我们运行地址 8002000到80020028 的代码,问题是我们在结束时注册 $ 18 内的内容。我想可能有 0x0E ,但我真的不确定我是如何得到这个答案的。谁能解释一下?
如果我们从80020000开始并遵循所写的说明可能会发生异常?如果是,什么时候可以发生?
8001FFF8 NOP
8001FFFC NOP
80020000 LUI $16, 0x8002
80020004 ADDIU $16, $16, 0x30
80020008 ADDI $17, $00, 0x3
8002000c SLL $17, $17, 0x2
80020010 LW $18, 0x4 ($16)
80020014 LW $19, 0x0 ($16)
80020018 SW $18, 0x8 ($16)
8002001C NOP
80020020 ADD $18, $18, $17
80020024 NOP
80020028 NOP
8002002C NOP
80020030 ???
80020034 SRL $00, $00, 0
80020038 SRA $00, $00, 0
8002003C SLLV $00, $00, $00
80020040 NOP
80020044 NOP
答案 0 :(得分:1)
8001FFF8 NOP
8001FFFC NOP
80020000 LUI $16, 0x8002
80020004 ADDIU $16, $16, 0x30
$ 16 = 0x80020030
80020008 ADDI $17, $00, 0x3
8002000c SLL $17, $17, 0x2
$ 17 = 12(3 <&lt; 2)
80020010 LW $18, 0x4 ($16)
$ 18 = 0x2(80020034的负载值,反汇编为srl $ 0,$ 0,0 - &gt; 0x2)
80020014 LW $19, 0x0 ($16)
$ 19 = ??? (价值低于0x80020030未知)
80020018 SW $18, 0x8 ($16)
存储在0x80020038(0x2)
下8002001C NOP
80020020 ADD $18, $18, $17
$ 18 = 0xE(0x2 + 12)
80020024 NOP
80020028 NOP
$ 18 = 0xE(nops不会改变任何东西)
8002002C NOP
80020030 ???
80020034 SRL $00, $00, 0
80020038 SRA $00, $00, 0
8002003C SLLV $00, $00, $00
80020040 NOP
80020044 NOP
此代码中的异常是可能的(我可能会遗漏一些内容):