1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-29 03:56:15 +00:00
kickc/src/test/ref/loop-while-continue.asm

30 lines
605 B
NASM
Raw Normal View History

// Tests break statement in a simple loop
// Commodore 64 PRG executable file
.file [name="loop-while-continue.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.label SCREEN = $400
.segment Code
main: {
ldx #0
__b1:
2020-02-23 08:44:36 +00:00
// while(++i<40*6)
inx
cpx #$28*6
bcc __b2
2020-02-23 08:44:36 +00:00
// }
rts
__b2:
2020-02-23 08:44:36 +00:00
// if(SCREEN[i]==' ')
lda SCREEN,x
cmp #' '
beq __b1
2020-02-23 08:44:36 +00:00
// SCREEN[i]++;
inc SCREEN,x
jmp __b1
}