1[BITS 32]
2
3[MAP all]
4; This file is loaded as a DOS .COM file.
5[SEGMENT _TEXT start=0 vstart=100h]
6 
7; shrink & relocate stack:
8	mov	sp, stack_ends   ; NASM puts 460h here -
9                                  ; 9B0h is desired.
10	mov	bx, sp
11	mov	cl, 4
12	shr	bx, cl
13	mov	ah, 4Ah  ; DOS resize mem.block
14	int 21h
15 
16[SEGMENT GATESEG align=1 follows=_TEXT vstart=0]
17; label to use for copying this segment at run-time.
18gate0cpy:
19dd 0
20 
21; 32-bit ring-0 protected mode code that interacts
22; with the VMM (Win3.x/9x kernel).  To be relocated
23; at run-time to memory dynamically allocated with
24; DPMI, and called through a call-gate from ring-3.
25; vstart=0 makes some calculations easier.
26 
27; Reserve space for stack:
28[SEGMENT .bss follows=GATESEG align=16]
29    resb 400h
30stack_ends:
31
32