News for hackers. Stuff that matters.
Re:AT&T Syntax versus Intel Syntax by userbinator on Sunday November 13, 2022 @03:41PM (#33587118)
IMHO the most confusing part is that AT&T/GAS syntax inverts the comparisons, which are otherwise natural in Intel syntax:

    cmp eax, ebx   ; eax ? ebx
    jg foo         ; jump if eax > ebx
Related: http://x86asm.net/articles/what-i-dislike-about-gas/
Re:AT&T Syntax versus Intel Syntax by mrjin on Sunday November 13, 2022 @03:54PM (#33587232)
Also the % before register names is completely unnecessary, it just another extra character to type.
Re:AT&T Syntax versus Intel Syntax by rwmj on Sunday November 13, 2022 @04:38PM (#33587616)
It disambiguates labels from registers, assuming of course you allow labels to have register names. eg this is valid:

        mov rax,%rax                                                            
  rax:  .ascii "hello\0"
Stupid perhaps, but valid.
Re:AT&T Syntax versus Intel Syntax by jck on Sunday November 13, 2022 @05:14PM (#33587941)
I wonder if it would have been more ergonomic to have the labels be % prefixed instead of registers.
Re:AT&T Syntax versus Intel Syntax by int_19h on Sunday November 13, 2022 @08:37PM (#33589301)
The above-linked article specifically points out that registers are referenced much more often than labels.
Re:AT&T Syntax versus Intel Syntax by userbinator on Sunday November 13, 2022 @06:34PM (#33588526)
Probably an artifact of the original use of the assembler being to process compiler output, and causing variable names to appear.
Re:AT&T Syntax versus Intel Syntax by professoretc on Monday November 14, 2022 @05:59PM (#33602600)
Yep, the "nice" thing about AT&T is that, from a parsing perspective, you don't really need to know much about the target architecture to be able to determine what's an instruction vs. a register vs. a label, etc.