Quiz Entry - updated: 2026.07.14
What is the AT&T assembly syntax and how does it differ from Intel syntax?
AT&T (GCC/GAS default) writes op source, destination with % on registers and $ on immediates; Intel writes op destination, source with bare operands — the operand order is reversed.
The same machine instruction can be printed two ways, and mixing them up silently inverts your reading. The differences are mechanical but total:
| Feature | AT&T | Intel |
|---|---|---|
| Operand order | src, dest | dest, src |
| Register prefix | %rax |
rax |
| Immediate prefix | $42 |
42 |
| Memory reference | (%rax) |
[rax] |
| Size suffix | movl, movq |
mov dword, mov qword |
| Displacement | 8(%rbp) |
[rbp+8] |
# AT&T: movl $42, %eax # set eax to 42
# Intel: mov eax, 42
You can make GCC emit Intel syntax with gcc -S -masm=intel program.c.
Tip: AT&T reads left-to-right as "move from A to B"; Intel reads as "set A to B." Decide which one you're looking at before trusting the direction of any instruction.
Go deeper:
x86 assembly language (Wikipedia) — a direct AT&T-vs-Intel comparison of operand order and sigils.