Hi, I have the following code,

Code:
MainLoop:

'DO SOME STUFF HERE.....

    FOR J = 0 TO 7
        GOSUB SearchForClockSignal
    NEXT J

goto MainLoop

SearchForClockSignal:

    USBSERVICE
    SERIN2 PORTE.3, 32, 3, CLOCKSEARCHFAILED, [wait(252), STR RFID_IN\6]
    USBSERVICE 

    IF RFID_IN[0] = 252 THEN GOTO MAINLOOP  

    SquaresArray[0] = 255
    SquaresArray[1] = 202                       
    SquaresArray[2] = RFID_IN[0]                        
    SquaresArray[3] = RFID_IN[1]  
    SquaresArray[4] = RFID_IN[2]                        
    SquaresArray[5] = RFID_IN[3]
    SquaresArray[6] = RFID_IN[4]                        
    SquaresArray[7] = RFID_IN[5] 
    
    if PPB_DeviceState = 32 then   'ONLY WHEN THERE IS A USB CONNECTION PRESENT     
        GOSUB SendUSBData
    endif
    
    GOTO MAINLOOP   'CLOCK SERIAL COMMUNICATION WAS RECEIVED
    
CLOCKSEARCHFAILED:

RETURN
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