Saturday 17 September 2011

PASS ONE OF DIRECT LINKING LOADER


PASS ONE OF DIRECT LINKING LOADER
AIM:
To implement pass one of direct-linking loader in C language.
ALGORITHM:
1. Enter the location where the program has to be loaded
2. Assign the address got from the user as the first control section address
3. Read the header record of the control section
a. From the details of the header read and store the control section length in a variable
b. Enter the control section name with its address into the external symbol table
4. For each symbol in the subsequent ‘D’ records the symbol must be entered into the
symbol table along with its address, added along with the corresponding control section
until the END record is reached
5. Assign the starting address of next control section as the address of the current control
section plus the length of the control section
6. Repeat the process from step 3 to 5 until there is no more records
OUTPUT:
Enter the location where the program has to be located: 5075
LINKIN.DAT
H PROGA 000000 000070
D LISTA 000040 ENDA 000054
R LISTB ENDB LISTC ENDC
T 000020 10 032010 77100004 15001
T 000054 16 100014 15100006 00002F 100014
M 000024 05 +LISTB
M 000054 06 +LISTC
M 000058 06 +ENDC
M 000064 06 +ENDC
E 000000
H PROGB 000000 000088
D LISTB 000060 ENDB 000070
R LISTA ENDA LISTC ENDC
T 000036 11 03100000 772027 0510030
T 000070 18 100000 05100006 0510020 0510030
M 000037 05 +LISTA
M 000044 05 +ENDA
M 000070 06 +ENDA
M 000074 06 +ENDC
M 000078 06 +ENDC
M 000082 06 +ENDA
E 000000
H PROGC 000000 000057
D LISTC 000030 ENDC 000042
R LISTA ENDA LISTB ENDB
T 000018 12 03100000 77100004 05100000
T 000042 15 100030 100008 100011 100000
M 000019 05 +LISTA
M 000023 05 +LISTB
M 000027 05 +ENDA
M 000048 06 +LISTA
M 000051 06 +ENDA
M 000054 06 +LISTB
E 000000
LINKOUT.DAT
CSect Sym_Name Address Length
PROGA ** 5075 70
** LISTA 50b5 0
** ENDA 50c9 0
PROGB ** 50e5 88
** LISTB 5145 0
** ENDB 5155 0
PROGC ** 516d 57
** LISTC 519d 0
** ENDC 51af 0


RESULT:
Thus pass one of direct-linking loader is implemented in C language.

0 comments:

Post a Comment