1 | ;
|
---|
2 | ; EXTAPI.ASM -- DOS extender API
|
---|
3 | ;
|
---|
4 | ; Copyright (c) 1995 by Eberhard Mattes
|
---|
5 | ;
|
---|
6 | ; This file is part of emx.
|
---|
7 | ;
|
---|
8 | ; emx is free software; you can redistribute it and/or modify it
|
---|
9 | ; under the terms of the GNU General Public License as published by
|
---|
10 | ; the Free Software Foundation; either version 2, or (at your option)
|
---|
11 | ; any later version.
|
---|
12 | ;
|
---|
13 | ; emx is distributed in the hope that it will be useful,
|
---|
14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | ; GNU General Public License for more details.
|
---|
17 | ;
|
---|
18 | ; You should have received a copy of the GNU General Public License
|
---|
19 | ; along with emx; see the file COPYING. If not, write to
|
---|
20 | ; the Free Software Foundation, 59 Temple Place - Suite 330,
|
---|
21 | ; Boston, MA 02111-1307, USA.
|
---|
22 | ;
|
---|
23 | ; See emx.asm for a special exception.
|
---|
24 | ;
|
---|
25 |
|
---|
26 | INCLUDE EMX.INC
|
---|
27 | INCLUDE PMINT.INC
|
---|
28 |
|
---|
29 | PUBLIC EXTAPI
|
---|
30 |
|
---|
31 | SV_CODE SEGMENT
|
---|
32 |
|
---|
33 | .386P
|
---|
34 |
|
---|
35 | ASSUME CS:SV_CODE, DS:NOTHING
|
---|
36 |
|
---|
37 | EXT_JUMP WORD EXT00, EXT01, EXT02, EXT03, EXT04
|
---|
38 | WORD EXT05, EXT06, EXT07, EXT08, EXT09
|
---|
39 | WORD EXT0A, EXT0B, EXT0C, EXT0D, EXT0E
|
---|
40 |
|
---|
41 | ASSUME DS:SV_DATA
|
---|
42 | ASSUME BP:PTR ISTACKFRAME
|
---|
43 | EXTAPI PROC NEAR
|
---|
44 | AND I_EFLAGS, NOT FLAG_C ; Clear carry flag (no error)
|
---|
45 | MOV AX, WORD PTR I_EAX
|
---|
46 | CMP AH, 0EH
|
---|
47 | JA SHORT EXT_INVALID
|
---|
48 | MOV BL, AH
|
---|
49 | MOV BH, 0
|
---|
50 | SHL BX, 1
|
---|
51 | JMP EXT_JUMP[BX]
|
---|
52 |
|
---|
53 | EXT00::
|
---|
54 | EXT01::
|
---|
55 | EXT02::
|
---|
56 | EXT03::
|
---|
57 | EXT05::
|
---|
58 | EXT06::
|
---|
59 | EXT07::
|
---|
60 | EXT08::
|
---|
61 | EXT09::
|
---|
62 | EXT0A::
|
---|
63 | EXT0B::
|
---|
64 | EXT0C::
|
---|
65 | EXT0D::
|
---|
66 | EXT0E::
|
---|
67 | EXT_INVALID: MOV AX, 8001H ; Unsupported function
|
---|
68 | EXT_ERROR: AND EAX, 0FFFFH
|
---|
69 | MOV I_EAX, EAX
|
---|
70 | OR I_EFLAGS, FLAG_C ; Set carray flag
|
---|
71 | RET
|
---|
72 |
|
---|
73 | EXT04:: CMP AL, 00H
|
---|
74 | JE SHORT EXT0400
|
---|
75 | CMP AL, 01H
|
---|
76 | JE SHORT EXT0401
|
---|
77 | JMP EXT_INVALID
|
---|
78 |
|
---|
79 | ;
|
---|
80 | ; Get version
|
---|
81 | ;
|
---|
82 | EXT0400: MOV I_EAX, 0100H ; DPMI 1.0
|
---|
83 | MOV I_EBX, 0005H ; TODO
|
---|
84 | MOV I_ECX, 0003H ; TODO
|
---|
85 | MOV I_EDX, 0000H ; TODO
|
---|
86 | RET
|
---|
87 |
|
---|
88 | ;
|
---|
89 | ; Get DPMI capabilities
|
---|
90 | ;
|
---|
91 | EXT0401: MOV EDI, I_EDI
|
---|
92 | MOV ES, I_ES
|
---|
93 | MOV I_EAX, 0000H ; TODO
|
---|
94 | MOV I_ECX, 0 ; Reserved
|
---|
95 | MOV I_EDX, 0 ; Reserved
|
---|
96 | MOV BYTE PTR ES:[EDI+0], 0 ; Major version (TODO)
|
---|
97 | MOV BYTE PTR ES:[EDI+1], 0 ; Minor version (TODO)
|
---|
98 | MOV BYTE PTR ES:[EDI+2], "e"
|
---|
99 | MOV BYTE PTR ES:[EDI+3], "m"
|
---|
100 | MOV BYTE PTR ES:[EDI+4], "x"
|
---|
101 | MOV BYTE PTR ES:[EDI+5], 0
|
---|
102 | RET
|
---|
103 |
|
---|
104 | EXTAPI ENDP
|
---|
105 |
|
---|
106 | SV_CODE ENDS
|
---|
107 |
|
---|
108 | END
|
---|