LOGBOOK

HELP

1 / 72
Other keys: showSpace: good1-4: rate0: skip5: flag6: 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 mov src, dst versus Intel mov dst, src with arrows showing source-into-destination for AT&T and the reversed order for Intel

* 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:

or press any other key