interrupt keyword

The __interrupt keyword is a synonym for interrupt, which is allowed when the -Ansi: Strict ANSI compiler option is present.

Note: Not all Backends support this keyword. See the Non-ANSI Keywords section in RS08 Backend.

One of two ways can be used to specify a function as an interrupt routine:

Use the nonstandard interrupt keyword like any other type qualifier. It specifies a function to be an interrupt routine. It is followed by a number specifying the entry in the interrupt vector that contains the address of the interrupt routine. If it is not followed by any number, the interrupt keyword has the same effect as the TRAP_PROC pragma. It specifies a function to be an interrupt routine. However, the number of the interrupt vector must be associated with the name of the interrupt function by using the Linker's VECTOR directive in the Linker parameter file.

Listing: Examples of the interrupt keyword
interrupt void f(); // OK   // same as #pragma TRAP_PROC, 
  // please set the entry number in the prm-file 
interrupt 2 int g(); 
// The 2nd entry (number 2) gets the address of func g(). 
interrupt 3 int g(); // OK 
// third entry in vector points to g() 
interrupt int l; // error: not a function