This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6678 中断,汇编中断服务程序



你好:

   我首先新建了一个工程,在工程里添加了三个文件,分别为:link.cmd  ,boot.asm ,main.asm。link.cmd  里的内容如下:

--entry.point=RESET_RST

MEMORY

{

CEO:  o=0X80000000   l=0x10000000

L2SRAM:o=0X00800000 l=0x0000fc00

}

SECTIONS

{

.myboot     >  L2SRAM

.my program >L2SRAM

.cinit >L2SRAM

.pinit >L2SRAM

.text  >L2SRAM

.stack >L2SRAM

.bss >L2SRAM

.const >L2SRAM

.date >L2SRAM

.far >L2SRAM

.swith>L2SRAM

.sysmem >L2SRAM

.stack >L2SRAM

.tables >L2SRAM

.cio >L2SRAM

}

boot.asm 的内容如下:

.sect   ".myboot"

.ref    start

.global RESET_RST

RESET_RST:

MVKL .S2   start ,B3

MVKH .S2   start ,B3

B .S2  B3                ;跳转的main

NOP

NOP

...(多个NOP)

RESV1:(多个NOP)

RESV2:(多个NOP)

..........:

INT15:(多个NOP)

mian.asm 的内容如下:

.sect   ".myprogram"

.global start

start:

.......(给A0~A15,B0~B15写0)

MVC TSR ,B0

OR B0,0x00000001,B0

MVC B0,TSR                  ;给TSR.GIE 写1

MVC.S2 CSR,B9

OR.S2 B9,0X00000001,B9

MVC.S2 B9,CSR          ; 给CSR.GIE 写1

MVKL 0X00000203,B1

MVC B1,IER                   ;使能9号中断

MVKL 0X00000200,B1

MVC B1,ISR                   ;设置9号中断

NOP 2                             ;这里应该开始跳转到IST

MVC IFR,B4

NOP 5

所有程序都在这里,可以成功生成.out 文件,当我选择 C6678 Device Funtional simulator ,little Endian ,加载.out 文件时,可以正常跳转到9号中断,但当我选择Blackhawk xds560v2-USB mezzanine emulator 时,连接上C6678板子,加载.out文件时,则始终不能跳转到9号中断,不知道为什么?TSR.INT 位始终为0,如能指点一二,不甚感激!