Every computer system has an operating system that runs it.
The way programs communicate with the OS is through the use of a trap . A trap is an instruction that the program uses to give up control of the computer to the OS, so that the OS can perform some function. When the OS finishes its job, it returns to the place in the program where the trap instruction was and continues. For the purposes of the Smalltium simulator, we are not going to run an operating system. Instead, the simulator itself will handle the various traps as though they were a part of the hardware.