Re: AT&T or Intel syntax ?



"T.M. Sommers" <tms@xxxxxx> wrote in
news:467051a6$0$17989$470ef3ce@xxxxxxxxxxx:
Gil Hamilton wrote:

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.

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).

You have picked just about the only case in which AT&T syntax
suffers in comparison to Intel's. It could have been fixed by
adjusting the condition codes, but that probably would have been
too confusing.

Yes, that would have made it even worse.


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.")

While the GNU people certainly did disdain the Intel chips, it
was not necessarily arrogance that led to the decision. Unix did
exist on Intel chips already, such as Xenix, Microport, Coherent,
etc. What syntax did their assemblers use?

A very good point. I used to work on some of these but I really don't
remember. I know that the version of SCO Xenix I worked on had a version
of masm on it that I used for a lot of work -- and obviously it used the
Intel syntax -- but I don't recall whether the C compiler used that (or
whether it even provided an intermediate assembly output).

GH

.



Relevant Pages

  • Re: newbe about API
    ... sure...because the Intel encodings and prefixes for 16-bit and 32-bit ... know - from only looking at those instruction encodings - which way ... Hence, even with your great "size suffix" syntax, Intel's encodings ... But, yeah, I looked at your code, Herbert, and you employed something ...
    (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)
  • 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: retf for 16bit or 32bit? CS:IP or CS:EIP?
    ... >> Frank, Frank, Frank...don't you know? ... Germans have no sense of humour, ... discussions about an alternative syntax to Intel's, ... fuss that "size in the mnemonics" was an a terrible idea and Intel were ...
    (alt.lang.asm)
  • Re: HLA History
    ... whatever (but was never really covered by Intel formally that _everyone_ - ... As "weird" as Herbert is using his own syntax and, ordinarily, you might ... different (for example, to get rid of the "ambiguity", you get the GAS / ... word register and a dword register all sharing the same space (which isn't ...
    (alt.lang.asm)