2020-09-20 21:49:36 +00:00
|
|
|
%import textio
|
2020-12-22 02:35:00 +00:00
|
|
|
%import diskio
|
2020-12-22 12:29:16 +00:00
|
|
|
%import floats
|
|
|
|
%import graphics
|
2020-11-20 21:15:14 +00:00
|
|
|
%import test_stack
|
2020-12-22 23:54:11 +00:00
|
|
|
%zeropage basicsafe
|
2020-12-08 00:02:38 +00:00
|
|
|
%option no_sysinit
|
|
|
|
|
2020-12-08 21:54:20 +00:00
|
|
|
main {
|
2020-12-21 23:59:07 +00:00
|
|
|
|
2020-12-23 22:23:16 +00:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2020-12-22 04:43:02 +00:00
|
|
|
sub start () {
|
2020-12-24 04:46:57 +00:00
|
|
|
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()
|
2020-12-24 06:12:59 +00:00
|
|
|
; TODO also see if we can do this via R0-R15 temp registers rather than using the estack???
|
2020-12-03 17:39:32 +00:00
|
|
|
}
|
2020-08-27 17:47:50 +00:00
|
|
|
}
|