| ??? 07/15/02 10:57 Read: times |
#25805 - RE: PCON |
Because you are mixing 'C' and assembler it is possible that your irq handler is overwriting a register used by the compiler. I cannot comment for other compilers but in Keil you can use 'C' functions to handle interrupts, eg:
void tim2_irq(void) interrupt 6 using 1 { TF2=0; counter++; } Which will associate the timer 2 interrupt vector with the above function. Specifying 'using 1' will make the compiler reserve register bank 1 for the irq handler which may reduce the number of registers that need to be pushed and popped. Irrespective of whether you specify the 'using' directive the compiler will push/pop whatever registers are necessary and end the function with an iret. |
| Topic | Author | Date |
| PCON | 01/01/70 00:00 | |
| RE: PCON | 01/01/70 00:00 | |
RE: PCON | 01/01/70 00:00 |



