Reading the Status Reg (SR)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Reading the Status Reg (SR)

916 次查看
jimb2
Contributor I

I'm trying to read the status reg (SR) of the DSP56800E "8365" device but I always read I1 & I0 as 1 (intr masked).  I have a routine that operates on shared memory so I want to disable intr only if they are not already disabled by the calling function.  If I read the SR into Y0 reg, it always shows intr masked even after I explicitly execute a "bfclr #0x0300,SR" asm insn.  I've also looked at the SR reg that is stacked upon a function call and see the same thing.

 

The spec says those I1 & I0 bits are R/W and it doesn't show that should always read 1, so what am I doing wrong?

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

779 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

I think you can clear the I0/I1 bit of SR with the following code:

asm(bfclr #$0300, SR); //enable interrupt

you can set the I0/I1 bit in SR with the following code

asm(bfset #$0300, SR); //disable interrupt

if you want to jump based on the condition of SR, you can use the code Jcc or Bcc instruction.

BR

xiangjun Rong

0 项奖励
回复