ADRESSING MODES OF 8086
The term addressing modes refers to the way in which the operand of an instruction is specified. Information contained in the instruction code is the value of the operand or the address of the result/operand. Following are the main addressing modes that are used on various platforms and architectures.
Various addressing modes of 8086/8088
1) Register Addressing mode
2) Immediate Addressing mode
3) Register Indirect Addressing mode
4) Direct Addressing mode
5) Indexed Addressing mode
6) Base Relative Addressing mode
7) Base Indexed Addressing mode
Register addressing mode
It means that the register is the source of an operand for an instruction.
Data transfer using registers is called register addressing mode. Here operand value is present in register. For example
MOV AL,BL;
MOV AX,BX;
Immediate addressing mode
The addressing mode in which the data operand is a part of the instruction itself is known as immediate addressing mode.
When data is stored in code segment instead of data segment immediate addressing mode is used. Here operand value is present in the instruction. For example
MOV AX, 12345;
Register indirect addressing mode
This addressing mode allows data to be addressed at any memory location through an offset address held in any of the following registers: BP, BX, DI & SI.
Here operand offset is given in a cpu register. Register used are BX, SI(source index), DI(destination index), or BP(base pointer). BP holds offset w.r.t Stack segment, but SI,DI and BX refer to data segment. For example
MOV [BX],AX;
ADD AX, [SI];
Direct addressing mode
The addressing mode in which the effective address of the memory location is written directly in the instruction.
When direct memory address is supplied as part of the instruction is called direct addressing mode. Operand offset value with respect to data segment is given in instruction. For example
MOV AX, [1234];
ADD AX, [1234];
Indexed addressing mode
In this addressing mode, the operands offset address is found by adding the contents of SI or DI register and 8-bit/16-bit displacements.
Here operand offset is given by a sum of a value held in either SI, or DI register and a constant displacement specified as an operand. For example
Lets take arrays as an example. This is very efficient way of accessing arrays.
My_array DB ‘1’, ‘2’, ‘3’,’4,’5’;
MOV SI, 3;
MOV AL, My_array[3];
Based-index addressing mode
In this addressing mode, the offset address of the operand is computed by summing the base register to the contents of an Index register..
here operand offset is given by sum of either BX or BP with either SI or DI. For example
MOV AX, [BX+SI]
JMP [BP+DI]
Based indexed with displacement mode
Or
Base Relative Addressing mode
In this addressing mode, the operands offset is computed by adding the base register contents. An Index registers contents and 8 or 16-bit displacement
.
.
Operand offset given by a sum of a value held either in BP, or BX and a constant offset sepecified as an operand. For example
MOV AX,[BP+1];
JMP [BX+1];
No comments:
Post a Comment