Docs on At&T X86 asm syntax

Kelley Cook kcook34@ford.com
Fri Jul 18 20:49:00 GMT 2003


> Hello,
> 
> Gcc use AT&T syntax for inline and sourcecode in
> assembler. But it is rather different from those used
> by Intel in their doc.
> 
> Some opcode doesn't have the same syntax, or same
> name, argument passing is different, etc..
> 

 > Where could I find a comprehensive doc on this syntax?

If you don't feel like learning AT&T syntax, then two other options 
would to compile with the flag "-masm=intel" or you can wrap all your 
inline assembly in ".intel_syntax" & ".att_syntax" pseudo-ops like this:

asm(
".intel_syntax\n\t"
"mov edx, dword *ptr* [ebp+08]\n"
...
".att_syntax")

Kelley Cook




More information about the Gcc mailing list