Hi Henrik
I have used this technique quite a lot in my project. What you can do is just do a goto BOOTUP instead of a return to end the gosub.
Yes, you are thinking correct. The gosub has pushed something on the stack and it is still there. So what; The bootup code will re-push another value to another location of the stack when it is called again. Remember, the stack rolls over after the 8th level (specifically the 16F917 which I use)
You are just intending to go back to bootup and forget what happened before. So, the goto will work. Even other gosubs will not know about the goto unless you RETURN more than you GOSUB.
Jerson
Bookmarks