The important aspects of the design of the calling sequence (I) How to divide the calling sequence operations between the e caller and callee At a minimum, the caller is responsible for computing the arguments and placing them in locations where they may be found by the callee (2)To what extent to rely on processor support for calls rather that generating explicit code for each step of the calling sequence
• The important aspects of the design of the calling sequence: (1) How to divide the calling sequence operations between the caller and callee • At a minimum, the caller is responsible for computing the arguments and placing them in locations where they may be found by the callee (2) To what extent to rely on processor support for calls rather that generating explicit code for each step of the calling sequence
7.2 Fully Static Runtime Environments
7.2 Fully Static Runtime Environments
The entire program memory can be visualized as follows Code for main procedure Code for procedure 1 Code area Code for procedure n Global data area Activation record of main procedure Activation record of Data area procedure 1 Activation reco pI rocedure n
The entire program memory can be visualized as follows: Code for main procedure Code for procedure 1 … Code for procedure n Code area Global data area Activation record of main procedure Activation record of procedure 1 … Activation record of procedure n Data area
All data are static, remaining fixed in memory for the duration of program execution For a language such as fortran77, no pointer or dynamic allocation, no recursive procedure calling g The global variables and all variables are allocated statically Each procedure has only a single activation record All variable, whether local or global, can be accessed directly via fixed address
• All data are static, remaining fixed in memory for the duration of program execution • For a language, such as FORTRAN77, no pointer or dynamic allocation, no recursive procedure calling – The global variables and all variables are allocated statically. – Each procedure has only a single activation record. – All variable, whether local or global, can be accessed directly via fixed address
Relative little overhead in terms of bookkeeping information to retain in each activation record And no extra information about the environment needs to be kept in an activation record The calling sequence is simple Each argument is computed and stored into its appropriate parameter location The return address is saved, and jump to the beginning of the code of the callee On return, a simple jump is made to the return address
• Relative little overhead in terms of bookkeeping information to retain in each activation record; • And no extra information about the environment needs to be kept in an activation record; • The calling sequence is simple. – Each argument is computed and stored into its appropriate parameter location; – The return address is saved, and jump to the beginning of the code of the callee; – On return, a simple jump is made to the return address