The Call Stack Explained: Call Frames, Return Addresses, Local Variables

The Call Stack Explained: Call Frames, Return Addresses, Local Variables

The call stack is a special stack data structure that your computer uses to manage function calls. Every time a function is called, a call frame is pushed onto the stack containing the return address, function arguments (beyond what fits in registers), preserved registers, and space for local variables. When the function returns, its call frame is popped and execution jumps back to the return address - this is how your program knows exactly where to continue after a function finishes.
Mixed Function Arguments in x86-64 Assembly – Integers & Floats Explained

Mixed Function Arguments in x86-64 Assembly – Integers & Floats Explained

In the System V x86-64 ABI, integer and floating-point arguments use separate register assignment sequences. Integer arguments go into rdi, rsi, rdx, rcx, r8, r9 (then stack), while floating-point arguments use xmm0 through xmm7 independently. This means the first integer you see — even if it appears after several doubles — always goes into rdi, and the second float always goes into xmm1 regardless of how many integers came before it.