Wednesday, June 13, 2012

We interrupt this program . . .

". . . to bring you a special bulletin." -- Announcement preceding a "breaking news" story

COUNT ZERO INTERRUPT:  On receiving an interrupt, decrement the counter to zero. -- Count Zero by William Gibson [Actually, this is backward; it should be "when the counter is decremented to zero, an interrupt is generated."]

An interrupt is the method for notifying a computer program (usually the operating system) of an exceptional situation.  The currently running program is suspended and the process for handling the exception (the interrupt handler) is executed before resuming the previously running program.

The actions that occur during an interrupt are

  1)  an internal component or external device detects an exceptional situation.
  2)  the component or device sends an interrupt request to the Central Processing Unit.
  3)  the CPU saves the process's state and the address of the next instruction.
  4)  a new process state is set up and the address of the next instruction is set to the beginning of
       the interrupt handler.
  5)  the interrupt handler is executed, during which all lower-priority interrupts are deferred.


Read more »