Programming the PIC Microcontroller with MBasic

We seen how timers and interrupts work in MBasic (Chapter 10) and learned a bit about assembler programming (Chapter 13) and how to mix assembler with MBasic (Chapter 14). It's time now to fuse these three strands into one writing an assembler interrupt service routine. We'll see that the assembler ISR has several advantages over its MBasic cousin; perhaps most importantly, it solves the latency problems we observed in Chapter 10. Its primary disadvantage is that it must be written solely in assembler. That's not to say that the assembler ISR can't communicate with the rest of the MBasic program because we'll see how to do exactly that but it does mean that we can't seamless alternate in-line assembler and MBasic code inside the ISR, as we were able to in Chapter 14.
Chapter 10 offers the following definition of an interrupt:
An interrupt is an event that causes the current program sequence to temporarily halt, and for different code, called an "interrupt service routine" or ISR, to be executed. When the ISR is completed, program flow returns to the point it was at before the interrupt occurred. You might think of an ISR as a subroutine that is called not by software, but rather an event. The event may be an external, such as an input pin changing state from a 0 to a 1, or vice versa. Or, the event may be internal to the PIC, such as a timer reaching a defined count. It may even be a combination of...