Interrupts are mechanisms that allow a program to be temporarily suspended in order to execute another routine known as the Interrupt Service Routine (ISR). When an interrupt occurs, the current program’s state is saved on the stack, which utilizes a Last In, First Out (LIFO) structure to manage nested interrupts effectively.
There are two types of Interrupts:

  1. Software Interrupts
    • To generate an Software Interrupt we use a Instruction called RSTn.
  2. Hardware Interrupts
    • Priority - The Interrupt with Lower priority is preferred when two Interrupts occur together, the other Interrupt is Sent to Pending State
    • Trigger - To know a Interrupt came or not the Interrupt Pins should be 1. There are two types of Triggers
      1. Edge Triggered - It tells an Interrupt is present only if the pin value moved from 0 to 1. e.g.: A gun will only shoot bullet when it pulled and triggered ( 0 to 1 - Triggering is necessary irrespective of the pull )
      2. Level Triggered - It tells an Interrupt is present if the pin value is 1, irrespective of it’s initial state. e.g.: A Machine gun shoots when it is triggered (1 - not care about the pulling )
    • Mask by SIM - It is used to stop particular any Interrupt except TRAP and INTR
    • Disable by DI - It is used to stop Interrupts except TRAP
    • Vector Address - If the address of an ISR is fixed we call it an Vector Address. Only INTR doesn’t have an fixed ISR address thus it is slow compared to others as to execute it the processor need to fetch the address
InterruptPriorityTriggerMask by SIMDisable by DIVector Address
TRAP1E / L0024H
RST 7.52E003CH
RST 6.53L0034H
RST 5.54L002CH
INTR5LNon - Vector (Device)

Interrupt Structure of 8085

Pasted image 20250614220251.png Note: To enable interrupts within an Interrupt Service Routine (ISR), we typically use the EI (Enable Interrupt) instruction. This instruction allows other interrupts to be processed while the current ISR is executing, effectively enabling interrupt priorities and permitting nested interrupts.
For an interrupt to execute, the following conditions must be met:

  1. The interrupt pin should be set to 1 (active).
  2. The interrupt should be unmasked (enabled).
  3. Global interrupts must be enabled by executing the EI instruction.

8259 Communication with 8085

  • First 8259 will send the Interrupt in any of the interrupt pins of 8085 via INTR
  • Then 8085 will send the INTA(bar) to 8259
  • Then 8259 will send an Opcode to 8085
    1. If the Opcode have RSTn then it will see the address of ISR by doing n x 8 and the function calling continues
    2. If the Opcode have CALL, then it also needs the address then 8259 will send an INTR and gets lower byte of address via INTA(bar) and again will send an INTR and gets higher byte of address Pasted image 20250614224238.png