This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Change register before stack operation in Interrupt

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

Parents Reply Children