At the start of the interrupt operation, I would like to change some register value before push the registers to the stack.
For example,
void test(void) interrupt 7 { CLKSEL = 0x02; ... }
is compiled to the file as follows with the current setting;
; FUNCTION test (BEGIN) 0000 C0E0 PUSH ACC 0002 C0F0 PUSH B 0004 C083 PUSH DPH 0006 C082 PUSH DPL 0008 C0D0 PUSH PSW 000A 75D000 MOV PSW,#00H 000D C000 PUSH AR0 000F C001 PUSH AR1 0011 C002 PUSH AR2 0013 C003 PUSH AR3 0015 C004 PUSH AR4 0017 C005 PUSH AR5 0019 C006 PUSH AR6 001B C007 PUSH AR7
001D 75A902 MOV CLKSEL,#02H
Can I get the file as follows? ;
; FUNCTION test (BEGIN)
00xx 75A902 MOV CLKSEL,#02H
0000 C0E0 PUSH ACC 0002 C0F0 PUSH B 0004 C083 PUSH DPH 0006 C082 PUSH DPL 0008 C0D0 PUSH PSW 000A 75D000 MOV PSW,#00H 000D C000 PUSH AR0 000F C001 PUSH AR1 0011 C002 PUSH AR2 0013 C003 PUSH AR3 0015 C004 PUSH AR4 0017 C005 PUSH AR5 0019 C006 PUSH AR6 001B C007 PUSH AR7
Thanks, Hiroto
this will tell the compiler to use resister bank 1 for this interrupt. Then it will not push anything on the stack not correct
correct: then it will not push R0-R7 on the stack, but will push the PSW and, if needed acc, b, dph and dpl
Erik