1 | ; $Id: WinExit.asm 96407 2022-08-22 17:43:14Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; 16-bit windows program that exits windows.
|
---|
4 | ;
|
---|
5 | ; Build: wcl -I%WATCOM%\h\win -l=windows -k4096 -fm WinExit.asm
|
---|
6 | ;
|
---|
7 |
|
---|
8 | ;
|
---|
9 | ; Copyright (C) 2018-2022 Oracle and/or its affiliates.
|
---|
10 | ;
|
---|
11 | ; This file is part of VirtualBox base platform packages, as
|
---|
12 | ; available from https://www.virtualbox.org.
|
---|
13 | ;
|
---|
14 | ; This program is free software; you can redistribute it and/or
|
---|
15 | ; modify it under the terms of the GNU General Public License
|
---|
16 | ; as published by the Free Software Foundation, in version 3 of the
|
---|
17 | ; License.
|
---|
18 | ;
|
---|
19 | ; This program is distributed in the hope that it will be useful, but
|
---|
20 | ; WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
21 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
22 | ; General Public License for more details.
|
---|
23 | ;
|
---|
24 | ; You should have received a copy of the GNU General Public License
|
---|
25 | ; along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
26 | ;
|
---|
27 | ; The contents of this file may alternatively be used under the terms
|
---|
28 | ; of the Common Development and Distribution License Version 1.0
|
---|
29 | ; (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
30 | ; in the VirtualBox distribution, in which case the provisions of the
|
---|
31 | ; CDDL are applicable instead of those of the GPL.
|
---|
32 | ;
|
---|
33 | ; You may elect to license modified versions of this file under the
|
---|
34 | ; terms and conditions of either the GPL or the CDDL or both.
|
---|
35 | ;
|
---|
36 | ; SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
37 | ;
|
---|
38 |
|
---|
39 |
|
---|
40 |
|
---|
41 | ;.stack 4096
|
---|
42 | STACK segment para stack 'STACK'
|
---|
43 | STACK ends
|
---|
44 |
|
---|
45 |
|
---|
46 | extrn INITTASK:FAR
|
---|
47 | extrn INITAPP:FAR
|
---|
48 | extrn EXITWINDOWS:FAR
|
---|
49 | extrn WAITEVENT:FAR
|
---|
50 |
|
---|
51 | _TEXT segment word public 'CODE'
|
---|
52 | start:
|
---|
53 | push bp
|
---|
54 | mov bp, sp
|
---|
55 |
|
---|
56 | ;
|
---|
57 | ; Initialize the windows app.
|
---|
58 | ;
|
---|
59 | call INITTASK
|
---|
60 |
|
---|
61 | xor ax, ax
|
---|
62 | push ax
|
---|
63 | call WAITEVENT
|
---|
64 |
|
---|
65 | push di ; hInstance
|
---|
66 | push di
|
---|
67 | call INITAPP
|
---|
68 |
|
---|
69 | ;
|
---|
70 | ; Do what we're here for, exitting windows.
|
---|
71 | ;
|
---|
72 | xor ax, ax
|
---|
73 | xor cx, cx
|
---|
74 | xor dx, dx
|
---|
75 | push ax
|
---|
76 | push ax
|
---|
77 | push ax
|
---|
78 | push ax
|
---|
79 | call EXITWINDOWS
|
---|
80 |
|
---|
81 | ;
|
---|
82 | ; Exit via DOS interrupt.
|
---|
83 | ;
|
---|
84 | xor al, al
|
---|
85 | mov ah,04cH
|
---|
86 | int 021h
|
---|
87 |
|
---|
88 | mov sp, bp
|
---|
89 | pop bp
|
---|
90 | ret
|
---|
91 |
|
---|
92 | _TEXT ends
|
---|
93 |
|
---|
94 | end start
|
---|
95 |
|
---|