CPSC 2310 - DAY 17 OCTOBER 12, 2016 ================================================================================ [ ] - INDICATES MEMORY ADDRESSES ^ needs to be an address in memory make sure that the number of registers that are pushed are also poped from the stack at the end. Parameters can easily be stored in memory Passing parameters on the stack is similar to passing parameters in memory the subroutine uses a dedicated register call-by-value .input parameters (declared with "IN") in Ada .default method parameters in C, C++, and Pascal .parameters of primitive type in java call-by-value-result .in/out parameters (declared with "IN OUT" in Ada call-by-reference .large array paramenters in Ada .array parameters in C and C++ .reference parameters declared with & in C++ .object parameters in Java Call-by-value .Copy values of a actual parameters into memory locations of formal parameters before executing the body of the subroutine, do nothing on return EX: main a=1 b=2 call subr(a,b) pass 1,2 via the stack print a,b //print 1,2 subr(x,y) x = x+1 y = x + y return