next up previous contents index
Next: 3.9 Enabling and Disabling Up: 3.8 Interrupt Service Routines Previous: 3.8.3 HC08 Interrupt Service   Contents   Index

3.8.4 Z80 Interrupt Service Routines

The Z80 uses several different methods for determining the correct interrupt vector depending on the hardware implementation. Therefore, SDCC ignores the optional interrupt number and does not attempt to generate an interrupt vector table.

By default, SDCC generates code for a maskable interrupt, which uses an RETI instruction to return from the interrupt. To write an interrupt handler for the non-maskable interrupt, which needs an RETN instruction instead, add the critical keyword:

void nmi_isr (void) critical interrupt 
{  
    ...  
}



Erik Petrich 2005-09-07