Subroutine: _____________________________
|
Subroutine calls
may involve the following steps (in this order):
1. Pass data (parameters) to the
subroutine, store the stack pointer (R6) as the dynamic link,
and compute a new stack pointer for the subroutine's activation record.
Filling in the table at left will help complete these steps.
|
Fill-in the table in
this order:
1. Below the entry for dynamic
link, list (in order of declaration) each
parameter of the subroutine and its size (in words of memory).
|
3. Below the local variables
(if any), list the registers
(besides R6 and R7) whose values may be changed by the subroutine or by
a subroutine called by it. The size of each register should be shown
as 1.
4. Calculate an offset for each entry in the table. The offset of an item is the sum of the offset and size of the item immediately before the current item in the table. 5. Add all the sizes to get the total size of the subroutine's activation record. |