将 ARM 汇编指令编码为 ARM 机器语言
Encoding ARM assembly instruction to ARM machine language
我在将 ARM 汇编指令编码为 ARM 机器语言时遇到问题
CMN r9,r10,ROR r11
将 ROR r11 具体转换为文字操作数(对齐和 8 位立即数)
既然你最终靠自己解决了这个问题:
so.s
CMN r9,r10,ROR r11
assemble 到目标文件中的机器代码,然后 disassemble that
arm-none-eabi-as so.s -o so.o
arm-none-objdump -d so.o
so.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <.text>:
0: e1790b7a cmn r9, r10, ror r11
从那个
CMN r9,r10,ROR r11
.inst 0xe1790b7a
Disassembly of section .text:
00000000 <.text>:
0: e1790b7a cmn r9, r10, ror r11
4: e1790b7a cmn r9, r10, ror r11
来自 arm 文档。
CMN (register-shifted register)
CMN<c> <Rn>, <Rm>, <type> <Rs>
[cond]00010111[rn]0000[rs]0[type]1[rm]
rn is r9 so 1001
rm is r10 so 1010
rs is r11 so 1011
[cond]00010111[1001]0000[1011]0[type]1[1010]
condition is always so 1110
type is ror so 11
[1110]00010111[1001]0000[1011]0[11]1[1010]
1110000101111001000010110111010
1110 0001 0111 1001 0000 1011 0111 1010
0xE1790B7A
尽可能快地type/write它下来你可以编码它。
只有当手工操作和使用工具不匹配时,您才需要找出原因。在极少数情况下,它是文档,看看您是否可以从处理器人员那里找到较旧的更新版本,而不是第三方的东西。或者,如果它不匹配,也许您正在查看错误的指令描述,请查看反汇编与文档进行比较以找出编码。 (或者您在某种程度上使用了错误的工具或错误的工具)。只有当它根本不匹配并且你无法弄清楚它才会成为 Stack Overflow 问题,首先是 chip/core 技术支持的支持问题,然后是像这里这样的地方。
我在将 ARM 汇编指令编码为 ARM 机器语言时遇到问题
CMN r9,r10,ROR r11
将 ROR r11 具体转换为文字操作数(对齐和 8 位立即数)
既然你最终靠自己解决了这个问题:
so.s
CMN r9,r10,ROR r11
assemble 到目标文件中的机器代码,然后 disassemble that
arm-none-eabi-as so.s -o so.o
arm-none-objdump -d so.o
so.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <.text>:
0: e1790b7a cmn r9, r10, ror r11
从那个
CMN r9,r10,ROR r11
.inst 0xe1790b7a
Disassembly of section .text:
00000000 <.text>:
0: e1790b7a cmn r9, r10, ror r11
4: e1790b7a cmn r9, r10, ror r11
来自 arm 文档。
CMN (register-shifted register)
CMN<c> <Rn>, <Rm>, <type> <Rs>
[cond]00010111[rn]0000[rs]0[type]1[rm]
rn is r9 so 1001
rm is r10 so 1010
rs is r11 so 1011
[cond]00010111[1001]0000[1011]0[type]1[1010]
condition is always so 1110
type is ror so 11
[1110]00010111[1001]0000[1011]0[11]1[1010]
1110000101111001000010110111010
1110 0001 0111 1001 0000 1011 0111 1010
0xE1790B7A
尽可能快地type/write它下来你可以编码它。
只有当手工操作和使用工具不匹配时,您才需要找出原因。在极少数情况下,它是文档,看看您是否可以从处理器人员那里找到较旧的更新版本,而不是第三方的东西。或者,如果它不匹配,也许您正在查看错误的指令描述,请查看反汇编与文档进行比较以找出编码。 (或者您在某种程度上使用了错误的工具或错误的工具)。只有当它根本不匹配并且你无法弄清楚它才会成为 Stack Overflow 问题,首先是 chip/core 技术支持的支持问题,然后是像这里这样的地方。