I initially learned the Intel syntax, and preferred it for awhile. But the more I work with non-x86 CPUs, the more I prefer AT&T just because it feels less different than everything else.
Much agreed. Intel syntax just seems somewhat alien.
AT&T Syntax versus Intel Syntax (2001)
41–50 of 112 posts
Re: AT&T Syntax versus Intel Syntax (2001)
#42AT&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. :)
op src dest is the logical order, the rest of the syntax I don’t care about much.
At least the Intel one makes actual mathematical sense: `section:[base + index*scale + disp]`
Re: AT&T Syntax versus Intel Syntax (2001)
#43 cmp eax, ebx ; eax ? ebx
jg foo ; jump if eax > ebx
Related: http://x86asm.net/articles/what-i-dislike-about-gas/Re: AT&T Syntax versus Intel Syntax (2001)
#44AT&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. :)
op src dest is the logical order, the rest of the syntax I don’t care about much.
Re: AT&T Syntax versus Intel Syntax (2001)
#45Here'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…
Re: AT&T Syntax versus Intel Syntax (2001)
#46Earlier quoted context omitted.
X86 addressing modes are an atrocity: https://stackoverflow.com/questions/63571979/clarifying-thre...
They are an atrocity in AT&T syntax . They are perfectly readable in Intel format. For example: https://blog.yossarian.net/2020/06/13/How-x86_64-addresses-m...
Re: AT&T Syntax versus Intel Syntax (2001)
#47Earlier quoted context omitted.
> 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]
add eax, [4]
if you desire. Indeed, many disassemblers will follow suit in unambiguous cases. IDA, for example, does this.Re: AT&T Syntax versus Intel Syntax (2001)
#48IMHO the most confusing part is that AT&T/GAS syntax inverts the comparisons, which are otherwise natural in Intel syntax: cmp eax, ebx ; eax ? ebx jg foo ; jump if eax > ebx Related: http://x86asm.net/articles/what-i-dislike-about-gas/
Re: AT&T Syntax versus Intel Syntax (2001)
#49Earlier quoted context omitted.
In mathematics variable = value , variable receives value, ergo op dest src . That is logic.
...math has no such order. Half the point of algebra is that the two sides of the equation are semantically equivalent and can be swapped at will.
Re: AT&T Syntax versus Intel Syntax (2001)
#50AT&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?
I've definitely had code that some assemblers accepted and others didn't on the same arch, so even if they could be equally expressive in practice they aren't. Fairly sure that's also true of inline assembly on clang x64, had to change between intel and at&t for something a while ago.