summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/MEM
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/MEM
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/CMD/MEM')
-rw-r--r--v4.0/src/CMD/MEM/MAKEFILE37
-rw-r--r--v4.0/src/CMD/MEM/MEM.C1674
-rw-r--r--v4.0/src/CMD/MEM/MEM.SKL53
-rw-r--r--v4.0/src/CMD/MEM/MSGDEF.H93
-rw-r--r--v4.0/src/CMD/MEM/PARSE.H144
-rw-r--r--v4.0/src/CMD/MEM/_MSGRET.ASM263
-rw-r--r--v4.0/src/CMD/MEM/_PARSE.ASM165
7 files changed, 2429 insertions, 0 deletions
diff --git a/v4.0/src/CMD/MEM/MAKEFILE b/v4.0/src/CMD/MEM/MAKEFILE
new file mode 100644
index 0000000..ec63a73
--- /dev/null
+++ b/v4.0/src/CMD/MEM/MAKEFILE
@@ -0,0 +1,37 @@
1#************************** makefile for cmd\... ***************************
2
3msg =..\..\messages
4dos =..\..\dos
5inc =..\..\inc
6hinc =..\..\h
7lib =..\..\lib
8
9#
10####################### dependencies begin here. #########################
11#
12
13all: mem.exe
14
15
16mem.ctl: mem.skl \
17 $(msg)\$(COUNTRY).msg makefile
18
19_parse.obj: _parse.asm \
20 makefile \
21 $(inc)\parse.asm \
22 $(inc)\psdata.inc
23
24_msgret.obj: _msgret.asm \
25 makefile \
26 mem.ctl \
27 $(inc)\msgserv.asm \
28 $(inc)\sysmsg.inc
29
30mem.obj: mem.c \
31 msgdef.h \
32 $(hinc)\copyrigh.h
33
34mem.exe: mem.obj _msgret.obj _parse.obj
35 link mem+_msgret+_parse,,,$(lib)\mem;
36
37
diff --git a/v4.0/src/CMD/MEM/MEM.C b/v4.0/src/CMD/MEM/MEM.C
new file mode 100644
index 0000000..624681e
--- /dev/null
+++ b/v4.0/src/CMD/MEM/MEM.C
@@ -0,0 +1,1674 @@
1
2/*----------------------------------------------------------------------+
3| |
4| |
5| Title: MEM |
6| |
7| Syntax: |
8| |
9| From the DOS command line: |
10| |
11| MEM |
12| - Used to display DOS memory map summary. |
13| |
14| MEM /PROGRAM |
15| - Used to display DOS memory map. |
16| |
17| MEM /DEBUG |
18| - Used to display a detailed DOS memory map. |
19| |
20| AN001 - PTM P2914 -> This PTM relates to MEM's ability to report|
21| the accurate total byte count for EM |
22| memory. |
23| |
24| AN002 - PTM P3477 -> MEM was displaying erroneous base memory |
25| information for "Total" and "Available" |
26| memory. This was due to incorrect logic |
27| for RAM carving. |
28| |
29| AN003 - PTM P3912 -> MEM messages do not conform to spec. |
30| PTM P3989 |
31| |
32| Date: 1/28/88 |
33| |
34| AN004 - PTM P4510 -> MEM does not give correct DOS size. |
35| |
36| Date: 4/27/88 |
37| |
38| AN005 - PTM P4957 -> MEM does not give correct DOS size for |
39| programs loaded into high memory. |
40| |
41| Date: 6/07/88 |
42| |
43+----------------------------------------------------------------------*/
44
45/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
46
47#include "ctype.h" /* ;an000; */
48#include "conio.h" /* need for kbhit prototype */ /* ;an000; */
49#include "stdio.h" /* ;an000; */
50#include "dos.h" /* ;an000; */
51#include "string.h" /* ;an000; */
52#include "stdlib.h" /* ;an000; */
53#include "msgdef.h" /* ;an000; */
54#include "parse.h" /* ;an000; */
55
56/* #include "copyrigh.h" */ /* Only need one copyright statement an004 */
57 /* It is included by the message ret an004 */
58
59/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
60
61 char *SingleDrive = "%c:" ; /* ;an000; */
62 char *MultipleDrives = "%c: - %c:" ; /* ;an000; */
63 char *UnOwned = "----------" ; /* ;an000; */
64 char *Ibmbio = "IO " ; /* ;an000; */
65 char *Ibmdos = "MSDOS " ;
66 /* ;an000; */
67 struct sublistx /* ;an000; */
68 { /* ;an000; */
69 unsigned char size; /* sublist size */ /* ;an000; */
70 unsigned char reserved; /* reserved for future growth */ /* ;an000; */
71 unsigned far *value; /* pointer to replaceable parm */ /* ;an000; */
72 unsigned char id; /* type of replaceable parm */ /* ;an000; */
73 unsigned char flags; /* how parm is to be displayed */ /* ;an000; */
74 unsigned char max_width; /* max width of replaceable field */ /* ;an000; */
75 unsigned char min_width; /* min width of replaceable field */ /* ;an000; */
76 unsigned char pad_char; /* pad character for replaceable field */ /* ;an000; */
77 } sublist[4]; /* ;an000; */
78 /* ;an000; */
79/*----------------------------------------------------------------------+
80| define structure used by parser |
81+----------------------------------------------------------------------*/
82
83struct p_parms p_p; /* ;an000; */
84 /* ;an000; */
85struct p_parmsx p_px; /* ;an000; */
86 /* ;an000; */
87struct p_control_blk p_con1; /* ;an000; */
88struct p_control_blk p_con2; /* ;an000; */
89 /* ;an000; */
90struct p_result_blk p_result1; /* ;an000; */
91struct p_result_blk p_result2; /* ;an000; */
92 /* ;an000; */
93struct p_value_blk p_noval; /* ;an000; */
94 /* ;an000; */
95 /* ;an000; */
96 struct DEVICEHEADER { /* ;an000; */
97 struct DEVICEHEADER far *NextDeviceHeader; /* ;an000; */
98 unsigned Attributes; /* ;an000; */
99 unsigned Strategy; /* ;an000; */
100 unsigned Interrupt; /* ;an000; */
101 char Name[8]; /* ;an000; */
102 }; /* ;an000; */
103 /* ;an000; */
104#define DA_TYPE 0x8000; /* ;an000; */
105#define DA_IOCTL 0x4000; /* ;an000; */
106 /* ;an000; */
107#define a(fp) ((char) fp) /* ;an000; */
108 /* ;an000; */
109/* defines used in EMS support */ /* ;an000; */
110 /* ;an000; */
111#define GET_VECT 0x35 /* EMS interrupt */ /* ;an000; */
112#define EMS 0x67 /* ;an000; */
113 /* ;an000; */
114#define CASSETTE 0x15 /* interrupt to get extended memory */ /* ;an000; */
115 /* ;an000; */
116#define DOSEMSVER 0x40 /* EMS version */ /* ;an000; */
117 /* ;an000; */
118#define EMSGetStat 0x4000 /* get stat */ /* ;an000; */
119#define EMSGetVer 0x4600 /* get version */ /* ;an000; */
120#define EMSGetFreePgs 0x4200 /* get free pages */ /* ;an000; */
121 /* ;an000; */
122#define GetExtended 0x8800 /* get extended memory size */ /* ;an000; */
123 /* ;an000; */
124 /* ;an000; */
125 /* ;an000; */
126/* defines used by total memory determination */ /* ;an000; */
127#define GET_PSP (unsigned char ) 0x62 /* get PSP function call */ /* ;an000; */
128
129#define MEMORY_DET 0x12 /* BIOS interrupt used to get total memory size */ /* ;an000; */
130 /* ;an000; */
131 struct SYSIVAR { /* ;an000; */
132 char far *DpbChain; /* ;an000; */
133 char far *SftChain; /* ;an000; */
134 char far *Clock; /* ;an000; */
135 char far *Con; /* ;an000; */
136 unsigned MaxSectorSize; /* ;an000; */
137 char far *BufferChain; /* ;an000; */
138 char far *CdsList; /* ;an000; */
139 char far *FcbChain; /* ;an000; */
140 unsigned FcbKeepCount; /* ;an000; */
141 unsigned char BlockDeviceCount; /* ;an000; */
142 char CdsCount; /* ;an000; */
143 struct DEVICEHEADER far *DeviceDriverChain; /* ;an000; */
144 unsigned NullDeviceAttributes; /* ;an000; */
145 unsigned NullDeviceStrategyEntryPoint; /* ;an000; */
146 unsigned NullDeviceInterruptEntryPoint; /* ;an000; */
147 char NullDeviceName[8]; /* ;an000; */
148 char SpliceIndicator; /* ;an000; */
149 unsigned DosParagraphs; /* ;an000; */
150 char far *DosServiceRntryPoint; /* ;an000; */
151 char far *IfsChain; /* ;an000; */
152 unsigned BufferValues; /* ;an000; */
153 unsigned LastDriveValue; /* ;an000; */
154 char BootDrive; /* ;an000; */
155 char MoveType;
156 unsigned ExtendedMemory;
157 }; /* ;an000; */
158 /* ;an000; */
159/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
160 /* ;an000; */
161 struct ARENA { /* ;an000; */
162 char Signature; /* ;an000; */
163 unsigned Owner; /* ;an000; */
164 unsigned Paragraphs; /* ;an000; */
165 char Dummy[3]; /* ;an000; */
166 char OwnerName[8]; /* ;an000; */
167 }; /* ;an000; */
168 /* ;an000; */
169/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
170 /* ;an000; */
171#define FALSE (char)(1==0) /* ;an000; */
172#define TRUE !(FALSE) /* ;an000; */
173#define CR '\x0d' /* ;an000; */
174#define LF '\x0a' /* ;an000; */
175#define NUL (char) '\0' /* ;an000; */
176#define TAB '\x09' /* ;an000; */
177#define BLANK ' ' /* ;an000; */
178 /* ;an000; */
179extern unsigned DOS_TopOfMemory; /* PSP Top of memory from 'C' init code */ /* ;an005; */
180
181/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
182 /* ;an000; */
183 unsigned far *ArenaHeadPtr; /* ;an000; */
184 struct SYSIVAR far *SysVarsPtr; /* ;an000; */
185 /* ;an000; */
186 char OwnerName[128]; /* ;an000; */
187 char TypeText[128]; /* ;an000; */
188 char cmd_line[128]; /* ;an000; */
189 char far *cmdline; /* ;an000; */
190 /* ;an000; */
191 char UseArgvZero = TRUE; /* ;an000; */
192 char EMSInstalledFlag = (char) 2; /* ;an000; */
193 /* ;an000; */
194 union REGS InRegs; /* ;an000; */
195 union REGS OutRegs; /* ;an000; */
196 struct SREGS SegRegs; /* ;an000; */
197 /* ;an000; */
198 int DataLevel; /* ;an000; */
199 int i; /* ;an000; */
200 /* ;an000; */
201 int BlockDeviceNumber; /* ;an000; */
202 unsigned Parse_Ptr; /* ;an003; dms; pointer to command */
203 /* ;an000; */
204/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
205 /* ;an000; */
206void main(int, char *[]); /* ;an000; */
207 /* ;an000; */
208int printf();
209int sprintf();
210int strcmp(const char *, const char *);
211int sscanf(); /* ;an000; */
212void exit(int); /* ;an000; */
213int kbhit(); /* ;an000; */
214char *OwnerOf(struct ARENA far *); /* ;an000; */
215char *TypeOf(struct ARENA far *); /* ;an000; */
216unsigned long AddressOf(char far *); /* ;an000; */
217 /* ;an000; */
218char EMSInstalled(void); /* ;an000; */
219void DisplayEMSSummary(void); /* ;an000; */
220void DisplayEMSDetail(void); /* ;an000; */
221 /* ;an000; */
222void DisplayBaseSummary(void); /* ;an000; */
223void DisplayExtendedSummary(void); /* ;an000; */
224void DisplayExpandedSummary(void); /* ;an000; */
225 /* ;an000; */
226void DisplayBaseDetail(void); /* ;an000; */
227 /* ;an000; */
228void GetFromArgvZero(unsigned,unsigned far *); /* ;an000; */
229 /* ;an000; */
230void DisplayDeviceDriver(struct DEVICEHEADER far *,int); /* ;an000; */
231 /* ;an000; */
232void parse_init(void); /* ;an000; */
233 /* ;an000; */
234void Parse_Message(int,int,unsigned char); /* ;an000; */
235void Sub0_Message(int,int,unsigned char); /* ;an000; */
236void Sub1_Message(int,int,unsigned char,unsigned long int *); /* ;an000; */
237void Sub2_Message(int,int,unsigned char,char *,int); /* ;an000; */
238void Sub3_Message(int,int,unsigned char, /* ;an000; */
239 char *, /* ;an000; */
240 unsigned long int *, /* ;an000; */
241 int); /* ;an000; */
242 /* ;an000; */
243void Sub4_Message(int,int,unsigned char, /* ;an000; */
244 unsigned long int *, /* ;an000; */
245 int, /* ;an000; */
246 unsigned long int *, /* ;an000; */
247 int); /* ;an000; */
248 /* ;an000; */
249void Sub4a_Message(int,int,unsigned char, /* ;an000; */
250 unsigned long int *, /* ;an000; */
251 char *, /* ;an000; */
252 unsigned long int *, /* ;an000; */
253 char *); /* ;an000; */
254 /* ;an000; */
255void EMSPrint(int,int,unsigned char, /* ;an000; */
256 int *, /* ;an000; */
257 char *, /* ;an000; */
258 unsigned long int *); /* ;an000; */
259 /* ;an000; */
260extern void sysloadmsg(union REGS *, union REGS *); /* ;an000; */
261extern void sysdispmsg(union REGS *, union REGS *); /* ;an000; */
262extern void sysgetmsg(union REGS *, struct SREGS *, union REGS *); /* ;an000; */
263extern void parse(union REGS *, union REGS *); /* ;an000; */
264 /* ;an000; */
265 /* ;an000; */
266/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
267 /* ;an000; */
268void main(argc,argv) /* ;an000; */
269int argc; /* ;an000; */
270char *argv[]; /* ;an000; */
271{ /* ;an000; */
272 /* ;an000; */
273 /* ;an000; */
274 /* ;an000; */
275 sysloadmsg(&InRegs,&OutRegs); /* ;an000; */
276 if ((OutRegs.x.cflag & CarryFlag) == CarryFlag) /* ;an000; */
277 { /* ;an000; */
278 sysdispmsg(&OutRegs,&OutRegs); /* ;an000; */
279 exit(1); /* ;an000; */
280 } /* ;an000; */
281 /* ;an000; */
282 /* ;an000; */
283 InRegs.h.ah = (unsigned char) 0x62; /* an000; dms; get the PSP */ /* ;an000; */
284 intdosx(&InRegs, &InRegs, &SegRegs); /* an000; dms; invoke the INT 21 */ /* ;an000; */
285 /* ;an000; */
286 FP_OFF(cmdline) = 0x81; /* an000; dms; offset of command line */ /* ;an000; */
287 FP_SEG(cmdline) = InRegs.x.bx; /* an000; dms; segment of command line */ /* ;an000; */
288 /* ;an000; */
289 i = 0; /* an000; dms; init index */ /* ;an000; */
290 while ( *cmdline != (char) '\x0d' ) cmd_line[i++] = *cmdline++; /* an000; dms; while no CR */ /* ;an000; */
291 cmd_line[i++] = (char) '\x0d'; /* an000; dms; CR terminate string */ /* ;an000; */
292 cmd_line[i++] = (char) '\0'; /* an000; dms; null terminate string */ /* ;an000; */
293 /* ;an000; */
294 DataLevel = 0; /* ;an000; */
295 /* ;an000; */
296 parse_init(); /* an000; dms; init for parser */ /* ;an000; */
297 InRegs.x.si = (unsigned)cmd_line; /* an000; dms; initialize to command ln.*/ /* ;an000; */
298 InRegs.x.cx = (unsigned)0; /* an000; dms; ordinal of 0 */ /* ;an000; */
299 InRegs.x.dx = (unsigned)0; /* an000; dms; init pointer */ /* ;an000; */
300 InRegs.x.di = (unsigned)&p_p; /* an000; dms; point to ctrl blocks */ /* ;an000; */
301 Parse_Ptr = (unsigned)cmd_line; /*;an003; dms; point to command */
302 /* ;an000; */
303 parse(&InRegs,&OutRegs); /* an000; dms; parse command line */ /* ;an000; */
304 while (OutRegs.x.ax == p_no_error) /* an000; dms; good parse loop */ /* ;an000; */
305 { /* ;an000; */
306 if (p_result1.P_SYNONYM_Ptr == (unsigned int)p_con1.p_keyorsw) /* an000; dms; DEBUG switch */ /* ;an000; */
307 DataLevel = 2; /* an000; dms; flag DEBUG switch */ /* ;an000; */
308 if (p_result2.P_SYNONYM_Ptr == (unsigned int)p_con2.p_keyorsw) /* an000; dms; PROGRAM switch */ /* ;an000; */
309 DataLevel = 1; /* an000; dms; flag PROGRAM switch */ /* ;an000; */
310 Parse_Ptr = OutRegs.x.si; /* an003; dms; point to next parm */
311 parse(&OutRegs,&OutRegs); /* an000; dms; parse the line */ /* ;an000; */
312 if (OutRegs.x.ax == p_no_error) /* an000; dms; check for > 1 switch */ /* ;an000; */
313 OutRegs.x.ax = p_too_many; /* an000; dms; flag too many */ /* ;an000; */
314 } /* ;an000; */
315 /* ;an000; */
316 if (OutRegs.x.ax != p_rc_eol) /* an000; dms; parse error? */ /* ;an000; */
317 { /* ;an000; */
318 Parse_Message(OutRegs.x.ax,STDERR,Parse_Err_Class); /* an000; dms; display parse error */ /* ;an000; */
319 exit(1); /* an000; dms; exit the program */ /* ;an000; */
320 } /* ;an000; */
321 /* ;an000; */
322 /* ;an000; */
323 if (DataLevel > 0) /* ;an000; */
324 { /* ;an000; */
325 DisplayBaseDetail(); /* ;an000; */
326 } /* ;an000; */
327 /* ;an000; */
328 /* ;an000; */
329 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */
330 DisplayBaseSummary(); /* display low memory totals */ /* ;an000; */
331 /* ;an000; */
332 if (EMSInstalled() && (DataLevel > 1)) /* ;an000; */
333 DisplayEMSDetail(); /* display EMS memory totals */ /* ;an000; */
334 /* ;an000; */
335 /* ;an000; */
336 if (EMSInstalled()) /* ;an000; */
337 DisplayEMSSummary(); /* display EMS memory totals */ /* ;an000; */
338 /* ;an000; */
339 DisplayExtendedSummary(); /* display extended memory summary */ /* ;an000; */
340 /* ;an000; */
341 return; /* end of MEM main routine */ /* ;an000; */
342 /* ;an000; */
343 } /* ;an000; */
344 /* ;an000; */
345/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
346 /* ;an000; */
347void DisplayBaseDetail() /* ;an000; */
348{ /* ;an000; */
349 /* ;an000; */
350 struct ARENA far *ThisArenaPtr; /* ;an000; */
351 struct ARENA far *NextArenaPtr; /* ;an000; */
352 struct ARENA far *ThisConfigArenaPtr; /* ;an000; */
353 struct ARENA far *NextConfigArenaPtr; /* ;an000; */
354 /* ;an000; */
355 struct DEVICEHEADER far *ThisDeviceDriver; /* ;an000; */
356 /* ;an000; */
357 int SystemDataType; /* ;an000; */
358 char SystemDataOwner[64]; /* ;an000; */
359 /* ;an000; */
360 int i; /* ;an000; */
361 unsigned int long Out_Var1; /* ;an000; */
362 unsigned int long Out_Var2; /* ;an000; */
363 char Out_Str1[64]; /* ;an000; */
364 char Out_Str2[64]; /* ;an000; */
365 /* ;an000; */
366 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */
367 if (DataLevel > 0) /* ;an000; */
368 { /* ;an000; */
369 Sub0_Message(Title1Msg,STDOUT,Utility_Msg_Class); /* ;an000; */
370 Sub0_Message(Title2Msg,STDOUT,Utility_Msg_Class); /* ;an000; */
371 } /* ;an000; */
372 /* ;an000; */
373 InRegs.h.ah = (unsigned char) 0x30; /* ;an000; */
374 intdos(&InRegs, &OutRegs); /* ;an000; */
375 /* ;an000; */
376 if ( (OutRegs.h.al != (unsigned char) 3) || (OutRegs.h.ah < (unsigned char) 40) ) /* ;an000; */
377 UseArgvZero = TRUE; /* ;an000; */
378 else UseArgvZero = FALSE; /* ;an000; */
379 /* ;an000; */
380 /* Display stuff below DOS */ /* ;an000; */
381 /* ;an000; */
382 Out_Var1 = 0l; /* ;an000; */
383 Out_Var2 = 0x400l; /* ;an000; */
384 Sub4_Message(MainLineMsg, /* ;an000; */
385 STDOUT, /* ;an000; */
386 Utility_Msg_Class, /* ;an000; */
387 &Out_Var1, /* ;an000; */
388 BlankMsg, /* ;an000; */
389 &Out_Var2, /* ;an000; */
390 InterruptVectorMsg); /* ;an000; */
391 /* ;an000; */
392 Out_Var1 = 0x400l; /* ;an000; */
393 Out_Var2 = 0x100l; /* ;an000; */
394 Sub4_Message(MainLineMsg, /* ;an000; */
395 STDOUT, /* ;an000; */
396 Utility_Msg_Class, /* ;an000; */
397 &Out_Var1, /* ;an000; */
398 BlankMsg, /* ;an000; */
399 &Out_Var2, /* ;an000; */
400 ROMCommunicationAreaMsg); /* ;an000; */
401 /* ;an000; */
402 Out_Var1 = 0x500l; /* ;an000; */
403 Out_Var2 = 0x200l; /* ;an000; */
404 Sub4_Message(MainLineMsg, /* ;an000; */
405 STDOUT, /* ;an000; */
406 Utility_Msg_Class, /* ;an000; */
407 &Out_Var1, /* ;an000; */
408 BlankMsg, /* ;an000; */
409 &Out_Var2, /* ;an000; */
410 DOSCommunicationAreaMsg); /* ;an000; */
411 /* ;an000; */
412 /* Display the DOS data */ /* ;an000; */
413 /* ;an000; */
414 InRegs.h.ah = (unsigned char) 0x52; /* ;an000; */
415 intdosx(&InRegs,&OutRegs,&SegRegs); /* ;an000; */
416 /* ;an000; */
417 FP_SEG(SysVarsPtr) = SegRegs.es; /* ;an000; */
418 FP_OFF(SysVarsPtr) = OutRegs.x.bx; /* ;an000; */
419 /* ;an000; */
420 /* Display the BIO location and size */ /* ;an000; */
421 /* ;an000; */
422 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */
423 /* ;an000; */
424 /* ;an000; */
425 Out_Var1 = 0x700l; /* ;an000; */
426 Out_Var2 = (long) (FP_SEG(SysVarsPtr) - 0x70)*16l; /* ;an000; */
427 Sub4_Message(MainLineMsg, /* ;an000; */
428 STDOUT, /* ;an000; */
429 Utility_Msg_Class, /* ;an000; */
430 &Out_Var1, /* ;an000; */
431 IbmbioMsg, /* ;an000; */
432 &Out_Var2, /* ;an000; */
433 SystemProgramMsg); /* ;an000; */
434 /* ;an000; */
435 /* Display the Base Device Driver Locations and Sizes */ /* ;an000; */
436 /* ;an000; */
437 BlockDeviceNumber = 0; /* ;an000; */
438 /* ;an000; */
439 for (ThisDeviceDriver = SysVarsPtr -> DeviceDriverChain; /* ;an000; */
440 (FP_OFF(ThisDeviceDriver) != 0xFFFF); /* ;an000; */
441 ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader) /* ;an000; */
442 { if ( FP_SEG(ThisDeviceDriver) < FP_SEG(SysVarsPtr) ) /* ;an000; */
443 DisplayDeviceDriver(ThisDeviceDriver,SystemDeviceDriverMsg); /* ;an000; */
444 kbhit(); /* ;an000; */
445 } /* ;an000; */
446 /* ;an000; */
447 /* Display the DOS location and size */ /* ;an000; */
448
449 FP_SEG(ArenaHeadPtr) = FP_SEG(SysVarsPtr); /* ;an004; */
450 FP_OFF(ArenaHeadPtr) = FP_OFF(SysVarsPtr) - 2; /* ;an004; */
451 /* ;an004; */
452 FP_SEG(ThisArenaPtr) = *ArenaHeadPtr; /* ;an004; */
453 FP_OFF(ThisArenaPtr) = 0; /* ;an004; */
454 /* ;an000; */
455 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */
456 /* ;an000; */
457 Out_Var1 = (long) FP_SEG(SysVarsPtr) * 16l; /* ;an000; */
458 Out_Var2 = (long) ((AddressOf((char far *)ThisArenaPtr)) - Out_Var1); /* ;ac004; */
459 Sub4_Message(MainLineMsg, /* ;an000; */
460 STDOUT, /* ;an000; */
461 Utility_Msg_Class, /* ;an000; */
462 &Out_Var1, /* ;an000; */
463 IbmdosMsg, /* ;an000; */
464 &Out_Var2, /* ;an000; */
465 SystemProgramMsg); /* ;an000; */
466 /* ;an000; */
467 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */
468 /* ;an000; */
469 /* Display the memory data */ /* ;an000; */
470 /* ;an000; */
471 while (ThisArenaPtr -> Signature != (char) 'Z') /* ;an000; */
472 { /* ;an000; */
473 /* ;an000; */
474 if (ThisArenaPtr -> Owner == 8) /* ;an000; */
475 { /* ;an000; */
476 /* ;an000; */
477 /* ;an000; */
478 Out_Var1 = AddressOf((char far *)ThisArenaPtr); /* ;an000; */
479 Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l; /* ;an000; */
480 Sub4_Message(MainLineMsg, /* ;an000; */
481 STDOUT, /* ;an000; */
482 Utility_Msg_Class, /* ;an000; */
483 &Out_Var1, /* ;an000; */
484 IbmbioMsg, /* ;an000; */
485 &Out_Var2, /* ;an000; */
486 SystemDataMsg); /* ;an000; */
487 /* ;an000; */
488 FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1; /* ;an000; */
489 FP_OFF(NextArenaPtr) = 0; /* ;an000; */
490 /* ;an000; */
491 FP_SEG(ThisConfigArenaPtr) = FP_SEG(ThisArenaPtr) + 1; /* ;an000; */
492 FP_OFF(ThisConfigArenaPtr) = 0; /* ;an000; */
493 /* ;an000; */
494 /* ;an000; */
495 while ( (FP_SEG(ThisConfigArenaPtr) > FP_SEG(ThisArenaPtr)) && /* ;an000; */
496 (FP_SEG(ThisConfigArenaPtr) < FP_SEG(NextArenaPtr)) ) /* ;an000; */
497 { /* ;an000; */
498 strcpy(SystemDataOwner," "); /* ;an000; */
499 switch(ThisConfigArenaPtr -> Signature) /* ;an000; */
500 { /* ;an000; */
501 case 'B': /* ;an000; */
502 SystemDataType = ConfigBuffersMsg; /* ;an000; */
503 break; /* ;an000; */
504 case 'D': /* ;an000; */
505 SystemDataType = ConfigDeviceMsg; /* ;an000; */
506 strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr)); /* ;an000; */
507 break; /* ;an000; */
508 case 'F': /* ;an000; */
509 SystemDataType = ConfigFilesMsg; /* ;an000; */
510 break; /* ;an000; */
511 case 'I': /* ;an000; */
512 SystemDataType = ConfigIFSMsg; /* ;an000; */
513 strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr)); /* ;an000; */
514 break; /* ;an000; */
515 case 'L': /* ;an000; */
516 SystemDataType = ConfigLastDriveMsg; /* ;an000; */
517 break; /* ;an000; */
518 case 'S': /* ;an000; */
519 SystemDataType = ConfigStacksMsg; /* ;an000; */
520 break; /* ;an000; */
521 case 'T': /* gga */ /* ;an000; */
522 SystemDataType = ConfigInstallMsg; /* gga */ /* ;an000; */
523 break; /* gga */ /* ;an000; */
524 case 'X': /* ;an000; */
525 SystemDataType = ConfigFcbsMsg; /* ;an000; */
526 break; /* ;an000; */
527 default: /* ;an000; */
528 SystemDataType = BlankMsg; /* ;an000; */
529 break; /* ;an000; */
530 } /* ;an000; */
531 Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l; /* ;an000; */
532 Sub3_Message(DriverLineMsg, /* ;an000; */
533 STDOUT, /* ;an000; */
534 Utility_Msg_Class, /* ;an000; */
535 SystemDataOwner, /* ;an000; */
536 &Out_Var1, /* ;an000; */
537 SystemDataType ); /* ;an000; */
538 /* ;an000; */
539 NextConfigArenaPtr = ThisConfigArenaPtr; /* ;an000; */
540 FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1; /* ;an000; */
541 if (ThisConfigArenaPtr -> Signature == (char) 'D') /* ;an000; */
542 { /* ;an000; */
543 /* ;an000; */
544 FP_SEG(ThisDeviceDriver) = FP_SEG(ThisConfigArenaPtr) + 1; /* ;an000; */
545 FP_OFF(ThisDeviceDriver) = 0; /* ;an000; */
546 while ( (a(ThisDeviceDriver) > a(ThisConfigArenaPtr)) && /* ;an000; */
547 (a(ThisDeviceDriver) < a(NextConfigArenaPtr)) ) /* ;an000; */
548 DisplayDeviceDriver(ThisDeviceDriver,InstalledDeviceDriverMsg); /* ;an000; */
549 } /* ;an000; */
550 /* ;an000; */
551 FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1; /* ;an000; */
552 /* ;an000; */
553 } /* ;an000; */
554 /* ;an000; */
555 } /* ;an000; */
556 else { /* ;an000; */
557 /* ;an000; */
558 Out_Var1 = AddressOf((char far *)ThisArenaPtr); /* ;an000; */
559 Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l; /* ;an000; */
560 strcpy(Out_Str1,OwnerOf(ThisArenaPtr)); /* ;an000; */
561 strcpy(Out_Str2,TypeOf(ThisArenaPtr)); /* ;an000; */
562 Sub4a_Message(MainLineMsg, /* ;an000; */
563 STDOUT, /* ;an000; */
564 Utility_Msg_Class, /* ;an000; */
565 &Out_Var1, /* ;an000; */
566 Out_Str1, /* ;an000; */
567 &Out_Var2, /* ;an000; */
568 Out_Str2); /* ;an000; */
569 } /* ;an000; */
570 /* ;an000; */
571 FP_SEG(ThisArenaPtr) += ThisArenaPtr -> Paragraphs + 1; /* ;an000; */
572 /* ;an000; */
573 } /* ;an000; */
574 Out_Var1 = AddressOf((char far *)ThisArenaPtr); /* ;an000; */
575 Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l; /* ;an000; */
576 strcpy(Out_Str1,OwnerOf(ThisArenaPtr)); /* ;an000; */
577 strcpy(Out_Str2,TypeOf(ThisArenaPtr)); /* ;an000; */
578 Sub4a_Message(MainLineMsg, /* ;an000; */
579 STDOUT, /* ;an000; */
580 Utility_Msg_Class, /* ;an000; */
581 &Out_Var1, /* ;an000; */
582 Out_Str1, /* ;an000; */
583 &Out_Var2, /* ;an000; */
584 Out_Str2); /* ;an000; */
585 /* ;an000; */
586 /* ;an000; */
587 return; /* end of MEM main routine */ /* ;an000; */
588 /* ;an000; */
589 } /* ;an000; */
590 /* ;an000; */
591 /* ;an000; */
592 /* ;an000; */
593/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
594 /* ;an000; */
595void DisplayDeviceDriver(ThisDeviceDriver,DeviceDriverType) /* ;an000; */
596struct DEVICEHEADER far *ThisDeviceDriver; /* ;an000; */
597int DeviceDriverType; /* ;an000; */
598{ /* ;an000; */
599 char LocalDeviceName[16]; /* ;an000; */
600 int i; /* ;an000; */
601 /* ;an000; */
602 if (DataLevel < 2) return; /* ;an000; */
603 /* ;an000; */
604 if ( ((ThisDeviceDriver -> Attributes) & 0x8000 ) != 0 ) /* ;an000; */
605 { for (i = 0; i < 8; i++) LocalDeviceName[i] = ThisDeviceDriver -> Name[i]; /* ;an000; */
606 LocalDeviceName[8] = NUL; /* ;an000; */
607 /* ;an000; */
608 Sub2_Message(DeviceLineMsg, /* ;an000; */
609 STDOUT, /* ;an000; */
610 Utility_Msg_Class, /* ;an000; */
611 LocalDeviceName, /* ;an000; */
612 DeviceDriverType); /* ;an000; */
613 /* ;an000; */
614 } /* ;an000; */
615 /* ;an000; */
616 else { /* ;an000; */
617 if ((int) ThisDeviceDriver -> Name[0] == 1) /* ;an000; */
618 sprintf(&LocalDeviceName[0],SingleDrive,'A'+BlockDeviceNumber); /* ;an000; */
619 else sprintf(&LocalDeviceName[0],MultipleDrives, /* ;an000; */
620 'A'+BlockDeviceNumber, /* ;an000; */
621 'A'+BlockDeviceNumber + ((int) ThisDeviceDriver -> Name[0]) - 1); /* ;an000; */
622 /* ;an000; */
623 Sub2_Message(DeviceLineMsg, /* ;an000; */
624 STDOUT, /* ;an000; */
625 Utility_Msg_Class, /* ;an000; */
626 LocalDeviceName, /* ;an000; */
627 DeviceDriverType); /* ;an000; */
628 /* ;an000; */
629 BlockDeviceNumber += (int) (ThisDeviceDriver -> Name[0]); /* ;an000; */
630 /* ;an000; */
631 } /* ;an000; */
632 /* ;an000; */
633 return; /* ;an000; */
634 /* ;an000; */
635 } /* ;an000; */
636 /* ;an000; */
637 /* ;an000; */
638/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
639 /* ;an000; */
640void DisplayBaseSummary() /* ;an000; */
641 { /* ;an000; */
642 /* ;an000; */
643 struct PSP_STRUC /* ;an000; */
644 { /* ;an000; */
645 unsigned int int_20; /* ;an000; */
646 unsigned int top_of_memory; /* ;an000; */
647 }; /* ;an000; */
648 /* ;an000; */
649 char far *CarvedPtr; /* ;an000; */
650 /* ;an000; */
651 unsigned long int total_mem; /* total memory in system */ /* ;an000; */
652 unsigned long int avail_mem; /* avail memory in system */ /* ;an000; */
653 unsigned long int free_mem; /* free memory */ /* ;an000; */
654 struct PSP_STRUC far *PSPptr; /* ;an000; */
655 /* ;an000; */
656/* skip a line */ /* ;an000; */
657 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */
658 /* ;an000; */
659/* get PSP info */ /* ;an000; */
660 InRegs.h.ah = GET_PSP; /* get PSP function call */ /* ;an000; */
661 intdos(&InRegs,&OutRegs); /* ;an000; */
662 /* ;an000; */
663 FP_SEG(PSPptr) = OutRegs.x.bx; /* PSP segment */ /* ;an000; */
664 FP_OFF(PSPptr) = 0; /* offset 0 */ /* ;an000; */
665
666/* Get total memory in system */ /* ;an000; */
667 int86(MEMORY_DET,&InRegs,&OutRegs); /* ;an000; */
668 /* ;an000; */
669/* Convert to bytes */ /* ;an000; */
670 total_mem = (unsigned long int) OutRegs.x.ax * 1024l; /* ;an000; */
671 avail_mem = total_mem;
672 InRegs.x.bx = 0; /* ;an000; */
673 InRegs.x.ax = 0xc100; /* ;an000; */
674 int86x(0x15, &InRegs, &OutRegs, &SegRegs); /* ;an000; */
675 if (OutRegs.x.cflag == 0) /* ;an000; */
676 { /* ;an000; */
677 FP_SEG(CarvedPtr) = SegRegs.es; /* ;an000; */
678 FP_OFF(CarvedPtr) = 0; /* ;an000; */
679 total_mem = total_mem + ( (unsigned long int) (*CarvedPtr) * 1024l) ; /* ;an002; dms;adjust total for */
680 } /* RAM carve value */
681 /* ;an000; */
682 Sub1_Message(TotalMemoryMsg,STDOUT,Utility_Msg_Class,&total_mem); /* ;an000; */
683 /* ;an000; */
684 Sub1_Message(AvailableMemoryMsg,STDOUT,Utility_Msg_Class,&avail_mem); /* ;an000; */
685 /* ;an000; */
686/* Calculate the total memory used. PSP segment * 16. Subtract from total to get free_mem */ /* ;an000; */
687 free_mem = (DOS_TopOfMemory * 16l) - (FP_SEG(PSPptr)*16l); /* ;an000;ac005; */
688 /* ;an000; */
689 Sub1_Message(FreeMemoryMsg,STDOUT,Utility_Msg_Class,&free_mem); /* ;an000; */
690 /* ;an000; */
691 /* ;an000; */
692 /* ;an000; */
693 return; /* ;an000; */
694 /* ;an000; */
695 } /* end of display_low_total */ /* ;an000; */
696 /* ;an000; */
697 /* ;an000; */
698/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
699 /* ;an000; */
700void DisplayEMSDetail() /* ;an000; */
701 { /* ;an000; */
702 /* ;an000; */
703#define EMSGetHandleName 0x5300 /* get handle name function */ /* ;an000; */
704#define EMSGetHandlePages 0x4c00 /* get handle name function */ /* ;an000; */
705#define EMSCODE_83 0x83 /* handle not found error */ /* ;an000; */
706#define EMSMaxHandles 256 /* max number handles */ /* ;an000; */
707 /* ;an000; */
708 int HandleIndex; /* used to step through handles */ /* ;an000; */
709 char HandleName[9]; /* save area for handle name */ /* ;an000; */
710 unsigned long int HandleMem; /* memory associated w/handle */ /* ;an000; */
711 char TitlesPrinted = FALSE; /* flag for printing titles */ /* ;an000; */
712 /* ;an000; */
713 HandleName[0] = NUL; /* initialize the array */ /* ;an000; */
714 /* ;an000; */
715 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */
716 /* ;an000; */
717 segread(&SegRegs); /* ;an000; */
718 /* ;an000; */
719 SegRegs.es = SegRegs.ds; /* ;an000; */
720 /* ;an000; */
721 for (HandleIndex = 0; HandleIndex < EMSMaxHandles; HandleIndex++) /* ;an000; */
722 { /* ;an000; */
723 /* ;an000; */
724 InRegs.x.ax = EMSGetHandleName; /* get handle name */ /* ;an000; */
725 InRegs.x.dx = HandleIndex; /* handle in question */ /* ;an000; */
726 InRegs.x.di = (unsigned int) HandleName; /* point to handle name */ /* ;an000; */
727 int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */
728 /* ;an000; */
729 HandleName[8] = NUL; /* make sure terminated w/nul */ /* ;an000; */
730 /* ;an000; */
731 if (OutRegs.h.ah != EMSCODE_83) /* ;an000; */
732 { /* ;an000; */
733 InRegs.x.ax = EMSGetHandlePages; /* get pages assoc w/this handle */ /* ;an000; */
734 InRegs.x.dx = HandleIndex; /* ;an000; */
735 int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */
736 HandleMem = OutRegs.x.bx; /* ;an000; */
737 HandleMem *= (long) (16l*1024l); /* ;an000; */
738 /* ;an000; */
739 if (!TitlesPrinted) /* ;an000; */
740 { /* ;an000; */
741 Sub0_Message(Title3Msg,STDOUT,Utility_Msg_Class); /* ;an000; */
742 Sub0_Message(Title4Msg,STDOUT,Utility_Msg_Class); /* ;an000; */
743 TitlesPrinted = TRUE; /* ;an000; */
744 } /* ;an000; */
745 /* ;an000; */
746 if (HandleName[0] == NUL) strcpy(HandleName," "); /* ;an000; */
747 EMSPrint(HandleMsg, /* ;an000; */
748 STDOUT, /* ;an000; */
749 Utility_Msg_Class, /* ;an000; */
750 &HandleIndex, /* ;an000; */
751 HandleName, /* ;an000; */
752 &HandleMem); /* ;an000; */
753 } /* ;an000; */
754 /* ;an000; */
755 } /* end for (HandleIndex = 0; HandleIndex < EMSMaxHandles;HandleIndex++) */ /* ;an000; */
756 /* ;an000; */
757 return; /* ;an000; */
758 /* ;an000; */
759 } /* end of DisplayEMSDetail */ /* ;an000; */
760 /* ;an000; */
761 /* ;an000; */
762 /* ;an000; */
763/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
764 /* ;an000; */
765void DisplayExtendedSummary() /* ;an000; */
766 { /* ;an000; */
767 /* ;an000; */
768 unsigned long int EXTMemoryTot; /* ;an000; */
769 /* ;an000; */
770 InRegs.h.ah = (unsigned char) 0x52; /* Get SysVar Pointer ;an001; dms;*/
771 intdosx(&InRegs,&OutRegs,&SegRegs); /* Invoke interrupt ;an001; dms;*/
772 /* ;an000; */
773 FP_SEG(SysVarsPtr) = SegRegs.es; /* put pointer in var ;an001; dms;*/
774 FP_OFF(SysVarsPtr) = OutRegs.x.bx; /* ;an001; dms;*/
775 if ((SysVarsPtr) -> ExtendedMemory != 0) /* extended memory? ;an001; dms;*/
776 { /* yes ;an001; dms;*/
777 EXTMemoryTot = (long) (SysVarsPtr) -> ExtendedMemory; /* get total EM size ;an001; dms;*/
778 EXTMemoryTot *= (long) 1024l; /* at boot time ;an001; dms;*/
779 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* print blank line ;an001; dms;*/
780 Sub1_Message(EXTMemoryMsg,STDOUT,Utility_Msg_Class,&EXTMemoryTot); /* print total EM mem ;an001; dms;*/
781 /* ;an000; */
782 OutRegs.x.cflag = 0; /* clear carry flag ;an001; dms;*/
783 InRegs.x.ax = GetExtended; /* get extended mem ;an001; dms;*/
784 /* available */
785 int86(CASSETTE, &InRegs, &OutRegs); /* INT 15h call ;an001; dms;*/
786
787 EXTMemoryTot = (long) OutRegs.x.ax; /* returns 1K mem blocks;an001; dms;*/
788 EXTMemoryTot *= (long) 1024l; /* convert to bytes ;an001; dms;*/
789
790 Sub1_Message(EXTMemAvlMsg,STDOUT,Utility_Msg_Class,&EXTMemoryTot); /* display available ;an001; dms;*/
791 }
792
793 /* ;an000; */
794 return; /* ;an000; */
795 /* ;an000; */
796 } /* end of DisplayExtendedSummary */ /* ;an000; */
797 /* ;an000; */
798 /* ;an000; */
799 /* ;an000; */
800 /* ;an000; */
801 /* ;an000; */
802/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
803 /* ;an000; */
804void DisplayEMSSummary() /* ;an000; */
805 { /* ;an000; */
806 /* ;an000; */
807 unsigned long int EMSFreeMemoryTot; /* ;an000; */
808 unsigned long int EMSAvailMemoryTot; /* ;an000; */
809 /* ;an000; */
810 Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */
811 /* ;an000; */
812 InRegs.x.ax = EMSGetFreePgs; /* get total number unallocated pages */ /* ;an000; */
813 int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */
814 /* ;an000; */
815 EMSFreeMemoryTot = OutRegs.x.bx; /* total unallocated pages in BX */ /* ;an000; */
816 EMSFreeMemoryTot *= (long) (16l*1024l); /* ;an000; */
817 /* ;an000; */
818 EMSAvailMemoryTot = OutRegs.x.dx; /* total pages */ /* ;an000; */
819 EMSAvailMemoryTot *= (long) (16l*1024l); /* ;an000; */
820 /* ;an000; */
821 Sub1_Message(EMSTotalMemoryMsg,STDOUT,Utility_Msg_Class,&EMSAvailMemoryTot); /* ;an000; */
822 Sub1_Message(EMSFreeMemoryMsg,STDOUT,Utility_Msg_Class,&EMSFreeMemoryTot); /* ;an000; */
823 /* ;an000; */
824 return; /* ;an000; */
825 /* ;an000; */
826 } /* end of DisplayEMSSummary */ /* ;an000; */
827 /* ;an000; */
828 /* ;an000; */
829/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
830 /* ;an000; */
831 /* ;an000; */
832char EMSInstalled() /* ;an000; */
833 { /* ;an000; */
834 /* ;an000; */
835 unsigned int EMSStatus; /* ;an000; */
836 unsigned int EMSVersion; /* ;an000; */
837 char ReturnFlag; /* ;an000; */
838 /* ;an000; */
839 if (EMSInstalledFlag == 2) /* ;an000; */
840 { /* ;an000; */
841 EMSInstalledFlag = FALSE; /* ;an000; */
842 InRegs.h.ah = GET_VECT; /* get int 67 vector */ /* ;an000; */
843 InRegs.h.al = EMS; /* ;an000; */
844 intdosx(&InRegs,&OutRegs,&SegRegs); /* ;an000; */
845 /* ;an000; */
846 /* only want to try this if vector is non-zero */ /* ;an000; */
847 /* ;an000; */
848 /* ;an000; */
849 if ((SegRegs.es != 0) && (OutRegs.x.bx != 0)) /* ;an000; */
850 { /* ;an000; */
851 InRegs.x.ax = EMSGetStat; /* get EMS status */ /* ;an000; */
852 int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */
853 EMSStatus = OutRegs.h.ah; /* EMS status returned in AH */ /* ;an000; */
854 /* ;an000; */
855 InRegs.x.ax = EMSGetVer; /* get EMS version */ /* ;an000; */
856 int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */
857 EMSVersion = OutRegs.h.al; /* EMS version returned in AL */ /* ;an000; */
858 /* ;an000; */
859 if ((EMSStatus == 0) && (EMSVersion >= DOSEMSVER)) /* ;an000; */
860 EMSInstalledFlag = TRUE; /* ;an000; */
861 else /* ;an000; */
862 EMSInstalledFlag = FALSE; /* ;an000; */
863 /* ;an000; */
864 } /* end ((SegRegs.es != 0) && (OutRegs.x.bx != 0)) */ /* ;an000; */
865 /* ;an000; */
866 } /* end if (EMSInstalledFlag == 2) */ /* ;an000; */
867 /* ;an000; */
868 /* ;an000; */
869 return(EMSInstalledFlag); /* ;an000; */
870 /* ;an000; */
871 /* ;an000; */
872 } /* ;an000; */
873 /* ;an000; */
874 /* ;an000; */
875/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
876 /* ;an000; */
877 /* ;an000; */
878char *OwnerOf(ArenaPtr) /* ;an000; */
879struct ARENA far *ArenaPtr; /* ;an000; */
880{ /* ;an000; */
881 /* ;an000; */
882 char far *StringPtr; /* ;an000; */
883 unsigned far *WordPtr; /* ;an000; */
884 char *o; /* ;an000; */
885 unsigned far *EnvironmentSegmentPtr; /* ;an000; */
886 unsigned PspSegment; /* ;an000; */
887 int i; /* ;an000; */
888 /* ;an000; */
889 o = &OwnerName[0]; /* ;an000; */
890 *o = NUL; /* ;an000; */
891 sprintf(o,UnOwned); /* ;an000; */
892 /* ;an000; */
893 PspSegment = ArenaPtr -> Owner; /* ;an000; */
894 /* ;an000; */
895 /* ;an000; */
896 if (PspSegment == 0) sprintf(o,Ibmdos); /* ;an000; */
897 else if (PspSegment == 8) sprintf(o,Ibmbio); /* ;an000; */
898 else { /* ;an000; */
899 FP_SEG(ArenaPtr) = PspSegment-1; /* -1 'cause Arena is 16 bytes before PSP */ /* ;an000; */
900 StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]); /* ;an000; */
901 for (i = 0; i < 8; i++) *o++ = *StringPtr++; /* ;an000; */
902 *o = (char) '\0'; /* ;an000; */
903 } /* ;an000; */
904 /* ;an000; */
905 if (UseArgvZero) GetFromArgvZero(PspSegment,EnvironmentSegmentPtr); /* ;an000; */
906 /* ;an000; */
907 return(&OwnerName[0]); /* ;an000; */
908 /* ;an000; */
909 } /* ;an000; */
910 /* ;an000; */
911 /* ;an000; */
912/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
913 /* ;an000; */
914void GetFromArgvZero(PspSegment,EnvironmentSegmentPtr) /* ;an000; */
915unsigned PspSegment; /* ;an000; */
916unsigned far *EnvironmentSegmentPtr; /* ;an000; */
917{ /* ;an000; */
918 /* ;an000; */
919 char far *StringPtr; /* ;an000; */
920 char *OutputPtr; /* ;an000; */
921 unsigned far *WordPtr; /* ;an000; */
922 /* ;an000; */
923 OutputPtr = &OwnerName[0]; /* ;an000; */
924 /* ;an000; */
925 if (UseArgvZero) /* ;an000; */
926 { /* ;an000; */
927 if (PspSegment < FP_SEG(ArenaHeadPtr)) /* ;an000; */
928 { /* ;an000; */
929 if (*OutputPtr == NUL) sprintf(OutputPtr,Ibmdos); /* ;an000; */
930 } /* ;an000; */
931 else { /* ;an000; */
932 FP_SEG(EnvironmentSegmentPtr) = PspSegment; /* ;an000; */
933 FP_OFF(EnvironmentSegmentPtr) = 44; /* ;an000; */
934 /* ;an000; */
935/* FP_SEG(StringPtr) = *EnvironmentSegmentPtr; */ /* ;an000; */
936 FP_SEG(StringPtr) = FP_SEG(EnvironmentSegmentPtr); /* ;an000; */
937 FP_OFF(StringPtr) = 0; /* ;an000; */
938 /* ;an000; */
939 while ( (*StringPtr != NUL) || (*(StringPtr+1) != NUL) ) StringPtr++; /* ;an000; */
940 /* ;an000; */
941 StringPtr += 2; /* ;an000; */
942 WordPtr = (unsigned far *) StringPtr; /* ;an000; */
943 /* ;an000; */
944 if (*WordPtr == 1) /* ;an000; */
945 { /* ;an000; */
946 StringPtr += 2; /* ;an000; */
947 while (*StringPtr != NUL) /* ;an000; */
948 *OutputPtr++ = *StringPtr++; /* ;an000; */
949 *OutputPtr++ = NUL; /* ;an000; */
950 /* ;an000; */
951 while ( OutputPtr > &OwnerName[0] ) /* ;an000; */
952 { if (*OutputPtr == (char) '.') *OutputPtr = NUL; /* ;an000; */
953 if ( (*OutputPtr == (char) '\\') || (*OutputPtr == (char) ':') ) /* ;an000; */
954 { OutputPtr++; /* ;an000; */
955 break; /* ;an000; */
956 } /* ;an000; */
957 OutputPtr--; /* ;an000; */
958 } /* ;an000; */
959 /* ;an000; */
960 } /* ;an000; */
961 /* ;an000; */
962 } /* ;an000; */
963 } /* ;an000; */
964 /* ;an000; */
965 strcpy(&OwnerName[0],OutputPtr); /* ;an000; */
966 /* ;an000; */
967 return; /* ;an000; */
968 /* ;an000; */
969 } /* ;an000; */
970 /* ;an000; */
971 /* ;an000; */
972/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
973 /* ;an000; */
974
975char *TypeOf(Header) /* ;an000; */
976struct ARENA far *Header; /* ;an000; */
977{ /* ;an000; */
978 /* ;an000; */
979 char *t; /* ;an000; */
980 unsigned PspSegment; /* ;an000; */
981 unsigned far *EnvironmentSegmentPtr; /* ;an000; */
982 unsigned int Message_Number;
983 char far *Message_Buf;
984 unsigned int i;
985 /* ;an000; */
986 t = &TypeText[0]; /* ;an000; */
987 *t = NUL; /* ;an000; */
988 /* ;an000; */
989 Message_Number = 0xff; /* ;an000; initialize number value */
990 if (Header -> Owner == 8) Message_Number = StackMsg; /* ;an000; */
991 if (Header -> Owner == 0) Message_Number = FreeMsg; /* ;an000; */
992 /* ;an000; */
993 PspSegment = Header -> Owner; /* ;an000; */
994 if (PspSegment < FP_SEG(ArenaHeadPtr)) /* ;an000; */
995 { /* ;an000; */
996 if (Message_Number == 0xff) Message_Number = BlankMsg;
997 } /* ;an000; */
998 else { /* ;an000; */
999 FP_SEG(EnvironmentSegmentPtr) = PspSegment; /* ;an000; */
1000 FP_OFF(EnvironmentSegmentPtr) = 44; /* ;an000; */
1001 /* ;an000; */
1002 /* ;an000; */
1003 if (PspSegment == FP_SEG(Header)+1)
1004 Message_Number = ProgramMsg;
1005 else if ( *EnvironmentSegmentPtr == FP_SEG(Header)+1 )
1006 Message_Number = EnvironMsg;
1007 else
1008 Message_Number = DataMsg;
1009
1010 }
1011
1012 InRegs.x.ax = Message_Number; /* ;an000; */
1013 InRegs.h.dh = Utility_Msg_Class; /* ;an000; */
1014 sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */
1015
1016 FP_OFF(Message_Buf) = OutRegs.x.si; /* ;an000; */
1017 FP_SEG(Message_Buf) = SegRegs.ds; /* ;an000; */
1018
1019 i = 0;
1020 while ( *Message_Buf != (char) '\x0' )
1021 TypeText[i++] = *Message_Buf++;
1022 TypeText[i++] = '\x0';
1023
1024 /* ;an000; */
1025 return(t); /* ;an000; */
1026 /* ;an000; */
1027 } /* ;an000; */
1028 /* ;an000; */
1029 /* ;an000; */
1030/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
1031 /* ;an000; */
1032unsigned long AddressOf(Pointer) /* ;an000; */
1033char far *Pointer; /* ;an000; */
1034{ /* ;an000; */
1035 /* ;an000; */
1036 unsigned long SegmentAddress,OffsetAddress; /* ;an000; */
1037 /* ;an000; */
1038 SegmentAddress = (unsigned long) (FP_SEG(Pointer)) * 16l; /* ;an000; */
1039 OffsetAddress = (unsigned long) (FP_OFF(Pointer)); /* ;an000; */
1040 /* ;an000; */
1041 return( SegmentAddress + OffsetAddress); /* ;an000; */
1042 /* ;an000; */
1043 } /* ;an000; */
1044 /* ;an000; */
1045/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */
1046 /* ;an000; */
1047 /* ;an000; */
1048/************************************************************************/ /* ;an000; */
1049/* SUB0_MESSAGE - This routine will print only those */ /* ;an000; */
1050/* messages that do not require a */ /* ;an000; */
1051/* a sublist. */ /* ;an000; */
1052/* */ /* ;an000; */
1053/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */
1054/* Handle - display type */ /* ;an000; */
1055/* Message_Type - type of message to display */ /* ;an000; */
1056/* */ /* ;an000; */
1057/* Outputs : message */ /* ;an000; */
1058/* */ /* ;an000; */
1059/************************************************************************/ /* ;an000; */
1060 /* ;an000; */
1061void Sub0_Message(Msg_Num,Handle,Message_Type) /* print messages with no subs */ /* ;an000; */
1062 /* ;an000; */
1063int Msg_Num; /* ;an000; */
1064int Handle; /* ;an000; */
1065unsigned char Message_Type; /* ;an000; */
1066 /* extended, parse, or utility */ /* ;an000; */
1067 { /* ;an000; */
1068 InRegs.x.ax = Msg_Num; /* put message number in AX */ /* ;an000; */
1069 InRegs.x.bx = Handle; /* put handle in BX */ /* ;an000; */
1070 InRegs.x.cx = No_Replace; /* no replaceable subparms */ /* ;an000; */
1071 InRegs.h.dl = No_Input; /* no keyboard input */ /* ;an000; */
1072 InRegs.h.dh = Message_Type; /* type of message to display */ /* ;an000; */
1073 sysdispmsg(&InRegs,&OutRegs); /* display the message */ /* ;an000; */
1074 /* ;an000; */
1075 return; /* ;an000; */
1076 } /* ;an000; */
1077 /* ;an000; */
1078 /* ;an000; */
1079/************************************************************************/ /* ;an000; */
1080/* SUB1_MESSAGE - This routine will print only those */ /* ;an000; */
1081/* messages that require 1 replaceable */ /* ;an000; */
1082/* parm. */ /* ;an000; */
1083/* */ /* ;an000; */
1084/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */
1085/* Handle - display type */ /* ;an000; */
1086/* Message_Type - type of message to display */ /* ;an000; */
1087/* Replace_Parm - pointer to parm to replace */ /* ;an000; */
1088/* */ /* ;an000; */
1089/* Outputs : message */ /* ;an000; */
1090/* */ /* ;an000; */
1091/************************************************************************/ /* ;an000; */
1092 /* ;an000; */
1093void Sub1_Message(Msg_Num,Handle,Message_Type,Replace_Parm) /* ;an000; */
1094 /* ;an000; */
1095int Msg_Num; /* ;an000; */
1096int Handle; /* ;an000; */
1097unsigned char Message_Type; /* ;an000; */
1098 /* extended, parse, or utility */ /* ;an000; */
1099unsigned long int *Replace_Parm; /* pointer to message to print */ /* ;an000; */
1100 /* ;an000; */
1101{ /* ;an000; */
1102 /* ;an000; */
1103 /* ;an000; */
1104 { /* ;an000; */
1105 /* ;an000; */
1106 sublist[1].value = (unsigned far *)Replace_Parm; /* ;an000; */
1107 sublist[1].size = Sublist_Length; /* ;an000; */
1108 sublist[1].reserved = Reserved; /* ;an000; */
1109 sublist[1].id = 1; /* ;an000; */
1110 sublist[1].flags = Unsgn_Bin_DWord+Right_Align; /* ;an000; */
1111 sublist[1].max_width = 10; /* ;an000; */
1112 sublist[1].min_width = 10; /* ;an000; */
1113 sublist[1].pad_char = Blank; /* ;an000; */
1114 /* ;an000; */
1115 InRegs.x.ax = Msg_Num; /* ;an000; */
1116 InRegs.x.bx = Handle; /* ;an000; */
1117 InRegs.x.cx = SubCnt1; /* ;an000; */
1118 InRegs.h.dl = No_Input; /* ;an000; */
1119 InRegs.h.dh = Message_Type; /* ;an000; */
1120 InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */
1121 sysdispmsg(&InRegs,&OutRegs); /* ;an000; */
1122 } /* ;an000; */
1123 return; /* ;an000; */
1124} /* ;an000; */
1125 /* ;an000; */
1126 /* ;an000; */
1127/************************************************************************/ /* ;an000; */
1128/* SUB2_MESSAGE - This routine will print only those */ /* ;an000; */
1129/* messages that require 2 replaceable */ /* ;an000; */
1130/* parms. */ /* ;an000; */
1131/* */ /* ;an000; */
1132/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */
1133/* Handle - display type */ /* ;an000; */
1134/* Message_Type - type of message to display */ /* ;an000; */
1135/* Replace_Parm1 - pointer to parm to replace */ /* ;an000; */
1136/* Replace_Parm2 - pointer to parm to replace */ /* ;an000; */
1137/* Replace_Parm3 - pointer to parm to replace */ /* ;an000; */
1138/* */ /* ;an000; */
1139/* Outputs : message */ /* ;an000; */
1140/* */ /* ;an000; */
1141/************************************************************************/ /* ;an000; */
1142 /* ;an000; */
1143void Sub2_Message(Msg_Num,Handle,Message_Type, /* ;an000; */
1144 Replace_Parm1, /* ;an000; */
1145 Replace_Message1) /* ;an000; */
1146 /* ;an000; */
1147int Msg_Num; /* ;an000; */
1148int Handle; /* ;an000; */
1149unsigned char Message_Type; /* ;an000; */
1150int Replace_Message1; /* ;an000; */
1151 /* extended, parse, or utility */ /* ;an000; */
1152char *Replace_Parm1; /* pointer to message to print */ /* ;an000; */
1153{ /* ;an000; */
1154 /* ;an000; */
1155 /* ;an000; */
1156 { /* ;an000; */
1157 switch(Msg_Num) /* ;an000; */
1158 { /* ;an000; */
1159 case DeviceLineMsg: /* ;an000; */
1160 /* ;an000; */
1161 sublist[1].value = (unsigned far *)Replace_Parm1; /* ;an000; */
1162 sublist[1].size = Sublist_Length; /* ;an000; */
1163 sublist[1].reserved = Reserved; /* ;an000; */
1164 sublist[1].id = 1; /* ;an000; */
1165 sublist[1].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1166 sublist[1].max_width = 0x0008; /* ;an000; */
1167 sublist[1].min_width = 0x0008; /* ;an000; */
1168 sublist[1].pad_char = Blank; /* ;an000; */
1169 /* ;an000; */
1170 InRegs.x.ax = Replace_Message1; /* ;an000; */
1171 InRegs.h.dh = Message_Type; /* ;an000; */
1172 sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */
1173 /* ;an000; */
1174 FP_OFF(sublist[2].value) = OutRegs.x.si; /* ;an000; */
1175 FP_SEG(sublist[2].value) = SegRegs.ds; /* ;an000; */
1176 sublist[2].size = Sublist_Length; /* ;an000; */
1177 sublist[2].reserved = Reserved; /* ;an000; */
1178 sublist[2].id = 2; /* ;an000; */
1179 sublist[2].flags = Char_Field_ASCIIZ+Right_Align; /* ;an000; */
1180 sublist[2].max_width = 00; /* ;an000; */
1181 sublist[2].min_width = 10; /* ;an000; */
1182 sublist[2].pad_char = Blank; /* ;an000; */
1183 break; /* ;an000; */
1184 } /* ;an000; */
1185 /* ;an000; */
1186 InRegs.x.ax = Msg_Num; /* ;an000; */
1187 InRegs.x.bx = Handle; /* ;an000; */
1188 InRegs.x.cx = SubCnt2; /* ;an000; */
1189 InRegs.h.dl = No_Input; /* ;an000; */
1190 InRegs.h.dh = Message_Type; /* ;an000; */
1191 InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */
1192 sysdispmsg(&InRegs,&OutRegs); /* ;an000; */
1193 } /* ;an000; */
1194 return; /* ;an000; */
1195} /* ;an000; */
1196 /* ;an000; */
1197/************************************************************************/ /* ;an000; */
1198/* SUB3_MESSAGE - This routine will print only those */ /* ;an000; */
1199/* messages that require 3 replaceable */ /* ;an000; */
1200/* parms. */ /* ;an000; */
1201/* */ /* ;an000; */
1202/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */
1203/* Handle - display type */ /* ;an000; */
1204/* Message_Type - type of message to display */ /* ;an000; */
1205/* Replace_Parm1 - pointer to parm to replace */ /* ;an000; */
1206/* Replace_Parm2 - pointer to parm to replace */ /* ;an000; */
1207/* Replace_Parm3 - pointer to parm to replace */ /* ;an000; */
1208/* */ /* ;an000; */
1209/* Outputs : message */ /* ;an000; */
1210/* */ /* ;an000; */
1211/************************************************************************/ /* ;an000; */
1212 /* ;an000; */
1213void Sub3_Message(Msg_Num,Handle,Message_Type, /* ;an000; */
1214 Replace_Parm1, /* ;an000; */
1215 Replace_Parm2, /* ;an000; */
1216 Replace_Message1) /* ;an000; */
1217 /* ;an000; */
1218int Msg_Num; /* ;an000; */
1219int Handle; /* ;an000; */
1220unsigned char Message_Type; /* ;an000; */
1221char *Replace_Parm1; /* ;an000; */
1222unsigned long int *Replace_Parm2; /* ;an000; */
1223int Replace_Message1; /* ;an000; */
1224 /* extended, parse, or utility */ /* ;an000; */
1225{ /* ;an000; */
1226 /* ;an000; */
1227 /* ;an000; */
1228 { /* ;an000; */
1229 switch(Msg_Num) /* ;an000; */
1230 { /* ;an000; */
1231 case DriverLineMsg: /* ;an000; */
1232 /* ;an000; */
1233 sublist[1].value = (unsigned far *)Replace_Parm1; /* ;an000; */
1234 sublist[1].size = Sublist_Length; /* ;an000; */
1235 sublist[1].reserved = Reserved; /* ;an000; */
1236 sublist[1].id = 1; /* ;an000; */
1237 sublist[1].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1238 sublist[1].max_width = 0x0008; /* ;an000; */
1239 sublist[1].min_width = 0x0008; /* ;an000; */
1240 sublist[1].pad_char = Blank; /* ;an000; */
1241 /* ;an000; */
1242 sublist[2].value = (unsigned far *)Replace_Parm2; /* ;an000; */
1243 sublist[2].size = Sublist_Length; /* ;an000; */
1244 sublist[2].reserved = Reserved; /* ;an000; */
1245 sublist[2].id = 2; /* ;an000; */
1246 sublist[2].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */
1247 sublist[2].max_width = 0x0006; /* ;an000; */
1248 sublist[2].min_width = 0x0006; /* ;an000; */
1249 sublist[2].pad_char = 0x0030; /* ;an000; */
1250 /* ;an000; */
1251 InRegs.x.ax = Replace_Message1; /* ;an000; */
1252 InRegs.h.dh = Message_Type; /* ;an000; */
1253 sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */
1254 /* ;an000; */
1255 FP_OFF(sublist[3].value) = OutRegs.x.si; /* ;an000; */
1256 FP_SEG(sublist[3].value) = SegRegs.ds; /* ;an000; */
1257 sublist[3].size = Sublist_Length; /* ;an000; */
1258 sublist[3].reserved = Reserved; /* ;an000; */
1259 sublist[3].id = 3; /* ;an000; */
1260 sublist[3].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1261 sublist[3].max_width = 00; /* ;an000; */
1262 sublist[3].min_width = 10; /* ;an000; */
1263 sublist[3].pad_char = Blank; /* ;an000; */
1264 break; /* ;an000; */
1265 /* ;an000; */
1266 case HandleMsg: /* ;an000; */
1267 sublist[1].value = (unsigned far *)Replace_Parm1; /* ;an000; */
1268 sublist[1].size = Sublist_Length; /* ;an000; */
1269 sublist[1].reserved = Reserved; /* ;an000; */
1270 sublist[1].id = 1; /* ;an000; */
1271 sublist[1].flags = Unsgn_Bin_Byte+Right_Align; /* ;an000; */
1272 sublist[1].max_width = 0x0009; /* ;an000; */
1273 sublist[1].min_width = 0x0009; /* ;an000; */
1274 sublist[1].pad_char = Blank; /* ;an000; */
1275 /* ;an000; */
1276 sublist[2].value = (unsigned far *)Replace_Parm2; /* ;an000; */
1277 sublist[2].size = Sublist_Length; /* ;an000; */
1278 sublist[2].reserved = Reserved; /* ;an000; */
1279 sublist[2].id = 2; /* ;an000; */
1280 sublist[2].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1281 sublist[2].max_width = 0x0008; /* ;an000; */
1282 sublist[2].min_width = 0x0008; /* ;an000; */
1283 sublist[2].pad_char = Blank; /* ;an000; */
1284 /* ;an000; */
1285 InRegs.x.ax = Replace_Message1; /* ;an000; */
1286 InRegs.h.dh = Message_Type; /* ;an000; */
1287 sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */
1288 /* ;an000; */
1289 FP_OFF(sublist[3].value) = OutRegs.x.si; /* ;an000; */
1290 FP_SEG(sublist[3].value) = SegRegs.ds; /* ;an000; */
1291 sublist[3].size = Sublist_Length; /* ;an000; */
1292 sublist[3].reserved = Reserved; /* ;an000; */
1293 sublist[3].id = 3; /* ;an000; */
1294 sublist[3].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */
1295 sublist[3].max_width = 00; /* ;an000; */
1296 sublist[3].min_width = 10; /* ;an000; */
1297 sublist[3].pad_char = Blank; /* ;an000; */
1298 break; /* ;an000; */
1299 /* ;an000; */
1300 } /* ;an000; */
1301 /* ;an000; */
1302 InRegs.x.ax = Msg_Num; /* ;an000; */
1303 InRegs.x.bx = Handle; /* ;an000; */
1304 InRegs.x.cx = SubCnt3; /* ;an000; */
1305 InRegs.h.dl = No_Input; /* ;an000; */
1306 InRegs.h.dh = Message_Type; /* ;an000; */
1307 InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */
1308 sysdispmsg(&InRegs,&OutRegs); /* ;an000; */
1309 } /* ;an000; */
1310 return; /* ;an000; */
1311} /* ;an000; */
1312 /* ;an000; */
1313 /* ;an000; */
1314/************************************************************************/ /* ;an000; */
1315/* SUB4_MESSAGE - This routine will print only those */ /* ;an000; */
1316/* messages that require 4 replaceable */ /* ;an000; */
1317/* parms. */ /* ;an000; */
1318/* */ /* ;an000; */
1319/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */
1320/* Handle - display type */ /* ;an000; */
1321/* Message_Type - type of message to display */ /* ;an000; */
1322/* Replace_Parm1 - pointer to parm to replace */ /* ;an000; */
1323/* Replace_Parm2 - pointer to parm to replace */ /* ;an000; */
1324/* Replace_Parm3 - pointer to parm to replace */ /* ;an000; */
1325/* Dynamic_Parm - parm number to use as replaceable */ /* ;an000; */
1326/* */ /* ;an000; */
1327/* Outputs : message */ /* ;an000; */
1328/* */ /* ;an000; */
1329/************************************************************************/ /* ;an000; */
1330 /* ;an000; */
1331void Sub4_Message(Msg_Num,Handle,Message_Type, /* ;an000; */
1332 Replace_Value1, /* ;an000; */
1333 Replace_Message1, /* ;an000; */
1334 Replace_Value2, /* ;an000; */
1335 Replace_Message2) /* ;an000; */
1336 /* ;an000; */
1337int Msg_Num; /* ;an000; */
1338int Handle; /* ;an000; */
1339unsigned char Message_Type; /* ;an000; */
1340unsigned long int *Replace_Value1; /* ;an000; */
1341int Replace_Message1; /* ;an000; */
1342unsigned long int *Replace_Value2; /* ;an000; */
1343int Replace_Message2; /* ;an000; */
1344 /* extended, parse, or utility */ /* ;an000; */
1345{ /* ;an000; */
1346 /* ;an000; */
1347 /* ;an000; */
1348 { /* ;an000; */
1349 switch(Msg_Num) /* ;an000; */
1350 { /* ;an000; */
1351 case MainLineMsg: /* ;an000; */
1352 /* ;an000; */
1353 sublist[1].value = (unsigned far *)Replace_Value1; /* ;an000; */
1354 sublist[1].size = Sublist_Length; /* ;an000; */
1355 sublist[1].reserved = Reserved; /* ;an000; */
1356 sublist[1].id = 1; /* ;an000; */
1357 sublist[1].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */
1358 sublist[1].max_width = 06; /* ;an000; */
1359 sublist[1].min_width = 06; /* ;an000; */
1360 sublist[1].pad_char = 0x0030; /* ;an000; */
1361 /* ;an000; */
1362 InRegs.x.ax = Replace_Message1; /* ;an000; */
1363 InRegs.h.dh = Message_Type; /* ;an000; */
1364 sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */
1365 /* ;an000; */
1366 FP_OFF(sublist[2].value) = OutRegs.x.si; /* ;an000; */
1367 FP_SEG(sublist[2].value) = SegRegs.ds; /* ;an000; */
1368 sublist[2].size = Sublist_Length; /* ;an000; */
1369 sublist[2].reserved = Reserved; /* ;an000; */
1370 sublist[2].id = 2; /* ;an000; */
1371 sublist[2].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1372 sublist[2].max_width = 0x0008; /* ;an000; */
1373 sublist[2].min_width = 0x0008; /* ;an000; */
1374 sublist[2].pad_char = Blank; /* ;an000; */
1375 /* ;an000; */
1376 sublist[3].value = (unsigned far *)Replace_Value2; /* ;an000; */
1377 sublist[3].size = Sublist_Length; /* ;an000; */
1378 sublist[3].reserved = Reserved; /* ;an000; */
1379 sublist[3].id = 3; /* ;an000; */
1380 sublist[3].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */
1381 sublist[3].max_width = 06; /* ;an000; */
1382 sublist[3].min_width = 06; /* ;an000; */
1383 sublist[3].pad_char = 0x0030; /* ;an000; */
1384 /* ;an000; */
1385 InRegs.x.ax = Replace_Message2; /* ;an000; */
1386 InRegs.h.dh = Message_Type; /* ;an000; */
1387 sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */
1388 /* ;an000; */
1389 FP_OFF(sublist[4].value) = OutRegs.x.si; /* ;an000; */
1390 FP_SEG(sublist[4].value) = SegRegs.ds; /* ;an000; */
1391 sublist[4].size = Sublist_Length; /* ;an000; */
1392 sublist[4].reserved = Reserved; /* ;an000; */
1393 sublist[4].id = 4; /* ;an000; */
1394 sublist[4].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1395 sublist[4].max_width = 0; /* ;an000; */
1396 sublist[4].min_width = 10; /* ;an000; */
1397 sublist[4].pad_char = Blank; /* ;an000; */
1398 break; /* ;an000; */
1399 } /* ;an000; */
1400 /* ;an000; */
1401 InRegs.x.ax = Msg_Num; /* ;an000; */
1402 InRegs.x.bx = Handle; /* ;an000; */
1403 InRegs.x.cx = SubCnt4; /* ;an000; */
1404 InRegs.h.dl = No_Input; /* ;an000; */
1405 InRegs.h.dh = Message_Type; /* ;an000; */
1406 InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */
1407 sysdispmsg(&InRegs,&OutRegs); /* ;an000; */
1408 } /* ;an000; */
1409 return; /* ;an000; */
1410} /* ;an000; */
1411 /* ;an000; */
1412 /* ;an000; */
1413 /* ;an000; */
1414/************************************************************************/ /* ;an000; */
1415/* SUB4a_MESSAGE - This routine will print only those */ /* ;an000; */
1416/* messages that require 4 replaceable */ /* ;an000; */
1417/* parms. */ /* ;an000; */
1418/* */ /* ;an000; */
1419/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */
1420/* Handle - display type */ /* ;an000; */
1421/* Message_Type - type of message to display */ /* ;an000; */
1422/* Replace_Parm1 - pointer to parm to replace */ /* ;an000; */
1423/* Replace_Parm2 - pointer to parm to replace */ /* ;an000; */
1424/* Replace_Parm3 - pointer to parm to replace */ /* ;an000; */
1425/* Dynamic_Parm - parm number to use as replaceable */ /* ;an000; */
1426/* */ /* ;an000; */
1427/* Outputs : message */ /* ;an000; */
1428/* */ /* ;an000; */
1429/************************************************************************/ /* ;an000; */
1430 /* ;an000; */
1431void Sub4a_Message(Msg_Num,Handle,Message_Type, /* ;an000; */
1432 Replace_Value1, /* ;an000; */
1433 Replace_Message1, /* ;an000; */
1434 Replace_Value2, /* ;an000; */
1435 Replace_Message2) /* ;an000; */
1436 /* ;an000; */
1437int Msg_Num; /* ;an000; */
1438int Handle; /* ;an000; */
1439unsigned char Message_Type; /* ;an000; */
1440unsigned long int *Replace_Value1; /* ;an000; */
1441char *Replace_Message1; /* ;an000; */
1442unsigned long int *Replace_Value2; /* ;an000; */
1443char *Replace_Message2; /* ;an000; */
1444 /* ;an000; */
1445{ /* ;an000; */
1446 /* ;an000; */
1447 /* ;an000; */
1448 { /* ;an000; */
1449 switch(Msg_Num) /* ;an000; */
1450 { /* ;an000; */
1451 case MainLineMsg: /* ;an000; */
1452 /* ;an000; */
1453 sublist[1].value = (unsigned far *)Replace_Value1; /* ;an000; */
1454 sublist[1].size = Sublist_Length; /* ;an000; */
1455 sublist[1].reserved = Reserved; /* ;an000; */
1456 sublist[1].id = 1; /* ;an000; */
1457 sublist[1].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */
1458 sublist[1].max_width = 06; /* ;an000; */
1459 sublist[1].min_width = 06; /* ;an000; */
1460 sublist[1].pad_char = 0x0030; /* ;an000; */
1461 /* ;an000; */
1462 sublist[2].value = (unsigned far *)Replace_Message1; /* ;an000; */
1463 sublist[2].size = Sublist_Length; /* ;an000; */
1464 sublist[2].reserved = Reserved; /* ;an000; */
1465 sublist[2].id = 2; /* ;an000; */
1466 sublist[2].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1467 sublist[2].max_width = 0x0008; /* ;an000; */
1468 sublist[2].min_width = 0x0008; /* ;an000; */
1469 sublist[2].pad_char = Blank; /* ;an000; */
1470 /* ;an000; */
1471 sublist[3].value = (unsigned far *)Replace_Value2; /* ;an000; */
1472 sublist[3].size = Sublist_Length; /* ;an000; */
1473 sublist[3].reserved = Reserved; /* ;an000; */
1474 sublist[3].id = 3; /* ;an000; */
1475 sublist[3].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */
1476 sublist[3].max_width = 06; /* ;an000; */
1477 sublist[3].min_width = 06; /* ;an000; */
1478 sublist[3].pad_char = 0x0030; /* ;an000; */
1479 /* ;an000; */
1480 sublist[4].value = (unsigned far *)Replace_Message2; /* ;an000; */
1481 sublist[4].size = Sublist_Length; /* ;an000; */
1482 sublist[4].reserved = Reserved; /* ;an000; */
1483 sublist[4].id = 4; /* ;an000; */
1484 sublist[4].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1485 sublist[4].max_width = 0; /* ;an000; */
1486 sublist[4].min_width = 10; /* ;an000; */
1487 sublist[4].pad_char = Blank; /* ;an000; */
1488 break; /* ;an000; */
1489 } /* ;an000; */
1490 /* ;an000; */
1491 InRegs.x.ax = Msg_Num; /* ;an000; */
1492 InRegs.x.bx = Handle; /* ;an000; */
1493 InRegs.x.cx = SubCnt4; /* ;an000; */
1494 InRegs.h.dl = No_Input; /* ;an000; */
1495 InRegs.h.dh = Message_Type; /* ;an000; */
1496 InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */
1497 sysdispmsg(&InRegs,&OutRegs); /* ;an000; */
1498 } /* ;an000; */
1499 return; /* ;an000; */
1500} /* ;an000; */
1501 /* ;an000; */
1502 /* ;an000; */
1503/************************************************************************/ /* ;an000; */
1504/* EMSPrint - This routine will print the message */ /* ;an000; */
1505/* necessary for EMS reporting. */ /* ;an000; */
1506/* */ /* ;an000; */
1507/* Outputs : message */ /* ;an000; */
1508/* */ /* ;an000; */
1509/************************************************************************/ /* ;an000; */
1510 /* ;an000; */
1511void EMSPrint(Msg_Num,Handle,Message_Type, /* ;an000; */
1512 Replace_Value1, /* ;an000; */
1513 Replace_Message1, /* ;an000; */
1514 Replace_Value2) /* ;an000; */
1515 /* ;an000; */
1516int Msg_Num; /* ;an000; */
1517int Handle; /* ;an000; */
1518unsigned char Message_Type; /* ;an000; */
1519int *Replace_Value1; /* ;an000; */
1520char *Replace_Message1; /* ;an000; */
1521unsigned long int *Replace_Value2; /* ;an000; */
1522 /* extended, parse, or utility */ /* ;an000; */
1523{ /* ;an000; */
1524 /* ;an000; */
1525 { /* ;an000; */
1526 sublist[1].value = (unsigned far *)Replace_Value1; /* ;an000; */
1527 sublist[1].size = Sublist_Length; /* ;an000; */
1528 sublist[1].reserved = Reserved; /* ;an000; */
1529 sublist[1].id = 1; /* ;an000; */
1530 sublist[1].flags = Unsgn_Bin_Word+Right_Align; /* ;an000; */
1531 sublist[1].max_width = 03; /* ;an000; */
1532 sublist[1].min_width = 03; /* ;an000; */
1533 sublist[1].pad_char = Blank; /* ;an000; */
1534 /* ;an000; */
1535 sublist[2].value = (unsigned far *)Replace_Message1; /* ;an000; */
1536 sublist[2].size = Sublist_Length; /* ;an000; */
1537 sublist[2].reserved = Reserved; /* ;an000; */
1538 sublist[2].id = 2; /* ;an000; */
1539 sublist[2].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */
1540 sublist[2].max_width = 0x0008; /* ;an000; */
1541 sublist[2].min_width = 0x0008; /* ;an000; */
1542 sublist[2].pad_char = Blank; /* ;an000; */
1543 /* ;an000; */
1544 sublist[3].value = (unsigned far *)Replace_Value2; /* ;an000; */
1545 sublist[3].size = Sublist_Length; /* ;an000; */
1546 sublist[3].reserved = Reserved; /* ;an000; */
1547 sublist[3].id = 3; /* ;an000; */
1548 sublist[3].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */
1549 sublist[3].max_width = 06; /* ;an000; */
1550 sublist[3].min_width = 06; /* ;an000; */
1551 sublist[3].pad_char = 0x0030; /* ;an000; */
1552 /* ;an000; */
1553 InRegs.x.ax = Msg_Num; /* ;an000; */
1554 InRegs.x.bx = Handle; /* ;an000; */
1555 InRegs.x.cx = SubCnt3; /* ;an000; */
1556 InRegs.h.dl = No_Input; /* ;an000; */
1557 InRegs.h.dh = Message_Type; /* ;an000; */
1558 InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */
1559 sysdispmsg(&InRegs,&OutRegs); /* ;an000; */
1560 } /* ;an000; */
1561 return; /* ;an000; */
1562} /* ;an000; */
1563 /* ;an000; */
1564/*----------------------------------------------------------------------+
1565| |
1566| SUBROUTINE NAME: PARSE_INIT |
1567| |
1568| SUBROUTINE FUNCTION: |
1569| |
1570| This routine is called by the FILESYS MAIN routine to initialize|
1571| the parser data structures. |
1572| |
1573| INPUT: |
1574| none |
1575| |
1576| OUTPUT: |
1577| properly initialized parser control blocks |
1578| |
1579+----------------------------------------------------------------------*/
1580void parse_init() /* ;an000; */
1581 { /* ;an000; */
1582 p_p.p_parmsx_address = &p_px; /* address of extended parm list */ /* ;an000; */
1583 p_p.p_num_extra = 0; /* ;an000; */
1584 /* ;an000; */
1585 p_px.p_minp = 0; /* ;an000; */
1586 p_px.p_maxp = 0; /* ;an000; */
1587 p_px.p_maxswitch = 2; /* ;an000; */
1588 p_px.p_control[0] = &p_con1; /* ;an000; */
1589 p_px.p_control[1] = &p_con2; /* ;an000; */
1590 p_px.p_keyword = 0; /* ;an000; */
1591 /* ;an000; */
1592 p_con1.p_match_flag = p_none; /* ;an000; */
1593 p_con1.p_function_flag = p_cap_file; /* ;an000; */
1594 p_con1.p_result_buf = (unsigned int)&p_result1; /* ;an000; */
1595 p_con1.p_value_list = (unsigned int)&p_noval; /* ;an000; */
1596 p_con1.p_nid = 1; /* ;an000; */
1597 strcpy(p_con1.p_keyorsw,"/DEBUG"+NUL); /* ;an000; */
1598 /* ;an000; */
1599 p_con2.p_match_flag = p_none; /* ;an000; */
1600 p_con2.p_function_flag = p_cap_file; /* ;an000; */
1601 p_con2.p_result_buf = (unsigned int)&p_result2; /* ;an000; */
1602 p_con2.p_value_list = (unsigned int)&p_noval; /* ;an000; */
1603 p_con2.p_nid = 1; /* ;an000; */
1604 strcpy(p_con2.p_keyorsw,"/PROGRAM"+NUL); /* ;an000; */
1605 /* ;an000; */
1606 p_noval.p_val_num = 0; /* ;an000; */
1607 /* ;an000; */
1608 p_result1.P_Type = 0; /* ;an000; */
1609 p_result1.P_Item_Tag = 0; /* ;an000; */
1610 p_result1.P_SYNONYM_Ptr = 0; /* ;an000; */
1611 p_result1.p_result_buff = 0; /* ;an000; */
1612 /* ;an000; */
1613 p_result2.P_Type = 0; /* ;an000; */
1614 p_result2.P_Item_Tag = 0; /* ;an000; */
1615 p_result2.P_SYNONYM_Ptr = 0; /* ;an000; */
1616 p_result2.p_result_buff = 0; /* ;an000; */
1617 /* ;an000; */
1618 return; /* ;an000; */
1619 /* ;an000; */
1620 } /* end parse_init */ /* ;an000; */
1621
1622
1623/************************************************************************/ /* ;an000; */
1624/* Parse_Message - This routine will print only those */
1625/* messages that require 1 replaceable */
1626/* parm. */
1627/* */
1628/* Inputs : Msg_Num - number of applicable message */
1629/* Handle - display type */
1630/* Message_Type - type of message to display */
1631/* Replace_Parm - pointer to parm to replace */
1632/* */
1633/* Outputs : message */
1634/* */
1635/************************************************************************/
1636
1637void Parse_Message(Msg_Num,Handle,Message_Type) /*;an003; dms; */
1638 /*;an003; dms; */
1639int Msg_Num; /*;an003; dms; */
1640int Handle; /*;an003; dms; */
1641unsigned char Message_Type; /*;an003; dms; */
1642 /*;an003; dms; */
1643{ /*;an003; dms; */
1644char far *Cmd_Ptr; /*;an003; dms; */
1645 /*;an003; dms; */
1646 /*;an003; dms; */
1647 { /*;an003; dms; */
1648 segread(&SegRegs); /*;an003; dms; */
1649 FP_SEG(Cmd_Ptr) = SegRegs.ds; /*;an003; dms; */
1650 FP_OFF(Cmd_Ptr) = OutRegs.x.si; /*;an003; dms; */
1651 *Cmd_Ptr = '\0'; /*;an003; dms; */
1652 /*;an003; dms; */
1653 FP_SEG(sublist[1].value) = SegRegs.ds; /*;an003; dms; */
1654 FP_OFF(sublist[1].value) = Parse_Ptr; /*;an003; dms; */
1655 sublist[1].size = Sublist_Length; /*;an003; dms; */
1656 sublist[1].reserved = Reserved; /*;an003; dms; */
1657 sublist[1].id = 0; /*;an003; dms; */
1658 sublist[1].flags = Char_Field_ASCIIZ+Left_Align; /*;an003; dms; */
1659 sublist[1].max_width = 40; /*;an003; dms; */
1660 sublist[1].min_width = 01; /*;an003; dms; */
1661 sublist[1].pad_char = Blank; /*;an003; dms; */
1662 /*;an003; dms; */
1663 InRegs.x.ax = Msg_Num; /*;an003; dms; */
1664 InRegs.x.bx = Handle; /*;an003; dms; */
1665 InRegs.x.cx = SubCnt1; /*;an003; dms; */
1666 InRegs.h.dl = No_Input; /*;an003; dms; */
1667 InRegs.h.dh = Message_Type; /*;an003; dms; */
1668 InRegs.x.si = (unsigned int)&sublist[1]; /*;an003; dms; */
1669 sysdispmsg(&InRegs,&OutRegs); /*;an003; dms; */
1670 } /*;an003; dms; */
1671 return; /*;an003; dms; */
1672} /*;an003; dms; */
1673
1674
diff --git a/v4.0/src/CMD/MEM/MEM.SKL b/v4.0/src/CMD/MEM/MEM.SKL
new file mode 100644
index 0000000..af49786
--- /dev/null
+++ b/v4.0/src/CMD/MEM/MEM.SKL
@@ -0,0 +1,53 @@
1
2:util MEM
3
4:class 1
5
6:class A
7:use COMMON1 ;Incorrect DOS version
8:def 10 CR,LF
9:def 11 " Address Name Size Type ",CR,LF
10:def 12 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
11:def 13 " Handle EMS Name Size ",CR,LF
12:def 14 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
13:def 15 " %1 %2 %3 %4",CR,LF
14:def 16 " %1 %2 %3 ",CR,LF
15:def 17 " %1 %2 ",CR,LF ;fix in usa
16:def 18 "%1 bytes total memory",CR,LF
17:def 19 "%1 bytes available",CR,LF
18:def 20 "%1 largest executable program size",CR,LF
19:def 21 "%1 bytes total EMS memory",CR,LF
20:def 22 "%1 bytes free EMS memory",CR,LF
21:def 23 "%1 bytes total extended memory",CR,LF
22:def 24 "Interrupt Vector",0
23:def 25 "ROM Communication Area",0
24:def 26 "DOS Communication Area",0
25:def 27 "IBMBIO",0
26:def 28 "IBMDOS",0
27:def 29 "System Data",0
28:def 30 "System Program",0
29:def 31 "System Device Driver",0
30:def 32 "Installed Device Driver",0
31:def 33 "%1:",0
32:def 34 "%1: - %2:",0
33:def 35 "BUFFERS=",0
34:def 36 "FILES=",0
35:def 37 "FCBS=",0
36:def 38 "STACKS=",0
37:def 39 "DEVICE=",0
38:def 40 "IFS=",0
39:def 45 "INSTALL=",0
40
41:class B
42:def 41 "LASTDRIVE=",0
43:def 42 "----------",0
44:def 43 " ",0
45:def 44 " %1 %2 %3",CR,LF
46:def 46 "%1 bytes available extended memory",CR,LF
47:def 47 "System Stacks",0
48:def 48 "-- Free --",0
49:def 49 "Program",0
50:def 50 "Environment",0
51:def 51 "Data",0
52
53:end
diff --git a/v4.0/src/CMD/MEM/MSGDEF.H b/v4.0/src/CMD/MEM/MSGDEF.H
new file mode 100644
index 0000000..c9703a6
--- /dev/null
+++ b/v4.0/src/CMD/MEM/MSGDEF.H
@@ -0,0 +1,93 @@
1/************************************************************************/
2/* MSGDEF.H - This include file defines each message type */
3/* that can occur in MEM. These defines will */
4/* be used by MEM to build the proper message. */
5/* */
6/* Date : 10/29/87 */
7/************************************************************************/
8
9#define NewLineMsg 10
10#define Title1Msg 11
11#define Title2Msg 12
12#define Title3Msg 13
13#define Title4Msg 14
14#define MainLineMsg 15
15#define DriverLineMsg 16
16#define DeviceLineMsg 17
17#define TotalMemoryMsg 18
18#define AvailableMemoryMsg 19
19#define FreeMemoryMsg 20
20#define EMSTotalMemoryMsg 21
21#define EMSFreeMemoryMsg 22
22#define EXTMemoryMsg 23
23#define InterruptVectorMsg 24
24#define ROMCommunicationAreaMsg 25
25#define DOSCommunicationAreaMsg 26
26#define IbmbioMsg 27
27#define IbmdosMsg 28
28#define SystemDataMsg 29
29#define SystemProgramMsg 30
30#define SystemDeviceDriverMsg 31
31#define InstalledDeviceDriverMsg 32
32#define SingleDriveMsg 33
33#define MultipleDrivesMsg 34
34#define ConfigBuffersMsg 35
35#define ConfigFilesMsg 36
36#define ConfigFcbsMsg 37
37#define ConfigStacksMsg 38
38#define ConfigDeviceMsg 39
39#define ConfigIFSMsg 40
40#define ConfigLastDriveMsg 41
41#define ConfigInstallMsg 45 /* gga */
42#define UnownedMsg 42
43#define BlankMsg 43
44#define HandleMsg 44
45#define EXTMemAvlMsg 46 /* ;an001; dms;*/
46#define StackMsg 47
47#define FreeMsg 48
48#define ProgramMsg 49
49#define EnvironMsg 50
50#define DataMsg 51
51
52
53#define ParseError1Msg 01
54#define ParseError10Msg 10
55
56/************************************************************************/
57/* Message Retriever Standard Equates */
58/************************************************************************/
59
60#define Ext_Err_Class 0x0001
61#define Parse_Err_Class 0x0002
62#define Utility_Msg_Class 0x00ff
63#define No_Handle 0xffff
64#define No_Replace 0x0000
65#define Sublist_Length 0x000b
66#define Reserved 0x0000
67#define Left_Align 0x0000
68#define Right_Align 0x0080
69#define Char_Field_Char 0x0000
70#define Char_Field_ASCIIZ 0x0010
71#define Unsgn_Bin_Byte 0x0011
72#define Unsgn_Bin_Word 0x0021
73#define Unsgn_Bin_DWord 0x0031
74#define Sgn_Bin_Byte 0x0012
75#define Sgn_Bin_Word 0x0022
76#define Sgn_Bin_DWord 0x0032
77#define Bin_Hex_Byte 0x0013
78#define Bin_Hex_Word 0x0023
79#define Bin_Hex_DWord 0x0033
80#define No_Input 0x0000
81#define STDIN 0x0000
82#define STDOUT 0x0001
83#define STDERR 0x0002
84#define Blank 0x0020
85
86#define SubCnt1 0x0001
87#define SubCnt2 0x0002
88#define SubCnt3 0x0003
89#define SubCnt4 0x0004
90#define SubCnt5 0x0005
91
92#define CarryFlag 0x0001
93
diff --git a/v4.0/src/CMD/MEM/PARSE.H b/v4.0/src/CMD/MEM/PARSE.H
new file mode 100644
index 0000000..ec4f4eb
--- /dev/null
+++ b/v4.0/src/CMD/MEM/PARSE.H
@@ -0,0 +1,144 @@
1/*  */
2/*----------------------------------------------------------------------+
3| |
4| This file contains the structures and defines that are needed to use |
5| the parser from a C program. |
6| |
7| |
8| Date: 5-21-87 |
9| |
10+----------------------------------------------------------------------*/
11
12
13#define p_len_parms 4 /* length of p_parms */
14#define p_i_use_default 0 /* no extra stuff specified */
15#define p_i_have_delim 1 /* extra delimiter specified */
16#define p_i_have_eol 2 /* extra EOL specified */
17
18struct p_parms
19 {
20 struct p_parmsx *p_parmsx_address; /* address of p_parmsx */
21 unsigned char p_num_extra; /* number of extra stuff */
22 unsigned char p_len_extra_delim; /* length of extra delimiter */
23 char p_extra_delim[30]; /* extra delimiters */
24 };
25
26struct p_parmsx
27 {
28 unsigned char p_minp; /* Minimum positional number */
29 unsigned char p_maxp; /* Maximum positional number */
30 unsigned char p_maxswitch; /* Maximum switches */
31 struct p_control_blk *p_control[2]; /* Address of the 1st CONTROL block */
32 unsigned char p_keyword; /* Keyword count */
33 };
34
35
36struct p_control_blk
37 {
38 unsigned int p_match_flag; /* Controls type matched */
39 unsigned int p_function_flag; /* Function should be taken */
40 unsigned int p_result_buf; /* Result buffer address */
41 unsigned int p_value_list; /* Value list address */
42 unsigned char p_nid; /* # of keyword/SW synonyms */
43 char p_keyorsw[64]; /* keyword or sw */
44 };
45
46/* Match_Flags */
47
48#define p_num_val 0x8000 /* Numeric Value */
49#define p_snum_val 0x4000 /* Signed numeric value */
50#define p_simple_s 0x2000 /* Simple string */
51#define p_date_s 0x1000 /* Date string */
52#define p_time_s 0x0800 /* Time string */
53#define p_cmpx_s 0x0400 /* Complex string */
54#define p_file_spc 0x0200 /* File Spec */
55#define p_drv_only 0x0100 /* Drive Only */
56#define p_qu_string 0x0080 /* Quoted string */
57#define p_ig_colon 0x0010 /* Ignore colon at end in match */
58#define p_repeat 0x0002 /* Repeat allowed */
59#define p_optional 0x0001 /* Optional */
60#define p_none 0x0000
61
62/*----------------------------------------------------------------------+
63| |
64| Function flags |
65| |
66+----------------------------------------------------------------------*/
67
68#define p_cap_file 0x0001 /* CAP result by file table */
69#define p_cap_char 0x0002 /* CAP result by character table */
70#define p_rm_colon 0x0010 /* Remove ":" at the end */
71
72
73
74#define p_nval_none 0 /* no value list ID */
75#define p_nval_range 1 /* range list ID */
76#define p_nval_value 2 /* value list ID */
77#define p_nval_string 3 /* string list ID */
78#define p_len_range 9 /* Length of a range choice(two DD plus one DB) */
79#define p_len_value 5 /* Length of a value choice(one DD plus one DB) */
80#define p_len_string 3 /* Length of a string choice(one DW plus one DB) */
81
82/*----------------------------------------------------------------------+
83| |
84| Value block structure |
85| |
86+----------------------------------------------------------------------*/
87
88struct p_value_blk
89 {
90 unsigned char p_val_num;
91 };
92
93
94/*----------------------------------------------------------------------+
95| |
96| Result block structure |
97| |
98+----------------------------------------------------------------------*/
99
100struct p_result_blk
101 {
102 unsigned char P_Type; /* Type returned */
103 unsigned char P_Item_Tag; /* Matched item tag */
104 unsigned int P_SYNONYM_Ptr; /* pointer to Synonym list returned */
105 unsigned long int p_result_buff; /* result value */
106 };
107
108/*----------------------------------------------------------------------+
109| |
110| type |
111| |
112+----------------------------------------------------------------------*/
113
114#define p_eol 0 /* End of line */
115#define p_number 1 /* Number */
116#define p_list_idx 2 /* List Index */
117#define p_string 3 /* String */
118#define p_complex 4 /* Complex */
119#define p_file_spec 5 /* File Spec */
120#define p_drive 6 /* Drive */
121#define p_date_f 7 /* Date */
122#define p_time_f 8 /* Time */
123#define p_quoted_string 9 /* Quoted String */
124
125#define p_no_tag 0x0FF /* No ITEM_TAG found */
126
127/*----------------------------------------------------------------------+
128| |
129| following return code will be returned in the AX register. |
130| |
131+----------------------------------------------------------------------*/
132
133#define p_no_error 0 /* No error */
134#define p_too_many 1 /* Too many operands */
135#define p_op_missing 2 /* Required operand missing */
136#define p_not_in_sw 3 /* Not in switch list provided */
137#define p_not_in_key 4 /* Not in keyword list provided */
138#define p_out_of_range 6 /* Out of range specified */
139#define p_not_in_val 7 /* Not in value list provided */
140#define p_not_in_str 8 /* Not in string list provided */
141#define p_syntax 9 /* Syntax error */
142#define p_rc_eol 0x0ffff /* End of command line */
143
144
diff --git a/v4.0/src/CMD/MEM/_MSGRET.ASM b/v4.0/src/CMD/MEM/_MSGRET.ASM
new file mode 100644
index 0000000..0b982f7
--- /dev/null
+++ b/v4.0/src/CMD/MEM/_MSGRET.ASM
@@ -0,0 +1,263 @@
1page 60,132
2name _msgret
3title C to Message Retriever
4;-------------------------------------------------------------------
5;
6; MODULE: _msgret
7;
8; PURPOSE: Supplies an interface between C programs and
9; the DOS 3.3 message retriever
10;
11; CALLING FORMAT:
12; msgret(&inregs,&outregs);
13;
14; DATE: 5-21-87
15;
16;-------------------------------------------------------------------
17
18 INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000;
19
20 MSG_UTILNAME <MEM> ;IDENTIFY THE COMPONENT ;AN000;
21
22;-------------------------------------------------------------------
23;-------------------------------------------------------------------
24
25
26_TEXT SEGMENT BYTE PUBLIC 'CODE'
27_TEXT ENDS
28_DATA SEGMENT WORD PUBLIC 'DATA'
29_DATA ENDS
30CONST SEGMENT WORD PUBLIC 'CONST'
31CONST ENDS
32_BSS SEGMENT WORD PUBLIC 'BSS'
33_BSS ENDS
34
35DGROUP GROUP CONST, _BSS, _DATA
36 ASSUME CS: DGROUP, DS: DGROUP, SS: DGROUP, ES: NOTHING
37
38 public data_sysloadmsg
39 public data_sysdispmsg
40 public data_sysgetmsg
41
42_DATA SEGMENT
43
44 MSG_SERVICES <MSGDATA>
45 MSG_SERVICES <LOADmsg,FARmsg>
46 MSG_SERVICES <DISPLAYmsg,GETmsg,CHARmsg,NUMmsg>
47 MSG_SERVICES <MEM.CLA,MEM.CLB,MEM.CL1,MEM.CL2,MEM.CTL> ;AN000;
48
49
50data_sysloadmsg proc far
51
52 push bp ; save user's base pointer
53 mov bp,sp ; set bp to current sp
54 push di ; save some registers
55 push si
56
57; copy C inregs into proper registers
58
59 mov di,[bp+4+4] ; fix di (arg 0)
60
61;-------------------------------------------------------------------
62
63 mov ax,[di+0ah] ; load di
64 push ax ; the di value from inregs is now on stack
65
66 mov ax,[di+00] ; get inregs.x.ax
67 mov bx,[di+02] ; get inregs.x.bx
68 mov cx,[di+04] ; get inregs.x.cx
69 mov dx,[di+06] ; get inregs.x.dx
70 mov si,[di+08] ; get inregs.x.si
71 pop di ; get inregs.x.di from stack
72
73 push bp ; save base pointer
74
75;-------------------------------------------------------------------
76
77 call sysloadmsg ; call the message retriever
78
79;-------------------------------------------------------------------
80
81 pop bp ; restore base pointer
82 push di ; the di value from call is now on stack
83 mov di,[bp+6+4] ; fix di (arg 1)
84
85 mov [di+00],ax ; load outregs.x.ax
86 mov [di+02],bx ; load outregs.x.bx
87 mov [di+04],cx ; load outregs.x.cx
88 mov [di+06],dx ; load outregs.x.dx
89 mov [di+08],si ; load outregs.x.si
90
91 lahf ; get flags into ax
92 mov al,ah ; move into low byte
93 mov [di+0ch],ax ; load outregs.x.cflag
94
95 pop ax ; get di from stack
96 mov [di+0ah],ax ; load outregs.x.di
97
98;-------------------------------------------------------------------
99
100 pop si ; restore registers
101 pop di
102 mov sp,bp ; restore sp
103 pop bp ; restore user's bp
104 ret
105
106data_sysloadmsg endp
107
108
109data_sysdispmsg proc far
110
111 push bp ; save user's base pointer
112 mov bp,sp ; set bp to current sp
113 push di ; save some registers
114 push si
115
116; copy C inregs into proper registers
117
118 mov di,[bp+4+4] ; fix di (arg 0)
119
120;-------------------------------------------------------------------
121
122 mov ax,[di+0ah] ; load di
123 push ax ; the di value from inregs is now on stack
124
125 mov ax,[di+00] ; get inregs.x.ax
126 mov bx,[di+02] ; get inregs.x.bx
127 mov cx,[di+04] ; get inregs.x.cx
128 mov dx,[di+06] ; get inregs.x.dx
129 mov si,[di+08] ; get inregs.x.si
130 pop di ; get inregs.x.di from stack
131
132 push bp ; save base pointer
133
134;-------------------------------------------------------------------
135
136 call sysdispmsg
137
138;-------------------------------------------------------------------
139
140 pop bp ; restore base pointer
141 push di ; the di value from call is now on stack
142 mov di,[bp+6+4] ; fix di (arg 1)
143
144 mov [di+00],ax ; load outregs.x.ax
145 mov [di+02],bx ; load outregs.x.bx
146 mov [di+04],cx ; load outregs.x.cx
147 mov [di+06],dx ; load outregs.x.dx
148 mov [di+08],si ; load outregs.x.si
149
150 lahf ; get flags into ax
151 mov al,ah ; move into low byte
152 mov [di+0ch],ax ; load outregs.x.cflag
153
154 pop ax ; get di from stack
155 mov [di+0ah],ax ; load outregs.x.di
156
157;-------------------------------------------------------------------
158
159 pop si ; restore registers
160 pop di
161 mov sp,bp ; restore sp
162 pop bp ; restore user's bp
163 ret
164
165data_sysdispmsg endp
166
167
168data_sysgetmsg proc far
169
170 push bp ; save user's base pointer
171 mov bp,sp ; set bp to current sp
172 push di ; save some registers
173 push si
174
175; copy C inregs into proper registers
176
177 mov di,[bp+4+4] ; fix di (arg 0)
178
179;-------------------------------------------------------------------
180
181 mov ax,[di+0ah] ; load di
182 push ax ; the di value from inregs is now on stack
183
184 mov ax,[di+00] ; get inregs.x.ax
185 mov bx,[di+02] ; get inregs.x.bx
186 mov cx,[di+04] ; get inregs.x.cx
187 mov dx,[di+06] ; get inregs.x.dx
188 mov si,[di+08] ; get inregs.x.si
189 pop di ; get inregs.x.di from stack
190
191 push bp ; save base pointer
192
193;-------------------------------------------------------------------
194
195 call sysgetmsg ; call the message retriever
196
197;-------------------------------------------------------------------
198
199 pop bp ; restore base pointer
200 push di ; the di value from call is now on stack
201 mov di,[bp+6+4] ; fix di (arg 1)
202
203 push ax ; save ax
204 mov [di+00],es ; load segregs.es
205 mov [di+06],ds ; load outregs.ds
206 pop ax ; restore ax
207
208 pop di ; restore di
209 push di ; save it
210 mov di,[bp+8+4] ; fix di (arg 2)
211 mov [di+00],ax ; load outregs.x.ax
212 mov [di+02],bx ; load outregs.x.bx
213 mov [di+04],cx ; load outregs.x.cx
214 mov [di+06],dx ; load outregs.x.dx
215 mov [di+08],si ; load outregs.x.si
216
217 lahf ; get flags into ax
218 mov al,ah ; move into low byte
219 mov [di+0ch],ax ; load outregs.x.cflag
220
221 pop ax ; get di from stack
222 mov [di+0ah],ax ; load outregs.x.di
223
224;-------------------------------------------------------------------
225
226 pop si ; restore registers
227 pop di
228 mov sp,bp ; restore sp
229 pop bp ; restore user's bp
230 ret
231
232data_sysgetmsg endp
233
234include msgdcl.inc
235
236_DATA ends ; end code segment
237
238_TEXT SEGMENT
239
240 assume cs:_TEXT
241
242 public _sysdispmsg
243 public _sysloadmsg
244 public _sysgetmsg
245
246_sysdispmsg proc near
247 call data_sysdispmsg
248 ret
249_sysdispmsg endp
250
251_sysloadmsg proc near
252 call data_sysloadmsg
253 ret
254_sysloadmsg endp
255
256_sysgetmsg proc near
257 call data_sysgetmsg
258 ret
259_sysgetmsg endp
260
261_TEXT ENDS
262 end
263
diff --git a/v4.0/src/CMD/MEM/_PARSE.ASM b/v4.0/src/CMD/MEM/_PARSE.ASM
new file mode 100644
index 0000000..d1424b7
--- /dev/null
+++ b/v4.0/src/CMD/MEM/_PARSE.ASM
@@ -0,0 +1,165 @@
1page 60,132
2name _parse
3title C to PARSER interface
4;-------------------------------------------------------------------
5;
6; MODULE: _parse
7;
8; PURPOSE: Supplies an interface between C programs and
9; the DOS 3.3 parser
10;
11; CALLING FORMAT:
12; parse(&inregs,&outregs);
13;
14; DATE: 5-21-87
15;
16;-------------------------------------------------------------------
17
18; extrn sysparse:far
19
20 public _parse
21
22;-------------------------------------------------------------------
23;FarSW equ 0 ; make sysparse be a NEAR proc
24;TimeSW equ 0 ; Check time format
25;FileSW equ 0 ; Check file specification
26;CAPSW equ 0 ; Perform CAPS if specified
27;CmpxSW equ 0 ; Check complex list
28;NumSW equ 1 ; Check numeric value
29;KeySW equ 0 ; Support keywords
30;SwSW equ 1 ; Support switches
31;Val1SW equ 1 ; Support value definition 1
32;Val2SW equ 1 ; Support value definition 2
33;Val3SW equ 0 ; Support value definition 3
34;DrvSW equ 0 ; Support drive only format
35;QusSW equ 0 ; Support quoted string format
36;-------------------------------------------------------------------
37
38
39
40
41_TEXT SEGMENT BYTE PUBLIC 'CODE'
42_TEXT ENDS
43_DATA SEGMENT WORD PUBLIC 'DATA'
44_DATA ENDS
45CONST SEGMENT WORD PUBLIC 'CONST'
46CONST ENDS
47_BSS SEGMENT WORD PUBLIC 'BSS'
48_BSS ENDS
49
50
51DGROUP GROUP CONST, _BSS, _DATA
52
53
54_DATA segment word public 'DATA'
55
56 assume cs:DGROUP
57 assume ss:dgroup
58
59 public SysParse
60
61;-------------------------------------------------------------------
62.xlist
63include parse.asm ; include the parser
64.list
65;-------------------------------------------------------------------
66
67 public CallParser
68CallParser proc far
69
70 push ds
71 PUSH ES
72
73 push cs
74 pop ds
75 assume ds:DGROUP
76
77 push cs
78 pop es
79 assume es:DGROUP
80
81 nop
82
83 call SysParse
84
85 POP ES
86 pop ds
87
88 ret
89
90CallParser endp
91
92
93
94_DATA ends
95
96_TEXT segment byte public 'CODE'
97
98 ASSUME CS:_TEXT
99 ASSUME DS:DGROUP
100 ASSUME ES:NOTHING
101 ASSUME SS:DGROUP
102
103_parse proc near
104
105 push bp ; save user's base pointer
106 mov bp,sp ; set bp to current sp
107 push di ; save some registers
108 push si
109
110; copy C inregs into proper registers
111
112 mov di,[bp+4] ; fix di (arg 0)
113
114;-------------------------------------------------------------------
115
116 mov ax,[di+0ah] ; load di
117 push ax ; the di value from inregs is now on stack
118
119 mov ax,[di+00] ; get inregs.x.ax
120 mov bx,[di+02] ; get inregs.x.bx
121 mov cx,[di+04] ; get inregs.x.cx
122 mov dx,[di+06] ; get inregs.x.dx
123 mov si,[di+08] ; get inregs.x.si
124 pop di ; get inregs.x.di from stack
125
126 push bp ; save base pointer
127
128;-------------------------------------------------------------------
129;-------------------------------------------------------------------
130
131 call CallParser ; call the parser
132
133;-------------------------------------------------------------------
134;-------------------------------------------------------------------
135
136 pop bp ; restore base pointer
137 push di ; the di value from call is now on stack
138 mov di,[bp+6] ; fix di (arg 1)
139
140 mov [di+00],ax ; load outregs.x.ax
141 mov [di+02],bx ; load outregs.x.bx
142 mov [di+04],cx ; load outregs.x.cx
143 mov [di+06],dx ; load outregs.x.dx
144 mov [di+08],si ; load outregs.x.si
145
146 xor ax,ax ; clear ax
147 lahf ; get flags into ax
148 mov [di+0ch],ax ; load outregs.x.cflag
149
150 pop ax ; get di from stack
151 mov [di+0ah],ax ; load outregs.x.di
152
153;-------------------------------------------------------------------
154
155 pop si ; restore registers
156 pop di
157 mov sp,bp ; restore sp
158 pop bp ; restore user's bp
159 ret
160
161_parse endp
162
163_TEXT ends ; end code segment
164 end
165