Interrupt

An interrupt is a signal sent to the processor that interrupts the current process and executes the interrupt. A hardware device or a software program may generate the interrupt.

The hardware interrupt is mostly created by an input device such as a keyboard or mouse. For example, if you use an MS program and press a key, the program must process the input immediately. Typing “YES” creates three interrupt requests, which allows the program to display the letters you typed. In the same way, when you click a mouse button, you send an interrupt signal to the device.

Each interrupt request (IRQ) has a unique setting and its priority. The keyboard and mouse have higher interrupts.

Software interrupts are used to handle errors and exceptions of running programs. For example, if a program expects a variable to be a valid number, but the value is null, then an interrupt may be generated to prevent the program from crashing.

Both hardware and software interrupts are processed by an interrupt handler, which is also called an interrupt service routine (ISR).

Question

The following are some events that occur after a device control issues on interrupt while processor L is under execution.

  • P) The processor pushes the process status of L onto the Control Stack.
  • Q) The processor finishes the execution of the current instruction.
  • R) The processor executes the interrupt service routine.
  • S) The processor pops the process status of L from the control stack.
  • T) Processor Loads the new PC value based on interrupt.

Which of the following is the correct order in which the above events occur?

A) PQRST

B) QPRTS

C) QPTRS

D) QTPRS

The answer is option (C), which is QPTRS.