Posted June 16, 2024 by syntaxerrorsoftware
Hi all, I've added some bug fixes and optimizations to Pas6502. If a conditional statement only has one logic part, like "if a = 3 then" it will produce a new fragment with "_l1" at the end of the file name. The "_l1" part represents the false label to jump to in the fragment code.
The compiler will expect a branch to a true part and a jmp to the false label {l1} in the fragment, and won't require leaving $ff or $00 in the accumulator as a true/false result anymore.
For example the fragment example below would change from:
lda {m1} + 1
cmp #>{c1}
bcc !isTrue+ // msb <
lda {m1} + 0
cmp #{c1}
beq !isTrue+
bcc !isTrue+
lda #$00
jmp !+
!isTrue:
lda #$ff
!:
to
lda {m1} + 1
cmp #>{c1}
bcc !isTrue+ // msb <
lda {m1} + 0
cmp #{c1}
beq !isTrue+
bcc !isTrue+
jmp {l1}
!isTrue: