Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1save register contents | Asave state -> run ISR -> restore state | |
| 2save program counter | Brestore register contents | |
| 3The saved state is put back into the registers after the ISR finishes, so the old task carries on exactly where it stopped | CNot saving the program counter means the CPU forgets the address of the next instruction, so the interrupted task cannot carry on from where it stopped. | |
| 4The correct order is to save the state first, then run the ISR, then restore the state | DThe CPU stores the address of the next instruction so it knows where the interrupted task stopped | |
| 5run ISR -> save register contents | EBefore the ISR runs, the CPU stores the values held in its registers so they are not overwritten | |
| 6Only the data registers are saved; the program counter is not saved | FThe state is saved after the ISR has already run. The ISR may already have overwritten the registers and the program counter, so the interrupted task's data is lost. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
save register contents — Before running the ISR, the CPU stores its register contents, including the program counter, so the interrupted task can later carry on exactly where it stopped.STORE registers
RUN ISR
RESTORE registersSTORE registers
RUN ISR
RESTORE registersSTORE registers
RUN ISR
RESTORE registerssavedPC ← PCIF interrupt THEN
STORE registers
RUN ISR