Virtual Devices (3.1) (vdag31qh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Begin_Nest_Exec
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
include vmm.inc
 
VMMcall Begin_Nest_Exec
 
The Begin_Nest_Exec service starts a nested execution block. This service is
used in conjunction with the End_Nest_Exec service to create a nested
execution block in which a virtual device may call the Exec_Int and
Resume_Exec services. Virtual devices use these services to call software in
the virtual machine.
 
This service has no parameters.
 
Return Value
 
The Client_CS and Client_IP registers contain a break point used by nested
execution services.
 
Comments
 
While in a nested execution block, a virtual device may call the Exec_Int
and Resume_Exec services any number of times.
 
If one of these calls changes the virtual machine registers, these changes
are also made to the client state. Before creating the nested execution
block, a virtual device should save the client state by using the
Save_Client_State service. After ending the nested execution block, a
virtual device should restore the client state by using the
Restore_Client_State service.
 
This service forces the virtual machine into protected-mode execution if
there is a protected-mode application running in the current virtual
machine. Otherwise, the virtual machine remains in V86 mode. The
End_Nest_Exec service restores the virtual machine to its mode prior to the
call to Begin_Nest_Exec.
 
If the execution mode changes to protected mode, this service automatically
switches the virtual machine to the locked protected-mode stack and
End_Nest_Exec switches it back. This allows most devices to change execution
modes without worrying about demand paging issues.
 
Example
 
The following example shows a nested call to the MS-DOS function Get Version
(Interrupt 21h, Function 30h):
 
VMMcall Begin_Nest_Exec             ; Start nested execution
mov     [ebp.Client_AH], 30h        ; 30h = Get MS-DOS Version #
mov     eax, 21h                    ; Execute an Int 21h in the
VMMcall Exec_Int                    ; current VM to call DOS
VMMcall End_Nest_Exec               ; End of nested exec calls
 
This example copies the MS-DOS version to the Client_AH and Client_AL
registers.
 
Uses
 
Client_CS, Client_IP, Flags
 
See Also
 
Begin_Nest_V86_Exec, End_Nest_Exec, Exec_Int, Restore_Client_State,
Resume_Exec, Save_Client_State, Set_PM_Exec_Mode, Set_V86_Exec_Mode