One of the possibilities is a stack failure. You havent said which device you use. So, if its one with a 2 level stack, the possibilities of stack failure increase. I usually avoid nesting GOSUBs beyond 4 calls since PBP needs around 4 calls to itself in different instructions. So, if you want to play safe, keep GOSUBs to the minimum.
A run away stack will drive you nuts for days on end. I've experienced this and its very hard to tell whats breaking the program flow. If your code is not very big, you could put it through MPSIM and monitor the stack level.
Just my thoughts
Bookmarks