Re: AT&T or Intel syntax ?



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.

.



Relevant Pages

  • Re: ( picoVerse-:( I want to generate machine code ) )
    ... I looked into the Intel op code manuals but I find it ... There's a reason why assembler syntax is so terse: ... Intel syntax will become "mov %ecx,%eax". ...
    (comp.lang.lisp)
  • Re: RosAsm is easier to read than HLL code
    ... > Intel does not have a preference, since we do not have an assembler any ... The syntax is determined by the assembler; ... they created was the definition of "Intel Syntax" assembly language. ...
    (alt.lang.asm)
  • Re: HLAs
    ... Uh, first of all it was Intel, not Microsoft. ... Intel devised this syntax, that's why we call it an "Intel-syntax" ... assembler rather than a "Microsoft-syntax" assembler (though ...
    (comp.lang.asm.x86)
  • Re: ASM386 Manual On-Line
    ... >> original Intel syntax. ... But that doesn't change the fact that "Intel ... Intel designed the syntax for their assembler when they first ... Let me get this straight- You hate Intel. ...
    (alt.lang.asm)
  • Re: HLA History
    ... Intel don't really define a "syntax", ... to try to provide the "HLL" style, ... "incompatibilitise" are minor things like "proprietary assembler ...
    (alt.lang.asm)