PadhaikoAll subjects

Interrupts, Polling, Types & 8085 Interrupt Processing

Microprocessors (ENEX 201)

Open in the Padhaiko app

5.1 Interrupt and its importance

An interrupt is an asynchronous hardware or software signal that informs the microprocessor that an external peripheral device or internal system event requires immediate service.

When an interrupt occurs:

  1. The microprocessor suspends execution of its current program.
  2. It saves its current execution state (the Program Counter) onto the stack.
  3. It branches to a dedicated subroutine known as an Interrupt Service Routine (ISR) or interrupt handler.
  4. After executing the ISR, the processor restores its saved state and resumes execution of the interrupted program exactly where it left off.

Importance of Interrupts

In real-world computer systems, interrupts are essential for three primary reasons:

  1. Elimination of Idle Waiting: In non-interrupt systems, the CPU must continuously query (poll) slow peripheral devices. Because peripherals operate millions of times slower than the CPU, polling wastes enormous computational bandwidth. Interrupts allow the CPU to perform useful calculations continuously while peripherals run independently.
  2. Immediate Real-Time Response: Time-critical events (such as power failure detection, emergency motor shutoff, industrial sensor alarms, and real-time clock ticks) must be acknowledged within microseconds. Interrupts force the CPU to respond immediately to critical signals.
  3. Asynchronous Concurrent I/O: Interrupts enable true asynchronous I/O operations where multiple peripherals (keyboards, serial ports, network interfaces, storage controllers) interact with the computer concurrently without interfering with the execution of the main user application.

5.2 Polling vs interrupt

Data transfer between a microprocessor and peripheral devices can be coordinated either through Polling (Programmed I/O) or through Interrupt-Driven I/O.

AspectPolling (Programmed I/O)Interrupt-Driven I/O
Control MechanismSoftware-driven; CPU repeatedly tests status register of peripheral in a loopHardware-driven; peripheral asserts physical interrupt line when ready
CPU UtilizationHighly wasteful; CPU spends most of its execution cycles in busy-waiting loopsHighly efficient; CPU executes main program and services devices only on demand
Response LatencyHigh latency; response time depends on how frequently the CPU checks the deviceMinimal latency; CPU responds immediately after finishing current instruction
Priority HandlingFixed by polling order in software loop (first polled device has highest priority)Handled automatically by hardware daisy-chain or programmable priority controller
Hardware ComplexityMinimal; requires only standard I/O port buffers and latchesRequires interrupt controller hardware, vector decoders, and CPU interrupt logic
ScalabilityPoor; adding more devices degrades system performance and increases polling delayExcellent; many devices can share interrupt lines without slowing down the CPU

5.3 Types of interrupts

Interrupts in microprocessor systems are classified into three primary operational categories:

1. Hardware vs Software Interrupts

2. Vectored vs Non-Vectored Interrupts

3. Maskable vs Non-Maskable Interrupts


5.4 Interrupts in 8085 and interrupt instructions

The Intel 8085 microprocessor features five hardware interrupt pins, listed below in strict order of hardware priority:

8085 Hardware Interrupt Specifications
Interrupt NamePriorityTrigger SensitivityMaskabilityVector Address (Hex)Vector Address (Dec)
TRAP1 (Highest)Level AND Rising EdgeNon-maskable0024H36
RST 7.52Rising Edge Only (Latched)Maskable (via SIM)003CH60
RST 6.53Level Sensitive (HIGH)Maskable (via SIM)0034H52
RST 5.54Level Sensitive (HIGH)Maskable (via SIM)002CH44
INTR5 (Lowest)Level Sensitive (HIGH)Maskable (via EI/DI)Supplied externallyVariable

Triggering Characteristics of 8085 Interrupts

  1. TRAP (Non-Maskable, Highest Priority):
    • It requires both a rising edge and a sustained HIGH level: the signal must make a low-to-high transition to be recognized and remain HIGH until the 8085 samples it. This dual sensitivity prevents false triggering caused by electrical noise spikes.
    • It cannot be disabled by DI or SIM.
    • Vector address = 4.5 x 8 = 36 = 0024H.
  2. RST 7.5 (Edge-Sensitive):
    • It is triggered strictly by a rising edge (low-to-high transition).
    • The edge sets an internal D flip-flop inside the 8085. Therefore, even if the external pulse goes LOW before the CPU finishes its current instruction, the interrupt request remains stored (latched) until serviced or cleared.
    • Vector address = 7.5 x 8 = 60 = 003CH.
  3. RST 6.5 and RST 5.5 (Level-Sensitive):
    • Triggered by a continuous logic HIGH level.
    • These pins have no internal latches; the external signal must be held HIGH until the processor samples and recognizes the interrupt during the final clock state of the executing instruction.
    • Vector addresses: RST 6.5 = 6.5 x 8 = 52 = 0034H; RST 5.5 = 5.5 x 8 = 44 = 002CH.
  4. INTR (General-Purpose, Non-Vectored):
    • Level-sensitive input sampled during the last clock cycle of each instruction.
    • When accepted, the 8085 asserts INTA_bar (Interrupt Acknowledge, pin 12) LOW. The external hardware must place a single-byte RST n instruction (opcodes C7H, CFH, D7H, DFH, E7H, EFH, F7H, FFH) or a three-byte CALL instruction on data bus D7–D0.

8085 Interrupt Control Instructions

The 8085 provides four dedicated machine instructions to manage its interrupt subsystem:

1. EI (Enable Interrupts)

2. DI (Disable Interrupts)

3. SIM (Set Interrupt Mask)

Text
+----+----+----+----+----+----+----+----+
| D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
+----+----+----+----+----+----+----+----+
  |    |    |    |    |    |    |    |
  |    |    |    |    |    |    |    +---> M5.5: Mask RST 5.5 (1=Masked, 0=Available)
  |    |    |    |    |    |    +--------> M6.5: Mask RST 6.5 (1=Masked, 0=Available)
  |    |    |    |    |    +-------------> M7.5: Mask RST 7.5 (1=Masked, 0=Available)
  |    |    |    |    +------------------> MSE: Mask Set Enable (1=Update D2–D0, 0=Ignore D2–D0)
  |    |    |    +-----------------------> R7.5: Reset RST 7.5 flip-flop (1=Clear pending request)
  |    |    +----------------------------> 0: Unused / don't care
  |    +---------------------------------> SDE: Serial Data Enable (1=Output D7 to SOD pin)
  +--------------------------------------> SOD: Serial Output Data bit

4. RIM (Read Interrupt Mask)

Text
+----+----+----+----+----+----+----+----+
| D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
+----+----+----+----+----+----+----+----+
  |    |    |    |    |    |    |    |
  |    |    |    |    |    |    |    +---> M5.5: Current mask status of RST 5.5 (1=Masked)
  |    |    |    |    |    |    +--------> M6.5: Current mask status of RST 6.5 (1=Masked)
  |    |    |    |    |    +-------------> M7.5: Current mask status of RST 7.5 (1=Masked)
  |    |    |    |    +------------------> IE: Interrupt Enable flag (1=Interrupts enabled)
  |    |    |    +-----------------------> P5.5: Pending request on RST 5.5 (1=Pending)
  |    |    +----------------------------> P6.5: Pending request on RST 6.5 (1=Pending)
  |    +---------------------------------> P7.5: Pending request on RST 7.5 (1=Pending)
  +--------------------------------------> SID: Current logic level on physical SID pin

5.5 Interrupt service routine

An Interrupt Service Routine (ISR) is a specialized subroutine designed to service a specific hardware or software interrupt condition.

Memory Organization of 8085 Vector Table

The 8085 reserves the first 64 bytes of memory (0000H through 003FH) for restart and interrupt vector locations. Each restart vector is allocated exactly 8 bytes of memory:

8085 Complete Vector Allocation Table
Instruction / PinVector FormulaHex AddressMemory AvailableTypical Action
System RESET / RST 00 x 80000H8 bytes (0000H–0007H)Power-on initialization jump (JMP MAIN)
RST 11 x 80008H8 bytes (0008H–000FH)Software restart / debug handler
RST 22 x 80010H8 bytes (0010H–0017H)Software restart
RST 33 x 80018H8 bytes (0018H–001FH)Software restart
RST 44 x 80020H4 bytes (0020H–0023H)Software restart
TRAP4.5 x 80024H4 bytes (0024H–0027H)Emergency power failure / critical fault jump
RST 55 x 80028H4 bytes (0028H–002BH)Software restart
RST 5.55.5 x 8002CH4 bytes (002CH–002FH)Hardware interrupt jump (JMP ISR_55)
RST 66 x 80030H4 bytes (0030H–0033H)Software restart
RST 6.56.5 x 80034H4 bytes (0034H–0037H)Hardware interrupt jump (JMP ISR_65)
RST 77 x 80038H4 bytes (0038H–003BH)Software restart
RST 7.57.5 x 8003CH4 bytes (003CH–003FH)Hardware interrupt jump (JMP ISR_75)

Because vector locations are separated by only 4 or 8 bytes, an entire ISR cannot fit in the vector space. Instead, a 3-byte unconditional jump instruction (JMP <ISR_ADDRESS>) is placed at the vector location, redirecting execution to the full ISR located elsewhere in system memory.

Standard Structure of an ISR

A robust ISR follows five essential steps:

  1. Context Saving: Save all CPU registers that the ISR will modify onto the stack using PUSH instructions (PUSH PSW, PUSH B, PUSH D, PUSH H).
  2. Execute Device Service: Perform the required data read, write, or algorithmic operation.
  3. Context Restoration: Restore the saved registers in reverse order using POP instructions (POP H, POP D, POP B, POP PSW).
  4. Re-Enable Interrupts: The 8085 hardware automatically disables maskable interrupts upon accepting an interrupt request. The ISR must execute an EI instruction immediately before returning so subsequent interrupts can be serviced.
  5. Return: Execute RET (Return) to pop the return address from the stack into the Program Counter.

5.6 Interrupt processing in 8085

The complete cycle of 8085 interrupt handling consists of an automated sequence of hardware operations followed by software execution:

Definition

Eight-Stage 8085 Interrupt Processing Sequence

  1. Stage 1 — Signal Assertion: An external peripheral asserts an interrupt pin (TRAP, RST 7.5, RST 6.5, RST 5.5, or INTR).
  2. Stage 2 — Completion of Current Instruction: The 8085 never aborts an instruction mid-cycle. It completes the execution of the current instruction to maintain architectural consistency.
  3. Stage 3 — Sampling and Priority Evaluation: During the final clock cycle (T-state) of the executing instruction, internal CPU logic samples all interrupt pins. If multiple lines are active, the internal priority resolver selects the request with the highest hardware priority.
  4. Stage 4 — Condition Check: The processor verifies that:
    • The selected interrupt is not masked (in the SIM mask register).
    • Maskable interrupts are globally enabled (internal IE = 1). (TRAP bypasses these checks as it is non-maskable).
  5. Stage 5 — Automatic Hardware Disable: The 8085 automatically clears the internal Interrupt Enable flip-flop (IE = 0), disabling all maskable interrupts to prevent nested interrupt collisions.
  6. Stage 6 — Return Address Pushed to Stack: The 8085 pushes the 16-bit Program Counter (the address of the next sequential instruction) onto the stack:
    • High byte of PC is stored at [SP - 1]
    • Low byte of PC is stored at [SP - 2]
    • Stack Pointer is decremented by 2 (SP = SP - 2).
  7. Stage 7 — Vector Generation or Acknowledgment:
    • For Vectored Interrupts (TRAP, RST 5.5, RST 6.5, RST 7.5): The internal hardware forces the corresponding vector address (0024H, 002CH, 0034H, or 003CH) into the Program Counter.
    • For Non-Vectored Interrupt (INTR): The 8085 generates an active-low INTA_bar (Interrupt Acknowledge) strobe. During this cycle, external hardware places an instruction (e.g., RST n, opcode 11nn n111B) onto data lines D7–D0. The 8085 fetches and executes this instruction, branching to n x 8.
  8. Stage 8 — Execution of ISR and Return: The 8085 begins executing instructions at the vector location. The ISR performs its task, re-enables interrupts via EI, and executes RET. The RET instruction pops the stored 16-bit address from the stack into the Program Counter, resuming the main program.

Worked Examples

Example

Configuring 8085 Interrupt Masks Using the SIM Instruction

An 8085 microprocessor system requires the following interrupt configuration:

  1. Construct the 8-bit accumulator mask word in binary and hexadecimal.
  2. Write the assembly instruction sequence to apply this mask configuration and globally enable interrupts. Show register states and timing.

Determine Accumulator Bit Values for SIM: The bit fields of the Accumulator for SIM are defined as:

  • D0 (M5.5): 1 (Mask / Disable RST 5.5)
  • D1 (M6.5): 0 (Unmask / Enable RST 6.5)
  • D2 (M7.5): 0 (Unmask / Enable RST 7.5)
  • D3 (MSE): 1 (Mask Set Enable: must be 1 to update bits D2–D0)
  • D4 (R7.5): 1 (Reset RST 7.5 flip-flop to clear pending request)
  • D5: 0 (Unused)
  • D6 (SDE): 0 (Serial Data Enable disabled; SOD pin is unchanged)
  • D7 (SOD): 0 (Don't care since SDE = 0)

Combining bits D7 down to D0: Accumulator Byte = 0 0 0 1 1 0 0 1 B = 19H

Assembly Instruction Sequence:

8085 ASM
ORG 2000H
MVI A,19H
SIM
EI
HLT

Instruction Trace and Register States:

  1. MVI A,19H: Loads the formulated control word 19H into the Accumulator.
After MVI A,19H
A19H
B00H
C00H
D00H
E00H
H00H
L00H
S0
Z0
AC0
P0
CY0
MVI A,19H CLK A15–A8 AD7–AD0 ALE IO/M̅ S1 S0 RD̅ WR̅ OF T1 T2 T3 T4 20H Unspecified 00H 3EH High-Z MR T1 T2 T3 20H 01H 19H
MVI A,19H · OF + MR · 7 T-states
  1. SIM: Transfers Accumulator bits into the internal interrupt mask register: RST 5.5 is masked (disabled), RST 6.5 and RST 7.5 are unmasked, and the RST 7.5 edge flip-flop is reset. Machine cycles: Opcode Fetch (4T) = 4 T-states.
  2. EI: Sets internal Interrupt Enable flip-flop (IE = 1), globally enabling maskable interrupts. Machine cycles: Opcode Fetch (4T) = 4 T-states.
Answer:

The Accumulator byte for SIM is 19H (00011001B). The sequence MVI A,19H, SIM, and EI applies the mask, clears pending RST 7.5 requests, and enables interrupts globally.

Example

Interrupt-Driven Pulse Counter Program with RST 7.5

Design an interrupt-driven pulse counter for an 8085 microprocessor. External sensor pulses arrive on the RST 7.5 hardware interrupt pin.

  1. The main program must initialize a 16-bit memory variable COUNTER at memory address 2050H to 0000H, unmask RST 7.5 (with RST 6.5 and RST 5.5 masked), globally enable interrupts, and wait for pulses.
  2. Write the Interrupt Service Routine (ISR) starting at address 2100H that increments COUNTER by 1 upon each pulse, saves and restores registers, re-enables interrupts, and returns. Show vector linking and register states.

Formulate SIM Control Word for Main Program:

  • Mask RST 5.5: D0 = 1
  • Mask RST 6.5: D1 = 1
  • Unmask RST 7.5: D2 = 0
  • Mask Set Enable: D3 = 1
  • Reset RST 7.5 flip-flop: D4 = 1
  • SDE = 0, SOD = 0

Control Word = 0 0 0 1 1 0 1 1 B = 1BH

Vector Location Setup (at 003CH): Because RST 7.5 vectors to address 003CH, we place a 3-byte unconditional jump at 003CH:

8085 ASM
ORG 003CH
JMP 2100H

Main Program and ISR Implementation:

8085 ASM
ORG 2000H
LXI SP,2400H
LXI H,0000H
SHLD 2050H

MVI A,1BH
SIM
EI

WAIT_LOOP:
HLT
JMP WAIT_LOOP

ORG 2100H
PUSH PSW
PUSH H
LHLD 2050H
INX H
SHLD 2050H
POP H
POP PSW
EI
RET

Execution Trace on First Interrupt Event:

  1. A rising edge on RST 7.5 sets the internal flip-flop.
  2. The 8085 finishes its current instruction, pushes return address (200EH, the instruction after HLT) onto stack at 23FEH, disables interrupts, and jumps to 003CH.
  3. At 003CH, JMP 2100H directs execution to the ISR.
  4. In ISR, LHLD 2050H loads 0000H into HL. INX H increments HL to 0001H. SHLD 2050H saves 0001H back into memory.
ISR Post-Increment State
A1BH
B00H
C00H
D00H
E00H
H00H
L01H
S0
Z0
AC0
P0
CY0
[2050H]01H
[2051H]00H
  1. Registers are popped, EI enables interrupts, and RET restores PC to resume the WAIT_LOOP.
Answer:

The main program configures SIM with 1BH and sets the stack. The vector at 003CH jumps to 2100H, where the ISR preserves registers, increments the 16-bit count at 2050H, executes EI, and returns.

Example

Interpreting 8085 Interrupt Status Using the RIM Instruction

During the execution of an industrial controller program, an 8085 microprocessor executes the RIM instruction. The Accumulator is loaded with the hexadecimal value 5DH.

Decode this byte completely and determine:

  1. The logic level currently present on the physical SID pin.
  2. The status of pending interrupt requests on RST 7.5, RST 6.5, and RST 5.5.
  3. The status of the internal Interrupt Enable (IE) flip-flop.
  4. The individual mask status of RST 7.5, RST 6.5, and RST 5.5.

Convert Hexadecimal Status Byte to Binary: 5DH = 0 1 0 1 1 1 0 1 B

Assign bit positions D7 down to D0:

  • D7 = 0
  • D6 = 1
  • D5 = 0
  • D4 = 1
  • D3 = 1
  • D2 = 1
  • D1 = 0
  • D0 = 1

Map Bits to RIM Register Definitions:

  1. SID Pin (Bit D7 = 0): The serial input data line SID is at logic 0 (0V).
  2. Pending Interrupts (Bits D6, D5, D4):
    • D6 (P7.5 = 1): A hardware request is pending on RST 7.5 (latched in its flip-flop).
    • D5 (P6.5 = 0): No request pending on RST 6.5.
    • D4 (P5.5 = 1): A hardware request is pending on RST 5.5.
  3. Interrupt Enable Flag (Bit D3 = 1): IE = 1: The internal Interrupt Enable flip-flop is set (interrupts are globally enabled via EI).
  4. Mask Bits (Bits D2, D1, D0):
    • D2 (M7.5 = 1): RST 7.5 is masked (disabled). Even though a request is pending (P7.5=1), the CPU will not service it until unmasked.
    • D1 (M6.5 = 0): RST 6.5 is unmasked (available).
    • D0 (M5.5 = 1): RST 5.5 is masked (disabled).
Answer:

SID pin = 0; Pending interrupts: RST 7.5 is pending, RST 6.5 is not pending, RST 5.5 is pending; Interrupt Enable flag = 1 (enabled); Masks: RST 7.5 is masked, RST 6.5 is unmasked, RST 5.5 is masked.


Exercises

Exercises

Question 1

Construct a comprehensive reference table for all five hardware interrupts of the Intel 8085 microprocessor. For each interrupt, specify: priority rank, triggering sensitivity (edge, level, or both), maskability, and the exact vector address in both hexadecimal and decimal notation.

Hardware Interrupt Summary Table:

Interrupt NamePriority RankTrigger TypeMaskabilityVector Address (Hex)Vector Address (Decimal)
TRAP1 (Highest)Level AND Rising EdgeNon-Maskable0024H36 (4.5 x 8)
RST 7.52Rising Edge Only (Latched)Maskable (via SIM)003CH60 (7.5 x 8)
RST 6.53High Level SensitiveMaskable (via SIM)0034H52 (6.5 x 8)
RST 5.54High Level SensitiveMaskable (via SIM)002CH44 (5.5 x 8)
INTR5 (Lowest)High Level SensitiveMaskable (via EI/DI)Non-vectoredSupplied by external hardware

Engineering Observations on Triggering Differences:

  • TRAP requires both a rising edge and a sustained HIGH level to prevent noise spikes from falsely triggering an unmaskable routine.
  • RST 7.5 is edge-triggered; its internal flip-flop stores narrow pulses even if the line returns LOW before instruction completion.
  • RST 6.5, RST 5.5, and INTR are level-sensitive; the external device must hold the pin HIGH until the CPU enters the acknowledge phase.
Answer:

TRAP (Priority 1, Non-maskable, Edge+Level, 0024H / 36); RST 7.5 (Priority 2, Maskable, Edge, 003CH / 60); RST 6.5 (Priority 3, Maskable, Level, 0034H / 52); RST 5.5 (Priority 4, Maskable, Level, 002CH / 44); INTR (Priority 5, Maskable, Level, Non-vectored).

Question 2

Compare Polling and Interrupt-Driven I/O across five critical criteria. Under what specific operational condition is Polling technically superior to an Interrupt-Driven design?

Comparison of Polling and Interrupt-Driven I/O:

  1. CPU Overhead: Polling wastes hundreds of thousands of CPU cycles executing query loops. Interrupts consume zero CPU cycles until the peripheral requires service.
  2. System Throughput: Interrupt systems provide dramatically higher overall throughput because the CPU executes computational algorithms concurrently with peripheral activity.
  3. Response Speed (Latency): Interrupts offer near-instantaneous response (serviced immediately after the current instruction completes). Polling latency depends on loop execution time.
  4. Hardware Complexity: Polling requires no specialized interrupt controllers, request pins, or vector tables. Interrupts require priority arbitration and vector hardware.
  5. Multiple Devices: Polling slows down linearly as more devices are added. Interrupt systems handle dozens of devices with priority-based queuing.

When Polling is Technically Superior: Polling is superior in dedicated, single-purpose embedded controllers where the processor has no other computational tasks and data arrives continuously at very high rates (e.g., continuous ADC streaming or high-speed packet capture).

In such scenarios:

  • The overhead of saving and restoring CPU registers (PUSH/POP), flushing pipelines, and executing CALL/RET sequences during an interrupt takes 20 to 50 clock cycles.
  • A tight polling loop (IN, ANI, JNZ) detects and processes incoming data in fewer clock cycles than the interrupt context-switch penalty.
Answer:

Interrupts maximize CPU efficiency and provide low-latency response. Polling is superior only in dedicated single-task systems where data arrives continuously at maximum speed, avoiding the 20–50 cycle context-switch overhead of interrupt handling.

Question 3

Explain the step-by-step sequence of internal hardware and software operations performed by the 8085 microprocessor when an interrupt request is acknowledged, serviced, and completed.

Step-by-Step Interrupt Sequence:

  1. Current Instruction Completion: The 8085 finishes executing the current instruction.
  2. Interrupt Sampling and Priority Arbitration: During the final T-state, interrupt lines are sampled. If multiple lines are active, the internal priority logic selects the highest priority active line.
  3. Mask and Enable Validation: The CPU verifies that the interrupt is unmasked and that the Interrupt Enable flip-flop is set (IE = 1).
  4. Hardware Disable: The 8085 automatically clears IE = 0, temporarily disabling all maskable interrupts to prevent nested conflicts.
  5. Stacking Return Address: The CPU decrements the Stack Pointer by 2 and pushes the 16-bit contents of the Program Counter (the return address) onto the stack (PCL at SP-2, PCH at SP-1).
  6. Vector Generation:
    • For vectored pins (TRAP, RST 7.5, RST 6.5, RST 5.5), the PC is loaded with the hardwired vector address.
    • For INTR, the CPU asserts INTA_bar LOW, and the external controller supplies an instruction byte (RST n or CALL).
  7. ISR Execution: The processor begins executing the ISR, saving working registers via PUSH.
  8. Re-enabling and Return: The ISR executes EI to re-enable interrupts and finishes with RET. RET pops the 16-bit address from the stack into the PC, resuming the interrupted program.
Answer:

The 8085 finishes the current instruction, resolves priority, clears IE to 0, pushes the Program Counter onto the stack, vectors to the ISR (automatically or via INTA_bar), executes the service routine, re-enables interrupts with EI, and returns via RET.

Question 4

Explain the bit structures and operational roles of the SIM (Set Interrupt Mask) and RIM (Read Interrupt Mask) instructions in the 8085 microprocessor.

Construct the SIM control byte to:

SIM and RIM Roles:

  • SIM (Set Interrupt Mask): An output instruction that reads Accumulator bits to update the hardware masks for RST 7.5, RST 6.5, and RST 5.5, reset the RST 7.5 edge flip-flop, and transmit serial data out of the SOD pin.
  • RIM (Read Interrupt Mask): An input instruction that loads the Accumulator with the current mask settings, pending interrupt states, Interrupt Enable status, and the current level on the physical SID pin.

Formulate SIM Control Byte: Bit requirements:

  • D0 (M5.5): 0 (Unmask RST 5.5)
  • D1 (M6.5): 1 (Mask RST 6.5)
  • D2 (M7.5): 1 (Mask RST 7.5)
  • D3 (MSE): 1 (Enable mask bits D2–D0)
  • D4 (R7.5): 0 (Do not reset RST 7.5 flip-flop)
  • D5: 0 (Unused)
  • D6 (SDE): 1 (Serial Data Enable active)
  • D7 (SOD): 1 (Output logic 1 on SOD pin)

Assembled byte: D7 D6 D5 D4 D3 D2 D1 D0 = 1 1 0 0 0 1 1 0 B = C6H

Answer:

SIM programs interrupt masks and outputs serial data; RIM reads masks, pending requests, and serial input. The control byte to unmask RST 5.5, mask RST 6.5/7.5, and output logic 1 on SOD is C6H (11000110B).

Question 5

Design an interface circuit for the non-vectored INTR interrupt pin of the 8085 microprocessor using a 74LS244 octal buffer. When an external device asserts INTR, the circuit must respond to the active-low INTA_bar strobe by placing the software restart instruction RST 6 (opcode F7H) onto data bus lines D7–D0.

Calculate the vector address of RST 6, specify the hardwired connections to the 74LS244 buffer, and write an 8085 assembly initialization routine.

Vector Address and Opcode for RST 6: The restart formula is: Vector Address = 6 x 8 = 48 = 0030H.

The opcode for RST n is 11 nnn 111B. For n = 6 (110B): Opcode = 1 1 1 1 0 1 1 1 B = F7H

Hardware Interconnection with 74LS244 Octal Buffer:

  1. Inputs (1A1–1A4, 2A1–2A4):
    • Connect lines corresponding to logic 1 (bits D7, D6, D5, D4, D2, D1, D0) to +5V (Vcc) through pull-up resistors.
    • Connect the line corresponding to logic 0 (bit D3) directly to ground (0V).
  2. Outputs (1Y1–1Y4, 2Y1–2Y4):
    • Connect directly to 8085 data bus lines D7 through D0.
  3. Enable Inputs (1OE_bar, 2OE_bar):
    • Tie both active-low output enables to the 8085 INTA_bar pin (pin 12).
    • During normal operation, INTA_bar = 1; buffer outputs remain high-impedance.
    • When the 8085 acknowledges an INTR request, it pulls INTA_bar LOW; the 74LS244 drives F7H (RST 6) onto D7–D0.

Assembly Initialization Routine:

8085 ASM
ORG 2000H
LXI SP,2400H
EI
HLT

ORG 0030H
JMP ISR_RST6

ISR_RST6:
PUSH PSW
MVI A,01H
OUT 80H
POP PSW
EI
RET
Answer:

RST 6 vectors to 0030H (48). Its opcode F7H (11110111B) is hardwired into the inputs of a 74LS244 buffer enabled by INTA_bar. The 8085 reads F7H on INTA_bar, pushes the return address to the stack, and branches to 0030H.

Past exam questions for Microprocessors

← Serial Interface: RS-232, USB & USARTPIC, 8086 Interrupts & Interrupt Vector Table →