Table of contents
1.
Introduction
2.
What are the Addressing Modes in 8086?
3.
Types Of Addressing Modes Of 8086
3.1.
Immediate Addressing Mode
3.2.
Register Addressing Mode
3.3.
Direct Addressing Mode 
3.4.
Register Indirect Addressing Mode 
3.5.
Based Addressing Mode 
3.6.
Indexed Mode 
3.7.
Based Indexed Mode
3.8.
Based Indexed Displacement Mode 
3.9.
String Addressing Mode
3.10.
Input/Output Mode
3.11.
Relative Addressing
3.12.
Implied Addressing Mode
4.
Frequently Asked Questions
4.1.
What are the addressing modes in 8086?
4.2.
What is the purpose of addressing modes in 8086?
4.3.
What is addressing modes in microprocessor?
4.4.
What are the modes of operation in 8086?
5.
Conclusion
Last Updated: Apr 14, 2024
Medium

Addressing Modes of 8086

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Addressing modes in the 8086 microprocessor define the techniques used to specify the location of operands in memory or registers during instruction execution. Understanding the various addressing modes is crucial in order to fully use the 8086 microprocessor and create efficient and effective assembly language applications.

The addressing modes employed by the 8086 processor play a crucial role in effectively accessing data and instructions. 

Addressing Modes of 8086

In this article, we will learn about the addressing modes of 8086 and different methods of addressing modes in 8086.

What are the Addressing Modes in 8086?

Addressing modes are a technique of describing how an instruction will operate data. For instructions that induce a program branch, this addressing method is necessary. A branch is an intra-segment branch or a nearby branch if it is located within the same segment. A branch is called an Inter-Segment Branch or a Far Branch if it is in a different segment. Addressing modes store the operands (source or destination) in any internal register or memory location. Addressing modes refer to the various approaches to addressing the operands.

Also see,  what is middleware

Types Of Addressing Modes Of 8086

There are many types of addressing modes. The different addressing modes of 8086 are as follows.

Immediate Addressing Mode

The operands are specified within the instructions in this type of mode. 

The first operand is never an immediate value. Instead, it contains a destination field that specifies the length of the data and can be either a register or a memory address. The second operand contains the actual data, a series of subsequent bytes.

Some examples of Immediate Addressing Modes are given below

MOV AL, 28H

 

It moves the 8-bit data 28H into AL.

Remember that a register is needed to initialize the segment register's value.

Register Addressing Mode

The data is referred to using the specific register in which it is stored. Both operands in this particular addressing mode are registers.

Some examples of Register addressing modes are given below.

MOV AX, BX 

 

It implies that the content of the 16-bit BX register is copied into the 16-bit AX register.

MOV CL, DL

 

Moves 8-bit contents of DL into CL.

Direct Addressing Mode 

The instruction specifies the effective address as displacement when using this sort of addressing mechanism.

This indicates that the value is immediately fixed and immutably entered into the instruction.

Of all the addressing techniques, direct addressing is the most straightforward.

Some examples of Direct addressing modes are given below

MOV AX, [5000H]

 

The square brackets around the 5000H imply the contents of the memory location. When it is executed, this instruction will copy the contents of the memory location into the AX register.

Register Indirect Addressing Mode 

In this Addressing Mode, the offset registers indirectly derive the address of the memory region containing the data or operand.

The base register, source index, or destination index (BX, SI, or DI register, respectively) contains the offset address of the data. Either DS or ES are the default segments.

Some examples of Register InDirect addressing mode are given below.

MOV BX, [AX]

 

Suppose the register AX holds 4895H, then its data, 4895H, is moved to BX.

Based Addressing Mode 

Based Addressing specifies a signed 8-bit or an unsigned 16-bit displacement and stores the base value for the effective address in BX or BP.

When there is an 8-bit displacement, the sign is 16-bit extended before being added to the base value.

When BX contains the base value of EA, DS, and BX are combined to form a 20-bit physical address. 

BP and SS are used when BP holds the base value of EA.

Examples of Based Addressing Modes are given below

MOV AX, [BX + 04]

 

Given instruction indicates that there is a value stored in the BX register and this is added with 4 bits displacement value and will store in the AX register.

Indexed Mode 

The SI or DI register stores the index value for memory data, and the instruction will specify either a signed 8-bit or an unsigned 16-bit displacement.

To produce the EA, displacement is added to the index value in the SI or DI register.

When there is an 8-bit displacement, the sign is 16-bit extended before being added to the base value.

Examples of Indexed Addressing Modes are given below.

MOV CX, [SI + 16]

 

Given instruction indicates that there is a value stored in the SI (Source Index) register and this is added with 16 bits displacement value and will store in the BX register.

Based Indexed Mode

In the based index addressing of 8086, a base register (BX or BP), an index register (SI or DI), and a displacement are added to determine the effective address.

Examples of Based Indexed Addressing Modes are given below.

MOV DX, [BX + SI]

 

Given instruction indicates that there is a value stored in the SI (Source Index) register and this is added to the value of the BX register and will store in the AX register.

Based Indexed Displacement Mode 

In this addressing mode, the operand offset is calculated by summing the content of the base register. The index records the content and an 8- or 16-bit offset.

Examples of Based Indexed Displacement Mode are given below.

MOV AX, [BX+DI+08]


Given instruction indicates that there is a value stored in the SI (Source Index) register and this is added to the value of the BX register along with the 8-bit displacement value and will store in the AX register.

String Addressing Mode

Used to manipulate string data when performing string operations.

Effective addresses (EAs) for source and destination data are maintained in SI and DI registers.

DS and ES are the segment registers used to determine the base addresses of the source and destination data, respectively.

Examples of String Addressing Mode are given below.

MOVS B

 

MAS= DS*10H+ (SI)

MAD = ES*10H+ (DI)

(MAD) <- (MAS)
 

According to DF (Directional Flag), the value of SI and DI will get incremented and decremented.

If DF = 0, then (DI) <- (DI) + 1; (SI) <- (SI) + 1

If DF = 1, then (DI) <- (DI) - 1; (SI) <- (SI) - 1

Input/Output Mode

Accessing data from commonly used I/O mapped devices or ports is done using these addressing modes.

Examples of Input/Output modes are given below.

IN AL, [09H]
PORTadder = 09H
(AL) ← (PORT)

 

The content of the port with address 09H is moved to the AL register

Relative Addressing

An 8-bit signed displacement is used in this addressing mode to specify the effective address of a program instruction in relation to the Instruction Pointer (IP).

Examples of Relative Addressing Modes are given below.

JNC START

 

If CY=O, then PC is assigned with current PC contents plus 8 bit signed value of START,

otherwise, the next instruction is executed.

Implied Addressing Mode

This kind of mode's instructions has no operands, and the data that the instruction will act on will be given explicitly in the instruction.

Examples of Implied AddressingMode are given below.

CLC

 

This clears the carry flag to zero.

Frequently Asked Questions

What are the addressing modes in 8086?

The addressing modes commonly used in 8086 microprocessors are immediate addressing, direct and indirect addressing, base addressing, index-based addressing, and also register addressing. 

What is the purpose of addressing modes in 8086?

Addressing modes allow you to specify how the effective address of an operand is represented in a particular instruction. Some addressing modes can efficiently refer to large areas. B. A list of addresses and a linear array of addresses.

What is addressing modes in microprocessor?

Addressing modes are a technique of describing how an instruction will operate data. For instructions that induce a program branch, this addressing method is necessary. A branch is an intra-segment branch or a nearby branch if it is located within the same segment. 

What are the modes of operation in 8086?

The intel 8086 microprocessor supports various various modes of operation. Some of the primary modes of operation in 8086 are real mode, virtual  mode and protected mode. 

Conclusion

In this article, we discussed addressing modes of 8086 and the technique of describing how an instruction will operate data. We have also learned the types of addressing modes of 8086 and discussed them briefly, along with their examples.

To learn more, go through the following articles.

 

Enhance your skills in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptSystem Design, and more with our Coding Ninjas Studio  Guided Path. If you want to sharpen your coding skills for the test, check out the mock test series and enter the contests on Coding Ninjas Studio! 

Check out The Interview Guide for Product Based Companies and some of the Popular Interview Problems from Top companies like AmazonAdobeGoogleUberMicrosoft, etc., on Coding Ninjas Studio.

Live masterclass