Timeline for Why is it called a "trap" instruction?
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 9, 2023 at 18:54 | comment | added | Daniel Wisehart | The IBM 704, introduced in 1954, used interrupts with a "transfer trap", which could invoke a special routine when a branch instruction was encountered. | |
| Jan 18, 2022 at 3:27 | comment | added | luv.preet | I think there is a snippet from the book explaining this, on page 3 in a greyed area. You can also read it here textbin.xyz/… | |
| Jan 18, 2022 at 3:24 | comment | added | luv.preet | That line, I suppose, is coming from the book OS: 3 easy pieces from this chapter pages.cs.wisc.edu/~remzi/OSTEP/cpu-mechanisms.pdf, page 4. I think the trap word used here is because if you want to move from User mode to Kernel mode, you have to call a trap instruction. When you make a system call, the system call calls the trap instruction with given arguments. So, I think the author here is saying that any system call you make, calls the trap instruction inside its implementation. | |
| Dec 16, 2020 at 9:28 | comment | added | Coroos | Motorla 68000 had a 'trap' instruction in Atari ST TOS. | |
| Dec 13, 2020 at 19:42 | audit | First posts | |||
| Dec 13, 2020 at 19:45 | |||||
| Dec 9, 2020 at 7:19 | comment | added | Hartmut Braun | I agree. I think it started with „capturing“ or „intercepting“ special conditions in the code (I.e. division by zero) and then the same mechanism (address tables for indirect jumps) was used for other purposes. Then instructions were included to support compilers to generate „capture code“ for their own special conditions and finally it is used as „normal“ subroutine calls that require full control by the OS. The instruction set of of the MC68k is a perfect example for all of that. With that context in mind, I think, the quote does not sound strange. | |
| Nov 18, 2020 at 15:20 | history | answered | haylem | CC BY-SA 4.0 |