source: vendor/emx/current/src/dos/extapi.asm

Last change on this file was 18, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 3.0 KB
Line 
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
31SV_CODE SEGMENT
32
33 .386P
34
35 ASSUME CS:SV_CODE, DS:NOTHING
36
37EXT_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
43EXTAPI 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
53EXT00::
54EXT01::
55EXT02::
56EXT03::
57EXT05::
58EXT06::
59EXT07::
60EXT08::
61EXT09::
62EXT0A::
63EXT0B::
64EXT0C::
65EXT0D::
66EXT0E::
67EXT_INVALID: MOV AX, 8001H ; Unsupported function
68EXT_ERROR: AND EAX, 0FFFFH
69 MOV I_EAX, EAX
70 OR I_EFLAGS, FLAG_C ; Set carray flag
71 RET
72
73EXT04:: 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;
82EXT0400: 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;
91EXT0401: 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
104EXTAPI ENDP
105
106SV_CODE ENDS
107
108 END
Note: See TracBrowser for help on using the repository browser.