Professional Documents
Culture Documents
(ii) Linking:
Combining two or more separate object programs and supply the information needed to
allow references between them.
(b) (i) Write the Modification Records for the instructions in this program that will need to be
relocated.
M^000021^05+NEWPRG
M^00002E^05+NEWPRG
M^000041^05+NEWPRG
(c) Write the object listing for this program assuming that Relocation will be done by using Relocation Bits.
H^NEWPRG^000000^000053
Saturday 2nd May, 2015
T^000000^2D ^020^17202D^69202D^----332007
T^00002D^1A^820^4B10105D^3F2FEC^03010 – 454F46
END
(ii) CSADDR
The starting address assigned to the control section currently being scanned by the loader
(iii) CSLTH
Length of a Control Section
(iv) ESTAB
External Symbol Table: Stores names and addresses of each external symbol in the set of
control sections being loaded. It also indicates in which control section the symbol is
defined.
(b) Assume that the three programs MAK, MUBS AND KLA shown here below are to be linked together and
that the beginning linking address in memory will be 5000. Construct an External Symbol Table for these
programs and hence calculate the value of MAK1 + MUBS2 – KLA1
(c) Use examples to explain when you may need to use the following Loader Options
(i) INCLUDE
To allow selection of an alternative source of input e.g. INCLUDE program_name
(library_name) directs the loader to read the designated object program from a library.
(ii) CHANGE
To change the name of an external symbols e.g. CHANGE name1, name2 causes the
external symbol name1 to be changed to name2 wherever it appears in the object
programs
(b) Assume the following grammar for the PASCAL compiler and construct a Top Down parse tree for the
expression X := Y DIV 50.
<assign>
<exp>
<term>
<term>
<factor> <factor>
id := id DIV int
{X} {Y} {50}