prog8/examples/test.p8

35 lines
782 B
Plaintext
Raw Normal View History

%import textio
%import diskio
2020-12-22 12:29:16 +00:00
%import floats
%import graphics
%import test_stack
%zeropage basicsafe
2020-12-08 00:02:38 +00:00
%option no_sysinit
main {
2020-12-23 04:04:19 +00:00
sub vpoke(ubyte bank, uword address, ubyte value) {
2020-12-24 05:24:52 +00:00
%asm {{
rts
}}
2020-12-23 04:04:19 +00:00
}
asmsub vpokeasm(uword address @R0, ubyte bank @A, ubyte value @Y) {
2020-12-24 05:24:52 +00:00
%asm {{
rts
}}
2020-12-23 04:04:19 +00:00
}
sub start () {
txt.chrout('!')
2020-12-24 05:24:52 +00:00
ubyte bank = 1
uword address = 1000
ubyte value = 123
bank++
vpoke(bank, address, value)
vpokeasm(address, bank, value) ; TODO generates params on stack if expression is used such as lsb(bank). CHECK STACK UNWINDING!!!
; TODO also see if we can do this via R0-R15 temp registers rather than using the estack???
}
2020-08-27 17:47:50 +00:00
}