2019-05-23 15:50:44 +00:00
|
|
|
// Tests statement sequence generation
|
|
|
|
.pc = $801 "Basic"
|
|
|
|
:BasicUpstart(main)
|
|
|
|
.pc = $80d "Program"
|
|
|
|
main: {
|
|
|
|
.label SCREEN = $400
|
|
|
|
ldy #0
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2020-02-23 08:44:36 +00:00
|
|
|
// c = i+5
|
2019-05-23 15:50:44 +00:00
|
|
|
tya
|
|
|
|
tax
|
|
|
|
axs #-[5]
|
2020-02-23 08:44:36 +00:00
|
|
|
// i&1
|
2019-05-23 15:50:44 +00:00
|
|
|
tya
|
|
|
|
and #1
|
2020-02-23 08:44:36 +00:00
|
|
|
// if((i&1)==0 || i>5)
|
2019-05-23 15:50:44 +00:00
|
|
|
cmp #0
|
2019-09-29 21:13:37 +00:00
|
|
|
beq __b3
|
2019-05-23 15:50:44 +00:00
|
|
|
cpy #5+1
|
2019-09-29 21:13:37 +00:00
|
|
|
bcc __b2
|
|
|
|
__b3:
|
2020-02-23 08:44:36 +00:00
|
|
|
// c++;
|
2019-05-23 15:50:44 +00:00
|
|
|
inx
|
2019-09-29 21:13:37 +00:00
|
|
|
__b2:
|
2020-02-23 08:44:36 +00:00
|
|
|
// SCREEN[i] = c
|
2019-05-23 15:50:44 +00:00
|
|
|
txa
|
|
|
|
sta SCREEN,y
|
2020-02-23 08:44:36 +00:00
|
|
|
// for(byte i: 0..10)
|
2019-05-23 15:50:44 +00:00
|
|
|
iny
|
|
|
|
cpy #$b
|
2019-09-29 21:13:37 +00:00
|
|
|
bne __b1
|
2020-02-23 08:44:36 +00:00
|
|
|
// }
|
2019-05-23 15:50:44 +00:00
|
|
|
rts
|
|
|
|
}
|