mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-09-29 03:56:15 +00:00
25 lines
382 B
NASM
25 lines
382 B
NASM
// Illustrates a problem where volatiles with initializers are initialized outside the main()-routine
|
|
.pc = $801 "Basic"
|
|
:BasicUpstart(__bbegin)
|
|
.pc = $80d "Program"
|
|
.label x = 2
|
|
__bbegin:
|
|
// x = 12
|
|
lda #$c
|
|
sta.z x
|
|
jsr main
|
|
rts
|
|
main: {
|
|
__b1:
|
|
// while(++x<50)
|
|
inc.z x
|
|
lda.z x
|
|
cmp #$32
|
|
bcc __b1
|
|
// x = 0
|
|
lda #0
|
|
sta.z x
|
|
// }
|
|
rts
|
|
}
|