You are on page 1of 5

Procedures

Parameter passing through Stack and Recursion


Parameter through Stack
• BP register
• RET n
PROCEDURE FACTORAL (input: N, output: Result)
If N = 1
then
Result = 1
Else
call FACTOTAL (input: N-1, output: Result)
Result = N * Result
END_IF
RETURN
Home work
• Find MAX example on page 359

You might also like