Skip to content

Latest commit

 

History

History
28 lines (15 loc) · 890 Bytes

File metadata and controls

28 lines (15 loc) · 890 Bytes

Question 5

What are the interrupts?

Answer

This is a controlled violation of the sequential execution of a program. Interrupts allows one to change program execution order based on events external to the program itself.

After a signal (external or internal) is caught, a program’s execution is suspended, some registers are saved, and the CPU starts executing a special routine to handle the situation. Following are exemplary situations when an interrupt occurs (and an appropriate piece of code is executed to handle it):

  • A signal from an external device (external interrupt).
  • Zero division (internal interrupt).
  • Invalid instruction (when CPU failed to recognize an instruction by its binary representation -- internal interrupt).
  • An attempt to execute a privileged instruction in a non-privileged mode (internal interrupt).

prev +++ next