interrupt (for the DSP56800)

Controls the compilation of object code for interrupt service routines (ISR).

Compatibility

This pragma is compatible with the DSP56800, but it is not compatible with the DSP56800E. For the DSP56800E, see interrupt (for the DSP56800E).

Syntax
#pragma interrupt [called|warn|saveall[warn]]
Remarks

The compiler generates a special prologue and epilogue for functions so that they may be used to handle interrupts. The contents of the epilogue and prologue vary depending on the mode selected.

The compiler also emits an RTI or RTS for the return statement depending upon the mode selected. The SA, R, and CC bits of the OMR register are set to system default.

There are several ways to use this pragma as described below:

In the following table, the advantages and disadvantages of the interrupt and interrupt saveall pragmas are listed.

Table 1. Comparision of Usage
Pragma Advantages Disadvantages
interrupt saveall
  • Entire context save
  • No need for #pragma interrupt called for called functions
Larger initial performance hit due to entire context save, but becomes advantageous for ISRs with several function calls
interrupt
  • Smaller context save, less performance hit
  • Generally good for ISRs with a small number of function calls
#pragma interrupt called required for all called functions