A stack is an array or list structure of function calls and parameters used in modern computer programming and CPU architecture. Similar to a stack of plates at a buffet restaurant or cafeteria, elements in a stack are added or removed from the top of the stack, in a “last in first, first out” or LIFO order. The process of adding data to a stack is referred to as a “push,” while retrieving data from a stack is called a “pop.” This occurs at the top of the stack. A stack pointer indicates the extent of the stack, adjusting as elements are pushed or popped to a stack. When a function is called, the address of the next instruction is pushed onto the stack. When the function exits, the address is popped off the stack and execution continues at that address.

File Download and Detail:

  • Lab Instruction
  • Quiz
  • Slides