For further flavor on what @MichaelPetch said, see the wiki pages
Assembly and
Opcode syntax, as well as the pages specifically about
GAS and
NASM.
Basically, even when they are targeting the same ISA, each different assembler can have its own syntax for things such as opcode names, order of operands, representations of different numeric bases and string formats, labels, and directives such as equates and origins.
While most x86 assemblers more or less follow the opcode syntax and argument ordering defined by Intel, the Gnu Assembler, GAS, uses an older opcode format going back to the original
as assembler for AT&T Unix. There are a number of differences in the AT&T syntax from the Intel syntax, most notably that while Intel defines the argument order as 'destination, source', the AT&T syntax follows what I assume was the PDP-11 syntax of 'source, destination', meaning that for the Intel syntax, "eax += 3" (that is, add 3 to EAX and save the result in EAX) would be
Code:
add eax, DWORD 3
but for the AT&T/Gnu syntax, it would be:
Code:
addl $3, %eax
Where the '$' prefix indicates an immediate operand, the '%' prefix means a register argument, and the 'l' suffix means a long (32-bit double-word) operation.