File: multisect1.asm

package info (click to toggle)
yasm 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 12,200 kB
  • ctags: 18,827
  • sloc: asm: 73,479; ansic: 48,942; sh: 9,773; python: 8,913; xml: 1,108; makefile: 147; pascal: 62; sed: 16
file content (31 lines) | stat: -rw-r--r-- 774 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[BITS 32]

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