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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
page 60,132 ;AN000;
name _msgret ;AN000;
title C to Message Retriever ;AN000;
;------------------------------------------------------------------- ;AN000;
; ;AN000;
; MODULE: _msgret ;AN000;
; ;AN000;
; PURPOSE: Supplies an interface between C programs and ;AN000;
; the DOS message retriever ;AN000;
; ;AN000;
; CALLING FORMAT: ;AN000;
; sysloadmsg(&inregs,&outregs); ;AN000;
; sysgetmsg(&inregs,&outregs); ;AN000;
; sysdispmsg(&inregs,&outregs); ;AN000;
; ;AN000;
; ;AN000;
; DATE: 5-21-87 ;AN000;
; Modified: 6/18/87 ;AN000;
; ;AN000;
;------------------------------------------------------------------- ;AN000;
; ;AN000;
INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000;
; ;AN000;
MSG_UTILNAME <ATTRIB> ;IDENTIFY THE COMPONENT ;AN000;
; ;AN000;
.8087 ;AN000;
_TEXT SEGMENT BYTE PUBLIC 'CODE' ;AN000;
_TEXT ENDS ;AN000;
_DATA SEGMENT WORD PUBLIC 'DATA' ;AN000;
_DATA ENDS ;AN000;
CONST SEGMENT WORD PUBLIC 'CONST' ;AN000;
CONST ENDS ;AN000;
_BSS SEGMENT WORD PUBLIC 'BSS' ;AN000;
_BSS ENDS ;AN000;
DGROUP GROUP CONST, _BSS, _DATA ;AN000;
ASSUME CS: _TEXT, DS: _TEXT, SS: DGROUP, ES: DGROUP ;AN000;
; ;AN000;
public _sysloadmsg ;AN000;
public _sysgetmsg ;AN000;
public _sysdispmsg ;AN000;
; ;AN000;
;------------------------------------------------------------------- ;AN000;
;------------------------------------------------------------------- ;AN000;
; ;AN000;
_DATA segment ;AN000;
.XLIST ;AN000;
.XCREF ;AN000;
; MSG_SERVICES <MSGDATA> ;DATA AREA FOR THE MESSAGE HANDLER ;AN000;
MSG_SERVICES <MSGDATA> ;DATA AREA FOR THE MESSAGE HANDLER ;AN000;
.LIST ;AN000;
.CREF ;AN000;
_DATA ends ;AN000;
; ;AN000;
; ;AN000;
_TEXT segment ;AN000;
; ;AN000;
;------------------------------------------------------------------- ;AN000;
; ;AN000;
;DEFAULT=CHECK DOS VERSION ;AN000;
;DEFAULT=NEARmsg ;AN000;
;DEFAULT=INPUTmsg ;AN000;
;DEFAULT=NUMmsg ;AN000;
;DEFAULT=NO TIMEmsg ;AN000;
;DEFAULT=NO DATEmsg ;AN000;
; MSG_SERVICES <LOADmsg,GETmsg,DISPLAYmsg,CHARmsg,NUMmsg,INPUTmsg,FARmsg,TIMEmsg,DATEmsg> ;AN000;
; MSG_SERVICES <ATTRIB.CLA,ATTRIB.CLB,ATTRIB.CL1,ATTRIB.CL2> ;MSG TEXT ;AN000;
.XLIST ;AN000;
.XCREF ;AN000;
MSG_SERVICES <LOADmsg,GETmsg,DISPLAYmsg,CHARmsg,NUMmsg,INPUTmsg,FARmsg,TIMEmsg,DATEmsg> ;AN000;
MSG_SERVICES <ATTRIB.CLA,ATTRIB.CLB,ATTRIB.CL1,ATTRIB.CL2> ;MSG TEXT ;AN000;
.LIST ;AN000;
.CREF ;AN000;
; ;AN000;
;------------------------------------------------------------------- ;AN000;
_sysloadmsg proc near ;AN000;
push bp ; save user's base pointer ;AN000;
mov bp,sp ; set bp to current sp ;AN000;
push di ; save some registers ;AN000;
push si ;AN000;
; ;AN000;
; copy C inregs into proper registers ;AN000;
; ;AN000;
mov di,[bp+4] ; fix di (arg 0) ;AN000;
; ;AN000;
mov ax,[di+0ah] ; load di ;AN000;
push ax ; the di value from inregs is now on stack ;AN000;
; ;AN000;
mov ax,[di+00] ; get inregs.x.ax ;AN000;
mov bx,[di+02] ; get inregs.x.bx ;AN000;
mov cx,[di+04] ; get inregs.x.cx ;AN000;
mov dx,[di+06] ; get inregs.x.dx ;AN000;
mov si,[di+08] ; get inregs.x.si ;AN000;
pop di ; get inregs.x.di from stack ;AN000;
; ;AN000;
push bp ; save base pointer ;AN000;
; ;AN000;
;------------------------------------------------------------------- ;AN000;
call sysloadmsg ; call the message retriever ;AN000;
;------------------------------------------------------------------- ;AN000;
; ;AN000;
pop bp ; restore base pointer ;AN000;
push di ; the di value from call is now on stack ;AN000;
mov di,[bp+6] ; fix di (arg 1) ;AN000;
; ;AN000;
mov [di+00],ax ; load outregs.x.ax ;AN000;
mov [di+02],bx ; load outregs.x.bx ;AN000;
mov [di+04],cx ; load outregs.x.cx ;AN000;
mov [di+06],dx ; load outregs.x.dx ;AN000;
mov [di+08],si ; load outregs.x.si ;AN000;
; ;AN000;
lahf ; get flags into ax ;AN000;
mov al,ah ; move into low byte ;AN000;
mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
; ;AN000;
pop ax ; get di from stack ;AN000;
mov [di+0ah],ax ; load outregs.x.di ;AN000;
; ;AN000;
pop si ; restore registers ;AN000;
pop di ;AN000;
mov sp,bp ; restore sp ;AN000;
pop bp ; restore user's bp ;AN000;
ret ;AN000;
_sysloadmsg endp ;AN000;
; ;AN000;
; ;AN000;
_sysgetmsg proc near ;AN000;
push bp ; save user's base pointer ;AN000;
mov bp,sp ; set bp to current sp ;AN000;
push di ; save some registers ;AN000;
push si ;AN000;
; ;AN000;
; copy C inregs into proper registers ;AN000;
; ;AN000;
mov di,[bp+4] ; fix di (arg 0) ;AN000;
; ;AN000;
mov ax,[di+0ah] ; load di ;AN000;
push ax ; the di value from inregs is now on stack ;AN000;
; ;AN000;
mov ax,[di+00] ; get inregs.x.ax ;AN000;
mov bx,[di+02] ; get inregs.x.bx ;AN000;
mov cx,[di+04] ; get inregs.x.cx ;AN000;
mov dx,[di+06] ; get inregs.x.dx ;AN000;
mov si,[di+08] ; get inregs.x.si ;AN000;
pop di ; get inregs.x.di from stack ;AN000;
; ;AN000;
push bp ; save base pointer ;AN000;
; ;AN000;
;------------------------------------------------------------------- ;AN000;
call sysgetmsg ; call the message retriever ;AN000;
;------------------------------------------------------------------- ;AN000;
; ;AN000;
pop bp ; restore base pointer ;AN000;
push di ; the di value from call is now on stack ;AN000;
mov di,[bp+6] ; fix di (arg 1) ;AN000;
; ;AN000;
mov [di+00],ax ; load outregs.x.ax ;AN000;
mov [di+02],bx ; load outregs.x.bx ;AN000;
mov [di+04],cx ; load outregs.x.cx ;AN000;
mov [di+06],dx ; load outregs.x.dx ;AN000;
mov [di+08],si ; load outregs.x.si ;AN000;
; ;AN000;
lahf ; get flags into ax ;AN000;
mov al,ah ; move into low byte ;AN000;
mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
; ;AN000;
pop ax ; get di from stack ;AN000;
mov [di+0ah],ax ; load outregs.x.di ;AN000;
; ;AN000;
pop si ; restore registers ;AN000;
pop di ;AN000;
mov sp,bp ; restore sp ;AN000;
pop bp ; restore user's bp ;AN000;
ret ;AN000;
_sysgetmsg endp ;AN000;
; ;AN000;
; ;AN000;
_sysdispmsg proc near ;AN000;
push bp ; save user's base pointer ;AN000;
mov bp,sp ; set bp to current sp ;AN000;
push di ; save some registers ;AN000;
push si ;AN000;
; ;AN000;
; copy C inregs into proper registers ;AN000;
; ;AN000;
mov di,[bp+4] ; fix di (arg 0) ;AN000;
; ;AN000;
mov ax,[di+0ah] ; load di ;AN000;
push ax ; the di value from inregs is now on stack ;AN000;
; ;AN000;
mov ax,[di+00] ; get inregs.x.ax ;AN000;
mov bx,[di+02] ; get inregs.x.bx ;AN000;
mov cx,[di+04] ; get inregs.x.cx ;AN000;
mov dx,[di+06] ; get inregs.x.dx ;AN000;
mov si,[di+08] ; get inregs.x.si ;AN000;
pop di ; get inregs.x.di from stack ;AN000;
; ;AN000;
push bp ; save base pointer ;AN000;
; ;AN000;
;------------------------------------------------------------------- ;AN000;
call sysdispmsg ; call the message retriever ;AN000;
;------------------------------------------------------------------- ;AN000;
; ;AN000;
pop bp ; restore base pointer ;AN000;
push di ; the di value from call is now on stack ;AN000;
mov di,[bp+6] ; fix di (arg 1) ;AN000;
; ;AN000;
mov [di+00],ax ; load outregs.x.ax ;AN000;
mov [di+02],bx ; load outregs.x.bx ;AN000;
mov [di+04],cx ; load outregs.x.cx ;AN000;
mov [di+06],dx ; load outregs.x.dx ;AN000;
mov [di+08],si ; load outregs.x.si ;AN000;
; ;AN000;
lahf ; get flags into ax ;AN000;
mov al,ah ; move into low byte ;AN000;
mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
; ;AN000;
pop ax ; get di from stack ;AN000;
mov [di+0ah],ax ; load outregs.x.di ;AN000;
; ;AN000;
pop si ; restore registers ;AN000;
pop di ;AN000;
mov sp,bp ; restore sp ;AN000;
pop bp ; restore user's bp ;AN000;
ret ;AN000;
_sysdispmsg endp ;AN000;
; ;AN000;
; ;AN000;
_TEXT ends ; end code segment ;AN000;
include msgdcl.inc
end ;AN000;
|