2024-09-22 19:41:41 +00:00
|
|
|
%import textio
|
2024-09-28 20:02:01 +00:00
|
|
|
%import string
|
|
|
|
%import compression
|
2024-09-29 21:18:51 +00:00
|
|
|
%import test_stack
|
2024-09-27 23:00:28 +00:00
|
|
|
%zeropage basicsafe
|
|
|
|
%option no_sysinit
|
2024-09-22 19:41:41 +00:00
|
|
|
|
2024-01-07 17:48:18 +00:00
|
|
|
main {
|
2024-08-24 12:34:23 +00:00
|
|
|
sub start() {
|
2024-09-29 21:18:51 +00:00
|
|
|
test_stack.test()
|
|
|
|
example(function1, 42)
|
|
|
|
example(function1, 99)
|
|
|
|
example(function2, 42)
|
|
|
|
example(function2, 99)
|
|
|
|
test_stack.test()
|
|
|
|
cx16.r0++
|
|
|
|
|
|
|
|
sub function1(ubyte arg) {
|
|
|
|
txt.print("function 1 arg=")
|
|
|
|
txt.print_ub(arg)
|
|
|
|
txt.nl()
|
2024-09-28 20:02:01 +00:00
|
|
|
}
|
|
|
|
|
2024-09-29 21:18:51 +00:00
|
|
|
sub function2(ubyte arg) {
|
|
|
|
txt.print("function 2 arg=")
|
|
|
|
txt.print_ub(arg)
|
2024-09-28 20:02:01 +00:00
|
|
|
txt.nl()
|
|
|
|
}
|
|
|
|
|
2024-09-29 21:18:51 +00:00
|
|
|
sub example(uword function, ubyte value) {
|
2024-09-28 20:02:01 +00:00
|
|
|
|
2024-09-29 21:18:51 +00:00
|
|
|
%asm {{
|
|
|
|
lda p8v_value
|
|
|
|
}}
|
2024-09-28 20:02:01 +00:00
|
|
|
|
2024-09-29 21:18:51 +00:00
|
|
|
call(function)
|
|
|
|
cx16.r1 = function+10
|
|
|
|
call(cx16.r1-10)
|
2024-09-28 20:02:01 +00:00
|
|
|
}
|
2024-07-21 11:35:28 +00:00
|
|
|
}
|
2024-09-14 21:17:26 +00:00
|
|
|
}
|
2024-09-28 20:02:01 +00:00
|
|
|
|