100% found this document useful (3 votes)
17K views14 pages

Different Types of Loading Schemes

There are six different Loading Schemes and this document giving the introduction to these loading schemes.

Uploaded by

Chintan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
17K views14 pages

Different Types of Loading Schemes

There are six different Loading Schemes and this document giving the introduction to these loading schemes.

Uploaded by

Chintan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

A. D.

Patel Institute of Technology

Topic : Different Loading Schemes

Subject : System Programming

Name : Dobariya Chintan (170010107013)


: Purabiya Jaydip (170010107046)
Different Loading Schemes

 Different Loading Schemes are:

 Compile-and-Go Loaders  Relocating Loaders

 General Loader Schemes  Linking Loaders

 Absolute Loaders  Relocating Linking Loaders


Relocating Loaders
 A relocating loader loads a program in a designated area of memory, relocates
it so that it can execute correctly in that area of memory and passes control
to it for execution.
 The binary program is stored in a file contains the following:

 A Header record showing the load origin, length and load time execution start
address of the program.
 A sequence of binary image records containing the program’s code. Each binary
image record contains a part of the program’s code in the form of a sequence
of bytes, the load address of the first byte of this code and a count of the
number of bytes of code.
 A table analogous to RELOCTAB table giving linked addresses of address
sensitive instructions in the program.
Linking Loaders
 A modern program comprises several procedures or subroutines together with
the main program module.

 The translator, in such cases as a compiler, will translate them all


independently into distinct object modules usually stored in the secondary
memory.

 Execution of the program in such cases is performed by linking together these


independent object modules and loading them into the main memory. Linking
of various object modules is done by the linker.

 Special system program called linking loader gathers various object modules,
links them together to produce single executable binary program and loads
them into the memory.
 This category of loaders leads to a popular class of loaders called direct-
linking loaders.

 These linking loaders, which link the necessary library functions and symbolic
references.

 Essentially, linking loaders accept and link together a set of object programs
and a single file to load them into the core.

 Linking loaders additionally perform relocation and overcome disadvantages


of other loading schemes.
Compile-and-Go Loaders
 In this type of loader, the instruction is read line by line, its machine code is
obtained and it is directly put in the main memory at some known address.

 That means the assembler runs in one part of memory and the assembled
machine instructions and data directly put into their assigned memory
locations.

 After the completion of loading process, the assembly process assigns the
starting address of the program to the location counter.

 This loading scheme is also called as “assemble-and-go”.

 The typical example is WATFOR-77, it’s a FORTRAN compiler which uses such
“Compile-and-go” scheme.
 Advantages
 This scheme is simple to implement because assembler is placed at one part of
the memory and loader simply loads assembled machine instructions into the
memory.
 Disadvantages
 There is wastage in memory space due to the presence of the assembler.
 The execution time will be more in this scheme as every time program is
assembled and then executed.
General Loader Schemes
 In this loader scheme, the source program is converted to object program by
some translator (assembler). The loader accepts these object modules and puts
the machine instruction and data in an executable form at their assigned
memory.
 The loader usually combines the object codes and executes them by loading
them into the memory, including the space where the assembler had been in
the assemble-and-go scheme.
 Rather than the entire assembler sitting in the memory, a small utility
component called loader does the job.

Fig. General Loader Scheme


 Advantages:
 Saves memory and makes it available for the user program as loaders are smaller
in size than assemblers. The loader replaces the assembler.
 Reassembly of the program is no more needed for later execution of the
program. The object file is available and can be loaded and executed directly at
the desired location.
 This scheme allows use of subroutines in several different languages because the
object files processed by the loader utility will all be in machine language.

 Disadvantages:
 The loader is more complicated and needs to manage multiple object files.
 Secondary storage is required to store object files, and they cannot be directly
placed into the memory by assemblers.
Absolute Loaders
 The absolute loader is a kind of loader in which relocated object files are
created, loader accepts these files and places them at a specified location in
the memory.
 This type of loader is called absolute loader because no relocating information
is needed, rather it is obtained from the programmer or assembler.

 In this scheme, the programmer or assembler should have knowledge of


memory management. The programmer should take care of two things:
1) Specification of starting address of each module to be used. If some modification is
done in some module then the length of that module may vary. This causes a change
in the starting address of immediate next modules, it's then the programmer's duty
to make necessary changes in the starting address of respective modules.
2) While branching from one segment to another the absolute starting address of
respective module is to be known by the programmer so that such address can be
specified at respective JMP instruction.
Fig. Process of Absolute Loader
 Advantages:
 Simple to implement and efficient in execution.
 This scheme allows multiple programs or the source programs written in
different languages.

 Disadvantages
 The programmer must know and clearly specify to the translator (the
assembler) the address in the memory for linking and loading of the
programs. Care should be taken so that the addresses do not overlap.
Relocating Linking Loaders
 Relocating linking loaders combines together the relocating capabilities of
relocating loaders and the advanced linking features of linking loaders and
presents a more robust loading scheme.

 This necessarily eliminates the need to use two separate programs for linking
and loading respectively.

 These loaders can perform relocation and linking both.

 These types of loaders are especially useful in dynamic runtime environment,


where the link and load origins are highly dependent upon the runtime
situations.

 These loaders can work efficiently with support from the operating system
and utilize the memory and other resources efficiently.
Thank You

You might also like