COMPSCI 61C Lecture Notes - Lecture 10: Call Stack, Exit Procedure, Memory Address

40 views4 pages

Document Summary

Calling function can rely on values being unchanged when the called function returns. Caller cannot rely on values being unchanged, so the caller must save them if needed across a function call. Return value registers , , argument registers - , - , . C has two storange classes: automatic and static. Automatic variables are local to function and discarded when function exits. Static variables exist across exits from and entries to procedures. Use the stack for automatic (local) variables that don"t t in registers. Use the stack for all callee-saved registers used in the function and restore those values upon function exit. Procedure frame / activation record: segment of stack with saved registers and local variables. Some mips compilers use a frame pointer to point to rst word of frame aka top of stack (not usually used because frame pointer is usually in reference to stack pointer)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents