These services allow protected mode applications to intercept real and protected mode interrupts and hook processor exceptions.
This function returns the value of the current task's real mode interrupt vector for the specified interrupt.
To Call
AX = 0200h
BL = Interrupt number
Returns
Carry flag is clear.
CX:DX = Segment:Offset of real mode interrupt handler
Programmer's Notes
This function sets the value of the current task's real mode interrupt vector for the specified interrupt.
To Call
AX = 0201h
BL = Interrupt number
CX:DX = Segment:Offset of real mode interrupt handler
Returns
If function was successful:
Carry flag is clear.
If function was not successful:
Carry flag is set.
Programmer's Notes
This function returns the CS:(E)IP of the current protected mode exception handler for the specified exception number.
To Call
AX = 0202h
BL = Exception/fault number (00h-1Fh)
Returns
If function was successful:
Carry flag is clear.
CX:(E)DX = Selector:Offset of exception handler
If function was not successful:
Carry flag is set.
The value passed in BL was invalid.
Programmer's Notes
This function allows protected mode applications to intercept processor exceptions that are not handled by the DPMI environment. Programs may wish to handle exceptions such as not present segment faults which would otherwise generate a fatal error.
Every exception is first examined by the protected mode operating system. If it can not handle the exception it then reflects it through the protected mode exception handler chain. The final handler in the chain may either reflect the exception as an interrupt (as would happen in real mode) or it may terminate the current program.
To Call
AX = 0203h
BL = Exception/fault number (00h-1Fh)
CX:(E)DX = Selector:Offset of exception handler
Returns
If function was successful:
Carry flag is clear.
If function was not successful:
Carry flag is set.
The value passed in BL was invalid.
Programmer's Notes
Call-Back Stack Frames
Stack frame for 16-bit programs:
15 0
SS
SP
Flags
CS
IP
Err Code
Return
CS
Return
IP
<-- SS:SP
Stack frame for 32-bit programs:
31 0
SS
ESP
EFlags
CS
EIP
Error Code
Ret CS
Return EIP
<-- SS:ESP
Shaded fields should not be modified. Other fields can be modified before returning from the exception handler.
This function returns the CS:(E)IP of the current protected mode interrupt handler for the specified interrupt number.
To Call
AX = 0204h
BL = Interrupt number
Returns
Carry flag is clear.
CX:(E)DX = Selector:Offset of exception handler
Programmer's Notes
This function sets the address of the specified protected mode interrupt vector.
To Call
AX = 0205h
BL = Interrupt number
CX:(E)DX = Selector:Offset of exception handler
Returns
If function was successful:
Carry flag is clear.
If function was not successful:
Carry flag is set.
Programmer's Notes