
UM004001-COR1103 2–5
C-Compiler Overview INTERRUPT FUNCTIONS
INTERRUPT FUNCTIONS
Interrupt functions are declared by preceding their definition with #pragma interrupt.
Such functions should not take parameters or return a value. For example:
#include <zilog.h>
#include <z382.h>
volatile int gprtCount;
#pragma interrupt
void timer(void)
{
char cDummy;
cDummy = tcr;
cDummy = tmdr0l;
cDummy = tmdr0h;
gprtCount++;
}
The compiler generates the following prologue and epilogue code for interrupt functions:
.align 2
_timer:
ex af,af’
exall
.
.
.
exall
ex af,af’
ei
reti
Komentarze do niniejszej Instrukcji