I found that my interrupt routine has strange
source code is:
void t3Isr(void) interrupt 3 using 0 { tm_flg |= (tm_sts ++ ^ tm_sts) & 0x7; }
the compiler give me: 5: void t3Isr(void) interrupt 3 using 0 { C:0x0003 C0E0 PUSH ACC(0xE0) C:0x0005 C0D0 PUSH PSW(0xD0) C:0x0007 75D000 MOV PSW(0xD0),#0x00
6: tm_flg |= (tm_sts ++ ^ tm_sts) & 0x7; C:0x000A AF08 MOV R7,tm_sts(0x08) C:0x000C 0508 INC tm_sts(0x08) C:0x000E E508 MOV A,tm_sts(0x08) C:0x0010 6F XRL A,R7 C:0x0011 5407 ANL A,#0x07 C:0x0013 4209 ORL tm_flg(0x09),A
7: }
8: C:0x0015 D0D0 POP PSW(0xD0) C:0x0017 D0E0 POP ACC(0xE0) C:0x0019 32 RETI
the question is how to save R7 that the compiler uses ?
James is right on with his answer.
Never 'using 0'. This give the compiler/linker permission to overwrite the register bank 0. Register bank 0 is the default register bank and it is not necessary to define 'using 0'.
Please review the documentation for the 'using' command.
Bradford