1 / 72
Other keys: show •
Space: good •
1-4: rate •
0: skip •
5: flag •
6: invert
Question
In AT&T syntax, what is the operand order and how does it differ from Intel syntax?
Answer
AT&T puts the source first, destination second (mov src, dst); Intel is the reverse (mov dst, src).
* AT&T lists the source first and destination second (read the comma as an arrow, into); Intel reverses it. *
| AT&T | Intel | Meaning |
|---|---|---|
mov %eax, %ebx |
mov ebx, eax |
ebx = eax |
add %ecx, %edx |
add edx, ecx |
edx = edx + ecx |
sub $5, %eax |
sub eax, 5 |
eax = eax - 5 |
Mnemonic: AT&T reads like an arrow: mov %eax, %ebx means "move eax into ebx."
Go deeper:
GNU as: AT&T vs Intel syntax — the assembler's own list of the operand-order and prefix differences.
x86 assembly language (Wikipedia) — syntax-comparison table plus the wider register/instruction context.
or press any other key
Note saved — thanks!