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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
title OS2_STUB - OS/2 Simulation routines for DOS 3
; These routines simulate family API routines for DOS 3
;
; Routines which are never called under DOS 3 just return
; popping the parameters.
;
; 87/04/24 SKS DOSGETMACHINEMODE stores a Byte, not a Word!
;
memL=1 ; simulate large model for returns
?PLM=1 ; pascal calling conventions
?WIN=0 ; no Windows
.xlist
include cmac_mrt.inc ; old, customized masm510 cmacros
.list
include msdos.inc
sBegin code
assumes cs,code
; __DOSDEVCONFIG - return 8087/80287 indicator
cProc __DOSDEVCONFIG,<PUBLIC>,<ES,BX>
parmDP devinfo
parmW devitem
parmW reserved
cbegin
les bx,devinfo
mov word ptr es:[bx],1 ; assume have 287
xor ax,ax ; return no error
cend
; __DOSGETMACHINEMODE - return real mode indicator
cProc __DOSGETMACHINEMODE,<PUBLIC>,<ES,BX>
parmDP mode
cbegin
les bx,mode
xor ax,ax ; ax = return code and mode
mov es:[bx],al ; set machine mode to real
cend
; __DOSSETVEC - never called under DOS 3.x
cProc __DOSSETVEC,<PUBLIC>,<>
parmDP oldaddr
parmDP newaddr
parmW vecnum
cbegin
cend
; __DOSCREATECSALIAS
cProc __DOSCREATECSALIAS,<PUBLIC>,<ES,BX>
parmW dataseg
parmDP csalias
cbegin
mov ax,dataseg
les bx,csalias
mov es:[bx],ax ; use dataseg value
cend
; __DOSFREESEG - never called from DOS 3.x
cProc __DOSFREESEG,<PUBLIC>,<>
parmW dataseg
cbegin
cend
; __DOSWRITE - stripped-down version called from emulator for no87 message
; - note that there is no error detection in this version
; - since the emulator doesn't check for write errors anyway
cProc __DOSWRITE,<PUBLIC>,<ds> ; <di> commented out
parmW handle ; unsigned
parmD p_buffer ; char far *
parmW bytestowrite ; unsigned
parmD p_byteswritten ; unsigned far *
; returns unsgined
cbegin
mov cx,bytestowrite
mov bx,handle
lds dx,p_buffer
callos write
; jc wrtret ; if write error, error code already in AX
; ; if no error, set bytes written
; les di,p_byteswritten
; mov word ptr es:[di],ax
xor ax,ax ; if no error, clear return code
;wrtret:
cend
sEnd code
end
|