summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/ATTRIB/_MSGRET.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/CMD/ATTRIB/_MSGRET.ASM')
-rw-r--r--v4.0/src/CMD/ATTRIB/_MSGRET.ASM233
1 files changed, 233 insertions, 0 deletions
diff --git a/v4.0/src/CMD/ATTRIB/_MSGRET.ASM b/v4.0/src/CMD/ATTRIB/_MSGRET.ASM
new file mode 100644
index 0000000..7acb51e
--- /dev/null
+++ b/v4.0/src/CMD/ATTRIB/_MSGRET.ASM
@@ -0,0 +1,233 @@
1page 60,132 ;AN000;
2name _msgret ;AN000;
3title C to Message Retriever ;AN000;
4;------------------------------------------------------------------- ;AN000;
5; ;AN000;
6; MODULE: _msgret ;AN000;
7; ;AN000;
8; PURPOSE: Supplies an interface between C programs and ;AN000;
9; the DOS message retriever ;AN000;
10; ;AN000;
11; CALLING FORMAT: ;AN000;
12; sysloadmsg(&inregs,&outregs); ;AN000;
13; sysgetmsg(&inregs,&outregs); ;AN000;
14; sysdispmsg(&inregs,&outregs); ;AN000;
15; ;AN000;
16; ;AN000;
17; DATE: 5-21-87 ;AN000;
18; Modified: 6/18/87 ;AN000;
19; ;AN000;
20;------------------------------------------------------------------- ;AN000;
21; ;AN000;
22 INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000;
23; ;AN000;
24 MSG_UTILNAME <ATTRIB> ;IDENTIFY THE COMPONENT ;AN000;
25; ;AN000;
26 .8087 ;AN000;
27_TEXT SEGMENT BYTE PUBLIC 'CODE' ;AN000;
28_TEXT ENDS ;AN000;
29_DATA SEGMENT WORD PUBLIC 'DATA' ;AN000;
30_DATA ENDS ;AN000;
31CONST SEGMENT WORD PUBLIC 'CONST' ;AN000;
32CONST ENDS ;AN000;
33_BSS SEGMENT WORD PUBLIC 'BSS' ;AN000;
34_BSS ENDS ;AN000;
35DGROUP GROUP CONST, _BSS, _DATA ;AN000;
36 ASSUME CS: _TEXT, DS: _TEXT, SS: DGROUP, ES: DGROUP ;AN000;
37; ;AN000;
38 public _sysloadmsg ;AN000;
39 public _sysgetmsg ;AN000;
40 public _sysdispmsg ;AN000;
41; ;AN000;
42;------------------------------------------------------------------- ;AN000;
43;------------------------------------------------------------------- ;AN000;
44; ;AN000;
45_DATA segment ;AN000;
46.XLIST ;AN000;
47.XCREF ;AN000;
48; MSG_SERVICES <MSGDATA> ;DATA AREA FOR THE MESSAGE HANDLER ;AN000;
49 MSG_SERVICES <MSGDATA> ;DATA AREA FOR THE MESSAGE HANDLER ;AN000;
50.LIST ;AN000;
51.CREF ;AN000;
52_DATA ends ;AN000;
53; ;AN000;
54; ;AN000;
55_TEXT segment ;AN000;
56; ;AN000;
57;------------------------------------------------------------------- ;AN000;
58; ;AN000;
59 ;DEFAULT=CHECK DOS VERSION ;AN000;
60 ;DEFAULT=NEARmsg ;AN000;
61 ;DEFAULT=INPUTmsg ;AN000;
62 ;DEFAULT=NUMmsg ;AN000;
63 ;DEFAULT=NO TIMEmsg ;AN000;
64 ;DEFAULT=NO DATEmsg ;AN000;
65; MSG_SERVICES <LOADmsg,GETmsg,DISPLAYmsg,CHARmsg,NUMmsg,INPUTmsg,FARmsg,TIMEmsg,DATEmsg> ;AN000;
66; MSG_SERVICES <ATTRIB.CLA,ATTRIB.CLB,ATTRIB.CL1,ATTRIB.CL2> ;MSG TEXT ;AN000;
67.XLIST ;AN000;
68.XCREF ;AN000;
69 MSG_SERVICES <LOADmsg,GETmsg,DISPLAYmsg,CHARmsg,NUMmsg,INPUTmsg,FARmsg,TIMEmsg,DATEmsg> ;AN000;
70 MSG_SERVICES <ATTRIB.CLA,ATTRIB.CLB,ATTRIB.CL1,ATTRIB.CL2> ;MSG TEXT ;AN000;
71.LIST ;AN000;
72.CREF ;AN000;
73; ;AN000;
74;------------------------------------------------------------------- ;AN000;
75_sysloadmsg proc near ;AN000;
76 push bp ; save user's base pointer ;AN000;
77 mov bp,sp ; set bp to current sp ;AN000;
78 push di ; save some registers ;AN000;
79 push si ;AN000;
80; ;AN000;
81; copy C inregs into proper registers ;AN000;
82; ;AN000;
83 mov di,[bp+4] ; fix di (arg 0) ;AN000;
84; ;AN000;
85 mov ax,[di+0ah] ; load di ;AN000;
86 push ax ; the di value from inregs is now on stack ;AN000;
87; ;AN000;
88 mov ax,[di+00] ; get inregs.x.ax ;AN000;
89 mov bx,[di+02] ; get inregs.x.bx ;AN000;
90 mov cx,[di+04] ; get inregs.x.cx ;AN000;
91 mov dx,[di+06] ; get inregs.x.dx ;AN000;
92 mov si,[di+08] ; get inregs.x.si ;AN000;
93 pop di ; get inregs.x.di from stack ;AN000;
94; ;AN000;
95 push bp ; save base pointer ;AN000;
96; ;AN000;
97;------------------------------------------------------------------- ;AN000;
98 call sysloadmsg ; call the message retriever ;AN000;
99;------------------------------------------------------------------- ;AN000;
100; ;AN000;
101 pop bp ; restore base pointer ;AN000;
102 push di ; the di value from call is now on stack ;AN000;
103 mov di,[bp+6] ; fix di (arg 1) ;AN000;
104; ;AN000;
105 mov [di+00],ax ; load outregs.x.ax ;AN000;
106 mov [di+02],bx ; load outregs.x.bx ;AN000;
107 mov [di+04],cx ; load outregs.x.cx ;AN000;
108 mov [di+06],dx ; load outregs.x.dx ;AN000;
109 mov [di+08],si ; load outregs.x.si ;AN000;
110; ;AN000;
111 lahf ; get flags into ax ;AN000;
112 mov al,ah ; move into low byte ;AN000;
113 mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
114; ;AN000;
115 pop ax ; get di from stack ;AN000;
116 mov [di+0ah],ax ; load outregs.x.di ;AN000;
117; ;AN000;
118 pop si ; restore registers ;AN000;
119 pop di ;AN000;
120 mov sp,bp ; restore sp ;AN000;
121 pop bp ; restore user's bp ;AN000;
122 ret ;AN000;
123_sysloadmsg endp ;AN000;
124; ;AN000;
125; ;AN000;
126_sysgetmsg proc near ;AN000;
127 push bp ; save user's base pointer ;AN000;
128 mov bp,sp ; set bp to current sp ;AN000;
129 push di ; save some registers ;AN000;
130 push si ;AN000;
131; ;AN000;
132; copy C inregs into proper registers ;AN000;
133; ;AN000;
134 mov di,[bp+4] ; fix di (arg 0) ;AN000;
135; ;AN000;
136 mov ax,[di+0ah] ; load di ;AN000;
137 push ax ; the di value from inregs is now on stack ;AN000;
138; ;AN000;
139 mov ax,[di+00] ; get inregs.x.ax ;AN000;
140 mov bx,[di+02] ; get inregs.x.bx ;AN000;
141 mov cx,[di+04] ; get inregs.x.cx ;AN000;
142 mov dx,[di+06] ; get inregs.x.dx ;AN000;
143 mov si,[di+08] ; get inregs.x.si ;AN000;
144 pop di ; get inregs.x.di from stack ;AN000;
145; ;AN000;
146 push bp ; save base pointer ;AN000;
147; ;AN000;
148;------------------------------------------------------------------- ;AN000;
149 call sysgetmsg ; call the message retriever ;AN000;
150;------------------------------------------------------------------- ;AN000;
151; ;AN000;
152 pop bp ; restore base pointer ;AN000;
153 push di ; the di value from call is now on stack ;AN000;
154 mov di,[bp+6] ; fix di (arg 1) ;AN000;
155; ;AN000;
156 mov [di+00],ax ; load outregs.x.ax ;AN000;
157 mov [di+02],bx ; load outregs.x.bx ;AN000;
158 mov [di+04],cx ; load outregs.x.cx ;AN000;
159 mov [di+06],dx ; load outregs.x.dx ;AN000;
160 mov [di+08],si ; load outregs.x.si ;AN000;
161; ;AN000;
162 lahf ; get flags into ax ;AN000;
163 mov al,ah ; move into low byte ;AN000;
164 mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
165; ;AN000;
166 pop ax ; get di from stack ;AN000;
167 mov [di+0ah],ax ; load outregs.x.di ;AN000;
168; ;AN000;
169 pop si ; restore registers ;AN000;
170 pop di ;AN000;
171 mov sp,bp ; restore sp ;AN000;
172 pop bp ; restore user's bp ;AN000;
173 ret ;AN000;
174_sysgetmsg endp ;AN000;
175; ;AN000;
176; ;AN000;
177_sysdispmsg proc near ;AN000;
178 push bp ; save user's base pointer ;AN000;
179 mov bp,sp ; set bp to current sp ;AN000;
180 push di ; save some registers ;AN000;
181 push si ;AN000;
182; ;AN000;
183; copy C inregs into proper registers ;AN000;
184; ;AN000;
185 mov di,[bp+4] ; fix di (arg 0) ;AN000;
186; ;AN000;
187 mov ax,[di+0ah] ; load di ;AN000;
188 push ax ; the di value from inregs is now on stack ;AN000;
189; ;AN000;
190 mov ax,[di+00] ; get inregs.x.ax ;AN000;
191 mov bx,[di+02] ; get inregs.x.bx ;AN000;
192 mov cx,[di+04] ; get inregs.x.cx ;AN000;
193 mov dx,[di+06] ; get inregs.x.dx ;AN000;
194 mov si,[di+08] ; get inregs.x.si ;AN000;
195 pop di ; get inregs.x.di from stack ;AN000;
196; ;AN000;
197 push bp ; save base pointer ;AN000;
198; ;AN000;
199;------------------------------------------------------------------- ;AN000;
200 call sysdispmsg ; call the message retriever ;AN000;
201;------------------------------------------------------------------- ;AN000;
202; ;AN000;
203 pop bp ; restore base pointer ;AN000;
204 push di ; the di value from call is now on stack ;AN000;
205 mov di,[bp+6] ; fix di (arg 1) ;AN000;
206; ;AN000;
207 mov [di+00],ax ; load outregs.x.ax ;AN000;
208 mov [di+02],bx ; load outregs.x.bx ;AN000;
209 mov [di+04],cx ; load outregs.x.cx ;AN000;
210 mov [di+06],dx ; load outregs.x.dx ;AN000;
211 mov [di+08],si ; load outregs.x.si ;AN000;
212; ;AN000;
213 lahf ; get flags into ax ;AN000;
214 mov al,ah ; move into low byte ;AN000;
215 mov [di+0ch],ax ; load outregs.x.cflag ;AN000;
216; ;AN000;
217 pop ax ; get di from stack ;AN000;
218 mov [di+0ah],ax ; load outregs.x.di ;AN000;
219; ;AN000;
220 pop si ; restore registers ;AN000;
221 pop di ;AN000;
222 mov sp,bp ; restore sp ;AN000;
223 pop bp ; restore user's bp ;AN000;
224 ret ;AN000;
225_sysdispmsg endp ;AN000;
226; ;AN000;
227; ;AN000;
228_TEXT ends ; end code segment ;AN000;
229
230 include msgdcl.inc
231
232 end ;AN000;
233 \ No newline at end of file