0% found this document useful (0 votes)
2 views13 pages

Addressing Mode

The document discusses various addressing modes used in computer architecture to specify the location of operands in instructions. It covers modes such as Implied, Immediate, Register, Indirect, Auto Increment/Decrement, Direct, Indirect, Relative, Index, and Base Registered Addressing, each with definitions and examples. Additionally, it explains the differences between byte addressable and word addressable memory and provides an evaluation of effective addresses for different addressing modes.

Uploaded by

Debashis Roy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views13 pages

Addressing Mode

The document discusses various addressing modes used in computer architecture to specify the location of operands in instructions. It covers modes such as Implied, Immediate, Register, Indirect, Auto Increment/Decrement, Direct, Indirect, Relative, Index, and Base Registered Addressing, each with definitions and examples. Additionally, it explains the differences between byte addressable and word addressable memory and provides an evaluation of effective addresses for different addressing modes.

Uploaded by

Debashis Roy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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 .

2. Immediate Mode: operand specified in inst n itself.

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

Now memory in two types:


1. Byte addressable memory
2. Word addressable memory

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

Have we address one word (2 Byte)


# Third case we can represent word addressable memory by byte addressable
memory.

# 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

So, here d=2 , then PC  PC +2 ( to set next instruction starting address )


# If instruction size = 3 Byte = 24 bit and we are using byte addressable memory then
d =3
 instruction size = 4 byte = 32 bit and we are using byte addressable memory
then d =4
Now as per previous example (Immediate Addressing Mode).
Move R, #20 and instruction size = 16 bit = 2 Byte

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.

5. Auto increment mode: (used in loop)


This is basically a register indirect mode, after according the operand the content of
the Reg is automatically increment to step size.

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.

Auto – decrement mode: - (used in loop)


Operand value = [ E.A]

5. Auto – decrement mode : - ( used in loop)


The content of Reg specified in the inst n are first automatically decrement
and then used as E.A of the operand.
(-R) Add r1, -(r2) [ pre – decrement ]

# Here we used 1 memory reference.

6. Direct or Absolute Addressing mode: - Address of operand given in inst n

# used to implement variable


(Storage as form of memory)
7. Indirect Addressing Mode ( used in pointer)

# memory reference used here 2


# it is used as pointer ( storage from of memory )
Example : - LOAD r 1 , @1000
7. Relative Addressing Mode: (relative to Program Counter)

So, next instruction will be in 1002, PC = PC + d


Now , instruction fetch and store in instruction register .
And PC now in 1002 ( by increment 2 ) .
So = 2000 ( mentioncal in instruction )
= 1002 ( content of PC right now after increment )
So, E.A = 2000 + 1002 = 3002
Operand value = [E.A] = [ 3002 ]
Used in:
1. Program relocation at runtime.
2. Branch type instruction.
Example:
JMP [ PC + 2000 ]
Index Addressing mode: (used in Array)

OP code Mem add 1000


or base add
� �=offset/displacement
2 index number

E.A= � + �
=1000+2
Add field of instn define beginning address of an array.
int Q[5]
size(int)=2

1000 1002 1004 1008


index- 0 1 2 3 4
so, have Base address=9 array name � = 1000 and � = 2 [Because we want
calculate the value of index 2.]
so, E.A=� + �
1000 2
= + × 2 ���� ����
� �

=1004

(10)Base Registered Addressing Mode: (used in relocation of programming in


memory)
Base Reg

OP Addressing
code Port �
#Hare if we change the base
address like
Displacement relative 3000 then we can totally
relocate the
to Base address Ranges from different location
OP 4 Base Reg
2000
code

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

You might also like