1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-29 03:56:15 +00:00
kickc/src/test/ref/init-volatiles.asm
2020-02-23 09:44:36 +01:00

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
}