-
Notifications
You must be signed in to change notification settings - Fork 1
Intel vs. AT&T Syntax
Confusingly, there are two distinct flavors of syntax for x86-64 assembly, AT&T and Intel. Even more confusingly, the world can't seem to agree on which one is better, and more confusingly still, the two syntaxes switch the order of operands for most instructions. At TechSec, we try to stick to Intel for all our workshops, code snippets, and tools.
This page outlines most of the differences pretty well. All you really need to know is that if you see a bunch of $'s and %'s in your assembly output, you're reading AT&T syntax. Below we'll show you how to configure all the tools we use to output Intel.
On Linux: objdump -M intel
On OS X: objdump -x86-asm-syntax=intel
We recommend making this an alias so that you don't have to type it out every time. In your ~/.bash_profile
add the line:
alias objdump='objdump -M intel'
or
alias objdump="objdump -x86-asm-syntax intel"
for OS X.
In your ~/.gdbinit
file (make one if you don't have one), include the line
set disassembly-flavor intel
Both IDA Pro and Binary Ninja use Intel by default. Yay!