Re: AT&T or Intel syntax ?
- From: Jerry Coffin <spamtrap@xxxxxxxxxx>
- Date: Sun, 17 Jun 2007 22:09:16 -0600
In article <Xns994C743E4DA7Egilhamiltonhotmailco@xxxxxxxxxxxxx>,
spamtrap@xxxxxxxxxx says...
[ ... ]
Regardless of your view of this fundamentally religious question, I
maintain that the application of "AT&T syntax" to the Intel instruction
set was and is brain-damaged.
Yes and no -- though on the 'yes' side, I think there's more evidence
than you've presented.
Consider this code in Intel format and then the equivalent code in AT&T:
cmp eax, ebx # Intel
jl somelabel
cmpl %ebx, %eax # AT&T
jl somelabel
The Intel format is easily parsed by a human reader as "compare eax to
ebx and jump to somelabel if eax is less than ebx". The same code in
AT&T syntax OTOH must be interpreted as "compare ebx to eax and jump to
somelabel if *eax* is less than *ebx*". That is, you the reader must
remember to transpose the operands in your head. While one can obviously
learn to do this eventually, it's still a bad idea; it essentially breaks
the mnemonic value of the "jl" instruction (and others like it).
There's also the fact that they encode the sizes into the opcode part,
so things like movsx and movzx look truly heinous.
IMO, the original imposition of "AT&T syntax" on the Intel platform was
simply arrogance on the part of the gnu folks who thought at the time
that the Intel 8086/286/386/etc. was a junky piece of crap compared to
other more "elegant" architectures of the time like the Motorola 68000
family. ("And, see, we can make it look almost like a real machine if we
redesign their stupid assembly language for them.")
I think it's far more laziness than arrogance. From the UNIX-esque
viewpoint, direct use of the assembler by a person is almost entirely
incidental. It's mostly there to isolate the compiler from the
intricacies of object file formats. Following UNIX tradition, the
intermediate file is in a text format, but it's really designed as a way
for one tool to talk to another -- easy for the compiler to generate and
easy for the assembler to parse. From their viewpoint, the fact that
reading or writing it causes pain means you shouldn't do that...
--
Later,
Jerry.
The universe is a figment of its own imagination.
.
- References:
- AT&T or Intel syntax ?
- From: psr
- Re: AT&T or Intel syntax ?
- From: Frank Kotler
- Re: AT&T or Intel syntax ?
- From: Zeljko Vrba
- Re: AT&T or Intel syntax ?
- From: Gil Hamilton
- AT&T or Intel syntax ?
- Prev by Date: HLA v1.97 is now available
- Next by Date: Get the FAQs
- Previous by thread: Re: AT&T or Intel syntax ?
- Next by thread: Re: AT&T or Intel syntax ?
- Index(es):
Relevant Pages
|