






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























COMP 524 Programming Language Concepts Aaron Block March 8, 2007 Based on notes by N. Fisher, F. Hernandez-Campos, and D. Stotts
A A A A Return Address Misc. Bookkeeping Local Variables Temps sp fp fp A Stack growth 1001: A( 3 ) ... 2001: int A(int n){ int m = n *n; return m + A(n-1); }
Arguments & returns n m
8 Saved Register Local variables and temporaries Space to build argument lists fp,sp Arguments & Returns Current frame Previous frame
16 Subroutine B Subroutine A (called from main) Subroutine Bar sp fp A & B Return Ad Subroutine foo
17 Subroutine B Subroutine A (called from main) Subroutine Bar sp A & B Return Ad Subroutine foo
19 Subroutine B Subroutine A (called from main) Subroutine Bar sp A & B Return Ad Subroutine foo