Using the TRAP_PROC Pragma

The TRAP_PROC pragma informs the compiler that the following function is an interrupt function (refer the following listing). In that case, the compiler should terminate the function by a special interrupt return sequence (for many processors, an RTI instead of an RTS).

Listing: Example of Using the TRAP_PROC Pragma


#pragma TRAP_PROC
void INCcount(void) {

  tcount++;

}