中断在c语言里面有两种方式表达:
(1)
interrupt void RTI_ISR(void)
{
......
}
// same as #pragma TRAP_PROC,
// set the entry number in the prm-file
这种方式定义了中断的结构,实际的向量地址在prm文件中定义
(2)
void interrupt 7 RTI_ISR(void)
{
.......
}
The 7th entry (number 2) gets the address of func g().
这种方式直接定义向量的向量号,这种定义需要明确指定向量号,而中断向量好是(中断向量地址-IVBR)/2,通过数据手册可以查,
比如9s12xdp512在
1.6 Resets and Interrupts(MC9S12XDP512 Data Sheet, Rev. 2.21 p72)