完整版本請見http://www.51qianru.cn/bbs/
*------------------------------------------------------------------------------
* Global symbols referenced in this file but defined somewhere else.
* Remember that your interrupt service routines need to be referenced here.
*------------------------------------------------------------------------------
.ref _c_int00 ;reset ISR(復位中斷設置寄存), .ref表明一個或多個在另一個模塊中定義而在前模塊中要用到的符號
*------------------------------------------------------------------------------
* This is a macro that instantiates one entry in the interrupt service table.
*------------------------------------------------------------------------------
VEC_ENTRY .macro addr ;中斷返回函數
STW B0,*--B15
MVKL addr,B0
MVKH addr,B0
B B0
LDW *B15++,B0
NOP 2
NOP
NOP
.endm
*------------------------------------------------------------------------------
* This is a dummy interrupt service routine used to initialize the IST.
*------------------------------------------------------------------------------
_vec_dummy: ;初始化IST寄存器(中斷向量表起始地址寄存器,用于設置中斷服務程序存放的地址)
B B3
NOP 5
*------------------------------------------------------------------------------
* This is the actual interrupt service table (IST). It is properly aligned and
* is located in the subsection .text:vecs. This means if you don't explicitly
* specify this section in your linker command file, it will default and link
* into the .text section. Remember to set the ISTP(中斷向量表起始地址寄存器) register to point to this
* table.
*------------------------------------------------------------------------------
.sect ".vecs" ;定義初始化帶名稱的段
.align 1024 ;分配程序頁
完整版本請見http://www.51qianru.cn/bbs/
*------------------------------------------------------------------------------
* Global symbols referenced in this file but defined somewhere else.
* Remember that your interrupt service routines need to be referenced here.
*------------------------------------------------------------------------------
.ref _c_int00 ;reset ISR(復位中斷設置寄存), .ref表明一個或多個在另一個模塊中定義而在前模塊中要用到的符號
*------------------------------------------------------------------------------
* This is a macro that instantiates one entry in the interrupt service table.
*------------------------------------------------------------------------------
VEC_ENTRY .macro addr ;中斷返回函數
STW B0,*--B15
MVKL addr,B0
MVKH addr,B0
B B0
LDW *B15++,B0
NOP 2
NOP
NOP
.endm
*------------------------------------------------------------------------------
* This is a dummy interrupt service routine used to initialize the IST.
*------------------------------------------------------------------------------
_vec_dummy: ;初始化IST寄存器(中斷向量表起始地址寄存器,用于設置中斷服務程序存放的地址)
B B3
NOP 5
*------------------------------------------------------------------------------
* This is the actual interrupt service table (IST). It is properly aligned and
* is located in the subsection .text:vecs. This means if you don't explicitly
* specify this section in your linker command file, it will default and link
* into the .text section. Remember to set the ISTP(中斷向量表起始地址寄存器) register to point to this
* table.
*------------------------------------------------------------------------------
.sect ".vecs" ;定義初始化帶名稱的段
.align 1024 ;分配程序頁