Skip to content
Advanced Microprocessor

8085 Hardware & Software Interrupts, SIM/RIM & Serial I/O

Hardware vs software interrupts, TRAP, RST 7.5–5.5, INTR, priority resolution, vector locations, SIM/RIM masking, and SID/SOD lines.

Knova editors10 min readQuick checkSources

An interrupt is an asynchronous signal sent by an external device to request the immediate attention of the microprocessor. When interrupted, the CPU suspends its current program execution, saves the Program Counter onto the stack, and branches to an Interrupt Service Routine (ISR).

Classification of 8085 Interrupts

Interrupts in the 8085 are classified along three dimensions:

  1. Hardware vs. Software: Hardware interrupts are initiated by physical signals applied to external CPU pins; software interrupts are initiated by inserting RST n instructions into code.
  2. Vectored vs. Non-Vectored: In vectored interrupts, the CPU branches to a fixed, pre-determined memory address wired into the silicon. In non-vectored interrupts, the interrupting device must place an instruction byte (typically a CALL or RST) onto the data bus during the interrupt acknowledge cycle.
  3. Maskable vs. Non-Maskable: Maskable interrupts can be disabled or delayed by software instructions (DI, SIM); non-maskable interrupts cannot be disabled and must be serviced immediately.

Hardware Interrupt Specifications and Vector Addresses

The 8085 provides five hardware interrupt input pins arranged in strict hardware priority order:

InterruptPriorityTrigger TypeMaskabilityVector Address (Hex)
TRAP (RST 4.5)1 (Highest)1\text{ (Highest)}Edge and LevelNon-Maskable0024H0024\text{H}
RST 7.52Rising-EdgeMaskable (via SIM)003CH003\text{C}\text{H}
RST 6.53High-LevelMaskable (via SIM)0034H0034\text{H}
RST 5.54High-LevelMaskable (via SIM)002CH002\text{C}\text{H}
INTR5 (Lowest)5\text{ (Lowest)}High-LevelMaskable (via EI/DI)Non-Vectored
Fig 6.1: 8085 Hardware Interrupt Priority Hierarchy & Vector Memory Addresses
Fig 6.1: 8085 Hardware Interrupt Priority Hierarchy & Vector Memory Addresses

Software Interrupts (RST 0 - RST 7)

The 8085 supports eight single-byte software restart instructions:

InstructionOpcodeVector Address
RST 0C7H0000H0000\text{H}
RST 1CFH0008H0008\text{H}
RST 2D7H0010H0010\text{H}
RST 3DFH0018H0018\text{H}
RST 4E7H0020H0020\text{H}
RST 5EFH0028H0028\text{H}
RST 6F7H0030H0030\text{H}
RST 7FFH0038H0038\text{H}

Interrupt Masking: SIM and RIM Instructions

Masking for RST 7.5, 6.5, and 5.5 is controlled through the Accumulator using the SIM (Set Interrupt Mask) and RIM (Read Interrupt Mask) instructions.

Bit Format of the SIM Instruction

D7D_7D6D_6D5D_5D4D_4D3D_3D2D_2D1D_1D0D_0
SODSOEXR7.5MSEM7.5M6.5M5.5
  • SOD (Bit 7): Serial Output Data to be latched onto pin 4.
  • SOE (Bit 6): Serial Output Enable (1=enable SOD output1 = \text{enable SOD output}, 0=ignore bit 70 = \text{ignore bit 7}).
  • R7.5 (Bit 4): Reset RST 7.5 flip-flop (1=force clear pending RST 7.5 request1 = \text{force clear pending RST 7.5 request}).
  • MSE (Bit 3): Mask Set Enable (1=apply mask bits D2−D01 = \text{apply mask bits } D_2-D_0, 0=preserve masks0 = \text{preserve masks}).
  • M7.5, M6.5, M5.5 (Bits 2-0): Mask bits (1=Masked/Disabled1 = \text{Masked/Disabled}, 0=Unmasked/Enabled0 = \text{Unmasked/Enabled}).

Bit Format of the RIM Instruction

D7D_7D6D_6D5D_5D4D_4D3D_3D2D_2D1D_1D0D_0
SIDI7.5I6.5I5.5IEM7.5M6.5M5.5
  • SID (Bit 7): Current logic level on the Serial Input Data (pin 5).
  • I7.5, I6.5, I5.5 (Bits 6-4): Pending interrupt flags (1=interrupt pending1 = \text{interrupt pending}).
  • IE (Bit 3): Interrupt Enable status flag (1=interrupts globally enabled1 = \text{interrupts globally enabled}).
  • M7.5, M6.5, M5.5 (Bits 2-0): Current mask status for each line.
Interrupt Priority & Masking Engine

Intel 8085 Interrupt System & SIM / RIM Register Flow

Test hardware interrupts against the priority ladder, toggle SIM mask bits, and observe CPU vector branching.

Global Interrupt Enable (IE)Controls maskable interrupt gate (EI / DI instructions)
SIM Register Mask Bits (0 = Unmasked, 1 = Masked)Word: 08H
Simulate External Pin Trigger:
CPU Interrupt Branch Destination
Executing Main Program (No Interrupt Service)
8085 Interrupt Priority Ladder
#1 TRAP (RST 4.5)
Edge + Level · NON-MASKABLE
0024H
#2 RST 7.5
Rising Edge · ENABLED
003CH
#3 RST 6.5
High Level · ENABLED
0034H
#4 RST 5.5
High Level · ENABLED
002CH
#5 INTR
Level · ENABLED
External Call
Interrupt Controller Log:

CPU ready in EI (Interrupts Enabled) state.

Serial I/O Communication: SID and SOD

The 8085 provides two dedicated serial communication pins:

  • SID (Serial Input Data, Pin 5): Reads a single serial bit directly into bit D7D_7 of the Accumulator when RIM is executed.
  • SOD (Serial Output Data, Pin 4): Latches bit D7D_7 of the Accumulator out to external circuitry when SIM is executed with SOE=1SOE = 1 (D6=1D_6 = 1).
Try it
SIM Instruction Mask Construction: To unmask RST 7.5 and RST 5.5, while masking RST 6.5, what hex byte should be loaded into Accumulator before executing SIM? (Ignore serial I/O).

Sources

  1. 1.Intel 8085 Microprocessor Datasheet · reference · Intel (opens in a new tab)

Was this chapter useful?

Editors read every answer.

Star this chapter

Each star goes once to every reader who improved this chapter.

Finished reading?

Mark it to keep your place in the course.