Quiz Entry - updated: 2026.07.14
What prefixes does AT&T syntax use for registers, immediates, and how does it format memory operands?
Registers are prefixed with %, immediate constants with $, and memory operands are written offset(base, index, scale).
* offset(base, index, scale) resolves to MEM[base + index*scale + offset]; scale is limited to 1, 2, 4, or 8. *
| Element | AT&T | Intel equivalent |
|---|---|---|
| Register | %eax |
eax |
| Immediate | $5, $0x10 |
5, 10h |
| Memory | 8(%rbp) |
[rbp + 8] |
| Scaled | (%rdi,%rsi,4) |
[rdi + rsi*4] |
| Full | 0x10(%rax,%rcx,8) |
[rax + rcx*8 + 0x10] |
Memory formula: offset(base, index, scale) = MEM[base + index*scale + offset]
Scale can only be 1, 2, 4, or 8. Omitted parts default to 0.
Go deeper:
GNU as: AT&T operand notation — authoritative definition of the % / $ prefixes and memory-operand form.
x86 assembly language (Wikipedia) — explains addressing modes and how the scaled-index form maps to hardware.