CSCE 2214 Lecture Notes - Lecture 16: Call Stack

22 views3 pages

Document Summary

Lec 16 9-30-16 stack in memory / leaf procedure. Lifo data structure which means last in first out. Stack pointer points to the top element in the stack. Push: place an element on the top of stack and update the pointer. Pop: remove an element from the top of stack and update pointer. General register is used to address the stack. The top of stack grows from a high address to a lower one. Pushing adds data onto the stack which makes the top of the stack a lower address. Pop removes data which makes the address of the top of stack higher. Non-leaf procedure: is both a caller and a callee, can perform instruction and then call on another procedure to perform another instruction. Leaf procedure: is a callee, performs instruction and returns result. Needs to save any arguments and temporaries needed after calling the callee. Restore from the stack after calling the callee.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents