Thursday, 31 May 2012

Self Relocating Programs


A self-relocating program is a program which can perform the relocation of its own address sensitive instructions.
It contains two provisions for relocation
1.A table of information concerning the address sensitive instruction exists as a part of program.
2.Code to perform the relocation of address sensitive instructions also exists as a part of the program. This is called the relocating logic.
The start address of the relocating logic is specified as the execution start address of the program.
The relocating logic gains control when the program is loaded in memory for execution.  It uses the load address and the information concerning address sensitive instructions to perform its own relocation.
A self relocating program can execute in any area of the memory.
This is very important in time sharing operating system where the load address of a program is likely to be different for different executions.

1 comment: