2020-03-11 22:08:08 +00:00
|
|
|
%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 {
|
2019-08-05 21:36:24 +00:00
|
|
|
|
|
|
|
sub start() {
|
2020-03-13 01:05:15 +00:00
|
|
|
c64scr.print("spstart:")
|
|
|
|
print_stackpointer()
|
|
|
|
sub1()
|
|
|
|
c64scr.print("spend:")
|
|
|
|
print_stackpointer()
|
|
|
|
}
|
2020-03-11 22:08:08 +00:00
|
|
|
|
2020-03-13 01:05:15 +00:00
|
|
|
sub sub1() {
|
|
|
|
c64scr.print("sp1:")
|
|
|
|
print_stackpointer()
|
|
|
|
sub2()
|
|
|
|
}
|
2020-03-13 00:26:53 +00:00
|
|
|
|
2020-03-13 01:05:15 +00:00
|
|
|
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
|
2020-03-13 01:31:53 +00:00
|
|
|
sub3()
|
|
|
|
sub3()
|
|
|
|
sub3()
|
|
|
|
sub3()
|
|
|
|
sub3()
|
|
|
|
sub3()
|
|
|
|
sub3()
|
|
|
|
sub3()
|
|
|
|
sub3()
|
2020-03-13 01:05:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub sub3() {
|
|
|
|
c64scr.print("sp3:")
|
|
|
|
print_stackpointer()
|
|
|
|
}
|
2020-03-11 22:08:08 +00:00
|
|
|
|
2020-03-13 01:05:15 +00:00
|
|
|
sub print_stackpointer() {
|
|
|
|
c64scr.print_ub(X) ; prints stack pointer
|
|
|
|
c64.CHROUT('\n')
|
2019-08-24 14:21:05 +00:00
|
|
|
}
|
2020-03-13 01:05:15 +00:00
|
|
|
}
|