EDIT: Would any of the people downvoting this comment care to explain their affection for this historical mistake? I have never understood why anyone would choose it.
EDIT: Would any of the people downvoting this comment care to explain their affection for this historical mistake? I have never understood why anyone would choose it.
All the GNU tools, and many of their clones, use AT&T syntax. I think I run into it more often than Intel, and I turn on the option for the latter where I can. It’s really prevalent.
As an example, scientific research papers were still being published in raw PostScript (PS) format long after PDF existed and become the defacto desktop publishing standard for 99.9% of the world outside of academia.
The use of AT&T assembler sticks out for me too, because I had learned Intel assembler back in the IBM XT days and wrote "demo" programs and all of that. And then my university used AT&T which was just so bizarre because literally 99% of the students had IBM compatible computers at home with Intel CPUs! Most of the lecturers had Intel PCs, most of the labs had Intel PCs, and it was just a handful of Solaris machines that had RISC CPUs and toolchains based on AT&T assembly.
Similarly, if you Google "Kerberos", an insane number of references pretend that this can only mean "MIT Kerberos", and is used for University lab PC authentication only. Meanwhile, in the real world, 99% of the Kerberos clients and servers out there are Microsoft Active Directory, and all configuration is done via highly available servers resolved via DNS, not static IP addresses.
Some design aspects of Linux and BSD have similar roots, and it shows. The DNS client in Linux is quite clearly designed for University campus networks. Combine this with typical University servers using hard-coded IP addresses for outbound comms, because of things like the Kerberos example above, and you get an end result that doesn't handle the requirements and failure modes of more general networks very well.
movl 8(%ebx,%eax,2), %eax
What does the 8 mean? How does the stuff in the parenthesis work? Why is there a type suffix? Here’s a general definition of AT&T syntax’s indirect form segment:offset(base,index,scale)
But the equivalent in Intel syntax (for the above two is): mov eax, [eax*2+ebx+8]
segment:[index*scale+base+offset]
Idk, but the Intel syntax is just clearer to me. eax = *(eax*2+ebx+8);
Like pseudo code almost. It honestly seems like AT&T syntax was created to facilitate easier parsing by computers, not humans.The biggest thing for me is that the parameter order doesn’t follow the Intel or AMD opcode manuals; I have to flip the operands in my head to compare them to the opcode manual.
I’m not saying people are wrong for using AT&T syntax, or that it’s not intuitive for some. Just that Intel felt more intuitive to me.
Weaponized comment flagging gone awry.
but yes, Gnu tools are ubiquitous and will continue to be so.
Edit: realized that gcc first target was 68k so it would make sense for gas to use right way round assembler syntax.
And it really, really bothers me when my tools do not match my documentation, for no good reason. (Just use the `-M intel` switch with x86 GNU tools, and then they will match. Or on ARM, do nothing, because by then they'd sensibly figured out not to bother with their "generic" syntax.)
Never again, after all this years I still have vague memories of how I used TASM and MASM, and trying to write x86 AT&T was such a pain.