fix 65c02 codegen for certain in-place byte bitwise invert

This commit is contained in:
Irmen de Jong
2024-01-31 23:54:22 +01:00
parent 932035cdc5
commit 9f8e61789a
2 changed files with 2 additions and 5 deletions

View File

@@ -4061,9 +4061,9 @@ internal class AssignmentAsmGen(private val program: PtProgram,
sta $addr""") sta $addr""")
} }
is PtIdentifier -> { is PtIdentifier -> {
val sourceName = asmgen.loadByteFromPointerIntoA(memory.address as PtIdentifier) asmgen.loadByteFromPointerIntoA(memory.address as PtIdentifier)
asmgen.out(" eor #255") asmgen.out(" eor #255")
asmgen.out(" sta ($sourceName),y") asmgen.storeAIntoPointerVar(memory.address as PtIdentifier)
} }
else -> { else -> {
asmgen.assignExpressionToVariable(memory.address, "P8ZP_SCRATCH_W2", DataType.UWORD) asmgen.assignExpressionToVariable(memory.address, "P8ZP_SCRATCH_W2", DataType.UWORD)

View File

@@ -1,9 +1,6 @@
TODO TODO
==== ====
fix "return <stmt>" not being an error.
maze: if cell & UP!=0 and @(celladdr(cx,cy-1)) & (WALKED|BACKTRACKED) ==0 maze: if cell & UP!=0 and @(celladdr(cx,cy-1)) & (WALKED|BACKTRACKED) ==0
^^ adding this !=0 caused a weird beq + / lda #1 / + to appear in front of the shortcircuit beq... ^^ adding this !=0 caused a weird beq + / lda #1 / + to appear in front of the shortcircuit beq...