Page 120 - DCAP507_SYSTEM_SOFTWARE
P. 120
System Software
Notes language assembler will translate it to the language and a familiar object file can be
organized with all the ad resolution.
3. The task of loader turns out to be simpler as it simply obeys the instruction concerning
where to position the object code in the main memory.
4. The procedure of execution is efficient.
Disadvantages
1. In this scheme it is the programmer's responsibility to regulate all the inter segment
addresses and manually do the linking activity. For that, it is necessary for a programmer
to know the memory management.
2. If at all any modification is done the some segments, the starting addresses of immediate
next segments may get changed, the programmer has to take care of this concern and he
requires to update the corresponding beginning addresses on any modification in the
source.
Algorithm for Absolute Loader
Input: Object codes and beginning address of program segments.
Output: An executable code for matching source program. This executable code is to be positioned
in the main memory.
Method: Begin
For each program segment do Begin
Read the first line from object module to obtain information about memory
location. The starting address say S in corresponding object module is the
memory location where executable code is to be placed.
Hence
Memory_location = S
Line counter = 1; as it is first line While (! end of file)
For the current object code
do Begin
1. Read next line
2. Write line into location S
3. S = S + 1
4. Line counter Line counter + 1
8.1.4 Subroutine Linkage
To recognize the concept of subroutine linkages, first consider the below scenario:
"In Program A a call to subroutine B is prepared. The subroutine B is not written in the program
segment of A, rather B is defined in some another program segment C"
114 LOVELY PROFESSIONAL UNIVERSITY