prog8/examples/test.p8

39 lines
871 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-25 01:59:19 +00:00
uword bank = 1
2020-12-24 05:24:52 +00:00
uword address = 1000
ubyte value = 123
bank++
2020-12-25 01:59:19 +00:00
test_stack.test()
vpoke(lsb(bank), address, value)
test_stack.test()
vpokeasm(address, lsb(bank), value) ; TODO generates params on stack if expression is used such as lsb(bank). CHECK STACK UNWINDING!!!
test_stack.test()
; 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
}