Re: AT&T or Intel syntax ?
- From: Frank Kotler <spamtrap@xxxxxxxxxx>
- Date: Fri, 08 Jun 2007 17:09:28 GMT
psr wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi ,
I want to learn x86 assembly.
I started looking into a book called Linux Assembly Language
Programming by Bob Neveln.
The first few pages speak of MASM , TASM, NASM, GNU as , intel synatx
and At&T synatx. The books says some good points about Nasm and its
syntax matching that of Intel's.It considered AT&T syntax obscure and
difficult to understand.
But my interest in the Linux kernel tells me there is AT&T assembly in
the kernel and not Intel's syntax. So i am more interested in learning
assembly using AT&T synatx.
At the same time i am really now confused if i should follow AT&T
syntax of intel's one?
Nasm or Gas?
I do not want to waste time on gas just to realise NASM was a better
choice.
Do you people have any advice to someone like me who is a C programmer
but not an asm programmer?
Which way should i follow?
AT&T or Intel syntax, keeping in mind i 'll be reading the Linux
kernel source?
Are there any good books i can follow which will help me in building a
solid foundation of assembly?
Jonathan Bartlett's "Programming From The Ground Up" teaches assemly language using AT&T syntax:
http://www.cafepress.com/bartlettpublish.8640017
Or the "free", as in "freeloader" version:
http://savannah.nongnu.org/projects/pgubook/
I agree that AT&T syntax is "obscure and difficult to understand" - "ugly as a bulldog's hind end", too! :) (I'm a Nasm bigot) However, it *is* what you'll find in the Linux kernel. Someone should re-write the entire kernel in Nasm - get rid of that obscure C, too! Since that's not happening...
I'm not familiar with Neveln (give us a "review" once you're into it). Since you've got that, probably starting there, and learning AT&T equivalents later would work. As Bjarne points out, it's "just syntax". Probably pretty confusing for a beginner, but as you learn what we're trying to *do* with "mov eax, ebx" it'll be more obvious that "movl %ebx, %eax" is the "same thing".
If you come up with specific examples, either from the kernel or from Neveln, we can probably help you convert it to the "other way". Once the assembler has converted our masterpiece to machine language, it really *is* the same thing.
You're in a dilemma to which there's no "right answer"... but no "wrong answer" either! Either... both... Follow your "instinct" and I don't think you'll go wrong.
Best,
Frank
.
- Follow-Ups:
- Re: AT&T or Intel syntax ?
- From: Zeljko Vrba
- Re: AT&T or Intel syntax ?
- From: news@xxxxxxxxxxxxxxx
- Re: AT&T or Intel syntax ?
- References:
- AT&T or Intel syntax ?
- From: psr
- AT&T or Intel syntax ?
- Prev by Date: Re: SMM Application Toolkits
- Next by Date: Re: SMM Application Toolkits
- Previous by thread: Re: AT&T or Intel syntax ?
- Next by thread: Re: AT&T or Intel syntax ?
- Index(es):
Relevant Pages
|