2078 10

CSC167 · 2078 · 5 marks

Explain Register Organization in 80386 microprocessor.

Explain Register Organization in 80386 microprocessor. [5]

MicroprocessorChapter 7: Advanced Microprocessors80386

Quick answer

The 80386 is a 32-bit microprocessor.

Register Organization in 80386 Microprocessor


Register Organization of 80386

The 80386 is a 32-bit microprocessor. Its registers are organized into the following groups:


1. General Purpose Registers (32-bit)

These are 32-bit registers used for arithmetic, logical, and data transfer operations. They are extensions of the 16-bit 8086 registers.

RegisterFull NameDescription
EAXExtended AccumulatorUsed for arithmetic and I/O operations
EBXExtended Base RegisterUsed as base address in memory addressing
ECXExtended Count RegisterUsed as loop counter
EDXExtended Data RegisterUsed in I/O and multiply/divide operations
ESIExtended Source IndexSource pointer for string operations
EDIExtended Destination IndexDestination pointer for string operations
EBPExtended Base PointerPoints to base of stack frame
ESPExtended Stack PointerPoints to top of stack
  • The lower 16 bits of each register can be accessed as AX, BX, CX, DX, SI, DI, BP, SP.
  • The lower 8 bits of AX, BX, CX, DX can be accessed as AL, AH, BL, BH, CL, CH, DL, DH.

2. Segment Registers (16-bit)

The 80386 has six 16-bit segment registers used to hold segment selectors in protected mode or segment base addresses in real mode.

RegisterNamePurpose
CSCode SegmentPoints to the segment containing program code
DSData SegmentPoints to the default data segment
SSStack SegmentPoints to the stack segment
ESExtra SegmentExtra segment for string operations
FSF SegmentAdditional general-purpose segment
GSG SegmentAdditional general-purpose segment

3. Instruction Pointer (EIP) - 32-bit

  • EIP holds the offset address of the next instruction to be executed within the code segment.
  • It is automatically incremented after each instruction fetch.
  • Equivalent to the Program Counter (PC) in other architectures.

4. Flag Register (EFLAGS) - 32-bit

The EFLAGS register contains status, control, and system flags.

Key flags include:

FlagSymbolDescription
Carry FlagCFSet on unsigned overflow
Zero FlagZFSet when result is zero
Sign FlagSFSet when result is negative
Overflow FlagOFSet on signed overflow
Parity FlagPFSet when result has even parity
Trap FlagTFEnables single-step mode
Interrupt FlagIFEnables/disables maskable interrupts
Direction FlagDFControls direction of string operations

5. Control Registers (CR0 - CR3)

Used to control operating modes and memory management:

RegisterPurpose
CR0Contains system control flags (e.g., PE bit to enable protected mode)
CR1Reserved
CR2Holds the linear address that caused a page fault
CR3Holds the base address of the page directory (used in paging)

6. System Address Registers

RegisterSizePurpose
GDTR48-bitGlobal Descriptor Table Register
IDTR48-bitInterrupt Descriptor Table Register
LDTR16-bitLocal Descriptor Table Register
TR16-bitTask Register

7. Debug and Test Registers

  • DR0 - DR7: Debug registers used to set hardware breakpoints.
  • TR6, TR7: Test registers used for testing the Translation Lookaside Buffer (TLB).

Summary Diagram

80386 Registers
├── General Purpose: EAX, EBX, ECX, EDX, ESI, EDI, EBP, ESP (32-bit)
├── Segment Registers: CS, DS, SS, ES, FS, GS (16-bit)
├── Instruction Pointer: EIP (32-bit)
├── Flags Register: EFLAGS (32-bit)
├── Control Registers: CR0 - CR3
├── System Address Registers: GDTR, IDTR, LDTR, TR
└── Debug Registers: DR0 - DR7

The rich register organization of the 80386 allows it to support real mode, protected mode, and virtual 8086 mode, making it a powerful and flexible 32-bit processor.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.