Microchip Technology SW006022-1N Data Sheet

Page of 338
MPLAB
®
 XC16 C Compiler User’s Guide
DS52071B-page 40
 2012 Microchip Technology Inc.
save(symbol-list) 
Save on entry and restore on exit the listed symbols (XC16)
irq(irqid) 
Specify the interrupt vector associated with this interrupt (XC16)
altirq(altirqid) 
Specify the alternate interrupt vector associated with this interrupt (XC16)
preprologue(asm) 
Specify assembly code to be executed before any compiler-generated interrupt code 
(XC16)
shadow 
Allow the ISR to utilise the shadow registers for context switching (XC16)
auto_psv 
The ISR will set the PSVPAG register and restore it on exit (XC16)
no_auto_psv 
The ISR will not set the PSVPAG register (XC16)
Use the native keywords discussed in the Differences section to look up information on 
the semantics of this specifier.
Some devices may not implement interrupts. Use of this qualifier for such devices will 
generate a warning. If the argument to the __interrupt specifier does not make 
sense for the target device, a warning or error will be issued by the compiler.
2.5.10.1
EXAMPLE
The following shows a function qualified using __interrupt.
__interrupt(low_priority) void getData(void) {
if (TMR0IE && TMR0IF) {
TMR0IF=0;
++tick_count;
}
}
2.5.10.2
DIFFERENCES
The 8-bit compilers have used the interrupt and low_priority qualifiers to indi-
cate this meaning for some devices. Interrupt routines were by default high priority.
The 16- and 32-bit compilers have used the interrupt attribute to define interrupt 
functions.