Home »
Embedded Systems
Types of Registers in the 8086 Microprocessor
In this tutorial, we will learn about the types of registers in the 8086 Microprocessors. We will first broadly categorize them and then will study about each of them and their types in detail. We will here be discussing mainly their purpose and use in the 8086 Microprocessor.
By Monika Sharma Last updated : May 15, 2023
In the 8086 Microprocessor, the registers are categorized into mainly four types:
- General Purpose Registers
- Segment Registers
- Pointers and Index Registers
- Flag or Status Register
1) General Purpose Registers
The use of general-purpose registers is to store temporary data. While the instructions are executed in the control unit, they may work on some numeric value or some operands. These need to be stored somewhere so that the processor can operate on them easily. So, these registers are used in these cases. There are 4 general-purpose registers of 16-bit length each. Each of them is further divided into two subparts of 8-bit length each: one high, which stores the higher-order bits and another low which stores the lower order bits.
- AX = [AH:AL]
- BX = [BH:BL]
- CX = [CH:CL]
- DX = [DH:DL]
2) Segment Registers
There are 4 segment registers in 8086 Microprocessor and each of them is of 16 bit. The code and instructions are stored inside these different segments.
- Code Segment (CS) Register:
The user cannot modify the content of these registers. Only the microprocessor's compiler can do this.
- Data Segment (DS) Register:
The user can modify the content of the data segment.
- Stack Segment (SS) Registers:
The SS is used to store the information about the memory segment. The operations of the SS are mainly Push and Pop.
- Extra Segment (ES) Register:
By default, the control of the compiler remains in the DS where the user can add and modify the instructions. If there is less space in that segment, then ES is used. ES is also used for copying purpose.
3) Pointers and Index Registers
The pointers will always store some address or memory location. In 8086 Microprocessor, they usually store the offset through which the actual address is calculated.
- Instruction Pointer (IP):
The instruction pointer usually stores the address of the next instruction that is to be executed. Apart from this, it also acts as an offset for CS register.
- Base Pointer (BP):
The Base pointer stores the base address of the memory. Also, it acts as an offset for Stack Segment (SS).
- Stack Pointer (SP):
The Stack Pointer Points at the current top value of the Stack. Like the BP, it also acts as an offset to the Stack Segment (SS).
The indexes are used with the extra segment and they usually are used for copying the contents of a particular block of memory to a new location.
- Source Index (SI):
It stores the offset address of the source.
- Destination Index (DI):
It stores the offset address of the Destination.
4) Flag or Status Register
The Flag or Status register is a 16-bit register which contains 9 flags, and the remaining 7 bits are idle in this register. These flags tell about the status of the processor after any arithmetic or logical operation. IF the flag value is 1, the flag is set, and if it is 0, it is said to be reset.