Home » Embedded Systems

Segment Override Prefix | 8086 Microprocessor

This article is about a very interesting feature of the 8086 microprocessor- the Segment override prefix. In this article, we are going to study a different way in which the effective address inside the microprocessor is calculated.
Submitted by Monika Sharma, on July 23, 2019

As we already know that the effective address is calculated by appending the segment registers value and adding up the value of the respective offset. But what if we want to choose some other offset than the assigned one.

This freedom is provided to us in 8086 microprocessor through the concept of Segment override prefix.

The Segment Override Prefix says that if we want to use some other segment register than the default segment for a particular code, then it is possible. It can simply be one by mentioning the segment that is to be used before the address location or the offset register containing that address. By doing so, the machine, i.e. the 8086 microprocessor, while calculating the effective address will consider the mentioned segment for calculating the effective address rather than opting for the default one.

The syntax of doing so, as mentioned earlier is by mentioning the segment just before the address location and proceeded by a colon. The following abbreviations for each segment register are used for this purpose:

  • Stack Segment Register - SS
  • Data Segment Register - DS
  • Code Segment Register - CS
  • Extra Segment Register - ES

Let us take the following examples to further understand this concept:

    MOV AX , [BX]

This is a normal instruction without any segment overriding. Hence the effective address will be calculated by using the default segment itself. Therefore, the effective address for the above-mentioned instruction:

Effective address = DS X 10H + content of BX register

    MOV AX, SS : [BX]

Here, in this case, the Stack segment register is used as a prefix for the offset BX. So, instead of DS, which is the default segment register for BX, the SS will be used for finding the effective address location. Therefore, the effective address in the above-mentioned equation will be:

Effective address = SS X 10H + content of BX register

    MOV BX, SS:[1002H]

Here, in this case, the address from where the data is to be fetched is directly mentioned in the instruction. By default, such cases take the Data Segment (DS) as its offset. But as the SS is the mentioned register in the given instruction, then it will be used here. Therefore, the effective address for the given instruction is:

    Effective Address = SS X 10H + 1002H





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.