As already mentioned in the answer by Jerry Coffin, the Intel syntax fits better with the encoding of instructions for the x86 architecture. As a comment in my debugger's disassembler states, "the operands appear in the instruction in the same order as they appear in the disassembly output". For example, consider this instruction:
-a
1772:0100 test word [AA55], 1234
1772:0106
-u 100 l 1
1772:0100 F70655AA3412 test word [AA55], 1234
-
As you can read in the opcode hexdump, the instruction opcode 0F7h
is first, then the ModR/M byte 06h
, then the little-endian offset word 0AA55h
, and then finally the immediate word 1234h
. The Intel syntax matches that order in the assembly source. In the AT&T syntax this would look like testw $0x1234, (0xAA55)
which swaps the order compared to the encoding.
Another example that obeys the Intel syntax order is comparison conditions. For example, consider this sequence:
cmp ax, 26
jae .label
This will jump to .label
if ax
is above-or-equal-to 26 (in unsigned comparison). This mnemonic is only true of the cmp dest, src
operand order, which sets flags as for dest -= src
.