Skip to main content

RST instructions in 8085

Short answer

RST n (n=0-7) is a 1-byte call to fixed address 8×n. It pushes return address onto the stack and loads PC with the vector. Uses include software interrupts, responding to INTR by placing opcode on bus, and fast routine calls.

Explain the operations and uses of RST instructions in 8085.

RST n (Restart, n = 0 to 7) is a 1-byte CALL instruction to a fixed address. When executed, the CPU pushes the current PC (address of the next instruction) onto the stack and loads PC with the vector address 8 x n. Execution then continues at that address, and RET at the end of the routine returns to the main program. It takes 12 T-states (opcode fetch 6T + two memory writes).

InstructionOpcodeVector address
RST 0C70000H
RST 1CF0008H
RST 2D70010H
RST 3DF0018H
RST 4E70020H
RST 5EF0028H
RST 6F70030H
RST 7FF0038H

Opcode format: 11 NNN 111, where NNN is the binary of n.

Operation (example RST 3)

SP-1 <- PCH ;  SP-2 <- PCL ;  SP <- SP - 2
PC   <- 0018H

No flags are affected.

Uses

  1. Software interrupts: a program can call a service routine with a 1-byte instruction, shorter than a 3-byte CALL (used for monitor/system calls and debugging breakpoints).
  2. Hardware interrupt response: for the INTR interrupt, the external device puts an RST opcode on the data bus in response to INTA, and the CPU jumps to the matching vector. The 8085 also has internal restarts: TRAP = 0024H, RST 5.5 = 002CH, RST 6.5 = 0034H, RST 7.5 = 003CH.
  3. Fast access to frequently used routines placed at the low addresses.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Microprocessor chapter 2 questions →