【发布时间】:2023-01-09 01:41:20
【问题描述】:
MARS & RARS 包含反汇编程序,但是
- 不允许
.word在.text内 - 只会反汇编
.text部分有没有办法让这些模拟器从十六进制中反汇编指令?
(常见的在线反汇编器也不支持 RISC V!)
【问题讨论】:
标签: mips disassembly riscv mars-simulator rars-simulator
MARS & RARS 包含反汇编程序,但是
.word在.text内.text部分
有没有办法让这些模拟器从十六进制中反汇编指令?
(常见的在线反汇编器也不支持 RISC V!)
【问题讨论】:
标签: mips disassembly riscv mars-simulator rars-simulator
以下代码序列将使 RARS/MARS 从十六进制反汇编(此处为 RARS 版本)。该程序可以编辑为使用其他指令作为十六进制,运行程序后,在“文本段”栏“基本”中可以看到反汇编。必须在“设置”菜单中启用“自修改代码”选项。
.data
WStart:
.word 0x00052283 # as many instructions in hex or other here as will fit in the nop's below
.word 0xfae7d2e3
WEnd:
.text
main:
j next
CC0: # after running the program,
nop # find disassembly here in the "Basic" column of the "Text Segment" window
nop
nop
nop
nop
nop
nop
nop
nop
next:
la a0, WStart
la a1, WEnd
la a2, CC0
loop1:
lw t0, (a0)
sw t0, (a2)
addi a0, a0, 4
addi a2, a2, 4
bne a0, a1, loop1
li a7, 10
ecall
【讨论】: