IT lexicon › Programming › System V AMD64 ABI

System V AMD64 ABI

Programming På svenska → Updated: 2026-11-05

The binary contract Linux, the BSDs and macOS follow on x86-64: which registers hold the arguments, who saves what, and what the stack must look like.

The spec was written around the turn of the millennium, before AMD's first 64-bit chip was on sale, by a group with roots in GCC and SUSE. The name is a holdover: formally the document is a processor supplement to the generic System V ABI from the AT&T days, and has nothing to do with that operating system any more. The first six integer and pointer arguments go in rdi, rsi, rdx, rcx, r8 and r9, floating point in xmm0–xmm7, and the result comes back in rax.

A function must preserve rbx, rbp and r12–r15, and the stack must be 16-byte aligned at every call — a rule that makes SSE code crash in baffling ways when hand-written assembly forgets it. Below the stack pointer sits a 128-byte red zone that leaf functions may use without moving the pointer. For variadic calls, al holds the number of vector registers in use, a detail few people know about until printf prints garbage.

← Back to the lexicon