The program above will run for about 20 seconds and then it will stop working. Now, if I replaced the code in red "GOTO MAINLOOP" above by RETURN, then the code works just fine. Now, I understand that every GOSUB waits for a RETURN, but since I had the option "STACK OVERFLAW" disabled I thought that I could get away with it. Can somebody explains to me what is going on with this issue?

Thanks,

Robert

"No one is completely worthless. They can always serve as a bad example."

Re: GOTO vs RETURN after a GOSUB

Better question is why you would use GOSUB without RETURN? That just doesn't have any sense.
If stack is full then PBP can't call internal subroutines, and it crash...
You just disabled reset on overflow. That fuse doesn't expand stack to infinity and beyond.

Re: GOTO vs RETURN after a GOSUB

Originally Posted by pedja089

Better question is why you would use GOSUB without RETURN?

Yes, I'm asking myself the same question . Yes, your code looks better than mine. The program is probably overflowing the stack and halting like Dave said. Will the program restart from the beginning if the stack overflow is enabled?

"No one is completely worthless. They can always serve as a bad example."