CSC362 2004S, Class 28: Stack Frames Admin: * Late: Sam * Stack frames have another name in the book (Activiation Records) * Due date for phase 3 extended to a week from Friday * Extra credit for attending awesome Math talk today * Cool "humanities" convo tomorrow (no extra credit) Overview: * Where we are and where we're going * What goes in a stack frame * Layout of stack frames * Interpreting variable references * And more as it comes up Key topics for rest of course will have to do with code generation (and modification) * Immediate issue: Where are my variables Step one: Layout of memory +--------+ 0 | CODE | +--------+ | | | | | | | | | | | | | | +--------+ * Instruction sequences (the code for your program) * Variables * Global variables (exists throughout the program) Available for complete lifetime Accessible to all code * Local variables Limited scope: Only accessible in certain parts of the program When the procedure that owns a local variable terminates, the local variable becomes "garbage"/inaccessible * In some languages, local variables maintain their last value (certain kinds of variables in C, all variables in "traditional" fortran) REMAINDER OF CLASS ON REAL BOARD DUE TO POWER FAILURE