Skip to main content

8086 architecture and programmer registers

Short answer

The 8086 has a BIU (segment registers CS,DS,SS,ES; IP; address adder; queue) and an EU (AX,BX,CX,DX; SP,BP,SI,DI; ALU, flags, control) working in parallel. Programmer's registers: AX (accumulator, I/O), BX (base), CX (count), DX (I/O, mul/div), SP (stack top), BP (stack parameters), SI (source index), DI (destination), segment registers, IP, and flags.

Draw the internal architecture of 8086 microprocessor. Explain the function of each register accessible to programmer.

 +---------------- BIU ----------------+
 |  CS   DS   SS   ES   (segment regs) |
 |  IP  (instruction pointer)          |
 |  Address adder  -> 20-bit address   |
 |  6-byte instruction queue           |
 |  Bus control logic                  |
 +------------------+------------------+
                    | internal bus
 +------------------+------------------+
 |  AX BX CX DX  (general registers)   |
 |  SP BP SI DI  (pointer/index)       |
 |  ALU      FLAG register             |
 |  Control unit + instruction decoder |
 +---------------- EU -----------------+
   BIU <-> external bus: AD0-AD15, A16-A19, control

The 8086 has two units: the BIU (fetches instructions, forms 20-bit addresses, handles the bus; contains segment registers, IP, address adder and the 6-byte queue) and the EU (decodes and executes; contains general registers, ALU, flags and control unit). They work in parallel.

Registers accessible to the programmer

1. General purpose registers (16-bit, splittable into 8-bit halves)

  • AX (AH/AL), accumulator: arithmetic, logic, I/O (IN/OUT), MUL/DIV, string operations.
  • BX (BH/BL), base: holds an offset address of data; used in XLAT.
  • CX (CH/CL), count: loop counter for LOOP, count for shifts (CL) and REP.
  • DX (DH/DL), data: I/O port address, high word of 32-bit multiply/divide result.

2. Pointer and index registers

  • SP: stack pointer, offset of the top of stack (in SS).
  • BP: base pointer, offset used to access stack-resident data/parameters.
  • SI: source index for string and indexed addressing (DS:SI).
  • DI: destination index (ES:DI for strings).

3. Segment registers

  • CS: code segment base. DS: data segment base. SS: stack segment base. ES: extra segment base (string destination).

4. Instruction pointer (IP): offset of the next instruction within CS; not directly accessed but changed by jumps and calls.

5. Flag register: six status flags (CF, PF, AF, ZF, SF, OF) and three control flags (TF, IF, DF).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Microprocessor chapter 3 questions →