Quiz Entry - updated: 2026.07.14
What are the AT&T size suffixes and when do you need them?
The suffix letters b, w, l, q set the operand size to 1, 2, 4, or 8 bytes; you need them only when the size can't be inferred from a register operand.
* The suffix picks the operand width; you only need it when no register operand already fixes the size. *
| Suffix | Size | Example | Meaning |
|---|---|---|---|
b |
1 byte | movb $0, %al |
Move byte |
w |
2 bytes | movw $0, %ax |
Move word |
l |
4 bytes | movl $0, %eax |
Move long (doubleword) |
q |
8 bytes | movq $0, %rax |
Move quad |
When required: When the operand size is ambiguous, e.g. movl $0, (%rax) — without l the assembler wouldn't know how many bytes to write.
When optional: When a register operand already implies the size, e.g. mov %eax, %ebx — eax is always 4 bytes.
Go deeper:
GNU as: mnemonic size suffixes — states that b/w/l/q select 8/16/32/64-bit references and when they are inferred.