Addressing modes:
An instruction is the command given to the computer to perform an specific task. In assembly language, an instruction has two parts, an operation code (opcode) that tells what operation to be carried out and an data to be operated on (operand). In 8085, operand may be source, destination or both. Source may be register, memory or input port and destination may be register, memory or output port. The various ways of specifying the operands are called addressing modes
Addressing modes are the various ways in which the data to be worked on can be addressed.
There are different addressing modes namely,
Immediate Addressing mode:
In this addressing mode , the operand is the data itself. Here, the data to be worked on is directly passed hence, called immediate.
example : MVI A,23H
Direct Addressing mode:
In this mode, the memory location of the data to be worked on is passed as the operand.
example: LXI H,2050H
Register Direct Addressing mode:
In this addressing mode, the register containing the data is passed in as the operand.Since, the register is directly passed, it's called register direct addressing mode.
example: MOV A,B
Register Indirect Addressing mode:
In this addressing mode, the memory location of the address of the data is passed as the operand. The address of the address is passed instead of the address of the data.
example: MOV A,M
Implied Addressing mode:
In this mode, no operands are passed.
example: NOP
Based Addressing mode:
In this mode, the offset address of the operand is found by the sum of BI or BP with the 8-bit or 16-bit displacement.
example: MOV AX,[BP+06H]
Indexed Addressing mode:
In this mode , the offset address of the operand is found by the sum of SI or DI with the 8-bit or 16-bit displacement.
example: MOV AX,[SI+06H]
Based-Indexed Addressing mode:
In this mode, the offset address of the operand is found by the sum of Index value and the base register.
example: MOV AX,[BI+DI]
Based-Indexed Addressing mode with displacement:
In this mode, the offset address of the operand is found by the sum of Index value and base register along with the 8-bit or 16-bit displacement.
example: MOV AX,[BI+DI+06H]
No comments:
Post a Comment