answersLogoWhite

0


Best Answer

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
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

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

This answer is:
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
Related questions

Disadvantage of writing OS in high level language such as C?

Nothing. Every modern OS is written in C, except for some little special parts (like interrupt-handling) that are written in Assembly.


Dos is written in which language?

Dos was written in assembly.


Why high level language is slower then assembly language?

Programs written in a high level language might be slower than ones written in Assembly language; but it is not always so, it is very easy to write un-effective programs in Assembly.


What is assembly program?

An assembly program is a machine-dependent program written in a low-level symbolic code known as assembly language.


In which programming language are operating systems written?

Usually a combination of C++, C and assembly language.


What has the author Len Bruns written?

Len Bruns has written: 'Assembly language programmer's guide'


In which language is the virus program written?

Assembly. C. Visual basic. Others.


What has the author Vincent Mahout written?

Vincent Mahout has written: 'Assembly language programming' -- subject(s): Embedded computer systems, Microprocessors, Assembler language (Computer program language)


What are some examples of assembly level language?

These days very few programs are written in assembly language. Some parts of operating system kernels are written in assembly language usually because they need to perform some function very specific to a particular microprocessor architecture. Other programs written in assembly language include programs written for very cheap microprocessors in embedded systems. Such systems have very little resources and do not run operating system and compilers. Finally some specific parts of applications programs may be written in assembly language for performance optimization, but examples of those today are quite rare indeed.


What has the author F D Vickers written?

F. D. Vickers has written: 'Introduction to machine and assembly language'


What has the author Rosemary Shields written?

Rosemary Shields has written: 'The assembly language programmer's guide' 'Beautiful shrubs'


What programming language is Unix written in?

Unix is primarily written in the C language, with some small snippets of assembler code for low level bootstraps.