Saturday 17 September 2011

PASS TWO OF DIRECT LINKING LOADER


PASS TWO OF DIRECT LINKING LOADER
AIM:
To implement pass two 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
i. From the details of the header read and store the control section length in a
variable
ii. 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
DLL_IN.TXT
H PROGA 000000 00003A
D LISTA 000030 ENDA 000050 .
R LISTB LISTC ENDC
T 000000 1D 172027 4B100000 032023 290000 332007 4B100000 3F2FEC 032016 0F2016
T 00001D 0D 010003 0F200A 4B100000 3E2000
M 000004 05 + LISTB
M 000011 05 + LISTC
E 000000
H PROGB 000000 00002E
D LISTB 000060 ENDB 000070 .
R LISTA ENDA
T 000000 1D B410 B400 B440 77201F E3201B 332FFA DB2015 A004 332009 57900000 B850
T 000020 0E 3B2FE9 13100000 4F0000 F1000000
M 000007 05 + LISTA
M 000022 05 + ENDA
E 000000
H PROGC 000000 00001C
D LISTC 000030 ENDC 000042 .
R LISTA ENDA
T 000000 1C B410 77100000 E32012 332FFA 53900000 DF2008 B850 3B2FEE 4F000005
M 000006 05 + LISTA
M 000013 06 + ENDA
E 000000
ESTAB.TXT
PROGA - 003000 000063
- LISTA 003030 -
- ENDA 003050 -
PROGB - 003063 00007f
- LISTB 0030c3 -
- ENDB 0030d3 -
PROGC - 0030e2 000051
- LISTC 003112 -
- ENDC 003124 –
MEMORY.TXT
3000 1720274B 1030c303 20232900 00332007
3010 4B103112 3F2FEC03 20160F20 16010003
3020 0F200A4B 1000003E 2000B410 B400B440
3030 77205013 201B332F FADB2015 A0043320
3040 09579000 00B850xx x3B2FE91 30305004
3050 F0000F10 00000B41 07710000 0E050423
3060 32FFA539 00000DF2 008B0034 02FEE4F0
3070 00005

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

0 comments:

Post a Comment