加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

进入HALT模式,主中断使能,但没有中断使能(0xFF0F = 0)?

发布时间:2020-12-15 00:48:38 所属栏目:Java 来源:网络整理
导读:根据 Gameboy Programming Manual, HALT mode is canceled by the following events,which have the starting addresses indicated. A LOW signal to the /RESET terminal Starting address: 0x0000 The interrupt-enable flag and its corresponding interr
根据 Gameboy Programming Manual,

HALT mode is canceled by the following events,which have the starting addresses indicated.

  1. A LOW signal to the /RESET terminal Starting address: 0x0000

  2. The interrupt-enable flag and its corresponding interrupt request flag are set

    • IME = 0 (Interrupt Master Enable flag disabled)
      Starting address: address following that of the HALT instruction

    • IME = 1 (Interrupt Master Enable flag enabled)
      Starting address: each interrupt starting address

假设程序进入HALT模式,中断主机使能标志使能IME = 1,并且任何中断的中断使能禁止0xFF0F = 0,会发生什么?实际的Gameboy设备的预期行为是什么?

解决方法

我不知道我是否理解你的问题,但无论如何:
根据引用的手册,IE(中断使能)寄存器地址FFFF确定5种中断类型中的哪一种被使能.如果IME(中断主机使能)设置为1,则只有设置为1的那些才被接受.
IF(中断标志)寄存器地址FF0F只提供请求中断的信息.
因此,如果程序处于IME = 1的HALT状态,则任何在IE中启用的中断都被接受.当然,有人必须产生中断,这个中断将由IF寄存器中的(或更多)1指示.

编辑:

也许这回答你现在的问题:如果程序进入HALT模式,则使能中断主机使能(IME = 1),但是所有特定的中断类型都被禁止(IE = 0),不会接受中断,并且不保持HALT模式.这是设备上的预期行为.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读