This DPMI 0.9 Specification is hosted by Tenberry Software, Inc.

10. Interrupt Services


[Next Section] * [Previous Section] * [DPMI Index]
[Tenberry Home] * [Software Quality] * [DOS/4G] * [DOS/4GW] * [DOS/16M]

These services allow protected mode applications to intercept real and protected mode interrupts and hook processor exceptions.


10.1 Get Real Mode Interrupt Vector

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


10.2 Set Real Mode Interrupt Vector

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


10.3 Get Processor Exception Handler Vector

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


10.4 Set Processor Exception Handler Vector

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.


10.5 Get Protected Mode Interrupt Vector

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


10.6 Set Protected Mode Interrupt Vector

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


[Next Section] * [Previous Section] * [DPMI Index]
[Tenberry Home] * [Software Quality] * [DOS/4G] * [DOS/4GW] * [DOS/16M]
This HTML edition of the DPMI 0.9 Specification is hosted by Tenberry Software, Inc., makers of the DOS/16M and the DOS/4G family of DOS extenders. Page last modified 2003.1.28, <webmaster@tenberry.com>