DOS/32 Advanced DOS Extender - Programmer's Reference 2.28 - DPMI function 0305h - Get State Save/Restore Addresses Returns the addresses of two procedures used to save and restore the state of the current task's registers in the mode which is not currently executing.
In: | AX = 0305h
Out: | CF clear AX = size of buffer in bytes required to save state BX:CX = real mode address of routine used to save/restore state SI:EDI = protected mode address of routine used to save/restore state
Notes: a) The real mode address returned by this function in BX:CX is called only in real mode to save/restore the state of the protected mode registers. The protected mode address returned by this function in SI:EDI is called only in protected mode to save/restore the state of the real mode registers. Registers for the current mode can be saved by simply pushing them on the stack. b) Both of the state-save procedures are entered by a FAR CALL with the following parameters: AL = 0 to save state AL = 1 to restore state ES:EDI= (selector or segment):offset of state-save buffer c) The state-save buffer must be at least as large as the value returned in AX by DPMI function 0305h. The state save/restore procedures do not modify any registers. d) Some DPMI hosts will not require the state to be saved, indicating this by returning a buffer size of zero in AX. In such cases, the addresses returned by this function can still be called, although they will simply return without performing any useful function. e) Clients do not need to call the state save/restore procedures before using DPMI functions 0300h, 0301h, or 0302h. The state save/restore procedures are provided specifically for clients that use the raw mode switch services. f) A client can use the function to save its state in the destination mode before switching modes using the raw mode switch or issuing real-mode calls from a protected mode hardware interrupt handler. Copyright © Supernar Systems, Ltd. 1996-2002 All Rights Reserved.