Example: Position-Independent Rom Code - Intel i960 User Manual

Processor compiler
Hide thumbs Also See for i960:
Table of Contents

Advertisement

Position Independence and Reentrancy
The first three instructions compute the difference between the link time
address and load time address of the
For example, if the code section links to begin at address zero, the
subtraction result is the address at which the code section was actually
loaded. Even if the code section links to begin at some other address, the
subtraction result is still the correct value for biasing pointers into the code
section.

Example: Position-independent ROM Code

Imagine designing two circuit boards for use in a new laser printer. ROM
chips on these boards contain type fonts and graphic elements. To provide
alternative printing capabilities, either board inserts into an optional slot in
the printer chassis. Memory allocated for each board is:
board 1
board 2
Although ROM and RAM for each board have different load addresses,
the controlling software for the printer must work correctly with either
board in use. In the printer, kernel ROM and RAM are at fixed addresses
in low memory. A large memory space is set aside for the kernel's ROM
and RAM.
Compiling the ROM code with the PID option and placing the correct bias
values in
makes the optional ROMs relocatable.
g12
section.
.text
20000 - 3ffff
40000 - 5ffff
9
9-3

Advertisement

Table of Contents
loading

Table of Contents