3 ms·
The best argument for Intel syntax is subtraction and division. Intel syntax's sub rax, rbx is equivalent to AT&T syntax's subq %rbx, %rax ...and i
by comex 2y ago
The best argument for Intel syntax is subtraction and division.
Intel syntax's
sub rax, rbx
is equivalent to AT&T syntax's
subq %rbx, %rax
...and it computes (rax - rbx), not (rbx - rax)!
I suppose you could justify the AT&T syntax as meaning "subtract rbx from rax". But it seems incredibly counterintuitive to me.
Edit: As another comment pointed out, this issue also applies to comparisons and is even worse there. Intel's
cmp rax, rbx
jg foo
is equivalent to AT&T syntax's
cmp %rbx, %rax
jg foo
and it means "compare rax to rbx; if it's 'g'reater, then 'j'ump to foo". There's no good way to write that in English where rbx comes first. At best you could say: "compare rbx to rax; if rax is greater"…