Featured Post

80186 Microprocessors: Introduction and Architecture

Hello friends, today we are going to discuss the 80186 microprocessor with integrated peripherals. The Intel 80186 is an improved version of the 8086 microprocessor. 80186 is a 16-bit microprocessor with a 16-bit data bus and a 20-bit address bus. It has a programmable peripheral device integrated into the same package. The instruction set of the 80186 is a superset of the instruction set of the 8086. The term super-set means that all of the 8086 instructions will execute properly on an 80186, but the 80186 has a few additional instructions. The following figure shows the block diagram and pin diagram of 80186. The CPU is divided into seven independent functional parts. 80186 internal block diagram  80186 68-pins pin diagram  Functional parts of 80186 Microprocessor The Bus Interface Unit (BIU) Execution Unit (EU) Clock Generator Programmable interrupt controller Programmable Chip Select Unit (CSU) Programmable DMA Unit Programmable counter/timers The Bus Interface Unit ...

Addressing modes Of 8086 Microprocessor

Hello, friends today we are going to see the addressing modes of 8086 microprocessor. before that, we have to understand what is addressing modes? 

Definition

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 categorised according to the accessing method. These are as follows. we will see that one by one with example.

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)
Again some instruction is classified according to their behaviour or condition, these are as follows.
5. Relative addressing modes (Related with some condition)
6. Implied or Implicit addressing mode (No operands)

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. 

i.e. 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 the 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
MOV AX, AX; yes, this is legal!

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 the 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 those 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 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 register at a displacement from the segment base of ." 
Addition of  data segment register
Addition of  data segment register 

4. Direct Addressing modes

This addressing mode is called direct because of the displacement or the 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 the 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

How you found this article, is this useful? I'm sure this will help you more. If you want more information please let me know through comments in the right below.
Subscribed to the My Computer Tutors for updates. I will keep updating to you with latest tutorials.