Addressing Modes of 8086 Microprocessor

The 8086 microprocessor accesses the data in different ways such as from different registers, from memory locations or from I/O ports are called its addressing modes. These addressing modes are categorized according to the accessing method. These  are as follows.

1. Register Addressing Modes (Accessing data from registers)
2. Immediate Addressing Modes (Accessing immediate data and storing in the register as an operand )
3. Memory Addressing Modes (Accessing data from memory)
4. Direct Addressing Modes (Accessing direct data from I/O port)
5. Relative addressing modes (Related with some condition)
6. Implied or Implicit addressing mode (No operands)


Registers of 8086

 

























General Purpose Registers






















Pointer and Index Registers


1. Register Addressing Modes


In register addressing mode, most 8086 instructions can operate the general purpose register to set as an operand to the instruction. This means a register is a source of an operand as well as the register is only the destination of an operand for an instruction.
MOV destination, source;

This instruction copies the data from the source location to the destination location. The 8-bit or 16 bit registers are certainly valid operands for this instruction. But both operands should be in  the same size. Now let's see some 8086 MOV instructions:

MOV AX, BX; Copies the 16 bit value from BX into AX,

Here the contents of AX is overlapping, but the contents of BX are not changed. (Both registers are in same size)

Example:

MOV DL, AL; Copies the value from AL into DL
MOV SI, DX; Copies the value from DX into SI
MOV SP, BP; Copies the value from BP into SP
MOV CH, CL; Copies the value from CL into CH


2. Immediate Addressing Modes


In immediate addressing mode, the hexadecimal number either 8-bit or 16-bit to be loaded immediately into the memory locations or consecutive memory locations respectively. i.e to load 8-bit immediate number into an 8-bit memory location or to load a 16-bit immediate number into two consecutive memory locations. Some examples of that instructions.

Example:


MOV CX, 437BH; copies 16-bit hexadecimal number 437BH in the 16-bit CX register
MOV CL, 48H; Load the 8-bit immediate number 48H into the 8-bit CL register

3. Memory Addressing Mode:

The memory addressing modes are used to specify the location of an operand as memory. To access data in memory, the 8086 should be produce a 20-bit physical address. It does this by adding a 16-bit value called the effective address (EA). The effective address represents the displacement or offset of the desired operand from the segment base. The data segment is most often used as a segment base.

MOV AL, [BX]; ADD the contents of DS (One of four segment bases) with BX and result will shift in AL register.
MOV AL, [BP]; same as above


The square bracket around the registers i.e. BX, BP are shorthand for “the contents of that registers at a displacement from the segment base of ." 

















4. Direct Addressing modes

This addressing mode is called direct because the displacement or offset of the operand from the segment base is specified directly in the instruction.

MOV CL, [437AH]; copy the contents of the memory location , at a displacement of 437AH from the data segment base , into the CL register.

MOV BX [437AH]; copies a word from memory into the BX register.

Note: each memory address represents a byte of storage, the word must come from two memory locations. The byte at a displacement of 437AH from the data segment base will be copied into BL. The contents of the next higher address, displacement 437BH will be copied into the BH register. The 8086 will automatically access the required number of bytes in memory for a given instruction. 


5. Relative addressing modes

This addressing mode is a relation base. The data is stored either in base pointer (BP) or in BX.
Example: MOV AX, [BP +1]
JMP [BX + 1]
JNC START : if CF=0 or not carry then start the PC

6. Implicit or Implied addressing modes

In this addressing mode no operands are used to execute the instruction.
Example: NOP : No operation
CLC : Clear carry flag to 0
START : Start execution



Comments

  1. Sir what is the best microprocessor that is widely used in electronics world?

    ReplyDelete
    Replies
    1. Intel is the premier chip maker for personal computers—companies such as Apple, Dell, HP, Samsung, Sony have product lines that depend on the processors that Intel produces. Intel's processors generally offer the best performance for all-around usage. This has been especially the case the last several years with the introduction and evolution of Intel's Core series product line. Currently, Intel's flagship consumer product line consists of mobile and desktop-grade Core i3, Core i5 and Core i7 processors. The biggest difference between these two generations amounts to a moderate improvement in all-around computing performance but a substantial improvement in integrated graphics performance.

      Delete

Post a Comment