mian.c中有一个函数
u32 add(u32 x,u32 y)
{
return x+x+y+y+x;
}
中断函数是
INTERRUPT_HANDLER(EXTI_PORTC_IRQHandler, 5)
{
u32 ii= add(323,424);}
查看这个代码的汇编文件,进入后,竟然对A寄存器额外操作
132 INTERRUPT_HANDLER(EXTI_PORTC_IRQHandler, 5)
133 {
\ EXTI_PORTC_IRQHandler:
\ _interrupt_7:
\ 000000 8A PUSH CC
\ 000001 84 POP A
\ 000002 A4BF AND A, #0xbf
\ 000004 88 PUSH A
\ 000005 86 POP CC
\ 000006 8D000000 CALLF L:?push_l0
\ 00000A 8D000000 CALLF L:?push_l1
134 /* In order to detect unexpected events during development,
135 it is recommended to set a breakpoint on the following instruction.
136
137
138 */
139 u32 ii= add(323,424);
\ 00000E AE01A8 LDW X, #0x1a8
\ 000011 BF00 LDW S:?w3, X
\ 000013 5F CLRW X
\ 000014 BF00 LDW S:?w2, X
\ 000016 AE0143 LDW X, #0x143
\ 000019 BF00 LDW S:?w1, X
\ 00001B 5F CLRW X
\ 00001C BF00 LDW S:?w0, X
\ 00001E 8D000000 CALLF add
140
141 }
\ 000022 8D000000 CALLF L:?pop_l1
\ 000026 8D000000 CALLF L:?pop_l0
\ 00002A 80 IRET |