172k views
2 votes
What is the purpose of interrupts? What are the differences betweena trap and an interrupt? Can traps be generated internally by ausers program? If so, for what purpose?

User Asmmahmud
by
6.6k points

1 Answer

3 votes

Answer:

An interrupt as the name suggests interrupts the present execution so focus on some other execution.It is a signal generated by hardware or software telling the system it needs attention.

The difference between a trap and an interrupt is that a trap is an interrupt emitted by software.While an interrupt is generated by computer hardware also.

Yes traps can be used internally.

Sometimes they are used to to call the OS(operating system) routines or to catch arithmetic errors.

User Sowen
by
6.8k points