Comprehensive Study Guide: Intel 8086 Microprocessor Architecture, Interfacing, and Instruction Set

Overview of Computer Systems and Microprocessor Evolution

  • Basic Computer System Architecture:

    • Central Processing Unit (CPU): Contains the Control Unit (CU) and Arithmetic/Logic Unit (ALU).

    • Control Unit (CU): Decodes instructions and manages the timing and control signals of the entire computer system.

    • Arithmetic/Logic Unit (ALU): Executes mathematical operations (addition, subtraction, multiplication, division) and logical operations (AND, OR, XOR, shifts).

    • Memory Unit (MU): Primary storage holding executable instructions and active data.

    • Input and Output Devices: Peripherals providing data input to the CPU and displaying or outputting processed results.

Block Diagram of Computer System
  • Evolutionary History of Intel Microprocessors:

    • 8085: 8-bit8\text{-bit} microprocessor architecture.

    • 8086: First 16-bit16\text{-bit} microprocessor architecture.

    • 80186: Enhanced 16-bit16\text{-bit} microprocessor with integrated hardware peripherals.

    • 80286: 16-bit16\text{-bit} processor introducing protected mode operation and expanded memory management.

    • 80386: First 32-bit32\text{-bit} processor architecture supporting paging and virtual memory.

    • 80486: 32-bit32\text{-bit} processor incorporating an on-chip floating-point unit (FPU) and L1 cache.

    • 80586 / Pentium Series: Advanced superscalar architecture progressing through Pentium 1 (P1), Pentium 2 (P2), Pentium 3 (P3), Core 2 Duo (C2D), Core i7 (Ci7), and Core i9 (Ci9).

  • Comparative Analysis: Intel 8085 vs. Intel 8086:

    • Data Bus / Processor Size:

      • 8085: 8-bit8\text{-bit} size.

      • 8086: 16-bit16\text{-bit} size.

    • Address Bus Width:

      • 8085: 16-bit16\text{-bit} address bus.

      • 8086: 20-bit20\text{-bit} address bus.

    • Addressable Memory Capacity:

      • 8085: Address space of 216=65,536 bytes=64 KB2^{16} = 65,536\text{ bytes} = 64\,\text{KB}.

      • 8086: Address space of 220=1,048,576 bytes=1 MB2^{20} = 1,048,576\text{ bytes} = 1\,\text{MB}.

    • Instruction Prefetch Queue:

      • 8085: No instruction queue.

      • 8086: Contains a 6-byte6\text{-byte} instruction prefetch queue.

    • Pipelining Capabilities:

      • 8085: Does not support instruction pipelining.

      • 8086: Supports 2-stage2\text{-stage} instruction pipelining (Fetch Stage and Execution Stage operating concurrently).

    • I/O Ports Capacity:

      • 8085: 28=2562^8 = 256 addressable I/O ports.

      • 8086: 216=65,5362^{16} = 65,536 addressable I/O ports.

    • Relative Unit Cost:

      • 8085: Low cost.

      • 8086: High cost.

8086 Microprocessor Architecture and Components

  • General Specifications of Intel 8086:

    • Designed by Intel in 1976 and commercially released in 1978 (Intel D8086).

    • Fully 16-bit16\text{-bit} architecture featuring a 16-bit16\text{-bit} ALU, 16-bit16\text{-bit} internal registers, and a 16-bit16\text{-bit} data bus.

    • 20-bit20\text{-bit} physical address bus allowing access to 1 MB1\,\text{MB} (1,048,576 bytes1,048,576\text{ bytes}) of memory space.

    • 64 KB64\,\text{KB} (65,53665,536) input/output port space.

    • Contains 14 internal registers, each 16 bits16\text{ bits} wide.

    • Available in three speed versions: 5 MHz5\,\text{MHz}, 8 MHz8\,\text{MHz}, and 10 MHz10\,\text{MHz}.

    • Driven by a single-phase clock with a 33%33\% duty cycle.

    • Integrated vector table supporting 256 vectored interrupts.

    • Operates in two hardware configurations: Minimum Mode (single-processor configuration) and Maximum Mode (multiprocessor/coprocessor configuration).

8086 Internal Architecture Diagram
  • Internal Functional Division:

    • The internal architecture is partitioned into two functional units working in parallel: the Bus Interface Unit (BIU) and the Execution Unit (EU).

  • Bus Interface Unit (BIU):

    • Primary Functions:

      1. Fetches instruction bytes from memory.

      2. Calculates 20-bit20\text{-bit} physical memory addresses.

      3. Manages data transfers between CPU registers and external memory or I/O ports.

      4. Controls the 6-byte6\text{-byte} instruction prefetch queue to maintain pipelining.

    • Core Components of BIU:

      • Segment Registers: Four 16-bit16\text{-bit} dedicated base registers:

        • Code Segment Register (CS)

        • Data Segment Register (DS)

        • Stack Segment Register (SS)

        • Extra Segment Register (ES)

      • Instruction Pointer (IP): A 16-bit16\text{-bit} pointer register containing the offset address of the next instruction byte to be fetched.

      • Address Generation Circuit: A dedicated summation adder (Σ\Sigma) that computes 20-bit20\text{-bit} physical addresses from segment base values and offset values.

      • Instruction Prefetch Queue: A 6-byte6\text{-byte} FIFO (First-In, First-Out) queue buffer storing prefetched instruction bytes fetched during idle bus cycles.

  • Execution Unit (EU):

    • Primary Functions:

      1. Decodes instruction opcodes drawn from the prefetch queue.

      2. Executes decoded instructions via the internal ALU.

      3. Performs internal register data transfers and arithmetic/logic operations.

      4. Sends requests to the BIU when access to memory or external I/O is required.

      5. Operates in synchronization with clock cycles (T-states).

    • Core Components of EU:

      • General Purpose Registers (GPRs): Four 16-bit16\text{-bit} registers usable as full words or as independent 8-bit8\text{-bit} high (H) and low (L) byte registers:

        • AX (AH, AL): Accumulator Register.

        • BX (BH, BL): Base Register (can hold memory base offsets).

        • CX (CH, CL): Count Register (used as loop counter and shift/rotate counter).

        • DX (DH, DL): Data Register (holds I/O port addresses and multiplication/division operands).

      • Pointer and Index Registers: Four 16-bit16\text{-bit} registers used to hold segment offset displacements:

        • Stack Pointer (SP): Holds top-of-stack offset in Stack Segment.

        • Base Pointer (BP): Holds offset address in Stack Segment for parameter passing.

        • Source Index (SI): Holds offset of source operand in Data Segment.

        • Destination Index (DI): Holds offset of destination operand in Extra Segment.

      • Arithmetic Logic Unit (ALU): 16-bit16\text{-bit} execution unit performing addition, subtraction, multiplication, division, AND, OR, XOR, shifts, and rotates.

      • Flag Register: 16-bit16\text{-bit} register holding processor status and control flags.

Flag Register Structure and Status Definitions

  • Bit Layout of the 16-Bit Flag Register:

    • Contains 9 active flags (6 Status Flags and 3 Control Flags). Unused bit positions are marked as don't-care (x).

8086 Flag Register Configuration
  • Status Flags:

    • Carry Flag (CF):

      • CF=1CF = 1: A carry out of the most significant bit (MSB) occurred during addition, or a borrow was required during subtraction.

      • CF=0CF = 0: No carry or borrow occurred out of the MSB.

    • Parity Flag (PF):

      • PF=1PF = 1: Lower 8 bits of the operation result contain an even number of 1s (Even Parity).

      • PF=0PF = 0: Lower 8 bits contain an odd number of 1s (Odd Parity).

    • Auxiliary Carry Flag (AF):

      • AF=1AF = 1: A carry occurred from the lower nibble (bit 3) to the higher nibble (bit 4) in 8-bit8\text{-bit} arithmetic.

      • AF=0AF = 0: No carry across the nibble boundary. Primarily utilized in BCD (Binary Coded Decimal) routines.

    • Zero Flag (ZF):

      • ZF=1ZF = 1: The result of an arithmetic or logical operation equals zero.

      • ZF=0ZF = 0: The result is non-zero.

    • Sign Flag (SF):

      • SF=1SF = 1: The MSB of the result is 1, indicating a negative signed value.

      • SF=0SF = 0: The MSB of the result is 0, indicating a positive signed value.

    • Overflow Flag (OF):

      • OF=1OF = 1: An arithmetic overflow occurred, meaning the signed result exceeded the storage capacity of the destination operand.

      • OF=0OF = 0: No signed overflow occurred.

  • Control Flags:

    • Trap Flag (TF):

      • TF=1TF = 1: Puts the processor into Single-Stepping mode. The CPU automatically generates an internal INT 1 interrupt after executing each instruction, enabling step-by-step debugging.

      • TF=0TF = 0: Disables single-stepping execution.

    • Interrupt Flag (IF):

      • IF=1IF = 1: Enables recognition of maskable hardware interrupt requests received on the INTR pin.

      • IF=0IF = 0: Disables maskable INTR interrupts.

    • Direction Flag (DF):

      • DF=1DF = 1: Auto-decrements index registers (SI and DI) during string processing instructions.

      • DF=0DF = 0: Auto-increments index registers (SI and DI) during string instructions.

Memory Segmentation and Address Calculation

  • Physical Address Generation:

    • Because segment registers and offset registers are 16 bits16\text{ bits} wide, the BIU combines a 16-bit16\text{-bit} segment base address with a 16-bit16\text{-bit} offset address using a bit-shift adder circuit to generate a 20-bit20\text{-bit} physical address.

    • Address Calculation Formula:         Physical Address=(Segment Register Value×10H)+Offset Address\text{Physical Address} = (\text{Segment Register Value} \times 10_{\text{H}}) + \text{Offset Address}

    • Equivalently, the segment register value is shifted left by 4 binary bit positions (1 hexadecimal digit1\text{ hexadecimal digit}) and added to the 16-bit16\text{-bit} offset displacement.

Physical Address Calculation Diagram
  • Worked Physical Address Calculation Example:

    • Given Segment Register Value = 53C2H53C2_{\text{H}}

    • Given Offset Displacement = 107AH107A_{\text{H}}

    • Shift Segment Register left by 4 bits: 53C20H53C20_{\text{H}}

    • Add Offset Value:         \begin{array}{r@{\quad}l} & 53C20_{\text{H}} \\ + & 107A_{\text{H}} \\ \hline = & 54C9A_{\text{H}} \end{array}

    • Calculated 20-bit20\text{-bit} Physical Address = 54C9AH54C9A_{\text{H}}.

  • Concept of Memory Segmentation:

    • Segmentation is the division of the 1 MB1\,\text{MB} physical memory space into logical blocks called segments.

    • Each logical segment has a maximum size of 64 KB64\,\text{KB} (65,536 bytes65,536\text{ bytes}), matching the addressable range of a 16-bit16\text{-bit} offset register (0000H0000_{\text{H}} to FFFFH\text{FFFF}_{\text{H}}).

  • Active Segments and Register Pairings:

    • Code Segment (CS): Holds instruction code. Paired with IP to generate physical code address: PA=CS×10H+IP\text{PA} = \text{CS} \times 10_{\text{H}} + \text{IP}.

    • Stack Segment (SS): Holds stack data. Paired with SP (top of stack) or BP (stack base offset): PA=SS×10H+SP\text{PA} = \text{SS} \times 10_{\text{H}} + \text{SP}.

    • Data Segment (DS): Holds program variables. Paired with BX, SI, or direct offset: PA=DS×10H+SI\text{PA} = \text{DS} \times 10_{\text{H}} + \text{SI}.

    • Extra Segment (ES): Holds extra destination data for string instructions. Paired with DI: PA=ES×10H+DI\text{PA} = \text{ES} \times 10_{\text{H}} + \text{DI}.

  • Segment Access Status Lines (S4,S3S_4, S_3):

    • S4=0,S3=0S_4 = 0, S_3 = 0: Extra Segment Access.

    • S4=0,S3=1S_4 = 0, S_3 = 1: Stack Segment Access.

    • S4=1,S3=0S_4 = 1, S_3 = 0: Code Segment Access.

    • S4=1,S3=1S_4 = 1, S_3 = 1: Data Segment Access.

  • Advantages of Memory Segmentation:

    • Enables 16-bit16\text{-bit} registers to address 1 MB1\,\text{MB} of physical memory.

    • Separates instruction code, data variables, and stack frames into isolated segments, enhancing code integrity and security.

    • Facilitates relocatable code: programs can be loaded anywhere in physical memory by changing segment base registers without reassembling logical offsets.

Memory Banking in 8086

  • Concept of Memory Banking:

    • The 1 MB1\,\text{MB} physical memory space is organized as two parallel 512 KB512\,\text{KB} memory banks: the Even Bank (Lower Bank) and the Odd Bank (Higher Bank).

    • Even Bank (Lower Bank - LB): Stores bytes located at even physical memory addresses (00000H,00002H,00004H,…00000_{\text{H}}, 00002_{\text{H}}, 00004_{\text{H}}, \dots). Connected to lower data lines D0−D7D_0 - D_7. Activated when address line A_0 = 0$.\n * **Odd Bank (Higher Bank - HB)**: Stores bytes located at odd physical memory addresses (00001_{\text{H}}, 00003_{\text{H}}, 00005_{\text{H}}, \dots).Connectedtohigherdatalines). Connected to higher data linesD_8 - D_{15}.ActivatedwhenBusHighEnablesignal. Activated when Bus High Enable signal\overline{\text{BHE}} = 0$.

  • Banking Operation Control Matrix:

    • BHE‾=0,A0=0\overline{\text{BHE}} = 0, A_0 = 0: Read or write a 16-bit16\text{-bit} word in a single bus cycle from both banks simultaneously (Aligned Word Access).

    • BHE‾=0,A0=1\overline{\text{BHE}} = 0, A_0 = 1: Read or write an 8-bit8\text{-bit} byte from/to the higher odd memory bank.

    • BHE‾=1,A0=0\overline{\text{BHE}} = 1, A_0 = 0: Read or write an 8-bit8\text{-bit} byte from/to the lower even memory bank.

    • BHE‾=1,A0=1\overline{\text{BHE}} = 1, A_0 = 1: No memory operation (Processor bus is idle).

  • Aligned vs. Misaligned Memory Access:

    • Aligned Word Operation: A 16-bit16\text{-bit} word stored at an even starting address (e.g., MOV BX, [2000H]). The CPU fetches both bytes simultaneously in 1 bus cycle because the lower byte is in the Even Bank and the upper byte is in the Odd Bank.

    • Misaligned Word Operation: A 16-bit16\text{-bit} word stored starting at an odd address (e.g., MOV BX, [2001H]). Access requires 2 bus cycles:

      • First Bus Cycle: Fetches the lower byte from odd address 2001H2001_{\text{H}} using the Higher Bank (BHE‾=0,A0=1\overline{\text{BHE}} = 0, A_0 = 1).

      • Second Bus Cycle: Fetches the upper byte from even address 2002H2002_{\text{H}} using the Lower Bank (BHE‾=1,A0=0\overline{\text{BHE}} = 1, A_0 = 0).

8086 Pin Description and Demultiplexing

  • Pin Configuration Overview:

    • Housed in a 40-pin Dual In-line Package (DIP).

8086 40-Pin DIP Pinout Diagram
  • Common Signal Pin Descriptions (Pins 1–23 and 32–40):

    • VCCV_{CC} (Pin 40): Power supply input (+5V DC±10%+5\text{V DC}\pm 10\%).

    • VSSV_{SS} (Pins 1 and 20): System ground connections.

    • AD0−AD15AD_0 - AD_{15} (Pins 16–2, 39): Multiplexed bidirectional address/data bus lines.

      • During T1T_1 clock state, lines carry lower 16 bits16\text{ bits} of physical address (A0−A15A_0 - A_{15}).

      • During T2,T3,T4T_2, T_3, T_4 clock states, lines carry 16 bits16\text{ bits} of parallel data (D0−D15D_0 - D_{15}).

      • AD0−AD7AD_0 - AD_7 carries lower byte (D0−D7D_0 - D_7); AD8−AD15AD_8 - AD_{15} carries upper byte (D8−D15D_8 - D_{15}).

    • A16/S3−A19/S6A_{16}/S_3 - A_{19}/S_6 (Pins 38–35): Multiplexed unidirectional address/status bus lines.

      • During T1T_1, lines carry upper 4 bits of physical address (A16−A19A_{16} - A_{19}).

      • During T2,T3,T4T_2, T_3, T_4, lines carry status signals S_3, S_4, S_5, S_6$.\n * S_5 indicates the current state of the Interrupt Flag (`IF`).\n * S_6 is always low when 8086 controls the system bus.\n * \overline{ ext{BHE}}/S_7(Pin34):BusHighEnableoutputmultiplexedwithstatus(Pin 34): Bus High Enable output multiplexed with statusS_7.Drivenactivelow(. Driven active low (\overline{ ext{BHE}} = 0)during) duringT_1toenabledatatransferovertheupperdatabus(to enable data transfer over the upper data bus (D_8 - D_{15}).\n * \overline{ ext{RD}} (Pin 32): Read control signal (Active Low). Indicates CPU is reading data from memory or I/O.\n * \overline{ ext{TEST}} (Pin 23): Input signal monitored by `WAIT` instruction. Connected to the `BUSY` output pin of 8087 math coprocessor. If low, execution continues; if high, CPU enters wait states.\n * \text{READY}(Pin22):ActivehighinputsignalfromslowmemoryorI/Odevicesindicatingdatatransferreadiness.Iflow,insertswaitstates((Pin 22): Active high input signal from slow memory or I/O devices indicating data transfer readiness. If low, inserts wait states (T_W) into the bus cycle.\n * \text{RESET} (Pin 21): Active high system reset input. Must remain high for at least 4 clock cycles to terminate current activities and re-initialize CPU.\n * ext{CLK}(Pin19):Clockinputsignalsupplyingtiming.Symmetricsquarewavewith(Pin 19): Clock input signal supplying timing. Symmetric square wave with33\% duty cycle ($5\,\text{MHz}, 8\,\text{MHz}, 10\,\text{MHz}).

    • INTR\text{INTR} (Pin 18): Active high, level-triggered maskable interrupt request input line.

    • NMI\text{NMI} (Pin 17): Active high, edge-triggered non-maskable interrupt request input line.

    • MN/MX‾MN/\overline{\text{MX}} (Pin 33): Mode Select input pin. Connected to +5V+5\text{V} (VCCV_{CC}) for Minimum Mode; connected to Ground (VSSV_{SS}) for Maximum Mode.

  • Interfacing and Demultiplexing Hardware Support Chips:

    • 8282 8-Bit Octal Latch:

      • Used to demultiplex and latch physical address lines (A0−A19A_0 - A_{19}) and BHE‾\overline{\text{BHE}} from the multiplexed AD0−AD15AD_0 - AD_{15} and A16/S3−A19/S6A_{16}/S_3 - A_{19}/S_6 buses.

      • Latching is controlled by Address Latch Enable (ALE\text{ALE}) connected to the STB pin of 8282. When STB (ALE\text{ALE}) is high, input addresses are passed to outputs; when low, outputs hold latched address stable.

      • To latch 21 bus signals (A0−A19A_0 - A_{19} and BHE‾\overline{\text{BHE}}), three 8282 chips (3×8=24 lines3 \times 8 = 24\text{ lines}) are connected in parallel.

    • 8286 8-Bit Bidirectional Transceiver:

      • Acts as a bus buffer/driver to separate data from multiplexed buses and increase current drive capability.

      • Enabled when Data Enable (DEN‾\overline{\text{DEN}}) connected to OE‾\overline{\text{OE}} is low.

      • Data direction is governed by Data Transmit/Receive (DT/R‾DT/\overline{\text{R}}) connected to T: if DT/R‾=1DT/\overline{\text{R}} = 1, data is transmitted out; if DT/R‾=0DT/\overline{\text{R}} = 0, data is received in.

      • Two 8286 chips are required to handle the 16-bit16\text{-bit} data bus (D0−D15D_0 - D_{15}).

    • 8284 Clock Generator:

      • Generates a symmetric clock signal with 33%33\% duty cycle using a quartz crystal oscillator connected across X1,X2X_1, X_2

      • Generates synchronized system RESET pulses.

      • Synchronizes asynchronous READY signals from slow peripheral devices to the CPU clock.

System Configurations: Minimum Mode and Maximum Mode

  • Minimum Mode Configuration (MN/MX‾=1MN/\overline{\text{MX}} = 1):

    • Configured by pulling pin 33 (MN/MX‾MN/\overline{\text{MX}}) high to +5V+5\text{V}.

    • Designed for single-processor systems where 8086 directly generates all bus control signals.

    • Clock, RESET, and READY signals are supplied by the 8284 clock generator.

    • External 3-to-8 decoder (74LS138) decodes control outputs to produce MEMR‾\overline{\text{MEMR}}, MEMW‾\overline{\text{MEMW}}, IOR‾\overline{\text{IOR}}, and IOW‾\overline{\text{IOW}}.

Minimum Mode System Diagram
  • Minimum Mode Specific Pin Definitions (Pins 24–31):

    • HOLD\text{HOLD} (Pin 31): Active high input from DMA controller requesting system bus mastership.

    • HLDA\text{HLDA} (Pin 30): Hold Acknowledge active high output to DMA controller indicating bus release.

    • WR‾\overline{\text{WR}} (Pin 29): Write signal active low output. Indicates write operation to memory or I/O.

    • M/IO‾M/\overline{\text{IO}} (Pin 28): Memory/IO select output. High indicates memory access; low indicates I/O port access.

    • DT/R‾DT/\overline{\text{R}} (Pin 27): Data Transmit/Receive output controlling 8286 transceiver data flow. High = Transmit; Low = Receive.

    • DEN‾\overline{\text{DEN}} (Pin 26): Data Enable active low output enabling 8286 transceivers.

    • ALE\text{ALE} (Pin 25): Address Latch Enable active high output pulse generated during T1T_1 to latch address into 8282 latches.

    • INTA‾\overline{\text{INTA}} (Pin 24): Interrupt Acknowledge active low output signal.

  • Maximum Mode Configuration (MN/MX‾=0MN/\overline{\text{MX}} = 0):

    • Configured by grounding pin 33 (MN/MX‾=0MN/\overline{\text{MX}} = 0).

    • Designed for multiprocessor systems incorporating numerical coprocessors (8087) or I/O processors (8089).

    • An external 8288 Bus Controller chip is required to decode processor status outputs (S0‾,S1‾,S2‾\overline{S_0}, \overline{S_1}, \overline{S_2}) and generate system control bus signals (MRDC‾\overline{\text{MRDC}}, MWTC‾\overline{\text{MWTC}}, AMWTC‾\overline{\text{AMWTC}}, IORC‾\overline{\text{IORC}}, IOWC‾\overline{\text{IOWC}}, AIOWC‾\overline{\text{AIOWC}}, INTA‾\overline{\text{INTA}}, ALE\text{ALE}, DEN\text{DEN}, DT/R‾DT/\overline{\text{R}}).

  • Maximum Mode Specific Pin Definitions (Pins 24–31):

    • RQ‾/GT0‾\overline{\text{RQ}}/\overline{\text{GT}_0} and RQ‾/GT1‾\overline{\text{RQ}}/\overline{\text{GT}_1} (Pins 31 and 30): Bidirectional Request/Grant pins used by other bus master processors to request system bus access. RQ‾/GT0‾\overline{\text{RQ}}/\overline{\text{GT}_0} has higher priority than RQ‾/GT1‾\overline{\text{RQ}}/\overline{\text{GT}_1}.

    • LOCK‾\overline{\text{LOCK}} (Pin 29): Active low bus lock output signal activated by adding LOCK prefix to instructions. Prevents other coprocessors from gaining control of system bus during critical memory cycles.

    • S2‾,S1‾,S0‾\overline{S_2}, \overline{S_1}, \overline{S_0} (Pins 28, 27, 26): Status lines output to 8288 Bus Controller:

      • S2‾=0,S1‾=0,S0‾=0\overline{S_2}=0, \overline{S_1}=0, \overline{S_0}=0: Interrupt Acknowledge

      • S2‾=0,S1‾=0,S0‾=1\overline{S_2}=0, \overline{S_1}=0, \overline{S_0}=1: Read I/O Port

      • S2‾=0,S1‾=1,S0‾=0\overline{S_2}=0, \overline{S_1}=1, \overline{S_0}=0: Write I/O Port

      • S2‾=0,S1‾=1,S0‾=1\overline{S_2}=0, \overline{S_1}=1, \overline{S_0}=1: Halt

      • S2‾=1,S1‾=0,S0‾=0\overline{S_2}=1, \overline{S_1}=0, \overline{S_0}=0: Opcode Fetch (Instruction Fetch)

      • S2‾=1,S1‾=0,S0‾=1\overline{S_2}=1, \overline{S_1}=0, \overline{S_0}=1: Memory Read

      • S2‾=1,S1‾=1,S0‾=0\overline{S_2}=1, \overline{S_1}=1, \overline{S_0}=0: Memory Write

      • S2‾=1,S1‾=1,S0‾=1\overline{S_2}=1, \overline{S_1}=1, \overline{S_0}=1: Passive / Inactive

    • QS0,QS1QS_0, QS_1 (Pins 25 and 24): Instruction Queue Status outputs reflecting prefetch queue activity:

      • QS1=0,QS0=0QS_1=0, QS_0=0: No operation

      • QS1=0,QS0=1QS_1=0, QS_0=1: First byte of opcode fetched from queue

      • QS1=1,QS0=0QS_1=1, QS_0=0: Prefetch queue is empty

      • QS1=1,QS0=1QS_1=1, QS_0=1: Subsequent byte fetched from queue

Bus Cycle Timing Diagrams

  • Fundamental Timing Definitions:

    • T-State: The duration of one system clock period (T=1/fT = 1/f).

      • At 5 MHz5\,\text{MHz} clock: 1 T-state=200 ns1\text{ T-state} = 200\,\text{ns}.

      • At 8 MHz8\,\text{MHz} clock: 1 T-state=125 ns1\text{ T-state} = 125\,\text{ns}.

      • At 10 MHz10\,\text{MHz} clock: 1 T-state=100 ns1\text{ T-state} = 100\,\text{ns}.

    • Bus / Machine Cycle: The total time required to execute one basic read or write memory/IO transfer cycle. Consists of a minimum of 4 clock T-states (T1,T2,T3,T4T_1, T_2, T_3, T_4).

      • Read/Write Bus Cycle duration at 5 MHz5\,\text{MHz}: 4×200 ns=800 ns4 \times 200\,\text{ns} = 800\,\text{ns}.

      • Read/Write Bus Cycle duration at 8 MHz8\,\text{MHz}: 4×125 ns=500 ns4 \times 125\,\text{ns} = 500\,\text{ns}.

      • Read/Write Bus Cycle duration at 10 MHz10\,\text{MHz}: 4×100 ns=400 ns4 \times 100\,\text{ns} = 400\,\text{ns}.

    • Instruction Cycle: Total time required to fetch, decode, and execute a complete instruction, composed of one or more consecutive bus cycles.

  • Minimum Mode Read Cycle Timing Sequence:

    • T1T_1: ALE\text{ALE} pulse goes high. Address (A0−A15A_0 - A_{15} and A16−A19A_{16} - A_{19}) and BHE‾\overline{\text{BHE}} are output on multiplexed bus. M/IO‾M/\overline{\text{IO}} is set high (Memory) or low (I/O). DT/R‾DT/\overline{\text{R}} is set low (Receive).

    • T2T_2: ALE\text{ALE} drops low to latch address in 8282. AD0−AD15AD_0 - AD_{15} float to high-impedance state. Upper address lines switch to status (S3−S7S_3 - S_7). RD‾\overline{\text{RD}} signal drops low. DEN‾\overline{\text{DEN}} drops low to enable 8286 transceiver.

    • T3T_3: Memory or I/O device places data (D0−D15D_0 - D_{15}) onto bus lines. Processor samples READY pin.

    • T4T_4: Processor latches data byte/word. RD‾\overline{\text{RD}} and DEN‾\overline{\text{DEN}} return high to end cycle.

Minimum Mode Read Cycle Timing Diagram
  • Minimum Mode Write Cycle Timing Sequence:

    • T1T_1: ALE\text{ALE} pulse goes high, outputting address and BHE‾\overline{\text{BHE}}. M/IO‾M/\overline{\text{IO}} indicates memory or I/O access. DT/R‾DT/\overline{\text{R}} goes high (Transmit).

    • T2T_2: ALE\text{ALE} goes low. 8086 outputs write data (D0−D15D_0 - D_{15}) onto $AD_0 - AD_{15}..\overline{ ext{WR}}andand\overline{ ext{DEN}} drop low.\n * T_3: Data is maintained stable on bus while external memory/device writes data. Processor samples `READY` pin.\n * T_4::\overline{ ext{WR}}andand\overline{ ext{DEN}} return high, ending cycle.\n\n![Minimum Mode Write Cycle Timing Diagram](https://assets.knowt.com/pdf-flow-prod/0788c2b7-aaf4-4598-b3aa-719544f32a3c-figures/45.jpg)\n\n* **Maximum Mode Read and Write Cycle Timing Sequences**:\n * Timing structure follows T_1 - T_4 clock states.\n * In T_1,statuslines, status lines\overline{S_2}, \overline{S_1}, \overline{S_0}outputactivestatuscodes,goingpassive/inactiveinoutput active status codes, going passive/inactive inT_3.\n * Control signals (\overline{ ext{MRDC}},,\overline{ ext{IORC}},,\overline{ ext{MWTC}},,\overline{ ext{AMWTC}},,\overline{ ext{IOWC}},,\overline{ ext{AIOWC}},,\text{ALE},,\text{DEN},,DT/\overline{ ext{R}}) are produced by the 8288 Bus Controller.\n\n![Maximum Mode Read Cycle Timing Diagram](https://assets.knowt.com/pdf-flow-prod/0788c2b7-aaf4-4598-b3aa-719544f32a3c-figures/46.jpg)\n\n![Maximum Mode Write Cycle Timing Diagram](https://assets.knowt.com/pdf-flow-prod/0788c2b7-aaf4-4598-b3aa-719544f32a3c-figures/47.jpg)\n\n# 8086 Interrupt Structure and Servicing\n\n* **Definition and Overview**:\n * An interrupt is an event that suspends normal program execution and redirects CPU control to an Interrupt Service Routine (ISR).\n * The 8086 handles 256 vector interrupts, numbered `INT 0` through `INT 255`.\n\n* **Interrupt Vector Table (IVT)**:\n * Located at the lowest 1\,\text{KB}ofphysicalmemory(of physical memory (00000_{\text{H}}toto003FF_{\text{H}}).\n * **IVT Memory Size Calculation**: 256\text{ interrupts} \times 4\text{ bytes per vector} = 1024\text{ bytes} = 1\,\text{KB}.\n * Each interrupt vector entry requires 4 memory locations:\n * Lower 2 bytes hold the offset address (`IP`): IP_{Lower}atlocationat locationN \times 4,,IP_{Higher}atatN \times 4 + 1$.

      • Upper 2 bytes hold the segment address (CS): CSLowerCS_{Lower} at location N×4+2N \times 4 + 2, CSHigherCS_{Higher} at N \times 4 + 3$.\n * **Base Address Formula**: \text{IVT Address} = N \times 4.\n\n![Interrupt Vector Table Memory Map](https://assets.knowt.com/pdf-flow-prod/0788c2b7-aaf4-4598-b3aa-719544f32a3c-figures/49.jpg)\n\n* **Classification of Interrupts**:\n 1. **Dedicated Interrupts (`INT 0` to `INT 4`)**:\n * `INT 0` (Divide Error): Automatically triggered when division quotient exceeds register capacity or when division by zero occurs. IVT Address = 00000_{\text{H}}.\n * `INT 1` (Single Step): Executed after every instruction if Trap Flag TF = 1.Pausesexecutionfordebugging.IVTAddress=. Pauses execution for debugging. IVT Address =00004_{\text{H}}.\n * `INT 2` (Non-Maskable Interrupt - NMI): Hardware interrupt triggered by an active-high edge on `NMI` pin. IVT Address = 00008_{\text{H}}.\n * `INT 3` (Breakpoint): Caused by opcode `INT 03H` (or single-byte `INT`). Used in debugging large programs to display register contents. IVT Address = 0000C_{\text{H}}.\n * `INT 4` (Overflow - INTO): Triggered by `INTO` instruction if Overflow Flag OF = 1.Usedtocatchsignedarithmeticoverflow.IVTAddress=. Used to catch signed arithmetic overflow. IVT Address =00010_{\text{H}}.\n 2. **Reserved Interrupts (`INT 5` to `INT 31`)**: Reserved by Intel for higher processors (80386, Pentium). Not available for general user applications.\n 3. **User Defined Interrupts (`INT 32` to `INT 255`)**: Software interrupts programmed by users for custom application subroutines. Invoked via `INT n` instruction.\n\n* **Hardware Interrupt Signals (`NMI` and `INTR`)**:\n * `NMI`: Non-maskable, high priority, edge-triggered hardware interrupt. Forces CPU to execute `INT 2` service routine.\n * `INTR`: Maskable, low priority, level-triggered hardware interrupt. Masked by clearing Interrupt Flag (IF = 0)via‘CLI‘;unmaskedbysetting) via `CLI`; unmasked by settingIF = 1via‘STI‘.When‘INTR‘isasserted,8086issuestwovia `STI`. When `INTR` is asserted, 8086 issues two\overline{ ext{INTA}} pulses:\n * *First \overline{ ext{INTA}} Pulse*: Informs peripheral device (e.g., 8259 PIC) to prepare vector number.\n * *Second \overline{ ext{INTA}}Pulse∗:DeviceoutputsinterruptvectorbytePulse*: Device outputs interrupt vector byteNontodatabus.CPUreadsonto data bus. CPU readsN,computes, computesN \times 4, and fetches target CS:IP from IVT.\n\n* **Interrupt Servicing Sequence (Step-by-Step Procedure)**:\n 1. PUSH Flag Register onto Stack:\n       \text{SS}:[\text{SP}-1] \leftarrow \text{Flag}{High}, \quad \text{SS}:[\text{SP}-2] \leftarrow \text{Flag}{Low}, \quad \text{SP} \leftarrow \text{SP} - 2\n 2. Clear Interrupt Flag (`IF`) and Trap Flag (`TF`) (IF \leftarrow 0, TF \leftarrow 0) to disable further maskable interrupts and single stepping.\n 3. PUSH Code Segment (`CS`) onto Stack:\n       \text{SS}:[\text{SP}-1] \leftarrow \text{CS}{High}, \quad \text{SS}:[\text{SP}-2] \leftarrow \text{CS}{Low}, \quad \text{SP} \leftarrow \text{SP} - 2\n 4. PUSH Instruction Pointer (`IP`) onto Stack:\n       \text{SS}:[\text{SP}-1] \leftarrow \text{IP}{High}, \quad \text{SS}:[\text{SP}-2] \leftarrow \text{IP}{Low}, \quad \text{SP} \leftarrow \text{SP} - 2\n 5. Load new `IP` from IVT address N \times 4andandN \times 4 + 1$.

    1. Load new CS from IVT address N×4+2N \times 4 + 2 and N \times 4 + 3$.\n 7. Jump control to starting address of ISR routine.\n\n* **Interrupt Return Sequence (`IRET` Execution)**:\n 1. Restore `IP` from Stack (\text{IP} \leftarrow \text{SS}:[\text{SP}], \text{SP} \leftarrow \text{SP} + 2).\n 2. Restore `CS` from Stack (\text{CS} \leftarrow \text{SS}:[\text{SP}], \text{SP} \leftarrow \text{SP} + 2).\n 3. Restore Flag Register from Stack (\text{Flag} \leftarrow \text{SS}:[\text{SP}], \text{SP} \leftarrow \text{SP} + 2).\n\n* **Interrupt Priorities**:\n * **Simultaneous Occurrence Priority**:\n 1. Divide Error, `INT n`, `INTO` (Highest Priority)\n 2. `NMI` (Priority 2)\n 3. `INTR` (Priority 3)\n 4. Single Stepping (`TF`) (Lowest Priority)\n * **Ability to Interrupt Another Running ISR**:\n * Software interrupts (`INT n`) and `NMI` are non-maskable and can interrupt any running ISR.\n * `INTR` and Single Stepping cannot interrupt an executing ISR because IFandandTF are automatically cleared to 0 upon entering any ISR.\n\n# Data and I/O Addressing Modes\n\n* **Definition**: Addressing modes represent the different methods used by instructions to specify source and destination operand data or effective memory locations.\n\n* **Data Addressing Modes**:\n 1. **Immediate Addressing Mode**: Source operand is an 8-bit or 16-bit constant data value specified within the instruction. Destination cannot be immediate data.\n * `MOV CX, 2000H` (Loads 2000_{\text{H}} into `CX`)\n * `MOV CL, 0AH` (Loads 0\text{A}{\text{H}} into `CL`)\n * `ADD CL, 45H` (Adds 45{\text{H}} to `CL`)\n 2. **Register Addressing Mode**: Both source and destination operands are internal CPU registers.\n * `MOV CL, DL` (Copies contents of `DL` to `CL`)\n * `XOR AX, BX` (Logical XOR between `AX` and `BX`)\n * `ADD AL, BL` (Adds `BL` to `AL`)\n 3. **Direct Addressing Mode**: Effective address (offset) of memory operand is directly specified inside square brackets `[...]` as a displacement value.\n * `MOV CL, [2000H]`\n * *Address Calculation*: \text{PA} = \text{DS} \times 10_{\text{H}} + 2000_{\text{H}}.If. If\text{DS} = 5000_{\text{H}},,\text{PA} = 50000_{\text{H}} + 2000_{\text{H}} = 52000_{\text{H}}.Contentatphysicallocation. Content at physical location52000_{\text{H}} is moved to `CL`.\n 4. **Indirect Addressing Modes**:\n * **Register Indirect Addressing Mode**: Offset address is stored inside a base or index register (`BX`, `BP`, `SI`, `DI`).\n * `MOV CL, [BX]` (\text{PA} = \text{DS} \times 10_{\text{H}} + \text{BX})\n * **Register Relative Addressing Mode**: Offset is computed as the sum of a register content and a constant displacement.\n * `MOV CL, [BX + 4]` or `MOV CL, 04H[BX]`\n * **Base Indexed Addressing Mode**: Offset is computed as the sum of a base register (`BX` or `BP`) and an index register (`SI` or `DI`). `BX` uses Data Segment (`DS`); `BP` uses Stack Segment (`SS`).\n * `MOV CL, [BX + SI]` (\text{PA} = \text{DS} \times 10_{\text{H}} + \text{BX} + \text{SI})\n * `MOV CL, [BP + SI]` (\text{PA} = \text{SS} \times 10_{\text{H}} + \text{BP} + \text{SI})\n * **Base Relative Plus Indexed Addressing Mode**: Offset is computed as the sum of a base register, index register, and constant displacement.\n * `MOV CL, [BX + DI + 20H]` (Operates in Data Segment)\n * `MOV [BP + SI + 2000H], CL` (Operates in Stack Segment)\n 5. **Implied / Implicit Addressing Mode**: Operands are implicitly defined by the instruction opcode itself.\n * `STC` (Sets Carry Flag CF = 1)\n * `CLD` (Clears Direction Flag DF = 0)\n\n* **I/O Addressing Modes**:\n 1. **Direct I/O Addressing Mode**: Uses an 8\text{-bit}portaddress(port address (00_{\text{H}}toto\text{FF}{\text{H}}) specified in instruction, accessing up to 256 I/O port locations.\n * `IN AL, 80H` (Reads byte from I/O port 80{\text{H}} into `AL`)\n * `OUT 05H, AL` (Outputs byte in `AL` to I/O port 05_{\text{H}})\n 2. **Indirect I/O Addressing Mode**: Uses a 16\text{-bit}portaddressstoredinregister‘DX‘(port address stored in register `DX` (0000_{\text{H}}toto\text{FFFF}{\text{H}}), accessing up to 65,536 I/O ports.\n * `MOV DX, 2000H` followed by `IN AL, DX` (Reads byte from I/O port 2000{\text{H}} held in `DX` into `AL`)\n\n# Assembler Directives\n\n* **Definition**: Assembler directives are reserved keywords and statements that direct the assembler during code processing, segment organization, and variable allocation. They do not generate executable machine opcodes.\n\n* **Summary of Key Directives**:\n * `.MODEL`: Defines memory model size:\n * `SMALL`: Code and data fit into single 64\,\text{KB} segments.\n * `MEDIUM`: Multiple code segments (> 64\,\text{KB}),singledatasegment(), single data segment (64\,\text{KB}).\n * `LARGE`: Multiple code segments and multiple data segments (> 64\,\text{KB}).\n * `.DATA`: Initializes and marks the start of the Data Segment.\n * `.CODE`: Marks the start of the Code Segment.\n * `.STACK`: Initializes and marks the start of the Stack Segment.\n * `DB` (Define Byte): Allocates 8\text{-bit} byte variable storage.\n * Example: `LIST DB 7FH, 42H, 35H`\n * `DW` (Define Word): Allocates 16\text{-bit} word storage across two consecutive byte memory locations per value.\n * Example: `ALIST DW 6512H, 7251H, 4DE2H` (Reserves 6 consecutive byte locations).\n * `SEGMENT` and `ENDS`: Mark the start and end of a program segment block.\n * Syntax:\n ```assembly\n Segname SEGMENT\n ; Program code or instructions\n Segname ENDS\n            ```\n * `ASSUME`: Informs assembler which segment register corresponds to a defined logical segment.\n * Example: `ASSUME CS:CODE, DS:DATA`\n * `ORG` (Origin): Sets the initial logical offset location counter for subsequent statements.\n * Example: `ORG 1000H` (Stores subsequent instructions starting at offset 1000_{\text{H}}).\n * `END`: Terminates program assembly. All statements following `END` are ignored.\n * `EVEN`: Directs assembler to align subsequent data or instructions on an even physical memory boundary.\n * `PROC` and `ENDP`: Define boundaries of subroutines/procedures.\n * Used with `NEAR` (intrasegment call) or `FAR` (intersegment call).\n * Syntax:\n ```assembly\n procname PROC NEAR\n ; Procedure statements\n RET\n procname ENDP\n            ```\n * `AT`: Instructs assembler to locate a segment at an absolute base segment address.\n * Example: `.data AT 5000H` (Starts data segment at base address 50000_{\text{H}}).\n\n# 8086 Instruction Set Reference\n\n* **Data Transfer Instructions**:\n * `MOV D, S`: Copies source Stodestinationto destinationD((D = S). E.g., `MOV AX, CX`, `MOV AL, CH`, `MOV BL, [SI]`.\n * `PUSH S`: Pushes word Sontostack(onto stack (\text{SS}:[\text{SP}-1] \leftarrow S_{High}, \text{SS}:[\text{SP}-2] \leftarrow S_{Low}, \text{SP} \leftarrow \text{SP}-2). E.g., `PUSH DX`, `PUSH AX`.\n * `POP D`: Pops word from stack into D((D_{Low} \leftarrow \text{SS}:[\text{SP}], D_{High} \leftarrow \text{SS}:[\text{SP}+1], \text{SP} \leftarrow \text{SP}+2). E.g., `POP AX`, `POP DX`.\n * `PUSHF`: Pushes Flag Register onto stack.\n * `POPF`: Pops word from stack into Flag Register.\n * `XCHG D, S`: Exchanges contents of DandandS. E.g., `XCHG DX, AX`.\n * `IN D, S`: Copies byte or word from I/O port Sintoaccumulatorinto accumulatorD(‘AL‘/‘AX‘).E.g.,‘INAL,80H‘,‘INAX,80H‘(‘AL‘gets(`AL`/`AX`). E.g., `IN AL, 80H`, `IN AX, 80H` (`AL` gets[80_{\text{H}}],‘AH‘gets, `AH` gets[81_{ ext{H}}]),‘INAX,DX‘(‘AL‘gets), `IN AX, DX` (`AL` gets[\text{DX}],‘AH‘gets, `AH` gets[\text{DX}+1]).\n * `OUT D, S`: Copies byte or word from accumulator StoI/Oportto I/O portD. E.g., `OUT 80H, AL`, `OUT 80H, AX`, `OUT DX, AX`.\n * `XLAT`: Look-up table translation (\text{AL} \leftarrow \text{DS}:[\text{BX} + \text{AL}]).\n * `LAHF`: Loads lower byte of Flag Register into `AH` register.\n * `SAHF`: Stores `AH` register into lower byte of Flag Register.\n * `LEA D, S`: Loads effective address offset of source into destination register. E.g., `LEA BX, [SI + 66H]`.\n * `LDS D, S`: Loads destination register with lower 2 bytes and `DS` register with upper 2 bytes from memory source point. E.g., `LDS SI, [DI]`.\n * `LES D, S`: Loads destination register with lower 2 bytes and `ES` register with upper 2 bytes from memory source. E.g., `LES BX, [DI]`.\n\n* **Arithmetic Instructions**:\n * `ADD D, S`: Addition (D = D + S). E.g., `ADD DH, CL`.\n * `ADC D, S`: Addition with Carry (D = D + S + \text{CF}). E.g., `ADC AX, BX`.\n * `SUB D, S`: Subtraction (D = D - S). E.g., `SUB AX, BX`.\n * `SBB D, S`: Subtraction with Borrow (D = D - S - \text{CF}). E.g., `SBB DX, BX`.\n * `CMP D, S`: Compares DandandS((D - S),settingflagswithoutmodifying), setting flags without modifyingDororS. E.g., `CMP AL, DL`.\n * `MUL Reg`: Unsigned multiplication. For 8\text{-bit}register:register:AX = AL \times \text{Reg8}.For. For16\text{-bit}register:register:DX:AX = AX \times \text{Reg16}. E.g., `MUL BH`, `MUL CX`.\n * `IMUL Reg`: Signed multiplication. E.g., `IMUL CX`.\n * `DIV Reg`: Unsigned division. For 8\text{-bit}register:register:AX / \text{Reg8} \rightarrow AL = \text{Quotient}, AH = \text{Remainder}$. For 16-bit16\text{-bit} register: DX:AX / \text{Reg16} \rightarrow AX = \text{Quotient}, DX = \text{Remainder}$. E.g., `DIV BL`, `DIV CX`.\n * `IDIV Reg`: Signed division. E.g., `IDIV BL`.\n * `INC D`: Increment by 1 (D = D + 1). E.g., `INC AX`.\n * `DEC D`: Decrement by 1 (D = D - 1). E.g., `DEC BL`.\n * `CBW`: Convert byte in `AL` to word in `AX` via sign extension.\n * `CWD`: Convert word in `AX` to double-word in `DX:AX` via sign extension.\n * `NEG D`: Replaces Dwithits2′scomplement(with its 2's complement (D = 0 - D). E.g., `NEG AL`.\n * `DAA`: Decimal Adjust Accumulator after addition (adjusts `AL` to packed BCD).\n * `DAS`: Decimal Adjust Accumulator after subtraction.\n * `AAA`: ASCII Adjust Accumulator after addition.\n * `AAS`: ASCII Adjust Accumulator after subtraction.\n * `AAM`: ASCII Adjust Accumulator after multiplication.\n * `AAD`: ASCII Adjust Accumulator before division.\n\n* **Logic, Shift, and Rotate Instructions**:\n\n![Shift and Rotate Operation Diagrams](https://assets.knowt.com/pdf-flow-prod/53bfacb5-26f2-4594-8483-63f85f0def2b-figures/22.png)\n\n * `AND D, S`: Bitwise AND (D = D \text{ AND } S). E.g., `AND AX, CX`.\n * `OR D, S`: Bitwise OR (D = D \text{ OR } S). E.g., `OR AX, BX`.\n * `NOT D`: Bitwise NOT / 1's Complement (D = \text{NOT } D). E.g., `NOT AL`.\n * `XOR D, S`: Bitwise Exclusive-OR (D = D \text{ XOR } S). E.g., `XOR AL, BL`.\n * `TEST D, S`: Performs bitwise AND (D \text{ AND } S) to update flags without altering destination operand. E.g., `TEST AX, 8000H`.\n * `SHR D, 1/CL`: Logical right shift (0 \rightarrow \text{MSB} \dots \text{LSB} \rightarrow \text{CF}). E.g., `SHR AL, 01H`.\n * `SHL/SAL D, 1/CL`: Logical/Arithmetic left shift (\text{CF} \leftarrow \text{MSB} \dots \text{LSB} \leftarrow 0). E.g., `SHL AX, CL`, `SAL Byte Ptr[SI], 1`.\n * `SAR D, 1/CL`: Arithmetic right shift (preserves sign MSB: \text{MSB} \rightarrow \text{MSB} \dots \text{LSB} \rightarrow \text{CF}). E.g., `SAR AL, 01H`, `SAR Word Ptr[BX], CL`.\n * `ROR D, 1/CL`: Rotate right (LSB rotates to MSB and enters CF). E.g., `ROR BL, CL`, `ROR AL, 1`.\n * `ROL D, 1/CL`: Rotate left (MSB rotates to LSB and enters CF). E.g., `ROL BX, 01H`, `ROL BX, CL`.\n * `RCR D, 1/CL`: Rotate right through Carry Flag. E.g., `RCR BL, CL`, `RCR Word Ptr[BX], CL`.\n * `RCL D, 1/CL`: Rotate left through Carry Flag. E.g., `RCL BX, 01H`, `RCL Byte Ptr[SI], 1`.\n\n* **String Manipulating Instructions**:\n * `MOVSB / MOVSW`: Move string byte or word from `DS:SI` to `ES:DI`. `SI` and `DI` auto-increment/decrement by 1 (byte) or 2 (word).\n * `LODSB / LODSW`: Load string byte/word from `DS:SI` into `AL` or `AX`. Auto-inc/dec `SI`.\n * `STOSB / STOSW`: Store string byte/word from `AL` or `AX` into `ES:DI`. Auto-inc/dec `DI`.\n * `CMPSB / CMPSW`: Compare string byte/word at `DS:SI` with `ES:DI`. Updates flags.\n * `SCASB / SCASW`: Scan string byte/word at `ES:DI` against `AL`/`AX`. Updates flags.\n * `REP`: Repeat string instruction while CX eq 0. E.g., `REP MOVSB`.\n * `REPE / REPZ`: Repeat string instruction while Zero Flag ZF = 1andandCX eq 0.\n * `REPNE / REPNZ`: Repeat string instruction while Zero Flag ZF = 0andandCX eq 0.\n * *Assembly Routine Example 1: Clear 50 bytes in Extra Segment starting at offset 2000H*:\n ```assembly\n MOV DI, 2000H\n MOV CX, 50\n MOV AL, 00H\n CLD\n REP STOSB\n        ```\n * *Assembly Routine Example 2: Block transfer 100 bytes from DS:5000H to ES:6000H*:\n ```assembly\n MOV SI, 5000H\n MOV DI, 6000H\n MOV CX, 100\n CLD\n REP MOVSB\n        ```\n\n* **Control Transfer / Branch Instructions**:\n * `CALL address`: Calls subroutine, saving return CS:IP on stack. E.g., `CALL Addition`.\n * `RET`: Returns from subroutine to main program.\n * `IRET`: Returns from Interrupt Service Routine to main program.\n * `JMP address`: Unconditional control jump. E.g., `JMP New`.\n * `LOOP address`: Decrements `CX` and jumps to target address if CX eq 0. E.g., `LOOP Next`.\n * `LOOPE / LOOPZ address`: Decrements `CX`, jumps if ZF = 1andandCX eq 0.\n * `LOOPNE / LOOPNZ address`: Decrements `CX`, jumps if ZF = 0andandCX eq 0.\n * `JC / JNC`: Jump if Carry (CF = 1)/JumpifNoCarry() / Jump if No Carry (CF = 0).\n * `JZ / JNZ` (or `JE / JNE`): Jump if Zero (ZF = 1)/JumpifNotZero() / Jump if Not Zero (ZF = 0).\n * `JO / JNO`: Jump if Overflow (OF = 1)/JumpifNoOverflow() / Jump if No Overflow (OF = 0).\n * `JP / JNP` (or `JPE / JPO`): Jump if Parity Even (PF = 1)/JumpifParityOdd() / Jump if Parity Odd (PF = 0).\n * `JS / JNS`: Jump if Sign Negative (SF = 1)/JumpifSignPositive() / Jump if Sign Positive (SF = 0).\n * `JA / JNBE`: Jump if Above (CF = 0\text{ and } ZF = 0).\n * `JNA / JBE`: Jump if Not Above / Below or Equal (CF = 1\text{ or } ZF = 1).\n * `JB / JNAE`: Jump if Below (CF = 1\text{ and } ZF = 0).\n * `JNB / JAE`: Jump if Not Below / Above or Equal (CF = 0\text{ or } ZF = 1).\n * `JG / JNLE`: Jump if Greater (SF = 0\text{ and } ZF = 0).\n * `JNG / JLE`: Jump if Not Greater / Less or Equal (SF = 1\text{ or } ZF = 1).\n * `JL / JNGE`: Jump if Less (SF = 1\text{ and } ZF = 0).\n * `JNL / JGE`: Jump if Not Less / Greater or Equal (SF = 0\text{ or } ZF = 1).\n * `JCXZ address`: Jump if `CX` register equals 0 (CX = 0).\n\n* **Processor Control / Machine Control Instructions**:\n * `STC`: Set Carry Flag (CF \leftarrow 1).\n * `CLC`: Clear Carry Flag (CF \leftarrow 0).\n * `CMC`: Complement Carry Flag (CF \leftarrow \overline{CF}).\n * `STD`: Set Direction Flag (DF \leftarrow 1).\n * `CLD`: Clear Direction Flag (DF \leftarrow 0).\n * `STI`: Set Interrupt Flag (IF \leftarrow 1).\n * `CLI`: Clear Interrupt Flag (IF \leftarrow 0).\n * `NOP`: No Operation.\n * `LOCK`: Instruction prefix activating \overline{ ext{LOCK}} pin to lock system bus.\n * `WAIT`: Suspends execution to check \overline{ ext{TEST}}$$ pin state (monitors BUSY pin of 8087 coprocessor).

    • ESC: Escape instruction prefix used to pass instructions to 8087 coprocessor.