Module 3 (Part1)
Module 3 (Part1)
PC-relative: -2048~2047
In PC relative, TA=(PC)+Disp
Hence Disp=TA-(PC) Base-relative: 0~4095
=0030-0003=002D
Opcode for J : 3F
Displacement(12bit)= FEC
NOBASE
If the base register has to be used for another purpose the programmer must
use NOBASE directive to inform the assembler that the contents of the base
register is not used for addressing.
Translation of Immediate addressing
Translation of Format 4 instructions
This format contains 20 bit address field . No displacement is
calculated.
Sometimes it is required to load and run several programs at the same time.
The system must be able to load these programs wherever there is place in the
memory.
Therefore the exact starting is not known until the load time.
Absolute Program- In this the address is mentioned during assembling itself. This
is called Absolute Assembly.
Apart from the instruction which will undergo a change in their operand address
value as the program load address changes. There exist some parts in the program
which will remain same regardless of where the program is being loaded.
Since assembler will not know actual location where the program will get
loaded, it cannot make the necessary changes in the addresses used in the
program. However, the assembler identifies for the loader those parts of
the program which need modification.
An object program that has the information necessary to perform this kind
of modification is called the relocatable program.
In SIC/XE format 1,2&3 instruction doesn’t contain any address,so they
are relocatable(no need of modification).
The only part of the program that require modification at load time are those that
specify direct addresses(format 4 instructions).
Modification record
Col. 1 M
Col. 2-7 Starting location of the address field to be modified, relative to
the beginning of the program (Hex)
0006 4B
0007 10
0008 10
0009 36
One modification record is created for each address to be
modified
The length is stored in half-bytes (4 bits)
The starting location is the location of the byte containing the
leftmost bits of the address field to be modified.
If the field contains an odd number of half-bytes, the starting
location begins in the middle of the first byte.