parRet EQU -3
parN EQU -2
fPow PUSH SP, R1 ; save R1
LOAD
R1, parN(FP)
COMP
R1,=1
JEQU One ; return 1 ?
;
return fPow(N-1) * N
SUB R1, =1
; R1 = N-1
PUSH SP, =0 ; ret. value space
PUSH SP, R1
CALL SP, fPow
POP SP, R1 ; R1 = fPow(N-1)
MUL R1, parN(FP)
One STORE
R1, parRet(FP)
POP SP, R1;
restore R1
EXIT SP, =1 ;
1 param.