Interrupts Flashcards

1
Q

what is an interrupt

A

a signal to the CPU indicating that an event needs immediate attentoin, pausing the current program flow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

interupts can be either [1] or [2]

A

1 = hardware
2 = software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is an interupt service routine (ISR)

A

a small dedicated program that the CPU runs in response to an interrupt. after it is finished the control returns to the interruprted program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

at what point in the Fetch–Execute cycle are interrupts checked?

A

At the end of each cycle, before the next fetch phase begins.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Outline the four main steps the CPU takes when handling an interrupt.

A
  1. Save the volatile environment (PC, registers)
  2. Jump to the ISR
  3. Execute the ISR
  4. Restore the saved state and resume the original program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is meant by the “volatile environment” and why must it be saved

A

The current contents of registers, the program counter (and sometimes stack pointer) that will change during the ISR; saving it lets the CPU restore and continue the original task correctly. |

How well did you know this?
1
Not at all
2
3
4
5
Perfectly