A.2 Calling Convention
| Purpose | Registers |
|---|---|
| Arguments (1-6) | rdi, rsi, rdx, rcx, r8, r9 |
| Return value | rax |
| Caller-saved | rax, rcx, rdx, rsi, rdi, r8-r11 |
| Callee-saved | rbx, rbp, r12-r15 |
Additional arguments beyond 6 are passed on the stack.