Exam-style question
Try this first
Why must the volatile environment be saved when an interrupt is being serviced?.
- A.To ensure that the interrupted program can continue correctly afterwards
- B.To make the ISR execute without any instructions
- C.To permanently delete the interrupted program
- D.To prevent the processor from ever fetching another instruction
Model answer
What a good answer should say
- To ensure that the interrupted program can continue correctly afterwards
Explanation
Why this works
The ISR may alter temporary processor information. Saving the volatile environment preserves the information needed to return to the interrupted program and continue its execution correctly.
Common mistake
No common mistake is linked to this question yet.
