Sei sulla pagina 1di 26

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : A Rajeswara rao
Designation : Head
Branch : Computer Engg.
Institute : GMR Polytechnic, Karimnagar
Year/Semester : III Semester
Subject : Computer Architecture
Subject Code : CM-303
Topic : Information Representation
Arithmetic operations
Duration : 50 mts
Sub. Topic : Addressing modes
Teaching Aids to be used : Animation clips& Images, PPT
CM303.22 1
Objective

•On completion of this period, you would be able to know

•Different addressing modes


On completion of this period, you would be able to know

CM303.22 2
RECAP

In the previous class, you have learnt about


• Differences between fixed point & floating point
numbers.
• Various ways of representing fixed point &
floating point numbers

CM303.22 3
Memory location
Address is the representation of memory location/register
which stores the data/operand. It is the set of binary (hex)
digits. In case of memory location, each location contains
one byte of data. The register contains one or more bytes
depending on the Microprocessor .

Eg:
2000H
12 H 2050H
are two memory addresses in
Reg A
memory map of 8085

CM303.22 4
Memory location
Contd..
Representation of memory locations with respect
to 8085 microprocessor is as shown below

0000H 11H
0001H A3H
.
.
2001H CHA
2000H E1H

FFFFH
CM303.22 5
Memory location Contd..
The way of representing the address of an operand in
the instruction is called addressing mode.
The different addressing modes are:
1. Implied mode

2. Immediate addressing mode

3. Register addressing mode

4. Direct addressing mode

5. Indirect addressing mode

CM303.22 6
1. Implied mode:
In this mode operands are specified implicitly
with in the instruction

Eg.
The instruction
CMA : complement accumulator
A (A)’

Here the operand is accumulator which is not specified


directly in the instruction

CM303.22 7
2. Immediate mode:
In this mode the value of the operand is specified with
in the instruction

Eg:
MVI A,01H; Move Immediate 01H to accumulator.
It instructs the computer to move the hex value 01H
into the accumulator.

11H 01H
Reg A Reg A
Before execution After execution
of an instruction of an instruction
CM303.22 8
3. Register mode
In this mode the register holding the value of the operand is
specified with in the instruction

Eg: MOV A,B;


It instructs the computer to move the value stored in
Reg. B into the accumulator.

22H
11H
Reg A
Reg A
22H
22H
Reg B
Reg B After execution
Before execution of instruction
of instruction CM303.22 9
4. Direct addressing mode: contd..

In this mode the address of the memory location holding the


operand is specified with in the instruction

Examples:

LDA 2050H ; Load Direct Accumulator through address.

It instructs the computer to move the value stored


in memory location 2050H into the accumulator

CM303.22 10
. Examples for Direct addressing mode
11H 0000H aaH A M(2050H)
33H
0001H bbH
Reg A Reg. A
.
2050H 33H

Before execution After execution


of instruction of instruction

CM303.22 11
5. Indirect addressing mode:
In this mode the register[s] holding the address of the memory
location holding the operand is specified with in the instruction.
Instructions under this category are

a) Register indirect mode


b) Auto increment / Auto decrement mode
c) Relative addressing mode
d) Indexed addressing mode
e) Base register addressing mode

CM303.22 12
a) Register indirect mode:

In this mode the register holding the address


of operand is specified with in the instruction

CM303.22 13
a) Register indirect mode:
Eg: LDAX B;Load acc. indirectly through the address
in register; pair BC
A M(BC)
12H 0000H 00H 21H
accumulator 0001H 11H accumulator
.
20 50
.
B C 2050H 21H
.
FFFEH 33H
FFFFH 44H
CM303.22 14
b) Auto increment / Auto decrement mode:

This is similar to register indirect mode except


that the register is incremented or decremented
after or before its value is used to access the
memory.

CM303.22 15
c) Relative addressing mode:

• In this mode , the content of the specified


register is added to the address part of the
instruction to get effective address

CM303.22 16
c) Relative addressing mode:

Eg: mov al,100[BX]; AL M((BX)+100H)

11H 0000H 00H


AL register 0001H 11H 21H
.
. AL register
20H 00H
2100H 21H
BX register .

CM303.22 17
d) Indexed addressing mode

In this mode , the content of the specified index


register is added to the address part of the
instruction to get effective address.

CM303.22 18
d) Indexed addressing mode
Eg: mov bl,200[SI]; BL M((BX)+100H)

11H 0000H 00H 99H


BL register 0001H 11H
. BL register
.
30H 00H
3100H 99H
SI register .

CM303.22 19
e) Base register addressing mode

• In this mode , the content of the base register is


added to the address part of the instruction to
get effective address.

CM303.22 20
e) Base register addressing mode
Eg: mov BX,300[BP]; BX M((BP)+300H)

11H 22 0000H 00H


0001H 11H 23H 10H
BX register
.
BX register
.
20H 00H
2300H 10H
.
BP register
2301H 23H

CM303.22 21
Summary

In this class you have learn


•The different addressing modes

CM303.22 22
Frequently asked questions

• Write and explain the different addressing


modes

CM303.22 23
Quiz

CM303.22 24
1.The indirect addressing mode can be specified
into ------ categories

a) 3
b) 4
c) 5
d) 6

CM303.22 25
2. In indexed addressing mode , the ______
register contents are added to get effective
address.

• Base
• Index
• Accumulator
• none

CM303.22 26

Potrebbero piacerti anche