Interrupt Cycle:
-
An instruction cycle (sometimes called fetch-and-execute cycle, fetch-decode-execute cycle, or FDX) is the basic operation cycle of a computer. It is the process by which a computer retrieves a program instruction from its memory, determines what actions the instruction requires, and carries out those actions. This cycle is repeated continuously by the central processing unit (CPU), from bootupto when the computer is shut down.
Block diagram of Interrupt Cycle
-
After the execute cycle is completed, a test is made to determine if an interrupt was enabled (e.g. so that another process can access the CPU)
-
If not, instruction cycle returns to the fetch cycle
-
If so, the interrupt cycle might performs the following tasks: (simplified...)
-
move the current value of PC into MBR
-
move the PC-save-address into MAR
-
move the interrupt-routine-address into PC
-
move the contents of the address in MBR into indicated memory cell
-
continue the instruction cycle within the interrupt routine
-
after the interrupt routine finishes, the PC-save-address is used to reset the value of PC and program execution can continue
flowchart of interrupt cycle