What is the difference between Trap and Interrupt?

后端 未结 10 1081
时光说笑
时光说笑 2020-12-02 03:44

What is the difference between Trap and Interrupt?

If the terminology is different for different systems, then what do they mean on x86?

10条回答
  •  囚心锁ツ
    2020-12-02 03:58

    Generally speaking, terms like exceptions, faults, aborts, Traps, and Interrupts all mean the same thing and are called "Interrupts".

    Coming to the difference between Trap and Interrupt:

    Trap: Is a programmer initiated and expected transfer of control to a special handler routine. (For ex: 80x86 INT instruction is a good example)

    Where as

    Interrupt(Hardware): Is a program control interruption based on an external hardware event external to the CPU (For ex: Pressing a key on the keyboard or a time out on a timer chip)

提交回复
热议问题