Positron Compiler Documentation

Typical format of the interrupt handler with enhanced 14-bit core devices.

Source: Positron8 Compiler User Manual, PDF page 467

As with standard 14-bit core interrupts, the interrupt handler subroutine must follow a fixed pattern.

tem variables and SFRs used. The microcontroller itself will save the contents of the STATUS, PCLATH, BSR, FSR0L\H, FSR1L\H and WREG registers.

rupt vector, therefore the same rules apply as outlined above concerning the establishment of the cause of the interrupt. Not forgetting to clear any interrupt flag that needs clearing before exiting the interrupt.

long as its corresponding Context Save command was used previously. This will restore any compiler system variables and SFRs, then exit the interrupt using the Retfie mnemonic.

Note that the STATUS, PCLATH, BSR, FSR0L\H, FSR1L\H and WREG registers will automatically be restored by the microcontroller once the interrupt is exited.

As with standard 14-bit core devices, any compiler variable or device SFR that is used by a command will be saved and restored as long as they reside within the Context Save and Context Restore commands. This is termed Managed Interrupts.

Note that the Context Save and Context Restore commands are not required unless managed interrupts are implemented, in which case use the Retfie mnemonic to exit the interrupt handler. However, you must be certain that the interrupt handler is not disturbing any compiler system variables or SFRs, or your program will not run correctly.