I had similar ideas, but give up on them. I use something like this:
Code:
Gosub xx : If err=1 then goto yy
XX:
if something to triger going to err sub then
err=1 ' goto in different sub after retun
else
err=0 ' return and continue normally
endif
But if you must have gosub, without return, you can look up in datasheet of PIC, POP command. It should pop up stack, and free one space.

Originally Posted by
Datasheet
The TOS value is pulled off the return
stack and is discarded. The TOS value
then becomes the previous value that
was pushed onto the return stack.
This instruction is provided to enable
the user to properly manage the return
stack to incorporate a software stack
If I understand POP and PUSH commands, you could do something like this
If err=1 THEN
@ POP
GOTO ErrHandler
ENDIF
Bookmarks