Interrupts Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an interrupt?

A

a way to pause execution of a program to run a predefined routine
once the interrupt has been handled the CPU returns to executing the original program
can be used by hardware or software
e.g keyboard and mouse inputs and software crashes

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

Interrupt register

A

when an interrupt is thrown the interrupt register is updated
value held within the register is a memory address which holds the program that handles the specific interrupt
add extra step to FDE cycle where the interrupt register is checked
if there is an interrupt we store the current state of the CPU and execute the interrupt

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

Where are interrupts handled in the FDE cycle?

A

between execute and fetch

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

The stack

A

behaves like a stack of plates
new items are placed at the top of the pile, push
items are taken from the top of the pile, pop
first item in the stack is the last one out (first in last out)
are used all over the place

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

Storing the CPU state

A

as dealing with an interrupt the state of all the registers in the CPU before the interrupt are stored in a stack
once finished executing the interrupt we rewrite the registers with the data in the stack
then continue as normal
copy contents of the interrupt register into the PC
follow stages of FDE cycle until the interrupt program is finished
when the interrupt program is finished the CPU state at the top of the stack is resumed

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

Interrupting the interrupt

A

while executing the first interrupt another interrupt occurs
still suspend the current program and store the CPU state in the stack
when interrupt B finishes we resume the interrupt A then returns to the original program

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

Why we have interrupts

A

often need a computer system to do something right this instant and can’t wait for the scheduler
e.g emergency stop on industrial equipment
or a program has crashed and we need to halt execution
e.g you didn’t add an exit condition in pygame game
are also used when hardware connected to the computer is changed
e.g. when a USB drive is disconnected
needed to halt execution of programs that are now

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