You are on page 1of 13

Index

1. Introduction
2. Functions of Loader
3. Translation & Linking of Program
4. Loading And Linking Scheme
-Link-And-Go
-Link-Load-And-Go
5. Difference Between ‘Link-And-Go’ & ‘Link-Load-And-Go’

1
Introduction

To execute an object program, we needs


Relocation, which modifies the object program so that it can
be loaded at an address different from the location originally
specified.

Linking, which combines two or more separate object


programs and supplies the information needed to allow
references between them.

Loading and Allocation, which allocates memory


location and brings the object program into memory for
execution.

2
Introduction
» Loader
– It is software processor which perform some low level
processing of the program that form input to it in order to
produce ready to execute program in the machine
language.
» Linking
– Loader performs some processing to put the various
program forms together to make single program is known
as linking.
» Object Program
– It accept output of translator program & uses certain
other similar program called object program.
3
Functions of Loader

1] Locate a program in appropriate area :-


The Basic function of loading is to locate a program in
appropriate area of the main memory of computer every area
of the main memory of computer every time it is to be
executed.
In addition to loading loader performs 2 important functions:-
2] Loading of program to assigned area :-
accept output of translator program form and uses certain other
similar program called object program, it produce 1 ready to
execute machine language program.

4
Functions of Loader

3] Linking of programs with each other :-


Loader performs some processing to put the various
programs forms together to make 1 single program. This is
known as linking.
Linking is necessary because program written by
programmer, generally does not execute on its own without
the presence of other object program in the computer storage.
e.g.
A program written in HLL may contain calls in certain standard
functions like sin, cos, tan etc. which are not coded by
programmer himself. Linking function makes address of program
known to each other, so that such transfer can take place during
execution.

5
Functions of Loader

4] Relocation of a program to execute properly :-


Another Function commonly performed by a Loader is that of
program relocation i.e. Simply moving a program from 1 storage
area to another and modify the location sensitive code (address
sensitive instructions). So that it can execute correctly in a new set
of location; so that call to program by another program can execute
efficiently.

6
Translation & Linking of Program.

Source
program Ready to run
Obj.Program machine lang. program

Computer Result
Translator Loader
System

Other Data
Obj.Program

A program translator binds a program to translation time address.


A loader modifies binding to bind program to load time address.

7
Loading And Linking Scheme

Loading And Linking Scheme :-


As loader perform loading of a program into assigned area,
linkage editor perform linking of a program with each
other, while relocation performs relocation of a program to
execute property.

There are two type of loading scheme :-


1] Link-And-Go.
2] Link-Load-And-Go.

8
1. Link-And-Go

In the Link-And-Go scheme the linkage editor actually situated a


program its load address perform all other linking function and passes
control to the purpose of execution.

Drawbacks of the scheme :-


1) Linkage editor co-exist with the program while perform the linkage
task.
2) Linking has to be repeated for execution of program.

9
9
Link-And-Go

Linkage
Editor
Ready To Execute
Object Program
Module

10
2.Link-Load-And Go:-

The Link-Load-And-Go scheme require less storage because its


construct a ready to execute form of a program and push it’s the
secondary storage. its necessary to load this program into the
main storage without any relocation. such loader is called as
absolute loader.

This loader presents :-


1)Text of program which has been link for desired area.
2)The load address origin.
3)Length of the program.

11
11
Link-Load- And-Go-Scheme

Phase
Object Module Library

Absolute
Linkage Editor
Loader
Ready to Execute
Program

12

12
Difference Between ‘Link-And-Go’ & ‘Link-Load-And-Go’
Link-And-Go Link-Load-And-Go

1) In link and go scheme loader 1) In link and go scheme loader


load the program into main load the program into main
storage perform necessary storage perform necessary
linking with other object module linking with other object module
and transfer the control for cpu and generate ready to run
execution. machine
language program and store
Secondary storage.

2) Linking is necessary every 2) Linking is not necessary every


time when the program time.
execute.

3) Memory requirement is more. 3) Memory requirement is less.

4) Linkage editor co-exits with user 4) Linkage editor is not needed


program every time. co-exit user program every time.

5) Absolute loader is not present. 5) Absolute loader is present. 13


13

You might also like