riscv 彙編與反彙編

  爲了riscv指令集,咱們須要彙編與反彙編工具來分析指令格式。sass

  能夠用下面的兩個工具來彙編和反彙編,下載連接:https://pan.baidu.com/s/1eUbBlVc工具

  riscv-none-embed-as.exe -c mm.s -o mm.o --march=rv32gurl

mm.sspa

addi x10, x6, 20
addi x11, x6, 20
addi x10, x6, 20
addi x10, x6, 20
beq  x10,x11,label
addi x12, x6, 20
addi x12, x6, 20
label:
addi x12, x6, 20
addi x12, x6, 20
addi x12, x6, 20

   riscv-none-embed-objdump.exe -d mm.o -M no-aliases,numeric.net

反彙編後的代碼爲:code

mm.o:     file format elf32-littleriscv


Disassembly of section .text:

00000000 <label-0x1c>:
   0:   01430513                addi    x10,x6,20
   4:   01430593                addi    x11,x6,20
   8:   01430513                addi    x10,x6,20
   c:   01430513                addi    x10,x6,20
  10:   00b50663                beq     x10,x11,1c <label>
  14:   01430613                addi    x12,x6,20
  18:   01430613                addi    x12,x6,20

0000001c <label>:
  1c:   01430613                addi    x12,x6,20
  20:   01430613                addi    x12,x6,20
  24:   01430613                addi    x12,x6,20
相關文章
相關標籤/搜索