With an algorithm, explain pass1 of a linking loader


Pass 1:

Begin

get PROOADDR from operating system

set CSADDR to PROOADDR {for first control section}

while not end of input do

begin

read next input record {Header record for control section}

set CSLTH to control section length

search ESTAB for control section name

if found then

set error flag {duplicate external symbol}

else

enter control section name into ESTAB with value CSADDR

while record type ~ 'E' do

begin

read next input record

if record type = 'D' then

for each symbol in the record do

begin

search ESTAB for symbol name

if found then

set error flag (duplicate external symbol)

else

enter symbol into ESTAB with value(CSADDR + indicated address)

end {for}

end {while ~ 'E'}

add CSLTH to CSADDR {starting address for next control section}

end {while not EOF}

end {Pass 1}



Share to whatsapp

More Questions from System Software and Compiler Design Module 2

How object program can be processed using linkage editor?
View
Explain the absolute loader and Write its algorithm.
View
Difference Between Linking Loader vs Linkage Editor
View
What is Lexical Analysis?
(or)
Lexical Analysis in Compiler Design with Example
View
Input Buffering in Compiler Design
View
What is dynamic linking? explain the process of loading and calling a subroutine using dynamic linking
View
Roles of the Lexical analyzer
View