Quit a program cleanly

Page 4/4
1 | 2 | 3 |

Par aoineko

Master (167)

Portrait de aoineko

08-01-2021, 21:36

I probably misspoke.
When I go back to Basic everything looks normal.
I can enter commands like Files and start other programs.
What is broken is the Basic program I started my game with.
It's just a:

10 print "loading..."
20 bload "file.bin",r

But when I go back to Basic after quitting my game and I do List, it is the program that is listed that is broken.

Par DamnedAngel

Master (233)

Portrait de DamnedAngel

08-01-2021, 23:32

Ouch... Either you are messing up with basic area (&h8000) or with the high RAM indeed.

If you mess the stack pointer up you could get such thing, mainly if it is near HIMEM. Can you debug your program and see that, just before your last ret, SP(end) = SP(start) - 2? If it is not, you got yourself a corrupt SP.

Page 4/4
1 | 2 | 3 |