MIPS中断不会跳转到中断处理程序

MIPS interrupt won't jump to the interrupt handler

这些值被加载到寄存器中

lui  $t0, 0xffff             # Loads receiver control
li   $t3, 0x00000002         # Loads the interrupt enable bit

此函数启用MMIO 输入中断。它将循环直到游戏结束 等到按下一个键。这将触发中断处理程序。

main:
beq  $s7, 1000, checkOver    # Every 1000 loops checks to see if the game is over
sw   $t3, ($t0)              # Enables interrupts
addi $s7, $s7, 1             # Adds one to the loop iterator
j    main                    # Loops in main until the game is over

然而,当我按下某个键时,却出现了这个错误

C:\Users**** 第 41 行中的错误:0x00400038 处的运行时异常:外部中断

我得到了这个错误,而不是我用 .ktext 编写的中断处理程序的代码。有人可以帮忙吗?

我弄明白了,我会 post 放在这里,以防其他人遇到同样的问题。我假设 .ktext 在内存中有一个定义的地址,但事实证明,当您定义 .ktext 时,您需要对位置进行硬编码。我在哪里

.ktext

我应该放

.ktext 0x80000180

然后代码正确地跳转到中断处理程序。找了好久。