Skip to main content

Interrupt vs polling; interrupts in 8085

Short answer

Polling wastes CPU time by repeatedly checking devices; interrupts let devices signal the CPU. In the 8085, after finishing the current instruction, it pushes PC, loads the vector address (e.g., 003CH for RST 7.5), and executes the ISR ending with EI and RET.

How is interrupt processing different than polling? Explain how interrupt processing is done with 8085.

Interrupt vs polling

In polling the processor repeatedly reads the status of each I/O device in a loop to see which one needs service. In interrupt processing the device itself signals the processor when it needs service, and the processor meanwhile does other work.

BasisPollingInterrupt
Who starts the transferThe CPU checks the deviceThe device requests the CPU
CPU timeWasted in the status loop (busy waiting)Used for useful work until an interrupt comes
Response timeDepends on the loop; may be slowFast (after current instruction)
HardwareSimple, no extra hardwareNeeds interrupt pins/controller
PriorityFixed by order of checkingSet by hardware priority
Suitable forFew devices, simple systemsReal-time, many devices

Interrupt processing in the 8085

The 8085 has TRAP, RST 7.5, RST 6.5, RST 5.5 (vectored) and INTR (non-vectored), with INTA' as the acknowledge output.

  1. The main program enables interrupts with EI (and SIM if RST 5.5/6.5/7.5 masks need to be set). TRAP is always enabled.
  2. A device raises a request on one of the pins.
  3. The 8085 finishes the current instruction and checks the pins (priority: TRAP > RST 7.5 > 6.5 > 5.5 > INTR).
  4. If the interrupt is accepted, the interrupt enable flip-flop is reset, so no other maskable interrupt is accepted.
  5. The PC (return address) is pushed on the stack.
  6. For INTR, the 8085 sends INTA'; the device places an RST n opcode (or CALL) on the data bus. For the others the PC is loaded with a fixed address: TRAP 0024H, RST 7.5 003CH, RST 6.5 0034H, RST 5.5 002CH.
  7. The interrupt service routine runs. It saves registers with PUSH, services the device, restores the registers with POP, and executes EI and then RET.
  8. RET pops the PC and the main program continues.
 Main program ---- interrupt arrives
      |   finish instruction, push PC
      v
 Vector (e.g. 003CH) -> JMP ISR
      |   ISR: PUSH, service, POP, EI, RET
      v
 Pop PC -> back to main program

✓ Answer checked by Claude Opus 5.5 (high effort)

All Microprocessor chapter 5 questions →