Chapter 6: Runtime System

Example

. Assume each

100: ACTION-l

action

120: MOV 140, 364

block takes 20

132: GOTO 200
bytes of space 140: ACTION-2
.Start address 160: HALT
of code for c :
and p is 200: ACTION-3
100 and 200 220: GOTO *364
. The activation :
records 300:
arestatically 304:

allocated starting

:
at addresses 364:
300 and 364. 368:

This example corresponds to the code shown in slide 57. Statically we say that the code for c starts at 100 and that for p starts at 200. At some point, c calls p. Using the strategy discussed earlier, and assuming that callee.staticarea is at the memory location 364, we get the code as given. Here we assume that a call to 'action' corresponds to a single machine instruction which takes 20 bytes.