Hi Charles,

With assembler interrupts, you have two options.

1. Write your entire interrupt handler in assembler.

2. Save all PBP system variables on entry, and restore all PBP system
variables on exit, from your interrupt handler.

With assembler interrupts, you can interrupt any PBP command in mid-stroke.
What this means is you exit from "any" command whether it's completed
execution or not.

Then when you enter your interrupt handler, and use BASIC commands, you
are again using PBP system variables.

If you over-write a single system variable that was being used at the time
the interrupt occured, then once you return to the interrupted BASIC library
routine, there's a good chance you have corrupted whatever system variables
were being used by the interrupted BASIC library function.

Your program goes haywire, and the rest is history.

Darrel posted several excellent interrupt routines. Take a peek at this thread
http://www.picbasic.co.uk/forum/showthread.php?t=3251

The .lst file generated at compile time gives you a full list of all system vars
you'll need to save/restore during an assembler interrupt.