Questions : 1. With example explain the different addressing modes of 8085 and the different types of instruction. 2. What are the different addressing modes in 8085 microprocessor ? Explain it with an example. 3. Explain the addressing modes of 8085 microprocessor with example for each.
Addressing Modes
AU
: Dec.-04, 12, 14, 15, 16, 17, 19, May-17, 18]
Part
of the programming flexibility for each microprocessor is the number and
different kind of ways the programmer can refer to data stored in the memory.
The different ways that a microprocessor can access data are referred to as
addressing modes. The 8085 has 5 addressing modes. These are :
1.
Immediate 2. Register
3.
Direct 4. Indirect 5. Implied
1.
Immediate addressing mode :
In
an immediate addressing mode, 8 or 16 bit data can be specified as a part of
instruction. In 8085, the instructions having T letter fall under this
category. T indicates immediate addressing mode.
Example :
MVI
A, 20 H ; Moves 8 bit immediate data (20H) into accumulator
MVI
M, 30 H ; Moves 8 bit immediate data (30H) into the
; memory location
pointed by HL register pair.
LXI
SP, 2700H ; Moves 16 bit immediate data (2700H) into SP.
LXI
D, 10FFH ; Moves 16 bit immediate data (10FFH) into DE
;
register pair ( D = 10H and E = FFH).
2.
Register addressing mode :
The
register addressing mode specifies the source operand, destination operand, or
both to be contained in an 8085 registers. This results in faster execution,
since it is not necessary to access memory locations for operands.
Example
:
MOV
A, B ; Moves the contents of register B into the accumulator.
SPHL
; Moves the contents of HL register pair into stack pointer.
ADD
C ; Adds the contents of register C into the contents of accumulator ; and
stores result in the accumulator.
3.
Direct addressing mode :
The
direct addressing mode specifies the 16 bit address of the operand within the
instruction itself. The second and third bytes of instruction contain this 16
bit address.
Example
:
LDA
200H ; Loads the 8 bit contents of memory location
;
2000H into the accumulator.
SHLD
3000H ; Stores the HL register pair into two consecutive memory
;
locations. Lower byte i.e. the contents of L register into memory
;
location 3000H and higher byte i.e. the contents of H register
;
into memory location 3001H.
4.
Indirect addressing mode :
In
indirect addressing mode, the memory address where the operand located is
specified by the contents of a register pair.
Example
:
LDAX
B ; Loads the accumulator with the contents of ; memory location pointed by BC
register pair.
MOV
M, A ; Stores the contents of accumulator into the ; memory location pointed by
HL register pair.
5.
Implied Addressing Mode :
In
implied addressing mode, opcode specifies the address of the operands.
Example
:
CMA ; Complements contents of accumulator.
RAL ; Rotates the contents of accumulator left
through cany.
Note
:
Many of the advanced processors support addressing mode called index addressing
mode. In this mode, the address of the operand within the memory is generated
by adding the offset/displacement to the register specified in the instruction.
The offset/displacement is also a part of the instruction. In 8085 such
addressing mode is not available. However, we can implement such kind of
program structure, by using memory pointer (HL register), any other register
pair and a instruction sequence given below :
LXI
H, Baseaddr ; Loads the base address
LXI
B, Offset/Displacement ; Loads the offset
or displacement
DAD
B ; Gives the addition of HL and BC in HL register pair.
MOV
A, M ; Load the data from memory in the accumulator
By
incrementing or decrementing contents of BC register or loading another
contents, we can change the index/offset/displacement
Review Questions
1. With example
explain the different addressing modes of 8085 and the different types of
instruction.
AU : Dec.-04, 19,
Marks 16
2. What are the
different addressing modes in 8085 microprocessor ? Explain it with an example.
AU : Dec.-12, 14,
Marks 8
3. Explain the
addressing modes of 8085 microprocessor with example for each.
AU : Dec-15, 17, May-17, 18, Marks 8
Microprocessors and Microcontrollers: Unit II: (b) 8085 Instruction Set and ALP : Tag: : - Addressing Modes