prog8/examples/test.p8

47 lines
855 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()
2020-03-13 01:44:01 +00:00
return
sub3() ; TODO warning about unreachable code
sub3() ; TODO remove statements after a return
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
sub3()
}
sub sub3() {
c64scr.print("sp3:")
print_stackpointer()
}
sub print_stackpointer() {
c64scr.print_ub(X) ; prints stack pointer
c64.CHROUT('\n')
2019-08-24 14:21:05 +00:00
}
}