2019-04-07 09:08:39 +00:00
|
|
|
// Tests calling into a function pointer which modifies global volatile
|
|
|
|
.pc = $801 "Basic"
|
|
|
|
:BasicUpstart(bbegin)
|
|
|
|
.pc = $80d "Program"
|
|
|
|
.label SCREEN = $400
|
|
|
|
.label idx = 2
|
|
|
|
bbegin:
|
|
|
|
lda #0
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z idx
|
2019-04-07 09:08:39 +00:00
|
|
|
jsr main
|
|
|
|
rts
|
|
|
|
main: {
|
|
|
|
jsr fn1
|
|
|
|
lda #'a'
|
2019-08-07 19:00:19 +00:00
|
|
|
ldy.z idx
|
2019-04-07 09:08:39 +00:00
|
|
|
sta SCREEN,y
|
|
|
|
jsr fn1
|
|
|
|
lda #'a'
|
2019-08-07 19:00:19 +00:00
|
|
|
ldy.z idx
|
2019-04-07 09:08:39 +00:00
|
|
|
sta SCREEN,y
|
|
|
|
rts
|
|
|
|
}
|
|
|
|
fn1: {
|
2019-08-07 19:00:19 +00:00
|
|
|
inc.z idx
|
2019-04-07 09:08:39 +00:00
|
|
|
rts
|
|
|
|
}
|