Static Allocation for Procedures - II
How do we code the procedure Fact( ) ?
code for
body of
Fact
ST(r28, caller-PC, r31)
LD(r31, caller-PC, r28)
JMP(r28, r31)
Fact-label:
Unnecessary if
r28 not modified
in body of Fact
Can we handle nested procedure calls and recursion
using static allocation?
Previous slide
Next slide
Back to first slide
View graphic version