answersLogoWhite

0

When an interrupt is requested, the currently running process is suspended and the handler is

invoked. When the handler exits, control is handed back to the running process. Since interrupts are

practically random and unplanned, when the handler passes back control, it must ensure that all

registers and stacks that it used are restored back to the exact state they were in when the process

got interrupted, so that the process can resume like as though nothing happened.

Access to these registers and stacks can only be done in assembly.

Other reasons include the fact that interrupt handlers must be very fast, and since the interrupt

routines are very short, they can be hand‐crafted to be much faster than anything a compiler

generates.

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
JudyJudy
Simplicity is my specialty.
Chat with Judy
More answers

Interrupt handlers are often written in assembly language to ensure that they execute quickly.

User Avatar

Wiki User

13y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Why interrupt handlers are written in assembly language?
Write your answer...
Submit
Still have questions?
magnify glass
imp