Hi Darrel,
Thanks for explaining further - I think the idea has finally got through my thick skull.
This must be why my programs keep working - once interrupted, everything the progam was doing is dropped, and the code never has to return back to before the interrupt, so the stray return addresses piling up on the stack just get overwritten when there are new GOSUBs or CALLs.It all boils down to the one statement in the manual that seems so innocuous.
All previous return addresses will be lost in this case.
As long as you never want to go back to the sections of code that got interrupted, then the stack simply wraps around, and only NEW gosubs past that point will be returned to. That's not something that any of my programs would be able to tolerate.
I'll have to keep this issue in mind if my code ever gets more complex! The PBP manual really should mention something about the potential stack problems with RESUME(label).
Thanks again,
Arch
Bookmarks