1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-10-21 17:24:39 +00:00
kickc/src/test/ref/function-pointer-noarg-call-7.asm

42 lines
518 B
NASM

// Tests calling into a function pointer with local variables
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
.label SCREEN = $400
.label idx = 3
bbegin:
lda #0
sta idx
jsr main
rts
main: {
jsr do10
rts
}
do10: {
.label i = 2
lda #0
sta i
b1:
jsr hello
inc i
lda #$a
cmp i
bne b1
rts
}
hello: {
ldx #0
b1:
lda msg,x
ldy idx
sta SCREEN,y
inc idx
inx
lda msg,x
cmp #'@'
bne b1
rts
}
msg: .text "hello @"