11.6. Support for Non-Local goto's.   

We saw that a call and a return from a procedure is not just a CALL and RET instruction since data frames must be manipulated. Similarly non-local goto's are not just JUMP instructions to the appropriate place in memory.

A goto which crosses only block boundaries must ensure that

the top of the stack register is set correctly i.e. as it
should be for the destination block.

A goto which crosses procedure boundaries must reset all relevant information. i.e. Consider recursive call:

procedure fish(i:integer);
begin
if
i<10 then fish(i+1)
else goto 666; /* 666 in MAIN */
end

GOTO must trace down the stack to find all relevant pointers and reset them. Must make its way down to correct level.


GOTO 666:
where does it end up? At top level or base level?