prog8/examples/test.p8

50 lines
812 B
Plaintext
Raw Normal View History

%import c64flt
2019-08-17 23:39:48 +00:00
%zeropage basicsafe
2019-08-09 00:15:31 +00:00
2019-08-07 00:02:34 +00:00
main {
sub start() {
c64scr.print("spstart:")
print_stackpointer()
sub1()
c64scr.print("spend:")
print_stackpointer()
}
sub sub1() {
c64scr.print("sp1:")
print_stackpointer()
sub2()
}
sub sub2() {
c64scr.print("sp2:")
print_stackpointer()
exit(65)
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
}
sub sub3() {
c64scr.print("sp3:")
print_stackpointer()
}
sub print_stackpointer() {
%asm {{
tsx
}}
c64scr.print_ub(X) ; prints stack pointer
c64.CHROUT('\n')
2019-08-24 14:21:05 +00:00
}
}