Types of Registers in 8086 Microprocessor

A microprocessor is a register-based clock-driven digital device that is used for data processing. It is a multipurpose device that is capable of producing outputs when provided binary data as input. In computers, the microprocessor is like the brain, handling tasks and calculations. Inside the microprocessor are tiny storage units called registers.

An 8086 microprocessor is 40 pin microprocessor, which was designed by INTEL in 1976. It is a 16-bit microprocessor that has 20 address lines and provides storage up to 1MB. It provides two modes of operation:

  • Minimum Mode, suitable for systems having multiple processors
  • Maximum Mode, suitable for systems having single processors.

Table of Content

  • Types of Registers in 8086 Microprocessor
  • General Purpose Registers
  • Segment Registers
  • Special Purpose Registers
  • Flag Register

Types of Registers in 8086 Microprocessor

Registers are storage blocks for temporary storage in microprocessors. They hold important information temporarily while the microprocessor works on it. Think of registers as tiny boxes where the microprocessor keeps things it needs to use right away.

In other words, one may also say that registers are like the memory of a computer’s brain, storing tiny bits of information that the microprocessor needs to work with quickly.

In 8086 microprocessor, the registers are categorized under following four types:

  • General Purpose Registers
  • Segment Registers
  • Special Purpose Registers
  • Flag Registers

These different types of registers of 8086 microprocessor are briefly discussed below.

General Purpose Registers

The general purpose registers are present in execution unit of 8086 microprocessor. These are versatile registers that can be used for various tasks, such as storing numbers for calculations or holding memory addresses for data access. Each register serves a specific purpose, aiding the microprocessor in different types of tasks.

A general purpose register contains eight registers namely, AH,AL,BH,BL,CH,CL,DH,DL in which each register carries 8-bit data. It is used for temporary storage. When there is requirement to store data is which greater than 8-bit then these registers are used in pairs as AX,BX,CX,DX thus it effectively double their storage capacity. These register pairs can hold a maximum of 16-bit data.

General Purpose Registers

The functions of each general purpose registers are stated below:

  • Accumulator Register(AX):When ALU performs arithmetic and logical operations then accumulator register stores the operands of such operations.
  • Base Register(BX): The base register is used to hold the base address of memory location for reading and writing data into the memory.
  • Counter Register(CX): The counter register is used to hold 8-bit data during the rotate and shift instructions. It is also used to store loop counter during loop instructions.
  • Data Register(DX): During the multiplication and division operations, if the result is of 32-bits, then 16 bits from MSB is stored in DX register and bits from LSB is stored in AX register. This register is also used to hold the address and instruction for I/O

Segment Registers

The Bus Interface Unit (BIU) of 8086 microprocessor. The segment registers are responsible for managing memory access. As the computer memory is segmented, the segment registers tracks the memory location of each and every segment. The segment registers contains four 16-bit registers namely, Code Segment(CS), Data Segment(DS), Stack segment(SS) and Extra Segment(ES). These registers are used to hold the 16 bits of starting address. Each segment register holds the starting address of its respective memory segment, allowing the microprocessor to quickly locate and access the data it needs during program execution.

Segment Registers

The function of each segment registers are stated below:

  • Code Segment(CS): This register is used to store the address of the memory in which the program which is to be executed is stored.
  • Data Segment(DS): It is used to data which is used by the program frequently. It also stores the offset address or the data of the register that holds the offset address.
  • Stack Segment(SS): It is used to store the address as well as data in the memory while the subprogram is executing.
  • Extra Segment(ES): This register is used to hold the extra data by providing additional data segment in the memory.

Special Purpose Registers

The index and pointer registers are collectively called as special purpose registers. These are 16-bit registers used as memory pointers and These registers generates 20- bit physical address. There are five 16-bit special purpose registers namely, Stack Pointer(SP), Base Pointer(BP), Source Index(SI), Destination Index(DI) and Instruction Pointer(IP).

Special Purpose Registers

The function of each general purpose registers are stated below:

  • Stack Pointer(SP): Stack Pointer register is used to hold the topmost address of the stack memory, i.e., it stores the address of the memory location in which data was recently stored.
  • Base Pointer(BP): It is used to store the base address of the memory.
  • Source Index(SI): It is a memory pointer which is used to store the offset address of the source.
  • Destination Index(DI): It is a memory pointer which is used to store the offset address of the destination.
  • Instruction Pointer(IP): This register is used to hold the address of the next instruction which is to be executed.

Flag Register

The flag register is also called as status register. It is a 16-bit register which is a set of flip-flops. There are nine flags in this register.

Flag Register

The flag register is classified into two categories:

Conditional Flags

These flags are used to hold the result obtained by ALU i.e., by arithmetical and logical operations. There are six conditional flags:

  • Carry Flag(CF): If any arithmetic operation results in the production of carry in the MSB position then this extra bit is stored in the carry flag. The carry flag is set i.e. 1 when the carry is generated, otherwise is reset, i.e. 0.
  • Auxiliary Carry Flag(AF): If the carry is generated in the 4th bit from the LSB then that carry is called as auxiliary carry. The auxiliary carry flag is set i.e. 1 when the auxiliary carry carry is generated, otherwise is reset, i.e. 0.
  • Parity Flag(PF): This flag is used to store the parity of the result of any arithmetic and logical operation. The value of parity flag is 1 (i.e., set) when the result is of even parity(the number of 1’s in result is odd) whereas the value of parity flag is 0(i.e., reset) when the result is of odd parity(the number of 1’s in result is even).
  • Zero Flag(ZF): If the result of any arithmetic and logical operations results in zero, then this flag is set otherwise reset.
  • Sign Flag(SF): The value of sign flag is 1 (i.e., set) when the result of any operation performed by ALU results in a negative number, whereas its value is 0 (i.e., reset) when the result is a positive number.
  • Overflow Flag(OF): If the result is within the capacity of the register then overflow flag is reset, whereas if the result exceeds the value of the register then the flag is set.

Control Flags

These flags are used to control some specific operations of the processor with the help of some specific instructions. The 8086 microprocessor provides three control flags:

  • Trap Flag(TF): When the trap flag is set then the processor will execute the whole program at once, whereas the trap flag is reset the program will be executed in step-by-step sequence.
  • Interrupt Flag(IF): This flag is set when the maskable interrupt is enabled, whereas it is reset when the the maskable interrupt is disabled.
  • Direction Flag(DF): This flag is reset when the bits are accessed from higher memory address to lower memory address, whereas the direction flag is reset when the bits are accessed from lower memory address to higher memory address.

Conclusion

In this article we have gone through the types of registers in 8086,we have gone through different types of flags and gone their working in brief. As we have already seen there are four types of registers in 8086 microprocessor named as General Purpose Registers, Segment Registers, Special Purpose Registers and Flag Register.

Types of Registers in 8086 Microprocessor – FAQs

What is a microprocessor?

A microprocessor is a register-based clock-driven digital device which is used for data processing. It is a multipurpose device which is capable of producing outputs when provided binary data as input.

What is an interrupt in 8086 microprocessor?

An interrupt refers to a mechanism by which external devices or internal conditions can request the CPU’s attention to perform a specific task or handle an event.

What role does register plays in a microprocessor?

A register is a critical component of computer memory that stores data and instructions for quick processing. It serves as an efficient temporary storage area where information can be accessed and manipulated quickly in order to carry out complex tasks.