Addressing Mode
Addressing Mode
The different ways in which the location of an operand is specified in our instruction
are addressing modes.
Some terms :
$ - with respect to program counter / relative to P.C
# - constant
@ - Indirect
Addressing Mode:
1. Implied Mode: Definition of the instruction gives operand.
Example :- comp acc , zero add instn (ADD)
(stack orgn)
# Definition itself implied Operand.
For example it clear that comp acc definition says that operation location in
acc .
Move R, #20
we immediate get operand in this inst n .
used in
1. Initializing reg to a constant value.
2. Data constant.
Move R # 20 let’s see the inst n in 16 bit
Byte addressable memory is a memory where we address each and every byte.
Word addressable memory: Here word size is not fixed, may be 1 word = 1 Byte, 1
word = 2 Byte or 1 word = 4 byte.
Let 1w = 2B
# Actually program counter specify an inst n, and fetch the inst n, program counter
again increment by step size.
So, in example step size = 2.
i.e. PC = PC + 2.
Now PC = PC +2. (step size)
1st case: - Inst n size = 1B.
But if inst n size =2B, and we are using byte addressable memory then
And have step size d = 2 (because instruction size = 16 bit = 2 byte) and PC –> PC + 2.
3. Register Addressing Mode: From name it is clear that we will get operant
from register. Here register is identify by register address or register name,
like R 1 – Register.
4. Register Indirect Mode:
# here also used one memory reference become one time we go to memory to fetch
the operand.
Used in: Pointer.
ADD r1 , (r2) + [ it is post increment , so , fixed fetch the value of operand , Meaning
from address which store in register r 2 , after that auto increment by step size ].
# d :- depend on the size of the operand accessed.
E.A= � + �
=1000+2
Add field of instn define beginning address of an array.
int Q[5]
size(int)=2
=1004
E.A=2000+4=2004
Q . An instn is stored at location 300 with it’s Add field at location [Link] address
field has value 400. A Processor Reg R1 contains the Number 200. Evaluate the
effective Address (E.A)
if addressing mode of the instn is
(1) Direct (2) Immediate (3) relative (4)Reg indirect
1) Direct addressing in definition address of the operand directly define so, here
E.A=400
2) Immediate addressing mode- itself content operand value which is 400 here and
what is address if 400 is 301 so E.A=301
3) In Relative addressing here we fetch instn 400 and store it to instn 400 and store it
to instn
Rag and increment pc by step no(here 2) so, right now PC = 302
And here � = 400 so , E.A = � + �
= 400 + 302
= 702
4. Indirect Register Address: register content holds address of the operand. So, here
R 1 = 200 (Address of the operand)
So , E.A = [ R 1 ] = 200