Hi,
Resetting the PIC via another pin seems technically possible. But I would like to know some example conditions which demands that a GOSUB be cancelled. I sometimes use sbroutines which may be called from other subroutines or just be executed themselve. I just use a software flag (accordingly set before a GOSUB or a GOTO) which decides how to end that routine by a return or a GOTO.
The stack pointer is not readable or writable. And three is no reference for a user initiated PUSH or POP on the mid range manual (I hope I have not skipped anything)
On a 18F you can push/pop it you. For reset it can be automatic when you mess up your stack, or by a RESET instruction.
Jersons technic is good as you will not be using the already pushed stack anyway and keep on pushing as if it were empty.
Bookmarks