Addressing Mode
11
1.7. Relative Addressing Mode
In this addressing mode, the effective address is calculated current address(the contents of PC) and the
contents of address part of instruction. The address part of the instruction is considered as a signed number
which can be either positive or negative. When this number is added to the contents of PC, the result
produces effective address whose position in memory is relative to the address of the next instruction in the
program.
Relative addressing mode is used in branch instructions when the branch address is in the area surrounding
the instruction word itself. It results in a shorter address field in the instruction format since the relatives
address can be specified with a smaller number of bits than the number of bits required to designate the
entire memory address. The relative address from the current address is in the range of -128 ~+127 byte.
PSW Relative
rel
The branch operation is determined by the bit of PSW specified by instruction. The branch address is
obtained by adding the contents of operand to the contents of program counter.
OP CODE
rel
Operand
Instructions
PSW
BCC
BCS
BEQ
BMI
BNE
BPL
BVC
BVS
Unconditioned
BRA
Notes : BRA 0FEH
endless Loop ( Recursive Branch )
Example)
50 30
BCC [30H]
A.bit Relative
A.bit,rel
The branch operation is determined by the bit of accumulator specified by bit7,6,5 of op code. The branch
address is obtained by adding the contents of operand to the contents of program counter.
OP CODE
rel
Operand
Instructions
A
BBC
BBS
+1
+2
PC+30
h
Op code ( 50 )
Operand ( 30 )
MEMORY
( IF C=0,)
( IF C=1,)
+2+30
NEXT