What is Interrupt?
[[File:Interrupt Process.PNG|thumb|This chart shows what happens when an interrupt is called]] An '''interrupt''' is when something happens to a [[microprocessor]] that causes it to ''interrupt'' the currently running code to allow it to respond to the thing that happened. Interrupts usually occur because the processor gets a special [[Signal processing|signal]] from [[Computer hardware|hardware]], but they can also be caused by [[software]]. Many things can cause interrupts, including pressing keys on a [[Keyboard (computer)|keyboard]], moving the [[Computer mouse|mouse]], the [[Clock rate|built-in timer]] going off, a [[data]] transfer taking place, or an [[Event-driven programming|event]] that was triggered which needs attention from the processor right away. Interrupts can happen at any time, no [[matter]] what program is running or where in the program's [[source code]] it is. == How interrupts work == The purpose of an interrupt is to temporarily pause normal code execution to allow the processor to respond very quickly to the thing causing the interrupt. Once that thing has been dealt with, the processor can resume the work it was doing. An interrupt is triggered by a hardware or software call known as an ''interrupt request'' (IRQ). When an IRQ happens, the processor immediately stores the details of what it is doing on a [[Stack (data structure)|stack]] for safe keeping, and then beings to follow special [[Instruction (computer science)|instructions]] to respond to the interrupt. These instructions form a very short program called an ''interrupt handler'' or ''interrupt service routine'' (ISR). The ISR must be short so the processor can get back to its original work as fast as possible. As soon as the ISR is completed, the processor goes back to the stack where it stored the ''context'' of its original work on a stack, and resumes running code exactly where it left off. Many interrupt controllers in today's processors use an ''interrupt vector'' as a way to sort interrupts based on where they came fr