(Taken from a post in the MegaTokyo OS Development forum, with additional credit given below)


The AT&T syntax (as understood by GAS, the GNU assembler) is the standard syntax on most non-Intel platforms, but remains rare among x86 assembly programmers (where the Intel syntax is understood by virtually every assembler). However, AT&T is what you need for InlineAssembly, and it is what objdump will provide you with when debugging your kernel.

You can switch to intel syntax mode in the inline assembler with a pseudo op, and switch back at the end of the block. See also https://mirbsd.bsdadvocacy.org:8890/cvs.cgi/src/share/man/man7/gas-intel-howto.7 for a small writeup on gas/intel for people who know gas/att or {t,n}asm/intel. Feedback and suggestions welcome.
-- MirAbile

That link you gave works on a port that's blocked by some firewalls. Is there any chance you'd share the contents in form of a Wiki page for ease of reference?
-- MartinBaute

New page with the contents on it, note: it's troff/groff source: GasIntelHowtoMirror
-- DasCandy

There are some substantial differences between the AT&T syntax and the Intel sytnax, which a programmer intending to use the GNU tools should be aware of. Here are a few key things to look for:

Macros

The built-in macro system has the following syntax:

.macro <name> <args>
<operations>
.endm

Example:

.macro write string
   movw string, %si
   call printstr
.endm

This would be equivalent to the NASM macro:

%macro write 1
   mov si, %1
   call printstr
%endmacro

Additionally, the cpp and m4 macro preprocessors are often used for macro handling.


Sources:

DJGPP AT&T Assembly Tutorial

Linux Assembly HOWTO

GAS/AS End User Help Project

Using as

Programming from the Ground Up