This call allows a process to register an address to be used when a machine exception occurs.
DosSetVec
VecNum (USHORT) - input
Value
rc (USHORT) - return
The DosSetVec process is analogous to setting an address in the interrupt vector table when running in 8086 mode.
Should an exception occur, and the process has registered a handler, that handler is entered as if its address had been stored in the CPU's interrupt vector, except that the interrupt is still enabled. If no address has been registered for that vector, the process terminates.
When a process registers an exception handler for VecNum 7 (processor extension not available), the machine status word (MSW) for that process is set to indicate that a numeric processor extension (NPX) 287 is not present in the machine. The Emulate bit is set and the Monitor Processor bit is reset. This is done without regard for the true state of the hardware.
When a process de-registers a handler for VecNum 7, the MSW is set to reflect the true state of the hardware.
When an NPX287 exception is processing, the NPX287 status word is passed to the exception handler by being pushed on the stack before the exception handler is invoked. When the exception handler has completed execution, this word must be popped from the stack before an IRET is issued to return to the exception handler interface routine.
Family API Considerations
Some options operate differently in the DOS mode than in OS/2 mode. Therefore, the following restriction applies to DosSetVec when coding for the DOS mode.
VecNum = 7 not supported.