affiliate marketing
Showing posts with label system software. Show all posts
Showing posts with label system software. Show all posts

Saturday, 17 December 2011

Relocation loader using C


IMPLEMENTATION OF RELOCATION LOADER
AIM
To implement relocation loader using C.
ALGORITHM
1.Enter new starting location to which object has ti be relocated.
2.Read the content of the input file as strings one at a time in an array input.
3.Transfer the string read in array input into another array output until it is incremented.
4.Move consecutive next 3 strings into array “output”.
5.Cover current location bit associated with each text record to binary form.
6.Make necessary changes in corresponding words of object code and store the updated object code into array “output”.
7.Move object code for which corresponding  relocation bit is not set directly to the array “output” from array “input” without any change.
8.Repeat step 2 to 8 until end record is encountered.
9.If the object code is in character form ,convert into internal hexadecimal representation.
10.Move object code to specified location in memory
11.Write starting LOCCTR value of block of object code and the corresponding internal hexadecimal representative to the output files.


Absolute loader


IMPLEMENTATION OF ABSOLUTE LOADER
AIM
To implement absolute loader using C.
ALGORITHM
1.Read loader record and filter the starting location and other details.
2.Read the first text record.
3.If the object code is in character form convert it into internal hexadecimal representation.
4.Move object code to specified location in memory.
5.Write starting location couter value of block of object code and corresponding internal hexadecimal representation to the output file.
6.Read next record from the input file.
7.Close all opened files and exit.

PROGRAM:
#include<stdio.h>