The AT&T assembly syntax, often called the GAS syntax, keeps surprising me. For example, its parameter order:
mov $100,%eax /* Destination after source */
This just seems so counter-intuitive! Nearly all programming languages (and the good old mathematical notation) go the other way around: destination before source, like this:
int a = 100; /* Destination before source (C-style) */
a := 100 // Destination before source (Pascal-style)
mov eax,100 ; Destination before source (Intel assembly syntax)
There are other points, for example, sigils… The %
-s before every register and the $
before every constant literal (except for those used as the fourth operand in the very strange-looking effective addressing syntax) mightily clutter up the code, when it would have been trivial to avoid them. What is, or was, their advantage?