Adressing Mode - 2

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

Addressing modes in 8085 microprocessor

Addressing modes

Addressing mode specifies a rule for interpreting or


modifying the address field of the instruction before the
operand is actually executed.
Types of addressing modes
In 8085 microprocessor there are 5 types of addressing modes:
1. Immediate Addressing Mode
In immediate addressing mode the source operand is always
data. If the data is 8-bit, then the instruction will be of 2 bytes, if
the data is of 16-bit then the instruction will be of 3 bytes.
Examples:
MVI B 45 (move the data 45H immediately to register B)
LXI H 3050 (load the H-L pair with the operand 3050H
immediately)
JMP address (jump to the operand address immediately)
2.Register Addressing Mode
In register addressing mode, the data to be operated is
available inside the register(s) and register(s) is(are)
operands. Therefore the operation is performed within
various registers of the microprocessor.

Examples:
MOV A, B (move the contents of register B to register A)
ADD B (add contents of registers A and B and store the result
in register A)
INR A (increment the contents of register A by one)
3.Direct Addressing Mode
In direct addressing mode, the data to be operated is
available inside a memory location and that memory
location is directly specified as an operand. The operand is
directly available in the instruction itself.
Examples:
LDA 2050 (load the contents of memory location into
accumulator A)
LHLD address (load contents of 16-bit memory location into
H-L register pair)
IN 35 (read the data from port whose address is 35)
4.Register Indirect Addressing Mode
In register indirect addressing mode, the data to be operated
is available inside a memory location and that memory
location is indirectly specified by a register pair.

Examples:
MOV A, M (move the contents of the memory location pointed
by the H-L pair to the accumulator)

LDAX B (move contents of B-C register to the accumulator)

LXIH 9570 (load immediate the H-L pair with the


address of the location 9570)
5.Implied/Implicit Addressing Mode –
In implied/implicit addressing mode the operand is
hidden and the data to be operated is available in the
instruction itself.
Examples:
CMA (finds and stores the 1’s complement of the
contains of accumulator A in A)
RRC (rotate accumulator A right by one bit)
RLC (rotate accumulator A left by one bit)
Computer Organization
Instruction Formats (Zero, One, Two and Three Address
Instruction)
Computer perform task on the basis of instruction provided. An instruction in
computer comprises of groups called fields. These field contains different
information as for computers every thing is in 0 and 1 so each field has
different significance on the basis of which a CPU decide what to perform.
The most common fields are:

•Operation field which specifies the operation to be performed like addition.


•Address field which contain the location of operand, i.e., register or memory
location.
•Mode field which specifies how operand is to be founded.

An instruction is of various length depending upon the number of addresses


it contain. Generally CPU organization are of three types on the basis of
number of address fields:
1.Single Accumulator organization
2.General register organization
3.Stack organization
In first organization operation is done involving a special
register called accumulator. In second on multiple registers are
used for the computation purpose. In third organization the
work on stack basis operation due to which it does not contain
any address field. It is not necessary that only a single
organization is applied, a blend of various organization is mostly
what we see generally.
Zero Address Instructions –

A stack based computer do not use address field in instruction. To evaluate a expression
first it is converted to revere Polish Notation i.e. Post fix Notation. Also called stack
organization
One Address Instructions –

This use a implied ACCUMULATOR register for data


manipulation. One operand is in accumulator and other is in
register or memory location. Implied means that the CPU
already know that one operand is in accumulator so there is no
need to specify it. SINGLE ACCUMULATOR ORGANIZATION
• It uses AC register for all data manipulation

• It uses AC register for all data manipulation

• Instruction: ADD X

Microoperation: AC ←AC + [X]


Two Address Instructions

This is common in commercial computers. Here two address can


be specified in the instruction. Unlike earlier in one address
instruction the result was stored in accumulator here result can
be stored at different location rather than just accumulator, but
require more number of bit to represent address.

• Two address registers or two memory locations are specified


• Assumes that the destination address is the same as that of the first operand.

• Instruction: ADD R1, R2


Three Address Instructions

This has three address field to specify a register or a memory


location. Program created are much short in size but number of
bits per instruction increase. These instructions make creation
of program much easier but it does not mean that program will
run much faster because now instruction only contain more
information but each micro operation (changing content of
register, loading address in address bus etc.) will be performed
in one cycle only.
• Instruction: ADD R1, R2, R3

You might also like