001 void suba() Prior to calling subb: 002 { 003 int ia1 = 100; 004 int ia2 = 200; 005 printf("suba: begin\n"); Output: 006 subb(); suba: begin 007 printf("suba: returned from subb\n"); 008 } 009 void subb() After call to subb: push return to stmt 007 010 { push locals ib1, ib2 011 int ib1 = 300; 012 int ib2 = 400; 013 printf("subb: begin\n"); 014 subc(); 015 printf("subb: returned from subc\n"); 016 } Output: subb: begin 017 void subc() After call to subc: push return to stmt 015 018 { push locals ic1, ic2, ic3 019 int ic1 = 500; 020 int ic2 = 600; 021 int ic3 = 700; 022 printf("subc: begin\n"); 023 } Output: subc: begin
001 void suba() 002 { 003 int ia1 = 100; 004 int ia2 = 200; 005 printf("suba: begin\n"); 006 subb(); 007 printf("suba: returned from subb\n"); 008 } Prior to calling subb: Output: suba: begin 009 void subb() 010 { 011 int ib1 = 300; 012 int ib2 = 400; 013 printf("subb: begin\n"); 014 subc(); 015 printf("subb: returned from subc\n"); 016 } After call to subb: push return to stmt 007 push locals ib1, ib2 Output: subb: begin 017 void subc() 018 { 019 int ic1 = 500; 020 int ic2 = 600; 021 int ic3 = 700; 022 printf("subc: begin\n"); 023 } After call to subc: push return to stmt 015 push locals ic1, ic2, ic3 Output: subc: begin
stacksPart1.docx