Professional Documents
Culture Documents
CE – TE – SPCC
Mrs. Anindita Achint Khade
Assistant Professor,
Dept. of Computer Engg.,
SIES Graduate School of Technology
1
Mrs. Anindita Khade
2
Mrs. Anindita Khade
3
Mrs. Anindita Khade
TXT CARDS
0 2 4000 RR
0 4 4002 RX
4
Mrs. Anindita Khade
Transfer Vector
6
Mrs. Anindita Khade
The loader
• loads the text and the transfer vector
• loads each subroutine identified in the transfer vector.
• place a transfer instruction to the corresponding subroutine in each entry in the transfer vector.
The execution of the call SQRT statement result in a branch to the first location in the
transfer vector which contains a branch to the location of SQRT.
Program Length
28bytes
Transfer vector
8 bytes
1. the transfer vector increases the size of the object program in memory
2. the loader does not facilitate access to data segments that can be shared
– the transfer vector linkage is only useful for transfers or BSRs
– not well suited for loading or storing external data (data located in another procedure
segment)
4 20 A
5 30 B
6 40 A(A)
7 44 A(B+10)
8 48 A(C-PG2)
9 52 END
12
Mrs. Anindita Khade
Example
Source card Relative address Labels Program
1 0 PG2 START
2 ENTRY C
3 EXTRN A,B
4 16 C
5 24 A(A)
6 28 A(B+20)
7 32 END
13
Mrs. Anindita Khade
Assembler records
• External Symbol Dictionary (ESD) record: Entries and Externals
• (TXT) records control the actual object code translated version of the source program.
• The Relocation and Linkage Directory (RLD) records relocation information
• The END record specifies the starting address for execution
• RLD - Relocation & Linkage Directory. – contains information about those locations in the
program whose contents depends on the address at which the program is placed.
• These information are::
• Location of each constant that needs to be changed due to relocation.
• By what it has to be changed.
• The operation to be performed.
15
Mrs. Anindita Khade
ESD
16
Mrs. Anindita Khade
TXT CARDS
17
Mrs. Anindita Khade
RLD
1 4 + 40
1 4 + 44
3 4 + 48
2 4 - 48
18
Mrs. Anindita Khade
For program 2
19
Mrs. Anindita Khade
ESD
20
Mrs. Anindita Khade
TXT CARDS
21
Mrs. Anindita Khade
RLD
2 4 + 24
3 4 + 28
22
Mrs. Anindita Khade
GEST and LESA
GEST: Prepared by pass 1.This table stores all external symbols and their
corresponding address.
23
Mrs. Anindita Khade
Pass 1:GEST
Symbol Address
PG1 104
A 124(104+20)
B 134(104+30)
PG2 156(104+32)
C 172(156+16)
IPLA=104
ILA=104+52==156
= 156+32
188
24
Mrs. Anindita Khade
Pass 2 : LESA for PG1 and PG2
ID Value
1 104
2 156
3 172
ID Value
1 156
2 124
3 134
25
Mrs. Anindita Khade
Example
Dividing the loading process into two separate programs a binder and a module loader can solve
these problems.
28
Mrs. Anindita Khade
Design of Direct Linking Loader
• Pass 1
• Allocate Segments
• Initial Program Load Address (IPLA)
• Assign each segment the next table location after the preceding segment.
• Define Symbols
• SD
• LD
• ER?!
33
Mrs. Anindita Khade
PASS 2
34
Mrs. Anindita Khade
Formats of Data Bases
35
Mrs. Anindita Khade
36
Mrs. Anindita Khade
This is used to save space and also increases the processing speed
37
Mrs. Anindita Khade
Allocate Segments
and Define
Symbols
Dr.Mrs.
Monther Aldwairi 38
Anindita Khade
Pass 2: load text and relocate/link
Dr.Mrs.
Monther Aldwairi 40
Anindita Khade
Pass 2
• END: The execution start address is relocated by the PLA
• The Program Load Address is incremented by the length of the segment and saved in
SLENGTH, becoming the PLA for the next segment.
• LDT/E0F record
• The loader transfers control to the loaded program at the address specified by current
contents of the execution, address variable (EXADDR)
42
Mrs. Anindita Khade
OTHER LOADING SCHEMES
These includes Binders, linking loaders, Overlays & Dynamic loaders.
• Binders:: - A Binder is a program that performs the same functions as that of a direct-
linking
• loader in binding subroutines together, but rather than placing the relocated & linked text
directly into memory, it outputs the text as a file or a card deck.
• This o/p file to be loaded is called as “load-module”.
The functions of binders are :
Allocation, Relocation, Linking & Loading.
There are 2 major classes of Binders::
Core – image module.( fast & simple)
Linkage Editor.(complex)
43
Mrs. Anindita Khade
Dynamic Loading overlays
• Each of the previous loader schemes assume that all of the subroutines are
loaded into core at the same time.
• It the total amount of memory available is less than memory required by all needed
subroutines, then there will be trouble
• Usually different subroutines are needed at different times. E.g. PASS1 & PASS2 of
assembler are mutually exclusive.
• Both can be loaded one after another, need not to be loaded at the same time.
• By determining which subroutines call another, which are exclusive , we can produce an
overlay structure, that will help to use memory economically.
44
Mrs. Anindita Khade
45
Mrs. Anindita Khade
Thank You!
(aninditak@sies.edu.in)
46
Mrs. Anindita Khade