COMPSCI 61C Lecture Notes - Lecture 10: Opcode, Instruction Set, Electronic Delay Storage Automatic Calculator

57 views5 pages

Document Summary

Contract between anyone writing a function and compilers" functions. To reduce expensive loads and stores from spilling and restoring registers, mips divides registers into two categories: 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 -, - Potential midterm question: callee vs. caller saved registers. C has two storage classes: automatic and static. Automatic variables are local to function and discarded when function exists. 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 then restore those values upon function exit. Procedure frame or activation record: segment of stack with saved registers and local variables.

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