Live data from Hacker News

AT&T Syntax versus Intel Syntax (2001)

cs.mcgill.ca

81–90 of 112 posts

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

#81
post #19

Here's the why for the curious. It's just a historical quirk. It's "AT&T syntax" because it dates to the 1978 AT&T Labs effort to port UNIX to the 8086. [1] While the 8086 did not have virtual memory or hardware protection, its memory segmentation model was still adequate to support UNIX. It was the first microprocessor practically capable of running UNIX, and this was realized before the chip was even released. The…

Recently having finished The Cuckoo's Egg by Cliff Stole, the book was the first thing I thought of when seeing this article. At the time he describes how the usage of one OS and/or syntax over the other even suggested one's geographical region.

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

#82

Earlier quoted context omitted.

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

That is extremely confusing for comparisons, which are effectively a subtraction.

I’m talking about moves and copies.

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

#83
post #65
post #59

Earlier quoted context omitted.

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 (2001)

#84
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…

Did any of those advantages that you relied on depend on AT&T syntax, though?

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

#85

Earlier quoted context omitted.

That is extremely confusing for comparisons, which are effectively a subtraction.

I’m talking about moves and copies.

It's even more confusing if moves have a different operation order from arithmetic ops and comparisons, no?

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

#86
post #51
post #19

Here's the why for the curious. It's just a historical quirk. It's "AT&T syntax" because it dates to the 1978 AT&T Labs effort to port UNIX to the 8086. [1] While the 8086 did not have virtual memory or hardware protection, its memory segmentation model was still adequate to support UNIX. It was the first microprocessor practically capable of running UNIX, and this was realized before the chip was even released. The…

I think there's a bit more to the story. It was before my time, but as I understand it the most widely used Unix for the 8086 was XENIX (initially a Microsoft product, later sold to SCO), which used Intel-syntax MASM as its assembler. XENIX for 386 was based on AT&T System V/386, which introduced the AT&T syntax to 32-bit x86. I've found some references to 32-bit XENIX still using an assembler called "masm" but I don…

Replying to my own comment since I was curious - it was certainly Microsoft MASM, and cc was the Microsoft C Compiler as well. [1] So probably Intel syntax.

There was also something called "SCO UNIX" which was apparently more of a straight adaptation of AT&T System V and might have used a pcc compiler and AT&T syntax. It's hard to figure out what happened when because there are a zillion different versions of Xenix/SCO Unix/OpenServer out there.

[1] https://www.scosales.com/ta/kb/100187.html

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

#87
post #49

Earlier quoted context omitted.

Good luck convincing anyone that value = variable makes sense.

My math teachers had no problem with '42 = x' vs 'x = 42' as long as the steps made sense to get there. In fact they'd probably comment that there was no need to go with 'x = 42' if I obviously took a circuitous route simply to end up with x on the left side of the equation, as that would have demonstrated a lack of internalizing some of the base ideas of algebra and it's approach of equation symmetry.

You should distinguish the meaning of = in mathematical and meta-mathematical statements. “42y = yx, therefore 42 = x” is fine; but “let 42 = x” is not.

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

#88

Earlier quoted context omitted.

Wow, is your bias showing. "Against the wishes of everyone"? How about the wishes of those who wanted an x86 assembler before Intel got around to releasing theirs? And who wanted to be able to not have to switch their brains into a backward syntax when working on an x86?

Probably "against the wishes of assembly language programmers who were familiar with microprocessors like the 8080 and Z-80 - and those who would have preferred to standardize on the official intel syntax rather than deal with two different and incompatible assembly language syntaxes."

So, reading the comments here I got the impression that the 8086/8088 order was backwards from everything else before it. Did the 8080 and Z-80 have the same order as the 8086?

But even then, you have worlds converging. The 8086 was (barely) capable of running Unix, whereas the Z-80 definitely was not. Was the 8086 a part of the PDP-11 minicomputer world, or was it part of the 8080/Z-80 world? Well, it was both. Complaining that one world produced an assembler before the other did is... a bit exclusivist. Also whiny.

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

#89
post #78

Earlier quoted context omitted.

The amount of disagreement this individual testimony is generating is fascinating and frustrating to me. I didn’t think it ever really makes sense to disagree with a comment like this, unless one is claiming that the content of your comment is intentionally untrue. Anyways, appreciate your perspective.

It's rare that I post unpopular opinions, but when I see an HN thread full of people talking about how terrible the tools are which helped me be successful, I just can't help but speak up. It's an important topic for me because I originally believed the consensus. Like all of you, I read the countless Internet comments which say things like GNU AS is meant only as a backend for GCC, that you must never write assembly…

That’s a much different lens on the point you were making before. One could argue it’s an entirely different comment and, more importantly, that it yields an entire spectrum of conclusions that weren’t your original point. Before, you were saying “people don’t like AT&T because,” and a bunch of other pronouncements that made my triple-decade native eyebrow raise because they didn’t match my experiences, even squinting really hard. You’re also introducing ideas that are just completely wrong, like syntax having anything to do with the ld integration in gas (it doesn’t; read nearby).

Now you’re saying you were swayed by the idea that one shouldn’t use gas directly, which is an entirely different premise — and much more understandable.

You found a stack that worked for you to build APE. Those are your experiences. Pivoting those experiences to absolute observations about what is good or bad or elite is the error, here. And it’s ironic: you’re lamenting believing “the consensus” in your own journey while simultaneously influencing the consensus with conclusions that your available data didn’t earn. Passively responding to negative feedback toward positive replies suggests bad faith, too, so I’d ask if your contribution to the consensus is harmful, like those were that steered you another way.

I also bristle at a niche field having terms like “elite” used casually to influence people entering it, just like you were once upon a time, and I note you ignored that feedback in responding here. That’s also ironic because APE is challenging the idea of how native software is packaged and distributed, which itself requires outside the box thinking, and you’re using language and absolutist pronouncements to create a different box that has a right and wrong.

Your commentary here suggests to me that the loads of people waiting on you to change the world with APE might be waiting a while. That’s unfortunate and directly motivational.

Post reply on HN