fix in-place <= for bytes

This commit is contained in:
Irmen de Jong 2023-09-02 23:58:16 +02:00
parent 15c649024e
commit 1ce8fe06d5

View File

@ -813,10 +813,13 @@ internal class AugmentableAssignmentAsmGen(private val program: PtProgram,
"<=" -> { "<=" -> {
if(!signed) { if(!signed) {
asmgen.out(""" asmgen.out("""
tay cmp $variable
bcc +
beq +
lda #0 lda #0
ldy $variable beq ++
rol a""") + lda #1
+""")
} else { } else {
// see http://www.6502.org/tutorials/compare_beyond.html // see http://www.6502.org/tutorials/compare_beyond.html
asmgen.out(""" asmgen.out("""
@ -966,10 +969,13 @@ internal class AugmentableAssignmentAsmGen(private val program: PtProgram,
if(!signed) { if(!signed) {
TODO("swap operand order") TODO("swap operand order")
asmgen.out(""" asmgen.out("""
tay cmp $variable
bcc +
beq +
lda #0 lda #0
ldy $variable beq ++
rol a""") + lda #1
+""")
} else { } else {
TODO("swap operand order") TODO("swap operand order")
// see http://www.6502.org/tutorials/compare_beyond.html // see http://www.6502.org/tutorials/compare_beyond.html