Hi,
Use a flag, when you receive your 'R' command you set the flag and then RETURN. Check the flag and GOTO SearchPoint if set. In SearchPoint clear the flag.
Perhaps something like this:
It'll add a couple of instruction cycles but I'm pretty sure it'll be fast enough, give it a try.Code:Abort VAR BIT Main: '...do whatever.... GOSUB SendThis If Abort = 1 THEN SearchPoint SearchPoint: Abort = 0 'Clear flag '...do whatever... Goto Main SendThis: 'Sends the next TxChar, increments CheckSum, looks for "R" command hserout [txchar] checksum = checksum + txchar hserin 0, norxdata, [rxchar] 'note - 0 is a valid timeout - yeah! if rxchar = "R" then Abort = 1 ' Set flag to indicate receives reset command 'Reset & back to the SearchPoint to look for the next GO command. 'Does this structure have a stack corruption problem? RETURN not executed. 'R should work within a character time. NoRxData: return
/Henrik.




Bookmarks