What happen when an interrupt occurs in between CPU executing a program?
What happen when an interrupt occurs in between CPU executing a program? Correct Answer Instructions execution series can be broken
The correct option is Instructions execution series can be broken
CONCEPT:
The interrupt is a signal emitted by hardware or software when a process or an event needs immediate attention.
Whenever an interrupt occurs, it causes the CPU to stop executing the current program. Then comes the control to interrupt handler or interrupt service routine.
What happens when an interrupt occurs:
CPU saves the state of the executing program. Enough information is saved so that the program can be resumed without being aware that it was interrupted
The control then passes to a special piece of code called an Interrupt Handler or Interrupt Service Routine
When the interrupt handler is finished, CPU transfers control back to the originally executing program.
Additional Information
An interrupt can arrive at any time during the execution of an instruction, but an interrupt will be handled only after the complete execution of the current instruction under execution.
Below is the instruction cycle during an interrupt.
[ alt="Untitled Diagram3" src="//storage.googleapis.com/tb-img/production/22/05/Untitled%20Diagram3.png" style="width: 500px; height: 99px;">