Retro video games delivered to your door every month!
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 far return frame</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
        Call Real Mode Procedure With Far Return Frame


                 This function  calls a real mode procedure.  The called
                 procedure must execute a far return when it completes.

            To Call

                 AX = 0301h
                 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 a far return
                      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    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