Overview

Our final new topic of assembly will be digging deep into how the call stack is managing everything and what that means for functions and recursion!

Basic Learning Objectives

Before class, you should be able to:

  • Explain the significance of %rsp and %rbp
  • Explain what push and pop do
  • Identify how a recursive function is tracked on the call stack

Advanced Learning Objectives

After class, you should be able to:

  • Explain how the call stack will be changed based on push and pop
  • Explain how %rsp and %rbp manage the call stack

Resources

Read the following:

Checks

Submit your answer to the following to Moodle.

Given this call stack:

Diagram of call stack

Assuming %rsp has a value of 0x110 and %rdi has a value of 0x7890, draw the call stack after the instruction push %rdi is executed. Be sure to also indicate the values in %rsp and %rbx as well.