Live data from Hacker News

AT&T Syntax versus Intel Syntax (2001)

cs.mcgill.ca

91–100 of 112 posts

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

#91

Earlier quoted context omitted.

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. Comp…

The 8086 was (barely) capable of running Unix, whereas the Z-80 definitely was not.

https://github.com/chettrick/uzics

You're wrong ;-)

Neither the 8086 nor the Z80 have virtual memory. The x86 has a larger instruction set and address space (1MB) but as it turns out, early Unix kernels didn't need that much RAM either.

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

#92
post #77
post #4

In a dumb idea to depend only on GAS, before it had good support for Intel syntax, I ported some code from Intel syntax into AT&T many moons ago, quite dumb idea, if i was doing it today I would have listed nasm or yasm as a requirement and be done with it.

I'm pretty sure all this predates the existence of gas

Only slightly. System V/386 was 1987, first release of GAS was 1989 (and GCC got 386 support in 1988)

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

#93
In grade school, they showed us a movie where researchers attached special glasses to a volunteer, and the volunteer had to wear them 24/7 or a mask for sleeping. The glasses turned everything upside down.

After a few days, suddenly everything was right side up for the volunteer. Until he took the glasses off ...

The movie ended with a warning to never try this yourself.

Anyhow, I'm reminded of that movie every time I have to switch between AT&T vs Intel syntax. My brain just hurts, and the asm code I write is all wrong.

So, the dmd D compiler's inline assembler syntax is Intel regardless of the OS, and the builtin disassembler is Intel syntax.

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

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

I am curious to hear some specifics of why APE did not work with nasm or fasm. Your earlier comment mentioned "tight cooperation with the linker" -- I don't know what this means. My mental model is that all assemblers ultimately produce an object file. It's not clear to me what would make one object file integrate better with a linker than another, unless there are certain .o outputs that nasm or fasm were not capable of generating.

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

#95
post #63
post #49

Earlier quoted context omitted.

Good luck convincing anyone that value = variable makes sense.

Some older C coding styles recommend that order because before compilers added warnings, “if (17 = variable)” resulted in a diagnostic, while “if (variable = 17)” would not. Nowadays, I think most programmers prefer putting the fastest-changing expression first.

Yeah that is due to clever C semantics that that should never had allowed for anything other than boolean expressions in conditionals like proper grown languages.

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

#96
post #77
post #4

In a dumb idea to depend only on GAS, before it had good support for Intel syntax, I ported some code from Intel syntax into AT&T many moons ago, quite dumb idea, if i was doing it today I would have listed nasm or yasm as a requirement and be done with it.

I'm pretty sure all this predates the existence of gas

I am pretty sure of its status about 25 years ago.

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

#97
post #85

Earlier quoted context omitted.

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?

No, each should have what makes sense, whether analogous to math or a shell command.

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

#98
I like AT&T more, because it have no of that "dword ptr" nonsense. AT&T more logical when it comes to differentiating between an immediate value and an address of a value. Everything else can be done both ways and do not matter much, but using dollar sign or not using it to distinguish immediates from addresses is a really nice touch.

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

#99
post #86
post #51

Earlier quoted context omitted.

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/S…

I cannot say much about which Assembler Xenix used, but in 1992 it was clearly still K&R C, the version I had access to was either lacking X installation or pure text based terminals.

It was so expensive in Escudos, that for teaching an high school class about UNIX, the teacher would bring a tower (286 or early 386 model) that would be timeshared with the whole class, meaning taking 15 minute slots seating at it, while having prepared the exercises, as much as we could, in Turbo C 2.0 on MS-DOS.

It definitly wasn't SCO UNIX though.

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

#100

In grade school, they showed us a movie where researchers attached special glasses to a volunteer, and the volunteer had to wear them 24/7 or a mask for sleeping. The glasses turned everything upside down. After a few days, suddenly everything was right side up for the volunteer. Until he took the glasses off ... The movie ended with a warning to never try this yourself. Anyhow, I'm reminded of that movie every time…

I love that dmd follows the home computer school of having inline Assembly done properly, instead of mini-languages stuffed inside strings.
Post reply on HN