Static Allocation for Procedures
How do we code a call Z = Fact( K ) ?
LD(r31, K, r2)
ST(r2, N, r31)
BEQ(r31, Fact-label, r28)
LD(r31, F, r0)
ST(r0, Z, r31)
Fact will return result
in r0 by convention
Call to Fact,
save caller’s PC
in r28
Move argument value
K to local storage N
Store result in Z
Previous slide
Next slide
Back to first slide
View graphic version