fix typecast error when assigning pointer to long

This commit is contained in:
Irmen de Jong
2025-10-12 12:40:35 +02:00
parent a84320c7e2
commit 6db3611d93
5 changed files with 14 additions and 10 deletions

View File

@@ -3127,6 +3127,14 @@ $endLabel""")
RegisterOrPair.XY -> asmgen.out(" stx $targetAsmVarName | sty $targetAsmVarName+1")
else -> throw AssemblyError("non-word regs")
}
} else if(targetDt.isLong) {
when(regs) {
RegisterOrPair.AX -> asmgen.out(" sta $targetAsmVarName | stx $targetAsmVarName+1")
RegisterOrPair.AY -> asmgen.out(" sta $targetAsmVarName | sty $targetAsmVarName+1")
RegisterOrPair.XY -> asmgen.out(" stx $targetAsmVarName | sty $targetAsmVarName+1")
else -> throw AssemblyError("non-word regs")
}
asmgen.out(" lda #0 | sta $targetAsmVarName+2 | sta $targetAsmVarName+3")
} else {
throw AssemblyError("cannot assign pointer to $targetDt")
}