Addressing modes of 8085 microprocessor


Addressing modes of 8085:
Each instruction to the microprocessor contains the operation to be performed and the data (operand). The data may be stored anywhere like register, memory and I/O unit. The address of operand can be provided using various ways. The various ways of specifying the operands are called addressing modes i.e. addressing modes specify where the operands are located.

8085 microprocessor has five different addressing modes which are given below:
                    i.            Direct addressing
                  ii.            Register addressing
                iii.            Register indirect addressing
                iv.            Immediate addressing
                  v.            Implied addressing

The explanation of above addressing modes is given below:
i.                    Direct addressing:
In this mode, the address of the operand is given in the instruction itself. This type of addressing mode generally contains two or three bytes instruction. Eg:-
      OUT 40H
      LDA 8010H
      CALL 8050H
ii.                  Register addressing:
In this mode, operands are specified in the general purpose register of register pair. Eg:-
      MOV B, D
      ADD B
      DAD B
iii.                Register Indirect addressing:
In this mode, a register pair stores the address of the operand. Then, the operand is accessed indirectly via register pair. Eg:-
      MOV B, M
      STAX B
      LDAX D
iv.                Immediate addressing:
In this mode, the data is specified in the instruction immediately after operation code. It generally contains two or three byte instructions. Eg:-
      MVI A, 25H
      LXI B, 1234H
v.                  Implied or Inherent addressing:-
In this mode, the operand is implied in the instruction itself. There is no need to define any operand. Eg:-
      STC                 ; Set carry flag
      CMC               ; Complement carry flag

The addressing modes help in understanding the mnemonics. For example, in the case of the MVI opcode, the letter ‘I’ suggests that the second byte is data not a register. Similarly, in LDA 9000H opcode, the letter ‘D’ suggests that the second and third byte refer to an address.
Some examples:
1.      The instruction ADD B has operand A as implied addressing and operand B as register addressing.
2.      In the instruction, MOV D, M one operand is register addressing and another is register indirect addressing.
Analogy:
The addressing modes can be understood using the following analogy. While eating in the restaurant, we may make the following requests and orders:
1.      Immediate addressing—MVI R, Data (Pass the butter)
2.      Register addressing – MOV Rd, Rs (Pass the bowl)
3.      Direct addressing – IN/OUT Port (Combination number 17 on the menu)
4.      Register indirect addressing – MOV B, M (I will have what John ordered)



For additional information, you can refer to Ramesh Gaonkar book on 8085 microprocessor.


Comments

Popular posts from this blog

Binary Search

System Bus

Differences between hardwired and micro-programmed control unit