An interrupt handler is a form of subroutine, one that is called involuntarily from a program, rather than voluntarily via a CALL instruction. However, the return from an interrupt is a voluntary occurrence, but it cannot use a simple RET instruction for several reasons. One is that the old PC needs to be fetched from where it was stashed when the interrupt occurred. Another is that in a multiprogrammed system with multiple users, the jump to the interrupt handler caused the CPU to switch from user mode to privileged mode so a return from the interrupt must cause the mode to switch back to what it was before.
Thus, most systems have an instruction similar to the VAX's REI instruction, which stands for Return from Exception or Interrupt. This privileged instruction is the equivalent of RET except that it changes privilege levels and sets the interrupt priority mask to allow interrupts of the same or lower level to now interrupt the CPU.
Fig. 19.7.1 shows a user program getting interrupted, the interrupt routine being executed, and a return via an REI instruction. While the instruction at 1384 is executing, PC actually contains 1385 because the CPU increments PC after fetching the current instruction and before executing it.
When the interrupt wire goes high, during execution of the LOD M instruction at 1384, the hardware completes the current instruction. But instead of continuing on with the ADD Y at 1385, it puts 64 into PC while simultaneously copying the current PC value (1385) into a safe place. This causes a change of control flow to 64 while preserving the return point, exactly what a CAL instruction does, although a CAL instruction does it voluntarily. After finishing the interrupt handler routine, REI copies the old PC value from the safe place back into PC, causing a jump back to where the program was before the interrupt came in. The protection level changes so that the interrupt handler can run with full privileges and can access any device or any part of memory. Obviously, the protection level has to be set back to unprivileged during REI or else the user program will suddenly find itself in complete control of the computer, a huge security breach.