Lecture: More Detail about Activation Records - Layout of Memory During a Function Call

Jerry Cain - Stanford

 
Previous LectureNext Lecture

Description

Lecture Description

More Detail about Activation Records - Layout of Memory During a Function Call, How the Return Address of a Function is Stored on the Stack, Example Showing How an Activation Record is Constructed on the Stack, Setting Up Function Parameters on the Stack, Using the Call Instruction to Jump to the Function, Cleaning Up at the End of a Function and Using the RET Instruction and the Saved Return Address to Return to the Original Function, General Layout of an Activation Record, Who Sets Up Each Part of the Activation Record, Assembly Code Translation of the Factorial Function, How Recursion Translates into Assembly, Why Registers Need to be Reloaded After Other Functions Are Called, Animation Demonstrating the Assembly Execution for the Factorial Function

Course Description

Topics include: Advanced memory management features of C and C++; the differences between imperative and object-oriented paradigms; the functional paradigm (using LISP) and concurrent programming (using C and C++); brief survey of other modern languages such as Python, Objective C, and C#.

Prerequisites: Programming and problem solving at the Programming Abstractions level. Prospective students should know a reasonable amount of C++. You should be comfortable with arrays, pointers, references, classes, methods, dynamic memory allocation, recursion, linked lists, binary search trees, hashing, iterators, and function pointers. You should be able to write well-decomposed, easy-to-understand code, and understand the value that comes with good variable names, short function and method implementations, and thoughtful, articulate comments.

from course: Computer Science III: Programming Paradigms

Comments

Related Lectures