我试图理解英特尔语法和AT&T语法之间的差异(我使用的是GNU).
我有两个文件,intel.s:
.intel_syntax noprefix
val:
mov eax, val
Run Code Online (Sandbox Code Playgroud)
和atandt.s:
val:
mov $val, %eax
Run Code Online (Sandbox Code Playgroud)
我正在尝试将AT&T版本转换为英特尔版本.但我得到了不同的结果:
$ objdump -d intel.o
intel.o: file format elf32-i386
Disassembly of section .text:
00000000 <val>:
0: a1 00 00 00 00 mov 0x0,%eax
Run Code Online (Sandbox Code Playgroud)
和
$ objdump -d atandt.o
atandt.o: file format elf32-i386
Disassembly of section .text:
00000000 <val>:
0: b8 00 00 00 00 mov $0x0,%eax
Run Code Online (Sandbox Code Playgroud)
他们为什么不同?