Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Gentle Introduction to x86-64 Assembly (x86-64.org)
19 points by nickb on June 1, 2009 | hide | past | favorite | 4 comments


Wish the examples were using intel syntax.


I had a reply to this (see below), but reflection revealed that this is just a flame-baiting comment. Intel/AT&T is apparently a long-running flamewar. See e.g. http://www.google.com/url?sa=t&source=web&ct=res&... .

Originally wrote: Why? The OSS world uses AT&T syntax, because that's what gas uses.


It is not flame bait. (BTW, I can't read your link due to Google's copyright restrictions.)

gas uses AT&T syntax because it needs a format that applies to multiple architectures. But the Intel format dominates Intel-specific compilers and, I expect, the mindshare of Intel assembly coders. The OSS world is no exception; the open-source Intel nasm and fasm assemblers use Intel format. Intel syntax is so popular, in fact, that gas itself was modified to support it: http://sourceware.org/binutils/docs-2.19/as/i386_002dSyntax....


and anybody who has written non-toy assembly knows GAS is a toy and a royal pain. GAS was designed to be fed the output of GCC, not handwritten. Support for opcodes has been lacking for ages, until NASM came along and put pressure on them. Let's not even compare the macros in intel-type assemblers to GASP, gasp!

Inline asm looks hideous with AT&T syntax; they had 20 years to copy Turbo C and they haven't yet.

P.S. I hope to god you're not calling your gas sources .S, as gcc will gobble it up or overwrite it if you have .c file with the same file name and you accidently -S.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: