Professional Documents
Culture Documents
L34 Linking Loader Pass 2
L34 Linking Loader Pass 2
Pass 2
Prepared By: Dr. D. P. Singh
Algorithm (Pass 2)
Begin else if record type = ‘M’ then
set CSADDR to PROGADDR begin
set EXECADDR to PROGADDR search ESTAB for modifying symbol
name
while not end of input do
if found then
begin
add or subtract symbol value at
read next input record {header record} location (CSADDR + specified
set CSLTH to control section length address)
while record type ≠ ‘E’ do else
begin set error flag (undefined
external symbol)
read next input record
end {if ‘M’}
if record type = ‘T’ then
end {while ≠ ‘E’}
begin
if an address is specified {in End record} then
{if object code is in character form,
convert into internal representation} set EXECADDR to (CSADDR + specified address)
move object code from record to add CSLTH to CSADDR
location (CSADDR + Specified address) end {while not EOF}
end {if ‘T’} Jump to location given by EXECADDR {to start execution of
loaded program}
End {pass 2}
Improve Efficiency
• Use local searching instead of multiple searches of ESTAB for
the same symbol
• assign a reference number to each external symbol
• the reference number is used in Modification records
• Implementation
• 01: control section name
• other: external reference symbols
Example