Addressing Modes of 8085 Microprocessor

Instruction
  • Instruction is a command or information given to the MP to perform a given specific task on specified data.
  • Each instruction has two parts: one the task to be performed and the other is data to be operated.
  • The code which specifies what operation to be performed is called operation code or opcode.
  • The data on which operation is performed is called operand.
        E.g. ADD B
        ADD is opcode and B is operand.
  • The complete instruction is combination of opcode and operand.
Addressing Modes
  • Each instruction performs an operation on the specified data. An operand must be specified for an instruction to be executed. The operand may be in the general purpose registers, accumulator or a memory location.
  • The method in which the operand is specified in an instruction is called addressing mode.
  • The various modes used in 8085 microprocessor are:
1. Implied or Implicit or Inherent Addressing
The instructions of this mode do not have operands. For example: 
    EI (Enable Interrupt),
    STC (set the carry flag),
    NOP (No operation)

2. Immediate Addressing
This is the simplest way of addressing. When it executes the instruction will operate on immediate hexadecimal number. The operand is present in instruction in this mode. This mode is used to define and use constants of set initial values of variables. The operand may be 8 bit data or 16 bit data. For example: 
    MVI B, 05H
    LXI B, 7A21H     (B<¬7A and C<¬21)
    ADI 72H

3. Register Addressing
Register direct addressing mode means that a register is the source of an operand for an instruction. It is similar to direct addressing. For example: 
    MOV A, B
    ADD B

4. Direct Addressing
This addressing mode is called direct because the effective address of the operand is specified directly in the instruction. Instructions using this mode may contain 2 or 3 bytes, with first byte as the Op-code followed by 1 or 2 bytes of address of data. Loading and storing in memory use 2 bytes of address while IN and OUT have one byte address. For example: 
    LDA 2035H (A<¬M [2035H])
    STA 2500H (M [2500H]<¬A)
    IN 07H (A<¬port address 07H)

5. Register Indirect Addressing
The address of the operand is specified by register pair.
    LDAX B     (if B=23 and C=50 then A<¬M [2350H])
    STAX D     (if D=30 and E=10 then M [3010H]<¬A)
    MOV A, M     (M=HL; if H=68 and L=32, then A<¬M [6832H)

No comments:

Post a Comment