The document discusses different types of addressing modes used in computer architecture. It describes 8 types of addressing modes: register, register indirect, immediate, direct, indirect, implicit, relative, and indexed. For each type, it provides an example instruction, brief explanation of how that addressing mode works, and diagram illustrating the addressing mode. It also discusses auto-increment and auto-decrement addressing modes.
1. Assignment on
TOPIC: Different types of Addressing Modes
Course code: CSE322
COURSE TITTLE: Computer Architecture & Organization
SUBMITTED TO
Dewan Mamun Raza
Lecturer in Department of CSE
Daffodil InternationalUniversity
SUBMITTED BY
Nusrat Jahan Tamanna
SEC: 0-2
Date of submission: 2.08.2020
Addressing modes:
2. Addressing modes are nothing but the different ways in which the
location of an operand can be specified in an instruction. The number
of addressing modes that a processor supports changes according to
the instruction set it is based on, however there are a few generic ones
that are present in almost all processors and are thus of utmost
importance.
They are as follows:
• register (or register-direct) addressing: R1
• register indirect addressing: M[R1]
• immediate addressing: data
• direct (or absolute) addressing: M[address]
• indirect addressing: M[M[address]]
• implicit addressing: default location
• relative & indexed addressing: M[R1+address]
• pre-decrement, post-decrement, pre-increment, ...
(1)Register (or register-direct) Addressing:
In register mode ,a register contains the operand. The operand is
specified with in one of the processor register. Instruction specifies the
register in which the operand is stored. In register addressing the
operand is placed in one of 8 bit or 16 bit general purpose registers.The
data is in the register that is specifiedby the instruction. Here one register
reference is required to access the data.
Example: Move
MOV C , A C ← A ( Here A is the operand specified in register)
In register,
Add
3. ADD B A ← A + B ( Here B is the operand specified in register)
In register,
Figure:
Figure: Register Addressing Diagram
(2)Register Indirect Addressing:
The instruction specifies the register in which the memory address of operand is
placed. Itdo not specify the operand itself but its location with in the memory
whereoperand is placed. In this addressing, theoperand offsetis placed in any
one of the registers BX,BP,SI,DI as specified in the instruction.
Example:
Move
MOV A , M A ← [[H][L]] Itmoves the data frommemory location specified
by HL register pair to A
4. The 8086 CPU’s let me access memory directly through a register using the
register indirect addressing mode.
Figure:
Figure: Register Indirect Addressing Diagram
(3)Immediate Addressing:
The operand is specified with in the instruction.Operand itself is provided in the
instruction rather than its address. In this mode data is present in address field of
instruction .Designed like one address instruction format.
Note:Limitation in the immediate mode is that the range of constants are restricted by
size of address field.
Example:
Move Immediate-
MVI A , 15h A ← 15h
( Here 15h is the immediate operand Add
Immediate)
ADI 3Eh A ← A + 3Eh (Here 3Eh is the immediate operand)
5. Figure:
Figure: Immediate Addressing Diagram
Example: MOV AL, 35H (move the data 35H into AL register)
(4)Direct (or absolute) addressing:
The instruction specifies the direct address of the operand.Thememory address
is specified wherethe actual operand is. The operand’s offset is given in the
instruction as an 8 bit or 16 bit displacement element. In this addressing mode the 16 bit
effective address of the data is the part of the instruction.Here only one memory
reference operation is required to access the data.
Example:
Load Accumulator
LDA 2805h A ← [2805] Itloads the data frommemory location 2805 to
A.
Store Accumulator STA
2803h [2803] ←A Itstores the data fromA to memory location 2803
Example: ADD AL,[0301] //add the contents of offset address 0301 to AL
Figure:
6. Figure: Direct Addressing Diagram
(5)Indirect Addressing:
The instruction specifies the indirect address where the effective
address of the operand is placed. The memory address is specified
where the actual address of operand is placed. The indirect addressing
mode uses a register to hold the actual address that will finally be used
in data moves ,the register itself is not the address, but rather the
number in the register.
Example:
Move
MOV A, 2802h A ← [[2802]]
It moves the data from memory location
specified by the location 2802 to A.
8. (6)Implicit Addressing:
It is also called inherent addressing mode. The operand is implied by the
instruction. The operand is hidden/fixed inside the instruction. All actions occur in
CPU. Mostof the logical Group instructions belong to this addressing mode. All
actions occur within CPU.
Example:Complement Accumulator CMA
(Hereaccumulator A is implied by the instruction) Complement
Carry Flag CMC (HereFlags register is implied by the instruction) Set Carry Flag
STC (HereFlags register is implied by the instruction).
(7)Relative Addressing Mode:
In relative addressing mode, contents of ProgramCounter PC is added to address
part of instruction to obtain effective address. Theaddress partof the instruction
is called as offsetand it can +ve or – ve. When the offset is added to the PC the
resultant number is the memory location where the operand will be placed.
Example:
Relative Addressing Mode:
9. Figure: Relative Addressing Diagram
(8)Index Addressing Mode:
In index addressing mode, contents of Indexregister is added to address partof
instruction to obtain effective address. The address partof instruction holds the
beginning/baseaddress and is called as base. The index register hold the index
value, which is +ve. Base remains same, the index changes. When the baseis
added to the index register the resultant number is the memory location where
the operand will be placed.
Example:
10. Figure: Indexed Addressing Diagram
(9)Auto-increment or Auto-decrement Addressing Mode:
Itis similar to register indirect addressing mode.Herethe register is incremented
or decremented before or after its value is used.
I. Example: