Writing Interrupts in C
The C compiler takes care of everything
- Pushing/popping the right registers (PSW, ACC, etc.)
- Generating the RTI instruction
- No arguments/no return valuesunsigned int count;unsigned char second;void timer0 (void) interrupt 1 using 2 { if (++count == 4000) { second++; count = 0; }}
- Timer mode 2
- Reload value = 6