RTUComputer ScienceYr 2024 · Sem 52024

Q2Microprocessor and Interfaces

Question

10 marks

(a) Explain the 8086 addressing modes with examples. (b) Discuss the concept of segmentation and offset addressing in 8086.

Answer

8086 Addressing Modes

Addressing modes define how the operand's effective address (offset) is determined:

  • Immediate: Operand is given in the instruction (e.g., MOV AX, 1234H).
  • Register: Operand is in a register (e.g., MOV AX, BX).
  • Direct: 16-bit offset address is given in the instruction (e.g., MOV AX, [5000H]).
  • Register Indirect: Offset is held in a base/index register like BX, SI, DI (e.g., MOV AX, [BX]).
  • Based: Offset is sum of base register and displacement (e.g., MOV AX, [BX+10H]).
  • Indexed: Offset is sum of index register and displacement (e.g., MOV AX, [SI+20H]).
  • Based Indexed: Offset is sum of base, index, and optional displacement (e.g., MOV AX, [BX+SI+5H]).

Segmentation is the mechanism of dividing the 1MB physical address space of the 8086 into 64KB logical blocks called segments. The start address of a segment is stored in a Segment Register (CS, DS, SS, ES).

The exact location of data within a segment is given by a 16-bit Offset Address (or Effective Address). The Bus Interface Unit (BIU) computes the actual 20-bit physical address by shifting the segment register value 4 bits to the left (multiplying by 16) and adding the offset. Physical Address = (Segment Address * 10H) + Offset Address. Advantages include independent code and data areas, easy relocation of programs, and protection.

Back to Paper