A computer performs tasks based on certain instructions provided to it. Instructions provided to a computer are divided into different fields or groups. An instruction contains an operation field, an address field and a mode field.
The mode field indicates how the address of the operand or the operand which is to be used in operation is determined. The addressing modes in 8085 microprocessors are instructions used to transfer data and perform operations on them.
An 8085 microprocessor uses five addressing modes: Immediate addressing mode, Register addressing mode, Register indirect addressing mode, Direct addressing mode, and Implicit addressing mode.
Immediate addressing mode
In this addressing mode, the data on which the operation is to be performed is mentioned in the instruction. Instead of specifying an address, the instruction specifies an operand along with the operation that is to be performed. The instruction is 2 bytes when there is 8-bit data and 4 bytes when there is 16-bit data. Examples of instructions that use immediate addressing mode are:
MVI B 05 – This instruction transfers the data, that is 05, to register B.
JMP address – This instruction moves the execution of the program to the specified address.
LXI H 3000 – This instruction transfers the data, that is, 3000, to the H-L pair register.
Register addressing mode
In this addressing mode, the instruction mentions a register which stores some data. The operation specified by the instruction is performed in the register specified by it. The instruction can also specify two registers. The size of the instructions in register addressing mode is 1 byte. The instruction’s opcode includes both the register and the operation to be performed. Examples of instructions that use register addressing mode are:
ADD B – This instruction adds the data within register B with the data in the accumulator and stores the result in the accumulator.
INR B – This instruction increases the data stored in register B by 1.
MOVE B, D – This instruction moves the content of register D to register B.
PCHL – This instruction transfers the contents stored in the HL pair to the program counter.
Direct addressing mode
In this addressing mode, the instruction specifies some address which stores the data. This memory location is mentioned in the instruction as an operand. The size of an instruction in the direct addressing mode is 3 bytes. However, input/output instructions in direct addressing mode are 2 bytes. Examples of instructions that use direct addressing mode are:
IN 35 – This instruction reads the data from a port. The address of the port is 35.
LHLD address – This instruction loads the data stored in the memory location specified by ‘address’ into the HL pair.
LDA 2050 – This instruction stores the contents of the memory location 2050H into the accumulator.
STA 2050 – This instruction stores the contents of the accumulator in the memory location 2050H.
Register Indirect addressing mode
In this addressing mode, the data on which the operation is to be performed is stored in some memory location. This memory location is specified in a register pair. The instruction then specifies this register pair. Examples of instructions that use register indirect addressing mode are:
LDAX B – This instruction loads the contents stored in the memory location specified by the register pair BC into the accumulator.
LXIH 9500 – This instruction stores the address ‘9500’ into the HL pair.
MOV A, M – This instruction moves the contents stored in the address specified by the HL pair into the accumulator.
Implied/Implicit addressing mode
In this addressing mode, the operand is described implicitly in the definition of the instruction. The operand is specified with the opcode of the instruction. The size of an implied addressing mode instruction is 1 byte. The instructions generally operate on data stored in the accumulator. Examples of instructions that use implied addressing mode are as follows:
RRC – This instruction rotates the contents of the accumulator to the right by one bit.
RLC – This instruction rotates the contents of the accumulator to the left by one bit.
CMA – This instruction complements the content stored in the accumulator. The result is then stored in the accumulator itself.
Conclusion
The different addressing modes in a microprocessor provide different ways in which the instruction specifies the address of the operand or the operand itself. There are five addressing modes in an 8085 microprocessor. Immediate addressing mode is where the instruction includes the operand along with the operation. Register addressing mode in which the instruction mentions a register which stores the data. Direct addressing mode where the operand on which the operation is to be performed is stored within a memory location mentioned in the instruction as an operand. Register indirect addressing mode in which the instruction mentions a register that stores the data’s address. Implied addressing mode, in which the operand is described implicitly in the definition of the instruction.
Also check: