prog8/examples/test.p8

43 lines
833 B
Plaintext
Raw Normal View History

%import textio
%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
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-29 21:18:51 +00:00
sub function2(ubyte arg) {
txt.print("function 2 arg=")
txt.print_ub(arg)
txt.nl()
}
2024-09-29 21:18:51 +00:00
sub example(uword function, ubyte value) {
2024-09-29 21:18:51 +00:00
%asm {{
lda p8v_value
}}
2024-09-29 21:18:51 +00:00
call(function)
cx16.r1 = function+10
call(cx16.r1-10)
}
2024-07-21 11:35:28 +00:00
}
}