c8051F120中断问题求解

[复制链接]
 楼主| DianGongN 发表于 2011-12-22 16:30 | 显示全部楼层 |阅读模式
本帖最后由 DianGongN 于 2011-12-22 16:34 编辑

今天用到c8051f120,查看datasheet中对clr ea指令的描述,说必须后跟2机器周期的指令,否则可能进入中断。
很奇怪,intel手册没有说过。
请高手分析为什么会这样?有什么方法可以验证?

原文如下:
Note: any instruction which clears the EA bit should be immediately followed by an instruction which has two or more opcode bytes. For example:
// in 'C':
EA = 0; // clear EA bit
EA = 0; // this is a dummy instruction with two-byte opcode
; in assembly:
CLR EA ; clear EA bit
CLR EA ; this is a dummy instruction with two-byte opcode
If an interrupt is posted during the execution phase of a "CLR EA" opcode (or any instruction which clears the EA bit), and the instruction is followed by a single-cycle instruction, the interrupt may be taken. If the EA bit is read inside the interrupt service routine, it will return a '0'. When the "CLR EA" opcode is followed by a multi-cycle instruction, the interrupt will not be taken.
ayb_ice 发表于 2011-12-22 16:35 | 显示全部楼层
标准的51确实没有这些BUG
这是C8051F改进成流水线后的BUG,有些C8051也没有这个限制
 楼主| DianGongN 发表于 2011-12-22 16:51 | 显示全部楼层
本帖最后由 DianGongN 于 2011-12-22 16:53 编辑

请问是不是所有的C8051F都是这样的?
我看了其他型号的,不是很全。总结如下:
没明确有这回事的:c8051f020,c8051f060 ,c8051f340 ,c8051f350
      说有这回事的:c8051f120,c8051f130,c8051f320

没有规律,一头雾水
ayb_ice 发表于 2011-12-22 17:17 | 显示全部楼层
没有明确说的应该没有问题
 楼主| DianGongN 发表于 2011-12-22 17:22 | 显示全部楼层
谢谢ayb_ice!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

31

主题

1437

帖子

14

粉丝
快速回复 在线客服 返回列表 返回顶部