From 2d04cacc5322951f187bb17e017c12920ac8ebe2 Mon Sep 17 00:00:00 2001 From: Mark Zbikowski Date: Thu, 25 Apr 2024 21:24:10 +0100 Subject: MZ is back! --- v4.0/src/CMD/MEM/MAKEFILE | 37 + v4.0/src/CMD/MEM/MEM.C | 1674 ++++++++++++++++++++++++++++++++++++++++++ v4.0/src/CMD/MEM/MEM.SKL | 53 ++ v4.0/src/CMD/MEM/MSGDEF.H | 93 +++ v4.0/src/CMD/MEM/PARSE.H | 144 ++++ v4.0/src/CMD/MEM/_MSGRET.ASM | 263 +++++++ v4.0/src/CMD/MEM/_PARSE.ASM | 165 +++++ 7 files changed, 2429 insertions(+) create mode 100644 v4.0/src/CMD/MEM/MAKEFILE create mode 100644 v4.0/src/CMD/MEM/MEM.C create mode 100644 v4.0/src/CMD/MEM/MEM.SKL create mode 100644 v4.0/src/CMD/MEM/MSGDEF.H create mode 100644 v4.0/src/CMD/MEM/PARSE.H create mode 100644 v4.0/src/CMD/MEM/_MSGRET.ASM create mode 100644 v4.0/src/CMD/MEM/_PARSE.ASM (limited to 'v4.0/src/CMD/MEM') 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 @@ +#************************** makefile for cmd\... *************************** + +msg =..\..\messages +dos =..\..\dos +inc =..\..\inc +hinc =..\..\h +lib =..\..\lib + +# +####################### dependencies begin here. ######################### +# + +all: mem.exe + + +mem.ctl: mem.skl \ + $(msg)\$(COUNTRY).msg makefile + +_parse.obj: _parse.asm \ + makefile \ + $(inc)\parse.asm \ + $(inc)\psdata.inc + +_msgret.obj: _msgret.asm \ + makefile \ + mem.ctl \ + $(inc)\msgserv.asm \ + $(inc)\sysmsg.inc + +mem.obj: mem.c \ + msgdef.h \ + $(hinc)\copyrigh.h + +mem.exe: mem.obj _msgret.obj _parse.obj + link mem+_msgret+_parse,,,$(lib)\mem; + + 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 @@ + +/*----------------------------------------------------------------------+ +| | +| | +| Title: MEM | +| | +| Syntax: | +| | +| From the DOS command line: | +| | +| MEM | +| - Used to display DOS memory map summary. | +| | +| MEM /PROGRAM | +| - Used to display DOS memory map. | +| | +| MEM /DEBUG | +| - Used to display a detailed DOS memory map. | +| | +| AN001 - PTM P2914 -> This PTM relates to MEM's ability to report| +| the accurate total byte count for EM | +| memory. | +| | +| AN002 - PTM P3477 -> MEM was displaying erroneous base memory | +| information for "Total" and "Available" | +| memory. This was due to incorrect logic | +| for RAM carving. | +| | +| AN003 - PTM P3912 -> MEM messages do not conform to spec. | +| PTM P3989 | +| | +| Date: 1/28/88 | +| | +| AN004 - PTM P4510 -> MEM does not give correct DOS size. | +| | +| Date: 4/27/88 | +| | +| AN005 - PTM P4957 -> MEM does not give correct DOS size for | +| programs loaded into high memory. | +| | +| Date: 6/07/88 | +| | ++----------------------------------------------------------------------*/ + +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ + +#include "ctype.h" /* ;an000; */ +#include "conio.h" /* need for kbhit prototype */ /* ;an000; */ +#include "stdio.h" /* ;an000; */ +#include "dos.h" /* ;an000; */ +#include "string.h" /* ;an000; */ +#include "stdlib.h" /* ;an000; */ +#include "msgdef.h" /* ;an000; */ +#include "parse.h" /* ;an000; */ + +/* #include "copyrigh.h" */ /* Only need one copyright statement an004 */ + /* It is included by the message ret an004 */ + +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ + + char *SingleDrive = "%c:" ; /* ;an000; */ + char *MultipleDrives = "%c: - %c:" ; /* ;an000; */ + char *UnOwned = "----------" ; /* ;an000; */ + char *Ibmbio = "IO " ; /* ;an000; */ + char *Ibmdos = "MSDOS " ; + /* ;an000; */ + struct sublistx /* ;an000; */ + { /* ;an000; */ + unsigned char size; /* sublist size */ /* ;an000; */ + unsigned char reserved; /* reserved for future growth */ /* ;an000; */ + unsigned far *value; /* pointer to replaceable parm */ /* ;an000; */ + unsigned char id; /* type of replaceable parm */ /* ;an000; */ + unsigned char flags; /* how parm is to be displayed */ /* ;an000; */ + unsigned char max_width; /* max width of replaceable field */ /* ;an000; */ + unsigned char min_width; /* min width of replaceable field */ /* ;an000; */ + unsigned char pad_char; /* pad character for replaceable field */ /* ;an000; */ + } sublist[4]; /* ;an000; */ + /* ;an000; */ +/*----------------------------------------------------------------------+ +| define structure used by parser | ++----------------------------------------------------------------------*/ + +struct p_parms p_p; /* ;an000; */ + /* ;an000; */ +struct p_parmsx p_px; /* ;an000; */ + /* ;an000; */ +struct p_control_blk p_con1; /* ;an000; */ +struct p_control_blk p_con2; /* ;an000; */ + /* ;an000; */ +struct p_result_blk p_result1; /* ;an000; */ +struct p_result_blk p_result2; /* ;an000; */ + /* ;an000; */ +struct p_value_blk p_noval; /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + struct DEVICEHEADER { /* ;an000; */ + struct DEVICEHEADER far *NextDeviceHeader; /* ;an000; */ + unsigned Attributes; /* ;an000; */ + unsigned Strategy; /* ;an000; */ + unsigned Interrupt; /* ;an000; */ + char Name[8]; /* ;an000; */ + }; /* ;an000; */ + /* ;an000; */ +#define DA_TYPE 0x8000; /* ;an000; */ +#define DA_IOCTL 0x4000; /* ;an000; */ + /* ;an000; */ +#define a(fp) ((char) fp) /* ;an000; */ + /* ;an000; */ +/* defines used in EMS support */ /* ;an000; */ + /* ;an000; */ +#define GET_VECT 0x35 /* EMS interrupt */ /* ;an000; */ +#define EMS 0x67 /* ;an000; */ + /* ;an000; */ +#define CASSETTE 0x15 /* interrupt to get extended memory */ /* ;an000; */ + /* ;an000; */ +#define DOSEMSVER 0x40 /* EMS version */ /* ;an000; */ + /* ;an000; */ +#define EMSGetStat 0x4000 /* get stat */ /* ;an000; */ +#define EMSGetVer 0x4600 /* get version */ /* ;an000; */ +#define EMSGetFreePgs 0x4200 /* get free pages */ /* ;an000; */ + /* ;an000; */ +#define GetExtended 0x8800 /* get extended memory size */ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/* defines used by total memory determination */ /* ;an000; */ +#define GET_PSP (unsigned char ) 0x62 /* get PSP function call */ /* ;an000; */ + +#define MEMORY_DET 0x12 /* BIOS interrupt used to get total memory size */ /* ;an000; */ + /* ;an000; */ + struct SYSIVAR { /* ;an000; */ + char far *DpbChain; /* ;an000; */ + char far *SftChain; /* ;an000; */ + char far *Clock; /* ;an000; */ + char far *Con; /* ;an000; */ + unsigned MaxSectorSize; /* ;an000; */ + char far *BufferChain; /* ;an000; */ + char far *CdsList; /* ;an000; */ + char far *FcbChain; /* ;an000; */ + unsigned FcbKeepCount; /* ;an000; */ + unsigned char BlockDeviceCount; /* ;an000; */ + char CdsCount; /* ;an000; */ + struct DEVICEHEADER far *DeviceDriverChain; /* ;an000; */ + unsigned NullDeviceAttributes; /* ;an000; */ + unsigned NullDeviceStrategyEntryPoint; /* ;an000; */ + unsigned NullDeviceInterruptEntryPoint; /* ;an000; */ + char NullDeviceName[8]; /* ;an000; */ + char SpliceIndicator; /* ;an000; */ + unsigned DosParagraphs; /* ;an000; */ + char far *DosServiceRntryPoint; /* ;an000; */ + char far *IfsChain; /* ;an000; */ + unsigned BufferValues; /* ;an000; */ + unsigned LastDriveValue; /* ;an000; */ + char BootDrive; /* ;an000; */ + char MoveType; + unsigned ExtendedMemory; + }; /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ + struct ARENA { /* ;an000; */ + char Signature; /* ;an000; */ + unsigned Owner; /* ;an000; */ + unsigned Paragraphs; /* ;an000; */ + char Dummy[3]; /* ;an000; */ + char OwnerName[8]; /* ;an000; */ + }; /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +#define FALSE (char)(1==0) /* ;an000; */ +#define TRUE !(FALSE) /* ;an000; */ +#define CR '\x0d' /* ;an000; */ +#define LF '\x0a' /* ;an000; */ +#define NUL (char) '\0' /* ;an000; */ +#define TAB '\x09' /* ;an000; */ +#define BLANK ' ' /* ;an000; */ + /* ;an000; */ +extern unsigned DOS_TopOfMemory; /* PSP Top of memory from 'C' init code */ /* ;an005; */ + +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ + unsigned far *ArenaHeadPtr; /* ;an000; */ + struct SYSIVAR far *SysVarsPtr; /* ;an000; */ + /* ;an000; */ + char OwnerName[128]; /* ;an000; */ + char TypeText[128]; /* ;an000; */ + char cmd_line[128]; /* ;an000; */ + char far *cmdline; /* ;an000; */ + /* ;an000; */ + char UseArgvZero = TRUE; /* ;an000; */ + char EMSInstalledFlag = (char) 2; /* ;an000; */ + /* ;an000; */ + union REGS InRegs; /* ;an000; */ + union REGS OutRegs; /* ;an000; */ + struct SREGS SegRegs; /* ;an000; */ + /* ;an000; */ + int DataLevel; /* ;an000; */ + int i; /* ;an000; */ + /* ;an000; */ + int BlockDeviceNumber; /* ;an000; */ + unsigned Parse_Ptr; /* ;an003; dms; pointer to command */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void main(int, char *[]); /* ;an000; */ + /* ;an000; */ +int printf(); +int sprintf(); +int strcmp(const char *, const char *); +int sscanf(); /* ;an000; */ +void exit(int); /* ;an000; */ +int kbhit(); /* ;an000; */ +char *OwnerOf(struct ARENA far *); /* ;an000; */ +char *TypeOf(struct ARENA far *); /* ;an000; */ +unsigned long AddressOf(char far *); /* ;an000; */ + /* ;an000; */ +char EMSInstalled(void); /* ;an000; */ +void DisplayEMSSummary(void); /* ;an000; */ +void DisplayEMSDetail(void); /* ;an000; */ + /* ;an000; */ +void DisplayBaseSummary(void); /* ;an000; */ +void DisplayExtendedSummary(void); /* ;an000; */ +void DisplayExpandedSummary(void); /* ;an000; */ + /* ;an000; */ +void DisplayBaseDetail(void); /* ;an000; */ + /* ;an000; */ +void GetFromArgvZero(unsigned,unsigned far *); /* ;an000; */ + /* ;an000; */ +void DisplayDeviceDriver(struct DEVICEHEADER far *,int); /* ;an000; */ + /* ;an000; */ +void parse_init(void); /* ;an000; */ + /* ;an000; */ +void Parse_Message(int,int,unsigned char); /* ;an000; */ +void Sub0_Message(int,int,unsigned char); /* ;an000; */ +void Sub1_Message(int,int,unsigned char,unsigned long int *); /* ;an000; */ +void Sub2_Message(int,int,unsigned char,char *,int); /* ;an000; */ +void Sub3_Message(int,int,unsigned char, /* ;an000; */ + char *, /* ;an000; */ + unsigned long int *, /* ;an000; */ + int); /* ;an000; */ + /* ;an000; */ +void Sub4_Message(int,int,unsigned char, /* ;an000; */ + unsigned long int *, /* ;an000; */ + int, /* ;an000; */ + unsigned long int *, /* ;an000; */ + int); /* ;an000; */ + /* ;an000; */ +void Sub4a_Message(int,int,unsigned char, /* ;an000; */ + unsigned long int *, /* ;an000; */ + char *, /* ;an000; */ + unsigned long int *, /* ;an000; */ + char *); /* ;an000; */ + /* ;an000; */ +void EMSPrint(int,int,unsigned char, /* ;an000; */ + int *, /* ;an000; */ + char *, /* ;an000; */ + unsigned long int *); /* ;an000; */ + /* ;an000; */ +extern void sysloadmsg(union REGS *, union REGS *); /* ;an000; */ +extern void sysdispmsg(union REGS *, union REGS *); /* ;an000; */ +extern void sysgetmsg(union REGS *, struct SREGS *, union REGS *); /* ;an000; */ +extern void parse(union REGS *, union REGS *); /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void main(argc,argv) /* ;an000; */ +int argc; /* ;an000; */ +char *argv[]; /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + sysloadmsg(&InRegs,&OutRegs); /* ;an000; */ + if ((OutRegs.x.cflag & CarryFlag) == CarryFlag) /* ;an000; */ + { /* ;an000; */ + sysdispmsg(&OutRegs,&OutRegs); /* ;an000; */ + exit(1); /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + InRegs.h.ah = (unsigned char) 0x62; /* an000; dms; get the PSP */ /* ;an000; */ + intdosx(&InRegs, &InRegs, &SegRegs); /* an000; dms; invoke the INT 21 */ /* ;an000; */ + /* ;an000; */ + FP_OFF(cmdline) = 0x81; /* an000; dms; offset of command line */ /* ;an000; */ + FP_SEG(cmdline) = InRegs.x.bx; /* an000; dms; segment of command line */ /* ;an000; */ + /* ;an000; */ + i = 0; /* an000; dms; init index */ /* ;an000; */ + while ( *cmdline != (char) '\x0d' ) cmd_line[i++] = *cmdline++; /* an000; dms; while no CR */ /* ;an000; */ + cmd_line[i++] = (char) '\x0d'; /* an000; dms; CR terminate string */ /* ;an000; */ + cmd_line[i++] = (char) '\0'; /* an000; dms; null terminate string */ /* ;an000; */ + /* ;an000; */ + DataLevel = 0; /* ;an000; */ + /* ;an000; */ + parse_init(); /* an000; dms; init for parser */ /* ;an000; */ + InRegs.x.si = (unsigned)cmd_line; /* an000; dms; initialize to command ln.*/ /* ;an000; */ + InRegs.x.cx = (unsigned)0; /* an000; dms; ordinal of 0 */ /* ;an000; */ + InRegs.x.dx = (unsigned)0; /* an000; dms; init pointer */ /* ;an000; */ + InRegs.x.di = (unsigned)&p_p; /* an000; dms; point to ctrl blocks */ /* ;an000; */ + Parse_Ptr = (unsigned)cmd_line; /*;an003; dms; point to command */ + /* ;an000; */ + parse(&InRegs,&OutRegs); /* an000; dms; parse command line */ /* ;an000; */ + while (OutRegs.x.ax == p_no_error) /* an000; dms; good parse loop */ /* ;an000; */ + { /* ;an000; */ + if (p_result1.P_SYNONYM_Ptr == (unsigned int)p_con1.p_keyorsw) /* an000; dms; DEBUG switch */ /* ;an000; */ + DataLevel = 2; /* an000; dms; flag DEBUG switch */ /* ;an000; */ + if (p_result2.P_SYNONYM_Ptr == (unsigned int)p_con2.p_keyorsw) /* an000; dms; PROGRAM switch */ /* ;an000; */ + DataLevel = 1; /* an000; dms; flag PROGRAM switch */ /* ;an000; */ + Parse_Ptr = OutRegs.x.si; /* an003; dms; point to next parm */ + parse(&OutRegs,&OutRegs); /* an000; dms; parse the line */ /* ;an000; */ + if (OutRegs.x.ax == p_no_error) /* an000; dms; check for > 1 switch */ /* ;an000; */ + OutRegs.x.ax = p_too_many; /* an000; dms; flag too many */ /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + if (OutRegs.x.ax != p_rc_eol) /* an000; dms; parse error? */ /* ;an000; */ + { /* ;an000; */ + Parse_Message(OutRegs.x.ax,STDERR,Parse_Err_Class); /* an000; dms; display parse error */ /* ;an000; */ + exit(1); /* an000; dms; exit the program */ /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + if (DataLevel > 0) /* ;an000; */ + { /* ;an000; */ + DisplayBaseDetail(); /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */ + DisplayBaseSummary(); /* display low memory totals */ /* ;an000; */ + /* ;an000; */ + if (EMSInstalled() && (DataLevel > 1)) /* ;an000; */ + DisplayEMSDetail(); /* display EMS memory totals */ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + if (EMSInstalled()) /* ;an000; */ + DisplayEMSSummary(); /* display EMS memory totals */ /* ;an000; */ + /* ;an000; */ + DisplayExtendedSummary(); /* display extended memory summary */ /* ;an000; */ + /* ;an000; */ + return; /* end of MEM main routine */ /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void DisplayBaseDetail() /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + struct ARENA far *ThisArenaPtr; /* ;an000; */ + struct ARENA far *NextArenaPtr; /* ;an000; */ + struct ARENA far *ThisConfigArenaPtr; /* ;an000; */ + struct ARENA far *NextConfigArenaPtr; /* ;an000; */ + /* ;an000; */ + struct DEVICEHEADER far *ThisDeviceDriver; /* ;an000; */ + /* ;an000; */ + int SystemDataType; /* ;an000; */ + char SystemDataOwner[64]; /* ;an000; */ + /* ;an000; */ + int i; /* ;an000; */ + unsigned int long Out_Var1; /* ;an000; */ + unsigned int long Out_Var2; /* ;an000; */ + char Out_Str1[64]; /* ;an000; */ + char Out_Str2[64]; /* ;an000; */ + /* ;an000; */ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */ + if (DataLevel > 0) /* ;an000; */ + { /* ;an000; */ + Sub0_Message(Title1Msg,STDOUT,Utility_Msg_Class); /* ;an000; */ + Sub0_Message(Title2Msg,STDOUT,Utility_Msg_Class); /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + InRegs.h.ah = (unsigned char) 0x30; /* ;an000; */ + intdos(&InRegs, &OutRegs); /* ;an000; */ + /* ;an000; */ + if ( (OutRegs.h.al != (unsigned char) 3) || (OutRegs.h.ah < (unsigned char) 40) ) /* ;an000; */ + UseArgvZero = TRUE; /* ;an000; */ + else UseArgvZero = FALSE; /* ;an000; */ + /* ;an000; */ + /* Display stuff below DOS */ /* ;an000; */ + /* ;an000; */ + Out_Var1 = 0l; /* ;an000; */ + Out_Var2 = 0x400l; /* ;an000; */ + Sub4_Message(MainLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &Out_Var1, /* ;an000; */ + BlankMsg, /* ;an000; */ + &Out_Var2, /* ;an000; */ + InterruptVectorMsg); /* ;an000; */ + /* ;an000; */ + Out_Var1 = 0x400l; /* ;an000; */ + Out_Var2 = 0x100l; /* ;an000; */ + Sub4_Message(MainLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &Out_Var1, /* ;an000; */ + BlankMsg, /* ;an000; */ + &Out_Var2, /* ;an000; */ + ROMCommunicationAreaMsg); /* ;an000; */ + /* ;an000; */ + Out_Var1 = 0x500l; /* ;an000; */ + Out_Var2 = 0x200l; /* ;an000; */ + Sub4_Message(MainLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &Out_Var1, /* ;an000; */ + BlankMsg, /* ;an000; */ + &Out_Var2, /* ;an000; */ + DOSCommunicationAreaMsg); /* ;an000; */ + /* ;an000; */ + /* Display the DOS data */ /* ;an000; */ + /* ;an000; */ + InRegs.h.ah = (unsigned char) 0x52; /* ;an000; */ + intdosx(&InRegs,&OutRegs,&SegRegs); /* ;an000; */ + /* ;an000; */ + FP_SEG(SysVarsPtr) = SegRegs.es; /* ;an000; */ + FP_OFF(SysVarsPtr) = OutRegs.x.bx; /* ;an000; */ + /* ;an000; */ + /* Display the BIO location and size */ /* ;an000; */ + /* ;an000; */ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + Out_Var1 = 0x700l; /* ;an000; */ + Out_Var2 = (long) (FP_SEG(SysVarsPtr) - 0x70)*16l; /* ;an000; */ + Sub4_Message(MainLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &Out_Var1, /* ;an000; */ + IbmbioMsg, /* ;an000; */ + &Out_Var2, /* ;an000; */ + SystemProgramMsg); /* ;an000; */ + /* ;an000; */ + /* Display the Base Device Driver Locations and Sizes */ /* ;an000; */ + /* ;an000; */ + BlockDeviceNumber = 0; /* ;an000; */ + /* ;an000; */ + for (ThisDeviceDriver = SysVarsPtr -> DeviceDriverChain; /* ;an000; */ + (FP_OFF(ThisDeviceDriver) != 0xFFFF); /* ;an000; */ + ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader) /* ;an000; */ + { if ( FP_SEG(ThisDeviceDriver) < FP_SEG(SysVarsPtr) ) /* ;an000; */ + DisplayDeviceDriver(ThisDeviceDriver,SystemDeviceDriverMsg); /* ;an000; */ + kbhit(); /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* Display the DOS location and size */ /* ;an000; */ + + FP_SEG(ArenaHeadPtr) = FP_SEG(SysVarsPtr); /* ;an004; */ + FP_OFF(ArenaHeadPtr) = FP_OFF(SysVarsPtr) - 2; /* ;an004; */ + /* ;an004; */ + FP_SEG(ThisArenaPtr) = *ArenaHeadPtr; /* ;an004; */ + FP_OFF(ThisArenaPtr) = 0; /* ;an004; */ + /* ;an000; */ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */ + /* ;an000; */ + Out_Var1 = (long) FP_SEG(SysVarsPtr) * 16l; /* ;an000; */ + Out_Var2 = (long) ((AddressOf((char far *)ThisArenaPtr)) - Out_Var1); /* ;ac004; */ + Sub4_Message(MainLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &Out_Var1, /* ;an000; */ + IbmdosMsg, /* ;an000; */ + &Out_Var2, /* ;an000; */ + SystemProgramMsg); /* ;an000; */ + /* ;an000; */ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */ + /* ;an000; */ + /* Display the memory data */ /* ;an000; */ + /* ;an000; */ + while (ThisArenaPtr -> Signature != (char) 'Z') /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + if (ThisArenaPtr -> Owner == 8) /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + Out_Var1 = AddressOf((char far *)ThisArenaPtr); /* ;an000; */ + Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l; /* ;an000; */ + Sub4_Message(MainLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &Out_Var1, /* ;an000; */ + IbmbioMsg, /* ;an000; */ + &Out_Var2, /* ;an000; */ + SystemDataMsg); /* ;an000; */ + /* ;an000; */ + FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1; /* ;an000; */ + FP_OFF(NextArenaPtr) = 0; /* ;an000; */ + /* ;an000; */ + FP_SEG(ThisConfigArenaPtr) = FP_SEG(ThisArenaPtr) + 1; /* ;an000; */ + FP_OFF(ThisConfigArenaPtr) = 0; /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + while ( (FP_SEG(ThisConfigArenaPtr) > FP_SEG(ThisArenaPtr)) && /* ;an000; */ + (FP_SEG(ThisConfigArenaPtr) < FP_SEG(NextArenaPtr)) ) /* ;an000; */ + { /* ;an000; */ + strcpy(SystemDataOwner," "); /* ;an000; */ + switch(ThisConfigArenaPtr -> Signature) /* ;an000; */ + { /* ;an000; */ + case 'B': /* ;an000; */ + SystemDataType = ConfigBuffersMsg; /* ;an000; */ + break; /* ;an000; */ + case 'D': /* ;an000; */ + SystemDataType = ConfigDeviceMsg; /* ;an000; */ + strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr)); /* ;an000; */ + break; /* ;an000; */ + case 'F': /* ;an000; */ + SystemDataType = ConfigFilesMsg; /* ;an000; */ + break; /* ;an000; */ + case 'I': /* ;an000; */ + SystemDataType = ConfigIFSMsg; /* ;an000; */ + strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr)); /* ;an000; */ + break; /* ;an000; */ + case 'L': /* ;an000; */ + SystemDataType = ConfigLastDriveMsg; /* ;an000; */ + break; /* ;an000; */ + case 'S': /* ;an000; */ + SystemDataType = ConfigStacksMsg; /* ;an000; */ + break; /* ;an000; */ + case 'T': /* gga */ /* ;an000; */ + SystemDataType = ConfigInstallMsg; /* gga */ /* ;an000; */ + break; /* gga */ /* ;an000; */ + case 'X': /* ;an000; */ + SystemDataType = ConfigFcbsMsg; /* ;an000; */ + break; /* ;an000; */ + default: /* ;an000; */ + SystemDataType = BlankMsg; /* ;an000; */ + break; /* ;an000; */ + } /* ;an000; */ + Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l; /* ;an000; */ + Sub3_Message(DriverLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + SystemDataOwner, /* ;an000; */ + &Out_Var1, /* ;an000; */ + SystemDataType ); /* ;an000; */ + /* ;an000; */ + NextConfigArenaPtr = ThisConfigArenaPtr; /* ;an000; */ + FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1; /* ;an000; */ + if (ThisConfigArenaPtr -> Signature == (char) 'D') /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + FP_SEG(ThisDeviceDriver) = FP_SEG(ThisConfigArenaPtr) + 1; /* ;an000; */ + FP_OFF(ThisDeviceDriver) = 0; /* ;an000; */ + while ( (a(ThisDeviceDriver) > a(ThisConfigArenaPtr)) && /* ;an000; */ + (a(ThisDeviceDriver) < a(NextConfigArenaPtr)) ) /* ;an000; */ + DisplayDeviceDriver(ThisDeviceDriver,InstalledDeviceDriverMsg); /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1; /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + else { /* ;an000; */ + /* ;an000; */ + Out_Var1 = AddressOf((char far *)ThisArenaPtr); /* ;an000; */ + Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l; /* ;an000; */ + strcpy(Out_Str1,OwnerOf(ThisArenaPtr)); /* ;an000; */ + strcpy(Out_Str2,TypeOf(ThisArenaPtr)); /* ;an000; */ + Sub4a_Message(MainLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &Out_Var1, /* ;an000; */ + Out_Str1, /* ;an000; */ + &Out_Var2, /* ;an000; */ + Out_Str2); /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + FP_SEG(ThisArenaPtr) += ThisArenaPtr -> Paragraphs + 1; /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + Out_Var1 = AddressOf((char far *)ThisArenaPtr); /* ;an000; */ + Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l; /* ;an000; */ + strcpy(Out_Str1,OwnerOf(ThisArenaPtr)); /* ;an000; */ + strcpy(Out_Str2,TypeOf(ThisArenaPtr)); /* ;an000; */ + Sub4a_Message(MainLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &Out_Var1, /* ;an000; */ + Out_Str1, /* ;an000; */ + &Out_Var2, /* ;an000; */ + Out_Str2); /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + return; /* end of MEM main routine */ /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void DisplayDeviceDriver(ThisDeviceDriver,DeviceDriverType) /* ;an000; */ +struct DEVICEHEADER far *ThisDeviceDriver; /* ;an000; */ +int DeviceDriverType; /* ;an000; */ +{ /* ;an000; */ + char LocalDeviceName[16]; /* ;an000; */ + int i; /* ;an000; */ + /* ;an000; */ + if (DataLevel < 2) return; /* ;an000; */ + /* ;an000; */ + if ( ((ThisDeviceDriver -> Attributes) & 0x8000 ) != 0 ) /* ;an000; */ + { for (i = 0; i < 8; i++) LocalDeviceName[i] = ThisDeviceDriver -> Name[i]; /* ;an000; */ + LocalDeviceName[8] = NUL; /* ;an000; */ + /* ;an000; */ + Sub2_Message(DeviceLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + LocalDeviceName, /* ;an000; */ + DeviceDriverType); /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + else { /* ;an000; */ + if ((int) ThisDeviceDriver -> Name[0] == 1) /* ;an000; */ + sprintf(&LocalDeviceName[0],SingleDrive,'A'+BlockDeviceNumber); /* ;an000; */ + else sprintf(&LocalDeviceName[0],MultipleDrives, /* ;an000; */ + 'A'+BlockDeviceNumber, /* ;an000; */ + 'A'+BlockDeviceNumber + ((int) ThisDeviceDriver -> Name[0]) - 1); /* ;an000; */ + /* ;an000; */ + Sub2_Message(DeviceLineMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + LocalDeviceName, /* ;an000; */ + DeviceDriverType); /* ;an000; */ + /* ;an000; */ + BlockDeviceNumber += (int) (ThisDeviceDriver -> Name[0]); /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + return; /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void DisplayBaseSummary() /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + struct PSP_STRUC /* ;an000; */ + { /* ;an000; */ + unsigned int int_20; /* ;an000; */ + unsigned int top_of_memory; /* ;an000; */ + }; /* ;an000; */ + /* ;an000; */ + char far *CarvedPtr; /* ;an000; */ + /* ;an000; */ + unsigned long int total_mem; /* total memory in system */ /* ;an000; */ + unsigned long int avail_mem; /* avail memory in system */ /* ;an000; */ + unsigned long int free_mem; /* free memory */ /* ;an000; */ + struct PSP_STRUC far *PSPptr; /* ;an000; */ + /* ;an000; */ +/* skip a line */ /* ;an000; */ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */ + /* ;an000; */ +/* get PSP info */ /* ;an000; */ + InRegs.h.ah = GET_PSP; /* get PSP function call */ /* ;an000; */ + intdos(&InRegs,&OutRegs); /* ;an000; */ + /* ;an000; */ + FP_SEG(PSPptr) = OutRegs.x.bx; /* PSP segment */ /* ;an000; */ + FP_OFF(PSPptr) = 0; /* offset 0 */ /* ;an000; */ + +/* Get total memory in system */ /* ;an000; */ + int86(MEMORY_DET,&InRegs,&OutRegs); /* ;an000; */ + /* ;an000; */ +/* Convert to bytes */ /* ;an000; */ + total_mem = (unsigned long int) OutRegs.x.ax * 1024l; /* ;an000; */ + avail_mem = total_mem; + InRegs.x.bx = 0; /* ;an000; */ + InRegs.x.ax = 0xc100; /* ;an000; */ + int86x(0x15, &InRegs, &OutRegs, &SegRegs); /* ;an000; */ + if (OutRegs.x.cflag == 0) /* ;an000; */ + { /* ;an000; */ + FP_SEG(CarvedPtr) = SegRegs.es; /* ;an000; */ + FP_OFF(CarvedPtr) = 0; /* ;an000; */ + total_mem = total_mem + ( (unsigned long int) (*CarvedPtr) * 1024l) ; /* ;an002; dms;adjust total for */ + } /* RAM carve value */ + /* ;an000; */ + Sub1_Message(TotalMemoryMsg,STDOUT,Utility_Msg_Class,&total_mem); /* ;an000; */ + /* ;an000; */ + Sub1_Message(AvailableMemoryMsg,STDOUT,Utility_Msg_Class,&avail_mem); /* ;an000; */ + /* ;an000; */ +/* Calculate the total memory used. PSP segment * 16. Subtract from total to get free_mem */ /* ;an000; */ + free_mem = (DOS_TopOfMemory * 16l) - (FP_SEG(PSPptr)*16l); /* ;an000;ac005; */ + /* ;an000; */ + Sub1_Message(FreeMemoryMsg,STDOUT,Utility_Msg_Class,&free_mem); /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + return; /* ;an000; */ + /* ;an000; */ + } /* end of display_low_total */ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void DisplayEMSDetail() /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ +#define EMSGetHandleName 0x5300 /* get handle name function */ /* ;an000; */ +#define EMSGetHandlePages 0x4c00 /* get handle name function */ /* ;an000; */ +#define EMSCODE_83 0x83 /* handle not found error */ /* ;an000; */ +#define EMSMaxHandles 256 /* max number handles */ /* ;an000; */ + /* ;an000; */ + int HandleIndex; /* used to step through handles */ /* ;an000; */ + char HandleName[9]; /* save area for handle name */ /* ;an000; */ + unsigned long int HandleMem; /* memory associated w/handle */ /* ;an000; */ + char TitlesPrinted = FALSE; /* flag for printing titles */ /* ;an000; */ + /* ;an000; */ + HandleName[0] = NUL; /* initialize the array */ /* ;an000; */ + /* ;an000; */ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */ + /* ;an000; */ + segread(&SegRegs); /* ;an000; */ + /* ;an000; */ + SegRegs.es = SegRegs.ds; /* ;an000; */ + /* ;an000; */ + for (HandleIndex = 0; HandleIndex < EMSMaxHandles; HandleIndex++) /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = EMSGetHandleName; /* get handle name */ /* ;an000; */ + InRegs.x.dx = HandleIndex; /* handle in question */ /* ;an000; */ + InRegs.x.di = (unsigned int) HandleName; /* point to handle name */ /* ;an000; */ + int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */ + /* ;an000; */ + HandleName[8] = NUL; /* make sure terminated w/nul */ /* ;an000; */ + /* ;an000; */ + if (OutRegs.h.ah != EMSCODE_83) /* ;an000; */ + { /* ;an000; */ + InRegs.x.ax = EMSGetHandlePages; /* get pages assoc w/this handle */ /* ;an000; */ + InRegs.x.dx = HandleIndex; /* ;an000; */ + int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */ + HandleMem = OutRegs.x.bx; /* ;an000; */ + HandleMem *= (long) (16l*1024l); /* ;an000; */ + /* ;an000; */ + if (!TitlesPrinted) /* ;an000; */ + { /* ;an000; */ + Sub0_Message(Title3Msg,STDOUT,Utility_Msg_Class); /* ;an000; */ + Sub0_Message(Title4Msg,STDOUT,Utility_Msg_Class); /* ;an000; */ + TitlesPrinted = TRUE; /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + if (HandleName[0] == NUL) strcpy(HandleName," "); /* ;an000; */ + EMSPrint(HandleMsg, /* ;an000; */ + STDOUT, /* ;an000; */ + Utility_Msg_Class, /* ;an000; */ + &HandleIndex, /* ;an000; */ + HandleName, /* ;an000; */ + &HandleMem); /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + } /* end for (HandleIndex = 0; HandleIndex < EMSMaxHandles;HandleIndex++) */ /* ;an000; */ + /* ;an000; */ + return; /* ;an000; */ + /* ;an000; */ + } /* end of DisplayEMSDetail */ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void DisplayExtendedSummary() /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + unsigned long int EXTMemoryTot; /* ;an000; */ + /* ;an000; */ + InRegs.h.ah = (unsigned char) 0x52; /* Get SysVar Pointer ;an001; dms;*/ + intdosx(&InRegs,&OutRegs,&SegRegs); /* Invoke interrupt ;an001; dms;*/ + /* ;an000; */ + FP_SEG(SysVarsPtr) = SegRegs.es; /* put pointer in var ;an001; dms;*/ + FP_OFF(SysVarsPtr) = OutRegs.x.bx; /* ;an001; dms;*/ + if ((SysVarsPtr) -> ExtendedMemory != 0) /* extended memory? ;an001; dms;*/ + { /* yes ;an001; dms;*/ + EXTMemoryTot = (long) (SysVarsPtr) -> ExtendedMemory; /* get total EM size ;an001; dms;*/ + EXTMemoryTot *= (long) 1024l; /* at boot time ;an001; dms;*/ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* print blank line ;an001; dms;*/ + Sub1_Message(EXTMemoryMsg,STDOUT,Utility_Msg_Class,&EXTMemoryTot); /* print total EM mem ;an001; dms;*/ + /* ;an000; */ + OutRegs.x.cflag = 0; /* clear carry flag ;an001; dms;*/ + InRegs.x.ax = GetExtended; /* get extended mem ;an001; dms;*/ + /* available */ + int86(CASSETTE, &InRegs, &OutRegs); /* INT 15h call ;an001; dms;*/ + + EXTMemoryTot = (long) OutRegs.x.ax; /* returns 1K mem blocks;an001; dms;*/ + EXTMemoryTot *= (long) 1024l; /* convert to bytes ;an001; dms;*/ + + Sub1_Message(EXTMemAvlMsg,STDOUT,Utility_Msg_Class,&EXTMemoryTot); /* display available ;an001; dms;*/ + } + + /* ;an000; */ + return; /* ;an000; */ + /* ;an000; */ + } /* end of DisplayExtendedSummary */ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void DisplayEMSSummary() /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + unsigned long int EMSFreeMemoryTot; /* ;an000; */ + unsigned long int EMSAvailMemoryTot; /* ;an000; */ + /* ;an000; */ + Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = EMSGetFreePgs; /* get total number unallocated pages */ /* ;an000; */ + int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */ + /* ;an000; */ + EMSFreeMemoryTot = OutRegs.x.bx; /* total unallocated pages in BX */ /* ;an000; */ + EMSFreeMemoryTot *= (long) (16l*1024l); /* ;an000; */ + /* ;an000; */ + EMSAvailMemoryTot = OutRegs.x.dx; /* total pages */ /* ;an000; */ + EMSAvailMemoryTot *= (long) (16l*1024l); /* ;an000; */ + /* ;an000; */ + Sub1_Message(EMSTotalMemoryMsg,STDOUT,Utility_Msg_Class,&EMSAvailMemoryTot); /* ;an000; */ + Sub1_Message(EMSFreeMemoryMsg,STDOUT,Utility_Msg_Class,&EMSFreeMemoryTot); /* ;an000; */ + /* ;an000; */ + return; /* ;an000; */ + /* ;an000; */ + } /* end of DisplayEMSSummary */ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +char EMSInstalled() /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + unsigned int EMSStatus; /* ;an000; */ + unsigned int EMSVersion; /* ;an000; */ + char ReturnFlag; /* ;an000; */ + /* ;an000; */ + if (EMSInstalledFlag == 2) /* ;an000; */ + { /* ;an000; */ + EMSInstalledFlag = FALSE; /* ;an000; */ + InRegs.h.ah = GET_VECT; /* get int 67 vector */ /* ;an000; */ + InRegs.h.al = EMS; /* ;an000; */ + intdosx(&InRegs,&OutRegs,&SegRegs); /* ;an000; */ + /* ;an000; */ + /* only want to try this if vector is non-zero */ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + if ((SegRegs.es != 0) && (OutRegs.x.bx != 0)) /* ;an000; */ + { /* ;an000; */ + InRegs.x.ax = EMSGetStat; /* get EMS status */ /* ;an000; */ + int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */ + EMSStatus = OutRegs.h.ah; /* EMS status returned in AH */ /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = EMSGetVer; /* get EMS version */ /* ;an000; */ + int86x(EMS, &InRegs, &OutRegs, &SegRegs); /* ;an000; */ + EMSVersion = OutRegs.h.al; /* EMS version returned in AL */ /* ;an000; */ + /* ;an000; */ + if ((EMSStatus == 0) && (EMSVersion >= DOSEMSVER)) /* ;an000; */ + EMSInstalledFlag = TRUE; /* ;an000; */ + else /* ;an000; */ + EMSInstalledFlag = FALSE; /* ;an000; */ + /* ;an000; */ + } /* end ((SegRegs.es != 0) && (OutRegs.x.bx != 0)) */ /* ;an000; */ + /* ;an000; */ + } /* end if (EMSInstalledFlag == 2) */ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + return(EMSInstalledFlag); /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +char *OwnerOf(ArenaPtr) /* ;an000; */ +struct ARENA far *ArenaPtr; /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + char far *StringPtr; /* ;an000; */ + unsigned far *WordPtr; /* ;an000; */ + char *o; /* ;an000; */ + unsigned far *EnvironmentSegmentPtr; /* ;an000; */ + unsigned PspSegment; /* ;an000; */ + int i; /* ;an000; */ + /* ;an000; */ + o = &OwnerName[0]; /* ;an000; */ + *o = NUL; /* ;an000; */ + sprintf(o,UnOwned); /* ;an000; */ + /* ;an000; */ + PspSegment = ArenaPtr -> Owner; /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + if (PspSegment == 0) sprintf(o,Ibmdos); /* ;an000; */ + else if (PspSegment == 8) sprintf(o,Ibmbio); /* ;an000; */ + else { /* ;an000; */ + FP_SEG(ArenaPtr) = PspSegment-1; /* -1 'cause Arena is 16 bytes before PSP */ /* ;an000; */ + StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]); /* ;an000; */ + for (i = 0; i < 8; i++) *o++ = *StringPtr++; /* ;an000; */ + *o = (char) '\0'; /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + if (UseArgvZero) GetFromArgvZero(PspSegment,EnvironmentSegmentPtr); /* ;an000; */ + /* ;an000; */ + return(&OwnerName[0]); /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +void GetFromArgvZero(PspSegment,EnvironmentSegmentPtr) /* ;an000; */ +unsigned PspSegment; /* ;an000; */ +unsigned far *EnvironmentSegmentPtr; /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + char far *StringPtr; /* ;an000; */ + char *OutputPtr; /* ;an000; */ + unsigned far *WordPtr; /* ;an000; */ + /* ;an000; */ + OutputPtr = &OwnerName[0]; /* ;an000; */ + /* ;an000; */ + if (UseArgvZero) /* ;an000; */ + { /* ;an000; */ + if (PspSegment < FP_SEG(ArenaHeadPtr)) /* ;an000; */ + { /* ;an000; */ + if (*OutputPtr == NUL) sprintf(OutputPtr,Ibmdos); /* ;an000; */ + } /* ;an000; */ + else { /* ;an000; */ + FP_SEG(EnvironmentSegmentPtr) = PspSegment; /* ;an000; */ + FP_OFF(EnvironmentSegmentPtr) = 44; /* ;an000; */ + /* ;an000; */ +/* FP_SEG(StringPtr) = *EnvironmentSegmentPtr; */ /* ;an000; */ + FP_SEG(StringPtr) = FP_SEG(EnvironmentSegmentPtr); /* ;an000; */ + FP_OFF(StringPtr) = 0; /* ;an000; */ + /* ;an000; */ + while ( (*StringPtr != NUL) || (*(StringPtr+1) != NUL) ) StringPtr++; /* ;an000; */ + /* ;an000; */ + StringPtr += 2; /* ;an000; */ + WordPtr = (unsigned far *) StringPtr; /* ;an000; */ + /* ;an000; */ + if (*WordPtr == 1) /* ;an000; */ + { /* ;an000; */ + StringPtr += 2; /* ;an000; */ + while (*StringPtr != NUL) /* ;an000; */ + *OutputPtr++ = *StringPtr++; /* ;an000; */ + *OutputPtr++ = NUL; /* ;an000; */ + /* ;an000; */ + while ( OutputPtr > &OwnerName[0] ) /* ;an000; */ + { if (*OutputPtr == (char) '.') *OutputPtr = NUL; /* ;an000; */ + if ( (*OutputPtr == (char) '\\') || (*OutputPtr == (char) ':') ) /* ;an000; */ + { OutputPtr++; /* ;an000; */ + break; /* ;an000; */ + } /* ;an000; */ + OutputPtr--; /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + strcpy(&OwnerName[0],OutputPtr); /* ;an000; */ + /* ;an000; */ + return; /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ + +char *TypeOf(Header) /* ;an000; */ +struct ARENA far *Header; /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + char *t; /* ;an000; */ + unsigned PspSegment; /* ;an000; */ + unsigned far *EnvironmentSegmentPtr; /* ;an000; */ + unsigned int Message_Number; + char far *Message_Buf; + unsigned int i; + /* ;an000; */ + t = &TypeText[0]; /* ;an000; */ + *t = NUL; /* ;an000; */ + /* ;an000; */ + Message_Number = 0xff; /* ;an000; initialize number value */ + if (Header -> Owner == 8) Message_Number = StackMsg; /* ;an000; */ + if (Header -> Owner == 0) Message_Number = FreeMsg; /* ;an000; */ + /* ;an000; */ + PspSegment = Header -> Owner; /* ;an000; */ + if (PspSegment < FP_SEG(ArenaHeadPtr)) /* ;an000; */ + { /* ;an000; */ + if (Message_Number == 0xff) Message_Number = BlankMsg; + } /* ;an000; */ + else { /* ;an000; */ + FP_SEG(EnvironmentSegmentPtr) = PspSegment; /* ;an000; */ + FP_OFF(EnvironmentSegmentPtr) = 44; /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + if (PspSegment == FP_SEG(Header)+1) + Message_Number = ProgramMsg; + else if ( *EnvironmentSegmentPtr == FP_SEG(Header)+1 ) + Message_Number = EnvironMsg; + else + Message_Number = DataMsg; + + } + + InRegs.x.ax = Message_Number; /* ;an000; */ + InRegs.h.dh = Utility_Msg_Class; /* ;an000; */ + sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */ + + FP_OFF(Message_Buf) = OutRegs.x.si; /* ;an000; */ + FP_SEG(Message_Buf) = SegRegs.ds; /* ;an000; */ + + i = 0; + while ( *Message_Buf != (char) '\x0' ) + TypeText[i++] = *Message_Buf++; + TypeText[i++] = '\x0'; + + /* ;an000; */ + return(t); /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ +unsigned long AddressOf(Pointer) /* ;an000; */ +char far *Pointer; /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + unsigned long SegmentAddress,OffsetAddress; /* ;an000; */ + /* ;an000; */ + SegmentAddress = (unsigned long) (FP_SEG(Pointer)) * 16l; /* ;an000; */ + OffsetAddress = (unsigned long) (FP_OFF(Pointer)); /* ;an000; */ + /* ;an000; */ + return( SegmentAddress + OffsetAddress); /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ +/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/************************************************************************/ /* ;an000; */ +/* SUB0_MESSAGE - This routine will print only those */ /* ;an000; */ +/* messages that do not require a */ /* ;an000; */ +/* a sublist. */ /* ;an000; */ +/* */ /* ;an000; */ +/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */ +/* Handle - display type */ /* ;an000; */ +/* Message_Type - type of message to display */ /* ;an000; */ +/* */ /* ;an000; */ +/* Outputs : message */ /* ;an000; */ +/* */ /* ;an000; */ +/************************************************************************/ /* ;an000; */ + /* ;an000; */ +void Sub0_Message(Msg_Num,Handle,Message_Type) /* print messages with no subs */ /* ;an000; */ + /* ;an000; */ +int Msg_Num; /* ;an000; */ +int Handle; /* ;an000; */ +unsigned char Message_Type; /* ;an000; */ + /* extended, parse, or utility */ /* ;an000; */ + { /* ;an000; */ + InRegs.x.ax = Msg_Num; /* put message number in AX */ /* ;an000; */ + InRegs.x.bx = Handle; /* put handle in BX */ /* ;an000; */ + InRegs.x.cx = No_Replace; /* no replaceable subparms */ /* ;an000; */ + InRegs.h.dl = No_Input; /* no keyboard input */ /* ;an000; */ + InRegs.h.dh = Message_Type; /* type of message to display */ /* ;an000; */ + sysdispmsg(&InRegs,&OutRegs); /* display the message */ /* ;an000; */ + /* ;an000; */ + return; /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/************************************************************************/ /* ;an000; */ +/* SUB1_MESSAGE - This routine will print only those */ /* ;an000; */ +/* messages that require 1 replaceable */ /* ;an000; */ +/* parm. */ /* ;an000; */ +/* */ /* ;an000; */ +/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */ +/* Handle - display type */ /* ;an000; */ +/* Message_Type - type of message to display */ /* ;an000; */ +/* Replace_Parm - pointer to parm to replace */ /* ;an000; */ +/* */ /* ;an000; */ +/* Outputs : message */ /* ;an000; */ +/* */ /* ;an000; */ +/************************************************************************/ /* ;an000; */ + /* ;an000; */ +void Sub1_Message(Msg_Num,Handle,Message_Type,Replace_Parm) /* ;an000; */ + /* ;an000; */ +int Msg_Num; /* ;an000; */ +int Handle; /* ;an000; */ +unsigned char Message_Type; /* ;an000; */ + /* extended, parse, or utility */ /* ;an000; */ +unsigned long int *Replace_Parm; /* pointer to message to print */ /* ;an000; */ + /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + { /* ;an000; */ + /* ;an000; */ + sublist[1].value = (unsigned far *)Replace_Parm; /* ;an000; */ + sublist[1].size = Sublist_Length; /* ;an000; */ + sublist[1].reserved = Reserved; /* ;an000; */ + sublist[1].id = 1; /* ;an000; */ + sublist[1].flags = Unsgn_Bin_DWord+Right_Align; /* ;an000; */ + sublist[1].max_width = 10; /* ;an000; */ + sublist[1].min_width = 10; /* ;an000; */ + sublist[1].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Msg_Num; /* ;an000; */ + InRegs.x.bx = Handle; /* ;an000; */ + InRegs.x.cx = SubCnt1; /* ;an000; */ + InRegs.h.dl = No_Input; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */ + sysdispmsg(&InRegs,&OutRegs); /* ;an000; */ + } /* ;an000; */ + return; /* ;an000; */ +} /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/************************************************************************/ /* ;an000; */ +/* SUB2_MESSAGE - This routine will print only those */ /* ;an000; */ +/* messages that require 2 replaceable */ /* ;an000; */ +/* parms. */ /* ;an000; */ +/* */ /* ;an000; */ +/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */ +/* Handle - display type */ /* ;an000; */ +/* Message_Type - type of message to display */ /* ;an000; */ +/* Replace_Parm1 - pointer to parm to replace */ /* ;an000; */ +/* Replace_Parm2 - pointer to parm to replace */ /* ;an000; */ +/* Replace_Parm3 - pointer to parm to replace */ /* ;an000; */ +/* */ /* ;an000; */ +/* Outputs : message */ /* ;an000; */ +/* */ /* ;an000; */ +/************************************************************************/ /* ;an000; */ + /* ;an000; */ +void Sub2_Message(Msg_Num,Handle,Message_Type, /* ;an000; */ + Replace_Parm1, /* ;an000; */ + Replace_Message1) /* ;an000; */ + /* ;an000; */ +int Msg_Num; /* ;an000; */ +int Handle; /* ;an000; */ +unsigned char Message_Type; /* ;an000; */ +int Replace_Message1; /* ;an000; */ + /* extended, parse, or utility */ /* ;an000; */ +char *Replace_Parm1; /* pointer to message to print */ /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + { /* ;an000; */ + switch(Msg_Num) /* ;an000; */ + { /* ;an000; */ + case DeviceLineMsg: /* ;an000; */ + /* ;an000; */ + sublist[1].value = (unsigned far *)Replace_Parm1; /* ;an000; */ + sublist[1].size = Sublist_Length; /* ;an000; */ + sublist[1].reserved = Reserved; /* ;an000; */ + sublist[1].id = 1; /* ;an000; */ + sublist[1].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[1].max_width = 0x0008; /* ;an000; */ + sublist[1].min_width = 0x0008; /* ;an000; */ + sublist[1].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Replace_Message1; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */ + /* ;an000; */ + FP_OFF(sublist[2].value) = OutRegs.x.si; /* ;an000; */ + FP_SEG(sublist[2].value) = SegRegs.ds; /* ;an000; */ + sublist[2].size = Sublist_Length; /* ;an000; */ + sublist[2].reserved = Reserved; /* ;an000; */ + sublist[2].id = 2; /* ;an000; */ + sublist[2].flags = Char_Field_ASCIIZ+Right_Align; /* ;an000; */ + sublist[2].max_width = 00; /* ;an000; */ + sublist[2].min_width = 10; /* ;an000; */ + sublist[2].pad_char = Blank; /* ;an000; */ + break; /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Msg_Num; /* ;an000; */ + InRegs.x.bx = Handle; /* ;an000; */ + InRegs.x.cx = SubCnt2; /* ;an000; */ + InRegs.h.dl = No_Input; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */ + sysdispmsg(&InRegs,&OutRegs); /* ;an000; */ + } /* ;an000; */ + return; /* ;an000; */ +} /* ;an000; */ + /* ;an000; */ +/************************************************************************/ /* ;an000; */ +/* SUB3_MESSAGE - This routine will print only those */ /* ;an000; */ +/* messages that require 3 replaceable */ /* ;an000; */ +/* parms. */ /* ;an000; */ +/* */ /* ;an000; */ +/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */ +/* Handle - display type */ /* ;an000; */ +/* Message_Type - type of message to display */ /* ;an000; */ +/* Replace_Parm1 - pointer to parm to replace */ /* ;an000; */ +/* Replace_Parm2 - pointer to parm to replace */ /* ;an000; */ +/* Replace_Parm3 - pointer to parm to replace */ /* ;an000; */ +/* */ /* ;an000; */ +/* Outputs : message */ /* ;an000; */ +/* */ /* ;an000; */ +/************************************************************************/ /* ;an000; */ + /* ;an000; */ +void Sub3_Message(Msg_Num,Handle,Message_Type, /* ;an000; */ + Replace_Parm1, /* ;an000; */ + Replace_Parm2, /* ;an000; */ + Replace_Message1) /* ;an000; */ + /* ;an000; */ +int Msg_Num; /* ;an000; */ +int Handle; /* ;an000; */ +unsigned char Message_Type; /* ;an000; */ +char *Replace_Parm1; /* ;an000; */ +unsigned long int *Replace_Parm2; /* ;an000; */ +int Replace_Message1; /* ;an000; */ + /* extended, parse, or utility */ /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + { /* ;an000; */ + switch(Msg_Num) /* ;an000; */ + { /* ;an000; */ + case DriverLineMsg: /* ;an000; */ + /* ;an000; */ + sublist[1].value = (unsigned far *)Replace_Parm1; /* ;an000; */ + sublist[1].size = Sublist_Length; /* ;an000; */ + sublist[1].reserved = Reserved; /* ;an000; */ + sublist[1].id = 1; /* ;an000; */ + sublist[1].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[1].max_width = 0x0008; /* ;an000; */ + sublist[1].min_width = 0x0008; /* ;an000; */ + sublist[1].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + sublist[2].value = (unsigned far *)Replace_Parm2; /* ;an000; */ + sublist[2].size = Sublist_Length; /* ;an000; */ + sublist[2].reserved = Reserved; /* ;an000; */ + sublist[2].id = 2; /* ;an000; */ + sublist[2].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */ + sublist[2].max_width = 0x0006; /* ;an000; */ + sublist[2].min_width = 0x0006; /* ;an000; */ + sublist[2].pad_char = 0x0030; /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Replace_Message1; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */ + /* ;an000; */ + FP_OFF(sublist[3].value) = OutRegs.x.si; /* ;an000; */ + FP_SEG(sublist[3].value) = SegRegs.ds; /* ;an000; */ + sublist[3].size = Sublist_Length; /* ;an000; */ + sublist[3].reserved = Reserved; /* ;an000; */ + sublist[3].id = 3; /* ;an000; */ + sublist[3].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[3].max_width = 00; /* ;an000; */ + sublist[3].min_width = 10; /* ;an000; */ + sublist[3].pad_char = Blank; /* ;an000; */ + break; /* ;an000; */ + /* ;an000; */ + case HandleMsg: /* ;an000; */ + sublist[1].value = (unsigned far *)Replace_Parm1; /* ;an000; */ + sublist[1].size = Sublist_Length; /* ;an000; */ + sublist[1].reserved = Reserved; /* ;an000; */ + sublist[1].id = 1; /* ;an000; */ + sublist[1].flags = Unsgn_Bin_Byte+Right_Align; /* ;an000; */ + sublist[1].max_width = 0x0009; /* ;an000; */ + sublist[1].min_width = 0x0009; /* ;an000; */ + sublist[1].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + sublist[2].value = (unsigned far *)Replace_Parm2; /* ;an000; */ + sublist[2].size = Sublist_Length; /* ;an000; */ + sublist[2].reserved = Reserved; /* ;an000; */ + sublist[2].id = 2; /* ;an000; */ + sublist[2].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[2].max_width = 0x0008; /* ;an000; */ + sublist[2].min_width = 0x0008; /* ;an000; */ + sublist[2].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Replace_Message1; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */ + /* ;an000; */ + FP_OFF(sublist[3].value) = OutRegs.x.si; /* ;an000; */ + FP_SEG(sublist[3].value) = SegRegs.ds; /* ;an000; */ + sublist[3].size = Sublist_Length; /* ;an000; */ + sublist[3].reserved = Reserved; /* ;an000; */ + sublist[3].id = 3; /* ;an000; */ + sublist[3].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */ + sublist[3].max_width = 00; /* ;an000; */ + sublist[3].min_width = 10; /* ;an000; */ + sublist[3].pad_char = Blank; /* ;an000; */ + break; /* ;an000; */ + /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Msg_Num; /* ;an000; */ + InRegs.x.bx = Handle; /* ;an000; */ + InRegs.x.cx = SubCnt3; /* ;an000; */ + InRegs.h.dl = No_Input; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */ + sysdispmsg(&InRegs,&OutRegs); /* ;an000; */ + } /* ;an000; */ + return; /* ;an000; */ +} /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/************************************************************************/ /* ;an000; */ +/* SUB4_MESSAGE - This routine will print only those */ /* ;an000; */ +/* messages that require 4 replaceable */ /* ;an000; */ +/* parms. */ /* ;an000; */ +/* */ /* ;an000; */ +/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */ +/* Handle - display type */ /* ;an000; */ +/* Message_Type - type of message to display */ /* ;an000; */ +/* Replace_Parm1 - pointer to parm to replace */ /* ;an000; */ +/* Replace_Parm2 - pointer to parm to replace */ /* ;an000; */ +/* Replace_Parm3 - pointer to parm to replace */ /* ;an000; */ +/* Dynamic_Parm - parm number to use as replaceable */ /* ;an000; */ +/* */ /* ;an000; */ +/* Outputs : message */ /* ;an000; */ +/* */ /* ;an000; */ +/************************************************************************/ /* ;an000; */ + /* ;an000; */ +void Sub4_Message(Msg_Num,Handle,Message_Type, /* ;an000; */ + Replace_Value1, /* ;an000; */ + Replace_Message1, /* ;an000; */ + Replace_Value2, /* ;an000; */ + Replace_Message2) /* ;an000; */ + /* ;an000; */ +int Msg_Num; /* ;an000; */ +int Handle; /* ;an000; */ +unsigned char Message_Type; /* ;an000; */ +unsigned long int *Replace_Value1; /* ;an000; */ +int Replace_Message1; /* ;an000; */ +unsigned long int *Replace_Value2; /* ;an000; */ +int Replace_Message2; /* ;an000; */ + /* extended, parse, or utility */ /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + { /* ;an000; */ + switch(Msg_Num) /* ;an000; */ + { /* ;an000; */ + case MainLineMsg: /* ;an000; */ + /* ;an000; */ + sublist[1].value = (unsigned far *)Replace_Value1; /* ;an000; */ + sublist[1].size = Sublist_Length; /* ;an000; */ + sublist[1].reserved = Reserved; /* ;an000; */ + sublist[1].id = 1; /* ;an000; */ + sublist[1].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */ + sublist[1].max_width = 06; /* ;an000; */ + sublist[1].min_width = 06; /* ;an000; */ + sublist[1].pad_char = 0x0030; /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Replace_Message1; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */ + /* ;an000; */ + FP_OFF(sublist[2].value) = OutRegs.x.si; /* ;an000; */ + FP_SEG(sublist[2].value) = SegRegs.ds; /* ;an000; */ + sublist[2].size = Sublist_Length; /* ;an000; */ + sublist[2].reserved = Reserved; /* ;an000; */ + sublist[2].id = 2; /* ;an000; */ + sublist[2].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[2].max_width = 0x0008; /* ;an000; */ + sublist[2].min_width = 0x0008; /* ;an000; */ + sublist[2].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + sublist[3].value = (unsigned far *)Replace_Value2; /* ;an000; */ + sublist[3].size = Sublist_Length; /* ;an000; */ + sublist[3].reserved = Reserved; /* ;an000; */ + sublist[3].id = 3; /* ;an000; */ + sublist[3].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */ + sublist[3].max_width = 06; /* ;an000; */ + sublist[3].min_width = 06; /* ;an000; */ + sublist[3].pad_char = 0x0030; /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Replace_Message2; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + sysgetmsg(&InRegs,&SegRegs,&OutRegs); /* ;an000; */ + /* ;an000; */ + FP_OFF(sublist[4].value) = OutRegs.x.si; /* ;an000; */ + FP_SEG(sublist[4].value) = SegRegs.ds; /* ;an000; */ + sublist[4].size = Sublist_Length; /* ;an000; */ + sublist[4].reserved = Reserved; /* ;an000; */ + sublist[4].id = 4; /* ;an000; */ + sublist[4].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[4].max_width = 0; /* ;an000; */ + sublist[4].min_width = 10; /* ;an000; */ + sublist[4].pad_char = Blank; /* ;an000; */ + break; /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Msg_Num; /* ;an000; */ + InRegs.x.bx = Handle; /* ;an000; */ + InRegs.x.cx = SubCnt4; /* ;an000; */ + InRegs.h.dl = No_Input; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */ + sysdispmsg(&InRegs,&OutRegs); /* ;an000; */ + } /* ;an000; */ + return; /* ;an000; */ +} /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/************************************************************************/ /* ;an000; */ +/* SUB4a_MESSAGE - This routine will print only those */ /* ;an000; */ +/* messages that require 4 replaceable */ /* ;an000; */ +/* parms. */ /* ;an000; */ +/* */ /* ;an000; */ +/* Inputs : Msg_Num - number of applicable message */ /* ;an000; */ +/* Handle - display type */ /* ;an000; */ +/* Message_Type - type of message to display */ /* ;an000; */ +/* Replace_Parm1 - pointer to parm to replace */ /* ;an000; */ +/* Replace_Parm2 - pointer to parm to replace */ /* ;an000; */ +/* Replace_Parm3 - pointer to parm to replace */ /* ;an000; */ +/* Dynamic_Parm - parm number to use as replaceable */ /* ;an000; */ +/* */ /* ;an000; */ +/* Outputs : message */ /* ;an000; */ +/* */ /* ;an000; */ +/************************************************************************/ /* ;an000; */ + /* ;an000; */ +void Sub4a_Message(Msg_Num,Handle,Message_Type, /* ;an000; */ + Replace_Value1, /* ;an000; */ + Replace_Message1, /* ;an000; */ + Replace_Value2, /* ;an000; */ + Replace_Message2) /* ;an000; */ + /* ;an000; */ +int Msg_Num; /* ;an000; */ +int Handle; /* ;an000; */ +unsigned char Message_Type; /* ;an000; */ +unsigned long int *Replace_Value1; /* ;an000; */ +char *Replace_Message1; /* ;an000; */ +unsigned long int *Replace_Value2; /* ;an000; */ +char *Replace_Message2; /* ;an000; */ + /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + /* ;an000; */ + { /* ;an000; */ + switch(Msg_Num) /* ;an000; */ + { /* ;an000; */ + case MainLineMsg: /* ;an000; */ + /* ;an000; */ + sublist[1].value = (unsigned far *)Replace_Value1; /* ;an000; */ + sublist[1].size = Sublist_Length; /* ;an000; */ + sublist[1].reserved = Reserved; /* ;an000; */ + sublist[1].id = 1; /* ;an000; */ + sublist[1].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */ + sublist[1].max_width = 06; /* ;an000; */ + sublist[1].min_width = 06; /* ;an000; */ + sublist[1].pad_char = 0x0030; /* ;an000; */ + /* ;an000; */ + sublist[2].value = (unsigned far *)Replace_Message1; /* ;an000; */ + sublist[2].size = Sublist_Length; /* ;an000; */ + sublist[2].reserved = Reserved; /* ;an000; */ + sublist[2].id = 2; /* ;an000; */ + sublist[2].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[2].max_width = 0x0008; /* ;an000; */ + sublist[2].min_width = 0x0008; /* ;an000; */ + sublist[2].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + sublist[3].value = (unsigned far *)Replace_Value2; /* ;an000; */ + sublist[3].size = Sublist_Length; /* ;an000; */ + sublist[3].reserved = Reserved; /* ;an000; */ + sublist[3].id = 3; /* ;an000; */ + sublist[3].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */ + sublist[3].max_width = 06; /* ;an000; */ + sublist[3].min_width = 06; /* ;an000; */ + sublist[3].pad_char = 0x0030; /* ;an000; */ + /* ;an000; */ + sublist[4].value = (unsigned far *)Replace_Message2; /* ;an000; */ + sublist[4].size = Sublist_Length; /* ;an000; */ + sublist[4].reserved = Reserved; /* ;an000; */ + sublist[4].id = 4; /* ;an000; */ + sublist[4].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[4].max_width = 0; /* ;an000; */ + sublist[4].min_width = 10; /* ;an000; */ + sublist[4].pad_char = Blank; /* ;an000; */ + break; /* ;an000; */ + } /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Msg_Num; /* ;an000; */ + InRegs.x.bx = Handle; /* ;an000; */ + InRegs.x.cx = SubCnt4; /* ;an000; */ + InRegs.h.dl = No_Input; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */ + sysdispmsg(&InRegs,&OutRegs); /* ;an000; */ + } /* ;an000; */ + return; /* ;an000; */ +} /* ;an000; */ + /* ;an000; */ + /* ;an000; */ +/************************************************************************/ /* ;an000; */ +/* EMSPrint - This routine will print the message */ /* ;an000; */ +/* necessary for EMS reporting. */ /* ;an000; */ +/* */ /* ;an000; */ +/* Outputs : message */ /* ;an000; */ +/* */ /* ;an000; */ +/************************************************************************/ /* ;an000; */ + /* ;an000; */ +void EMSPrint(Msg_Num,Handle,Message_Type, /* ;an000; */ + Replace_Value1, /* ;an000; */ + Replace_Message1, /* ;an000; */ + Replace_Value2) /* ;an000; */ + /* ;an000; */ +int Msg_Num; /* ;an000; */ +int Handle; /* ;an000; */ +unsigned char Message_Type; /* ;an000; */ +int *Replace_Value1; /* ;an000; */ +char *Replace_Message1; /* ;an000; */ +unsigned long int *Replace_Value2; /* ;an000; */ + /* extended, parse, or utility */ /* ;an000; */ +{ /* ;an000; */ + /* ;an000; */ + { /* ;an000; */ + sublist[1].value = (unsigned far *)Replace_Value1; /* ;an000; */ + sublist[1].size = Sublist_Length; /* ;an000; */ + sublist[1].reserved = Reserved; /* ;an000; */ + sublist[1].id = 1; /* ;an000; */ + sublist[1].flags = Unsgn_Bin_Word+Right_Align; /* ;an000; */ + sublist[1].max_width = 03; /* ;an000; */ + sublist[1].min_width = 03; /* ;an000; */ + sublist[1].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + sublist[2].value = (unsigned far *)Replace_Message1; /* ;an000; */ + sublist[2].size = Sublist_Length; /* ;an000; */ + sublist[2].reserved = Reserved; /* ;an000; */ + sublist[2].id = 2; /* ;an000; */ + sublist[2].flags = Char_Field_ASCIIZ+Left_Align; /* ;an000; */ + sublist[2].max_width = 0x0008; /* ;an000; */ + sublist[2].min_width = 0x0008; /* ;an000; */ + sublist[2].pad_char = Blank; /* ;an000; */ + /* ;an000; */ + sublist[3].value = (unsigned far *)Replace_Value2; /* ;an000; */ + sublist[3].size = Sublist_Length; /* ;an000; */ + sublist[3].reserved = Reserved; /* ;an000; */ + sublist[3].id = 3; /* ;an000; */ + sublist[3].flags = Bin_Hex_DWord+Right_Align; /* ;an000; */ + sublist[3].max_width = 06; /* ;an000; */ + sublist[3].min_width = 06; /* ;an000; */ + sublist[3].pad_char = 0x0030; /* ;an000; */ + /* ;an000; */ + InRegs.x.ax = Msg_Num; /* ;an000; */ + InRegs.x.bx = Handle; /* ;an000; */ + InRegs.x.cx = SubCnt3; /* ;an000; */ + InRegs.h.dl = No_Input; /* ;an000; */ + InRegs.h.dh = Message_Type; /* ;an000; */ + InRegs.x.si = (unsigned int)&sublist[1]; /* ;an000; */ + sysdispmsg(&InRegs,&OutRegs); /* ;an000; */ + } /* ;an000; */ + return; /* ;an000; */ +} /* ;an000; */ + /* ;an000; */ +/*----------------------------------------------------------------------+ +| | +| SUBROUTINE NAME: PARSE_INIT | +| | +| SUBROUTINE FUNCTION: | +| | +| This routine is called by the FILESYS MAIN routine to initialize| +| the parser data structures. | +| | +| INPUT: | +| none | +| | +| OUTPUT: | +| properly initialized parser control blocks | +| | ++----------------------------------------------------------------------*/ +void parse_init() /* ;an000; */ + { /* ;an000; */ + p_p.p_parmsx_address = &p_px; /* address of extended parm list */ /* ;an000; */ + p_p.p_num_extra = 0; /* ;an000; */ + /* ;an000; */ + p_px.p_minp = 0; /* ;an000; */ + p_px.p_maxp = 0; /* ;an000; */ + p_px.p_maxswitch = 2; /* ;an000; */ + p_px.p_control[0] = &p_con1; /* ;an000; */ + p_px.p_control[1] = &p_con2; /* ;an000; */ + p_px.p_keyword = 0; /* ;an000; */ + /* ;an000; */ + p_con1.p_match_flag = p_none; /* ;an000; */ + p_con1.p_function_flag = p_cap_file; /* ;an000; */ + p_con1.p_result_buf = (unsigned int)&p_result1; /* ;an000; */ + p_con1.p_value_list = (unsigned int)&p_noval; /* ;an000; */ + p_con1.p_nid = 1; /* ;an000; */ + strcpy(p_con1.p_keyorsw,"/DEBUG"+NUL); /* ;an000; */ + /* ;an000; */ + p_con2.p_match_flag = p_none; /* ;an000; */ + p_con2.p_function_flag = p_cap_file; /* ;an000; */ + p_con2.p_result_buf = (unsigned int)&p_result2; /* ;an000; */ + p_con2.p_value_list = (unsigned int)&p_noval; /* ;an000; */ + p_con2.p_nid = 1; /* ;an000; */ + strcpy(p_con2.p_keyorsw,"/PROGRAM"+NUL); /* ;an000; */ + /* ;an000; */ + p_noval.p_val_num = 0; /* ;an000; */ + /* ;an000; */ + p_result1.P_Type = 0; /* ;an000; */ + p_result1.P_Item_Tag = 0; /* ;an000; */ + p_result1.P_SYNONYM_Ptr = 0; /* ;an000; */ + p_result1.p_result_buff = 0; /* ;an000; */ + /* ;an000; */ + p_result2.P_Type = 0; /* ;an000; */ + p_result2.P_Item_Tag = 0; /* ;an000; */ + p_result2.P_SYNONYM_Ptr = 0; /* ;an000; */ + p_result2.p_result_buff = 0; /* ;an000; */ + /* ;an000; */ + return; /* ;an000; */ + /* ;an000; */ + } /* end parse_init */ /* ;an000; */ + + +/************************************************************************/ /* ;an000; */ +/* Parse_Message - This routine will print only those */ +/* messages that require 1 replaceable */ +/* parm. */ +/* */ +/* Inputs : Msg_Num - number of applicable message */ +/* Handle - display type */ +/* Message_Type - type of message to display */ +/* Replace_Parm - pointer to parm to replace */ +/* */ +/* Outputs : message */ +/* */ +/************************************************************************/ + +void Parse_Message(Msg_Num,Handle,Message_Type) /*;an003; dms; */ + /*;an003; dms; */ +int Msg_Num; /*;an003; dms; */ +int Handle; /*;an003; dms; */ +unsigned char Message_Type; /*;an003; dms; */ + /*;an003; dms; */ +{ /*;an003; dms; */ +char far *Cmd_Ptr; /*;an003; dms; */ + /*;an003; dms; */ + /*;an003; dms; */ + { /*;an003; dms; */ + segread(&SegRegs); /*;an003; dms; */ + FP_SEG(Cmd_Ptr) = SegRegs.ds; /*;an003; dms; */ + FP_OFF(Cmd_Ptr) = OutRegs.x.si; /*;an003; dms; */ + *Cmd_Ptr = '\0'; /*;an003; dms; */ + /*;an003; dms; */ + FP_SEG(sublist[1].value) = SegRegs.ds; /*;an003; dms; */ + FP_OFF(sublist[1].value) = Parse_Ptr; /*;an003; dms; */ + sublist[1].size = Sublist_Length; /*;an003; dms; */ + sublist[1].reserved = Reserved; /*;an003; dms; */ + sublist[1].id = 0; /*;an003; dms; */ + sublist[1].flags = Char_Field_ASCIIZ+Left_Align; /*;an003; dms; */ + sublist[1].max_width = 40; /*;an003; dms; */ + sublist[1].min_width = 01; /*;an003; dms; */ + sublist[1].pad_char = Blank; /*;an003; dms; */ + /*;an003; dms; */ + InRegs.x.ax = Msg_Num; /*;an003; dms; */ + InRegs.x.bx = Handle; /*;an003; dms; */ + InRegs.x.cx = SubCnt1; /*;an003; dms; */ + InRegs.h.dl = No_Input; /*;an003; dms; */ + InRegs.h.dh = Message_Type; /*;an003; dms; */ + InRegs.x.si = (unsigned int)&sublist[1]; /*;an003; dms; */ + sysdispmsg(&InRegs,&OutRegs); /*;an003; dms; */ + } /*;an003; dms; */ + return; /*;an003; dms; */ +} /*;an003; dms; */ + + 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 @@ + +:util MEM + +:class 1 + +:class A +:use COMMON1 ;Incorrect DOS version +:def 10 CR,LF +:def 11 " Address Name Size Type ",CR,LF +:def 12 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF +:def 13 " Handle EMS Name Size ",CR,LF +:def 14 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF +:def 15 " %1 %2 %3 %4",CR,LF +:def 16 " %1 %2 %3 ",CR,LF +:def 17 " %1 %2 ",CR,LF ;fix in usa +:def 18 "%1 bytes total memory",CR,LF +:def 19 "%1 bytes available",CR,LF +:def 20 "%1 largest executable program size",CR,LF +:def 21 "%1 bytes total EMS memory",CR,LF +:def 22 "%1 bytes free EMS memory",CR,LF +:def 23 "%1 bytes total extended memory",CR,LF +:def 24 "Interrupt Vector",0 +:def 25 "ROM Communication Area",0 +:def 26 "DOS Communication Area",0 +:def 27 "IBMBIO",0 +:def 28 "IBMDOS",0 +:def 29 "System Data",0 +:def 30 "System Program",0 +:def 31 "System Device Driver",0 +:def 32 "Installed Device Driver",0 +:def 33 "%1:",0 +:def 34 "%1: - %2:",0 +:def 35 "BUFFERS=",0 +:def 36 "FILES=",0 +:def 37 "FCBS=",0 +:def 38 "STACKS=",0 +:def 39 "DEVICE=",0 +:def 40 "IFS=",0 +:def 45 "INSTALL=",0 + +:class B +:def 41 "LASTDRIVE=",0 +:def 42 "----------",0 +:def 43 " ",0 +:def 44 " %1 %2 %3",CR,LF +:def 46 "%1 bytes available extended memory",CR,LF +:def 47 "System Stacks",0 +:def 48 "-- Free --",0 +:def 49 "Program",0 +:def 50 "Environment",0 +:def 51 "Data",0 + +: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 @@ +/************************************************************************/ +/* MSGDEF.H - This include file defines each message type */ +/* that can occur in MEM. These defines will */ +/* be used by MEM to build the proper message. */ +/* */ +/* Date : 10/29/87 */ +/************************************************************************/ + +#define NewLineMsg 10 +#define Title1Msg 11 +#define Title2Msg 12 +#define Title3Msg 13 +#define Title4Msg 14 +#define MainLineMsg 15 +#define DriverLineMsg 16 +#define DeviceLineMsg 17 +#define TotalMemoryMsg 18 +#define AvailableMemoryMsg 19 +#define FreeMemoryMsg 20 +#define EMSTotalMemoryMsg 21 +#define EMSFreeMemoryMsg 22 +#define EXTMemoryMsg 23 +#define InterruptVectorMsg 24 +#define ROMCommunicationAreaMsg 25 +#define DOSCommunicationAreaMsg 26 +#define IbmbioMsg 27 +#define IbmdosMsg 28 +#define SystemDataMsg 29 +#define SystemProgramMsg 30 +#define SystemDeviceDriverMsg 31 +#define InstalledDeviceDriverMsg 32 +#define SingleDriveMsg 33 +#define MultipleDrivesMsg 34 +#define ConfigBuffersMsg 35 +#define ConfigFilesMsg 36 +#define ConfigFcbsMsg 37 +#define ConfigStacksMsg 38 +#define ConfigDeviceMsg 39 +#define ConfigIFSMsg 40 +#define ConfigLastDriveMsg 41 +#define ConfigInstallMsg 45 /* gga */ +#define UnownedMsg 42 +#define BlankMsg 43 +#define HandleMsg 44 +#define EXTMemAvlMsg 46 /* ;an001; dms;*/ +#define StackMsg 47 +#define FreeMsg 48 +#define ProgramMsg 49 +#define EnvironMsg 50 +#define DataMsg 51 + + +#define ParseError1Msg 01 +#define ParseError10Msg 10 + +/************************************************************************/ +/* Message Retriever Standard Equates */ +/************************************************************************/ + +#define Ext_Err_Class 0x0001 +#define Parse_Err_Class 0x0002 +#define Utility_Msg_Class 0x00ff +#define No_Handle 0xffff +#define No_Replace 0x0000 +#define Sublist_Length 0x000b +#define Reserved 0x0000 +#define Left_Align 0x0000 +#define Right_Align 0x0080 +#define Char_Field_Char 0x0000 +#define Char_Field_ASCIIZ 0x0010 +#define Unsgn_Bin_Byte 0x0011 +#define Unsgn_Bin_Word 0x0021 +#define Unsgn_Bin_DWord 0x0031 +#define Sgn_Bin_Byte 0x0012 +#define Sgn_Bin_Word 0x0022 +#define Sgn_Bin_DWord 0x0032 +#define Bin_Hex_Byte 0x0013 +#define Bin_Hex_Word 0x0023 +#define Bin_Hex_DWord 0x0033 +#define No_Input 0x0000 +#define STDIN 0x0000 +#define STDOUT 0x0001 +#define STDERR 0x0002 +#define Blank 0x0020 + +#define SubCnt1 0x0001 +#define SubCnt2 0x0002 +#define SubCnt3 0x0003 +#define SubCnt4 0x0004 +#define SubCnt5 0x0005 + +#define CarryFlag 0x0001 + 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 @@ +/*  */ +/*----------------------------------------------------------------------+ +| | +| This file contains the structures and defines that are needed to use | +| the parser from a C program. | +| | +| | +| Date: 5-21-87 | +| | ++----------------------------------------------------------------------*/ + + +#define p_len_parms 4 /* length of p_parms */ +#define p_i_use_default 0 /* no extra stuff specified */ +#define p_i_have_delim 1 /* extra delimiter specified */ +#define p_i_have_eol 2 /* extra EOL specified */ + +struct p_parms + { + struct p_parmsx *p_parmsx_address; /* address of p_parmsx */ + unsigned char p_num_extra; /* number of extra stuff */ + unsigned char p_len_extra_delim; /* length of extra delimiter */ + char p_extra_delim[30]; /* extra delimiters */ + }; + +struct p_parmsx + { + unsigned char p_minp; /* Minimum positional number */ + unsigned char p_maxp; /* Maximum positional number */ + unsigned char p_maxswitch; /* Maximum switches */ + struct p_control_blk *p_control[2]; /* Address of the 1st CONTROL block */ + unsigned char p_keyword; /* Keyword count */ + }; + + +struct p_control_blk + { + unsigned int p_match_flag; /* Controls type matched */ + unsigned int p_function_flag; /* Function should be taken */ + unsigned int p_result_buf; /* Result buffer address */ + unsigned int p_value_list; /* Value list address */ + unsigned char p_nid; /* # of keyword/SW synonyms */ + char p_keyorsw[64]; /* keyword or sw */ + }; + +/* Match_Flags */ + +#define p_num_val 0x8000 /* Numeric Value */ +#define p_snum_val 0x4000 /* Signed numeric value */ +#define p_simple_s 0x2000 /* Simple string */ +#define p_date_s 0x1000 /* Date string */ +#define p_time_s 0x0800 /* Time string */ +#define p_cmpx_s 0x0400 /* Complex string */ +#define p_file_spc 0x0200 /* File Spec */ +#define p_drv_only 0x0100 /* Drive Only */ +#define p_qu_string 0x0080 /* Quoted string */ +#define p_ig_colon 0x0010 /* Ignore colon at end in match */ +#define p_repeat 0x0002 /* Repeat allowed */ +#define p_optional 0x0001 /* Optional */ +#define p_none 0x0000 + +/*----------------------------------------------------------------------+ +| | +| Function flags | +| | ++----------------------------------------------------------------------*/ + +#define p_cap_file 0x0001 /* CAP result by file table */ +#define p_cap_char 0x0002 /* CAP result by character table */ +#define p_rm_colon 0x0010 /* Remove ":" at the end */ + + + +#define p_nval_none 0 /* no value list ID */ +#define p_nval_range 1 /* range list ID */ +#define p_nval_value 2 /* value list ID */ +#define p_nval_string 3 /* string list ID */ +#define p_len_range 9 /* Length of a range choice(two DD plus one DB) */ +#define p_len_value 5 /* Length of a value choice(one DD plus one DB) */ +#define p_len_string 3 /* Length of a string choice(one DW plus one DB) */ + +/*----------------------------------------------------------------------+ +| | +| Value block structure | +| | ++----------------------------------------------------------------------*/ + +struct p_value_blk + { + unsigned char p_val_num; + }; + + +/*----------------------------------------------------------------------+ +| | +| Result block structure | +| | ++----------------------------------------------------------------------*/ + +struct p_result_blk + { + unsigned char P_Type; /* Type returned */ + unsigned char P_Item_Tag; /* Matched item tag */ + unsigned int P_SYNONYM_Ptr; /* pointer to Synonym list returned */ + unsigned long int p_result_buff; /* result value */ + }; + +/*----------------------------------------------------------------------+ +| | +| type | +| | ++----------------------------------------------------------------------*/ + +#define p_eol 0 /* End of line */ +#define p_number 1 /* Number */ +#define p_list_idx 2 /* List Index */ +#define p_string 3 /* String */ +#define p_complex 4 /* Complex */ +#define p_file_spec 5 /* File Spec */ +#define p_drive 6 /* Drive */ +#define p_date_f 7 /* Date */ +#define p_time_f 8 /* Time */ +#define p_quoted_string 9 /* Quoted String */ + +#define p_no_tag 0x0FF /* No ITEM_TAG found */ + +/*----------------------------------------------------------------------+ +| | +| following return code will be returned in the AX register. | +| | ++----------------------------------------------------------------------*/ + +#define p_no_error 0 /* No error */ +#define p_too_many 1 /* Too many operands */ +#define p_op_missing 2 /* Required operand missing */ +#define p_not_in_sw 3 /* Not in switch list provided */ +#define p_not_in_key 4 /* Not in keyword list provided */ +#define p_out_of_range 6 /* Out of range specified */ +#define p_not_in_val 7 /* Not in value list provided */ +#define p_not_in_str 8 /* Not in string list provided */ +#define p_syntax 9 /* Syntax error */ +#define p_rc_eol 0x0ffff /* End of command line */ + + 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 @@ +page 60,132 +name _msgret +title C to Message Retriever +;------------------------------------------------------------------- +; +; MODULE: _msgret +; +; PURPOSE: Supplies an interface between C programs and +; the DOS 3.3 message retriever +; +; CALLING FORMAT: +; msgret(&inregs,&outregs); +; +; DATE: 5-21-87 +; +;------------------------------------------------------------------- + + INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000; + + MSG_UTILNAME ;IDENTIFY THE COMPONENT ;AN000; + +;------------------------------------------------------------------- +;------------------------------------------------------------------- + + +_TEXT SEGMENT BYTE PUBLIC 'CODE' +_TEXT ENDS +_DATA SEGMENT WORD PUBLIC 'DATA' +_DATA ENDS +CONST SEGMENT WORD PUBLIC 'CONST' +CONST ENDS +_BSS SEGMENT WORD PUBLIC 'BSS' +_BSS ENDS + +DGROUP GROUP CONST, _BSS, _DATA + ASSUME CS: DGROUP, DS: DGROUP, SS: DGROUP, ES: NOTHING + + public data_sysloadmsg + public data_sysdispmsg + public data_sysgetmsg + +_DATA SEGMENT + + MSG_SERVICES + MSG_SERVICES + MSG_SERVICES + MSG_SERVICES ;AN000; + + +data_sysloadmsg proc far + + push bp ; save user's base pointer + mov bp,sp ; set bp to current sp + push di ; save some registers + push si + +; copy C inregs into proper registers + + mov di,[bp+4+4] ; fix di (arg 0) + +;------------------------------------------------------------------- + + mov ax,[di+0ah] ; load di + push ax ; the di value from inregs is now on stack + + mov ax,[di+00] ; get inregs.x.ax + mov bx,[di+02] ; get inregs.x.bx + mov cx,[di+04] ; get inregs.x.cx + mov dx,[di+06] ; get inregs.x.dx + mov si,[di+08] ; get inregs.x.si + pop di ; get inregs.x.di from stack + + push bp ; save base pointer + +;------------------------------------------------------------------- + + call sysloadmsg ; call the message retriever + +;------------------------------------------------------------------- + + pop bp ; restore base pointer + push di ; the di value from call is now on stack + mov di,[bp+6+4] ; fix di (arg 1) + + mov [di+00],ax ; load outregs.x.ax + mov [di+02],bx ; load outregs.x.bx + mov [di+04],cx ; load outregs.x.cx + mov [di+06],dx ; load outregs.x.dx + mov [di+08],si ; load outregs.x.si + + lahf ; get flags into ax + mov al,ah ; move into low byte + mov [di+0ch],ax ; load outregs.x.cflag + + pop ax ; get di from stack + mov [di+0ah],ax ; load outregs.x.di + +;------------------------------------------------------------------- + + pop si ; restore registers + pop di + mov sp,bp ; restore sp + pop bp ; restore user's bp + ret + +data_sysloadmsg endp + + +data_sysdispmsg proc far + + push bp ; save user's base pointer + mov bp,sp ; set bp to current sp + push di ; save some registers + push si + +; copy C inregs into proper registers + + mov di,[bp+4+4] ; fix di (arg 0) + +;------------------------------------------------------------------- + + mov ax,[di+0ah] ; load di + push ax ; the di value from inregs is now on stack + + mov ax,[di+00] ; get inregs.x.ax + mov bx,[di+02] ; get inregs.x.bx + mov cx,[di+04] ; get inregs.x.cx + mov dx,[di+06] ; get inregs.x.dx + mov si,[di+08] ; get inregs.x.si + pop di ; get inregs.x.di from stack + + push bp ; save base pointer + +;------------------------------------------------------------------- + + call sysdispmsg + +;------------------------------------------------------------------- + + pop bp ; restore base pointer + push di ; the di value from call is now on stack + mov di,[bp+6+4] ; fix di (arg 1) + + mov [di+00],ax ; load outregs.x.ax + mov [di+02],bx ; load outregs.x.bx + mov [di+04],cx ; load outregs.x.cx + mov [di+06],dx ; load outregs.x.dx + mov [di+08],si ; load outregs.x.si + + lahf ; get flags into ax + mov al,ah ; move into low byte + mov [di+0ch],ax ; load outregs.x.cflag + + pop ax ; get di from stack + mov [di+0ah],ax ; load outregs.x.di + +;------------------------------------------------------------------- + + pop si ; restore registers + pop di + mov sp,bp ; restore sp + pop bp ; restore user's bp + ret + +data_sysdispmsg endp + + +data_sysgetmsg proc far + + push bp ; save user's base pointer + mov bp,sp ; set bp to current sp + push di ; save some registers + push si + +; copy C inregs into proper registers + + mov di,[bp+4+4] ; fix di (arg 0) + +;------------------------------------------------------------------- + + mov ax,[di+0ah] ; load di + push ax ; the di value from inregs is now on stack + + mov ax,[di+00] ; get inregs.x.ax + mov bx,[di+02] ; get inregs.x.bx + mov cx,[di+04] ; get inregs.x.cx + mov dx,[di+06] ; get inregs.x.dx + mov si,[di+08] ; get inregs.x.si + pop di ; get inregs.x.di from stack + + push bp ; save base pointer + +;------------------------------------------------------------------- + + call sysgetmsg ; call the message retriever + +;------------------------------------------------------------------- + + pop bp ; restore base pointer + push di ; the di value from call is now on stack + mov di,[bp+6+4] ; fix di (arg 1) + + push ax ; save ax + mov [di+00],es ; load segregs.es + mov [di+06],ds ; load outregs.ds + pop ax ; restore ax + + pop di ; restore di + push di ; save it + mov di,[bp+8+4] ; fix di (arg 2) + mov [di+00],ax ; load outregs.x.ax + mov [di+02],bx ; load outregs.x.bx + mov [di+04],cx ; load outregs.x.cx + mov [di+06],dx ; load outregs.x.dx + mov [di+08],si ; load outregs.x.si + + lahf ; get flags into ax + mov al,ah ; move into low byte + mov [di+0ch],ax ; load outregs.x.cflag + + pop ax ; get di from stack + mov [di+0ah],ax ; load outregs.x.di + +;------------------------------------------------------------------- + + pop si ; restore registers + pop di + mov sp,bp ; restore sp + pop bp ; restore user's bp + ret + +data_sysgetmsg endp + +include msgdcl.inc + +_DATA ends ; end code segment + +_TEXT SEGMENT + + assume cs:_TEXT + + public _sysdispmsg + public _sysloadmsg + public _sysgetmsg + +_sysdispmsg proc near + call data_sysdispmsg + ret +_sysdispmsg endp + +_sysloadmsg proc near + call data_sysloadmsg + ret +_sysloadmsg endp + +_sysgetmsg proc near + call data_sysgetmsg + ret +_sysgetmsg endp + +_TEXT ENDS + end + 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 @@ +page 60,132 +name _parse +title C to PARSER interface +;------------------------------------------------------------------- +; +; MODULE: _parse +; +; PURPOSE: Supplies an interface between C programs and +; the DOS 3.3 parser +; +; CALLING FORMAT: +; parse(&inregs,&outregs); +; +; DATE: 5-21-87 +; +;------------------------------------------------------------------- + +; extrn sysparse:far + + public _parse + +;------------------------------------------------------------------- +;FarSW equ 0 ; make sysparse be a NEAR proc +;TimeSW equ 0 ; Check time format +;FileSW equ 0 ; Check file specification +;CAPSW equ 0 ; Perform CAPS if specified +;CmpxSW equ 0 ; Check complex list +;NumSW equ 1 ; Check numeric value +;KeySW equ 0 ; Support keywords +;SwSW equ 1 ; Support switches +;Val1SW equ 1 ; Support value definition 1 +;Val2SW equ 1 ; Support value definition 2 +;Val3SW equ 0 ; Support value definition 3 +;DrvSW equ 0 ; Support drive only format +;QusSW equ 0 ; Support quoted string format +;------------------------------------------------------------------- + + + + +_TEXT SEGMENT BYTE PUBLIC 'CODE' +_TEXT ENDS +_DATA SEGMENT WORD PUBLIC 'DATA' +_DATA ENDS +CONST SEGMENT WORD PUBLIC 'CONST' +CONST ENDS +_BSS SEGMENT WORD PUBLIC 'BSS' +_BSS ENDS + + +DGROUP GROUP CONST, _BSS, _DATA + + +_DATA segment word public 'DATA' + + assume cs:DGROUP + assume ss:dgroup + + public SysParse + +;------------------------------------------------------------------- +.xlist +include parse.asm ; include the parser +.list +;------------------------------------------------------------------- + + public CallParser +CallParser proc far + + push ds + PUSH ES + + push cs + pop ds + assume ds:DGROUP + + push cs + pop es + assume es:DGROUP + + nop + + call SysParse + + POP ES + pop ds + + ret + +CallParser endp + + + +_DATA ends + +_TEXT segment byte public 'CODE' + + ASSUME CS:_TEXT + ASSUME DS:DGROUP + ASSUME ES:NOTHING + ASSUME SS:DGROUP + +_parse proc near + + push bp ; save user's base pointer + mov bp,sp ; set bp to current sp + push di ; save some registers + push si + +; copy C inregs into proper registers + + mov di,[bp+4] ; fix di (arg 0) + +;------------------------------------------------------------------- + + mov ax,[di+0ah] ; load di + push ax ; the di value from inregs is now on stack + + mov ax,[di+00] ; get inregs.x.ax + mov bx,[di+02] ; get inregs.x.bx + mov cx,[di+04] ; get inregs.x.cx + mov dx,[di+06] ; get inregs.x.dx + mov si,[di+08] ; get inregs.x.si + pop di ; get inregs.x.di from stack + + push bp ; save base pointer + +;------------------------------------------------------------------- +;------------------------------------------------------------------- + + call CallParser ; call the parser + +;------------------------------------------------------------------- +;------------------------------------------------------------------- + + pop bp ; restore base pointer + push di ; the di value from call is now on stack + mov di,[bp+6] ; fix di (arg 1) + + mov [di+00],ax ; load outregs.x.ax + mov [di+02],bx ; load outregs.x.bx + mov [di+04],cx ; load outregs.x.cx + mov [di+06],dx ; load outregs.x.dx + mov [di+08],si ; load outregs.x.si + + xor ax,ax ; clear ax + lahf ; get flags into ax + mov [di+0ch],ax ; load outregs.x.cflag + + pop ax ; get di from stack + mov [di+0ah],ax ; load outregs.x.di + +;------------------------------------------------------------------- + + pop si ; restore registers + pop di + mov sp,bp ; restore sp + pop bp ; restore user's bp + ret + +_parse endp + +_TEXT ends ; end code segment + end + -- cgit v1.2.3