Simulate Real Mode Interrupt


This function simulates an interrupt in real mode. It
will invoke the CS:IP specified by the real mode
interrupt vector and the handler must return by
executing an iret.

To Call

AX = 0300h
BL = Interrupt number
BH = Flags
Bit 0 = 1 resets the interrupt controller and A20
line
Other flags reserved and must be 0
CX = Number of words to copy from protected mode to
real mode stack
ES:(E)DI = Selector:Offset of real mode call structure

Returns

If function was successful:
Carry flag is clear.
ES:(E)DI = Selector:Offset of modified real mode call
structure

If function was not successful:
Carry flag is set.

Programmer's Notes

o The CS:IP in the real mode call structure is
ignored by this service. The appropriate
interrupt handler will be called based on the
value passed in BL.
o If the SS:SP fields are zero then a real mode
stack will be provided by the DPMI host.
Otherwise, the real mode SS:SP will be set to the
specified values before the interrupt handler is
called.
o The flags specified in the real mode call
structure will be pushed on the real mode stack
iret frame. The interrupt handler will be called
with the interrupt and trace flags clear.
o When the Int 31h returns, the real mode call
register structure will contain the values that
were returned by the real mode interrupt handler.
o It is up to the caller to remove any parameters
that were pushed on the protected mode stack.
o 32-bit programs must use ES:EDI to point to the
real mode call structure. 16-bit programs should
use ES:DI.
o The flag to reset the interrupt controller and A20
line is ignored by DPMI implementations that run
in Virtual 8086 mode. It causes DPMI
implementations that return to real mode to set
the interrupt controller and A20 address line
hardware to its normal real mode state.