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

3.9.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 a RETI instruction to return from the interrupt. To write an interrupt handler for the non-maskable interrupt, which needs a RETN instruction instead, add the critical keyword:

void nmi_isr (void) critical interrupt 
{  
    ...  
}
However if you need to create a non-interruptable interrupt service routine you would also require the critical keyword. To distinguish between this and an nmi_isr you must provide an interrupt number.




2008-12-05