wire / wire-format / system-v-amd64-abi
The System V AMD64 ABI is the standard calling convention for x86-64 on Linux, macOS, and most Unix systems. Integer/pointer arguments: RDI, RSI, RDX, RCX, R8, R9 (first 6), then stack. Floating-point arguments: XMM0-XMM7 (first 8), then stack. Return value: RAX (integer), XMM0 (float). Caller-saved: RAX, RCX, RDX, RSI, RDI, R8-R11. Callee-saved: RBX, RBP, R12-R15. Stack: 16-byte aligned before CALL. Red zone: 128 bytes below RSP (not clobbered by signal handlers).
aka: System V AMD64 ABI (calling convention)
spec: System V Application Binary Interface (AMD64)
The System V AMD64 ABI is the standard calling convention for x86-64 on Linux, macOS, and most Unix systems. Integer/pointer arguments: RDI, RSI, RDX, RCX, R8, R9 (first 6), then stack. Floating-point arguments: XMM0-XMM7 (first 8), then stack. Return value: RAX (integer), XMM0 (float). Caller-saved: RAX, RCX, RDX, RSI, RDI, R8-R11. Callee-saved: RBX, RBP, R12-R15. Stack: 16-byte aligned before CALL. Red zone: 128 bytes below RSP (not clobbered by signal handlers).
| field | size | meaning |
|---|---|---|
| Integer args | 6 registers | RDI, RSI, RDX, RCX, R8, R9 (in order). Additional args on stack (right-to-left). |
| Float args | 8 registers | XMM0-XMM7. Additional args on stack. |
| Integer return | RAX | Return value in RAX (and RDX for 128-bit). |
| Float return | XMM0 | Return value in XMM0 (and XMM1 for complex/long double). |
| Caller-saved | registers | RAX, RCX, RDX, RSI, RDI, R8-R11. Caller must save if needed across calls. |
| Callee-saved | registers | RBX, RBP, R12-R15. Callee must save/restore if used. |
| Stack alignment | 16 bytes | RSP must be 16-byte aligned before a CALL instruction. |
| Red zone | 128 bytes | 128 bytes below RSP are not clobbered by signal handlers or interrupt handlers. Leaf functions can use this without adjusting RSP. |
| Varargs | AL register | For variadic functions, AL = number of XMM registers used (0-8). |
example:
55 48 89 e5
Function prologue: PUSH rbp; MOV rbp, rsp
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/system-v-amd64-abi
or /wire-format/system-v-amd64-abi.json