11 //two functions that use the same registers (but should be in different banks)
13 unsigned char calculate(unsigned char v1
,unsigned char v2
)
16 TF2
= 1; //trigger the interrupt
22 unsigned char calculateISR(unsigned char v1
,unsigned char v2
) __using(1)
25 TF2
= 0; //clear the interrupt
34 void T2_isr(void) __interrupt(5) __using(1)
36 r1
= calculateISR(4,40);
38 //sdcc eliminates mov psw,0x080
39 //which is necessary to ensure that calculateISR uses registers from bank 1 to not
40 //corrupt calculate in main loop
46 #if 0 //defined(__SDCC_mcs51) && defined(__SDCC_STACK_AUTO) // TODO:remove STACK_AUTO CONDITION when division support routine becomes reentrant or sdcc optimizes out the call.
47 TF2
= 0; //clear timer 2 interrupt
48 ET2
= 1; //enable timer 2 interrupt
49 EA
= 1; //enable interrupts