2013-07-23 61 views
0

在的Nios 2與Altera DE2 FPGA,我研究了中斷爲什麼我需要遮罩指令?

在異常下面的代碼:檢查是否陷阱或中斷

exc_hand: 
rdctl et,estatus # read estatus 
andi et,et,1 # mask EPIE, bit 0 
beq et,r0,noint # om EPIE == 0: no interrupt 
rdctl et,ipending # read ipending 
beq et,r0,noint # if ipending == 0: no interrupt 
int_check: # if we reach this then there aws an interrupt 
subi ea,ea,4 # adjust exception return address 

我可以理解,第一說明什麼面具呢,但我不不明白爲什麼面具是必要的。是否因爲其他位中可能存在垃圾而不是位0? AFAIK只使用位0,所以爲什麼我需要掩蓋它?

回答