CSE325 SLecture 10 Sub Programs Recursion
CSE325 SLecture 10 Sub Programs Recursion
IMPLEMENTING
SUBPROGRAMS
CSE 325/CSE 425:
CONCEPTS OF
PROGRAMMING LANGUAGE
• Call Semantics:
• Save the execution status of the caller
• Pass the parameters
• Pass the return address to the called
• Transfer control to the called
(CONT.)
• Return Semantics:
• If pass-by-value-result or out mode parameters are
used, move the current values of those parameters to
their corresponding actual parameters
• If it is a function, mode the functional value to a place
the caller can get it
• Restore the execution status of the caller
• Transfer control back to the caller
• Required storage:
• Status information, parameters, return address, return
value for functions, temporaries
(CONT.)