created: 06/06/02

# CHAPTER 25 — The Run-time Stack

This chapter discusses the run-time stack and the stack pointer register `$sp`.

#### Chapter Topics:

- Stacks
- The stack pointer register `$sp`
- Push and Pop stack operations.
- The MIPS runtime stack.
- Compiler use of stacks.
- String reversal example.

Note: for the example programs in this chapter, assume that the SPIM simulator has been set so that pseduoinstrictions are ON, delayed branches are OFF, and delayed loading is OFF.

### QUESTION 1:

Say that you need to get a plate from a stack of dinner plates. Which one do you normally get?