CS 342 Lecture -*- Outline -*- * Activation records (how to implement subprograms) ** problems saving state of caller (program counter and registers) transmiting parameters ** data structure: the activation record holds all information relevant to subprogram -resumption address (program counter) -dynamic link: pointer to caller's activation record -parameters (storage for formals) -storage for variables and temporaries ** Call steps 1. evaluate actuals and put parameters in callee's AR 2. save state of caller in caller's AR 3. fill in dynamic link of callee with address of caller's AR ** Return steps 1. jump to resumption address in caller's AR (found using dynamic link) 2. restore state from AR