From 1ce8fe06d59e9cb0f5053f7715e93cdeab4f99c3 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sat, 2 Sep 2023 23:58:16 +0200 Subject: [PATCH] fix in-place <= for bytes --- .../assignment/AugmentableAssignmentAsmGen.kt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt index 3e43feec4..cb0424a9d 100644 --- a/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt +++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt @@ -813,10 +813,13 @@ internal class AugmentableAssignmentAsmGen(private val program: PtProgram, "<=" -> { if(!signed) { asmgen.out(""" - tay + cmp $variable + bcc + + beq + lda #0 - ldy $variable - rol a""") + beq ++ ++ lda #1 ++""") } else { // see http://www.6502.org/tutorials/compare_beyond.html asmgen.out(""" @@ -966,10 +969,13 @@ internal class AugmentableAssignmentAsmGen(private val program: PtProgram, if(!signed) { TODO("swap operand order") asmgen.out(""" - tay + cmp $variable + bcc + + beq + lda #0 - ldy $variable - rol a""") + beq ++ ++ lda #1 ++""") } else { TODO("swap operand order") // see http://www.6502.org/tutorials/compare_beyond.html