prog8/examples/test.p8

27 lines
394 B
Plaintext
Raw Normal View History

%import textio
%option no_sysinit
2023-01-22 16:10:36 +00:00
%zeropage basicsafe
2022-11-29 19:09:10 +00:00
main {
sub start() {
2023-01-22 16:10:36 +00:00
ubyte @shared ub = asmfoo(42)
ub = normalfoo(42)
somelabel:
ub++
txt.print_ub(ub)
}
2023-01-22 16:10:36 +00:00
asmsub asmfoo(ubyte arg @Y) -> ubyte @Y {
%asm {{
iny
rts
}}
}
2023-01-22 16:10:36 +00:00
sub normalfoo(ubyte arg) -> ubyte {
arg++
return 42
}
}