Stack pops?

Started by Tom Becker August 10, 2004
If, while deep into a nest of Calls, I need to abend and return to
several levels up - skipping the intermediary Calls - can I, in essence,
pop the BasicX stack myself? Tom
Tom Becker
--... ...--
www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700



--- In , "Tom Becker" <gtbecker@r...> wrote:
> If, while deep into a nest of Calls, I need to abend and return to
> several levels up - skipping the intermediary Calls - can I, in
> essence, pop the BasicX stack myself?

You'll need to restore a "context" which includes (at a minimum) a
frame pointer, a stack pointer and an instruction pointer.

With a little experimentation, you could probably discover where the
frame pointer and return address are stored on the stack during a
call. With this information it might be possible to create a pair of
functions similar to setjmp/longjmp in C.

For those who may not know, a frame pointer provides the reference
for local variables.