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.
[ Parent
| on HN ]
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.I wonder if it would have been more ergonomic to have the labels be % prefixed instead of registers.
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.