2,307 views

1 Answer

2 votes
2 votes

Answer:

Part of interrupt handlers is written in assembly language because:

  • In order to facilitate more efficient functions and procedures.
  • Assembly language is more powerful as it can operate directly on the physical CPU. It enables direct communication between the physical machine instruction and the language.
  • So, creating interrupt handlers in an assembly language helps the program to run at a much faster speed than other high-level languages.

  • Also due to fewer restrictions, it can perform more operations.

  • More Technical: Since all the interrupt begins by saving the registers, frequently for the current process in the processes table entry. Now, the data which is pushed onto the stack by the use of interrupt is deleted and the SP is now pointed to a temporary stack.

    Actions, like setting the stack pointer and saving the registers, can’t be conveyed in the high-level languages like C++, hence they have to be worked out by assembly language routines.

 

edited by

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2