The following lists some major differences of the two syntaxes:
- AT&T prefixes register with % sign
* Intel:
eax, ebx, ecx,...
* AT&T:
prefix by % sign: %eax, %ebx, %ecx,...
- AT&T prefixes immediate value with $ sign, Intel is not
* Intel: 10, 80h
* AT&T: $10, $0x80
- AT&T and Intel syntax use opposite instruction operands
* Intel: mnemonic destination, source
Ex: mov eax, 100
* AT&T: mnemonic source, destination
Ex: movl $100, %eax
- AT&T suffixes instruction to specify instruction's operand size (1 byte: b, 2 bytes: w, 4 bytes: l) but Intel uses directive before operands (1 byte: byte ptr, 2 bytes: word ptr, 4 bytes: dword ptr)
* Intel:
mov al, byte ptr foo
* AT&T:
movb foo, %al