Assembly and the ABI
x86-64 assembly: registers (rax–r15, rsp, rbp), instructions (mov, add, cmp, jmp, call, ret), addressing modes. The System V AMD64 ABI defines: argument passing (first 6 integer args in rdi, rsi, rdx, rcx, r8, r9; floats in xmm0–xmm7), return value in rax, caller-saved vs callee-saved registers, stack alignment (16-byte at call). volatile tells the compiler a value may change externally — don’t optimize away reads. Memory barriers (__sync_synchronize, atomic_thread_fence) prevent CPU/compiler reordering.