In addition to jumps, loops, and procedures that alter program execution, interrupt routines transfer execution to a different location. In this case, control goes to an interrupt routine.
You can write your own interrupt routines, either to replace an existing routine or to use an undefined interrupt number. You may want to replace the processor's divide-overflow (0h) interrupts or DOS interrupts, such as the critical-error (24h) and CONTROL+C (23h) handlers. The BOUND instruction checks array bounds and calls interrupt 5 when an error occurs. If you use this instruction, you need to write an interrupt handler for it.
This section summarizes the following:
How to call interrupts
How the processor handles interrupts
How to redefine an existing interrupt routine
The example routine in this section handles addition or multiplication overflow and illustrates the steps necessary for writing an interrupt routine. See Chapter 19, “Writing Memory-Resident Software” for additional information about DOS and BIOS interrupts.
NOTE:
Under OS/2, system access is made through calls to the Applications Program Interface (API), not through interrupts. Microsoft Windows applications use both interrupts and API calls.