GAS or GNU as syntax is a different form of syntax for assembly language files, known also as AT&T syntax after the original style. It is commonly used by other versions of GAS for other architectures (i.e. non-x86). This guide is not a complete reference, but merely an overview.
GAS syntax can appear foreign to someone who is familiar with Intel syntax.
mov eax, ecx(move ecx into eax) becomes
movl %ecx, %eax. Note the "l". This is discussed in item 4.
mov eax, 50becomes
movl $50, %eax. Constants are decimal by default; hexadecimal constants are additionally prefixed with 0x, e.g. "$0x50".
[eax + 4 + edx*2]is written as
4(%eax, %edx, 2). Note that parentheses are used, NOT square brackets.
mov dword eax, [symbol]is the same
movl symbol, %eax. To load the address of "symbol", then Intel/NASM syntax uses
mov eax, symbol, while GAS uses
movl $symbol, %eax.
movb $0x40, %al, move constant 0x40 into register al.
movw %ax, %bx, move register ax into bx.
movl %ecx, %eax, move register ecx into eax
movq %rax, %rdx, move register rax into rdx
flds (%eax), load 32 bit "float" from memory.
fldl (%eax), load 64 bit "double" from memory.
fldt (%eax), load 80 bit "long double" from memory.