
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Dos Protected Mode Interface - <b>call real mode procedure with iret frame</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Call Real Mode Procedure With Iret Frame
This function calls a real mode procedure. The called
procedure must execute an iret when it completes.
To Call
AX = 0302h
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
specifies the address of the real mode procedure
to call.
o The real mode procedure must execute an iret when
it has completed.
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 procedure is called.
o When the Int 31h returns, the real mode call
structure will contain the values that were
returned by the real mode procedure.
o The flags specified in the real mode call
structure will be pushed the real mode stack iret
frame. The procedure will be called with the
interrupt and trace flags clear.
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.
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson