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()
|
|
|
|
exit(65)
|
2020-03-13 01:21:37 +00:00
|
|
|
sub3() ; TODO remove the code in optimizer
|
|
|
|
sub3() ; TODO remove the code in optimizer
|
|
|
|
sub3() ; TODO remove the code in optimizer
|
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() {
|
|
|
|
%asm {{
|
|
|
|
tsx
|
|
|
|
}}
|
|
|
|
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
|
|
|
}
|