Search⌘ K

Functions in Frame Pointers and Local Variables

Learn how the frame pointers are updated during function prolog and epilog.

Function prolog

The sequence of instructions that initializes the %RBP register and makes room for local variables is called a function prolog. One example is pictured below, where func calls func2, which has one local variable var. Sometimes saving necessary registers is also considered part of a function prolog.

Raw stack (no local variables and function parameters)

Now we can understand additional data–the previous %RBP that was equal to the previous %RSP ...