Live data from Hacker News

No one should use the AT&T syntax (2021)

outerproduct.net

1–10 of 112 posts

Re: No one should use the AT&T syntax (2021)

#6
Fun little thing: If you really want to confuse an LLM, try to make it reason about x86 assembler, and watch it trip all over operand order (along with many other things).

I've had models assume different operand order in two different places in the same file.

x86 assembler really is the gift that keeps on giving. Sadly it doesn't given you anything nice.

Re: No one should use the AT&T syntax (2021)

#9
post #4

I didn't really read the article, because/but I spent a minute or two playing with the cat. Nice little animation.

Cool, neko, originally created for X by Masayuki Koba. I have it installed on my Slackware System :)

To me, as a non-WEB developer, I think that would be hard to do on a WEB Page.

As for AT&T vs x86 assembly, it is a flame war I have not heard from in decades and a couple of arguments were hit upon in the article were part of that war. Nice hearing about an old classic war :)

I have not even looked at assembly in many decades, and back then I did the bare minimum with help from someone, so most of the article was over my head.

Re: No one should use the AT&T syntax (2021)

#10
As someone who has both written and read a lot of assembly in a professional context, my colleagues who are assembly writers very frequently prefer Intel syntax. The ones who are mostly (exclusively) readers seem to generally prefer AT&T. It is pretty undisputed that AT&T is easier for computers to parse, but it's also generally easier for humans to parse when reading it.

* The suffixes give you a lot of easy specificity about what the operands are, while they are unnecessary if you already know what the operands are.

* DWORD PTR [x + A + B * C] is wordy, but at least the math is clear, and you can write the arithmetic in any order you want (as well as using 3, 5, and 9 as multipliers). X(A, B, C) is more concise and has no operand order to think about, and not terribly hard to read once you learn.

* AT&T syntax from a compiler always uses the easy cases and never makes mistakes about placement of the "glyphs" ($, %, etc.). There is none of the example's "movq ($28), %rax" because having a symbol called "$28" is fundamentally dumb.

* Operand order in AT&T is really dumb, especially for 3-operand instructions, but if you're just reading, you really don't need to know operand order to understand what's going on.

For these reasons, I assume the OP was written by someone who I assume writes a lot of assembly by comparison.

Post reply on HN