Some compiler fun. I've compiled the same code with Wolin, cc65 and vbcc:
Wolin:
C (generated by Wolin C frontend
)
Code:
do {
(*(unsigned char *)(53280))++;
} while ( (*(unsigned char *)(53280)) < 255);
cc65:
Code:
L0015: ldx #$00
lda $D020
inc $D020
ldx #$00
lda $D020
cmp #$FF
jsr boolult
jne L0015
I wonder if I can make my bool operations any smarter and use V/C/N flags somehow (and obviously win brevity competition)... But I do like the way it works now - by storing the final bool result of an operation in SP reg. MAYBE instead of storing it at SP,x I just pretend I "stored" it at 6502 V/C/N?
You compiled the CC65 example without optimizations, here I get (using "cc65 -Osir test.c":