WCU / Cybersecurity
~/CSC 471/Class 03/KP 07
Class 03 · KP 07 / 21

Anatomy of a Stack Frame

A stack frame is the slice of stack owned by one function call.

  • Return address — pushed by the caller's call.
  • Saved RBP — the caller's frame pointer, saved in the prologue.
  • Saved registers — callee-saved registers the function will clobber.
  • Local variables — addressed relative to RBP or RSP.
  • Outgoing arguments — extra args for functions this one calls.
Key Takeaway

One frame per active call. RBP anchors the current frame; RSP marks its edge.