Lab 7 – Stack Pointer & Subroutines

This lab provides an introduction to using the stack and subroutines.  Both of these topics are critical for efficient assembly programing.  The name ‘stack’ gives a very good description of the function of the stack pointer and its use; when something needs to be stored temporarily and will be used again soon it can be placed on the stack.  Just like a stack of papers it can then be taken back off the top of the stack, or more pieces of paper can be placed on top of it.  Once a piece of data becomes buried in the stack each element on top of the desired data must be taken off first before the desired data is reached.  Using this logic it makes sense that the stack should only be used when data will be used in a sequential way, not for general storage.

Download (PDF, 514.63KB)

About the Author