Live data from Hacker News

AT&T Syntax versus Intel Syntax (2001)

cs.mcgill.ca

21–30 of 112 posts

Re: AT&T Syntax versus Intel Syntax (2001)

#21
post #2

Hmm. "AT&T"? I thought it at least came from DEC via the PDP-11,7 assembler. And I'm guessing Intel didn't invent doing it backwards in their own either.

It's the AT&T syntax because AT&T are the one who unleashed that on the world against the wishes of everyone. See the sibling comment:

> The AT&T folks did not even wait for Intel's assembler [...] Nor did they closely model their assembler after it. They just took the assembler they already had for the PDP-11 and adapted it with minimal changes for the 8086.

Re: AT&T Syntax versus Intel Syntax (2001)

#23
AT&T syntax is the most elite syntax. I've used it to write some famous hacks, like Actually Portable Executable, which is a 16-bit BIOS bootloader shell script ELF / Mach-O / PE executable. People dislike it because writing assembly Bell Labs style requires great responsibility. What makes AT&T syntax so powerful is its tight cooperation with the linker. I don't think it would have been possible for me to invent APE had I been using tools like NASM and YASM and FASM because PC assemblers were traditionally written as isolated tools that weren't able to take a holistic view with linker scripts and the C preprocessor. https://raw.githubusercontent.com/jart/cosmopolitan/master/a...

Re: AT&T Syntax versus Intel Syntax (2001)

#24
post #12

Earlier quoted context omitted.

op src dest is the logical order, the rest of the syntax I don’t care about much.

In mathematics variable = value , variable receives value, ergo op dest src . That is logic.

In mathematics variable = value ≡ value = variable

Re: AT&T Syntax versus Intel Syntax (2001)

#25
post #8

AT&T vs. Intel syntax has caused many arguments in some of my circles. AT&T is an atrocity and if you disagree... you're wrong. :)

They are using a classic dollar sign for assignment, so clearly at&t is better.

> They are using a classic dollar sign for assignment

They're using a dollar sign for immediates.

As if you can't notice that it's a number.

    addl $4, %eax
that's 3 different completely unnecessary symbols for things which are not ambiguous in the first place:

- the operation width is provided by the registry

- a number is an immediate

- a register is named

Hence the much less noisy Intel syntax:

    add eax, 4

Re: AT&T Syntax versus Intel Syntax (2001)

#26
post #12

Earlier quoted context omitted.

op src dest is the logical order, the rest of the syntax I don’t care about much.

In mathematics variable = value , variable receives value, ergo op dest src . That is logic.

That is just an arbitrary notation, nothing to do with logic. In English at least, "add 4 to x" is more natural than "add to x 4".

Ergo op src dest

Re: AT&T Syntax versus Intel Syntax (2001)

#29
post #8

Earlier quoted context omitted.

They are using a classic dollar sign for assignment, so clearly at&t is better.

> They are using a classic dollar sign for assignment They're using a dollar sign for immediates . As if you can't notice that it's a number. addl $4, %eax that's 3 different completely unnecessary symbols for things which are not ambiguous in the first place: - the operation width is provided by the registry - a number is an immediate - a register is named Hence the much less noisy Intel syntax: add eax, 4

addl is not necessary if it is not ambiguous

    add $4, %eax
- is fine

Compare with

    add 4, %eax
The "less noisy" Intel syntax becomes:

    add eax, DWORD PTR [4]

Re: AT&T Syntax versus Intel Syntax (2001)

#30
post #23

AT&T syntax is the most elite syntax. I've used it to write some famous hacks, like Actually Portable Executable, which is a 16-bit BIOS bootloader shell script ELF / Mach-O / PE executable. People dislike it because writing assembly Bell Labs style requires great responsibility. What makes AT&T syntax so powerful is its tight cooperation with the linker. I don't think it would have been possible for me to invent APE…

Isn't this a function of the tools you were using, not the syntax? Couldn't any of these tools support any syntax and do the same thing?
Post reply on HN