Lesson 16 of 48 intermediate

Reset, HOLD, HLDA, and Basic Control Signals

How the 8086 starts up, shares the bus with DMA, and uses essential control pins

Open interactive version (quiz + challenge)

Real-world analogy

RESET is like a fire alarm drill at school — everyone stops what they are doing, returns to their default positions, and waits for the all-clear. HOLD/HLDA is like a valet parking system: the valet (DMA) asks for the car keys (HOLD), the driver (CPU) finishes parking and hands over the keys (HLDA), and the valet drives the car directly where it needs to go — much faster than giving the driver directions.

What is it?

The 8086's control signals manage system initialization (RESET sets CS=FFFFh, IP=0000h so execution begins at FFFF0h), bus sharing (HOLD/HLDA handshake lets DMA controllers take over the bus for direct memory transfers), interrupt handling (INTA acknowledges hardware interrupts), coprocessor synchronization (TEST/WAIT), and bus locking (LOCK for atomic operations).

Real-world relevance

Every time you power on or restart your computer, the CPU goes through a RESET sequence almost identical to the 8086's — modern x86 processors still start at a high address in the firmware (UEFI/BIOS) ROM. DMA transfers, pioneered with the 8086's HOLD/HLDA mechanism, are still fundamental — your disk controller, network card, and GPU all use DMA to transfer data to RAM without burdening the CPU.

Key points

Code example

; Complete power-on boot sequence of an 8086 system

; === PHASE 1: RESET ===
; Power supply stabilizes, 8284A holds RESET HIGH
; After 4+ clock cycles, RESET goes LOW
; CPU state after RESET:
;   CS=FFFFh, IP=0000h -> fetch from FFFF0h
;   DS=ES=SS=0000h, SP=0000h
;   Flags=0000h (IF=0, interrupts disabled)

; === PHASE 2: First instruction fetch ===
; Physical address = FFFFh << 4 + 0000h = FFFF0h
; ROM at FFFF0h contains:
    JMP FAR F000h:E05Bh  ; Jump to BIOS

; === PHASE 3: BIOS initialization ===
; CS=F000h, IP=E05Bh
; BIOS code initializes hardware:
    CLI                   ; Ensure interrupts off
    MOV AX, 0000h
    MOV DS, AX           ; DS = 0000h
    MOV SS, AX           ; SS = 0000h
    MOV SP, 0400h        ; Set up stack

; === PHASE 4: Hardware test and setup ===
; BIOS tests RAM, initializes 8259A, 8253, etc.
; Sets up interrupt vector table at 0000:0000
; Eventually enables interrupts:
    STI                   ; IF=1, INTR now active

; === PHASE 5: Boot ===
; BIOS loads boot sector from disk via DMA:
;   8237 DMA asserts HOLD
;   CPU asserts HLDA, releases bus
;   DMA reads disk data directly to RAM at 7C00h
;   DMA releases HOLD
;   CPU resumes, JMPs to 0000:7C00h (boot sector)

Line-by-line walkthrough

  1. 1. After RESET releases, CS=FFFFh and IP=0000h. The physical address is FFFFh shifted left 4 bits plus 0000h = FFFF0h. ROM must be mapped here.
  2. 2. JMP FAR F000h:E05Bh at FFFF0h loads CS with F000h and IP with E05Bh — this jumps to the actual BIOS code further down in ROM.
  3. 3. CLI clears the Interrupt Flag — we do not want interrupts firing before the interrupt vector table and hardware are initialized.
  4. 4. MOV AX,0000h then MOV DS/SS,AX sets the data and stack segments to zero — segment registers cannot be loaded with immediate values directly.
  5. 5. MOV SP,0400h sets up the stack pointer so PUSH, POP, CALL, and interrupts have a valid stack to use.
  6. 6. BIOS code then tests RAM, initializes peripheral chips (8259A interrupt controller, 8253 timer, 8237 DMA), and builds the interrupt vector table.
  7. 7. STI enables interrupts once everything is set up — now the 8259A can deliver hardware interrupts to the CPU via INTR.
  8. 8. The DMA sequence: 8237 asserts HOLD, CPU finishes its current cycle and asserts HLDA, bus goes tri-state, DMA reads disk sector directly to RAM at 7C00h, DMA releases HOLD, CPU deasserts HLDA and resumes.
  9. 9. Finally the BIOS jumps to 0000:7C00h where the boot sector code now resides in RAM — the operating system loading process begins.

Spot the bug

; After RESET, the system hangs — never reaches BIOS
; Hardware setup:
;   ROM chip mapped at address range F0000h-FFFFFh
;   RAM chip mapped at address range 00000h-0FFFFh
;   No other memory chips installed
;
; ROM contents at offset FFF0h (physical FFFF0h):
;   JMP FAR 0000h:8000h  ; Jump to RAM at 08000h
;
; Observation: CPU fetches first instruction OK
; but hangs immediately after the JMP
Need a hint?
Where does the JMP try to go, and is there any memory mapped at that address?
Show answer
Bug: The JMP FAR 0000h:8000h jumps to physical address 0000h × 10h + 8000h = 08000h. But the RAM chip only covers 00000h-0FFFFh (64 KB) and the ROM covers F0000h-FFFFFh. Address 08000h is within the RAM range — but it contains random garbage data since no code has been loaded into RAM yet! The CPU tries to execute random bytes and crashes. Fix: The reset vector JMP should jump to an address within the ROM range, e.g., JMP FAR F000h:E05Bh (which maps to FE05Bh, within the ROM). Only jump to RAM after loading valid code there.

Explain like I'm 5

When you press the power button on a computer, it is like waking up in the morning. RESET is the alarm clock — it puts everything back to the start. The CPU opens its eyes and looks at one specific spot (FFFF0h) for its first instruction, which is like a sticky note on the nightstand saying 'Go to the kitchen' (JMP to BIOS). HOLD/HLDA is like when your mom says 'Let me use the table for a moment' — you step back, she does her thing, then gives it back to you.

Fun fact

The reset vector address FFFF0h was chosen by Intel because it is near the top of the 1 MB address space, ensuring that ROM (which must be at a fixed location) could be mapped to the highest addresses. This convention persists to this day — modern x86-64 processors start execution at FFFFFFF0h (4 GB - 16 bytes) in their initial real-address mode, maintaining backward compatibility with a design decision from 1978!

Hands-on challenge

Write the first 10 instructions of a BIOS initialization routine that would execute after RESET. Your code should: (1) jump from the reset vector FFFF0h to a lower ROM address, (2) disable interrupts, (3) set up DS, ES, SS to known values, (4) set up a stack pointer, (5) test a memory location to verify RAM is working. Then describe the HOLD/HLDA sequence that would occur when loading the boot sector from a floppy disk via DMA.

More resources

Open interactive version (quiz + challenge) ← Back to course: Microprocessor A–Z