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/INC/ARENA.INC | 30 + v4.0/src/INC/BOOT.INC | 64 + v4.0/src/INC/BOOT11.INC | 64 + v4.0/src/INC/BOOTFORM.INC | 47 + v4.0/src/INC/BPB.INC | 41 + v4.0/src/INC/BUFFER.INC | 77 + v4.0/src/INC/BUGTYP.ASM | 49 + v4.0/src/INC/CASRN.INC | 59 + v4.0/src/INC/CASVAR.INC | 88 + v4.0/src/INC/CDS.C | 132 ++ v4.0/src/INC/CMACROS.INC | 932 +++++++++ v4.0/src/INC/COMSUBS.LIB | Bin 0 -> 9728 bytes v4.0/src/INC/CONST2.ASM | 211 ++ v4.0/src/INC/COPYRIGH.INC | 2 + v4.0/src/INC/CPMFCB.INC | 125 ++ v4.0/src/INC/CPUTYPE.INC | 39 + v4.0/src/INC/CURDIR.INC | 45 + v4.0/src/INC/DBCS.OFF | 2 + v4.0/src/INC/DBCS.ON | 2 + v4.0/src/INC/DBCS.SW | 2 + v4.0/src/INC/DEVSYM.INC | 207 ++ v4.0/src/INC/DIRENT.INC | 61 + v4.0/src/INC/DIVMES.ASM | 11 + v4.0/src/INC/DOSCNTRY.INC | 114 + v4.0/src/INC/DOSMAC.INC | 630 ++++++ v4.0/src/INC/DOSSEG.ASM | 25 + v4.0/src/INC/DOSSYM.INC | 157 ++ v4.0/src/INC/DPB.C | 38 + v4.0/src/INC/DPB.INC | 35 + v4.0/src/INC/DPL.ASM | 15 + v4.0/src/INC/DSEG.INC | 208 ++ v4.0/src/INC/EA.INC | 72 + v4.0/src/INC/ERROR.INC | 155 ++ v4.0/src/INC/ERRTST.C | 310 +++ v4.0/src/INC/EXE.INC | 78 + v4.0/src/INC/FASTOPEN.INC | 148 ++ v4.0/src/INC/FASTSEEK.INC | 22 + v4.0/src/INC/FASTXXXX.INC | 12 + v4.0/src/INC/FILEMODE.INC | 56 + v4.0/src/INC/FIND.INC | 25 + v4.0/src/INC/IFSSYM.INC | 670 ++++++ v4.0/src/INC/INTNAT.INC | 39 + v4.0/src/INC/IOCTL.INC | 211 ++ v4.0/src/INC/KSTRING.C | 118 ++ v4.0/src/INC/LOCK.INC | 24 + v4.0/src/INC/MACRO.DEF | 19 + v4.0/src/INC/MAKEFILE | 54 + v4.0/src/INC/MFT.INC | 176 ++ v4.0/src/INC/MI.INC | 19 + v4.0/src/INC/MSBDS.INC | 128 ++ v4.0/src/INC/MSDATA.ASM | 33 + v4.0/src/INC/MSDATA2.ASM | 33 + v4.0/src/INC/MSDOSME.ASM | 17 + v4.0/src/INC/MSGDCL.INC | 108 + v4.0/src/INC/MSGHAN.INC | 153 ++ v4.0/src/INC/MSGSERV.ASM | 3133 +++++++++++++++++++++++++++ v4.0/src/INC/MSHALO.ASM | 247 +++ v4.0/src/INC/MSHEAD.ASM | 134 ++ v4.0/src/INC/MSTABLE.ASM | 16 + v4.0/src/INC/MS_DATA.ASM | 194 ++ v4.0/src/INC/MULT.INC | 184 ++ v4.0/src/INC/NIBDOS.ASM | 7 + v4.0/src/INC/PARSE.ASM | 2974 ++++++++++++++++++++++++++ v4.0/src/INC/PATHMAC.INC | 44 + v4.0/src/INC/PCGEQU.INC | 184 ++ v4.0/src/INC/PCINPUT.INC | 3794 +++++++++++++++++++++++++++++++++ v4.0/src/INC/PDB.INC | 51 + v4.0/src/INC/POSTEQU.INC | 262 +++ v4.0/src/INC/PRINTF.ASM | 415 ++++ v4.0/src/INC/PRINTF.OBJ | Bin 0 -> 1159 bytes v4.0/src/INC/PSDATA.INC | 504 +++++ v4.0/src/INC/REDIRSYM.INC | 174 ++ v4.0/src/INC/SF.INC | 168 ++ v4.0/src/INC/SHELL.MEU | Bin 0 -> 4588 bytes v4.0/src/INC/SHELLRD.EQU | 1155 ++++++++++ v4.0/src/INC/SHELLRD.INC | 5111 +++++++++++++++++++++++++++++++++++++++++++++ v4.0/src/INC/SMDOSSYM.INC | 157 ++ v4.0/src/INC/SMIFSSYM.INC | 62 + v4.0/src/INC/STRING.C | 94 + v4.0/src/INC/STRING.OBJ | Bin 0 -> 608 bytes v4.0/src/INC/STRUC.INC | 702 +++++++ v4.0/src/INC/SYSCALL.INC | 166 ++ v4.0/src/INC/SYSMSG.INC | 443 ++++ v4.0/src/INC/SYSVAR.C | 49 + v4.0/src/INC/SYSVAR.INC | 77 + v4.0/src/INC/VECTOR.INC | 72 + v4.0/src/INC/VERSION.INC | 106 + v4.0/src/INC/VERSIONA.INC | 18 + v4.0/src/INC/YESNO.ASM | 4 + v4.0/src/INC/_PARSE.ASM | 117 ++ 90 files changed, 27010 insertions(+) create mode 100644 v4.0/src/INC/ARENA.INC create mode 100644 v4.0/src/INC/BOOT.INC create mode 100644 v4.0/src/INC/BOOT11.INC create mode 100644 v4.0/src/INC/BOOTFORM.INC create mode 100644 v4.0/src/INC/BPB.INC create mode 100644 v4.0/src/INC/BUFFER.INC create mode 100644 v4.0/src/INC/BUGTYP.ASM create mode 100644 v4.0/src/INC/CASRN.INC create mode 100644 v4.0/src/INC/CASVAR.INC create mode 100644 v4.0/src/INC/CDS.C create mode 100644 v4.0/src/INC/CMACROS.INC create mode 100644 v4.0/src/INC/COMSUBS.LIB create mode 100644 v4.0/src/INC/CONST2.ASM create mode 100644 v4.0/src/INC/COPYRIGH.INC create mode 100644 v4.0/src/INC/CPMFCB.INC create mode 100644 v4.0/src/INC/CPUTYPE.INC create mode 100644 v4.0/src/INC/CURDIR.INC create mode 100644 v4.0/src/INC/DBCS.OFF create mode 100644 v4.0/src/INC/DBCS.ON create mode 100644 v4.0/src/INC/DBCS.SW create mode 100644 v4.0/src/INC/DEVSYM.INC create mode 100644 v4.0/src/INC/DIRENT.INC create mode 100644 v4.0/src/INC/DIVMES.ASM create mode 100644 v4.0/src/INC/DOSCNTRY.INC create mode 100644 v4.0/src/INC/DOSMAC.INC create mode 100644 v4.0/src/INC/DOSSEG.ASM create mode 100644 v4.0/src/INC/DOSSYM.INC create mode 100644 v4.0/src/INC/DPB.C create mode 100644 v4.0/src/INC/DPB.INC create mode 100644 v4.0/src/INC/DPL.ASM create mode 100644 v4.0/src/INC/DSEG.INC create mode 100644 v4.0/src/INC/EA.INC create mode 100644 v4.0/src/INC/ERROR.INC create mode 100644 v4.0/src/INC/ERRTST.C create mode 100644 v4.0/src/INC/EXE.INC create mode 100644 v4.0/src/INC/FASTOPEN.INC create mode 100644 v4.0/src/INC/FASTSEEK.INC create mode 100644 v4.0/src/INC/FASTXXXX.INC create mode 100644 v4.0/src/INC/FILEMODE.INC create mode 100644 v4.0/src/INC/FIND.INC create mode 100644 v4.0/src/INC/IFSSYM.INC create mode 100644 v4.0/src/INC/INTNAT.INC create mode 100644 v4.0/src/INC/IOCTL.INC create mode 100644 v4.0/src/INC/KSTRING.C create mode 100644 v4.0/src/INC/LOCK.INC create mode 100644 v4.0/src/INC/MACRO.DEF create mode 100644 v4.0/src/INC/MAKEFILE create mode 100644 v4.0/src/INC/MFT.INC create mode 100644 v4.0/src/INC/MI.INC create mode 100644 v4.0/src/INC/MSBDS.INC create mode 100644 v4.0/src/INC/MSDATA.ASM create mode 100644 v4.0/src/INC/MSDATA2.ASM create mode 100644 v4.0/src/INC/MSDOSME.ASM create mode 100644 v4.0/src/INC/MSGDCL.INC create mode 100644 v4.0/src/INC/MSGHAN.INC create mode 100644 v4.0/src/INC/MSGSERV.ASM create mode 100644 v4.0/src/INC/MSHALO.ASM create mode 100644 v4.0/src/INC/MSHEAD.ASM create mode 100644 v4.0/src/INC/MSTABLE.ASM create mode 100644 v4.0/src/INC/MS_DATA.ASM create mode 100644 v4.0/src/INC/MULT.INC create mode 100644 v4.0/src/INC/NIBDOS.ASM create mode 100644 v4.0/src/INC/PARSE.ASM create mode 100644 v4.0/src/INC/PATHMAC.INC create mode 100644 v4.0/src/INC/PCGEQU.INC create mode 100644 v4.0/src/INC/PCINPUT.INC create mode 100644 v4.0/src/INC/PDB.INC create mode 100644 v4.0/src/INC/POSTEQU.INC create mode 100644 v4.0/src/INC/PRINTF.ASM create mode 100644 v4.0/src/INC/PRINTF.OBJ create mode 100644 v4.0/src/INC/PSDATA.INC create mode 100644 v4.0/src/INC/REDIRSYM.INC create mode 100644 v4.0/src/INC/SF.INC create mode 100644 v4.0/src/INC/SHELL.MEU create mode 100644 v4.0/src/INC/SHELLRD.EQU create mode 100644 v4.0/src/INC/SHELLRD.INC create mode 100644 v4.0/src/INC/SMDOSSYM.INC create mode 100644 v4.0/src/INC/SMIFSSYM.INC create mode 100644 v4.0/src/INC/STRING.C create mode 100644 v4.0/src/INC/STRING.OBJ create mode 100644 v4.0/src/INC/STRUC.INC create mode 100644 v4.0/src/INC/SYSCALL.INC create mode 100644 v4.0/src/INC/SYSMSG.INC create mode 100644 v4.0/src/INC/SYSVAR.C create mode 100644 v4.0/src/INC/SYSVAR.INC create mode 100644 v4.0/src/INC/VECTOR.INC create mode 100644 v4.0/src/INC/VERSION.INC create mode 100644 v4.0/src/INC/VERSIONA.INC create mode 100644 v4.0/src/INC/YESNO.ASM create mode 100644 v4.0/src/INC/_PARSE.ASM (limited to 'v4.0/src/INC') diff --git a/v4.0/src/INC/ARENA.INC b/v4.0/src/INC/ARENA.INC new file mode 100644 index 0000000..5177552 --- /dev/null +++ b/v4.0/src/INC/ARENA.INC @@ -0,0 +1,30 @@ +; SCCSID = @(#)arena.asm 1.1 85/04/09 +BREAK + +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +; +; arena item +; +arena STRUC +arena_signature DB ? ; 4D for valid item, 5A for last item +arena_owner DW ? ; owner of arena item +arena_size DW ? ; size in paragraphs of item +arena_reserved DB 3 DUP(?) ; reserved +arena_name DB 8 DUP(?) ; owner file name +arena ENDS + +; +; CAUTION: The routines in ALLOC.ASM rely on the fact that arena_signature +; and arena_owner_system are all equal to zero and are contained in DI. Change +; them and change ALLOC.ASM. + +arena_owner_system EQU 0 ; free block indication + +arena_signature_normal EQU 4Dh ; valid signature, not end of arena +arena_signature_end EQU 5Ah ; valid signature, last block in arena +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + \ No newline at end of file diff --git a/v4.0/src/INC/BOOT.INC b/v4.0/src/INC/BOOT.INC new file mode 100644 index 0000000..fc6ea20 --- /dev/null +++ b/v4.0/src/INC/BOOT.INC @@ -0,0 +1,64 @@ + db 0EBH,03CH,090H,04DH,053H,044H,04FH,053H + db 034H,02EH,030H,000H,002H,008H,001H,000H + db 002H,000H,002H,003H,051H,0F8H,008H,000H + db 011H,000H,004H,000H,001H,000H,000H,000H + db 000H,000H,000H,000H,080H,000H,029H,000H + db 000H,000H,000H,04EH,04FH,020H,04EH,041H + db 04DH,045H,020H,020H,020H,020H,046H,041H + db 054H,031H,032H,020H,020H,020H,0FAH,033H + db 0C0H,08EH,0D0H,0BCH,000H,07CH,016H,007H + db 0BBH,078H,000H,036H,0C5H,037H,01EH,056H + db 016H,053H,0BFH,03EH,07CH,0B9H,00BH,000H + db 0FCH,0F3H,0A4H,006H,01FH,0C6H,045H,0FEH + db 00FH,08BH,00EH,018H,07CH,088H,04DH,0F9H + db 089H,047H,002H,0C7H,007H,03EH,07CH,0FBH + db 0CDH,013H,072H,07CH,033H,0C0H,039H,006H + db 013H,07CH,074H,008H,08BH,00EH,013H,07CH + db 089H,00EH,020H,07CH,0A0H,010H,07CH,0F7H + db 026H,016H,07CH,003H,006H,01CH,07CH,013H + db 016H,01EH,07CH,003H,006H,00EH,07CH,083H + db 0D2H,000H,0A3H,050H,07CH,089H,016H,052H + db 07CH,0A3H,049H,07CH,089H,016H,04BH,07CH + db 0B8H,020H,000H,0F7H,026H,011H,07CH,08BH + db 01EH,00BH,07CH,003H,0C3H,048H,0F7H,0F3H + db 001H,006H,049H,07CH,083H,016H,04BH,07CH + db 000H,0BBH,000H,005H,08BH,016H,052H,07CH + db 0A1H,050H,07CH,0E8H,087H,000H,072H,020H + db 0B0H,001H,0E8H,0A1H,000H,072H,019H,08BH + db 0FBH,0B9H,00BH,000H,0BEH,0DBH,07DH,0F3H + db 0A6H,075H,00DH,08DH,07FH,020H,0BEH,0E6H + db 07DH,0B9H,00BH,000H,0F3H,0A6H,074H,018H + db 0BEH,093H,07DH,0E8H,051H,000H,032H,0E4H + db 0CDH,016H,05EH,01FH,08FH,004H,08FH,044H + db 002H,0CDH,019H,058H,058H,058H,0EBH,0E8H + db 0BBH,000H,007H,0B9H,003H,000H,0A1H,049H + db 07CH,08BH,016H,04BH,07CH,050H,052H,051H + db 0E8H,03AH,000H,072H,0E6H,0B0H,001H,0E8H + db 054H,000H,059H,05AH,058H,072H,0C9H,005H + db 001H,000H,083H,0D2H,000H,003H,01EH,00BH + db 07CH,0E2H,0E2H,08AH,02EH,015H,07CH,08AH + db 016H,024H,07CH,08BH,01EH,049H,07CH,0A1H + db 04BH,07CH,0EAH,000H,000H,070H,000H,0ACH + db 00AH,0C0H,074H,029H,0B4H,00EH,0BBH,007H + db 000H,0CDH,010H,0EBH,0F2H,03BH,016H,018H + db 07CH,073H,019H,0F7H,036H,018H,07CH,0FEH + db 0C2H,088H,016H,04FH,07CH,033H,0D2H,0F7H + db 036H,01AH,07CH,088H,016H,025H,07CH,0A3H + db 04DH,07CH,0F8H,0C3H,0F9H,0C3H,0B4H,002H + db 08BH,016H,04DH,07CH,0B1H,006H,0D2H,0E6H + db 00AH,036H,04FH,07CH,08BH,0CAH,086H,0E9H + db 08AH,016H,024H,07CH,08AH,036H,025H,07CH + db 0CDH,013H,0C3H,00DH,00AH,04EH,06FH,06EH + db 02DH,053H,079H,073H,074H,065H,06DH,020H + db 064H,069H,073H,06BH,020H,06FH,072H,020H + db 064H,069H,073H,06BH,020H,065H,072H,072H + db 06FH,072H,00DH,00AH,052H,065H,070H,06CH + db 061H,063H,065H,020H,061H,06EH,064H,020H + db 070H,072H,065H,073H,073H,020H,061H,06EH + db 079H,020H,06BH,065H,079H,020H,077H,068H + db 065H,06EH,020H,072H,065H,061H,064H,079H + db 00DH,00AH,000H,049H,04FH,020H,020H,020H + db 020H,020H,020H,053H,059H,053H,04DH,053H + db 044H,04FH,053H,020H,020H,020H,053H,059H + db 053H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,055H,0AAH diff --git a/v4.0/src/INC/BOOT11.INC b/v4.0/src/INC/BOOT11.INC new file mode 100644 index 0000000..f61125c --- /dev/null +++ b/v4.0/src/INC/BOOT11.INC @@ -0,0 +1,64 @@ + db 0EBH,027H,090H,008H,000H,014H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,0CDH + db 019H,0FAH,08CH,0C8H,08EH,0D8H,033H,0D2H + db 08EH,0D2H,0BCH,000H,07CH,0FBH,0B8H,060H + db 000H,08EH,0D8H,08EH,0C0H,033H,0D2H,08BH + db 0C2H,0CDH,013H,072H,069H,0E8H,085H,000H + db 072H,0DDH,02EH,083H,03EH,003H,07CH,008H + db 074H,006H,02EH,0C6H,006H,064H,07DH,002H + db 0BBH,000H,000H,02EH,08BH,00EH,003H,07CH + db 051H,0B0H,009H,02AH,0C1H,0B4H,000H,08BH + db 0F0H,056H,033H,0D2H,033H,0C0H,08AH,0C5H + db 02EH,0F6H,036H,064H,07DH,08AH,0E8H,08AH + db 0F4H,08BH,0C6H,0B4H,002H,0CDH,013H,072H + db 02DH,05EH,059H,02EH,029H,036H,005H,07CH + db 074H,01FH,08BH,0C6H,02EH,0F7H,026H,065H + db 07DH,003H,0D8H,0FEH,0C5H,0B1H,001H,051H + db 0BEH,008H,000H,02EH,03BH,036H,005H,07CH + db 07CH,005H,02EH,08BH,036H,005H,07CH,0EBH + db 0C0H,0EAH,000H,000H,060H,000H,0BEH,067H + db 07DH,0E8H,002H,000H,0EBH,0FEH,032H,0FFH + db 02EH,0ACH,024H,07FH,074H,00BH,056H,0B4H + db 00EH,0BBH,007H,000H,0CDH,010H,05EH,0EBH + db 0EFH,0C3H,0E9H,033H,0FFH,0BBH,000H,000H + db 0B9H,004H,000H,0B8H,001H,002H,0CDH,013H + db 01EH,072H,033H,08CH,0C8H,08EH,0D8H,0BFH + db 000H,000H,0B9H,00BH,000H,026H,080H,00DH + db 020H,026H,080H,04DH,020H,020H,047H,0E2H + db 0F4H,0BFH,000H,000H,0BEH,08BH,07DH,0B9H + db 00BH,000H,0FCH,0F3H,0A6H,075H,00FH,0BFH + db 020H,000H,0BEH,097H,07DH,0B9H,00BH,000H + db 0F3H,0A6H,075H,002H,01FH,0C3H,0BEH,01BH + db 07DH,0E8H,0A2H,0FFH,0B4H,000H,0CDH,016H + db 01FH,0F9H,0C3H,00DH,00AH,04EH,06FH,06EH + db 02DH,053H,079H,073H,074H,065H,06DH,020H + db 064H,069H,073H,06BH,020H,06FH,072H,020H + db 064H,069H,073H,06BH,020H,065H,072H,072H + db 06FH,072H,00DH,00AH,052H,065H,070H,06CH + db 061H,063H,065H,020H,061H,06EH,064H,020H + db 073H,074H,072H,069H,06BH,065H,020H,061H + db 06EH,079H,020H,06BH,065H,079H,020H,077H + db 068H,065H,06EH,020H,072H,065H,061H,064H + db 079H,00DH,00AH,000H,001H,000H,002H,00DH + db 00AH,044H,069H,073H,06BH,020H,042H,06FH + db 06FH,074H,020H,066H,061H,069H,06CH,075H + db 072H,065H,00DH,00AH,000H,04DH,069H,063H + db 072H,06FH,073H,06FH,066H,074H,02CH,049H + db 06EH,063H,020H,069H,062H,06DH,062H,069H + db 06FH,020H,020H,063H,06FH,06DH,030H,069H + db 062H,06DH,064H,06FH,073H,020H,020H,063H + db 06FH,06DH,030H,005H,0C6H,006H,077H,02FH + db 0FFH,083H,07EH,0FCH,000H,075H,00BH,080H + db 07EH,0F7H,03BH,075H,005H,0C6H,006H,076H + db 02FH,0FFH,089H,0ECH,05DH,0CAH,004H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H diff --git a/v4.0/src/INC/BOOTFORM.INC b/v4.0/src/INC/BOOTFORM.INC new file mode 100644 index 0000000..8f53a51 --- /dev/null +++ b/v4.0/src/INC/BOOTFORM.INC @@ -0,0 +1,47 @@ + %OUT BOOTFORM.INC... +;**************************************************************************** +;AN000; - Structure of the Extended IBMBOOT record for DOS -. J.K. +;AN001; - D304 Include PHYDRV, CURHD to the header structure 11/09/87 J.K. +;**************************************************************************** + +BOOT_SIZE EQU 512 +EXT_BOOT_SIGNATURE EQU 41 ;Extended boot signature +; +EXT_BPB_INFO STRUC +EBPB_BYTESPERSECTOR DW ? +EBPB_SECTORSPERCLUSTER DB ? +EBPB_RESERVEDSECTORS DW ? +EBPB_NUMBEROFFATS DB ? +EBPB_ROOTENTRIES DW ? +EBPB_TOTALSECTORS DW ? +EBPB_MEDIADESCRIPTOR DB ? +EBPB_SECTORSPERFAT DW ? +EBPB_SECTORSPERTRACK DW ? +EBPB_HEADS DW ? +EBPB_HIDDENSECTOR DD ? +EBPB_BIGTOTALSECTORS DD ? +EXT_BPB_INFO ENDS +; +;AN001; EXT_PHYDRV, EXT_CURHD included in the header for OS2. +EXT_IBMBOOT_HEADER STRUC +EXT_BOOT_JUMP DB 3 DUP (?) +EXT_BOOT_OEM DB 8 DUP (?) +EXT_BOOT_BPB DB type EXT_BPB_INFO dup (?) +EXT_PHYDRV DB 80h +EXT_CURHD DB 0 +EXT_BOOT_SIG DB EXT_BOOT_SIGNATURE +EXT_BOOT_SERIAL DD ? +EXT_BOOT_VOL_LABEL DB 11 DUP (?) +EXT_SYSTEM_ID DB 8 DUP (?) +EXT_IBMBOOT_HEADER ENDS +; +BOOT_SIGNATURE = word ptr (BOOT_SIZE-2) + +; +;J.K. This is the number of sectors (of size 512 bytes) that will cover +;the size of IBMLOAD program. IBMBOOT program has to at least read this +;many sectors, and these sectors should be the first cluster and consecutive. +;Make sure IBMBOOT program uses the same value as this. +IBMLOADSIZE equ 3 ;Number of sectors IBMBOOT program should read in. + + diff --git a/v4.0/src/INC/BPB.INC b/v4.0/src/INC/BPB.INC new file mode 100644 index 0000000..f05fa5e --- /dev/null +++ b/v4.0/src/INC/BPB.INC @@ -0,0 +1,41 @@ + %OUT BPB.INC... +; SCCSID = @(#)BPB.ASM 1.1 85/04/29 +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; + +; BIOS PARAMETER BLOCK DEFINITION +; THIS STRUCTURE IS USED TO BUILD A FULL DPB + +BPBLOCK STRUC +BPSECSZ DW ? ; SIZE IN BYTES OF PHYSICAL SECTOR +BPCLUS DB ? ; SECTORS/ALLOC UNIT +BPRES DW ? ; NUMBER OF RESERVED SECTORS +BPFTCNT DB ? ; NUMBER OF FATS +BPDRCNT DW ? ; NUMBER OF DIRECTORY ENTRIES +BPSCCNT DW ? ; TOTAL NUMBER OF SECTORS +BPMEDIA DB ? ; MEDIA DESCRIPTOR BYTE +BPFTSEC DW ? ; NUMBER OF SECTORS TAKEN UP BY ONE FAT +BPBLOCK ENDS + +A_BPB STRUC +BPB_BYTESPERSECTOR DW ? +BPB_SECTORSPERCLUSTER DB ? +BPB_RESERVEDSECTORS DW ? +BPB_NUMBEROFFATS DB ? +BPB_ROOTENTRIES DW ? +BPB_TOTALSECTORS DW ? +BPB_MEDIADESCRIPTOR DB ? +BPB_SECTORSPERFAT DW ? +BPB_SECTORSPERTRACK DW ? +BPB_HEADS DW ? +BPB_HIDDENSECTORS DW ? + DW ? +BPB_BIGTOTALSECTORS DW ? + DW ? + DB 6 DUP(?) +A_BPB ENDS +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + \ No newline at end of file diff --git a/v4.0/src/INC/BUFFER.INC b/v4.0/src/INC/BUFFER.INC new file mode 100644 index 0000000..bd64882 --- /dev/null +++ b/v4.0/src/INC/BUFFER.INC @@ -0,0 +1,77 @@ +; SCCSID = @(#)buffer.asm 1.1 85/04/09 +BREAK +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; + +; Field definition for I/O buffer information + +BUFFINFO STRUC +buf_next DW ? ; Pointer to next buffer in list +buf_prev DW ? ; Pointer to prev buffer in list +buf_ID DB ? ; Drive of buffer (bit 7 = 0) + ; SFT table index (bit 7 = 1) + ; = FFH if buffer free +buf_flags DB ? ; Bit 7 = 1 if Remote file buffer + ; = 0 if Local device buffer + ; Bit 6 = 1 if buffer dirty + ; Bit 5 = Reserved + ; Bit 4 = Search bit (bit 7 = 1) + ; Bit 3 = 1 if buffer is DATA + ; Bit 2 = 1 if buffer is DIR + ; Bit 1 = 1 if buffer is FAT + ; Bit 0 = Reserved +buf_sector DD ? ; Sector number of buffer (bit 7 = 0) +; The next two items are often refed as a word (bit 7 = 0) +buf_wrtcnt DB ? ; For FAT sectors, # times sector written out +buf_wrtcntinc DW ? ; " " " , # sectors between each write +buf_DPB DD ? ; Pointer to drive parameters +buf_fill DW ? ; How full buffer is (bit 7 = 1) +buf_reserved DB ? ; make DWORD boundary for 386 +BUFFINFO ENDS + +buf_offset EQU DWORD PTR buf_sector + ;For bit 7 = 1, this is the byte + ;offset of the start of the buffer in + ;the file pointed to by buf_ID. Thus + ;the buffer starts at location + ;buf_offset in the file and contains + ;buf_fill bytes. + +BUFINSIZ EQU SIZE BUFFINFO + ; Size of structure in bytes + +buf_Free EQU 0FFh ; buf_id of free buffer + +;Flag byte masks +buf_isnet EQU 10000000B +buf_dirty EQU 01000000B +;*** +buf_visit EQU 00100000B +;*** +buf_snbuf EQU 00010000B + +buf_isDATA EQU 00001000B +buf_isDIR EQU 00000100B +buf_isFAT EQU 00000010B +buf_type_0 EQU 11110001B ; AND sets type to "none" + +buf_NetID EQU BUFINSIZ + +; +; Buffer Hash Entry Structure + +BUFFER_HASH_ENTRY STRUC ; DOS 4.00 +EMS_PAGE_NUM DW -1 ; logical page number for EMS handle +BUFFER_BUCKET DD ? ; pointer to buffers +DIRTY_COUNT DB 0 ; number of dirty buffers +BUFFER_RESERVED DB 0 ; reserved +BUFFER_HASH_ENTRY ENDS + +MaxBuffinBucket EQU 15 ; Max number of buffers per bucket +MaxBucketinPage EQU 2 ; Max number of buckets per 16kb page + + +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; diff --git a/v4.0/src/INC/BUGTYP.ASM b/v4.0/src/INC/BUGTYP.ASM new file mode 100644 index 0000000..076ba36 --- /dev/null +++ b/v4.0/src/INC/BUGTYP.ASM @@ -0,0 +1,49 @@ +; SCCSID = @(#)bugtyp.asm 1.1 85/04/09 +; +; debugging types and levels for MSDOS +; + +TypAccess EQU 0001h + LevSFN EQU 0000h + LevBUSY EQU 0001h + +TypShare EQU 0002h + LevShEntry EQU 0000h + LevMFTSrch EQU 0001h + +TypSect EQU 0004h + LevEnter EQU 0000h + LevLeave EQU 0001h + LevReq EQU 0002h + +TypSMB EQU 0008h + LevSMBin EQU 0000h + LevSMBout EQU 0001h + LevParm EQU 0002h + LevASCIZ EQU 0003h + LevSDB EQU 0004h + LevVarlen EQU 0005h + +TypNCB EQU 0010h + LevNCBin EQU 0000h + LevNCBout EQU 0001h + +TypSeg EQU 0020h + LevAll EQU 0000h + +TypSyscall EQU 0040h + LevLog EQU 0000h + LevArgs EQU 0001h + +TypInt24 EQU 0080h + LevLog EQU 0000h + +TypProlog EQU 0100h + LevLog EQU 0000h + +TypInt EQU 0200h + LevLog equ 0000h + +typFCB equ 0400h + LevLog equ 0000h + LevCheck equ 0001h diff --git a/v4.0/src/INC/CASRN.INC b/v4.0/src/INC/CASRN.INC new file mode 100644 index 0000000..779f9ec --- /dev/null +++ b/v4.0/src/INC/CASRN.INC @@ -0,0 +1,59 @@ +; +; CAS Routine Numbers +; +; Revised: 10-05-87 +; +BX_RN EQU 3009H ;DRAWBOX PCBOXDR FABOXDR +CC_RN EQU 2100H ;CALCLOR PCCOLOR FACOLOR +CR_RN EQU 2101H ;CROWCOL PCROWCL FAROWCL +CE_RN EQU 5000H ;CRITERR PCCRITE FACRITE +CM_RN EQU 3001H ;COMPRSS PCCOMPS FACOMPS +CRD_RN EQU 210BH ; PCCLRRD +CWR_RN EQU 210CH ; PCCLRWR +DTS_RN EQU 4001H ;DATES PCDATES FADATES +FF_RN EQU 1300H ;FINDFLS PCFINDF FAFINDF +GV_RN EQU 2102H ;GETVIDO PCGVIDO FAGVIDO +GE_RN EQU 4000H ;GETEQUP PCGEQUP FAGEQUP +HWR_RN EQU 2108H ; PCHLPRD +HRD_RN EQU 2109H ; PCHLPWR +INS_RN EQU 300BH ;INSTRG PCINSTR FAINSTR +I2S_RN EQU 3000H ;CIS PCIN2ST FAIN2ST +MB_RN EQU 2400H ;MAKEBEEP PCMBEEP FAMBEEP +MO_RN EQU 3002H ;MOVECON PCMOVEC FAMOVEC +MI_RN EQU 3003H ;MOVEINT PCMOVEI FAMOVEI +MS_RN EQU 1200H ;TRACKER PCTRACK +MX_RN EQU 3004H ;MOVEMIX PCMOVEM FAMOVEM +PM_RN EQU 2103H ;PANMAN PCPANEL FAPANEL +PWR_RN EQU 2106H ; PCPANWR +PRD_RN EQU 210AH ; PCPANRD +QM_RN EQU 2111H ; PCDISPQ +SF_RN EQU 2107H ;SETFLAG PCSTATF FASTATF +SV_RN EQU 2104H ;SETVIDO PCSVIDO FASVIDO +SK_RN EQU 1102H ;SIMKEY PCSIMKY FASIMKY +SRD_RN EQU 210DH ; PCSCRRD +SWR_RN EQU 210EH ; PCSCRWR +SM_RN EQU 300DH ; PCPANSM +SCB_RN EQU 2105H ;SLCTOPT PCSLCTP +SO_RN EQU 2105H ;SLCTOPT FASLCTP +SS_RN EQU 3005H ;STRGSRT PCSORTS FASORTS +SSC_RN EQU 300AH ;STRSTRC PCSTRST FASTRST +TMS_RN EQU 4002H ;TIMES PCTIMES FATIMES +WN_RN EQU 3007H ;WINDOW PCWINDO FAWINDO +S2I_RN EQU 300EH ; PCST2IN +WWP_RN EQU 300FH ; PCWWRAP PCGRPRD +GWR_RN EQU 3010H ; PCGRPWR PCGRPWR +GRD_RN EQU 3011H ; PCGRPRD PCGRPRD +IWR_RN EQU 3012H ; PCINPWR PCINPWR +IRD_RN EQU 3013H ; PCINPRD PCINPRD +M1_RN EQU 3014H ; PCMSDRV +M1_RN EQU 3014H ; PCIBMDRV +INC_RN EQU 3015H ; PCINCHA PCINCHA +DBC_RN EQU 3016H ; PCINDBC PCINDBC +C0H_RN EQU 3017H ; PCGEQUP +MRD_RN EQU 3018H ; +NWR_RN EQU 3019H ; +IN_RN EQU 301AH ; PCINPUT PCINPUT +MG_RN EQU 301BH ; PCINPUT PCINPUT +MWR_RN EQU 301CH ; PCMEUWR PCMEUWR +; + \ No newline at end of file diff --git a/v4.0/src/INC/CASVAR.INC b/v4.0/src/INC/CASVAR.INC new file mode 100644 index 0000000..452a511 --- /dev/null +++ b/v4.0/src/INC/CASVAR.INC @@ -0,0 +1,88 @@ +; +; Revised: 02-15-88 +; +CASRM EQU 0 ;Set to zero (0) to create an + ; object module to put in the + ; CAS Library. Set to one (1) + ; to create the CAS Routine + ; Manager version of the routine. +; +CASFAR EQU 1 ;Set to zero (0) to create an + ; object module that is called + ; as a near procedure. Set to + ; one (1) to create an object + ; module that is called as a far + ; procedure. +; +COPYRIGHT EQU 1 ;Set to zero (0) to include + ; Copyright 1988 Microsoft + ; (1) to exclude Copyright 1988 Microsoft + ; notice. +; +SMODE EQU 2 ;Set to one (1) for Interpertive + ; BASIC. Set to two (2) for + ; Compiled BASIC. +; +CASINT EQU 7FH ;CAS Routine Manager interupt +; +CASFILEID EQU 01234H ;This CAS file identification + ; is found at the beginning of all + ; CAS files in the first word +PANELOBJID EQU 0FFH ;This is the panel object + ; identification number that is + ; found inside a valid CAS file's + ; object list when panels have + ; been saved inside a file +HELPOBJID EQU 0FEH ;This is the help/error object + ; identification number that is + ; found inside a valid CAS file's + ; object list when helps have + ; been saved inside a file +COLOROBJID EQU 0FDH ;This is the color object + ; identification number that is + ; found inside a valid CAS file's + ; object list when colors have + ; been saved inside a file +INPUTOBJID EQU 0FCH ;This is the input object + ; identification number that is + ; found inside a valid CAS file's + ; object list when input fields + ; have been saved inside a file +DIALOGOBJID EQU 0FBH ;This is the dialog object + ; identification number that is + ; found inside a valid CAS file's + ; object list when dialogs have + ; been saved inside a file +SCROLLOBJID EQU 0FAH ;This is the scroll field object + ; identification number that is + ; found inside a valid CAS file's + ; object list when scroll fields + ; have been saved inside a file +TRANSOBJID EQU 0F9H ;This is the translation object + ; identification number that is + ; found inside a valid CAS file's + ; object list when a translation + ; table has been saved inside a + ; file +GRAPHOBJID EQU 0F8H ;This is the graphic field object + ; identification number that is + ; found inside a valid CAS file's + ; object list when a graphic + ; fields has been saved inside a + ; file +MENUOBJID EQU 0F7H ;This is the maintain menu object + ; identification number that is + ; found inside a valid CAS file's + ; object list when a menu table + ; has been saved inside a file +MAXNUMOBJS EQU 20 ;Maximum possible number of + ; objects types reserved in CAS + ; data files. (i.e. panel, help, + ; error, color, input objects,,,) +; +LIBVER MACRO + DB "Version 4.0" ;CAS library version number +ENDM +; +INCLUDE CASRN.INC ;Include the CAS routine numbers +; diff --git a/v4.0/src/INC/CDS.C b/v4.0/src/INC/CDS.C new file mode 100644 index 0000000..861b42d --- /dev/null +++ b/v4.0/src/INC/CDS.C @@ -0,0 +1,132 @@ +/* cds utilities */ +/* #include "types.h" */ +#include "sysvar.h" +#include "cds.h" +#include "dpb.h" +#include +#include "jointype.h" + +extern struct sysVarsType SysVars ; + +char fGetCDS(i, pLCDS) +int i ; +struct CDSType *pLCDS ; +{ + struct CDSType far *cptr ; + int j ; + /* Get pointer to CDS */ + if (i >= 0 && i < SysVars.cCDS) { + *(long *)(&cptr) = SysVars.pCDS + (i * sizeof(*pLCDS)) ; + + /* Copy CDS to our program */ + for (j=0 ; j < sizeof(*pLCDS) ; j++) + *((char *)pLCDS+j) = *((char far *)cptr+j) ; + + return TRUE ; + } ; + return FALSE ; +} + + + + +char fPutCDS(i, pLCDS) +int i ; +struct CDSType *pLCDS ; +{ + struct CDSType far *cptr ; + int j ; + + if (i >= 0 && i < SysVars.cCDS) { + *(long *)(&cptr) = SysVars.pCDS + (i * sizeof(*pLCDS)) ; + + for (j=0 ; j < sizeof(*pLCDS) ; j++) + *((char far *)cptr+j) = *((char *)pLCDS+j) ; + + return TRUE ; + } ; + return FALSE ; +} + +/* returns TRUE if drive i is a physical drive. Physical means that logical + * drive n corresponds with physical drive n. This is the case ONLY if the + * CDS is inuse and the DPB corresponding to the CDS has the physical drive + * equal to the original drive. + */ + +char fPhysical(i) +int i ; +{ + struct DPBType DPB ; + struct DPBType *pd = &DPB ; + struct DPBType far *dptr ; + int j ; + + struct CDSType CDS ; + + if (!fGetCDS(i, &CDS)) + return FALSE ; + + if (TESTFLAG(CDS.flags,CDSNET | CDSSPLICE | CDSLOCAL)) + return FALSE ; + + *(long *)(&dptr) = CDS.pDPB ; + + for (j=0 ; j < sizeof(DPB) ; j++) + *((char *)pd+j) = *((char far *)dptr+j) ; + + return(i == DPB.drive) ; +} + +/* return TRUE if the specified drive is a network drive. i is a 0-based + * quantity + */ + +/* MODIFICATION HISTORY + * + * M000 June 5/85 Barrys + * Removed extra net check. + */ + +char fNet(i) +int i ; +{ + union REGS ir ; + register union REGS *iregs = &ir ; /* Used for DOS calls */ + + struct CDSType CDS ; + + if (!fGetCDS(i, &CDS)) + return FALSE ; + + iregs->x.ax = IOCTL9 ; /* Function 0x4409 */ + iregs->x.bx = i + 1 ; + intdos(iregs, iregs) ; + +/*** M000 + return(TESTFLAG(CDS.flags,CDSNET) || TESTFLAG(iregs->x.dx,0x1000)) ; +/***/ + return(TESTFLAG(CDS.flags,CDSNET)) ; +} + + +/* return TRUE if the specified drive is a shared drive. i is a 0-based + * quantity + */ +char fShared(i) +int i ; +{ + struct CDSType CDS ; + union REGS ir ; + register union REGS *iregs = &ir ; /* Used for DOS calls */ + + if (!fGetCDS(i, &CDS)) + return FALSE ; + + iregs->x.ax = IOCTL9 ; /* Function 0x4409 */ + iregs->x.bx = i + 1 ; + intdos(iregs, iregs) ; + + return TESTFLAG(CDS.flags,CDSNET) || TESTFLAG(iregs->x.dx,0x0200) ; +} + \ No newline at end of file diff --git a/v4.0/src/INC/CMACROS.INC b/v4.0/src/INC/CMACROS.INC new file mode 100644 index 0000000..d81960c --- /dev/null +++ b/v4.0/src/INC/CMACROS.INC @@ -0,0 +1,932 @@ +comment $ +cmacros - assembly macros for interfacing to HHLs +(C)Copyright 1984, 1988 Microsoft Corporation +$ +if1 +outif MACRO name,defval,onmsg,offmsg + ifndef name + ifb + name=0 + else + name=defval + endif + endif + if name + name=1 + ifnb + %out ! onmsg + endif + else + ifnb + %out ! offmsg + endif + endif +endm + +error MACRO msg +bug +%out E r r o r ----- msg +ENDM +%out cMacros Version 1.04 +outif memS,0, +outif memM,0, +outif memL,0, +outif memC,0, +outif memH,0, +memMOD= memS + memM + memL + memC + memH +if memMOD ne 1 +if memMOD eq 0 +memS= 1 +outif memS,0, +else +error +endif +endif +sizeC= memM + memL + memH +sizeD= memL + memC + (memH*2) +outif ?DF,0, +outif ?WIN,0, +outif ?PLM,0, +endif + .XCREF + .XCREF ?N,?AX,?AH,?AL,?BX,?BH + .XCREF ?BL,?CX,?CH,?CL,?DX,?DH + .XCREF ?DL,?SI,?DI,?ES,?DS,?BP + .XCREF ?SP,?SS,?CS + .XCREF ?RSL,?CPD,?argl,?argc,?BA + .XCREF ?ACB,???,?PO + .XCREF ?PAS,?PC + .XCREF Uconcat,mPush,mPop + .XCREF ?RI,?pp,?pp1,?al1 + .XCREF ?aD,?AP,?Atal,?pd,?dd,?dd1,?ex1,?cas + .XCREF ?pg,?pg1,?aloc,?cs1,?cs2 + .XCREF ?lb1,?lblpu + .XCREF ?DF,?PLM,?WIN,?IA,?PU,?ADJ + .CREF +?RSL = 0 +?CPD = 0 +?ArgL = 0 +?ArgC = 0 +?BA = 0 +?ACB = 0 +??? = 0 +?PO = 0 +?PAS = 0 +?PC = 0 +?IA = 0 +?PU = 0 +?ADJ = 0 +?lblpu = 0 +?N = 0000000000000000B +?AX = 0000000000000011B +?AH = 0000000000000001B +?AL = 0000000000000010B +?BX = 0000000000001100B +?BH = 0000000000000100B +?BL = 0000000000001000B +?CX = 0000000000110000B +?CH = 0000000000010000B +?CL = 0000000000100000B +?DX = 0000000011000000B +?DH = 0000000001000000B +?DL = 0000000010000000B +?SI = 0000000100000000B +?DI = 0000001000000000B +?ES = 0000010000000000B +?DS = 0000100000000000B +?BP = 0001000000000000B +?SP = 0010000000000000B +?SS = 0100000000000000B +?CS = 1000000000000000B +uconcat macro n1,n2,o1,o2,p1,p2 +n1&n2 o1&o2 p1&p2 +endm +mpush macro rV +irp x, +if rV AND ?&&x +push x +endif +endm +endm +mpop macro rV +irp x, +if rV AND ?&&x +pop x +endif +endm +endm +SAVE macro rL +?RSL = 0 +?RI ?RSL, +endm +smashes macro n,rL + .xcref + .xcref ?SM&n + .cref +?SM&n = 0 +?RI ?SM&n, +endm +?RI macro n,rL +irp x, +ifdef ?&&x +n = n or ?&&x +endif +endm +endm +parmB macro nl +?pp <&nL>,,2,1 +endm +parmW macro nl +?pp <&nL>,,2,2 +endm +parmD macro nl +ife ?PLM +irp x, +?pp <&&x>,,0,4 +?pp ,,2,2 +?pp ,,2,2 +endm +else +irp x, +?pp ,,2,2 +?pp ,,2,2 +?pp <&&x>,,0,4 +endm +endif +endm +parmQ macro nl +?pp <&nL>,,8,8 +endm +parmT macro nl +?pp <&nL>,,10,10 +endm +if sizeC +parmCP macro nl +parmD +endm +else +parmCP macro nl +parmW +endm +endif +if sizeD +parmDP macro nl +parmD +endm +else +parmDP macro nl +parmW +endm +endif +?pp macro nL,t,l,s +if ?CPD + .xcref +ife ?PLM +irp x, +?pp1 x,,%?PO,%?adj,%(?PO+?adj) +?PO = ?PO + l + .xcref ?T&&x +?T&&x = s +endm +else +irp x, +?PO = ?PO + l +?pp1 x,,%?PO,%?adj,%(?PO+?adj) + .xcref ?T&&x +?T&&x = s +endm +endif + .cref +else +%out Parm(s) "&nl" declared outside proc def. +endif +endm +?pp1 macro n,t,o,a,b +ife ?PLM +n equ t ptr [bp+b] +else +n equ t ptr [bp+a+?PO-o] +endif +endm +localB macro nL +?aLoc <&nL>,,1,1,0 +endm +localW macro nL +?aLoc <&nL>,,2,2,1 +endm +localD macro nL +irp x, +?aLoc ,,2,2,1 +?aLoc ,,2,2,1 +?aLoc <&&x>,,0,4,1 +endm +endm +localQ macro nL +?aLoc <&nL>,,8,8,1 +endm +localT macro nL +?aLoc <&nL>,,10,10,1 +endm +if sizeC +localCP macro nL +localD +endm +else +localCP macro nL +localW +endm +endif +if sizeD +localDP macro nL +localD +endm +else +localDP macro nL +localW +endm +endif +localV macro n,a +?aLoc <&n>,,%(&a),0,1 +endm +?aLoc macro nL,t,l,s,a +if ?CPD + .xcref +??? = ??? + l +if a +??? = ((??? + 1) AND 0FFFEH) +endif +irp x, +?aL1 x,,%??? + .xcref ?T&&x +?T&&x = s +endm + .cref +else +%out Locals "&nl" declared outside procedure def. +endif +endm +?aL1 macro n,t,o +if ?IA +n equ t [bp-?IA-o] +else +n equ t [bp-o] +endif +endm +globalB macro n,i,s +?aD ,1 +?dd n,1,,,, +endm +globalW macro n,i,s +?aD ,2 +?dd n,1,,,, +endm +globalD macro n,i,s +?aD ,4 +?dd n,1,,
,, +endm +globalQ macro n,i,s +?aD ,8 +?dd n,1,,,, +endm +globalT macro n,i,s +?aD ,10 +?dd n,1,,
,, +endm +if sizeC +globalCP macro n,i,s +globalD n,, +endm +else +globalCP macro n,i,s +globalW n,, +endm +endif +if sizeD +globalDP macro n,i,s +globalD n,, +endm +else +globalDP macro n,i,s +globalW n,, +endm +endif +staticB macro n,i,s +?aD ,1 +?dd n,0,,,, +endm +staticW macro n,i,s +?aD ,2 +?dd n,0,,,, +endm +staticD macro n,i,s +?aD ,4 +?dd n,0,,
,, +endm +staticQ macro n,i,s +?aD ,8 +?dd n,0,,,, +endm +staticT macro n,i,s +?aD ,10 +?dd n,0,,
,, +endm +if sizeC +staticCP macro n,i,s +staticD n,, +endm +else +staticCP macro n,i,s +staticW n,, +endm +endif +if sizeD +staticDP macro n,i,s +staticD n,, +endm +else +staticDP macro n,i,s +staticW n,, +endm +endif +?dd macro n,p,t,d,i,s +ife ?PLM +n label t +?dd1 _&n,p,,, +else +?dd1 n,p,,, +endif +endm +?dd1 macro n,p,d,i,s +if p +PUBLIC n +endif +ifb +n d i +else +ifb +n d s DUP (?) +else +n d s DUP (i) +endif +endif +endm +externB macro nL +?ex1 <&nL>,1, +endm +externW macro nL +?ex1 <&nL>,2, +endm +externD macro nL +?ex1 <&nL>,4, +endm +externQ macro nL +?ex1 <&nL>,8, +endm +externT macro nL +?ex1 <&nL>,10, +endm +externNP macro nL +?ex1 <&nL>,2, +endm +externFP macro nL +?ex1 <&nL>,4, +endm +if sizeC +externP macro nL +?ex1 <&nL>,4, +endm +else +externP macro nL +?ex1 <&nL>,2, +endm +endif +if sizeC +externCP macro nL +?ex1 <&nL>,4, +endm +else +externCP macro nL +?ex1 <&nL>,2, +endm +endif +if sizeD +externDP macro nL +?ex1 <&nL>,4, +endm +else +externDP macro nL +?ex1 <&nL>,2, +endm +endif +?ex1 macro nL,s,d +irp x, + .xcref + .xcref ?T&&x + .cref +?T&&x = s +ife ?PLM +extrn _&&x:&d +x equ _&&x +else +extrn x:&d +endif +endm +endm +labelB macro nL +?lb1 <&nL>,1, +endm +labelW macro nL +?lb1 <&nL>,2, +endm +labelD macro nL +?lb1 <&nL>,4, +endm +labelQ macro nL +?lb1 <&nL>,8, +endm +labelT macro nL +?lb1 <&nL>,10, +endm +labelNP macro nL +?lb1 <&nL>,2, +endm +labelFP macro nL +?lb1 <&nL>,4, +endm +if sizeC +labelP macro nL +?lb1 <&nL>,4, +endm +else +labelP macro nL +?lb1 <&nL>,2, +endm +endif +if sizeC +labelCP macro nL +?lb1 <&nL>,4, +endm +else +labelCP macro nL +?lb1 <&nL>,2, +endm +endif +if sizeD +labelDP macro nL +?lb1 <&nL>,4, +endm +else +labelDP macro nL +?lb1 <&nL>,2, +endm +endif +?lb1 macro nL,s,d +?lblpu = 0 +irp x, +ifidn , +?lblpu = 1 +else + .xcref + .xcref ?T&&x + .cref +?T&&x = s +ife ?PLM +if ?lblpu +public _&&x +endif +_&&x label &d +x equ _&&x +else +if ?lblpu +public x +endif +x label &d +endif +endif +endm +endm +defB macro nL +?aD <&nL>,1 +endm +defW macro nL +?aD <&nL>,2 +endm +defD macro nL +?aD <&nL>,4 +endm +defQ macro nL +?aD <&nL>,8 +endm +defT macro nL +?aD <&nL>,10 +endm +if sizeC +defCP macro nL +defD +endm +else +defCP macro nL +defW +endm +endif +if sizeD +defDP macro nL +defD +endm +else +defDP macro nL +defW +endm +endif +?aD macro nL,s +irp x, + .xcref + .xcref ?T&&x + .cref +?T&&x = s +endm +endm +regPtr macro n,S,O + .xcref + .xcref ?T&n,?SR&n,?OR&n + .cref +?T&n = 0FFFFH +?SR&n = 0 +?RI ?SR&n,<&S> +?OR&n = 0 +?RI ?OR&n,<&O> +endm +arg macro aL +irp x, +?argc = ?argc + 1 +?Atal ,%?argc +endm +endm +?Atal macro n,i + .xcref + .xcref ?ALI&i + .cref +?ALI&i ¯o +?AP n +&endm +endm +?AP macro n +?argl = ?argl + 2 +ifdef ?T&n +ife ?T&n-1 +push word ptr (n) +exitm +endif +ife ?T&n-2 +push n +exitm +endif +ife ?T&n-4 +push word ptr (n)+2 +push word ptr (n) +?argl = ?argl + 2 +exitm +endif +ife ?T&n-8 +push word ptr (n)+6 +push word ptr (n)+4 +push word ptr (n)+2 +push word ptr (n) +?argl = ?argl + 6 +exitm +endif +ife ?T&n-0FFFFH +mpush %(?SR&n),1 +mpush %(?OR&n),1 +?argl = ?argl + 2 +exitm +endif +ife ?T&n +push word ptr (n) +exitm +endif +endif +push n +endm +ife ?PLM +ccall macro n,a,sleaze +ifnb +Arg +endif +ifdef ?SM&n +?RSL = ?RSL AND ?SM&n +endif +mpush %?RSL +?argl = 0 +?ACB = ?argc +rept ?argc +uconcat ,%?ACB +uconcat ,,,%?ACB +?ACB = ?ACB - 1 +endm +ife ?PLM +ifb +call _&n +else +call n +endif +else +call n +endif +if ?argl +add sp,?argl +endif +mpop %?RSL +?RSL = 0 +?argc = 0 +?argl = 0 +endm +else +ccall macro n,a +ifnb +Arg +endif +ifdef ?SM&n +?RSL = ?RSL AND ?SM&n +endif +mpush %?RSL +?argl = 0 +?ACB = 1 +rept ?argc +uconcat ,%?ACB +uconcat ,,,%?ACB +?ACB = ?ACB + 1 +endm +ife ?PLM +call _&n +else +call n +endif +mpop %?RSL +?RSL = 0 +?argc = 0 +?argl = 0 +endm +endif +cProc macro n,cl,s +?pd n,,,4 +endm +?pd macro n,c,a,i +if ?CPD +?UTPE +endif +?CPD = 1 +??? = 0 +?argc = 0 +?BA = 0 +?PO = 0 +?PU = 0 +?IA = 0 +?adj = i +?PAS = 0 +ifnb +?RI ?PAS, +endif +?PC = sizeC +irp x, +ifidn , +?PC = 1 +endif +ifidn , +?PC = 0 +endif +ifidn , +?PU = 1 +endif +endm +if ?PC +if ?WIN +?IA = 2 +endif +?adj = ?adj + 2 +endif +ife ?PLM +ife ?PC +n label near +else +n label far +endif +?pg <_&n>,%?PU,%?PC,%?PAS +else +?pg ,%?PU,%?PC,%?PAS +endif +endm +?pg macro n,p,c,a + .xcref + cBegin ¯o g + .xcref + ?pg1 ,c,a,%?PO + ?CPD = 0 + ?argc = 0 + ?BA = 1 + ??? = (???+1) AND 0FFFEH + if p + PUBLIC n + endif + ife c + n proc NEAR + else + n proc FAR + endif + ifidn , + if ???+?PO+a + %out + endif + else + if ?IA + mov ax,ds + nop + inc bp + push bp + mov bp,sp + push ds + mov ds,ax + else + push bp + mov bp,sp + endif + if ??? + sub sp,??? + endif + mPush a,1 + endif + .cref + purge cBegin + &endm + ?UTPE ¯o + %out Unterminated Procedure Definition: "&n" + &endm +endm + +?pg1 macro n,c,a,o + .xcref + cEnd ¯o g + .xcref + ?BA = 0 + ifidn , + if o+a + %out + endif + else + mPop a,1 + if ?IA + sub bp,2 + mov sp,bp + pop ds + pop bp + dec bp + else + mov sp,bp + pop bp + endif + ife ?PLM + ret + else + ret o + endif + endif + n endp + .cref + purge cEnd + &endm + .cref +endm + +assumes macro s,g +local assumed +assumed = 0 +ifidn , +?cas +assumed = 1 +endif +ifidn , +?cas +assumed = 1 +endif +ifidn , +assume s&:dgroup +assumed = 1 +endif +ifidn , +assume s&:dgroup +assumed = 1 +endif +ife assumed +assume s&:&g +endif +endm +if sizeC +?cas macro s +assume s&:_TEXT +endm +else +?cas macro s +assume s&:IGROUP +endm +endif +createSeg macro n,ln,a,co,cl,grp +ifnb +ifidn , +ife sizeC +addSeg IGROUP,n +endif +else +addSeg grp,n +endif +endif +ifnb +n segment a co '&cl' +else +n segment a co +endif +n ends +?cs1 , +endm +if1 +ASMpass=1 +else +ASMpass=2 +endif +addSeg macro grp,seg +ifndef def_&grp +def_&grp= 0 +endif +if def_&grp ne ASMpass +add_&grp ¯o s +in_&grp ,s +&endm +in_&grp ¯o sl,s +ifb +grp group sl +else +add_&grp ¯o ns +in_&grp ,ns +&endm +endif +&endm +def_&grp=ASMpass +else +add_&grp seg +endif +endm +defGrp macro nam +addSeg nam +endm +?cs1 macro n,ln +begin&ln ¯o +?cs2 +n segment +&endm +endm + +?cs2 macro n + sEnd ¯o + n ends + &endm +endm + +sBegin macro ln + begin&ln +endm + +ife ?DF + createSeg _TEXT,code,byte,public,CODE,IGROUP + createSeg _DATA,data,word,public,DATA,DGROUP + if ?WIN + ife sizeC + createSeg _INITTEXT,initcode,byte,public,CODE,IGROUP + createSeg _INITDATA,initdata,word,public,DATA,DGROUP + endif + endif + ife sizeC + defGrp IGROUP + endif + defGrp DGROUP + if sizeC + codeOFFSET equ OFFSET _TEXT: + else + codeOFFSET equ OFFSET IGROUP: + endif + dataOFFSET equ OFFSET DGROUP: +endif + +errnz macro x + if2 + if x + errnz1 ,%(x) + endif + endif +endm + +errnz1 macro x1,x2 + = *ERRNZ* x1 = x2 +endm + +errn$ macro l,x + errnz +endm diff --git a/v4.0/src/INC/COMSUBS.LIB b/v4.0/src/INC/COMSUBS.LIB new file mode 100644 index 0000000..18215a9 Binary files /dev/null and b/v4.0/src/INC/COMSUBS.LIB differ diff --git a/v4.0/src/INC/CONST2.ASM b/v4.0/src/INC/CONST2.ASM new file mode 100644 index 0000000..7a7c1d5 --- /dev/null +++ b/v4.0/src/INC/CONST2.ASM @@ -0,0 +1,211 @@ +; SCCSID = @(#)const2.asm 1.4 85/07/24 +TITLE CONST2 - More constants data +NAME CONST2 + +.xlist +.xcref +INCLUDE DOSSYM.INC +include dosseg.asm +INCLUDE DEVSYM.INC +.cref +.list + +Break + +; +; We need to identify the parts of the data area that are relevant to tasks +; and those that are relevant to the system as a whole. Under 3.0, the system +; data will be gathered with the system code. The process data under 2.x will +; be available for swapping and under 3.0 it will be allocated per-process. +; +; The data that is system data will be identified by [SYSTEM] in the comments +; describing that data item. +; + + AsmVars + +CONSTANTS SEGMENT WORD PUBLIC 'CONST' + +; +; Table of routines for assignable devices +; +; MSDOS allows assignment if the following standard devices: +; stdin (usually CON input) +; stdout (usually CON output) +; auxin (usually AUX input) +; auxout (usually AUX output) +; stdlpt (usually PRN output) +; +; SPECIAL NOTE: +; Status of a file is a strange idea. We choose to handle it in this +; manner: If we're not at end-of-file, then we always say that we have a +; character. Otherwise, we return ^Z as the character and set the ZERO +; flag. In this manner we can support program written under the old DOS +; (they use ^Z as EOF on devices) and programs written under the new DOS +; (they use the ZERO flag as EOF). + +; Default SFTs for boot up + +Public CONST001S,CONST001E +CONST001s label byte + PUBLIC sftabl +sftabl LABEL DWORD ; [SYSTEM] file table + DW -1 ; [SYSTEM] link to next table + DW -1 ; [SYSTEM] link seg to next table + DW sf_default_number ; [SYSTEM] Number of entries in table + DB sf_default_number DUP ( (SIZE sf_entry) DUP (0)); [SYSTEM] + +; the next two variables relate to the position of the logical stdout/stdin +; cursor. They are only meaningful when stdin/stdout are assigned to the +; console. + I_am CARPOS,BYTE ; [SYSTEM] cursor position in stdin + I_am STARTPOS,BYTE ; [SYSTEM] position of cursor at beginning of buffered input call + I_am INBUF,128 ; [SYSTEM] general device input buffer + I_am CONBUF,131 ; [SYSTEM] The rest of INBUF and console buffer + + I_am PFLAG,BYTE ; [SYSTEM] printer echoing flag + I_am VERFLG,BYTE ; [SYSTEM] Initialize with verify off + I_am CharCo,BYTE,<00000011B> ; [SYSTEM] Allows statchks every 4 chars... + I_am chSwitch,BYTE,<'/'> ; [SYSTEM] current switch character + I_am AllocMethod,BYTE ; [SYSTEM] how to alloc first(best)last + I_am fShare,BYTE,<0> ; [SYSTEM] TRUE => sharing installed + I_am DIFFNAM,BYTE,<1> ; [SYSTEM] Indicates when MYNAME has + ; changed + I_am MYNAME,16,<32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32> + ; [SYSTEM] My network name + + +; +; The following table is a list of addresses that the sharer patches to be +; PUSH AX to enable the critical sections +; +PUBLIC CritPatch +CritPatch LABEL WORD +IRP sect, +IF (NOT REDIRECTOR) AND (NOT SHAREF) + Short_Addr E§ + Short_Addr L§ +ELSE + DW 0 + DW 0 +ENDIF +ENDM + DW 0 + +; +; WARNING!!! PRINT and PSPRINT *REQUIRE* ErrorMode to precede INDOS. +; Also, IBM server 1.0 requires this also. +; + EVEN ; Force swap area to start on word boundry +PUBLIC SWAP_START +SWAP_START LABEL BYTE + I_am ErrorMode,BYTE ; Flag for INT 24 processing + I_am INDOS,BYTE,<0> ; DOS status for interrupt processing + I_am WPErr,BYTE,<-1> ; Write protect error flag + I_am EXTERR_LOCUS,BYTE ; Extended Error Locus + I_am EXTERR,WORD,<0> ; Extended Error code + +;WARNING Following two bytes Accessed as word in $GetExtendedError + I_am EXTERR_ACTION,BYTE ; Extended Error Action + I_am EXTERR_CLASS,BYTE ; Extended Error Class +; end warning + + I_am EXTERRPT,DWORD ; Extended Error pointer + I_am DMAADD,DWORD,<80h,?> ; User's disk transfer address (disp/seg) + I_am CurrentPDB,WORD ; Current process identifier + I_am ConC_spsave,WORD ; saved SP before ^C + I_am exit_code,WORD ; exit code of last proc. + I_am CURDRV,BYTE ; Default drive (init A) + I_am CNTCFLAG,BYTE,<0> ; ^C check in dispatch disabled + ; F.C. 2/17/86 + I_am CPSWFLAG,BYTE,<0> ; Code Page Switching Flag DOS 4.00 + I_am CPSWSAVE,BYTE,<0> ; copy of above in case of ABORT + EVEN + PUBLIC Swap_Always + Swap_Always LABEL BYTE + I_am USER_IN_AX,WORD ; User INPUT AX value (used for + ; extended error type stuff. NOTE: + ; does not have Correct value on + ; 1-12, OEM, Get/Set CurrentPDB, + ; GetExtendedError system calls + I_am PROC_ID,WORD,<0> ; PID for sharing (0 = local) + I_am USER_ID,WORD,<0> ; Machine for sharing (0 = local) + I_am FirstArena,WORD ; first free block found + I_am BestArena,WORD ; best free block found + I_am LastArena,WORD ; last free block found + I_am EndMem,WORD ; End of memory used in DOSINIT + I_am LASTENT,WORD ; Last entry for directory search + + I_am FAILERR,BYTE,<0> ; NZ if user did FAIL on I 24 + I_am ALLOWED,BYTE,<0> ; Allowed I 24 answers (see allowed_) + I_am NoSetDir,BYTE ; true -> do not set directory + I_am DidCTRLC,BYTE ; true -> we did a ^C exit + I_am SpaceFlag,BYTE ; true -> embedded spaces are allowed in FCB +; Warning! The following items are accessed as a WORD in TIME.ASM + EVEN + I_am DAY,BYTE,<0> ; Day of month + I_am MONTH,BYTE,<0> ; Month of year + I_am YEAR,WORD,<0> ; Year (with century) + I_am DAYCNT,WORD,<-1> ; Day count from beginning of year + I_am WEEKDAY,BYTE,<0> ; Day of week +; end warning + I_am CONSWAP,BYTE ; TRUE => console was swapped during device read + I_am IDLEINT,BYTE,<1> ; TRUE => idle int is allowed + I_am fAborting,BYTE,<0> ; TRUE => abort in progress + +; Combination of all device call parameters + PUBLIC DEVCALL ; +DEVCALL SRHEAD <> ; basic header for disk packet + PUBLIC CALLUNIT +CALLUNIT LABEL BYTE ; unit number for disk +CALLFLSH LABEL WORD ; + I_am CALLMED,BYTE ; media byte +CALLBR LABEL DWORD ; + PUBLIC CALLXAD ; +CALLXAD LABEL DWORD ; + I_am CALLRBYT,BYTE ; + PUBLIC CALLVIDM ; +CALLVIDM LABEL DWORD ; + DB 3 DUP(?) ; + PUBLIC CallBPB ; +CALLBPB LABEL DWORD ; + I_am CALLSCNT,WORD ; + PUBLIC CALLSSEC +CALLSSEC LABEL WORD ; + DW ? ; + I_am CALLVIDRW,DWORD ; + ; + I_am CALLNEWSC,DWORD ; starting sector for >32mb + I_am CALLDEVAD,DWORD ; stash for device entry point + ; +; Same as above for I/O calls ; + ; + PUBLIC IOCall ; +IOCALL SRHEAD <> ; +IOFLSH LABEL WORD ; + PUBLIC IORCHR ; +IORCHR LABEL BYTE ; + I_am IOMED,BYTE ; + I_am IOXAD,DWORD ; + I_am IOSCNT,WORD ; + I_am IOSSEC,WORD ; +; Call struct for DSKSTATCHK ; + I_am DSKSTCALL,2, ; + I_am DSKSTCOM,1, ; + I_am DSKSTST,WORD ; + DB 8 DUP (0) ; + I_am DSKCHRET,BYTE ; + short_addr DEVIOBUF ; + DW ? ; DOS segment set at Init + I_AM DSKSTCNT,WORD,<1> ; + DW 0 ; + + I_am CreatePDB,BYTE ; flag for creating a process + PUBLIC Lock_Buffer ; +Lock_Buffer LABEL DWORD ;MS. DOS Lock Buffer for Ext Lock + DD ? ;MS. position + DD ? ;MS. length +CONST001e label byte + +CONSTANTS ENDS + END diff --git a/v4.0/src/INC/COPYRIGH.INC b/v4.0/src/INC/COPYRIGH.INC new file mode 100644 index 0000000..cfc0214 --- /dev/null +++ b/v4.0/src/INC/COPYRIGH.INC @@ -0,0 +1,2 @@ + DB "MS DOS Version 4.00 (C)Copyright 1988 Microsoft Corp" + DB "Licensed Material - Property of Microsoft " diff --git a/v4.0/src/INC/CPMFCB.INC b/v4.0/src/INC/CPMFCB.INC new file mode 100644 index 0000000..1d6a6bf --- /dev/null +++ b/v4.0/src/INC/CPMFCB.INC @@ -0,0 +1,125 @@ +; SCCSID = @(#)cpmfcb.asm 1.1 85/04/10 +; SCCSID = @(#)cpmfcb.asm 1.1 85/04/10 +;BREAK + +; +; Field definition for FCBs +; The FCB has the following structure: +; +; +---------------------------+ +; | Drive indicator(byte) | +; +---------------------------+ +; | Filename (8 chars) | +; +---------------------------+ +; | Extension (3 chars) | +; +---------------------------+ +; | Current Extent(word) | +; +---------------------------+ +; | Record size (word) | +; +---------------------------+ +; | File Size (2 words) | +; +---------------------------+ +; | Date of write | +; +---------------------------+ +; | Time of write | +; +---------------------------+ +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +; +---------------------------+ +; | 8 bytes reserved | +; +---------------------------+ +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; | next record number | +; +---------------------------+ +; | random record number | +; +---------------------------+ +; + +sys_fcb STRUC +fcb_drive DB ? +fcb_name DB 8 DUP (?) +fcb_ext DB 3 DUP (?) +fcb_EXTENT DW ? +fcb_RECSIZ DW ? ; Size of record (user settable) +fcb_FILSIZ DW ? ; Size of file in bytes; used with the + ; following word +fcb_DRVBP DW ? ; BP for SEARCH FIRST and SEARCH NEXT +fcb_FDATE DW ? ; Date of last writing +fcb_FTIME DW ? ; Time of last writing +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +fcb_reserved DB 8 DUP (?) ; RESERVED +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +fcb_NR DB ? ; Next record +fcb_RR DB 4 DUP (?) ; Random record +sys_fcb ENDS + +FILDIRENT = fcb_FILSIZ ; Used only by SEARCH FIRST and SEARCH + ; NEXT + +fcb_sfn EQU BYTE PTR fcb_reserved + +; Note that fcb_net_handle, fcb_nsl_drive, fcb_nsld_drive and fcb_l_drive +; all must point to the same byte. Otherwise, the FCBRegen will fail. +; NOTE about this byte (fcb_nsl_drive) +; The high two bits of this byte are used as follows to indicate the FCB type +; 00 means a local file or device with sharing loaded +; 10 means a remote (network) file +; 01 means a local file with no sharing loaded +; 11 means a local device with no sharing loaded + +; +; Network FCB +; +fcb_net_drive EQU BYTE PTR fcb_reserved+1 +fcb_net_handle EQU WORD PTR fcb_reserved+2 +fcb_netID EQU DWORD PTR fcb_reserved+4 + +; +; No sharing local file FCB +; +fcb_nsl_drive EQU BYTE PTR fcb_reserved+1 +fcb_nsl_bits EQU BYTE PTR fcb_reserved+2 +fcb_nsl_firclus EQU WORD PTR fcb_reserved+3 +fcb_nsl_dirsec EQU WORD PTR fcb_reserved+5 +fcb_nsl_dirpos EQU BYTE PTR fcb_reserved+7 + +; +; No sharing local device FCB +; +fcb_nsld_drive EQU BYTE PTR fcb_reserved+1 +fcb_nsld_drvptr EQU DWORD PTR fcb_reserved+2 + +; +; Sharing local FCB +; +fcb_l_drive EQU BYTE PTR fcb_reserved+1 +fcb_l_firclus EQU WORD PTR fcb_reserved+2 +fcb_l_mfs EQU WORD PTR fcb_reserved+4 +fcb_l_attr EQU BYTE PTR fcb_reserved+6 + +; +; Bogusness: the four cases are: +; +; local file 00 +; local device 40 +; local sharing C0 +; network 80 +; +; Since sharing and network collide, we cannot use a test instruction for +; deciding whether a network or a share check in involved +; +FCBDEVICE EQU 040h +FCBNETWORK EQU 080h +FCBSHARE EQU 0C0h + +; FCBSPECIAL must be able to mask off both net and share +FCBSPECIAL EQU 080h +FCBMASK EQU 0C0h + \ No newline at end of file diff --git a/v4.0/src/INC/CPUTYPE.INC b/v4.0/src/INC/CPUTYPE.INC new file mode 100644 index 0000000..da6f102 --- /dev/null +++ b/v4.0/src/INC/CPUTYPE.INC @@ -0,0 +1,39 @@ +; Note: this must be a macro, and not a subroutine in the BIOS since +; it is called from both CODE and SYSINITSEG. +; +;------GET_CPU_TYPE------------------------------------------------------------May, 88 by MW +; Returns: AX = 0 if 8086 or 8088 +; = 1 if 80286 +; = 2 if 80386 +; +Get_CPU_Type macro + pushf + push bx ; preserve bx + xor bx, bx ; init bx to zero + + xor ax,ax ; 0000 into AX + push ax ; put it on the stack... + popf ; ...then shove it into the flags + pushf ; get it back out of the flags... + pop ax ; ...and into ax + and ax,0F000h ; mask off high four bits + cmp ax,0F000h ; was it all 1's? + je cpu_8086 ; aye; it's an 8086 or 8088 + + mov ax,0F000h ; now try to set the high four bits.. + push ax + popf + pushf + pop ax ; ...and see what happens + and ax,0F000h ; any high bits set ? + jz cpu_286 ; nay; it's an 80286 + +cpu_386: ; bx starts as zero + inc bx ; inc twice if 386 +cpu_286: ; just inc once if 286 + inc bx +cpu_8086: ; don't inc at all if 086 + mov ax, bx ; put CPU type value in ax + pop bx ; restore original bx + popf + endm diff --git a/v4.0/src/INC/CURDIR.INC b/v4.0/src/INC/CURDIR.INC new file mode 100644 index 0000000..a91bff7 --- /dev/null +++ b/v4.0/src/INC/CURDIR.INC @@ -0,0 +1,45 @@ +; SCCSID = @(#)curdir.asm 1.1 85/04/10 +; SCCSID = @(#)curdir.asm 1.1 85/04/10 +BREAK +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +; CDS items are used bu the internal routines to store cluster numbers and ; +; network identifiers for each logical name. The ID field is used dually, ; +; both as net ID and for a cluster number for local devices. In the case ; +; of local devices, the cluster number will be -1 if there is a potential ; +; of the disk being changed or if the path must be recracked. The END ; +; field is the location of the end of the definition. No .. is allowed ; +; past this point ; + +DIRSTRLEN EQU 64+3 ; Max length in bytes of directory strings +TEMPLEN EQU DIRSTRLEN*2 + +curdir_list STRUC +curdir_text DB DIRSTRLEN DUP (?) ; text of assignment and curdir +curdir_flags DW ? ; various flags +curdir_devptr DD ? ; local pointer to DPB or net device +curdir_ID DW ? ; cluster of current dir (net ID) + DW ? +curdir_user_word DW ? +curdir_end DW ? ; end of assignment +curdir_type DB ? ; IFS drive (2=ifs, 4=netuse) +curdir_ifs_hdr DD ? ; Ptr to File System Header +curdir_fsda DB 2 DUP (?) ; File System Dependent Data Area +curdir_list ENDS + +curdirLen EQU Size curdir_list ; Needed for screwed up + ; ASM87 which doesn't allow + ; Size directive as a macro + ; argument +curdir_netID EQU DWORD PTR curdir_ID + +;Flag word masks +curdir_isnet EQU 1000000000000000B +curdir_isifs EQU 1000000000000000B ; DOS 4.00 +curdir_inuse EQU 0100000000000000B +curdir_splice EQU 0010000000000000B +curdir_local EQU 0001000000000000B +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; diff --git a/v4.0/src/INC/DBCS.OFF b/v4.0/src/INC/DBCS.OFF new file mode 100644 index 0000000..28db94d --- /dev/null +++ b/v4.0/src/INC/DBCS.OFF @@ -0,0 +1,2 @@ +DBCS = FALSE + \ No newline at end of file diff --git a/v4.0/src/INC/DBCS.ON b/v4.0/src/INC/DBCS.ON new file mode 100644 index 0000000..b2b340a --- /dev/null +++ b/v4.0/src/INC/DBCS.ON @@ -0,0 +1,2 @@ +DBCS = TRUE + \ No newline at end of file diff --git a/v4.0/src/INC/DBCS.SW b/v4.0/src/INC/DBCS.SW new file mode 100644 index 0000000..28db94d --- /dev/null +++ b/v4.0/src/INC/DBCS.SW @@ -0,0 +1,2 @@ +DBCS = FALSE + \ No newline at end of file diff --git a/v4.0/src/INC/DEVSYM.INC b/v4.0/src/INC/DEVSYM.INC new file mode 100644 index 0000000..951a894 --- /dev/null +++ b/v4.0/src/INC/DEVSYM.INC @@ -0,0 +1,207 @@ + %OUT DEVSYM.INC... +; SCCSID = @(#)DEVSYM.ASM 1.10 85/09/04 +; SCCSID = @(#)DEVSYM.ASM 1.10 85/09/04 + +; THE DEVICE TABLE LIST HAS THE FORM: +SYSDEV STRUC +SDEVNEXT DD ? ;POINTER TO NEXT DEVICE HEADER +SDEVATT DW ? ;ATTRIBUTES OF THE DEVICE +SDEVSTRAT DW ? ;STRATEGY ENTRY POINT +SDEVINT DW ? ;INTERRUPT ENTRY POINT +SDEVNAME DB 8 DUP (?) ;NAME OF DEVICE (ONLY FIRST BYTE USED FOR BLOCK) +SYSDEV ENDS + +; +; ATTRIBUTE BIT MASKS +; +; CHARACTER DEVICES: +; +; BIT 15 -> MUST BE 1 +; 14 -> 1 IF THE DEVICE UNDERSTANDS IOCTL CONTROL STRINGS +; 13 -> 1 IF THE DEVICE SUPPORTS OUTPUT-UNTIL-BUSY +; 12 -> UNUSED +; 11 -> 1 IF THE DEVICE UNDERSTANDS OPEN/CLOSE +; 10 -> MUST BE 0 +; 9 -> MUST BE 0 +; 8 -> UNUSED +; 7 -> UNUSED +; 6 -> UNUSED +; 5 -> UNUSED +; 4 -> 1 IF DEVICE IS RECIPIENT OF INT 29H +; 3 -> 1 IF DEVICE IS CLOCK DEVICE +; 2 -> 1 IF DEVICE IS NULL DEVICE +; 1 -> 1 IF DEVICE IS CONSOLE OUTPUT +; 0 -> 1 IF DEVICE IS CONSOLE INPUT +; +; BLOCK DEVICES: +; +; BIT 15 -> MUST BE 0 +; 14 -> 1 IF THE DEVICE UNDERSTANDS IOCTL CONTROL STRINGS +; 13 -> 1 IF THE DEVICE DETERMINES MEDIA BY EXAMINING THE FAT ID BYTE. +; THIS REQUIRES THE FIRST SECTOR OF THE FAT TO *ALWAYS* RESIDE IN +; THE SAME PLACE. +; 12 -> UNUSED +; 11 -> 1 IF THE DEVICE UNDERSTANDS OPEN/CLOSE/REMOVABLE MEDIA +; 10 -> MUST BE 0 +; 9 -> MUST BE 0 +; 8 -> UNUSED +; 7 -> UNUSED +; 6 -> IF DEVICE HAS SUPPORT FOR GETMAP/SETMAP OF LOGICAL DRIVES. +; IF THE DEVICE UNDERSTANDS GENERIC IOCTL FUNCTION CALLS. +; 5 -> UNUSED +; 4 -> UNUSED +; 3 -> UNUSED +; 2 -> UNUSED +; 1 -> UNUSED +; 0 -> UNUSED +; + +DEVTYP EQU 8000H ; BIT 15 - 1 IF CHAR, 0 IF BLOCK +CHARDEV EQU 8000H +DEVIOCTL EQU 4000H ; BIT 14 - CONTROL MODE BIT +ISFATBYDEV EQU 2000H ; BIT 13 - DEVICE USES FAT ID BYTES, + ; COMP MEDIA. +OUTTILBUSY EQU 2000H ; OUTPUT UNTIL BUSY IS ENABLED +ISNET EQU 1000H ; BIT 12 - 1 IF A NET DEVICE, 0 IF + ; NOT. CURRENTLY BLOCK ONLY. +DEVOPCL EQU 0800H ; BIT 11 - 1 IF THIS DEVICE HAS + ; OPEN,CLOSE AND REMOVABLE MEDIA + ; ENTRY POINTS, 0 IF NOT + +EXTENTBIT EQU 0400H ; BIT 10 - CURRENTLY 0 ON ALL DEVS + ; THIS BIT IS RESERVED FOR FUTURE USE + ; TO EXTEND THE DEVICE HEADER BEYOND + ; ITS CURRENT FORM. + +; NOTE BIT 9 IS CURRENTLY USED ON IBM SYSTEMS TO INDICATE "DRIVE IS SHARED". +; SEE IOCTL FUNCTION 9. THIS USE IS NOT DOCUMENTED, IT IS USED BY SOME +; OF THE UTILITIES WHICH ARE SUPPOSED TO FAIL ON SHARED DRIVES ON SERVER +; MACHINES (FORMAT,CHKDSK,RECOVER,..). + +DEV320 EQU 0040H ;BIT 6 - FOR BLOCK DEVICES, THIS + ;DEVICE SUPPORTS SET/GET MAP OF + ;LOGICAL DRIVES, AND SUPPORTS + ;GENERIC IOCTL CALLS. + ;FOR CHARACTER DEVICES, THIS + ;DEVICE SUPPORTS GENERIC IOCTL. + ;THIS IS A DOS 3.2 DEVICE DRIVER. +ISSPEC EQU 0010H ;BIT 4 - THIS DEVICE IS SPECIAL +ISCLOCK EQU 0008H ;BIT 3 - THIS DEVICE IS THE CLOCK DEVICE. +ISNULL EQU 0004H ;BIT 2 - THIS DEVICE IS THE NULL DEVICE. +ISCOUT EQU 0002H ;BIT 1 - THIS DEVICE IS THE CONSOLE OUTPUT. +ISCIN EQU 0001H ;BIT 0 - THIS DEVICE IS THE CONSOLE INPUT. +EXTDRVR EQU 0002H ;BIT 1 - BLOCK DEVICE EXTNDED DRIVER + +;STATIC REQUEST HEADER +SRHEAD STRUC +REQLEN DB ? ;LENGTH IN BYTES OF REQUEST BLOCK +REQUNIT DB ? ;DEVICE UNIT NUMBER +REQFUNC DB ? ;TYPE OF REQUEST +REQSTAT DW ? ;STATUS WORD + DB 8 DUP(?) ;RESERVED FOR QUEUE LINKS +SRHEAD ENDS + +;STATUS WORD MASKS +STERR EQU 8000H ;BIT 15 - ERROR +STBUI EQU 0200H ;BIT 9 - BUISY +STDON EQU 0100H ;BIT 8 - DONE +STECODE EQU 00FFH ;ERROR CODE +; 2/12/KK +; Interim character identifier 2/12/KK +Ddkey EQU 0000010000000000B ; 2/12/KK + +;FUNCTION CODES +DEVINIT EQU 0 ;INITIALIZATION +DINITHL EQU 26 ;SIZE OF INIT HEADER +DEVMDCH EQU 1 ;MEDIA CHECK +DMEDHL EQU 15 ;SIZE OF MEDIA CHECK HEADER +DEVBPB EQU 2 ;GET BPB +DEVRDIOCTL EQU 3 ;IOCTL READ +DBPBHL EQU 22 ;SIZE OF GET BPB HEADER +DEVRD EQU 4 ;READ +DRDWRHL EQU 22 ;SIZE OF RD/WR HEADER +DEVRDND EQU 5 ;NON DESTRUCTIVE READ NO WAIT (CHARACTER DEVS) +DRDNDHL EQU 14 ;SIZE OF NON DESTRUCTIVE READ HEADER +DEVIST EQU 6 ;INPUT STATUS +DSTATHL EQU 13 ;SIZE OF STATUS HEADER +DEVIFL EQU 7 ;INPUT FLUSH +DFLSHL EQU 15 ;SIZE OF FLUSH HEADER +DEVWRT EQU 8 ;WRITE +DEVWRTV EQU 9 ;WRITE WITH VERIFY +DEVOST EQU 10 ;OUTPUT STATUS +DEVOFL EQU 11 ;OUTPUT FLUSH +DEVWRIOCTL EQU 12 ;IOCTL WRITE +DEVOPN EQU 13 ;DEVICE OPEN +DEVCLS EQU 14 ;DEVICE CLOSE +DOPCLHL EQU 13 ;SIZE OF OPEN/CLOSE HEADER +DEVRMD EQU 15 ;REMOVABLE MEDIA +REMHL EQU 13 ;SIZE OF REMOVABLE MEDIA HEADER +GENIOCTL EQU 19 +; THE NEXT THREE ARE USED IN DOS 4.0 +; 20 +; 21 +; 22 +DEVGETOWN EQU 23 ;GET DEVICE OWNER +DEVSETOWN EQU 24 ;SET DEVICE OWNER +OWNHL EQU 13 ;SIZE OF DEVICE OWNER HEADER + +DEVOUT EQU 16 ; OUTPUT UNTIL BUSY. +DEVOUTL EQU DEVWRT ; LENGTH OF OUTPUT UNTIL BUSY + +; GENERIC IOCTL REQUEST STRUCTURE +; SEE THE DOS 4.0 DEVICE DRIVER SPEC FOR FURTHER ELABORATION. +; +IOCTL_REQ STRUC + DB (SIZE SRHEAD) DUP(?) + ; GENERIC IOCTL ADDITION. +MAJORFUNCTION DB ? ;FUNCTION CODE +MINORFUNCTION DB ? ;FUNCTION CATEGORY +REG_SI DW ? +REG_DI DW ? +GENERICIOCTL_PACKET DD ? ; POINTER TO DATA BUFFER +IOCTL_REQ ENDS + +; DEFINITIONS FOR IOCTL_REQ.MINORFUNCTION +GEN_IOCTL_WRT_TRK EQU 40H +GEN_IOCTL_RD_TRK EQU 60H +GEN_IOCTL_FN_TST EQU 20H ; USED TO DIFF. BET READS AND WRTS + +;; 32-bit absolute read/write input list structure + +ABS_32RW STRUC +SECTOR_RBA DD ? ; relative block address +ABS_RW_COUNT DW ? ; number of sectors to be transferred +BUFFER_ADDR DD ? ; data addrress +ABS_32RW ENDS + +;; media ID info + +MEDIA_ID_INFO STRUC +MEDIA_level DW 0 ; info level +MEDIA_Serial DD 0 ; serial # +MEDIA_Label DB 11 dup (' ') ;volume label +MEDIA_System DB 8 dup (' ') ;system type +MEDIA_ID_INFO ENDS + +;; equates for DOS34_FLAG + +IFS_ABSRW EQU 00001H ;IFS absolute read/write +NO_IFS_ABSRW EQU 0FFFEH ;no IFS absolute read/write +IFS_DRIVE_RESET EQU 00002H ;IFS drvive reset +NO_IFS_DRIVE_RESET EQU 0FFFDH ;no IFS drive reset +FROM_DISK_RESET EQU 00004H ;from disk reset +NO_FROM_DISK_RESET EQU 0FFFBH ;not from disk reset +From_String_Output EQU 00008H ;from con string output +NO_From_String_Output EQU 0FFF7H ;not from con string output +From_DOS_WRITE EQU 00010H ;from dos_write +NO_From_DOS_WRITE EQU 0FFEFH ;not from dos_write +Force_I24_Fail EQU 00020H ;form IFS CALL BACK +NO_Force_I24_Fail EQU 0FFDFH ;not form IFS CALL BACK +Disable_EOF_I24 EQU 00040H ;disable EOF int24 for input status +NO_Disable_EOF_I24 EQU 0FFBFH ;disable EOF int24 for input status +DBCS_VOLID EQU 00080H ;indicate from volume id +DBCS_VOLID2 EQU 00100H ;indicate 8th char is DBCS +CTRL_BREAK_FLAG EQU 00200H ;indicate control break is input +NO_CTRL_BREAK_FLAG EQU 0FDFFH ;reset control break +SEARCH_FASTOPEN EQU 00400H ;set fastopen flag for search +X25_special EQU 00800H ;flag for X25 driver diff --git a/v4.0/src/INC/DIRENT.INC b/v4.0/src/INC/DIRENT.INC new file mode 100644 index 0000000..1961721 --- /dev/null +++ b/v4.0/src/INC/DIRENT.INC @@ -0,0 +1,61 @@ +; SCCSID = @(#)dirent.asm 1.1 85/04/10 +; SCCSID = @(#)dirent.asm 1.1 85/04/10 +Break + +; +; +---------------------------+ +; | (12 BYTE) filename/ext | 0 0 +; +---------------------------+ +; | (BYTE) attributes | 11 B +; +---------------------------+ +; | (10 BYTE) reserved | 12 C +; +---------------------------+ +; | (WORD) time of last write | 22 16 +; +---------------------------+ +; | (WORD) date of last write | 24 18 +; +---------------------------+ +; | (WORD) First cluster | 26 1A +; +---------------------------+ +; | (DWORD) file size | 28 1C +; +---------------------------+ +; +; First byte of filename = E5 -> free directory entry +; = 00 -> end of allocated directory +; Time: Bits 0-4=seconds/2, bits 5-10=minute, 11-15=hour +; Date: Bits 0-4=day, bits 5-8=month, bits 9-15=year-1980 +; + +dir_entry STRUC +dir_name DB 11 DUP (?) ; file name +dir_attr DB ? ; attribute bits +dir_codepg dw ? ; code page DOS 4.00 +dir_extcluster dw ? ; extended attribute starting cluster +dir_attr2 db ? ; reserved +dir_pad DB 5 DUP (?) ; reserved for expansion +dir_time DW ? ; time of last write +dir_date DW ? ; date of last write +dir_first DW ? ; first allocation unit of file +dir_size_l DW ? ; low 16 bits of file size +dir_size_h DW ? ; high 16 bits of file size +dir_entry ENDS + +attr_read_only EQU 1h +attr_hidden EQU 2h +attr_system EQU 4h +attr_volume_id EQU 8h +attr_directory EQU 10h +attr_archive EQU 20h +attr_device EQU 40h ; This is a VERY special bit. + ; NO directory entry on a disk EVER + ; has this bit set. It is set non-zero + ; when a device is found by GETPATH + +attr_all EQU attr_hidden+attr_system+attr_directory + ; OR of hard attributes for FINDENTRY + +attr_ignore EQU attr_read_only+attr_archive+attr_device + ; ignore this(ese) attribute(s) during + ; search first/next + +attr_changeable EQU attr_read_only+attr_hidden+attr_system+attr_archive + ; changeable via CHMOD diff --git a/v4.0/src/INC/DIVMES.ASM b/v4.0/src/INC/DIVMES.ASM new file mode 100644 index 0000000..4de491f --- /dev/null +++ b/v4.0/src/INC/DIVMES.ASM @@ -0,0 +1,11 @@ +; THIS IS THE ONLY DOS "MESSAGE". IT DOES NOT NEED A TERMINATOR. + PUBLIC DIVMES +Public DIVM001S,DIVM001E +DIVM001S label byte + +include msdos.cl1 + + PUBLIC DivMesLen +DivMesLen DW $-DivMes ; Length of the above message in bytes +DIVM001E label byte + \ No newline at end of file diff --git a/v4.0/src/INC/DOSCNTRY.INC b/v4.0/src/INC/DOSCNTRY.INC new file mode 100644 index 0000000..6594e96 --- /dev/null +++ b/v4.0/src/INC/DOSCNTRY.INC @@ -0,0 +1,114 @@ +; +;Equates for COUNTRY INFORMATION. +SetCountryInfo EQU 1 ;country info +SetUcase EQU 2 ;uppercase table +SetLcase EQU 3 ;lowercase table (Reserved) +SetUcaseFile EQU 4 ;uppercase file spec table +SetFileList EQU 5 ;valid file character list +SetCollate EQU 6 ;collating sequence +SetDBCS EQU 7 ;double byte character set +SetALL EQU -1 ;all the entries + + +;DOS country and code page information table structure. +;Internally, DOS gives a pointer to this table. +;IBMBIO, MODE and NLSFUNC modules communicate with DOS through +;this structure. +DOS_country_cdpg_info struc +ccInfo_reserved db 8 dup (?) ;reserved for internal use +ccPath_CountrySys db 64 dup (0);path and filename for country info +ccSysCodePage dw 0 ;system code page id +ccNumber_of_entries dw 6 ; 6 entries +ccSetUcase db SetUcase +ccUcase_ptr dd ? ;pointer to Ucase table + +ccSetUcaseFile db SetUcaseFile +ccFileUcase_ptr dd ? ;pointer to File Ucase table + +ccSetFileList db SetFileList +ccFileChar_ptr dd ? ;pointer to File char list table + +ccSetCollate db SetCollate +ccCollate_ptr dd ? ;pointer to collate table + +ccSetDBCS db SetDBCS +ccDBCS_ptr dd ? ;pointer to DBCS table + +ccSetCountryInfo db SetCountryInfo +ccCountryInfoLen dw ? ;length of country info +ccDosCountry dw ? ;active country code id +ccDosCodePage dw ? ;active code page id +ccDFormat dw ? ;date format +ccCurSymbol db " ",0;5 byte of (currency symbol+0) +cc1000Sep db " ",0 ;2 byte of (1000 sep. + 0) +ccDecSep db " ",0 ;2 byte of (Decimal sep. + 0) +ccDateSep db " ",0 ;2 byte of (date sep. + 0) +ccTimeSep db " ",0 ;2 byte of (time sep. + 0) +ccCFormat db ? ;currency format flags +ccCSigDigits db ? ;# of digits in currency +ccTFormat db ? ;time format +ccMono_Ptr dd ? ;monocase routine entry point +ccListSep db " ",0 ;data list separator +ccReserved_area dw 5 dup(?);reserved + +DOS_country_cdpg_info ends + +;Ucase table +CC_UCASE_TAB struc +ccUcase_leng dw 128 +ccUcase_data db 128 dup (?) +CC_UCASE_TAB ends + +;File Ucase table +CC_FILE_UCASE_TAB struc +ccFileucase_leng dw 128 +ccFileucase_data db 128 dup (?) +CC_FILE_UCASE_TAB ends + +;File char list +CC_FILE_CHAR_TAB struc +ccFilechar_leng dw ? +ccFilechar_data db 46 dup (?) +CC_FILE_CHAR_TAB ends + +;collate table +CC_COLLATE_TAB struc +ccCollate_leng dw 256 +ccCollate_data db 256 dup (?) +CC_COLLATE_TAB ends + +;DBCS table - for DOS 4.00 +CC_DBCS_TAB struc +ccDBCS_leng dw 6 +ccDBCS_data db 6 dup (?) +CC_DBCS_TAB ends + +; 2/12/KK +; Define subfunctions of ECS_call ( 63H ) 2/12/KK +; 2/12/KK +GetLeadBTBL EQU 0 ; 2/12/KK +SetInterimMode EQU 1 ; 2/12/KK +GetInterimMode EQU 2 ; 2/12/KK + ; 2/12/KK +NonInterimMode EQU 0 ; 2/12/KK +InterimMode EQU 1 ; 2/12/KK + +OLD_COUNTRY_SIZE equ (type DOS_country_cdpg_info - ccDFormat - 10) +NEW_COUNTRY_SIZE equ (type DOS_country_cdpg_info - ccDosCountry) + +;CAPITALIZATION equates +CAP_ONE_CHAR equ 20H +CAP_STRING equ 21H +CAP_ASCIIZ equ 22H +CHECK_YES_NO equ 23H +UPPER_TABLE equ 80H + +;NLS_YES equ 59H +;NLS_yes2 equ 79H +;NLS_NO equ 4EH +;NLS_no2 equ 6EH + + + + + diff --git a/v4.0/src/INC/DOSMAC.INC b/v4.0/src/INC/DOSMAC.INC new file mode 100644 index 0000000..ca21f8b --- /dev/null +++ b/v4.0/src/INC/DOSMAC.INC @@ -0,0 +1,630 @@ +; SCCSID = @(#)dosmac.asm 1.1 85/04/10 +; SCCSID = @(#)dosmac.asm 1.1 85/04/10 +; +; Macro file for MSDOS. +; + +TRUE EQU 0FFFFh +FALSE EQU 0 + +SUBTTL BREAK a listing into pages and give new subtitles +PAGE +BREAK MACRO subtitle + SUBTTL subtitle + PAGE +ENDM +.xcref break + +BREAK + +AsmVars Macro varlist +IRP var, +AsmVar var +ENDM +ENDM + +AsmVar Macro var +IFNDEF var +var = FALSE +ENDIF +ENDM + +BREAK + +; +; declare a variable external and allocate a size +; +AsmVar InstalledData +I_NEED MACRO sym,len +IF NOT InstalledData + DATA SEGMENT WORD PUBLIC 'DATA' + IFIDN , + EXTRN &sym:WORD + ELSE + IFIDN , + EXTRN &sym:DWORD + ELSE + EXTRN &sym:BYTE + ENDIF + ENDIF + DATA ENDS +ENDIF +ENDM + .xcref I_need + +; +; call a procedure that may be external. The call will be short. +; +invoke MACRO name +.xcref + IF2 + IFNDEF name + EXTRN name:NEAR + ENDIF + ENDIF +.cref + CALL name +ENDM +.xcref invoke + +PAGE +; +; jump to a label that may be external. The jump will be near. +; +transfer MACRO name +.xcref + IF2 + IFNDEF name + EXTRN name:NEAR + ENDIF + ENDIF +.cref + JUMP name +ENDM +.xcref transfer + +; +; get a short address in a word +; +short_addr MACRO name + IFDIF , +.xcref + IF2 + IFNDEF name + EXTRN name:NEAR + ENDIF + ENDIF +.cref + DW OFFSET DOSGROUP:name + ELSE + DW ? + ENDIF +ENDM +.xcref short_addr + +; +; get a long address in a dword +; +long_addr MACRO name +.xcref + IF2 + IFNDEF name + EXTRN name:NEAR + ENDIF + ENDIF +.cref + DD name +ENDM +.xcref long_addr + +; +; declare a PROC near or far but PUBLIC nonetheless +; +.xcref ?frame +.xcref ?aframe +.xcref ?stackdepth +.xcref ?initstack +?frame = 0 ; initial +?aframe = 0 ; initial +?stackdepth = 0 ; initial stack size +?initstack = 0 ; initial stack size + +procedure MACRO name,distance + ?frame = 0 + ?aframe = 2 ;; remember the pushed BP + PUBLIC name + IF1 + %OUT name... pass 1 + ENDIF + IF2 + %OUT name... pass 2 + ENDIF +name PROC distance + ?initstack = ?stackdepth ;; beginning of procedure +ENDM +.xcref procedure + +; +; end a procedure and check that stack depth is preserved +; +EndProc MACRO name, chk + IFDIF , ;; check the stack size + IF2 + IF ?initstack NE ?stackdepth ;; is it different? + %OUT ***** Possible stack size error in name ***** + ENDIF + ENDIF + ENDIF +name ENDP +ENDM +.xcref endproc +PAGE +; +; define a data item to be public and of an appropriate size/type +; + +I_AM MACRO name,size,init +;; declare the object public + PUBLIC name +;; declare the type of the object + IFIDN , +name LABEL WORD + I_AM_SIZE = 1 + I_AM_LEN = 2 + ELSE + IFIDN , +name LABEL DWORD + I_AM_SIZE = 2 + I_AM_LEN = 2 + ELSE + IFIDN , +name LABEL BYTE + I_AM_SIZE = 1 + I_AM_LEN = 1 + ELSE +name LABEL BYTE + I_AM_SIZE = size + I_AM_LEN = 1 + ENDIF + ENDIF + ENDIF +;; if no initialize then allocate blank storage + IFB + DB I_AM_SIZE*I_AM_LEN DUP (?) + ELSE +IF NOT InstalledData + IRP itm, + IF I_AM_LEN EQ 1 + DB itm + ELSE + DW itm + ENDIF + I_AM_SIZE = I_AM_SIZE - 1 + ENDM + IF I_AM_SIZE NE 0 + %out ***** initialization of name not complete ***** + ENDIF +ELSE + DB I_AM_SIZE*I_AM_LEN DUP (?) +ENDIF + ENDIF +ENDM +.xcref I_AM +.xcref I_AM_SIZE +.xcref I_AM_LEN +I_AM_SIZE = 0 +I_AM_LEN = 0 + +PAGE + +; +; define an entry in a procedure +; +entry macro name + PUBLIC name +name: +endm +.xcref entry + +BREAK + +error macro code +.xcref + MOV AL,code + transfer SYS_RET_ERR +.cref +ENDM +.xcref error + +BREAK +; +; given a label either 2 byte jump to another label _J +; if it is near enough or 3 byte jump to +; + +jump macro lbl + local a +.xcref + + ifndef lbl&_J ;; is this the first invocation +a: JMP lbl + ELSE + IF (lbl&_J GE $) OR ($-lbl&_J GT 126) +a: JMP lbl ;; is the jump too far away? + ELSE +a: JMP lbl&_J ;; do the short one... + ENDIF + ENDIF + lbl&_j = a +.cref +endm +.xcref jump + +BREAK + +return macro x + local a +.xcref +a: + RET +ret_l = a +.cref +endm +.xcref return + +BREAK + +condret macro cc,ncc + local a +.xcref +.xcref a +.cref + ifdef ret_l ;; if ret_l is defined + if (($ - ret_l) le 126) and ($ gt ret_l) + ;; if ret_l is near enough then + a: j&cc ret_l ;; a: j to ret_l + ret_&cc = a ;; define ret_ to be a: + exitm + endif + endif + ifdef ret_&cc ;; if ret_ defined + if (($ - ret_&cc) le 126) and ($ gt ret_&cc) + ;; if ret_ is near enough + a: j&cc ret_&cc ;; a: j to ret_ + ret_&cc = a ;; define ret_ to be a: + exitm + endif + endif + j&ncc a ;; j a: + return ;; return + a: ;; a: + ret_&cc = ret_l ;; define ret_ to be ret_l +endm +.xcref condret + +BREAK + +retz macro + condret z,nz +endm +.xcref retz + +BREAK + +retnz macro + condret nz,z +endm +.xcref retnz + +BREAK + +retc macro + condret c,nc +endm +.xcref retc + +BREAK + +retnc macro + condret nc,c +endm +.xcref retnc + +BREAK + +context macro r + PUSH SS + POP r + ASSUME r:DOSGROUP +endm +.xcref context + +BREAK + +SaveReg MACRO reglist ;; push those registers +IRP reg, + ?stackdepth = ?stackdepth + 1 + PUSH reg +ENDM +ENDM +.xcref SaveReg + +BREAK + +RestoreReg MACRO reglist ;; pop those registers +IRP reg, + ?stackdepth = ?stackdepth - 1 + POP reg +ENDM +ENDM +.xcref RestoreReg + +BREAK + +EnterCrit MACRO section + Invoke E§ion +ENDM + +LeaveCrit MACRO section + Invoke L§ion +ENDM + +Break + +AsmVars + +if debug +fmt MACRO typ,lev,fmts,args +local a,b,c + PUSHF +IFNB + TEST BugTyp,typ + JZ c + CMP BugLev,lev + JB c +ENDIF + PUSH AX + PUSH BP + MOV BP,SP +If (not sharef) and (not redirector) +Table segment +a db fmts,0 +Table ends + MOV AX,OFFSET DOSGROUP:a +else + jmp short b +a db fmts,0 +if sharef +b: mov ax,offset share:a +else +b: mov ax,offset netwrk:a +endif +endif + PUSH AX +cargs = 2 +IRP item, +IFIDN , + MOV AX,[BP+2] +ELSE + MOV AX,item +ENDIF + PUSH AX +cargs = cargs + 2 +ENDM + invoke PFMT + ADD SP,Cargs + POP BP + POP AX +c: + POPF +ENDM +else +fmt macro +endm +endif + +Break + +AsmVar Debug,$temp + +IF debug +DOSAssume Macro reg,reglist,message +local a,b + IFIDN , + $temp = 1 + ELSE + IFIDN , + $temp = 0 + ELSE + %out ***** Invalid DOS register reg in DOSAssume ***** + ENDIF + ENDIF + IRP r, + IFIDN , + $temp = $temp OR 2 + ELSE + IFIDN , + $temp = $temp OR 4 + ELSE + %out ***** Invalid register reg in DOSAssume ***** + ENDIF + ENDIF + ENDM + PUSH AX + MOV AX,$temp + PUSH AX +IF SHAREF + MOV AX,OFFSET a +ELSE + MOV AX,OFFSET DOSGroup:a +ENDIF + PUSH AX + Invoke SegCheck + POP AX +IF NOT SHAREF +Table SEGMENT +a DB message,0 +Table ends +ELSE + JMP SHORT a +b DB message,0 +a: +ENDIF +IRP r, + ASSUME r:DOSGroup +ENDM +ENDM +ELSE +DOSAssume Macro reg,reglist,message +IRP r, + ASSUME r:DOSGroup +ENDM +ENDM +ENDIF + +BREAK + +IF DEBUG +Assert MACRO kind, objs, message + LOCAL a,b + IFIDN , + CMP objs,0 + JZ a + fmt <>,<>, +a: + ELSE + IFIDN , + CMP objs,0 + JNZ a + fmt <>,<>, +a: + ELSE + PUSH AX + IRP obj, + PUSH obj + ENDM + IF SHAREF + MOV AX,OFFSET b + ELSE + MOV AX,OFFSET DOSGroup:b + ENDIF + PUSH AX + IFIDN , + Invoke BUFCheck + ENDIF + IFIDN , + Invoke SFTCheck + ENDIF + IFIDN , + Invoke DPBCheck + ENDIF + POP AX + IF SHAREF + JMP SHORT a +b DB Message,0 +a: + ELSE +Table segment +b db Message,0 +Table ends + ENDIF + ENDIF + ENDIF +ENDM +ELSE +Assert Macro +ENDM +ENDIF + +Break + +CallInstall MACRO name,mpx,fn,save,restore +IF Installed + IFNB + SaveReg + ENDIF + MOV AX,(mpx SHL 8) + fn + INT 2Fh + IFNB + RestoreReg + ENDIF +ELSE + Invoke name +ENDIF +ENDM + +Break + +localvar macro name,length +local a + ifidn , + ?frame = ?frame + 1 + a = ?frame + name EQU BYTE PTR [BP-a] + else + ifidn , + ?frame = ?frame + 2 + a = ?frame + name EQU WORD PTR [BP-a] + else + ifidn , + ?frame = ?frame + 4 + a = ?frame + name EQU DWORD PTR [BP-a] + name&l EQU WORD PTR [BP-a] + name&h EQU WORD PTR [BP-a+2] + else + ?frame = ?frame + length + a = ?frame + name EQU BYTE PTR [BP-a] + endif + endif + endif +endm + +enter macro + push bp + mov bp,sp + sub sp,?frame +endm + +leave macro + mov sp,bp + pop bp +endm + +Argvar macro name,length +local a + ifidn , + a = ?aframe + ?aframe = ?aframe + 1 + name EQU BYTE PTR [BP+a] + else + ifidn , + a = ?aframe + ?aframe = ?aframe + 2 + name EQU WORD PTR [BP+a] + else + ifidn , + a = ?aframe + ?aframe = ?aframe + 4 + name EQU DWORD PTR [BP+a] + name&l EQU WORD PTR [BP+a] + name&h EQU WORD PTR [BP+a+2] + else + a = ?aframe + ?aframe = ?aframe + length + name EQU BYTE PTR [BP+a] + endif + endif + endif +endm + +BREAK + +errnz macro x +if x NE 0 + %out ***** FATAL error: x <> 0 +foobar +endif +endm diff --git a/v4.0/src/INC/DOSSEG.ASM b/v4.0/src/INC/DOSSEG.ASM new file mode 100644 index 0000000..a84d79b --- /dev/null +++ b/v4.0/src/INC/DOSSEG.ASM @@ -0,0 +1,25 @@ +; SCCSID = @(#)dosseg.asm 1.1 85/04/10 +; SCCSID = @(#)dosseg.asm 1.1 85/04/10 +; +; segment ordering for MSDOS +; + +START SEGMENT BYTE PUBLIC 'START' +START ENDS + +CONSTANTS SEGMENT WORD PUBLIC 'CONST' +CONSTANTS ENDS + +DATA SEGMENT WORD PUBLIC 'DATA' +DATA ENDS + +TABLE SEGMENT BYTE PUBLIC 'TABLE' +TABLE ENDS + +CODE SEGMENT BYTE PUBLIC 'CODE' +CODE ENDS + +LAST SEGMENT PARA PUBLIC 'LAST' +LAST ENDS + +DOSGROUP GROUP START,CONSTANTS,DATA,TABLE,CODE,LAST diff --git a/v4.0/src/INC/DOSSYM.INC b/v4.0/src/INC/DOSSYM.INC new file mode 100644 index 0000000..02f881e --- /dev/null +++ b/v4.0/src/INC/DOSSYM.INC @@ -0,0 +1,157 @@ +; SCCSID = @(#)dossym.asm 1.1 85/04/10 +; SCCSID = @(#)dossym.asm 1.1 85/04/10 + PAGE 80,132 +TRUE EQU 0FFFFh +FALSE EQU 0 + +Installed = TRUE +IFNDEF DEBUG + DEBUG = FALSE +ENDIF + +include dbcs.sw +include dosmac.INC + +include VERSIONA.INC + +IF2 + %OUT DOSSYM in Pass 2 +ENDIF + +BREAK + +c_DEL EQU 7Fh ; ASCII rubout or delete previous char +c_BS EQU 08h ; ^H ASCII backspace +c_CR EQU 0Dh ; ^M ASCII carriage return +c_LF EQU 0Ah ; ^J ASCII linefeed +c_ETB EQU 17h ; ^W ASCII end of transmission +c_NAK EQU 15h ; ^U ASCII negative acknowledge +c_ETX EQU 03h ; ^C ASCII end of text +c_HT EQU 09h ; ^I ASCII tab + +BREAK + +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; ; +; C A V E A T P R O G R A M M E R ; +; ; +; Certain structures, constants and system calls below are private to ; +; the DOS and are extremely version-dependent. They may change at any ; +; time at the implementors' whim. As a result, they must not be ; +; documented to the general public. If an extreme case arises, they ; +; must be documented with this warning. ; +; ; +; Those structures and constants that are subject to the above will be ; +; marked and bracketed with the flag: ; +; ; +; C A V E A T P R O G R A M M E R ; +; ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + +include bpb.INC + +include buffer.INC + +BREAK +; Location of user registers relative user stack pointer + +user_environ STRUC +user_AX DW ? +user_BX DW ? +user_CX DW ? +user_DX DW ? +user_SI DW ? +user_DI DW ? +user_BP DW ? +user_DS DW ? +user_ES DW ? +user_IP DW ? +user_CS DW ? +user_F DW ? +user_environ ENDS + +include sysvar.INC + +include vector.INC + +include mult.INC + +BREAK +; MSDOS partitions the disk into 4 sections: +; +; phys sector 0: +-------------------+ +; | | boot/reserved | +; | +-------------------+ +; | | File allocation | +; v | table(s) | +; | (multiple copies | +; | are kept) | +; +-------------------+ +; | Directory | +; +-------------------+ +; | File space | +; +-------------------+ +; | Unaddressable | +; | (to end of disk) | +; +-------------------+ +; +; All partition boundaries are sector boundaries. The size of the FAT is +; adjusted to maximize the file space addressable. + +include dirent.INC + +BREAK +; +; The File Allocation Table uses a 12-bit entry for each allocation unit on +; the disk. These entries are packed, two for every three bytes. The contents +; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result +; to the base address of the Allocation Table; 3) fetching the 16-bit word +; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift +; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex). Entry +; number zero is used as an end-of-file trap in the OS and is passed to the +; BIOS to help determine disk format. Entry 1 is reserved for future use. +; The first available allocation unit is assigned entry number two, and even +; though it is the first, is called cluster 2. Entries greater than 0FF8H +; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero +; are unallocated. Otherwise, the contents of a FAT entry is the number of +; the next cluster in the file. +; +; Clusters with bad sectors are tagged with FF7H. Any non-zero number would +; do because these clusters show as allocated, but are not part of any +; allocation chain and thus will never be allocated to a file. A particular +; number is selected so that disk checking programs know what to do (ie. a +; cluster with entry FF7H which is not in a chain is not an error). + +include dpb.INC + +include curdir.INC + +include cpmfcb.INC + +include find.INC + +include pdb.INC + +include exe.INC + +include sf.INC + +include arena.INC + +include intnat.INC + +include mi.INC + +fChk equ 1 +fDelim equ 2 +fSpChk equ 4 +fFCB equ 8 + +include filemode.INC + +include error.INC + +include syscall.INC + +SUBTTL + \ No newline at end of file diff --git a/v4.0/src/INC/DPB.C b/v4.0/src/INC/DPB.C new file mode 100644 index 0000000..e6ce8b9 --- /dev/null +++ b/v4.0/src/INC/DPB.C @@ -0,0 +1,38 @@ +/* dpb.c - retrieve DPB for physical drive */ + +#include "types.h" +#include "sysvar.h" +#include "dpb.h" +#include "cds.h" + +extern char NoMem[], ParmNum[], BadParm[] ; +extern struct sysVarsType SysVars ; + + +/* Walk the DPB list trying to find the appropriate DPB */ + +long GetDPB(i) +int i ; +{ + struct DPBType DPB ; + struct DPBType *pd = &DPB ; + struct DPBType far *dptr ; + int j ; + + *(long *)(&dptr) = DPB.nextDPB = SysVars.pDPB ; + DPB.drive = -1 ; + + while (DPB.drive != i) { + if ((int)DPB.nextDPB == -1) + return -1L ; + + *(long *)(&dptr) = DPB.nextDPB ; + + for (j=0 ; j < sizeof(DPB) ; j++) + *((char *)pd+j) = *((char far *)dptr+j) ; + + } ; + return (long)dptr ; +} + + \ No newline at end of file diff --git a/v4.0/src/INC/DPB.INC b/v4.0/src/INC/DPB.INC new file mode 100644 index 0000000..651f5d0 --- /dev/null +++ b/v4.0/src/INC/DPB.INC @@ -0,0 +1,35 @@ +; SCCSID = @(#)dpb.asm 1.1 85/04/10 +; SCCSID = @(#)dpb.asm 1.1 85/04/10 +BREAK +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +dpb STRUC +dpb_drive DB ? ; Logical drive # assoc with DPB (A=0,B=1,...) +dpb_UNIT DB ? ; Driver unit number of DPB +dpb_sector_size DW ? ; Size of physical sector in bytes +dpb_cluster_mask DB ? ; Sectors/cluster - 1 +dpb_cluster_shift DB ? ; Log2 of sectors/cluster +dpb_first_FAT DW ? ; Starting record of FATs +dpb_FAT_count DB ? ; Number of FATs for this drive +dpb_root_entries DW ? ; Number of directory entries +dpb_first_sector DW ? ; First sector of first cluster +dpb_max_cluster DW ? ; Number of clusters on drive + 1 +dpb_FAT_size DW ? ;;Number of records occupied by FAT +dpb_dir_sector DW ? ; Starting record of directory +dpb_driver_addr DD ? ; Pointer to driver +dpb_media DB ? ; Media byte +dpb_first_access DB ? ; This is initialized to -1 to force a media + ; check the first time this DPB is used +dpb_next_dpb DD ? ; Pointer to next Drive parameter block +dpb_next_free DW ? ; Cluster # of last allocated cluster +dpb_free_cnt DW ? ; Count of free clusters, -1 if unknown +dpb ENDS + +DPBSIZ EQU SIZE dpb ; Size of the structure in bytes + +DSKSIZ = dpb_max_cluster ; Size of disk (temp used during init only) +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + \ No newline at end of file diff --git a/v4.0/src/INC/DPL.ASM b/v4.0/src/INC/DPL.ASM new file mode 100644 index 0000000..cf29b91 --- /dev/null +++ b/v4.0/src/INC/DPL.ASM @@ -0,0 +1,15 @@ +; SCCSID = @(#)dpl.asm 1.1 85/04/10 +; SCCSID = @(#)dpl.asm 1.1 85/04/10 +DPL STRUC +DPL_AX DW ? ; AX register +DPL_BX DW ? ; BX register +DPL_CX DW ? ; CX register +DPL_DX DW ? ; DX register +DPL_SI DW ? ; SI register +DPL_DI DW ? ; DI register +DPL_DS DW ? ; DS register +DPL_ES DW ? ; ES register +DPL_reserved DW ? ; Reserved +DPL_UID DW ? ; User (Machine) ID (0 = local macine) +DPL_PID DW ? ; Process ID (0 = local user PID) +DPL ENDS diff --git a/v4.0/src/INC/DSEG.INC b/v4.0/src/INC/DSEG.INC new file mode 100644 index 0000000..8a527ba --- /dev/null +++ b/v4.0/src/INC/DSEG.INC @@ -0,0 +1,208 @@ +;---Revised 8-17-84 FOR KBX (ADDED ADDITIONAL KEYBOARD FLAG - KB_FLAG_3) +;---------------------------------------- +; 0286 INTERRUPT LOCATIONS (READ): +;---------------------------------------- +ABS0 SEGMENT AT 0 +STG_LOC0 LABEL BYTE + ORG 2*4 +NMI_PTR LABEL WORD + ORG 5*4 +INT5_PTR LABEL WORD + ORG 8*4 +INT_ADDR LABEL WORD +INT_PTR LABEL DWORD + ORG 10H*4 +VIDEO_INT LABEL WORD + ORG 13H*4 ; NEW FDISK +ORG_VECTOR LABEL DWORD + ORG 18H*4 +BASIC_PTR LABEL WORD + ORG 19H*4 +BOOT_VEC LABEL DWORD +BOOT_VECTOR LABEL DWORD + ORG 1DH*4 +PARM_PTR LABEL DWORD ; POINTER TO VIDEO PARMS + ORG 1EH*4 +DISK_POINTER LABEL DWORD + ORG 01FH*4 +EXT_PTR LABEL DWORD + ORG 40H*4 ; DISKETTE POINTER +DISK_VECTOR LABEL DWORD + ORG 41H*4 +HF_TBL_VEC LABEL DWORD + ORG 46H*4 +HF1_TBL_VEC LABEL DWORD + ORG 70H*4 +SLAVE_INT_PTR LABEL DWORD +RTC_INT_VEC LABEL DWORD ; REAL TIME CLOCK INT + ORG 76H*4 ; FIXED DISK INTERRUPT VECTOR +HDISK_INT LABEL DWORD + ORG 400H +DATA_AREA LABEL BYTE ;ABSOLUTE LOCATION OF DATA SEGMENT +DATA_WORD LABEL WORD + ORG 0500H +MFG_TEST_RTN LABEL FAR + ORG 7C00H +BOOT_LOCN LABEL FAR +ABS0 ENDS +PAGE +;------------------------------------------------ +; STACK -- USED DURING INITIALIZATION ONLY : +;------------------------------------------------ +STACK SEGMENT AT 30H + DW 128 DUP(?) +TOS LABEL WORD +STACK ENDS +;---------------------------------------- +; ROM BIOS DATA AREAS : +;---------------------------------------- +DATA SEGMENT AT 40H +;DATA_BASE LABEL BYTE +RS232_BASE DW 4 DUP(?) ; ADDRESSES OF RS232 ADAPTERS +PRINTER_BASE DW 4 DUP(?) ; ADDRESSES OF PRINTERS +EQUIP_FLAG DW 1 DUP(?) ; INSTALLED HARDWARE +MFG_TST DB 1 DUP(?) ; INITIALIZATION FLAG +MEMORY_SIZE DW 1 DUP(?) ; MEMORY SIZE IN K BYTES +MFG_ERR_FLAG DB 1 DUP(?) ; SCRATCHPAD FOR MANUFACTURING + DB 1 DUP(?) ; ERROR CODES +PAGE +;---------------------------------------- +; KEYBOARD DATA AREAS : +;---------------------------------------- +KB_FLAG DB 1 DUP(?) +KB_FLAG_1 DB 1 DUP(?) ; SECOND BYTE OF KEYBOARD STATUS +ALT_INPUT DB 1 DUP(?) ; STORAGE FOR ALTERNATE KEYPAD ENTRY +BUFFER_HEAD DW 1 DUP(?) ; POINTER TO HEAD OF KEYBOARD BUFFER +BUFFER_TAIL DW 1 DUP(?) ; POINTER TO TAIL OF KEYBOARD BUFFER +KB_BUFFER DW 16 DUP(?) ; ROOM FOR 15 ENTRIES +KB_BUFFER_END LABEL WORD + +;------ HEAD = TAIL INDICATES THAT THE BUFFER IS EMPTY + +;---------------------------------------- +; DISKETTE DATA AREAS : +;---------------------------------------- +SEEK_STATUS DB 1 DUP(?) ; DRIVE RECALIBRATION STATUS + ; BIT 3-0 = DRIVE 3-0 NEEDS RECAL + ; BEFORE NEXT SEEK IF BIT IS = 0 +MOTOR_STATUS DB 1 DUP(?) ; MOTOR STATUS + ; BIT 3-0 = DRIVE 3-0 IS CURRENTLY + ; RUNNING + ; BIT 7 = CURRENT OPERATION IS A WRITE, + ; REQUIRES DELAY +MOTOR_COUNT DB 1 DUP(?) ; TIME OUT COUNTER FOR DRIVE TURN OFF +DISKETTE_STATUS DB 1 DUP(?) ; RETURN CODE STATUS BYTE +CMD_BLOCK LABEL BYTE +HD_ERROR LABEL BYTE +NEC_STATUS DB 7 DUP(?) ; STATUS BYTES FROM NEC +PAGE +;---------------------------------------- +; VIDEO DISPLAY DATA AREA : +;---------------------------------------- +CRT_MODE DB 1 DUP(?) ; CURRENT CRT MODE +CRT_COLS DW 1 DUP(?) ; NUMBER OF COLUMNS ON SCREEN +CRT_LEN DW 1 DUP(?) ; LENGTH OF REGEN IN BYTES +CRT_START DW 1 DUP(?) ; STARTING ADDRESS IN REGEN BUFFER +CURSOR_POSN DW 8 DUP(?) ; CURSOR FOR EACH OF UP TO 8 PAGES +CURSOR_MODE DW 1 DUP(?) ; CURRENT CURSOR MODE SETTING +ACTIVE_PAGE DB 1 DUP(?) ; CURRENT PAGE BEING DISPLAYED +ADDR_6845 DW 1 DUP(?) ; BASE ADDRESS FOR ACTIVE DISPLAY CARD +CRT_MODE_SET DB 1 DUP(?) ; CURRENT SETTING OF THE 3X8 REGISTER +CRT_PALLETTE DB 1 DUP(?) ; CURRENT PALLETTE SETTING COLOR CARD +PAGE +;---------------------------------------- +; POST DATA AREA : +;---------------------------------------- +IO_ROM_INIT DW 1 DUP(?) ; PNTR TO OPTIONAL I/O ROM INIT ROUTINE +IO_ROM_SEG DW 1 DUP(?) ; POINTER TO IO ROM SEGMENT +INTR_FLAG DB 1 DUP(?) ; FLAG TO INDICATE AN INTERRUPT HAPPEND +;---------------------------------------- +; TIMER DATA AREA : +;---------------------------------------- +TIMER_LOW DW 1 DUP(?) ; LOW WORD OF TIMER COUNT +TIMER_HIGH DW 1 DUP(?) ; HIGH WORD OF TIMER COUNT +TIMER_OFL DB 1 DUP(?) ; TIMER HAS ROLLED OVER SINCE LAST READ +;---------------------------------------- +; SYSTEM DATA AREA : +;---------------------------------------- +BIOS_BREAK DB 1 DUP(?) ; BIT 7=1 IF BREAK KEY HAS BEEN HIT +RESET_FLAG DW 1 DUP(?) ; WORD=1234H IF KEYBOARD RESET UNDERWAY +PAGE +;---------------------------------------- +; HARD FILE DATA AREAS : +;---------------------------------------- +DISK_STATUS1 DB 1 DUP(?) +HF_NUM DB 1 DUP(?) +CONTROL_BYTE DB 1 DUP(?) +PORT_OFF DB 1 DUP(?) +;------------------------------------------------------ +; PRINTER AND RS232 TIME-OUT VARIABLES : +;------------------------------------------------------ +PRINT_TIM_OUT DB 4 DUP(?) +RS232_TIM_OUT DB 4 DUP(?) +;---------------------------------------- +; ADDITIONAL KEYBOARD DATA AREA : +;---------------------------------------- +BUFFER_START DW 1 DUP(?) +BUFFER_END DW 1 DUP(?) +;--------------------------------------- +; ADDITIONAL FLOPPY DATA ; +;--------------------------------------- + ORG 8BH +LASTRATE DB 1 DUP(?) ; LAST DATA RATE SELECTED +PAGE +;--------------------------------------- +; ADDITIONAL HARD FILE DATA : +;--------------------------------------- + ORG 8CH +HF_STATUS DB 1 DUP(?) ; STATUS REGISTER +HF_ERROR DB 1 DUP(?) ; ERROR REGISTER +HF_INT_FLAG DB 1 DUP(?) ; HARD FILE INTERRUPT FLAG +HF_CNTRL DB 1 DUP(?) ; COMBO HARD FILE/FLOPPY CARD BIT 0=1 +;---------------------------------------- +; ADDITIONAL DISKETTE AREA : +;---------------------------------------- + ORG 90H +DSK_STATE LABEL BYTE + DB 1 DUP(?) ; DRIVE 0 MEDIA STATE + DB 1 DUP(?) ; DRIVE 1 MEDIA STATE + DB 1 DUP(?) ; DRIVE 0 OPERATION START STATE + DB 1 DUP(?) ; DRIVE 1 OPERATION START STATE +DSK_TRK DB 1 DUP(?) ; DRIVE 0 PRESENT CYLINDER + DB 1 DUP(?) ; DRIVE 1 PRESENT CYLINDER + DB 1 DUP(?) ; RESERVED +;---------------------------------------- AEV +; ADDITIONAL KEYBOARD FLAG FOR KBX: AEV +;---------------------------------------- AEV + ORG 96H ; AEV +KB_FLAG_3 DB 1 DUP(?) ; AEV +;---------------------------------------- +; ADDITIONAL KEYBOARD LED FLAG : +;---------------------------------------- + ORG 97H +KB_FLAG_2 DB 1 DUP(?) +PAGE +;---------------------------------------- +; REAL TIME CLOCK DATA AREA : +;---------------------------------------- + ORG 98H +USER_FLAG DW 1 DUP(?) ; OFFSET ADDR OF USERS WAIT FLAG +USER_FLAG_SEG DW 1 DUP(?) ; SEG ADDR OF USER WAIT FLAG +RTC_LOW DW 1 DUP(?) ; LOW WORD OF USER WAIT FLAG +RTC_HIGH DW 1 DUP(?) ; HIGH WORD OF USER WAIT FLAG +RTC_WAIT_FLAG DB 1 DUP(?) ; WAIT ACTIVE FLAG +DATA ENDS +;---------------------------------------- +; EXTRA DATA AREA : +;---------------------------------------- +XXDATA SEGMENT AT 50H +STATUS_BYTE DB 1 DUP(?) +XXDATA ENDS +;---------------------------------------- +; VIDEO DISPLAY BUFFER : +;---------------------------------------- +VIDEO_RAM SEGMENT AT 0B800H +REGEN LABEL BYTE +REGENW LABEL WORD + DB 16384 DUP(?) +VIDEO_RAM ENDS diff --git a/v4.0/src/INC/EA.INC b/v4.0/src/INC/EA.INC new file mode 100644 index 0000000..c77cde2 --- /dev/null +++ b/v4.0/src/INC/EA.INC @@ -0,0 +1,72 @@ + +;Get/Set Extended Attrbute Equates + +;The following equates are for EA types + +EAISUNDEF equ 00H ; undefined +EAISLOGICAL equ 01H ; logical (0 or 1), 1 byte +EAISBINARY equ 02H ; binary integer 1, 2, or 4 bytes +EAISASCII equ 03H ; ASCII , 0 to 128 bytes +EAISDATE equ 04H ; DOS file date format, 2 bytes +EAISTIME equ 05H ; DOS file time format, 2 bytes + +;The following equates are for EA flags + +EASYSTEM equ 8000H ; system defined, bultin +EAREADONLY equ 4000H ; read-only , cannot be changed +EAHIDDEN equ 2000H ; hidden from ATTRIB +EACREATEONLY equ 1000H ; settable only at create time + +;The following equates are for EA failure reason code (set by DOS) + +EARCSUCCESS equ 00H ; success +EARCNOTFOUND equ 01H ; name not found +EARCNOSPACE equ 02H ; no space to hold name or value +EARCNOTNOW equ 03H ; name can't be set on this function +EARCNOTEVER equ 04H ; name can't be set +EARCUNDEF equ 05H ; name known to IFS but not supported +EARCDEFBAD equ 06H ; EA definition bad (type,length, etc) +EARCACCESS equ 07H ; EA access denied +EARCBADVAL equ 08H ; bad value +EARCDEVERROR equ 09H ; device error +EARCUNKNOWN equ 0FFFFH ; unknown cause + + +;The following equates are for EA file type + +EAEXISTING equ 00H ; existing file +EARTL equ 02H ; right to left +EAEXECUTABLE equ 03H ; executable program +EAINSTALLABLE equ 04H ; installable executable program +EAOVERLAY equ 05H ; program overlay +EADEV_DRIVER equ 06H ; device driver +EAIFS_DRIVER equ 07H ; ifs deriver + + + + +By_Create equ 0000010B ; set by Extended Open (create) +BY_XA equ 0000100B ; set by Get/Set XA by Handle + +;Extended Attribute Structure + +EA STRUC ; extended attribute list +EA_TYPE DB ? ; type +EA_FLAGS DW ? ; flags +EA_RC DB ? ; reason code +EA_NAMELEN DB ? ; name length +EA_VALLEN DW ? ; value length +EA_NAME DB ? ; name +EA ENDS + + +;Query Extended Attribute list + +QEA STRUC ; extended attribute list +QEA_TYPE DB ? ; type +QEA_FLAGS DW ? ; flags +QEA_NAMELEN DB ? ; name length +QEA_NAME DB ? ; name +QEA ENDS + + \ No newline at end of file diff --git a/v4.0/src/INC/ERROR.INC b/v4.0/src/INC/ERROR.INC new file mode 100644 index 0000000..49c2843 --- /dev/null +++ b/v4.0/src/INC/ERROR.INC @@ -0,0 +1,155 @@ +; SCCSID = @(#)error.asm 1.1 85/04/10 +; SCCSID = @(#)error.asm 1.1 85/04/10 +BREAK + +; +; XENIX calls all return error codes through AX. If an error occurred then +; the carry bit will be set and the error code is in AX. If no error occurred +; then the carry bit is reset and AX contains returned info. +; +; Since the set of error codes is being extended as we extend the operating +; system, we have provided a means for applications to ask the system for a +; recommended course of action when they receive an error. +; +; The GetExtendedError system call returns a universal error, an error +; location and a recommended course of action. The universal error code is +; a symptom of the error REGARDLESS of the context in which GetExtendedError +; is issued. +; + +; +; These are the 2.0 error codes +; +error_invalid_function EQU 1 +error_file_not_found EQU 2 +error_path_not_found EQU 3 +error_too_many_open_files EQU 4 +error_access_denied EQU 5 +error_invalid_handle EQU 6 +error_arena_trashed EQU 7 +error_not_enough_memory EQU 8 +error_invalid_block EQU 9 +error_bad_environment EQU 10 +error_bad_format EQU 11 +error_invalid_access EQU 12 +error_invalid_data EQU 13 +;**** reserved EQU 14 ; ***** +error_invalid_drive EQU 15 +error_current_directory EQU 16 +error_not_same_device EQU 17 +error_no_more_files EQU 18 +; +; These are the universal int 24 mappings for the old INT 24 set of errors +; +error_write_protect EQU 19 +error_bad_unit EQU 20 +error_not_ready EQU 21 +error_bad_command EQU 22 +error_CRC EQU 23 +error_bad_length EQU 24 +error_Seek EQU 25 +error_not_DOS_disk EQU 26 +error_sector_not_found EQU 27 +error_out_of_paper EQU 28 +error_write_fault EQU 29 +error_read_fault EQU 30 +error_gen_failure EQU 31 +; +; These are the new 3.0 error codes reported through INT 24 +; +error_sharing_violation EQU 32 +error_lock_violation EQU 33 +error_wrong_disk EQU 34 +error_FCB_unavailable EQU 35 +error_sharing_buffer_exceeded EQU 36 +error_Code_Page_Mismatched EQU 37 ; DOS 4.00 ;AN000; +error_handle_EOF EQU 38 ; DOS 4.00 ;AN000; +error_handle_Disk_Full EQU 39 ; DOS 4.00 ;AN000; +; +; New OEM network-related errors are 50-79 +; +error_not_supported EQU 50 +; +; End of INT 24 reportable errors +; +error_file_exists EQU 80 +error_DUP_FCB EQU 81 ; ***** +error_cannot_make EQU 82 +error_FAIL_I24 EQU 83 +; +; New 3.0 network related error codes +; +error_out_of_structures EQU 84 +error_Already_assigned EQU 85 +error_invalid_password EQU 86 +error_invalid_parameter EQU 87 +error_NET_write_fault EQU 88 +error_sys_comp_not_loaded EQU 90 ; DOS 4.00 ;AN000; + +BREAK + +error_I24_write_protect EQU 0 +error_I24_bad_unit EQU 1 +error_I24_not_ready EQU 2 +error_I24_bad_command EQU 3 +error_I24_CRC EQU 4 +error_I24_bad_length EQU 5 +error_I24_Seek EQU 6 +error_I24_not_DOS_disk EQU 7 +error_I24_sector_not_found EQU 8 +error_I24_out_of_paper EQU 9 +error_I24_write_fault EQU 0Ah +error_I24_read_fault EQU 0Bh +error_I24_gen_failure EQU 0Ch +; NOTE: Code 0DH is used by MT-DOS. +error_I24_wrong_disk EQU 0Fh + +; THE FOLLOWING ARE MASKS FOR THE AH REGISTER ON Int 24 + +Allowed_FAIL EQU 00001000B +Allowed_RETRY EQU 00010000B +Allowed_IGNORE EQU 00100000B +;NOTE: ABORT is ALWAYS allowed + +I24_operation EQU 00000001B ;Z if READ,NZ if Write +I24_area EQU 00000110B ; 00 if DOS + ; 01 if FAT + ; 10 if root DIR + ; 11 if DATA +I24_class EQU 10000000B ;Z if DISK, NZ if FAT or char + +BREAK + +; Values for error CLASS + +errCLASS_OutRes EQU 1 ; Out of Resource +errCLASS_TempSit EQU 2 ; Temporary Situation +errCLASS_Auth EQU 3 ; Permission problem +errCLASS_Intrn EQU 4 ; Internal System Error +errCLASS_HrdFail EQU 5 ; Hardware Failure +errCLASS_SysFail EQU 6 ; System Failure +errCLASS_Apperr EQU 7 ; Application Error +errCLASS_NotFnd EQU 8 ; Not Found +errCLASS_BadFmt EQU 9 ; Bad Format +errCLASS_Locked EQU 10 ; Locked +errCLASS_Media EQU 11 ; Media Failure +errCLASS_Already EQU 12 ; Collision with Existing Item +errCLASS_Unk EQU 13 ; Unknown/other + +; Values for error ACTION + +errACT_Retry EQU 1 ; Retry +errACT_DlyRet EQU 2 ; Delay Retry, retry after pause +errACT_User EQU 3 ; Ask user to regive info +errACT_Abort EQU 4 ; abort with clean up +errACT_Panic EQU 5 ; abort immediately +errACT_Ignore EQU 6 ; ignore +errACT_IntRet EQU 7 ; Retry after User Intervention + +; Values for error LOCUS + +errLOC_Unk EQU 1 ; No appropriate value +errLOC_Disk EQU 2 ; Random Access Mass Storage +errLOC_Net EQU 3 ; Network +errLOC_SerDev EQU 4 ; Serial Device +errLOC_Mem EQU 5 ; Memory diff --git a/v4.0/src/INC/ERRTST.C b/v4.0/src/INC/ERRTST.C new file mode 100644 index 0000000..20bb0bf --- /dev/null +++ b/v4.0/src/INC/ERRTST.C @@ -0,0 +1,310 @@ +/* 0 */ +#include "comsub.h" +#include "dpb.h" +#include +#include "jointype.h" + +extern unsigned char *com_substr() ; /* ;AN000; DBCS enabled */ +extern char getdrv() ; + +union REGS inregs, outregs; /* ;AN000; Regs for Int21 */ +struct SREGS segregs; /* ;AN000; Segment regs for Int21 */ + +#define GET_DBCS_VEC 0x6300 /* ;AN000; Int21 Get DBCS Vector */ +#define DBLNULL "00" /* ;AN000; */ +#define NULL 0 /* ;AN000; */ + +#define KANJI TRUE + +/* return FALSE if drive is valid AND the path is not a prefix of a non-root + * current directory. + */ +char fPathErr(p) +char *p ; +{ + char buf[MAXARG] ; + int d ; +#ifdef KANJI + char *p1; +#endif + + if (p[1] == ':') + d = *p-'A'+1 ; + else + d = 0 ; + + if (curdir(buf, d) == -1) /* drive is invalid => error */ + return(TRUE) ; + + if (strlen(buf) == 3) /* current directory is root => OK */ + return(FALSE) ; + + if (strpre(p, buf)) { +#ifdef KANJI + p1 = p; + while (*p1 != NULL) { + if(testkanj(*p1 & 0xFF)) + p1 += 2 ; + else + if((*p1++ == '\\') && (*p1 == NULL)) + return(TRUE) ; + } +#else + if (p[strlen(p)-1] == '\\') /* prefix matched, prefix had...*/ + return(TRUE) ; /* ...trailing / => valid ... */ + /* ...prefix => ERROR */ +#endif + d = buf[strlen(p)] ; + if (d == 0 || d == '\\') /* prefix matched,... */ + return(TRUE) ; /* ...prefix had no trailing /, */ + /* ...next char was / => ... */ + /* ...valid prefix => ERROR */ + } ; + + return(FALSE) ; /* drive letter good and not valid prefix => OK */ +} + + +strpre(pre, tot) + char *pre; + char *tot; +{ + return(!strncmp(pre, tot, strlen(pre))); +} + + + +Fatal(p) +char *p ; +{ + printf("%s\n", p) ; + exit(1) ; +} + + + + +ffirst(pb, attr, pfbuf) +char *pb ; +int attr ; +struct findType *pfbuf ; +{ + union REGS regs ; + + /* set DMA to point to buffer */ + + regs.h.ah = 0x1A ; + regs.x.dx = (unsigned) pfbuf ; + intdos (®s, ®s) ; + + /* perform system call */ + + regs.h.ah = 0x4E ; + regs.x.cx = attr ; + regs.x.dx = (unsigned) pb ; + intdos (®s, ®s) ; + + return (regs.x.cflag ? -1 : 0) ; +} + +fnext (pfbuf) +struct findType *pfbuf; +{ + union REGS regs; + + /* set DMA to point to buffer */ + regs.h.ah = 0x1A; + regs.x.dx = (unsigned) pfbuf; + intdos (®s, ®s); + /* perform system call */ + regs.h.ah = 0x4F; + intdos (®s, ®s); + return (regs.x.cflag ? -1 : 0) ; +} + + +char *strbscan(str, class) +char *str ; +char *class ; +{ + char *p ; + + p = com_substr(str, class) ; /* :AN000; DBCS function */ + return((p == NULL) ? (str + strlen(str)) : p) ; +} + + + + + +/* curdir.c - return text of current directory for a particular drive */ + + +curdir (dst, drive) +char *dst ; +int drive ; +{ + union REGS regs ; + + *dst++ = PathChr ; + regs.h.ah = 0x47 ; + regs.h.dl = drive ; + regs.x.si = (unsigned) dst ; + intdos (®s, ®s) ; + return(regs.x.cflag ? -1 : 0) ; +} + + + + +/* + rootpath +*/ + +/*** rootpath -- convert a pathname argument to root based cannonical form + * + * rootpath determines the current directory, appends the path argument (which + * may affect which disk the current directory is relative to), and qualifies + * "." and ".." references. The result is a complete, simple, path name with + * drive specifier. + * + * If the relative path the user specifies does not include a drive spec., the + * default drive will be used as the base. (The default drive will never be + * changed.) + * + * entry: relpath -- pointer to the pathname to be expanded + * fullpath -- must point to a working buffer, see warning + * exit: fullpath -- the full path which results + * return: true if an error occurs, false otherwise + * + * calls: curdir, getdrv + * + * warning: fullpath must point to a working buffer large enough to hold the + * longest possible relative path argument plus the longest possible + * current directory path. + * + */ +int rootpath(relpath, fullpath) +char *relpath ; +char *fullpath ; +{ + int drivenum ; + char tempchar; + register char *lead, *follow ; + char *p1, *p2; + + + /* extract drive spec */ + drivenum = getdrv() ; + if ((*relpath != NULL) && (relpath[1] == COLON)) { + drivenum = relpath[0] - 'A' ; + relpath += 2 ; + } + fullpath[0] = (char) ('A' + drivenum) ; + fullpath[1] = COLON ; + + /* append relpath to fullpath/base */ + if (*relpath == PathChr) { + /* relpath starts at base */ + strcpy(fullpath+2, relpath) ; + } + else { + /* must get base path first */ + if (curdir(fullpath+2, drivenum+1)) + return(TRUE) ; /* terrible error */ + if ((*relpath != ASCNULL) && (strlen(fullpath) > 3)) + strcat(fullpath, "\\") ; + strcat(fullpath, relpath) ; + } + + + /* convert path to cannonical form */ + lead = fullpath ; + while(*lead != ASCNULL) { + /* mark next path segment */ + follow = lead ; + lead = (char *) com_substr(follow+1, "\\") ; /* ;AC000; */ + if (lead == NULL) + lead = fullpath + strlen(fullpath) ; + tempchar = *lead ; + if (tempchar == PathChr) + tempchar = BACKSLASH ; /* make breaks uniform */ + *lead = ASCNULL ; + + /* "." segment? */ + if (strcmp(follow+1, ".") == 0) { + *lead = tempchar ; + strcpy(follow, lead) ; /* remove "." segment */ + lead = follow ; + } + + /* ".." segment? */ + else if (strcmp(follow+1, "..") == 0) { + *lead = tempchar ; + tempchar = *follow ; + *follow = NULL ; + p2 = fullpath - 1 ; + while(*(p2=strbscan(p1=p2+1,"\\")) != NULL) ; + /* p1 now points to the start of the previous element */ + *follow = tempchar ; + if(p1 == fullpath) + return(TRUE) ; /* tried to .. the root */ + follow = p1 - 1 ; /* follow points to path sep */ + strcpy(follow, lead) ; /* remove ".." segment */ + lead = follow ; + } + + /* normal segment */ + else + *lead = tempchar ; + } + if (strlen(fullpath) == 2) /* 'D:' or some such */ + strcat(fullpath, "\\") ; + + return(FALSE) ; +} + + +/* getdrv - return current drive as a character */ + + +char getdrv() +{ + union REGS regs ; + + regs.h.ah = CURDISK ; /* Function 0x19 */ + intdos (®s, ®s) ; + return(regs.h.al) ; +} + +testkanj(c) +unsigned char c; +{ + char fix_es_reg[1]; /* ;AN000; Fixes es reg after "far" */ + char far * fptr; /* ;AN000; Pts to DBCS vector */ + unsigned * ptr; /* ;AN000; Input to fptr */ + unsigned int got_dbcs; /* ;AN000; Flag */ + + inregs.x.ax = GET_DBCS_VEC; /* ;AN000; 0x6300 */ + intdosx(&inregs,&outregs,&segregs); /* ;AN000; Int21 */ + + got_dbcs = FALSE; /* ;AN000; Initialize */ + + ptr = (unsigned *)&fptr; /* ;AN000; Int21 returns DS:SI */ + *ptr = outregs.x.si; /* ;AN000; as ptr to DBCS */ + ptr++; /* ;AN000; vector, now fill */ + *ptr = segregs.ds; /* ;AN000; in our pointer */ + + for (fptr; *(unsigned far *)fptr != (unsigned)DBLNULL; fptr += 2) /* ;AN000; */ + { /* ;AN000; */ + if ( (c >= (char)*fptr) && (c <= (char)*(fptr+1)) ) /* ;AN000; Is char */ + { /* ;AN000; within the range? */ + got_dbcs = TRUE; /* ;AN000; Char is DBCS */ + break; /* ;AN000; */ + } /* ;AN000; */ + } /* ;AN000; */ + + strcpy(fix_es_reg,NULL); /* ;AN000; Repair ES reg */ + return(got_dbcs); /* ;AN000; */ +} + \ No newline at end of file diff --git a/v4.0/src/INC/EXE.INC b/v4.0/src/INC/EXE.INC new file mode 100644 index 0000000..e768f6b --- /dev/null +++ b/v4.0/src/INC/EXE.INC @@ -0,0 +1,78 @@ +; SCCSID = @(#)exe.asm 1.1 85/04/10 +; SCCSID = @(#)exe.asm 1.1 85/04/10 +BREAK +; +; EXEC arg block - load/go program +; + +; +; The following get used as arguments to the EXEC system call. They indicate +; whether or not the program is executed or whether or not a program header +; gets created. +; +exec_func_no_execute EQU 1 ; no execute bit +exec_func_overlay EQU 2 ; overlay bit + +Exec0 STRUC +Exec0_environ DW ? ; seg addr of environment +Exec0_com_line DD ? ; pointer to asciz command line +Exec0_5C_FCB DD ? ; default fcb at 5C +Exec0_6C_FCB DD ? ; default fcb at 6C +Exec0 ENDS + +Exec1 STRUC +Exec1_environ DW ? ; seg addr of environment +Exec1_com_line DD ? ; pointer to asciz command line +Exec1_5C_FCB DD ? ; default fcb at 5C +Exec1_6C_FCB DD ? ; default fcb at 6C +Exec1_SP DW ? ; stack pointer of program +Exec1_SS DW ? ; stack seg register of program +Exec1_IP DW ? ; entry point IP +Exec1_CS DW ? ; entry point CS +Exec1 ENDS + +Exec3 STRUC +Exec3_load_addr DW ? ; seg address of load point +Exec3_reloc_fac DW ? ; relocation factor +Exec3 ENDS + +; +; Exit codes in upper byte +; +Exit_terminate EQU 0 +Exit_abort EQU 0 +Exit_Ctrl_C EQU 1 +Exit_Hard_Error EQU 2 +Exit_Keep_process EQU 3 + +; +; EXE file header +; + +EXE_file STRUC +exe_signature DW ? ; must contain 4D5A (yay zibo!) +exe_len_mod_512 DW ? ; low 9 bits of length +exe_pages DW ? ; number of 512b pages in file +exe_rle_count DW ? ; count of reloc entries +exe_par_dir DW ? ; number of paragraphs before image +exe_min_BSS DW ? ; minimum number of para of BSS +exe_max_BSS DW ? ; max number of para of BSS +exe_SS DW ? ; stack of image +exe_SP DW ? ; SP of image +exe_chksum DW ? ; checksum of file (ignored) +exe_IP DW ? ; IP of entry +exe_CS DW ? ; CS of entry +exe_rle_table DW ? ; byte offset of reloc table +exe_iov DW ? ; overlay number (0 for root) +exe_sym_tab DD ? ; offset of symbol table in file +EXE_file ENDS + +exe_valid_signature EQU 5A4Dh +exe_valid_old_signature EQU 4D5Ah + +symbol_entry STRUC +sym_value DD ? +sym_type DW ? +sym_len DB ? +sym_name DB 255 dup (?) +symbol_entry ENDS diff --git a/v4.0/src/INC/FASTOPEN.INC b/v4.0/src/INC/FASTOPEN.INC new file mode 100644 index 0000000..a01c6da --- /dev/null +++ b/v4.0/src/INC/FASTOPEN.INC @@ -0,0 +1,148 @@ +; +; EXPORT DATE: 9/11 +;Equates for FASTOPEN. + +;FASTOPEN NAME CACHING Subfunctions +FONC_Look_up equ 1 +FONC_insert equ 2 +FONC_delete equ 3 +FONC_update equ 4 +FONC_purge equ 5 ;reserved for the future use. + +;FASTOPEN EXTENT CACHING Subfunctions +FSK_Open equ 11 ;AN000; +FSK_Close equ 12 ;AN000; +FSK_Delete equ 13 ;AN000; +FSK_Lookup equ 14 ;AN000; +FSK_Insert equ 15 ;AN000; +FSK_Trunc equ 16 ;AN000; + +HeaderSize equ 8 ; size of file header (8 bytes) ;AN000; +ExtendSize equ 8 ; size of extend (8 bytes) ;AN000; +Num_Of_Pages equ 1 ; number of pages ;AN000; +Num_Of_Segs equ 2 ; number of frame segments ;AN000; +Stayresident equ 04ch ; terminate and stay resident function code + + +;Equates used in DOS. +FastOpen_Set equ 00000001B +FastOpen_Reset equ 11111110B +Lookup_Success equ 00000010B +Lookup_Reset equ 11111101B +Special_Fill_Set equ 00000100B +Special_Fill_Reset equ 11111011B +No_Lookup equ 00001000B +Set_For_Search equ 00010000B ;DCR 167 + + +;============= FastOpen Data Structures ===================== + +Fastopen_Entry STRUC ;Fastopen Entry pointer in DOS +Fastopen_Entry_size dw 4 ;size of the following +Fastopen_Name_Caching dd ? +;Fastopen_FatChain_Caching dd ? ;reserved for future use +Fastopen_Entry ENDS +; + + +CMPCT_DIR_INFO STRUC ;compact version of Dir Info. +CDI_file_name db 11 dup (' ') +CDI_file_attr db ? +CDI_codepage dw ? +CDI_extcluster dw ? +CDI_attr2 db ? +CDI_time dw ? +CDI_date dw ? +CDI_cluster dw ? +CDI_filesize dd ? +CMPCT_DIR_INFO ENDS +; + +ORIG_DIR_INFO STRUC +ODI_head db 17 dup (?) +ODI_skip db 5 dup (0) ;reserved for DOS. FASTOPEN does not +ODI_tail db 10 dup (?) ; use ODI_skip part. +ORIG_DIR_INFO ENDS +; + +ODI_head_leng equ 17 +ODI_skip_leng equ 5 +ODI_tail_leng equ 10 +; + +FASTOPEN_EXTENDED_INFO STRUC +FEI_dirpos db 0 +FEI_dirsec dd 0 +FEI_clusnum dw 0 +FEI_lastent dw 0 ; for search first +FEI_dirstart dw 0 ; for search first +FASTOPEN_EXTENDED_INFO ENDS +; + +NAME_RECORD STRUC +nLRU_ptr dw -1 +nMRU_ptr dw -1 ;reverse of nLRU_ptr +nChild_ptr dw -1 +nSibling_ptr dw -1 +nBackward_ptr dw -1 ;points to preceding node +nCmpct_Dir_Info db size Cmpct_Dir_Info dup (' ') +nExtended_Info db size Fastopen_Extended_Info dup (?) +NAME_RECORD ENDS +; + +DRIVE_CACHE_HEADER STRUC ;drive cache header +DCH_LRU_ROOT dw 0 ;Header of the LRU chain of this drive +DCH_MRU_ROOT dw 0 ;offset to the last entry of LRU chain +DCH_Child_ptr dw -1 ;the first child in Name cache seg. +DCH_Sibling_ptr dw -1 ;points to the next drive cache header +DCH_Drive_letter db 'C' ;drive letter +DCH_Num_Entries dw 0 ;Number of entries in the Name cache. +DCH_Name_Buff dw 0 ;pointer to name cahe buffer +DRIVE_CACHE_HEADER ENDS +; + + + + + +;======== FAST SEEK FUNCTION DATA STRUCTURES ======================= + +DRIVE_HEADER STRUC ; Drive header structure ;AN000; +Drive_Number dw 0 ; drive number ;AN000; +Extent_Count dw 0 ; reserved for debugging +MRU_Hdr_Ptr dw 0 ; pointer to OPEN Queue +Free_ptr dw 0 ; pointer to FREE buffer ;AN000; +Close_Ptr dw 0 ; pointer to CLOSE Queue ;AN000; +Buff_Size dw 0 ; cache buffer size including header ;AN000; +Free_Size dw 0 ; size of Free area in bytes +Next_Drv_Hdr_Ptr dw 0 ; pointer to next drive header +DRIVE_HEADER ENDS + + + +FILE_HEADER STRUC ; File header structure ;AN000; +FH_Phys_Clus_Num dw 0 ; starting physcial clustnum of file ;AN000; +FH_Refer_Count dw 0 ; reference count ;AN000; +FH_Next_Extn_Ptr dw 0 ; pointer to first extent of the file;AN000; +FH_Next_Hdr_Ptr dw 0 ; pointer to next file header ;AN000; +FH_MRU_Extn_Ptr dw 0 ; pointer to MRU extent + dw 0 + dw 0 + dw 0 +FILE_HEADER ENDS ;AN000; + + + +EXTENT_HEADER STRUC ; extend header structure ;AN000; +EH_Logic_Clus_Num dw 0 ; starting logical clus num of extent;AN000; +EH_Phys_Clus_Num dw 0 ; starting physical clus numof extnt;AN000; +EH_Count dw 0 ; range of logical clusnum in the extnt +EH_Next_Extn_Ptr dw 0 ; pointer to next extent ;AN000; +EH_Prev_Extn_Ptr dw 0 ; pointer to previous extent ;AN000; +EH_Next_LRU_Ptr dw 0 ; pointer to next LRU extent +EH_Prev_LRU_Ptr dw 0 ; pointer tp previous LRU extent + dw 0 +EXTENT_HEADER ENDS + + + diff --git a/v4.0/src/INC/FASTSEEK.INC b/v4.0/src/INC/FASTSEEK.INC new file mode 100644 index 0000000..cac529e --- /dev/null +++ b/v4.0/src/INC/FASTSEEK.INC @@ -0,0 +1,22 @@ +; +;Equates for FASTSEEK. +; +;FASTSEEK flags +; +FS_begin equ 00000001B +FS_end equ 11111110B +FS_insert equ 00000010B +FS_no_insert equ 11111101B + +;FASTSEEK EXTENT CACHING Subfunctions +FSEC_open equ 11 +FSEC_close equ 12 +FSEC_delete equ 13 +FSEC_lookup equ 14 +FSEC_insert equ 15 +FSEC_truncate equ 16 +; +;Equates used in DOS. + + +; diff --git a/v4.0/src/INC/FASTXXXX.INC b/v4.0/src/INC/FASTXXXX.INC new file mode 100644 index 0000000..97a9163 --- /dev/null +++ b/v4.0/src/INC/FASTXXXX.INC @@ -0,0 +1,12 @@ +; Fastxxx equates +FastOpen_ID equ 1 +FastSeek_ID equ 2 +Fast_yes equ 10000000B ; fastxxx flag + +;Structure definitions +; +Fasttable_Entry struc ; Fastxxx Entry pointer in DOS +Fast_Entry_Num dw 2 ; number of entries +FastOpen_Seek dd ? ; fastopen & fastseek entry address +Fasttable_Entry ends +; diff --git a/v4.0/src/INC/FILEMODE.INC b/v4.0/src/INC/FILEMODE.INC new file mode 100644 index 0000000..f6377a7 --- /dev/null +++ b/v4.0/src/INC/FILEMODE.INC @@ -0,0 +1,56 @@ +; SCCSID = @(#)filemode.asm 1.1 85/04/10 +; SCCSID = @(#)filemode.asm 1.1 85/04/10 +BREAK + +stdin EQU 0 +stdout EQU 1 +stderr EQU 2 +stdaux EQU 3 +stdprn EQU 4 + +BREAK + +access_mask EQU 0FH +open_for_read EQU 00h +open_for_write EQU 01h +open_for_both EQU 02h + +sharing_mask EQU 0F0H +sharing_compat EQU 000H +sharing_deny_both EQU 010H +sharing_deny_write EQU 020H +sharing_deny_read EQU 030H +sharing_deny_none EQU 040H +sharing_net_FCB EQU 070h +sharing_no_inherit EQU 080H + +BREAK + +no_code_page_check EQU 0100H +int_24_error EQU 2000H +auto_commit_write EQU 4000H +ext_open_on EQU 01H +ext_file_not_exists EQU 04H +ext_open_I24_off EQU 02H +io_mode_id EQU 00000010B +reserved_bits_mask EQU 0FE00H +exists_mask EQU 0FH +not_exists_mask EQU 0F0H +action_opened EQU 01H +action_created_opened EQU 02H +action_replaced_opened EQU 03H + +ext_exists_open EQU 01H +ext_exists_fail EQU 0H +ext_nexists_create EQU 10H + + + +ext_open_parm struc +ext_set_list dd ? +ext_num_of_parm dw ? +ext_open_parm ends + + + + \ No newline at end of file diff --git a/v4.0/src/INC/FIND.INC b/v4.0/src/INC/FIND.INC new file mode 100644 index 0000000..4c8610e --- /dev/null +++ b/v4.0/src/INC/FIND.INC @@ -0,0 +1,25 @@ +; SCCSID = @(#)find.asm 1.1 85/04/10 +; SCCSID = @(#)find.asm 1.1 85/04/10 +Break + +find_buf STRUC +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +find_buf_drive DB ? ; drive of search +find_buf_name DB 11 DUP (?) ; formatted name +find_buf_sattr DB ? ; attribute of search +find_buf_LastEnt DW ? ; LastEnt +find_buf_DirStart DW ? ; DirStart +find_buf_NetID DB 4 DUP (?) ; Reserved for NET +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + +find_buf_attr DB ? ; attribute found +find_buf_time DW ? ; time +find_buf_date DW ? ; date +find_buf_size_l DW ? ; low(size) +find_buf_size_h DW ? ; high(size) +find_buf_pname DB 13 DUP (?) ; packed name +find_buf ENDS diff --git a/v4.0/src/INC/IFSSYM.INC b/v4.0/src/INC/IFSSYM.INC new file mode 100644 index 0000000..716c651 --- /dev/null +++ b/v4.0/src/INC/IFSSYM.INC @@ -0,0 +1,670 @@ + PAGE ,132 ; +; SCCSID = @(#)ifssym.inc 1.0 87/05/11 +;****************************************************************************** +; IFS Symbol File +; +; REVISION HISTORY: +; A000 Original version 4.00 May 1987 +; A001 DCR 158 - merge unc info in attach start/status requests 8/87 RGAZZIA +; A002 DCR 187 - ctrl req renumber, make attach type byte 8/87 RGAZZIA +; A003 PTM 764 - printer attach problems 8/87 RGAZZIA +; A004 PTM ???? - Write Only locks on Read/Write 10/27 FEIGENBAUM +; A005 DCR 285 - remove Extended Attribute/Lock support 1/88 RG +; A006 PTM 2827 error proc 1/88 RG +; A007 PTM 3334- reset envirn subfunc to eop 2/88 RMG +; A008 PTM 3745- commit across net problem due to sft flags problem 3/88 RMG +; A009 PTM 3810- new sft unique id in sff 3/88 RMG +; A010 PTM 4392- ditch sf_iomode,cp 4/18/88 RMG +; +; LOD - 414 +; +;****************************************************************************** + ;AN000; +SUBTTL IFS Driver Header ;AN000; +PAGE ;AN000; + ;AN000; +IFSHEADER STRUC ;AN000; +IFS_NEXT DD -1 ; Next header in list (-1=end) ;AN000; +IFS_NAME DB " " ; IFS name ;AN000; +IFS_ATTRIBUTE DW ? ; Attributes ;AN000; +IFS_VERSION DW 0 ; Request level supported ;AN000; +IFS_DOSCALL@ DD ? ; DOS interface routine ;AN000; + ; (set by TUPPER before the init call) ;AN000; +IFS_CALL@ DW ? ; Function entry point ;AN000; +IFSHEADER ENDS ;AN000; + ;AN000; +; ifs_attribute equates ;AN000; + ;AN000; +IFSDEVICE EQU 8000H ; Supports single device/file functions ;AN000; +IFSDISK EQU 4000H ; Supports multi-file functions ;AN000; +IFSUNC EQU 2000H ; Support UNC (nameless) connection ;AN000; +IFSREMOTE EQU 0800H ; File system is remote ;AN000; +IFSFILTER EQU 0400H ; FS will filter (if off, use DOS ;AN000; + ; standard, cap & 8.3) ;AN000; +IFSIOCTL EQU 0002H ; Supports IOCTL functions ;AN000; +IFSUSESHARE EQU 0001H ; Uses DOS share support (vs own share) ;AN000; + ;AN000; + ;AN000; +SUBTTL IFSRH - IFS Request Header ;AN000; +PAGE ;AN000; + ;AN000; +; IFS Request Header ;AN000; + ;AN000; +IFSRH STRUC ;AN000; +IFSR_LENGTH DW ? ; Total length of request ;AN000; +IFSR_FUNCTION DB ? ; Requested function ;AN000; +IFSR_RETCODE DW ? ; Explicit error ;AN000; +IFSR_RETCLASS DB ? ; Error class ;AN000; +IFSR_RESV1 DB 16 DUP(0) ; DOS reserved ;AN000; +IFSR_FCN_PARMS DB 50 DUP(0) ; Additional parameters ;AN000; +IFSRH ENDS ;AN000; + ;AN000; +; IFSR_FUNCTION codes ;AN000; +; Control requests: ;AN000; +IFSINIT EQU 1 ;AN000; +IFSATTSTART EQU 2 ;AN000; +IFSATTSTAT EQU 3 ;AC002; +IFSATTEND EQU 4 ;AC002; +IFSEXECAPI EQU 5 ;AC002; +IFSCRITMSG EQU 6 ;AC002; +IFSUPDATECB EQU 7 ;AC002; + ;AN000; +; IFSR_APIFUNC codes: ;AN000; +; Int 21 mapped requests: ;AN000; +IFSDRIVERESET EQU 1 ;AN000; +IFSDISKATTR EQU 2 ;AN000; +IFSMKDIR EQU 3 ;AN000; +IFSRMDIR EQU 4 ;AN000; +IFSCHDIR EQU 5 ;AN000; +IFSDELFILE EQU 6 ;AN000; +IFSRENFILE EQU 7 ;AN000; +IFSSEARCHFILE EQU 8 ;AN000; +IFSOPENFILE EQU 9 ;AN000; +IFSLSEEKFILE EQU 10 ;AN000; +IFSREADFILE EQU 11 ;AN000; +IFSWRITEFILE EQU 12 ;AN000; +IFSLOCKFILE EQU 13 ;AN000; +IFSCLOSEFILE EQU 14 ;AN000; +IFSFILEATTR EQU 15 ;AN000; +IFSDEPIOCTL EQU 16 ;AN000; +IFSDEVIOCTL EQU 17 ;AN000; +IFSEOP EQU 18 ;AN000; +IFSEOCID EQU 19 ;AN000; + ;AN000; +SUBTTL Control Request Parameter Macro ;AN000; +PAGE ;AN000; + ;AN000; +IFSR_FCN_DEF MACRO fcn ;AN000; + ;AN000; + IFIDN , ;AN000; + IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS ; command parameters ;AN000; + IFSR_RESSIZE = WORD PTR IFSR_FCN_PARMS+4 ; driver total size ;AN000; + LENGTH_INIT EQU IFSR_RESSIZE-IFSRH+2 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_TYPE = BYTE PTR IFSR_FCN_PARMS ; attach type ;AC001; + IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS+2 ; command parameters ;AN000; + IFSR_DEVICE_CB@ = DWORD PTR IFSR_FCN_PARMS+6 ; CD/DF ;AN000; + IFSR_USER_WORD = WORD PTR IFSR_FCN_PARMS+10 ; for unc deviceless attach ;AN001; + LENGTH_ATTSTART EQU IFSR_USER_WORD-IFSRH+2 ;AC001;/;AC004; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_TYPE = BYTE PTR IFSR_FCN_PARMS ; attach type ;AC001; + IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS+2 ; command parameters ;AN000; + IFSR_DEVICE_CB@ = DWORD PTR IFSR_FCN_PARMS+6 ; CD/DF ;AN000; + IFSR_USER_WORD = WORD PTR IFSR_FCN_PARMS+10 ; for unc deviceless attach ;AN001; + IFSR_MAX_XMITT_SIZE = WORD PTR IFSR_FCN_PARMS+12 ; redir-maximum transmit size ;AN001; + IFSR_NET_NAME_ID = WORD PTR IFSR_FCN_PARMS+14 ; redir-net name id ;AN001; + IFSR_LSN = WORD PTR IFSR_FCN_PARMS+16 ; redir-low byte=local session # ;AN001; + IFSR_DEVICE_STATUS = BYTE PTR IFSR_FCN_PARMS+18 ; redir-interesting bits ;AN001; + LENGTH_ATTSTAT EQU IFSR_DEVICE_STATUS-IFSRH+2 ;AC001; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_DEVICE_CB@ = DWORD PTR IFSR_FCN_PARMS ; CD/DF ;AN000; + IFSR_NAME@ = DWORD PTR IFSR_FCN_PARMS+4 ; UNC deviceless detach ;AN000; + LENGTH_ATTEND EQU IFSR_NAME@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_APIFUNC = BYTE PTR IFSR_FCN_PARMS ; API function code ;AN000; + IFSR_ERROR_CLASS = BYTE PTR IFSR_FCN_PARMS+1 ; DOS extended error class ;AN000; + IFSR_ERROR_ACTION = BYTE PTR IFSR_FCN_PARMS+2 ; DOS extended error action ;AN000; + IFSR_ERROR_LOCUS = BYTE PTR IFSR_FCN_PARMS+3 ; DOS extended error locus ;AN000; + IFSR_ALLOWED = BYTE PTR IFSR_FCN_PARMS+4 ; DOS extended error locus ;AN000; + IFSR_I24_COUNT = BYTE PTR IFSR_FCN_PARMS+5 ; critical error retry count ;AN000; + ; 0=first time ;AN000; + IFSR_I24_RESP = BYTE PTR IFSR_FCN_PARMS+6 ; critical error response ;AN000; + ; 0=ignore 1=retry ;AN000; + IFSR_DEVICE_CB@ = DWORD PTR IFSR_FCN_PARMS+8 ; device (CD or DF) ;AN000; + IFSR_OPEN_CB@ = DWORD PTR IFSR_FCN_PARMS+12 ; open file instance (SF) ;AN000; + IFSR_API_PARMS = BYTE PTR IFSR_FCN_PARMS+16 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_MSG@ = DWORD PTR IFSR_FCN_PARMS ; message buffer address ;AN000; + IFSR_MSG_TYPE = BYTE PTR IFSR_FCN_PARMS+4 ; message type ;AN000; + ; 1=message is printed in form ;AN000; + ; ;AN000; + ; Abort,Retry,Ignore,Fail ;AN000; + ; 0=message is printed in form ;AN000; + ; error (read/writ)ing (drive/device) XXX ; ;AN000; + ; Abort,Retry,Ignore,Fail ;AN000; + ;AN000; + LENGTH_CRITMSG EQU IFSR_MSG_TYPE-IFSRH+2 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_CB@ = DWORD PTR IFSR_FCN_PARMS ; control block address ;AN000; + IFSR_TYPE = BYTE PTR IFSR_FCN_PARMS+4 ; control block type ;AN000; + IFSOPEN EQU 0 ; open instance (SFT) entry ;AN000; + IFSCB EQU -1 ; see control block type field ;AN000; + LENGTH_UPDATECB EQU IFSR_TYPE-IFSRH+2 ;AN000; + ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDM ;AN000; + ;AN000; +SUBTTL INT 21H Mapped Request Parameter Macro ;AN000; +PAGE ;AN000; + ;AN000; +IFSR_API_DEF MACRO fcn ;AN000; + ;AN000; + IFIDN , ;AN000; + IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 0=flush ;AN000; + LENGTH_DRIVERESET EQU IFSR_FUNC-IFSRH+2 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_ALLOCUNITS = WORD PTR IFSR_API_PARMS ; # allocation units ;AN000; + IFSR_ALLOCSIZE = WORD PTR IFSR_API_PARMS+2 ; allocation unit sectors ;AN000; + IFSR_SECTSIZE = WORD PTR IFSR_API_PARMS+4 ; sector size ;AN000; + IFSR_AVAILALLOC = WORD PTR IFSR_API_PARMS+6 ; free allocation units ;AN000; + IFSR_FSID = BYTE PTR IFSR_API_PARMS+8 ; file system media id ;AN000; + LENGTH_DISKATTR EQU IFSR_FSID-IFSRH+2 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_NAME@ = DWORD PTR IFSR_API_PARMS ; asciiz name to process ;AN000; + LENGTH_MKDIR EQU IFSR_NAME@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_NAME@ = DWORD PTR IFSR_API_PARMS ; asciiz name to process ;AN000; + LENGTH_RMDIR EQU IFSR_NAME@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_NAME@ = DWORD PTR IFSR_API_PARMS ; asciiz name to process ;AN000; + LENGTH_CHDIR EQU IFSR_NAME@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_MATCHATTR_47 = WORD PTR IFSR_API_PARMS ; format 00000000e0a00shr ;AN000; + IFSR_NAME@ = DWORD PTR IFSR_API_PARMS+2 ; file to delete ;AN000; + LENGTH_DELFILE EQU IFSR_NAME@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_MATCHATTR = WORD PTR IFSR_API_PARMS ; format 00000000e0a00shr ;AN000; + IFSR_NAME1@ = DWORD PTR IFSR_API_PARMS+2 ; file to rename ;AN000; + IFSR_NAME2@ = DWORD PTR IFSR_API_PARMS+6 ; new file name ;AN000; + LENGTH_RENFILE EQU IFSR_NAME2@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_SUBFUNC = BYTE PTR IFSR_API_PARMS ; 1=first, 2=next ;AN000; + IFSR_CONTINFO@ = DWORD PTR IFSR_API_PARMS+2 ; continuation info addr ;AN000; + IFSR_MATCHATTR = WORD PTR IFSR_API_PARMS+6 ; format 0000000re0advshr (1st) ;AN000; + IFSR_NAME@ = DWORD PTR IFSR_API_PARMS+8 ; asciiz name to process (1st) ;AN000; + LENGTH_SEARCHFILE EQU IFSR_NAME@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_MODE = WORD PTR IFSR_API_PARMS ; open mode ;AN000; + ; format: 0WF0000CISSS0AAA ;AN000; + ; AAA=access code 0=read,1=write ;AN000; + ; 2=read/write ;AN000; + ; SSS=sharing mode 0=compatibility ;AN000; + ; 1=deny r/w, 2=deny write ;AN000; + ; 3=deny read, 4=deny none ;AN000; + ; I 0=pass handle to child, 1=no inheri;AN000;t + ; C 0=validate cp, 1=no cp check ;AN000; + ; F 0=int 24H, 1=return error on ;AN000; + ; this open & any I/O to this handle ;AN000; + ; W 0=no commit, 1=auto-commit on ;AN000; + ; write ;AN000; + IFSR_FLAG = WORD PTR IFSR_API_PARMS+2 ; function control; format=CE ;AN000; + ; C=does not exist action ;AN000; + ; 0=fail, 1=create ;AN000; + ; E=exists action ;AN000; + ; 0=fail, 1=open, 2=replace/open ;AN000; + IFSR_CP = WORD PTR IFSR_API_PARMS+4 ; global code page ;AN000; + IFSR_CPSW = BYTE PTR IFSR_API_PARMS+6 ; CPSW flag ;AN000; + IFSR_NAME@ = DWORD PTR IFSR_API_PARMS+8 ; asciiz name to open ;AN000; + IFSR_PARMS@ = DWORD PTR IFSR_API_PARMS+12 ; format: + ; DD EA address + ; DW #parms + ; DB IOMODE ID ;AN000; + ; DW IO Mode ;AN000; + IFSR_MATCHATTR = WORD PTR IFSR_API_PARMS+16 ; format 00000000e0advshr ;AN000; + IFSR_ACTION = WORD PTR IFSR_API_PARMS+18 ;AN000; + LENGTH_OPENFILE EQU IFSR_ACTION-IFSRH+2 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_MODE = BYTE PTR IFSR_API_PARMS ; see INT 21H AH=42H ;AN000; + IFSR_POSITION = DWORD PTR IFSR_API_PARMS+2 ; displacement of LSEEK ;AN000; + LENGTH_LSEEKFILE EQU IFSR_POSITION-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; +;IFSR_MODE = BYTE PTR IFSR_API_PARMS ;AD005; + IFSR_COUNT = WORD PTR IFSR_API_PARMS+2 ;AN000; + IFSR_BUFFER@ = DWORD PTR IFSR_API_PARMS+4 ;AN000; + LENGTH_READFILE EQU IFSR_BUFFER@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; +;IFSR_MODE = BYTE PTR IFSR_API_PARMS ;AD005; + IFSR_COUNT = WORD PTR IFSR_API_PARMS+2 ;AN000; + IFSR_BUFFER@ = DWORD PTR IFSR_API_PARMS+4 ;AN000; + LENGTH_WRITEFILE EQU IFSR_BUFFER@-IFSRH+4 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; +;IFSR_MODE = BYTE PTR IFSR_API_PARMS ; bit 0: 0=lock all operations ;AD005; + ; 1=lock only write operations ;AD005; + IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 0=LOCK, 1=UNLOCK ;AC005; +;IFSR_COUNT = WORD PTR IFSR_API_PARMS+2 ;AD005; +;IFSR_RANGE@ = DWORD PTR IFSR_API_PARMS+4 ;AD005; + IFSR_LK_POSITION = DWORD PTR IFSR_API_PARMS+2 ;AN005; + IFSR_LK_LENGTH = DWORD PTR IFSR_API_PARMS+6 ;AN005; + LENGTH_LOCKFILE EQU IFSR_LK_LENGTH-IFSRH+4 ;AC005; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 0=CLOSE, 1=COMMIT ;AN000; + LENGTH_CLOSEFILE EQU IFSR_FUNC-IFSRH+2 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 0=get, 1=set by handle ;AN000; + ; 2=get, 3=set by name ;AN000; + IFSR_SUBFUNC = BYTE PTR IFSR_API_PARMS+2 ; 0=none,2=EA List, 3-EA names ;AN000; + ; 2,3 used only on IFSR_FUNC=0,1 ;AN000; + IFSR_BUFFER1@ = DWORD PTR IFSR_API_PARMS+4 ; if IFSR_TYPE=2,3 ;AN000; + IFSR_BUFFER2@ = DWORD PTR IFSR_API_PARMS+8 ; if IFSR_TYPE=2 ;AN000; + IFSR_COUNT = WORD PTR IFSR_API_PARMS+12 ; if IFSR_TYPE=2,3 ;AN000; + ; Following present only if IFSR_FUNC=2,3 ;AN000; + IFSR_MATCHATTR = WORD PTR IFSR_API_PARMS+14 ; format 0000000re0advshr ;AN000; + IFSR_NAME@ = DWORD PTR IFSR_API_PARMS+16 ; ASCIIZ file name ;AN000; + IFSR_SIZE = DWORD PTR IFSR_API_PARMS+20 ; file size ;AN000; + IFSR_DATE = WORD PTR IFSR_API_PARMS+24 ; file date ;AN000; + IFSR_TIME = WORD PTR IFSR_API_PARMS+26 ; file time ;AN000; + IFSR_ATTR = WORD PTR IFSR_API_PARMS+28 ; format 0000000re0advshr ;AN000; + LENGTH_FILEATTR EQU IFSR_ATTR-IFSRH+2 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 00 Generic IOCTL by device # ;AN000; + ; 01 Generic IOCTL by handle ;AN000; + ; 02 FS IOCTL query OS type ;AN000; + IFSR_BUFFER@ = DWORD PTR IFSR_API_PARMS+2 ; set on queries ;AN000; + IFSR_BUFSIZE = WORD PTR IFSR_API_PARMS+6 ; Buffer size set for IFSR_FUNC=2 ;AN000; + ; FUNC dependent parameters ;AN000; + ; For generic ;AN000; + IFSR_CATEGORY = BYTE PTR IFSR_API_PARMS+8 ; generic subfunctions ;AN000; + IFSR_CTLFUNC = BYTE PTR IFSR_API_PARMS+9 ; see INT 21H AH=6BH ;AN000; + LENGTH_DEPIOCTL EQU IFSR_CTLFUNC-IFSRH+1 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 00 Generic IOCTL by device # ;AN000; + ; 01 Generic IOCTL by handle ;AN000; + ; 02 FS IOCTL query OS type ;AN000; + IFSR_BUFFER@ = DWORD PTR IFSR_API_PARMS+2 ; set on queries ;AN000; + IFSR_BUFSIZE = WORD PTR IFSR_API_PARMS+6 ; buffer size set for IFSR_FUNC=2 ;AN000; + ; FUNC dependent parameters ;AN000; + ; For generic ;AN000; + IFSR_CATEGORY = BYTE PTR IFSR_API_PARMS+8 ; generic subfunctions ;AN000; + IFSR_CTLFUNC = BYTE PTR IFSR_API_PARMS+9 ; see INT 21H AH=6BH ;AN000; + LENGTH_DEVIOCTL EQU IFSR_CTLFUNC-IFSRH+1 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_PID = WORD PTR IFSR_API_PARMS ; process ID ;AN000; + IFSR_SUBFUNC = BYTE PTR IFSR_API_PARMS+2 ; 0=NORMAL EXIT, 1=ABORT EXIT ;AN000; + LENGTH_EOP EQU IFSR_SUBFUNC-IFSRH+2 ;AN000; + ;AN000; + ELSE ;AN000; + IFIDN , ;AN000; + IFSR_UID = WORD PTR IFSR_API_PARMS ; process ID ;AN000; + LENGTH_EOCID EQU IFSR_UID-IFSRH+2 ;AN000; + ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + ENDM ;AN000; + ;AN000; +SUBTTL Request Data ;AN000; +PAGE ;AN000; + ;AN000; +; Attach types ;AN000; +;;;aliasTYPE_ALIAS EQU 0 ;AN000; +TYPE_DEVICE EQU 1 ;AN000; +TYPE_DRIVE EQU 2 ;AN000; +TYPE_NET_DEVICE EQU 3 ;AN000; +TYPE_NET_DRIVE EQU 4 ;AN000; +; Attach cmds ;AN000; +GET_MODE EQU 0 ;AN000; +SET_MODE EQU 1 ;AN000; +GET_ASSIGN_LIST EQU 2 ;AN000; +DEFINE_MACRO EQU 3 ;AN000; +CANCEL_ATTACH EQU 4 ;AN000; + ;AN000; +ATTACH_PARMS STRUC ;AN000; +AP_COUNT DW ? ;AN000; +AP_STRING DB ? ;AN000; +ATTACH_PARMS ENDS ;AN000; + ;AN000; +; Critical Error Message types ;AN000; +CRIT_MSG_TYPE_1 equ 1 +TYPE1 EQU 1 ;AN000; +TYPE0 EQU 0 ;AN000; + ;AN000; +; Control Block types ;AN000; +CBTYPE_SFF EQU 0 ;AN000; +CBTYPE_CD EQU 1 ;AN000; +CBTYPE_DF EQU 2 ;AN000; +CBTYPE_DUMMYCD EQU 3 ;AN000; + ;AN000; +; Drive Reset equates ;AN000; +FUNC_FLUSH EQU 0 ;AN000; +FUNC_FLUSH_INVALIDATE EQU 1 ;AN000; + ;AN000; +; Search File equates ;AN000; +IFSSEARCH_FIRST EQU 1 ;AN000; +IFSSEARCH_NEXT EQU 2 ;AN000; + ;AN000; +; Open/Create type ;AN000; +TYPE_NONE EQU 0 ;AN000; +NOTEXIST_ACT_FAIL = 0 ;+BAF +NOTEXIST_ACT_CREATE = 1 ;+BAF +EXIST_ACT_FAIL = 0 ;+BAF +EXIST_ACT_OPEN = 1 ;+BAF +EXIST_ACT_REP_OPEN = 2 ;+BAF + +FILE_OPENED = 1 +FILE_CREATED = 2 +FILE_REPLACED = 3 + ;AN000; +; Read/Write equates ;AN000; +;MODE_READ EQU 0 ;AD005; +;MODE_WRITE EQU 0 ;AD005; +;MODE_LOCK_READ EQU 1 ;AD005; +;MODE_WRITE_UNLOCK EQU 1 ;AD005; +;MODE_WRITE_SFPOS EQU 00H ;AD005; +;MODE_WRITE_SFSIZE EQU 02H ;AD005; +;MODE_ADD_MASK EQU 00000010B ; do I need this??? ;AD005; + ;AN000; +; Lock equates ;AN000; +;MODE_LOCK_ALL EQU 0 ;AD005; +;MODE_LOCK_WRITE EQU 1 ;AD005; +FUNC_LOCK EQU 0 ;AN000; +FUNC_UNLOCK EQU 1 ;AN000; +;MODE_ADD_MASK EQU 00000010B ;AD005; +;MODE_WO_MASK EQU 10000000B ;AN004; BAF ;AD005; +;LOCK_RANGE_STRUC STRUC ;AD005; +; IFSR_LOCK_POSITION DD ? ;AD005; +; IFSR_LOCK_LENGTH DD ? ;AD005; +;LOCK_RANGE_STRUC ENDS ;AD005; + + ;AN000; +; Close equates ;AN000; +FUNC_CLOSE EQU 0 ;AN000; +FUNC_COMMIT EQU 1 ;AN000; + ;AN000; +; LSeek equates ;AN000; +MODE2 EQU 2 ;AN000; + ;AN000; +; File Attribute equates ;AN000; +FUNC_GET_BY_HANDLE EQU 0 ;AN000; +FUNC_SET_BY_HANDLE EQU 1 ;AN000; +FUNC_GET_BY_NAME EQU 2 ;AN000; +FUNC_SET_BY_NAME EQU 3 ;AN000; +SUBFUNC_INLINE EQU 0 ;AN000; +SUBFUNC_EA EQU 2 ;AN000; +SUBFUNC_EA_NAMES EQU 3 ;AN000; + ;AN000; +; FS Dependent IOCTL ;AN000; +GEN_IOCTL_BY_DEVNUM EQU 0 ;AN000; +GEN_IOCTL_BY_HANDLE EQU 1 ;AN000; +QUERY_OS_TYPE EQU 2 ;AN000; +CATEGORY_FS EQU 0 ;AN000; +CATEGORY_REDIR EQU 1 ;AN000; +PRINTER_SET_STRING EQU 2 ;AN000; +PRINTER_GET_STRING EQU 3 ;AN000; +PRINTER_SET_FLAGS EQU 4 ;AN000; +PRINTER_GET_FLAGS EQU 5 ;AN000; +CTLFUNC_PRINTER_SET_STRING EQU 00100001B ;AN000; +CTLFUNC_PRINTER_GET_STRING EQU 00000001B ;AN000; +CTLFUNC_PRINTER_SET_FLAGS EQU 00100010B ;AN000; +CTLFUNC_PRINTER_GET_FLAGS EQU 00000010B ;AN000; +CTLFUNC_DEVECHOCHECK EQU 00000011B ;AN000; +CTLFUNC_GET_UNC_ITEM EQU 00000100B ;AN000; +CTLFUNC_DEVCLOSE EQU 00000101B ;AN000; +CTLFUNC_DEVOPER EQU 00000110B ;AN000; +CTLFUNC_PRINT_ON EQU 00100111B ;AN000; +CTLFUNC_PRINT_OFF EQU 00000111B ;AN000; +CLOSE_SPOOL_FILES EQU 9 ;AN000; +LENGTH_DEVECHOCHECK_BUFFER EQU 1 ;AN000; + ;AN000; +; FS Device IOCTL ;AN000; +READ_DEVICE EQU 2 ;AN000; +WRITE_DEVICE EQU 3 ;AN000; +CHAR_GENERIC EQU 0CH ;AN000; +BLOCK_GENERIC EQU 0DH ;AN000; + ;AN000; +; End of Process equates ;AN000; +EOP_NORMAL EQU 0 ;AN000; +EOP_ABORT EQU 1 ;AN000; +RESET_ENVIRONMENT EQU 2 + ;AN000; +SUBTTL Request Return Classes/Codes ;AN000; +PAGE ;AN000; + ;AN000; +; IFS Request Return Codes ;AN000; +IFSR_NO_ERROR EQU 0 ;AN000; +IFSR_NONSPEC_ERROR EQU 1 ;AN000; +IFSR_NOT_FOUND_ERROR EQU 2 ;AN000; +IFSR_ACCESS_DENIED EQU 3 ;AN000; +IFSR_DEVICE_TYPE_MISMATCH EQU 4 ;AN000; +IFSR_NO_SUBFCN_SUPPORT EQU -2 ;AN000; +IFSR_NO_FCN_SUPPORT EQU -1 ;AN000; + ;AN000; +; IFS Request Return Classes ;AN000; +IFSR_INT21H_ERROR EQU 1 ;AN000; +IFSR_DRIVER_ERROR EQU 2 ;AN000; +IFSR_INT21H_CRITER EQU 3 ;AN000; +IFSR_DEVICE_ERROR EQU 4 ;AN006; +IFSR_BAD_FORMAT EQU -1 ;AN000; + +; +; Int 24H +NO_RETRY = 0 +I24_RESP_IGNORE = 0 +I24_RESP_RETRY = 1 + + ;AN000; +; IFS_DOSCALL@ function equates ;AN000; +; Block Device Driver Requests ;AN000; +CALL_INTERRUPT_ROUTINE EQU 1 ;AN000; +READ_SECTORS EQU 2 ;AN000; +WRITE_SECTORS EQU 3 ;AN000; +FIND_SECTOR EQU 8 ;AN000; +MARK_SECTOR_CHANGED EQU 9 ;AN000; +; Buffer Cache Requests ;AN000; +WRITE_DOS_BUFFER EQU 10 ;AN000; +READ_DOS_BUFFER EQU 11 ;AN000; +FREE_DOS_BUFFER EQU 12 ;AN000; +FLUSH_DOS_BUFFERS EQU 13 ;AN000; +; Get DOS Variable ;AN000; +GET_DOS_VALUE EQU 32 ;AN000; +ACTIVE_PROCESS_INFO EQU 1 ;AN000; +CPSW_INFORMATION EQU 2 ;AN000; +BREAK_INFORMATION EQU 3 ;AN000; +VERIFY_INFORMATION EQU 4 ;AN000; +CONFIG_SYS_VALUES EQU 5 ;AN000; + DOS_VALUE_BUFFER STRUC ;AN000; + VAL_BUF_SIZE DW 14 ;AN000; + VAL_BUF_FILES DW 0 ;AN000; + VAL_BUF_FCBS DW 0 ;AN000; + DW 0 ;AN000; + VAL_BUF_BUFS DW 0 ;AN000; + DW 0 ;AN000; + VAL_BUF_LDRV DW 0 ;AN000; + VAL_BUF_SSZ DW 0 ;AN000; + DOS_VALUE_BUFFER ENDS ;AN000; +MACHINE_NAME EQU 6 ;AN000; +COUNTRY_INFO EQU 7 ;AN000; +SHARE_RETRY_COUNT EQU 8 ;AN000; +; Get Assign Mode ;AN000; +GET_ASSIGN_MODE EQU 33 ;AN000; +DEVICE_MACRO = 3 +DRIVE_MACRO = 4 +PAUSE_MODE_ON = 1 +PAUSE_MODE_OFF = 0 +; +DOS2NET_DATE = 34 +NET2DOS_DATE = 35 +DOS_STRCMP = 36 +DOS_STRCPY = 37 +USE_SYSTEM_TIMEDATE = 0 +USE_USER_TIMEDATE = 1 +; + ;AN000; + ;AN000; +SUBTTL Pseudo Block Structures: SF, CD, DF ;AN000; +PAGE ;AN000; +; SFF - Pseudo SFT ;AN000; +; This structure is used to pass pertinent SFT information ;AN000; +; to IFS driver. ;AN000; + ;AN000; +SFF STRUC ; Open File Control Block ;AN000; +SFF_TYPE DB 0,0 ; Identifies SFF ;AN000; +SFF_FLAGS DW ? ; Control flags ;AN000; + ; 4000H=don't set date/time on close ;AN009; + ; 0080H=device (vs file) ;AN009; + ; 0040H=File clean ;AN008; +SFF_MODE DW ? ; Mode of access. ;AN000; + ; 8000H=FCB (vs handle)[this moved from flags];AC008; +SFF_RESV1 DW ? ; IO mode. ;AC023; iomode +SFF_ATTR DW ? ; File attr.FORMAT : 0000000re0advshr ;AN000; +SFF_UID DW ? ; User ID ;AN000; +SFF_PID DW ? ; Process ID ;AN000; +SFF_SIZE DD ? ; File size ;AN000; +SFF_POSITION DD ? ; Read/Write pointer ;AN000; +SFF_TIME DW ? ; File time ;AN000; +SFF_DATE DW ? ; File date ;AN000; +SFF_NAME DB 8 DUP (?) ; Name ;AN000; +SFF_EXT DB 3 DUP (?) ; Extension ;AN000; +SFF_RESV2 DW 0 ; Code page ;AC024; cp +SFF_SF_ID DW 0 ; Unique SFT entry identifier ;AN009; +SFF_RESV DB 12 DUP(0) ; Reserved ;AC009; +SFF_FSDA DB 8 DUP(?) ; File System Dependent Data Area ;AN000; +SFF ENDS ;AN000; + ;AN000; +; sff_flags bits +SFF_Close_NoDate EQU 4000H ; 4000H=don't set date/time on close ;AN009; +SFF_IsDevice EQU 0080H ; 0080H=device (vs file) ;AN009; +SFF_FileClean EQU 0040H ; 0040H=File clean ;AN008; +SFF_Device_Raw EQU 0020H ; 0020H=Device raw ;AN008; +SFF_Net_Spool EQU 0000100000000000B +; sff_mode bits +SFF_IsFCB EQU 8000H ; 8000H=FCB (vs handle)[this moved from flags];AC008; + +; CD - Pseudo CDS ;AN000; +; This structure is used to pass pertinent CDS information ;AN000; +; to IFS driver. ;AN000; + ;AN000; +CD STRUC ;AN000; +CD_TYPE DB 1,0 ; Identifies CD ;AN000; +CD_END DW ? ; End of assignment in CD_TEXT ;AN000; +CD_TEXT DB 67 DUP (?) ; Text of assignment and curdir ;AN000; +CD_RESV DB 5 DUP(0) ; Reserved ;AN000; +CD_FSDA DB 8 DUP(?) ; File System Dependent Data Area ;AN000; +CD ENDS ;AN000; + ;AN000; +; DF - Pseudo DFL ;AN000; +; This structure is used to pass pertinent DFL information ;AN000; +; to IFS driver. ;AN000; + +DFL STRUC ;AN000; +DFL_TYPE DB 2,0 ; Identifies DFL ;AN000; +DFL_DEV_NAME DB 8 DUP (?) ; Device name ;AN000; +DFL_FSDA DB 8 DUP (?) ; File System Dependent Data Area ;AN000; +DFL ENDS ;AN000; + ;AN000; +SUBTTL Search Continuation Information ;AN000; +PAGE ;AN000; +CONTINFO STRUC ;AN000; +CI_SEARCH_FN DB 8 DUP(?) ; SEARCH FILE NAME ;AN000; +CI_SEARCH_FN_EXT DB 3 DUP(?) ; SEARCH FILE EXTENSION ;AN000; +CI_SEARCH_ATTR DB ? ; SEARCH ATTRIBUTE ;AN000; +CI_FSDA DB 8 DUP(?) ; FSDA ;AN000; + ; Directory entry: ;AN000; +CI_FOUND_FN DB 8 DUP(?) ; FOUND FILE NAME ;AN000; +CI_FOUND_FN_EXT DB 3 DUP(?) ; FOUND FILE EXTENSION ;AN000; +CI_FOUND_ATTRL DB ? ; FOUND ATTRIBUTE LOW ??? DB/DD ;AN000; +CI_CP DW ? ; FILE CODE PAGE (OR 0) ;AN000; +CI_RESV1 DW ? ; RESERVED ;AN000; +CI_FOUND_ATTRH DB ? ; FOUND ATTRIBUTE HIGH ;AN000; +CI_RESV2 DB 5 DUP(?) ; RESERVED ;AN000; +CI_FILE_TIME DW ? ; FILE TIME ;AN000; +CI_FILE_DATE DW ? ; FILE DATE ;AN000; +CI_FSWORD DW ? ; MEANING FILE SYSTEM SPECIFIC ;AN000; + ; (STARTING CLUSTER IN FAT) ;AN000; +CI_FILE_SIZE DD ? ; FILE SIZE ;AN000; +CONTINFO ENDS ;AN000; + + +CATEGORY_PRINTER EQU 5 + +CTLFUNC_SELECT EQU 4AH +CTLFUNC_QUERY_SELECTED EQU 6AH +CTLFUNC_QUERY_PREPLIST EQU 6BH + +DEV_OPER_BUFFER STRUC + OPER_FUNC DB ? + TRUNC_FLAG DB ? +DEV_OPER_BUFFER ENDS + +PACKET STRUC ; device ioctl buffer info + PACKLEN DW 2 ; length of packet in bytes + PACKCPID DW ? ; code page id +PACKET ENDS + diff --git a/v4.0/src/INC/INTNAT.INC b/v4.0/src/INC/INTNAT.INC new file mode 100644 index 0000000..125484d --- /dev/null +++ b/v4.0/src/INC/INTNAT.INC @@ -0,0 +1,39 @@ +; SCCSID = @(#)intnat.asm 1.1 85/04/10 +BREAK + +; +; Current structure of the data returned by the international call +; +internat_block STRUC +Date_tim_format DW ? ; 0-USA, 1-EUR, 2-JAP +Currency_sym DB ? ; Currency Symbol 5 bytes + DB ? + DB ? + DB ? + DB ? +Thous_sep DB ? ; Thousands separator 2 bytes + DB ? +Decimal_sep DB ? ; Decimal separator 2 bytes + DB ? +Date_sep DB ? ; Date separator 2 bytes + DB ? +Time_sep DB ? ; Decimal separator 2 bytes + DB ? +Bit_field DB ? ; Bit values + ; Bit 0 = 0 if currency symbol first + ; = 1 if currency symbol last + ; Bit 1 = 0 if No space after currency symbol + ; = 1 if space after currency symbol +Currency_cents DB ? ; Number of places after currency dec point +Time_24 DB ? ; 1 if 24 hour time, 0 if 12 hour time +Map_call DW ? ; Address of case mapping call (DWORD) + DW ? ; THIS IS TWO WORDS SO IT CAN BE INITIALIZED + ; in pieces. +Data_sep DB ? ; Data list separator character + DB ? +internat_block ENDS + +; +; Max size of the block returned by the INTERNATIONAL call +; +internat_block_max EQU 32 diff --git a/v4.0/src/INC/IOCTL.INC b/v4.0/src/INC/IOCTL.INC new file mode 100644 index 0000000..b9c335d --- /dev/null +++ b/v4.0/src/INC/IOCTL.INC @@ -0,0 +1,211 @@ + +%OUT IOCTL.INC... +; THESE ARE ALL THE IMPORTANT STRUCTURES AND EQUATES FOR IOCTL +;============================================================================== +;REVISION HISTORY: +;AN000 - New for DOS Version 4.00 - J.K. +;AC000 - Changed for DOS Version 4.00 - J.K. +;AN00x - PTM number for DOS Version 4.00 - J.K. +;============================================================================== +;AN001; D241 Provide support of Multi-track Format/Verify 9/23/87 J.K. +;AN002; P1535 Unformatted hard file problem 10/15/87 J.K. +;AN003; D490 IOCTL subfunction 63h,43h,64h,44h conflicts with OS2 2/26/88 J.K. +;============================================================================== + +;*** J.K. +;General Guide - +;Category Code: +; 0... .... DOS Defined +; 1... .... User defined +; .xxx xxxx Code + +;Function Code: +; 0... .... Return error if unsupported +; 1... .... Ignore if unsupported +; .0.. .... Intercepted by DOS +; .1.. .... Passed to driver +; ..0. .... Sends data/commands to device +; ..1. .... Quries data/info from device +; ...x .... Subfunction +; +; Note that "Sends/queries" data bit is intended only to regularize the +; function set. It plays no critical role; some functions may contain both +; command and query elements. The convention is that such commands are +; defined as "sends data". + +;*****************************;* +; BLOCK DRIVERS ;* +;*****************************;* + +; IOCTL SUB-FUNCTIONS +IOCTL_GET_DEVICE_INFO EQU 0 +IOCTL_SET_DEVICE_INFO EQU 1 +IOCTL_READ_HANDLE EQU 2 +IOCTL_WRITE_HANDLE EQU 3 +IOCTL_READ_DRIVE EQU 4 +IOCTL_WRITE_DRIVE EQU 5 +IOCTL_GET_INPUT_STATUS EQU 6 +IOCTL_GET_OUTPUT_STATUS EQU 7 +IOCTL_CHANGEABLE? EQU 8 +IOCTL_DeviceLocOrRem? EQU 9 +IOCTL_HandleLocOrRem? EQU 0Ah ;10 +IOCTL_SHARING_RETRY EQU 0Bh ;11 +GENERIC_IOCTL_HANDLE EQU 0Ch ;12 +GENERIC_IOCTL EQU 0Dh ;13 + +; GENERIC IOCTL CATEGORY CODES +IOC_OTHER EQU 0 ; Other device control J.K. 4/29/86 +IOC_SE EQU 1 ; SERIAL DEVICE CONTROL +IOC_TC EQU 2 ; TERMINAL CONTROL +IOC_SC EQU 3 ; SCREEN CONTROL +IOC_KC EQU 4 ; KEYBOARD CONTROL +IOC_PC EQU 5 ; PRINTER CONTROL +IOC_DC EQU 8 ; DISK CONTROL (SAME AS RAWIO) + +; GENERIC IOCTL SUB-FUNCTIONS +RAWIO EQU 8 + +; RAWIO SUB-FUNCTIONS +GET_DEVICE_PARAMETERS EQU 60H +SET_DEVICE_PARAMETERS EQU 40H +READ_TRACK EQU 61H +WRITE_TRACK EQU 41H +VERIFY_TRACK EQU 62H +FORMAT_TRACK EQU 42H +GET_MEDIA_ID EQU 66h ;AN000;AN003;changed from 63h +SET_MEDIA_ID EQU 46h ;AN000;AN003;changed from 43h +GET_ACCESS_FLAG EQU 67h ;AN002;AN003;Unpublished function.Changed from 64h +SET_ACCESS_FLAG EQU 47h ;AN002;AN003;Unpublished function.Changed from 44h + +; SPECIAL FUNCTION FOR GET DEVICE PARAMETERS +BUILD_DEVICE_BPB EQU 000000001B + +; SPECIAL FUNCTIONS FOR SET DEVICE PARAMETERS +INSTALL_FAKE_BPB EQU 000000001B +ONLY_SET_TRACKLAYOUT EQU 000000010B +TRACKLAYOUT_IS_GOOD EQU 000000100B + +; SPECIAL FUNCTION FOR FORMAT TRACK +STATUS_FOR_FORMAT EQU 000000001B +DO_FAST_FORMAT equ 000000010B ;AN001; +; CODES RETURNED FROM FORMAT STATUS CALL +FORMAT_NO_ROM_SUPPORT EQU 000000001B +FORMAT_COMB_NOT_SUPPORTED EQU 000000010B + +; DEVICETYPE VALUES +MAX_SECTORS_IN_TRACK EQU 63 ; MAXIMUM SECTORS ON A DISK.(Was 40 in DOS 3.2) +DEV_5INCH EQU 0 +DEV_5INCH96TPI EQU 1 +DEV_3INCH720KB EQU 2 +DEV_8INCHSS EQU 3 +DEV_8INCHDS EQU 4 +DEV_HARDDISK EQU 5 +DEV_OTHER EQU 7 + +MAX_DEV_TYPE EQU 7 ; MAXIMUM DEVICE TYPE THAT WE + ; CURRENTLY SUPPORT. + +;J.K. Bug in MASM 3. A_BPB will be defined in PASS1 and, in PASS2 the +;compiler does not include BPB.INC and it will be treated as undefined. +IF1 + BPBINPASS1 = 0 + IFNDEF A_BPB + INCLUDE BPB.INC + BPBINPASS1 = 1 + ENDIF +ELSE + IF BPBINPASS1 + INCLUDE BPB.INC + ENDIF +ENDIF + +A_SECTORTABLE STRUC +ST_SECTORNUMBER DW ? +ST_SECTORSIZE DW ? +A_SECTORTABLE ENDS + +A_DEVICEPARAMETERS STRUC +DP_SPECIALFUNCTIONS DB ? +DP_DEVICETYPE DB ? +DP_DEVICEATTRIBUTES DW ? +DP_CYLINDERS DW ? +DP_MEDIATYPE DB ? +DP_BPB DB SIZE A_BPB DUP (?) +DP_TRACKTABLEENTRIES DW ? +DP_SECTORTABLE DB MAX_SECTORS_IN_TRACK * SIZE A_SECTORTABLE DUP (?) +A_DEVICEPARAMETERS ENDS + +A_TRACKREADWRITEPACKET STRUC +TRWP_SPECIALFUNCTIONS DB ? +TRWP_HEAD DW ? +TRWP_CYLINDER DW ? +TRWP_FIRSTSECTOR DW ? +TRWP_SECTORSTOREADWRITE DW ? +TRWP_TRANSFERADDRESS DD ? +A_TRACKREADWRITEPACKET ENDS + +;AN001; - FP_TRACKCOUNT is only meaningful when FP_SPECIALFUNCTIONS bit 1 = 1. +A_FORMATPACKET STRUC +FP_SPECIALFUNCTIONS DB ? +FP_HEAD DW ? +FP_CYLINDER DW ? +FP_TRACKCOUNT DW 1 +A_FORMATPACKET ENDS + +A_VERIFYPACKET STRUC +VP_SPECIALFUNCTIONS DB ? +VP_HEAD DW ? +VP_CYLINDER DW ? +A_VERIFYPACKET ENDS + +A_MEDIA_ID_INFO STRUC +MI_LEVEL DW 0 ;J.K. 87 Info. level +MI_SERIAL DD ? ;J.K. 87 Serial # +MI_LABEL DB 11 DUP (' ') ;J.K. 87 volume label +MI_SYSTEM DB 8 DUP (' ') ;J.K. 87 File system type +A_MEDIA_ID_INFO ENDS + +A_DISKACCESS_CONTROL STRUC ;AN002; Unpublished function. Only for Hard file. +DAC_SPECIALFUNCTIONS DB 0 ;AN002; Always 0 +DAC_ACCESS_FLAG DB 0 ;AN002; Non Zero - allow disk I/O to unformatted hard file +A_DISKACCESS_CONTROL ENDS ;AN002; 0 - Disallow disk I/O to unformatted hard file + +;********************************;* +; CHARACTER DEVICES (PRINTERS) ;* +;********************************;* + +;RAWIO SUB-FUNCTIONS +GET_RETRY_COUNT EQU 65H +SET_RETRY_COUNT EQU 45H + +A_RETRYCOUNT STRUC +RC_COUNT DW ? +A_RETRYCOUNT ENDS + +;********************************;* ;J.K. 4/29/86 +; CHARACTER DEVICES (SCREEN) ;* +;********************************;* ;J.K. 4/29/86 +; +;SC_MODE_INFO struc +;SC_INFO_LENGTH DW 9 +;SC_MODE DB 0 +;SC_COLORS DW 0 +;SC_WIDTH DW 0 +;SC_LENGTH DW 0 +;SC_MODE_INFO ends +; +;SC_INFO_PACKET_LENGTH EQU 9 ;LENGTH OF THE INFO PACKET. + +;SUBFUNCTIONS FOR CON$GENIOCTL +;GET_SC_MODE EQU 60h +;SET_SC_MODE EQU 40h +;The following subfunctions are reserved for installable CODE PAGE switch +;console devices. - J.K. 4/29/86 +;Get_active_codepage equ 6Ah +;Invoke_active_codepage equ 4Ah +;Start_designate_codepage equ 4Ch +;End_designate_codepage equ 4Dh +;Get_list_of_designated_codepage equ 6Bh +;J.K. 4/29/86 *** End of Con$genioctl equates & structures + + diff --git a/v4.0/src/INC/KSTRING.C b/v4.0/src/INC/KSTRING.C new file mode 100644 index 0000000..b59f717 --- /dev/null +++ b/v4.0/src/INC/KSTRING.C @@ -0,0 +1,118 @@ +#include "internat.h" +#include +#define NULL 0 +#define TRUE 0xffff +#define FALSE 0 +#define KANJI TRUE +char haveinttab = FALSE; +/* + * ECS Support - This module provides support for international >7FH and + * TWO-BYTE character sets. The toupper routine uses the DOS MAP_CASE call. + * In addition, STRING.C contains a default_tab containing a default lead + * byte table for two byte character sets. If single byte operation is + * desired, modify this table as follows: ="\000". If this utility + * is run on a DOS with Function 63H support, the default table will + * be replaced by the table in the DOS. The lbtbl_ptr is the far ptr to + * which ever table is in use. +*/ +long lbtbl_ptr; +char *default_tab="\201\237\340\374\000\000"; +char have_lbtbl = FALSE; + +struct InterTbl Currtab; + +int toupper(c) +int c; +{ + union REGS regs ; + + if(!haveinttab) { + regs.x.ax = 0x3800 ; + regs.x.dx = (unsigned) &Currtab ; + intdos (®s, ®s) ; /* INIT the table */ + + haveinttab = TRUE; + } + + return(IToupper(c,Currtab.casecall)); + +} + +char *strupr(string) +char *string; +{ + register char *p1; + + p1 = string; + while (*p1 != NULL) { + /* + * A note about the following " & 0xFF" stuff. This is + * to prevent the damn C compiler from converting bytes + * to words with the CBW instruction which is NOT correct + * for routines like toupper + */ +#ifdef KANJI + if(testkanj(*p1 & 0xFF)) + p1 += 2 ; + else + *p1++ = toupper(*p1 & 0xFF); +#else + *p1++ = toupper(*p1 & 0xFF); +#endif + } + return(string); +} + +char *strpbrk(string1,string2) +char *string1; +char *string2; +{ + register char *p1; + + while (*string1 != NULL) { + /* + * A note about the following " & 0xFF" stuff. This is + * to prevent the damn C compiler from converting bytes + * to words with the CBW instruction which is NOT correct + * for routines like toupper + */ +#ifdef KANJI + if(testkanj(*string1 & 0xFF)) + string1 += 2 ; + else { +#endif + p1 = string2; + while (*p1 != NULL) { + if(*p1++ == *string1) + return(string1); + } + string1++; +#ifdef KANJI + } +#endif + + } + return(NULL); /* no matches found */ +} + +#ifdef KANJI +testkanj(c) +unsigned char c; +{ + long *p1; + union REGS regs ; + int i; + + p1 = (long *)&lbtbl_ptr ; + if (!have_lbtbl ) { + (char far *)lbtbl_ptr = (char far *)default_tab ; /* Load offset in pointer */ + get_lbtbl( p1 ); + have_lbtbl=TRUE; + } + + if ( test_ecs( c, lbtbl_ptr )) + return(TRUE); + else + return(FALSE); +} +#endif diff --git a/v4.0/src/INC/LOCK.INC b/v4.0/src/INC/LOCK.INC new file mode 100644 index 0000000..469ce79 --- /dev/null +++ b/v4.0/src/INC/LOCK.INC @@ -0,0 +1,24 @@ +; +;Equates for LOCK +; +;LOCK functions +; +Lock_all equ 0 +Unlock_all equ 1 +Lock_mul_range equ 2 +Unlock_mul_range equ 3 +Lock_read equ 4 +Write_unlock equ 5 +Lock_add equ 6 + +; +;Structure for Lock buffer + +LockBuf STRUC + + Lock_position DD ? ; file position for LOCK + Lock_length DD ? ; number of bytes to LOCK + +LockBuf ENDS +; + \ No newline at end of file diff --git a/v4.0/src/INC/MACRO.DEF b/v4.0/src/INC/MACRO.DEF new file mode 100644 index 0000000..cf11a24 --- /dev/null +++ b/v4.0/src/INC/MACRO.DEF @@ -0,0 +1,19 @@ + PAGE +;***************************************************************************; +; MACRO DEFINITION ; +;***************************************************************************; + +PRINT MACRO MESSAGE + MOV DX,OFFSET MESSAGE&_PTR + PUSH DX + PUSH CS + CALL PRINTF +ENDM + + + +INPUT MACRO MESSAGE + PRINT MESSAGE + CALL PROMPT +ENDM + \ No newline at end of file diff --git a/v4.0/src/INC/MAKEFILE b/v4.0/src/INC/MAKEFILE new file mode 100644 index 0000000..e2bed75 --- /dev/null +++ b/v4.0/src/INC/MAKEFILE @@ -0,0 +1,54 @@ +#*************************** makefile for inc **************************** + +msg =..\messages +dos =..\dos +inc =..\inc +hinc =..\h + +# +####################### dependencies begin here. ######################### +# + +all: errtst.obj sysvar.obj cds.obj dpb.obj nibdos.obj \ + const2.obj msdata.obj msdosme.obj mstable.obj msgserv.asm + +errtst.obj: errtst.c \ + $(hinc)\types.h \ + $(hinc)\comsub.h \ + $(hinc)\dpb.h + +sysvar.obj: sysvar.c \ + $(hinc)\types.h \ + $(hinc)\sysvar.h + +cds.obj: cds.c \ + $(hinc)\types.h \ + $(hinc)\sysvar.h \ + $(hinc)\cds.h \ + $(hinc)\dpb.h + +dpb.obj: dpb.c \ + $(hinc)\dpb.h \ + dpb.inc + +nibdos.obj: nibdos.asm $(dos)\mssw.asm $(dos)\msconst.asm \ + dossym.inc dosseg.asm mshead.asm + +const2.obj: const2.asm dossym.inc devsym.inc \ + dosseg.asm + +msdata.obj: msdata.asm $(dos)\mssw.asm dosseg.asm \ + dosmac.inc msdata.asm $(dos)\msinit.asm \ + devsym.inc vector.inc buffer.inc \ + dirent.inc dpb.inc curdir.inc \ + find.inc pdb.inc \ + sf.inc arena.inc mi.inc + +msdosme.obj: msdosme.asm $(dos)\mssw.asm dosseg.asm \ + $(dos)\dosmes.asm dosmac.inc intnat.inc \ + divmes.asm + +mstable.obj: mstable.asm $(dos)\mssw.asm \ + $(dos)\ms_table.asm dossym.inc dosseg.asm \ + $(dos)\misc2.asm + diff --git a/v4.0/src/INC/MFT.INC b/v4.0/src/INC/MFT.INC new file mode 100644 index 0000000..0359f80 --- /dev/null +++ b/v4.0/src/INC/MFT.INC @@ -0,0 +1,176 @@ +BREAK + +;** MSDOS MFT definitions +; +; The Master File Table (MFT) associates the cannonicalized pathnames, lock +; records and SFTs for all files open on this machine. +; +; The MFT implementation employs a single memory buffer which is used from +; both ends. This gives the effect (at least until they run into each +; other) of two independent buffers. +; +; MFT buffer +; ========== +; The MFT buffer contains MFT name records and free space. It uses a +; classic heap architecture: freed name records are marked free and +; conglomerated with any adjacent free space. When one is to create a name +; entry the free list is searched first-fit. The list of name and free +; records is always terminated by a single END record. +; +; LOCK buffer +; =========== +; The lock buffer contains fixed format records containing record locking +; information. Since they are fixed format the space is handled as a series +; of chains: one for each MFT name record and one for the free list. No +; garbage collection is necessary. +; +; Space allocation +; ================ +; The MFT is managed as a heap. Empty blocks are allocated on a first-fit +; basis. If there is no single large enough empty block the list is garbage +; collected. +; +; MFT name records: +; +; 8 16 8 16 32 16 n +; |------|-----|-----|------|------|------|---------~~~~~~---------| +; | FLAG | LEN | SUM | LPTR | SPTR | SERL | <.asciz string> | +; --------------------------------------------------~~~~~~---------- +; +; FLAG = record type flag +; LEN = total byte length of record. +; SUM = sum of bytes in asciz string. Used to speed +; searches +; LPTR= pointer to first record in lock chain segment +; is MFT segment +; SPTR= pointer to first sft in sft chain +; SERL= serial number +; = name string, zero-byte terminated. There +; may be garbage bytes following the 00 byte; +; these are counted in the LEN field. +; +; +; MFT free records +; +; 8 16 +; |------|-----|----~~~~~~~~~~~~~~~~~~~~~~~~~~~---------| +; | FLAG | LEN | free | +; ------------------~~~~~~~~~~~~~~~~~~~~~~~~~~~---------- +; +; FLAG = record type flag +; LEN = total byte length of record. +; +; +; MFT END records +; +; 8 +; |------| +; | FLAG | +; -------- +; +; FLAG = record type flag + +;** MFT definitions +;* +;* NOTE: the flag and length fields are identical for all record types +;* (except the END type has no length) This must remain so as +;* some code depends upon it. +;* +;* NOTE: Many routines check for "n-1" of the N flag values and if no +;* match is found assume the flag value must be the remaining +;* possibility. If you add or remove flag values you must check +;* all references to mft_flag. + +MFT_entry STRUC + +mft_flag DB ? ; flag/len field +mft_len DW ? +mft_sum DB ? ; string sum word +mft_lptr DW ? ; LCK pointer +mft_sptr DD ? ; sft pointer +mft_serl DW ? ; serial number +mft_name DB ? ; offset to start of name + +MFT_entry ENDS + +MFLG_NAM EQU 1 ; min value for name record +MFLG_FRE EQU 0 ; free record +MFLG_END EQU -1 ; end record + +;* Record Lock Record (RLR): +; +; 16 32 32 32 +; |-------|--------|--------|--------| +; | NEXT | FBA | LBA | SPTR | +; | | lo hi | lo hi | | +; ------------|--------|-------------- +; +; CHAIN = pointer to next RLR. 0 if end +; FBA = offset of 1st byte of locked region +; LBA = offset of last byte of locked region +; SPTR = pointer to SFT lock was issued on + +RLR_entry STRUC + +rlr_next DW ? ; chain to next RLR, 0 if end +rlr_fba DW ? ; first byte addr (offset) of reigion + DW ? +rlr_lba DW ? ; last byte addr of region + DW ? +rlr_sptr DD ? ; SFT pointer +rlr_pid dw ? ; process id of issuer +rlr_type dw ? ; lock type +RLR_entry ENDS + +rlr_lall equ 00h ; lock all ops +rlr_lwr equ 01h ; lock write ops + +; +; A pictorial diagram for the linkages is as follows: +; +; +---sptr------+ +; V | +; +---+<----------|---sptr------+------------+ +; |SFT+----+ | | | +; +-+-+ | +-+-+ +--+-+ +--+-+ +; V +--->|MFT+-lptr->-|LOCK+-next->|LOCK+->0 +; +---+ | +---+ +----+ +----+ +; |SFT+----+ ^ +; +-+-+ | +; | | +; +-------------+ +; +; + +;** +; +; Interesting behavior should be noted: +; +; The sharer must maintain information on files in three forms: +; +; local/remote handles. These are normal handles and behave in no +; strange manner. They are identified by SF_mode not having the +; sfIsFCB flag nor by having the sf_mode = 70. No problems with +; locking. No problems with open. No problems with close. +; CloseByName will iterate closes until the mft disappears. +; CloseUser will iterate closes until no SFT for the particular user +; appears. CloseProcess will iterate closes until no SFT for the +; particular user/process appears. +; +; local FCBs. There are no corresponding SFT's for these as the SFTs +; are cached but will be valid for the particular file. There is +; one SFT for each open on a file by a specific process. These are +; identified the sfIsFCB flag in the sf_mode field. When multiple +; opens occur, we merely find the sf pertinent to the file and +; process. Close decrements the ref count. CloseByName, CloseUser, +; CloseProcess will iterate closes until no more SFTs exist. +; +; handles with mode 70. These represent FCB's open across the network. +; As such, identical sfts may have been collapsed by the $open code. +; This results in a reuse of the same SFT. The $Open code must +; correctly set the ref-count for the sft to reflect the number of +; collapses that have occurred. These are identified by a 70 in the +; SF_mode field. There can be no locking on these SFTs. Open must +; scan the list of SFTs for the file and increment its ref count +; appropriately. + \ No newline at end of file diff --git a/v4.0/src/INC/MI.INC b/v4.0/src/INC/MI.INC new file mode 100644 index 0000000..89e26bb --- /dev/null +++ b/v4.0/src/INC/MI.INC @@ -0,0 +1,19 @@ +; SCCSID = @(#)mi.asm 1.1 85/04/10 +BREAK + +mi_INT EQU 0CDh +mi_Long_JMP EQU 0EAh +mi_Long_CALL EQU 09Ah +mi_Long_RET EQU 0CBh +mi_Near_RET EQU 0C3h + +; xxxxoditszxaxpxc +f_Overflow EQU 0000100000000000B +f_Direction EQU 0000010000000000B +f_Interrupt EQU 0000001000000000B +f_Trace EQU 0000000100000000B +f_Sign EQU 0000000010000000B +f_Zero EQU 0000000001000000B +f_Aux EQU 0000000000010000B +f_Parity EQU 0000000000000100B +f_Carry EQU 0000000000000001B diff --git a/v4.0/src/INC/MSBDS.INC b/v4.0/src/INC/MSBDS.INC new file mode 100644 index 0000000..6c41d69 --- /dev/null +++ b/v4.0/src/INC/MSBDS.INC @@ -0,0 +1,128 @@ + +%OUT MSBDS.INC... +; SCCSID = @(#)IBMBDS.ASM 1.9 85/09/16 +;============================================================================== +;REVISION HISTORY: +;AN000 - New for DOS Version 4.00 - J.K. +;AC000 - Changed for DOS Version 4.00 - J.K. +;AN00x - PTM number for DOS Version 4.00 - J.K. +;============================================================================== +;AN001; D113 Disable I/O access to unformatted media 9/03/87 J.K. +;============================================================================== + +; VALUES FOR VARIOUS FLAGS IN BDS.FLAGS. + +FNON_REMOVABLE EQU 01H ;FOR NON-REMOVABLE MEDIA +FCHANGELINE EQU 02H ;IF CHANGELINE SUPPORTED ON DRIVE +RETURN_FAKE_BPB EQU 04H ; WHEN SET, DON'T DO A BUILD BPB + ; JUST RETURN THE FAKE ONE +GOOD_TRACKLAYOUT EQU 08H ; THE TRACK LAYOUT HAS NO FUNNY SECTORS +; FCHANGED_BY_FORMAT EQU 08H +FI_AM_MULT EQU 10H ;IF MORE THAN ONE LOGICAL FOR THIS PHYSICAL +FI_OWN_PHYSICAL EQU 20H ;SIGNIFY LOGICAL OWNER OF THIS PHYSICAL +FCHANGED EQU 40H ;INDICATES MEDIA CHANGED +SET_DASD_TRUE EQU 80H ; SET DASD BEFORE NEXT FORMAT +FCHANGED_BY_FORMAT EQU 100H ;MEDIA CHANGED BY FORMAT +UNFORMATTED_MEDIA EQU 200H ;AN001; Fixed disk only + +; +; VARIOUS FORM FACTORS TO DESCRIBE MEDIA +; +FF48TPI EQU 0 +FF96TPI EQU 1 +FFSMALL EQU 2 +FFHARDFILE EQU 5 +FFOTHER EQU 7 + +BDS_TYPE STRUC +LINK DD ? ; LINK TO NEXT BDS +DRIVENUM DB ? ; INT 13 DRIVE NUMBER +DRIVELET DB ? ; DOS DRIVE NUMBER +BYTEPERSEC DW ? ; NUMBER OF BYTES/SEC +SECPERCLUS DB ? ; SEC PER ALLOCATION UNIT +RESSEC DW ? ; NUMBER OF RESERVED SECTORS +CFAT DB ? ; NUMBER OF FATS +CDIR DW ? ; NUMBER OF DIRECTORY ENTRIES +DRVLIM DW ? ; NUMBER OF SECTORS ON MEDIUM +MEDIAD DB ? ; MEDIA DESCRIPTOR BYTE +CSECFAT DW ? ; NUMBER OF SECTORS/FAT +SECLIM DW ? ; SECTORS PER TRACK +HDLIM DW ? ; MAX NUMBER OF HEADS +HIDSEC_L DW ? ; NUMBER OF HIDDEN SECTORS +HIDSEC_H dw 0 ;J.K.87 +DRVLIM_L dw 0 ;J.K.87 +DRVLIM_H dw 0 ;J.K.87 +FATSIZ DB ? ; FLAGS... +OPCNT DW ? ; OPEN REF. COUNT +FORMFACTOR DB ? ; FORM FACTOR INDEX +FLAGS DW ? ; VARIOUS FLAGS +CCYLN DW ? ; MAX NUMBER OF CYLINDERS +RBYTEPERSEC DW ? ; RECOMMENDED BPB +RSECPERCLUS DB ? +RRESSEC DW ? +RCFAT DB ? +RCDIR DW ? +RDRVLIM DW ? +RMEDIAD DB ? +RCSECFAT DW ? +RSECLIM DW ? +RHDLIM DW ? +RHIDSEC_L DW ? +RHIDSEC_H DW 0 ;J.K.87 +RDRVLIM_L dw 0 ;J.K.87 +RDRVLIM_H dw 0 ;J.K.87 +RESERVE DB 6 DUP (?) ; RESERVED FOR FUTURE +TRACK DB ? ; LAST TRACK ACCESSED ON DRIVE +TIM_LO DW ? ; TIME OF LAST ACCESS. KEEP +TIM_HI DW ? ; THESE CONTIGUOUS. +VOLID DB 12 DUP (?) ; VOLUME ID OF MEDIUM +VOL_SERIAL dd 0 ;J.K.87 Current volume serial number from Boot record +FILESYS_Id db 9 dup (0) ;J.K.87 Current file system id from Boot record +BDS_TYPE ENDS + +BPBSIZE = TRACK - RBYTEPERSEC ; SIZE IN BYTES OF RECBPB AREA IN THE BDS + + +;********************************************************************* +; BDS structure for mini disk - J.K. 4/7/86 +;********************************************************************* + +BDSM_type struc +mlink DW -1 ;Link to next structure + DW ? +mdriveNum DB 80 ;Int 13 Drive Number +mdriveLet DB 3 ;Logical Drive Number +mBytePerSec DW 512 +mSecPerClus DB 1 ;Sectors/allocation unit +mRESSEC DW 1 ;Reserved sectors for DOS +mcFAT DB 2 ;No. of allocation tables +mcDIR DW 16 ;Number of directory entries +mDRVLIM DW 0 ;Number of sectors (at 512 bytes each) +mMediad DB 11111000B ;Media descriptor +mcSecFat DW 1 ;Number of FAT sectors +mSECLIM DW 0 ;Sector limit +mHDLIM DW 0 ;Head limit +mHIDSEC_L DW 0 ;Hidden sector count +mHidsec_H dw 0 ;J.K.87 +mDrvlim_L dw 0 ;J.K.87 +mDrvlim_H dw 0 ;J.K.87 +mFatSiz DB 0 ;TRUE => bigfat +mOPCNT DW 0 ;Open Ref. Count +mFormFactor DB 3 ;Form Factor +mFLAGS DW 0020H ;Various Flags +mcCyln dw 40 ;max number of cylinders +mRecBPB db 31 dup (0) ;Recommended BPB for drive +mTrack db -1 +IsMini dw 1 ;Overlapping TIM_LOH +Hidden_Trks dw 0 ;Overlapping TIM_HIH +mVOLID DB "NO NAME " ;Volume ID for this disk + DB 0 ;ASCIZII for "NO NAME " +mVol_Serial dd 0 ;Current volume serial number from Boot record +mFileSys_Id db "FAT12 " ;Current file system id from Boot record + db 0 + +BDSM_type ENDS +;****************************************************************************** +Max_mini_dsk_num = 23 ;J.K. 4/7/86 - max # of mini disk ibmbio can support +; + diff --git a/v4.0/src/INC/MSDATA.ASM b/v4.0/src/INC/MSDATA.ASM new file mode 100644 index 0000000..5b7c55f --- /dev/null +++ b/v4.0/src/INC/MSDATA.ASM @@ -0,0 +1,33 @@ +; SCCSID = @(#)ibmdata.asm 1.1 85/04/10 +; +; DATA Segment for DOS. +; + +.xlist +.xcref +include mssw.asm +include dosseg.asm +debug = FALSE ; No dossym (too big) +INCLUDE DOSMAC.INC +INCLUDE SF.INC +INCLUDE DIRENT.INC +INCLUDE CURDIR.INC +INCLUDE DPB.INC +INCLUDE BUFFER.INC +INCLUDE ARENA.INC +INCLUDE VECTOR.INC +INCLUDE DEVSYM.INC +INCLUDE PDB.INC +INCLUDE FIND.INC +INCLUDE MI.INC +.cref +.list + +TITLE IBMDATA - DATA segment for DOS +NAME IBMDATA + +installed = TRUE + +include ms_data.asm +include msinit.asm + END diff --git a/v4.0/src/INC/MSDATA2.ASM b/v4.0/src/INC/MSDATA2.ASM new file mode 100644 index 0000000..0615493 --- /dev/null +++ b/v4.0/src/INC/MSDATA2.ASM @@ -0,0 +1,33 @@ +; SCCSID = @(#)ibmdata.asm 1.1 85/04/10 +; +; DATA Segment for DOS +; + +.xlist +.xcref +include mssw.asm +include dosseg.asm +debug = FALSE ; No dossym (too big) +INCLUDE DOSMAC.INC +INCLUDE SF.INC +INCLUDE DIRENT.INC +INCLUDE CURDIR.INC +INCLUDE DPB.INC +INCLUDE BUFFER.INC +INCLUDE ARENA.INC +INCLUDE VECTOR.INC +INCLUDE DEVSYM.INC +INCLUDE PDB.INC +INCLUDE FIND.INC +INCLUDE MI.INC +.cref +.list + +TITLE IBMDATA - DATA segment for DOS +NAME IBMDATA + +installed = TRUE + +include msdata.asm +include msinit.asm + END diff --git a/v4.0/src/INC/MSDOSME.ASM b/v4.0/src/INC/MSDOSME.ASM new file mode 100644 index 0000000..911d756 --- /dev/null +++ b/v4.0/src/INC/MSDOSME.ASM @@ -0,0 +1,17 @@ +; SCCSID = @(#)ibmdosmes.asm 1.1 85/04/10 +; +; Standard device IO for MSDOS (first 12 function calls) +; +debug=0 +.xlist +.xcref +include mssw.asm +include dosseg.asm +.cref +.list + +TITLE IBMDOSMES - DOS OEM dependancies +NAME IBMDOSMES + +include dosmes.asm + \ No newline at end of file diff --git a/v4.0/src/INC/MSGDCL.INC b/v4.0/src/INC/MSGDCL.INC new file mode 100644 index 0000000..52f3d77 --- /dev/null +++ b/v4.0/src/INC/MSGDCL.INC @@ -0,0 +1,108 @@ +; This Macro was removed from sysmsg.inc. We had to remove this +; macro and put it into it's own include file in order to clear up +; some assembly errors. MS MASM will not allow a public declaration +; during the second pass of the assembler. IBM MASM will allow this. +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; $M_DECLARE Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +$M_DECLARE macro numcls ; + $M_DCOUNT = 0 ; + REPT numcls ; + $M_DCOUNT = $M_DCOUNT + 1 ; + $M_DECLARE2 %$M_DCOUNT ; + ENDM ; + + IF COMR + IFNDEF $M_RT2 ; If Resident table is not in this assembly, + EXTRN $M_RT2:BYTE ; Must be external + ELSE + PUBLIC $M_RT2 + ENDIF ; + ELSE + IFNDEF $M_RT ; If Resident table is not in this assembly, + EXTRN $M_RT:BYTE ; Must be external + ELSE + PUBLIC $M_RT + ENDIF ; + ENDIF + + $M_CHECK $M_GET_MSG_ADDRESS ; If this subroutine is not in this assembly, + $M_CHECK $M_MSGSERV_1 ; If this subroutine is not in this assembly, + $M_CHECK $M_MSGSERV_2 ; If this subroutine is not in this assembly, + +ENDM ; + ; +$M_DECLARE2 macro innum ; + IF NOT COMR ; IF Not resident COMMAND.COM + IF NOT COMT ; IF Not transient COMMAND.COM + IFNDEF $M_CLS_&innum ; IF class is not in this assembly, + IF FARmsg ; + EXTRN $M_CLS_&innum:FAR ; Must be external + ELSE ; + EXTRN $M_CLS_&innum:NEAR ; Must be external + ENDIF ; + ELSE ; ELSE + PUBLIC $M_CLS_&innum ; Label PUBLIC + ENDIF ; + ELSE ; ELSE + IFDIF <$M_CLS_&innum>,<$M_CLS_1> ; IF NOT $M_CLS_1 or + IFDIF <$M_CLS_&innum>,<$M_CLS_2> ; IF NOT $M_CLS_2 then + IFNDEF $M_CLS_&innum ; IF class is not in this assembly, + IF FARmsg ; + EXTRN $M_CLS_&innum:FAR ; Must be external + ELSE ; + EXTRN $M_CLS_&innum:NEAR ; Must be external + ENDIF ; + ELSE ; ELSE + PUBLIC $M_CLS_&innum ; Label PUBLIC + ENDIF ; + ENDIF ; + ENDIF ; + ENDIF ; + ELSE ; ELSE + IFDIF <$M_CLS_&innum>,<$M_CLS_1> ; IF NOT $M_CLS_1 or + IFDIF <$M_CLS_&innum>,<$M_CLS_2> ; IF NOT $M_CLS_2 then + IFNDEF $M_CLS_&innum ; IF class is not in this assembly, + IF FARmsg ; + EXTRN $M_CLS_&innum:FAR ; Must be external + ELSE ; + EXTRN $M_CLS_&innum:NEAR ; Must be external + ENDIF ; + ELSE ; ELSE + PUBLIC $M_CLS_&innum ; Label PUBLIC + ENDIF ; + ENDIF ; + ENDIF ; + ENDIF ; +ENDM ; + ; +$M_CHECK macro parm ; + IFNDEF parm ; IF class is not in this assembly, + IF FARmsg ; + EXTRN parm:FAR ; Must be external + ELSE ; + EXTRN parm:NEAR ; Must be external + ENDIF ; + ELSE + IF COMR + ELSE + PUBLIC parm + ENDIF + ENDIF ; +ENDM ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +IF1 ; + $M_DECLARE %$M_NUM_CLS ; Declare any class not in this assembly +ENDIF ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + \ No newline at end of file diff --git a/v4.0/src/INC/MSGHAN.INC b/v4.0/src/INC/MSGHAN.INC new file mode 100644 index 0000000..1046317 --- /dev/null +++ b/v4.0/src/INC/MSGHAN.INC @@ -0,0 +1,153 @@ + IF1 ;AN000; + %OUT INCLUDING MSGHAN.INC...;AN000; + ENDIF ;AN000; +;THIS IS A COMMONLY INCLUDED FILE, USED BY (AT LEAST) THE FOLLOWING COMPONENTS: +;TREE, GRAFTABL, DISKCOMP, DISKCOPY, COMP - WRITTEN OR Revised BY E.K. + +; VALUES FOR THE MSG_DESC CONTROL BLOCK +ONE_SUBS EQU 1 ;AN000;ONE VARIABLE FIELD IN MESSAGE +TWO_SUBS EQU 2 ;AN000;TWO VARIABLE FIELDS IN MESSAGE +THREE_SUBS EQU 3 ;AN000;THREE VARIABLE FIELDS IN MESSAGE +CLASS_1 EQU EXT_ERR_CLASS ;AN000;CLASS 1 (DOS EXTENDED ERRORS) +CLASS_2 EQU PARSE_ERR_CLASS ;AN000;CLASS 2 (PARSE ERRORS) +CLASS_A EQU UTILITY_MSG_CLASS ;AN000;CLASS A TYPE MESSAGE + +;THIS MESSAGE DESCRIPTOR CONTROL BLOCK IS GENERATED, ONE PER MESSAGE, +;TO DEFINE THE SEVERAL PARAMETERS THAT ARE EXPECTED TO BE PASSED IN +;CERTAIN REGISTERS WHEN THE SYSDISPMSG FUNCTION IS TO BE INVOKED. + +MSG_DESC STRUC ;AN000; +MSG_NUM DW 0 ;AN000;MESSAGE NUMBER (TO AX) +MSG_HANDLE DW STDOUT ;AN000;HANDLE OF OUTPUT DEVICE (TO BX) +MSG_SUBLIST DW 0 ;AN000;POINTER TO SUBLIST (TO SI) +MSG_COUNT DW 0 ;AN000;SUBSTITUTION COUNT (TO CX) +MSG_CLASS DW CLASS_A SHL 8 ;AN000;MESSAGE CLASS (IN HIGH BYTE, TO DH) + ; LOW BYTE HAS 0 (FUNCTION "NO INPUT", TO DL) +MSG_DESC ENDS ;AN000; + +; VALUES FOR THE SUBLIST CONTROL BLOCK +PC_ID_0 EQU 0 ;AN000;ID OF " - " TRAILER TO MESSAGE +PC_ID_1 EQU 1 ;AN000;ID OF PERCENT VARIABLE FIELD +PC_ID_2 EQU 2 ;AN000;ID OF PERCENT VARIABLE FIELD +PC_ID_3 EQU 3 ;AN000;ID OF PERCENT VARIABLE FIELD +MAX_0 EQU 0 ;AN000;MAXIMUM WIDTH OF STRING FIELD (0=NO LIMIT) +MIN_1 EQU 1 ;AN000;MINIMUM WIDTH OF STRING FIELD +PAD_BLK EQU " " ;AN000;CHAR FOR PAD FIELD +FILL_OFF EQU 0 ;AN000;TO BE REPLACED WITH ACTUAL OFFSET +FILL_SEG EQU 0 ;AN000;TO BE REPLACED WITH ACTUAL SEG ID + +;THIS SUBLIST CONTROL BLOCK, POINTED TO BY SI WHEN SYSDISPMSG IS CALLED +;FURTHER DESCRIBES THE MESSAGE AND THE VARIABLE FIELDS THE MSG MAY CONTAIN. +;THERE IS ONE OF THESE CONTROL BLOCKS PER VARIABLE FIELD. ADDITIONAL +;VARIABLE FIELDS ARE DEFINED IN ADDITIONAL "SUBLIST" CONTROL BLOCKS, +;CONSECUTIVE AND CONTIGUOUS WITH THIS ONE. THE NUMBER OF THESE CONTROL +;BLOCKS IS THE SUBSTITUTION COUNT, PASSED IN CS TO SYSDISPMSG, AS DEFINED +;IN THE ABOVE "MSC_DESC" CONTROL BLOCK. + +SUBLIST STRUC ;AN000; +SUB_SIZE DB 11 ;AN000;SUBLIST SIZE (POINTER TO NEXT SUBLIST) +SUB_RES DB 0 ;AN000;RESERVED + ;NEXT FIELD IS TO BE USED AS A DOUBLE WORD +SUB_VALUE DW 0 ;AN000;TIME, DATE, OR PTR TO DATA ITEM +SUB_VALUE_SEG DW 0 ;AN000;SEG ID OF PTR + ;(ABOVE FIELD MUST BE FILLED AT EXECUTION TIME + ; IF THIS IS A .COM FILE) +SUB_ID DB 0 ;AN000;N OF %N +SUB_FLAGS DB 0 ;AN000;DATA TYPE FLAGS +SUB_MAX_WIDTH DB MAX_0 ;AN000;MAXIMUM FIELD WIDTH (0=UNLIMITED) +SUB_MIN_WIDTH DB 0 ;AN000;MINIMUM FIELD WIDTH +SUB_PAD_CHAR DB PAD_BLK ;AN000;CHARACTER FOR PAD FIELD + ; CAN BE " ", "0" OR ",". + ; "," CAUSES INSERTION OF THE ACTIVE + ; THOUSANDS SEPARATOR BETWEEN EVERY 3 DIGITS. +SUBLIST ENDS ;AN000; + +; BITS DEFINED FOR SUB_FLAGS ABOVE +; FORMAT = A0SSTTTT +; ³³ ³ ÀÄÄÄ FIELD TYPE +; ³³ ÀÄÄÄ DATA VARIABLE SIZE +; ³ÀÄÄÄ RESERVED, MUST BE ZERO +; ÀÄÄÄ ALIGNMENT INDICATOR +SF_BITS RECORD F_ALIGN:1,F_RES:1=0,F_SIZE:2,F_TYPE:4;AN000; + +; F_ALIGN FIELD, ALIGNMENT INDICATOR +SF_LEFT EQU 0 ;AN000;LEFT ALIGN +SF_RIGHT EQU 1 ;AN000;RIGHT ALIGN + +; F_RES FIELD, RESERVED, SHOULD BE ZERO + +; F_TYPE FIELD, FIELD TYPE +SF_CHAR EQU 0000B ;AN000;TYPE IS CHARACTER +; F_SIZE FIELD, +SF_CH EQU 00B ;AN000;SINGLE CHARACTER +SF_ASCIIZ EQU 01B ;AN000;ASCIIZ STRING + +; F_TYPE FIELD, FIELD TYPE +SF_UN_BD EQU 0001B ;AN000;UNSIGNED BINARY TO DECIMAL CHARACTER +; F_SIZE FIELD, +SF_BYTE EQU 01B ;AN000;DATA IS BYTE SIZED +SF_WORD EQU 10B ;AN000;DATA IS WORD SIZED +SF_DWORD EQU 11B ;AN000;DATA IS DOUBLE WORD SIZED + +; F_TYPE FIELD, FIELD TYPE +SF_SIN_BD EQU 0010B ;AN000;SIGNED BINARY TO DECIMAL CHARACTER +; F_SIZE FIELD, +;SF_BYTE EQU 01B ;DATA IS BYTE SIZED +;SF_WORD EQU 10B ;DATA IS WORD SIZED +;SF_DWORD EQU 11B ;DATA IS DOUBLE WORD SIZED + +; F_TYPE FIELD, FIELD TYPE +SF_UN_BH EQU 0011B ;AN000;UNSIGNED BINARY TO HEXADECIMAL CHARACTER +; F_SIZE FIELD, +;SF_BYTE EQU 01B ;DATA IS BYTE SIZED +;SF_WORD EQU 10B ;DATA IS WORD SIZED +;SF_DWORD EQU 11B ;DATA IS DOUBLE WORD SIZED + +; F_TYPE FIELD, FIELD TYPE +SF_DATE EQU 0100B ;AN000;DATE TO CHARACTER, + ; USING CURRENT COUNTRY FORMAT + ;SUB_VALUE HIGH=YEAR + ;SUB_VALUE LOW=MMDD +; F_SIZE FIELD, +SF_MD EQU 01B ;AN000;MONTH AND DAY ONLY +SF_MDY2 EQU 10B ;AN000;MONTH,DAY AND YEAR (2 DIGITS) +SF_MDY4 EQU 11B ;AN000;MONTH,DAY AND YEAR (4 DIGITS) + +; F_TYPE FIELD, FIELD TYPE +SF_TIME_12 EQU 0101B ;AN000;TIME TO CHARACTER, 12 HOUR FORMAT + ; USING CURRENT COUNTRY FORMAT + ;SUB_VALUE HIGH=HHMM + ;SUB_VALUE LOW=SSHH +; F_SIZE FIELD, +SF_HHMM EQU 00B ;AN000;HH:MM (ACTIVE TIME FORMAT) +SF_HHMMSS EQU 01B ;AN000;HH:MM:SS (ACTIVE TIME FORMAT) +SF_HHMMSSHH EQU 10B ;AN000;HH:MM:SS:HH + +; F_TYPE FIELD, FIELD TYPE +SF_TIME_24 EQU 0110B ;AN000;TIME TO CHARACTER, 24 HOUR FORMAT + ; USING CURRENT COUNTRY FORMAT + ;SUB_VALUE HIGH=HHMM + ;SUB_VALUE LOW=SSHH +; F_SIZE FIELD, +;SF_HHMM EQU 00B ;HH:MM (ACTIVE TIME FORMAT) +;SF_HHMMSS EQU 01B ;HH:MM:SS (ACTIVE TIME FORMAT) +;SF_HHMMSSHH EQU 10B ;HH:MM:SS:HH + +; THE NEXT GROUP ARE ALL CLASS "1" MESSAGES + + PUBLIC MSGNUM_EXTERR;AN000; +MSGNUM_EXTERR MSG_DESC <,STDERR,,,CLASS_1 SHL 8> ;AN000;ALL EXTENDED DOS ERRORS + ;ERROR NUMBER WILL NEED TO BE FILLED IN + +; THE NEXT GROUP ARE ALL CLASS "2" MESSAGES + + PUBLIC MSGNUM_PARSE ;AN000;SO PARSE DRIVER CAN FIND IT +MSGNUM_PARSE MSG_DESC <,STDERR,,,CLASS_2 SHL 8> ;AN000;ALL PARSING ERRORS + ;ERROR NUMBER WILL NEED TO BE FILLED IN + +; THE NEXT GROUP ARE ALL CLASS "A" MESSAGES +; THESE ARE THE "CANNED" MESSAGES ALWAYS PRESENT + + PUBLIC MSGNUM_VER ;AN000; +MSGNUM_VER MSG_DESC <1,STDERR> ;AN000;"Incorrect DOS Version" +;end of MSGHAN.INC diff --git a/v4.0/src/INC/MSGSERV.ASM b/v4.0/src/INC/MSGSERV.ASM new file mode 100644 index 0000000..21f012d --- /dev/null +++ b/v4.0/src/INC/MSGSERV.ASM @@ -0,0 +1,3133 @@ +; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * * +; +; MODULE NAME: MSGSERV.SAL +; +; DESCRIPTIVE NAME: Message Services SALUT file +; +; FUNCTION: This module incorporates all the messages services and +; is called upon at build time to INCLUDE the code requested +; by a utility. Code is requested using the macro MSG_SERVICES. +; +; ENTRY POINT: Since this a collection of subroutines, entry point is at +; requested procedure. +; +; INPUT: Since this a collection of subroutines, input is dependent on function +; requested. +; +; EXIT-NORMAL: In all cases, CARRY FLAG = 0 +; +; EXIT-ERROR: In all cases, CARRY FLAG = 1 +; +; INTERNAL REFERENCES: (list of included subroutines) +; +; - SYSLOADMSG +; - SYSDISPMSG +; - SYSGETMSG +; +; +; EXTERNAL REFERENCES: None +; +; NOTES: At build time, some modules must be included. These are only included +; once using assembler switches. Other logic is included at the request +; of the utility. +; +; COMR and COMT are assembler switches to conditionally assemble code +; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident +; storage and multiple EQUates. +; +; REVISION HISTORY: Created MAY 1987 +; +; Label: DOS - - Message Retriever +; (c) Copyright 1988 Microsoft +; +; +; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * * +; Page + +; $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting + +IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN + $M_STRUC = FALSE ;;AN000;; Let the assembler know that we have + ;;AN000;; and include them + + PAGE + SUBTTL DOS - Message Retriever - MSGSTR.INC Module +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; STRUCTURE: $M_SUBLIST_STRUC +;; +;; Replacable parameters are described by a sublist structure +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_SUBLIST_STRUC STRUC ;;AN000;; + ;; + $M_S_SIZE DB 11 ;;AN000;; SUBLIST size (PTR to next SUBLIST) + $M_S_RESV DB 0 ;;AN000;; RESERVED + $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item + $M_S_ID DB ? ;;AN000;; n of %n + $M_S_FLAG DB ? ;;AN000;; Data-type flags + $M_S_MAXW DB ? ;;AN000;; Maximum field width + $M_S_MINW DB ? ;;AN000;; Minimum field width + $M_S_PAD DB ? ;;AN000;; Character for Pad field + ;; +$M_SUBLIST_STRUC ENDS ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; STRUCTURE: $M_CLASS_ID +;; +;; Each class will be defined by this structure. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_CLASS_ID STRUC ;;AN000;; + ;; + $M_CLS_ID DB -1 ;;AN000;; Class identifer + $M_COMMAND_VER DW EXPECTED_VERSION ;;AN003;; COMMAND.COM version check + $M_NUM_CLS_MSG DB 0 ;;AN000;; Total number of message in class + ;; +$M_CLASS_ID ENDS ;; + ;;AN000;; + $M_CLASS_ID_SZ EQU TYPE $M_CLASS_ID ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; STRUCTURE: $M_ID_STRUC +;; +;; Each message will be defined by this structure. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_ID STRUC ;;AN000;; + ;; + $M_NUM DW -1 ;;AN000;; Message Number + $M_TXT_PTR DW ? ;;AN000;; Pointer to message text + ;; +$M_ID ENDS ;;AN000;; + ;;AN000;; Status Flag Values: + $M_ID_SZ EQU TYPE $M_ID ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; STRUCTURE: $M_RES_ADDRS +;; +;; Resident data area definition of variables +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_RES_ADDRS STRUC ;;AN000;; + ;; + $M_EXT_ERR_ADDRS DD 0 ;;AN000;; Allow pointers to THREE Extended error locations + $M_EXT_FILE DD 0 ;;AN001;; + $M_EXT_COMMAND DD 0 ;;AN000;; + $M_EXT_TERM DD -1 ;;AN000;; + $M_PARSE_COMMAND DD 0 ;;AN000;; + $M_PARSE_ADDRS DD 0 ;;AN000;; Allow pointers to TWO Parse error locations + $M_PARSE_TERM DD -1 ;;AN000;; + $M_CRIT_ADDRS DD 0 ;;AN000;; Allow pointers to TWO Critical error locations + $M_CRIT_COMMAND DD 0 ;;AN000;; + $M_CRIT_TERM DD -1 ;;AN000;; + $M_DISK_PROC_ADDR DD -1 ;;AN004;; Address of READ_DISK_PROC + $M_CLASS_ADDRS DD $M_NUM_CLS DUP(0) ;;AN000;; Allow pointers to specified classes + $M_CLS_TERM DD -1 ;;AN000;; + $M_DBCS_VEC DD 0 ;;AN000;; Save DBCS vector + $M_HANDLE DW ? ;;AN000;; + $M_SIZE DB 0 ;;AN000;; + $M_CRLF DB 0DH,0AH ;;AN004;; CR LF message + $M_CLASS DB ? ;;AN004;; Saved class + $M_RETURN_ADDR DW ? ;;AN000;; + $M_MSG_NUM DW $M_NULL ;;AN000;; + $M_DIVISOR DW 10 ;;AN000;; Default = 10 (must be a WORD for division) + $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP("$") ;;AN000;; Temporary buffer + $M_BUF_TERM DB "$" ;;AN000;; + +$M_RES_ADDRS ENDS ;;AN000;; + ;; +$M_RES_ADDRS_SZ EQU TYPE $M_RES_ADDRS ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; STRUCTURE: $M_COUNTRY_INFO +;; +;; Important fields of the Get Country Information call +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation + ;; + $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc + $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format + $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;; + $M_THOU_SEPARA DB ?,0 ;;AN000;; <------- Thou Separator + $M_DECI_SEPARA DB ?,0 ;;AN000;; <------- Decimal Separator + $M_DATE_SEPARA DB ?,0 ;;AN000;; <------- Date Separator + $M_TIME_SEPARA DB ?,0 ;;AN000;; <------- Time Separator + $M_CURR_FORMAT DB ? ;;AN000;; + $M_SIG_DIGS_CU DB ? ;;AN000;; + $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format + ;; +$M_COUNTRY_INFO ENDS ;;AN000;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ELSE ;;AN000;; ELSE if we have already included the STRUCTURES +; +; $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section + + IF MSGDATA ;;AN000;; IF this is a request to include the data area + MSGDATA = FALSE ;;AN000;; Let the assembler know not to include it again + ;;AN000;; and include it + PAGE + SUBTTL DOS - Message Retriever - MSGRES.TAB Module +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; DATA NAME: $M_RES_TABLE +;; +;; REFERENCE LABEL: $M_RT +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +IF COMR ;;AN000;; Since COMMAND.COM includes this twice + $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no + $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur + $M_ALTLABEL = TRUE ;;AN000;; Flag that label was changed +ELSE ;;AN000;; + $M_RT LABEL BYTE ;;AN000;; +ENDIF ;;AN000;; + $M_RES_ADDRS <> ;;AN000;; Resident addresses + ;; + include COPYRIGH.INC ;;AN001;; Include Copyright 1988 Microsoft + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include of Data table + +; + IF NOT $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN + ;; don't include any more code + ;;AN000;; Figure out what other code to include + IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code + IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it) + $M_RT EQU $M_RT2 ;;AN003;; + ENDIF + DISK_PROC = FALSE ;;AN003;; Yes, THEN include it and reset flag + PAGE + SUBTTL DOS - Message Retriever - DISK_PROC Module +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: DISK_PROC +;; +;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended +;; errors from disk\diskette +;; INPUTS: AX has the message number +;; DX has the message class +;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is +;; assumed to be set!! +;; +;; OUTPUTS: ES:DI points to message length (BYTE) followed by text +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC READ_DISK_PROC ;; + ;; +READ_DISK_PROC PROC FAR ;;AN003;; + + PUSH AX ;;AN003;; Save everything + PUSH BX ;;AN003;; + PUSH DX ;;AN003;; + PUSH SI ;;AN003;; + PUSH BP ;;AN003;; + PUSH DS ;;AN003;; + PUSH DI ;;AN003;; + MOV BP,AX ;;AN003;; Save message number + MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function + LEA SI,RESGROUP:COMSPEC ;;AN003;; Get addressibilty to COMMAND.COM + PUSH CS ;;AN003;; + POP DS ;;AN003;; + MOV DI,-1 ;;AN003;; No extended attribute list + MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error + MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag + INT 21H ;;AN003;; Open the file + POP DI ;;AN003;; Retreive LSEEK pointer + ;;AN003;; Error ? +; $IF NC,LONG ;;AN003;; No, + JNC $MXL1 + JMP $MIF1 +$MXL1: + PUSH DI ;;AN003;; Save LSEEK pointer + MOV BX,AX ;;AN003;; Set handle in BX + MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors + XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM + MOV DX,DI ;;AN003;; + INT 21H ;;AN003;; LSEEK the file + POP DX ;;AN003;; Retreive LSEEK pointer + ;;AN003;; Error ? +; $IF NC ;;AN003;; No, + JC $MIF2 + INC CX ;;AN003;; Set flag to first pass +; $DO ;;AN003;; +$MDO3: + PUSH DX ;;AN003;; Save LSEEK pointer + PUSH CX ;;AN003;; Save first pass flag + PUSH AX ;;AN003;; Save number of messages (if set yet) + XOR SI,SI ;;AN003;; Reset buffer index + MOV AH,DOS_READ_BYTE ;;AN003;; Read + MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header + LEA DX,$M_RT.$M_TEMP_BUF ;;AN003;; into the temp buffer + INT 21H ;;AN003;; Read it + MOV DI,DX ;;AN003;; + POP AX ;;AN003;; + POP CX ;;AN003;; + OR CX,CX ;;AN003;; +; $IF NZ ;;AN003;; + JZ $MIF4 + XOR CX,CX ;;AN003;; Set flag to second pass + XOR AH,AH ;;AN003;; Get number of messages in class + MOV AL,DS:[DI].$M_NUM_CLS_MSG ;;AN003;; + MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index + CMP DS:[DI].$M_COMMAND_VER,EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM? +; $ENDIF ;;AN003;; +$MIF4: + POP DX ;;AN003;; +; $IF Z ;;AN003;; Yes, + JNZ $MIF6 +; $SEARCH ;;AN003;; +$MDO7: + CMP BP,WORD PTR $M_RT.$M_TEMP_BUF[SI] ;;AN003;; Is this the message I'm looking for? +; $EXITIF Z ;;AN003;; Yes, (ZF=1) + JNZ $MIF7 + CLC ;;AN003;; Reset carry, exit search +; $ORELSE ;;AN003;; No, (ZF=0) + JMP SHORT $MSR7 +$MIF7: + ADD SI,$M_ID_SZ ;;AN003;; Increment index + ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header + DEC AX ;;AN003;; Decrement # of messages left +; $LEAVE Z ;;AN003;; Have we exhausted all messages? + JZ $MEN7 + CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer? +; $ENDLOOP A ;;AN003;; No, Check next message (ZF=1) + JNA $MDO7 +$MEN7: + STC ;;AN003;; Yes, (ZF=0) set error (ZF=0) +; $ENDSRCH ;;AN003;; +$MSR7: +; $ELSE ;;AN003;; No, + JMP SHORT $MEN6 +$MIF6: + XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop + STC ;;AN003;; Set Carry +; $ENDIF ;;AN003;; +$MEN6: +; $ENDDO Z ;;AN003;; Get next buffer full if needed + JNZ $MDO3 + ;;AN003;; Error ? +; $IF NC ;;AN003;; No, + JC $MIF16 + MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message + XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM + ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header + ADD DX,WORD PTR $M_RT.$M_TEMP_BUF[SI]+2 ;;AN003;; Add offset from msg structure + INT 21H ;;AN003;; LSEEK the file + MOV AH,DOS_READ_BYTE ;;AN003;; Read + MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message + LEA DX,$M_RT.$M_TEMP_BUF ;;AN003;; into the temp buffer + INT 21H ;;AN003;; Read it + MOV DI,DX ;;AN003;; into the temp buffer + PUSH DS ;;AN003;; into the temp buffer + POP ES ;;AN003;; into the temp buffer +; $ENDIF ;;AN003;; +$MIF16: +; $ENDIF ;;AN003;; +$MIF2: + PUSHF ;;AN003;; Close file handle + MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle + INT 21H ;;AN003;; + $M_POPF ;;AN003;; +; $ENDIF ;;AN003;; Yes there was an error, +$MIF1: + POP DS ;;AN003;; + POP BP ;;AN003;; + POP SI ;;AN003;; + POP DX ;;AN003;; + POP BX ;;AN003;; + POP AX ;;AN003;; + ;;AN003;; abort everything + RET ;;AN003;; + +READ_DISK_PROC ENDP ;;AN003;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN003;; END of include for DISK_PROC +; + + IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO + SETSTDIO = FALSE ;;AN000;; Yes, THEN include it and reset flag + PAGE + SUBTTL DOS - Message Retriever - SETSTDIO Module +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: SETSTDIO +;; +;; FUNCTION: +;; INPUTS: +;; +;; OUPUTS: +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +IF FARmsg ;AN001; + SETSTDINON PROC FAR ;AN001; +ELSE ;AN001; + SETSTDINON PROC NEAR ;AN001; +ENDIF ;AN001; + PUSH AX ;AN002; Save changed regs + PUSH BX ;AN002; + PUSH DX ;AN002; + MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL + MOV BX,STDIN ;AN001; + XOR DX,DX ;AN001; + INT 21H ;AN001; + + OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit + MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL + INT 21H ;AN001; + POP DX ;AN002; Restore Regs + POP BX ;AN002; + POP AX ;AN002; + + RET ;AN001; + ;AN001; + SETSTDINON ENDP ;AN001; + +IF FARmsg ;AN001; + SETSTDINOFF PROC FAR ;AN001; +ELSE ;AN001; + SETSTDINOFF PROC NEAR ;AN001; +ENDIF ;AN001; + + PUSH AX ;AN002; Save changed regs + PUSH BX ;AN002; + PUSH DX ;AN002; + MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL + MOV BX,STDIN ;AN001; + XOR DX,DX ;AN001; + INT 21H ;AN001; + + AND DH,NOT $M_CRIT_ERR_MASK ;AN001; Turn off bit + MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL + INT 21H ;AN001; + POP DX ;AN002; Restore Regs + POP BX ;AN002; + POP AX ;AN002; + + RET ;AN001; + + SETSTDINOFF ENDP ;AN001; + +IF FARmsg ;AN001; + SETSTDOUTON PROC FAR ;AN001; +ELSE ;AN001; + SETSTDOUTON PROC NEAR ;AN001; +ENDIF ;AN001; + + PUSH AX ;AN002; Save changed regs + PUSH BX ;AN002; + PUSH DX ;AN002; + MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL + MOV BX,STDOUT ;AN001; + XOR DX,DX ;AN001; + INT 21H ;AN001; + + OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit + MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL + INT 21H ;AN001; + POP DX ;AN002; Restore Regs + POP BX ;AN002; + POP AX ;AN002; + + RET ;AN001; + + SETSTDOUTON ENDP ;AN001; + +IF FARmsg ;AN001; + SETSTDOUTOFF PROC FAR ;AN001; +ELSE ;AN001; + SETSTDOUTOFF PROC NEAR +ENDIF ;AN001; + + PUSH AX ;AN002; Save changed regs + PUSH BX ;AN002; + PUSH DX ;AN002; + MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL + MOV BX,STDOUT ;AN001; + XOR DX,DX ;AN001; + INT 21H ;AN001; + + AND DH,NOT $M_CRIT_ERR_MASK ;AN001; Turn off bit + MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL + INT 21H ;AN001; + POP DX ;AN002; Restore Regs + POP BX ;AN002; + POP AX ;AN002; + + RET ;AN001; + + SETSTDOUTOFF ENDP ;AN001; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include for SETSTDIO +; + IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ? + IF COMR ;;AN000;; + $M_RT EQU $M_RT2 ;;AN000;; + ENDIF + LOADmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag + PAGE + SUBTTL DOS - Message Retriever - LOADMSG.ASM Module +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: SYSLOADMSG +;; +;; FUNCTION: +;; INPUTS: +;; +;; OUPUTS: +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +IF FARmsg ;;AN000;; + SYSLOADMSG PROC FAR ;;AN000;; +ELSE ;;AN000;; + SYSLOADMSG PROC NEAR ;;AN000;; +ENDIF ;;AN000;; + PUSH AX ;;AN000; + PUSH BX ;;AN000; + PUSH DX ;;AN000; + PUSH ES ;;AN000; + PUSH DI ;;AN000; + XOR CX,CX ;;AN000; Reset to zero + MOV ES,CX ;;AN000; + XOR DI,DI ;;AN000; + MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface + MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM + INT 2FH ;;AN000;; Private interface + MOV WORD PTR $M_RT.$M_EXT_COMMAND+2,ES ;;AN000;; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_EXT_COMMAND,DI ;;AN000;; + ;; + MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface + MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM + INT 2FH ;;AN000;; Private interface + MOV WORD PTR $M_RT.$M_PARSE_COMMAND+2,ES ;;AN000;; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_PARSE_COMMAND,DI ;;AN000;; + ;; + MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface + MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM + INT 2FH ;;AN000;; Private interface + MOV WORD PTR $M_RT.$M_CRIT_COMMAND+2,ES ;;AN000;; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_CRIT_COMMAND,DI ;;AN000;; + + MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface + MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE + INT 2FH ;;AN001;; Private interface + MOV WORD PTR $M_RT.$M_EXT_FILE+2,ES ;;AN001;; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_EXT_FILE,DI ;;AN001;; + +IF COMR ;; ** Special case for RESIDENT COMMAND.COM + IF2 + IFNDEF READ_DISK_INFO ;;AN003;; + Extrn READ_DISK_PROC:Far ;;AN003;; + ENDIF ;;AN003;; + ENDIF ;;AN003;; +ELSE ;; + IF FARmsg ;;AN000;; + CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) + ELSE ;;AN000;; + CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors) + ENDIF ;;AN000;; + MOV WORD PTR $M_RT.$M_EXT_ERR_ADDRS+2,ES ;;AN000;; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_EXT_ERR_ADDRS,DI ;;AN000;; + MOV WORD PTR $M_RT.$M_CRIT_ADDRS+2,ES ;;AN000;; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_CRIT_ADDRS,DI ;;AN000;; + ;; + IF FARmsg ;;AN000;; + CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) + ELSE ;;AN000;; + CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors) + ENDIF ;;AN000;; + MOV WORD PTR $M_RT.$M_PARSE_ADDRS+2,ES ;;AN000;; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_PARSE_ADDRS,DI ;;AN000;; +ENDIF ;; + ;; + MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface + MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM + INT 2FH ;;AN001;; Private interface + MOV WORD PTR $M_RT.$M_DISK_PROC_ADDR+2,ES ;;AN001;; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_DISK_PROC_ADDR,DI ;;AN001;; + + $M_BUILD_PTRS %$M_NUM_CLS ;;AN000;; Build all utility classes + ;;AN000;; + CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector + +IF NOT NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed + CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK +ENDIF ;;AN000;; + ;;AN000;; +IF NOT NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed + CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK +ENDIF ;;AN000;; + ;;AN000;; +IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed + CLC ;;AN000;; Make sure carry is clear +ELSE ;;AN000;; ELSE + PUSH CX ;;AN000;; + CALL $M_VERSION_CHECK ;;AN000;; Check Version +ENDIF ;;AN000;; + ;; Error ? +; $IF NC ;;AN000;; No. + JC $MIF20 +IF NOT NOVERCHECKmsg ;;AN000;; IF version check was not supressed + POP CX ;;AN000;; Reset stack +ENDIF ;;AN000;; + POP DI ;;AN000;; Restore REGS + POP ES ;;AN000;; + POP DX ;;AN000;; + POP BX ;;AN000;; + POP AX ;;AN000;; +; $ELSE ;;AN000;; Yes, + JMP SHORT $MEN20 +$MIF20: +IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed + ADD SP,10 ;;AN000;; + STC ;;AN000;; Reset carry flag +ELSE ;;AN000;; IF version check is to be supressed + ADD SP,12 ;;AN000;; + STC ;;AN000;; Reset carry flag +ENDIF ;;AN000;; IF version check is to be supressed +; $ENDIF ;;AN000;; +$MEN20: + RET ;;AN000;; + ;; + SYSLOADMSG ENDP ;;AN000;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PAGE + SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Proc Name: $M_GET_DBCS_VEC +;; +;; Function: Get the DBCS vector and save it for later use +;; +;; Inputs: None +;; +;; Outputs: None +;; +;; Regs Changed: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_GET_DBCS_VEC PROC NEAR ;;AN000;; + ;; + PUSH AX ;;AN000;; Save character to check + PUSH SI ;;AN000;; + PUSH DS ;;AN000;; + MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment + INT 21H ;;AN000;; Get environment pointer + PUSH DS ;;AN000;; Get environment pointer + POP ES ;;AN000;; Get environment pointer + POP DS ;;AN000;; Get environment pointer +; $IF NC ;;AN000;; + JC $MIF23 + MOV WORD PTR $M_RT.$M_DBCS_VEC,SI ;;AN000;; Save DBCS Vector + MOV WORD PTR $M_RT.$M_DBCS_VEC+2,ES ;;AN000;; +; $ENDIF ;;AN000;; +$MIF23: + POP SI ;;AN000;; + POP AX ;;AN000;; Retrieve character to check + RET ;;AN000;; Return + ;; +$M_GET_DBCS_VEC ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ? + ELSE ;AN001; Yes, THEN include it + PAGE + SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Proc Name: $M_CHECKSTDIN +;; +;; Function: +;; +;; Inputs: None +;; +;; Outputs: +;; +;; Regs Changed: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_CHECKSTDIN PROC NEAR ;AN001; + + MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL + MOV BX,STDIN ;AN001; + XOR DX,DX ;AN001; + INT 21H ;AN001; + + OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit + MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL + INT 21H ;AN001; + + RET ;AN001; + +$M_CHECKSTDIN ENDP ;AN001; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;AN001; END of include for EOF Check + IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full? + ELSE ;AN001; Yes, THEN include it + PAGE + SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Proc Name: $M_CHECKSTDOUT +;; +;; Function: +;; +;; Inputs: None +;; +;; Outputs: +;; +;; Regs Changed: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_CHECKSTDOUT PROC NEAR ;AN001; + + MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL + MOV BX,STDOUT ;AN001; + XOR DX,DX ;AN001; + INT 21H ;AN001; + + OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit + MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL + INT 21H ;AN001; + + RET ;AN001; + +$M_CHECKSTDOUT ENDP ;AN001; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;AN001; END of include for Disk Full Check + IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check? + ELSE ;;AN000;; Yes, THEN include it + PAGE + SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Proc Name: $M_VERSION_CHECK +;; +;; Function: Determine if DOS version is within allowable limits +;; +;; Inputs: None +;; +;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version +;; Registers set for SYSDISPMSG +;; CARRY_FLAG = 0 if Correct DOS version +;; +;; Regs Changed: AX +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_VERSION_CHECK PROC NEAR ;;AN000;; + ;; + MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC + INT 21H ;;AN000;; + ;; + CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct +; $IF E ;;AN000;; + JNE $MIF25 + CLC ;;AN000;; Clear the carry flag +; $ELSE ;;AN000;; ELSE + JMP SHORT $MEN25 +$MIF25: +IF NOT COMR ;; ** Special case for RESIDENT COMMAND.COM + CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH +; $IF B ;;AN000;; No, + JNB $MIF27 + MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support) +; $ELSE ;;AN000;; Yes, + JMP SHORT $MEN27 +$MIF27: + MOV BX,STDERR ;;AN000;; Standard Error +; $ENDIF ;;AN000;; +$MEN27: +ELSE + MOV BX,NO_HANDLE ;;AN000;; No handle +ENDIF + MOV AX,1 ;;AN000;; Set message # 1 + MOV CX,NO_REPLACE ;;AN000;; No replacable parms + MOV DL,NO_INPUT ;;AN000;; No input + MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message + STC ;;AN000;; Set Carry Flag +; $ENDIF ;;AN000;; +$MEN25: + ;; + RET ;;AN000;; Return + ;; +$M_VERSION_CHECK ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include for DOS version check + ENDIF ;;AN000;; END of include for SYSLOADMSG +; + IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? + IF COMR ;;AN000;; + $M_RT EQU $M_RT2 ;;AN000;; + ENDIF ;;AN000;; + GETmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag + PAGE + SUBTTL DOS - Message Retriever - GETMSG.ASM Module +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Proc Name: SYSGETMSG +;; +;; Function: The GET service returns the segment, offset and size of the +;; message text to the caller based on a message number. +;; The GET function will not display the message thus assumes +;; caller will handle replaceable parameters. +;; +;; Inputs: +;; +;; Outputs: +;; +;; Psuedocode: +;; Call $M_GET_MSG_ADDRESS +;; IF MSG_NUM exists THEN +;; Set DS:SI = MSG_TXT_PTR + 1 +;; CARRY_FLAG = 0 +;; ELSE +;; CARRY_FLAG = 1 +;; ENDIF +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +IF FARmsg ;;AN000;; + SYSGETMSG PROC FAR ;;AN000;; +ELSE ;;AN000;; + SYSGETMSG PROC NEAR ;;AN000;; +ENDIF ;;AN000;; + ;; +;; Save registers needed later + + PUSH AX ;;AN000;; Save changed regs + PUSH ES ;;AN000;; + PUSH DI ;;AN000;; + PUSH BP ;;AN000;; + ;; +IF FARmsg ;;AN000;; + CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message +ELSE ;;AN000;; + CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message +ENDIF ;;AN000;; Return message in ES:DI +; $IF NC ;;AN000;; Message found? + JC $MIF31 + CMP DH,UTILITY_MSG_CLASS + CLC ;;AN000;; +; $IF NE + JE $MIF32 + PUSH ES ;;AN000;; + POP DS ;;AN000;; Return message in DS:SI +; $ELSE + JMP SHORT $MEN32 +$MIF32: +IF FARmsg ;;AN000;; Yes, + PUSH ES ;;AN000;; + POP DS ;;AN000;; Return message in DS:SI +ELSE ;;AN000;; + PUSH CS ;;AN000;; Return message in DS:SI + POP DS ;;AN000;; +ENDIF ;;AN000;; +; $ENDIF ;;AN000;; +$MEN32: + MOV SI,DI ;;AN000;; Return message in DS:SI +; $ENDIF ;;AN000;; +$MIF31: + ;; + POP BP ;;AN000;; Restore changed regs + POP DI ;;AN000;; + POP ES ;;AN000;; + POP AX ;;AN000;; + ;; + RET ;;AN000;; Return + ;; + SYSGETMSG ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet + $M_SUBS = FALSE ;;AN000;; No, then include and reset the flag +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_GET_MSG_ADDRESS +;; +;; FUNCTION: To scan thru classes to return pointer to the message header +;; INPUTS: Access to $M_RES_ADDRESSES +;; OUPUTS: IF CX = 0 THEN Message was not found +;; IF CX > 1 THEN ES:DI points to the specified message +;; REGS CHANGED: ES,DI,CX +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +IF FARmsg ;;AN000;; + $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; +ELSE ;;AN000;; + $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; +ENDIF ;;AN000;; + ;; + PUSH SI ;;AN000;; + PUSH BX ;;AN000;; + XOR SI,SI ;;AN000;; Use SI as an index + XOR CX,CX ;;AN000;; Use CX as an size +; $DO ;;AN000;; +$MDO36: + CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? +; $IF E ;;AN000;; Yes, + JNE $MIF37 + IF FARmsg ;;AN000;; + LES DI,DWORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class + MOV BX,ES ;;AN000; + ELSE ;;AN000;; + MOV DI,WORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class + MOV BX,DI ;;AN000; + ENDIF ;;AN000;; +; $ELSE ;;AN000;; No, + JMP SHORT $MEN37 +$MIF37: + TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? +; $IF NE ;;AN000;; Yes, + JE $MIF39 + LES DI,DWORD PTR $M_RT.$M_PARSE_COMMAND[SI] ;;AN000;; Get address of class + MOV BX,ES ;;AN000; +; $ELSE ;;AN000;; No, extended errors were specified + JMP SHORT $MEN39 +$MIF39: + CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? +; $IF AE,AND ;;AN000;; + JNAE $MIF41 + CMP AX,$M_CRIT_HI ;;AN000;; +; $IF BE ;;AN000;; Yes, + JNBE $MIF41 + LES DI,DWORD PTR $M_RT.$M_CRIT_ADDRS[SI] ;;AN000;; Get address of class + MOV BX,ES ;;AN000; +; $ELSE ;;AN000;; + JMP SHORT $MEN41 +$MIF41: + LES DI,DWORD PTR $M_RT.$M_EXT_ERR_ADDRS[SI] ;;AN000;; Get address of class + MOV BX,ES ;;AN000; +; $ENDIF ;;AN000;; +$MEN41: +; $ENDIF ;;AN000;; +$MEN39: +; $ENDIF ;;AN000;; +$MEN37: + ;; + CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? +; $IF E ;;AN000;; Yes, + JNE $MIF46 + CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? +; $IF E ;;AN000;; Yes, + JNE $MIF47 + STC ;;AN000;; Set the carry flag +; $ELSE ;;AN000;; No, + JMP SHORT $MEN47 +$MIF47: + MOV $M_RT.$M_MSG_NUM,AX ;;AN000;; Save message number + MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number + MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message + XOR SI,SI ;;AN000;; Reset the SI index to start again + CLC ;;AN000;; +; $ENDIF ;;AN000;; No, +$MEN47: +; $ELSE ;;AN000;; + JMP SHORT $MEN46 +$MIF46: + CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? +; $IF NE ;;AN001;; Yes, + JE $MIF51 + CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message +; $ENDIF ;;AN000;; +$MIF51: + ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class + CLC ;;AN000;; +; $ENDIF ;;AN000;; +$MEN46: +; $LEAVE C ;;AN000;; + JC $MEN36 + OR CX,CX ;;AN000;; Was the message found? +; $ENDDO NZ,LONG ;;AN000;; + JNZ $MXL2 + JMP $MDO36 +$MXL2: +$MEN36: + + PUSHF ;;AN006;; Save the flag state + CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? +; $IF E ;;AN006;; Yes, + JNE $MIF56 + PUSH DX ;;AN006;; Save all needed registers + PUSH BP ;;AN006;; + PUSH CX ;;AN006;; + PUSH ES ;;AN006;; + PUSH DI ;;AN006;; + PUSH AX ;;AN006;; + + MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed + INT 2FH ;;AN006;; + CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? + POP AX ;;AN006;; Restore msg number +; $IF E ;;AN006;; Yes, + JNE $MIF57 + MOV BX,AX ;;AN006;; BX is the extended error number + MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number + INT 2FH ;;AN006;; Call IFSFUNC +; $ELSE ;;AN006;; No, + JMP SHORT $MEN57 +$MIF57: + STC ;;AN006;; Carry conditon +; $ENDIF ;;AN006;; +$MEN57: + +; $IF C ;;AN006;; Was there an update? + JNC $MIF60 + POP DI ;;AN006;; No, + POP ES ;;AN006;; Restore old pointer + POP CX ;;AN006;; +; $ELSE ;;AN006;; Yes + JMP SHORT $MEN60 +$MIF60: + ADD SP,6 ;;AN006;; Throw away old pointer + CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string +; $ENDIF ;;AN006;; +$MEN60: + POP BP ;;AN006;; Restore other Regs + POP DX ;;AN006;; +; $ENDIF ;;AN006;; +$MIF56: + $M_POPF ;;AN006;; Restore the flag state + + POP BX ;;AN000;; + POP SI ;;AN000;; + RET ;;AN000;; Return ES:DI pointing to the message + ;; +$M_GET_MSG_ADDRESS ENDP ;; + ;; +$M_SET_LEN_IN_CX PROC NEAR ;; + ;; + PUSH DI ;;AN006;; Save position + PUSH AX ;;AN006;; + MOV CX,-1 ;;AN006;; Set CX for decrements + XOR AL,AL ;;AN006;; Prepare compare register + REPNE SCASB ;;AN006;; Scan for zero + NOT CX ;;AN006;; Change decrement into number + DEC CX ;;AN006;; Don't include the zero + POP AX ;;AN006;; + POP DI ;;AN006;; Restore position + RET ;;AN006;; + ;; +$M_SET_LEN_IN_CX ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_FIND_SPECIFIED_MSG +;; +;; FUNCTION: To scan thru message headers until message is found +;; INPUTS: ES:DI points to beginning of msg headers +;; CX contains the number of messages in class +;; DH contains the message class +;; OUPUTS: IF CX = 0 THEN Message was not found +;; IF CX > 1 THEN ES:DI points to header of specified message +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; + ;; + CMP BX,1 ;;AN004;; Do we have an address to CALL? +; $IF E,AND ;;AN004;; Yes, + JNE $MIF64 + CMP WORD PTR $M_RT.$M_DISK_PROC_ADDR,-1 ;;AN004;; Do we have an address to CALL? +; $IF NE ;;AN004;; Yes, + JE $MIF64 + CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? +; $IF E ;;AN004;; . . . and . . . + JNE $MIF65 + PUSH AX ;;AN004;; Reset the special message number + MOV AX,$M_RT.$M_MSG_NUM ;;AN004;; Get the old message number + CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text + POP AX ;;AN004;; Reset the special message number +; $ELSE ;;AN004;; Get the old message number + JMP SHORT $MEN65 +$MIF65: + CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text +; $ENDIF ;;AN004;; Get the old message number +$MEN65: +; $ELSE ;;AN004;; + JMP SHORT $MEN64 +$MIF64: + XOR CX,CX ;;AN002;; CX = 0 will allow us to + CMP DH,UTILITY_MSG_CLASS ;;AN001;; +; $IF NE ;;AN001;; + JE $MIF69 + MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN001;; Get number of messages in class +; $ELSE ;;AN001;; + JMP SHORT $MEN69 +$MIF69: +IF FARmsg ;;AN001;; + CMP BYTE PTR ES:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at +ELSE + CMP BYTE PTR CS:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at +ENDIF +; $IF E ;;AN002;; pointer (hopefully) + JNE $MIF71 +IF FARmsg ;;AN001;; + MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class +ELSE + MOV CL,BYTE PTR CS:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class +ENDIF +; $ENDIF ;;AN002;; go on to the next class +$MIF71: +; $ENDIF ;;AN001;; +$MEN69: + ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header + STC ;;AN004;; Flag that we haven't found anything yet +; $ENDIF ;;AN004;; +$MEN64: + +; $IF C ;;AN004;; Have we found anything yet? + JNC $MIF75 + CLC ;;AN004;; No, reset carry +; $SEARCH ;;AN000;; +$MDO76: + OR CX,CX ;;AN000;; Do we have any to check? +; $LEAVE Z ;;AN000;; No, return with CX = 0 + JZ $MEN76 + CMP DH,UTILITY_MSG_CLASS ;;AN001;; +; $IF NE ;;AN001;; + JE $MIF78 + CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN001;; Is this the message requested? +; $ELSE ;;AN001;; + JMP SHORT $MEN78 +$MIF78: +IF FARmsg ;;AN001;; + CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN000;; Is this the message requested? +ELSE + CMP AX,WORD PTR CS:[DI].$M_NUM ;;AN000;; Is this the message requested? +ENDIF +; $ENDIF +$MEN78: +; $EXITIF E ;;AN000;; + JNE $MIF76 +; $ORELSE ;;AN000; + JMP SHORT $MSR76 +$MIF76: + DEC CX ;;AN000;; No, well do we have more to check? +; $LEAVE Z ;;AN000;; No, return with CX = 0 + JZ $MEN76 + ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header +; $ENDLOOP ;;AN000;; + JMP SHORT $MDO76 +$MEN76: + STC ;;AN000;; +; $ENDSRCH ;;AN000;; Check next message +$MSR76: +; $IF NC ;;AN000;; Did we find the message? + JC $MIF86 + CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? + CLC ;;AN001;; +; $IF E ;;AN001;; + JNE $MIF87 +IF FARmsg ;;AN001;; +ELSE ;;AN000;; + PUSH CS ;;AN000;; + POP ES ;;AN000;; Return ES:DI pointing to the message +ENDIF +; $ENDIF ;;AN001;; +$MIF87: + ADD DI,WORD PTR ES:[DI].$M_TXT_PTR ;;AN000;; Prepare ES:DI pointing to the message +; $ENDIF ;;AN004;; +$MIF86: +; $ENDIF ;;AN004;; +$MIF75: + ;; Yes, great we can return with CX > 0 + +; $IF NC ;;AN000;; Did we find the message? + JC $MIF91 + XOR CH,CH ;;AN000;; + MOV CL,BYTE PTR ES:[DI] ;;AN000;; Move size into CX + INC DI ;;AN000;; Increment past length +; $ENDIF ;;AN004;; +$MIF91: + + MOV $M_RT.$M_SIZE,$M_NULL ;;AN004;; Reset variable + RET ;;AN000;; Return + ;; +$M_FIND_SPECIFIED_MSG ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include of common subroutines + ENDIF ;;AN000;; END of include of SYSGETMSG +; + IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ? + IF COMR ;;AN000;; + $M_RT EQU $M_RT2 ;;AN000;; + ENDIF ;;AN000;; + DISPLAYmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag + PAGE + SUBTTL DOS - Message Retriever - DISPMSG.ASM Module +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Proc Name: SYSDISPMSG +;; +;; Function: The DISPLAY service will output a defined message to a handle +;; requested by the caller. It also provides function to display +;; messages when handles are not applicable (ie. DOS function calls +;; 00h to 0Ah) Replaceable parameters are allowed and are +;; defined previous to entry. +;; +;; It is assumes that a PRELOAD function has already determined +;; the addressibilty internally to the message retriever services. +;; Inputs: +;; +;; Outputs: +;; +;; Psuedocode: +;; Save registers needed later +;; Get address of the message requested +;; IF Message number exists THEN +;; IF replacable parameters were specified THEN +;; Display message with replacable parms +;; ELSE +;; Display string without replacable parms +;; ENDIF +;; IF character input was requested THEN +;; Wait for character input +;; ENDIF +;; Clear CARRY FLAG +;; ELSE +;; Set CARRY FLAG +;; ENDIF +;; Return +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +IF FARmsg ;;AN000;; + SYSDISPMSG PROC FAR ;;AN000;; +ELSE ;;AN000;; + SYSDISPMSG PROC NEAR ;;AN000;; +ENDIF ;;AN000;; + ;; +;; Save registers and values needed later + + PUSH AX ;;AN000;; Save changed REGs + PUSH BX ;;AN000;; + PUSH CX ;;AN000;; + PUSH BP ;;AN000;; + PUSH DI ;;AN000;; Save pointer to input buffer (offset) + PUSH ES ;;AN000;; Save pointer to input buffer (segment) + PUSH DX ;;AN000;; Save Input/Class request + + MOV BP,CX ;;AN000;; Use BP to hold replace count + MOV WORD PTR $M_RT.$M_HANDLE,BX ;;AN000;; Save handle + MOV BYTE PTR $M_RT.$M_CLASS,DH ;;AN004;; Save class + +;; Get address of the message requested + +IF FARmsg ;;AN000;; + CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message +ELSE ;;AN000;; + CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message +ENDIF ;;AN000;; + OR CX,CX ;;AN000;; Was message found? +; $IF NZ ;;AN000;; YES, Message address in ES:DI + JZ $MIF93 + +;; Test if replacable parameters were specified + + OR BP,BP ;;AN000;; Were replacable parameters requested +; $IF Z ;;AN000;; + JNZ $MIF94 + +;; Display string without replacable parms + + CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message +; $ELSE ;;AN000;; + JMP SHORT $MEN94 +$MIF94: +IF $M_REPLACE ;;AN000;; + +;; Display message with replacable parms + + CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions +ENDIF ;;AN000;; +; $ENDIF ;;AN000;; +$MEN94: +; $IF NC + JC $MIF97 + + POP DX ;;AN000;; Get Input/Class request + + CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. + + POP ES ;;AN000;; Get location of input buffer (if specified) + POP DI ;;AN000;; + +;; Test if character input was requested + +IF INPUTmsg ;;AN000;; + OR DL,DL ;;AN000;; Was Wait-For-Input requested? +; $IF NZ ;;AN000;; + JZ $MIF98 + CALL $M_WAIT_FOR_INPUT ;;AN000;; +; $ENDIF ;;AN000;; +$MIF98: +ENDIF ;;AN000;; +; $ELSE ;;AN000;; + JMP SHORT $MEN97 +$MIF97: + ADD SP,6 ;;AN000;; + STC ;;AN000;; Reset carry flag +; $ENDIF ;;AN000;; +$MEN97: +; $ELSE ;;AN000;; No, + JMP SHORT $MEN93 +$MIF93: + POP ES ;;AN000;; Get pointer to input buffer (segment) + POP DI ;;AN000;; Get base pointer to first sublist (offset) + POP DX ;;AN000;; Get base pointer to first sublist (segment) + STC ;;AN000;; Set carry flag +; $ENDIF ;;AN000;; +$MEN93: + ;; +; $IF NC ;;AN000;; Was there an error? + JC $MIF104 + POP BP ;;AN000;; No, + POP CX ;;AN000;; + POP BX ;;AN000;; +IF INPUTmsg ;;AN000;; + ADD SP,2 ;;AN000;; +ELSE ;AN000; + POP AX ;;AN000;; +ENDIF ;;AN000;; +; $ELSE ;;AN000;; Yes, + JMP SHORT $MEN104 +$MIF104: + ADD SP,8 ;;AN000;; Eliminate from stack + STC ;;AN000;; +; $ENDIF ;;AN000;; +$MEN104: + ;; + RET ;;AN000;; Return + ;; + SYSDISPMSG ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +;; +;; PROC NAME: $M_DISPLAY_STRING +;; +;; FUNCTION: Will display or write string +;; INPUTS: ES:DI points to beginning of message +;; CX contains the length of string to write (if applicable) +;; OUTPUTS: None +;; REGS Revised: None +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_DISPLAY_STRING PROC NEAR ;;AN000;; + ;; + PUSH AX ;;AN000;; + PUSH BX ;;AN000;; + PUSH DX ;;AN000;; + ;; + MOV BX,$M_RT.$M_HANDLE ;;AN000;; Retrieve handle + ;; +IF COMR ;; ** Special case for RESIDENT COMMAND.COM + CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string +ELSE + CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? +; $IF E ;;AN000;; + JNE $MIF107 + CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string +; $ELSE ;;AN000;; + JMP SHORT $MEN107 +$MIF107: + CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle +; $ENDIF ;;AN000;; +$MEN107: + ;AN001; +; $IF C ;;AN000;; Was there an error? + JNC $MIF110 + MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes, + MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error + INT 21H ;;AN000;; + XOR AH,AH ;;AN000;; Clear AH + ADD SP,6 ;;AN000;; Clean up stack + STC ;;AN000;; Flag that there was an error +; $ELSE ;;AN000;; No, + JMP SHORT $MEN110 +$MIF110: + CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified? +; $IF NE ;;AN000;; + JE $MIF112 + CMP AX,CX ;AN001; Was it ALL written? +; $IF NE ;AN001; No, + JE $MIF113 + CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error + ADD SP,6 ;AN001; Clean up stack + STC ;AN001; Flag that there was an error +; $ENDIF ;AN001; +$MIF113: +; $ENDIF ;AN001; +$MIF112: +; $ENDIF ;;AN000;; +$MEN110: +ENDIF +; $IF NC ;;AN000;; Was there ANY error? + JC $MIF117 + POP DX ;;AN000;; Restore regs + POP BX ;;AN000;; + POP AX ;;AN000;; +; $ENDIF ;;AN000;; +$MIF117: + RET ;;AN000;; Return + ;; +$M_DISPLAY_STRING ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_DISPLAY_$_STRING +;; +;; FUNCTION: Will display a $ terminated string +;; INPUTS: ES:DI points to beginning of message text (not the length) +;; OUPUTS: None +;; REGS USED: AX,DX +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_DISPLAY_$_STRING PROC NEAR ;;AN000;; + ;; + PUSH DS ;;AN000;; + PUSH ES ;;AN000;; + POP DS ;;AN000;; Set DS to segment of message text +IF NOT COMR + CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? +; $IF E ;;AN000;; Yes, + JNE $MIF119 + MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER + MOV DL,BYTE PTR ES:[DI] ;;AN000;; Get the character + INT 21H ;;AN000;; Write character + POP DS ;;AN000;; Set DS to segment of message text + MOV AL,DL ;;AN000;; Get the character in AL + CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character + PUSH DS ;;AN000;; + PUSH ES ;;AN000;; + POP DS ;;AN000;; Set DS to segment of message text +; $IF C ;;AN000;; Yes, + JNC $MIF120 + MOV DL,BYTE PTR ES:[DI]+1 ;;AN000;; Get the next character + INT 21H ;;AN000;; Write character + CLC ;;AN000;; Clear the DBCS indicator +; $ENDIF ;;AN000;; +$MIF120: +; $ELSE ;;AN000;; No, + JMP SHORT $MEN119 +$MIF119: +ENDIF + MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER +; $DO ;;AN002;; No, +$MDO123: + OR CX,CX ;;AN002;; Are there any left to display? +; $LEAVE Z ;;AN002;; Yes, + JZ $MEN123 + MOV DL,BYTE PTR ES:[DI] ;;AN002;; Get the character + INT 21H ;;AN002;; Display the character + INC DI ;;AN002;; Set pointer to next character + DEC CX ;;AN002;; Count this character +; $ENDDO Z ;;AN002;; No, + JNZ $MDO123 +$MEN123: +IF NOT COMR +; $ENDIF ;;AN000;; +$MEN119: +ENDIF + CLC ;;AN000;; Char functions used don't return carry as error + POP DS ;;AN000;; + RET ;;AN000;; + ;; +$M_DISPLAY_$_STRING ENDP ;;AN000;; + ;; +IF NOT COMR +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_DISPLAY_H_STRING +;; +;; FUNCTION: Will display a string to a specified handle +;; INPUTS: ES:DI points to beginning of message +;; CX contains the number of bytes to write +;; BX contains the handle to write to +;; OUPUTS: None +;; REGS USED: AX,DX +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_DISPLAY_H_STRING PROC NEAR ;;AN000;; + ;; + XOR AX,AX ;;AN002;; Set number of bytes written to 0 + OR CX,CX ;;AN002;; For performance, don't write if not necessary +; $IF NZ ;;AN002;; Any chars to write? + JZ $MIF127 + PUSH DS ;;AN000;; Yes, + PUSH ES ;;AN000;; + POP DS ;;AN000;; Set DS to segment of message text + MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle + MOV DX,DI ;;AN000;; Pointer to data to write + CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character? +; $IF E ;;AN000;; Yes, + JNE $MIF128 + INT 21H ;;AN000;; Write character + POP DS ;;AN000;; Set DS to segment of message text + PUSH AX ;;AN000;; + MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character + CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character + POP AX ;;AN000;; Set DS to segment of message text + PUSH DS ;;AN000;; + PUSH ES ;;AN000;; + POP DS ;;AN000;; Set DS to segment of message text +; $IF C ;;AN000;; Yes, + JNC $MIF129 + CLC ;;AN000;; Clear the DBCS indicator + MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle + INC DX ;;AN000;; Point to next character + INT 21H ;;AN000;; Write character +; $ENDIF ;;AN000;; +$MIF129: +; $ELSE ;;AN000;; No, + JMP SHORT $MEN128 +$MIF128: + INT 21H ;;AN000;; Write String at DS:SI to handle +; $ENDIF ;;AN000;; +$MEN128: + POP DS ;;AN000;; +; $ENDIF ;;AN002;; +$MIF127: + ;; + RET ;;AN000;; + ;; +$M_DISPLAY_H_STRING ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_GET_EXT_ERR_39 +;; +;; FUNCTION: Will set registers for extended error #39 +;; INPUTS: None +;; OUPUTS: AX,BX,CX set +;; REGS USED: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_GET_EXT_ERR_39 PROC NEAR ;AN001; + ;; + MOV AX,EXT_ERR_39 ;AN001; Set AX=39 + MOV BX,(ERROR_CLASS_39 SHR 8) + ACTION_39 ;AN001; Set BH=1 BL=4 + MOV CH,LOCUS_39 ;AN001; Set CH=1 + ;AN001; + RET ;AN001; + ;; +$M_GET_EXT_ERR_39 ENDP ;AN001; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ENDIF +;; +;; PROC NAME: $M_ADD_CRLF +;; +;; FUNCTION: Will decide whether to display a CRLF +;; INPUTS: DX contains the Input/Class requested +;; OUTPUTS: None +;; REGS Revised: CX,ES,DI +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_ADD_CRLF PROC NEAR ;;AN004;; + ;; + CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? +; $IF NE ;;AN004;; No, + JE $MIF134 + TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? +; $IF Z ;;AN004;; No, + JNZ $MIF135 + PUSH DS ;;AN004;; + POP ES ;;AN004;; Set ES to data segment + LEA DI,$M_RT.$M_CRLF ;;AN004;; Point at CRLF message + MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size + CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF +; $ENDIF ;;AN004;; +$MIF135: +; $ENDIF ;;AN004;; +$MIF134: + RET ;;AN004;; Return + ;; +$M_ADD_CRLF ENDP ;;AN004;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_IS_IT_DBCS +;; +;; FUNCTION: Will decide whether character is Single or Double Byte +;; INPUTS: AL contains the byte to be checked +;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range +;; Carry flag = 1 if byte IS in DBCS range +;; REGS USED: All restored +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_IS_IT_DBCS PROC NEAR ;;AN000;; + ;; + PUSH ES ;;AN000;; Save Extra segment register + PUSH DI ;;AN000;; Save SI register + ;; + LES DI,$M_RT.$M_DBCS_VEC ;;AN000;; + OR DI,DI ;;AN000;; Was the DBCS vector set? +; $IF NZ ;;AN000;; + JZ $MIF138 +; $DO ;;AN000;; +$MDO139: + CMP WORD PTR ES:[DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag? + CLC ;;AN000;; +; $LEAVE E ;;AN000;; + JE $MEN139 + ;; No, + CMP AL,BYTE PTR ES:[DI] ;;AN000;; Does the character fall in the DBCS range? +; $IF AE,AND ;;AN000;; + JNAE $MIF141 + CMP AL,BYTE PTR ES:[DI]+1 ;;AN000;; Does the character fall in the DBCS range? +; $IF BE ;;AN000;; + JNBE $MIF141 + STC ;;AN000;; Yes, +; $ENDIF ;;AN000;; Set carry flag +$MIF141: + INC DI ;;AN000;; No, + INC DI ;;AN000;; Go to next vector +; $ENDDO ;;AN000;; + JMP SHORT $MDO139 +$MEN139: +; $ENDIF ;;AN000;; +$MIF138: + + POP DI ;;AN000;; + POP ES ;;AN000;; Restore SI register + RET ;;AN000;; Return + ;; +$M_IS_IT_DBCS ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_CONVERT2ASC +;; +;; FUNCTION: Convert a binary number to a ASCII string +;; INPUTS: DX:AX contains the number to be converted +;; $M_RT_DIVISOR contains the divisor +;; OUPUTS: CX contains the number of characters +;; Top of stack --> Last character +;; . . . +;; Bot of stack --> First character +;; REGS USED: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_CONVERT2ASC PROC NEAR ;;AN000;; + ;; + POP [$M_RT.$M_RETURN_ADDR] ;;AN000;; Save Return Address + XOR BX,BX ;;AN000;; Use BP as a swapping register + ;; + XCHG BX,AX ;;AN000;; Initialize - Low Word in BP + XCHG AX,DX ;;AN000;; - High Word in AX +; $DO ;;AN000;; DO UNTIL Low Word becomes zero +$MDO145: + DIV $M_RT.$M_DIVISOR ;;AN000;; Divide High Word by divisor + XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder + ;; and save reduced High Word in BP + DIV $M_RT.$M_DIVISOR ;;AN000;; Divide Low Word by divisor + CMP DX,9 ;;AN000;; Make a digit of the remainder +; $IF A ;;AN000;; IF 10 to 15, + JNA $MIF146 + ADD DL,55 ;;AN000;; Make A to F ASCII +; $ELSE ;;AN000;; IF 0 to 9, + JMP SHORT $MEN146 +$MIF146: + ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII +; $ENDIF ;;AN000;; +$MEN146: + PUSH DX ;;AN000;; Save the digit on the stack + INC CX ;;AN000;; Count that digit + OR AX,AX ;;AN000;; Are we done? +; $LEAVE Z,AND ;;AN000;; + JNZ $MLL149 + OR BX,BX ;;AN000;; AX and BX must be ZERO!! +; $LEAVE Z ;;AN000;; No, + JZ $MEN145 +$MLL149: +IF NOT COMR + CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark +; $IF E ;;AN000;; Yes, + JNE $MIF150 + CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? +; $IF E ;;AN000;; Yes, + JNE $MIF151 + PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator + INC CX ;;AN000;; +; $ENDIF ;;AN000;; +$MIF151: +; $ELSE ;;AN000;; No, + JMP SHORT $MEN150 +$MIF150: + CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark +; $IF E ;;AN000;; Yes, + JNE $MIF154 + CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? +; $IF E ;;AN000;; Yes, + JNE $MIF155 + PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator + INC CX ;;AN000;; +; $ENDIF ;;AN000;; +$MIF155: +; $ELSE ;;AN000;; No, + JMP SHORT $MEN154 +$MIF154: + CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark +; $IF E ;;AN000;; Yes, + JNE $MIF158 + CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? +; $IF E ;;AN000;; Yes, + JNE $MIF159 + PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator + INC CX ;;AN000;; +; $ENDIF ;;AN000;; +$MIF159: +; $ENDIF ;;AN000;; +$MIF158: +; $ENDIF ;;AN000;; +$MEN154: +; $ENDIF ;;AN000;; +$MEN150: +ENDIF + XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word + ;;AN000;; and Revised Low Word + XOR DX,DX ;;AN000;; Reset remainder +; $ENDDO ;;AN000;; NEXT + JMP SHORT $MDO145 +$MEN145: + ;;AN000;; Yes, + XOR DX,DX ;;AN000;; Reset remainder + XOR AX,AX ;;AN000;; Reset remainder + PUSH [$M_RT.$M_RETURN_ADDR] ;;AN000;; Restore Return Address + RET ;;AN000;; Return + ;; +$M_CONVERT2ASC ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_DISPLAY_MESSAGE +;; +;; FUNCTION: Will display or write entire message (with replacable parameters) +;; INPUTS: ES:DI points to beginning of message +;; DS:SI points to first sublist structure in chain +;; BX contains the handle to write to (if applicable) +;; CX contains the length of string to write (before substitutions) +;; BP contains the count of replacables +;; +;; OUTPUTS: +;; REGS USED: All +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_DISPLAY_MESSAGE PROC NEAR ;;AN000;; + ;; +; $DO ;;AN000;; Note: DS:SI -> message +$MDO165: + XOR DX,DX ;;AN000;; Set size = 0 + OR CX,CX ;;AN000;; Are we finished the message yet? +; $IF NZ ;;AN000;; No, + JZ $MIF166 + MOV AH,"%" ;;AN000;; Prepare to scan for % + MOV AL,0 ;;AN004;; + ;; +; $DO ;;AN000;; Scan through string until % +$MDO167: + CMP BYTE PTR ES:[DI],AH ;;AN000;; Is this character NOT a % +; $LEAVE E,AND ;;AN000;; No, + JNE $MLL168 + CMP BYTE PTR ES:[DI+1],AH ;;AN000;; Is the next character also a % +; $LEAVE NE,AND ;;AN000;; No, + JE $MLL168 + CMP AL,AH ;;AN000;; Was the character before a % +; $LEAVE NE ;;AN000;; No, GREAT found it + JNE $MEN167 +$MLL168: + MOV AL,BYTE PTR ES:[DI] ;;AN004;; Yes, (to any of the above) + CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? +; $IF C ;;AN004;; Yes, + JNC $MIF169 + INC DI ;;AN004;; Increment past second part +; $ENDIF ;;AN004;; +$MIF169: + INC DI ;;AN000;; Next character in string + INC DX ;;AN000;; Size = Size + 1 + DEC CX ;;AN000;; Decrement total size +; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line + JNZ $MDO167 +$MEN167: +; $ENDIF ;;AN000;; +$MIF166: + ;; + PUSH SI ;;AN000;; Save beginning of sublists + XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX) + OR BP,BP ;;AN000;; Do we have any replacables to do? +; $IF NZ ;;AN000;; Yes, + JZ $MIF173 + DEC BP ;;AN000;; Decrement number of replacables + +;; Search through sublists to find applicable one + + CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case +; $IF E ;;AN000;; No, + JNE $MIF174 +; $SEARCH ;;AN000;; +$MDO175: + MOV AL,$M_SL.$M_S_ID ;;AN000;; Get ID byte + ADD AL,30H ;;AN000;; Convert to ASCII + CMP AL,BYTE PTR ES:[DI]+1 ;;AN000;; Is this the right sublist? +; $EXITIF E ;;AN000;; + JNE $MIF175 +; $ORELSE ;;AN000;; No, + JMP SHORT $MSR175 +$MIF175: + CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 +; $LEAVE E,AND ;;AN000;; Yes, + JNE $MLL178 + OR DX,DX ;;AN000;; Are we at the end of the message? +; $LEAVE Z ;;AN000;; No, + JZ $MEN175 +$MLL178: + ADD SI,WORD PTR $M_SL.$M_S_SIZE ;;AN000;; Next SUBLIST +; $ENDLOOP ;;AN000;; Yes, + JMP SHORT $MDO175 +$MEN175: + CMP $M_RT.$M_CLASS,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message? +; $IF E ;;AN004;; Yes, + JNE $MIF180 + INC DX ;;AN000;; Remember to display CR,LF + INC DX ;;AN000;; at the end of the message + DEC CX ;;AN000;; Adjust message length + DEC CX ;;AN000;; + DEC DI ;;AN000;; Adjust ending address of message + DEC DI ;;AN000;; +; $ELSE ;;AN004;; No, + JMP SHORT $MEN180 +$MIF180: + MOV DX,-1 ;;AN004;; Set special case +; $ENDIF ;;AN004;; +$MEN180: +; $ENDSRCH ;;AN000;; +$MSR175: +; $ENDIF ;;AN000;; +$MIF174: +; $ENDIF ;;AN000;; +$MIF173: + +;; Prepare and display this part of message + + PUSH DI ;;AN000;; Save pointer to replace number + SUB DI,CX ;;AN000;; Determine beginning of string + CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) + POP DI ;;AN000;; Get back pointer to replace number + POP CX ;;AN000;; Clean up stack in case error +; $LEAVE C,LONG ;;AN000;; Fail if carry was set + JNC $MXL3 + JMP $MEN165 +$MXL3: + PUSH CX ;;AN000;; + +;; Save and reset pointer registers + + MOV CX,DX ;;AN000;; Get the size of the rest of the message + CMP $M_SL.$M_S_ID,$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case? +; $IF NE ;;AN000;; No, + JE $MIF187 + OR CX,CX ;;AN000;; Are we finished the whole message? +; $IF NZ ;;AN000;; No, + JZ $MIF188 + DEC CX ;;AN000;; Decrement total size (%) + DEC CX ;;AN000;; Decrement total size (#) + INC DI ;;AN000;; Go past % + INC DI ;;AN000;; Go past replace number +; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) + JMP SHORT $MEN188 +$MIF188: + POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs +; $ENDIF ;;AN000;; Yes, Note this will not leave because INC +$MEN188: +; $ELSE ;;AN000;; + JMP SHORT $MEN187 +$MIF187: + OR CX,CX ;;AN000;; Are we finished the whole message? +; $IF Z ;;AN004;; No, + JNZ $MIF192 + POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs +; $ELSE ;;AN000;; No, + JMP SHORT $MEN192 +$MIF192: + CMP CX,-1 ;;AN004;; Are we at the end of the message? +; $IF Z ;;AN004;; No, + JNZ $MIF194 + XOR CX,CX ;;AN004;; +; $ENDIF ;;AN000;; +$MIF194: + OR DI,DI ;;AN004;; Turn ZF off +; $ENDIF ;;AN000;; +$MEN192: +; $ENDIF ;;AN000;; Note this will not leave because INC +$MEN187: +; $LEAVE Z ;;AN000;; + JZ $MEN165 + PUSH BP ;;AN000;; Save the replace count + PUSH DI ;;AN000;; Save location to complete message + PUSH ES ;;AN000;; + PUSH CX ;;AN000;; Save size of the rest of the message + XOR CX,CX ;;AN000;; Reset CX used for character count + +;; Determine what action is required on parameter + + CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case +; $IF E ;;AN000;; + JNE $MIF199 + +IF CHARmsg ;;AN000;; Was Char specified? + TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;; +; $IF Z ;;AN000;; + JNZ $MIF200 + +;; Character type requested + ;;AN000;; + LES DI,DWORD PTR $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter + CALL $M_CHAR_REPLACE ;;AN000;; +; $ELSE ;;AN000;; Get the rest of the message to display + JMP SHORT $MEN200 +$MIF200: +ENDIF ;;AN000;; +IF NUMmsg ;;AN000;; Was Nnmeric type specified? + TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; +; $IF Z,OR ;;AN000;; + JZ $MLL202 + TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; +; $IF Z,OR ;;AN000;; + JZ $MLL202 + TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Bin_Hex_Type AND $M_TYPE_MASK ;;AN000;; +; $IF Z ;;AN000;; + JNZ $MIF202 +$MLL202: + +;; Numeric type requested + + LES DI,DWORD PTR $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter + CALL $M_BIN2ASC_REPLACE ;;AN000;; +; $ELSE ;;AN000;; Get the rest of the message to display + JMP SHORT $MEN202 +$MIF202: +ENDIF ;;AN000;; +IF DATEmsg ;;AN000;; Was date specified? + TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Date_Type AND $M_TYPE_MASK ;;AN000;; +; $IF E ;;AN000;; + JNE $MIF204 + +;; Date type requested + + CALL $M_DATE_REPLACE ;;AN000;; +; $ELSE ;;AN000;; Get the rest of the message to display + JMP SHORT $MEN204 +$MIF204: +ENDIF ;;AN000;; +IF TIMEmsg ;;AN000;; Was time (12 hour format) specified? + +;; Time type requested (Default if we have not matched until here) + + CALL $M_TIME_REPLACE ;;AN000;; +ENDIF ;;AN000;; + +IF DATEmsg ;;AN000;; +; $ENDIF ;;AN000;; +$MEN204: +ENDIF ;;AN000;; +IF NUMmsg ;;AN000;; +; $ENDIF ;;AN000;; +$MEN202: +ENDIF ;;AN000;; +IF CHARmsg ;;AN000;; +; $ENDIF ;;AN000;; +$MEN200: +ENDIF ;;AN000;; + +IF $M_REPLACE ;;AN000;; +;; With the replace information of the Stack, display the replaceable field + + CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace +ENDIF ;;AN000;; +;; None of the above - Extended/Parse replace +; $ELSE ;;AN000;; + JMP SHORT $MEN199 +$MIF199: +IF NOT COMR + CALL $M_EXT_PAR_REPLACE ;;AN000;; +ENDIF +; $ENDIF ;;AN000;; +$MEN199: + +;; We must go back and complete the message after the replacable parameter if there is any left + +; $IF NC ;;AN000;; IF there was an error displaying then EXIT + JC $MIF211 + POP CX ;;AN000;; Get size of the rest of the message + POP ES ;;AN000;; Get address of the rest of the message + POP DI ;;AN000;; + POP BP ;;AN000;; Get replacment count + POP SI ;;AN000;; ELSE get address of first sublist structure +; $ELSE ;;AN000;; + JMP SHORT $MEN211 +$MIF211: + ADD SP,10 ;;AN000;; Clean up stack if error + STC ;;AN000;; +; $ENDIF ;;AN000;; +$MEN211: + CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case +; $ENDDO NE,OR ;;AN000;; + JNE $MLL214 +; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message + JC $MXL4 + JMP $MDO165 +$MXL4: +$MLL214: +$MEN165: + ;; IF there was an error displaying then EXIT + MOV $M_RT.$M_MSG_NUM,0 ;;AN000;; Reset message number to null + RET ;;AN000;; Return + ;; +$M_DISPLAY_MESSAGE ENDP ;;AN000;; +IF NOT COMR +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_EXT_PAR_REPLACE +;; +;; FUNCTION: +;; INPUTS: +;; OUPUTS: +;; +;; REGS USED: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_EXT_PAR_REPLACE PROC NEAR ;;AN000;; + ;; + XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) + MOV AX,$M_RT.$M_MSG_NUM ;;AN000;; Prepare for get binary value (LOW) + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor + ;; + CALL $M_CONVERT2ASC ;;AN000;; + ;; +; $DO ;;AN000;; +$MDO215: + POP AX ;;AN000;; Get character in register + MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move char into the buffer + INC BX ;;AN000;; Increase buffer count + CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? +; $IF E ;;AN000;; Yes, + JNE $MIF216 + CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer +; $ENDIF ;;AN000;; +$MIF216: + DEC CL ;;AN000;; Have we completed replace? +; $ENDDO Z ;;AN000;; + JNZ $MDO215 + ;; + MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer + MOV WORD PTR $M_RT.$M_TEMP_BUF[BX],AX ;;AN000;; Move char into the buffer + INC BX ;;AN000;; Increase buffer count + INC BX ;;AN000;; Increase buffer count + CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer + RET ;;AN000:: + ;; +$M_EXT_PAR_REPLACE ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ENDIF + IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet + $M_SUBS = FALSE ;;AN000;; No, then include and reset the flag +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_GET_MSG_ADDRESS +;; +;; FUNCTION: To scan thru classes to return pointer to the message header +;; INPUTS: Access to $M_RES_ADDRESSES +;; OUPUTS: IF CX = 0 THEN Message was not found +;; IF CX > 1 THEN DS:SI points to the specified message +;; REGS CHANGED: ES,DI,CX,DS,SI +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +IF FARmsg ;;AN000;; + $M_GET_MSG_ADDRESS PROC FAR ;;AN000;; +ELSE ;;AN000;; + $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;; +ENDIF ;;AN000;; + ;; + PUSH SI ;;AN000;; + PUSH BX ;;AN000;; + XOR SI,SI ;;AN000;; Use SI as an index + XOR CX,CX ;;AN000;; Use CX as an size +; $DO ;;AN000;; +$MDO219: + CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested? +; $IF E ;;AN000;; Yes, + JNE $MIF220 + IF FARmsg ;;AN000;; + LES DI,DWORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class + MOV BX,ES ;;AN000; + ELSE ;;AN000;; + MOV DI,WORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class + MOV BX,DI ;;AN000; + ENDIF ;;AN000;; +; $ELSE ;;AN000;; No, + JMP SHORT $MEN220 +$MIF220: + TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested? +; $IF NE ;;AN000;; Yes, + JE $MIF222 + LES DI,DWORD PTR $M_RT.$M_PARSE_COMMAND[SI] ;;AN000;; Get address of class + MOV BX,ES ;;AN000; +; $ELSE ;;AN000;; No, extended errors were specified + JMP SHORT $MEN222 +$MIF222: + CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error? +; $IF AE,AND ;;AN000;; + JNAE $MIF224 + CMP AX,$M_CRIT_HI ;;AN000;; +; $IF BE ;;AN000;; Yes, + JNBE $MIF224 + LES DI,DWORD PTR $M_RT.$M_CRIT_ADDRS[SI] ;;AN000;; Get address of class + MOV BX,ES ;;AN000; +; $ELSE ;;AN000;; + JMP SHORT $MEN224 +$MIF224: + LES DI,DWORD PTR $M_RT.$M_EXT_ERR_ADDRS[SI] ;;AN000;; Get address of class + MOV BX,ES ;;AN000; +; $ENDIF ;;AN000;; +$MEN224: +; $ENDIF ;;AN000;; +$MEN222: +; $ENDIF ;;AN000;; +$MEN220: + ;; + CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? +; $IF E ;;AN000;; Yes, + JNE $MIF229 + CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class? +; $IF E ;;AN000;; Yes, + JNE $MIF230 + STC ;;AN000;; Set the carry flag +; $ELSE ;;AN000;; No, + JMP SHORT $MEN230 +$MIF230: + MOV $M_RT.$M_MSG_NUM,AX ;;AN000;; Save message number + MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number + MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message + XOR SI,SI ;;AN000;; Reset the SI index to start again + CLC ;;AN000;; +; $ENDIF ;;AN000;; No, +$MEN230: +; $ELSE ;;AN000;; + JMP SHORT $MEN229 +$MIF229: + CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? +; $IF NE ;;AN001;; Yes, + JE $MIF234 + CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message +; $ENDIF ;;AN000;; +$MIF234: + ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class + CLC ;;AN000;; +; $ENDIF ;;AN000;; +$MEN229: +; $LEAVE C ;;AN000;; + JC $MEN219 + OR CX,CX ;;AN000;; Was the message found? +; $ENDDO NZ,LONG ;;AN000;; + JNZ $MXL5 + JMP $MDO219 +$MXL5: +$MEN219: + + PUSHF ;;AN006;; Save the flag state + CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested? +; $IF E ;;AN006;; Yes, + JNE $MIF239 + PUSH DX ;;AN006;; Save all needed registers + PUSH BP ;;AN006;; + PUSH CX ;;AN006;; + PUSH ES ;;AN006;; + PUSH DI ;;AN006;; + PUSH AX ;;AN006;; + + MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed + INT 2FH ;;AN006;; + CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed? + POP AX ;;AN006;; Restore msg number +; $IF E ;;AN006;; Yes, + JNE $MIF240 + MOV BX,AX ;;AN006;; BX is the extended error number + MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number + INT 2FH ;;AN006;; Call IFSFUNC +; $ELSE ;;AN006;; No, + JMP SHORT $MEN240 +$MIF240: + STC ;;AN006;; Carry conditon +; $ENDIF ;;AN006;; +$MEN240: + +; $IF C ;;AN006;; Was there an update? + JNC $MIF243 + POP DI ;;AN006;; No, + POP ES ;;AN006;; Restore old pointer + POP CX ;;AN006;; +; $ELSE ;;AN006;; Yes + JMP SHORT $MEN243 +$MIF243: + ADD SP,6 ;;AN006;; Throw away old pointer + CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string +; $ENDIF ;;AN006;; +$MEN243: + POP BP ;;AN006;; Restore other Regs + POP DX ;;AN006;; +; $ENDIF ;;AN006;; +$MIF239: + $M_POPF ;;AN006;; Restore the flag state + + POP BX ;;AN000;; + POP SI ;;AN000;; + RET ;;AN000;; Return ES:DI pointing to the message + ;; +$M_GET_MSG_ADDRESS ENDP ;; + ;; +$M_SET_LEN_IN_CX PROC NEAR ;; + ;; + PUSH DI ;;AN006;; Save position + PUSH AX ;;AN006;; + MOV CX,-1 ;;AN006;; Set CX for decrements + XOR AL,AL ;;AN006;; Prepare compare register + REPNE SCASB ;;AN006;; Scan for zero + NOT CX ;;AN006;; Change decrement into number + DEC CX ;;AN006;; Don't include the zero + POP AX ;;AN006;; + POP DI ;;AN006;; Restore position + RET ;;AN006;; + ;; +$M_SET_LEN_IN_CX ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_FIND_SPECIFIED_MSG +;; +;; FUNCTION: To scan thru message headers until message is found +;; INPUTS: ES:DI points to beginning of msg headers +;; CX contains the number of messages in class +;; DH contains the message class +;; OUPUTS: IF CX = 0 THEN Message was not found +;; IF CX > 1 THEN ES:DI points to header of specified message +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;; + ;; + CMP BX,1 ;;AN004;; Do we have an address to CALL? +; $IF E,AND ;;AN004;; Yes, + JNE $MIF247 + CMP WORD PTR $M_RT.$M_DISK_PROC_ADDR,-1 ;;AN004;; Do we have an address to CALL? +; $IF NE ;;AN004;; Yes, + JE $MIF247 + CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? +; $IF E ;;AN004;; . . . and . . . + JNE $MIF248 + PUSH AX ;;AN004;; Reset the special message number + MOV AX,$M_RT.$M_MSG_NUM ;;AN004;; Get the old message number + CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text + POP AX ;;AN004;; Reset the special message number +; $ELSE ;;AN004;; Get the old message number + JMP SHORT $MEN248 +$MIF248: + CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text +; $ENDIF ;;AN004;; Get the old message number +$MEN248: +; $ELSE ;;AN004;; + JMP SHORT $MEN247 +$MIF247: + XOR CX,CX ;;AN002;; CX = 0 will allow us to + CMP DH,UTILITY_MSG_CLASS ;;AN001;; +; $IF NE ;;AN001;; + JE $MIF252 + MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN001;; Get number of messages in class +; $ELSE ;;AN001;; + JMP SHORT $MEN252 +$MIF252: +IF FARmsg ;;AN001;; + CMP BYTE PTR ES:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at +ELSE + CMP BYTE PTR CS:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at +ENDIF +; $IF E ;;AN002;; pointer (hopefully) + JNE $MIF254 +IF FARmsg ;;AN001;; + MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class +ELSE + MOV CL,BYTE PTR CS:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class +ENDIF +; $ENDIF ;;AN002;; go on to the next class +$MIF254: +; $ENDIF ;;AN001;; +$MEN252: + ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header + STC ;;AN004;; Flag that we haven't found anything yet +; $ENDIF ;;AN004;; +$MEN247: + +; $IF C ;;AN004;; Have we found anything yet? + JNC $MIF258 + CLC ;;AN004;; No, reset carry +; $SEARCH ;;AN000;; +$MDO259: + OR CX,CX ;;AN000;; Do we have any to check? +; $LEAVE Z ;;AN000;; No, return with CX = 0 + JZ $MEN259 + CMP DH,UTILITY_MSG_CLASS ;;AN001;; +; $IF NE ;;AN001;; + JE $MIF261 + CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN001;; Is this the message requested? +; $ELSE ;;AN001;; + JMP SHORT $MEN261 +$MIF261: +IF FARmsg ;;AN001;; + CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN000;; Is this the message requested? +ELSE + CMP AX,WORD PTR CS:[DI].$M_NUM ;;AN000;; Is this the message requested? +ENDIF +; $ENDIF +$MEN261: +; $EXITIF E ;;AN000;; + JNE $MIF259 +; $ORELSE ;;AN000; + JMP SHORT $MSR259 +$MIF259: + DEC CX ;;AN000;; No, well do we have more to check? +; $LEAVE Z ;;AN000;; No, return with CX = 0 + JZ $MEN259 + ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header +; $ENDLOOP ;;AN000;; + JMP SHORT $MDO259 +$MEN259: + STC ;;AN000;; +; $ENDSRCH ;;AN000;; Check next message +$MSR259: +; $IF NC ;;AN000;; Did we find the message? + JC $MIF269 + CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message? + CLC ;;AN001;; +; $IF E ;;AN001;; + JNE $MIF270 +IF FARmsg ;;AN001;; +ELSE ;;AN000;; + PUSH CS ;;AN000;; + POP ES ;;AN000;; Return ES:DI pointing to the message +ENDIF +; $ENDIF ;;AN001;; +$MIF270: + ADD DI,WORD PTR ES:[DI].$M_TXT_PTR ;;AN000;; Prepare ES:DI pointing to the message +; $ENDIF ;;AN004;; +$MIF269: +; $ENDIF ;;AN004;; +$MIF258: + ;; Yes, great we can return with CX > 0 + +; $IF NC ;;AN000;; Did we find the message? + JC $MIF274 + XOR CH,CH ;;AN000;; + MOV CL,BYTE PTR ES:[DI] ;;AN000;; Move size into CX + INC DI ;;AN000;; Increment past length +; $ENDIF ;;AN004;; +$MIF274: + + MOV $M_RT.$M_SIZE,$M_NULL ;;AN004;; Reset variable + RET ;;AN000;; Return + ;; +$M_FIND_SPECIFIED_MSG ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include of common subroutines +; + IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms + $M_REPLACE = FALSE ;;AN000;; Tell the assembler we did + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +$M_DISPLAY_REPLACE PROC NEAR ;;AN000;; + ;; + XOR BX,BX ;;AN000;; Use BX for buffer count +IF NOT COMR + CMP $M_SL.$M_S_ID,$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII) +; $IF E ;;AN000;; Yes, + JNE $MIF276 + MOV WORD PTR $M_RT.$M_TEMP_BUF[BX],$M_SPACE_HYP ;;AN000;; Move in a " -" + INC BX ;;AN000;; Increment count + INC BX ;;AN000;; Increment count + MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],$M_SPACE ;;AN000;; Move in a " " + INC BX ;;AN000;; Increment count + CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case +; $ENDIF ;;AN000;; If it fails we will catch it later +$MIF276: +ENDIF + + POP BP ;;AN000;; Remember the return address + XOR BX,BX ;;AN000;; Use BX for buffer count + XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack + + MOV $M_RT.$M_SIZE,CL ;;AN000;; Save size to later clear stack + MOV AL,BYTE PTR $M_SL.$M_S_MINW ;;AN000;; Get the minimum width + ;; + CMP AL,CL ;;AN000;; Do we need pad chars added? +; $IF A ;;AN000;; Yes, + JNA $MIF278 + SUB AL,CL ;;AN000;; Calculate how many pad chars are needed. + MOV DH,AL ;;AN000;; Save the number of pad characters + TEST BYTE PTR $M_SL.$M_S_FLAG,Right_Align ;;AN000;; Was replaceable parm to be right aligned? +; $IF NZ ;;AN000;; Yes, + JZ $MIF279 +; $DO ;;AN000;; Begin filling buffer with pad chars +$MDO280: + MOV AL,BYTE PTR $M_SL.$M_S_PAD ;;AN000;; + MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move in a pad char + INC BX ;;AN000;; + CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? +; $IF E ;;AN000;; Yes, + JNE $MIF281 + CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer +; $ENDIF ;;AN000;; +$MIF281: + DEC DH ;;AN000;; Have we filled with enough pad chars? +; $ENDDO Z ;;AN000;; No, next pad character + JNZ $MDO280 +; $ENDIF ;;AN000;; +$MIF279: +; $ENDIF ;;AN000;; Yes, +$MIF278: + ;; + CMP BYTE PTR $M_SL.$M_S_MAXW,$M_UNLIM_W ;;AN000;; Is maximum width unlimited? +; $IF NE ;;AN000;; + JE $MIF286 + CMP BYTE PTR $M_SL.$M_S_MAXW,CL ;;AN000;; Will we exceed maximum width? +; $IF B ;;AN000;; Yes, + JNB $MIF287 + SUB CL,BYTE PTR $M_SL.$M_S_MAXW ;;AN000;; Calculate how many extra chars + MOV DL,CL ;;AN000;; Remember how many chars to pop off + MOV CL,BYTE PTR $M_SL.$M_S_MAXW ;;AN000;; Set new string length +; $ENDIF ;;AN000;; +$MIF287: +; $ENDIF ;;AN000;; +$MIF286: + OR CX,CX ;;AN000;; +; $IF NZ ;;AN000;; + JZ $MIF290 +; $DO ;;AN000;; Begin filling buffer with string +$MDO291: + TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;; +; $IF Z,AND ;;AN000;; + JNZ $MIF292 + TEST $M_SL.$M_S_FLAG,Char_field_ASCIIZ AND $M_SIZE_MASK ; Is this replace a ASCIIZ string? +; $IF NZ ;;AN000;; Yes, + JZ $MIF292 + MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get first character from string + INC DI ;;AN000;; Next character in string +; $ELSE ;;AN000;; No, + JMP SHORT $MEN292 +$MIF292: + POP AX ;;AN000;; Get character in register +; $ENDIF ;;AN000;; +$MEN292: + MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move char into the buffer + INC BX ;;AN000;; Increase buffer count + CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? +; $IF E ;;AN000;; Yes, + JNE $MIF295 + CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer +; $ENDIF ;;AN000;; +$MIF295: + DEC CL ;;AN000;; Have we completed replace? +; $ENDDO Z ;;AN000;; Test again + JNZ $MDO291 +; $ENDIF ;;AN000;; +$MIF290: + ;; + TEST BYTE PTR $M_SL.$M_S_FLAG,Right_Align ;;AN000;; Was replaceable parm to be left aligned? +; $IF Z ;;AN000;; Yes, + JNZ $MIF299 + OR DH,DH ;;AN000;; Do we need pad chars added? +; $IF NZ ;;AN000;; Yes, + JZ $MIF300 +; $DO ;;AN000;; Begin filling buffer with pad chars +$MDO301: + MOV AL,BYTE PTR $M_SL.$M_S_PAD ;;AN000;; + MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move in a pad char + INC BX ;;AN000;; + CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full? +; $IF E ;;AN000;; Yes, + JNE $MIF302 + CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer +; $ENDIF ;;AN000;; +$MIF302: + DEC DH ;;AN000;; Have we filled with enough pad chars? +; $ENDDO Z ;;AN000;; Test again + JNZ $MDO301 +; $ENDIF ;;AN000;; +$MIF300: +; $ENDIF ;;AN000;; +$MIF299: + ;; + TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;; +; $IF Z,AND ;;AN000;; + JNZ $MIF307 + TEST $M_SL.$M_S_FLAG,Char_field_ASCIIZ AND $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string? +; $IF NZ ;;AN000;; Yes, + JZ $MIF307 +; $ELSE ;;AN000;; + JMP SHORT $MEN307 +$MIF307: + OR DL,DL ;;AN000;; +; $IF NE ;;AN000;; + JE $MIF309 +; $DO ;;AN000;; +$MDO310: + POP [$M_RT.$M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable + DEC DL ;;AN000;; Are we done? +; $ENDDO Z ;;AN000;; + JNZ $MDO310 +; $ENDIF ;;AN000;; +$MIF309: +; $ENDIF ;;AN000;; +$MEN307: + CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time + PUSH BP ;;AN000;; Restore the return address + ;; + RET ;;AN000;; + ;; +$M_DISPLAY_REPLACE ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_FLUSH_BUFFER +;; +;; FUNCTION: Display the contents of the temporary buffer +;; INPUTS: DI contains the number of bytes to display +;; OUTPUTS: BX reset to zero +;; +;; REGS USED: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_FLUSH_BUF PROC NEAR ;;AN000;; + ;; + PUSH CX ;;AN000;; Save changed regs + PUSH ES ;;AN000;; + PUSH DI ;;AN000;; + PUSH DS ;;AN000;; Set ES pointing to buffer + POP ES ;;AN000;; + ;; + MOV CX,BX ;;AN000;; Set number of bytes to display + XOR BX,BX ;;AN000;; Reset buffer counter + LEA DI,$M_RT.$M_TEMP_BUF ;;AN000;; Reset buffer location pointer + CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer + ;; +; $IF NC ;;AN000;; Error? + JC $MIF314 + POP DI ;;AN000;; No, Restore changed regs + POP ES ;;AN000;; + POP CX ;;AN000;; +; $ELSE ;;AN000;; Yes, + JMP SHORT $MEN314 +$MIF314: + ADD SP,6 ;;AN000;; Fix stack + STC ;;AN000;; +; $ENDIF ;;AN000;; Error? +$MEN314: + ;; + RET ;;AN000;; Return + ;; +$M_FLUSH_BUF ENDP ;;AN000;; + ;; + ;; + IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace? + $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common + $M_CHAR_ONLY = TRUE ;;AN000;; replacement code later +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_CHAR_REPLACE +;; +;; FUNCTION: Will prepare a single char or ASCIIZ string for replace +;; INPUTS: DS:SI points at corresponding SUBLIST +;; ES:DI contains the VALUE from SUBLIST +;; OUTPUTS: CX contains number of characters on stack +;; Top of stack --> Last character +;; . . . +;; Bot of stack --> First character +;; +;; OTHER REGS Revised: AX +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_CHAR_REPLACE PROC NEAR ;;AN000;; + ;; + POP BP ;;AN000;; Save return address + TEST $M_SL.$M_S_FLAG,NOT Char_Field_Char AND $M_SIZE_MASK ;;AN000;; Was Character specified? +; $IF Z ;;AN000;; Yes, + JNZ $MIF317 + MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character + PUSH AX ;;AN000;; Put it on the stack + INC CX ;;AN000;; Increase the count + CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character +; $IF C ;;AN000;; Yes, + JNC $MIF318 + MOV AL,BYTE PTR ES:[DI]+1 ;;AN000;; Get the next character + PUSH AX ;;AN000;; Put it on the stack + CLC ;;AN000;; Clear the carry +; $ENDIF ;;AN000;; +$MIF318: +; $ELSE ;;AN000;; No, it was an ASCIIZ string + JMP SHORT $MEN317 +$MIF317: +; $DO ;;AN000;; +$MDO321: + MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character + OR AL,AL ;;AN000;; Is it the NULL? +; $LEAVE Z ;;AN000;; No, + JZ $MEN321 + INC DI ;;AN000;; Next character + INC CX ;;AN000;; Increment the count +; $ENDDO ;;AN000;; Yes, + JMP SHORT $MDO321 +$MEN321: + SUB DI,CX ;;AN000;; Set SI at the beginning of the string +; $ENDIF ;;AN000;; +$MEN317: + ;;AN000;; + PUSH BP ;;AN000;; Restore return address + RET ;;AN000;; Return + ;; +$M_CHAR_REPLACE ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include of CHAR replace code +; + IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace? + $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common + $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_BIN2ASC_REPLACE +;; +;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string +;; and prepare to display +;; INPUTS: DS:SI points at corresponding SUBLIST +;; ES:DI contains the VALUE from SUBLIST +;; OUTPUTS: CX contains number of characters on stack +;; Top of stack --> Last character +;; . . . +;; Bot of stack --> First character +;; OTHER REGS Revised: BX,DX,AX +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_BIN2ASC_REPLACE PROC NEAR ;;AN000;; + ;; + POP BP ;;AN000;; Save return address + ;; + XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH) + XOR AX,AX ;;AN000;; Prepare for get binary value (LOW) + MOV $M_RT.$M_DIVISOR,$M_BASE16 ;;AN000;; Set default divisor + XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable) +IF NOT COMR + TEST $M_SL.$M_S_FLAG,NOT $M_BYTE AND $M_SIZE_MASK ;;AN000;; Was BYTE specified? +; $IF Z ;;AN000;; + JNZ $MIF325 + MOV AL, BYTE PTR ES:[DI] ;;AN000;; Setup byte in AL + TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified? +; $IF Z ;;AN000;; + JNZ $MIF326 + TEST AL,10000000b ;;AN000;; Is this number negative? +; $IF NZ ;;AN000;; Yes, + JZ $MIF327 + INC BX ;;AN000;; Remember that it was negative + AND AL,01111111b ;;AN000;; Make it positive +; $ENDIF ;;AN000;; +$MIF327: + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; +; $ENDIF ;;AN000;; +$MIF326: + TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified? +; $IF Z ;;AN000;; + JNZ $MIF330 + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; +; $ENDIF ;;AN000;; +$MIF330: +; $ELSE ;;AN000;; + JMP SHORT $MEN325 +$MIF325: +ENDIF + TEST $M_SL.$M_S_FLAG,NOT $M_WORD AND $M_SIZE_MASK ;;AN000;; Was WORD specified? +; $IF Z ;;AN000;; + JNZ $MIF333 + MOV AX, WORD PTR ES:[DI] ;;AN000;; Setup byte in AL + TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;; AN000;; Was Signed binary specified? +; $IF Z ;;AN000;; + JNZ $MIF334 + TEST AH,10000000b ;;AN000;; Is this number negative? +; $IF NZ ;;AN000;; Yes, + JZ $MIF335 + INC BX ;;AN000;; Remember that it was negative + AND AH,01111111b ;;AN000;; Make it positive +; $ENDIF ;;AN000;; +$MIF335: + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; +; $ENDIF ;;AN000;; +$MIF334: + TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified? +; $IF Z ;;AN000;; + JNZ $MIF338 + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; +; $ENDIF ;;AN000;; +$MIF338: +; $ELSE ;;AN000;; + JMP SHORT $MEN333 +$MIF333: +IF NOT COMR + MOV AX, WORD PTR ES:[DI] ;;AN000;; Setup Double word in DX:AX + MOV DX, WORD PTR ES:[DI]+2 ;;AN000;; + TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified? +; $IF Z ;;AN000;; + JNZ $MIF341 + TEST DH,10000000b ;;AN000;; Is this number negative? +; $IF NZ ;;AN000;; Yes, + JZ $MIF342 + INC BX ;;AN000;; Remember that it was negative + AND DH,01111111b ;;AN000;; Make it positive +; $ENDIF ;;AN000;; +$MIF342: + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; +; $ENDIF ;;AN000;; +$MIF341: + TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified? +; $IF Z ;;AN000;; + JNZ $MIF345 + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; +; $ENDIF ;;AN000;; +$MIF345: +ENDIF +; $ENDIF ;;AN000;; +$MEN333: +; $ENDIF ;;AN000;; +$MEN325: + ;; + CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string +IF NOT COMR + OR BX,BX ;;AN000;; +; $IF NZ ;;AN000;; Was number negative? + JZ $MIF349 + XOR DX,DX ;;AN000;; Yes, + MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number + PUSH DX ;;AN000;; +; $ENDIF ;;AN000;; No, +$MIF349: +ENDIF + ;; + PUSH BP ;;AN000;; Restore return address + RET ;;AN000;; Return + ;; +$M_BIN2ASC_REPLACE ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include of NUM replace code +; + IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace? + $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common + $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_DATE_REPLACE +;; +;; FUNCTION: Convert a date to a decimal ASCII string using current +;; country format and prepare to display +;; INPUTS: DS:SI points at corresponding SUBLIST +;; ES:DI points at VALUE from SUBLIST +;; OUTPUTS: CX contains number of characters on stack +;; Top of stack --> Last character +;; . . . +;; Bot of stack --> First character +;; OTHER REGS Revised: DX, AX +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_DATE_REPLACE PROC NEAR ;;AN000;; + ;; + POP BP ;;AN000;; Save return address + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor + CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT + ;;AN000;; All O.K.? + XOR DX,DX ;;AN000;; Reset DX value + XOR AX,AX ;;AN000;; Reset AX value + CMP WORD PTR $M_RT.$M_DATE_FORMAT,0 ;;AN000;; USA Date Format +; $IF E ;;AN000;; Beginning from end: (saved on the stack) + JNE $MIF351 + CALL $M_YEAR ;;AN000;; Get Year + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;; + INC CX ;;AN000;; Increment count + XOR AX,AX ;;AN000;; Reset AX value + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;; + INC CX ;;AN000;; Increment count + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string +; $ENDIF ;;AN000;; +$MIF351: + ;; + CMP WORD PTR $M_RT.$M_DATE_FORMAT,1 ;;AN000;; EUROPE Date Format +; $IF E ;;AN000;; Beginning from end: (saved on the stack) + JNE $MIF353 + CALL $M_YEAR ;;AN000;; Get Year + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;; + INC CX ;;AN000;; + XOR AX,AX ;;AN000;; Reset AX + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;; + INC CX ;;AN000;; + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string +; $ENDIF ;;AN000;; +$MIF353: + ;; + CMP WORD PTR $M_RT.$M_DATE_FORMAT,2 ;;AN000;; JAPAN Date Format +; $IF E ;;AN000;; Beginning from end: (saved on the stack) + JNE $MIF355 + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;; + INC CX ;;AN000;; + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;; + INC CX ;;AN000;; + CALL $M_YEAR ;;AN000;; Get Year + CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string +; $ENDIF ;;AN000;; +$MIF355: + ;; + PUSH BP ;;AN000;; Restore return address + RET ;;AN000;; Return + ;; +$M_DATE_REPLACE ENDP ;;AN000;; + ;; +$M_GET_DATE PROC NEAR ;;AN000;; + MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info + MOV AL,0 ;;AN000;; Get current country info + LEA DX,$M_RT.$M_TEMP_BUF ;;AN000;; Set up addressibility to buffer + INT 21H ;;AN000;; +; $IF C ;;AN000;; No, + JNC $MIF357 + MOV WORD PTR $M_RT.$M_DATE_FORMAT,$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH) + MOV BYTE PTR $M_RT.$M_DATE_SEPARA,$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL) +; $ENDIF ;;AN000;; +$MIF357: + RET ;;AN000;; +$M_GET_DATE ENDP ;;AN000;; + ;; +$M_YEAR PROC NEAR ;;AN000;; + MOV AX,WORD PTR $M_SL.$M_S_VALUE ;;AN000;; Get Year + TEST $M_SL.$M_S_FLAG,Date_MDY_4 AND $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified? +; $IF Z ;;AN000;; + JNZ $MIF359 + CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year +; $IF A ;;AN000;; + JNA $MIF360 + MOV AX,$M_MAX_2_YEAR ;;AN000;; +; $ENDIF ;;AN000;; +$MIF360: +; $ENDIF ;;AN000;; +$MIF359: + RET ;;AN000;; +$M_YEAR ENDP ;;AN000;; + ;; +$M_CONVERTDATE PROC NEAR ;;AN000;; + POP WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address + MOV $M_RT.$M_SIZE,CL ;;AN000;; Save the size before conversion + CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string + DEC CX ;;AN000;; Test if size only grew by 1 + CMP CL,$M_RT.$M_SIZE ;;AN000;; Did size only grow by one +; $IF E ;;AN000;; Yes, + JNE $MIF363 + MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) + PUSH AX ;;AN000;; Save it + INC CX ;;AN000;; Count it +; $ENDIF ;;AN000;; +$MIF363: + INC CX ;;AN000;; Restore CX + PUSH WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address + RET ;;AN000;; +$M_CONVERTDATE ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include of DATE replace code +; + IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace? + $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common + $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_TIME_REPLACE +;; +;; FUNCTION: Convert a time to a decimal ASCII string +;; and prepare to display +;; INPUTS: DS:SI points at corresponding SUBLIST +;; ES:DI points at VALUE from SUBLIST +;; OUTPUTS: CX contains number of characters on stack +;; Top of stack --> Last character +;; . . . +;; Bot of stack --> First character +;; REGS USED: BP,CX,AX +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_TIME_REPLACE PROC NEAR ;;AN000;; + ;; + POP BP ;;AN000;; Save return address + MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor + CALL $M_GET_TIME ;;AN000;; All O.K.? + TEST $M_SL.$M_S_FLAG,Time_Cty_Type AND $M_TIME_MASK ;;AN000;; Is this a request for current country info? +; $IF NZ ;;AN000;; Yes, + JZ $MIF365 + CMP BYTE PTR $M_RT.$M_TIME_FORMAT,0 ;;AN000;; Is the current country format 12 Hour? +; $IF E ;;AN000;; Yes, + JNE $MIF366 + MOV AL,BYTE PTR $M_SL.$M_S_VALUE ;;AN000;; Get Hours + CMP AL,12 ;;AN000;; Is hour 12 or less? +; $IF L,OR ;;AN000;; or + JL $MLL367 + CMP AL,23 ;;AN000;; Is hour 24 or greater? +; $IF G ;;AN000;; Yes, + JNG $MIF367 +$MLL367: + MOV AL,$M_AM ;;AN000;; + PUSH AX ;;AN000;; Push an "a" to represent AM. + INC CX ;;AN000;; +; $ELSE ;;AN000;; No, + JMP SHORT $MEN367 +$MIF367: + MOV AL,$M_PM ;;AN000;; + PUSH AX ;;AN000;; Push an "p" to represent PM. + INC CX ;;AN000;; +; $ENDIF ;;AN000;; +$MEN367: +; $ENDIF ;;AN000;; +$MIF366: +; $ENDIF ;;AN000;; +$MIF365: + ;; + XOR AX,AX ;;AN000;; + XOR DX,DX ;;AN000;; + TEST $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? +; $IF NZ ;;AN000;; + JZ $MIF372 + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Hundreds + CALL $M_CONVERTTIME ;;AN000;; + PUSH WORD PTR $M_RT.$M_DECI_SEPARA ;;AN000;; + INC CX ;;AN000;; +; $ENDIF ;;AN000;; +$MIF372: + TEST $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? +; $IF NZ,OR ;;AN000;; + JNZ $MLL374 + TEST $M_SL.$M_S_FLAG,Time_HHMMSS_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified? +; $IF NZ ;;AN000;; + JZ $MIF374 +$MLL374: + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Seconds + CALL $M_CONVERTTIME ;;AN000;; + PUSH WORD PTR $M_RT.$M_TIME_SEPARA ;;AN000;; + INC CX ;;AN000;; +; $ENDIF ;;AN000;; +$MIF374: + ;; Do Hour/Min (12 Hour) + MOV AL,BYTE PTR $M_SL.$M_S_VALUE+1 ;;AN000;; Get Minutes + CALL $M_CONVERTTIME ;;AN000;; + PUSH WORD PTR $M_RT.$M_TIME_SEPARA ;;AN000;; + INC CX ;;AN000;; + ;; + MOV AL,BYTE PTR $M_SL.$M_S_VALUE ;;AN000;; Get Hours + TEST $M_SL.$M_S_FLAG,Time_Cty_Type AND $M_TIME_MASK ;;AN000;; Is this a request for current country info? +; $IF NZ ;;AN000;; Yes, + JZ $MIF376 + CMP BYTE PTR $M_RT.$M_TIME_FORMAT,0 ;;AN000;; Is the current country format 12 Hour? +; $IF E ;;AN000;; Yes, + JNE $MIF377 + CMP AL,13 ;;AN000;; Is hour less than 12? +; $IF GE ;;AN000;; Yes, + JNGE $MIF378 + SUB AL,12 ;;AN000;; Set to a 12 hour value +; $ENDIF ;;AN000;; +$MIF378: + CMP AL,0 ;;AN000;; Is hour less than 12? +; $IF E ;;AN000;; Yes, + JNE $MIF380 + MOV AL,12 ;;AN000;; Set to a 12 hour value +; $ENDIF ;;AN000;; +$MIF380: +; $ENDIF ;;AN000;; +$MIF377: +; $ENDIF ;;AN000;; +$MIF376: + CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII + ;; + PUSH BP ;;AN000;; Restore return address + RET ;;AN000;; Return + ;; +$M_TIME_REPLACE ENDP ;;AN000;; + ;; +$M_GET_TIME PROC NEAR ;;AN000;; + MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info + MOV AL,0 ;;AN000;; Get current country info + LEA DX,$M_RT.$M_TEMP_BUF ;;AN000;; Set up addressibility to buffer + INT 21H ;;AN000;; +; $IF C ;;AN000;; No, + JNC $MIF384 + MOV WORD PTR $M_RT.$M_TIME_FORMAT,$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH) + MOV BYTE PTR $M_RT.$M_TIME_SEPARA,$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL) + MOV BYTE PTR $M_RT.$M_DECI_SEPARA,$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL) +; $ENDIF ;;AN000;; +$MIF384: + RET ;;AN000;; +$M_GET_TIME ENDP ;;AN000;; + ;; +$M_CONVERTTIME PROC NEAR ;;AN000;; + POP WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address + MOV $M_RT.$M_SIZE,CL ;;AN000;; Save the size before conversion + CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string + DEC CX ;;AN000;; Test if size only grew by 1 + CMP CL,$M_RT.$M_SIZE ;;AN000;; Did size only grow by one +; $IF E ;;AN000;; Yes, + JNE $MIF386 + MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0) + PUSH AX ;;AN000;; Save it + INC CX ;;AN000;; Count it +; $ENDIF ;;AN000;; +$MIF386: + INC CX ;;AN000;; Restore CX + PUSH WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address + RET ;;AN000;; +$M_CONVERTTIME ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include of TIME replace + ENDIF ;;AN000;; END of include of Replacement common code +; + IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace? + INPUTmsg = FALSE ;;AN000;; Yes, THEN include it and reset the flag +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PROC NAME: $M_WAIT_FOR_INPUT +;; +;; FUNCTION: To accept keyed input and return extended key value +;; in AX register +;; INPUTS: DL contains the DOS function requested for input +;; OUPUTS: AX contains the extended key value that was read +;; REGS USED: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +$M_WAIT_FOR_INPUT PROC NEAR ;;AN000;; + ;; + PUSH CX ;;AN000;; Save CX + PUSH DX ;;AN000;; Save DX + PUSH DS ;;AN000;; Save Data segment + ;; + CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer? +; $IF A ;;AN001;; Yes, + JNA $MIF388 + MOV AL,DL ;;AN001;; Mov function into AL + AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble + MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function +; $ELSE ;;AN001;; No, + JMP SHORT $MEN388 +$MIF388: + MOV AH,DL ;;AN000;; Put DOS function in AH +; $ENDIF ;;AN001;; +$MEN388: + PUSH ES ;;AN000;; Get output buffer segment + POP DS ;;AN000;; + MOV DX,DI ;;AN000;; Get output buffer offset in case needed + INT 21H ;;AN000;; Get keyboard input + POP DS ;;AN000;; + + CMP DL,DOS_BUF_KEYB_INP ;;AN000;; + CLC ;;AN000;; +; $IF NE ;;AN000;; If character input + JE $MIF391 + CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS? +; $IF C ;;AN000;; + JNC $MIF392 + MOV CL,AL ;;AN000;; Save first character + MOV AH,DL ;;AN001;; Get back function + INT 21H ;;AN000;; Get keyboard input + MOV AH,CL ;;AN000;; Retreive first character AX = xxxx + CLC ;;AN000;; Clear carry condition +; $ELSE ;;AN000;; + JMP SHORT $MEN392 +$MIF392: + MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS +; $ENDIF ;;AN000;; +$MEN392: +; $ENDIF ;;AN000;; +$MIF391: + ;; +; $IF NC ;;AN000;; + JC $MIF396 + POP DX ;;AN000;; + POP CX ;;AN000;; +; $ELSE ;;AN000;; + JMP SHORT $MEN396 +$MIF396: + ADD SP,4 ;;AN000;; + STC ;;AN000;; Reset carry flag +; $ENDIF ;;AN000;; +$MEN396: + RET ;;AN000;; Return + ;; +$M_WAIT_FOR_INPUT ENDP ;;AN000;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ENDIF ;;AN000;; END of include of Wait for Input + ENDIF ;;AN000;; END of include of SYSDISPMSG + ENDIF ;;AN000;; END of include of MSG_DATA_ONLY +ENDIF ;;AN000;; END of include of Structure only + \ No newline at end of file diff --git a/v4.0/src/INC/MSHALO.ASM b/v4.0/src/INC/MSHALO.ASM new file mode 100644 index 0000000..65b46d5 --- /dev/null +++ b/v4.0/src/INC/MSHALO.ASM @@ -0,0 +1,247 @@ +; SCCSID = @(#)ibmhalo.asm 1.1 85/04/10 +; On 2K (800h) boundaries beginning at address C0000h and ending at EF800h +; there is a header that describes a block of rom program. This header +; contains information needed to initialize a module and to provide PCDOS +; with a set of reserved names for execution. +; +; This header has the following format: +; +; rom_header STRUC +; Signature1 DB 55h +; Signature2 DB AAh +; rom_length DB ? ; number of 512 byte pieces +; init_jmp DB 3 dup (?) +; name_list name_struc <> +; rom_header ENDS +; +; name_struc STRUC +; name_len DB ? +; name_text DB ? DUP (?) +; name_jmp DB 3 DUP (?) +; name_struc ENDS +; +; The name list is a list of names that are reserved by a particular section +; of a module. This list of names is terminated by a null name (length +; is zero). +; +; Consider now, the PCDOS action when a user enters a command: +; +; COMMAND.COM has control. +; o If location FFFFEh has FDh then +; o Start scanning at C0000h, every 800h for a byte 55h followed +; by AAh, stop scan if we get above or = F0000H +; o When we've found one, compare the name entered by the user +; with the one found in the rom. If we have a match, then +; set up the environment for execution and do a long jump +; to the near jump after the found name. +; o If no more names in the list, then continue scanning the module +; for more 55h followed by AAh. +; o We get to this point only if there is no matching name in the +; rom. We now look on disk for the command. +; +; This gives us the flexibility to execute any rom cartridge without having +; to 'hard-code' the name of the cartridge into PCDOS. Rom modules that +; want to be invisible to the DOS should not have any names in their lists +; (i.e. they have a single null name). +; +; Consider a new release of BASIC, say, that patches bugs in the ROM version. +; Clearly this version will be available on disk. How does a user actually +; invoke this new BASIC?? He cannot call it BASIC on the disk because the +; EXEC loader will execute the ROM before it even looks at the disk! Only +; solution: +; +; o Keep things consistent and force the user to have his software named +; differently from the ROM names (BASIC1, BASIC2, etc). + +rom_header STRUC + Signature1 DB ? + Signature2 DB ? + rom_length DB ? + init_jmp DB 3 dup (?) + name_list DB ? +rom_header ENDS + +name_struc STRUC + name_len DB ? + name_text DB 1 DUP (?) + name_jmp DB 3 DUP (?) +name_struc ENDS + +ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING + +; +; Check for IBM PC Jr rom cartrides. DS:DX is a pointer to name +; +ROM_SCAN: + PUSH ES + PUSH SI + PUSH DI + PUSH CX + PUSH AX + PUSH BX +; +; check for PC Jr signature in rom +; + MOV AX,0F000h + MOV ES,AX + CMP BYTE PTR ES:[0FFFEh],0FDh + JZ SCAN_IT +NO_ROM: + CLC +ROM_RET: + POP BX + POP AX + POP CX + POP DI + POP SI + POP ES + RET +SCAN_IT: +; +; start scanning at C000 +; + MOV AX,0C000h +SCAN_ONE: + MOV ES,AX + XOR DI,DI +SCAN_MODULE: +; +; check for a valid header +; + CMP WORD PTR ES:[DI],0AA55h + JZ SCAN_LIST + ADD AX,080h +SCAN_END: + CMP AX,0F000h + JB SCAN_ONE + JMP NO_ROM +; +; trundle down list of names +; +SCAN_LIST: + MOV BL,ES:[DI].rom_length ; number of 512-byte jobbers + XOR BH,BH ; nothing in the high byte + SHL BX,1 + SHL BX,1 ; number of paragraphs + ADD BX,7Fh + AND BX,0FF80h ; round to 2k + + MOV DI,name_list +SCAN_NAME: + MOV CL,ES:[DI] ; length of name + INC DI ; point to name + XOR CH,CH + OR CX,CX ; zero length name + JNZ SCAN_TEST ; nope... compare + ADD AX,BX ; yep, skip to next block + JMP SCAN_END +; +; compare a single name +; +SCAN_TEST: + MOV SI,DX + INC SI + REPE CMPSB ; compare name + JZ SCAN_FOUND ; success! +SCAN_NEXT: + ADD DI,CX ; failure, next name piece + ADD DI,3 + JMP SCAN_NAME +; +; found a name. save entry location +; +SCAN_FOUND: + CMP BYTE PTR DS:[SI],'?' + JZ SCAN_SAVE + CMP BYTE PTR DS:[SI],' ' + JNZ SCAN_NEXT +SCAN_SAVE: + MOV [rom_cs],ES + MOV [ROM_ip],DI + STC + JMP ROM_RET + +; +; execute a rom-placed body of code. allocate largest block +; +ROM_EXEC: + MOV BX,0FFFFh + MOV AH,ALLOC + INT int_command + MOV AH,ALLOC + INT int_command + PUSH BX + PUSH AX +; +; set terminate addresses +; + MOV AX,(set_interrupt_vector SHL 8) + int_terminate + PUSH DS + MOV DS,[RESSEG] + ASSUME DS:RESGROUP + MOV DX,OFFSET RESGROUP:EXEC_WAIT + INT int_command + MOV DX,DS + MOV ES,DX + ASSUME ES:RESGROUP + POP DS + ASSUME DS:NOTHING +; +; and create program header and dup all jfn's +; + POP DX + MOV AH,DUP_PDB + INT int_command +; +; set up dma address +; + MOV DS,DX + MOV DX,080h + MOV AH,SET_DMA + INT int_command +; +; copy in environment info +; + MOV AX,[ENVIRSEG] + MOV DS:[PDB_environ],AX +; +; set up correct size of block +; + POP BX ; BX has size, DS has segment + MOV DX,DS + ADD DX,BX + MOV DS:[PDB_block_len],DX +; +; change ownership of block +; + MOV DX,DS + DEC DX + MOV DS,DX + INC DX + MOV DS:[arena_owner],DX + MOV DS,DX +; +; set up correct stack +; + CMP BX,1000h + JB GOT_STACK + XOR BX,BX +GOT_STACK: + MOV CL,4 + SHL BX,CL + MOV DX,DS + MOV SS,DX + MOV SP,BX + XOR AX,AX + PUSH AX +; +; set up initial registers and go to the guy +; + NOT AX + PUSH [ROM_CS] + PUSH [ROM_IP] + MOV ES,DX +ASSUME ES:NOTHING +FOOBAR PROC FAR + RET +FOOBAR ENDP diff --git a/v4.0/src/INC/MSHEAD.ASM b/v4.0/src/INC/MSHEAD.ASM new file mode 100644 index 0000000..ad28472 --- /dev/null +++ b/v4.0/src/INC/MSHEAD.ASM @@ -0,0 +1,134 @@ +; SCCSID = @(#)mshead.asm 1.1 85/04/10 +; TITLE MSHEAD.ASM -- MS-DOS DEFINITIONS +PAGE +; MS-DOS High-performance operating system for the 8086 version 1.28 +; by Microsoft MSDOS development group: +; TP (Ret.) +; AR +; NP (Parenting) +; MZ +; CP (BIOS) (ret.) + +; ****************** Revision History ************************* +; >> EVERY change must noted below!! << +; +; 0.34 12/29/80 General release, updating all past customers +; 0.42 02/25/81 32-byte directory entries added +; 0.56 03/23/81 Variable record and sector sizes +; 0.60 03/27/81 Ctrl-C exit changes, including register save on user stack +; 0.74 04/15/81 Recognize I/O devices with file names +; 0.75 04/17/81 Improve and correct buffer handling +; 0.76 04/23/81 Correct directory size when not 2^N entries +; 0.80 04/27/81 Add console input without echo, Functions 7 & 8 +; 1.00 04/28/81 Renumber for general release +; 1.01 05/12/81 Fix bug in `STORE' +; 1.10 07/21/81 Fatal error trapping, NUL device, hidden files, date & time, +; RENAME fix, general cleanup +; 1.11 09/03/81 Don't set CURRENT BLOCK to 0 on open; fix SET FILE SIZE +; 1.12 10/09/81 Zero high half of CURRENT BLOCK after all (CP/M programs don't) +; 1.13 10/29/81 Fix classic "no write-through" error in buffer handling +; 1.20 12/31/81 Add time to FCB; separate FAT from DPT; Kill SMALLDIR; Add +; FLUSH and MAPDEV calls; allow disk mapping in DSKCHG; Lots +; of smaller improvements +; 1.21 01/06/82 HIGHMEM switch to run DOS in high memory +; 1.22 01/12/82 Add VERIFY system call to enable/disable verify after write +; 1.23 02/11/82 Add defaulting to parser; use variable escape character Don't +; zero extent field in IBM version (back to 1.01!) +; 1.24 03/01/82 Restore fcn. 27 to 1.0 level; add fcn. 28 +; 1.25 03/03/82 Put marker (00) at end of directory to speed searches +; 1.26 03/03/82 Directory buffers searched as a circular queue, current buffer +; is searched first when possible to minimize I/O +; 03/03/82 STORE routine optimized to tack on partial sector tail as +; full sector write when file is growing +; 03/09/82 Multiple I/O buffers +; 03/29/82 Two bugs: Delete all case resets search to start at beginning +; of directory (infinite loop possible otherwise), DSKRESET +; must invalidate all buffers (disk and directory). +; 1.27 03/31/82 Installable device drivers +; Function call 47 - Get pointer to device table list +; Function call 48 - Assign CON AUX LIST +; 04/01/82 Spooler interrupt (INT 28) added. +; 1.28 04/15/82 DOS retructured to use ASSUMEs and PROC labels around system +; call entries. Most CS relative references changed to SS +; relative with an eye toward putting a portion of the DOS in +; ROM. DOS source also broken into header, data and code pieces +; 04/15/82 GETDMA and GETVECT calls added as 24 and 32. These calls +; return the current values. +; 04/15/82 INDOS flag implemented for interrupt processing along with +; call to return flag location (call 29) +; 04/15/82 Volume ID attribute added +; 04/17/82 Changed ABORT return to user to a long ret from a long jump to +; avoid a CS relative reference. +; 04/17/82 Put call to STATCHK in dispatcher to catch ^C more often +; 04/20/82 Added INT int_upooler into loop ^S wait +; 04/22/82 Dynamic disk I/O buffer allocation and call to manage them +; call 49. +; 04/23/82 Added GETDSKPTDL as call 50, similar to GETFATPT(DL), returns +; address of DPB +; 04/29/82 Mod to WRTDEV to look for ^C or ^S at console input when +; writting to console device via file I/O. Added a console +; output attribute to devices. +; 04/30/82 Call to en/dis able ^C check in dispatcher Call 51 +; 04/30/82 Code to allow assignment of func 1-12 to disk files as well +; as devices.... pipes, redirection now possible +; 04/30/82 Expanded GETLIST call to 2.0 standard +; 05/04/82 Change to INT int_fatal_abort callout int HARDERR. DOS SS +; (data segment) stashed in ES, INT int_fatal_abort routines must +; preserve ES. This mod so HARDERR can be ROMed. +; 1.29 06/01/82 Installable block and character devices as per 2.0 spec +; 06/04/82 Fixed Bug in CLOSE regarding call to CHKFATWRT. It got left +; out back about 1.27 or so (oops). ARR +; 1.30 06/07/82 Directory sector buffering added to main DOS buffer queue +; 1.40 06/15/82 Tree structured directories. XENIX Path Parser MKDIR CHDIR +; RMDIR Xenix calls +; 1.41 06/13/82 Made GETBUFFR call PLACEBUF +; 1.50 06/17/82 FATs cached in buffer pool, get FAT pointer calls disappear +; Frees up lots of memory. +; 1.51 06/24/82 BREAKDOWN Revised to do EXACT one sector read/write through +; system buffers +; 1.52 06/30/82 OPEN, CLOSE, READ, WRITE, DUP, DUP2, LSEEK implemented +; 1.53 07/01/82 OPEN CLOSE mod for Xenix calls, saves and gets remote dir +; 1.54 07/11/82 Function calls 1-12 make use of new 2.0 PDB. Init code +; changed to set file handle environment. +; 2.00 08/01/82 Number for IBM release +; 01/19/83 No environ bug in EXEC +; 01/19/83 MS-DOS OEM INT 21 extensions (SET_OEM_HANDLER) +; 01/19/83 Performance bug fix in cooked write to NUL +; 01/27/83 Growcnt fixed for 32-bits +; 01/27/83 Find-first problem after create +; 2.01 02/17/83 International DOS +; 2.10 03/09/83 Start of NETWORK support +; New Buffer structure +; New Sytem file table structure +; FCB moved to internal representation +; DOS re-organized +; 2.11 04/21/83 Continuation of 2.10, preliminary Network +; device interface. +; 2.50 09/12/83 More network stuff +; +; ************************************************************* + +INCLUDE DOSSYM.INC +INCLUDE DEVSYM.INC + +Break + +; The following are all of the segments used. They are declared in the order +; that they should be placed in the executable + +; +; segment ordering for MSDOS +; + +include dosseg.asm + +AsmVar + +START SEGMENT BYTE PUBLIC 'START' + ASSUME CS:DOSGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING + JMP near ptr DOSINIT +START ENDS + +LAST SEGMENT PARA PUBLIC 'LAST' + Extrn DOSINIT:NEAR +LAST ENDS diff --git a/v4.0/src/INC/MSTABLE.ASM b/v4.0/src/INC/MSTABLE.ASM new file mode 100644 index 0000000..4bef26f --- /dev/null +++ b/v4.0/src/INC/MSTABLE.ASM @@ -0,0 +1,16 @@ +; SCCSID = @(#)ibmtable.asm 1.1 85/04/10 +; +; Table Segment for DOS +; + +.xlist +.xcref +include mssw.asm +.cref +.list + +TITLE IBMTABLE - Table segment for DOS +NAME IBMTABLE + +include ms_table.asm + END diff --git a/v4.0/src/INC/MS_DATA.ASM b/v4.0/src/INC/MS_DATA.ASM new file mode 100644 index 0000000..fa1c855 --- /dev/null +++ b/v4.0/src/INC/MS_DATA.ASM @@ -0,0 +1,194 @@ +; SCCSID = @(#)msdata.asm 1.8 85/09/12 + AsmVars + +Break + +DATA SEGMENT WORD PUBLIC 'DATA' +; Init code overlaps with data area below + + ORG 0 +PUBLIC MSDAT001S,MSDAT001E +MSDAT001S label byte + + I_am TIMEBUF,6 ; Time read from clock device + I_am DEVIOBUF,2 ; Buffer for I/O under file assignment +; +; The following areas are used as temp buffer in EXEC system call +; + I_am OPENBUF,128 ; buffer for name operations + I_am RenBuf,128 ; buffer for rename destination +; Buffer for search calls + I_am SEARCHBUF,53 ; internal search buffer + I_am DummyCDS,curdirLen +; +; End of contiguous buffer +; + +; +; Temporary directory entry for use by many routines. Device directory +; entries (bogus) are built here. +; + PUBLIC DevFCB +DEVFCB LABEL BYTE ; Uses NAME1, NAME2, combined +; WARNING.. do not alter position of NAME1 relative to DEVFCB +; without first examining BUILD_DEVICE_ENT. Look carefully at DOS_RENAME +; as well as it is the only guy who uses NAME2 and DESTSTART. + I_am NAME1,12 ; File name buffer + I_am NAME2,13 ; + I_am DESTSTART,WORD ; + DB ((SIZE DIR_ENTRY) - ($ - DEVFCB)) DUP (?) +; +; End Temporary directory entry. +; + I_am ATTRIB,BYTE ; storage for file attributes + I_am EXTFCB,BYTE ; TRUE => extended FCB in use + I_am SATTRIB,BYTE ; Storage for search attributes + I_AM open_access,BYTE ; access of open system call + I_am FoundDel,BYTE ; true => file was deleted + I_am Found_dev,BYTE ; true => search found a device + I_am fSplice,BYTE ; true => do a splice in transpath + I_am fSharing,BYTE ; TRUE => no redirection + I_am SECCLUSPOS,BYTE ; Position of first sector within cluster + I_am TRANS,BYTE ; + I_am READOP,BYTE ; + I_am THISDRV,BYTE ; + I_am CLUSFAC,BYTE ; + I_am CLUSSPLIT,BYTE ; + I_am INSMODE,BYTE ; true => insert mode in buffered read + I_am cMeta,BYTE ; count of meta'ed components found + I_am VOLID,BYTE ; + I_am exit_type,BYTE ; type of exit... + + EVEN + +; WARNING - the following two items are accessed as a word + I_am CREATING,BYTE ; true => creating a file + I_am DELALL,BYTE ; true => deleting everything + + I_am EXITHOLD,DWORD ; Temp location for proc terminate + I_am user_SP,WORD ; User SP for system call + I_am user_SS,WORD ; User SS for system call + I_am CONTSTK,WORD ; + I_am THISDPB,DWORD ; + I_am CLUSSAVE,WORD ; + I_am CLUSSEC,DWORD ;>32mb AC0000 + I_am PREREAD,WORD ; 0 means preread; 1 means optional + I_am FATBYT,WORD ; Used by ALLOCATE + I_am FATBYTE,WORD ; Used by $SLEAZEFUNC + I_am DEVPT,DWORD ; + I_am THISSFT,DWORD ; Address of user SFT + I_am THISCDS,DWORD ; Address of current CDS + I_am THISFCB,DWORD ; Address of user FCB + I_am SFN,WORD,<-1> ; SystemFileNumber found for accessfile + I_am JFN,WORD ; JobFileNumber found for accessfile + I_am PJFN,DWORD ; PointerJobFileNumber found for accessfile + I_am WFP_START,WORD ; + I_am REN_WFP,WORD ; + I_am CURR_DIR_END,WORD ; + I_am NEXTADD,WORD ; + I_am LASTPOS,WORD ; + I_am CLUSNUM,WORD ; + I_am DIRSEC,DWORD ;>32mb AC0000 + I_am DIRSTART,WORD ; + I_am SECPOS,DWORD ;>32mb Position of first sector accessed + I_am VALSEC,DWORD ;>32mb Number of valid (previously written) + ; sectors + I_am BYTSECPOS,WORD ; Position of first byte within sector + I_am BYTPOS,4 ; Byte position in file of access + I_am BYTCNT1,WORD ; No. of bytes in first sector + I_am BYTCNT2,WORD ; No. of bytes in last sector + I_am SECCNT,WORD ; No. of whole sectors + I_am ENTFREE,WORD ; + I_am ENTLAST,WORD ; + I_am NXTCLUSNUM,WORD ; + I_am GROWCNT,DWORD ; + I_am CURBUF,DWORD ; + I_am CONSft,DWORD ; SFT of console swapped guy. + I_am SaveBX,WORD ; + I_am SaveDS,WORD ; + I_am restore_tmp,WORD ; return address for restore world + I_am NSS,WORD + I_am NSP,WORD + I_am EXTOPEN_FLAG,WORD,<0> ;FT. extended open input flag ;AN000; + I_am EXTOPEN_ON,BYTE,<0> ;FT. extended open conditional flag ;AN000; + I_am EXTOPEN_IO_MODE,WORD,<0>;FT. extende open io mode ;AN000; + I_am SAVE_DI,WORD ;FT. extende open saved DI ;AN000; + I_am SAVE_ES,WORD ;FT. extende open saved ES ;AN000; + I_am SAVE_DX,WORD ;FT. extende open saved DX ;AN000; + I_am SAVE_CX,WORD ;FT. extende open saved CX ;AN000; + I_am SAVE_BX,WORD ;FT. extende open saved BX ;AN000; + I_am SAVE_SI,WORD ;FT. extende open saved SI ;AN000; + I_am SAVE_DS,WORD ;FT. extende open saved DS ;AN000; + I_am HIGH_SECTOR,WORD,<0> ;>32mb higher sector # ;AN000; + I_am HIGH_SECTOR_TEMP,WORD,<0>;>32mb high sector # ;AN000; + I_am DISK_FULL,BYTE ;>32mb indicating disk full when 1 ;AN000; + I_am TEMP_VAR,WORD ; temporary variable for everyone ;AN000; + I_am TEMP_VAR2,WORD ; temporary variable 2 for everyone ;AN000; + I_am DrvErr,BYTE ; used to save drive error ;AN000; + I_am DOS34_FLAG,WORD,<0> ; common flag for DOS 3.4 ;AN000; + I_am NO_FILTER_PATH,DWORD ; pointer to orignal path ;AN000; + I_am NO_FILTER_DPATH,DWORD ; pointer to orignal path of destination;AN000; + I_am Callback_SS,WORD ;AN000; call back SS for system call + I_am Callback_SP,WORD ;AN000; call back SP for system call + I_am Callback_flag,BYTE,<0> ;AN000; call back flag + + +; make those pushes fast!!! +EVEN +StackSize = 180h ; gross but effective +;;;StackSize = 300h ; This is a "trial" change IBM hasn't +;;; ; made up their minds about + +; +; WARNING!!!! DskStack may grow into AUXSTACK due to interrupt service. +; This is NO problem as long as AUXSTACK comes immediately before DSKSTACK +; + + PUBLIC RENAMEDMA,AuxStack,DskStack,IOStack +RENAMEDMA LABEL BYTE ; See DOS_RENAME + + DB StackSize DUP (?) ; +AuxStack LABEL BYTE + + DB StackSize DUP (?) ; +DskStack LABEL BYTE + + DB StackSize DUP (?) ; +IOStack LABEL BYTE + + +; patch space for Boca folks. +; Say What????!!! This does NOT go into the swappable area! +; NOTE: We include the decl of ibmpatch in ms-dos even though it is not needed. +; This allows the REDIRector to work on either IBM or MS-DOS. + +PUBLIC IBMPATCH +IBMPATCH label byte + I_am PRINTER_FLAG,BYTE,<0> ; [SYSTEM] status of PRINT utility + I_am VOLCHNG_FLAG,BYTE,<0> ; [SYSTEM] true if volume label created + I_am VIRTUAL_OPEN,BYTE,<0> ; [SYSTEM] non-zero if we opened a virtual file + +; Following 4 variables moved to MSDATA.asm from MSTABLE.asm (P4986) + I_am FSeek_drive,BYTE ;AN000; fastseek drive # + I_am FSeek_firclus,WORD ;AN000; fastseek first cluster # + I_am FSeek_logclus,WORD ;AN000; fastseek logical cluster # + I_am FSeek_logsave,WORD ;AN000; fastseek returned log clus # + I_am ACT_PAGE,WORD,<-1> ;;;;;;; ;BL ; active EMS page ;AN000; + + +SWAP_END LABEL BYTE +PUBLIC SWAP_END + +; THE FOLLOWING BYTE MUST BE HERE, IMMEDIATELY FOLLOWING SWAP_END. IT CANNOT +; BE USED. If the size of the swap data area is ODD, it will be rounded up +; to include this byte. + DB ? + + DB (512+80+32-(SWAP_END-ibmpatch)) DUP (?) + +MSDAT001e label byte + +.xall + +DATA ENDS + \ No newline at end of file diff --git a/v4.0/src/INC/MULT.INC b/v4.0/src/INC/MULT.INC new file mode 100644 index 0000000..7509a07 --- /dev/null +++ b/v4.0/src/INC/MULT.INC @@ -0,0 +1,184 @@ +; SCCSID = @(#)mult.asm 1.2 85/04/12 +Break + +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +; Critical section definitions +; +; These below are subject to leave-all sections +critDisk EQU 1 ; Disk I/O critical section +critDevice EQU 2 ; Device I/O critical section +critShare EQU 1 ; Sharer I/O critical section +critMem EQU 1 ; memory maintenance critical section +critNet EQU 5 ; network critical section +critSFT EQU 1 ; sft table allocation +critIFS EQU 6 ; ifsfunc critical section +; These below are not subject to leave-all sections +critASSIGN EQU 8 ; Assign has munged a system call +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + +; +; The current set of defined multiplex channels is (* means documented): +; +; Channel(h) Issuer Receiver Function +; 00 server PSPRINT print job control +; *01 print/apps PRINT Queueing of files +; 02 BIOS REDIR signal open/close of printers +; +; 05 command REDIR obtain text of net int 24 message +; *06 server/assign ASSIGN Install check +; +; 08 external driver IBMBIO interface to internal routines +; +; 10 sharer/server Sharer install check +; 11 DOS/server Redir install check/redirection funcs +; 12 sharer/redir DOS dos functions and structure maint +; 13 MSNET MSNET movement of NCBs +; 13 external driver IBMBIO Reset_Int_13, allows installation +; of alternative INT_13 drivers after +; boot_up +; 14 (IBM) DOS NLSFUNC down load NLS country info,DOS 3.3 +; 14 (MS) APPS POPUP MSDOS 4 popup screen functions +; 15 APPS MSCDEX CD-ROM extensions interface +; 16 WIN386 WIN386 Windows communications +; 17 Clipboard WINDOWS Clipboard interface +; *18 Applications MS-Manger Toggle interface to manager +; 19 Shell +; 1A Ansi.sys +; 1B Fastopen,Vdisk IBMBIO EMS INT 67H stub handler +; +; AC Graphics +; AD NLS (toronto) +; AE +; AF Mode +; B0 GRAFTABL GRAFTABL +; + + +;MUX 00-3F reserverd for IBM +;MUX 80-BF reserverd for IBM +;MUX 40-7F reserved for Microsoft +;MUX C0-FF users + + + +MultSHARE EQU 10h ; sharer + ; 1 MFT_enter + ; 2 MFTClose + ; 3 MFTclU + ; 4 MFTCloseP + ; 5 MFTCloN + ; 6 set_block + ; 7 clr_block + ; 8 chk_block + ; 9 MFT_get + ; 10 ShSave + ; 11 ShChk + ; 12 ShCol + ; 13 ShCloseFile + +MultNET EQU 11h ; Network support +MultIFS EQU 11h ; Network support + ; 1 IFS_RMDIR + ; 2 IFS_SEQ_RMDIR + ; 3 IFS_MKDIR + ; 4 IFS_SEQ_MKDIR + ; 5 IFS_CHDIR + ; 6 IFS_CLOSE + ; 7 IFS_COMMIT + ; 8 IFS_READ + ; 9 IFS_WRITE + ; 10 IFS_LOCK + ; 11 IFS_UNLOCK + ; 12 IFS_DISK_INFO + ; 13 IFS_SET_FILE_ATTRIBUTE + ; 14 IFS_SEQ_SET_FILE_ATTRIBUTE + ; 15 IFS_GET_FILE_INFO + ; 16 IFS_SEQ_GET_FILE_INFO + ; 17 IFS_RENAME + ; 18 IFS_SEQ_RENAME + ; 19 IFS_DELETE + ; 20 IFS_SEQ_DELETE + ; 21 IFS_OPEN + ; 22 IFS_SEQ_OPEN + ; 23 IFS_CREATE + ; 24 IFS_SEQ_CREATE + ; 25 IFS_SEQ_SEARCH_FIRST + ; 26 IFS_SEQ_SEARCH_NEXT + ; 27 IFS_SEARCH_FIRST + ; 28 IFS_SEARCH_NEXT + ; 29 IFS_ABORT + ; 30 IFS_ASSOPER + ; 31 Printer_SET_STRING + ; 32 IFSFlushBuf + ; 33 IFSBufWrite + ; 34 IFSResetEnvironment + ; 35 IFSSpoolCheck + ; 36 IFSSpoolClose + +MultDOS EQU 12h ; DOS call back + ; 1 DOS_CLOSE + ; 2 RECSET + ; 3 Get DOSGROUP + ; 4 PATHCHRCMP + ; 5 OUT + ; 6 NET_I24_ENTRY + ; 7 PLACEBUF + ; 8 FREE_SFT + ; 9 BUFWRITE + ; 10 SHARE_VIOLATION + ; 11 SHARE_ERROR + ; 12 SET_SFT_MODE + ; 13 DATE16 + ; 14 SETVISIT + ; 15 SCANPLACE + ; 16 SKIPVISIT + ; 17 StrCpy + ; 18 StrLen + ; 19 Ucase + ; 20 POINTCOMP + ; 21 CHECKFLUSH + ; 22 SFFromSFN + ; 23 GetCDSFromDrv + ; 24 Get_User_Stack + ; 25 GetThisDrv + ; 26 DriveFromText + ; 27 SETYEAR + ; 28 DSUM + ; 29 DSLIDE + ; 30 StrCmp + ; 31 initcds + ; 32 pjfnfromhandle + ; 33 $NameTrans + ; 34 CAL_LK + ; 35 DEVNAME + ; 36 Idle + ; 37 DStrLen + ; 38 NLS_OPEN DOS 3.3 + ; 39 $CLOSE DOS 3.3 + ; 40 NLS_LSEEK DOS 3.3 + ; 41 $READ DOS 3.3 + ; 42 FastInit DOS 4.0 + ; 43 NLS_IOCTL DOS 3.3 + ; 44 GetDevList DOS 3.3 + ; 45 NLS_GETEXT DOS 3.3 + ; 46 MSG_RETRIEVAL DOS 4.0 + ; 47 FAKE_VERSION DOS 4.0 + ; +NLSFUNC EQU 14h ; NLSFUNC CALL , DOS 3.3 + ; 0 NLSInstall + ; 1 ChgCodePage + ; 2 GetExtInfo + ; 3 SetCodePage + ; 4 GetCntry + ; +;FASTOPEN is not chained through INT 2F ; DOS 3.3 F.C. +; it calls Multdos 42 to set up an entry routine address + ; 0 Install status (reserved) + ; 1 Lookup + ; 2 Insert + ; 3 Delete + ; 4 Purge (reserved) diff --git a/v4.0/src/INC/NIBDOS.ASM b/v4.0/src/INC/NIBDOS.ASM new file mode 100644 index 0000000..3cfe74c --- /dev/null +++ b/v4.0/src/INC/NIBDOS.ASM @@ -0,0 +1,7 @@ +; SCCSID = @(#)nibdos.asm 1.1 85/04/10 +TITLE NIBDOS +NAME MSDOS_3 + +include mssw.asm +include msconst.asm + END diff --git a/v4.0/src/INC/PARSE.ASM b/v4.0/src/INC/PARSE.ASM new file mode 100644 index 0000000..80dc9d7 --- /dev/null +++ b/v4.0/src/INC/PARSE.ASM @@ -0,0 +1,2974 @@ + PAGE ;AN000; +; $SALUT (4,4,8,41) +;(deleted).XLIST +;(deleted)INCLUDE STRUC.INC ;AN020;structured macro definitions for .IF,.ELSE etc. +;(deleted).LIST +; +; NOTE: basesw must be set properly to allow the PARSER to access psdata. +; - basesw undefined means CS seg. override for psdata access. +; - basesw = 1 means DS seg. override for psdata access & +; DS must point to psdata. +; - basesw = 0 means ES seg. override for psdata access & +; ES must point to psdata. +; +; +IFNDEF basesw ;AN022; + psdata_seg EQU CS ;AN022; +ELSE ;AN022; + IF basesw ;AN022;IF "basesw EQU 1" specified by caller THEN + psdata_seg EQU DS ;AN022; + ELSE ;AN022; + psdata_seg EQU ES ;AN022;ELSE only other choice is ES (basesw EQU 0) + ENDIF ;AN022; +ENDIF ;AN022; + +ifndef incsw ;AN000; (tm03) Someone doesn't want to include psdata + incsw equ 1 ;AN000; include psdata.inc (tm03) +endif ;AN000; (tm03) +if incsw ;AN000; If incsw = 1 then (tm03) + include psdata.inc ;AN000; include psdata.inc (tm03) +endif ;AN000; endif (tm03) + PAGE ;AN000; +IF1 ;AN000; + %OUT INCLUDING COMP=COMMON DSN=PARSE.ASM...;AN000; +ENDIF ;AN000; +;*********************************************************************** +; SysParse; +; +; Function : Parser Entry +; +; Input: DS:SI -> command line +; ES:DI -> parameter block +; psdata_seg -> psdata.inc +; CX = operand ordinal +; +; Note: ES is the segment containing all the control blocks defined +; by the caller, except for the DOS COMMAND line parms, which +; is in DS. +; +; Output: CY = 1 error of caller, means invalid parameter block or +; invalid value list. But this parser does NOT implement +; this feature. Therefore CY always zero. +; +; CY = 0 AX = return code +; BL = terminated delimiter code +; CX = new operand ordinal +; SI = set past scaned operand +; DX = selected result buffer +; +; Use: $P_Skip_Delim, $P_Chk_EOL, $P_Chk_Delim, $P_Chk_DBCS +; $P_Chk_Swtch, $P_Chk_Pos_Control, $P_Chk_Key_Control +; $P_Chk_Sw_Control, $P_Fill_Result +; +; Vars: $P_Ordinal(RW), $P_RC(RW), $P_SI_Save(RW), $P_DX(R), $P_Terminator(R) +; $P_SaveSI_Cmpx(W), $P_Flags(RW), $P_Found_SYNONYM(R), $P_Save_EOB(W) +; +;-------- Modification History ----------------------------------------- +; +; 4/04/87 : Created by K. K, +; 4/28/87 : $P_Val_YH assemble error (tm01) +; : JMP SHORT assemble error (tm02) +; 5/14/87 : Someone doesn't want to include psdata (tm03) +; 6/12/87 : $P_Bridge is missing when TimeSw equ 0 and (CmpxSw equ 1 or +; DateSW equ 1) (tm04) +; 6/12/87 : $P_SorD_Quote is missing when QusSw equ 0 and CmpxSW equ 1 +; (tm05) in PSDATA.INC +; 6/12/87 : $P_FileSp_Char and $P_FileSP_Len are missing +; when FileSW equ 0 and DrvSW equ 1 (tm06) in PSDATA.INC +; 6/18/87 : $VAL1 and $VAL3, $VAL2 and $VAL3 can be used in the same +; value-list block (tm07) +; 6/20/87 : Add $P_SW to check if there's an omiting parameter after +; switch (keyword) or not. If there is, backup si for next call +; (tm08) +; 6/24/87 : Complex Item checking does not work correctly when CmpSW equ 1 +; and DateSW equ 0 and TimeSW equ 0 (tm09) +; 6/24/87 : New function flag $P_colon_is_not_necessary for switch +; /+15 and /+:15 are allowed for user (tm10) +; 6/29/87 : ECS call changes DS register but it causes the address problem +; in user's routines. $P_Chk_DBCS (tm11) +; 7/10/87 : Switch with no_match flag (0x0000H) does not work correctly +; (tm12) +; 7/10/87 : Invalid switch/keyword does not work correctly +; (tm13) +; 7/10/87 : Drive_only breaks 3 bytes after the result buffer +; (tm14) +; 7/12/87 : Too_Many_Operands sets DX=0 as the PARSE result +; (tm15) +; 7/24/87 : Negative lower bound on numeric ranges cause trouble + +; 7/24/87 : Quoted strings being returned with quotes. + +; 7/28/87 : Kerry S (;AN018;) +; Non optional value on switch (match flags<>0 and <>1) not flagged +; as an error when missing. Solution: return error 2. Modules +; affected: $P_Chk_SW_Control. + +; 7/29/87 : Kerry S (;AN019;) +; Now allow the optional bit in match flags for switches. This +; allows the switch to be encountered with a value or without a +; value and no error is returned. +; + +; 8/28/87 : Ed K, Kerry S (;AN020;) +; 9/14/87 In PROC $P_Get_DecNum, when checking for field separators +; within a date response, instead of checking just for the one +; character defined by the COUNTRY DEPENDENT INFO, check for +; all three chars, "-", "/", and ".". Change $P_Chk_Switch to allow +; slashes in date strings when DateSw (assembler switch) is set. + +; 9/1/87 : Kerry S (;AN021) +; In PROC $P_String_Comp, when comparing the switch or keyword on +; the command line with the string in the control block the +; comparing was stopping at a colon (switch) or equal (keyword) +; on the command line and assuming a match. This allowed a shorter +; string on the command line than in the synonym list in the control +; block. I put in a test for a null in the control block so the +; string in the control block must be the same length as the string +; preceeding the colon or equal on the command line. + +; 8/28/87 : Kerry S (;AN022;) +; All references to data in PSDATA.INC had CS overrides. This caused +; problems for people who included it themselves in a segment other +; than CS. Added switch to allow including PSDATA.INC in any +; segment. + +; 9/16/87 : Ed K (;AN023;) PTM1040 +; in $p_set_cdi PROC, it assumes CS points to psdata. Change Push CS +; into PUSH PSDATA_SEG. In $P_Get_DecNum PROC, fix AN020 +; forced both TIME and DATE to use the delims, "-","/",".". +; Created FLag, in $P_time_Format PROC, to request the delim in +; BL be used if TIME is being parsed. + +; 9/24/87 : Ed K +; Removed the include to STRUC.INC. Replaced the STRUC macro +; invocations with their normally expanded code; made comments +; out of the STRUC macro invocation statements to maintain readability. + +; 9/24/87 : Ed K (;AN024;) PTM1222 +; When no CONTROL for a keyword found, tried to fill in RESULT +; pointed to by non-existant CONTROL. + +; 10/15/87 : Ed K (;AN025;) PTM1672 +; A quoted text string can be framed only by double quote. Remove +; support to frame quoted text string with single quote. +; (apostrophe) $P_SorD_Quote is removed from PSDATA.INC. +; $P_SQuote EQU also removed from PSDATA.INC. Any references to +; single quote in PROC prologues are left as is for history reasons. + +; This fixes another bug, not mentioned in p1672, in that two +; quote chars within a quoted string is supposed to be reported as +; one quote character, but is reported as two quotes. This changed +; two instructions in PROC $P_Quoted_Str. + +; Also fixed are several JMP that caused a NOP, these changed to +; have the SHORT operator to avoid the unneeded NOP. + +; The code and PSDATA.INC have been aligned for ease of reading. + +; 10/26/87 : Ed K (;AN026;) PTM2041, DATE within SWITCH, BX reference to +; psdata buffer should have psdata_seg. + +; 10/27/87 : Ed K (;AN027;) PTM2042 comma between keywords implies +; positional missing. + +; 11/06/87 : Ed K (;AN028;) PTM 2315 Parser should not use line feed +; as a line delimiter, should use carriage return. +; Define switch: LFEOLSW, if on, accept LF as end of line char. + +; 11/11/87 : Ed K (;AN029;) PTM 1651 GET RID OF WHITESPACE AROUND "=". + +; 11/18/87 : Ed K (;AN030;) PTM 2551 If filename is just "", then +; endless loop since SI is returned still pointing to start +; of that parm. + +; 11/19/87 : Ed K (;AN031;) PTM 2585 date & time getting bad values. +; Vector to returned string has CS instead of Psdata_Seg, but +; when tried to fix it on previous version, changed similar +; but wrong place. + +; 12/09/87 : Bill L (;AN032;) PTM 2772 colon and period are now valid +; delimiters between hours, minutes, seconds for time. And period +; and comma are valid delimiters between seconds and 100th second. + +; 12/14/87 : Bill L (;AN033;) PTM 2722 if illegal delimiter characters +; in a filespec, then flag an error. + +; 12/22/87 : Bill L (;AN034;) All local data to parser is now +; indexed off of the psdata_seg equate instead of the DS register. +; Using this method, DS can point to the segment of PSP or to psdata +; --> local parser data. Why were some references to local data changed +; to do this before, but not all ????? + +; 02/02/88 : Ed K (;AC035;) INSPECT utility, suggests optimizations. + +; 02/05/88 : Ed K (;AN036;) P3372-UPPERCASE TRANSLATION, PSDATA_SEG HOSED. +; +; 02/08/88 : Ed K (;AN037;) P3410-AVOID POP OF CS, CHECK BASESW FIRST. + +; 02/19/88 : Ed K (;AN038;) p3524 above noon and "am" should be error + +; 02/23/88 : Ed K (;AN039;) p3518 accept "comma" and "period" as decimal +; separator in TIME before hundredths field. +; +;*********************************************************************** +IF FarSW ;AN000;(Check if need far return) +SysParse proc far ;AN000; +ELSE ;AN000; +SysParse proc near ;AN000; +ENDIF ;AN000;(of FarSW) +; $SALUT (4,9,17,41) + mov psdata_seg:$P_Flags,0 ;AC034; Clear all internal flags +IF TimeSw ;AN039; FOR TIME ONLY + MOV PSDATA_SEG:$P_ORIG_ORD,CX ;AN039; ORIGINAL ORDINAL FROM CX + MOV PSDATA_SEG:$P_ORIG_STACK,SP ;AN039; ORIGINAL VALUE OF STACK FROM SP + MOV PSDATA_SEG:$P_ORIG_SI,SI ;AN039; ORIGINAL START PARSE POINTER FROM SI +$P_REDO_TIME: ;AN039; try to parse time again +ENDIF ;AN039; FOR TIME ONLY + cld ;AN000; confirm forward direction + mov psdata_seg:$P_ordinal,cx ;AC034; save operand ordinal + mov psdata_seg:$P_RC,$P_No_Error ;AC034; Assume no error + mov psdata_seg:$P_Found_SYNONYM,0 ;AC034; initalize synonym pointer + + mov word ptr psdata_seg:$P_DX,0 ;AC034; (tm15) +IF KeySW ;AN029; +;IN CASE THE USER PUT OPTIONAL WHITESPACE CHARS AROUND THE "=" USED IN +;KEYWORD DEFINITIONS, SCAN THE COMMAND LINE AND COMPRESS OUT ANY WHITESPACES +;NEXT TO "=" BEFORE STARTING THE USUAL PARSING. + push cx ;AN029; + push dx ;AN029; + push di ;AN029; + + push si ;AN029; remember where command line starts + mov cx,-1 ;AN029; init counter +; $do +$P_loc_eol: ;AN029; + inc cx ;AN029; bump counter of chars up to EOL + lodsb ;AN029; get a char from command line + CALL $P_Chk_EOL ;AN029; see if AL is EOL char + +; enddo z + jnz $P_loc_EOL ;AN029; not found that EOL char + + mov psdata_seg:$P_count_to_EOL,cx ;AN029;AC034;; save count of chars up to EOL + pop si ;AN029; restore start of command line + +;scan command string for combinations including "=", +; and replace each with just the simple "=" + +;REPEAT UNTIL ONE PASS IS MADE WHEREIN NO CHANGES WERE MADE +; $do +$P_DO1: ;AN029; + push si ;AN029; remember where string started + MOV CX,psdata_seg:$P_COUNT_TO_EOL ;AN029;AC034;; set count to no. chars in string, + ;AN029; not counting the EOL char + XOR BX,BX ;AN029;SET $P_REG_BL_DQ_SW TO "NOT IN QUOTES", AND... + ;AN029;SET $P_REG_BH_CG_SW TO "NO CHANGES MADE" +;MAKE ONE PASS THRU THE STRING, LOOKING AT EACH CHARACTER +; $do ;AN029; +$P_DO2: ;AN029; + cmp BYTE PTR [SI],$P_double_quote ;AN029; +; $if e ;AN029;if a double quote was found + JNE $P_IF3 ;AN029; + NOT $P_REG_BL_DQ_SW ;AN029;TOGGLE THE DOUBLE QUOTE STATE SWITCH +; $endif ;AN029; +$P_IF3: ;AN029; + OR $P_REG_BL_DQ_SW,$P_REG_BL_DQ_SW ;AN029;IS THE DOUBLE QUOTE SWITCH SET? +; $if Z ;AN029;IF NOT IN DOUBLE QUOTES + JNZ $P_IF5 ;AN029; + mov ax,word ptr [si] ;AN029; get pair to be checked out + cmp ax,$P_BL_EQ ;AN029;" =" +; $if e,or ;AN029; + JE $P_LL6 ;AN029; + cmp ax,$P_EQ_BL ;AN029;"= " +; $if e,or ;AN029; + JE $P_LL6 ;AN029; + cmp ax,$P_EQ_TB ;AN029; "=" +; $if e,or ;AN029; + JE $P_LL6 ;AN029; + cmp ax,$P_TB_EQ ;AN029;"=" +; $if e ;AN029;if this pair to be replaced with a single "=" + JNE $P_IF6 ;AN029; +$P_LL6: ;AN029; + mov BYTE PTR [SI],$P_Keyword ;AN029; "=" + inc si ;AN029;point to next char after the new "=" + mov di,si ;AN029;move target right after new "=" + + push si ;AN029;remember where i am, right after new "=" + PUSH CX ;AN029;SAVE CURRENT COUNT + inc si ;AN029;source is one beyond that + push es ;AN029;remember the extra segment + push ds ;AN029;temporarily, set source seg and + pop es ;AN029; target seg to the command line seg + rep movsb ;AN029;move chars left one position + pop es ;AN029;restore the extra segment + POP CX ;AN029;RESTORE CURRENT COUNT + pop si ;AN029;back to where I was + + DEC SI ;AN029;LOOK AT FIRST CHAR JUST MOVED + MOV $P_REG_BH_CG_SW,-1 ;AN029;set switch to say "a change was made" + DEC psdata_seg:$P_COUNT_TO_EOL ;AN029;AC034;;because just threw away a char + dec CX ;AN029;DITTO +; $endif ;AN029;comparand pair found? +$P_IF6: ;AN029; +; $endif ;AN029;double quote switch? +$P_IF5: ;AN029; + inc si ;AN029;bump index to look at next char in command string + dec CX ;AN029;one less char to look at +;(deleted ;AC035;) CMP CX,0 ;AN029;is char count all gone yet? +; $enddo LE ;AN029;quit if no more chars + JNLE $P_DO2 ;AN029; + pop si ;AN029;remember where string started + OR $P_REG_BH_CG_SW,$P_REG_BH_CG_SW ;AN029;WAS "A CHANGE MADE"? +; $enddo Z ;AN029;QUIT when no changes were made + JNZ $P_DO1 ;AN029; + pop di ;AN029; + pop dx ;AN029; + pop cx ;AN029; + +;NOW THAT ALL WHITESPACE SURROUNDING "=" HAVE BEEN COMPRESSED OUT, +;RESUME NORMAL PARSING... +ENDIF ;AN029; KEYWORDS SUPPORTED? + call $P_Skip_Delim ;AN000; Move si to 1st non white space + jnc $P_Start ;AN000; If EOL is not encountered, do parse + +;--------------------------- End of Line + mov ax,$P_RC_EOL ;AN000; set exit code to -1 + push bx ;AN000; + mov bx,es:[di].$P_PARMSX_Address ;AN000; Get the PARMSX address to + cmp cl,es:[bx].$P_MinP ;AN000; check ORDINAL to see if the minimum + jae $P_Fin ;AN000; positional found. + + mov ax,$P_Op_Missing ;AN000; If no, set exit code to missing operand +$P_Fin: ;AN000; + pop bx ;AN000; + jmp $P_Single_Exit ;AN000; return to the caller + +;--------------------------- +$P_Start: ;AN000; + mov psdata_seg:$P_SaveSI_Cmpx,si ;AN000;AC034; save ptr to command line for later use by complex, + push bx ;AN000; quoted string or file spec. + push di ;AN000; + push bp ;AN000; + lea bx,psdata_seg:$P_STRING_BUF ;AC034; set buffer to copy from command string + test psdata_seg:$P_Flags2,$P_Extra ;AC034; 3/9 extra delimiter encountered ? + jne $P_Pack_End ;AN000; 3/9 if yes, no need to copy + +$P_Pack_Loop: ;AN000; + lodsb ;AN000; Pick a operand from buffer + call $P_Chk_Switch ;AN000; Check switch character + jc $P_Pack_End_BY_EOL ;AN020; if carry set found delimiter type slash, need backup si, else continue + + call $P_Chk_EOL ;AN000; Check EOL character + je $P_Pack_End_BY_EOL ;AN000; need backup si + + call $P_Chk_Delim ;AN000; Check delimiter + jne $P_PL01 ;AN000; If no, process next byte + + test psdata_seg:$P_Flags2,$P_Extra ;AC034; 3/9 If yes and white spec, +; (tm08)jne $P_Pack_End ;AN000; 3/9 then + jne $P_Pack_End_backup_si ;AN000; (tm08) + + call $P_Skip_Delim ;AN000; skip subsequent white space,too + jmp short $P_Pack_End ;AN000; finish copy by placing NUL at end + +$P_PAck_End_backup_si: ;AN000; (tm08) + test psdata_seg:$P_Flags2,$P_SW+$P_equ ;AN000;AC034; (tm08) + je $P_Pack_End ;AN000; (tm08) + + dec si ;AN000; (tm08) + jmp short $P_Pack_End ;AN025; (tm08) + +$P_PL01: ;AN000; + mov psdata_seg:[bx],al ;AN000; move byte to STRING_BUF + cmp al,$P_Keyword ;AN000; if it is equal character, + jne $P_PL00 ;AN000; then + + or psdata_seg:$P_Flags2,$P_equ ;AC034; remember it in flag +$P_PL00: ;AN000; + inc bx ;AN000; ready to see next byte + call $P_Chk_DBCS ;AN000; was it 1st byte of DBCS ? + jnc $P_Pack_Loop ;AN000; if no, process to next byte + + lodsb ;AN000; if yes, store + mov psdata_seg:[bx],al ;AN000; 2nd byte of DBCS + inc bx ;AN000; update pointer + jmp short $P_Pack_Loop ;AN000; process to next byte + +$P_Pack_End_BY_EOL: ;AN000; + dec si ;AN000; backup si pointer +$P_Pack_End: ;AN000; + mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI + mov byte ptr psdata_seg:[bx],$P_NULL ;AN000; put NULL at the end + mov psdata_seg:$P_Save_EOB,bx ;AC034; 3/17/87 keep the address for later use of complex + mov bx,es:[di].$P_PARMSX_Address ;AN000; get PARMSX address + lea si,psdata_seg:$P_STRING_BUF ;AC034; + cmp byte ptr psdata_seg:[si],$P_Switch ;AN000; the operand begins w/ switch char ? + je $P_SW_Manager ;AN000; if yes, process as switch + + test psdata_seg:$P_Flags2,$P_equ ;AC034; the operand includes equal char ? + jne $P_Key_manager ;AN000; if yes, process as keyword + +$P_Positional_Manager: ;AN000; else process as positional + mov al,es:[bx].$P_MaxP ;AN000; get maxp + xor ah,ah ;AN000; ax = maxp + cmp psdata_seg:$P_ORDINAL,ax ;AC034; too many positional ? + jae $P_Too_Many_Error ;AN000; if yes, set exit code to too many + + mov ax,psdata_seg:$P_ORDINAL ;AC034; see what the current ordinal + shl ax,1 ;AN000; ax = ax*2 + inc bx ;AC035; add '2' to + inc bx ;AC035; BX reg + ;AN000; now bx points to 1st CONTROL +;(changed ;AC035;) add bx,2 ;AN000; now bx points to 1st CONTROL + add bx,ax ;AN000; now bx points to specified CONTROL address + mov bx,es:[bx] ;AN000; now bx points to specified CONTROL itself + call $P_Chk_Pos_Control ;AN000; Do process for positional + jmp short $P_Return_to_Caller ;AN000; and return to the caller + +$P_Too_Many_Error: ;AN000; + mov psdata_seg:$P_RC,$P_Too_Many ;AC034; set exit code + jmp short $P_Return_to_Caller ;AN000; and return to the caller +; +$P_SW_Manager: ;AN000; + mov al,es:[bx].$P_MaxP ;AN000; get maxp + xor ah,ah ;AN000; ax = maxp + inc ax ;AN000; + shl ax,1 ;AN000; ax = (ax+1)*2 + add bx,ax ;AN000; now bx points to maxs + mov cl,es:[bx] ;AN000; + xor ch,ch ;AN000; cx = maxs + or cx,cx ;AN000; at least one switch ? + je $P_SW_Not_Found ;AN000; + + inc bx ;AN000; now bx points to 1st CONTROL address + +$P_SW_Mgr_Loop: ;AN000; + push bx ;AN000; + mov bx,es:[bx] ;AN000; bx points to Switch CONTROL itself + call $P_Chk_SW_Control ;AN000; do process for switch + pop bx ;AN000; + jnc $P_Return_to_Caller ;AN000; if the CONTROL is for the switch, exit + + inc bx ;AC035; add '2' to + inc bx ;AC035; BX reg + ;AN000; else bx points to the next CONTROL +;(changed ;AC035;) add bx,2 ;AN000; else bx points to the next CONTROL + loop $P_SW_Mgr_Loop ;AN000; and loop + +$P_SW_Not_Found: ;AN000; + mov psdata_seg:$P_RC,$P_Not_In_SW ;AC034; here no CONTROL for the switch has + jmp short $P_Return_to_Caller0 ;AN000; not been found, means error. +; +$P_Key_Manager: ;AN000; + mov al,es:[bx].$P_MaxP ;AN000; get maxp + xor ah,ah ;AN000; ax = maxp + inc ax ;AN000; + shl ax,1 ;AN000; ax = (ax+1)*2 + add bx,ax ;AN000; now bx points to maxs + mov al,es:[bx] ;AN000; + xor ah,ah ;AN000; ax = maxs + shl ax,1 ;AN000; + inc ax ;AN000; ax = ax*2+1 + add bx,ax ;AN000; now bx points to maxk + mov cl,es:[bx] ;AN000; + xor ch,ch ;AN000; cx = maxk + or cx,cx ;AN000; at least one keyword ? + je $P_Key_Not_Found ;AN000; + + inc bx ;AN000; now bx points to 1st CONTROL + +$P_Key_Mgr_Loop: ;AN000; + push bx ;AN000; + mov bx,es:[bx] ;AN000; bx points to keyword CONTROL itself + call $P_Chk_Key_Control ;AN000; do process for keyword + pop bx ;AN000; + jnc $P_Return_to_Caller ;AN000; if the CONTROL is for the keyword, exit + + inc bx ;AC035; add '2' to + inc bx ;AC035; BX reg + ;AN000; else bx points to the next CONTROL +;(changed ;AC035;) add bx,2 ;AN000; else bx points to the next CONTROL + loop $P_Key_Mgr_Loop ;AN000; and loop + +$P_Key_Not_Found: ;AN000; + mov psdata_seg:$P_RC,$P_Not_In_Key ;AC034; here no CONTROL for the keyword has +$P_Return_to_Caller0: ;AN000; not been found, means error. + +;(deleted ;AN024;) mov bx,es:[bx-2] ;AN000; (tm13) backup bx + +;(deleted ;AN024;) mov al,$P_String ;AN000; Set +;(deleted ;AN024;) mov ah,$P_No_Tag ;AN000; result +;(deleted ;AN024;) call $P_Fill_Result ;AN000; buffer + +$P_Return_to_Caller: ;AN000; + pop bp ;AN000; + pop di ;AN000; + pop bx ;AN000; + mov cx,psdata_seg:$P_Ordinal ;AC034; return next ordinal + mov ax,psdata_seg:$P_RC ;AC034; return exit code + mov si,psdata_seg:$P_SI_Save ;AC034; return next operand pointer + mov dx,psdata_seg:$P_DX ;AC034; return result buffer address + mov bl,psdata_seg:$P_Terminator ;AC034; return delimiter code found +$P_Single_Exit: ;AN000; + clc ;AN000; + ret ;AN000; +SysParse endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Chk_Pos_Control +; +; Function: Parse CONTROL block for a positional +; +; Input: ES:BX -> CONTROL block +; psdata_seg:SI -> $P_STRING_BUF +; +; Output: None +; +; Use: $P_Fill_Result, $P_Check_Match_Flags +; +; Vars: $P_Ordinal(W), $P_RC(W) +;*********************************************************************** +$P_Chk_Pos_Control proc ;AN000; + push ax ;AN000; + mov ax,es:[bx].$P_Match_Flag ;AN000; + test ax,$P_Repeat ;AN000; repeat allowed ? + jne $P_CPC00 ;AN000; then do not increment ORDINAL + + inc psdata_seg:$P_ORDINAL ;AC034; update the ordinal +$P_CPC00: ;AN000; + cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; no data ? + jne $P_CPC01 ;AN000; + + test ax,$P_Optional ;AN000; yes, then is it optional ? + jne $P_CPC02 ;AN000; + + mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; no, then error 3/17/87 + jmp short $P_CPC_Exit ;AN000; + +$P_CPC02: ;AN000; + push ax ;AN000; + mov al,$P_String ;AN000; if it is optional return NULL + mov ah,$P_No_Tag ;AN000; no item tag indication + call $P_Fill_Result ;AN000; + pop ax ;AN000; + jmp short $P_CPC_Exit ;AN000; + +$P_CPC01: ;AN000; + call $P_Check_Match_Flags ;AN000; +$P_CPC_Exit: ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Chk_Pos_Control endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Chk_Key_Control +; +; Function: Parse CONTROL block for a keyword +; +; Input: ES:BX -> CONTROL block +; psdata_seg:SI -> $P_STRING_BUF +; +; Output: CY = 1 : not match +; +; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags +; +; Vars: $P_RC(W), $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W) +;*********************************************************************** +$P_Chk_Key_Control proc ;AN000; +IF KeySW ;AN000;(Check if keyword is supported) + or psdata_seg:$P_Flags2,$P_Key_Cmp ;AC034; Indicate keyword for later string comparison + call $P_Search_KEYorSW ;AN000; Search the keyword in the CONTROL block + jc $P_Chk_Key_Err0 ;AN000; not found, then try next CONTROL + + and psdata_seg:$P_Flags2,0ffh-$P_Key_Cmp ;AC034; reset the indicator previously set +; + push ax ;AN000; keyword= + mov ax,psdata_seg:$P_KEYorSW_Ptr ;AC034; ^ ^ + sub ax,si ;AN000; SI KEYorSW + add psdata_seg:$P_SaveSI_Cmpx,ax ;AC034; update for complex, quoted or file spec. + pop ax ;AN000; +; + mov si,psdata_seg:$P_KEYorSW_Ptr ;AC034; set si just after equal char + cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; any data after equal ? + je $P_Chk_Key_Err1 ;AN000; if no, syntax error + + call $P_Check_Match_Flags ;AN000; else, process match flags + clc ;AN000; + jmp short $P_Chk_Key_Exit ;AN000; + +$P_Chk_Key_Err0: ;AN000; + stc ;AN000; not found in keyword synonym list + jmp short $P_Chk_Key_Exit ;AN000; + +$P_Chk_Key_Err1: ;AN000; + mov psdata_seg:$P_RC,$P_Syntax ;AC034; no parameter is not specified after "=" +$P_Chk_Key_ErrExit: ;AN000; + push ax ;AN000; + mov al,$P_String ;AN000; set + mov ah,$P_No_Tag ;AN000; result + call $P_Fill_Result ;AN000; buffer + pop ax ;AN000; + clc ;AN000; +$P_Chk_Key_Exit: ;AN000; + ret ;AN000; +ELSE ;AN000;(of IF KeySW) + stc ;AN000;this logic works when the KeySW + ret ;AN000;is reset. +ENDIF ;AN000;(of KeySW) +$P_Chk_Key_Control endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +IF KeySW+SwSW ;AN000;(Check if keyword or switch is supported) +; $P_Search_KEYorSW: +; +; Function: Seach specified keyword or switch from CONTROL +; +; Input: ES:BX -> CONTROL block +; psdata_seg:SI -> $P_STRING_BUF +; +; Output: CY = 1 : not match +; +; Use: $P_String_Comp, $P_MoveBP_NUL, $P_Found_SYNONYM +;*********************************************************************** +$P_Search_KEYorSW proc ;AN000; + push bp ;AN000; + push cx ;AN000; + mov cl,es:[bx].$P_nid ;AN000; Get synonym count + xor ch,ch ;AN000; and set it to cx + or cx,cx ;AN000; No synonyms specified ? + je $P_KEYorSW_Not_Found ;AN000; then indicate not found by CY + + lea bp,es:[bx].$P_KEYorSW ;AN000; BP points to the 1st synonym +$P_KEYorSW_Loop: ;AN000; + call $P_String_Comp ;AN000; compare string in buffer w/ the synonym + jnc $P_KEYorSW_Found ;AN000; If match, set it to synonym pointer + + call $P_MoveBP_NUL ;AN000; else, bp points to the next string + loop $P_KEYorSW_Loop ;AN000; loop nid times +$P_KEYorSW_Not_Found: ;AN000; + stc ;AN000; indicate not found in synonym list + jmp short $P_KEYorSW_Exit ;AN000; and exit + +$P_KEYorSW_Found: ;AN000; + mov psdata_seg:$P_Found_SYNONYM,bp ;AC034; set synonym pointer + clc ;AN000; indicate found +$P_KEYorSW_Exit: ;AN000; + pop cx ;AN000; + pop bp ;AN000; + ret ;AN000; +$P_Search_KEYorSW endp ;AN000; +;*********************************************************************** +; $P_MoveBP_NUL +;*********************************************************************** +$P_MoveBP_NUL proc ;AN000; +$P_MBP_Loop: ;AN000; + cmp byte ptr es:[bp],$P_NULL ;AN000; Increment BP that points + je $P_MBP_Exit ;AN000; to the synomym list + + inc bp ;AN000; until + jmp short $P_MBP_Loop ;AN000; NULL encountered. + +$P_MBP_Exit: ;AN000; + inc bp ;AN000; bp points to next to NULL + ret ;AN000; +$P_MoveBP_NUL endp ;AN000; +ENDIF ;AN000;(of KeySW+SwSW) +PAGE ;AN000; +;*********************************************************************** +; $P_Chk_SW_Control +; +; Function: Parse CONTROL block for a switch +; +; Input: ES:BX -> CONTROL block +; psdata_seg:SI -> $P_STRING_BUF +; +; Output: CY = 1 : not match +; +; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags +; +; Vars: $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W) +;*********************************************************************** +$P_Chk_SW_Control proc ;AN000; + + +IF SwSW ;AN000;(Check if switch is supported) + or psdata_seg:$P_Flags2,$P_Sw_Cmp ;AC034; Indicate switch for later string comparison + call $P_Search_KEYorSW ;AN000; Search the switch in the CONTROL block + jc $P_Chk_SW_Err0 ;AN000; not found, then try next CONTROL + + and psdata_seg:$P_Flags2,0ffh-$P_Sw_Cmp ;AC034; reset the indicator previously set +; + push ax ;AN000; /switch: + mov ax,psdata_seg:$P_KEYorSW_Ptr ;AC034; ^ ^ + sub ax,si ;AN000; SI KEYorSW + add psdata_seg:$P_SaveSI_Cmpx,ax ;AC034; update for complex list + pop ax ;AN000; +; + mov si,psdata_seg:$P_KEYorSW_Ptr ;AC034; set si at the end or colon + cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; any data after colon + jne $P_CSW00 ;AN000; if yes, process match flags + + cmp byte ptr psdata_seg:[si-1],$P_Colon ;AN000; if no, the switch terminated by colon ? + jne $P_Chk_if_data_required ;AN000; if yes, + + mov psdata_seg:$P_RC,$P_Syntax ;AC034; return syntax error + jmp short $P_Chk_SW_Exit ;AN000; + +$P_Chk_if_data_required: ;AN018; no data, no colon + cmp es:[bx].$P_Match_Flag,0 ;AN018; should have data? zero match flag means switch followed by nothing is OK + je $P_Chk_SW_Exit ;AN018; match flags not zero so should have something if optional bit is not on + + test es:[bx].$P_Match_Flag,$P_Optional ;AN019; see if no value is valid + jnz $P_Chk_SW_Exit ;AN019; if so, then leave, else yell + + mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; return required operand missing + jmp short $P_Chk_SW_Exit ;AN018; + +$P_CSW00: ;AN000; + call $P_Check_Match_Flags ;AN000; process match flag + clc ;AN000; indicate match + jmp short $P_Chk_SW_Single_Exit ;AN000; + +$P_Chk_SW_Err0: ;AN000; + stc ;AN000; not found in switch synonym list + jmp short $P_Chk_SW_Single_Exit ;AN000; + +$P_Chk_SW_Exit: ;AN000; + push ax ;AN000; + mov al,$P_String ;AN000; set + mov ah,$P_No_Tag ;AN000; result + call $P_Fill_Result ;AN000; buffer + pop ax ;AN000; + clc ;AN000; +$P_Chk_SW_Single_Exit: ;AN000; + ret ;AN000; +ELSE ;AN000;(of IF SwSW) + stc ;AN000; this logic works when the SwSW + ret ;AN000; is reset. +ENDIF ;AN000;(of SwSW) +$P_Chk_SW_Control endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Fill_Result +; +; Function: Fill the result buffer +; +; Input: AH = Item tag +; AL = type +; AL = 1: CX,DX has 32bit number (CX = high) +; AL = 2: DX has index(offset) into value list +; AL = 6: DL has driver # (1-A, 2-B, ... , 26 - Z) +; AL = 7: DX has year, CL has month and CH has date +; AL = 8: DL has hours, DH has minutes, CL has secondsn, +; amd CH has hundredths +; AL = else: psdata_seg:SI points to returned string buffer +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Do_CAPS_String, $P_Remove_Colon, $P_Found_SYNONYM +; +; Vars: $P_DX(W) +;*********************************************************************** +$P_Fill_Result proc ;AN000; + push di ;AN000; + mov di,es:[bx].$P_Result_Buf ;AN000; di points to result buffer + mov psdata_seg:$P_DX,di ;AC034; set returned result address + mov es:[di].$P_Type,al ;AN000; store type + mov es:[di].$P_Item_Tag,ah ;AN000; store item tag + push ax ;AN000; + mov ax,psdata_seg:$P_Found_SYNONYM ;AC034; if yes, + mov es:[di].$P_SYNONYM_Ptr,ax ;AN000; then set it to the result + pop ax ;AN000; +$P_RLT04: ;AN000; + cmp al,$P_Number ;AN000; if number + jne $P_RLT00 ;AN000; + +$P_RLT02: ;AN000; + mov word ptr es:[di].$P_Picked_Val,dx ;AN000; then store 32bit + mov word ptr es:[di+2].$P_Picked_Val,cx ;AN000; number + jmp short $P_RLT_Exit ;AN000; + +$P_RLT00: ;AN000; + cmp al,$P_List_Idx ;AN000; if list index + jne $P_RLT01 ;AN000; + + mov word ptr es:[di].$P_Picked_Val,dx ;AN000; then store list index + jmp short $P_RLT_Exit ;AN000; + +$P_RLT01: ;AN000; + cmp al,$P_Date_F ;AN000; Date format ? + je $P_RLT02 ;AN000; + + cmp al,$P_Time_F ;AN000; Time format ? + je $P_RLT02 ;AN000; +; + cmp al,$P_Drive ;AN000; drive format ? + jne $P_RLT03 ;AN000; + + mov byte ptr es:[di].$P_Picked_Val,dl ;AN000; store drive number + jmp short $P_RLT_Exit ;AN000; + +$P_RLT03: ;AN000; + cmp al,$P_Complex ;AN000; complex format ? + jne $P_RLT05 ;AN000; + + mov ax,psdata_seg:$P_SaveSI_Cmpx ;AC034; then get pointer in command buffer + inc ax ;AN000; skip left Parentheses + mov word ptr es:[di].$P_Picked_Val,ax ;AN000; store offset + mov word ptr es:[di+2].$P_Picked_Val,ds ;AN000; store segment + jmp short $P_RLT_Exit ;AN000; + +$P_RLT05: ;AN000; +;------------------------ AL = 3, 5, or 9 + mov word ptr es:[di].$P_Picked_Val,si ;AN000; store offset of STRING_BUF +;(replaced ;AN031;) mov word ptr es:[di+word].$P_Picked_Val,cs ;AN000; store segment of STRING_BUF + mov word ptr es:[di+2].$P_Picked_Val,Psdata_Seg ;AN031; store segment of STRING_BUF +; + push ax ;AN000; + test byte ptr es:[bx].$P_Function_Flag,$P_CAP_File ;AN000; need CAPS by file table? + je $P_RLT_CAP00 ;AN000; + + mov al,$P_DOSTBL_File ;AN000; use file upper case table + jmp short $P_RLT_CAP02 ;AN000; + +$P_RLT_CAP00: ;AN000; + test byte ptr es:[bx].$P_Function_Flag,$P_CAP_Char ;AN000; need CAPS by char table ? + je $P_RLT_CAP01 ;AN000; + + mov al,$P_DOSTBL_Char ;AN000; use character upper case table +$P_RLT_CAP02: ;AN000; + call $P_Do_CAPS_String ;AN000; process CAPS along the table +$P_RLT_CAP01: ;AN000; + pop ax ;AN000; + test byte ptr es:[bx].$P_Function_Flag,$P_Rm_Colon ;AN000; removing colon at end ? + je $P_RLT_Exit ;AN000; + + call $P_Remove_Colon ;AN000; then process it. +$P_RLT_Exit: ;AN000; + pop di ;AN000; + ret ;AN000; +$P_Fill_Result endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Check_Match_Flags +; +; Function: Check the mutch_flags and make the exit code and set the +; result buffer +; +; Check for types in this order: +; Complex +; Date +; Time +; Drive +; Filespec +; Quoted String +; Simple String +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Value, P$_SValue, $P_Simple_String, $P_Date_Format +; $P_Time_Format, $P_Complex_Format, $P_File_Foemat +; $P_Drive_Format +;*********************************************************************** +$P_Check_Match_Flags proc ;AN000; + mov psdata_seg:$P_err_flag,$P_NULL ;AN033;AC034;; clear filespec error flag. + push ax ;AN000; + mov ax,es:[bx].$P_Match_Flag ;AN000; load match flag(16bit) to ax + + or ax,ax ;AC035; test ax for zero +;(changed ;AC035;) cmp ax,0 ;AN000; (tm12) + jne $P_Mat ;AN000; (tm12) + + push ax ;AN000; (tm12) + push bx ;AN000; (tm12) + push dx ;AN000; (tm12) + push di ;AN000; (tm12) + mov psdata_seg:$P_RC,$P_Syntax ;AC034; (tm12) + mov ah,$P_No_Tag ;AN000; (tm12) + mov al,$P_String ;AN000; (tm12) + call $P_Fill_Result ;AN000; (tm12) + pop di ;AN000; (tm12) + pop dx ;AN000; (tm12) + pop bx ;AN000; (tm12) + pop ax ;AN000; (tm12) + jmp short $P_Bridge ;AC035; (tm12) + +$P_Mat: ;AN000; (tm12) + +IF CmpxSW ;AN000;(Check if complex item is supported) + test ax,$P_Cmpx_S ;AN000; Complex string + je $P_Match01 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_Complex_Format ;AN000; do process + cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type + jne $P_Bridge ;AN000; + +$P_Match01: ;AN000; +ENDIF ;AN000;(of CmpxSW) +IF DateSW ;AN000;(Check if date format is supported) + test ax,$P_Date_S ;AN000; Date string + je $P_Match02 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_Date_Format ;AN000; do process + cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type + jne $P_Bridge ;AN000; + +$P_Match02: ;AN000; +ENDIF ;AN000;(of DateSW) +IF TimeSW ;AN000;(Check if time format is supported) + test ax,$P_Time_S ;AN000; Time string + je $P_Match03 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_Time_Format ;AN000; do process + cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type +; je $P_Match03 ;AN000: + + jne $P_Bridge ;AN000; (tm09) + +ENDIF ;AN000;(of TimeSW) (tm04) + jmp short $P_Match03 ;AN025; (tm09) + +$P_Bridge: ;AN000; +; jmp short $P_Match_Exit (tm02) + + jmp $P_Match_Exit ;AN000; (tm02) + +$P_Match03: ;AN000; +; ENDIF ;AN000;(of TimeSW) (tm04) +IF NumSW ;AN000;(Check if numeric value is supported) + test ax,$P_Num_Val ;AN000; Numeric value + je $P_Match04 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_Value ;AN000; do process + cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type + jne $P_Match_Exit ;AN000; + +$P_Match04: ;AN000; + test ax,$P_SNUM_Val ;AN000; Signed numeric value + je $P_Match05 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_SValue ;AN000; do process + cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type + jne $P_Match_Exit ;AN000; + +$P_Match05: ;AN000; +ENDIF ;AN000;(of NumSW) +IF DrvSW ;AN000;(Check if drive only is supported) + test ax,$P_Drv_Only ;AN000; Drive only + je $P_Match06 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_File_Format ;AN000; 1st, call file format + call $P_Drive_Format ;AN000; check drive format, next + cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examinee the next type + jne $P_Match_Exit ;AN000; + +$P_Match06: ;AN000; +ENDIF ;AN000;(of DrvSW) +IF FileSW ;AN000;(Check if file spec is supported) + test ax,$P_File_Spc ;AN000; File spec + je $P_Match07 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_File_Format ;AN000; do process + cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type + jne $P_Match_Exit ;AN000; + +$P_Match07: ;AN000; +ENDIF ;AN000;(of FileSW) +IF QusSW ;AN000;(Check if quoted string is supported) + test ax,$P_Qu_String ;AN000; Quoted string + je $P_Match08 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_Quoted_Format ;AN000; do process + cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type + jne $P_Match_Exit ;AN000; + +$P_Match08: ;AN000; +ENDIF ;AN000;(of QusSW) + test ax,$P_Simple_S ;AN000; Simple string + je $P_Match09 ;AN000; + + mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error + call $P_Simple_String ;AN000; do process +;;;; cmp psdata_seg:$P_RC,$P_Syntax ;AC034; These two lines will be alive +;;;; jne $P_Match_Exit ;when extending the match_flags. +$P_Match09: ;AN000; +$P_Match_Exit: ;AN000; + cmp psdata_seg:$P_err_flag,$P_error_filespec ;AC034; bad filespec ? + jne $P_Match2_Exit ;AN033; no, continue + cmp psdata_seg:$P_RC,$P_No_Error ;AN033;AC034;; check for other errors ? + jne $P_Match2_Exit ;AN033; no, continue + mov psdata_seg:$P_RC,$P_Syntax ;AN033;AC034;; set error flag +$P_Match2_Exit: ;AN033; + pop ax ;AN000; + ret ;AN000; +$P_Check_Match_Flags endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Remove_Colon; +; +; Function: Remove colon at end +; +; Input: psdata_seg:SI points to string buffer to be examineed +; +; Output: None +; +; Use: $P_Chk_DBCS +;*********************************************************************** +$P_Remove_Colon proc ;AN000; + push ax ;AN000; + push si ;AN000; +$P_RCOL_Loop: ;AN000; + mov al,psdata_seg:[si] ;AN000; get character + or al,al ;AN000; end of string ? + je $P_RCOL_Exit ;AN000; if yes, just exit + + cmp al,$P_Colon ;AN000; is it colon ? + jne $P_RCOL00 ;AN000; + + cmp byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; if so, next is NULL ? + jne $P_RCOL00 ;AN000; no, then next char + + mov byte ptr psdata_seg:[si],$P_NULL ;AN000; yes, remove colon + jmp short $P_RCOL_Exit ;AN000; and exit. + +$P_RCOL00: ;AN000; + call $P_Chk_DBCS ;AN000; if not colon, then check if + jnc $P_RCOL01 ;AN000; DBCS leading byte. + + inc si ;AN000; if yes, skip trailing byte +$P_RCOL01: ;AN000; + inc si ;AN000; si points to next byte + jmp short $P_RCOL_Loop ;AN000; loop until NULL encountered + +$P_RCOL_Exit: ;AN000; + pop si ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Remove_Colon endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Do_CAPS_String; +; +; Function: Perform capitalization along with the file case map table +; or character case map table. +; +; Input: AL = 2 : Use character table +; AL = 4 : Use file table +; psdata_seg:SI points to string buffer to be capitalized +; +; Output: None +; +; Use: $P_Do_CAPS_Char, $P_Chk_DBCS +;*********************************************************************** +$P_Do_CAPS_String proc ;AN000; + push si ;AN000; + push dx ;AN000; + mov dl,al ;AN000; save info id + +$P_DCS_Loop: ;AN000; + mov al,psdata_seg:[si] ;AN000; load charater and + call $P_Chk_DBCS ;AN000; check if DBCS leading byte + jc $P_DCS00 ;AN000; if yes, do not need CAPS + + or al,al ;AN000; end of string ? + je $P_DCS_Exit ;AN000; then exit. + + call $P_Do_CAPS_Char ;AN000; Here a SBCS char need to be CAPS + mov psdata_seg:[si],al ;AN000; stored upper case char to buffer + jmp short $P_DCS01 ;AN000; process nexit +$P_DCS00: ;AN000; + inc si ;AN000; skip DBCS leading and trailing byte +$P_DCS01: ;AN000; + inc si ;AN000; si point to next byte + jmp short $P_DCS_Loop ;AN000; loop until NULL encountered +$P_DCS_Exit: ;AN000; + pop dx ;AN000; + pop si ;AN000; + ret ;AN000; +$P_Do_CAPS_String endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Do_CAPS_Char; +; +; Function: Perform capitalization along with the file case map table +; or character case map table. +; +; Input: DL = 2 : Use character table +; DL = 4 : Use file table +; AL = character to be capitalized +; +; Output: None +; +; Use: INT 21h /w AH=65h +;*********************************************************************** +$P_Do_CAPS_Char proc ;AN000; + cmp al,$P_ASCII80 ;AN000; need upper case table ? + jae $P_DCC_Go ;AN000; + + cmp al,"a" ;AN000; if no, + jb $P_CAPS_Ret ;AN000; check if "a" <= AL <= "z" + + cmp al,"z" ;AN000; + ja $P_CAPS_Ret ;AN000; if yes, make CAPS + + and al,$P_Make_Upper ;AN000; else do nothing. + jmp short $P_CAPS_Ret ;AN000; + +$P_DCC_Go: ;AN000; + push bx ;AN000; + push es ;AN000; + push di ;AN000; +IF CAPSW ;AN000;(Check if uppercase conversion is supported) + lea di,psdata_seg:$P_File_CAP_Ptr ;AC034; + cmp dl,$P_DOSTBL_File ;AN000; Use file CAPS table ? + je $P_DCC00 ;AN000; + +ENDIF ;AN000;(of CAPSW) + lea di,psdata_seg:$P_Char_CAP_Ptr ;AC034; or use char CAPS table ? +$P_DCC00: ;AN000; + cmp psdata_seg:[di],dl ;AN000; already got table address ? + je $P_DCC01 ;AN000; if no, + +;In this next section, ES will be used to pass a 5 byte workarea to INT 21h, +; the GET COUNTYRY INFO call. This usage of ES is required by the function +; call, regardless of what base register is currently be defined as PSDATA_SEG. +;BASESW EQU 0 means that ES is the psdata_seg reg. + +IFDEF BASESW ;AN037; If BASESW has been defined, and + IFE BASESW ;AN037; If ES is psdata base + push PSDATA_SEG ;AN037; save current base reg + ENDIF ;AN037; +ENDIF ;AN037; + + push ax ;AN000; get CAPS table thru DOS call + push cx ;AN000; + push dx ;AN000; + + + push PSDATA_SEG ;AC036; pass current base seg into + ;(Note: this used to push CS. BUG... + pop es ;AN000; ES reg, required for + ;get extended country information + mov ah,$P_DOS_Get_TBL ;AN000; get extended CDI + mov al,dl ;AN000; upper case table + mov bx,$P_DOSTBL_Def ;AN000; get active CON + mov cx,$P_DOSTBL_BL ;AN000; buffer length + mov dx,$P_DOSTBL_Def ;AN000; get for default code page + ;DI already set to point to buffer + int 21h ;AN000; es:di point to buffer that + ;now has been filled in with info + pop dx ;AN000; + pop cx ;AN000; + pop ax ;AN000; +IFDEF BASESW ;AN037; If BASESW has been defined, and + IFE BASESW ;AN037; If ES is psdata base + pop PSDATA_SEG ;AN037; restore current base reg + ENDIF ;AN037; +ENDIF ;AN037; +$P_DCC01: ;AN000; + +;In this next section, ES will be used as the base of the XLAT table, provided +; by the previous GET COUNTRY INFO DOS call. This usage of ES is made +; regardless of which base reg is currently the PSDATA_SEG reg. + +IFDEF BASESW ;AN037; If BASESW has been defined, and + IFE BASESW ;AN037; If ES is psdata base + push PSDATA_SEG ;AN037; save current base reg + ENDIF ;AN037; +ENDIF ;AN037; + mov bx,psdata_seg:[di+$P_DOS_TBL_Off] ;AN000; get offset of table + mov es,psdata_seg:[di+$P_DOS_TBL_Seg] ;AN000; get segment of table + inc bx ;AC035; add '2' to + inc bx ;AC035; BX reg + ;AN000; skip length field +;(changed ;AN035;) add bx,word ;AN000; skip length field + sub al,$P_ASCII80 ;AN000; make char to index + xlat es:[bx] ;AN000; perform case map + +IFDEF BASESW ;AN037; If BASESW has been defined, and + IFE BASESW ;AN037; If ES is psdata base + pop PSDATA_SEG ;AN037; restore current base reg + ENDIF ;AN037; +ENDIF ;AN037; + pop di ;AN000; + pop es ;AN000; + pop bx ;AN000; +$P_CAPS_Ret: ;AN000; + ret ;AN000; +$P_Do_CAPS_Char endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +IF NumSW ;AN000;(Check if numeric value is supported) +; $P_Value / $P_SValue +; +; Function: Make 32bit value from psdata_seg:SI and see value list +; and make result buffer. +; $P_SValue is an entry point for the signed value +; and this will simply call $P_Value after the handling +; of the sign character, "+" or "-" +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Fill_Result, $P_Check_OVF +; +; Vars: $P_RC(W), $P_Flags(RW) +;*********************************************************************** +$P_SValue proc ;AN000; when signed value here + push ax ;AN000; + or psdata_seg:$P_Flags2,$P_Signed ;AC034; indicate a signed numeric + and psdata_seg:$P_Flags2,0ffh-$P_Neg ;AC034; assume positive value + mov al,psdata_seg:[si] ;AN000; get sign + cmp al,$P_Plus ;AN000; "+" ? + je $P_SVal00 ;AN000; + + cmp al,$P_Minus ;AN000; "-" ? + jne $P_Sval01 ;AN000; else + + or psdata_seg:$P_Flags2,$P_Neg ;AC034; set this is negative value +$P_SVal00: ;AN000; + inc si ;AN000; skip sign char +$P_Sval01: ;AN000; + call $P_Value ;AN000; and process value + pop ax ;AN000; + ret ;AN000; +$P_SValue endp ;AN000; +;*********************************************************************** +$P_Value proc ;AN000; + push ax ;AN000; + push cx ;AN000; + push dx ;AN000; + push si ;AN000; + xor cx,cx ;AN000; cx = higher 16 bits + xor dx,dx ;AN000; dx = lower 16 bits + push bx ;AN000; save control pointer +$P_Value_Loop: ;AN000; + mov al,psdata_seg:[si] ;AN000; get character + or al,al ;AN000; end of line ? + je $P_Value00 ;AN000; + + call $P_0099 ;AN000; make asc(0..9) to bin(0..9) + jc $P_Value_Err0 ;AN000; + + xor ah,ah ;AN000; + mov bp,ax ;AN000; save binary number + shl dx,1 ;AN000; to have 2*x + rcl cx,1 ;AN000; shift left w/ carry + call $P_Check_OVF ;AN000; Overflow occurred ? + jc $P_Value_Err0 ;AN000; then error, exit + + mov bx,dx ;AN000; save low(2*x) + mov ax,cx ;AN000; save high(2*x) + shl dx,1 ;AN000; to have 4*x + rcl cx,1 ;AN000; shift left w/ carry + call $P_Check_OVF ;AN000; Overflow occurred ? + jc $P_Value_Err0 ;AN000; then error, exit + + shl dx,1 ;AN000; to have 8*x + rcl cx,1 ;AN000; shift left w/ carry + call $P_Check_OVF ;AN000; Overflow occurred ? + jc $P_Value_Err0 ;AN000; then error, exit + + add dx,bx ;AN000; now have 10*x + adc cx,ax ;AN000; 32bit ADD + call $P_Check_OVF ;AN000; Overflow occurred ? + jc $P_Value_Err0 ;AN000; then error, exit + + add dx,bp ;AN000; Add the current one degree decimal + adc cx,0 ;AN000; if carry, add 1 to high 16bit + call $P_Check_OVF ;AN000; Overflow occurred ? + jc $P_Value_Err0 ;AN000; then error, exit + + inc si ;AN000; update pointer + jmp short $P_Value_Loop ;AN000; loop until NULL encountered +; +$P_Value_Err0: ;AN000; + pop bx ;AN000; + jmp $P_Value_Err ;AN000; Bridge +; +$P_Value00: ;AN000; + pop bx ;AN000; restore control pointer + test psdata_seg:$P_Flags2,$P_Neg ;AC034; here cx,dx = 32bit value + je $P_Value01 ;AN000; was it negative ? + + not cx ;AN000; + + not dx ;AN000; |- Make 2's complement + add dx,1 ;AN000; | + adc cx,0 ;AN000; + +$P_Value01: ;AN000; / nval =0 + mov si,es:[bx].$P_Value_List ;AN000; si points to value list + mov al,es:[si] ;AN000; get nval + cmp al,$P_nval_None ;AN000; no value list ? + jne $P_Value02 ;AN000; + + mov al,$P_Number ;AN000; Set type + mov ah,$P_No_Tag ;AN000; No ITEM_TAG set + jmp $P_Value_Exit ;AN000; + +$P_Value02: ;AN000; / nval = 1 +IF Val1SW ;AN000;(Check if value list id #1 is supported) +;(tm07) cmp al,$P_nval_Range ;AN000; have range list ? +;(tm07) jne $P_Value03 ;AN000; + + inc si ;AN000; + mov al,es:[si] ;AN000; al = number of range + cmp al,$P_No_nrng ;AN000; (tm07) + je $P_Value03 ;AN000; (tm07) + + inc si ;AN000; si points to 1st item_tag +$P_Val02_Loop: ;AN000; + test psdata_seg:$P_Flags2,$P_Signed ;AC034; + jne $P_Val02_Sign ;AN000; + + cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH + jb $P_Val02_Next ;AN000; + + ja $P_Val_In ;AN000; + + cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL + jb $P_Val02_Next ;AN000; + +$P_Val_In: ;AN000; +;;;;;; cmp cx,es:$P_Val_YH] ; comp cx with YH (tm01) + cmp cx,es:[si+$P_Val_YH] ;AN000; comp cx with YH (tm01) + ja $P_Val02_Next ;AN000; + + jb $P_Val_Found ;AN000; + + cmp dx,es:[si+$P_Val_YL] ;AN000; comp dx with YL + ja $P_Val02_Next ;AN000; + + jmp short $P_Val_Found ;AN000; + +$P_Val02_Sign: ;AN000; + cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH + jl $P_Val02_Next ;AN000; + + jg $P_SVal_In ;AN000; + + cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL + jl $P_Val02_Next ;AN000; + +$P_SVal_In: ;AN000; + cmp cx,es:[si+$P_Val_YH] ;AN000; comp cx with YH + jg $P_Val02_Next ;AN000; + + jl $P_Val_Found ;AN000; + + cmp dx,es:[si+$P_Val_YL] ;AN000; comp dx with YL + jg $P_Val02_Next ;AN000; + + jmp short $P_Val_Found ;AN000; + +$P_Val02_Next: ;AN000; + add si,$P_Len_Range ;AN000; + dec al ;AN000; loop nrng times in AL + jne $P_Val02_Loop ;AN000; + ; / Not found + mov psdata_seg:$P_RC,$P_Out_of_Range ;AC034; + mov al,$P_Number ;AN000; + mov ah,$P_No_Tag ;AN000; No ITEM_TAG set + jmp short $P_Value_Exit ;AN000; + +ENDIF ;AN000;(of Val1SW) +IF Val1SW+Val2SW ;AN000;(Check if value list id #1 or #2 is supported) +$P_Val_Found: ;AN000; + mov al,$P_Number ;AN000; + mov ah,es:[si] ;AN000; found ITEM_TAG set + jmp short $P_Value_Exit ;AN000; + +ENDIF ;AN000;(of Val1SW+Val2SW) +$P_Value03: ;AN000; / nval = 2 +IF Val2SW ;AN000;(Check if value list id #2 is supported) +;;;; cmp al,$P_nval_Value ; have match list ? ASSUME nval=2, +;;;; jne $P_Value04 ; even if it is 3 or more. +;(tm07) inc si ;AN000; +;(tm07) mov al,es:[si] ;AN000; al = nrng + mov ah,$P_Len_Range ;AN000; + mul ah ;AN000; Skip nrng field + inc ax ;AN000; + add si,ax ;AN000; si points to nnval + mov al,es:[si] ;AN000; get nnval + inc si ;AN000; si points to 1st item_tag +$P_Val03_Loop: ;AN000; + cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH + jne $P_Val03_Next ;AN000; + + cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL + je $P_Val_Found ;AN000; + +$P_Val03_Next: ;AN000; + add si,$P_Len_Value ;AN000; points to next value choice + dec al ;AN000; loop nval times in AL + jne $P_Val03_Loop ;AN000; + ;AN000; / Not found + mov psdata_seg:$P_RC,$P_Not_in_Val ;AC034; + mov al,$P_Number ;AN000; + mov ah,$P_No_Tag ;AN000; No ITEM_TAG set + jmp short $P_Value_Exit ;AN000; + +ENDIF ;AN000;(of Val2SW) +$P_Value04: ;AN000; / nval = 3 or else +$P_Value_Err: ;AN000; + mov psdata_seg:$P_RC,$P_Syntax ;AC034; + mov al,$P_String ;AN000; Set type + mov ah,$P_No_Tag ;AN000; No ITEM_TAG set +$P_Value_Exit: ;AN000; + call $P_Fill_Result ;AN000; + pop si ;AN000; + pop dx ;AN000; + pop cx ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Value endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Check_OVF +; +; Function: Check if overflow is occurred with consideration of +; signed or un-signed numeric value +; +; Input: Flag register +; +; Output: CY = 1 : Overflow +; +; Vars: $P_Flags(R) +;*********************************************************************** +$P_Check_OVF proc ;AN000; + pushf ;AN000; + test psdata_seg:$P_Flags2,$P_Neg ;AC034; is it negative value ? + jne $P_COVF ;AN000; if no, check overflow + + popf ;AN000; by the CY bit + ret ;AN000; + +$P_COVF: ;AN000; + popf ;AN000; else, + jo $P_COVF00 ;AN000; check overflow by the OF + + clc ;AN000; indicate it with CY bit + ret ;AN000; CY=0 means no overflow + +$P_COVF00: ;AN000; + stc ;AN000; and CY=1 means overflow + ret ;AN000; +$P_Check_OVF endp ;AN000; +ENDIF ;AN000;(of FarSW) +;*********************************************************************** +; $P_0099; +; +; Function: Make ASCII 0-9 to Binary 0-9 +; +; Input: AL = character code +; +; Output: CY = 1 : AL is not number +; CY = 0 : AL contains binary value +;*********************************************************************** +$P_0099 proc ;AN000; + cmp al,"0" ;AN000; + jb $P_0099Err ;AN000; must be 0 =< al =< 9 + + cmp al,"9" ;AN000; + ja $P_0099Err ;AN000; must be 0 =< al =< 9 + + sub al,"0" ;AN000; make char -> bin + clc ;AN000; indicate no error + ret ;AN000; + +$P_0099Err: ;AN000; + stc ;AN000; indicate error + ret ;AN000; +$P_0099 endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Simple_String +; +; Function: See value list for the simple string +; and make result buffer. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Fill_Result, $P_String_Comp +; +; Vars: $P_RC(W) +;*********************************************************************** +$P_Simple_String proc ;AN000; + push ax ;AN000; + push bx ;AN000; + push dx ;AN000; + push di ;AN000; + mov di,es:[bx].$P_Value_List ;AN000; di points to value list + mov al,es:[di] ;AN000; get nval + or al,al ;AN000; no value list ? + jne $P_Sim00 ;AN000; then + + mov ah,$P_No_Tag ;AN000; No ITEM_TAG set + jmp short $P_Sim_Exit ;AN000; and set result buffer + +$P_Sim00: ;AN000; +IF Val3SW+KeySW ;AN000;(Check if keyword or value list id #3 is supported) + cmp al,$P_nval_String ;AN000; String choice list provided ? + jne $P_Sim01 ;AN000; if no, syntax error + + inc di ;AN000; + mov al,es:[di] ;AN000; al = nrng + mov ah,$P_Len_Range ;AN000; + mul ah ;AN000; Skip nrng field + inc ax ;AN000; ax = (nrng*9)+1 + add di,ax ;AN000; di points to nnval + mov al,es:[di] ;AN000; get nnval + mov ah,$P_Len_Value ;AN000; + mul ah ;AN000; Skip nnval field + inc ax ;AN000; ax = (nnval*5)+1 + add di,ax ;AN000; di points to nstrval + mov al,es:[di] ;AN000; get nstrval + inc di ;AC035; add '2' to + inc di ;AC035; DI reg + ;AN000; di points to 1st string in list +;(replaced ;AC035;) add di,2 ;AN000; di points to 1st string in list +$P_Sim_Loop: ;AN000; + mov bp,es:[di] ;AN000; get string pointer + call $P_String_Comp ;AN000; compare it with operand + jnc $P_Sim_Found ;AN000; found on list ? + + add di,$P_Len_String ;AN000; if no, point to next choice + dec al ;AN000; loop nstval times in AL + jne $P_Sim_Loop ;AN000; + ;AN000; / Not found + mov psdata_seg:$P_RC,$P_Not_In_Str ;AC034; + mov ah,$P_No_Tag ;AN000; No ITEM_TAG set + jmp short $P_Sim_Exit ;AN000; + +$P_Sim_Found: ;AN000; + mov ah,es:[di-1] ;AN000; set item_tag + mov al,$P_List_Idx ;AN000; + mov dx,es:[di] ;AN000; get address of STRING + jmp short $P_Sim_Exit0 ;AN000; +ENDIF ;AN000;(of Val3SW+KeySW) +$P_Sim01: ;AN000; + mov psdata_seg:$P_RC,$P_Syntax ;AC034; + mov ah,$P_No_Tag ;AN000; No ITEM_TAG set +$P_Sim_Exit: ;AN000; + mov al,$P_String ;AN000; Set type +$P_Sim_Exit0: ;AN000; + call $P_Fill_Result ;AN000; + pop di ;AN000; + pop dx ;AN000; + pop bx ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Simple_String endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_String_Comp: +; +; Function: Compare two string +; +; Input: psdata_seg:SI -> 1st string +; ES:BP -> 2nd string (Must be upper case) +; ES:BX -> CONTROL block +; +; Output: CY = 1 if not match +; +; Use: $P_Chk_DBCS, $P_Do_CAPS_Char +; +; Vars: $P_KEYor_SW_Ptr(W), $P_Flags(R). $P_KEYorSW_Ptr +;*********************************************************************** +$P_String_Comp proc ;AN000; + push ax ;AN000; + push bp ;AN000; + push dx ;AN000; + push si ;AN000; + mov dl,$P_DOSTBL_Char ;AN000; use character case map table +$P_SCOM_Loop: ;AN000; + mov al,psdata_seg:[si] ;AN000; get command character + call $P_Chk_DBCS ;AN000; DBCS ? + jc $P_SCOM00 ;AN000; yes,DBCS + + call $P_Do_CAPS_Char ;AN000; else, upper case map before comparison +IF KeySW+SwSW ;AN000;(Check if keyword or switch is supported) + test psdata_seg:$P_Flags2,$P_Key_Cmp ;AC034; keyword search ? + je $P_SCOM04 ;AN000; + + cmp al,$P_Keyword ;AN000; "=" is delimiter + jne $P_SCOM03 ;AN000;IF "=" on command line AND (bp+1=> char after the "=" in synonym list) + + cmp byte ptr es:[bp+1],$P_NULL ;AN021; at end of keyword string in the control block THEN + jne $P_SCOM_DIFFER ;AN021; + + jmp short $P_SCOM05 ;AN000; keyword found in synonym list + +$P_SCOM04: ;AN000; + test psdata_seg:$P_Flags2,$P_SW_Cmp ;AC034; switch search ? + je $P_SCOM03 ;AN000; + + cmp al,$P_Colon ;AN000; ":" is delimiter, at end of switch on command line + jne $P_SCOM03 ;AN000; continue compares + + cmp byte ptr es:[bp],$P_NULL ;AN021; IF at end of switch on command AND + jne $P_SCOM_DIFFER ;AN021; at end of switch string in the control block THEN + +$P_SCOM05: ;AN000; found a match + inc si ;AN000; si points to just after "=" or ":" + jmp short $P_SCOM_Same ;AN000; exit + +$P_SCOM03: ;AN000; +ENDIF ;AN000;(of KeySW+SwSW) + cmp al,es:[bp] ;AN000; compare operand w/ a synonym + jne $P_SCOM_Differ0 ;AN000; if different, check ignore colon option + + or al,al ;AN000; end of line + je $P_SCOM_Same ;AN000; if so, exit + + inc si ;AN000; update operand pointer + inc bp ;AN000; and synonym pointer + jmp short $P_SCOM01 ;AN000; loop until NULL or "=" or ":" found in case + +$P_SCOM00: ;AN000; Here al is DBCS leading byte + cmp al,es:[bp] ;AN000; compare leading byte + jne $P_SCOM_Differ ;AN000; if not match, say different + + inc si ;AN000; else, load next byte + mov al,psdata_seg:[si] ;AN000; and + inc bp ;AN000; + cmp al,es:[bp] ;AN000; compare 2nd byte + jne $P_SCOM_Differ ;AN000; if not match, say different, too + + inc si ;AN000; else update operand pointer + inc bp ;AN000; and synonym pointer +$P_SCOM01: ;AN000; + jmp short $P_SCOM_Loop ;AN000; loop until NULL or "=" or "/" found in case + +$P_SCOM_Differ0: ;AN000; + +IF SwSW ;AN000;(tm10) + test psdata_seg:$P_Flags2,$P_SW ;AC034;(tm10) + je $P_not_applicable ;AN000;(tm10) + + test es:[bx].$P_Function_Flag,$P_colon_is_not_necessary ;AN000;(tm10) + je $P_not_applicable ;AN000;(tm10) + + cmp byte ptr es:[bp],$P_NULL ;AN000;(tm10) +;(deleted ;AN025;) jne $P_not_applicable ;AN000;(tm10) + je $P_SCOM_Same ;AN025;(tm10) + +$P_not_applicable: ;AN000;(tm10) +ENDIF ;AN000;(tm10) + + test es:[bx].$P_Match_Flag,$P_Ig_Colon ;AN000; ignore colon option specified ? + je $P_SCOM_Differ ;AN000; if no, say different. + + cmp al,$P_Colon ;AN000; End up with ":" and + jne $P_SCOM02 ;AN000; subseqently + + cmp byte ptr es:[bp],$P_NULL ;AN000; NULL ? + jne $P_SCOM_Differ ;AN000; if no, say different + + jmp short $p_SCOM_Same ;AN000; else, say same + +$P_SCOM02: ;AN000; + cmp al,$P_NULL ;AN000; end up NULL and : + jne $P_SCOM_Differ ;AN000; + + cmp byte ptr es:[bp],$P_Colon ;AN000; if no, say different + je $p_SCOM_Same ;AN000; else, say same + +$P_SCOM_Differ: ;AN000; + stc ;AN000; indicate not found + jmp short $P_SCOM_Exit ;AN000; + +$P_SCOM_Same: ;AN000; + mov psdata_seg:$P_KEYorSW_Ptr,si ;AC034; for later use by keyword or switch + clc ;AN000; indicate found +$P_SCOM_Exit: ;AN000; + pop si ;AN000; + pop dx ;AN000; + pop bp ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_String_Comp endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +IF DateSW ;AN000;(Check if date format is supported) +; $P_Date_Format +; +; Function: Convert a date string to DOS date format for int 21h +; with format validation. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum +; +; Vars: $P_RC(W), $P_1st_Val(RW), $P_2nd_Val(RW), $P_3rd_Val(RW) +;*********************************************************************** +$P_Date_Format proc ;AN000; + push ax ;AN000; + push cx ;AN000; + push dx ;AN000; + push si ;AN000; + push bx ;AN000; + push si ;AN000; + call $P_Set_CDI ;AN000; set country dependent information before process +; mov bl,psdata_seg:[si].$P_CDI_DateS ;load date separator ;AN020; (deleted) +; note: the country info is still needed +; to determine the order of the fields, +; but the separator char is no longer used. + pop si ;AN000; + mov psdata_seg:$P_1st_Val,0 ;AC034; set initial value + mov psdata_seg:$P_2nd_Val,0 ;AC034; set initial value + mov psdata_seg:$P_3rd_Val,0 ;AC034; set initial value + call $P_Get_DecNum ;AN000; get 1st number + jc $P_DateF_Err0 ;AN000;-----------------------+ + + mov psdata_seg:$P_1st_Val,ax ;AC034; | + or bl,bl ;AN000; end of line ? | + je $P_DateF_YMD ;AN000; | + + call $P_Get_DecNum ;AN000; get 2nd number | + jc $P_DateF_Error ;AN000; | + + mov psdata_seg:$P_2nd_Val,ax ;AC034; | + or bl,bl ;AN000; end of line ? | + je $P_DateF_YMD ;AN000; | + + call $P_Get_DecNum ;AN000; get 3rd number | +$P_DateF_Err0: ;AN000; Bridge <-----------+ + jc $P_DateF_Error ;AN000; + + mov psdata_seg:$P_3rd_Val,ax ;AC034; + or bl,bl ;AN000; end of line ? + jne $P_DateF_Error ;AN000; + +$P_DateF_YMD: ;AN000; + mov bx,psdata_seg:$P_Country_Info.$P_CDI_DateF ;AC034; get date format + cmp bx,$P_Date_YMD ;AN000; + je $P_DateF00 ;AN000; + + mov ax,psdata_seg:$P_1st_Val ;AC034; + or ah,ah ;AN000; + jne $P_DateF_Error ;AN000; + + mov cl,al ;AN000; set month + mov ax,psdata_seg:$P_2nd_Val ;AC034; + or ah,ah ;AN000; if overflow, error. + jne $P_DateF_Error ;AN000; + + mov ch,al ;AN000; set date + mov dx,psdata_seg:$P_3rd_Val ;AC034; set year + cmp bx,$P_Date_DMY ;AN000; from here format = MDY + jne $P_DateF01 ;AN000; if it is DMY + + xchg ch,cl ;AN000; then swap M <-> D +$P_DateF01: ;AN000; + jmp short $P_DateF02 ;AN000; + +$P_DateF00: ;AN000; / here format = YMD + mov dx,psdata_seg:$P_1st_Val ;AC034; set year + mov ax,psdata_seg:$P_2nd_Val ;AC034; + or ah,ah ;AN000; if overflow, error + jne $P_DateF_Error ;AN000; + + mov cl,al ;AN000; set month + mov ax,psdata_seg:$P_3rd_Val ;AC034; + or ah,ah ;AN000; if overflow, error + jne $P_DateF_Error ;AN000; + + mov ch,al ;AN000; set date +$P_DateF02: ;AN000; + cmp dx,100 ;AN000; year is less that 100 ? + jae $P_DateF03 ;AN000; + + add dx,1900 ;AN000; set year 19xx +$P_DateF03: ;AN000; + pop bx ;AN000; recover CONTROL block + pop si ;AN000; recover string pointer + mov ah,$P_No_Tag ;AN000; set + mov al,$P_Date_F ;AN000; result + call $P_Fill_Result ;AN000; buffer + jmp short $P_Date_Format_Exit ;AN000; to Date + +$P_DateF_Error: ;AN000; + pop bx ;AN000; recover CONTROL block + pop si ;AN000; recover string pointer + mov ah,$P_No_Tag ;AN000; set + mov al,$P_String ;AN000; result + call $P_Fill_Result ;AN000; buffer to string + mov psdata_seg:$P_RC,$P_Syntax ;AC034; indicate syntax error +$P_Date_Format_Exit: ;AN000; + pop dx ;AN000; + pop cx ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Date_Format endp ;AN000; +ENDIF ;AN000;(of DateSW) +PAGE ;AN000; +;*********************************************************************** +IF TimeSW+DateSW ;AN000;(Check if time or date format is supported) +; $P_Set_CDI: +; +; Function: Read CDI from DOS if it has not been read yet +; +; Input: None +; +; Output: psdata_seg:SI -> CDI +; +; Use: INT 21h w/ AH = 38h +;*********************************************************************** +$P_Set_CDI proc ;AN000; + lea si,psdata_seg:$P_Country_Info ;AC034; + cmp psdata_seg:[si].$P_CDI_DateF,$P_NeedToBeRead ;AN000; already read ? + je $P_Read_CDI ;AN000; + + jmp short $P_Set_CDI_Exit ;AN000; then do nothing + +$P_Read_CDI: ;AN000; else read CDI thru DOS + push ds ;AN000; + push dx ;AN000; + push ax ;AN000; + push PSDATA_SEG ;AC023; + pop ds ;AN000; set segment register + mov ax,$P_DOS_Get_CDI ;AN000; get country information + mov dx,si ;AN000; set offset of CDI in local data area + int 21h ;AN000; + pop ax ;AN000; + pop dx ;AN000; + pop ds ;AN000; +$P_Set_CDI_Exit: ;AN000; + ret ;AN000; +$P_Set_CDI endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Get_DecNum: +; +; Function: Read a chcrater code from psdata_seg:SI until specified delimiter +; or NULL encountered. And make a decimal number. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; +; Output: BL = delimiter code or NULL +; AX = Decimal number +; SI advanced to the next number +; CY = 1 : Syntax error, AL = Latest examineed number +; +; Use: $P_0099 +;*********************************************************************** +$P_Get_DecNum proc ;AN000; + push cx ;AN000; + push dx ;AN000; + xor cx,cx ;AN000; cx will have final value +$P_GetNum_Loop: ;AN000; + mov al,psdata_seg:[si] ;AN000; load character + or al,al ;AN000; end of line ? + je $P_GetNum00 ;AN000; if yes, exit + + cmp psdata_seg:$P_Got_Time,0 ;AC034; ;is this numeric in a time field? ;AC023 + je $P_Do_Date_Delims ;AN000;no, go check out Date delimiters ;AC023 + +; Determine which delimiter(s) to check for. Colon & period or period only + cmp bl,$P_colon_period ;AN032; ;Time + jne $P_Do_Time_Delim1 ;AN032; ;only check for period + + cmp al,$P_Colon ;AN032; ;Is this a valid delimiter ? + je $P_GetNum01 ;AN032; ;yes, exit + +$P_Do_Time_Delim1: ;AN000; + cmp al,$P_Period ;;AC032;;AC023;Is this a valid delimiter ? + je $P_GetNum01 ;AC023; yes, exit + + jmp short $P_Neither_Delims ;AN023; + +$P_Do_Date_Delims: ;AN000; +;Regardless of the date delimiter character specified in the country +;dependent information, check for the presence of any one of these +;three field delimiters: "-", "/", or ".". + cmp al,$P_Minus ;AN020;is this a date delimiter character? + je $P_GetNum01 ;AN020;if yes, exit + + cmp al,$P_Slash ;AN020;is this a date delimiter character? + je $P_GetNum01 ;AN020;if yes, exit + + cmp al,$P_Period ;AN020;is this a date delimiter character? + je $P_GetNum01 ;AN000; if yes, exit + +$P_Neither_Delims: ;AN023; + + call $P_0099 ;AN000; convert it to binary + jc $P_GetNum_Exit ;AN000; if error exit + + mov ah,0 ;AN000; + xchg ax,cx ;AN000; + mov dx,10 ;AN000; + mul dx ;AN000; ax = ax * 10 + or dx,dx ;AN000; overflow + jne $P_GetNum02 ;AN000; then exit + + add ax,cx ;AN000; + jc $P_GetNum_Exit ;AN000; + + xchg ax,cx ;AN000; + inc si ;AN000; + jmp short $P_GetNum_Loop ;AN000; + +$P_GetNum00: ;AN000; + mov bl,al ;AN000; set bl to NULL + clc ;AN000; indicate no error + jmp short $P_GetNum_Exit ;AN000; + +$P_GetNum01: ;AN000; + inc si ;AN000; si points to next number + clc ;AN000; indicate no error + jmp short $P_GetNum_Exit ;AN000; + +$P_GetNum02: ;AN000; + stc ;AN000; indicate error +$P_GetNum_Exit: ;AN000; + mov ax,cx ;AN000;return value + pop dx ;AN000; + pop cx ;AN000; + ret ;AN000; +$P_Get_DecNum endp ;AN000; +ENDIF ;AN000;(of TimeSW+DateSW) +PAGE ;AN000; +;*********************************************************************** +IF TimeSW ;AN000;(Check if time format is supported) +; $P_Time_Format +; +; Function: Convert a time string to DOS time format for int 21h +; with format validation. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum, $P_Time_2412 +; +; Vars: $P_RC(W), $P_Flags(R), $P_1st_Val(RW), $P_2nd_Val(RW) +; $P_3rd_Val(RW), $P_4th_Val(RW) +;*********************************************************************** +$P_Time_Format proc ;AN000; + push ax ;AN000; + push cx ;AN000; + push dx ;AN000; + push si ;AN000; + push bx ;AN000; + push si ;AN000; + call $P_Set_CDI ;AN000; Set country independent + ; information before process +;(AN032; deleted) mov bl,psdata_seg:[si].$P_CDI_TimeS ;load time separator +;(AN032; deleted) mov bh,psdata_seg:[si].$P_CDI_Dec ;load decimal separator + test byte ptr psdata_seg:[si].$P_CDI_TimeF,1 ;AN000; 24 hour system + pop si ;AN000; + jne $P_TimeF00 ;AN000; if no, means 12 hour system + + call $P_Time_2412 ;AN000; this routine handle "am" "pm" +$P_TimeF00: ;AN000; + mov psdata_seg:$P_1st_Val,0 ;AC034; set initial value + mov psdata_seg:$P_2nd_Val,0 ;AC034; set initial value + mov psdata_seg:$P_3rd_Val,0 ;AC034; set initial value + mov psdata_seg:$P_4th_Val,0 ;AC034; set initial value + mov psdata_seg:$P_Got_Time,1 ;AN023;AC034;; use time delimiter + mov bl,$P_colon_period ;AN032; flag, indicates use of + ; delimiters between hours, + ; minutes,seconds + call $P_Get_DecNum ;AN000; get 1st number + jc $P_TimeF_Err0 ;AN000; + + mov psdata_seg:$P_1st_Val,ax ;AC034; + or bl,bl ;AN000; end of line ? + je $P_TimeF_Rlt ;AN000; + + call $P_Get_DecNum ;AN000; get 2nd number + jc $P_TimeF_Err0 ;AC038; if OK + + mov psdata_seg:$P_2nd_Val,ax ;AC034; + or bl,bl ;AN000; end of line ? + je $P_TimeF_Rlt ;AN000; + +;(;AN032; deleted) mov bl,bh ;set decimal separator + mov bl,$P_period_only ;AN032; flag, which to decimal separator + call $P_Get_DecNum ;AN000; get 3rd number + jc $P_TimeF_Err0 ;AC039; if problem, bridge to error + + mov psdata_seg:$P_3rd_Val,ax ;AC034; + or bl,bl ;AN000; end of line ? +;(DELETED ;AN039;) je $P_TimeF_Rlt ;AN000; + jne $P_Time_4 ;AN039; NOT END OF LINE, + ;AN039; GO TO 4TH NUMBER + test psdata_seg:$P_Flags1,$P_Time_Again ;AN039; HAS TIME PARSE + ;AN039; BEEN REPEATED? + jnz $P_TimeF_Rlt ;AN039; yes, this is really + ;AN039; the end of line + ;AN039; no, time has not been repeated + mov si,psdata_seg:$P_SI_Save ;AN039; get where parser quit + ;AN039; in command line + cmp byte ptr [si-1],$P_Comma ;AN039; look at delimiter + ;AN039; from command line + jne $P_TimeF_Rlt ;AN039; was not a comma, this is + ;AN039; really end of line + ;AN039; is comma before hundredths, + ;AN039; redo TIME + mov byte ptr [si-1],$P_Period ;AN039; change that ambiguous + ;AN039; comma to a decimal point + ;AN039; parse can understand + mov psdata_seg:$P_Flags,0 ;AN039; Clear all internal flags + or psdata_seg:$P_Flags1,$P_Time_Again ;AN039; indicate TIME + ;AN039; is being repeated + mov cx,psdata_seg:$P_ORIG_ORD ;AN039; ORIGINAL ORDINAL FROM CX + mov sp,psdata_seg:$P_ORIG_STACK ;AN039; ORIGINAL VALUE + ;AN039; OF STACK FROM SP + mov si,psdata_seg:$P_ORIG_SI ;AN039; ORIGINAL START + ;AN039; PARSE POINTER FROM SI + jmp $P_Redo_Time ;AN039; go try TIME again +; =============================================================== +$P_Time_4: ;AN039; READY FOR 4TH (HUNDREDTHS) NUMBER + call $P_Get_DecNum ;AN000; get 4th number +$P_TimeF_Err0: ;AN000; Bridge + jc $P_TimeF_Error ;AN000; + + mov psdata_seg:$P_4th_Val,ax ;AC034; + or bl,bl ;AN000; After hundredth, no data allowed + jne $P_TimeF_Error ;AN000; if some, then error + +$P_TimeF_RLT: ;AN000; + mov ax,psdata_seg:$P_1st_Val ;AC034; + or ah,ah ;AN000; if overflow then error + jne $P_TimeF_Err ;AN000; + + test psdata_seg:$P_Flags1,$P_Time12am ;AN038;if "am" specified + jz $P_Time_notAM ;AN038;skip if no "AM" specified + ;since "AM" was specified, + cmp al,12 ;AN038: if hour specified as later than noon + ja $P_TimeF_Err ;AN038; error if "AM" on more than noon + jne $P_Time_notAM ;AN038; for noon exactly, + + xor al,al ;AN038; set hour = zero +$P_Time_notAM: ;AN038; + test psdata_seg:$P_Flags2,$P_Time12 ;AC034; if 12 hour system and pm is specified + je $P_TimeSkip00 ;AN000; then + + cmp al,12 ;AN038; if 12:00 o'clock already + je $P_TimeSkip00 ;AN038; it is PM already + + add al,12 ;AN000; add 12 hours to make it afternoon + jc $P_TimeF_Err ;AN000; if overflow then error + + cmp al,24 ;AN038; after adding 12, now cannot be >24 + ja $P_TimeF_Err ;AN038; if too big, error + +$P_TimeSkip00: ;AN000; + mov dl,al ;AN000; set hour + mov ax,psdata_seg:$P_2nd_Val ;AC034; + or ah,ah ;AN000; if overflow then error + jne $P_TimeF_Err ;AN000; + + mov dh,al ;AN000; set minute + mov ax,psdata_seg:$P_3rd_Val ;AC034; + or ah,ah ;AN000; if overflow then error + jne $P_TimeF_Err ;AN000; + + mov cl,al ;AN000; set second + mov ax,psdata_seg:$P_4th_Val ;AC034; + or ah,ah ;AN000; if overflow then error + jne $P_TimeF_Err ;AN000; + + mov ch,al ;AN000; set hundredth + pop bx ;AN000; recover CONTROL block + pop si ;AN000; recover string pointer + mov ah,$P_No_Tag ;AN000; set + mov al,$P_Time_F ;AN000; result + call $P_Fill_Result ;AN000; buffer + jmp short $P_Time_Format_Exit ;AN000; to time + +$P_TimeF_Error: ;AN000; +$P_TimeF_Err: ;AN000; + pop bx ;AN000; recover CONTROL block + pop si ;AN000; recover string pointer + mov ah,$P_No_Tag ;AN000; set + mov al,$P_String ;AN000; result + call $P_Fill_Result ;AN000; buffer to string + mov psdata_seg:$P_RC,$P_Syntax ;AC034; return syntax error +$P_Time_Format_Exit: ;AN000; + mov psdata_seg:$P_Got_Time,0 ;AN023;AC034;; finished with this time field + pop dx ;AN000; + pop cx ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Time_Format endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Time_2412: +; +; Function: Remove "a", "p", "am", or "pm" from the end of stinrg +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; +; Output: Set $P_Time12 flag when the string is terminated by "p" +; or "pm" +; +; Vars: $P_Flags(W) +;*********************************************************************** +$P_Time_2412 proc ;AN000; + push ax ;AN000; + push si ;AN000; +$P_T12_Loop: ;AN000; + mov al,psdata_seg:[si] ;AN000; Move + inc si ;AN000; si + or al,al ;AN000; to + jne $P_T12_Loop ;AN000; end of string + + mov al,psdata_seg:[si-word] ;AN000; get char just before NULL + or al,$P_Make_Lower ;AN000; lower case map + cmp al,"p" ;AN000; only "p" of "pm" ? + je $P_T1200 ;AN000; + + cmp al,"a" ;AN000; only "a" of "am" ? + je $P_T1201 ;AN000; + + cmp al,"m" ;AN000; "m" of "am" or "pm" + jne $P_T12_Exit ;AN000; + + dec si ;AN000; + mov al,psdata_seg:[si-word] ;AN000; + or al,$P_Make_lower ;AN000; lower case map + cmp al,"p" ;AN000; "p" of "pm" ? + je $P_T1200 ;AN000; + + cmp al,"a" ;AN000; "a" of "am" ? + je $P_T1201 ;AN000; go process "a" + + jmp short $P_T12_Exit ;AN000; no special chars found + +$P_T1200: ;AN000; "P" found + or psdata_seg:$P_Flags2,$P_Time12 ;AC034; flag "PM" found + jmp short $P_Tclr_chr ;AN038; go clear the special char + +$P_T1201: ;AN000; "A" found + or psdata_seg:$P_Flags1,$P_Time12AM ;AN038; flag "AM" found +$P_Tclr_chr: ;AN038; + mov byte ptr psdata_seg:[si-2],$P_NULL ;AN000; null out special char +$P_T12_Exit: ;AN000; + pop si ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Time_2412 endp ;AN000; +ENDIF ;AN000;(of TimeSW) +PAGE ;AN000; +;*********************************************************************** +IF CmpxSW ;AN000;(Check if complex item is supported) +; $P_Complex_Format: +; +; Function: Check if the input string is valid complex format. +; And set the result buffer. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Fill_Result, $P_Chk_DBCS, $P_Chk_EOL, $P_Skip_Delim +; $P_Quoted_str, $P_Chk_DSQuote +; +; Vars: $P_RC(W), $P_SI_Save(W), $P_SaveSI_Cmpx(R), $P_Save_EOB(R) +;*********************************************************************** +$P_Complex_Format proc ;AN000; + push ax ;AN000; + push bx ;AN000; + push si ;AN000; + mov bx,psdata_seg:$P_SaveSI_Cmpx ;AC034; bx points to user buffer + cmp byte ptr [bx],$P_Lparen ;AN000; 1st char = left parentheses + jne $P_Cmpx_Err ;AN000; + + xor ah,ah ;AN000; ah = parentheses counter +$P_Cmpx_Loop: ;AN000; + mov al,[bx] ;AN000; load character from command buffer + call $P_Chk_EOL ;AN000; if it is one of EOL + je $P_CmpxErr0 ;AN000; then error exit. + + cmp al,$P_Lparen ;AN000; left parentheses ? + jne $P_Cmpx00 ;AN000; then + + inc ah ;AC035; add '1' to AH reg + ;AN000; increment parentheses counter +;(replaced ;AC035;) add ah,1 ;AN000; increment parentheses counter + jc $P_CmpxErr0 ;AN000; if overflow, error +$P_Cmpx00: ;AN000; + cmp al,$P_Rparen ;AN000; right parentheses ? + jne $P_Cmpx01 ;AN000; then + + dec ah ;AC035; subtract '1' from AH reg + ;AN000; decrement parentheses counter +;(changed ;AC035;) sub ah,1 ;AN000; decrement parentheses counter + jc $P_CmpxErr0 ;AN000; if overflow error + + je $P_Cmpx03 ;AN000; ok, valid complex + +$P_Cmpx01: ;AN000; +;(deleted ;AN025;) call $P_Chk_DSQuote ;AN000; double or single quotation mark ? 3/17/KK + cmp al,$P_DQuote ;AN025; double quotation mark? + jne $P_Cmpx04 ;AN000; 3/17/KK + + mov psdata_seg:[si],al ;AN000; here quoted string is found in the complex list. + inc si ;AN000; + inc bx ;AN000; bx points to 2nd character + call $P_Quoted_Str ;AN000; skip pointers until closing of quoted string + jc $P_CmpxErr0 ;AN000; if error in quoted string syntax then exit + + jmp short $P_Cmpx05 ;AN000; + +$P_Cmpx04: ;AN000; + call $P_Chk_DBCS ;AN000; was it a lead byte of DBCS ? + jnc $P_Cmpx02 ;AN000; + + mov psdata_seg:[si],al ;AN000; then store 1st byte + inc si ;AN000; + inc bx ;AN000; + mov al,[bx] ;AN000; load 2nd byte +$P_Cmpx02: ;AN000; + mov psdata_seg:[si],al ;AN000; store SBCS or 2nd byte of DBCS +$P_Cmpx05: ;AN000; + inc si ;AN000; + inc bx ;AN000; + jmp short $P_Cmpx_Loop ;AN000; loop +;---- ;AN000; +$P_Cmpx03: ;AN000; + mov byte ptr psdata_seg:[si],al ;AN000; + mov byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; + mov byte ptr [bx],$P_NULL ;AN000; replace right parentheses with NULL + mov si,bx ;AN000; skip whitespaces + inc si ;AN000; after + call $P_Skip_Delim ;AN000; right parentheses + mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI + jmp short $P_Cmpx_Exit ;AN000; + +$P_CmpxErr0: ;AN000; + mov si,psdata_seg:$P_Save_EOB ;AC034; if EOF encountered, restore + mov byte ptr psdata_seg:[si],$P_NULL ;AN000; EOB mark +$P_Cmpx_Err: ;AN000; + mov psdata_seg:$P_RC,$P_Syntax ;AC034; +$P_Cmpx_Exit: ;AN000; + mov ah,$P_No_Tag ;AN000; + mov al,$P_Complex ;AN000; + pop si ;AN000; + pop bx ;AN000; + call $P_Fill_Result ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Complex_Format endp ;AN000; +ENDIF ;AN000;(of CpmxSW) +PAGE ;AN000; +;*********************************************************************** +IF QusSW ;AN000;(Check if quoted string is supported) +; $P_Quoted_Format: +; +; Function: Check if the input string is valid quoted string format. +; And set the result buffer. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Fill_Result, $P_Chk_DBCS, $P_Chk_EOL, $P_Skip_Delim +; $P_Chk_DSQuote, $P_Quoted_Str +; +; Vars: $P_RC(W), $P_SI_Save(W), $P_SaveSI_Cmpx(R),$P_Save_EOB(R) +;*********************************************************************** +$P_Quoted_Format proc ;AN000; + push ax ;AN000; + push bx ;AN000; + push si ;AN000; + mov bx,psdata_seg:$P_SaveSI_Cmpx ;AC034; bx points to user buffer + mov al,byte ptr [bx] ;AN000; get 1st character +;(deleted ;AN025;) call $P_Chk_DSQuote ;AN000; is it single or double quote ? + cmp al,$P_DQuote ;AN025; double quotation mark? + jne $P_Qus_Err ;AN000; if no, error + +; mov psdata_seg:[si],al ;AN000; move it to internal buffer +; inc si ;AN000; + inc bx ;AN000; bx points to 2nd character + call $P_Quoted_Str ;AN000; skip pointers to the closing of quoted string + jc $P_Qus_Err0 ;AN000; if invali quoted string syntax, exit + + mov byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; end up with NULL + mov si,bx ;AN000; + inc si ;AN000; + call $P_Skip_Delim ;AN000; skip whitespaces after closing quote + mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI + jmp short $P_Qus_Exit ;AN000; + +$P_Qus_Err0: ;AN000; + mov si,psdata_seg:$P_Save_EOB ;AC034; if EOF encountered, restore + mov byte ptr psdata_seg:[si],$P_NULL ;AN000; EOB mark +$P_Qus_Err: ;AN000;AN000 + mov psdata_seg:$P_RC,$P_Syntax ;AC034; indicate syntax error +$P_Qus_Exit: ;AN000; + mov ah,$P_No_Tag ;AN000; set + mov al,$P_Quoted_String ;AN000; result + pop si ;AN000; buffer + pop bx ;AN000; to + call $P_Fill_Result ;AN000; quoted string + pop ax ;AN000; + ret ;AN000; +$P_Quoted_Format endp ;AN000; +ENDIF ;AN000;(of QusSW) +PAGE ;AN000; +;*********************************************************************** +; $P_Chk_DSQuote; +; +; Function: Check if AL is double quotation or single quotation +; +; Input: AL = byte to be examineed +; +; Output: ZF on if AL is single or double quotetaion +; +; Vars: $P_SorD_Quote(W) +;*********************************************************************** +IF QusSW+CmpxSW ;AN000;(Check if quoted string or complex item is supported) +;(deleted ;AN025;) $P_Chk_DSQuote proc ; +;(deleted ;AN025;) mov $P_SorD_Quote,$P_SQuote ; 3/17/87 assume single quote +;(deleted ;AN025;) cmp al,$P_DQuote ; 1st char = double quotation ? +;(deleted ;AN025;) jne $P_CDSQ00 ; 3/17/87 +;(deleted ;AN025;) mov $P_SorD_Quote,al ; 3/17/87 set bigning w/ double quote +;(deleted ;AN025;) ret ; 3/17/87 +;(deleted ;AN025;) $P_CDSQ00: ; 3/17/87 +;(deleted ;AN025;) cmp al,$P_SQuote ; 1st char = single quotation ? +;(deleted ;AN025;) ret ; +;(deleted ;AN025;) $P_Chk_DSQuote endp ; + PAGE ;AN000; +;*********************************************************************** +; $P_Quoted_Str: +; +; Function: Copy chracacter from ES:BX to psdata_seg:SI until closing single +; (double) quotation found. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> Operand in command buffer +; +; Output: CY on indicates EOF encounterd before closing quotation +; BX and SI +; +; +; Vars: $P_SorD_Quote(R) +;*********************************************************************** +$P_Quoted_Str proc ;AN000; + push ax ;AN000; +$P_Qus_Loop: ;AN000; + mov ax,[bx] ;AN000; 3/17/87 + call $P_Chk_EOL ;AN000; + je $P_Qustr_Err0 ;AN000; + +;(deleted ;AN025;) cmp al,$P_SorD_Quote ;AN000; quotation ? 3/17/87 + cmp al,$P_DQuote ;AN025; double quote? + jne $P_Qus00 ;AN000; + +;(deleted ;AN025;) cmp ah,$P_SorD_Quote ;AN000; contiguous quotation 3/17/87 + cmp ah,$P_DQuote ;AN025; double quote? + jne $P_Qus02 ;AN000; + +;(deleted ;AN025:) mov word ptr psdata_seg:[si],ax ;AN000; 3/17/87 + mov byte ptr psdata_seg:[si],al ;AN025; save one of the quotes +;(deleted ;AN025:) add si,2 ;AN000; + + inc si ;AC035; add '1' to SI reg + ;AN025; adjust target index +;(changed ;AC035;) add si,1 ;AN025; adjust target index + inc bx ;AC035; add '2' to + inc bx ;AC035; BX reg + ;AN000; adjust source index by 2 to skip extra quote +;(changed ;AC035;) add bx,2 ;AN000; adjust source index by 2 to skip extra quote + jmp short $P_Qus_Loop ;AN000; + +$P_Qus00: ;AN000; + call $P_Chk_DBCS ;AN000; was it a lead byte of DBCS ? + jnc $P_Qus01 ;AN000; + + mov psdata_seg:[si],al ;AN000; store 1st byte + inc si ;AN000; + inc bx ;AN000; + mov al,[bx] ;AN000; load 2nd byte +$P_Qus01: ;AN000; + mov psdata_seg:[si],al ;AN000; store SBCS or 2nd byte of DBCS + inc si ;AN000; + inc bx ;AN000; + jmp short $P_Qus_Loop ;AN000; + +$P_Qustr_Err0: ;AN000; + stc ;AN000; indicate error + jmp short $P_Quoted_Str_Exit ;AN000; + +$P_Qus02: ;AN000; + mov byte ptr psdata_seg:[si],0 ;AN000; + clc ;AN000; indicate no error +$P_Quoted_Str_Exit: ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Quoted_Str endp ;AN000; +ENDIF ;AN000;(of QusSW+CmpxSW) +PAGE ;AN000; +;*********************************************************************** +IF FileSW+DrvSW ;AN000;(Check if file spec or drive only is supported) +; $P_File_Format; +; +; Function: Check if the input string is valid file spec format. +; And set the result buffer. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Fill_Result, $P_Chk_DBCS, $P_FileSp_Chk +; +; Vars: $P_RC(W), $P_SI_Save(W), $P_Terminator(W), $P_SaveSI_Cmpx(R) +; $P_SaveSI_Cmpx(R) +;*********************************************************************** +$P_File_Format proc ;AN000; + push ax ;AN000; + push di ;AN000; + push si ;AN000; + mov di,psdata_seg:$P_SaveSI_cmpx ;AC034; get user buffer address +$P_FileF_Loop0: ;AN000; / skip special characters + mov al,psdata_seg:[si] ;AN000; load character + or al,al ;AN000; end of line ? + je $P_FileF_Err ;AN000; if yes, error exit + + call $P_FileSp_Chk ;AN000; else, check if file special character + jne $P_FileF03 ;AN000; if yes, + +;AN033; deleted inc di ;skip +;AN033; deleted inc si ; the +;AN033; deleted jmp short $P_FileF_Loop0 ; character + mov psdata_seg:$P_err_flag,$P_error_filespec ;AN033;AC034;; set error flag- bad char. + pop si ;AN033; + mov byte ptr psdata_seg:[si],$P_NULL ;AN033; + pop di ;AN033; + jmp short $P_FileF02 ;AN033; + + +$P_FileF_Err: ;AN000; + pop si ;AN000; + mov byte ptr psdata_seg:[si],$P_NULL ;AN000; +;(deleted ;AN030;) mov di,$P_SaveSI_cmpx ;AN000; get user buffer address +;(deleted ;AN030;) mov $P_SI_Save,di ;AN000; update pointer to user buffer + pop di ;AN000; + test es:[bx].$P_Match_Flag,$P_Optional ;AN000; is it optional ? + jne $P_FileF02 ;AN000; + + mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; 3/17/87 + jmp short $P_FileF02 ;AN000; + +$P_FileF03: ;AN000; + pop ax ;AN000; discard save si + push si ;AN000; save new si +$P_FileF_Loop1: ;AN000; + mov al,psdata_seg:[si] ;AN000; load character (not special char) + or al,al ;AN000; end of line ? + je $P_FileF_RLT ;AN000; + + call $P_FileSp_Chk ;AN000; File special character ? + je $P_FileF00 ;AN000; + + call $P_Chk_DBCS ;AN000; no, then DBCS ? + jnc $P_FileF01 ;AN000; + inc di ;AN000; if yes, skip next byte + inc si ;AN000; +$P_FileF01: ;AN000; + inc di ;AN000; + inc si ;AN000; + jmp short $P_FileF_Loop1 ;AN000; +; +$P_FileF00: ;AN000; + mov psdata_seg:$P_Terminator,al ;AC034; + mov byte ptr psdata_seg:[si],$P_NULL ;AN000; update end of string + inc di ;AN000; + mov psdata_seg:$P_SI_Save,di ;AC034; update next pointer in command line +$P_FileF_RLT: ;AN000; + pop si ;AN000; + pop di ;AN000; +$P_FileF02: ;AN000; + + pop ax ;AN000; (tm14) + test ax,$P_File_Spc ;AN000; (tm14) + je $P_Drv_Only_Exit ;AN000; (tm14) + + push ax ;AN000; (tm14) + + mov ah,$P_No_Tag ;AN000; set + mov al,$P_File_Spec ;AN000; result + call $P_Fill_Result ;AN000; buffer to file spec + pop ax ;AN000; + +$P_Drv_Only_Exit: ;AN000; (tm14) + + ret ;AN000; +$P_File_Format endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_FileSp_Chk +; +; Function: Check if the input byte is one of file special characters +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; AL = character code to be examineed +; +; Output: ZF = 1 , AL is one of special characters +;*********************************************************************** +$P_FileSp_Chk proc ;AN000; + push bx ;AN000; + push cx ;AN000; + lea bx,psdata_seg:$P_FileSp_Char ;AC034; special character table + mov cx,$P_FileSp_Len ;AN000; load length of it +$P_FileSp_Loop: ;AN000; + cmp al,psdata_seg:[bx] ;AN000; is it one of special character ? + je $P_FileSp_Exit ;AN000; + + inc bx ;AN000; + loop $P_FileSp_Loop ;AN000; + + inc cx ;AN000; reset ZF +$P_FileSp_Exit: ;AN000; + pop cx ;AN000; + pop bx ;AN000; + ret ;AN000; +$P_FileSp_Chk endp ;AN000; +ENDIF ;AN000;(of FileSW+DrvSW) +PAGE ;AN000; +;*********************************************************************** +IF DrvSW ;AN000;(Check if drive only is supported) +; $P_Drive_Format; +; +; Function: Check if the input string is valid drive only format. +; And set the result buffer. +; +; Input: psdata_seg:SI -> $P_STRING_BUF +; ES:BX -> CONTROL block +; +; Output: None +; +; Use: $P_Fill_Result, $P_Chk_DBCS +; +; Vars: $P_RC(W) +;*********************************************************************** +$P_Drive_Format proc ;AN000; + push ax ;AN000; + push dx ;AN000; + mov al,psdata_seg:[si] ;AN000; + or al,al ;AN000; if null string + je $P_Drv_Exit ;AN000; do nothing + + call $P_Chk_DBCS ;AN000; is it leading byte ? + jc $P_Drv_Err ;AN000; + + cmp word ptr psdata_seg:[si+byte],$P_Colon ;AN000; "d", ":", 0 ? + je $P_DrvF00 ;AN000; + + test es:[bx].$P_Match_Flag,$P_Ig_Colon ;AN000; colon can be ignored? + je $P_Drv_Err ;AN000; + + cmp byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; "d", 0 ? + jne $P_Drv_Err ;AN000; + +$P_DrvF00: ;AN000; + or al,$P_Make_Lower ;AN000; lower case + cmp al,"a" ;AN000; drive letter must + jb $P_Drv_Err ;AN000; in range of + + cmp al,"z" ;AN000; "a" - "z" + ja $P_Drv_Err ;AN000; if no, error + + sub al,"a"-1 ;AN000; make text drive to binary drive + mov dl,al ;AN000; set + mov ah,$P_No_Tag ;AN000; result + mov al,$P_Drive ;AN000; buffer + call $P_Fill_Result ;AN000; to drive + jmp short $P_Drv_Exit ;AN000; + +$P_Drv_Err: ;AN000; + mov psdata_seg:$P_RC,$P_Syntax ;AC034; +$P_Drv_Exit: ;AN000; + pop dx ;AN000; + pop ax ;AN000; + ret ;AN000; +$P_Drive_Format endp ;AN000; +ENDIF ;AN000;(of DrvSW) +PAGE ;AN000; +;*********************************************************************** +; $P_Skip_Delim; +; +; Function: Skip delimiters specified in the PARMS list, white space +; and comma. +; +; Input: DS:SI -> Command String +; ES:DI -> Parameter List +; +; Output: CY = 1 if the end of line encounterd +; CY = 0 then SI move to 1st non-delimiter character +; AL = Last examineed character +; +; Use: $P_Chk_EOL, $P_Chk_Delim, +; +; Vars: $P_Flags(R) +;*********************************************************************** +$P_Skip_Delim proc ;AN000; +$P_Skip_Delim_Loop: ;AN000; + LODSB ;AN000; + call $P_Chk_EOL ;AN000; is it EOL character ? + je $P_Skip_Delim_CY ;AN000; if yes, exit w/ CY on + + call $P_Chk_Delim ;AN000; is it one of delimiters ? + jne $P_Skip_Delim_NCY ;AN000; if no, exit w/ CY off + + test psdata_seg:$P_Flags2,$P_Extra ;AC034; extra delim or comma found ? + je $P_Skip_Delim_Loop ;AN000; if no, loop + + test psdata_seg:$P_Flags2,$P_SW+$P_equ ;AC034; /x , or xxx=zzz , (tm08) + je short $P_Exit_At_Extra ;AN000; no switch, no keyword (tm08) + + dec si ;AN000; backup si for next call (tm08) + jmp short $P_Exit_At_Extra ;AN000; else exit w/ CY off + +$P_Skip_Delim_CY: ;AN000; + stc ;AN000; indicate EOL + jmp short $P_Skip_Delim_Exit ;AN000; + +$P_Skip_Delim_NCY: ;AN000; + clc ;AN000; indicate non delim +$P_Skip_Delim_Exit: ;AN000; in this case, need + dec si ;AN000; backup index pointer + ret ;AN000; + +$P_Exit_At_Extra: ;AN000; + clc ;AN000; indicate extra delim + ret ;AN000; +$P_Skip_Delim endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Chk_EOL; +; +; Function: Check if AL is one of End of Line characters. +; +; Input: AL = character code +; ES:DI -> Parameter List +; +; Output: ZF = 1 if one of End of Line characters +;********************************************************************** +$P_Chk_EOL proc ;AN000; + push bx ;AN000; + push cx ;AN000; + cmp al,$P_CR ;AN000; Carriage return ? + je $P_Chk_EOL_Exit ;AN000; + + cmp al,$P_NULL ;AN000; zero ? + je $P_Chk_EOL_Exit ;AN000; + +IF LFEOLSW ;AN028; IF LF TO BE ACCEPTED AS EOL + cmp al,$P_LF ;AN000; Line feed ? + je $P_Chk_EOL_Exit ;AN000; +ENDIF ;AN028; + + cmp byte ptr es:[di].$P_Num_Extra,$P_I_Have_EOL ;AN000; EOL character specified ? + jb $P_Chk_EOL_Exit ;AN000; + + xor bx,bx ;AN000; + mov bl,es:[di].$P_Len_Extra_Delim ;AN000; get length of delimiter list + add bx,$P_Len_PARMS ;AN000; skip it + cmp byte ptr es:[bx+di],$P_I_Use_Default ;AN000; No extra EOL character ? + je $P_Chk_EOL_NZ ;AN000; + + xor cx,cx ;AN000; Get number of extra chcracter + mov cl,es:[bx+di] ;AN000; +$P_Chk_EOL_Loop: ;AN000; + inc bx ;AN000; + cmp al,es:[bx+di] ;AN000; Check extra EOL character + je $P_Chk_EOL_Exit ;AN000; + + loop $P_Chk_EOL_Loop ;AN000; + +$P_Chk_EOL_NZ: ;AN000; + cmp al,$P_CR ;AN000; reset ZF +$P_Chk_EOL_Exit: ;AN000; + pop cx ;AN000; + pop bx ;AN000; + ret ;AN000; +$P_Chk_EOL endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Chk_Delim; +; +; Function: Check if AL is one of delimiter characters. +; if AL+[si] is DBCS blank, it is replaced with two SBCS +; blanks. +; +; Input: AL = character code +; DS:SI -> Next Character +; ES:DI -> Parameter List +; +; Output: ZF = 1 if one of delimiter characters +; SI points to the next character +; Vars: $P_Terminator(W), $P_Flags(W) +;*********************************************************************** +$P_Chk_Delim proc ;AN000; + push bx ;AN000; + push cx ;AN000; + mov psdata_seg:$P_Terminator,$P_Space ;AC034; Assume terminated by space + and psdata_seg:$P_Flags2,0ffh-$P_Extra ;AC034; + cmp al,$P_Space ;AN000; Space ? + je $P_Chk_Delim_Exit ;AN000; + + cmp al,$P_TAB ;AN000; TAB ? + je $P_Chk_Delim_Exit ;AN000; + + cmp al,$P_Comma ;AN000; Comma ? + je $P_Chk_Delim_Exit0 ;AN000; + +$P_Chk_Delim00: ;AN000; + cmp al,$P_DBSP1 ;AN000; 1st byte of DBCS Space ? + jne $P_Chk_Delim01 ;AN000; + + cmp byte ptr [si],$P_DBSP2 ;AN000; 2nd byte of DBCS Space ? + jne $P_Chk_Delim01 ;AN000; + + mov al,$P_Space ;AN000; + inc si ;AN000; make si point to next character + cmp al,al ;AN000; Set ZF + jmp short $P_Chk_Delim_Exit ;AN000; + +$P_Chk_Delim01: ;AN000; + cmp byte ptr es:[di].$P_Num_Extra,$P_I_Have_Delim ;AN000; delimiter character specified ? + jb $P_Chk_Delim_Exit ;AN000; + + xor cx,cx ;AN000; + mov cl,es:[di].$P_Len_Extra_Delim ;AN000; get length of delimiter list + or cx,cx ;AN000; No extra Delim character ? + je $P_Chk_Delim_NZ ;AN000; + + mov bx,$P_Len_PARMS-1 ;AN000; set bx to 1st extra delimiter +$P_Chk_Delim_Loop: ;AN000; + inc bx ;AN000; + cmp al,es:[bx+di] ;AN000; Check extra Delim character + je $P_Chk_Delim_Exit0 ;AN000; + + loop $P_Chk_Delim_Loop ;AN000; examine all extra delimiter + +$P_Chk_Delim_NZ: ;AN000; + cmp al,$P_Space ;AN000; reset ZF +$P_Chk_Delim_Exit: ;AN000; +;;;; jne $P_ChkDfin +;;;; mov psdata_seg:$P_Terminator,al ;AN034; +$P_ChkDfin: ;AN000; + pop cx ;AN000; + pop bx ;AN000; + ret ;AN000; + +$P_Chk_Delim_Exit0: ;AN000; + mov psdata_seg:$P_Terminator,al ;AC034; keep terminated delimiter + test psdata_seg:$P_Flags2,$P_Equ ;AN027;AC034;; if terminating a key= + jnz $P_No_Set_Extra ;AN027; then do not set the EXTRA bit + + or psdata_seg:$P_Flags2,$P_Extra ;AC034; flag terminated extra delimiter or comma +$P_No_Set_Extra: ;AN027; + cmp al,al ;AN000; set ZF + jmp short $P_Chk_Delim_Exit ;AN000; + +$P_Chk_Delim endp ;AN000; +PAGE ;AN000; +;*********************************************************************** +; $P_Chk_Switch; +; +; Function: Check if AL is the switch character not in first position of +; $P_STRING_BUF +; +; Input: AL = character code +; BX = current pointer within $P_String_Buf +; SI =>next char on command line (following the one in AL) +; +; Output: CF = 1 (set)if AL is switch character, and not in first +; position, and has no chance of being part of a date string, +; i.e. should be treated as a delimiter. + +; CF = 0 (reset, cleared) if AL is not a switch char, is in the first +; position, or is a slash but may be part of a date string, i.e. +; should not be treated as a delimiter. +; +; Vars: $P_Terminator(W) + +; Use: $P_0099 +;*********************************************************************** +$P_Chk_Switch proc ;AN000; + +;AN020;; Function: Check if AL is the switch character from 2nd position of $P_STRING_BUF +;AN020;; Output: ZF = 1 if switch character +;AN020;; lea bp,$P_STRING_BUF ;AN000; +;AN020;; cmp bx,bp ;AN000; 1st position ? +;AN020;; je $P_Chk_S_Exit_1 ;AN000; +;AN020;; cmp al,$P_Switch ;AN000; +;AN020;; jmp short $P_Chk_S_Exit_0 ;AN000; +;AN020;;$P_Chk_S_Exit_1: ;AN000; +;AN020;; cmp al,$P_Switch ;AN000; (tm08) +;AN020;; jne $P_Nop ;AN000; (tm08) +;AN020;; or $P_Flags2,$P_SW ;AN000; (tm08) It could be valid switch +;AN020;;$P_Nop: ;AN000; (tm08) +;AN020;; inc bp ;AN000; +;AN020;; cmp bx,bp ;AN000; reset ZF +;AN020;;$P_Chk_S_Exit_0: ;AN000; +;AN020;; jne $P_Chk_S_Exit ;AN000; +;AN020;; mov $P_Terminator,al ;AN000; store switch character +;AN020;;$P_Chk_S_Exit: ;AN000; + + LEA BP,psdata_seg:$P_String_Buf ;AN020;AC034; BP=OFFSET of $P_String_Buf even in group addressing +; .IF THEN ;AN020;IF not first char THEN + cmp BX,BP ;AN000; + je $P_STRUC_L2 ;AN000; + +; .IF THEN ;AN020;otherwise see if a slash + cmp AL,$P_Switch ;AN000; + jne $P_STRUC_L5 ;AN000; + + STC ;AN020;not in first position and is slash, now see if might be in date string +IF DateSw ;AN020;caller looking for date, see if this may be part of one + PUSH AX ;AN020;save input char + MOV AL,PSDATA_SEG:[BX-1] ;AN026;AL=char before the current char + CALL $P_0099 ;AN020;return carry set if not numeric +; .IF NC ;AND ;AN020;IF previous char numeric AND + jc $P_STRUC_L7 ;AN000; + + MOV AL,[SI] ;AN020;AL=char after the current char + CALL $P_0099 ;AN020;return carry set if not numeric +;(deleted) .IF NC THEN ;AN020;IF next char numeric THEN could be a date +;(deleted) CLC ;AN020;reset CF so "/" not treated as a delimiter +;(deleted) .ENDIF ;AN026; +; .ENDIF ;AN020;ENDIF looks like date (number/number) +$P_STRUC_L7: ;AN000; + POP AX ;AN020;restore AL to input char +ENDIF ;AN020;DateSw +; .ELSE ;AN020; + jmp short $P_STRUC_L1 ;AN000; + +$P_STRUC_L5: ;AN000; + CLC ;AN020;not a slash +; .ENDIF ;AN020; +; .ELSE ;AN020;is first char in the buffer, ZF=0 + jmp short $P_STRUC_L1 ;AN000; + +$P_STRUC_L2: ;AN000; +; .IF THEN ;AN020; + cmp AL,$P_Switch ;AN000; + jne $P_STRUC_L12 ;AN000; + + OR psdata_seg:$P_Flags2,$P_SW ;AN020;AC034;;could be valid switch, first char and is slash +; .ENDIF ;AN020; +$P_STRUC_L12: ;AN000; + CLC ;AN020;CF=0 indicating first char +; .ENDIF ;AN020; +$P_STRUC_L1: ;AN000; + + ret ;AN000; +$P_Chk_Switch endp ;AN000; + PAGE ;AN000; +;************************************************************************** +; $P_Chk_DBCS: +; +; Function: Check if a specified byte is in ranges of the DBCS lead bytes +; +; Input: +; AL = Code to be examineed +; +; Output: +; If CF is on then a lead byte of DBCS +; +; Use: INT 21h w/AH=63 +; +; Vars: $P_DBCSEV_Seg(RW), $P_DBCSEV_Off(RW) +;*************************************************************************** +$P_Chk_DBCS PROC ;AN000; +; + PUSH DS ;AN000; + PUSH SI ;AN000; + PUSH bx ;AN000; (tm11) + CMP psdata_seg:$P_DBCSEV_SEG,0 ;AC034; ALREADY SET ? + JNE $P_DBCS00 ;AN000; + + PUSH AX ;AN000; +; PUSH BX ;AN000; (tm11) + PUSH ds ;AN000; (tm11) + PUSH CX ;AN000; + PUSH DX ;AN000; + PUSH DI ;AN000; + PUSH BP ;AN000; + PUSH ES ;AN000; + XOR SI,SI ;AN000; + MOV DS,SI ;AN000; + MOV AX,$P_DOS_GetEV ;AN000; GET DBCS EV CALL + INT 21H ;AN000; + +; MOV AX,DS ;AN000; (tm11) +; OR AX,AX ;AN000; (tm11) + MOV bx,DS ;AN000; (tm11) + OR bx,bx ;AN000; (tm11) + POP ES ;AN000; + POP BP ;AN000; + POP DI ;AN000; + POP DX ;AN000; + POP CX ;AN000; +; POP BX ;AN000; (tm11) + POP ds ;AN000; (tm11) + POP AX ;AN000; + JE $P_NON_DBCS ;AN000; + +$P_DBCS02: ;AN000; + MOV psdata_seg:$P_DBCSEV_OFF,SI ;AC034; save EV offset +; MOV psdata_seg:$P_DBCSEV_SEG,DS ;AC034; save EV segment + MOV psdata_seg:$P_DBCSEV_SEG,bx ;AC034; save EV segment (tm11) +$P_DBCS00: ;AN000; + MOV SI,psdata_seg:$P_DBCSEV_OFF ;AC034; load EV offset + MOV DS,psdata_seg:$P_DBCSEV_SEG ;AC034; and segment + +$P_DBCS_LOOP: ;AN000; + CMP WORD PTR [SI],0 ;AN000; zero vector ? + JE $P_NON_DBCS ;AN000; then exit + + CMP AL,[SI] ;AN000; + JB $P_DBCS01 ;AN000; Check if AL is in + + CMP AL,[SI+BYTE] ;AN000; range of + JA $P_DBCS01 ;AN000; the vector + + STC ;AN000; if yes, indicate DBCS and exit + JMP short $P_DBCS_EXIT ;AN000; + +$P_DBCS01: ;AN000; + INC SI ;AC035; add '2' to + INC SI ;AC035; SI reg + ;AN000; get next vector +;(changed ;AC035;) ADD SI,2 ;AN000; get next vector + JMP short $P_DBCS_LOOP ;AN000; loop until zero vector found + +$P_NON_DBCS: ;AN000; + CLC ;AN000; indicate SBCS +$P_DBCS_EXIT: ;AN000; + POP bx ;AN000; (tm11) + POP SI ;AN000; + POP DS ;AN000; + RET ;AN000; +$P_Chk_DBCS ENDP ;AN000; diff --git a/v4.0/src/INC/PATHMAC.INC b/v4.0/src/INC/PATHMAC.INC new file mode 100644 index 0000000..7abf50d --- /dev/null +++ b/v4.0/src/INC/PATHMAC.INC @@ -0,0 +1,44 @@ +;;*********************************************************************** +;; NAME: pathlabl +;; DESC: creates a public label at the spot it is placed, using the name +;; given. +;; INPUT: either module name or procedure name +;; OUTPUT: public label +;; LOGIC: LBL-parameter-name will have four values - +;; - one for each pass (2) +;; - one for start and one for stop +;; if LBL is not defined, it is first pass, at beginning label +;; - set it to 1 and create the start label +;; if LBL = 1, it is first pass, at end label +;; - set it to 2 and create stop label +;; if LBL = 2, it is second pass, at beginning label +;; - set it to 3 and create the start label +;; if LBL = 3, it is second pass, at end label +;; - set it to 4 and create stop label +;; if LBL = 4, it is second pass, +;; - this macro has been invoked more than twice with same parm +;; - issue error message +;;*********************************************************************** +IF1 + %OUT COMPONENT=COMMON, MODULE=PATHMAC.INC ... +ENDIF + +pathlabl MACRO pnam +IFNDEF LBL_&pnam ;;IF THIS IS THE FIRST TIME, + LBL_&pnam = 0 ;;DEFINE IT, INITIALLY ZERO +ELSE ;;SINCE IT IS DEFINED + IF (LBL_&pnam GT 3) ;;IF USED TOO MANY TIMES, + .ERR NON-UNIQUE OPERAND ON PATHLABL + EXITM ;;ABORT THIS GENERATION + ENDIF +ENDIF + +IF (LBL_&pnam EQ 0) OR (LBL_&pnam EQ 2) ;;ready for START? + $$A_START_&pnam: ;;create START label + PUBLIC $$A_START_&pnam ;;make it public +ELSE ;;SINCE SWITCH MAY BE 1 OR 3, + $$A_STOP_&pnam: ;;create STOP label + PUBLIC $$A_STOP_&pnam ;;make it public +ENDIF +LBL_&pnam = LBL_&pnam + 1 ;;INCREMENT SWITCH +ENDM diff --git a/v4.0/src/INC/PCGEQU.INC b/v4.0/src/INC/PCGEQU.INC new file mode 100644 index 0000000..c49b8eb --- /dev/null +++ b/v4.0/src/INC/PCGEQU.INC @@ -0,0 +1,184 @@ + +;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B +; CONDITIONAL ASSEMBLY CONTROLS +;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B +WINTHORN EQU 1 ;OS/2 compatible + +;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B +; VIDEO REGISTER PORT ADDRESS EQUATES =B +; =B +;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B +seq_addr EQU 0C4H ;Sequencer Address =B +seq_data EQU 0C5H ;Sequencer Data =B +crtc_addr EQU 0D4H ;CRT Controller Address (Color) =B +crtc_addr_b EQU 0B4H ;CRT Controller Address (Mono) =B +crtc_data EQU 0D5H ;CRT Controller Data =B +graph_1_pos EQU 0CCH ;Graphics 1 Position =B +graph_2_pos EQU 0CAH ;Graphics 2 Position =B +graph_addr EQU 0CEH ;Graphics 1 & 2 Address =B +graph_data EQU 0CFH ;Graphics 1 & 2 Data =B +misc_output EQU 0C2H ;Miscellaneous Output =B +misc_read EQU 0CCH ;Miscellaneous Output Read Port Address =B +in_stat_0 EQU 0C2H ;Input Status Register 0 =B +input_status_b EQU 0BAH ;Feature Control (Mono) =B +input_status EQU 0DAH ;Feature Control (Color) =B +attr_read EQU 0C1H ;Attribute Controller Read Address =B +attr_write EQU 0C0H ;Attribute Controller Write Address =B +fctrl_read EQU 0CAH ;Feature Control Regiester Read Address =B + +;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +; SEQUENCER ADDRESS REGISTER EQUATES +; +;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +s_reset EQU 00H ;Reset =B +s_clock EQU 01H ;Clocking Mode =B +s_map EQU 02H ;Map Mask =B +s_cgen EQU 03H ;Character Map Select =B +s_mem EQU 04H ;Memory Mode =B + + +;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +; GRAPHICS ADDRESS REGISTER EQUATES +; +;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +g_set_reset EQU 00H ;set/reset =B +g_enbl_set EQU 01H ;enable set/reset =B +g_clr_comp EQU 02H ;color compare =B +g_data_rot EQU 03H ;data rotate =B +g_read_map EQU 04H ;read map select =B +g_mode EQU 05H ;mode =B +g_misc EQU 06H ;miscellaneous =B +g_color EQU 07H ;color don't care =B +g_bit_mask EQU 08H ;bit mask =B + +;---------------------------------------------------------------------+ +; | +; Miscellaneous Equates | +; | +;---------------------------------------------------------------------+ + +LINELEN EQU 80 ; Length of a Graphics Buffer Line +COLPELS EQU 8 ; Number of pels per text column +;DEFROFFU EQU 1 ; Default Pointer Icon Row Center Offset +;DEFROFFD EQU 14 ; Default Pointer Icon Row Center Offset +;DEFCOFFR EQU 11 ; Default Pointer Icon Column Center Offst +;DEFCOFFL EQU 4 ; Default Pointer Icon Column Center Offst +;ICONROWS EQU 16 ; Number of Rows in Pointer Icon +;M_WHITE EQU 15 ;default foreground color (icon) +;M_DAXIS EQU 11 ;default axis mouse pointer + +DEFROFFU EQU 1 ; Default Pointer Icon Row Center Offset +DEFROFFD EQU 14 ; Default Pointer Icon Row Center Offset +DEFCOFFR EQU 14 ; Default Pointer Icon Column Center Offst +DEFCOFFL EQU 2 ; Default Pointer Icon Column Center Offst +ICONROWS EQU 20 ; Number of Rows in Pointer Icon +M_DAXIS EQU 800 ;default axis mouse pointer + +ICONCOLS EQU 16 ; Number of Columns in Pointer Icon +SHFTMSK EQU 07H ; Column Shift Count Bit Mask (Hi-Res) +M_BLACK EQU 0 ;default background color (icon) +M_WHITE EQU 15 ;default foreground color (icon) +VSICONR EQU 28 ;# pel rows +VSICONC EQU 2*8 ;# pel columns +MVSICONR EQU 16 ;minimun pel rows in sb icon +MHSICONC EQU 3*8 ;minimum pel cols in sb icon + +;; +;; Long Conditional Jump Macros +;; +lja macro Farlabel + local Nearlabel + jna Nearlabel + jmp Farlabel +Nearlabel: + endm +ljae macro Farlabel + local Nearlabel + jnae Nearlabel + jmp Farlabel +Nearlabel: + endm +ljb macro Farlabel + local Nearlabel + jnb Nearlabel + jmp Farlabel +Nearlabel: + endm +ljc macro Farlabel + local Nearlabel + jnc Nearlabel + jmp Farlabel +Nearlabel: + endm +ljbe macro Farlabel + local Nearlabel + jnbe Nearlabel + jmp Farlabel +Nearlabel: + endm +lje macro Farlabel + local Nearlabel + jne Nearlabel + jmp Farlabel +Nearlabel: + endm +ljz macro Farlabel + local Nearlabel + jnz Nearlabel + jmp Farlabel +Nearlabel: + endm +ljg macro Farlabel + local Nearlabel + jng Nearlabel + jmp Farlabel +Nearlabel: + endm +ljge macro Farlabel + local Nearlabel + jnge Nearlabel + jmp Farlabel +Nearlabel: + endm +ljl macro Farlabel + local Nearlabel + jnl Nearlabel + jmp Farlabel +Nearlabel: + endm +ljle macro Farlabel + local Nearlabel + jnle Nearlabel + jmp Farlabel +Nearlabel: + endm +ljnc macro Farlabel + local Nearlabel + jc Nearlabel + jmp Farlabel +Nearlabel: + endm +ljne macro Farlabel + local Nearlabel + je Nearlabel + jmp Farlabel +Nearlabel: + endm +ljnz macro Farlabel + local Nearlabel + jz Nearlabel + jmp Farlabel +Nearlabel: + endm +ljno macro Farlabel + local Nearlabel + jo Nearlabel + jmp Farlabel +Nearlabel: + endm +ljo macro Farlabel + local Nearlabel + jno Nearlabel + jmp Farlabel +Nearlabel: + endm diff --git a/v4.0/src/INC/PCINPUT.INC b/v4.0/src/INC/PCINPUT.INC new file mode 100644 index 0000000..dc94520 --- /dev/null +++ b/v4.0/src/INC/PCINPUT.INC @@ -0,0 +1,3794 @@ +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Source...: PCINPUT.INC : +; Created..: 01-01-82 : +; Standards: 01-07-86 : +; Revised..: 11-17-87 : +; Version..: PC DOS : +; Called as: FAR, NEAR or INT : +; Public as: INPUT : +; : +;-----------------------------------------------------------------------------+ +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; DEFAULT : +; : +; Performs the following functions: : +; : +; - Initializes pointers and counters : +; - Initializes input buffer with default value (from screen or strg) : +; - Set options and display input buffer as default on screen : +; - Display field delimiters : +; - Display minus or plus sign : +; : +; : +; Entry: ES:SI = Points to current ICB : +; DS:DI = Points to PB : +; : +; WR_CURSIZE = Current cursor size : +; : +; Exit: Default displayed : +; : +;-----------------------------------------------------------------------------+ +; +DEFAULT PROC NEAR +; +; Initialize input buffer with default buffer +; + PUSH BP + PUSH ES ;save registers + PUSH DS + PUSH DI + PUSH SI +; + MOV DX,ES:[SI]+ICB_FIELDLEN ;save for later ;=W + MOV BX,ES:[SI]+ICB_DEFLEN ;save for later ;=W +; + MOV AX,ES:[SI]+ICB_DEFSEG ;get source string segment ;=W + MOV DS,AX ;=W +; + MOV AX,ES:[SI]+ICB_FIELDOFF ;get destination offset ;=W + MOV DI,AX ;=W +; + MOV AX,ES:[SI]+ICB_FIELDSEG ;get destination segment ;=W + MOV CX,ES:[SI]+ICB_DEFOFF ;get source string offset ;=W + MOV SI,CX ;=W + MOV ES,AX ;=W +; + PUSH DI + MOV CX,DX ;clear input buffer ;=W + MOV AL,WR_SPACE ;=W + CLD ;=W + REP STOSB ;=W + POP DI +; ;=W + MOV BP,0 + MOV CX,BX ;initialize number of bytes in ;=W + ; default string + CMP CX,DX ;check if default string is + JBE DEF10 ; longer than input buffer +; + MOV CX,DX ;error set to input buffer leng + MOV BP,ICB_STRU ;set error indicating default was + ; truncated +DEF10: + CLD + REP MOVSB ;move default into input buffer +; + POP SI ;restore registers + POP DI + POP DS + POP ES +; + OR ES:[SI]+ICB_STATUS,BP ;save error status + POP BP +; +; Calculate row and column of input field and set the desired display attribute +; + MOV AX,ES:[SI]+ICB_ROW ;get input field row + MOV [DI]+CR_ROW,AX +; + MOV AX,ES:[SI]+ICB_COL ;get input field column + MOV [DI]+CR_COL,AX +; + CALL PCROWCL_CALL ;calculate row and column info + ; return CR_RCOFF and CR_BEGROWOFF + MOV AL,[DI]+WR_EATTR ;set the entry attribute to the + MOV [DI]+WR_CATTR,AL ; current attribute +; +; Initialize variables for left justified field +; + TEST ES:[SI]+ICB_OPT1,ICB_RJU ;check if right justified + JNE DEF20 +; + MOV [DI]+WR_LEFTCHAR,1 ;set left character marker to + ;beginning of input field + MOV AX,ES:[SI]+ICB_FIELDLEN ;get max field length ;=W +; + TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if horizontal scrolling ;=W + JE DEF15 ;no ;=W + MOV AX,ES:[SI]+ICB_WIDTH ;get field width for horizontal scrolling ;=W + ;because we only show a windowful of field ;=W +DEF15: ;=W + MOV [DI]+WR_RIGHTCHAR,AX ;set ptr to rightmost character ;=W + CALL CAL_COORS ;get end of field char, byte ;=W + JMP DEF30 ;and next byte positions +; +; Initialize variables for right justified field +; +DEF20: ; + ; code here + ; +; +; Display default even if password option is active +; +DEF30: PUSH ES:[SI]+ICB_OPT1 ;save option word +; + TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active + JE DEF40 +; + AND ES:[SI]+ICB_OPT1,NOT ICB_PSW + ;set option word to force disp + ; of default value +DEF40: + MOV AX,2 ;set option to actually display + CALL WORD PTR [DI]+WR_DISPLAY ; default value in proper + ; justification + POP ES:[SI]+ICB_OPT1 ;restore original password +; +; Display initial cursor in proper size and location +; + MOV AX,[DI]+IN_CURNOR ;set cursor size for replace + MOV [DI]+WR_CURSIZE,AX +; + TEST ES:[SI]+ICB_STATUS,ICB_SINS + JE DEF45 ;check if insert is active +; + MOV AX,[DI]+IN_CURINS ;set cursor size for insert + MOV [DI]+WR_CURSIZE,AX +; +DEF45: + CALL CAL_COORS ;calculate coordinates ;=W + CALL CURSOR ;initialize cursor size and locat +; +; Determine if characters in input buffer are allowonce chars and set flags +; + + jmp Def65 ;temp until bug in allowonce scan fixed + + PUSH ES ;save registers + PUSH SI +; + MOV BX,ES ;set segment of ICB + MOV DX,SI ;set offset of ICB +; + MOV CX,ES:[SI]+ICB_FIELDLEN ;get field length +; + PUSH ES:[SI]+ICB_FIELDOFF ;get field offset + PUSH ES:[SI]+ICB_FIELDSEG ;get field segment + POP ES + POP SI +; +DEF50: MOV AL,ES:[SI] ;get character from input buffer + MOV [DI]+DBC_KS,AL ; and set to PCINDBC PB +; + INC SI ;point to next byte +; + CALL PCINDBC_CALL ;call PCINDBC + + TEST [DI]+DBC_STAT,DBC_DBCS ;check if keystroke double byte + JE DEF60 +; + CMP CX,0 ;if last loop is double character + JBE DEF60 ; and is missing trailing byte + ; then, consider a single byte +; + MOV AH,ES:[SI] ;get character from input buffer + MOV [DI]+DBC_KS,AH ; and set to PCINDBC PB + INC SI ;point to next byte + DEC CX ;adjust loop pointer for additial + ; character read (double byte) +; +DEF60: PUSH ES ;save registers + PUSH SI +; + MOV ES,BX ;load ICB + MOV SI,DX +; + CALL ON_ALLOWONCE ;Scan the allowonce string for + ; the character in AX and set flag + ; if found + POP SI ;restore registers + POP ES +; + LOOP DEF50 ;get next keystroke +; + POP SI ;restore registers + POP ES +; +; Display field delimiters +; +DEF65: ;=W + MOV AX,01 ;assume "[ ]" as delimiters ;=W +; ;=W + TEST ES:[SI]+ICB_OPT1,ICB_BEN ;display entry delimiters ;=W + JE DEF100 ;no, leave ;=W +; ;=W + TEST ES:[SI]+ICB_OPT3,ICB_WIN ;does field use windowing ;=W + JE DEF70 ;no, check others ;=W +; ;=W + TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if delimiter = box ;=W + JE DEF90 ;no, display normal delimiters ;=W +; ;=W + MOV AX,06 ;display box ;=W + JMP DEF90 ;done with delimiters ;=W +DEF70: ;=W + TEST ES:[SI]+ICB_OPT3,ICB_HOR ;does field use horiz. window ;=W + JE DEF80 ;=W +; ;=W + MOV AX,03 ;display "[ >" ;=W + CMP ES:[SI]+ICB_HRSTART,01H ;are we at beginning of window ? ;=W + JLE DEF80 ;yes ;=W +; + MOV AX,04 ;no, display "< >" ;=W +DEF80: ;=W + CALL DELIMITER ;do it ;=W +; + TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if also need box ;=W + JE DEF100 ;=W +; ;=W + MOV AX,06 ;display box ;=W +DEF90: ;=W + CALL DELIMITER ;do it ;=W +; +; Display minus or plus sign if active +; +DEF100: + TEST ES:[SI]+ICB_OPT1,ICB_MUS ;Check if minus/plus sign + JE DEFEXIT ; display option is active +; + MOV [DI]+WR_KEYCONF,0 ;initialize to plus sign key +; + TEST ES:[SI]+ICB_OPT1,ICB_SMU ;Check if default is negative + JE DEF110 +; + OR [DI]+WR_KEYCONF,WR_MUS ;initialize to minus sign key +; +DEF110: CALL PLUS_MINUS ;display plus or minus sign and + ; set status +; +DEFEXIT: ;continue +; + RET +DEFAULT ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; PRE_EXIT : +; : +; Performs the following functions: : +; : +; - Removes field delimiters : +; - Inserts commas as specified : +; - Inserts decimal point as specified : +; - Adjusts field to specified significant digits : +; - Displays buffer contents in exit color : +; - Checks if original default has changed : +; - Check if entry is in specified numeric range : +; - Sets minus or plus sign indicator in exit color : +; - Remove thousand separators from input string buffer : +; - Restore original cursor position and size, only in text mode : +; : +; Entry: ES:SI = Points to current ICB : +; DS:DI = Points to PB : +; : +; Exit: None : +; : +;-----------------------------------------------------------------------------+ +; +PRE_EXIT PROC NEAR + +; +; Inserts commas as specified +; + ; + ; Code here + ; +; +; Inserts decimal point as specified +; + ; + ; Code here + ; +; +; Adjusts field to specified significant digits +; + ; + ; Code here + ; +; +; Calculate color attribute of exit colors +; + TEST ES:[SI]+ICB_OPT1,ICB_XCL ;check if option to use exit + JE PRE10 ; colors is active +; + MOV AL,[DI]+WR_XATTR ;set the exit attribute to the + MOV [DI]+WR_CATTR,AL ; current attribute +; +; Display default value of input buffer in proper justification +; +PRE10: MOV [DI]+WR_LEFTCHAR,1 ;set left character + MOV AX,ES:[SI]+ICB_FIELDLEN ;set right marker +; + TEST ES:[SI]+ICB_OPT3,ICB_HOR ;horizontal scrolling mode ? ;=W + JE PRE15 ;no, display all buffer ;=W + MOV AX,ES:[SI]+ICB_WIDTH ;use width instead of all buffer ;=W +PRE15: + MOV [DI]+WR_RIGHTCHAR,AX +; + MOV AX,2 ;set option to actually display + CALL WORD PTR [DI]+WR_DISPLAY ; default value in proper +; ; justification +; Process minus/plus key options +; + TEST ES:[SI]+ICB_OPT1,ICB_MUS ;Check if minus/plus sign + JE PRE40 ; display option is active +; + MOV [DI]+WR_KEYCONF,0 ;initialize to plus sign +; + TEST ES:[SI]+ICB_STATUS,ICB_SMUS + JE PRE20 ;Check if sign is negative +; + OR [DI]+WR_KEYCONF,WR_MUS ;initialize to minus sign key +; +PRE20: TEST ES:[SI]+ICB_STATUS,ICB_SPUS + JE PRE30 ;Check if sign is positive +; + OR [DI]+WR_KEYCONF,WR_PUS ;initialize to plus sign key +; +PRE30: CALL PLUS_MINUS ;display plus or minus sign + ; according to WR_KEYCONF setting +; +; Replace field entry delimiters with exit delimiters +; +PRE40: TEST ES:[SI]+ICB_OPT1,ICB_BEX ;check if field delimiters + JE PRE60 ; should be displayed on exit +; + MOV AX,2 ;option to remove delimiters + CALL DELIMITER ;display delimiters +; + TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if box around field + JE PRE60 ; should be displayed +; + MOV AX,7 ;set option to remove box + CALL DELIMITER ;display delimiters +; +; Check if default value has changed and set return flag +; +PRE60: PUSH DS ;save registers + PUSH SI + PUSH ES + PUSH DI +; + MOV CX,ES:[SI]+ICB_DEFLEN ;initialize to default length + CMP CX,ES:[SI]+ICB_FIELDLEN ;check if default length is less + JBE PRE70 ; than field length +; + MOV CX,ES:[SI]+ICB_FIELDLEN ;initialize to field length +; +PRE70: MOV AX,ES:[SI]+ICB_DEFSEG ;compare default string to ;=W + MOV DS,AX ;=W + MOV AX,ES:[SI]+ICB_FIELDOFF ;=W + MOV DI,AX ;=W +; + MOV AX,ES:[SI]+ICB_DEFOFF ; current input string ;=W + MOV BX,ES:[SI]+ICB_FIELDSEG ;=W + MOV ES,BX ;=W + MOV SI,AX ;=W +; + REPE CMPSB ;compare default and input strings +; + POP DI ;restore registers + POP ES + POP SI + POP DS +; + CMP CX,0 ;are we done ? ;=W + JE PRE80 ;check if strings compared +; + OR ES:[SI]+ICB_STATUS,ICB_SDEF + ;set flag that default changed +; +; Check if entry is within specified numeric range, if not set flag +; +PRE80: ; + ; code here + ; +; +; Remove thousand separators if specified from input string buffer +; +PRE90: ; + ; code here + ; +; +; Restore original cursor position and size +; +PRE95: + TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ? + JE PRE100 ;no, quit + CALL CURSOR ;erase the graphics cursor +PRE100: + OR ES:[SI]+ICB_STATUS,ICB_DONE ;exit condition found, exit ;=W +; ;=W +; Check if ICB_SAV option selected. If selected, then save contents of the ;=W +; input buffer to the default buffer. ;=W +; ;=W + TEST ES:[SI]+ICB_OPT4,ICB_SAV ;check ? ;=W + JE PRE200 ;no, exit now ;=W +; ;=W + PUSH ES ;save registers ;=W + PUSH DS ;=W + PUSH DI ;=W + PUSH SI ;=W +; ;=W + MOV CX,ES:[SI]+ICB_ENDBYTE ;# of bytes to copy from input ;=W + ; buffer to default buffer ;=W + MOV ES:[SI]+ICB_DEFLEN,CX ;reset default length +; + MOV AX,ES:[SI]+ICB_FIELDSEG ;get destination segment ;=W + MOV DS,AX ;=W +; ;=W + MOV AX,ES:[SI]+ICB_DEFOFF ;get source string offset ;=W + MOV DI,AX ;=W +; ;=W + MOV AX,ES:[SI]+ICB_DEFSEG ;get source string segment ;=W + MOV BX,ES:[SI]+ICB_FIELDOFF ;get destination offset ;=W + MOV SI,BX ;=W + MOV ES,AX ;=W +; ;=W + CLD ;=W + REP MOVSB ;move default into input buffer ;=W +; ;=W + POP SI ;restore registers ;=W + POP DI ;=W + POP DS ;=W + POP ES ;=W +PRE200: ;=W + RET +PRE_EXIT ENDP +; ;=W +PAGE ;=W +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; RIGHT_H_JUST : ;=W +; : ;=W +; Process keystroke and update display with input buffer changes : ;=W +; for the following functions: : ;=W +; : ;=W +; Home key Up arrow Allowonce replace mode : ;=W +; End key Down arrow Allowonce insert mode : ;=W +; Left arrow Control end Allow replace mode : ;=W +; Right arrow Delete key Allow insert mode : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +; ;=W +RIGHT_H_JUST PROC NEAR ;=W +; ;=W + ; ;=W + ; code here ;=W + ; ;=W +; ;=W + RET ;=W +RIGHT_H_JUST ENDP ;=W +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; RIGHT_JUST : +; : +; Process keystroke and update display with input buffer changes : +; for the following functions: : +; : +; Home key Up arrow Allowonce replace mode : +; End key Down arrow Allowonce insert mode : +; Left arrow Control end Allow replace mode : +; Right arrow Delete key Allow insert mode : +; : +;-----------------------------------------------------------------------------+ +; +RIGHT_JUST PROC NEAR +; + ; + ; code here + ; +; + RET +RIGHT_JUST ENDP +; ;=W +PAGE ;=W +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; LEFT_H_JUST : ;=W +; : ;=W +; Process keystroke and update display with input buffer changes : ;=W +; for the following functions: : ;=W +; : ;=W +; Home key Up arrow Allowonce replace mode : ;=W +; End key Down arrow Allowonce insert mode : ;=W +; Left arrow Control end Allow replace mode : ;=W +; Right arrow Delete key Allow insert mode : ;=W +; : ;=W +; : ;=W +; Following information is used: : ;=W +; : ;=W +; : ;=W +; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W +; ³ buffer in memory. : ;=W +; ³ : ;=W +; ³ ÚÄ (WR_CUBYTE) Byte offset into the input buffer : ;=W +; ³ ³ of where characters will be added : ;=W +; ³ ³ to input buffer. : ;=W +; ³ ³ : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ S ³ ³ ³ ³ ³ ³ ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W +; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W +; ³ : ;=W +; (ICB_FIELDLEN) Length of input field in bytes. : ;=W +; : ;=W +; : ;=W +; The following demonstrates the before and after input buffer : ;=W +; images. (S = Single byte, L = DBCS lead byte, T = DBCS trailing : ;=W +; byte) : ;=W +; : ;=W +; Deleting a double byte: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W +; : ;=W +; Deleting a single byte: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ L ³ T ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W +; : ;=W +; Backspace removal of a double byte: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W +; : ;=W +; Backspace removal of a single byte: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ S ³ S ³ S ³ L ³ T ³ ³ S ³ S ³ S ³ L ³ T ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W +; : ;=W +; Replacing a double byte with a double byte: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W +; : ;=W +; Replacing a double byte with a single byte: (Option 1) : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ S ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W +; : ;=W +; Replacing a double byte with a single byte: (Option 2) : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ S ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W +; : ;=W +; Replacing a single byte with a single byte: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W +; : ;=W +; Replacing a single byte with a double byte. : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W +; : ;=W +; Replacing a single byte with a double byte without enough buffer: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W +; : ;=W +; Inserting a single byte. : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W +; : ;=W +; Inserting a single byte without enough buffer generate an error: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ S ³ S ³ ³ ³ S ³ L ³ T ³ S ³ S ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W +; : ;=W +; Inserting a double byte character: : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W +; : ;=W +; : ;=W +; Entry: ES:SI = Points to current ICB : ;=W +; DS:DI = Points to PB : ;=W +; : ;=W +; INC_KS = Keystroke from returned from PCINCHA : ;=W +; : ;=W +; WR_KEYCONF = Bit flag inidicating the options set for INC_KS : ;=W +; WR_KEYCONF2 keystroke. : ;=W +; : ;=W +; Exit: None. : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +; ;=W +LEFT_H_JUST PROC NEAR ;=W +; ;=W +; Initialize right and left boundary markers ;=W +; ;=W + TEST [DI]+WR_KEYCONF,WR_MASK ;check to see if editing key entered ;=W + JNE LHJ5 ;yes, must check for editing keys ;=W + JMP LHJ190 ;no, skip checks for editing keys ;=W + ;=W +; ;=W +; Process home key ;=W +; ;=W +LHJ5: TEST [DI]+WR_KEYCONF,WR_HOM ;check if home key pressed ;=W + JE LHJ10 ;=W +; ;=W + ; ;=W + ; add ICB_WHM option to process window home key movement ;=W + ; ;=W +; ;=W + MOV ES:[SI]+ICB_CURCHAR,1 ;initialize cursor to 1st byte ;=W + ; position, assuming no windowing ;=W + ; wrap is occurring ;=W + MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W + CALL CAL_COORS ;calculate cursor position ;=W + MOV AX,3 ;display delimiters "[ >" ;=W + CALL DELIMITER ;display delimiter ;=W + JMP LHJEXIT ; returns WR_CURROW, WR_CURROW ;=W + ; and WR_CUBYTE ;=W +; ;=W +; Process end key ;=W +; ;=W +LHJ10: TEST [DI]+WR_KEYCONF,WR_END ;check if home key pressed ;=W + JNE LHJ12 ;=W + JMP LHJ20 +LHJ12: ;=W + ; ;=W + ; add ICB_WEN to move cursor to end of current window row ;=W + ; ;=W +; ;=W + CALL CAL_COORS ;get current end of field info ;=W + MOV AX,[DI]+WR_ENCHAR ;adjust one past end buffer charac ;=W + INC AX ;=W + MOV ES:[SI]+ICB_CURCHAR,AX ;set current cursor position to ;=W + CALL CAL_COORS ;get cursor position ;=W + MOV AX,4 ;display delimiters "< >" ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LHJ17 ;no ;=W + MOV AX,5 ;display delimiters "< ]" ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LHJ15 + MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position + MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W + MOV AX,3 ;display delimiters "[ >" ;=W + JMP LHJ19 ;exit +LHJ15: + TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W + JE LHJ16 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W +LHJ16: ;=W + MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W + SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W + INC BX ; DBCS support) ;=W + MOV [DI]+WR_HRCHAR,BX ;=W + JMP LHJ19 ;=W +LHJ17: ;=W + MOV CX,[DI]+WR_CUBYTE ;check if need to adjust horz. ;=W + CMP CX,ES:[SI]+ICB_WIDTH ; window ;=W + JA LHJ18 ;=W + MOV [DI]+WR_HRCHAR,1 ;=W + MOV AX,3 ;display delimiters "[ >" ;=W + JMP LHJ19 ;=W +LHJ18: ;=W + MOV BX,[DI]+WR_ENBYTE ;yes, adjust it ;=W + SUB BX,ES:[SI]+ICB_WIDTH ;=W + ADD BX,2 ;=W + MOV [DI]+WR_HRCHAR,BX ;=W +LHJ19: ;=W + CALL CAL_COORS ;re-calculate display ;=W + CALL DELIMITER ;display delimiter ;=W + JMP LHJEXIT ;exit ;=W +; ;=W +; Process left arrow ;=W +; ;=W +LHJ20: TEST [DI]+WR_KEYCONF,WR_LFT ;check if left arrow key pressed ;=W + JE LHJ40 ;=W +; ;=W + ; ;=W + ; add ICB_CSW option to wrap cursor from top/bottom end to end ;=W + ; ;=W +; ;=W + ; ;=W + ; add ICB_WAR option to wrap cursor on same row end to end ;=W + ; ;=W +; ;=W + MOV BX,ES:[SI]+ICB_CURCHAR ;get cursor position ;=W + CMP BX,1 ;is cursor in first position ? ;=W + JA LHJ30 ;no ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LHJ23 + MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W + MOV ES:[SI]+ICB_CURCHAR,BX ;wrap to first character position + SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W + INC BX ; DBCS support) ;=W + MOV [DI]+WR_HRCHAR,BX ;=W +; + MOV AX,5 ;display delimiters "< ]" ;=W + CALL DELIMITER ;display delimiter ;=W + JMP LHJ32 ;exit +LHJ23: + MOV AX,3 ;display delimiters "[ >" ;=W + CALL DELIMITER ;display delimiter ;=W + TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W + JE LHJ25 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W + JMP LHJ400 ;=W +LHJ25: ;=W + CALL PCMBEEP_CALL ;error beep ;=W + JMP LHJEXIT ;exit ;=W +LHJ30: ;=W + DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position ;=W +; + CMP BX,[DI]+WR_HRCHAR ;is cursor to the left of horz.wind. ? ;=W + JG LHJ32 ;no ;=W + DEC [DI]+WR_HRCHAR ;yes, adjust horiz. window ;=W + MOV AX,4 ;display delimiters "< >" ;=W + CALL DELIMITER ;display delimiter ;=W +LHJ32: ; towards the left ;=W + CALL CAL_COORS ;calculate cursor position + JMP LHJEXIT ;exit ;=W +; ;=W +; Process right arrow ;=W +; ;=W +LHJ40: TEST [DI]+WR_KEYCONF,WR_RGT ;check if left arrow key pressed ;=W + JE LHJ60 ;=W +; ;=W + ; ;=W + ; add ICB_WAR option to wrap cursor on same row end to end ;=W + ; ;=W +; ;=W + CALL CAL_COORS ;get cursor position ;=W +; ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LHJ50 ;=W +; ;=W + MOV AX,5 ;display delimiters "< ]" ;=W + CALL DELIMITER ;display delimiter ;=W + CALL PCMBEEP_CALL ;error beep ;=W + JMP LHJEXIT ;exit ;=W +; ;=W +LHJ50: INC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position ;=W + ; towards the right ;=W + MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W + ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W + CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W + JG LHJ52 ;no ;=W + INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W + MOV AX,4 ;display delimiters "< >" ;=W + CALL DELIMITER ;display delimiter ;=W +LHJ52: ;=W + CALL CAL_COORS ;calculate cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LHJ55 ;no ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LHJ53 + MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position + MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W + MOV AX,3 ;display delimiters "[ >" ;=W + CALL DELIMITER ;display delimiter ;=W + JMP LHJ55 ;exit +LHJ53: + DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W + MOV AX,5 ;display delimiters "< ]" ;=W + CALL DELIMITER ;display delimiter ;=W + TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W + JE LHJ55 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W +LHJ55: ;=W + CALL CAL_COORS ;calculate cursor position ;=W + JMP LHJEXIT ;exit ;=W +; ;=W +; Process up arrow ;=W +; ;=W +LHJ60: ; ;=W + ; adjust cursor position ;=W + ; ;=W + ;=W + ; ;=W + ; check for field wrap, exit, error beep ;=W + ; ;=W +; ;=W +; Process down arrow ;=W +; ;=W +LHJ70: ; ;=W + ; adjust cursor position ;=W + ; ;=W + ;=W + ; ;=W + ; check for field wrap, exit, error beep ;=W + ; ;=W +; ;=W +; Process cntrl+end key ;=W +; ;=W +LHJ80: TEST [DI]+WR_KEYCONF,WR_CED ;check if control+end key pressed ;=W + JE LHJ100 ;=W +; ;=W + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LHJ90 ;=W +; ;=W + CALL PCMBEEP_CALL ;error beep ;=W + JMP LHJEXIT ;exit ;=W +LHJ90: + MOV BX,[DI]+WR_CUBYTE ;delete from current byte position ;=W + CALL CLEAR_BUFFER ;=W +; ;=W + CALL CAL_COORS ;calculate cursor position + JMP LHJEXIT ;display field, set cursor, exit ;=W +; ;=W +; Process delete key ;=W +; ;=W +LHJ100: TEST [DI]+WR_KEYCONF,WR_DEL ;check if delete key pressed ;=W + JE LHJ130 ;=W +; ;=W + ; ;=W + ; Add ICB_WDL option in off state to delete on current line only ;=W + ; ;=W +; ;=W + CALL CAL_COORS ;get cursor position ;=W +; ;=W + CMP [DI]+WR_FIELDEND,1 ;check if cursor past end of field ;=W + JE LHJ110 ;=W +; ;=W + CALL REMOVE_CHAR ;remove character at current offst ;=W + ; and shift remaining in place ;=W + CALL CAL_COORS ;calculate cursor position + JMP LHJEXIT ;display field, set cursor, exit ;=W +; ;=W +LHJ110: CALL PCMBEEP_CALL ;error beep ;=W + JMP LHJEXIT ;exit ;=W +; ;=W +; Process backspace key ;=W +; ;=W +LHJ130: TEST [DI]+WR_KEYCONF,WR_BCK ;check if backspace key pressed ;=W + JE LHJ160 ;=W +; ;=W + MOV BX,ES:[SI]+ICB_CURCHAR ;get cursor position ;=W + CMP BX,1 ;check if cursor is at first ;=W + JA LHJ140 ; field position ;=W +; + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LHJ133 + MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W + MOV ES:[SI]+ICB_CURCHAR,BX ;wrap to first character position + SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W + INC BX ; DBCS support) ;=W + MOV [DI]+WR_HRCHAR,BX ;=W +; + MOV AX,5 ;display delimiters "< ]" ;=W + CALL DELIMITER ;display delimiter ;=W + JMP LHJ145 ;exit +LHJ133: + MOV AX,3 ;display delimiters "[ >" ;=W + TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W + JE LHJ135 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W + CALL DELIMITER ;display delimiter ;=W + JMP LHJ400 ;=W +LHJ135: ;=W + CALL DELIMITER ;display delimiter ;=W + CALL PCMBEEP_CALL ;error beep ;=W + JMP LHJEXIT ;exit ;=W +LHJ140: ;=W + DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position + ; towards the left ;=W + CMP BX,[DI]+WR_HRCHAR ;is cursor in front of the wind. ? ;=W + JG LHJ142 ;no ;=W + DEC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W + MOV AX,4 ;display delimiters "< >" ;=W + CALL DELIMITER ;display delimiter ;=W +LHJ142: ;=W +; ;=W + CALL CAL_COORS ;get cursor position ;=W + CALL REMOVE_CHAR ;remove character at current offst ;=W + ; and shift remaining in place ;=W +LHJ145: ;=W + CALL CAL_COORS ;calculate cursor position + JMP LHJEXIT ;display field, set cursor, exit ;=W +; ;=W +; Process insert key toggle ;=W +; ;=W +LHJ160: TEST [DI]+WR_KEYCONF,WR_INS ;check if insert key pressed ;=W + JE LHJ180 ; if not, continue ;=W +; ;=W + TEST ES:[SI]+ICB_STATUS,ICB_SINS ;check if in insert mode ? ;=W + JE LHJ165 ;no, put in insert mode ;=W +; ;=W + MOV BX,[DI]+IN_CURNOR ;set cursor size for normal ;=W + MOV [DI]+WR_CURSIZE,BX ; cursor ;=W +; ;=W + AND ES:[SI]+ICB_STATUS,NOT ICB_SINS ;=W + JMP LHJ170 ;turn insert mode off ;=W +; ;=W +LHJ165: MOV BX,[DI]+IN_CURINS ;set cursor size for insert ;=W + MOV [DI]+WR_CURSIZE,BX ; cursor ;=W +; ;=W + OR ES:[SI]+ICB_STATUS,ICB_SINS ;=W + ;turn insert mode on ;=W +; ;=W +LHJ170: ;=W +; ;=W + PUSH DS ;save registers ;=W + PUSH DI ;=W +; ;=W + MOV DI,40H ;point DS:DI to KB_FLAG in BIOS ;=W + MOV DS,DI ;=W + MOV DI,17H ;=W + MOV AX,[DI] ;get current BIOS KB_FLAG ;=W +; ;=W + AND AX,NOT WR_INSSTATE ;set BIOS insert active flag off ;=W +; ;=W + TEST ES:[SI]+ICB_STATUS,ICB_SINS ;=W + JE LHJ175 ;check if insert should be set on ;=W +; ;=W + OR AX,WR_INSSTATE ;set BIOS insert active flag on ;=W +; ;=W +LHJ175: POP DI ;restore registers ;=W + POP DS ;=W +; ;=W + JMP LHJEXIT ;exit ;=W +; ;=W +; Process allowonce key option ;=W +; ;=W +LHJ180: ; ;=W + ; insert or replace ;=W + ; ;=W +; ;=W + ; ;=W + ; adjust input buffer ;=W + ; ;=W +; ;=W + ; ;=W + ; check for field wrap, exit, error beep ;=W + ; ;=W +; ;=W + ; ;=W + ; adjust cursor position ;=W + ; ;=W +; ;=W +; Process allowed keystroke in replace mode ;=W +; ;=W +LHJ190: TEST [DI]+WR_KEYCONF,WR_ALL ;check if allow key pressed ;=W + JNE LHJ195 ;=W +; ;=W + CALL PCMBEEP_CALL ;error beep key not defined ;=W + JMP LHJEXIT ;exit ;=W +; ;=W +LHJ195: TEST ES:[SI]+ICB_STATUS,ICB_SINS ;=W + JE LHJ198 ;check if insert is active ;=W +; ;=W + JMP LHJ270 ;do insert display ;=W +; ;=W +LHJ198: ;=W + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LHJ200 ;=W +; ;=W + CALL PCMBEEP_CALL ;error beep key not defined ;=W + JMP LHJEXIT ;exit ;=W +; ;=W +; Check if character to be replaced in field buffer is double byte character ;=W +; ;=W +LHJ200: PUSH ES ;save registers ;=W + PUSH SI ;=W +; ;=W + PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W + PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W + POP SI ;=W + POP ES ;=W +; ;=W + ADD SI,[DI]+WR_CUBYTE ;add cursor offset into buffer ;=W + DEC SI ;make zero based ;=W +; ;=W + MOV CX,ES ;save offset of character to ;=W + MOV DX,SI ; replace ;=W +; ;=W + MOV AL,ES:[SI] ;get byte that cursor is pointing ;=W + MOV [DI]+DBC_KS,AL ; to check if DBCS ;=W + CALL PCINDBC_CALL ;call routine to check if char ;=W + ; is lead double byte char ;=W +; ;=W + POP SI ;restore registers ;=W + POP ES ;=W +; ;=W + TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS ;=W + JE LHJ220 ; if no, jump to single byte code ;=W +; ;=W +; Replace double byte character with double byte character ;=W +; ;=W + TEST [DI]+WR_KEYCONF2,WR_DBC ;check if keystroke is DBC ;=W + JE LHJ210 ;continue with single byte ;=W +; ;=W + MOV AX,[DI]+INC_KS ;set double byte character to ;=W + ; input buffer replacing ;=W + ; double byte character ;=W + PUSH ES ;=W + PUSH SI ;=W +; ;=W + MOV ES,CX ;save offset of character to ;=W + MOV SI,DX ; replace ;=W + MOV ES:[SI],AX ;replace double byte ;=W +; ;=W + POP SI ;restore registers ;=W + POP ES ;=W +; ;=W + JMP LHJ260 ;exit ;=W +; ;=W +; Replace double byte character with single byte character ;=W +; ;=W +LHJ210: MOV AX,[DI]+INC_KS ;get keystroke and replace double ;=W + ; byte with single byte ;=W +; ;=W + PUSH ES ;=W + PUSH SI ;=W +; ;=W + MOV ES,CX ;save offset of character to ;=W + MOV SI,DX ; replace single byte ;=W + MOV ES:[SI],AL ;=W +; ;=W + POP SI ;restore registers ;=W + POP ES ;=W +; ;=W + MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte ;=W + MOV [DI]+WR_RIGHTBYTE,AX ;=W +; ;=W + MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W + INC AX ;adjust past replaced leading byte ;=W + MOV [DI]+WR_LEFTBYTE,AX ; trailing byte ;=W +; ;=W + MOV BX,1 ;set number of positions to shift ;=W + MOV AX,2 ;set option to shift left ;=W + CALL SHIFT ;call shift 1 position toward left ;=W + JMP LHJ260 ;exit ;=W +; ;=W +; Replace single byte character with single byte character ;=W +; ;=W +LHJ220: TEST [DI]+WR_KEYCONF2,WR_DBC ;check if double byte character ;=W + JNE LHJ230 ; continue with single byte ;=W +; ;=W + MOV AX,[DI]+INC_KS ;get keystroke ;=W +; ;=W + PUSH ES ;=W + PUSH SI ;=W +; ;=W + MOV ES,CX ;save offset of character to ;=W + MOV SI,DX ; replace single byte ;=W + MOV ES:[SI],AL ;=W +; ;=W + POP SI ;restore registers ;=W + POP ES ;=W +; ;=W + JMP LHJ260 ;exit ;=W +; ;=W +; Replace single byte character with double byte character ;=W +; ;=W +LHJ230: ;=W + CALL CAL_COORS ;calculate cursor position ;=W + MOV BX,[DI]+WR_ENBYTE ;get end byte of input field ;=W + MOV AX,[DI]+WR_ENCHAR ;get end character of field ;=W + CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character ;=W + JA LHJ240 ;=W +; ;=W + MOV BX,[DI]+WR_CUBYTE ;set cursor character position ;=W +LHJ240: ;=W + MOV AX,ES:[SI]+ICB_FIELDLEN ;get end of field position ;=W + SUB AX,BX ;subtract to get the remaining space ;=W + CMP AX,1 ;will byte fit ? ;=W + JGE LHJ250 ;yes ;=W +; ;=W + CALL PCMBEEP_CALL ;error beep because replace char ;=W + JMP LHJEXIT ; will not fit and exit ;=W +; ;=W +LHJ250: MOV BX,ES:[SI]+ICB_FIELDLEN ;set ending byte ;=W + MOV [DI]+WR_RIGHTBYTE,BX ;=W +; ;=W + MOV BX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W + INC BX ;adjust past replaced leading byte ;=W + MOV [DI]+WR_LEFTBYTE,BX ; trailing byte ;=W +; ;=W + MOV BX,1 ;set number of positions to shift ;=W + MOV AX,1 ;set option to shift right ;=W + CALL SHIFT ;call shift 1 position toward ;=W + ; left ;=W + MOV AX,[DI]+INC_KS ;get keystroke ;=W +; ;=W + PUSH ES ;=W + PUSH SI ;=W +; ;=W + MOV ES,CX ;save offset of character to ;=W + MOV SI,DX ; replace double byte ;=W + MOV ES:[SI],AX ;=W +; ;=W + POP SI ;restore registers ;=W + POP ES ;=W +; ;=W +; Calculate new ending and cursor coordinates ;=W +; ;=W +LHJ260: ;=W + CALL CAL_COORS ;calculate cursor position ;=W + INC ES:[SI]+ICB_CURCHAR ;point to next char ;=W + MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W + ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W + CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W + JG LHJ265 ;no ;=W + INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W + MOV AX,4 ;display delimiters "< >" ;=W + CALL DELIMITER ;display delimiter ;=W +LHJ265: ;=W + CALL CAL_COORS ;calculate cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LHJ267 ;no ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LHJ266 + MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position + MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W + MOV AX,3 ;display delimiters "[ >" ;=W + CALL DELIMITER ;display delimiter ;=W + JMP LHJ267 ;exit +LHJ266: + + DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W + MOV AX,5 ;display delimiters "< ]" ;=W + CALL DELIMITER ;display delimiter ;=W + TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W + JE LHJ267 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W +LHJ267: ;=W + CALL CAL_COORS ;calculate cursor position ;=W + JMP LHJEXIT ;display field, set cursor, exit ;=W +; ;=W +; Process allowed keystroke in insert mode ;=W +; ;=W +LHJ270: ;=W + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LHJ280 ;=W +; ;=W + CALL PCMBEEP_CALL ;error beep key not defined ;=W + JMP LHJEXIT ;exit ;=W +; ;=W +; Check if enough room available to insert single or double byte character ;=W +; ;=W +LHJ280: ;=W + MOV CX,ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W + MOV DX,ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W +; ;=W + ADD DX,[DI]+WR_CUBYTE ;add cursor offset into buffer ;=W + DEC DX ;make zero based ;=W +; ;=W + MOV BX,1 ;initialize to single byte ;=W +; ;=W + TEST [DI]+WR_KEYCONF2,WR_DBC ;check for double byte character ;=W + JE LHJ290 ;=W +; ;=W + MOV BX,2 ;reset to double byte character ;=W +LHJ290: ;=W + PUSH BX ;=W + CALL CAL_COORS ;calculate cursor position ;=W + MOV BX,[DI]+WR_ENBYTE ;get end byte of input field ;=W + MOV AX,[DI]+WR_ENCHAR ;get end character of field ;=W + CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character ;=W + JA LHJ300 ;=W +; ;=W + MOV BX,[DI]+WR_CUBYTE ;set cursor character position ;=W +LHJ300: ;=W + MOV AX,ES:[SI]+ICB_FIELDLEN ;get end of field position ;=W + SUB AX,BX ;subtract to get the remaining space ;=W + POP BX ;=W + CMP AX,BX ;will byte fit ? ;=W + JGE LHJ310 ;yes ;=W +; ;=W + CALL PCMBEEP_CALL ;error beep replace character ;=W + JMP LHJEXIT ; will not fit and exit ;=W +; ;=W +; Shift to insert single or double byte character, BX= # bytes to shift ;=W +; ;=W +LHJ310: MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte to make room in ;=W + MOV [DI]+WR_RIGHTBYTE,AX ; buffer by shifting characters ;=W +; ;=W + MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W + MOV [DI]+WR_LEFTBYTE,AX ; trailing byte ;=W +; ;=W + MOV AX,1 ;set option to shift right, BX= ;=W + ; number of bytes to insert ;=W + CALL SHIFT ;call shift 1 position toward ;=W + ; left ;=W + MOV AX,[DI]+INC_KS ;get keystroke ;=W +; ;=W +; Insert single byte character ;=W +; ;=W + CMP BX,2 ;check how many bytes should be ;=W + JE LHJ320 ; inserted ;=W +; ;=W + PUSH ES ;=W + PUSH SI ;=W +; ;=W + MOV ES,CX ;save offset of character to ;=W + MOV SI,DX ; replace single byte ;=W + MOV ES:[SI],AL ;insert single byte character ;=W +; ;=W + POP SI ;restore registers ;=W + POP ES ;=W +; ;=W + JMP LHJ330 ;=W +; ;=W +; Insert double byte character ;=W +; ;=W +LHJ320: PUSH ES ;=W + PUSH SI ;=W +; ;=W + MOV ES,CX ;save offset of character to ;=W + MOV SI,DX ; replace ;=W + MOV ES:[SI],AX ;insert double byte character ;=W +; ;=W + POP SI ;restore registers ;=W + POP ES ;=W +; ;=W +; Calculate new ending and cursor coordinates ;=W +; ;=W +LHJ330: ;=W + CALL CAL_COORS ;get new end coordinates ;=W +; ;=W + INC ES:[SI]+ICB_CURCHAR ;point to next char ;=W + MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W + ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W + CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W + JG LHJ332 ;no ;=W + INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W + MOV AX,4 ;display delimiters "< >" ;=W + CALL DELIMITER ;display delimiter ;=W +LHJ332: ;=W + CALL CAL_COORS ;calculate cursor position + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LHJ335 ;no ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LHJ333 + MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position + MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W + MOV AX,3 ;display delimiters "[ >" ;=W + CALL DELIMITER ;display delimiter ;=W + JMP LHJ335 ;exit +LHJ333: + DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W + MOV AX,5 ;display delimiters "< ]" ;=W + CALL DELIMITER ;display delimiter ;=W + TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W + JE LHJ335 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W +LHJ335: + CALL CAL_COORS ;calculate cursor position ;=W + JMP LHJEXIT ;display cursor +; ;=W +; Display field & Exit ;=W +; ;=W +LHJ400: + CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer ;=W + ; in left justified field ;=W + JMP LHJCUR +LHJEXIT: ;=W + CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer ;=W + ; in left justified field ;=W + TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ? + JNE LHJCUR ;cursor is already on, don't turn it on ;=W + CALL CURSOR ;display cursor ;=W +LHJCUR: +; ;=W + RET ;=W +LEFT_H_JUST ENDP ;=W +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; LEFT_JUST : +; : +; Process keystroke and update display with input buffer changes : +; for the following functions: : +; : +; Home key Up arrow Allowonce replace mode : +; End key Down arrow Allowonce insert mode : +; Left arrow Control end Allow replace mode : +; Right arrow Delete key Allow insert mode : +; : +; : +; Following information is used: : +; : +; : +; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : +; ³ buffer in memory. : +; ³ : +; ³ ÚÄ (WR_CUBYTE) Byte offset into the input buffer : +; ³ ³ of where characters will be added : +; ³ ³ to input buffer. : +; ³ ³ : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ S ³ S ³ ³ ³ ³ ³ ³ ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : +; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : +; ³ : +; (ICB_FIELDLEN) Length of input field in bytes. : +; : +; : +; The following demonstrates the before and after input buffer : +; images. (S = Single byte, L = DBCS lead byte, T = DBCS trailing : +; byte) : +; : +; Deleting a double byte: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : +; : +; Deleting a single byte: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ L ³ T ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : +; : +; Backspace removal of a double byte: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : +; : +; Backspace removal of a single byte: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ S ³ S ³ S ³ L ³ T ³ ³ S ³ S ³ S ³ L ³ T ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : +; : +; Replacing a double byte with a double byte: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : +; : +; Replacing a double byte with a single byte: (Option 1) : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ S ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : +; : +; Replacing a double byte with a single byte: (Option 2) : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ S ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : +; : +; Replacing a single byte with a single byte: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : +; : +; Replacing a single byte with a double byte. : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : +; : +; Replacing a single byte with a double byte without enough buffer: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : +; : +; Inserting a single byte. : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : +; : +; Inserting a single byte without enough buffer generate an error: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ S ³ S ³ ³ ³ S ³ L ³ T ³ S ³ S ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : +; : +; Inserting a double byte character: : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : +; : +; : +; Entry: ES:SI = Points to current ICB : +; DS:DI = Points to PB : +; : +; INC_KS = Keystroke from returned from PCINCHA : +; : +; WR_KEYCONF = Bit flag inidicating the options set for INC_KS : +; WR_KEYCONF2 keystroke. : +; : +; Exit: None. : +; : +;-----------------------------------------------------------------------------+ +; +LEFT_JUST PROC NEAR +; +; Initialize right and left boundary markers +; + MOV [DI]+WR_LEFTCHAR,1 ;set left character to beginning + ; of field +; + MOV AX,ES:[SI]+ICB_FIELDLEN ;set right marker past end of + INC AX ; field + MOV [DI]+WR_RIGHTCHAR,AX +; + TEST [DI]+WR_KEYCONF,WR_MASK ;check to see if editing key entered ;=W + JNE LJ5 ;yes, must check for editing keys ;=W + JMP LJ190 ;no, skip checks for editing keys ;=W + +; +; Process home key +; +LJ5: TEST [DI]+WR_KEYCONF,WR_HOM ;check if home key pressed + JE LJ10 +; + ; + ; add ICB_WHM option to process window home key movement + ; +; + MOV ES:[SI]+ICB_CURCHAR,1 ;initialize cursor to 1st byte + ; position, assuming no windowing + ; wrap is occurring + CALL CAL_COORS ;get cursor position ;=W + JMP LJEXIT ; returns WR_CURROW, WR_CURROW + ; and WR_CUBYTE +; +; Process end key +; +LJ10: TEST [DI]+WR_KEYCONF,WR_END ;check if home key pressed + JE LJ20 +; + ; + ; add ICB_WEN to move cursor to end of current window row + ; +; + CALL CAL_COORS ;get current end of field info ;=W +; + MOV AX,[DI]+WR_ENCHAR ;adjust one past end buffer charac + INC AX + MOV ES:[SI]+ICB_CURCHAR,AX ;set current cursor position to + ; end of field + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LJ17 ;no ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LJ16 + MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position + CALL CAL_COORS ;get cursor position + JMP LJEXIT ;exit +LJ16: + TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W + JE LJ17 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W +LJ17: ;=W + JMP LJEXIT ;exit +; +; Process left arrow +; +LJ20: TEST [DI]+WR_KEYCONF,WR_LFT ;check if left arrow key pressed + JE LJ40 +; + ; + ; add ICB_WAR option to wrap cursor on same row end to end + ; +; + CMP ES:[SI]+ICB_CURCHAR,1 ;check if cursor is at first + JA LJ30 ; field position +; + TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W + JE LJ25 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W + JMP LJCUR ;=W +LJ25: ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LJ27 + MOV AX,ES:[SI]+ICB_FIELDLEN ;get last position + MOV ES:[SI]+ICB_CURCHAR,AX ;put as current position + CALL CAL_COORS + JMP LJEXIT +LJ27: + CALL PCMBEEP_CALL ;error beep + JMP LJEXIT ;exit +; +LJ30: DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position + ; towards the left + CALL CAL_COORS ;get cursor position ;=W + JMP LJEXIT ;exit +; +; Process right arrow +; +LJ40: TEST [DI]+WR_KEYCONF,WR_RGT ;check if left arrow key pressed + JE LJ60 +; + ; + ; add ICB_CSW option to wrap cursor from top/bottom end to end + ; +; + ; + ; add ICB_AXC option to auto enter if cursor reaches end + ; +; + ; + ; add ICB_WAR option to wrap cursor on same row end to end + ; +; + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field + JE LJ50 +; + CALL PCMBEEP_CALL ;error beep + JMP LJEXIT ;exit +; +LJ50: INC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position + ; towards the left + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LJ55 ;no ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LJ52 + MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position + CALL CAL_COORS ;get cursor position + JMP LJEXIT ;exit +LJ52: + TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W + JE LJ55 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W +LJ55: ;=W + JMP LJEXIT ;exit +; +; Process up arrow +; +LJ60: ; + ; adjust cursor position + ; + + ; + ; check for field wrap, exit, error beep + ; +; +; Process down arrow +; +LJ70: ; + ; adjust cursor position + ; + + ; + ; check for field wrap, exit, error beep + ; +; +; Process cntrl+end key +; +LJ80: TEST [DI]+WR_KEYCONF,WR_CED ;check if control+end key pressed + JE LJ100 +; + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field + JE LJ90 +; + CALL PCMBEEP_CALL ;error beep + JMP LJEXIT ;exit +; +LJ90: CALL CAL_COORS ;get current end of field info ;=W +; + MOV AX,ES:[SI]+ICB_FIELDLEN ;set rightmost area to refresh on + MOV [DI]+WR_RIGHTDISP,AX ; display to entire field +; + MOV BX,[DI]+WR_CUBYTE ;delete from current byte position + CALL CLEAR_BUFFER +; + CALL CAL_COORS ;get cursor position ;=W + JMP LJ340 ;display field, set cursor, exit +; +; Process delete key +; +LJ100: TEST [DI]+WR_KEYCONF,WR_DEL ;check if delete key pressed + JE LJ130 +; + ; + ; Add ICB_WDL option in off state to delete on current line only + ; +; + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,1 ;check if cursor past end of field + JE LJ110 +; + CALL REMOVE_CHAR ;remove character at current offst + ; and shift remaining in place + JMP LJ340 ;display field, set cursor, exit +; +LJ110: CALL PCMBEEP_CALL ;error beep + JMP LJEXIT ;exit +; +; Process backspace key +; +LJ130: TEST [DI]+WR_KEYCONF,WR_BCK ;check if backspace key pressed + JE LJ160 +; + CMP ES:[SI]+ICB_CURCHAR,1 ;check if cursor is at first + JA LJ140 ; field position +; + TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W + JE LJ135 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W + JMP LJCUR ;=W +LJ135: ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LJ137 + MOV AX,ES:[SI]+ICB_FIELDLEN ;get last position + MOV ES:[SI]+ICB_CURCHAR,AX ;put as current position + CALL CAL_COORS + JMP LJEXIT +LJ137: + CALL PCMBEEP_CALL ;error beep + JMP LJEXIT ;exit +; +LJ140: DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position + ; towards the left + CALL CAL_COORS ;get cursor position ;=W + CALL REMOVE_CHAR ;remove character at current offst + ; and shift remaining in place +; + CALL CAL_COORS ;get cursor position ;=W + JMP LJ340 ;display field, set cursor, exit +; +; Process insert key toggle +; +LJ160: TEST [DI]+WR_KEYCONF,WR_INS ;check if insert key pressed + JE LJ180 ; if not, continue +; + TEST ES:[SI]+ICB_STATUS,ICB_SINS ;check if in insert mode ? + JE LJ165 ;no, put in insert mode +; + MOV BX,[DI]+IN_CURNOR ;set cursor size for normal + MOV [DI]+WR_CURSIZE,BX ; cursor +; + AND ES:[SI]+ICB_STATUS,NOT ICB_SINS + JMP LJ170 ;turn insert mode off +; +LJ165: MOV BX,[DI]+IN_CURINS ;set cursor size for insert + MOV [DI]+WR_CURSIZE,BX ; cursor +; + OR ES:[SI]+ICB_STATUS,ICB_SINS + ;turn insert mode on +; +LJ170: +; + PUSH DS ;save registers + PUSH DI +; + MOV DI,40H ;point DS:DI to KB_FLAG in BIOS + MOV DS,DI + MOV DI,17H + MOV AX,[DI] ;get current BIOS KB_FLAG +; + AND AX,NOT WR_INSSTATE ;set BIOS insert active flag off +; + TEST ES:[SI]+ICB_STATUS,ICB_SINS + JE LJ175 ;check if insert should be set on +; + OR AX,WR_INSSTATE ;set BIOS insert active flag on +; +LJ175: POP DI ;restore registers + POP DS +; + JMP LJEXIT ;exit +; +; Process allowonce key option +; +LJ180: ; + ; insert or replace + ; +; + ; + ; adjust input buffer + ; +; + ; + ; check for field wrap, exit, error beep + ; +; + ; + ; adjust cursor position + ; +; +; Process allowed keystroke in replace mode +; +LJ190: TEST [DI]+WR_KEYCONF,WR_ALL ;check if allow key pressed + JNE LJ195 +; + CALL PCMBEEP_CALL ;error beep key not defined + JMP LJEXIT ;exit +; +LJ195: TEST ES:[SI]+ICB_STATUS,ICB_SINS + JE LJ198 ;check if insert is active +; + JMP LJ270 ;do insert display +; +LJ198: + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field + JE LJ200 +; + CALL PCMBEEP_CALL ;error beep key not defined + JMP LJEXIT ;exit +; +; Check if character to be replaced in field buffer is double byte character +; +LJ200: PUSH ES ;save registers + PUSH SI +; + PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer + PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer + POP SI + POP ES +; + ADD SI,[DI]+WR_CUBYTE ;add cursor offset into buffer + DEC SI ;make zero based +; + MOV CX,ES ;save offset of character to + MOV DX,SI ; replace +; + MOV AL,ES:[SI] ;get byte that cursor is pointing + MOV [DI]+DBC_KS,AL ; to check if DBCS + CALL PCINDBC_CALL ;call routine to check if char + ; is lead double byte char +; + POP SI ;restore registers + POP ES +; + TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS + JE LJ220 ; if no, jump to single byte code +; +; Replace double byte character with double byte character +; + TEST [DI]+WR_KEYCONF2,WR_DBC ;check if keystroke is DBC + JE LJ210 ;continue with single byte +; + MOV AX,[DI]+INC_KS ;set double byte character to + ; input buffer replacing + ; double byte character + PUSH ES + PUSH SI +; + MOV ES,CX ;save offset of character to + MOV SI,DX ; replace + MOV ES:[SI],AX ;replace double byte +; + POP SI ;restore registers + POP ES +; + JMP LJ260 ;exit +; +; Replace double byte character with single byte character +; +LJ210: MOV AX,[DI]+INC_KS ;get keystroke and replace double + ; byte with single byte +; + PUSH ES + PUSH SI +; + MOV ES,CX ;save offset of character to + MOV SI,DX ; replace single byte + MOV ES:[SI],AL +; + POP SI ;restore registers + POP ES +; + MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte + MOV [DI]+WR_RIGHTBYTE,AX +; + MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove + INC AX ;adjust past replaced leading byte ;=W + MOV [DI]+WR_LEFTBYTE,AX ; trailing byte +; + MOV BX,1 ;set number of positions to shift + MOV AX,2 ;set option to shift left + CALL SHIFT ;call shift 1 position toward left + JMP LJ260 ;exit +; +; Replace single byte character with single byte character +; +LJ220: TEST [DI]+WR_KEYCONF2,WR_DBC ;check if double byte character + JNE LJ230 ; continue with single byte +; + MOV AX,[DI]+INC_KS ;get keystroke +; + PUSH ES + PUSH SI +; + MOV ES,CX ;save offset of character to + MOV SI,DX ; replace single byte + MOV ES:[SI],AL +; + POP SI ;restore registers + POP ES +; + JMP LJ260 ;exit +; +; Replace single byte character with double byte character +; +LJ230: MOV BX,ES:[SI]+ICB_CURCHAR ;set cursor character position + MOV [DI]+WR_LEFTCHAR,BX ; to left marker +; + CALL CAL_COORS ;get the current end of field ;=W + ; coordinates + MOV AX,[DI]+WR_ENCHAR ;get end character of field + CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character + JA LJ240 +; + MOV AX,ES:[SI]+ICB_CURCHAR ;cursor is past last char +; +LJ240: MOV [DI]+WR_RIGHTCHAR,AX ;set right marker +; + MOV BX,1 ;One byte is already available + ; check if room for trailing byte + MOV AX,1 ;set up call to LEFT_DISP to + CALL WORD PTR [DI]+WR_DISPLAY ; determine if additional byte + ; will fit in input buffer + CMP AX,0 ;check if double byte character + JE LJ250 ; will fit +; + CALL PCMBEEP_CALL ;error beep because replace char + JMP LJEXIT ; will not fit and exit +; +LJ250: MOV BX,ES:[SI]+ICB_FIELDLEN ;set ending byte + MOV [DI]+WR_RIGHTBYTE,BX +; + MOV BX,[DI]+WR_CUBYTE ;set markers for shift to remove + INC BX ;adjust past replaced leading byte + MOV [DI]+WR_LEFTBYTE,BX ; trailing byte +; + MOV BX,1 ;set number of positions to shift + MOV AX,1 ;set option to shift right + CALL SHIFT ;call shift 1 position toward + ; left + MOV AX,[DI]+INC_KS ;get keystroke +; + PUSH ES + PUSH SI +; + MOV ES,CX ;save offset of character to + MOV SI,DX ; replace double byte + MOV ES:[SI],AX +; + POP SI ;restore registers + POP ES +; +; Calculate new ending and cursor coordinates +; +LJ260: + MOV BX,[DI]+WR_ENCHAR ;set rightmost area to refresh on ;=W + CALL CAL_COORS ;get new end coordinates ;=W + CMP BX,[DI]+WR_ENCHAR ;is old END_CHAR > new END_CHAR ? ;=W + JG LJ261 ;yes, use old END_CHAR (so display ;=W + MOV BX,[DI]+WR_ENCHAR ; is updated correctly) + +LJ261: ;set rightmost area to refresh on ;=W + MOV [DI]+WR_RIGHTDISP,BX ; display to new ending character + + INC ES:[SI]+ICB_CURCHAR ;point to next char + + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LJ265 ;no ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LJ262 + MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position + JMP LJ340 ;display field, set cursor, exit +LJ262: + TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W + JE LJ265 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W +LJ265: ;=W + JMP LJ340 ;display field, set cursor, exit +; +; Process allowed keystroke in insert mode +; +LJ270: + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field + JE LJ280 +; + CALL PCMBEEP_CALL ;error beep key not defined + JMP LJEXIT ;exit +; +; Check if enough room available to insert single or double byte character +; +LJ280: + MOV CX,ES:[SI]+ICB_FIELDSEG ;get segment of input buffer + MOV DX,ES:[SI]+ICB_FIELDOFF ;get offset of input buffer +; + ADD DX,[DI]+WR_CUBYTE ;add cursor offset into buffer + DEC DX ;make zero based +; + MOV BX,1 ;initialize to single byte +; + TEST [DI]+WR_KEYCONF2,WR_DBC ;check for double byte character + JE LJ290 +; + MOV BX,2 ;reset to double byte character +; +LJ290: MOV AX,ES:[SI]+ICB_CURCHAR ;set cursor character position + MOV [DI]+WR_LEFTCHAR,AX ; to left marker +; + CALL CAL_COORS ;get the current end of field ;=W + ; coordinates + MOV AX,[DI]+WR_ENCHAR ;get end character of field +; + CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character + JA LJ300 +; + MOV AX,ES:[SI]+ICB_CURCHAR ;cursor is past last char + DEC AX +; +LJ300: MOV [DI]+WR_RIGHTCHAR,AX ;set right marker +; + MOV AX,1 ;set up call to LEFT_DISP to + CALL WORD PTR [DI]+WR_DISPLAY ; determine if additional byte + ; will fit in input buffer + ; BX= number of bytes to insert + CMP AX,0 ;check if double byte character + JE LJ310 ; will fit +; + CALL PCMBEEP_CALL ;error beep replace character + JMP LJEXIT ; will not fit and exit +; +; Shift to insert single or double byte character, BX= # bytes to shift +; +LJ310: MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte to make room in + MOV [DI]+WR_RIGHTBYTE,AX ; buffer by shifting characters +; + MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove + MOV [DI]+WR_LEFTBYTE,AX ; trailing byte +; + MOV AX,1 ;set option to shift right, BX= + ; number of bytes to insert + CALL SHIFT ;call shift 1 position toward + ; left + MOV AX,[DI]+INC_KS ;get keystroke +; +; Insert single byte character +; + CMP BX,2 ;check how many bytes should be + JE LJ320 ; inserted +; + PUSH ES + PUSH SI +; + MOV ES,CX ;save offset of character to + MOV SI,DX ; replace single byte + MOV ES:[SI],AL ;insert single byte character +; + POP SI ;restore registers + POP ES +; + JMP LJ330 +; +; Insert double byte character +; +LJ320: PUSH ES + PUSH SI +; + MOV ES,CX ;save offset of character to + MOV SI,DX ; replace + MOV ES:[SI],AX ;insert double byte character +; + POP SI ;restore registers + POP ES +; +; Calculate new ending and cursor coordinates +; +LJ330: + CALL CAL_COORS ;get new end coordinates ;=W +; + MOV AX,[DI]+WR_ENCHAR ;set rightmost area to refresh on + MOV [DI]+WR_RIGHTDISP,AX ; display to old ending character +; + INC ES:[SI]+ICB_CURCHAR ;point to next char +; + CALL CAL_COORS ;get cursor position ;=W + CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W + JE LJ340 ;no ;=W + TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W + JE LJ335 + MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position + JMP LJ340 ;display field, set cursor, exit +LJ335: + TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W + JE LJ340 ;no ;=W + OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W +; +; Display field +; +LJ340: + MOV AX,ES:[SI]+ICB_CURCHAR ;set left character to cursor + DEC AX ; last cursor position + MOV [DI]+WR_LEFTCHAR,AX +; + MOV AX,[DI]+WR_RIGHTDISP ;set right character marker to ;=W + MOV [DI]+WR_RIGHTCHAR,AX ; max possible field length +; + CALL CAL_COORS ;get end of field char, byte ;=W + ; and next byte positions + + MOV AX,2 ;set display option + CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer + ; in left justified field +; +; Exit +; +LJEXIT: ;continue + TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ? + JNE LJCUR ;cursor is already on, don't turn it on ;=W + CALL CURSOR ;display cursor ;=W +LJCUR: +; + RET +LEFT_JUST ENDP +;-----------------------------------------------------------------------------+ +; : +; CAL_COORS : +; : +; Calculates character coordinates based on the display format : +; currently active (windowing and horizontal display). : +; : +; The following examples demonstrate the values that are set on : +; exit from this routine: : +; : +; : +; Example: Horizontal field coordinates calculated. : +; : +; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ : +; ³123456789012345678901234567890 : +; ³2 : +; ³3 [sLtLtssss....] : +; ^ : +; ³ ³ ³ : +; ³ ³ ÀÄ WR_ENCHAR = 7 : +; ³ ³ WR_ENBYTE = 9 : +; ³ ³ WR_RGCHAR = 7 : +; ³ ³ : +; ³ ÀÄÄÄÄÄÄ WR_CUCHAR = 3 : +; ³ WR_CUBYTE = 4 : +; ³ WR_UPCHAR = 3 : +; ³ WR_DNCHAR = 3 : +; ³ WR_CURROW = 3 : +; ³ WR_CURCOL = 13 : +; ³ : +; ÀÄÄÄÄÄÄÄÄÄ WR_LFCHAR = 1 : +; WR_HRCHAR = 1 : +; : +; : +; Example: Horizontal field scroll coordinates calculated: : +; : +; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ : +; ³123456789012345678901234567890 : +; ³2 ÚÄÄÄÄÄ¿ : +; ³3 s³LtLt ³Ltsss..... : +; ³ÀÄÄÄÄÄÙ ³ : +; ³ ³ ^ ³ : +; ³ ³ ³ ³ : +; ³ ³ ³ À WR_ENCHAR = 7 : +; ³ ³ ³ WR_ENBYTE = 10 : +; ³ ³ ³ WR_RGCHAR = 7 : +; ³ ³ ³ : +; ³ ³ ÀÄÄÄÄÄÄÄÄ WR_CUCHAR = 3 : +; ³ ³ WR_CUBYTE = 4 : +; ³ ³ WR_UPCHAR = 3 : +; ³ ³ WR_DNCHAR = 3 : +; ³ ³ WR_CURROW = 3 : +; ³ ³ WR_CURCOL = 14 : +; ³ ³ : +; ³ ÀÄÄÄÄÄÄÄÄÄÄ WR_HRCHAR = 2 : +; ³ : +; ÀÄÄÄÄÄÄÄÄÄÄÄÄ WR_LFCHAR = 1 : +; : +; : +; : +; Example: Windowed field coordinates calculated. : +; : +; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ : +; ³123456789012345678901234567890 : +; ³2 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ WR_LFCHAR= 6 : +; ³3 ³ ÚÄÄÄÄÄÄÄÄ WR_UPCHAR= 3 : +; ³4 ³ ÚÄijÄÄ¿ : +; ³5 ³ ³ABCDE³ : +; ³6 ÀÄÄFGHI.³ : +; ³7 ³ Ú³³ÀÄÄÄÄÄÄ WR_RGCHAR= 10 : +; ³8 Àij³ÀÄÄÄÄÄÄÄ WR_ENCHAR= 9 : +; ³9 ³³ : +; ³ÀÄÄÄÄÄÄÂÄ WR_CUCHAR= 8 : +; ³ ÃÄ WR_CURCOL= 24 : +; ³ ÀÄ WR_CURROW= 6 : +; ³ : +; ÀÄÄÄÄÄÄÄÄÄ WR_DNCHAR= 13 : +; : +; : +; Entry: ICB_CURCHAR = The character position into the input field from : +; which the exit coordinates will be calculated. : +; : +; WR_HRCHAR = The character position into the input field that : +; is currently the first displayed character of the : +; horizontal window. : +; : +; ICB_WIDTH = The width of windowed or horizontal scroll field. : +; : +; ICB_FIELDLEN = Input field buffer length. : +; : +; ICB_FIELDOFF = Input field buffer offset. : +; : +; ICB_FIELDSEG = Input field buffer segment. : +; : +; : +; Exit: WR_RGCHAR = Character offset into input buffer of the character : +; appearing at the beginning of the current line that : +; WR_CUCHAR is located on. : +; : +; WR_LFCHAR = Character offset into input buffer of the character : +; appearing at the end of the current line that : +; WR_CUCHAR is located on. : +; : +; WR_UPCHAR = Character offset into input buffer of the character : +; displayed directly above the position that : +; WR_CUCHAR is located on. : +; : +; WR_DNCHAR = Character offset into input buffer of the character : +; displayed directly below the position that : +; WR_CUCHAR is located on. : +; : +; WR_ENCHAR = Number of characters currently entered in the : +; field. This value may be less than the number : +; of bytes used to represent the characters if : +; double byte characters are present. : +; : +; WR_CURROW = Actual row offset into the video buffer of the : +; character specified by WR_CURCHAR. : +; : +; WR_CURCOL = Actual column offset into the video buffer of the : +; character specified by WR_CUCHAR. : +; : +; WR_ENBYTE = Number of bytes currently used to represent : +; entered characters in the buffer. This counter : +; can be used to calculate the current end : +; position of the entered data in the field. : +; : +; WR_CUBYTE = Number of bytes into input field where WR_CUCHAR : +; appears. : +; : ;=W +; WR_CUCHAR = Offset of current cursor position in input field. : ;=W +; : ;=W +; WR_HRBYTE = Number of bytes into input field where WR_HRCHAR : +; appears. : +; : +; WR_FIELDEND = Boolean flag, 0 = cursor not past end of field : ;=W +; 1 = cursor is past end of field : ;=W +; : +;-----------------------------------------------------------------------------+ +; +CAL_COORS PROC NEAR +; + PUSH AX ;save registers + PUSH BX + PUSH CX + PUSH DX + PUSH ES + PUSH SI + PUSH BP ;=W +; ;=W +; initialize general variables for all display modes ;=W +; + MOV [DI]+WR_FIELDEND,0 ;initialize boolean flag that ;=W + ;cursor is not past end of field ;=W + MOV AX,ES:[SI]+ICB_CURCHAR ;get current char. offset ;=W + MOV [DI]+WR_CUCHAR,AX ;save it ;=W +; + MOV AX,ES:[SI]+ICB_ROW ;initialize row offset of field ;=W + DEC AX ;=W + MOV [DI]+WR_CURROW,AX ;char row offset inot video buf ;=W + MOV AX,ES:[SI]+ICB_COL ;initialize col offset of field ;=W + DEC AX ;=W + MOV [DI]+WR_CURCOL,AX ;char col offset into video buf ;=W +; + MOV [DI]+WR_LFCHAR,1 ;leftmost character possible char ;=W + MOV [DI]+WR_RGCHAR,1 ;rightmost character possible char ;=W + MOV [DI]+WR_ENBYTE,0 ;end byte of data in input buffer ;=W + MOV [DI]+WR_ENCHAR,0 ;end character in input buffer ;=W + MOV [DI]+WR_HRBYTE,1 ;byte of first char in horz. window ;=W +; + MOV AX,[DI]+WR_CUCHAR ;get current position ;=W + MOV [DI]+WR_UPCHAR,1 ;topmost char in current column ;=W + MOV [DI]+WR_DNCHAR,1 ;bottommost char in current column ;=W +; + MOV BP,0 ;have not found current char yet ;=W + MOV CX,1 ;counter tracking number of bytes ;=W + MOV DX,1 ;counter tracking number of chars ;=W +; +; Determine display format of field +; + TEST ES:[SI]+ICB_OPT3,ICB_WIN ;check if windowing option on + JE CC10 +; + JMP CC200 ;process window option +; +CC10: TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if horizontal scroll option + JE CC20 ; on +; + JMP CC100 ;process horizontal scroll +; +; Process fully displayed horizontal field +; +CC20: ;=W + MOV [DI]+WR_HRCHAR,1 ;leftmost character possible char +; +; Examine the next byte in the input buffer +; +CC30: CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been + JBE CC35 ; scanned and exit +; + CMP BP,0 ;found current char yet ? ;=W + JE CC40 ;no, find it ;=W + JMP CCEXIT +; +CC35: PUSH ES ;save registers + PUSH SI +; + PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer + PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer + POP SI + POP ES +; + DEC CX ;make byte count zero based + ADD SI,CX ;add byte count to input fld offst + INC CX ;make byte count one based + MOV AL,ES:[SI] ;get byte in input buffer to + MOV [DI]+DBC_KS,AL ; check if DBCS + CALL PCINDBC_CALL ;call routine to check if char + ; is lead double byte char +; + POP SI ;restore registers + POP ES +; +; Check if end data byte and character should be updated +; + CMP AL,WR_BLANK ;check if blanking character found + JE CC40 ;now adjust pointers +; + MOV [DI]+WR_ENBYTE,CX ;set current byte count + MOV [DI]+WR_ENCHAR,DX ;set current character count + MOV [DI]+WR_RGCHAR,DX ;set right most character +; +; Check if current character pointer +; +CC40: CMP [DI]+WR_CUCHAR,DX ;check if current character found + JNE CC50 +; + MOV BP,1 ;current char found ;=W + MOV [DI]+WR_UPCHAR,DX ;set up and down character + MOV [DI]+WR_DNCHAR,DX ; to current character +; + MOV [DI]+WR_CUBYTE,CX ;set current character byte count + ADD [DI]+WR_CURCOL,CX ;set actual column of cursor based + DEC [DI]+WR_CURCOL ; on current character byte count ;=W +; +; Increment pointers and counters to next character and byte position check +; +CC50: INC CX ;adjust byte counter + INC DX ;adjust character counter +; + TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte + JE CC30 +; + INC CX ;adjust byte count for trail byte + JMP CC30 + + + + + +; +; Calculate horizontal scroll coordinates +; +CC100: + MOV AX,[DI]+WR_CUCHAR ;initialize current character + CMP AX,[DI]+WR_HRCHAR ;horizontal display position must + JAE CC120 ; not be less than current char + ; position + MOV [DI]+WR_HRCHAR,AX ;set current char position as + ; new horizontal position +; +; Examine the next byte in the input buffer +; +CC120: CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been + JBE CC122 ; scanned and exit ;=W +; + CMP BP,0 ;found current char yet ? ;=W + JE CC130 ;no, find it ;=W +; + JMP CCEXIT ;=W +CC122: ;=W + PUSH ES ;save registers + PUSH SI +; + PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer + PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer + POP SI + POP ES +; + DEC CX ;make byte count zero based + ADD SI,CX ;add byte count to input fld offst + INC CX ;make byte count one based + MOV AL,ES:[SI] ;get byte in input buffer to + MOV [DI]+DBC_KS,AL ; check if DBCS + CALL PCINDBC_CALL ;call routine to check if char + ; is lead double byte char +; + POP SI ;restore registers + POP ES +; ;=W +; Set WR_HRBYTE to correct byte count ;=W +; ;=W + CMP [DI]+WR_HRCHAR,DX ;is this position the first char ;=W + ;in the horizl. window ? ;=W + JNE CC125 ;no ;=W +; + MOV [DI]+WR_HRBYTE,CX ;save # byte for first char in h. wind. ;=W +; +; Check if end data byte and character should be updated +; +CC125: CMP AL,WR_BLANK ;check if blanking character found + JE CC130 ;now adjust pointers +; + MOV [DI]+WR_ENBYTE,CX ;set current byte count + MOV [DI]+WR_ENCHAR,DX ;set current character count + MOV [DI]+WR_RGCHAR,DX ;set right most character +; +; Check if current character pointer +; +CC130: CMP [DI]+WR_CUCHAR,DX ;check if current character found + JNE CC140 +; + MOV BP,1 ;current char found + MOV [DI]+WR_UPCHAR,DX ;set up and down character + MOV [DI]+WR_DNCHAR,DX ; to current character +; + MOV [DI]+WR_CUBYTE,CX ;set current character byte count + MOV BX,CX ;set actual column of cursor based ;=W + ; on current character byte count ;=W + SUB BX,[DI]+WR_HRBYTE ;subtract beginning of horiz. wind. ;=W + ADD [DI]+WR_CURCOL,BX ;add to window offset = new column ;=W +; +; Increment pointers and counters to next character and byte position check +; +CC140: INC CX ;adjust byte counter + INC DX ;adjust character counter +; + TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte + JE CC120 +; + INC CX ;adjust byte count for trail byte + JMP CC120 + + + + + +; +; Calculate windowing coordinates ;=W +; +CC200: ;=W +; +; Examine the next byte in the input buffer ;=W +; + CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been ;=W + JBE CC235 ; scanned and exit ;=W +; + CMP BP,0 ;found current char yet ? ;=W + JE CC240 ;no, find it ;=W +; + JMP CCBYE ;boolean flag should have been set ;=W + ; already, if needed ;=W +CC235: PUSH ES ;save registers ;=W + PUSH SI ;=W +; + PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W + PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W + POP SI ;=W + POP ES ;=W +; + DEC CX ;make byte count zero based ;=W + ADD SI,CX ;add byte count to input fld offst ;=W + INC CX ;make byte count one based ;=W + MOV AL,ES:[SI] ;get byte in input buffer to ;=W + MOV [DI]+DBC_KS,AL ; check if DBCS ;=W + CALL PCINDBC_CALL ;call routine to check if char ;=W + ; is lead double byte char ;=W +; + POP SI ;restore registers ;=W + POP ES ;=W +; ;=W +; Check if end data byte and character should be updated ;=W +; ;=W + CMP AL,WR_BLANK ;check if blanking character found ;=W + JE CC240 ;now adjust pointers ;=W +; + MOV [DI]+WR_ENBYTE,CX ;set current byte count ;=W + MOV [DI]+WR_ENCHAR,DX ;set current character count ;=W + MOV [DI]+WR_RGCHAR,DX ;set right most character ;=W +; ;=W +; Check if current character pointer ;=W +; ;=W +CC240: + CMP [DI]+WR_CUCHAR,DX ;check if current character found ;=W + JNE CC250 ;no ;=W +; + MOV BP,1 ;found current char + MOV [DI]+WR_CUBYTE,CX ;set current character byte count ;=W +; + PUSH DX ;needed for division ;=W + MOV AX,CX ;get current cursor pos. in field ;=W + DEC AX ;make it zero based for divide ;=W +; + CMP CX,ES:[SI]+ICB_FIELDLEN ;are we past end of field ? ;=W + JLE CC241 ;no ;=W + MOV [DI]+WR_FIELDEND,1 ;yes, set boolean flag ;=W + DEC AX ;make cursor pos. be inside field ;=W + ; for division ;=W + CWD ;calculate current row,column ;=W + IDIV ES:[SI]+ICB_WIDTH ; row = cur_byte / width-1 ;=W + ; col = cur_byte mod width-1 ;=W + INC DX ;reposition cursor in correct pos. ;=W + JMP CC244 ;=W +CC241: ;=W + CWD ;calculate current row,column for ;=W + IDIV ES:[SI]+ICB_WIDTH ; cursor positions inside the field ;=W + ; row = cur_byte / width of field ;=W + ; col = cur_byte mod width of field ;=W +CC244: ;=W + ADD [DI]+WR_CURROW,AX ;set actual row of cursor ;=W + ADD [DI]+WR_CURCOL,DX ;set actual column of cursor ;=W +; + MOV BX,CX ;calculate WR_LFCHAR ;=W +CC245: DEC BX ;get the correct cur_byte ;=W + MOV AX,BX ;cur_byte/width ;=W + CWD ;=W + IDIV ES:[SI]+ICB_WIDTH ;=W + CMP DX,0 ;is the remainder zero ? ;=W + JNE CC245 ;no, not at beginning of row, do again ;=W +; + MOV [DI]+WR_LFCHAR,BX ;yes, this is beginning of row ;=W +; + POP DX ;=W +; +; Increment pointers and counters to next character and byte position check ;=W +; ;=W +CC250: INC CX ;adjust byte counter ;=W + INC DX ;adjust character counter ;=W +; + TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte ;=W + JE CC260 ;=W +; + INC CX ;adjust byte count for trail byte ;=W +CC260: + JMP CC200 ;=W +; +; Exit +; +CCEXIT: ;=W + MOV AX,[DI]+WR_CUBYTE ;is cursor past end of field ;=W + CMP AX,ES:[SI]+ICB_FIELDLEN ;?? ;=W + JLE CCBYE ;no ;=W +; + MOV [DI]+WR_FIELDEND,1 ;yes, set boolean flag ;=W +CCBYE: + MOV AX,[DI]+WR_ENBYTE ;set ICB_ENDBYTE ;=W + MOV ES:[SI]+ICB_ENDBYTE,AX ;=W +; + MOV AX,[DI]+WR_HRBYTE ;set ICB_HRSTART ;=W + MOV ES:[SI]+ICB_HRSTART,AX ;=W +; + POP BP + POP SI ;restore registers + POP ES + POP DX ;restore registers + POP CX + POP BX + POP AX +; + RET +CAL_COORS ENDP +; +PAGE ;=W +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; SET_DISP_ADDR : ;=W +; : ;=W +; Determine which display routine to use. The choice is between : ;=W +; left justified, right justified, double byte support, no double : ;=W +; byte support, windowing, horizontal scrolling. : ;=W +; Also pick the justify routine to use. : ;=W +; : ;=W +; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ : ;=W +; ³ DISPLAY ³ : ;=W +; ÀÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÙ : ;=W +; ÚÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ¿ : ;=W +; ÚÄÄÄÄÁÄÄÄÄ¿ ³ ³ ÚÄÄÄÄÁÄÄÄÄÄ¿ ³ ³ : ;=W +; ³LEFT_DISP³ ³ ³ ³RIGHT_DISP³ ³ ³ : ;=W +; ÀÄÄÄÄÄÄÄÄÄÙ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÙ ³ ³ : ;=W +; ÚÄÄÄÄÄÁÄÄÄÄÄ¿ ³ ÚÄÄÄÄÄÄÁÄÄÄÄÄ¿ ³ : ;=W +; ³LEFT_H_DISP³ ³ ³RIGHT_H_DISP³ ³ : ;=W +; ÀÄÄÄÄÄÄÄÄÄÄÄÙ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ : ;=W +; ÚÄÄÄÄÄÁÄÄÄÄ¿ ÚÄÄÄÄÄÄÁÄÄÄÄ¿ : ;=W +; ³LEFTS_DISP³ ³RIGHTS_DISP³ : ;=W +; ÀÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W +; : ;=W +; : ;=W +; : ;=W +; : ;=W +; : ;=W +; DISPLAY ROUTINES : ;=W +; LEFT_DISP - left justified, double byte support, windowing : ;=W +; LEFTS_DISP - left justified, no double byte support, windowing : ;=W +; LEFT_H_DISP - left justified, double byte support, horizontal scrolling : ;=W +; RIGHT_DISP - right justified, double byte support, windowing : ;=W +; RIGHTS_DISP - right justified, no double byte support, windowing : ;=W +; RIGHT_H_DISP - right justified, double byte support, horizontal scrolling : ;=W +; : ;=W +; JUSTIFY ROUTINES : ;=W +; LEFT_H_JUST - left justified, horizontal scrolling : ;=W +; LEFT_JUST - left justified, windowing : ;=W +; RIGHT_H_JUST - right justified, horizontal scrolling : ;=W +; RIGHT_JUST - right justified, windowing : ;=W +; : ;=W +; Entry: ES:SI - ICB control block : ;=W +; DS:DI - IN control block : ;=W +; Exit: none : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +; ;=W +SET_DISP_ADDR PROC NEAR ;=W +; + PUSH AX ;=W + PUSH BX ;=W +; + TEST ES:[SI]+ICB_OPT1,ICB_RJU ;check if field right just ;=W + JNE SD20 ;if yes, jump ;=W +; +; Display value of input buffer left justified ;=W +; + TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if field is in horizontial ;=W + JE SD10 ;no, windowing mode ;=W +; + MOV AX,OFFSET LEFT_H_DISP ;=W + MOV BX,OFFSET LEFT_H_JUST ;=W +; + JMP SDEXIT ;=W +SD10: ;=W + MOV AX,OFFSET LEFT_DISP ;=W + MOV BX,OFFSET LEFT_JUST ;=W +; + TEST DS:[DI]+IN_OPT,IN_ADBCS ;check if double byte is active ;=W + JNE SDEXIT ;yes ;=W + MOV AX,OFFSET LEFTS_DISP ;no, single byte only ;=W + JMP SDEXIT ;=W +; +; Display default value of input buffer right justified ;=W +; +SD20: ;=W + TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if field is in horizontial ;=W + JE SD30 ;no, windowing mode ;=W +; + MOV AX,OFFSET RIGHT_H_DISP ;=W + MOV BX,OFFSET RIGHT_H_JUST ;=W +; + JMP SDEXIT ;=W +SD30: ;=W + MOV AX,OFFSET RIGHT_DISP ;=W + MOV BX,OFFSET RIGHT_DISP ;=W +; + TEST DS:[DI]+IN_OPT,IN_ADBCS ;check if double byte is active ;=W + JNE SDEXIT ;yes ;=W + MOV AX,OFFSET RIGHTS_DISP ;no, single byte only ;=W +; +SDEXIT: ;=W + MOV DS:[DI]+WR_DISPLAY,AX ;save addr of routine to call ;=W + MOV DS:[DI]+WR_JUSTIFY,BX ;save addr of routine to call ;=W +; + POP BX ;=W + POP AX ;=W +; + RET ;=W +SET_DISP_ADDR ENDP ;=W +; +PAGE ;=W +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; RIGHTS_DISP : ;=W +; : ;=W +; Entry: : ;=W +; : ;=W +; Exit: : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +; ;=W +RIGHTS_DISP PROC NEAR ;=W +; ;=W + ; ;=W + ; code here ;=W + ; ;=W +; ;=W + RET ;=W +RIGHTS_DISP ENDP ;=W +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; RIGHT_H_DISP : +; : +; Entry: : +; : +; Exit: : +; : +;-----------------------------------------------------------------------------+ +; +RIGHT_H_DISP PROC NEAR +; + ; + ; code here + ; +; + RET +RIGHT_H_DISP ENDP +; +PAGE ;=W +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; RIGHT_DISP : ;=W +; : ;=W +; Entry: : ;=W +; : ;=W +; Exit: : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +; ;=W +RIGHT_DISP PROC NEAR ;=W +; ;=W + ; ;=W + ; code here ;=W + ; ;=W +; ;=W + RET ;=W +RIGHT_DISP ENDP ;=W +; ;=W +PAGE ;=W +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; LEFT_H_DISP : ;=W +; : ;=W +; Calculates if the specified character will fit in the input : ;=W +; buffer at the specified character position without display. : ;=W +; The byte offset where this character should be inserted is : ;=W +; returned or a flag indicating that the character will not fit. : ;=W +; : ;=W +; Displays the specified portion of the input field buffer from : ;=W +; the left character marker to the end of the field. The following : ;=W +; display options are handled by this routine: : ;=W +; : ;=W +; - Display of the input field in a wrapped window : ;=W +; - Adjustment of double byte characters to prevent malformed : ;=W +; characters : ;=W +; : ;=W +; : ;=W +; The following pointers are used: : ;=W +; : ;=W +; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W +; ³ buffer in memory. : ;=W +; ³ : ;=W +; ³ ÚÄ (WR_HRCHAR) Left marker delimiting the left : ;=W +; ³ ³ most character position in the : ;=W +; ³ ³ input buffer. : ;=W +; ³ ³ : ;=W +; ³ ³ : ;=W +; ³ ³ : ;=W +; ³ ³ : ;=W +; ³ ³ : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W +; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ : ;=W +; ³ ³ Area to display (ICB_WIDTH) : ;=W +; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W +; ³ : ;=W +; ICB_FIELDLEN Length of input field in bytes. : ;=W +; : ;=W +; : ;=W +; Entry: ES:SI = Points to current ICB : ;=W +; DS:DI = Points to PB : ;=W +; : ;=W +; WR_CATTR = Logical color attribute to use when updating screen : ;=W +; if the use of the color attribute string is not : ;=W +; specified. : ;=W +; : ;=W +; CR_RCOFF = Beginning offset of the upper left input field : ;=W +; display corner from the beginning of the video : ;=W +; buffer. : ;=W +; : ;=W +; CR_SCRWIDTH = Width of the video buffer in characters and : ;=W +; attributes. : ;=W +; : ;=W +; WR_HRCHAR = The offset into the input buffer, in characters, : ;=W +; of where to begin display. : ;=W +; : ;=W +; Exit: (none) : ;=W +;-----------------------------------------------------------------------------+ ;=W +; ;=W +LEFT_H_DISP PROC NEAR ;=W +; + PUSH ES ;save PB pointers ;=W + PUSH DI ;=W + PUSH BX ;=W + PUSH [DI]+CR_RCOFF ;save input field display offset ;=W +; ;=W +; Initialize MOVEG parm block ;=W +; + MOV AX,ES:[SI]+ICB_FIELDOFF ;get offset of the input buffer ;=W + MOV [DI]+WR_FIELDOFF,AX ;=W + ;=W + MOV AX,ES:[SI]+ICB_FIELDSEG ;get segment of the input buffer ;=W + MOV [DI]+MG_TEXTSEG,AX ;=W + ;=W + MOV AX,ES:[SI]+ICB_ATTROFF ;get offset of color attribute buffer ;=W + MOV [DI]+MG_ATTOFF,AX ;=W + ;=W + MOV AX,ES:[SI]+ICB_ATTRSEG ;get segment of color attribute ;=W + MOV [DI]+MG_ATTSEG,AX ;buffer ;=W + ;=W + MOV AX,[DI]+IN_LVBSEG ;get segment of the LVB ;=W + MOV [DI]+MG_MIXSEG,AX ;=W + ;=W + MOV AL,[DI]+WR_CATTR ;get logical color attribute ;=W + MOV [DI]+MG_SOURCE_A,AL ;=W +; ;=W +; Display all characters in input buffer starting with WR_HRCHAR ;=W +; and continuing until ICB_WIDTH-1 number of characters has been displayed. ;=W +; + MOV AX,ES:[SI]+ICB_FIELDOFF ;calcuate beginning character ;=W + ADD AX,[DI]+WR_HRBYTE ;to display ;=W + DEC AX ;=W + MOV [DI]+WR_FIELDOFF,AX ;save it ;=W + MOV [DI]+MG_TEXTOFF,AX ; to display ;=W +; + MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W + ;set write attribute option ;=W + ;set use logical attribute option ;=W + TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W + JNE LHD10 ;=W +; + OR [DI]+MG_OPT,MG_WC ;set write character option ;=W +LHD10: ;=W + MOV AX,ES:[SI]+ICB_WIDTH ;get field width ;=W + MOV [DI]+MG_NUM,AX ;number of words to move into the ;=W + ; LVB ;=W +; + MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W + ADD AX,[DI]+CR_RCOFF ; the character to write ;=W + MOV [DI]+MG_MIXOFF,AX ;=W +; + CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W +; ;=W +; Check if last character is DBCS ;=W +; ;=W + PUSH ES ;=W + PUSH SI ;=W +; + MOV AX,ES:[SI]+ICB_FIELDSEG ;get input buffer segment ;=W + MOV BX,ES:[SI]+ICB_FIELDOFF ;get input buffer offset ;=W + ADD BX,[DI]+WR_HRBYTE ;add offset of beginning of window ;=W + ADD BX,ES:[SI]+ICB_WIDTH ;add width to get last character ;=W + SUB BX,2 ;subtract to get correct byte ;=W + MOV ES,AX ;=W + MOV SI,BX ;=W + MOV AL,ES:[SI] ;get the character ;=W +; + POP SI ;=W + POP ES ;=W +; + PUSH AX ;=W + MOV [DI]+DBC_KS,AL ;=W + CALL PCINDBC_CALL ;check if char is lead DBCS ;=W + POP AX ;=W + TEST [DI]+DBC_STAT,DBC_DBCS ;is it ? ;=W + JE LHD30 ;no, display the character ;=W +; + MOV AL,1DH ;display '', can't split DBCS char ;=W +; ;=W +; Display the last character ;=W +; ;=W +LHD30: ;=W + MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W + ;set write attribute option ;=W + ;set use logical attribute option ;=W + TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W + JNE LHD40 ;=W +; + OR [DI]+MG_OPT,MG_WC+MG_UC ;set write character option ;=W +LHD40: ;=W + MOV [DI]+MG_SOURCE_C,AL ;character to display ;=W + MOV [DI]+MG_NUM,1 ;number of words to move into the ;=W + ; LVB ;=W +; + MOV AX,ES:[SI]+ICB_WIDTH ;add width to get last character ;=W + MOV BX,2 ;=W + MUL BX ;x2 to account for attr. bytes ;=W + ADD AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W + ADD AX,[DI]+CR_RCOFF ; the character to write ;=W + SUB AX,2 ;subtract to get correct byte ;=W + MOV [DI]+MG_MIXOFF,AX ;=W +; + CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W +LHDEXIT: ;=W + POP [DI]+CR_RCOFF ;save input field display offset ;=W + POP BX ;restore registers ;=W + POP DI ;=W + POP ES ;=W +; + RET ;=W +LEFT_H_DISP ENDP ;=W +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; LEFT_DISP : +; : +; Calculates if the specified character will fit in the input : +; buffer at the specified character position without display. : +; The byte offset where this character should be inserted is : +; returned or a flag indicating that the character will not fit. : +; : +; Displays the specified portion of the input field buffer from : +; the left character marker to the end of the field. The following : +; display options are handled by this routine: : +; : +; - Display of the input field in a wrapped window : +; - Adjustment of double byte characters to prevent malformed : +; characters : +; : +; : +; The following pointers are used: : +; : +; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : +; ³ buffer in memory. : +; ³ : +; ³ ÚÄ (WR_LEFTCHAR) Left marker delimiting the left : +; ³ ³ most character position in the : +; ³ ³ input buffer. : +; ³ ³ : +; ³ ³ Right marker delimiting the right : +; ³ ³ most character position in the : +; ³ ³ input buffer. (WR_RIGHTCHAR) : +; ³ ³ ³ : +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : +; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ : +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : +; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ : +; ³ ³ Area to display : +; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : +; ³ : +; ICB_FIELDLEN Length of input field in bytes. : +; : +; : +; Entry: ES:SI = Points to current ICB : +; DS:DI = Points to PB : +; : +; AX 1 = This option will calculate if the specified number : +; of bytes in BX can fit into input buffer at the : +; specified character position considering the display : +; coordinates and options. No update of the display : +; screen will occur. A flag indicating if the bytes : +; can be inserted or not is returned. If the bytes : +; will fit the offset from the beginning of the input : +; field in bytes is returned indicating where the : +; characters should be inserted. : +; : +; 2 = This option will update the display screen in the : +; proper format with the input buffer characters : +; starting at the specified left offset character : +; to the right character marker. : +; : +; BX = Number of bytes to insert starting at the specified : +; character position. : +; : +; WR_CATTR = Logical color attribute to use when updating screen : +; if the use of the color attribute string is not : +; specified. : +; : +; CR_RCOFF = Beginning offset of the upper left input field : +; display corner from the beginning of the video : +; buffer. : +; : +; CR_SCRWIDTH = Width of the video buffer in characters and : +; attributes. : +; : +; WR_LEFTCHAR = The offset into the input buffer, in characters, : +; of where the specified bytes should fit. : +; : +; WR_RIGHTCHAR = The offset into the input buffer, in characters, : +; of where the right most character position. : +; : +; : +; Exit: If AX on entry is set to 1 then on exit: : +; : +; AX 0 = The specified number of characters will fit. : +; 1 = The specified number of characters will not fit. : +; : +; WR_LEFTBYTE = The offset into the input buffer, in bytes, of the : +; left most character position. : +; : +; WR_RIGHTBYTE = The offset into the input buffer, in bytes, of the : +; right most character position. : +; : +; : +; If AX on entry is set to 2 then the input field buffer is : +; displayed on the screen. : +; : +;-----------------------------------------------------------------------------+ +; +LEFT_DISP PROC NEAR +; + PUSH ES ;save PB pointers + PUSH DI + PUSH BX + PUSH [DI]+CR_RCOFF ;save input field display offset +; + CALL LEFT_DISP_INIT ;initialize internal counter & vars ;=W +; + JMP LF20 ;begin of first row +; +; Start a new row in LVB +; +LF10: MOV AX,[DI]+CR_RCOFF ;set ptr into LVB to next row. + ADD AX,[DI]+CR_SCRWIDTH ; Start with current position in + SUB AX,ES:[SI]+ICB_WIDTH ; LVB, add screen width in text + SUB AX,ES:[SI]+ICB_WIDTH ; and attributes, then subtract + MOV [DI]+CR_RCOFF,AX ; the length of the input field + ; twice since length is just in + ; text chars +; +; Do not start new row +; +LF20: MOV AX,ES:[SI]+ICB_WIDTH ;counter contains number of bytes + MOV [DI]+WR_CNTR2,AX ; available in current row of + ; input field +; +; Prepare to place next byte into LVB, verify chars remaining in input buffer +; +LF30: MOV AX,[DI]+WR_CNTR3 ;check if last character has been + CMP [DI]+WR_RIGHTCHAR,AX ; written in LVB (rightmost) + JGE LF40 ;if not last char jump ? +; + JMP LF160 ;yes, last character written + ; prepare to exit +; +; Check if end of field on display has been reached +; +LF40: MOV AX,ES:[SI]+ICB_FIELDLEN ;loop if number chars moved is + CMP [DI]+WR_CNTR1,AX ; less than input buffer length + JLE LF50 ; +; + JMP LF160 +; +; Not complete +; +LF50: CMP [DI]+WR_CNTR2,0 ;loop while number of bytes + JE LF10 ; remaining in the row is greater + ; than zero, jump if bytes avail +; + CMP [DI]+WR_MOVE,1 ;check if entry option is to + JNE LF60 ; determine if bytes may be + ; inserted in displayed field +; + MOV AX,[DI]+WR_LEFTCHAR ;check if insertion calculations + CMP [DI]+WR_CNTR3,AX ; should begin by comparing + JNE LF60 ; current counter with beginning + ; left character marker +; + MOV AL,1 ;check if insertion calculations + CMP [DI]+WR_INSDONE,AL ; are complete + JE LF60 ;if yes, jump +; +; Adjust counters after pretending to insert a character into string and LVB +; + MOV AX,[DI]+WR_BYTESINST ;dec number bytes avail in row + ADD [DI]+WR_CNTR1,AX ;inc number bytes moved into LVB + SUB [DI]+WR_CNTR2,AX ;dec number bytes remaining in row + MOV [DI]+WR_INSDONE,1 ;set flag indicating insert calc + JMP LF30 ; complete +; +; Determine if current byte is a DBCS lead byte +; +LF60: MOV BX,[DI]+WR_FIELDOFF ;get the current byte in the +; + PUSH ES ;save registers + PUSH SI +; + PUSH ES:[SI]+ICB_FIELDSEG ; input field buffer + PUSH [DI]+WR_FIELDOFF ;get the current byte in the + POP SI + POP ES +; + MOV AL,ES:[SI] ;get character in input buffer +; + POP SI ;restore registers + POP ES +; + MOV [DI]+DBC_KS,AL +; + CALL PCINDBC_CALL ;call routine to check if char + ; is lead double byte char +; + TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS + JNE LF70 ;if yes, jump to double byte code +; + JMP LF130 ;if no, jump to single byte code +; +; Current byte is leading byte of a double byte character +; +LF70: CMP [DI]+WR_CNTR2,1 ;check if there is room in current + JNE LF80 ; row for double byte character +; + JMP LF110 ;no room, adjust to next row +; +; Double byte character fits on current row +; +LF80: CMP [DI]+WR_MOVE,2 ;check if option to actually + JNE LF100 ; update display is active +; + MOV AX,[DI]+WR_LEFTCHAR ;check if character should be + CMP [DI]+WR_CNTR3,AX ; displayed by verifying that + JL LF100 ; current character falls + ; between the left and right + MOV AX,[DI]+WR_RIGHTCHAR ; character markers + CMP [DI]+WR_CNTR3,AX + JG LF100 +; + MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s) + MOV [DI]+MG_TEXTOFF,AX ; to display +; + MOV [DI]+MG_OPT,MG_WA+MG_SC ;set write attribute option +; + TEST ES:[SI]+ICB_OPT1,ICB_USC ;use attribute string + JNE LF84 +; + OR [DI]+MG_OPT,MG_UA ;set use logical attribute option +; +LF84: TEST ES:[SI]+ICB_OPT1,ICB_PSW ;is option for password write + JNE LF85 ; active +; + OR [DI]+MG_OPT,MG_WC ;set write character option +; +LF85: MOV [DI]+MG_NUM,2 ;number of words to move into LVB + MOV AX,[DI]+IN_LVBOFF ;set actual offset into LVB + ADD AX,[DI]+CR_RCOFF ; where character(s) will be + MOV [DI]+MG_MIXOFF,AX ; written +; + CALL PCMOVEG_CALL ;call PCMOVEG to write characters +; +; Adjust pointers and counters after moving double byte character +; +LF100: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left + CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and + JNE LF104 ; left chars. See if the current +; + MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so + MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4, + JMP LF106 ; into WR_LEFTBYTE +; +; Update right byte marker +; +LF104: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left + CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and + JNE LF106 ; left chars. See if the current +; + MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so + MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4, + ; into WR_RIGHTBYTE +; +LF106: ADD [DI]+WR_FIELDOFF,2 ;inc number bytes moved from input + ; buffer + ADD [DI]+CR_RCOFF,4 ;inc pointer into LVB + ADD [DI]+WR_CNTR1,2 ;inc number of bytes moved into + ; LVB + SUB [DI]+WR_CNTR2,2 ;dec number of bytes remain + INC [DI]+WR_CNTR3 ;inc number of characters moved + ; into LVB from input string + ADD [DI]+WR_CNTR4,2 ;inc number of bytes moved from + JMP LF30 ; input string +; +; Blank fill remaining screen character positions on current row to prevent +; double byte character from being split +; +LF110: CMP [DI]+WR_MOVE,2 ;check if option to update display + JNE LF120 ; is active +; + MOV AX,[DI]+WR_LEFTCHAR ;check if current character + CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying + JL LF120 ; that the character falls + ; within the left and right + MOV AX,[DI]+WR_RIGHTCHAR ; character markers + CMP [DI]+WR_CNTR3,AX + JG LF120 +; + MOV AL,WR_BLANK ;get blanking character + MOV [DI]+MG_SOURCE_C,AL +; + MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UC + ;set write attr, char and syn chk + TEST ES:[SI]+ICB_OPT1,ICB_USC + JNE LF114 ;use attribute string +; + OR [DI]+MG_OPT,MG_UA ;set use logical attribute option +; +LF114: TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active + JNE LF115 +; + OR [DI]+MG_OPT,MG_WC ;set write character option +; +LF115: MOV [DI]+MG_NUM,1 ;number of words to move into the + ; LVB + MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of + ADD AX,[DI]+CR_RCOFF ; the character to write + MOV [DI]+MG_MIXOFF,AX +; + CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) +; +; Adjust pointers and counters after writing blanking character to LVB +; +LF120: ADD [DI]+CR_RCOFF,2 ;inc pointer into the LVB + INC [DI]+WR_CNTR1 ;inc number of bytes moved into + ; the LVB + DEC [DI]+WR_CNTR2 ;dec number of bytes remaining in + JMP LF10 ; the current row +; +; Byte is a single byte character +; +LF130: CMP [DI]+WR_MOVE,2 ;check if option to update display + JNE LF150 ; is active +; + MOV AX,[DI]+WR_LEFTCHAR ;check if current character + CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying + JL LF150 ; that the character falls +; + MOV AX,[DI]+WR_RIGHTCHAR ; character markers + CMP [DI]+WR_CNTR3,AX + JG LF150 +; + MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s) + MOV [DI]+MG_TEXTOFF,AX ; to display +; + MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA + ;set write attribute option + ;set use logical attribute option + TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active + JNE LF135 +; + OR [DI]+MG_OPT,MG_WC ;set write character option +; +LF135: MOV [DI]+MG_NUM,1 ;number of words to move into the + ; LVB +; + MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of + ADD AX,[DI]+CR_RCOFF ; the character to write + MOV [DI]+MG_MIXOFF,AX +; + CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) +; +; Adjust pointers and counters after moving single byte character +; +LF150: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left + CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and + JNE LF154 ; left chars. See if the current +; + MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so + MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4, + JMP LF156 ; into WR_LEFTBYTE +; +; Update right byte marker +; +LF154: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left + CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and + JNE LF156 ; left chars. See if the current +; + MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so + MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4, + ; into WR_RIGHTBYTE +; +LF156: INC [DI]+WR_FIELDOFF ;inc pointer input buffer + ADD [DI]+CR_RCOFF,2 ;inc pointer into LVB + INC [DI]+WR_CNTR1 ;inc counter with number bytes + ; moved into LVB + DEC [DI]+WR_CNTR2 ;dec counter with number of bytes + ; remaining in current row + ADD [DI]+WR_CNTR3,1 ;inc counter with number of chars + ; moved into the LVB from input + ; buffer + ADD [DI]+WR_CNTR4,1 ;inc counter with number of bytes + JMP LF30 ; moved into the LVB from input + ; buffer +; +; Completed updating LVB, adjust pointers +; +LF160: CMP [DI]+WR_MOVE,1 ;Check if option to calculate + JNE LFEXIT ; if chars fit in buffer +; +; Set up proper return values for insert calculation +; + MOV AX,1 ;set flag indicating insert did + ; not fit + MOV BX,[DI]+WR_CNTR3 ;see if input field fit into LVB + DEC BX ; by comparing the right char + CMP [DI]+WR_RIGHTCHAR,BX ; number with the number of chars + JNE LFEXIT ; moved into the LVB. If they + ; are equal the string fit into + ; the LVB. + CMP [DI]+WR_INSDONE,1 ;see if insert has been done + JE LF170 ;if yes set up return values +; + MOV BX,ES:[SI]+ICB_FIELDLEN ;if no, then insert is at end of + SUB BX,[DI]+WR_CNTR1 ; line i.e. past right char + INC BX ;see if there is enough room left + CMP BX,[DI]+WR_BYTESINST ; to display char being inserted + JL LFEXIT +; +LF170: MOV AX,0 ;set flag indicating insert fits +; +; Restores the registers to entry values and exits +; +LFEXIT: POP [DI]+CR_RCOFF ;save input field display offset +; + POP BX ;restore registers + POP DI + POP ES +; + RET +LEFT_DISP ENDP +; +PAGE +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; LEFTS_DISP (no double byte support) : ;=W +; : ;=W +; Calculates if the specified character will fit in the input : ;=W +; buffer at the specified character position without display. : ;=W +; The byte offset where this character should be inserted is : ;=W +; returned or a flag indicating that the character will not fit. : ;=W +; : ;=W +; Displays the specified portion of the input field buffer from : ;=W +; the left character marker to the end of the field. The following : ;=W +; display options are handled by this routine: : ;=W +; : ;=W +; - Display of the input field in a wrapped window : ;=W +; - Adjustment of double byte characters to prevent malformed : ;=W +; characters : ;=W +; : ;=W +; : ;=W +; The following pointers are used: : ;=W +; : ;=W +; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W +; ³ buffer in memory. : ;=W +; ³ : ;=W +; ³ ÚÄ (WR_LEFTCHAR) Left marker delimiting the left : ;=W +; ³ ³ most character position in the : ;=W +; ³ ³ input buffer. : ;=W +; ³ ³ : ;=W +; ³ ³ Right marker delimiting the right : ;=W +; ³ ³ most character position in the : ;=W +; ³ ³ input buffer. (WR_RIGHTCHAR) : ;=W +; ³ ³ ³ : ;=W +; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W +; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ : ;=W +; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W +; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ : ;=W +; ³ ³ Area to display : ;=W +; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W +; ³ : ;=W +; ICB_FIELDLEN Length of input field in bytes. : ;=W +; : ;=W +; : ;=W +; Entry: ES:SI = Points to current ICB : ;=W +; DS:DI = Points to PB : ;=W +; : ;=W +; AX 1 = This option will calculate if the specified number : ;=W +; of bytes in BX can fit into input buffer at the : ;=W +; specified character position considering the display : ;=W +; coordinates and options. No update of the display : ;=W +; screen will occur. A flag indicating if the bytes : ;=W +; can be inserted or not is returned. If the bytes : ;=W +; will fit the offset from the beginning of the input : ;=W +; field in bytes is returned indicating where the : ;=W +; characters should be inserted. : ;=W +; : ;=W +; 2 = This option will update the display screen in the : ;=W +; proper format with the input buffer characters : ;=W +; starting at the specified left offset character : ;=W +; to the right character marker. : ;=W +; : ;=W +; BX = Number of bytes to insert starting at the specified : ;=W +; character position. : ;=W +; : ;=W +; WR_CATTR = Logical color attribute to use when updating screen : ;=W +; if the use of the color attribute string is not : ;=W +; specified. : ;=W +; : ;=W +; CR_RCOFF = Beginning offset of the upper left input field : ;=W +; display corner from the beginning of the video : ;=W +; buffer. : ;=W +; : ;=W +; CR_SCRWIDTH = Width of the video buffer in characters and : ;=W +; attributes. : ;=W +; : ;=W +; WR_LEFTCHAR = The offset into the input buffer, in characters, : ;=W +; of where the specified bytes should fit. : ;=W +; : ;=W +; WR_RIGHTCHAR = The offset into the input buffer, in characters, : ;=W +; of where the right most character position. : ;=W +; : ;=W +; : ;=W +; Exit: If AX on entry is set to 1 then on exit: : ;=W +; : ;=W +; AX 0 = The specified number of characters will fit. : ;=W +; 1 = The specified number of characters will not fit. : ;=W +; : ;=W +; WR_LEFTBYTE = The offset into the input buffer, in bytes, of the : ;=W +; left most character position. : ;=W +; : ;=W +; WR_RIGHTBYTE = The offset into the input buffer, in bytes, of the : ;=W +; right most character position. : ;=W +; : ;=W +; : ;=W +; If AX on entry is set to 2 then the input field buffer is : ;=W +; displayed on the screen. : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +; ;=W +LEFTS_DISP PROC NEAR ;=W +; + PUSH ES ;save PB pointers ;=W + PUSH DI ;=W + PUSH BX ;=W + PUSH [DI]+CR_RCOFF ;save input field display offset ;=W +; + CALL LEFT_DISP_INIT ;initialize internal counters & vars ;=W +; + JMP LS20 ;begin of first row ;=W +; ;=W +; Start a new row in LVB ;=W +; ;=W +LS10: MOV AX,[DI]+CR_RCOFF ;set ptr into LVB to next row. ;=W + ADD AX,[DI]+CR_SCRWIDTH ; Start with current position in ;=W + SUB AX,ES:[SI]+ICB_WIDTH ; LVB, add screen width in text ;=W + SUB AX,ES:[SI]+ICB_WIDTH ; and attributes, then subtract ;=W + MOV [DI]+CR_RCOFF,AX ; the length of the input field ;=W + ; twice since length is just in ;=W + ; text chars ;=W +; ;=W +; Do not start new row ;=W +; ;=W +LS20: MOV AX,ES:[SI]+ICB_WIDTH ;counter contains number of bytes ;=W + MOV [DI]+WR_CNTR2,AX ; available in current row of ;=W + ; input field ;=W +; ;=W +; Prepare to place next byte into LVB, verify chars remaining in input buffer ;=W +; ;=W +LS30: MOV AX,[DI]+WR_CNTR3 ;check if last character has been ;=W + CMP [DI]+WR_RIGHTCHAR,AX ; written in LVB (rightmost) ;=W + JGE LS40 ;if not last char jump ? ;=W +; + JMP LS160 ;yes, last character written ;=W + ; prepare to exit ;=W +; ;=W +; Check if end of field on display has been reached ;=W +; ;=W +LS40: MOV AX,ES:[SI]+ICB_FIELDLEN ;loop if number chars moved is ;=W + CMP [DI]+WR_CNTR1,AX ; less than input buffer length ;=W + JLE LS50 ; ;=W +; + JMP LS160 ;=W +; ;=W +; Not complete ;=W +; ;=W +LS50: CMP [DI]+WR_CNTR2,0 ;loop while number of bytes ;=W + JE LS10 ; remaining in the row is greater ;=W + ; than zero, jump if bytes avail ;=W +; + CMP [DI]+WR_MOVE,1 ;check if entry option is to ;=W + JNE LS130 ; determine if bytes may be ;=W + ; inserted in displayed field ;=W +; + MOV AX,[DI]+WR_LEFTCHAR ;check if insertion calculations ;=W + CMP [DI]+WR_CNTR3,AX ; should begin by comparing ;=W + JNE LS130 ; current counter with beginning ;=W + ; left character marker ;=W +; + MOV AL,1 ;check if insertion calculations ;=W + CMP [DI]+WR_INSDONE,AL ; are complete ;=W + JE LS130 ;if yes, jump ;=W +; ;=W +; Adjust counters after pretending to insert a character into string and LVB ;=W +; ;=W + MOV AX,[DI]+WR_BYTESINST ;dec number bytes avail in row ;=W + ADD [DI]+WR_CNTR1,AX ;inc number bytes moved into LVB ;=W + SUB [DI]+WR_CNTR2,AX ;dec number bytes remaining in row ;=W + MOV [DI]+WR_INSDONE,1 ;set flag indicating insert calc ;=W + JMP LS30 ; complete ;=W +; ;=W +; Byte is a single byte character ;=W +; ;=W +LS130: CMP [DI]+WR_MOVE,2 ;check if option to update display ;=W + JNE LS150 ; is active ;=W +; + MOV AX,[DI]+WR_LEFTCHAR ;check if current character ;=W + CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying ;=W + JL LS150 ; that the character falls ;=W + ; within the left and right ;=W + MOV AX,[DI]+WR_RIGHTCHAR ; character markers ;=W + CMP [DI]+WR_CNTR3,AX ;=W + JG LS150 ;=W +; + MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s) ;=W + MOV [DI]+MG_TEXTOFF,AX ; to display ;=W +; + MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W + ;set write attribute option ;=W + ;set use logical attribute option ;=W + TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W + JNE LS135 ;=W +; + OR [DI]+MG_OPT,MG_WC ;set write character option ;=W +; +LS135: MOV [DI]+MG_NUM,1 ;number of words to move into the ;=W + ; LVB ;=W +; + MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W + ADD AX,[DI]+CR_RCOFF ; the character to write ;=W + MOV [DI]+MG_MIXOFF,AX ;=W +; + CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W +; ;=W +; Adjust pointers and counters after moving single byte character ;=W +; ;=W +LS150: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left ;=W + CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and ;=W + JNE LS154 ; left chars. See if the current ;=W +; + MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so ;=W + MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4, ;=W + JMP LS156 ; into WR_LEFTBYTE ;=W +; ;=W +; Update right byte marker ;=W +; ;=W +LS154: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left ;=W + CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and ;=W + JNE LS156 ; left chars. See if the current ;=W +; + MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so ;=W + MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4, ;=W + ; into WR_RIGHTBYTE ;=W +LS156: INC [DI]+WR_FIELDOFF ;inc pointer input buffer ;=W + ADD [DI]+CR_RCOFF,2 ;inc pointer into LVB ;=W + INC [DI]+WR_CNTR1 ;inc counter with number bytes ;=W + ; moved into LVB ;=W + DEC [DI]+WR_CNTR2 ;dec counter with number of bytes ;=W + ; remaining in current row ;=W + ADD [DI]+WR_CNTR3,1 ;inc counter with number of chars ;=W + ; moved into the LVB from input ;=W + ; buffer ;=W + ADD [DI]+WR_CNTR4,1 ;inc counter with number of bytes ;=W + JMP LS30 ; moved into the LVB from input ;=W + ; buffer ;=W +; ;=W +; Completed updating LVB, adjust pointers ;=W +; ;=W +LS160: CMP [DI]+WR_MOVE,1 ;Check if option to calculate ;=W + JNE LSEXIT ; if chars fit in buffer ;=W +; ;=W +; Set up proper return values for insert calculation ;=W +; ;=W + MOV AX,1 ;set flag indicating insert did ;=W + ; not fit ;=W + MOV BX,[DI]+WR_CNTR3 ;see if input field fit into LVB ;=W + DEC BX ; by comparing the right char ;=W + CMP [DI]+WR_RIGHTCHAR,BX ; number with the number of chars ;=W + JNE LSEXIT ; moved into the LVB. If they ;=W + ; are equal the string fit into ;=W + ; the LVB. ;=W + CMP [DI]+WR_INSDONE,1 ;see if insert has been done ;=W + JE LS170 ;if yes set up return values ;=W +; + MOV BX,ES:[SI]+ICB_FIELDLEN ;if no, then insert is at end of ;=W + SUB BX,[DI]+WR_CNTR1 ; line i.e. past right char ;=W + INC BX ;see if there is enough room left ;=W + CMP BX,[DI]+WR_BYTESINST ; to display char being inserted ;=W + JL LSEXIT ;=W +; +LS170: MOV AX,0 ;set flag indicating insert fits ;=W +; ;=W +; Restores the registers to entry values and exits ;=W +; ;=W +LSEXIT: POP [DI]+CR_RCOFF ;save input field display offset ;=W +; + POP BX ;restore registers ;=W + POP DI ;=W + POP ES ;=W +; + RET ;=W +LEFTS_DISP ENDP ;=W +; +PAGE +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; DRAW_DEM : ;=W +; Draw a input field delimiter : ;=W +; : ;=W +; Entry: : ;=W +; ES:SI address of icon : ;=W +; GC_ROW - character row to display delimiter : ;=W +; GC_COL - character column to display delimiter : ;=W +; : ;=W +; Exit: None : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +DRAW_DEM PROC NEAR ;=W +; + PUSH AX ;=W + PUSH BX ;=W + PUSH CX ;=W + PUSH DX ;=W + PUSH DI ;=W + PUSH SI ;=W + PUSH DS ;=W + PUSH ES ;=W + PUSH BP ;=W +; + MOV BP,AX +; + MOV DX,300H + graph_addr ;=W + MOV AH,2 ; Write Mode 2 ;=W + MOV AL,5 ; Write Mode Register ;=W + OUT DX,AX ;=W +; + MOV DL,seq_addr ;=W + MOV AH,0FFH ;enable all maps ;=W + MOV AL,s_map ;map mask ;=W + OUT DX,AX ;set the registers ;=W +; + MOV AX,[DI]+WR_ROWBYTES ;=W + MOV BX,50H ;=W + MUL BX ;=W + ;=W + MOV BX,[DI]+GC_ROW ;=W + MUL BX ;=W + ADD AX,[DI]+GC_COL ;=W +; + MOV BH,[DI]+WR_CATTR ;get current color attribute ;=W +; + CMP [DI]+WR_VIDMODE,11H ;check for graphics mode 11H + JNE DD05 ;nop, continue + MOV BH,0FH ;yes, mode 11 is only black & +; +DD05: MOV CL,4 ;count for shift ;=W + SHR BX,CL ;separate background/foreground ;=W + MOV CL,4 ;count for shift ;=W + SHR BL,CL ;put in low order nibble ;=W + XCHG BL,BH ;foreground/background are reversed ;=W + ; for delimiter +; BL = background color, BH = foreground color + CMP BP,02 ;check if we want to remove delimiters ;=W + JNE DD10 ;no, ok ;=W + MOV BH,BL ;make both background color ;=W + ;=W +DD10: ;=W + MOV CL,[DI]+WR_VIDMODE ;=W + MOV DX,[DI]+IN_OPT +; + PUSH ES ;make DS:SI point to bit maps ;=W + POP DS ;=W +; + MOV DI,AX ;=W + MOV AX,0A000H ;=W + MOV ES,AX ;=W +; + TEST DX,IN_MCGA ;mode 11H, non-VGA hardware? + JNE DD100 ;if so, go do it +;--------------------------------------------- ;=W +; Mode 10,11,12 with VGA : ;=W +;--------------------------------------------- ;=W + MOV DX,300H + graph_addr ;graphics chip ;=W + XOR CH,CH ;=W +; + MOV AL,CL ;save vid mode + MOV CL,0EH ;# pixel rows in delimiter ;=W + CMP AL,10H ;are we in graphics mode 10H + JE DD40 ;yes, # rows ok + ADD CL,2 ;no, mode 11,12 have 16 pixel rows +DD40: ; instead of 14 pixel rows. + MOV BP,02H ;# pixel columns/8 in delimiter ;=W +; + MOV AH,0FFH ;=W + MOV AL,g_bit_mask ;bit mask index ;=W + OUT DX,AX ;set bit mask ;=W +DD50: ;=W + PUSH CX ;=W + PUSH DI ;=W + MOV CX,BP ;=W +DD60: ;=W + MOV AH,0FFH ;background ;=W + MOV AL,g_bit_mask ;bit mask index ;=W + OUT DX,AX ;set bit mask ;=W +; + MOV AL,ES:[DI] ;latch data ;=W + MOV ES:[DI],BH ;set the dot ;=W +; + LODSB ;foreground ;=W + XCHG AL,AH ;=W +; + MOV AL,g_bit_mask ;bit mask index ;=W + OUT DX,AX ;set bit mask ;=W +; + MOV AL,ES:[DI] ;latch data ;=W + MOV ES:[DI],BL ;set the dot ;=W +; + INC DI ;=W + LOOP DD60 ;=W +; + POP DI ;=W + ADD DI,LINELEN ;=W + POP CX ;=W + LOOP DD50 ;=W + JMP DDEXIT ;=W +;--------------------------------------------- ;=W +; Mode 11H with no VGA : ;=W +;--------------------------------------------- ;=W +DD100: XOR CH,CH + MOV CL,10H ;# pixel rows in delimiter + MOV BP,02H ;# of pixel columns in delimiter + +DD110: PUSH CX + PUSH DI +; + MOV CX,BP +; +DD120: LODSB ;get icon row +; +DD130: XOR AL,0FFH + MOV ES:[DI],AL ;set the dot + INC DI + LOOP DD120 +; + POP DI +; + ADD DI,50H ;line length, 80 +; + POP CX +; + LOOP DD110 +; +DDEXIT: POP BP + POP ES + POP DS + POP SI + POP DI + POP DX + POP CX + POP BX + POP AX +; + RET +DRAW_DEM ENDP +; +PAGE +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; GET_MONO_DOS : ;=W +; Get segment and offset of the DOS monocasing table and return it : ;=W +; : ;=W +; Entry: None : ;=W +; : ;=W +; Exit: None : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +GET_MONO_DOS PROC NEAR ;=W +; + PUSH SI ;save registers ;=W + PUSH ES ;=W + PUSH DI ;=W +; + MOV AH,65H ;extended country info ;=W + MOV AL,02H ;get uppercase table ptrs ;=W + MOV BX,-1 ;default code page ;=W + MOV DX,-1 ;default country id ;=W + MOV CX,05H ;# bytes returned ;=W + PUSH DS ;=W + POP ES ;ES:DI ptrs to return buffer ;=W + MOV DI,OFFSET WR_CUCHAR ;use as temp buffer ;=W +; + INT 21H ;=W +; + INC DI ;skip info id ;=W + MOV SI,DI ;we need DI so use SI ;=W + POP DI ;=W +; + MOV AX,WORD PTR [SI] ;get DOS monocasing table offset ;=W + MOV [DI]+IN_MONOOFF,AX ;save it ;=W + ADD SI,2 ;=W + MOV AX,WORD PTR [SI] ;get DOS monocasing table segment ;=W + MOV [DI]+IN_MONOSEG,AX ;save it ;=W +; + POP ES ;restore registers ;=W + POP SI ;=W +; + RET ;=W +GET_MONO_DOS ENDP +; +PAGE +;-----------------------------------------------------------------------------+ ;=W +; : ;=W +; GET_DBCS : ;=W +; Get segment and offset of the DOS double byte support table. : ;=W +; : ;=W +; Entry: DS:DI : ;=W +; : ;=W +; Exit: None : ;=W +; : ;=W +;-----------------------------------------------------------------------------+ ;=W +GET_DBCS PROC NEAR ;=W +; + PUSH SI + PUSH ES ;=W + PUSH DI ;=W + PUSH DI ;=W +; + MOV AH,65H ;get extended country info + MOV AL,07H ;get DBCS environment table + INT 21H ;DOS function call,vector returned + ; in ES:DI + POP SI ;ptr, SI -> IN_PB + INC DI ;skip over id byte returned + MOV AX,WORD PTR ES:[DI] ;get offset of DBCS table + MOV [DI]+IN_DBCSOFF,AX ;save it +; + ADD DI,2 ;skip over offset to get segment + MOV BX,WORD PTR ES:[DI] ;get segment of DBCS table + MOV [DI]+IN_DBCSSEG,BX ;save it +; + POP DI +; + MOV SI,AX ;Point to DBCS table to get length + MOV ES,BX + MOV AX,WORD PTR ES:[SI] + MOV [DI]+IN_DBCSLEN,AX + ADD [DI]+IN_DBCSOFF,2 ;change offset to point to table +; + POP ES + POP SI +; + RET +GET_DBCS ENDP diff --git a/v4.0/src/INC/PDB.INC b/v4.0/src/INC/PDB.INC new file mode 100644 index 0000000..41fbd90 --- /dev/null +++ b/v4.0/src/INC/PDB.INC @@ -0,0 +1,51 @@ +; SCCSID = @(#)pdb.asm 1.1 85/04/10 +BREAK + +; +; Process data block (otherwise known as program header) +; + +FilPerProc EQU 20 + +Process_data_block STRUC +PDB_Exit_Call DW ? ; INT int_abort system terminate +PDB_block_len DW ? ; size of execution block + DB ? +PDB_CPM_Call DB 5 DUP (?) ; ancient call to system +PDB_Exit DD ? ; pointer to exit routine +PDB_Ctrl_C DD ? ; pointer to ^C routine +PDB_Fatal_abort DD ? ; pointer to fatal error +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +PDB_Parent_PID DW ? ; PID of parent (terminate PID) +PDB_JFN_Table DB FilPerProc DUP (?) + ; indices into system table +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +PDB_environ DW ? ; seg addr of environment +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +PDB_User_stack DD ? ; stack of self during system calls +PDB_JFN_Length DW ? ; number of handles allowed +PDB_JFN_Pointer DD ? ; pointer to JFN table +PDB_Next_PDB DD ? ; pointer to nested PDB's +PDB_PAD1 DB 14h DUP (?) +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +PDB_Call_system DB 5 DUP (?) ; portable method of system call +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +PDB_PAD2 DB 7h DUP (?) +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Process_data_block ENDS + +PDB_InterCon EQU BYTE PTR PDB_PAD1 ; 2/12/KK +PDB_Append EQU BYTE PTR PDB_PAD1+1 ; 2/12/KK + \ No newline at end of file diff --git a/v4.0/src/INC/POSTEQU.INC b/v4.0/src/INC/POSTEQU.INC new file mode 100644 index 0000000..b01ed5e --- /dev/null +++ b/v4.0/src/INC/POSTEQU.INC @@ -0,0 +1,262 @@ +; Revised FOR KBX (ADD EQUATES FOR KB_FLAG_3) AEV 8-17-84 +;---------------------------------------------------------------------------- +; EQUATES : +;---------------------------------------------------------------------------- +TTEST EQU 0 ; CONDITIONAL ASM (TEST2.SRC) +KY_LOCK EQU 0 ; CONDITIONAL ASM (TEST2.SRC) +KEY_NUMS EQU 0 ; CONDITIONAL ASM (KYBD.SRC) +;---------------------------------------------------------------------------- +X287 EQU 0F0H ; MATH PROCESSOR +;---------------------------------------------------------------------------- +LOOP_POST EQU 020H ; MFG LOOP POST JUMPER +;---------------------------------------------------------------------------- +REFRESH_BIT EQU 010H ; REFRESH TEST BIT +;---------------------------------------------------------------------------- +POST_SS EQU 0H ; POST STACK SEGMENT +POST_SP EQU 8000H ; POST STACK POINTER +TEMP_STACK_LO EQU 0FFFFH ; +TEMP_STACK_HI EQU 0 ; SET PROTECTED MODE TEMP_SS + ; 0:FFFFH +;---------------------------------------------------------------------------- +PORT_A EQU 60H ; 8042 KEYBOARD SCAN/DIAG OUTPUTS +PORT_B EQU 61H ; 8042 READ WRITE REGISTER +PARITY_ERR EQU 0C0H ; RAM/IO CHANNEL PARITY ERROR +RAM_PAR_ON EQU 11110011B ; AND THIS VALUE +RAM_PAR_OFF EQU 00001100B ; OR THIS VALUE +IO_CHK EQU 01000000B ; IO CHECK? +PRTY_CHK EQU 10000000B ; PARITY CHECK? + +STATUS_PORT EQU 64H ;8042 STATUS PORT +OUT_BUF_FULL EQU 01H ; 0 = +OUTPUT BUFFER FULL +INPT_BUF_FULL EQU 02H ; 1 = +INPUT BUFFER FULL +SYS_FLAG EQU 04H ; 2 = -SYSTEM FLAG -POR/-SELF TEST +CMD_DATA EQU 08H ; 3 = -COMMAND/+DATA +KYBD_INH EQU 10H ; 4 = +KEYBOARD INHIBITED +TRANS_TMOUT EQU 20H ; 5 = +TRANSMIT TIMEOUT +RCV_TMOUT EQU 40H ; 6 = +RECEIVE TIME OUT +PARITY_EVEN EQU 80H ; 7 = +PARITY IS EVEN +SHUT_CMD EQU 0FEH ; CAUSE A SHUTDOWN COMMAND +INTR_FACE_CK EQU 0ABH ; CHECK 8042 INTERFACE CMD +KYBD_CLK_DATA EQU 0E0H ; GET KYBD CLOCK AND DATA CMD +KYBD_CLK EQU 001H ; KEYBOARD CLOCK BIT 0 +;----------MANUFACTURING PORT------------------------------------------------ +MFG_PORT EQU 80H ; MANUFACTURING CHECKPOINT PORT +;----------MANUFACTURING BIT DEFINITION FOR MFG_ERR_FLAG+1------------------- +MEM_FAIL EQU 00000001B ; STORAGE TEST FAILED (ERROR 20X) +PRO_FAIL EQU 00000010B ; VIRTUAL MODE TEST FAILED (ERROR 104) +LMCS_FAIL EQU 00000100B ; LOW MEG CHIP SELECT FAILED (ERROR 109) +KYCLK_FAIL EQU 00001000B ; KEYBOARD CLOCK TEST FAILED (ERROR 304) +KY_SYS_FAIL EQU 00010000B ; KEYBOARD OR SYSTEM FAILED (ERROR 303) +KYBD_FAIL EQU 00100000B ; KEYBOARD FAILED (ERROR 301) +DSK_FAIL EQU 01000000B ; DISKETTE TEST FAILED (ERROR 601) +KEY_FAIL EQU 10000000B ; KEYBOARD LOCKED (ERROR 302) +;----------8042 INPUT PORT BIT DEFINITION------------------------------------ +BASE_RAM EQU 10H ;BASE R/W MEMORY +MFG_JMP EQU 20H ;LOOP POST JUMPER +DSP_JMP EQU 40H ;DISPLAY TYPE JUMPER +KEY_BD_INHIB EQU 80H ;KEYBOARD INHIBIT SWITCH +;----------8042 RAM DEFINITION----------------------------------------------- +INH_KEYBOARD EQU 10H ;BYTE 0 BIT 4 OF 8042 RAM +;-------------- COMMANDS ---------------------------------------------------- +READ_8042_RAM EQU 20H ; BITS 0-4 = ADDRESS (20-3F) +WRITE_8042_RAM EQU 60H ; +SELF_8042_TEST EQU 0AAH ; 8042 SELF TEST +READ_8042_INPUT EQU 0C0H ; READ 8042 INPUT PORT +ENA_KBD EQU 0AEH ; ENABLE KEYBOARD COMMAND +DIS_KBD EQU 0ADH ; DISABLE KEYBOARD COMMAND +ENABLE_BIT20 EQU 0DFH ; ENABLE ADDR LINE BIT 20 +DISABLE_BIT20 EQU 0DDH ; DISABLE ADDR LINE BIT 20 +;-------------- KEYBOARD/LED COMMANDS -------------------------------------- +KB_MENU EQU 0F1H ; SELECT MENU COMMAND +KB_TYPA_RD EQU 0F3H ; SET TYPAMATIC RATE/DELAY RWV 10-07-85 +KB_ENABLE EQU 0F4H ; KEYBOARD ENABLE +KB_MAKE_BREAK EQU 0F7H ; TYPAMATIC +KB_ECHO EQU 0FEH ; ECHO COMMAND +KB_RESET EQU 0FFH ; SELF DIAGNOSTIC COMMAND +LED_CMD EQU 0EDH ; LED WRITE COMMAND +;--------------- KEYBOARD RESPONSE ----------------------------------------- +KB_OK EQU 0AAH ; RESPONSE FROM SELF DIAG +KB_ACK EQU 0FAH ; ACKNOWLEDGE FROM TRANSMISSION +KB_OVER_RUN EQU 0FFH ; OVER RUN +KB_RESEND EQU 0FEH ; RESEND REQUEST +KB_BREAK EQU 0F0H ; KEYBOARD BREAK CODE +;-------------- CMOS EQUATES ------------------------------------------------- +CMOS_PORT EQU 070H ; IO ADDRESS OF CMOS PORT +CLK_UP EQU 08AH ; CLOCK UPDATE STATUS +CMOS_ALARM EQU 08BH ; +CMOS_BEGIN EQU 090H ; +CMOS_END EQU 0ADH ; +SHUT_DOWN EQU 08FH ; SHUTDOWN OFFSET +BATTERY_COND_STATUS EQU 08DH ; BATTERY STATUS +M_SIZE_HI EQU 0B1H ; IO MEMORY SIZE HIGH BYTE (POST) +M_SIZE_LO EQU 0B0H ; IO MEMORY SIZE LO BYTE (POST) +M1_SIZE_HI EQU 096H ; 0->640K CONFIG MEMORY SIZE (SETUP) +M1_SIZE_LO EQU 095H ; LOW BYTE (SETUP) +M2_SIZE_HI EQU 098H ; 640K->UP CONFIG MEMORY SIZE (SETUP) +M2_SIZE_LO EQU 097H ; LOW BYTE (SETUP) +C_EQUIP EQU 094H ; CMOS EQUIPMENT FLAG +HD_FILE_TYPE EQU 092H ; HARD FILE TYPE BYTE +PAGE +;--------------- CMOS DIAG_STATUS ERROR FLAGS-------------------------------- +DIAG_STATUS EQU 08EH ; CMOS ADDRESS OF DIAG_STATUS +BAD_BAT EQU 080H ; DEAD BATTERY +BAD_CKSUM EQU 040H ; CHECKSUM ERROR +BAD_CONFIG EQU 020H ; MINIMUM CONFIG USED INSTEAD OF CMOS +W_MEM_SIZE EQU 010H ; MEMORY SIZE NOT EQUAL TO CONFIG +HF_FAIL EQU 008H ; HARD FILE FAILURE ON INIT +CMOS_CLK_FAIL EQU 004H ; CMOS CLK NOT UPDATING OR NOT VALID +;--------------- CMOS INFORMATION FLAGS-------------------------------------- +INFO_STATUS EQU 0B3H ; CMOS ADDRESS OF INFO BYTE +M640K EQU 080H ; 512K -> 640K CARD INSTALLED +NEW_INST EQU 040H ; FLAG USED BY CMOS SETUP UTILITY +HF_BOOT EQU 020H ; BOOT HARD FILE FLAG +;--------------- INTERRUPT EQUATES ------------------------------------------ +INTA00 EQU 20H ; 8259 PORT +INTA01 EQU 21H ; 8259 PORT +EOI EQU 20H +INTB00 EQU 0A0H ; 2ND 8259 +INTB01 EQU 0A1H ; +INT_TYPE EQU 070H ; START OF 8259 INTERRUPT TABLE LOCATION +INT_VIDEO EQU 010H ; VIDEO VECTOR +;--------------------------------------------------------------------------- +TIMER EQU 40H +TIM_CTL EQU 43H ; 8253 TIMER CONTROL PORT ADDR +TIMER0 EQU 40H ; 8253 TIMER/CNTER 0 PORT ADDR +TMINT EQU 01 ; TIMER 0 INTR RECVD MASK +;-------------------------------------------------------------------------- +DMA08 EQU 08 ; DMA STATUS REG PORT ADDR +DMA EQU 00 ; DMA CH.0 ADDR. REG PORT ADDR +;-------------------------------------------------------------------------- +DMA18 EQU 0D0H ; 2ND DMA STATUS PORT ADDR +DMA1 EQU 0C0H ; 2ND DMA CH.0 ADDR. REG PORT ADDR +;-------------------------------------------------------------------------- +DMA_PAGE EQU 81H ; START OF DMA PAGE REGISTERS +LAST_DMA_PAGE EQU 8FH ; LAST DMA PAGE REGISTER +;-------------------------------------------------------------------------- +MAX_PERIOD EQU 540H +MIN_PERIOD EQU 410H +KBD_IN EQU 60H ; KEYBOARD DATA IN ADDR PORT +KBDINT EQU 02 ; KEYBOARD INTR MASK +KB_DATA EQU 60H ; KEYBOARD SCAN CODE PORT +KB_CTL EQU 61H ; CONTROL BITS FOR KEYBOARD SENSE DATA +KB_ERR EQU 80H ; KEYBOARD TRANSMIT ERROR FLAG +;----- SHIFT FLAG EQUATES WITHIN KB_FLAG +INS_STATE EQU 80H ; INSERT STATE IS ACTIVE +CAPS_STATE EQU 40H ; CAPS LOCK STATE HAS BEEN TOGGLED +NUM_STATE EQU 20H ; NUM LOCK STATE HAS BEEN TOGGLED +SCROLL_STATE EQU 10H ; SCROLL LOCK STATE HAS BEEN TOGGLED +ALT_SHIFT EQU 08H ; ALTERNATE SHIFT KEY DEPRESSED +CTL_SHIFT EQU 04H ; CONTROL SHIFT KEY DEPRESSED +LEFT_SHIFT EQU 02H ; LEFT SHIFT KEY DEPRESSED +RIGHT_SHIFT EQU 01H ; RIGHT SHIFT KEY DEPRESSED +;----- SHIFT FLAG EQUATES WITHIN KB_FLAG_1 +INS_SHIFT EQU 80H ; INSERT KEY IS DEPRESSED +CAPS_SHIFT EQU 40H ; CAPS LOCK KEY IS DEPRESSED +NUM_SHIFT EQU 20H ; NUM LOCK KEY IS DEPRESSED +SCROLL_SHIFT EQU 10H ; SCROLL LOCK KEY IS DEPRESSED +HOLD_STATE EQU 08H ; SUSPEND KEY HAS BEEN TOGGLED +SYS_SHIFT EQU 04H ; SYSTEM KEY DEPRESSED AND HELD +L_ALT_SHIFT EQU 02H ; LEFT ALT KEY DOWN RWV 8-28-85 +L_CTL_SHIFT EQU 01H ; LEFT CTL KEY DOWN RWV 8-28-85 +;---------------FLAGS WITHIN KB_FLAG_2 +KB_ERR EQU 80H ; KEYBOARD TRANSMIT ERROR FLAG +KB_PR_LED EQU 40H ; MODE INDICATOR UPDATE +KB_FE EQU 20H ; RESEND RECEIVED FLAG +KB_FA EQU 10H ; ACK RECEIVED +CIRCUS_SYSTEM EQU 08H ; CIRCUS SYSTEM INDICATOR +KB_LEDS EQU 07H ; KEYBOARD LED STATE BITS +; 04H ; CAPS LOCK INDICATOR +; 02H ; NUM LOCK INDICATOR +; 01H ; SCROLL LOCK INDICATOR +;---------------FLAGS WITHIN KB_FLAG_3 +RD_ID EQU 80H ; DOING A READ ID (MUST BE BIT0) AEV +LC_AB EQU 40H ; LAST CHAR WAS FIRST ID CHAR AEV +SET_NUM_LK EQU 20H ; FORCE NUM LOCK IF RD ID & KBX AEV +KBX EQU 10H ; ENHANCED KEYBOARD INSTALLED RWV 7-18-85 +R_ALT_SHIFT EQU 08H ; RIGHT ALT KEY DOWN RWV 7-18-85 +GRAPH_ON EQU 08H ; ALT GRAPHICS KEY DOWN (WT ONLY) AEV +R_CTL_SHIFT EQU 04H ; RIGHT CTL KEY DOWN RWV 7-18-85 +LC_E0 EQU 02H ; LAST CODE WAS THE E0 HIDDEN CODE RWV 7-18-85 +LC_E1 EQU 01H ; LAST CODE WAS THE E1 HIDDEN CODE RWV 7-18-85 +;----- SCAN CODE EQUATES FOR THE KEYBOARD +NUM_KEY EQU 69 ; SCAN CODE FOR NUMBER LOCK +SCROLL_KEY EQU 70 ; SCAN CODE FOR SCROLL LOCK +ALT_KEY EQU 56 ; SCAN CODE FOR ALTERNATE KEY +CTL_KEY EQU 29 ; SCAN CODE FOR CONTROL KEY +CAPS_KEY EQU 58 ; SCAN CODE FOR SHIFT LOCK +LEFT_KEY EQU 42 ; SCAN CODE FOR LEFT SHIFT +RIGHT_KEY EQU 54 ; SCAN CODE FOR RIGHT SHIFT +INS_KEY EQU 82 ; SCAN CODE FOR INSERT KEY +DEL_KEY EQU 83 ; SCAN CODE FOR DELETE KEY +SYS_KEY EQU 84 ; SCAN CODE FOR SYSTEM KEY +;-------------- ENHANCED KEYBOARD EQUATES +ID_1 EQU 0ABH ; 1ST ID CHAR FOR KBX +ID_2 EQU 041H ; 2ND ID CHAR FOR KBX AEV +ID_2A EQU 054H ; ALTERNATE 2ND ID CHAR FOR KBX RWV 8-16-85 +F11_M EQU 87 ; F11 KEY MAKE +F12_M EQU 88 ; F12 KEY MAKE +MC_E0 EQU 224 ; GENERAL MARKER CODE +MC_E1 EQU 225 ; PAUSE KEY MARKER CODE + +;-------------- DISKETTE EQUATES +INT_FLAG EQU 080H ; INTERRUPT OCCURRENCE FLAG +MOTOR_WAIT EQU 37 ; 2 SECS OF COUNTS FOR MOTOR TURN OFF +TIME_OUT EQU 80H ; ATTACHMENT FAILED TO RESPOND +BAD_SEEK EQU 40H ; SEEK OPERATION FAILED +BAD_NEC EQU 20H ; NEC CONTROLLER HAS FAILED +BAD_CRC EQU 10H ; BAD CRC ON DISKETTE READ +DMA_BOUNDARY EQU 09H ; ATTEMPT TO DMA ACROSS 64K BOUNDARY +BAD_DMA EQU 08H ; DMA OVERRUN ON OPERATION +MEDIA_CHANGE EQU 06H ; MEDIA REMOVED ON DUAL ATTACH CARD +RECORD_NOT_FND EQU 04H ; REQUESTED SECTOR NOT FOUND +WRITE_PROTECT EQU 03H ; WRITE ATTEMPTED ON WRITE PROT DISK +BAD_ADDR_MARK EQU 02H ; ADDRESS MARK NOT FOUND +BAD_CMD EQU 01H ; BAD COMMAND PASSED TO DISKETTE I/O + +XRATE EQU 02H ; 250KBS DATA TRANSFER RATE +DUAL EQU 01H ; DUAL ATTACH CARD PRESENT FLAG + +DSK_CHG EQU 080H ; DISKETTE CHANGE FLAG MASK BIT +STATE_MSK EQU 007H ; USED TO STRIP OFF STATE OF MEDIA +REV_STATE EQU 0F8H ; USED AS MASK FOR STATE BITS +DETERMINED EQU 010H ; SET STATE DETERMINED IN STATE BITS +TRAN_MSK EQU 03H ; ISOLATE SHIFTED TRANSFER RATE BITS +DOUBLE_STEP EQU 020H ; MASK TO TURN ON DOUBLE STEPPING +MOTOR_MSK EQU 0F0H ; MASK TO CLEAR MOTOR ON BITS +MAX_DRV EQU 002H ; MAX NUMBER OF DRIVES +;HOME EQU 010H ; TRACK 0 MASK +SENSE_DRV_ST EQU 004H ; SENSE DRIVE STATUS COMMAND +ONE EQU 001H ; SEEK ONE TRACK +TRK_SLAP EQU 030H ; CRASH STOP (48 TPI DRIVES) +QUIET_SEEK EQU 00AH ; SEEK TO TRACK 10 +HD12_SETTLE EQU 015D ; 1.2 M HEAD SETTLE TIME +HD320_SETTLE EQU 020D ; 320 K HEAD SETTLE TIME +WRITE_OP EQU 080H ; WRITE OPERATION FLAG +DD_MASK EQU 010H ; MASK TO INDICATE DRIVE IS 80 TRACKS +PAGE +;------ DISK CHANGE LINE EQUATES +NOCHGLN EQU 001H ; NO DISK CHANGE LINE AVAILABLE +CHGLN EQU 002H ; DISK CHANGE LINE AVAILABLE +;------ MEDIA/DRIVE STATE INDICATORS +M326D326 EQU 093H ; STATE MACHINE - 320/360 MEDIA/DRIVE +M326D12 EQU 074H ; STATE MACHINE - 320/360 MEDIA,1.2DRIVE +M12D12 EQU 015H ; STATE MACHINE - 1.2 MEDIA/DRIVE +POA_DUAL EQU 061H ; 300K DATA TRANSFER RATE & STATE 1 +POA_START EQU 080H ; 250K DATA TRANSFER RATE & STATE 0 +TRK_80 EQU 008H ; DISKETTE DRIVE HAS 80 TRACKS +;------ CMOS NON-VOLATILE RAM EQUATES +CMOSDSB_ADDR EQU 00EH ; DISKETTE STATUS BYTE ADDRESS +CADR_PRT EQU 070H ; CMOS ADDRESS PORT ADDRESS +CDATA_PRT EQU 071H ; CMOS DATA PORT ADDRESS +CMOS_GOOD EQU 0C0H ; BATTERY AND CHECKSUM INDICATOR +CMOSDSK_BYTE EQU 010H ; DISKETTE BYTE ADDRESS +LOWNIB EQU 00FH ; ISOLATE LOW NIBBLE IN REGISTER MASK +INVALID_DRV EQU 002H ; FIRST INVALID DISKETTE TYPE +;---------------------------------------- +; TIMER DATA AREA : +;---------------------------------------- +; COUNTS_SEC EQU 18 +; COUNTS_MIN EQU 1092 +; COUNTS_HOUR EQU 65543 +; COUNTS_DAY EQU 1573040 = 1800B0H +PAGE diff --git a/v4.0/src/INC/PRINTF.ASM b/v4.0/src/INC/PRINTF.ASM new file mode 100644 index 0000000..bc871b4 --- /dev/null +++ b/v4.0/src/INC/PRINTF.ASM @@ -0,0 +1,415 @@ +TITLE PRINTF ROUITNE FOR MS-DOS +; +; PRINTF(Control String, arg1, arg2,...,argn-1,argn) +; +; Characters are output to PFHandle according to the +; specifications contained in the Control String. +; +; The conversion characters are as follow: +; +; %c - output the next argument as a character +; %s - output the next argument as a string +; %x - output the next argument as a hexidecimal number +; using abcedf +; %X - output the next argument as a hexidecimal number +; using ABCDEF +; %d - output the next argument as a decimal number +; +; +; Other format specifiers that may precede the conversion character are: +; +; - (minus sign) - causes the field to be left-adjusted +; + (plus sign) - causes the field to be right-adjusted (default) +; n - digit specifing the minimum field width (default to 1) +; L - specifing a long integer +; +; On entry to PRINTF the stack contains the return address and a pointer +; to an argument list. +; +; ____________________ +; | Ret Addr | <= SP +; -------------------- +; | Ptr to Arg List | +; -------------------- +; +; And the argument list contains the following: +; +; String_ptr (a pointer to the control string) +; Arg 1 +; Arg 2 +; . +; . +; . +; Arg n-1 +; Arg n +; +; If the argument is a %s or %c the arg contains a pointer to the string +; or character. +; +; The arguments are used in one-to-one correspondence to % specifiers. + +.xlist +.xcref + INCLUDE dossym.asm +.cref +.list + +printf_CODE SEGMENT public byte +ASSUME CS:PRINTF_CODE,DS:NOTHING,ES:NOTHING,SS:NOTHING + + PUBLIC PRINTF, PFHandle + PUBLIC PRINTF_LAST + +PFHandle DW 1 +PRINTF_LEFT DB 0 +PRINTF_LONG DB 0 +PRINTF_HEX DB 0 +TABLE_INDEX DB 0 +S_FLAG DB 0 +PRINTF_WIDTH DW 0 +PRINTF_BASE DW 0 +PAD_CHAR DB " " + +PRINTF_TABLE DB "0123456789ABCDEFabcdef" + +PRINTF_STACK STRUC +OLDES DW ? +OLDDS DW ? +OLDSI DW ? +OLDDI DW ? +OLDAX DW ? +OLDBX DW ? +OLDCX DW ? +OLDDX DW ? +OLDBP DW ? +OLDCS DW ? +OLDIP DW ? +STRING DW ? +PRINTF_STACK ENDS + +PRINTF_ARGS STRUC +CONSTR DW ? +ARG DW ? +PRINTF_ARGS ENDS + +RET_ADDR1 DW ? +RET_ADDR2 DW ? + +BUFSIZ = 20 +PRINTF_BUF DB BUFSIZ DUP (?) + db 0 ;This buffer is always nul terminated +BUFEND DW $-PRINTF_BUF + +PRINTF proc far + PUSH BP ;Save the callers' registers + PUSH DX + PUSH CX + PUSH BX + PUSH AX + PUSH DI + PUSH SI + PUSH ES + PUSH DS + MOV BP,SP + PUSH CS + POP ES ;ES points to Printf segment + MOV DI,OFFSET PRINTF_BUF ;DI points to the output buffer + MOV BP,[BP.STRING] ;BP points to the argument list + MOV SI,DS:[BP] ;SI points to the control string + XOR BX,BX ;BX is the index into the arg list + CALL Clear_flags ; initialize the world +GET_CHAR: + LODSB ;Get a character + CMP AL,"%" ;Is it a conversion specifier? + JZ CONV_CHAR ;Yes - find out which one + OR AL,AL ;Is it the end of the control string? + JZ PRINTF_DONE ;Yes - then we're done + CALL OUTCHR ;Otherwise store the character + JMP SHORT GET_CHAR ;And go get another + +PRINTF_DONE: + CALL FLUSH + POP DS + POP ES + POP SI + POP DI + POP AX + POP BX + POP CX + POP DX + POP BP + POP CS:[RET_ADDR1] ;Fix up the stack + POP CS:[RET_ADDR2] + POP AX + PUSH CS:[RET_ADDR2] + PUSH CS:[RET_ADDR1] + RET + +printf endp + +PRINTF_PERCENT: + CALL OUTCHR + JMP GET_CHAR + +CONV_CHAR: + ;Look for any format specifiers preceeding the conversion character + LODSB + CMP AL,"%" ;Just print the % + JZ PRINTF_PERCENT + CMP AL,"-" ;Right justify the field + JZ LEFT_ADJ + CMP AL,"+" ;Left justify the field + JZ NXT_CONV_CHAR + CMP AL,"L" ;Is it a long integer + JZ LONG_INT + CMP AL,"l" + JZ LONG_INT + CMP AL,"0" ;Is it a precision specification + JB LOOK_CONV_CHAR + CMP AL,"9" + JA LOOK_CONV_CHAR + CMP AL,"0" + JNZ NOT_PAD + CMP CS:[PRINTF_WIDTH],0 + JNZ NOT_PAD + MOV CS:BYTE PTR [PAD_CHAR],"0" +NOT_PAD: + PUSH AX ;Adjust decimal place on precision + MOV AX,10 + MUL CS:[PRINTF_WIDTH] + MOV CS:[PRINTF_WIDTH],AX + POP AX + XOR AH,AH + SUB AL,"0" + ADD CS:[PRINTF_WIDTH],AX ;And save the total + JMP SHORT NXT_CONV_CHAR + + ;Set the correct flags for the options in a conversion + +LEFT_ADJ: + INC CS:BYTE PTR[PRINTF_LEFT] + JMP SHORT NXT_CONV_CHAR + +LONG_INT: + INC CS:BYTE PTR[PRINTF_LONG] +NXT_CONV_CHAR: + JMP CONV_CHAR + + ;Look for a conversion character + +LOOK_CONV_CHAR: + CMP AL,"X" + JZ HEX_UP + + ;Make all other conversion characters upper case + + CMP AL,"a" + JB CAPS + CMP AL,"z" + JG CAPS + AND AL,0DFH +CAPS: + CMP AL,"X" + JZ HEX_LO + CMP AL,"D" + JZ DECIMAL + CMP AL,"C" + JZ C_PUT_CHAR + CMP AL,"S" + JZ S_PUT_STRG + + ;Didn't find any legal conversion character - IGNORE it + + call clear_flags + jmp get_char + +HEX_LO: + MOV CS:[TABLE_INDEX],6 ;Will print lower case hex digits +HEX_UP: + MOV CS:[PRINTF_BASE],16 ;Hex conversion + JMP CONV_TO_NUM + +DECIMAL: + MOV CS:[PRINTF_BASE],10 ;Decimal conversion + JMP CONV_TO_NUM + +S_PUT_STRG: + INC CS:[S_FLAG] ;It's a string specifier +C_PUT_CHAR: + PUSH SI ;Save pointer to control string + MOV SI,BX + ADD BX,2 + MOV SI,ds:[BP+SI.ARG] ;Point to the % string or character + CMP BYTE PTR CS:[S_FLAG],0 + JNZ S_PUT_1 + LODSB + cmp al,0 + jz short c_s_end + CALL OUTCHR ;Put it into our buffer + JMP SHORT C_S_END + +S_PUT_1: + mov cx,cs:[printf_width] + or cx,cx + jz s_put_2 + cmp cs:byte ptr[printf_left],0 + jnz s_put_2 + push si + call Pad_string + pop si +s_put_2: + push si +s_put_3: + LODSB ;Put them all in our buffer + CMP AL,0 + jz s_put_4 + CALL OUTCHR + jmp short S_PUT_3 +s_put_4: + pop si + cmp byte ptr[printf_left],0 + jz c_s_end + mov cx,cs:[printf_width] + or cx,cx + jz c_s_end + call Pad_string +C_S_END: + call clear_flags + POP SI ;Restore control string pointer + JMP GET_CHAR ;Go get another character + +pad_string: + xor dx,dx +count_loop: + lodsb + or al,al + jz count_done + inc dx + jmp short count_loop +count_done: + sub cx,dx + jbe count_ret + call pad +count_ret: + ret + +CONV_TO_NUM: + + PUSH SI ;Save pointer to control string + MOV SI,BX ;Get index into argument list + ADD BX,2 ;Increment the index + MOV AX,ds:[BP+SI.ARG] ;Lo word of number in SI + CMP BYTE PTR CS:[PRINTF_LONG],0 ;Is this is a short or long integer? + JZ NOT_LONG_INT + MOV SI,BX ;Copy index + ADD BX,2 ;Increment the index + MOV DX,ds:[BP+SI.ARG] ;Hi word of number in BP + JMP SHORT DO_CONV +NOT_LONG_INT: + XOR DX,DX ;Hi word is zero +DO_CONV: + PUSH BX ;Save index into arguemnt list + MOV si,CS:[PRINTF_BASE] + MOV cx,CS:[PRINTF_WIDTH] + CALL PNUM + CALL PAD +CONV_DONE: + call clear_flags + POP BX + POP SI + jmp get_char + +PNUM: + DEC CX + PUSH AX + MOV AX,DX + XOR DX,DX + DIV SI + MOV BX,AX + POP AX + DIV SI + XCHG BX,DX + PUSH AX + OR AX,DX + POP AX + JZ DO_PAD + PUSH BX + CALL PNUM + POP BX + JMP SHORT REM +DO_PAD: + CMP CS:BYTE PTR[PRINTF_LEFT],0 + JNZ REM + CALL PAD +REM: + MOV AX,BX + CMP AL,10 + JB NOT_HEX + CMP CS:BYTE PTR [PRINTF_HEX],0 + JNZ NOT_HEX + ADD AL,CS:BYTE PTR [TABLE_INDEX] +NOT_HEX: + MOV BX,OFFSET PRINTF_TABLE + PUSH DS + PUSH CS + POP DS + XLAT 0 + POP DS + push cx + CALL OUTCHR + pop cx + RET + +PAD: + OR CX,CX + JLE PAD_DONE + MOV AL,CS:BYTE PTR [PAD_CHAR] +PAD_LOOP: + push cx + CALL OUTCHR + pop cx + LOOP PAD_LOOP +PAD_DONE: + RET + +OUTCHR: + STOSB + CMP DI,offset bufend-1 ;Don't count the nul + RETNZ + MOV CX,BUFSIZ +WRITE_CHARS: + push bx + MOV BX,PFHandle + push ds + PUSH CS + POP DS + MOV DX,OFFSET PRINTF_BUF + MOV AH,WRITE + INT 21H + pop ds + pop bx + MOV DI,OFFSET PRINTF_BUF + RET + +FLUSH: + CMP DI,OFFSET PRINTF_BUF + RETZ + SUB DI,OFFSET PRINTF_BUF + MOV CX,DI + call write_chars + ret + +CLEAR_FLAGS: + XOR ax,ax + MOV BYTE PTR CS:[PRINTF_LEFT],al ;Reset justifing flag + MOV BYTE PTR CS:[PRINTF_LONG],al ;Reset long flag + MOV BYTE PTR CS:[TABLE_INDEX],al ;Reset hex table index + MOV CS:[PRINTF_WIDTH],ax ;Reinitialize width to 0 + MOV BYTE PTR CS:[PAD_CHAR]," " ;Reset padding character + MOV BYTE PTR CS:[S_FLAG],al ;Clear the string flag + ret + +PRINTF_LAST LABEL WORD +printf_CODE ENDS + END + \ No newline at end of file diff --git a/v4.0/src/INC/PRINTF.OBJ b/v4.0/src/INC/PRINTF.OBJ new file mode 100644 index 0000000..2672351 Binary files /dev/null and b/v4.0/src/INC/PRINTF.OBJ differ diff --git a/v4.0/src/INC/PSDATA.INC b/v4.0/src/INC/PSDATA.INC new file mode 100644 index 0000000..7ce8896 --- /dev/null +++ b/v4.0/src/INC/PSDATA.INC @@ -0,0 +1,504 @@ +;******************************************************************* +; Parser include file +;******************************************************************* +IF1 ;AN000; + %OUT INCLUDING COMP=COMMON DSN=PSDATA.INC...;AN000; +ENDIF ;AN000; +; +;**** Default assemble switches definition ************************* + +IFNDEF FarSW ;AN000; +FarSW equ 0 ;AN000; Near call expected +ENDIF ;AN000; + +IFNDEF DateSW ;AN000; +DateSW equ 1 ;AN000; Check date format +ENDIF ;AN000; + +IFNDEF TimeSW ;AN000; +TimeSW equ 1 ;AN000; Check time format +ENDIF ;AN000; + +IFNDEF FileSW ;AN000; +FileSW equ 1 ;AN000; Check file specification +ENDIF ;AN000; + +IFNDEF CAPSW ;AN000; +CAPSW equ 1 ;AN000; Perform CAPS if specified +ENDIF ;AN000; + +IFNDEF CmpxSW ;AN000; +CmpxSW equ 1 ;AN000; Check complex list +ENDIF ;AN000; + +IFNDEF NumSW ;AN000; +NumSW equ 1 ;AN000; Check numeric value +ENDIF ;AN000; + +IFNDEF KeySW ;AN000; +KeySW equ 1 ;AN000; Support keywords +ENDIF ;AN000; + +IFNDEF SwSW ;AN000; +SwSW equ 1 ;AN000; Support switches +ENDIF ;AN000; + +IFNDEF Val1SW ;AN000; +Val1SW equ 1 ;AN000; Support value definition 1 +ENDIF ;AN000; + +IFNDEF Val2SW ;AN000; +Val2SW equ 1 ;AN000; Support value definition 2 +ENDIF ;AN000; + +IFNDEF Val3SW ;AN000; +Val3SW equ 1 ;AN000; Support value definition 3 +ENDIF ;AN000; + +IFNDEF DrvSW ;AN000; +DrvSW equ 1 ;AN000; Support drive only format +ENDIF ;AN000; + +IFNDEF QusSW ;AN000; +QusSW equ 1 ;AN000; Support quoted string format +ENDIF ;AN000; + +IFNDEF LFEOLSW ;AN028; +LFEOLSW EQU 1 ;AN028; Accept Line feed (0AH) as end of line +ENDIF ;AN028; + +;**** Equation field +;-------- Character code definition + +$P_DBSP1 equ 81h ;AN000; 1st byte of DBCS blank +$P_DBSP2 equ 40h ;AN000; 2nd byte of DBCS blank +$P_Period equ "." ;AN020; +$P_Slash equ "/" ;AN020; +$P_Space equ " " ;AN000; SBCS blank +$P_Comma equ "," ;AN000; +$P_Switch equ "/" ;AN000; +$P_Keyword equ "=" ;AN000; +$P_Colon equ ":" ;AN000; +$P_Plus equ "+" ;AN000; +$P_Minus equ "-" ;AN000; +$P_Rparen equ ")" ;AN000; +$P_Lparen equ "(" ;AN000; +;(deleted ;AN025;) $P_SQuote equ "'" +$P_DQuote equ '"' ;AN000; +$P_NULL equ 0 ;AN000; +$P_TAB equ 9 ;AN000; +$P_CR equ 0Dh ;AN000; +$P_LF equ 0Ah ;AN000; +$P_ASCII80 equ 80h ;AN000; ASCII 80h character code + +;-------- Masks +$P_Make_Lower equ 20h ;AN000; make lower case character +$P_Make_Upper equ 0ffh-$P_Make_Lower ;AN000; make upper case character + + PAGE ;AN000; +;-------- DOS function call related equs + +$P_DOS_Get_CDI equ 3800h ;AN000; get country dependent information + ; by this call, following information +$P_CDI struc ;AN000; is returned. +$P_CDI_DateF dw 0 ;AN000; +$P_CDI_Money db 0,0,0,0,0 ;AN000; +$P_CDI_1000 db 0,0 ;AN000; +$P_CDI_Dec db 0,0 ;AN000; +$P_CDI_DateS db 0,0 ;AN000; +$P_CDI_TimeS db 0,0 ;AN000; + db 0 ;AN000; + db 0 ;AN000; +$P_CDI_TimeF db 0 ;AN000; + dw 0,0 ;AN000; + db 0,0 ;AN000; + dw 5 dup(0) ;AN000; +$P_CDI ends ;AN000; + +$P_Date_MDY equ 0 ;AN000; +$P_Date_DMY equ 1 ;AN000; +$P_Date_YMD equ 2 ;AN000; +;------------- +$P_DOS_GetEV equ 6300h ;AN000; get DBCS EV call + ;AN000; DS:SI will points to DBCS EV +;------------- +$P_DOS_Get_TBL equ 65h ;AN000; get uppercase table call + ;AN000; following parameters are set + ;AN000; to get casemap table. +$P_DOSTBL_Def equ -1 ;AN000; get default +$P_DOSTBL_BL equ 5 ;AN000; buffer length for Tbl pointer +$P_DOSTBL_File equ 4 ;AN000; get file uppercase table +$P_DOSTBL_Char equ 2 ;AN000; get character uppercase table + ; By this call following information + ; is returned. +$P_DOS_TBL struc ;AN000; +$P_DOS_InfoID db 0 ;AN000; information id for the table +$P_DOS_TBL_Off dw 0 ;AN000; offset address of the table +$P_DOS_TBL_Seg dw 0 ;AN000; segment address of the table +$P_DOS_TBL ends ;AN000; + PAGE ;AN000; +;--------------------------------------------------------------------------------------------------------- +; PARMS LABEL BYTE +; DW PARMSX +; DB 2 ; NUMBER OF STRINGS (0, 1, 2) +; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE +; DB " .. " ; EXTRA DELIMITER LIST, +; ; TYPICAL ARE ";", "=" +; ; "," & WHITESPACE ALWAYS +; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE +; DB " .. " ; EXTRA END OF LINE LIST, CR, LF OR 0 ALWAYS +;--------------------------------------------------------------------------------------------------------- + +;-------------------------------- PARMS block structure +$P_PARMS_Blk struc ;AN000; +$P_PARMSX_Address dw 0 ;AN000; Address of PARMSX +$P_Num_Extra db 0 ;AN000; Number of extra stuff +$P_Len_Extra_Delim db 0 ;AN000; Length of extra delimiter +$P_PARMS_Blk ends ;AN000; + +$P_Len_PARMS equ 4 ;AN000; +$P_I_Use_Default equ 0 ;AN000; no extra stuff specified +$P_I_Have_Delim equ 1 ;AN000; extra delimiter specified +$P_I_Have_EOL equ 2 ;AN000; extra EOL specified + +;--------------------------------------------------------------------------------------------------------- +; PARMSX LABEL BYTE +; DB minp,maxp ; MIN, MAX POSITIONAL OPERANDS ALLOWED +; DW CONTROL ; DESCRIPTION OF POSITIONAL 1 +; : ; REPEATS maxp-1 TIMES +; DB maxs ; # OF SWITCHES +; DW CONTROL ; DESCRIPTION OF SWITCH 1 +; : ; REPEATS maxs-1 TIMES +; DB maxk ; # OF KEYWORD +; DW CONTROL ; DESCRIPTION OF KEYWORD 1 +; : ; REPEATS maxk-1 TIMES +;--------------------------------------------------------------------------------------------------------- + +;-------------------------------- PARMSX block structure +$P_PARMSX_Blk struc ;AN000; +$P_MinP db 0 ;AN000; Minimum positional number +$P_Maxp db 0 ;AN000; Maximum positional number +$P_1st_Control dw 0 ;AN000; Address of the 1st CONTROL block +$P_PARMSX_Blk ends ;AN000; + PAGE ;AN000; +;--------------------------------------------------------------------------------------------------------- +; << Control field definition >> +; +; +;CONTROL LABEL BYTE +; DW MATCH_FLAGS ; CONTROLS TYPE MATCHED +; ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED) +; ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE CHECKED) +; ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED) +; ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED) +; ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED) +; ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED) +; ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED) +; ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED) +; ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED) +; ; 0010H=IGNORE ":" AT END IN MATCH +; ; 0002H=REPEATS ALLOWED +; ; 0001H=OPTIONAL +; DW FUNCTION_FLAGS +; ; 0001H=CAP RESULT BY FILE TABLE +; ; 0002H=CAP RESULT BY CHAR TABLE +; ; 0010H=REMOVE ":" AT END +; (tm10) ; 0020H=colon is not necessary for switch +; DW RESULT ; RESULT BUFFER +; DW VALUES ; VALUE LISTS +; DB nid ; NUMBER OF KEYWORD/SWITCH SYNONYMS IN FOLLOWING LIST +; DB "...",0 ; IF n >0, KEYWORD 1 +; : +; +;Note: +; - The MATCH_FLAG is bit significant. You can set, for example, TIME bit and +; DATE bit simalteniously. +; +; The parser examins each bit along with the following priority. +; +; COMPLEX -> DATE -> TIME -> NUMERIC VAL -> SIGNED NUMERIC VAL -> DRIVE -> +; FILE SPEC -> SIMPLE STRING. +; +; +; - When the FUNCTION_FLAG is 0001 or 0002, the STRING pointed to by a pointer +; in the result buffer is capitalized. +; +; - Match_Flags 0001H and 0002H have meaning only for the positional. +; +; +; - The "...",0 (bottom most line) does require '=' or '/'. When you need a +; switch, for example, '/A', then STRING points to; +; +; DB 1 ; number of following synonyms +; DB '/A',0 +; +; When you need a keyword, for example, 'CODEPAGE=', then "...",0 will be; +; +; DB 1 ; number of following synonyms +; DB 'CODEPAGE=',0 +; +; +; - "..." must consist of upper case characters only because the parser +; performs pattern matching after converting input to upper case (by +; using the current country upper case table) +; +; +; - One "..." can contain only one switch or keyword. If you need, for +; example /A and /B, the format will be; +; +; DB 2 ; number of following synonyms +; DB '/A',0 +; DB '/B',0 +;--------------------------------------------------------------------------------------------------------- + +;**** Match_Flags + +$P_Num_Val equ 8000h ;AN000; Numeric Value +$P_SNum_Val equ 4000h ;AN000; Signed numeric value +$P_Simple_S equ 2000h ;AN000; Simple string +$P_Date_S equ 1000h ;AN000; Date string +$P_Time_S equ 0800h ;AN000; Time string +$P_Cmpx_S equ 0400h ;AN000; Complex string +$P_File_Spc equ 0200h ;AN000; File Spec +$P_Drv_Only equ 0100h ;AN000; Drive Only +$P_Qu_String equ 0080h ;AN000; Quoted string +$P_Ig_Colon equ 0010h ;AN000; Ignore colon at end in match +$P_Repeat equ 0002h ;AN000; Repeat allowed +$P_Optional equ 0001h ;AN000; Optional + +;**** Function flags + +$P_CAP_File equ 0001h ;AN000; CAP result by file table +$P_CAP_Char equ 0002h ;AN000; CAP result by character table +$P_Rm_Colon equ 0010h ;AN000; Remove ":" at the end +$P_colon_is_not_necessary equ 0020h ;AN000;(tm10) /+10 and /+:10 + +;-------------------------------- Control block structure +$P_Control_Blk struc ;AN000; +$P_Match_Flag dw 0 ;AN000; Controls type matched +$P_Function_Flag dw 0 ;AN000; Function should be taken +$P_Result_Buf dw 0 ;AN000; Result buffer address +$P_Value_List dw 0 ;AN000; Value list address +$P_nid db 0 ;AN000; # of keyword/SW synonyms +$P_KeyorSW db 0 ;AN000; keyword or sw +$P_Control_Blk ends ;AN000; + PAGE ;AN000; +;--------------------------------------------------------------------------------------------------------- +; << Value List Definition >> +; +;VALUES LABEL BYTE +; DB nval ; NUMBER OF VALUE DEFINITIONS (0 - 3) +; Ú +; ³ DB nrng ; NUMBER OF RANGES +; ³ ÚDB ITEM_TAG ; RETURN VALUE IF RANGE MATCHED +; ³ ÀDD X,Y ; RANGE OF VALUES +; ³ : +; ³ DB nnval ; NUMBER OF CHOICES +; ³ ÚDB ITEM_TAG ; RETURN VALUE IF NUMBER CHOICE MATCHED +; ³ ÀDD VALUE ; SPECIFIC CHOICE IF NUMBER +; ³ : +; ³ DB nstrval ; NUMBER OF CHOICES +; ³ ÚDB ITEM_TAG ; RETURN VALUE IF STRING CHOICE MATCHED +; ³ ÀDW STRING ; SPECIFIC CHOICE IF STING +; À : +; +;STRING DB "...",0 ; ASCIIZ STRING IMAGE +; +;Note: +; - ITEM_TAG must not be 0FFH, which will be used in the result buffer +; when no choice lists are provided. +; +; - STRING must consist of upper case characters only because the parser +; performs pattern matching after converting input to upper case (by +; using the current country upper case table) +;--------------------------------------------------------------------------------------------------------- + +$P_nval_None equ 0 ;AN000; no value list ID +$P_nval_Range equ 1 ;AN000; range list ID +$P_nval_Value equ 2 ;AN000; value list ID +$P_nval_String equ 3 ;AN000; string list ID +$P_Len_Range equ 9 ;AN000; Length of a range choice(two DD plus one DB) +$P_Len_Value equ 5 ;AN000; Length of a value choice(one DD plus one DB) +$P_Len_String equ 3 ;AN000; Length of a string choice(one DW plus one DB) +$P_No_nrng equ 0 ;AN000; (tm07) no nrng. nnval must not be 0. + +$P_Val_List struc ;AN000; +$P_NumofList db 0 ;AN000; number of following choice +$P_Val_XL dw 0 ;AN000; lower word of value +$P_Val_XH dw 0 ;AN000; higher word of value +$P_Val_YL dw 0 ;AN000; lower word of another value +$P_Val_YH dw 0 ;AN000; higher word of another value +$P_Val_List ends ;AN000; + PAGE ;AN000; +;--------------------------------------------------------------------------------------------------------- +; << Result Buffer Definition >> +; +;RESULT LABEL BYTE ; BELOW FILLED IN FOR DEFAULTS +; DB type ; TYPE RETURNED: 0=RESERVED, +; ; 1=NUMBER, 2=LIST INDEX, +; ; 3=STRING, 4=COMPLEX, +; ; 5=FILESPEC, 6=DRIVE +; ; 7=DATE, 8=TIME +; ; 9=QUOTED STRING +; DB ITEM_TAG ; MATCHED ITEM TAG +; +; dw synonym@ ; es:@ points to found SYNONYM if provided. +; +; +; Ú DD n ; VALUE IF NUMBER +; ³ or +; ³ DW i ; INDEX (OFFSET) INTO VALUE LIST +; ³ ; (ES presents Segment address) +; ³ or +; ³ DD STRING ; OFFSET OF STRING VALUE +; ³ or +; ³ DB drv ; DRIVE NUMBER (1-A, 2-B,..., 26-Z) +; ³ or +; ³ DW YEAR ;(1980-2099) IN CASE OF DATE +; ³ DB MONTH ;(1-12) Note: Range check is not performed. +; ³ DB DATE ;(1-31) 0 is filled when the corresponding field was not specified. +; ³ or +; ³ DB HOUR ;(0-23) IN CASE OF TIME +; ³ DB MINUTES ;(0-59) Note: Range check is not performed . +; ³ DB SECONDS ;(0-59) 0 is filled when the corresponding field was not specified . +; ³ DB HUNDREDTHS ;(0-99) +; À +; +; +;Note: ITEM_TAG is 0FFH when the caller does not specify the choice +; list. +; +; YEAR: If the input value for the year is less than 100, parser +; adds 1900 to it. For example, when 87 is input to parser for +; the year value, he returns 1987. +;--------------------------------------------------------------------------------------------------------- + +;-------------------------------- Result block structure +$P_Result_Blk struc ;AN000; +$P_Type db 0 ;AN000; Type returned +$P_Item_Tag db 0 ;AN000; Matched item tag +$P_SYNONYM_Ptr dw 0 ;AN000; pointer to Synonym list returned +$P_Picked_Val db 0,0,0,0 ;AN000; value +$P_Result_Blk ends ;AN000; +;-------------------------------- +;**** values for the type field in the result block + +$P_EOL equ 0 ;AN000; End of line +$P_Number equ 1 ;AN000; Number +$P_List_Idx equ 2 ;AN000; List Index +$P_String equ 3 ;AN000; String +$P_Complex equ 4 ;AN000; Complex +$P_File_Spec equ 5 ;AN000; File Spec +$P_Drive equ 6 ;AN000; Drive +$P_Date_F equ 7 ;AN000; Date +$P_Time_F equ 8 ;AN000; Time +$P_Quoted_String equ 9 ;AN000; Quoted String + +$P_No_Tag equ 0FFH ;AN000; No ITEM_TAG found +;**** Return code +; +; following return code will be returned in the AX register. + +$P_No_Error equ 0 ;AN000; No error +$P_Too_Many equ 1 ;AN000; Too many operands +$P_Op_Missing equ 2 ;AN000; Required operand missing +$P_Not_In_SW equ 3 ;AN000; Not in switch list provided +$P_Not_In_Key equ 4 ;AN000; Not in keyword list provided +$P_Out_Of_Range equ 6 ;AN000; Out of range specified +$P_Not_In_Val equ 7 ;AN000; Not in value list provided +$P_Not_In_Str equ 8 ;AN000; Not in string list provided +$P_Syntax equ 9 ;AN000; Syntax error +$P_RC_EOL equ -1 ;AN000; End of command line + + PAGE ;AN000; +;********************** Local Data ************************************* +$P_ORDINAL dw 0 ;AN000; Operand ordinal save area +$P_RC dw 0 ;AN000; Return code from parser +$P_SI_Save dw 0 ;AN000; Pointer of command buffer +$P_DX dw 0 ;AN000; Return result buffer address +$P_Terminator db 0 ;AN000; Terminator code (ASCII) +$P_DBCSEV_OFF dw 0 ;AN000; Offset of DBCS EV +$P_DBCSEV_SEG dw 0 ;AN000; Segment of DBCS EV +$P_Flags dw 0 ;AN000; Parser internal flags +$P_Flags1 equ byte ptr $P_Flags ;AN038; to reference first byte flags +$P_Flags2 equ byte ptr $P_Flags+1 ;AN038; to reference second byte flags only + +;in second byte of $P_Flags, referenced as $P_Flags2: +$P_equ equ 01h ;AN000; "=" packed in string buffet +$P_Neg equ 02h ;AN000; Negative value +$P_Time12 equ 04h ;AN000; set when PM is specified +$P_Key_Cmp equ 08h ;AN000; set when keyword compare +$P_SW_Cmp equ 10h ;AN000; set when switch compare +$P_Extra equ 20h ;AN000; set when extra delimiter found +$P_SW equ 40h ;AN000; set when switch found (tm08) +$P_Signed equ 80h ;AN000; signed numeric specified + +;in first byte of $P_Flags, referenced as $P_Flags1: +$P_time12am equ 01h ;AN038; set when AM is specified on time +$P_TIME_AGAIN EQU 02H ;AN039; SET WHEN READY TO RE-PARSE TIME + +$P_SaveSI_Cmpx dw 0 ;AN000; save si for later use by complex +$P_KEYorSW_Ptr dw 0 ;AN000; points next to "=" or ":" code +$P_Save_EOB dw 0 ;AN000; save pointer to EOB +$P_Found_SYNONYM dw 0 ;AN000; es:@ points to found synonym + +$P_STRING_BUF db 128 dup(0) ;AN000; Pick a operand from command line +$P_STRING_BUF_END equ $ ;AN000; +IF TimeSw ;AN039; For TIME only +$P_ORIG_ORD DW 0 ;AN039; ORIGINAL ORDINAL FROM CX +$P_ORIG_STACK DW 0 ;AN039; ORIGINAL VALUE OF STACK FROM SP +$P_ORIG_SI DW 0 ;AN039; ORIGINAL START PARSE POINTER FROM SI +ENDIF ;AN039; +IF DateSw+TimeSw ;AN000;(Check if date or time format is supported) +;------------------------------ +; +$P_Got_Time db 0 ;AN023; if 1, use Time delimiters +$P_NeedToBeRead equ 0ffffh ;AN000; + +$P_COUNTRY_INFO $P_CDI <$P_NeedToBeRead> ;AN000; +; +$P_1st_Val dw 0 ;AN000; used when process date or time +$P_2nd_Val dw 0 ;AN000; used when process date or time +$P_3rd_Val dw 0 ;AN000; used when process date or time +$P_4th_Val dw 0 ;AN000; used when process date or time +;------------------------------ +ENDIF ;AN000;(of DateSW+TimeSW) +$P_Char_CAP_Ptr db 0ffh ;AN000; info id + dw 0 ;AN000; offset of char case map table + dw 0 ;AN000; segment of char case map table +IF CAPSW ;AN000;(Check if uppercase conversion is supported) +$P_File_CAP_Ptr db 0ffh ;AN000; info id + dw 0 ;AN000; offset of file case map table + dw 0 ;AN000; segment of file case map table +ENDIF ;AN000;(of CAPSW) +; (tm06) IF FileSW ;AN000;(Check if file spec is supported) +IF FileSW+DrvSW ;AN000;(Check if file spec is supported) +$P_FileSp_Char db '[]|<>+=;"' ;AN000; delimitter of file spec +$P_FileSp_Len equ $-$P_FileSp_Char ;AN000; +ENDIF ;AN000;(of FileSW) +; (tm05) IF QusSW ;AN000;(Check if quoted string is supported) +;(deleted ;AN025;) IF QusSW+CmpxSW ; (tm05) ;AN000;(Check if quoted string is supported) +;(deleted ;AN025;) $P_SorD_Quote db 0 ;AN000; keep double or single quote +;(deleted ;AN025;) ENDIF ;AN000;(of QueSW) +IF KeySW ;AN029; if keywords supported +$P_count_to_eol dw 0 ;AN029; count of chars not including EOL +; REGISTER EQUATES - SPECIAL USAGE FOR REGISTERS +$P_REG_BH_CG_SW EQU BH ;AN029;0="NO CHANGES MADE", FF=CHANGES MADE +$P_REG_BL_DQ_SW EQU BL ;AN029;0=NOT IN QUOTES,FF=IN QUOTES + +$P_DOUBLE_QUOTE EQU """" ;AN029; +$P_BL_EQ EQU " =" ;AN029; +$P_EQ_BL EQU "= " ;AN029; +$P_TB_EQ EQU 093DH ;AN029; ;"=" +$P_EQ_TB EQU 3D09H ;AN029; ;"=" +ENDIF ;AN029; IF KeySW Supported + +; delimiter parsing +$P_colon_period equ 01 ;AN032; check for colon & period +$P_period_only equ 02 ;AN032; check only for period + +;filespec error flag +$P_err_flag db 00 ;AN033; flag set if filespec parsing error + ;AN033; was detected. +$P_error_filespec equ 01 ;AN033; mask to set flag +;*********************************************************************** diff --git a/v4.0/src/INC/REDIRSYM.INC b/v4.0/src/INC/REDIRSYM.INC new file mode 100644 index 0000000..88bf209 --- /dev/null +++ b/v4.0/src/INC/REDIRSYM.INC @@ -0,0 +1,174 @@ +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Redirector MACROS +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +EDW MACRO name + extrn name:near + DW OFFSET RG:name +ENDM + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +CHECK_DIALECT MACRO name + + IF2 ;AN000; If not defined yet, + IFNDEF CHECKDIALECT ;AN000; THEN Extrn + Extrn CHECKDIALECT&name:NEAR ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + CALL CHECKDIALECT&name ;AN000; Call the appropriate routine + +ENDM + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +CallREDIRSub MACRO name,fn,save,restore ;AN000; + IF2 ;AN000; If not defined yet, + IFNDEF REDIRSub&fn ;AN000; THEN Extrn + Extrn REDIRSub&fn:NEAR ;AN000; + ENDIF ;AN000; + ENDIF ;AN000; + IFNB ;AN000; If not blank + SaveReg ;AN000; Save the regs + ENDIF ;AN000; + CALL REDIRSub&fn ;AN000; Call the appropriate routine + IFNB ;AN000; If not blank + RestoreReg ;AN000; Save the regs + ENDIF ;AN000; +ENDM ;AN000; + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Redirector structures +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + INCLUDE IFSSYM.INC ;AN000; + INCLUDE ERROR.INC ;AN000; + INCLUDE FILEMODE.INC ;AN000; + +;; CD_FSDA STRUCTURE + + CD_FSDA_OFF EQU WORD PTR CD_FSDA ;AN000; + CD_FSDA_SEG EQU WORD PTR CD_FSDA+2 ;AN000; + CD_FSDA_FLAGS EQU WORD PTR CD_FSDA+4 ;AN000; + +;; DFL_FSDA STRUCTURE + + DF_FSDA_OFF EQU WORD PTR DFL_FSDA ;AN000; + DF_FSDA_SEG EQU WORD PTR DFL_FSDA+2 ;AN000; + DF_FSDA_FLAGS EQU WORD PTR DFL_FSDA+4 ;AN000; + +;; SFF_FSDA STRUCTURE + + SFF_FSDA_OFF EQU WORD PTR SFF_FSDA ;AN000; + SFF_FSDA_SEG EQU WORD PTR SFF_FSDA+2 ;AN000; + SFF_FSDA_FLAGS EQU WORD PTR SFF_FSDA+4 ;AN000; + +;; IFS Structure fixes + + ifsr_fcn_def EXECAPI ;AN000; + ifsr_api_def OPENFILE ;AN000; +IFSR_OPENNAME@ = IFSR_NAME@ ;AN000; + ifsr_api_def SEARCHFILE ;AN000; +IFSR_SRCHNAME@ = IFSR_NAME@ ;AN000; + ifsr_api_def MKDIR ;AN000; +IFSR_DIRNAME@ = IFSR_NAME@ ;AN000; + ifsr_api_def DELFILE ;AN000; +IFSR_DELNAME@ = IFSR_NAME@ ;AN000; + ifsr_api_def FILEATTR ;AN000; +IFSR_ATTRNAME@ = IFSR_NAME@ ;AN000; + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Redirector Equates +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +Get_Interrupt_Vector EQU 35H ;AN000; +Set_Interrupt_Vector EQU 25H ;AN000; +Deallocate_memory EQU 49H ;AN000; + +GET_SYS_CONFIG EQU 0C000H ;AN000; INT 15H to get configuration +CONFIG_STRUC STRUC ;AN001; + LENGTH DW ? ;AN001; + MODEL_BYTE DB ? ;AN001; +CONFIG_STRUC ENDS ;AN001; + +LOWEST_386_MODEL EQU 0F8H ;AN001; + +INCOR_DOS EQU 1 ;AN000; +ALREADY_INST EQU 2 ;AN000; +NOT_INST EQU 3 ;AN000; +NET_NOT_STARTED EQU 4 ;AN000; +INSUFF_MEM EQU 5 ;AN000; +BAD_PARM EQU 10 ;AN000; +INSUFFICENT_MEM EQU 76 ;AN001; Extended Error + +ONE_REPLACE EQU 1 ;AN000; +SINGLE_COUNT EQU 1 ;AN000; +TESTDIALECT = 0 ;AN001; + +REDIR_INSTALLED EQU -1 ;AN000; +REDIR_SYS_INSTALL EQU 0BF80H ;AN000; REDIR.SYS 2FH Function number +REDIR_EXE_INSTALL EQU 0BF00H ;AN000; REDIR.EXE 2FH Function number + +FASSIGN_ON EQU -1 ;AN000; +FASSIGN_OFF EQU 0 ;AN000; +FPRINT_ON EQU -1 ;AN000; +FPRINT_OFF EQU 0 ;AN000; + +EXT_ERR_72 EQU 72 ;AN000; +PSP_ENVIRO_SEG EQU 002CH ;AN000; Offset into the PSP of the Enviroment Segment + +PrnIO EQU 17H ; Int vector for Printer IO +PrntScr EQU 05H ; Int vector for Print Screen +PrnRdrMark EQU 2 ; Mark for port addr + +VER12 EQU 00000010b ;AN001; +VER13 EQU 00000100b ;AN001; + +FIRST_TIME EQU 1 ;AN001; +SECOND_TIME EQU 2 ;AN001; + +SHIFT_BY_7 EQU 7 ;AN001; + +HI_BIT_SHARING_MASK EQU 1111111101111111b ;AN001; Turns off Hi bit in nibble + + +;; ############################################################### +;; MISC.INC +;; ############################################################### + +; NETFILE + +attr_read_only = 00000001b + +; NETINIT + +IFSR_INVALID_CMD = -1 ;AN000; + +; NETUTIL + +MACRO_4 = 4 +DATE_TIME = 0 + + +; NETHAND + +LOCK_ALL_OPERS = 0 +POS_LEN_PTR_SIZE = 8 ;AN001; 8 bytes for position/length + +FIND_BUF STRUC + +find_buf_drive DB ? ; drive of search +find_buf_name DB 11 DUP (?) ; formatted name +find_buf_sattr DB ? ; attribute of search +find_buf_LastEnt DW ? ; LastEnt +find_buf_DirStart DW ? ; DirStart +find_buf_NetID DB 4 DUP (?) ; Reserved for NET +find_buf_attr DB ? ; attribute found +find_buf_time DW ? ; time +find_buf_date DW ? ; date +find_buf_size_l DW ? ; low(size) +find_buf_size_h DW ? ; high(size) +find_buf_pname DB 13 DUP (?) ; packed name + +FIND_BUF ENDS + diff --git a/v4.0/src/INC/SF.INC b/v4.0/src/INC/SF.INC new file mode 100644 index 0000000..dd6f188 --- /dev/null +++ b/v4.0/src/INC/SF.INC @@ -0,0 +1,168 @@ +; SCCSID = @(#)sf.asm 1.1 85/04/10 +BREAK +; +; AN000 version 4.00 Jan. 1988 +; AN003 PTM 3680 -- make NAME offset the same as before (<=3.30) +; AN009 PTM 3839 reorder SFT for MS WINDOWS + +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +; +; system file table +; + +SF STRUC +SFLink DD ? +SFCount DW ? ; number of entries +SFTable DW ? ; beginning of array of the following +SF ENDS + +; +; system file table entry +; + +sf_entry STRUC +sf_ref_count DW ? ; number of processes sharing entry + ; if FCB then ref count +sf_mode DW ? ; mode of access or high bit on if FCB +sf_attr DB ? ; attribute of file +sf_flags DW ? ;Bits 8-15 + ; Bit 15 = 1 if remote file + ; = 0 if local file or device + ; Bit 14 = 1 if date/time is not to be + ; set from clock at CLOSE. Set by + ; FILETIMES and FCB_CLOSE. Reset by + ; other reseters of the dirty bit + ; (WRITE) + ; Bit 13 = Pipe bit (reserved) + ; + ; Bits 0-7 (old FCB_devid bits) + ; If remote file or local file, bit + ; 6=0 if dirty Device ID number, bits + ; 0-5 if local file. + ; bit 7=0 for local file, bit 7 + ; =1 for local I/O device + ; If local I/O device, bit 6=0 if EOF (input) + ; Bit 5=1 if Raw mode + ; Bit 0=1 if console input device + ; Bit 1=1 if console output device + ; Bit 2=1 if null device + ; Bit 3=1 if clock device +sf_devptr DD ? ; Points to DPB if local file, points + ; to device header if local device, + ; points to net device header if + ; remote +sf_firclus DW ? ; First cluster of file (bit 15 = 0) +sf_time DW ? ; Time associated with file +sf_date DW ? ; Date associated with file +sf_size DD ? ; Size associated with file +sf_position DD ? ; Read/Write pointer or LRU count for FCBs +; +; Starting here, the next 7 bytes may be used by the file system to store an +; ID +; +sf_cluspos DW ? ; Position of last cluster accessed +sf_dirsec DD ? ; Sector number of directory sector for + ; for this file +sf_dirpos DB ? ; Offset of this entry in the above +; +; End of 7 bytes of file-system specific info. +; +sf_name DB 11 DUP (?) ; 11 character name that is in the + ; directory entry. This is used by + ; close to detect file deleted and + ; disk changed errors. + +; SHARING INFO +sf_chain DD ? ; link to next SF +sf_UID DW ? +sf_PID DW ? +sf_MFT DW ? +sf_lstclus DW ? ;AN009; Last cluster accessed +sf_IFS_HDR DD ? +sf_entry ENDS + +sf_fsda EQU BYTE PTR sf_cluspos ;DOS 4.00 +sf_serial_ID EQU WORD PTR sf_firclus ;DOS 4.00 +sf_netid EQU BYTE PTR sf_cluspos +sf_OpenAge EQU WORD PTR sf_position+2 +sf_LRU EQU WORD PTR sf_position + +sf_default_number EQU 5h + +; +; Note that we need to mark an SFT as being busy for OPEN/CREATE. This is +; because an INT 24 may prevent us from 'freeing' it. We mark this as such +; by placing a -1 in the ref_count field. +; + +sf_busy EQU -1 + + +; mode mask for FCB detection +sf_isfcb EQU 1000000000000000B + +; Flag word masks +sf_isnet EQU 1000000000000000B +sf_close_nodate EQU 0100000000000000B +sf_pipe EQU 0010000000000000B +sf_no_inherit EQU 0001000000000000B +sf_net_spool EQU 0000100000000000B +Handle_Fail_I24 EQU 0000000100000000B ;BIT 8 - DISK FULL I24 ERROR + +; Local file/device flag masks +devid_file_clean EQU 40h ; true if file and not written +devid_file_mask_drive EQU 3Fh ; mask for drive number + +devid_device EQU 80h ; true if a device +devid_device_EOF EQU 40h ; true if end of file reached +devid_device_raw EQU 20h ; true if in raw mode +devid_device_special EQU 10h ; true if special device +devid_device_clock EQU 08h ; true if clock device +devid_device_null EQU 04h ; true if null device +devid_device_con_out EQU 02h ; true if console output +devid_device_con_in EQU 01h ; true if consle input +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + +; +; structure of devid field as returned by IOCTL is: +; +; BIT 7 6 5 4 3 2 1 0 +; |---|---|---|---|---|---|---|---| +; | I | E | R | S | I | I | I | I | +; | S | O | A | P | S | S | S | S | +; | D | F | W | E | C | N | C | C | +; | E | | | C | L | U | O | I | +; | V | | | L | K | L | T | N | +; |---|---|---|---|---|---|---|---| +; ISDEV = 1 if this channel is a device +; = 0 if this channel is a disk file +; +; If ISDEV = 1 +; +; EOF = 0 if End Of File on input +; RAW = 1 if this device is in Raw mode +; = 0 if this device is cooked +; ISCLK = 1 if this device is the clock device +; ISNUL = 1 if this device is the null device +; ISCOT = 1 if this device is the console output +; ISCIN = 1 if this device is the console input +; +; If ISDEV = 0 +; EOF = 0 if channel has been written +; Bits 0-5 are the block device number for +; the channel (0 = A, 1 = B, ...) +; +devid_ISDEV EQU 80h +devid_EOF EQU 40h +devid_RAW EQU 20h +devid_SPECIAL EQU 10H +devid_ISCLK EQU 08h +devid_ISNUL EQU 04h +devid_ISCOT EQU 02h +devid_ISCIN EQU 01h + +devid_block_dev EQU 1Fh ; mask for block device number diff --git a/v4.0/src/INC/SHELL.MEU b/v4.0/src/INC/SHELL.MEU new file mode 100644 index 0000000..5a47af1 Binary files /dev/null and b/v4.0/src/INC/SHELL.MEU differ diff --git a/v4.0/src/INC/SHELLRD.EQU b/v4.0/src/INC/SHELLRD.EQU new file mode 100644 index 0000000..3e0c7a8 --- /dev/null +++ b/v4.0/src/INC/SHELLRD.EQU @@ -0,0 +1,1155 @@ +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: SHELLRD.EQU : +; : +; Description: Common internal shell equates : +; : +; Revised: 05-05-88 : +; : +;-----------------------------------------------------------------------------+ +; +; Pull down selection to dither (1 bit = 1 selection line) +; +DIT_L1 EQU 0000000000000001B ;Pull down selection 1 ;DITHER +DIT_L2 EQU 0000000000000010B ;Pull down selection 2 ;DITHER +DIT_L3 EQU 0000000000000100B ;Pull down selection 3 ;DITHER +DIT_L4 EQU 0000000000001000B ;Pull down selection 4 ;DITHER +DIT_L5 EQU 0000000000010000B ;Pull down selection 5 ;DITHER +DIT_L6 EQU 0000000000100000B ;Pull down selection 6 ;DITHER +DIT_L7 EQU 0000000001000000B ;Pull down selection 7 ;DITHER +DIT_L8 EQU 0000000010000000B ;Pull down selection 8 ;DITHER +DIT_L9 EQU 0000000100000000B ;Pull down selection 9 ;DITHER +DIT_L10 EQU 0000001000000000B ;Pull down selection 10 ;DITHER +DIT_L11 EQU 0000010000000000B ;Pull down selection 11 ;DITHER +DIT_L12 EQU 0000100000000000B ;Pull down selection 12 ;DITHER +DIT_L13 EQU 0001000000000000B ;Pull down selection 13 ;DITHER +DIT_L14 EQU 0010000000000000B ;Pull down selection 14 ;DITHER +DIT_L15 EQU 0100000000000000B ;Pull down selection 15 ;DITHER +DIT_L16 EQU 1000000000000000B ;Pull down selection 16 ;DITHER +; +; Input field control block equates +; +INP_FILEMASK1 EQU 1 ;file mask input field 1 mul only +INP_FILEMASK2 EQU 2 ;file mask input field 2 mul only +INP_AADDT EQU 3 ;add menu item title +INP_JOHN EQU 4 ;dyanmic input field +INP_DOSCMDEST EQU 5 ;move/copy destination line +INP_DOSRFNAM EQU 6 ;rename file field +INP_DOSRDNAM EQU 7 ;rename directory field +INP_DOSEXOPT EQU 8 ;start a program +INP_DOSMDNAM EQU 9 ;make DOS directory field +INP_CMDLINE EQU 10 ;command line input field +INP_PASSWORD EQU 11 ;app menu password +INP_APPMFILE EQU 12 ;app menu filename +INP_EDITPH EQU 13 ;app menu edit or help/psc +INP_FILEMASK EQU 14 ;file mask input field +INP_DOSASSOC EQU 15 ;associate file input field +INP_HELP EQU 16 ;app help edit field +INP_DOSCMFROM EQU 17 ;dos services from: input field +INP_DOMASK EQU 18 ;display options pulldown filemask +INP_DOSDELDIS EQU 19 ;dos display delete list +; +; Scroll ID equates +; +SCB_CHELP EQU 1 ;contextual helps +SCB_IHELP EQU 2 ;indexed helps +; +; Help equates for panel position +; +HLP_UPPANROW EQU 5 ;upper help panel row +HLP_UPPANCOL EQU 18 ;upper help panel column +HLP_LWPANROW EQU 14 ;lower help panel row +HLP_LWPANCOL EQU 16 ;lower help panel column +HLP_PANLINES EQU 10 ;number of lines in help panel +HLPTLINS EQU 12 ;user defined help text lines +HLPWID EQU 40 ;user defined help text width +; +; Application menu location equates +; +APP_ROW EQU 7 ;jpw application menu start row +APP_COLUMN EQU 1 ;jpw application menu start col +APP_MAXLINES EQU 16 +; +; Error ID equates +; +ERR_PSP EQU 1 ;invalid invocation parameters +ERR_FILMERR EQU 2 ;file not found +ERR_PATHERR EQU 3 ;path not found +ERR_NODA EQU 4 ;dos/app both not active +ERR_ACCEERR EQU 5 ;access denied +ERR_APIF EQU 6 ;missing or invalid main menu file +ERR_INVDEST EQU 7 ;invalid destination path +ERR_INSM EQU 8 ;insufficent memory available +ERR_CLRF EQU 9 ;missing or invalid color file +ERR_BADD EQU 10 ;bad disk or drive door open +ERR_HELF EQU 11 ;missing or bad help file +ERR_COMS EQU 12 ;missing COMSPEC in Environment +ERR_DEAL EQU 13 ;DOS unable to de-allocate memory +ERR_256K EQU 14 ;inadequate graphics memory avail +ERR_MODE EQU 15 ;graph mode request not successful +ERR_MOUS EQU 16 ;missing or bad mouse driver +ERR_EMPTERR EQU 17 ;empty menu +ERR_MAXFERR EQU 18 ;maximum number of files/dirs exce +ERR_WRIPERR EQU 19 ;disk write protected +ERR_DISKERR EQU 20 ;disk full +ERR_DRVNERR EQU 21 ;drive not ready +ERR_NOMARK EQU 22 ;no files marked +ERR_GENERAL1 EQU 23 ;general error has occurred +ERR_EMPTY EQU 24 ;file is empty +ERR_NOPARM EQU 25 ;used of uninitialized psc parm +ERR_NOQUOTE EQU 26 ;missing quote in PSC syntax +ERR_BADNUM EQU 27 ;invalid number inside " " +ERR_PARAOUT EQU 28 ;PSC parameter out of range +ERR_NOEOL EQU 29 ;missing PSC eol marker +ERR_BUFOUT EQU 30 ;output buffer exceeded +ERR_GENERAL EQU 31 ;general error has occurred +ERR_NORBRAC EQU 32 ;no closing ] in psc +ERR_BIGTITL EQU 33 ;psc title too big +ERR_BIGINST EQU 34 ;psc instruction too big +ERR_BIGPRPT EQU 35 ;psc prompt too big +ERR_BIGDEF EQU 36 ;psc default input too big +ERR_BADMOD EQU 37 ;invalid modifier chars in psc +ERR_NOCOPY EQU 38 ;file cannot be copied on itself +ERR_NOROOM EQU 39 ;no room on menu +ERR_LOST EQU 40 ;menu items may be lost +ERR_BLANK EQU 41 ;blank string to clear G3 messages +ERR_ROOT EQU 42 ;delete or rename root error messg +ERR_PDFILE EQU 43 ;shelli.dat file is invalid +ERR_PDFULL EQU 44 ;menu is full, no room for predefs +ERR_ASSOC EQU 45 ;associate file limit reached +ERR_FILEXT EQU 46 ;invalid file ext for association +ERR_PGMEXT EQU 47 ;invalid prgm ext for association +ERR_PASSWD EQU 48 ;invalid password +ERR_INVPARM EQU 49 ;invalid number of parameters +ERR_DEEP EQU 50 ;too many menu levels deep >5 +ERR_MAXDERR EQU 51 ;max number directories exceeded +ERR_ASRF EQU 52 ;bad or missing associate filename +ERR_SGDRCOPY EQU 53 ;single drive copy not supported +ERR_ONEMARK EQU 54 ;function limited to one file +ERR_PRTINST EQU 55 ;print not installed +ERR_PRTQFULL EQU 56 ;print queue full +ERR_PRTNOSUB EQU 57 ;print cannot be submitted +ERR_NOHIGHLT EQU 58 ;no files/directories highlighted +ERR_BADCMD EQU 59 ;pcr 2/26/88 +ERR_BIGFILE EQU 60 ;filespec in psc > 76 chars +; +; Color ID equates +; +CLR_3 EQU 1 ;shipped text mode color index +CLR_7 EQU 2 ;shipped monochrome color index +CLR_10 EQU 3 ;shipped graphics mode 10H/12H +CLR_11 EQU 4 ;shipped graphics mode 11H index +; +; Panel color index record equates +; +CLR_LOGO EQU 1 ;Logo Scr +CLR_BASE EQU 2 ;Base Scr +CLR_ERROR EQU 3 ;Error +CLR_HELP EQU 4 ;Help +CLR_AAB EQU 5 ;action bar +CLR_FILE1 EQU 7 ;graphics file 1 +CLR_FILE2 EQU 6 ;graphics file 2 +CLR_DIR1 EQU 7 ;graphics directory 1 +CLR_DIR2 EQU 6 ;graphics directory 2 +CLR_DRIVE1 EQU 7 ;graphics drive 1 +CLR_DRIVE2 EQU 6 ;graphics drive 2 +CLR_BARTITLE EQU 8 ;title bar title +CLR_INSTRUCT1 EQU 10 ;second instruction +CLR_CMD EQU 11 ;command line +CLR_STATUS EQU 12 ;graphics status +CLR_TITLE EQU 13 ;title +CLR_INSTRUCT EQU 14 ;Instructions +CLR_POPUP1 EQU 15 ;Popup 1 +CLR_POPUP2 EQU 16 ;Popup 2 +CLR_INDEX EQU 17 ;Reserved +; +; Shell panel ID equates +; +PAN_DTITLE EQU 1 ;DOS services title text +PAN_ATITLE EQU 2 ;App menu title text +PAN_DABFILE EQU 3 ;DOS AAB file command text +PAN_DABDISP EQU 4 ;DOS AAB display command text +PAN_DABSHEL EQU 5 ;DOS AAB shell command text +PAN_DABEXIT EQU 6 ;DOS AAB exit command text +PAN_AABMAIN EQU 7 ;App AAB maintain command text +PAN_AABSHEL EQU 8 ;App AAB shell command text +PAN_AABEXIT EQU 9 ;App AAB exit command text +PAN_ENTER EQU 10 ;Common action Enter +PAN_ESC EQU 11 ;Common actions Esc=Cancel +PAN_F1 EQU 12 ;Common actions F1=Help +PAN_F5 EQU 13 ;Common actions F5=Index +PAN_F9 EQU 14 ;Common actions F7=Keys +PAN_APDMAINP EQU 15 ;App maintain pull down panel +PAN_APDMAINC EQU 16 ;App maintain pull down panel text +PAN_APDSHELP EQU 17 ;App shell pull down panel +PAN_APDSHELC EQU 18 ;App shell pull down panel text +PAN_APDEXITP EQU 19 ;App exit pull down panel +PAN_APDEXITC EQU 20 ;App exit pull down panel text +PAN_DPDFILEP EQU 21 ;DOS file pull down panel +PAN_DPDFILEC EQU 22 ;DOS file pull down panel text +PAN_DPDEXITP EQU 23 ;DOS exit pull down panel +PAN_DPDEXITC EQU 24 ;DOS exit pull down panel text +PAN_DPDDISPP EQU 25 ;DOS display pull down panel +PAN_DPDDISPC EQU 26 ;DOS display pull down panel text +PAN_DPDSHELP EQU 27 ;DOS shell pull down panel +PAN_DPDSHELC EQU 28 ;DOS shell pull down panel text +PAN_DSFMT2 EQU 29 ;DOS top single drive/file panel +PAN_DSFMT3 EQU 30 ;DOS extended directory panel +PAN_DSFMT4 EQU 31 ;DOS status panel +PAN_DSFMT6 EQU 32 ;DOS global file search +PAN_FILEVIEW EQU 33 ;DOS file view panel top template +PAN_FILEVIEWT EQU 34 ;fileview panel text +PAN_FVHEX EQU 35 ;DOS hex file view panel bottom +PAN_FVASCII EQU 36 ;DOS hex file view panel bottom +PAN_FKEY EQU 37 ;function key panel +PAN_APPINST2 EQU 38 ;App copy menu item dest instr +PAN_APPINST5 EQU 39 ;App menu reorder second instr +PAN_APPINST6 EQU 40 ;App menu operational instr +PAN_MCP EQU 41 ;Maintain color panel text +PAN_MCSS EQU 42 ;Maintain color sample panel +PAN_DSREAD EQU 43 ;DOS reading drive panel text +PAN_G1 EQU 44 ;general panel 1 +PAN_G1PASSWM EQU 45 ;Enter menu item password panel +PAN_G1OPT EQU 46 ;DOS file options text +PAN_G3SORTC EQU 47 ;DOS sort panel text +PAN_G2 EQU 48 ;General panel 2 +PAN_G2DELM EQU 49 ;delete menu item confirmation +PAN_G3 EQU 50 ;General panel 3 +PAN_G3COPYT EQU 51 ;DOS file copy panel title +PAN_G3COPY EQU 52 ;DOS file copy panel in progress +PAN_G3MOVET EQU 53 ;DOS file move panel title +PAN_G3MOVE EQU 54 ;DOS file move panel in progress +PAN_G3DEST EQU 55 ;DOS file copy/move destination +PAN_G3REPL EQU 56 ;DOS file copy/move replace existg +PAN_G3ERROR EQU 57 ;DOS file copy/move error +PAN_G3FILEDL EQU 58 ;DOS file delete in progress txt +PAN_G3FILEDB EQU 59 ;DOS file delete confirm panel txt +PAN_G3FILERN EQU 60 ;DOS file rename panel text +PAN_G3FILEA EQU 61 ;DOS attr change in progress text +PAN_G3FILEAB EQU 62 ;DOS attr change panel text +PAN_G3DIRD EQU 63 ;DOS dir delete in progress text +PAN_G3DIRDB EQU 64 ;DOS dir delete confirm panel text +PAN_G3DIRM EQU 65 ;DOS dir make panel text +PAN_G3DIRERN EQU 66 ;directory rename text +PAN_G3PRED EQU 67 ;APP predefined menu panel text +PAN_HELP EQU 68 ;Help panel text +PAN_G5 EQU 69 ;General panel 5 +PAN_G5TEXT EQU 70 ;add program text +PAN_G5ADDG EQU 71 ;add group text +PAN_G6 EQU 72 ;General panel 6 +PAN_G6START EQU 73 ;Enter parameters start a program +PAN_GSTATUS EQU 74 ;graphics status panel +PAN_ERR EQU 75 ;small error text panel +PAN_G7 EQU 76 ;small error text panel +PAN_G7ERROR EQU 77 ;small error text panel +PAN_JOHN EQU 78 ;PSC dialog panel +PAN_CLS EQU 79 ;clear screen +PAN_BTITLE EQU 80 ;app and dos background title +PAN_BAAB EQU 81 ;app and dos aab background +PAN_GDIRECTE EQU 82 ;graphics dir extended panel +PAN_GFILEE EQU 83 ;graphics dir extended panel +PAN_GFILEG EQU 84 ;graphics global file panel +PAN_GDIRECTD1 EQU 85 ;graphics multiple directory 1 +PAN_GDIRECTD2 EQU 86 ;graphics multiple directory 2 +PAN_GFILED1 EQU 87 ;graphics multiple file 1 +PAN_GFILED2 EQU 88 ;graphics multiple file 2 +PAN_G7ERROR2 EQU 89 ;reading tree and file error +PAN_G2ASCO EQU 90 ;association options +PAN_G3ASCE EQU 91 ;association panel +PAN_GSTATUSP EQU 92 ;graphics status +PAN_G7ERROR3 EQU 93 ;app menu error panel/exit to dos +PAN_G7ERROR4 EQU 94 ;dir and/or file limit reached +PAN_G3FILEPRT EQU 95 ;DOS file print in progress txt +PAN_F10 EQU 96 ;Common actions F10=Actions +PAN_ALTG EQU 97 ;Common actions Alt+G=Mark all +PAN_ALTU EQU 98 ;Common actions Alt+U=Unmark all +PAN_F8 EQU 99 ;Common actions F8=Hex/ASCII +PAN_DOSTOP EQU 100 ;DOS top panel +PAN_F2 EQU 101 ;F2=Save +PAN_BLANK EQU 102 ;panel to blank app instructions +PAN_CMDL EQU 103 ;Shift+F9=Command Line +PAN_G2FILA EQU 104 ;DOS file attr confirm panel text +PAN_G2FILD EQU 105 ;DOS display delete list +PAN_CMDLA EQU 106 ;app menu Shift+F9=Command Line +PAN_F10A EQU 107 ;app menu f10 key panel text +PAN_FVESC EQU 108 ;file view escape key panel text +PAN_DSFMT7 EQU 109 ;single drive panel titles +PAN_DSFMT8 EQU 110 ;system file list panel titles +PAN_TOTALNUM EQU 110 ;total number panels *PCR +; +; Internal Shell equates for string vector +; +STR_AAPEXT EQU 1 ;main application menu extension +STR_CLREXT EQU 2 ;color profile extension +STR_APPMFILE EQU 3 ;default app menu filename +STR_CLRFILE EQU 4 ;default color filename +STR_HLPFILE EQU 5 ;default help text filename +STR_MS1FILE EQU 6 ;microsoft serial mouse driver +STR_MS2FILE EQU 7 ;IBM mouse driver +STR_COMSPEC EQU 8 ;string to search for in Environ +STR_EXIT EQU 9 ;command line termination string +STR_MOSEXT EQU 10 ;mouse extension length +STR_LBRACKET EQU 11 ;left bracket in PSC +STR_RBRACKET EQU 12 ;right bracket in PSC +STR_PERCENT EQU 13 ;percent sign in PSC +STR_TITLEESC EQU 14 ;title escape in PSC +STR_INSTRESC EQU 15 ;instruction escape in PSC +STR_PRMTESC EQU 16 ;prompt escape in PSC +STR_DEFLTESC EQU 17 ;default escape in PSC source +STR_LENGESC EQU 18 ;length escape in PSC source +STR_MODESC EQU 19 ;modifier escape in PSC source +STR_CLEARESC EQU 20 ;clear escape in PSC source +STR_QUOTE EQU 21 ;quote in PSC source +STR_PSCEND EQU 22 ;end of a PSC line +STR_WALLOW EQU 23 ;allow string +STR_WVALID EQU 24 ;valid allow string +STR_REMOVE EQU 25 ;remove default option in PSC's +STR_WRESEND EQU 26 ;ending psc for resident mode +STR_WTRANEND EQU 27 ;ending psc for transient mode +STR_WTITLDEF EQU 28 ;default user prompt tittle text +STR_WINSTDEF EQU 29 ;default user prompt instr. text +STR_WPRMTPDEF EQU 30 ;default user prompt prompt text +STR_DRIVE EQU 31 ;drive escape in PSC source +STR_PATH EQU 32 ;path escape in PSC source +STR_LCTITLEESC EQU 33 ;title escape in PSC +STR_LCINSTRESC EQU 34 ;instruction escape in PSC +STR_LCPRMTESC EQU 35 ;prompt escape in PSC +STR_LCDEFLTESC EQU 36 ;default escape in PSC source +STR_LCLENGESC EQU 37 ;length escape in PSC source +STR_LCMODESC EQU 38 ;modifier escape in PSC source +STR_LCCLEARESC EQU 39 ;clear escape in PSC source +STR_LCREMOVE EQU 40 ;remove default option in PSC's +STR_DOSEXIT EQU 41 ;ending batch command for dos exit +STR_CDIR EQU 42 ;change directory command for psc +STR_TOPTITLE EQU 43 ;title for indexed help panel +STR_MNAAAB EQU 44 ;Program menu AAB mnemonics +STR_MNMAIN EQU 45 ;Prog maint pull down mnemonics +STR_MNASWI EQU 46 ;Prog switch pull down mnemonics +STR_MNAEXI EQU 47 ;Prog exit pull down mnmemonics +STR_MNDAAB EQU 48 ;DOS Services AAB mnemonics +STR_MNFILE EQU 49 ;DOS Services File mnemonics +STR_MNDSWI EQU 50 ;DOS Services switch mnemonics +STR_MNDISP EQU 51 ;DOS Services display mnemonics +STR_MNDEXI EQU 52 ;DOS Services exit mnemonics +STR_APPMENU EQU 53 ;app menu configured +STR_DOSSERV EQU 54 ;DOS services configured +STR_REFBUF EQU 55 ;refresh DOS buffer configured +STR_TRANS EQU 56 ;transient shell configured +STR_MODE10H EQU 57 ;graphics mode 10H +STR_MODE11H EQU 58 ;graphics mode 11H +STR_MODE12H EQU 59 ;graphics mode 12H +STR_CLFILE EQU 60 ;color filename +STR_MULTIPE EQU 61 ;multiple drive display +STR_CLRACT EQU 62 ;maintain color active +STR_MENUACT EQU 63 ;menu maintainance active +STR_EXITDOS EQU 64 ;exit to DOS active +STR_CMDLINE EQU 65 ;command line active +STR_PREDACT EQU 66 ;predefined menu active +STR_MOUSACT EQU 67 ;mouse active +STR_LEFTACT EQU 68 ;left hand mouse +STR_SOUDACT EQU 69 ;sound active +STR_APMFILE EQU 70 ;app main menu filename +STR_TOTAL EQU 71 ;total structute list +STR_FILL1 EQU 72 ;fill pattern 1 +STR_ASCEXT EQU 73 ;default association filename +STR_CHECKM EQU 74 ;check mark +STR_RETEXEC EQU 75 ;press enter to exit from start +STR_NOCMD EQU 76 ;no command for EXEC error +STR_BUTTON EQU 77 ;button mouse fld text for psc pan +STR_TEXTS EQU 78 ;invocation text mode option +STR_NLS EQU 79 ;NLS translation invoke option +STR_NOFILD EQU 80 ;No files in marked directory' +STR_NOFILM EQU 81 ;No files match file specifier' +STR_NOFIL EQU 82 ;'No file' +STR_ROOTN EQU 83 ;'ROOT' +STR_DTITLE EQU 84 ;DOS Services AAB mnemonics string +STR_ATITLE EQU 85 ;App Menu AAB mnemonics string +STR_DABFILE EQU 86 ;File P. down AAB mnemonics string +STR_DABDISP EQU 87 ;Disp P. down AAB mnemonics string +STR_DABSHEL EQU 88 ;Prog P. down AAB mnemonics string +STR_DABEXIT EQU 89 ;Exit P. down AAB mnemonics string +STR_AABMAIN EQU 90 ;Mait P. down AAB mnemonics string +STR_AABSHEL EQU 91 ;Prog P. down AAB mnemonics string +STR_AABEXIT EQU 92 ;Exit P. down AAB mnemonics string +STR_MORE EQU 93 ;text mode more string +STR_DIRT EQU 94 ;Directory title +STR_FILET EQU 95 ;File title +STR_DFSAVE EQU 96 ;dir/file buffer disk swap option +STR_BUFO EQU 97 ;dir/file buffer size override +STR_ASOFILE EQU 98 ;associate file name option +STR_ASOEXT EQU 99 ;associate file name extension +STR_DBCS EQU 100 ;DBCS invocation string +STR_NOCMDM EQU 101 ;insufficient command line memory +STR_DATE EQU 102 ;date invocation string +STR_FSTATT EQU 103 ;file status title ;pcr 2/2/88 +STR_COM2 EQU 104 ;COM2 invocation string D491 +STR_ENH EQU 105 ;invocation enhancements +STR_SCOPYF EQU 106 ;copy file title +STR_SMOVEF EQU 107 ;move file title +STR_SDELEF EQU 108 ;delete file title +STR_SPRINF EQU 109 ;Print file title +STR_SASSOF EQU 110 ;Associate file title +STR_SRENMF EQU 111 ;rename file title +STR_SSTARF EQU 112 ;start a program title +STR_SATTRF EQU 113 ;change attribute file title +STR_SREMOD EQU 114 ;Remove directory title +STR_SMAKED EQU 115 ;Make directory title +STR_SRENMD EQU 116 ;Rename directory title +STR_SADDP EQU 117 ;Add program title +STR_SADDG EQU 118 ;Add group title +STR_SCHANP EQU 119 ;Change Program title +STR_SCHANG EQU 120 ;Change Group title +STR_SDELMI EQU 121 ;Delete menu item title +STR_SWARN EQU 122 ;Warning title +STR_SHELP EQU 123 ;Help panel title +STR_SPWVER EQU 124 ;password verification title +STR_SDISO EQU 125 ;display options title +STR_SFILO EQU 126 ;file options title +STR_RETCMD EQU 127 ;DOS command return prompt +STR_UTITLE EQU 128 ;User defined PSC title +STR_PROFACT EQU 129 ;profile switch +STR_PROEXT EQU 130 ;profile extension +STR_CDON EQU 131 ; +STR_CDOFF EQU 132 ; +STR_CRON EQU 133 ; +STR_CROFF EQU 134 ; +STR_ASON EQU 135 ; +STR_ASOFF EQU 136 ; +STR_SBNAME EQU 137 ; +STR_SBEXT EQU 138 ; +STR_SBSIZE EQU 139 ; +STR_SBDATE EQU 140 ; +STR_SBDISK EQU 141 ; +STR_FILECHK EQU 142 ;PSC /F parameter +STR_LCFILECHK EQU 143 ;PSC /f parameter +STR_SN EQU 144 ;>>SN +; +; Active button bit maps ;sos 2/2/88 +; +BUT_ESC EQU 0000000000000001B ;Esc +BUT_F1 EQU 0000000000000010B ;F1 +BUT_F5 EQU 0000000000000100B ;F5 +BUT_F9 EQU 0000000000001000B ;F9 +BUT_F10 EQU 0000000000010000B ;F10 +BUT_ALTG EQU 0000000000100000B ;Alt+G +BUT_LFARROW EQU 0000000001000000B ;Left arrow +BUT_RTARROW EQU 0000000010000000B ;Right arrow +BUT_ENTER EQU 0000000100000000B ;Enter +BUT_ALTU EQU 0000001000000000B ;Alt+U +BUT_PGUP EQU 0000010000000000B ;PgUp +BUT_PGDN EQU 0000100000000000B ;PgDn +BUT_STOP EQU 0001000000000000B ;Stop button +BUT_F8 EQU 0010000000000000B ;F8 +BUT_F2 EQU 0100000000000000B ;F2=Save +; +; Internal button bit map vector equates +; +BCB_BACK EQU 1 ;key backgrd +BCB_LFARROW EQU 2 ;Left arrow foregrd +BCB_RTARROW EQU 3 ;Right arrow foregrd +BCB_PGUP EQU 4 ;PgUp foregrd +BCB_PGDN EQU 5 ;PgDn foregrd +BCB_BACK2 EQU 6 ;PgUp/Dn backgrd +; +; 16 byte paragraph size of allocated buffers +; +MAX_COLRBUF EQU 106 ;Color buffer (1.7 K) +MAX_HELPBUF EQU 625 ;help buffer (10.0 K) +MAX_TEXTBUF EQU 250 ;logical video text only (4.0 K) +MAX_APPMBUF EQU 1000 ;application menu buffer (16.0 K) +MAX_DISQBUF EQU 125 ;display queue text only (2.0K) +; +MAX_DIR1BUF EQU 500 ;directory buffer 1 ( 8.0 KB) +MAX_DIR2BUF EQU 500 ;directory buffer 2 ( 8.0 KB) +MAX_DOSWBUF EQU 640 ;DOS working buffer (10.0 KB) +MIN_FILEBUF EQU 64 ;minimum DOS file buffer (1.0 KB) +SM_FILEBUF EQU 640 ;small file buffer (10.0 KB) +MIN_DIR1BUF EQU 250 ;min directory buffer 1 ( 4.0 KB) +MIN_DOSWBUF EQU 500 ;min DOS working buffer ( 8.0 KB) +; +MAX_EXECBUF EQU 4070 ;app menu/prompt min memy(64.0 KB) +MAX_WORKBUF EQU 1000 ;working DOS buffer (10.0 KB) +MAX_DOSPBUF EQU 12250 ;dos serv min memory (196.0 KB) +MAX_APPPBUF EQU 4070 ;app menu min memory (64.0 KB) +; +; Miscellaneous sizes +; +MAX_CCSET EQU 4 ;number of user color selections ;pcr 3/4/88 +MAX_CLRECD EQU 12 ;num of bytes per PCPANEL color rc +MAX_SCRROWS EQU 30 ;mode 11H and 12H require 30 rows +MAX_REVERSE EQU 0 ;size of mouse reverse high buffer +MAX_WPARMLEN EQU 127 ;max psc prompt input length +MAX_WPSCOUT EQU 512 ;max psc size +; +; Machine IDs +; +MODEL_80 EQU 0F8H ;model 80 hardware VGA +SUBMD_80 EQU 000H +MODEL_60 EQU 0FCH ;model 60 hardware VGA +SUBMD_60 EQU 005H +MODEL_50 EQU 0FCH ;model 50 hardware VGA +SUBMD_50 EQU 004H +MODEL_30 EQU 0FAH ;model 30 hardware MCGA +SUBMD_30 EQU 000H +MODEL_25 EQU 0FAH ;model 25 hardware MCGA +SUBMD_25 EQU 001H +MODEL_PC EQU 0FFH ;PC Planar board +SUBMD_PC EQU 000H +MODEL_XT EQU 0FEH ;XT Planar board +SUBMD_XT EQU 000H +MODEL_JR EQU 0FDH ;JR Planar board +SUBMD_JR EQU 000H +MODEL_AT EQU 0FCH ;AT Planar board +SUBMD_AT EQU 000H +SUBMD_AS EQU 001H ;AT Planar board for skyrocket +MODEL_CV EQU 0F9H ;convertible +SUBMD_CV EQU 000H +; +; Keystroke equates +; +DCLICK EQU 255 ;double click key +INABOVE EQU 115 ;insert above ctrl+left arrow +INBELOW EQU 116 ;insert below ctrl+right arrow +DELETE EQU 89 ;delete shift+F6 +DELALL EQU 118 ;delete cursor to end ctrl+pgdn +CR EQU 0DH ;ASCII carriage return +LF EQU 0AH ;ASCII line feed +UPARROW EQU 72 ;up arrow +DNARROW EQU 80 ;down arrow +LFARROW EQU 75 ;left arrow +RTARROW EQU 77 ;right arrow +PGUP EQU 73 +PGDN EQU 81 +ESCK EQU 27 +ENTER EQU 13 +SPACE EQU 32 +F1 EQU 59 +F2 EQU 60 +F3 EQU 61 +F4 EQU 62 +F5 EQU 63 +F6 EQU 64 +F7 EQU 65 +F8 EQU 66 +F9 EQU 67 +F10 EQU 68 +F11 EQU 85h ;*PCR +ALTC EQU 46 +ALTM EQU 50 +ALTD EQU 32 +ALTR EQU 19 +ALTG EQU 34 +ALTU EQU 22 +SAVE EQU 60 ;F2 save help/psc +EOLMARK EQU 62 ;F4 separate psc lines +TAB EQU 09 ;tab +BKTAB EQU 0FH ;back tab +BKSPC EQU 08 ;backspace +SHIFTF9 EQU 92 ;Shift+F9 +; +; Internal SHELLRD PSP invocation option equates (COM_STATE) +; +COM_APPM EQU 0000000000000001B ;application menu configured +COM_DOSS EQU 0000000000000010B ;DOS Services configured +COM_REFD EQU 0000000000000100B ;refresh directory +COM_RESS EQU 0000000000001000B ;resident shell +COM_AUTI EQU 0000000000010000B ;predefined menu installation +COM_DRV2 EQU 0000000000100000B ;multiple drive display active +COM_FLCL EQU 0000000001000000B ;command line access is active +COM_FLMI EQU 0000000010000000B ;maintain menu item active +COM_FLCS EQU 0000000100000000B ;maintain color selections active +COM_FLED EQU 0000001000000000B ;exit to DOS is active +COM_MOUS EQU 0000010000000000B ;mouse is active. +COM_LFMS EQU 0000100000000000B ;left hand mouse. +COM_M10H EQU 0001000000000000B ;Graphics EGA mode 10H requested +COM_M11H EQU 0010000000000000B ;Graphics VGA mode 11H requested +COM_M12H EQU 0100000000000000B ;Graphics VGA mode 12H requested +COM_TEXT EQU 1000000000000000B ;text mode 3 or 7 is active +; +; Internal SHELLRD PSP invocation option equates (COM_STATE2) +; +COM_SOUD EQU 0000000000000001B ;sound active +COM_NLS EQU 0000000000000010B ;NLS help index translation active +COM_DFSAVE EQU 0000000000000100B ;dir/file buffer swap option +COM_BUFO EQU 0000000000001000B ;dir/file buffer size override +COM_DBCS EQU 0000000000010000B ;DBCS support is active +COM_DATE EQU 0000000000100000B ;Date is active +COM_COM2 EQU 0000000001000000B ;COM2 is active D491 +COM_ENHA EQU 0000000010000000B ;Enhancements active +COM_SNA EQU 0000000100000000B ;>>SN +; +; Internal SHELLRD dialog equates (COM_CDIALOG) +; +COM_GDRIVE1 EQU 0 ;DOS drive 1 dialog +COM_GNAME1 EQU 1 ;DOS filemask 1 dialog +COM_GDIR1 EQU 2 ;DOS directory 1 dialog +COM_GFILE1 EQU 3 ;DOS file 1 dialog +COM_GDRIVE2 EQU 4 ;DOS drive 2 dialog +COM_GNAME2 EQU 5 ;DOS filemask 2 dialog +COM_GDIR2 EQU 6 ;DOS directory 2 dialog +COM_GFILE2 EQU 7 ;DOS file 2 dialog +COM_APPMENU EQU 8 ;app menu screen +COM_EXITDOS EQU 9 ;exit to DOS +COM_PEC EQU 10 ;exit to execute PEC +COM_PAAB EQU 11 ;app menu action bar dialog +COM_DAAB EQU 12 ;DOS services action bar dialog +COM_DCLR EQU 13 ;change color dialog +COM_FIRST EQU 14 ;first time dialog +; +; Internal SHELLRD base screen equates (COM_BASESCR) +; +COM_DOSSCR1 EQU 1 ;not used +COM_DOSSCR4 EQU 2 ;multiple display +COM_DOSSCR2 EQU 3 ;extended directory display +COM_DOSSCR3 EQU 4 ;global file list +COM_APPSCR EQU 5 ;application menu +COM_PRESCR EQU 6 ;predefined menu +COM_CLRSCR EQU 7 ;color menu +COM_AFVIEW EQU 8 ;ascii file view +COM_HFVIEW EQU 9 ;hex file view +; +; Internal Shell vector length equates +; +COM_ERRVECLEN EQU 3 ;# bytes in each error vector +COM_STRVECLEN EQU 3 ;# bytes in each string vector +COM_INVVECLEN EQU 6 ;# bytes in each invoke vector +COM_KEYVECLEN EQU 6 ;# bytes in each keys vector +COM_GCBVECLEN EQU 6 ;# bytes in each graphics vector +COM_PCBVECLEN EQU 4 ;# bytes in each panel vector +COM_ICBVECLEN EQU 4 ;# bytes in each input vector +COM_SCBVECLEN EQU 4 ;# bytes in each scroll vector +COM_BCBVECLEN EQU 2 ;# bytes in each button vector +COM_MCBVECLEN EQU 2 ;# bytes in each mouse vector +COM_MGPVECLEN EQU 3 ;# bytes in each group vector +COM_FLDVECLEN EQU 4 ;# bytes in each fld vector +COM_CALTABLEN EQU 6 ;# bytes in each fld table entry +COM_SWITABLEN EQU 3 ;# bytes in each fld table entry +COM_SWIVECLEN EQU 3 ;# bytes in each fld table entry +; +; Field call table ID equates +; +;CAL_PREDEF EQU 1 ;predefined app menu +CAL_APPM EQU 1 ;application menu call table ID +CAL_CLRSCR EQU 2 ;color screen +CAL_DOSSCR2 EQU 3 ;dos services screen 2 +CAL_DOSSCR3 EQU 4 ;dos services screen 3 +CAL_DOSSCR4 EQU 5 ;dos services screen 4 +CAL_AFVIEW EQU 6 ;ascii file view +; +; Mouse field group equates +; +MGG_AABDOS EQU 1 ;AAB for DOS +MGG_AABFILE EQU 2 ;AAB file pull down group +MGG_AABDISP EQU 3 ;AAB display pull down group +MGG_AABSHEL EQU 4 ;AAB file pull down group +MGG_AABEXIT EQU 5 ;AAB exit pull down group +MGG_DOSG2 EQU 6 ;DOS G2 popup panel fields +MGG_DOSVIEW EQU 7 ;DOS file view fields +MGG_DOSG3 EQU 8 ;DOS G3 esc and help +MGG_G3FLDS EQU 9 ;DOS G3 pan copy/move file dest +MGG_G3ATTR EQU 10 ;DOS G3 pan file attribute sele +MGG_DOSG6 EQU 11 ;DOS G6 pan esc and f1 key fiel +MGG_AABAPPM EQU 12 ;APP menu actual group +MGG_AABAOPT EQU 13 ;AAB options pull down group +MGG_AABAPRG EQU 14 ;AAB program pull down group +MGG_AABAEXT EQU 15 ;AAB exit pull down group +MGG_AADDT EQU 16 ;app menu item add title group +MGG_APPMITM EQU 17 ;App menu item fields (actual appl +MGG_APPPASS EQU 18 ;App menu add/edit/delete password +MGG_APPFILN EQU 19 ;App menu add/edit filename field +MGG_APPCONF EQU 20 ;App menu item delete confirm fiel +MGG_JOHN EQU 21 ;App menu dynamic user dialog flds +MGG_ERRFLDS EQU 22 ;DOS small error panel fields +MGG_G7FLDS EQU 23 ;DOS big error panel +MGG_G3ERRFLDS EQU 24 ;DOS g3 error fields +MGG_DOSMULT EQU 25 ;DOS multiple group +MGG_DOSEXTN EQU 26 ;DOS extended group +MGG_DOSGLOB EQU 27 ;DOS global group +MGG_CLR EQU 28 ;App color group +MGG_LIHELP EQU 29 ;lower help group +MGG_STATUSR EQU 30 ;status popup panel (right side) +MGG_STATUSL EQU 31 ;status popup panel (left side) +MGG_SORTC EQU 32 ;display options panel +MGG_FILEOPT EQU 33 ;file options panel +MGG_DOSG2DEL EQU 34 ;delete list panel +MGG_DOSG3EX EQU 35 ;program parameters +MGG_DOSG3AS EQU 36 ;associate file extensions +; +; Mouse data field ID equates +; +MFF_AABFILE EQU 1 ;AAB file +MFF_AABDISP EQU 2 ;AAB options +MFF_AABSHEL EQU 3 ;AAB special +MFF_AABEXIT EQU 4 ;AAB exit +MFF_AABHELP EQU 5 ;AAB help +; +MFF_PDFSTART EQU 6 ;Open +MFF_PDFPRINT EQU 7 ;print +MFF_PDFASSOC EQU 8 ;assoc +MFF_PDFMOVE EQU 9 ;move +MFF_PDFCOPY EQU 10 ;copy +MFF_PDFDELETE EQU 11 ;delete +MFF_PDFRENAME EQU 12 ;rename +MFF_PDFATTR EQU 13 ;attribute +MFF_PDFVIEW EQU 14 ;view +MFF_PDFCREATE EQU 15 +MFF_PDFSELECT EQU 16 ;select all +MFF_PDFDSELECT EQU 17 ;Deselect all +MFF_PDFESC EQU 18 ;esc +; +MFF_PDSSORT EQU 19 ;display options (sort) +MFF_PDSFILEOPT EQU 20 +MFF_PDSEXTEND EQU 21 ;show info +MFF_PDSESC EQU 22 ;esc; +MFF_PDPSINGLE EQU 23 ;single +MFF_PDPMULT EQU 24 ;multiple +MFF_PDPGLOBAL EQU 25 ;system +MFF_PDPESC EQU 26 ;esc +; +MFF_PDEDOSX EQU 27 ;exit to start a program +MFF_PDERESUME EQU 28 ;resume file system +MFF_PDEESC EQU 29 ;esc +; +MFF_DOSG2FLD1 EQU 30 ;selection field 1 +MFF_DOSG2FLD2 EQU 31 ;selection field 2 +MFF_DOSG2ENTER EQU 32 ;enter +MFF_DOSG2ESC EQU 33 ;esc +MFF_DOSG2HLP EQU 34 ;f1 +; +MFF_DOSVFPGUP EQU 35 ;PgUp +MFF_DOSVFPGDN EQU 36 ;PgDn +MFF_DOSVFESC EQU 37 ;Esc (25 rows) +; +MFF_DOSG3FLD1 EQU 38 ;selection field 1 +MFF_DOSG3FLD2 EQU 39 ;selection field 2 +MFF_DOSG3CH EQU 40 ;hidden attribute selection +MFF_DOSG3CO EQU 41 ;read only attr selection +MFF_DOSG3CA EQU 42 ;archive attribute selection +MFF_DOSG3ENTER EQU 43 ;enter +MFF_DOSG3ESC EQU 44 ;esc +MFF_DOSG3HLP EQU 45 ;help +; +MFF_DOSG6ENTER EQU 46 ;enter +MFF_DOSG6ESC EQU 47 ;Esc +MFF_DOSG6HLP EQU 48 ;F1 +; +MFF_GDRIVE1 EQU 49 ;DOS A-Z drive display field +MFF_GFILEM EQU 50 ;Single Drive filename input fld; +MFF_AABAOPT EQU 51 ;AAB programs +MFF_AABAPROG EQU 52 ;AAB groups +MFF_AABAEXIT EQU 53 ;AAB exit +; +MFF_PDASTART EQU 54 ;start program menu +MFF_PDAADDPSC EQU 55 ;add +MFF_PDACHANGE EQU 56 ;change +MFF_PDADELETE EQU 57 ;delete +MFF_PDACOPY EQU 58 ;copy +MFF_PDAOESC EQU 59 ;esc field +; +MFF_PDADOS EQU 60 ;add group +MFF_PDACMD EQU 61 ;delete group +MFF_PDAREM EQU 62 ;remane group +MFF_PDAREARRG EQU 63 ;rearrange +MFF_PDAPESC EQU 64 ;esc +; +MFF_PDADOSX EQU 65 ;exit to DOS +MFF_PDARESUME EQU 66 ;resume start a program +MFF_PDAXESC EQU 67 ;esc +; +MFF_AADDTF2 EQU 68 ;app menu add title enter +MFF_AADDTESC EQU 69 ;app menu add title esc +MFF_AADDTHLP EQU 70 ;app menu add title help +; +MFF_APPMITEM EQU 71 ;app menu item selection field +MFF_APPMITEMSB EQU 72 ;app menu item scroll bar +; +MFF_APPOESC EQU 73 ;app other menu Esc key +MFF_APPOHLP EQU 74 ;app menu help key +MFF_APPOCMDL EQU 75 ;app menu Shift+F9=command line +; +MFF_APPADPENTR EQU 76 ;app enter +MFF_APPADPESC EQU 77 ;app add/edit/delete password +MFF_APPADPHLP EQU 78 ;app add/edit/delete password +; +MFF_F8 EQU 79 ;F8=Hex/ASCII +; +MFF_APPADKENTR EQU 80 ;app add/edit type enter +MFF_APPADKESC EQU 81 ;app add/edit type Esc key +MFF_APPADKHLP EQU 82 ;app add/edit type F1 key +; +MFF_APPADFENTR EQU 83 ;app add/edit filename enter +MFF_APPADFESC EQU 84 ;app add/edit filename Esc +MFF_APPADFHLP EQU 85 ;app add/edit filename F1 +; +MFF_APPDECOY EQU 86 ;app delete confirmation yes +MFF_APPDECON EQU 87 ;app delete confirmation no +MFF_APPDECOEN EQU 88 ;app delete confirmation enter +MFF_APPDECOESC EQU 89 ;app delete confirmation Esc +MFF_APPDECOHLP EQU 90 ;app delete confirmation F1 +; +MFF_JOHNENTER EQU 91 ;Enter +MFF_JOHNESC EQU 92 ;Esc key +MFF_JOHNHLP EQU 93 ;F1 key +; +MFF_ERRESC EQU 94 ;Esc key +MFF_ERRHLP EQU 95 ;F1 key +; +MFF_G7FLD1 EQU 96 ;selection field 1 +MFF_G7FLD2 EQU 97 ;selection field 2 +MFF_G7ENTER EQU 98 ;enter +MFF_G7ESC EQU 99 ;Esc key +MFF_G7HLP EQU 100 ;F1 key +; +MFF_G3EFLD1 EQU 101 ;selection field 1 +MFF_G3EFLD2 EQU 102 ;selection field 2 +; +MFF_GDRIVE2 EQU 103 ;DOS A-Z drive display field2 +MFF_GFILEM1 EQU 104 ;Mult Drive filename input fld +MFF_GFILEM2 EQU 105 ;Mult Drive filename input fld +MFF_GDIRECTD1 EQU 106 ;Mult dir tree field 1 +MFF_GDIRECTDB1 EQU 107 ;Mult dir tree scroll bar 1 +MFF_GDIRECTD2 EQU 108 ;Mult dir tree field 2 +MFF_GDIRECTDB2 EQU 109 ;Mult dir tree scroll bar 2 +MFF_GFILED1 EQU 110 ;Mult file field 1 +MFF_GFILED1B EQU 111 ;Mult file scroll bar 1 +MFF_GFILED2 EQU 112 ;Mult file field 2 +MFF_GFILED2B EQU 113 ;Mult file scroll bar 2 +; +MFF_GFILEG EQU 114 ;Global file field +MFF_GFILEGB EQU 115 ;Global file scroll bar +; +MFF_GDIRECTE EQU 116 ;Ext dir tree field +MFF_GDIRECTEB EQU 117 ;Ext dir tree scroll bar +MFF_GFILEE EQU 118 ;Ext file field 1 +MFF_GFILEEB EQU 119 ;Ext file scroll bar +; +MFF_CRARROW EQU 120 ;Color palette right +MFF_CLARROW EQU 121 ;Color palette left +; +MFF_LF1 EQU 122 ;lower help panel F1 field +MFF_LF5 EQU 123 ;lower help panel F5 field +MFF_LF9 EQU 124 ;lower help panel F9 field +MFF_LESC EQU 125 ;lower help panel Esc field +MFF_LHELP EQU 126 ;lower help panel selection +MFF_LSB EQU 127 ;lower help panel scroll bar +; +MFF_STATRESC EQU 128 ;status esc key +MFF_STATRHLP EQU 129 ;status F1 key +MFF_STATLESC EQU 130 ;status esc key +MFF_STATLHLP EQU 131 ;status F1 key +; +MFF_AAB EQU 132 ;background AAB field +MFF_DOSVFENTER EQU 133 ;enter key for fkey line +MFF_F10A EQU 134 ;*PCR (AND MFF RENUM) +MFF_F10 EQU 135 ;F10=Actions +MFF_ALTG EQU 136 ;Alt+G=Mark all +MFF_ALTU EQU 137 ;Alt+U=Unmark all +MFF_CMDL EQU 138 ;Shift+F9=Command Line +; +MFF_APPPROG EQU 139 ;add/change title field +MFF_APPPSC EQU 140 ;add/change psc field +MFF_APPHELP EQU 141 ;add/change help field +MFF_APPPASS EQU 142 ;add/change password field +MFF_APPFILE EQU 143 ;add/change filename field +; +MFF_DOSG3FROM EQU 144 ;G3 panel from field +MFF_DOSG3TO EQU 145 ;G3 panel to field +; +MFF_FILEMASK EQU 146 ;filemask input field +MFF_BYNAME EQU 147 ;sort by name +MFF_BYEXT EQU 148 ;sort by extension +MFF_BYDATE EQU 149 ;sort by date +MFF_BYSIZE EQU 150 ;sort by size +MFF_BYDISK EQU 151 ;sort by disk order +MFF_BYNAMEB EQU 152 ;sort by name +MFF_BYEXTB EQU 153 ;sort by extension +MFF_BYDATEB EQU 154 ;sort by date +MFF_BYSIZEB EQU 155 ;sort by size +MFF_BYDISKB EQU 156 ;sort by disk order +; +MFF_DELCONF EQU 157 ;file options delete field +MFF_REPCONF EQU 158 ;file options replace field +MFF_MULCONF EQU 159 ;file options across dirs field +; +MFF_DELCONFB EQU 160 ;file options delete field +MFF_REPCONFB EQU 161 ;file options replace field +MFF_MULCONFB EQU 162 ;file options across dirs field +; +MFF_DOSG2DELL EQU 163 ;dos G2 delete list field +MFF_DOSG2DELLL EQU 164 ;dos G2 delete list field +MFF_DOSG2DELLR EQU 165 ;dos G2 delete list field +; +MFF_GDIRECTD1U EQU 166 +MFF_GDIRECTD1D EQU 167 +MFF_GDIRECTD2U EQU 168 +MFF_GDIRECTD2D EQU 169 +MFF_GFILED1U EQU 170 +MFF_GFILED1D EQU 171 +MFF_GFILED2U EQU 172 +MFF_GFILED2D EQU 173 +MFF_GDIRECTEU EQU 174 +MFF_GDIRECTED EQU 175 +MFF_GFILEEU EQU 176 +MFF_GFILEED EQU 177 +MFF_GFILEGU EQU 178 +MFF_GFILEGD EQU 179 +; +MFF_DOSG3EXP EQU 180 +MFF_DOSG3EXPL EQU 181 +MFF_DOSG3EXPR EQU 182 +; +MFF_DOSG3ASE EQU 183 +MFF_DOSG3ASEL EQU 184 +MFF_DOSG3ASER EQU 185 +; +MFF_DOSG3FROML EQU 186 +MFF_DOSG3FROMR EQU 187 +MFF_DOSG3TOL EQU 188 +MFF_DOSG3TOR EQU 189 +; +MFF_PDBACK EQU 190 ;pull down panel esc w/click outsi +MFF_APPPROGLA EQU 191 ;title field left arrow +MFF_APPPROGRA EQU 192 ;title field right arrow +MFF_APPPSCLA EQU 193 ;program field left arrow +MFF_APPPSCRA EQU 194 ;program field right arrow +MFF_APPHELPLA EQU 195 ;help field left arrow +MFF_APPHELPRA EQU 196 ;help field right arrow +; +MFF_LHELPUA EQU 197 ;lower help panel up arrow +MFF_LHELPDA EQU 198 ;lower help panel down arrow +; +; help on keys, help on help +; +HLP_KEYASSIGN EQU 1 ;help on keys +HLP_HELPONHELP EQU 2 ;help on help +; +; general shell helps +; +HLP_PROMEUINST EQU 3 ;instruction for progrm menu +HLP_DOSSERINST EQU 4 ;explain what is dos services +HLP_MOUSEUSAGE EQU 5 ;explain how to use mouse +HLP_KEYBDUSAGE EQU 6 ;explain using the keyboard +; +; start a program action bar helps +; +HLP_AABPROGRAM EQU 7 ;AAB PROGRAM help +HLP_AABGROUP EQU 8 ;AAB GROUP help +HLP_AABEXIT EQU 9 ;AAB EXIT function help +; +; start a program PROGRAM pulldown helps +; +HLP_STARTPROG EQU 10 ;start program help +HLP_ADDPROG EQU 11 ;add a program help +HLP_GENCHANGE EQU 12 ;change program help +HLP_DELMAFUNC EQU 13 ;delete program item +HLP_COPYMAFUNC EQU 14 ;copy program help +; +; start a program GROUP pulldown helps +; +HLP_ADDGROUP EQU 15 ;add group help +HLP_CHNGEGROUP EQU 16 ;change group help +HLP_DELGROUP EQU 17 ;delete group help +HLP_REARGROUP EQU 18 ;reorder item help +; +; start a program EXIT pulldown helps +; +HLP_DOSEXITP EQU 19 ;explain exit to dos +HLP_RESPRGMENU EQU 20 ;explain how to start a program +; +; file system action bar helps +; +HLP_GENFILFUNC EQU 21 ;view,delete,copy,move,rename, etc +HLP_GENOPTIONS EQU 22 ;options help +HLP_GENSPECIAL EQU 23 ;special help +HLP_GENEXIFUNC EQU 24 ;EXIT function +; +; file system FILE pulldown helps +; +HLP_STRTPRGDOS EQU 25 ;DOS service start program list +HLP_PRINTFILE EQU 26 ;explain how to print file +HLP_ASSCDOS EQU 27 ;Associate pull down panel +HLP_MOVEFILE EQU 28 ;explain how to move file +HLP_COPYFILE EQU 29 ;explain how to copy file +HLP_DELFILFUNC EQU 30 ;explain how to delete file +HLP_RENMEFILE EQU 31 ;expalin how to rename file +HLP_GENCHGATTR EQU 32 ;hidden, readonly, and archive +HLP_VIEWFILE EQU 33 ;explain how to view file +HLP_MAKEDIR EQU 34 ;explain how to make a directory +HLP_SELECTALL EQU 35 ;select all help +HLP_DSELECTALL EQU 36 ;Deselect all help +; +; file system OPTIONS pulldown helps +; +HLP_GENFILSRT EQU 37 ;display options, filemask / sort +HLP_CONFIRM EQU 38 ;file options +HLP_SINGLEDRV EQU 39 ;explain file status panel +; +; file system SPECIAL pulldown helps +; +HLP_EXTDIRDIS EQU 40 ;explain extend directory display +HLP_MULTIDRV EQU 41 ;explain multiple drive display +HLP_GLOFILELST EQU 42 ;explain global file list display +; +; file system EXIT pulldown helps +; +HLP_PROGMENU EQU 43 ;defines what is program menu help +HLP_RESDOSSERV EQU 44 ;explain how to resume dos service +; +; start a program general add program/group help messages +; +HLP_ADDTITLE EQU 45 ;add title help +HLP_ADDPASWRD EQU 46 ;add password help for program or +HLP_ADDONLINE EQU 47 ;add online help information +HLP_EXPPRGSTRT EQU 48 ;describe program startup command +HLP_ADDMFILNAM EQU 49 ;explain steps to create a filenme +; +; start a program general change program/group help messages +; +HLP_CHGMEUFILN EQU 50 ;explain change menu item filename +HLP_CHGMEUITIL EQU 51 ;detail change menu item title +HLP_CHGMEUIHLP EQU 52 ;explain on changing menu item +HLP_CHGMEUIPSW EQU 53 ;detail change menu item password +HLP_CHGMEUIPSC EQU 54 ;detail change menu item startup +; +; general start a program help +; +HLP_PASWRDLIM EQU 55 ;explain password prompt +HLP_CHNGECOLOR EQU 56 ;change the color(s) for display +HLP_DELMEUCONF EQU 57 ;delete menu item confirmation +HLP_NOTDELMEU EQU 58 ;do not delete menu item +; +; file system file options popup helps +; +HLP_DELCONF EQU 59 ;explain confirmation for deleting +HLP_REPITMCONF EQU 60 ;replace menu item confirmation +HLP_DIRSELECT EQU 61 ;select across directory options +; +; file system display options popup helps +; +HLP_FILENAME EQU 62 ;explain display by filemask +HLP_FILNAMESRT EQU 63 ;explain sorting by file name +HLP_FILEXTSRT EQU 64 ;expalin sorting by file extension +HLP_FILDATESRT EQU 65 ;explain sorting by file date +HLP_FILSIZESRT EQU 66 ;explain sorting by file size +HLP_DISKORD EQU 67 ;files displayed by disk order +; +; file system change attribute popup helps +; +HLP_HIDFILATTR EQU 68 ;explain hidden file attribute +HLP_READONATTR EQU 69 ;explain file read only attribute +HLP_ARCHIVATTR EQU 70 ;explain file archive attribute +; +; file system change attribute marked files popup helps +; +HLP_CHGONEFILE EQU 71 ;explain how to change mark file +HLP_CHGMULTFIL EQU 72 ;explain how to change multi file +; +; file system remove directory confirmation helps +; +HLP_NOTREMDIR EQU 73 ;do not remove the directory +HLP_REMOVEDIR EQU 74 ;remove the directory +; +; file system replace file error popup equates +; +HLP_REPLCESKIP EQU 75 ;skip this file, do not replace +HLP_REPLCEFILE EQU 76 ;explain replacing a file +; +; file system delete file confirm popup equates +; +HLP_SKIPFILE1 EQU 77 ;explain skip file help and cont +HLP_DELFILE EQU 78 ;explain deleteing file +; +; file system associate file option popup equates +; +HLP_OPTPRMPT EQU 79 ;use the option prompt +HLP_NOOPTPRMPT EQU 80 ;do not use the option prompt +; +; general file system help +; +HLP_VIEWDRIVE EQU 81 ;explain viewing a dir for a drive +HLP_NEWDIRNAME EQU 82 ;explain renaming directory +HLP_COPYDEST EQU 83 ;explain copy to destination +HLP_MOVDEST EQU 84 ;explain moving to destination +HLP_NEWFILENME EQU 85 ;explain new file name +HLP_STRTPRGOPT EQU 86 ;explain starting prog OPTIONS +HLP_NEWDIRFNME EQU 87 ;explain specifying new dir name +HLP_DIRSTRUCT EQU 88 ;explain the structure of dir +HLP_FILELIST EQU 89 ;help for highlighting file list +HLP_MARKFILE EQU 90 ;mark file help +HLP_ASSEXT EQU 91 ;associate file extensions help +HLP_GENVIEW EQU 92 ;general view file help +HLP_LISTDEL EQU 93 ;explain list of delete files +HLP_MOVFROM EQU 94 ;help for move file from: field +HLP_COPYFROM EQU 95 ;help for copy file from: field +; +; no help available message +; +HLP_NOHLPMSG EQU 96 ;no help message assigned +; +; more help for error message for the shell +; +HLP_SHLMEMREQ EQU 97 ;shell memory requirements +HLP_NODOSMEUF EQU 98 ;error msg for no menu file +HLP_MISSHLCLRF EQU 99 ;error msg for missing SHELL.CLR +HLP_DRIVEFAIL EQU 100 ;error msg for drive failure +HLP_MRKACTBAR EQU 101 ;error marking action bar +HLP_EMPTYFILE EQU 102 ;empty file, delete entry from lst +HLP_DELFILLIMT EQU 103 ;error msg for file limit +HLP_EMPTYMENU EQU 104 ;error msg for empty menu +HLP_MENULEVEL EQU 105 ;error message for max menu level +HLP_PSCQUOTE EQU 106 ;error message for no psc quote +HLP_PASSERR EQU 107 ;error message for bad password +HLP_PSCBADPARM EQU 108 ;error message for bad param num +HLP_PSCBUFOUT EQU 109 ;psc output buffer exceeded +HLP_PSCNORBRAC EQU 110 ;missing psc bracket help +HLP_PSCTITLE EQU 111 ;psc title too large +HLP_PSCINSTR EQU 112 ;psc instruction too large +HLP_PSCPROMPT EQU 113 ;psc prompt too large +HLP_PSCDEFAULT EQU 114 ;psc default too large +HLP_PSCMOD EQU 115 ;invalid modify option letters +HLP_COPYONSELF EQU 116 ;no copy file on itself +HLP_MENUFULL EQU 117 ;menu is full error +HLP_ROOTREDE EQU 118 ;can not rename, delete root +HLP_PSCBADNUM EQU 119 ;bad number in psc commands +HLP_PSCPARVAL EQU 120 ;use of uninitialized psc param +HLP_FILENOFOU EQU 121 ;file not found help +HLP_PATHNOFOU EQU 122 ;path not found help +HLP_ACCDENIED EQU 123 ;access denied help +HLP_DESTINCORR EQU 124 ;destination path incorrect +HLP_NOFREEMEM EQU 125 ;DOS unable to free memory +HLP_WRITEPRO EQU 126 ;disk write protected +HLP_DISKFULL EQU 127 ;disk full error +HLP_ASSLIMIT EQU 128 ;association file limit reached +HLP_ASSBADEXT EQU 129 ;bad extension for assocation file +HLP_ASSBADPRO EQU 130 ;bad program ext for association +HLP_INVPARNUM EQU 131 ;invalid number of parameter help +HLP_GENERAL EQU 132 ;general error help +HLP_INTRO EQU 133 ;shell introduction +HLP_DISKFAIL EQU 134 ;disk failure +HLP_DIREXMAX EQU 135 ;directories exceed maximum +HLP_OPTNOTACT EQU 136 ;option not active +HLP_STATUS EQU 137 ;status popup panel text +HLP_SGDRCOPY EQU 138 ;single drive copy not supported +HLP_ONEMARK EQU 139 ;function limited to one file +HLP_PRTINST EQU 140 ;print not installed +HLP_PRTQFULL EQU 141 ;print queue full +HLP_PRTNOSUB EQU 142 ;print cannot be submitted +HLP_BIGFILE EQU 143 ;filespec in psc > 76 chars +; *PCR +; APP_STATUS flag equates *PCR +; *PCR +APP_ERROR EQU 0000000000000001B ;general error has occured *PCR +APP_PSC EQU 0000000000000010B ;current item is psc *PCR +APP_MENU EQU 0000000000000100B ;current item is menu *PCR +APP_COPYOP EQU 0000000000001000B ;copy op in process *PCR +APP_REORDERDC EQU 0000000000010000B ;double click in reorder op *PCR +APP_RETRY EQU 0000000000100000B ;retry operation *PCR +APP_NOCLRSC EQU 0000000001000000B ;slctp clear screen *PCR +APP_INIT EQU 0000000010000000B ;memory initialization *PCR +APP_BIGERR EQU 0000000100000000B ;missing shell.meu error condition *PCR +APP_READ EQU 0000001000000000B ;read of menu on disk required *PCR +APP_COLRERR EQU 0000010000000000B ;call of proc_error from color chg *PCR +APP_REORDEROP EQU 0000100000000000B ;reorder operation in progress *PCR +APP_LVMFLDS EQU 0001000000000000B ;leave mflds active after pw check diff --git a/v4.0/src/INC/SHELLRD.INC b/v4.0/src/INC/SHELLRD.INC new file mode 100644 index 0000000..7d35d11 --- /dev/null +++ b/v4.0/src/INC/SHELLRD.INC @@ -0,0 +1,5111 @@ +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: SHELLRD.INC : +; : +; Description: Include file for SHELLRD.ASM : +; : +; Revised: 04-21-88 : +; : +;-----------------------------------------------------------------------------+ +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: INIT_GTEXT : +; : +; Description: Initialize the PCGRAPH parameter block with the PCB : +; contained in AX. : +; : +; Entry: AX = Panel ID to initialize into PCGRAPH parameter : +; block. : +; : +; Exit: ES:DI = Address of initialized PCGRAPH parameter : +; block. : +; : +; Entry point: INIT_GTEXT : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +INIT_GTEXT PROC NEAR +; + CALL FAR PTR GET_PCB ;return panel address at ES:DI +; + PUSH ES:[DI]+PCB_FLAGSEG ;flag string segment + PUSH ES:[DI]+PCB_FLAGOFF ;flag string offset + PUSH ES:[DI]+PCB_EXPANDSEG ;segment of text string + PUSH ES:[DI]+PCB_EXPANDOFF ;offset of text string + PUSH ES:[DI]+PCB_WIDTH ;width of panel + PUSH ES:[DI]+PCB_LROW ;lower right corner + PUSH ES:[DI]+PCB_UCOL ;column location of panel + PUSH ES:[DI]+PCB_UROW ;row location of panel + PUSH ES:[DI]+PCB_CCBID ;Index number of log color + MOV AL,ES:[DI]+PCB_OPT4 +; + LEA DI,GEN_DATA ;point graphics window structure + ; to data area + MOV [DI]+G_DRAWT_F,AL ;set flags + POP AX ;get color index + POP BX ;get upper row + MOV [DI]+G_DRAWTROWO,BX ;window row origin (top left) + POP [DI]+G_DRAWTCOLO ;window column origin + POP CX ;get lower row and calculate + SUB CX,BX ; number of lines in text panel + INC CX + MOV [DI]+G_DRAWTLINES,CX + POP [DI]+G_DRAWTLEN ;width of panel text +; + POP WORD PTR [DI].G_DRAWTSTRING + ;panel text string address + POP WORD PTR [DI+2].G_DRAWTSTRING + POP WORD PTR [DI].G_DRAWTFLAGS + ;panel text flag string address + POP WORD PTR [DI+2].G_DRAWTFLAGS +; + DEC [DI]+G_DRAWTROWO ;window row origin (top left) + DEC [DI]+G_DRAWTCOLO ;window column origin +; + MOV BX,G_DRAWT_WA+G_DRAWT_WC+G_DRAWT_UA + CMP [DI]+G_DRAWT_F,0 ;check if source flags option used + JE IGT10 +; + CMP WORD PTR [DI].G_DRAWTFLAGS,0 + JNE IGT10 +; + OR BX,G_DRAWT_UF ;set option to use source flags + ; option +; +IGT10: MOV [DI]+G_DRAWTOPT,BX ;option word + MOV [DI]+G_DRAWTSKIP,0 ;num bytes in source to next line +; + PUSH ES ;save pointer to panel data + PUSH DI + CALL FAR PTR GET_COLOR ;get color attribute + MOV AL,ES:[DI]+CCB_A1 ;get normal panel color + POP DI ;point back to panel data + POP ES + MOV [DI]+G_DRAWT_A,AL ;window attribute + MOV [DI]+G_DRAWTOUT,AL ;outline color attribute +; + MOV AX,DATA ;point to segment containing + MOV ES,AX ; general data area +; + RET +INIT_GTEXT ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PROCESS_SCROLL : +; : +; Description: Highlight mouse fields in the specified range as : +; the up and down arrows are used. The range of mouse : +; fields to highlight are specified in AX and BX with : +; intervening fields in consecutive order. The help : +; ID for each selection is calculated from the values : +; set to COM_HCBIDL and COM_HCBIDH. It is important : +; that the help equates are in sequential order. : +; : +; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ : +; COM_HCBIDL ÄÄ 1. First element to highlight ÄÄÄÄ AX : +; ³ 2. : : ³ : +; ³ 3. : : ³ : +; COM_HCBIDH ÄÄ 4. Last element to highlight ÄÄÄÄ BX : +; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : +; : +; : +; Entry: AX = First element to highlight : +; BX = Last element to highlight : +; : +; COM_HCBIDL = First element help ID : +; COM_HCBIDH = Last element help ID : +; COM_HCBID = Set to desired help ID for all selections: +; and set COM_HCBIDL and COM_HCBIDH to 0. : +; : +; COM_SCROPT = Set scroll option for multiple : +; selections. COM_HCBID and COM_CURPUPF : +; must be initialized before entry. : +; : +; Exit: COM_MOK 0= Mouse input : +; 1= Keyboard input : +; COM_KEY = Keystroke (keyboard or mouse value) : +; COM_ROW = Row of mouse pointer (text coordinates) : +; COM_COL = Column of mouse pointer (text coord) : +; COM_POSITION = Line number of scroll bar element : +; COM_CURRF = Current mouse field ID : +; COM_DELTA = Scroll bar delta from current top : +; element displayed in panel : +; COM_HCBID = Current help equate : +; : +; : +; Notes: None. : +; : +; Entry point: PROCESS_SCROLL : +; : +; Internal references: PCTRACK_CALL : +; PCINPUT_CALL : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PROCESS_SCROLL PROC FAR +; + PUSH AX ;save registers + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH ES + PUSH SI + PUSH DS +; +; initialize first highlighted field +; + MOV COM_HLPTEMP,0 ;set to unique scroll help +; + CMP COM_HCBIDL,0 ;check if unique scroll item + JNE SI04 ; help option active +; + CMP COM_HCBIDH,0 + JNE SI04 +; + PUSH COM_HCBID ;set help ID + POP COM_HLPTEMP +; +SI04: MOV COM_FLDT,2 ;scroll field type +; + MOV CX,BX ;calulate number of entries + SUB CX,AX ; in list + XOR CH,CH ;clear to zero + ADD CL,'1' ;adjust for string value + MOV COM_CNT,CX ;save value +; + CMP COM_SCROPT,1 ;when using this option make + JNE SI05 ; sure starting help ID initializd + ; to COM_HCBID and the current + ; field to highlight COM_CURPUPF +; + MOV DX,AX ;get first field + MOV AX,COM_CURPUPF ;make new mouse field the current + MOV COM_LASTF,AX ; field + JMP SI07 +; +SI05: MOV CX,COM_HCBIDL ;initialize starting help ID + MOV COM_HCBID,CX +; + MOV COM_CURPUPF,AX ;make new mouse field the current + MOV COM_LASTF,AX ; field + MOV DX,AX ;get first field +; +SI07: MOV CX,BX ;get last field + CALL FAR PTR LOC_MOUSEF ;get actual mouse field number + CALL FAR PTR MOUSE_OFF + CALL FAR PTR MOUSE_HIGH ;highlight mouse field + CALL FAR PTR MOUSE_ON +; +; Poll for keyboard or mouse input +; +SI10: CMP COM_HLPTEMP,0 ;check if single help ID selection + JE SI11 ; active +; + MOV AX,COM_HLPTEMP ;set single help ID for all scroll + MOV COM_HCBID,AX ; selections +; +SI11: MOV AX,0 ;turn monocasing off + CALL FAR PTR PROCESS_KEY ;get keystroke + + MOV BX,COM_KEY ;get keystroke +; +; Exit if mouse action +; +SI12: CMP COM_MOK,1 ;check if keyboard input + JE SI15 +; + CMP BX,ES:[DI]+KY_ENTER ;check if Enter pressed + JNE SI13 +; + CMP COM_SCROPT,1 ;is this the multiple select opt? + JE SI13 ;yes, jump out of procedure +; + MOV AX,COM_CURPUPF ;get current highlighted field + CALL FAR PTR GET_MOUSEF ;get mouse structure +; + MOV AX,ES:[DI]+MS_KEYS ;keystroke assigned to field + MOV COM_KEY,AX + MOV COM_MOK,0 ;set for keystroke input +; +SI13: JMP SIEXIT ;mouse action exit +; +; Process down arrow key +; +SI15: CMP BX,ES:[DI]+KY_DARROW ;check if up arrow pressed + JNE SI30 +; + CMP COM_CURPUPF,CX ;check if below last field + JAE SI20 +; + INC COM_HCBID ;point to next help equate + INC COM_CURPUPF ;no, point to next field + JMP SI45 ;now change highlight +; +SI20: PUSH COM_HCBIDL ;initialize help to first field + POP COM_HCBID + MOV COM_CURPUPF,DX ;yes, point to first field + JMP SI45 ;now change highlight +; +; process up arrow key +; +SI30: CMP BX,ES:[DI]+KY_UARROW ;check if up arrow pressed + JNE SI50 +; + CMP COM_CURPUPF,DX ;check if above first field + JBE SI40 +; + DEC COM_HCBID ;point to next help equate + DEC COM_CURPUPF ;no, point to previous field + JMP SI45 +; +SI40: PUSH COM_HCBIDH ;initialize help to last field + POP COM_HCBID + MOV COM_CURPUPF,CX ;yes, point to last field +; +; Remove last field highlight and display new highlight +; +SI45: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off +; + MOV AX,COM_LASTF ;unhighlight last mouse field + CALL FAR PTR LOC_MOUSEF ;get actual field number + CALL FAR PTR MOUSE_UNHIGH +; + MOV AX,COM_CURPUPF ;highlight current mouse field + CALL FAR PTR LOC_MOUSEF ;get actual field number + CALL FAR PTR MOUSE_HIGH +; + CALL FAR PTR MOUSE_ON ;turn mouse pointer on +; + MOV AX,COM_CURPUPF ;set last field as current + MOV COM_LASTF,AX + JMP SI10 ;poll for next keystroke +; +; Process Enter key +; +SI50: CMP BX,ES:[DI]+KY_ENTER ;check if Enter pressed + JNE SI60 +; + CMP COM_SCROPT,1 ;is this the multiple select opt? + JE SIEXIT ;yes, jump out of procedure +; + MOV AX,COM_CURPUPF ;get current highlighted field + CALL FAR PTR GET_MOUSEF ;get mouse structure +; + MOV AX,ES:[DI]+MS_KEYS ;keystroke assigned to field + MOV COM_KEY,AX + MOV COM_MOK,0 ;set for keystroke input + JMP SIEXIT ;exit process_scroll +; +; if escape key, exit +; +SI60: CMP BX,ES:[DI]+KY_CANCEL ;check if Escape pressed + JNE SI70 +; + JMP SIEXIT +; +; if not multiple select, exit on number +; +SI70: CMP COM_SCROPT,1 ;is this the multiple select opt? + JE SI90 ;yes, jump to check space bar +; + CMP BX,'1' ;compare to a one + JB SI80 +; + CMP BX,COM_CNT ;compare to number of entries + JBE SIEXIT +; +SI80: JMP SI100 ;poll for next keystroke +; +; multiple select, exit on spacebar +; +SI90: CMP BX,ES:[DI]+KY_SELECT ;was this the space bar? + JE SIEXIT ;yes, exit routine +; +SI100: CALL FAR PTR PCMBEEP_CALL ;beep on unknown keystroke P*3940 + JMP SI10 ;poll for next keystroke +; +; Unhighlight field before exit +; +SIEXIT: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off + MOV AX,COM_CURPUPF ;get last field +; + CALL FAR PTR LOC_MOUSEF + CALL FAR PTR MOUSE_UNHIGH ;unhighlight field before exit + CALL FAR PTR MOUSE_ON ;turn mouse point on +; + MOV COM_FLDT,0 ;no field type +; + POP DS ;restore registers + POP SI + POP ES + POP DI + POP DX + POP CX + POP BX + POP AX +; + RET +PROCESS_SCROLL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PROCESS_INPUT : +; : +; Description: Display input field contents relative to location of : +; associated panel and optionally process keystroke : +; before returning. : +; : +; Entry: COM_ICBID = Input field ID to process. : +; COM_HCBID = Help ID assigned to input field. : +; COM_INOPT 0= Display data entry : +; 1= Do not display data entry (Password) : +; : +; Exit: ES:DI = Address of input field data : +; CX = Length of data : +; AX = Return key : +; : +; COM_MOK 0= Mouse input : +; 1= Keyboard input : +; COM_KEY = Keystroke (keyboard or mouse value) : +; COM_ROW = Row of mouse pointer (text coordinates) : +; COM_COL = Column of mouse pointer (text coord) : +; COM_CURRF = Current mouse field ID : +; COM_DELTA = Scroll bar delta from current top : +; element displayed in panel : +; : +; : +; Entry point: PROCESS_INPUT : +; : +; Notes: None. : +; : +; Internal references: GET_ICB = Get specified input control block. : +; : +; PCINPUT_CALL = Call to external CAS routine. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PROCESS_INPUT PROC FAR +; + PUSH BX + PUSH DX +; +; initialize +; + MOV COM_FLDT,1 ;input field +; + MOV IN_CURNOR,0607H ;non-mono cursor size +; + CMP GV_VIDMODE,7 ;check if mono mode + JNE PH03 +; + MOV IN_CURNOR,0C0DH ;mono cursor size +; +; remove mouse pointer +; +PH03: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off +; +; locate specified input control block +; + MOV AX,COM_ICBID ;get PCINPUT field + MOV IN_ICBID,AX + CALL FAR PTR GET_ICB ;ES:DI points to ICB +; +; initialize, display and exit field +; + AND ES:[DI]+ICB_OPT1,NOT ICB_PSW + ;deactivate password option + CMP COM_INOPT,0 ;check if password option is on + JE PH04 +; + OR ES:[DI]+ICB_OPT1,ICB_PSW ;activate password option +; +PH04: AND ES:[DI]+ICB_STATUS,NOT ICB_DONE + AND ES:[DI]+ICB_STATUS,NOT ICB_SINS +; + MOV ES:[DI]+ICB_CURCHAR,1 +; +PH05: OR ES:[DI]+ICB_OPT4,ICB_INIT + AND ES:[DI]+ICB_OPT3,NOT ICB_KEY + CALL FAR PTR PCINPUT_CALL ;initialize field + AND ES:[DI]+ICB_OPT4,NOT ICB_INIT + OR ES:[DI]+ICB_OPT3,ICB_KEY + ;remove initialization option +; +; Process field +; +PH06: XOR AX,AX + OR ES:[DI]+ICB_OPT3,ICB_KEY + AND ES:[DI]+ICB_OPT4,NOT ICB_INIT + TEST ES:[DI]+ICB_OPT2,ICB_UPC ;check if monocasing option active + JE PH07 +; + MOV AX,0000000000000001B ;set monocasing option on +; +PH07: TEST IN_OPT,IN_UTRAN ;check if translation option actv + JE PH10 +; + MOV AX,0000000000000010B ;set translation option on +; +; display mouse pointer +; +PH10: CALL FAR PTR MOUSE_ON ;turn mouse pointer on +; +; Poll keyboard and mouse +; + CALL FAR PTR PROCESS_KEY + MOV AX,COM_KEY ;get keystroke +; + CMP COM_MOK, 0 ;mouse field? + JNE PH12 ;no, continue + CMP COM_RSTFLD, 0 ;restrict mouse field? + JE PH12 ;no, continue + CMP AH, 0 ;extended char? + JE PH12 ;no, continue + CMP AL,0 ;unrestricted extended char? + JE PH12 ;yes, continue + CMP AL, COM_RSTFLD ;mouse field in current set? + JNE PH11 ;no, return new field index + XOR AL, AL ;clear ID byte +comment | + cmp ah, rtarrow ; + jne ph1005 ; + mov es,in_icbseg ; + mov di,in_icboff ; + inc es:[di]+icb_hrstart ; + INC ES:[DI]+ICB_CURCHAR ; + AND ES:[DI]+ICB_OPT3,NOT ICB_KEY + OR ES:[DI]+ICB_OPT4,ICB_INIT + jmp ph12 ; +ph1005: cmp ah, lfarrow ; + jne ph12 ; + mov es,in_icbseg ; + mov di,in_icboff ; + dec es:[di]+icb_hrstart ; + DEC ES:[DI]+ICB_CURCHAR ; + AND ES:[DI]+ICB_OPT3,NOT ICB_KEY + OR ES:[DI]+ICB_OPT4,ICB_INIT + | + JMP PH12 ;continue +PH11: XOR AH, AH ;clear keystroke byte +; +PH12: MOV COM_KEY, AX ;update keystroke + CALL FAR PTR MOUSE_OFF ; +; +; Pass keystroke to input field for processing +; +PH50: MOV ES,IN_ICBSEG ;point to current ICB + MOV DI,IN_ICBOFF + MOV ES:[DI]+ICB_KS,AX ;set keystroke to ICB +; + CALL FAR PTR PCINPUT_CALL ;process input field +; + MOV ES,IN_ICBSEG ;point to current ICB + MOV DI,IN_ICBOFF +; + MOV AX,ES:[DI]+ICB_KS ;return keystroke +; + TEST ES:[DI]+ICB_STATUS,ICB_DONE + jne ph51 + jmp PH06 ;check for exit condition +; +ph51: CALL FAR PTR MOUSE_ON ;turn mouse pointer on + CALL FAR PTR CURSOROFF ;turn hardware cursor off + MOV COM_FLDT,0 ;no field type + MOV COM_INOPT,0 ;no password option +; + MOV DX,ES:[DI]+ICB_OPT4 ;get option word 4 +; + PUSH ES:[DI]+ICB_ENDBYTE ;return length of data + PUSH ES:[DI]+ICB_FIELDOFF ;return offset of data + PUSH ES:[DI]+ICB_FIELDSEG ;return segment of data +; + POP ES + POP DI + POP CX +; + TEST DX,ICB_TRUN ;field is DOS pathname? + JZ PH60 ;no, continue +; + MOV SI,DI ;save string offset + ADD DI,CX ;get end of string offset + MOV BYTE PTR ES:[DI],0 ;null-terminate pathname + MOV DI,SI ;restore string offset +; + CALL TRUNC_NAME ;truncate DOS names & extensions + PUSH ES ;MJK005 + PUSH DI ;MJK005 + MOV ES,IN_ICBSEG ;point to current ICB ;MJK005 + MOV DI,IN_ICBOFF ;MJK005 + MOV ES:[DI]+ICB_ENDBYTE,CX ;return length of data ;MJK005 + POP DI ;MJK005 + POP ES ;MJK005 +; +PH60: POP DX + POP BX +; + RET +PROCESS_INPUT ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PROCESS_KEY : +; : +; Description: Poll keyboard then mouse return only if action : +; occurs. : +; : +; Entry: AX 0000000000000001 = Monocasing : +; 0000000000000010 = Translation table : +; : +; COM_HLPOPT = set to 10 to deactivate help : +; COM_HCBID = Help ID assigned to input field. : +; : +; Exit: COM_MOK 0= Mouse input : +; 1= Keyboard input : +; COM_KEY = Keystroke (keyboard or mouse value) : +; COM_ROW = Row of mouse pointer (text coordinates) : +; COM_COL = Column of mouse pointer (text coord) : +; COM_CURRF = Current mouse field ID : +; COM_DELTA = Scroll bar delta from current top : +; element displayed in panel : +; : +; COM_FLDT 0= no field used to determine if : +; 1= input field cursor should be displayed : +; 2= scroll field : +; : +; Entry point: PROCESS_KEY : +; : +; Notes: None. : +; : +; Internal references: PCTRACK_CALL = Call to external CAS routine. : +; PCINPUT_CALL = Call to external CAS routine. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PROCESS_KEY PROC FAR +; + PUSH AX ;save registers + PUSH BX + PUSH CX + PUSH DX +; + MOV INC_KS,0 ;initialize to no keystroke + MOV INC_OPT,0 +; + TEST AX,0000000000000001B ;check if monocasing + JE PK05 +; + OR INC_OPT,INC_AMONO ;initialize to monocasing + CMP IN_MONOSEG,0 ;monocasing table gotten? P5197 + JNE PK02 ;yes, don't get again P5197 + CALL GET_MONO_DOS ;get DOS monocasing table P5197 +PK02: ; P5197 + MOV BX,IN_MONOOFF ;get from PCINPUT control block + MOV INC_MONOOFF,BX ;set in PCINCHA control block + MOV BX,IN_MONOSEG ;get from PCINPUT control block + MOV INC_MONOSEG,BX ;set in PCINCHA control block +; +PK05: TEST AX,0000000000000010B ;check if translation table + JE PK10 +; + OR INC_OPT,INC_UTRAN ;initialize for translation table +; +; Poll keyboard for input +; +PK10: MOV KS_CHAR,0 ;clear out P*4663 + TEST COM_PROCFLAG,COM_KPLOCK ;keyboard locked? P*4457 + JZ PK17 ;no, get keystroke P*4457 + IN AL,64H ;get keyboard lock bit P*4457 + TEST AL,10H ;is keyboard locked? P*4457 + JNZ PK15 ;OK, keyboard not locked P*4457 + JMP PK40 ;check time/date P*4457 +PK15: + CALL INIT_MOUSE ;initialize mouse P*4457 + CALL MOUSE_ON ;turn on mouse P*4457 +PK17: ; P*4457 + + + MOV AH,1 ;keystroke status MJK013 + TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732 + JZ PK17_05 ;no, get normal keystroke P*4732 + MOV AH,11H ;get extended keystroke P*4732 +PK17_05: ; P*4732 + INT 16H ;is there any keystrokes? MJK013 + JZ PK17_10 ;don't save keystroke P*4663 + MOV KS_CHAR,AX ;save the keystroke MJK013 +PK17_10: ; P*4663 +; + CALL PCINCHA_CALL ;call CAS routine +; + CMP INC_KS,0 ;check if keystroke returned + JE PK20 ;yes, pass to input field +; + CMP INC_KS, 0003H ;ctrl/c or ctrl/break? P*4663 + JNE PK18 ;no, continue P*4663 + MOV AX, KS_CHAR ;get status keystroke P*4663 + CMP AL, 03H ;same ASCII character? P*4663 + JE PK19 ;yes, must be ctrl/c P*4663 + MOV INC_KS, 0 ;ignore ctrl/break P*4663 + JMP PK40 ;continue P*4663 +PK18: ; p*4663 + + CMP INC_KS, 6800H ;keystroke is alt-f1? + + JNE PK19 ;no, continue + MOV INC_KS, 8500H ;translate to f11 +; +PK19: CALL CHK_OVERRUN ;check for overrun keystrokes +; + MOV COM_MOK,1 ;set to indicate keyboard + XOR AX,AX ;clear to zero + MOV COM_ROW,AX ; pointer row + MOV COM_COL,AX ; pointer column + MOV COM_DELTA,AX ; scroll bar delta + MOV AX,INC_KS ;set keystroke from keyboard + MOV COM_KEY,AX +; + MOV AX,COM_CURRF ;sav field ID before help process + MOV COM_HELPF,AX +; + JMP PK30 +; +; Poll mouse for action +; +PK20: TEST COM_STATE,COM_MOUS ;check if mouse configured + JNE PK22 ; do call if no + JMP PK40 ; skip call if yes +; +PK22: LEA DI,GEN_DATA ;check mouse for button press + MOV [DI]+M_FUNC,M_GET + CALL FAR PTR PCTRACK_CALL +; + XOR CH,CH ;clear to zero + XOR DH,DH ;clear to zero + MOV CL,[DI]+M_GETBUT ;get button pressed + MOV DL,[DI]+M_GETFIELD ;get field of current pointer +; + CMP CL, 2 ;process keystroke + JNE PK24X +; + TEST COM_STATE2,COM_ENHA + JZ PK24X +; + MOV COM_BUT2,1 + MOV CL, 1 + JMP PK24 +; +PK24X: MOV COM_BUT2,0 + CMP CL,1 ;mouse configuration + JE PK24 ; 0= no button pressed +; + CMP CL,4 ; 1= button 1 pressed + JE PK24 ; 2= button 2 pressed + ; 3= button 3 pressed + ; 4= double click button 1 + JMP PK40 +; +PK24: OR DL,DL ;check if pointer in active field + JNZ PK26 ; when button pressed, if not + JMP PK40 ; poll again +; +PK26: CMP GE_MODEL,MODEL_AT ;check if AT + JNE PK29 +; + CMP GE_SUBMODEL,SUBMD_AT ;make sure AT + JE PK28 +; + CMP GE_SUBMODEL,SUBMD_AS ;make sure AT/skyrocket + JNE PK29 +; +PK28: CALL KEYLOCK ;check if keyboard on AT is + JNZ PK29 +; + JMP PK40 ; locked, poll again +; +PK29: MOV COM_MOK,0 ;set to indicate mouse + MOV AX,COM_CURRF ;sav field ID before help process + MOV COM_HELPF,AX + MOV COM_CURRF,DX ;set current field number + MOV AX,[DI]+M_GETROW ;get mouse pointer row where + MOV COM_ROW,AX ; button was pressed + MOV AX,[DI]+M_GETCOL ;get mouse pointer column where + MOV COM_COL,AX ; button was pressed + MOV AX,[DI]+M_GETFKEY ;get keystroke assigned to field + MOV COM_KEY,AX +; + MOV AX,[DI]+M_GETDELTA ;scroll delta (if in sb field) + MOV COM_DELTA,AX + XOR CX,CX + MOV AX,[DI]+M_GETSPOS ;text row/col position in bar + MOV COM_POSITION,AX +; +; Check for help option before exit +; +PK30: CMP COM_HLPOPT,10 ;check if help deactivated + JE PKEXIT ;exit +; + MOV AX,STR_TOTAL ;get keystroke structure + CALL FAR PTR GET_STRING ;structure at ES:DI +; + MOV AX,COM_KEY ;get keystroke + CMP AX,ES:[DI]+KY_CHELP + JNE PKEXIT +; + CALL FAR PTR CURSOROFF ;turn hardware cursor off + PUSH COM_HELPF ;save field ID before help process + CALL MANAGE_HELP ;process all types of help + POP COM_CURRF ;reset original field ID before hl +; + CMP COM_FLDT,1 ;redisplay cursor if input field + JNE PK40 +; + CALL FAR PTR CURSORON ;turn hardware cursor on +; +; Check if date and time should be updated. +; +PK40: CALL DISP_DATETIME ;update date/time + JMP PK10 +; +; Exit +; +PKEXIT: PUSH ES + PUSH DI + MOV AX, 40H + MOV ES, AX + MOV BX, 17H + MOV AL, ES:[BX] + XOR AH, AH + MOV COM_SHIFT, AX + POP DI + POP ES +; + POP DX ;exit + POP CX + POP BX + POP AX +; + RET +PROCESS_KEY ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; P5197 : +; GET_MONO_DOS : +; Get segment and offset of the DOS monocasing table and return it : +; : +; Entry: None : +; : +; Exit: None : +; P5197 : +;-----------------------------------------------------------------------------+ +GET_MONO_DOS PROC NEAR +; + PUSH ES ; P5197 + PUSH DI ; P5197 + PUSH AX ; P5197 +; + MOV AH,65H ;extended country info P5197 + MOV AL,04H ;get uppercase table ptrs P5197 + MOV BX,-1 ;default code page P5197 + MOV DX,-1 ;default country id P5197 + MOV CX,05H ;# bytes returned P5197 + PUSH DS + POP ES ;ES:DI ptrs to return buf P5197 + MOV DI,OFFSET TEMP_WKA ;use as temp buffer P5197 + INT 21H + JC GET_MONO_RET +; + INC DI ;skip info id P5197 +; + MOV AX,WORD PTR [DI] ;get DOS mono table offset P5197 + MOV IN_MONOOFF,AX ;save it P5197 + ADD DI,2 + MOV AX,WORD PTR [DI] ;get DOS mono table seg P5197 + MOV IN_MONOSEG,AX ;save it P5197 +; +GET_MONO_RET: + POP AX ; P5197 + POP DI ;restore registers P5197 + POP ES ; P5197 +; + RET ; P5197 +GET_MONO_DOS ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: CHK_OVERRUN : +; : +; Description: Check for multiple entries of cursor keys to : +; eliminate overrun in typeamatic mode. : +; : +; Entry: INC_KS = Key stroke : +; : +; Exit: INC_KS = Returned keystroke : +; : +; Entry point: CHK_OVERRUN : +; : +; Notes: Duplicate cursor keystrokes are removed. : +; : +; Internal references: PCINCHA_CALL = Call to external CAS routine. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +CHK_OVERRUN PROC NEAR +; + PUSH CX + PUSH DI + PUSH ES +; + MOV CX,KS_TABLE_LEN ;len of cursor keystroke table + ROR CX,1 ;set number of entries + MOV AX,DS ;get segment of table + MOV ES,AX ;set segment of table + MOV DI,OFFSET KS_TABLE ;offset of table + MOV AX,INC_KS ;current keystroke + CLD + REPNZ SCASW ;scan table for keystroke match + JNZ CHK_OVRET ;no match found +; +CHK_OV10: MOV AH,1 ;keystroke status + TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732 + JZ CHK_OV20 ;no, get normal keystroke P*4732 + MOV AH,11H ;get extended keystroke P*4732 +CHK_OV20: ; P*4732 + INT 16H ;check for next keystroke + JZ CHK_OVRET ;no, keystroke available +; + CMP AX,KS_CHAR ;is it the same as before MJK013 + JNE CHK_OVRET ;no, return +; + MOV AH,0 ;keystroke read + TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732 + JZ CHK_OV30 ;no, get normal keystroke P*4732 + MOV AH,10H ;get extended keystroke P*4732 +CHK_OV30: ; P*4732 + INT 16H ;remove it + JMP CHK_OV10 ;check next keystroke +; +CHK_OVRET: POP ES + POP DI + POP CX +; + RET +CHK_OVERRUN ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: DISP_DATETIME : +; : +; Description: display the date and time on the display. : +; : +; Entry: COM_STATE2: : +; COM_DATE = O - no date displayed : +; 1 - display date and time : +; : +; Exit: Display updated : +; : +; Entry point: DISP_DATETIME : +; : +; Notes: None. : +; : +; Internal references: UPDATE_DISPLAY : +; MOUSE_OFF : +; MOUSE_ON : +; : +; External references: PCDATES_CALL = Call to external CAS routine. : +; PCTIMES_CALL = Call to external CAS routine. : +; : +;-----------------------------------------------------------------------------+ +; +DISP_DATETIME PROC NEAR +; + PUSH AX ;save registers + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + PUSH ES +; + TEST COM_STATE2,COM_DATE ;is the date option active? + JNZ DT_02 ;yes, continue + JMP DT_RET ;return +; +; Set up to get the date and time. +; +DT_02: MOV DI,OFFSET TIME_WKA ;time workarea + MOV BX,DS:[DI+4] ;save currect seconds +; + CALL PCDATES_CALL ;get date +; + CALL PCTIMES_CALL ;get time +; + TEST COM_PROCFLAG,COM_NODATE ;should date not be displayed? + JNZ DT_RET ;yes, return +; + TEST COM_PROCFLAG,COM_PSCEXEC ;has PSC ended execution? + JZ DT_05 ;no, continue +; + AND COM_PROCFLAG,NOT COM_PSCEXEC ;reset PSC ended execution + JMP DT_20 ;display time/date + +DT_05: MOV AX,COM_BASESCR ;get base screen + CMP AX,COM_BASE_WKA ;has it changed? + JE DT_10 ;no, see if time has changed +; + MOV COM_BASE_WKA,AX ;save new base screen + JMP DT_20 ;continue +; +DT_10: CMP BX,DS:[DI+4] ;has the time minutes changed? + JE DT_RET ;no, don't update it +; +DT_20: MOV SI,PAN_ATITLE ;get panel id for moveg + MOV AX,1 ;row to display + MOV BX,3 ;column to display + MOV CX,LENGTH DATE_WKA ;len of date + MOV DX,OFFSET DATE_WKA + PUSH DS + POP ES +; + CALL FAR PTR MOUSE_OFF ;turn mouse off +; + PUSH AX ; + MOV AX, PAN_ATITLE ;set panel id + CALL FAR PTR GET_ATTR ;get color attr + AND AH, 0F0H ;mask off foreground + CMP AH, 0F0H ;background is white? + POP AX ; + JNE DT_28 ;no, continue + MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816 +DT_28: + +; CMP GV_VIDMODE,11H ;mode 11? P*4816 +; JNE DT_30 ;no, don't underline P*4816 +; MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816 + + +DT_30: ; P*4816 + CALL UPDATE_DISPLAY ;display date +; + MOV BX,69 ;column to display + MOV CX,LENGTH TIME_WKA ;len of time + MOV DX,OFFSET TIME_WKA +; + PUSH AX ; + MOV AX, PAN_ATITLE ;set panel id + CALL FAR PTR GET_ATTR ;get color attr + AND AH, 0F0H ;mask off foreground + CMP AH, 0F0H ;background is white? + POP AX ; + JNE DT_38 ;no, continue + MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816 +DT_38: + + +; CMP GV_VIDMODE,11H ;mode 11? P*4816 +; JNE DT_40 ;no, don't underline P*4816 +; MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816 +DT_40: ; P*4816 + CALL UPDATE_DISPLAY ;display time +; + CALL FAR PTR MOUSE_ON ;turn mouse on +; +DT_RET: POP ES ;restore registers + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX +; + RET +DISP_DATETIME ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: KEYLOCK : +; : +; Description: Determine if AT keyboard lock is on. : +; : +; Entry: None. : +; : +; Exit: ZF = 1 : keyboard is locked : +; ZF = 0 : keyboard is unlocked : +; : +; Entry point: KEYLOCK : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +KEYLOCK PROC NEAR +; + PUSH BX + PUSH CX +; + CLI ;disable ints while checking kybd + MOV AL,READ_KBD_INPT ;get kybd read input command + OUT STATUS_PORT,AL ;issue the command + SUB CX,CX ;cls controller count cmd issue +; +KEYLOCK10: IN AL,STATUS_PORT + TEST AL,INPT_BUF_FULL + LOOPNZ KEYLOCK10 ;wait for command to be accepted + JNZ KEYLOCK50 ;exit if command not accepted +; + SUB CX,CX + MOV BL,6 +; +KEYLOCK20: IN AL,STATUS_PORT + TEST AL,OUTPT_BUF_FULL + JNZ KEYLOCK30 ;branch if OBF +; + LOOP KEYLOCK20 ;loop until response or timeout + DEC BL ;timeout loop attempted six times + JNZ KEYLOCK20 +; + INC BL ;set ZF = 0 if no response + JMP KEYLOCK50 +; +KEYLOCK30: IN AL,INPUT_PORT ;read keyboard input port + TEST AL,KYBD_INH ;test to see if kybd lock is on +; +KEYLOCK50: +; +KEYLOCK60: STI ;enable ints + POP CX ;restore regs + POP BX +; + RET ;Exit +KEYLOCK ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: COMMAND_LINE : +; : +; Description: Command line dialog. : +; : +; Entry: COM_OLDCBKOFF = offset of original crtl+break : +; COM_OLDCBKSEG = segment of original crtl+break : +; COM_CMDBUF = required to invoke COMMAND.COM : +; COM_CMDINPBUF = command line input buffer : +; COM_CMDINPLEN = length of command line input buf : +; COM_CMDBUFLEN = length including '/C' : +; COM_CMDDRIVE = current drive and path to display : +; COM_CMDPATH for command line input prompt : +; KY_COMDLINE = command line Shift + F9 : +; KY_LASTCOMD = last command up arrow : +; KY_NEXTCOMD = next command dn arrow : +; Exit: : +; : +; Entry point: COMMAND_LINE : +; : +; Notes: Changed procedure to use a COMMAND.COM PSC execution. : +; : +; Internal references: PCTRACK_CALL : +; : +; External references: INT 21H AH=40H Write string to standard output. : +; INT 21H AH=25H Set interrupt vector address. : +; INT 21H AH=35H Get interrupt vector address. : +; INT 21H AH=49H Deallocate memory. : +; INT 21H AH=47H Read current directory. : +; INT 21H AH=19H Read current disk. : +; INT 21H AH=06H Write char to standard output. : +; INT 21H AH=4BH EXEC command line. : +; : +;-----------------------------------------------------------------------------+ +; +COMMAND_LINE PROC FAR + + TEST COM_STATE,COM_FLCL ;check if command line active + JNE MC10 +; + CALL FAR PTR OPT_INACTIVE ;display error panel for inactive *PCR + JMP MCEXIT ;exit +; +; save registers +; +MC10: CALL FAR PTR REMOVE_OLDPD ;remove last pull down panel + MOV COM_CURPD,0 +; + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH BP + PUSH SI + PUSH DI +; +; disable mouse tracker +; + CALL FAR PTR MOUSE_OFF ;turn mouse pointer off + CALL FAR PTR DEL_MOUSEF ;delete all mouse fields + CALL FAR PTR MOUSE_DIS ;disable mouse support +; +; Set current directory path +; + CMP COM_CDIALOG,COM_APPMENU ;check if program menu dialog + JNE MC20 ; don't ask for dir from DOS Serv +; + JMP MC30 +; +MC20: CMP COM_CDIALOG,COM_PAAB ;check if program menu dialog + JE MC30 ; don't ask for dir from DOS Serv +; + CMP COM_CDIALOG,COM_DCLR ;check if program menu dialog + JE MC30 ; don't ask for dir from DOS Serv +; + XOR AX,AX ;get current selected directory + MOV AX,1 ;get current selected dir ;P*4245 + CALL RETURN_PATH ; in DOS services +; + MOV BX,OFFSET FULLSPEC ;file name + MOV DL,DS:BYTE PTR[BX] ;drive id + CALL SET_DRIVE ;set to the drive +; + PUSH DI + MOV AH,0EH ;change to selected drive + MOV DX,DATA + MOV DS,DX + LEA DI,FULLSPEC + MOV DL,[DI] + SUB DL,'A' + INT 21H + POP DI +; + MOV AH,3BH ;change to selected directory + MOV DX,DATA + MOV DS,DX + LEA DX,FULLSPEC + INT 21H +; +; Move in COMSPEC to PSC workarea for new COMMAND.COM PSC execution. +; +MC30: MOV SI,OFFSET COM_PFILSPEC ;COMSPEC location +; + mov dl, byte ptr [si] ;get drive letter of comspec + call set_drive ;set logical drive +; + MOV DI,OFFSET PEC_COM ;PSC workarea location + MOV PEC_BYTE,0 ;clear length +; +MC40: MOV AL,DS:BYTE PTR [SI] ;get character + CMP AL,0 ;end of string? + JE MC50 ;yes, add parm sep char +; + MOV DS:BYTE PTR [DI],AL ;put character in PSC workarea + INC PEC_BYTE ;adjust length + INC SI ;point to next COMSPEC char + INC DI ;point to next PSC position + JMP MC40 ;get next character +; +MC50: MOV DS:BYTE PTR [DI],PEC_SEP ;set parameter seperator char + INC PEC_BYTE ;adjust length + PUSH DS + POP ES ;set segment of PSC workarea + MOV DI,OFFSET PEC_TITLE ;set offset of PSC workarea + + OR COM_PROCFLAG,COM_CMDPSC ;set COMMAND.COM PSC exec P*3748 + CALL FAR PTR PROCESS_PSC ;set up to process PSC +; + POP DI ;restore registers + POP SI + POP BP + POP DX + POP CX + POP BX + POP AX +; +MCEXIT: +; + RET +COMMAND_LINE ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; SET_DRIVE : +; : +; On a single drive system, set the logical to the physical drive. : +; : +; Entry: DL - Drive letter : +; : +; Exit: Logical drive set : +; : +; Notes: None : +; : +;-----------------------------------------------------------------------------+ +; +SET_DRIVE PROC NEAR + + PUSH BX ; P*4831 + PUSH DX ; P*4831 + PUSH AX ; P*4831 + + AND DL,0DFH ; convert it to P*4831 + SUB DL,40H ; an binary number. P*4831 + MOV BL,DL + MOV AX,440FH ; I/O control P*4831 + INT 21H ; set logical drive letter P*4831 + + POP AX ; P*4831 + POP DX ; P*4831 + POP BX ; P*4831 + RET ; return to caller P*4831 + +SET_DRIVE ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCCLRRD_CALL : +; : +; Description: Call to PCCLRRD. : +; : +; Entry: PCCLRRD parameter block initialized. : +; : +; Exit: PCCLRRD parameter block initialized. : +; : +; Entry point: PCCLRRD_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCCLRRD_CALL PROC NEAR ;*PCR (ENTIRE PROC) +; + PUSH DS ;Set segment + POP ES +; + PUSH DS + PUSH DI ;Save registers +; + LEA DI,CRD_OPT1 ;Set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;Make call to CAS-RM + MOV BX,CRD_RN ;Set cas routine number + INT CASINT ;Call routine +ELSE + CALL CLRRD +ENDIF +; +; copy the color index vector into buffer below clrrd buffer +; + MOV AX,16 ;calc length of color read and + MOV BX,MAX_COLRBUF ; write buffers + MUL BX ;# paragraphs * 16 = # bytes + SUB AX,500 ;leave room for safe buffer + ADD AX,CRD_BUFOFF ;add current crd buf offset + MOV DI,AX + MOV SI,CRD_CCBVECOFF ;get source address + MOV CRD_CCBVECOFF,DI ;set destination offset +; + CMP CRD_ERROR,0 ;was there an error + JNE CR_EXIT ;yes, don't overwrite + CMP CRD_DOSERROR,0 ;was there an error + JNE CR_EXIT ;yes, don't overwrite +; + MOV ES,CRD_BUFSEG ;set destination segment + MOV CX,CRD_CCBVECLEN ;get the length to move + PUSH DS + MOV AX,CRD_CCBVECSEG ;set source segment + MOV DS,AX +; + REP MOVSB ;move the data + POP DS +; +CR_EXIT: POP DI ;Restore registers + POP DS +; + RET +PCCLRRD_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: SET_DEFAULT : +; : +; Description: Set default value in specified ICB control block. : +; : +; Entry: ES:DI = Address of default value. : +; CX = Length of string. : +; AX = ICB number of input field. : +; : +; Exit: None. : +; : +; Entry point: None. : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +SET_DEFAULT PROC FAR +; + PUSH ES ;save default segment + PUSH DI ;save default offset +; + CALL FAR PTR GET_ICB ;get input control block +; + MOV ES:[DI]+ICB_CURCHAR,1 ;reset starting cursor position + MOV ES:[DI]+ICB_DEFLEN,CX ;set length + POP ES:[DI]+ICB_DEFOFF ;offset + POP ES:[DI]+ICB_DEFSEG ;segment +; + RET +SET_DEFAULT ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: GET_PCB : +; : +; Description: Return address of specified panel control block. : +; : +; Entry: AX = Number of PCB vector desired. : +; : +; COM_PCBVECSEG = PCB vector segment. : +; COM_PCBVECOFF = PCB vector offset. : +; COM_PCBVECLEN = number of bytes in each vector : +; : +; Exit: ES:DI = Address of specified PCB : +; : +; Entry point: : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +GET_PCB PROC FAR +; + PUSH AX + PUSH BX + PUSH CX + PUSH DX +; +; read panel control block vector to obtain PCB address +; + MOV BX,COM_PCBVECSEG ;get beginning PCB vector address + MOV ES,BX + MOV DI,COM_PCBVECOFF +; + DEC AX ;make zero based + MOV BX,COM_PCBVECLEN ;multiply PCB element length by + ; desired vector number in BX + MUL BX ; to determine offset into PCB vec + ADD DI,AX ;add offset inside table + MOV BX,ES:[DI] ;get actual PCB segment + MOV CX,ES:[DI]+2 ;point past PCB seg to get PCB off +; + MOV ES,BX ;set ES:DI to panel's actual + MOV DI,CX ; PCB address +; + POP DX + POP CX + POP BX + POP AX +; + RET +GET_PCB ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: GET_SCB : +; : +; Description: Return address of specified scroll control block. : +; : +; Entry: AX = Number of SCB vector desired. : +; : +; COM_SCBVECSEG = SCB vector segment. : +; COM_SCBVECOFF = SCB vector offset. : +; COM_SCBVECLEN = number bytes in each vector : +; : +; Exit: ES:DI = Address of specified SCB : +; : +; Entry point: : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +GET_SCB PROC NEAR +; + PUSH AX + PUSH BX + PUSH CX + PUSH DX +; +; read panel control block vector to obtain SCB address +; + MOV BX,COM_SCBVECSEG ;get beginning SCB vector address + MOV ES,BX + MOV DI,COM_SCBVECOFF +; + DEC AX ;make zero based + MOV BX,COM_SCBVECLEN ;multiply SCB element length by + ; desired vector number in BX + MUL BX ; to determine offset into SCB vec + ADD DI,AX ;add offset inside table + MOV BX,ES:[DI] ;get actual SCB segment + MOV CX,ES:[DI]+2 ;point past SCB seg to get SCB off +; + MOV ES,BX ;set ES:DI to panel's actual + MOV DI,CX ; PCB address +; + POP DX + POP CX + POP BX + POP AX +; + RET +GET_SCB ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: GET_ICB : +; : +; Description: Return address of specified input control block. : +; : +; Entry: AX = Number of ICB vector desired. : +; : +; COM_ICBVECSEG = ICB vector segment. : +; COM_ICBVECOFF = ICB vector offset. : +; COM_ICBVECLEN = vector length. : +; : +; Exit: ES:DI = Address of specified ICB : +; : +; Entry point: : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +GET_ICB PROC FAR +; + PUSH AX + PUSH BX + PUSH CX + PUSH DX +; +; read input control block vector to obtain PCB address +; + MOV BX,COM_ICBVECSEG ;get beginning ICB vector address + MOV ES,BX + MOV DI,COM_ICBVECOFF +; + DEC AX ;make zero based + MOV BX,COM_ICBVECLEN ;multiply ICB element length by + ; desired vector number in BX + MUL BX ; to determine offset into ICB vec + ADD DI,AX ;add offset inside table + MOV BX,ES:[DI] ;get actual ICB segment + MOV CX,ES:[DI]+2 ;point past ICB seg to get ICB off +; + MOV ES,BX ;set ES:DI to input's actual + MOV DI,CX ; ICB address +; + TEST COM_STATE,COM_TEXT ;check if in text mode + JE GIEXIT +; + AND ES:[DI]+ICB_OPT1,NOT ICB_BOX + ;if in text mode deactivate box + ; option +; +GIEXIT: POP DX + POP CX + POP BX + POP AX +; + RET +GET_ICB ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: GET_ERROR : +; : +; Description: Return address of error message. : +; : +; Entry: AX = Number of vector desired. : +; : +; COM_ERRVECSEG = Error message vector segment. : +; COM_ERRVECOFF = Error message vector offset. : +; COM_ERRVECLEN = Length of each vector in bytes. : +; : +; Exit: ES:DI = Address of specified error message. : +; AX = length of error message. : +; : +; Entry point: GET_ERROR : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +GET_ERROR PROC FAR +; + PUSH BX + PUSH CX + PUSH DX +; +; read error message vector +; + MOV BX,COM_ERRVECSEG ;get beginning vector address + MOV ES,BX + MOV DI,COM_ERRVECOFF +; + DEC AX ;make zero based + MOV BX,COM_ERRVECLEN ;multiply element length by + ; desired vector number in BX + MUL BX ; to determine offset into vector + ADD DI,AX ;add offset inside table + MOV CX,ES:[DI] ;get error text offset + XOR AX,AX ;clear to zero + MOV AL,ES:[DI]+2 ;get error text length +; + MOV DI,CX ;set ES:DI to panel's actual + ; PCB address +; + POP DX + POP CX + POP BX +; + RET +GET_ERROR ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: GET_BUTTON : +; : +; Description: Return address of graphics button. : +; : +; Entry: AX = Number of vector desired. : +; : +; COM_BCBVECSEG = vector segment. : +; COM_BCBVECOFF = vector offset. : +; COM_BCBVECLEN = Length of each vector in bytes. : +; : +; Exit: ES:DI = Address of specified string. : +; : +; Entry point: GET_BUTTON : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +GET_BUTTON PROC NEAR +; + PUSH BX + PUSH CX + PUSH DX +; +; read keystroke vector +; + MOV BX,COM_BCBVECSEG ;get beginning vector address + MOV ES,BX + MOV DI,COM_BCBVECOFF +; + DEC AX ;make zero based + MOV BX,COM_BCBVECLEN ;multiply element length by + ; desired vector number in BX + MUL BX ; to determine offset into vector + ADD DI,AX ;add offset inside table + MOV CX,ES:[DI] ;get text offset + MOV DI,CX ;set ES:DI to actual data +; + POP DX + POP CX + POP BX +; + RET +GET_BUTTON ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: GET_STRING : +; : +; Description: Return address of string. : +; : +; Entry: AX = Number of ICB vector desired. : +; : +; COM_STRVECSEG = String vector segment. : +; COM_STRVECOFF = String vector offset. : +; COM_STRVECLEN = Length of each vector in bytes. : +; : +; Exit: ES:DI = Address of specified string. : +; AX = length of string. : +; : +; Entry point: GET_STRING : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +GET_STRING PROC FAR +; + PUSH DX + PUSH BX + PUSH CX +; +; read error message vector +; + MOV BX,COM_STRVECSEG ;get beginning vector address + MOV ES,BX + MOV DI,COM_STRVECOFF +; + DEC AX ;make zero based + MOV BX,COM_STRVECLEN ;multiply element length by + ; desired vector number in BX + MUL BX ; to determine offset into vector + ADD DI,AX ;add offset inside table + MOV CX,ES:[DI] ;get text offset + XOR AX,AX ;clear to zero + MOV AL,ES:[DI]+2 ;get text length +; + MOV DI,CX ;set ES:DI to actual data +; + POP CX + POP BX + POP DX +; + RET +GET_STRING ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: GET_ATTR : +; : +; Description: Returns the normal and highlight color attributes : +; of a specified panel. : +; : +; : +; Entry: AX = Panel ID number. : +; : +; Exit: AH = Panel's normal color attr : +; AL = Panel's highlight color attr : +; : +; Entry point: GET_ATTR : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +GET_ATTR PROC FAR +; + PUSH ES ;save registers + PUSH DI +; + CALL FAR PTR GET_PCB ;load the panel's PCB in ES:DI + MOV AX,ES:[DI]+PCB_CCBID ;get panel's color index number +; + CALL FAR PTR GET_COLOR ;load the color index + MOV AH,ES:[DI]+CCB_A1 ;get the normal color attr + MOV AL,ES:[DI]+CCB_A2 ;get the highlighted color attr +; + POP DI ;restore registers + POP ES +; + RET +GET_ATTR ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: GET_COLOR : +; : +; Description: Returns ES:DI pointing to color index specified in : +; AX. Use the CCB_PB to reference the desired color : +; attributes. : +; : +; Entry: AX = Color index to return. : +; CRD_CCBVECOFF = Offset of color index. : +; CRD_CCBVECSEG = Segment of color index. : +; : +; Exit: ES:DI = Address of color index : +; : +; Entry point: GET_COLOR : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +GET_COLOR PROC FAR +; + PUSH AX ;save registers + PUSH BX + PUSH DX +; + DEC AX ; default index and make zero + ; based + PUSH CRD_CCBVECSEG ;get color index segment + POP ES +; + PUSH CRD_CCBVECOFF ;get color index offset + POP DI +; + MOV BX,COM_CCBLEN ;multiply CCB element length by + MUL BX ; desired vector add offset + ADD DI,AX ; to color index offset +; + POP DX ;restore registers + POP BX + POP AX +; + RET +GET_COLOR ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: SET_SHLVMDOS : +; : +; Description: Set shell video mode from current DOS video mode. : +; : +; Entry: COM_STATE = Option word indicating invocation : +; parameters passed through PSP. : +; : +; Exit: PCGVIDO = Parmeter block initialized. : +; COM_DVIDMODE = Original DOS video mode. : +; COM_SVIDMODE = Current Shell video mode. : +; : +; Entry point: SET_SHLVMDOS : +; : +; Notes: None. : +; : +; Internal references: PCGVIDO_CALL : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +SET_SHLVMDOS PROC NEAR +; + LEA DI,GEN_DATA ;load offset of PCGRAPH PB + MOV [DI]+G_INITVFLAG,0 ;init to VGA hardware available +; +; Check if mode 10H requested +; + TEST COM_STATE,COM_M10H ;check if graphics mode 10H + JE VMD20 ; requested (EGA/VGA) +; + TEST GV_STAT1,GV_256K ;256K memory on EGA card + JNE VMD10 +; + MOV COM_ERRID,ERR_256K ;set error for less than 256KB + JMP VMDEXIT ; available on graphics adaphter +; +VMD10: MOV AL,10H ;set for mode 10H + JMP VMD60 +; +; Check if mode 11H requested +; +VMD20: TEST COM_STATE,COM_M11H ;check if graphics mode 11H + JE VMD40 ; requested (VGA/MCGA) +; + TEST GV_STAT1,GV_EGAA ;check if VGA/EGA hardware avail + JNE VMD30 +; + CMP GE_MODEL,MODEL_30 ;check for MCGA support + JNE VMD30 +; + OR IN_OPT,IN_MCGA ;MCGA active + MOV [DI]+G_INITVFLAG,G_INITNOVGA + ;no VGA hardware available +; +VMD30: MOV AL,11H ;set for mode 11H + JMP VMD60 +; +; check if mode 12H requested +; +VMD40: TEST COM_STATE,COM_M12H ;check if graphics mode 12H + JE VMD70 +; + TEST GV_STAT1,GV_256K ;256K memory on EGA card + JNE VMD50 +; + MOV COM_ERRID,ERR_256K ;set error for less than 256KB + JMP VMDEXIT ; available on graphics adaphter +; +VMD50: MOV AL,12H ;set for mode 12H +; +; set graphics video mode +; +VMD60: CMP AL,12H ;check for mode 12H + JE VMD62 +; + CMP AL,11H ;check for mode 11H + JE VMD62 +; + JMP VMD65 ;must be mode 10H +; +VMD62: CMP GE_MODEL,MODEL_30 ;check if model 30 + JE VMD65 +; + CMP GE_MODEL,MODEL_25 ;check if model 25 + JE VMD65 +; + PUSH AX + MOV AX, 1A00H ;BIOS check display + INT 10H + CMP AL, 1AH ;VGA supported? + POP AX + JE VMD65 ;yes, continue +; + MOV AL,0 ;set error in video mode + JMP VMD80 ;exit +; +VMD65: MOV [DI]+G_INITVMODE,AL ;set desired graphics video mode + MOV [DI]+G_FUNC,G_INIT ;initialize graphics support + MOV BX,DATA ;point to general PCGRAPH + MOV ES,BX ; initialize parameter block + PUSH AX + CALL PCGRAPH_CALL ;initialize graphics + POP AX + JMP VMD80 +; +; set text video mode +; +VMD70: MOV AL,7 ;initialize + CMP AL,COM_DVIDMODE ;if monochrome text mode is active + JE VMD80 ; no need to set mode +; + MOV AL,3 + CMP AL,COM_DVIDMODE ;if color text mode is active no + JE VMD80 ; need to set mode +; + XOR AH,AH ;set to color text mode + PUSH AX ;save + INT 10H + POP AX ;restore +; +; read all video information and check if mode set successful +; +VMD80: CALL PCGVIDO_CALL ;get new video information and + CMP AL,GV_VIDMODE ; check if mode set successful + JE VMD100 ;yes +; + MOV COM_ERRID,ERR_MODE ;requested video mode failed + JMP VMDEXIT +; +VMD100: MOV COM_SVIDMODE,AL ;save current shell video mode + cmp al, 7 ;monochrome text mode active? + jne vmd101 ;no, continue + and COM_STATE,not COM_FLCS ;inactivate color change +vmd101: + CALL FAR PTR CURSOROFF ;deactive cursor +; +VMDEXIT: ;exit +; + RET +SET_SHLVMDOS ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: SET_DOSVMSHL : +; : +; Description: Set original DOS video mode from current shell mode : +; and disable mouse support : +; : +; Entry: PCGVIDO = Parmeter block initialized. : +; COM_DVIDMODE = Original DOS video mode. : +; COM_SVIDMODE = Current Shell video mode. : +; COM_STATE = Invocation options. : +; : +; Exit: PCGVIDO = Parmeter block initialized. : +; : +; Entry point: SET_DOSVMSHL : +; : +; Notes: None. : +; : +; Internal references: PCGVIDO_CALL : +; PCTRACK_CALL : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +SET_DOSVMSHL PROC NEAR +; +; Disable mouse support +; + CALL FAR PTR MOUSE_DIS ;disable mouse support +; +; Check if shell is in text mode +; +VMS10: CMP COM_STATE,COM_TEXT + JNE VMS20 +; +; Terminate shell graphics mode and restore original DOS video mode +; + LEA DI,GEN_DATA ;load offset of PCGRAPH PB + MOV [DI]+G_FUNC,G_TERM ;terminate graphics support + MOV BX,DATA ;point to general PCGRAPH + MOV ES,BX ;initialize parameter block + CALL PCGRAPH_CALL ;initialize graphics + JMP VMSEXIT +; +; Shell is in text video mode, restore original DOS video mode +; +VMS20: MOV AL,COM_DVIDMODE ;if shell mode and DOS mode are + XOR AH,AH ;shell and DOS modes are different + INT 10H ; reset original DOS mode +; +; Exit +; +VMSEXIT: MOV AL,0 ;clear screen + MOV CH,0 + MOV CL,0 + MOV DX,GV_NUMLINES ;set DH to bottom row + MOV DL,80 ;set DL to screen width in chars + MOV BH,07H ;set white on black color + MOV AH,6 + INT 10H +; + CALL FAR PTR CURSORON + CALL PCGVIDO_CALL +; + RET +SET_DOSVMSHL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: SET_CMDVMSHL : +; : +; Description: Set shell command line video mode from current shell : +; mode. : +; : +; Entry: PCGVIDO = Parmeter block initialized. : +; COM_DVIDMODE = Original DOS video mode. : +; COM_STATE = Invocation options. : +; : +; Exit: COM_CVIDMODE = Shell command line video mode. : +; PCGVIDO = Parmeter block initialized. : +; : +; Entry point: SET_CMDVMSHL : +; : +; Notes: None. : +; : +; Internal references: PCGVIDO_CALL : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +SET_CMDVMSHL PROC FAR +; +; Check if shell text mode is active +; + CMP COM_STATE,COM_TEXT + JE CMDEXIT +; +; Terminate shell graphics mode and restore original DOS video mode +; + LEA DI,GEN_DATA ;load offset of PCGRAPH PB + MOV [DI]+G_FUNC,G_TERM ;terminate graphics support + MOV BX,DATA ;point to general PCGRAPH + MOV ES,BX ;initialize parameter block + CALL PCGRAPH_CALL ;initialize graphics +; +; Set shell command line to text video mode +; + MOV AL,7 ;initialize to monochrome mode + CMP COM_DVIDMODE,AL ;check if DOS video mode was + JE CMD10 ; monochrome +; + MOV AL,3 ;set color text mode +; +CMD10: XOR AH,AH ;set command line video mode + INT 10H +; +; Exit +; +CMDEXIT: CALL PCGVIDO_CALL +; + RET +SET_CMDVMSHL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: SET_SHLVMCMD : +; : +; Description: Set shell video mode from shell command line video : +; mode. : +; : +; Entry: COM_STATE = Option word indicating invocation : +; parameters passed through PSP. : +; : +; Exit: PCGVIDO = Parmeter block initialized. : +; COM_DVIDMODE = Original DOS video mode. : +; COM_SVIDMODE = Current Shell video mode. : +; : +; Entry point: SET_SHLVMCMD : +; : +; Notes: None. : +; : +; Internal references: PCGVIDO_CALL : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +SET_SHLVMCMD PROC FAR +; +; Check if shell graphics modes 10H, 11H, and 12H were active +; + LEA DI,GEN_DATA ;load offset of PCGRAPH PB + MOV [DI]+G_INITVFLAG,0 +; + TEST COM_STATE,COM_M11H ;check if graphics mode 11H + JE SMC20 ; requested (VGA/MCGA) +; + TEST GV_STAT1,GV_EGAA ;check if VGA/EGA hardware avail + JNE SMC10 +; + CMP GE_MODEL,MODEL_30 ;check for MCGA support + JNE SMC10 +; + OR IN_OPT,IN_MCGA ;MCGA active + MOV [DI]+G_INITVFLAG,G_INITNOVGA + ;no VGA hardware available +; +SMC10: MOV AL,11H ;set for mode 11H + JMP SMC50 +; +SMC20: CMP COM_SVIDMODE,10H ;check if mode 10 active + JE SMC50 +; + CMP COM_SVIDMODE,12H ;check if mode 12 active + JE SMC50 +; + MOV AH,0FH ;get current video mode + INT 10H +; + CMP AL,COM_SVIDMODE ;check if command line video mode + JNE SMC30 ; changed and reset if yes +; + JMP SMCEXIT +; +; Switch to monochrome monitor +; +SMC30: CMP COM_SVIDMODE,3H ;check if color mode should be set + JE SMC40 +; + PUSH DS +; + XOR AX,AX ;clear to zero + MOV ES,AX ;point to BIOS data area and + MOV DL,ES:[410H] ; get mode byte + OR DL,00110000B + MOV ES:[410H],DL + XOR AH,AH ;set color monochrome mode + MOV AL,7H + INT 10H +; + POP DS +; + JMP SMCEXIT +; +; Switch to color monitor in text mode 80x25 +; +SMC40: PUSH DS +; + XOR AX,AX ;clear to zero + MOV ES,AX ;point to BIOS data area and + MOV DL,ES:[410H] ; get mode byte + AND DL,11001111B + OR DL,00100000B + MOV ES:[410H],DL + XOR AH,AH ;set color mode + MOV AL,3H + INT 10H +; + POP DS +; + JMP SMCEXIT +; +; Initialize shell graphics mode from shell command line text mode +; +SMC50: MOV AH,0FH ;get current video mode + INT 10H +; + CMP AL,7H ;check if command line mode set + JNE SMC60 ; for monochrome, if yes reset to + ; graphics monitor +; + PUSH DS +; + XOR AX,AX ;clear to zero + MOV ES,AX ;point to BIOS data area and + MOV DL,ES:[410H] ; get mode byte + AND DL,11001111B + OR DL,00100000B + MOV ES:[410H],DL + XOR AH,AH ;set color 80x25 mode before + MOV AL,3H ; setting graphics mode + INT 10H +; + POP DS +; +SMC60: LEA DI,GEN_DATA ;load offset of PCGRAPH PB + MOV AL,COM_SVIDMODE ;set the shell graphics video mode + MOV [DI]+G_INITVMODE,AL + MOV [DI]+G_FUNC,G_INIT ;initialize graphics support + MOV BX,DATA ;point to general PCGRAPH + MOV ES,BX ;initialize parameter block + CALL PCGRAPH_CALL ;initialize graphics +; +; Exit +; +SMCEXIT: CALL PCGVIDO_CALL +; + RET +SET_SHLVMCMD ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: CURSOROFF : +; : +; Description: Deactivates hardware cursor from display. : +; : +; Entry: None : +; : +; Exit: None. : +; : +; Entry point: CURSOROFF : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +CURSOROFF PROC FAR +; + PUSH AX ;save registers + PUSH BX + PUSH CX +; + MOV AH,3 ;function to get cursor info + MOV BH,0 ;page zero + INT 10H + OR CH,20H ;set bit 6 + MOV AH,1 ;function to set cursor + INT 10H +; + POP CX ;restore registers + POP BX + POP AX +; + RET +CURSOROFF ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: CURSORON : +; : +; Description: Displays the hardare cursor. : +; : +; Entry: None. : +; : +; Exit: None. : +; : +; Entry point: CURSORON : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +CURSORON PROC FAR +; + PUSH AX ;save registers + PUSH BX + PUSH CX + PUSH DX ;>>SN +; + MOV AH,3 ;function to get cursor info + MOV BH,0 ;page zero + INT 10H + AND CH,NOT 20H ;clear bit 6 + MOV AH,1 ;function to set cursor + INT 10H +; + POP DX ;>>SN + POP CX ;restore registers + POP BX + POP AX +; + RET +CURSORON ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCINPUT_CALL : +; : +; Description: Call to PCINPUT. : +; : +; Entry: PCINPUT parameter block initialized. : +; : +; Exit: PCINPUT parameter block initialized. : +; : +; Entry point: PCINPUT_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCINPUT_CALL PROC FAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + TEST COM_STATE2,COM_DBCS ;check if DBCS option active + JE INPT10 +; + OR IN_OPT,IN_DDBCS+IN_ADBCS ;activate DBCS +; +INPT10: LEA DI,IN_OPT ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,IN_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL INPUT +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCINPUT_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCINCHA_CALL : +; : +; Description: Call to PCINCHA. : +; : +; Entry: PCINCHA parameter block initialized. : +; : +; Exit: PCINCHA parameter block initialized. : +; : +; Entry point: PCINCHA_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCINCHA_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + TEST COM_STATE2,COM_DBCS ;check if DBCS option active + JE INCH10 +; + OR INC_OPT,INC_DDBCS ;activate DBCS +; +INCH10: LEA DI,INC_OPT ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,INC_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL INCHA +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCINCHA_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCDISPQ_CALL : +; : +; Description: Call to PCDISPQ. : +; : +; Entry: PCDISPQ parameter block initialized. : +; : +; Exit: PCDISPQ parameter block initialized. : +; : +; Entry point: PCDISPQ_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCDISPQ_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,QM_OPT1 ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,QM_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL DISPQ +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCDISPQ_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCPANEL_CALL : +; : +; Description: Initialize for call to PCPANEL including refresh of : +; input and scroll fields in the logical video buffer : +; before display. : +; : +; Entry: PCPANEL parameter block initialized. : +; : +; AX 0= Logical video buffer mode write : +; 1= Direct video mode write : +; : +; Exit: PCPANEL parameter block initialized. : +; : +; Entry point: PCPANEL_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCPANEL_CALL PROC NEAR +; +; initialize PCDISPQ info for PCPANEL call +; + CMP AX,1 ;check if direct video buffer + JE PP10 ; write option active +; + MOV BX,QM_PANQUENUM + MOV PM_PANQUENUM,BX ;number of panels in parent queue +; + MOV BX,QM_CHDQUENUM + MOV PM_CHDQUENUM,BX ;number panels in child queue +; + MOV BX,QM_ACTIVEPAN + MOV PM_ACTIVEPAN,BX ;active parent panel number +; + MOV PM_OPT1,PM_DOA+PM_DOV+PM_DOQ+PM_CL + MOV PM_PANPDQNUM,1 ;beg/ending parent PDQ number + MOV PM_PANBRKOFF,0 ;panel off in lvb of break panel +; +; actual PCPANEL call +; +PP10: PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,PM_OPT1 ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,PM_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL PANEL +ENDIF + POP DI ;restore registers + POP DS +; +; Exit +; +PPEXIT: ;exit +; + RET +PCPANEL_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCMBEEP_CALL : +; : +; Description: Call to PCMBEEP. : +; : +; Entry: PCMBEEP parameter block initialized. : +; : +; Exit: PCMBEEP parameter block initialized. : +; : +; Entry point: PCMBEEP_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCMBEEP_CALL PROC FAR +; + TEST COM_STATE2,COM_SOUD ;check if sound is off + JE BEXIT +; + PUSH CX ;save registers + PUSH DX +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,MB_FREQUENCY ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,MB_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL MBEEP +ENDIF + POP DI ;restore registers + POP DS +; + POP DX ;restore registers + POP CX +; +BEXIT: +; + RET +PCMBEEP_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCSLCTP_CALL : + +; : +; Description: Call to PCSLCTP. : +; : +; Entry: ES:DI = beginning address of PCSLCTP parameter block. : +; : +; Exit: PCSLCTP parameter block initialized. : +; : +; Entry point: PCSLCTP_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCSLCTP_CALL PROC NEAR +; +; Initialize color index vector +; + MOV AX,PM_CCBVECNUM ;set color index number + MOV ES:[DI]+SCB_CCBVECNUM,AX +; + MOV AX,CRD_CCBVECOFF ;set color index offset + MOV ES:[DI]+SCB_CCBVECOFF,AX +; + MOV AX,CRD_CCBVECSEG ;set color index segment + MOV ES:[DI]+SCB_CCBVECSEG,AX +; +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,SCB_RN ;set CAS routine number + INT CASINT ;call slctopt +ELSE + CALL SLCTP +ENDIF +; + RET +PCSLCTP_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCHLPRD_CALL : +; : +; Description: Call to PCHLPRD. : +; : +; Entry: PCHLPRD parameter block initialized. : +; : +; Exit: PCHLPRD parameter block initialized. : +; : +; Entry point: PCHLPRD_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCHLPRD_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,HRD_OPT1 ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,HRD_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL HLPRD +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCHLPRD_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCINSTR_CALL : +; : +; Description: Call to PCINSTR. : +; : +; Entry: PCINSTR parameter block initialized. : +; : +; Exit: PCINSTR parameter block initialized. : +; : +; Entry point: PCINSTR_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCINSTR_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,INS_OPT ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,INS_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL INSTRN +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCINSTR_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCGVIDO_CALL : +; : +; Description: Call to PCGVIDO. : +; : +; Entry: PCGVIDO parameter block initialized. : +; : +; Exit: PCGVIDO parameter block initialized. : +; : +; Entry point: PCGVIDO_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCGVIDO_CALL PROC NEAR +; + PUSH ES +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,GV_STAT1 ;set DI to proper parameter block + ; for call +; +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,GV_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL GVIDO +ENDIF + POP DI ;restore registers + POP DS +; + POP ES +; + RET +PCGVIDO_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCCLRWR_CALL : +; : +; Description: Call to PCCLRWR. : +; : +; Entry: PCCLRWR parameter block initialized. : +; : +; Exit: PCCLRWR parameter block initialized. : +; : +; Entry point: PCCLRWR_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCCLRWR_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,CWR_OPT ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,CWR_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL CLRWR +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCCLRWR_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCCRITE_CALL : +; : +; Description: Call to PCCRITE. : +; : +; Entry: PCCRITE parameter block initialized. : +; : +; Exit: PCCRITE parameter block initialized. : +; : +; Entry point: PCCRITE_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCCRITE_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,CE_OPT ;set DI to proper parameter block + ; for call +; +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,CE_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL CRITE +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCCRITE_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCWWRAP_CALL : +; : +; Description: Call to PCWWRAP. : +; : +; Entry: PCWWRAP parameter block initialized. : +; : +; Exit: PCWWRAP parameter block initialized. : +; : +; Entry point: PCWWRAP_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCWWRAP_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,WWP_OPT1 ;set DI to proper parameter block + ; for call +; +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,WWP_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL WWRAP +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCWWRAP_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCTRACK_CALL : +; : +; Description: Call to PCTRACK. : +; : +; Entry: PCTRACK parameter block initialized. : +; : +; Exit: PCTRACK parameter block initialized. : +; : +; Entry point: PCTRACK_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCTRACK_CALL PROC FAR +; + PUSH DS + PUSH DI ;save registers +; + PUSH DS ;point to PCTRACK parameter block + POP ES +; +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,MS_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL TRACK +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCTRACK_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCGRAPH_CALL : +; : +; Description: Call to PCGRAPH. : +; : +; Entry: PCGRAPH parameter block initialized. : +; : +; Exit: PCGRAPH parameter block initialized. : +; : +; Entry point: PCGRAPH_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCGRAPH_CALL PROC NEAR +; + PUSH DS + PUSH DI ;save registers +; +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,MS_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL GRAPH +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCGRAPH_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCST2IN_CALL : +; : +; Description: Call to PCST2IN. : +; : +; Entry: PCST2IN parameter block initialized. : +; : +; Exit: PCST2IN parameter block initialized. : +; : +; Entry point: PCST2IN_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCST2IN_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,ST2_OPT1 ;set DI to proper parameter block + ; for call +; +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,S2I_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL ST2IN +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCST2IN_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: PCMOVEC_CALL : +; : +; Description: Call to PCMOVEC. : +; : +; Entry: PCMOVEC parameter block initialized. : +; : +; Exit: PCMOVEC parameter block initialized. : +; : +; Entry point: PCMOVEC_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +PCMOVEC_CALL PROC NEAR +; + PUSH DS ;set segment + POP ES +; + PUSH DS + PUSH DI ;save registers +; + LEA DI,MO_OPT ;set DI to proper parameter block + ; for call +; +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,MO_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL MOVEC +ENDIF + POP DI ;restore registers + POP DS +; + RET +PCMOVEC_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: SHELLDA_CALL : +; : +; Description: Call to SHELLDA. : +; : +; Entry: None : +; : +; Exit: None : +; : +; Entry point: SHELLDA_CALL : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +SHELLDA_CALL PROC NEAR +; + CALL SHELLDA +; + RET +SHELLDA_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; PCROWCL_CALL : +; : +; Call to PCROWCL. : +; : +; Entry: PB initialized. : +; : +; Exit: None : +; : +; Notes: None : +; : +;-----------------------------------------------------------------------------+ +; +PCROWCL_CALL PROC NEAR + + PUSH ES + PUSH DS ;set segment + POP ES + + PUSH DS + PUSH DI ;save registers + + LEA DI,CR_SCRWIDTH ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,CR_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL ROWCL +ENDIF + POP DI ;restore registers + POP DS + POP ES +; + RET +PCROWCL_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; PCMOVEG_CALL : +; : +; Call to PCMOVEG. : +; : +; Entry: PB initialized. : +; : +; Exit: None : +; : +; Notes: None : +; : +;-----------------------------------------------------------------------------+ +; +PCMOVEG_CALL PROC NEAR + + PUSH ES + PUSH DS ;set segment + POP ES + + PUSH DS + PUSH DI ;save registers + + LEA DI,MG_OPT ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,MG_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL MOVEG +ENDIF + POP DI ;restore registers + POP DS + POP ES +; + RET +PCMOVEG_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; PCGEQUP_CALL : +; : +; Call to PCGEQUP. : +; : +; Entry: PB initialized. : +; : +; Exit: None : +; : +; Notes: None : +; : +;-----------------------------------------------------------------------------+ +; +PCGEQUP_CALL PROC NEAR + + PUSH ES + PUSH DS ;set segment + POP ES + + PUSH DS + PUSH DI ;save registers + + LEA DI,GE_OPT ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,MG_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL GEQUP +ENDIF + POP DI ;restore registers + POP DS + POP ES +; + RET +PCGEQUP_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; PCDATES_CALL : +; : +; Call to PCDATES. : +; : +; Entry: PB initialized. : +; : +; Exit: None : +; : +; Notes: None : +; : +;-----------------------------------------------------------------------------+ +; +PCDATES_CALL PROC NEAR + + PUSH ES + PUSH DS ;set segment + POP ES + + PUSH DS + PUSH DI ;save registers + + LEA DI,DTS_OPT ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,DTS_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL DATES +ENDIF + POP DI ;restore registers + POP DS + POP ES +; + RET +PCDATES_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; PCTIMES_CALL : +; : +; Call to PCTIMES. : +; : +; Entry: PB initialized. : +; : +; Exit: None : +; : +; Notes: None : +; : +;-----------------------------------------------------------------------------+ +; +PCTIMES_CALL PROC NEAR + + PUSH ES + PUSH DS ;set segment + POP ES + + PUSH DS + PUSH DI ;save registers + + LEA DI,TMS_OPT ;set DI to proper parameter block + ; for call +IF CASRM + MOV AH,00H ;make call to CAS-RM + MOV BX,TMS_RN ;set CAS routine number + INT CASINT ;call routine +ELSE + CALL TIMES +ENDIF + POP DI ;restore registers + POP DS + POP ES +; + RET +PCTIMES_CALL ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: CHANGE_APPM : +; : +; Description: Display Application menu screen. : +; : +; Entry: None. : +; : +; Exit: COM_CDIALOG : +; : +; Entry point: CHANGE_APPM : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +CHANGE_APPM PROC FAR +; + TEST COM_STATE,COM_APPM ;check if app menu active + JNE CAM10 +; + CALL FAR PTR OPT_INACTIVE ;display error panel for inactive *PCR + JMP CAMEXIT +; +CAM10: MOV COM_HLPOPT2,0 ;set for normal shell help + MOV COM_HCBIDAAB,HLP_AABPROGRAM + MOV COM_HCBID,HLP_AABPROGRAM +; + MOV AX,MFF_AABAOPT ;default to program menu AAB field + CALL FAR PTR LOC_MOUSEF + MOV COM_CURAABF,AX +; + MOV APP_SKIN,0 ;set to reinitialize app menu fld + MOV COM_CDIALOG,COM_PAAB ;set for menu action bar dialog + MOV COM_BASESCR,COM_APPSCR ;initialize for display of DOS scr +; +CAMEXIT: +; + RET +CHANGE_APPM ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: ALLOCATE_BUFB : +; : +; Description: Allocate memory for directory and file buffers. : +; : +; Entry: COM_STATE2 = Invocation parameters. : +; COM_DFSIZE = Optional buffer override size in parags.: +; : +; MAX_DIR1BUF = Size of directory buffer 1 in paragraph : +; MAX_DIR2BUF = Size of directory buffer 2 in paragraph : +; MAX_DOSWBUF = Size of view, copy, move working buffer : +; MAX_EXECBUF = Size of app menu and/or command prompt : +; free space to be made avail to dos in : +; resident mode only. : +; : +; Allocated by one DOS call with COM_DATA4SEG as : +; starting segment. : +; : +; COM_DATA4LEN Optional DOS Services directory : +; COM_DATA4OFF list 1 buffer. : +; COM_DATA4SEG : +; : +; COM_DATA5LEN Optional DOS Services directory : +; COM_DATA5OFF list 2 buffer. : +; COM_DATA5SEG : +; : +; COM_DATA6LEN Optional DOS Services file list 1 : +; COM_DATA6OFF buffer : +; COM_DATA6SEG : +; : +; COM_DATA7LEN Optional DOS Services file list 2 : +; COM_DATA7OFF buffer : +; COM_DATA7SEG : +; : +; COM_DATA8LEN Optional DOS Services : +; COM_DATA8OFF buffer : +; COM_DATA8SEG : +; : +; Entry point: ALLOCATE_BUFB : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: INT 21H 48H Allocate memory : +; : +;-----------------------------------------------------------------------------+ +; +ALLOCATE_BUFB PROC FAR +; + TEST COM_STATE,COM_DOSS ;check if DOS Services configured + JNE AMB05 ;exit +; + JMP AMBEXIT +; +; Determine avail memory, calc memory to allocate for shell functions +; +AMB05: MOV AH,48H ;find out how many parags are aval + MOV BX,0FFFFH ; in BX on return + INT 21H +; +; adjust for resident mode operation +; + TEST COM_STATE,COM_RESS ;check if resident mode is active + JE AMB11 ; if yes, check if prompt or menu + ; options are active, if yes, + ; reduce avail size by 64KB to + ; allow room for command line + ; or prog menu operation +; +AMB08: CMP BX,MAX_EXECBUF ;64K remaining? + JB AMB_ERR ;no, error +; + SUB BX,MAX_EXECBUF ;save 64KB for execution of + ; command prompt or program menu + ; only if in resident mode +; +AMB11: MOV CX,BX ;save avail paraghs for compare +; + TEST COM_STATE,COM_RESS ;check if resident mode is active + JNE AMB12 ; if yes, reserve room required + ; memory for view, copy,,, + ; if not, DOS funcs in shell will + ; automatically allocate memory + ; as needed +; + CMP BX,MAX_DOSWBUF ;10K remaining? + JB AMB_ERR ;no, error +; + SUB BX,MAX_DOSWBUF ;reserve working memory for copy + ; and view functions (10KB) +; +; Check for minimum storage to run DOS Services +; +AMB12: MOV TMP_DOSWBUF,MAX_DOSWBUF ;max work buffer + MOV TMP_DIRBUF,MAX_DIR1BUF ;max directory buffer +; + CALL CHK_MINDOS ;check for minimum DOS + JNC AMB30 ;OK to allocate +; + TEST COM_STATE2,COM_BUFO ;/B specified? + JZ AMB14 ;no, try for minimum system +; + CMP COM_DFSIZE,SM_FILEBUF ;User specified a small file buf? + JA AMB_ERR ;no, /B just too large +; +AMB14: MOV TMP_DOSWBUF,MIN_DOSWBUF ;min work buffer + MOV TMP_DIRBUF,MIN_DIR1BUF ;min directory buffer + TEST COM_STATE,COM_RESS ;resident mode? + JNZ AMB16 ;yes, no need to adjust avail stg +; + ADD BX,MAX_DOSWBUF ;change from 16K + SUB BX,MIN_DOSWBUF ; to 8K for View/Copy buffer +; +AMB16: CALL CHK_MINDOS ;check for absolutely minimum DOS + JNC AMB30 ;OK to allocate +; +AMB_ERR: MOV COM_ERRID,ERR_INSM ;insufficent memory available + JMP AMBEXIT +; +; Allocate required shell memory +; +AMB30: XOR AX,AX + MOV AH,48H ;set allocate function number + INT 21H ;allocate memory + JNC AMB40 ;check for error +; + MOV COM_ERRID,ERR_INSM ;insufficent memory available + JMP AMBEXIT +; +; Check if resident mode active and preallocate working DOS buffers +; +AMB40: MOV CX,AX ;save beginning segment +; + TEST COM_STATE,COM_RESS ;check if resident mode is active + JE AMB70 ; if yes, pre-allocate required + ; memory for view, copy,,, + ; if not, DOS funcs in shell will + ; automatically allocate memory + ; as needed +; + TEST COM_STATE,COM_APPM ;check if app menu active + JNE AMB60 +; + MOV COM_DATA8SEG,CX ;set segment of DOS work buffer + MOV COM_DATA8OFF,0 ;offset starts at zero + MOV AX,TMP_DOSWBUF ;calculate length of buffer + MOV BX,16 ; in bytes + SUB COM_DFSIZE,AX ;adjust remaining paragraphs + MUL BX + MOV COM_DATA8LEN,AX + ADD CX,MAX_DOSWBUF ;adjust segment + JMP AMB70 +; +AMB60: MOV AX,COM_DATA3SEG ;reuse app menu buffer + MOV COM_DATA8SEG,AX ;set segment + MOV AX,COM_DATA3OFF + MOV COM_DATA8OFF,AX ;set offset + MOV AX,COM_DATA3LEN ;set DOS working buffer size in + MOV COM_DATA8LEN,AX ; bytes +; +; Use next available memory for dir buffer 1 and 2 +; +AMB70: MOV COM_DATA4SEG,CX ;set segment of directory list 1 + MOV COM_DATA4OFF,0 ;offset starts at zero + MOV AX,TMP_DIRBUF ;calculate length of buffer + ADD CX,AX ;adjust new segment + SUB COM_DFSIZE,AX ;adjust remaining paragraphs + MOV BX,16 + MUL BX + MOV COM_DATA4LEN,AX ;set length in paragraphs +; + TEST COM_STATE,COM_DRV2 ;check if multiple drive display + JE AMB80 ; active +; + MOV COM_DATA5SEG,CX ;set segment of directory list 2 + MOV COM_DATA5OFF,0 ;offset starts at zero + MOV AX,TMP_DIRBUF ;calculate length of buffer + ADD CX,AX ;adjust new segment + SUB COM_DFSIZE,AX ;adjust remaining paragraphs + MOV BX,16 + MUL BX + MOV COM_DATA5LEN,AX ;set length in paragraphs +; +; Use remaining memory for file buffers 1 and 2 +; +AMB80: MOV COM_DATA6SEG,CX ;set segment of file buf 1 + MOV COM_DATA6OFF,0 ;offset starts at zero +; + MOV AX,COM_DFSIZE ;get remaining buffer +; + TEST COM_STATE,COM_DRV2 ;check if multiple drive display + JE AMB90 ; active +; + SHR AX,1 ;divide remaining buffer by 2 +; +AMB90: MOV COM_DATA6LEN,AX ;set file buffer 1 len in paraghs + ADD CX,AX ;adjust new segment + SUB COM_DFSIZE,AX ;adjust remaining buffer paraghs +; + TEST COM_STATE,COM_DRV2 ;check if multiple drive display + JE AMBEXIT ; active +; + MOV COM_DATA7SEG,CX ;set segment of file buf 2 + MOV COM_DATA7OFF,0 ;offset starts at zero + MOV AX,COM_DFSIZE ;set # parags in file buf 2 + MOV COM_DATA7LEN,AX +; +AMBEXIT: ;exit +; + RET +ALLOCATE_BUFB ENDP +; +PAGE +; +;-----------------------------------------------------------------------------+ +; : +; Name: CHK_MINDOS : +; : +; Description: Check for enough storage to run minimum DOS Services. : +; : +; Entry: TMP_DOSWBUF - Size of DOS work buffer : +; TMP_DIRBUF - Size of DOS directory buffer : +; COM_DFSIZE - User specified file buffer size : +; BX - Maximum memory available : +; : +; Exit: Carry flag set : +; : +; Entry point: CHK_MINDOS : +; : +; Notes: None. : +; : +; Internal references: None : +; : +; External references: None : +; : +;-----------------------------------------------------------------------------+ +; +CHK_MINDOS PROC NEAR +; + XOR AX,AX ;clear out + TEST COM_STATE,COM_RESS ;resident mode? + JZ CHS14 ;no, storage already adjusted +; + TEST COM_STATE,COM_APPM ;appl configured? + JNZ CHS14 ;yes, reuse appl workarea +; + ADD AX,TMP_DOSWBUF ;10K or 8K for View/Copy buffer +; +CHS14: ADD AX,TMP_DIRBUF ;8K or 4K for first dir buffer + TEST COM_STATE,COM_DRV2 ;multiple buffers configured? + JZ CHS16 ;no, no second buffer needed +; + ADD AX,TMP_DIRBUF ;8K or 4K for second dir buffer +; +CHS16: TEST COM_STATE2,COM_BUFO ;/B specified? + JZ CHS18 ;no, add in for min file buffer +; + ADD AX,COM_DFSIZE ;update total storage needed + CMP BX,AX ;is storage available? + JA CHS17 ;yes +; + SUB AX,COM_DFSIZE ;back out and use all of storage + JMP CHS18 ;continue + +; JB CHS_ERR ;no, display error message +; +CHS17: MOV BX,AX ;set to allocate storage + JMP CHS20 +; +CHS18: ADD AX,MIN_FILEBUF ;minimun file buffer to alloc + CMP BX,AX ;is storage available + JB CHS_ERR ;no, display error message +; +CHS20: MOV COM_DFSIZE,BX ;set to allocate all avail storage + JMP CHS_OK +; +CHS_ERR: STC ;error + JMP CHS_RET +; +CHS_OK: CLC ;OK + +CHS_RET: ;exit +; + RET +CHK_MINDOS ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: MANAGE_ERROR : +; : +; Description: Manage error messages. : +; : +; Entry: COM_ERRID = ID number of error message. : +; : +; Exit: None. : +; : +; Entry point: MANAGE_ERROR : +; : +; Notes: None. : +; : +; Internal references: GET_ERROR : +; : +; External references: INT 21H AH=09H Print string to standard output. : +; : +;-----------------------------------------------------------------------------+ +; +MANAGE_ERROR PROC NEAR +; +; Process critcal error messages before initialization is complete +; + CALL SET_DOSVMSHL ;set DOS video mode from shell + ; video mode +; + MOV AX,COM_ERRID ;calculate offset into error + CALL FAR PTR GET_ERROR +; + PUSH DS ;save data segment address +; + MOV CX,AX ;set message length + MOV DX,DI ;set message offset + MOV AX,ES ;set message segment + MOV DS,AX +; + XOR AX,AX ;clear to zero + MOV AH,40H ;set print string function number + MOV BX,1 ;standard output + INT 21H ;print string +; + MOV AH,06 ;print to screen + MOV DL,CR + INT 21H +; + MOV AH,06 ;print to screen + MOV DL,LF + INT 21H +; + POP DS ;restore data segment address +; + RET +MANAGE_ERROR ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: EXAMINE_PSP : +; : +; Description: Examine Program Segment Prefix string for current : +; SHELLRD.EXE invocation parameters. : +; : +; Entry: PSP initialized. : +; : +; Exit: COM_STATE = Option word indicating invocation : +; parameters passed through PSP. : +; : +; Label Bit Description : +; -------- --- ----------------------------------- : +; COM_APPM 0 0= Application menu not configured. : +; 1= Application menu configured. : +; COM_DOSS 1 0= DOS Services not configured. : +; 1= DOS Services configured. : +; COM_REFD 2 0= Do not refresh directory buffer : +; during command line or PEC execution: +; 1= Refresh directory buffer during : +; command line or PEC execution. : +; COM_RESS 3 0= Transient shell. : +; 1= Resident shell. : +; COM_AUTI 4 0= Automatic predefined menu : +; installation is not active. : +; 1= Automatic predefined menu : +; installation is active. : +; COM_DRV2 5 0= Multiple drive buffer not active. : +; 1= Multiple drive buffer active. : +; COM_FLCL 6 0= Command line access is not active. : +; 1= Command line access is active. : +; COM_FLMI 7 0= Maintain menu item access is not : +; active. : +; 1= Maintain menu item access is active.: +; COM_FLCS 8 0= Maintain color selections access is : +; not active. : +; 1= Maintain color selections access is : +; active. : +; COM_FLED 9 0= Exit to DOS is not active. : +; 1= Exit to DOS is active. : +; COM_MOUS 10 0= Mouse is not active. : +; 1= Mouse is active. : +; COM_LFMS 11 0= Right hand mouse. : +; 1= Left hand mouse. : +; COM_M10H 12 0= No function assigned. : +; 1= Graphics EGA mode 10H requested : +; COM_M11H 13 0= No function assigned. : +; 1= Graphics VGA/MCGA mode 11H requested: +; COM_M12H 14 0= No function assigned. : +; 1= Graphics VGA mode 12H requested : +; COM_TEXT 15 0= No function assigned. : +; 1= Text mode is requested. : +; : +; COM_STATE2 = Option word indicating invocation : +; parameters passed through PSP. : +; : +; Label Bit Description : +; -------- --- ----------------------------------- : +; COM_SOUD 0 0= Sound not active. : +; 1= Sound active. : +; : +; COM_NLS 1 0= Not active. : +; 1= NLS help index display option active: +; : +; COM_DFSAV 2 0= Not active. : +; 1= Directory and file save active. : +; : +; COM_BUFO 3 0= Not active. : +; 1= Dir/file buffer size override on. : +; : +; COM_DBCS 4 0= Not active. : +; 1= DBCS active. : +; : +; COM_DATE 5 0= Not active. : +; 1= Date/time active. : +; : +; COM_COM2 5 0= Not active. D491: +; 1= COM2 active. D491: +; : +; COM_DFSIZE = Size of DOS directory and file buffer : +; to allocate in paragraphs. Used only : +; if buffer override option is active : +; in COM_STATE2. : +; : +; COM_PSPOFF = Offset of SHELL.EXE PSP : +; COM_PSPSEG = Segment of SHELL.EXE PSP : +; : +; Entry point: EXAMINE_PSP : +; : +; Notes: EXAMINE_PSP is beginning overlay point for mouse : +; driver. : +; : +; Internal references: MANAGE_ERROR : +; PCINSTR_CALL : +; : +; External references: INT 21H 19H Return current drive : +; INT 21H 47H Return current path : +; : +;-----------------------------------------------------------------------------+ +; +EXAMINE_PSP PROC NEAR +; +; Intialize to search PSP for invocation options +; + MOV INS_OPT,0 ;set to find string + MOV ES, COM_PSPSEG ;get PSP segment + MOV DI, 80H ;get offset of PSP length byte + MOV CL, ES:[DI] ;get PSP length byte + CMP CL, 0 ;any command line options? + JA EP03 ;yes, continue + MOV COM_ERRID,ERR_PSP ;invalid psp command line + JMP EPEXIT ;exit +EP03: XOR CH, CH ;clear high byte + MOV SI, COM_PSPOFF ;set offset of PSP + ADD SI, 81H ;get command line buffer + LEA DI, EP_CMDLIN ;set offset of command line buffer + MOV INS_SOFF, DI ;save offset of command buffer + MOV INS_SSEG, DATA ;save segment of command buffer + MOV ES, INS_SSEG ;set segment of command buffer + mov dl, 0 ;init comment flag + mov ins_slen, 0 ;init length of command search str + mov com_cmdact, 0 ;init actual length of commands + mov com_cmdnum, 0 ;init length of commands found +; +EP034: PUSH DS ;save data seg + MOV DS, COM_PSPSEG ;PSP segment is source seg + mov al, ds:[si] ; + POP DS ; +; + cmp al, ' ' ; + jbe ep039 ; +; + cmp al, '{' ; + jne ep037 ; + mov dl, 1 ; + jmp ep039 ; +; +EP037: cmp al, '}' ; + jne ep038 ; + mov dl, 0 ; + jmp ep039 ; +; +EP038: cmp dl, 1 ; + je ep039 ; +; + cmp al, 'a' ; + jb ep0385 ; + cmp al, 'z' ; + ja ep0385 ; + sub al, 32 ; +; +ep0385: mov es:[di], al ; + inc ins_slen ; + inc com_cmdact ; + inc di ; +; +ep039: inc si ; + loop ep034 ; +; + MOV EP_ENDOFF, DI ;set offset of last byte in buffer +; +; Check for profile filename /PRO:filename.PRO +; +EP1900: XOR AX,AX ;get current drive + MOV AH,19H + INT 21H + ADD AL,65 ;convert from # to alpha char + MOV COM_RFILSPEC,AL ;complete current drive and path +; + MOV AH,47H ;read current path + MOV DL,0 + LEA SI,COM_RFILSPEC+3 ;point past C:\ + INT 21H + JNC EP1910 ;check for error +; + MOV COM_ERRID,ERR_BADD ;bad disk or drive door open + JMP EPEXIT +; +EP1910: MOV AX,STR_PROFACT ;profile active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 ;check if not found, error + JG EP1920 +; + JMP EP05 ;profile not active get next var +; +EP1920: ADD COM_CMDNUM,AX +; + PUSH INS_FOFF ;save invocation parameter offset +; + MOV CX,INS_RSLT ;save starting search point + ADD CX,INS_FLEN ;point past /PRO: to beginning of + ; profile file name +; + MOV AX,STR_PROEXT ;profile extension + CALL FAR PTR GET_STRING +; + MOV INS_FLEN,AX ;length of find string + MOV INS_FOFF,DI ;offset of find string '.PRO' + MOV INS_FSEG,ES ;segment of string + CALL PCINSTR_CALL ;search for string +; + POP INS_FOFF ;restore before exit +; + CMP INS_RSLT,0 + JG EP1930 +; + MOV COM_ERRID,ERR_MOUS ;invalid profile file + JMP EPEXIT +; +EP1930: PUSH SI + PUSH DS +; + MOV AX,INS_RSLT + SUB AX,CX ;ending offset - starting offset + ADD AX,INS_FLEN ; + length of extension = # bytes + ; to move + ADD COM_CMDNUM,AX ; + MOV BX,INS_SOFF ;calculate offset of source strg + ADD BX,CX ; to move + DEC BX +; + PUSH BX ;save source offset + PUSH INS_SSEG ;save source segment +; + MOV CX,AX ; = number of bytes to move + LEA DI,COM_RFILSPEC ;get dest offset +; + PUSH DS + PUSH ES + POP DS + POP ES +; +EP1940: MOV AL,ES:[DI] ;locate end of drive and path + CMP AL,0 ; in shell profile name buffer + JE EP1980 +; + INC DI ;point to next character + JMP EP1940 +; +EP1980: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of + JE EP1990 ; file separator +; + MOV BYTE PTR ES:[DI],'\' ;add path and filename separator + INC DI ;point to where filename goes +; +EP1990: POP DS ;now move profile filename string + POP SI ; to end of profile buffer path +; + REP MOVSB ;copy profile filespec +; + POP DS + POP SI +; +; Open profile file +; + MOV AH, 3DH ;DOS open handle + MOV AL, 010B ;open for read/write + LEA DX, COM_RFILSPEC ;set offset of profile filename + INT 21H ;open profile file + JNC EP_1992 ;continue if no error + MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open + JMP EPEXIT +; +; Read profile file to command buffer ; +; +ep_1992: mov dl, 0 + mov di, ep_endoff + MOV BX, AX ;set file handle +; +ep_1993: push dx + MOV AH, 3FH ;DOS read handle + mov cx, 1 + lea dx, gen_data + INT 21H ;read profile into buffer + JNC EP_1994 ;continue if no error + pop dx + MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open + JMP EPEXIT + +EP_1994: ; ADD INS_SLEN, AX ; + + +epx034: + cmp ax, 0 ; + ja epx035 +; + pop dx + jmp ep1995 +; +epx035: pop dx +; + mov al, byte ptr gen_data ; +; + cmp al, ' ' ; + jbe epx039 ; +; + cmp al, '{' ; + jne epx037 ; + mov dl, 1 ; + jmp epx039 ; +; +epx037: cmp al, '}' ; + jne epx038 ; + mov dl, 0 ; + jmp epx039 ; +; +epx038: cmp dl, 1 ; + je epx039 ; +; + cmp al, 'a' ; + jb epx0385 ; + cmp al, 'z' ; + ja epx0385 ; + sub al, 32 ; +; +epx0385: mov [di], al ; + inc ins_slen ; + inc com_cmdact ; + inc di ; +; +epx039: jmp ep_1993 ; +; +; Close profile handle +; +EP1995: MOV AH, 3EH ; + INT 21H ;close handle + JNC EP05 ;continue if no error + MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open + JMP EPEXIT +; +; Convert command string alpha to upper case +; +EP05: MOV ES,INS_SSEG ;get PSP command line segment + MOV DI,INS_SOFF ;point to PSP command line string + MOV CX,INS_SLEN ;get length of PSP +; + MOV COM_STATE, 0 ; + MOV COM_STATE2,0 ;initialize to zero +; + MOV AX,STR_CDON ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2510 ; + ADD COM_CMDNUM,AX ; + OR COM_CONFIRM, COM_CONFDEL ; +ep2510: + MOV AX,STR_CDOFF ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2511 ; + ADD COM_CMDNUM,AX ; + AND COM_CONFIRM,NOT COM_CONFDEL +ep2511: + MOV AX,STR_CRON ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2520 ; + ADD COM_CMDNUM,AX ; + OR COM_CONFIRM, COM_CONFREPL; +ep2520: + MOV AX,STR_CROFF ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2521 ; + ADD COM_CMDNUM,AX ; + AND COM_CONFIRM,NOT COM_CONFREPL +ep2521: + MOV AX,STR_ASON ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2530 ; + ADD COM_CMDNUM,AX ; + OR COM_CONFIRM, COM_ALLOWSEL; +ep2530: + MOV AX,STR_ASOFF ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2540 ; + ADD COM_CMDNUM,AX ; + AND COM_CONFIRM,NOT COM_ALLOWSEL +ep2540: + MOV AX,STR_SBNAME ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2550 ; + ADD COM_CMDNUM,AX ; + MOV SORTSTAT, SST_NAME ; + JMP EP2590 +ep2550: + MOV AX,STR_SBEXT ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2560 ; + ADD COM_CMDNUM,AX ; + MOV SORTSTAT, SST_EXT ; + JMP EP2590 +ep2560: + MOV AX,STR_SBSIZE ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2570 ; + ADD COM_CMDNUM,AX ; + MOV SORTSTAT, SST_SIZE ; + JMP EP2590 +ep2570: + MOV AX,STR_SBDATE ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2580 ; + ADD COM_CMDNUM,AX ; + MOV SORTSTAT, SST_DATE ; + JMP EP2590 +ep2580: + MOV AX,STR_SBDISK ; + CALL CHECK_STRING ; + CMP INS_RSLT,0 ; + JE EP2590 ; + ADD COM_CMDNUM,AX ; + MOV SORTSTAT, 0 ; +ep2590: +; +; Check for NLS translation option for help index display +; + MOV AX,STR_NLS ;NLS configured + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP25 +; + ADD COM_CMDNUM,AX ;add length to found length + OR COM_STATE2,COM_NLS ;app menu configured +; +; Check for application menu option +; +EP25: MOV AX,STR_APPMENU ;app menu configured + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP30 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_APPM ;app menu configured +; +; Check for DOS Services option +; +EP30: MOV AX,STR_DOSSERV ;DOS services configured + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP50 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_DOSS ;DOS services configured +; +; Check for transient mode operation +; +EP50: MOV AX,STR_TRANS ;transient shell configured + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JNE EP51 +; + OR COM_STATE,COM_RESS ;resident shell configured + JMP EP60 +; +EP51: ADD COM_CMDNUM,AX +; +; Check for hi-res graphics mode operation = Mode 10 +; +EP60: MOV AX,STR_MODE10H ;graphics mode 10H + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP62 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_M10H ;activate graphics mode flag + JMP EP74 +; +; Check for hi-res graphics mode operation = Mode 11 +; +EP62: MOV AX,STR_MODE11H ;graphics mode 11H + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP64 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_M11H ;activate graphics mode flag + JMP EP74 +; +; Check for hi-res graphics mode operation = Mode 12 +; +EP64: MOV AX,STR_MODE12H ;graphics mode 12H + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP65 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_M12H ;activate graphics mode flag + JMP EP74 +; +; Check for text mode operation = Mode 7 or 3 +; +EP65: MOV AX,STR_TEXTS ;graphics mode 12H + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP66 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_TEXT ;activate text mode flag + JMP EP74 +; +; User did not set desired video mode, default to highest available +; +EP66: CMP GE_MODEL,MODEL_30 ;check if model 25 and 30 + JNE EP68 +; + CMP GE_SUBMODEL,SUBMD_30 + JE EP67 +; + CMP GE_SUBMODEL,SUBMD_25 + JNE EP68 +; +EP67: OR COM_STATE,COM_M11H ;default to mode 11H + JMP EP74 +; +; Check for VGA video +; +EP68: MOV AX,1A00H ;BIOS check display + INT 10H ; + CMP AL,1AH ;VGA supported? + JNE EP686 ;no, continue +; +; VGA video, check for INFOWINDOW display +; + CMP BL, 4 ;infowindow display? + JNE EP685 ;no, continue +; + OR COM_STATE, COM_M10H ;mode for VGA with infowindow + JMP EP74 ;continue +; +; VGA video, non-INFOWINDOW, set highest available mode +; +EP685: MOV AH, 1BH + MOV BX, 0 + PUSH DS + POP ES + LEA DI, GEN_DATA + INT 10H + PUSH ES:[DI] + PUSH ES:[DI+2] + POP ES + POP DI +; + TEST BYTE PTR ES:[DI+2], 00000100B + JZ EP6851 + OR COM_STATE, COM_M12H + JMP EP74 +EP6851: TEST BYTE PTR ES:[DI+2], 00000010B + JZ EP6852 + OR COM_STATE, COM_M11H + JMP EP74 +EP6852: TEST BYTE PTR ES:[DI+2], 00000001B + JZ EP6853 + OR COM_STATE, COM_M10H + JMP EP74 +EP6853: OR COM_STATE, COM_TEXT + JMP EP74 +; +; Check for EGA video +; +EP686: MOV AH,12H ;BIOS alternate select + MOV BL,10H ;return EGA info + INT 10H ; + CMP BL,10H ;EGA video? + JNE EP687 ;yes, continue +; +; CGA or Monochrome video +; + OR COM_STATE,COM_TEXT ;text mode operation + JMP EP74 ;continue +; +; EGA video, check for sufficient memory for mode 10 +; +EP687: CMP BL,3H ;256K available? + JAE EP688 ;yes, continue +; + OR COM_STATE,COM_TEXT ;ega has no memory for mode 10 + JMP EP74 ;continue +; +; EGA with 256K, check for cga or monochrome emulation +; +EP688: AND CL,1111B ;save registers + CMP CL,9 + JE EP689 +; +; EGA emulating CGA or Monochrome +; + OR COM_STATE,COM_TEXT + JMP EP74 +; +; EGA in EGA mode +; +EP689: OR COM_STATE,COM_M10H +; +; Check for application main menu filename +; +EP74: TEST COM_STATE,COM_APPM ;if app menu not configured do not + JNE EP75 ; search for app main menu filespc +; + MOV AX,STR_APMFILE ;app main menu filename + CALL CHECK_STRING ;search for string + CALL PCINSTR_CALL + CMP INS_RSLT,0 ;check if parameter found + JG EP75 +; + JMP EP112 ;check next parameter +; +EP75: XOR AX,AX ;get current drive + MOV AH,19H + INT 21H + ADD AL,65 ;convert from # to alpha char + MOV APP_MFILSPEC,AL ;complete current drive and path +; + MOV AH,47H ;read current path + MOV DL,0 + LEA SI,APP_MFILSPEC+3 ;point past C:\ + INT 21H + JNC EP78 ;check for error +; + MOV COM_ERRID,ERR_BADD ;bad disk or drive door open + JMP EPEXIT +; +EP78: MOV AX,STR_APMFILE ;app main menu filename + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JG EP80 +; + MOV AX,STR_APPMFILE ;default app menu filename + CALL FAR PTR GET_STRING ;user did not supply new app menu +; + PUSH SI ;save data segment + PUSH DS +; + PUSH DI ;save filename offset + PUSH ES ;save filename segment +; + JMP EP92 ; SHELL.MEU file instead +; +EP80: PUSH INS_FOFF ;save invocation parameter offset + ADD COM_CMDNUM,AX +; + MOV CX,INS_RSLT ;save starting search point + ADD CX,INS_FLEN ;point past /MEU: to beginning of + ; menu file name + MOV AX,STR_AAPEXT ;main application menu extension + CALL FAR PTR GET_STRING +; + MOV INS_FLEN,AX ;length of string + MOV INS_FOFF,DI ;offset of string '.MEU' + MOV INS_FSEG,ES ;segment of string + CALL PCINSTR_CALL ;search for string +; + POP INS_FOFF +; + CMP INS_RSLT,0 + JG EP90 +; + MOV COM_ERRID,ERR_APIF ;invalid main app menu filename + JMP EPEXIT +; +EP90: PUSH SI ;save data segment + PUSH DS +; + MOV AX,INS_RSLT + SUB AX,CX ;ending offset - starting offset + ADD AX,INS_FLEN ; + length of extension = # bytes + ; to move + ADD COM_CMDNUM,AX +; + MOV BX,INS_SOFF ;calculate offset of source strg + ADD BX,CX ; to move + DEC BX +; + PUSH BX ;save source offset + PUSH INS_SSEG ;save source segment +; +EP92: MOV CX,AX ; = number of bytes to move + LEA DI,APP_MFILSPEC ;get dest offset +; + PUSH DS + PUSH ES + POP DS + POP ES +; +EP94: MOV AL,ES:[DI] ;locate end of drive and path + CMP AL,0 ; in shell app menu file buffer + JE EP98 +; + INC DI ;point to next character + JMP EP94 +; +EP98: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of + JE EP99 ; file separator +; + MOV BYTE PTR ES:[DI],'\' ;add path and filename separator + INC DI ;point to where filename goes +; +EP99: POP DS ;now move shell menu filename to + POP SI ; end of app menu file path +; + REP MOVSB ;copy application menu filespec +; + POP DS + POP SI +; +; Move copy of menu filename to first menu buffer +; +EP100: MOV AX,STR_APMFILE ;app main menu filename + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JG EP103 +; + MOV AX,STR_APPMFILE ;default app menu filename + CALL FAR PTR GET_STRING ;user did not supply new app menu +; + PUSH SI ;save data segment + PUSH DS +; + PUSH DI ;save filename offset + PUSH ES ;save filename segment +; + JMP EP105 ; SHELL.MEU file instead +; +EP103: PUSH INS_FOFF ;save invocation parameter offset +; + MOV CX,INS_RSLT ;save starting search point + ADD CX,INS_FLEN ;point past /MEU: to beginning of + ; menu file name + MOV AX,STR_AAPEXT ;main application menu extension + CALL FAR PTR GET_STRING +; + MOV INS_FLEN,AX ;length of string + MOV INS_FOFF,DI ;offset of string '.MEU' + MOV INS_FSEG,ES ;segment of string + CALL PCINSTR_CALL ;search for string +; + POP INS_FOFF +; + CMP INS_RSLT,0 + JG EP104 +; + MOV COM_ERRID,ERR_APIF ;invalid main app menu filename + JMP EPEXIT +; +EP104: PUSH SI ;save data segment + PUSH DS +; + MOV AX,INS_RSLT + SUB AX,CX ;ending offset - starting offset + ADD AX,INS_FLEN ; + length of extension = # bytes + ; to move +; + MOV BX,INS_SOFF ;calculate offset of source strg + ADD BX,CX ; to move + DEC BX +; + PUSH BX ;save source offset + PUSH INS_SSEG ;save source segment +; +EP105: MOV CX,AX ; = number of bytes to move + LEA DI,APP_MFILNAME ;get dest offset +; + PUSH DS + PUSH ES + POP DS + POP ES +; +EP108: POP DS ;now move shell menu filename to + POP SI ; end of app menu file path +; + REP MOVSB ;copy application menu filespec +; + POP DS + POP SI +; +; Check for color filename +; +EP112: XOR AX,AX ;get current drive + MOV AH,19H + INT 21H + ADD AL,65 ;convert from # to alpha char + MOV COM_CFILSPEC,AL ;complete current drive and path +; + MOV AH,47H ;read current path + MOV DL,0 + LEA SI,COM_CFILSPEC+3 ;point past C:\ + INT 21H + JNC EP115 ;check for error +; + MOV COM_ERRID,ERR_BADD ;bad disk or drive door open + JMP EPEXIT +; +EP115: MOV AX,STR_CLFILE ;color filename + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 ;check if not found, error + JG EP118 +; + MOV AX,STR_CLRFILE ;default color filename + CALL FAR PTR GET_STRING ;user did not supply new app menu +; + PUSH SI ;save data segment + PUSH DS +; + PUSH DI ;save offset of filename + PUSH ES ;save segment of filename +; + JMP EP122 ; SHELL.CLR file +; +EP118: PUSH INS_FOFF ;save invocation parameter offset + ADD COM_CMDNUM,AX +; + MOV CX,INS_RSLT ;save starting search point + ADD CX,INS_FLEN ;point past /K: to beginning of + ; color file name +; + MOV AX,STR_CLREXT ;color profile extension + CALL FAR PTR GET_STRING +; + MOV INS_FLEN,AX ;length of find string + MOV INS_FOFF,DI ;offset of find string '.CLR' + MOV INS_FSEG,ES ;segment of string + CALL PCINSTR_CALL ;search for string +; + POP INS_FOFF ;restore before exit +; + CMP INS_RSLT,0 + JG EP120 +; + MOV COM_ERRID,ERR_CLRF ;invalid user color profile + JMP EPEXIT +; +EP120: PUSH SI + PUSH DS +; + MOV AX,INS_RSLT + SUB AX,CX ;ending offset - starting offset + ADD AX,INS_FLEN ; + length of extension = # bytes + ; to move + ADD COM_CMDNUM,AX + MOV BX,INS_SOFF ;calculate offset of source strg + ADD BX,CX ; to move + DEC BX +; + PUSH BX ;save source offset + PUSH INS_SSEG ;save source segment +; +EP122: MOV CX,AX ; = number of bytes to move + LEA DI,COM_CFILSPEC ;get dest offset +; + PUSH DS + PUSH ES + POP DS + POP ES +; +EP124: MOV AL,ES:[DI] ;locate end of drive and path + CMP AL,0 ; in shell color file buffer + JE EP128 +; + INC DI ;point to next character + JMP EP124 +; +EP128: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of + JE EP129 ; file separator +; + MOV BYTE PTR ES:[DI],'\' ;add path and filename separator + INC DI ;point to where filename goes +; +EP129: POP DS ;now move color filename string + POP SI ; to end of color buffer path +; + REP MOVSB ;copy color index filespec +; + POP DS + POP SI +; +; Check for multiple DOS Service drive buffers +; +EP130: MOV AX,STR_MULTIPE ;multiple drive display + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP140 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_DRV2 +; +; Check for active maintain color option +; +EP140: MOV AX,STR_CLRACT ;color active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 ; + JE EP150 ; +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_FLCS ;maintain color is active +; +; Check for active maintain menu option +; +EP150: MOV AX,STR_MENUACT ;menu maintainance active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP160 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_FLMI ;maintain menu is active +; +; Check for active exit to DOS option +; +EP160: AND FLAG_FSEXIT, NOT DIT_L1 ;turn exit to DOS dither off start + AND FLAG_FDEXIT, NOT DIT_L1 ;turn exit file system dither off +; + MOV AX,STR_EXITDOS ;exit to DOS active + CALL CHECK_STRING ;search for string +; + OR FLAG_FSEXIT, DIT_L1 ;turn exit to DOS dither on start +; + TEST COM_STATE,COM_APPM ;app menu configured + JNZ EP161 ; +; + OR FLAG_FDEXIT, DIT_L1 ;turn exit from file system dither + ; on +; +EP161: CMP INS_RSLT,0 + JE EP170 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_FLED ;exit to DOS is active +; + AND FLAG_FSEXIT, NOT DIT_L1 ;turn exit to DOS dither off start + AND FLAG_FDEXIT, NOT DIT_L1 ;turn exit file system dither off +; +; Check for active command line option +; +EP170: MOV AX,STR_CMDLINE ;command line active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP180 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_FLCL ;command line is active +; +; Check for predefined menu installation option +; +EP180: MOV AX,STR_PREDACT ;predefined menu active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP190 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_AUTI ;predefined is active +; +; Check for mouse filename /MOS:filename.MOS +; +EP190: XOR AX,AX ;get current drive + MOV AH,19H + INT 21H + ADD AL,65 ;convert from # to alpha char + MOV COM_VFILSPEC,AL ;complete current drive and path +; + MOV AH,47H ;read current path + MOV DL,0 + LEA SI,COM_VFILSPEC+3 ;point past C:\ + INT 21H + JNC EP191 ;check for error +; + MOV COM_ERRID,ERR_BADD ;bad disk or drive door open + JMP EPEXIT +; +EP191: MOV AX,STR_MOUSACT ;mouse active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 ;check if not found, error + JG EP192 +; + JMP EP200 ;mouse is not active get next var +; +EP192: OR COM_STATE,COM_MOUS ;mouse is active + ADD COM_CMDNUM,AX +; + PUSH INS_FOFF ;save invocation parameter offset +; + MOV CX,INS_RSLT ;save starting search point + ADD CX,INS_FLEN ;point past /MOS: to beginning of + ; mouse file name +; + MOV AX,STR_MOSEXT ;mouse extension + CALL FAR PTR GET_STRING +; + MOV INS_FLEN,AX ;length of find string + MOV INS_FOFF,DI ;offset of find string '.MOS' + MOV INS_FSEG,ES ;segment of string + CALL PCINSTR_CALL ;search for string +; + POP INS_FOFF ;restore before exit +; + CMP INS_RSLT,0 + JG EP193 +; + MOV COM_ERRID,ERR_MOUS ;invalid mouse driver + JMP EPEXIT +; +EP193: PUSH SI + PUSH DS +; + MOV AX,INS_RSLT + SUB AX,CX ;ending offset - starting offset + ADD AX,INS_FLEN ; + length of extension = # bytes + ; to move + ADD COM_CMDNUM,AX + MOV BX,INS_SOFF ;calculate offset of source strg + ADD BX,CX ; to move + DEC BX +; + PUSH BX ;save source offset + PUSH INS_SSEG ;save source segment +; + MOV CX,AX ; = number of bytes to move + LEA DI,COM_VFILSPEC ;get dest offset +; + PUSH DS + PUSH ES + POP DS + POP ES +; +EP194: MOV AL,ES:[DI] ;locate end of drive and path + CMP AL,0 ; in shell mouse file buffer + JE EP198 +; + INC DI ;point to next character + JMP EP194 +; +EP198: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of + JE EP199 ; file separator +; + MOV BYTE PTR ES:[DI],'\' ;add path and filename separator + INC DI ;point to where filename goes +; +EP199: POP DS ;now move mouse filename string + POP SI ; to end of mouse buffer path +; + REP MOVSB ;copy mouse index filespec +; + POP DS + POP SI +; +; Check for left hand mouse option +; +EP200: MOV AX,STR_LEFTACT ;left hand mouse + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP205 +; + ADD COM_CMDNUM,AX + OR COM_STATE,COM_LFMS ;left hand mouse +; +; Check for sound active option +; +EP205: MOV AX,STR_SOUDACT ;sound active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP207 +; + ADD COM_CMDNUM,AX + OR COM_STATE2,COM_SOUD ;sound active +; +; Check for dir/file buffer save option +; +EP207: MOV AX,STR_DFSAVE ;check if option active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP210 +; + ADD COM_CMDNUM,AX + OR COM_STATE2,COM_DFSAVE ;dir/file buffer save option + ; active +; +; Save filespec of shell.hlp at COM_HFILSPEC +; +EP210: XOR AX,AX ;get current drive + MOV AH,19H + INT 21H + ADD AL,65 ;convert from # to alpha char + MOV COM_HFILSPEC,AL ;complete current drive and path +; + MOV AH,47H ;read current path + MOV DL,0 + LEA SI,COM_HFILSPEC+3 ;point past C:\ + INT 21H + JNC EP250 +; + MOV COM_ERRID,ERR_BADD ;bad disk or drive door open + JMP EPEXIT +; +EP250: LEA DI,COM_HFILSPEC ;get dest offset +; + MOV AX,DS + MOV ES,AX +; +EP260: MOV AL,ES:[DI] ;locate end of drive and path + CMP AL,0 ; in shell help file buffer + JE EP270 +; + INC DI ;point to next character + JMP EP260 +; +EP270: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of + JE EP275 ; file separator +; + MOV BYTE PTR ES:[DI],'\' ;add path and filename separator + INC DI ;point to where filename goes +; +EP275: PUSH DS ;save register +; + PUSH DI + MOV AX,STR_HLPFILE ;default help text filename + CALL FAR PTR GET_STRING + MOV SI,DI ;get offset of SHELL.HLP + MOV CX,AX ;get length + POP DI +; + PUSH ES ;set source segment + POP DS +; + REP MOVSB +; + POP DS ;restore +; +; Check for associate filename /ASC:filename.ASC +; +EP300: XOR AX,AX ;get current drive + MOV AH,19H + INT 21H + ADD AL,65 ;convert from # to alpha char + MOV COM_AFILSPEC,AL ;complete current drive and path +; + MOV AH,47H ;read current path + MOV DL,0 + LEA SI,COM_AFILSPEC+3 ;point past C:\ + INT 21H + JNC EP315 ;check for error +; + MOV COM_ERRID,ERR_BADD ;bad disk or drive door open + JMP EPEXIT +; +EP315: MOV AX,STR_ASOFILE ;associate filename /ASO + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 ;check if not found, error + JG EP318 +; + MOV AX,STR_ASCEXT ;default associate filename + CALL FAR PTR GET_STRING ;user did not supply new app menu +; + PUSH SI ;save data segment + PUSH DS +; + PUSH DI ;save offset of filename + PUSH ES ;save segment of filename +; + JMP EP322 ; SHELL.ASO file +; +EP318: PUSH INS_FOFF ;save invocation parameter offset + ADD COM_CMDNUM,AX +; + MOV CX,INS_RSLT ;save starting search point + ADD CX,INS_FLEN ;point past /ASO: to beginning of + ; associate file name +; + MOV AX,STR_ASOEXT ;assoicate profile extension + CALL FAR PTR GET_STRING +; + MOV INS_FLEN,AX ;length of find string + MOV INS_FOFF,DI ;offset of find string '.ASO' + MOV INS_FSEG,ES ;segment of string + CALL PCINSTR_CALL ;search for string +; + POP INS_FOFF ;restore before exit +; + CMP INS_RSLT,0 + JG EP320 +; + MOV COM_ERRID,ERR_ASRF ;invalid user associate profile + JMP EPEXIT +; +EP320: PUSH SI + PUSH DS +; + MOV AX,INS_RSLT + SUB AX,CX ;ending offset - starting offset + ADD AX,INS_FLEN ; + length of extension = # bytes + ; to move + ADD COM_CMDNUM,AX + MOV BX,INS_SOFF ;calculate offset of source strg + ADD BX,CX ; to move + DEC BX +; + PUSH BX ;save source offset + PUSH INS_SSEG ;save source segment +; +EP322: MOV CX,AX ; = number of bytes to move + LEA DI,COM_AFILSPEC ;get dest offset +; + PUSH DS + PUSH ES + POP DS + POP ES +; +EP324: MOV AL,ES:[DI] ;locate end of drive and path + CMP AL,0 ; in shell associate file buffer + JE EP328 +; + INC DI ;point to next character + JMP EP324 +; +EP328: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of + JE EP329 ; file separator +; + MOV BYTE PTR ES:[DI],'\' ;add path and filename separator + INC DI ;point to where filename goes +; +EP329: POP DS ;now move filename string + POP SI ; to end of buffer path +; + REP MOVSB ;copy associate filespec +; + POP DS + POP SI +; +; Check for buffer size override +; +EP350: MOV AX,STR_BUFO ;buffer size override active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP390 +; + ADD COM_CMDNUM,AX + MOV AX,INS_SSEG ;segment of PSP + MOV ES,AX + MOV BX,INS_SOFF ;offset of PSP + ADD BX,INS_RSLT ;start of /B: parm + ADD BX,INS_FLEN ;start of kilobyte value + DEC BX ;adjust for zero offset + PUSH BX +; +EP360: CMP ES:BYTE PTR[BX],'0' ;ASCII digit GE 0 + JB EP370 ;no, end of digits +; + CMP ES:BYTE PTR[BX],'9' ;ASCII digit LE 9 + JA EP370 ;no, end of digits +; + INC BX + JMP EP360 ;check next digit +; +EP370: POP AX + CMP AX,BX ;any digits? + JE EP390 ;no, ignore /B parm +; + MOV ST2_OPT1,ST2_DEC16BI+ST2_SETSTRLEN + ;convert ASCII value + MOV ST2_STRGSEG,ES ;segment of value + MOV ST2_STRGOFF,AX ;offset of value + SUB BX,AX ;calculate numbers of digits + MOV ST2_STRGLEN,BX ;set length to convert + ADD COM_CMDNUM,BX +; + CALL PCST2IN_CALL ;convert the value +; + TEST ST2_ERROR,ST2_OUTOFMEM ;value too large + JNZ EP375 ;yes, set to fail during alloc +; + CMP ST2_NUMH,0 ;value too large + JNE EP375 ;yes, set to fail during alloc +; + CMP ST2_NUML,960 ;value to large + JB EP380 ;no, attempt to alloc it +; +EP375: MOV COM_DFSIZE,0F000H ;set to fail during alloc + JMP EP385 + +EP380: MOV AX,ST2_NUML ;get kilobyte value + MOV BX,64 ;convert to paragraphs + MUL BX ;kilo -> para + MOV COM_DFSIZE,AX ;set value to allocate + +EP385: OR COM_STATE2,COM_BUFO ;buffer size override active +; +; Check if DBCS is active +; +EP390: MOV AX,STR_DBCS ;DBCS active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP395 +; + ADD COM_CMDNUM,AX + OR COM_STATE2,COM_DBCS ;DBCS active +; +; Check for date/time active option +; +EP395: MOV AX,STR_DATE ;date active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP397 +; + ADD COM_CMDNUM,AX + OR COM_STATE2,COM_DATE ;date/time active +; +; Check for COM2 active option +; +EP397: MOV AX,STR_COM2 ;COM2 active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 + JE EP398 +; + ADD COM_CMDNUM,AX + OR COM_STATE2,COM_COM2 ;COM2 active +; +; Check for enhancement activation +; +EP398: MOV AX,STR_ENH ;COM2 active + CALL CHECK_STRING ;search for string + CMP INS_RSLT,0 ; +;>>SN JE EP400 + JE EP399 ;>>SN +; + ADD COM_CMDNUM,AX + OR COM_STATE2,COM_ENHA ;COM2 active +; ;>>SN +; Check for Special Needs option ;>>SN +; ;>>SN +EP399: MOV AX, STR_SN ;>>SN + CALL CHECK_STRING ;>>SN + CMP INS_RSLT,0 ;>>SN + JE EP400 ;>>SN +; ;>>SN + ADD COM_CMDNUM, AX ;>>SN + OR COM_STATE2,COM_SNA ;>>SN +; +; Check for invalid parameters +; +EP400: + MOV AX, COM_CMDACT + CMP AX, COM_CMDNUM + JE EP405 +; + MOV COM_ERRID,ERR_BADCMD + JMP EPEXIT +; +; Check for missing invocation parameter errors +; +EP405: TEST COM_STATE,COM_APPM + JNE EP410 +; + TEST COM_STATE,COM_DOSS + JNE EP410 +; + MOV COM_ERRID,ERR_NODA ;dos/app both not active + JMP EPEXIT +; +; Turn off color selection if mode 11 active +; +EP410: TEST COM_STATE,COM_M11H ; + JZ EPEXIT ; +; + AND COM_STATE, NOT COM_FLCS ; +; +EPEXIT: ;exit +; + RET +EXAMINE_PSP ENDP +; +PAGE +;-----------------------------------------------------------------------------+ +; : +; Name: CHECK_STRING : +; : +; Description: Search for string identified by AX. : +; : +; Entry: AX = String ID. : +; : +; Exit: INS_RSLT = Offset into search string where match : +; found. : +; Entry point: CHECK_STRING : +; : +; Notes: None. : +; : +; Internal references: None. : +; : +; External references: None. : +; : +;-----------------------------------------------------------------------------+ +; +CHECK_STRING PROC NEAR +; + CALL FAR PTR GET_STRING ;get address and length of string +; + MOV INS_SPOFF,0 ;start at beginning of command lin + MOV INS_FLEN,AX ;set length of string to find + MOV INS_FOFF,DI ;set offset of string to find + MOV INS_FSEG,ES ;set segment of string to find + CALL PCINSTR_CALL +; +CHKSEXIT: ;exit +; + RET +CHECK_STRING ENDP diff --git a/v4.0/src/INC/SMDOSSYM.INC b/v4.0/src/INC/SMDOSSYM.INC new file mode 100644 index 0000000..5604e59 --- /dev/null +++ b/v4.0/src/INC/SMDOSSYM.INC @@ -0,0 +1,157 @@ +; SCCSID = @(#)dossym.asm 1.1 85/04/10 +; SCCSID = @(#)dossym.asm 1.1 85/04/10 + PAGE 80,132 +TRUE EQU 0FFFFh +FALSE EQU 0 + +Installed = TRUE +IFNDEF DEBUG + DEBUG = FALSE +ENDIF + +include dosmac.INC +INCLUDE VERSIONA.INC ;DEFINE THE MAJOR AND MINOR VERSION NUMBERS + +IF2 + %OUT DOSSYM in Pass 2 +ENDIF + +BREAK + +c_DEL EQU 7Fh ; ASCII rubout or delete previous char +c_BS EQU 08h ; ^H ASCII backspace +c_CR EQU 0Dh ; ^M ASCII carriage return +c_LF EQU 0Ah ; ^J ASCII linefeed +c_ETB EQU 17h ; ^W ASCII end of transmission +c_NAK EQU 15h ; ^U ASCII negative acknowledge +c_ETX EQU 03h ; ^C ASCII end of text +c_HT EQU 09h ; ^I ASCII tab + +BREAK + +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; ; +; C A V E A T P R O G R A M M E R ; +; ; +; Certain structures, constants and system calls below are private to ; +; the DOS and are extremely version-dependent. They may change at any ; +; time at the implementors' whim. As a result, they must not be ; +; documented to the general public. If an extreme case arises, they ; +; must be documented with this warning. ; +; ; +; Those structures and constants that are subject to the above will be ; +; marked and bracketed with the flag: ; +; ; +; C A V E A T P R O G R A M M E R ; +; ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + +include bpb.INC + +include buffer.INC + +BREAK +; Location of user registers relative user stack pointer + +user_environ STRUC +user_AX DW ? +user_BX DW ? +user_CX DW ? +user_DX DW ? +user_SI DW ? +user_DI DW ? +user_BP DW ? +user_DS DW ? +user_ES DW ? +user_IP DW ? +user_CS DW ? +user_F DW ? +user_environ ENDS + +include sysvar.INC + +include vector.INC + +;include mult.INC + +BREAK +; MSDOS partitions the disk into 4 sections: +; +; phys sector 0: +-------------------+ +; | | boot/reserved | +; | +-------------------+ +; | | File allocation | +; v | table(s) | +; | (multiple copies | +; | are kept) | +; +-------------------+ +; | Directory | +; +-------------------+ +; | File space | +; +-------------------+ +; | Unaddressable | +; | (to end of disk) | +; +-------------------+ +; +; All partition boundaries are sector boundaries. The size of the FAT is +; adjusted to maximize the file space addressable. + +include dirent.INC + +BREAK +; +; The File Allocation Table uses a 12-bit entry for each allocation unit on +; the disk. These entries are packed, two for every three bytes. The contents +; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result +; to the base address of the Allocation Table; 3) fetching the 16-bit word +; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift +; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex). Entry +; number zero is used as an end-of-file trap in the OS and is passed to the +; BIOS to help determine disk format. Entry 1 is reserved for future use. +; The first available allocation unit is assigned entry number two, and even +; though it is the first, is called cluster 2. Entries greater than 0FF8H +; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero +; are unallocated. Otherwise, the contents of a FAT entry is the number of +; the next cluster in the file. +; +; Clusters with bad sectors are tagged with FF7H. Any non-zero number would +; do because these clusters show as allocated, but are not part of any +; allocation chain and thus will never be allocated to a file. A particular +; number is selected so that disk checking programs know what to do (ie. a +; cluster with entry FF7H which is not in a chain is not an error). + +include dpb.INC + +include curdir.INC + +;include cpmfcb.INC + +;include find.INC + +include pdb.INC + +include exe.INC + +include sf.INC + +include arena.INC + +include intnat.INC + +include mi.INC + +fChk equ 1 +fDelim equ 2 +fSpChk equ 4 +fFCB equ 8 + +;include filemode.INC + +;include error.INC + +include syscall.INC + +include doscntry.inc ;J.K. 5/26/86 + +SUBTTL + \ No newline at end of file diff --git a/v4.0/src/INC/SMIFSSYM.INC b/v4.0/src/INC/SMIFSSYM.INC new file mode 100644 index 0000000..7706e44 --- /dev/null +++ b/v4.0/src/INC/SMIFSSYM.INC @@ -0,0 +1,62 @@ + + PAGE 60,132 +; SCCSID = @(#)smifssym.inc 1.0 87/05/11 +; +; Modification history: +; Created: May 11 1987 +; +; SMifssym is only for IBMBIO. It will only has definitions +; for IFSHEADER, IFSRH of INIT function. +; When ifssym.inc is Revised, make sure that SMifssym.inc +; is also correct. - JK. +; + +;================== +;IFS drive header +;================= + + IFSDEVICE EQU 8000H ; Supports single device/file functions + IFSDISK EQU 4000H ; Supports multi-file functions + IFSUNC EQU 2000H ; Support UNC (nameless) connection + IFSREMOTE EQU 0800H ; File system is remote + IFSFILTER EQU 0400H ; FS will filter (if off, use DOS + ; standard, cap & 8.3) + IFSIOCTL EQU 0002H ; Supports IOCTL functions + IFSUSESHARE EQU 0001H ; Uses DOS share support (vs own share) + +IFSHEADER STRUC +IFS_NEXT DD -1 ; Next header in list (-1=end) +IFS_NAME DB " " ; IFS name +IFS_ATTRIBUTE DW ? ; Attributes +IFS_VERSION DW 0 ; Request level supported +IFS_DOSCALL@ DD ? ; DOS interface routine + ; (set by TUPPER before the init call) +IFS_CALL@ DW ? ; Function entry point +IFSHEADER ENDS + +;===================== +; IFS Request Header +;===================== + +IFSRH STRUC +IFSR_LENGTH DW ? ; Total length of request +IFSR_FUNCTION DB ? ; Requested function +IFSR_RETCODE DB ? ; Explicit error +IFSR_RETCLASS DB ? ; Error class +IFSR_RESV1 DB 17 DUP(0) ; DOS reserved +IFSR_FCN_PARMS DB 38 DUP(0) ; Additional parameters +IFSRH ENDS + +; IFSR_FUNCTION codes +; Control requests: +IFSINIT EQU 1 +IFSATTSTART EQU 2 +IFSATTEND EQU 3 +IFSEXECAPI EQU 4 +IFSCRITMSG EQU 5 +IFSCBUPDATE EQU 6 +; INIT function. +IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS ; command parameters +IFSR_RESSIZE = WORD PTR IFSR_FCN_PARMS+4 ; driver total size +LENGTH_INIT EQU IFSR_RESSIZE-IFSRH+2 + diff --git a/v4.0/src/INC/STRING.C b/v4.0/src/INC/STRING.C new file mode 100644 index 0000000..3a2d74a --- /dev/null +++ b/v4.0/src/INC/STRING.C @@ -0,0 +1,94 @@ +#include "types.h" +#include "internat.h" +#include + +/* #define KANJI TRUE */ + +char haveinttab = FALSE; + +struct InterTbl Currtab; + +int toupper(c) +int c; +{ + union REGS regs ; + + if(!haveinttab) { + regs.x.ax = 0x3800 ; + regs.x.dx = (unsigned) &Currtab ; + intdos (®s, ®s) ; /* INIT the table */ + + haveinttab = TRUE; + } + + return(IToupper(c,Currtab.casecall)); + +} + +char *strupr(string) +char *string; +{ + register char *p1; + + p1 = string; + while (*p1 != NULL) { + /* + * A note about the following " & 0xFF" stuff. This is + * to prevent the damn C compiler from converting bytes + * to words with the CBW instruction which is NOT correct + * for routines like toupper + */ +#ifdef KANJI + if(testkanj(*p1 & 0xFF)) + p1 += 2 ; + else + *p1++ = toupper(*p1 & 0xFF); +#else + *p1++ = toupper(*p1 & 0xFF); +#endif + } + return(string); +} + +char *strpbrk(string1,string2) +char *string1; +char *string2; +{ + register char *p1; + + while (*string1 != NULL) { + /* + * A note about the following " & 0xFF" stuff. This is + * to prevent the damn C compiler from converting bytes + * to words with the CBW instruction which is NOT correct + * for routines like toupper + */ +#ifdef KANJI + if(testkanj(*string1 & 0xFF)) + string1 += 2 ; + else { +#endif + p1 = string2; + while (*p1 != NULL) { + if(*p1++ == *string1) + return(string1); + } + string1++; +#ifdef KANJI + } +#endif + + } + return(NULL); /* no matches found */ +} + +#ifdef KANJI +testkanj(c) +unsigned char c; +{ + if((c >= 0x81 && c <= 0x9F) || (c >= 0xE0 && c <= 0xFC)) + return(TRUE); + else + return(FALSE); +} +#endif diff --git a/v4.0/src/INC/STRING.OBJ b/v4.0/src/INC/STRING.OBJ new file mode 100644 index 0000000..27417b5 Binary files /dev/null and b/v4.0/src/INC/STRING.OBJ differ diff --git a/v4.0/src/INC/STRUC.INC b/v4.0/src/INC/STRUC.INC new file mode 100644 index 0000000..f024a9a --- /dev/null +++ b/v4.0/src/INC/STRUC.INC @@ -0,0 +1,702 @@ +;;STRUC--Stucture Macro Library +;;Optimizing Version 2.30 03/31/87 + +if1 +$NoConj equ 0 +$And equ 1 +$Or equ 2 +$Short equ 3 +$Near equ 4 +$NearToShort equ 5 +$ncxz equ 6 +$AndOr = 0 +$Temp = 0 +$Temp2 = 0 +$Dist = 0 + +$NoType equ 10 +$ConjIfType equ 11 +$IfType equ 12 +$ElseType equ 13 +$WhileType equ 14 +$ConjWhileType equ 15 +$RepeatType equ 16 +$ConjUntilType equ 17 +$ForType equ 18 +$ConjLeaveType equ 19 +$SelectType equ 20 +$WhenType equ 21 +$ConjWhenType equ 22 +$OtherwiseType equ $ElseType + +$StrucError macro text + Structure error -- text +endm + +J macro +endm +JN macro +endm + +$BuildJump macro j1,j2 + j1 macro t + .xcref j1 + j2 t + endm +endm + +irp x,<,,,,,,,> + $BuildJump x +endm +irp x,<,,,,,,> + $BuildJump x +endm +irp x, + $BuildJump jnn&x,j&x +endm + +jncxz macro t + if $Dist eq $NearToShort + jcxz $+5 + jmp t + else + jcxz $+4 + jmp short t + endif +endm + +purge $BuildJump + +$GetConj macro p1,p2 + $AndOr = $NoConj + irp parm, + ifnb <&parm> + irp x, + ifidn , + $AndOr = $&&&x + exitm + endif + endm + endif + endm +endm + +$GetDist macro p1,p2 + irp parm, + ifnb + irp x, + ifidn , + $Dist = $&&&x + exitm + endif + endm + endif + endm +endm + + +$Poke macro n,m + $st&n = m +.xcref $st&n +endm + +$Peek macro x,n + x = $st&n +endm + +$Push macro n + $st = $st+1 + $Poke %$st,n +endm + +$Pop macro x + if $st gt 0 + $Peek x,%$st + $st = $st-1 + else + $StrucError + endif +endm + +$EquateLabel macro last,this + if $LastLabelOrg eq $ + $ll&last = this + .xcref $ll&last + endif +endm + +$TraceLabel macro n,a,b + if $ll&a eq $ll&b + $ll&n = b + .xcref $ll&n + else + $TraceLabel n,%$ll&a,%$ll&b + endif +endm + +$Label macro n + if1 + $EquateLabel %$LastLabel,n + $ll&n = n + .xcref $ll&n + $LastLabel = n + $LastLabelOrg = $ +$l&n: + else + if $ll&n eq n +$l&n: + else + .xcref $l&n + .xcref $ll&n + endif + endif +endm + +$CondJump macro l,tf,c + if1 + ifb + $EquateLabel %$LastLabel,l + endif + ifndef <$ll&l> + $ll&l = l + .xcref $ll&l + endif + else + $TraceLabel l,l,%$ll&l + endif + $CondJump2 %$ll&l,tf,c +endm + +$CondJump2 macro l,tf,c + if $Dist eq $Short + ifb + jmp short $l&l + else + ifidn , + jn&c $l&l + else + j&c $l&l + endif + endif + else + ifnb + ifdef $l&l + if (($ - $l&l) le 126) and (($l&l - $) le 129) + $Dist = $NearToShort + $nops = 3 + ifidn , + jn&c $l&l + ifdef $n&c + if $n&c eq $ncxz + $nops = 0 + endif + endif + ifdef $&c + if $&c eq $ncxz + $nops = 5 + endif + endif + else + j&c $l&l + ifdef $n&c + if $n&c eq $ncxz + $nops = 5 + endif + endif + ifdef $&c + if $&c eq $ncxz + $nops = 0 + endif + endif + endif + rept $nops + nop + endm + else + ifidn , + j&c $+5 + else + jn&c $+5 + endif + jmp $l&l + endif + else + ifidn , + j&c $+5 + else + jn&c $+5 + endif + jmp $l&l + endif + else + ifdef $l&l + ifidn , + jmp $l&l + else + if (($ - $l&l) le 126) and (($l&l - $) le 129) + jmp short $l&l + nop + else + jmp $l&l + endif + endif + else + jmp $l&l + endif + endif + endif +endm + + +$CondLoop macro l,c + loop&c $l&l +endm + +$Test macro tgt,a1,a2,a3,a4,x + ifb + $StrucError + else + ifb + $CondJump %&tgt,a1 + else + ifb + ifdif , + ifdif , + ifdif , + ifdif , + $StrucError + exitm + endif + endif + endif + endif + or a2,a2 + $CondJump %&tgt,a1 + else + ifb + cmp a1,a3 + $CondJump %&tgt,a2 + else + ifb + ifdif , + ifdif , + $StrucError + exitm + endif + endif + test a2,a4 + $CondJump %&tgt,a3 + else + $StrucError + endif + endif + endif + endif + endif +endm + +$TopTest macro args,n,c,p4,p5 + $GetConj p4,p5 + $Dist = $DefDist + $GetDist p4,p5 + if $AndOr eq $NoConj + $Test <$sn-1,f>,args + $Pop $Temp + if $OrFound + $Label %$Temp + endif + $Push n + else + if $AndOr eq $And + $Test <$sn-1,f>,args + else + $OrFound = 1 + $Test <$sn,t>,args + endif + $Push c + endif +endm +;;***************************************************************************** +.if macro t,p2,p3 + $Peek $Temp,%$st + if $Temp eq $ConjIfType + $Pop $Temp + else + $OrFound = 0 + $sn = $sn+1 + $Push $sn + $sn = $sn+1 + $Push $sn + $sn = $sn+1 + $Push $sn + endif + $TopTest ,$IfType,$ConjIfType,p2,p3 +endm +;;***************************************************************************** +.then macro + $Peek $Temp,%$st + if $Temp ne $IfType + if $Temp ne $WhenType + $StrucError + endif + endif +endm +;;***************************************************************************** +.elseif macro t,p2,p3 + $Pop $Temp + if $Temp ne $IfType + $StrucError + exitm + endif + $OrFound = 0 + $Pop $Temp + $Peek $Temp2,%$st + $Dist = $Near + $CondJump %$Temp2 + $Label %$Temp + $sn = $sn+1 + $Push $sn + $sn = $sn+1 + $Push $sn + $TopTest ,$IfType,$ConjIfType,p2,p3 +endm +;;***************************************************************************** +.else macro dist + $Pop $Temp + if $Temp ne $IfType + if $Temp ne $WhenType + if $Temp ne $SelectType + $StrucError + exitm + endif + endif + endif + $sn = $sn+1 + if $Temp eq $SelectType + $Push $sn + else + $Dist = $DefDist + $GetDist dist + $CondJump %$sn + $Pop $Temp + $Label %$Temp + $Push $sn + endif + $push $ElseType +endm +;;***************************************************************************** +.endif macro + $Pop $Temp + if $Temp ne $IfType + if $Temp ne $ElseType + $StrucError + exitm + endif + endif + $Pop $Temp + $Label %$Temp + $Pop $Temp + $Label %$Temp +endm +;;***************************************************************************** +.select macro x + $OrFound = 0 + $sn = $sn+1 + $Push $sn + $Push $SelectType +endm +;;***************************************************************************** +.when macro tst,p2,p3 + $Pop $Temp + if $Temp ne $SelectType + if $Temp ne $WhenType + if $Temp ne $ConjWhenType + $StrucError + exitm + endif + endif + endif + if $Temp ne $ConjWhenType + $Dist = $Near + $OrFound = 0 + if $Temp eq $WhenType + $Pop $Temp2 + $Peek $Temp,%$st + $CondJump %$Temp + $Label %$Temp2 + endif + $sn = $sn+1 + $Push $sn + $sn = $sn+1 + $Push $sn + endif + $TopTest ,$WhenType,$ConjWhenType,p2,p3 +endm +;;***************************************************************************** +.otherwise macro dist + $Pop $Temp + if $Temp ne $WhenType + if $Temp ne $SelectType + if $Temp ne $IfType + $StrucError + exitm + endif + endif + endif + $sn = $sn+1 + if $Temp eq $SelectType + $Push $sn + else + $Dist = $DefDist + $GetDist dist + $CondJump %$sn + $Pop $Temp + $Label %$Temp + $Push $sn + endif + $push $OtherwiseType +endm +;;***************************************************************************** +.endselect macro + $Pop $Temp + if $Temp ne $WhenType + if $Temp ne $OtherwiseType + if $Temp ne $SelectType + $StrucError + exitm + endif + endif + endif + $pop $Temp2 + if $Temp ne $SelectType + $Label %$Temp2 + $Pop $Temp2 + $Label %$Temp2 + endif +endm +;;***************************************************************************** +.while macro t,p2,p3 + $Peek $Temp,%$st + if $Temp eq $ConjWhileType + $Pop $Temp + else + $Push $LoopEnd + $OrFound = 0 + $sn = $sn + 1 + $Push $sn + $Label %$sn + $sn = $sn + 2 + $Push $sn + $LoopEnd = $sn - 1 + endif + $TopTest ,$WhileType,$ConjWhileType,p2,p3 +endm +;;***************************************************************************** +.endwhile macro p1 + $Pop $Temp + if $Temp ne $WhileType + $StrucError + exitm + endif + $Dist = $Near + $Pop $Temp + $CondJump %$Temp,NoFold + $Label %$Temp+1 + $Pop $LoopEnd +endm +;;***************************************************************************** +.repeat macro + $Push $LoopEnd + $Push $LeaveFound + $sn = $sn+1 + $Label %$sn + $Push $sn + $Push $RepeatType + $sn = $sn+1 + $LoopEnd = $sn + $LeaveFound = 0 +endm +;;***************************************************************************** +.until macro t,p2,p3 + $until2 p2,p3,t +endm +$until2 macro p2,p3,a1,a2,a3,a4,x + $Pop $Temp + if $Temp ne $RepeatType + if $Temp ne $ConjUntilType + $StrucError + exitm + endif + else + $OrFound = 0 + endif + $Dist = $DefDist + $GetDist p2,p3 + $GetConj p2,p3 + + if $AndOr eq $NoConj + $Pop $Temp + ifb + $Dist = $Near + $CondJump %$Temp,NoFold + else + $Test <$Temp,f>,,,,, + endif + if $OrFound or $LeaveFound + $Label %$Temp+1 + endif + $Pop $LeaveFound + $Pop $LoopEnd + else + $Peek $Temp,%$st + if $AndOr eq $And + $Test <$Temp,f>,,,,, + else + $OrFound = 1 + $Test <$Temp+1,t>,,,,, + endif + $Push $ConjUntilType + endif +endm +;;***************************************************************************** +.loop macro cond + $Pop $Temp + if $Temp ne $RepeatType + $StrucError + exitm + endif + $Pop $Temp + $CondLoop %$Temp,cond + if $LeaveFound + $Label %$Temp+1 + endif + $Pop $LeaveFound + $Pop $LoopEnd +endm +;;***************************************************************************** +.for macro index,equals,start,to,stop,by,step,dist + mov index,start + $Push $LoopEnd + $sn = $sn+1 + $Push $sn + $Label %$sn + $sn = $sn+1 + $LoopEnd = $sn + cmp index,stop + $Dist = $DefDist + ifb + $Push 1 + $GetDist by + $CondJump %$sn,t,gt + else + $GetDist dist + $Push %(step) + if step lt 0 + $CondJump %$sn,t,lt + else + $CondJump %$sn,t,gt + endif + endif + $Push $ForType +endm +;;***************************************************************************** +.next macro index,dist + $Pop $Temp + if $Temp ne $ForType + $StrucError + exitm + endif + $Pop $Temp + if $Temp eq 1 + inc index + else + if $Temp eq -1 + dec index + else + add index,$Temp + endif + endif + $Pop $Temp + $Dist = $Near + $CondJump %$Temp,NoFold + $Label %$Temp+1 + $Pop $LoopEnd +endm +;;***************************************************************************** +.leave macro t,p2,p3 + $leave2 p2,p3,t +endm +$leave2 macro p2,p3,a1,a2,a3,a4,x + ife $LoopEnd + $StrucError + exitm + endif + $LeaveFound = 1 + $Peek $Temp,%$st + if $Temp eq $ConjLeaveType + $Pop $Temp + else + $OrFound = 0 + $sn = $sn + 1 + endif + $Dist = 0 + $GetDist + if $Dist + $CondJump %$LoopEnd + if $OrFound + $Label %$sn + endif + else + $Dist = $DefDist + $GetDist p2,p3 + $GetConj p2,p3 + if $AndOr eq $NoConj + ifb + $CondJump %$LoopEnd,t + else + $Test <$LoopEnd,t>,,,,, + endif + if $OrFound + $Label %$sn + endif + else + if $AndOr eq $And + $OrFound = 1 + $Test <$sn,f>,,,,, + else + $Test <$LoopEnd,t>,,,,, + endif + $Push $ConjLeaveType + endif + endif +endm +;;***************************************************************************** +else ;else for if1 +$Pop $Temp +;;if $Temp ne $NoType +if $st ne 0 + $StrucError +endif +.xcref $NoConj,$And,$Or,$Short,$Near,$NearToShort,$AndOr,$Temp,$Temp2,$Dist +.xcref $NoType,$ConjIfType,$IfType,$ElseType,$WhileType,$ConjWhileType +.xcref $RepeatType,$ConjUntilType,$ForType,$ConjLeaveType,jncxz +.xcref $SelectType,$WhenType,$OtherwiseType,$ConjWhenType +.xcref jeq,jgt,jlt,jneq,jngt,jnlt,jnna,jnnae,jnnb,jnnbe,jnnc,jnncxz +.xcref jnne,jnng,jnnge,jnnl,jnnle,jnno,jnnp,jnns,jnnz,jnpe,jnpo,$BuildJump +.xcref $GetConj,$GetDist,$Poke,$Peek,$Push,$Pop,$Label,$CondJump,$CondLoop,$Test +.xcref $TopTest,$leave2,$until2,$StrucError,j,jn,jand,jnand,jnnand +.xcref jnnonzero,jnonzero,jnzero,jzero +.xcref $st,$sn,$OrFound,$LoopEnd,$LeaveFound,$DefDist +.xcref $LastLabel,$LastLabelOrg,$EquateLabel,$TraceLabel,$CondJump2,$ncxz +endif + + +$st = 0 +$sn = 0 +$OrFound = 0 +$LoopEnd = 0 +$LeaveFound = 0 +$LastLabel = -1 +$LastLabelOrg = $ +$DefDist= $Short +$Push %$NoType diff --git a/v4.0/src/INC/SYSCALL.INC b/v4.0/src/INC/SYSCALL.INC new file mode 100644 index 0000000..f5b10e9 --- /dev/null +++ b/v4.0/src/INC/SYSCALL.INC @@ -0,0 +1,166 @@ +; SCCSID = @(#)syscall.asm 1.1 85/04/10 +;BREAK +SUBTTL system call definitions +PAGE + +Abort EQU 0 ; 0 0 +Std_Con_Input EQU 1 ; 1 1 +Std_Con_Output EQU 2 ; 2 2 +Std_Aux_Input EQU 3 ; 3 3 +Std_Aux_Output EQU 4 ; 4 4 +Std_Printer_Output EQU 5 ; 5 5 +Raw_Con_IO EQU 6 ; 6 6 +Raw_Con_Input EQU 7 ; 7 7 +Std_Con_Input_No_Echo EQU 8 ; 8 8 +Std_Con_String_Output EQU 9 ; 9 9 +Std_Con_String_Input EQU 10 ; 10 A +Std_Con_Input_Status EQU 11 ; 11 B +Std_Con_Input_Flush EQU 12 ; 12 C +Disk_Reset EQU 13 ; 13 D +Set_Default_Drive EQU 14 ; 14 E +FCB_Open EQU 15 ; 15 F +FCB_Close EQU 16 ; 16 10 +Dir_Search_First EQU 17 ; 17 11 +Dir_Search_Next EQU 18 ; 18 12 +FCB_Delete EQU 19 ; 19 13 +FCB_Seq_Read EQU 20 ; 20 14 +FCB_Seq_Write EQU 21 ; 21 15 +FCB_Create EQU 22 ; 22 16 +FCB_Rename EQU 23 ; 23 17 +Get_Default_Drive EQU 25 ; 25 19 +Set_DMA EQU 26 ; 26 1A +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Get_Default_DPB EQU 31 ; 31 1F +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +FCB_Random_Read EQU 33 ; 33 21 +FCB_Random_Write EQU 34 ; 34 22 +Get_FCB_File_Length EQU 35 ; 35 23 +Get_FCB_Position EQU 36 ; 36 24 +Set_Interrupt_Vector EQU 37 ; 37 25 +Create_Process_Data_Block EQU 38 ; 38 26 +FCB_Random_Read_Block EQU 39 ; 39 27 +FCB_Random_Write_Block EQU 40 ; 40 28 +Parse_File_Descriptor EQU 41 ; 41 29 +Get_Date EQU 42 ; 42 2A +Set_Date EQU 43 ; 43 2B +Get_Time EQU 44 ; 44 2C +Set_Time EQU 45 ; 45 2D +Set_Verify_On_Write EQU 46 ; 46 2E +; Extended functionality group +Get_DMA EQU 47 ; 47 2F +Get_Version EQU 48 ; 48 30 +Keep_Process EQU 49 ; 49 31 +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Get_DPB EQU 50 ; 50 32 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Set_CTRL_C_Trapping EQU 51 ; 51 33 +Get_InDOS_Flag EQU 52 ; 52 34 +Get_Interrupt_Vector EQU 53 ; 53 35 +Get_Drive_Freespace EQU 54 ; 54 36 +Char_Oper EQU 55 ; 55 37 +International EQU 56 ; 56 38 +; Directory Group +MKDir EQU 57 ; 57 39 +RMDir EQU 58 ; 58 3A +CHDir EQU 59 ; 59 3B +; File Group +Creat EQU 60 ; 60 3C +Open EQU 61 ; 61 3D +Close EQU 62 ; 62 3E +Read EQU 63 ; 63 3F +Write EQU 64 ; 64 40 +Unlink EQU 65 ; 65 41 +LSeek EQU 66 ; 66 42 +CHMod EQU 67 ; 67 43 +IOCtl EQU 68 ; 68 44 +XDup EQU 69 ; 69 45 +XDup2 EQU 70 ; 70 46 +Current_Dir EQU 71 ; 71 47 +; Memory Group +Alloc EQU 72 ; 72 48 +Dealloc EQU 73 ; 73 49 +Setblock EQU 74 ; 74 4A +; Process Group +Exec EQU 75 ; 75 4B +Exit EQU 76 ; 76 4C +WaitProcess EQU 77 ; 77 4D +Find_First EQU 78 ; 78 4E +; Special Group +Find_Next EQU 79 ; 79 4F +; SPECIAL SYSTEM GROUP +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Set_Current_PDB EQU 80 ; 80 50 +Get_Current_PDB EQU 81 ; 81 51 +Get_In_Vars EQU 82 ; 82 52 +SetDPB EQU 83 ; 83 53 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Get_Verify_On_Write EQU 84 ; 84 54 +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Dup_PDB EQU 85 ; 85 55 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Rename EQU 86 ; 86 56 +File_Times EQU 87 ; 87 57 +AllocOper EQU 88 ; 88 58 +; Network extention system calls +GetExtendedError EQU 89 ; 89 59 +CreateTempFile EQU 90 ; 90 5A +CreateNewFile EQU 91 ; 91 5B +LockOper EQU 92 ; 92 5C Lock and Unlock +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall, + ; CloseByName, CloseUser, + ; CloseUserProcess, + ; GetOpenFileList +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +UserOper EQU 94 ; 94 5E Get and Set +AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel +xNameTrans EQU 96 ; 96 60 +PathParse EQU 97 ; 97 61 +GetCurrentPSP EQU 98 ; 98 62 +Hongeul EQU 99 ; 99 63 +ECS_CALL EQU 99 ; 99 63 ;; DBCS support +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Set_Printer_Flag EQU 100 ; 100 64 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +GetExtCntry EQU 101 ; 101 65 +GetSetCdPg EQU 102 ; 102 66 +ExtHandle EQU 103 ; 103 67 +Commit EQU 104 ; 104 68 +GetSetMediaID EQU 105 ; 105 69 +IFS_IOCTL EQU 107 ; 107 6B +ExtOpen EQU 108 ; 108 6C +; +; +Set_Oem_Handler EQU 248 ; 248 F8 +OEM_C1 EQU 249 ; 249 F9 +OEM_C2 EQU 250 ; 250 FA +OEM_C3 EQU 251 ; 251 FB +OEM_C4 EQU 252 ; 252 FC +OEM_C5 EQU 253 ; 253 FD +OEM_C6 EQU 254 ; 254 FE +OEM_C7 EQU 255 ; 255 FF + \ No newline at end of file diff --git a/v4.0/src/INC/SYSMSG.INC b/v4.0/src/INC/SYSMSG.INC new file mode 100644 index 0000000..5462820 --- /dev/null +++ b/v4.0/src/INC/SYSMSG.INC @@ -0,0 +1,443 @@ + PAGE ,132 + SUBTTL DOS - Message Retriever - SYSTEM CONTROL file +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS -- Message Retriever +;; (c) Copyright 1988 Microsoft +;; +;; File Name: SYSMSG.INC +;; ---------- +;; +;; Description: Message retriever functions are included into source code +;; ------------ by referencing a MSG_SERVICES macro. That macro is defined +;; here as well as the logic to include necessary .ASM and .INC +;; files. +;; +;; +;; Documentation Reference: +;; ------------------------ +;; DOS -Message Retriever I0 Document - Feb. ?? 1987 +;; DOS -Message Retriever I1 Document - Mar. ?? 1987 +;; DOS -Message Retriever I2 Document - Mar. ?? 1987 +;; DOS -Final Functional Specification Document - Mar ?? 1987 +;; +;; Procedures Contained in This File: +;; --------------------------------- +;; None +;; +;; Include Files Required: +;; ----------------------- +;; MSGSERV.INC := All message services +;; ???? := ???? +;; +;; External Procedure References: +;; ------------------------------ +;; None +;; +;; Linkage Instructions: +;; -------------------- +;; None +;; +;; Change History: +;; --------------- +;; CREATED March, 1987 RPS +;; +;; Psuedocode: +;; ----------- +;; None +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INCLUDE VERSIONA.INC ;;AN003;; + +FALSE = 0 ;; +TRUE = NOT FALSE ;; List message services and flags + ;; + +; Control Characters For Message Skeleton file + +NULL EQU 00H ;; Null +BELL EQU 07H ;; Bell +TAB EQU 09H ;; Tab +LF EQU 0AH ;; Line Feed +HOME EQU 0BH ;; Home +FORMFD EQU 0CH ;; Form Feed +CR EQU 0DH ;; Carriage Return +COLON EQU 3AH ;; Colon + +; SYSDISPMSG and SYSGETMSG Equates + +MSG_SER_CLASS EQU 00H ;; Message Service Class (reserved) +EXT_ERR_CLASS EQU 01H ;; DOS Extended error class +PARSE_ERR_CLASS EQU 02H ;; Parse error class +UTILITY_MSG_CLASS EQU 0FFH ;; Utility message class + +NO_HANDLE EQU 0FFFFH ;; No handle specified (Use DOS functions 01H-09H only) + +NO_REPLACE EQU 0000H ;; No replacable parameters + +; SUBLIST Equates + + Sublist_Length EQU 11 ;; Length of sublist structure + Reserved EQU 0 ;; Reserved byte field + + Left_Align EQU 0 ;;00xxxxxx + Right_Align EQU 80h ;;10xxxxxx + + Char_type EQU 0 ;;axxx0000 - Character type + Char_Field_Char EQU 0 ;;a0000000 + Char_Field_ASCIIZ EQU 10h ;;a0010000 + + Unsgn_Bin_Type EQU 01h ;;axxx0001 - Unsigned Binary to Decimal character + Unsgn_Bin_Byte EQU 11h ;;a0010001 + Unsgn_Bin_Word EQU 21h ;;a0100001 + Unsgn_Bin_DWord EQU 31h ;;a0110001 + + Sgn_Bin_Type EQU 02h ;;axxx0010 - Signed Binary to Decimal character + Sgn_Bin_Byte EQU 12h ;;a0010010 + Sgn_Bin_Word EQU 22h ;;a0100010 + Sgn_Bin_DWord EQU 32h ;;a0110010 + + Bin_Hex_Type EQU 03h ;;axxx0011 - Unsigned Binary to Hexidecimal character + Bin_Hex_Byte EQU 13h ;;a0010011 + Bin_Hex_Word EQU 23h ;;a0100011 + Bin_Hex_DWord EQU 33h ;;a0110011 + + Date_Type EQU 04h ;;axxx0100 - Date to character using current country format + Date_MD EQU 14h ;;a0010100 + Date_MDY_2 EQU 24h ;;a0100100 + Date_MDY_4 EQU 34h ;;a0110100 + + Time_Cty_Type EQU 05h ;;axxx0101 - Time to character using current country format + Time_HHMM_Cty EQU 05h ;;a0000101 + Time_HHMMSS_Cty EQU 15h ;;a0010101 + Time_HHMMSSHH_Cty EQU 25h ;;a0100101 + + Time_24_Type EQU 06h ;;axxx0110 - Time to character using 24 hour format + Time_HHMM_24 EQU 06h ;;a0000110 + Time_HHMMSS_24 EQU 16h ;;a0010110 + Time_HHMMSSHH_24 EQU 26h ;;a0100110 + + $M_EXTPAR_Type EQU 08h ;;axxx1000 - Special case for extended parse replace format + +NO_INPUT EQU 00H ;; No input characters +DOS_KEYB_INP EQU 01H ;; DOS INT 21H - AH=01H := Keyboard Input +DOS_DIR_CON_INP EQU 07H ;; DOS INT 21H - AH=07H := Direct Console Input Without Echo +DOS_CON_INP EQU 08H ;; DOS INT 21H - AH=08H := Console Input Without Echo (Check CTL-BK) +DOS_BUF_KEYB_INP EQU 0AH ;; DOS INT 21H - AH=0AH := Buffered Keyboard Input +DOS_CLR_KEYB_BUF EQU 0CH ;; DOS INT 21H - AH=0CH := Clear keyboard buffer +DOS_WRITE_HANDLE EQU 40H ;; DOS INT 21H - AH=40H := Write to a DOS handle +DOS_DISP_STRING EQU 09H ;; DOS INT 21H - AH=09H := Display $ terminated string +DOS_DISP_CHAR EQU 02H ;; DOS INT 21H - AH=02H := Display Character +LOWEST_4CH_VERSION EQU 0002H ;; First DOS version to allow AH = 4CH Exit (VERSION 2.00) + +DOS_GET_DBCS_INFO EQU 6300H ;; DOS INT 21H - AX=6507H := Get DBCS Vector Table +DOS_GET_EXT_ERROR EQU 59H ;; DOS INT 21H - AH=59H := Get Extended Error +DOS_GET_EXT_ERROR_BX EQU 00H ;; DOS INT 21H - BX=0000H := Version 0 + +DOS_EXTENDED_OPEN EQU 6C00H ;AN003; DOS INT 21H - AX=6C00H := Extended Open +NO_CRIT_OPEN EQU 2000H ;AN003; Extended Open Mode bit +NOT_EX_FAIL_EX_OPEN EQU 0101H ;AN003; Extended Open Flag +DOS_LSEEK_FILE EQU 4200H ;AN003; DOS INT 21H - AX=4200H := LSEEK file +DOS_READ_BYTE EQU 3FH ;AN003; DOS INT 21H - AH=3FH := Read byte block +DOS_CLOSE_FILE EQU 3EH ;AN003; DOS INT 21H - AH=3EH := Close file handle + +IFSFUNC_INSTALL_CHECK EQU 0500H ;AN006; IFSFUNC Installation Check +IFS_GET_ERR_TEXT EQU 0502H ;AN006; IFSFUNC Get Extended Error Text +IFSFUNC_INSTALLED EQU 0FFH ;AN006; Return code if IFSFUNC is installed + +EXT_ERR_39 EQU 39 ;; Insufficent Disk Space EXTENDED ERROR (changed from hex to decimal - eg d201) +ERROR_CLASS_39 EQU 01H ;; Error Class = 1 +ACTION_39 EQU 04H ;; Suggested Action = 4 +LOCUS_39 EQU 01H ;; Locus = 1 + +DOS_GET_COUNTRY EQU 38H ;; DOS INT 21H - AH=38H := Get Country Dependant Information +DOS_GET_VERSION EQU 30H ;; DOS INT 21H - AH=30H := Get DOS Version number +DOS_IOCTL_GET_INFO EQU 4400H ;; DOS INT 21H - AH=4400H := I/O control for devices +DOS_IOCTL_SET_INFO EQU 4401H ;; DOS INT 21H - AH=4401H := I/O control for devices +DOS_GET_EXT_PARSE_ADD EQU 122EH ;; DOS INT 2FH - AX=122EH := Get Extended/Parse error address +DOS_GET_EXTENDED EQU 00 ;; DOS INT 2FH - AX=122EH - DL=00 := Get Extended address +DOS_GET_PARSE EQU 02 ;; DOS INT 2FH - AX=122EH - DL=02 := Get Parse address +DOS_GET_CRITICAL EQU 04 ;; DOS INT 2FH - AX=122EH - DL=04 := Get Critical address +DOS_GET_FILE EQU 06 ;; DOS INT 2FH - AX=122EH - DL=06 := Get File system dependant +DOS_GET_ADDR EQU 08 ;; DOS INT 2FH - AX=122EH - DL=08 := Get Address of READ_DISK_PROC +DOS_SET_ADDR EQU 09 ;; DOS INT 2FH - AX=122EH - DL=09 := Set Address of READ_DISK_PROC +LOW_NIB_MASK EQU 0FH ;; Mask out the high byte +DOS_CLR_KEYB_BUF_MASK EQU 0C0H ;; Check if high nibble is C Hex +$M_CON_INP EQU -1 ;; If DOS INT 21H Function 06H - DL := 0FFH for input +$M_CRIT_LO EQU 19 ;; First Extended Error considered CRITICAL +$M_CRIT_HI EQU 39 ;; Last Extended Error considered CRITICAL (EG - D191) +$M_AM EQU "a" ;; Time format AM indicator +$M_PM EQU "p" ;; Time format PM indicator +$M_NEG_SIGN EQU "-" ;; Signed decimal number format negative indicator +$M_DEF_TIME_FORM EQU 1 ;; Default Time format - 24 hour +$M_DEF_DATE_FORM EQU 0 ;; Default Time format - 0 := USA format +$M_DEF_TIME_SEP EQU ":" ;; Default Time separator - ":" +$M_DEF_DATE_SEP EQU "-" ;; Default Time separator - "-" +$M_DEF_DECI_SEP EQU "." ;; Default Time hundreds separator - "." +$M_TIMEDATE_PAD EQU "0" ;; Time/Date PAD character - "0" (ie 12:03p) +$M_MAX_2_YEAR EQU 99 ;; Maximum 2 digit year +$M_SINGLE_CHAR EQU 1 ;; A single character is this long ^ +$M_SPECIAL_CASE EQU 30H ;; Special case for replacable parameters %0 +$M_UNLIM_W EQU 0 ;; Unlimited width character +$M_COMMA EQU "," ;; Default Thousand separate +$M_CR_LF EQU 0A0DH ;; Default CR/LF +$M_SPACE_HYP EQU "- " ;; Default Space/Hyphan +$M_SPACE EQU " " ;; Default Space +$M_NULL EQU 0 ;; Null +$M_FIRST_THOU EQU 3 ;; Location of first thousand separator +$M_SECOND_THOU EQU 6 ;; Location of second thousand separator +$M_THIRD_THOU EQU 9 ;; Location of third thousand separator +$M_BASE10 EQU 10 ;; Base 10 for arthmetic +$M_BASE16 EQU 16 ;; Base 16 for arthmetic +$M_CLASS_NOT_EXIST EQU 0 ;; Does class exist? +$M_TERMINATING_FLAG EQU -1 ;; Is there any more classes? +$M_ADDR_SZ_NEAR EQU 2 ;; Size to increment if NEAR +$M_ADDR_SZ_FAR EQU 4 ;; Size to increment if FAR +$M_SL EQU DS:[SI] ;; Refer to SUBLIST as $M_SL +$M_NO_HANDLE EQU -1 ;; No handle flag +$M_TEMP_BUF_SZ EQU 64 ;; Size of temporary buffer ;AN003; +$M_NEXT_DBCS_VECTOR EQU 2 ;; Amount to increment to get next vector +$M_DBCS_TERM EQU 0000 ;; DBCS vector table terminating flag +$M_SPECIAL_MSG_NUM EQU 0FFFFH ;; Special generic message number +$M_CRLF_SIZE EQU 2 ;; Size of the CR LF message +$M_NO_CRLF_MASK EQU 10000000B ;; Mask to supress CR LF +$M_ONE_REPLACE EQU 1 ;; Indicate one replacement +$M_CRIT_ERR_MASK EQU 00000001B ;; Mask to allow EOF/EOI Crit error + ;; +$M_ALIGN_MASK EQU 10000000b ;; Mask for align +$M_TYPE_MASK EQU 00001111b ;; Mask for types +$M_SIZE_MASK EQU 00110000b ;; Mask for types +$M_TIME_MASK EQU 00000001b ;; Mask for TIME +$M_DATE_MASK EQU 00010000b ;; Mask for TIME +$M_BYTE EQU 00010000b ;; BYTE indicator +$M_WORD EQU 00100000b ;; WORD indicator +$M_DWORD EQU 00110000b ;; DWORD indicator + +; Standard reserved DOS handles + +STDIN EQU 0000H ;; Standard Input device handle +STDOUT EQU 0001H ;; Standard Output device handle +STDERR EQU 0002H ;; Standard Error Output device handle +STDAUX EQU 0003H ;; Standard Auxiliary device handle +STDPRN EQU 0004H ;; Standard Printer device handle + +; Reserved Message Service equates + +NEARmsg = TRUE ;; \ +NOVERCHECKmsg = FALSE ;; | +MSGDATA = FALSE ;; | +FARmsg = FALSE ;; | +GETmsg = FALSE ;; | +LOADmsg = FALSE ;; | +DISPLAYmsg = FALSE ;; } Set default cases +SETSTDIO = FALSE ;; | +NOCHECKSTDIN = FALSE ;; | +NOCHECKSTDOUT = FALSE ;; | +DISK_PROC = FALSE ;; | ;AN003; +INPUTmsg = FALSE ;; | +CHARmsg = FALSE ;; | +NUMmsg = FALSE ;; | +TIMEmsg = FALSE ;; | +DATEmsg = FALSE ;; / + +IF1 ;; +COMR = FALSE ;; COMMAND.COM Cases (resident) +COMT = FALSE ;; (transient) +ENDIF ;; + +$M_STRUC = TRUE ;; Internal message service defaults +$M_LOAD = TRUE ;; +$M_SUBS = TRUE ;; +$M_REPLACE = TRUE ;; +$M_REPL_DONE = FALSE ;; +$M_CHAR_ONLY = TRUE ;; +$M_PARSE_FLAG = TRUE ;; +$M_EXT_ERR_FLAG = TRUE ;; +$M_MSGDATA_ONLY = TRUE ;; +$M_END = FALSE ;; +$M_EXT_CLS = TRUE ;; +$M_PAR_CLS = TRUE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; $M_POPF Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +$M_POPF MACRO + LOCAL $M_MYRET + JMP $+3 +$M_MYRET LABEL NEAR + IRET + PUSH CS + CALL $M_MYRET +ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Message Retreiver requests +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +MSG_UTILNAME Macro utilname ; + ; + INCLUDE &utilname.CTL ; Include the control file for the utility + $M_STRUC = TRUE ; + INCLUDE MSGSERV.ASM ; Get structure definitions + ; +ENDM ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; MSG_SERVICES Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +MSG_SERVICES Macro varlist ; MACRO used in source routine + ; + $M_SERVICE = FALSE ; Reset service flag + IRP var, ; FOR each variable in the list + $M_INCLUDE = TRUE ; Reset include flag + ; For each service predefined + +IRP serv, + + IFDIF , ; IF it IS a service (defined above) + ELSE ; + IFDIF , ; IF it is NOT the message data space request + $M_MSGDATA_ONLY = FALSE ; Instruct the assembler to include all services + ENDIF ; ENDIF + IRP repl, ; IF it is a replace service + IFIDN , ; + $M_REPLACE = TRUE ; Set replace flag + ENDIF ; + ENDM ; + serv = TRUE ; Let the assembler know about the service + $M_SERVICE = TRUE ; Let the macro know it was a service + $M_INCLUDE = FALSE ; Let the macro know it wasn't a class + ENDIF ; ENDIF + ENDM ; NEXT service + +MSG_SERVICES2 + ; Continue further checks (If we add any more predefined + ; function to the above IRP command, it generates a + ; syntax error. We must continue the processing in another + ; MACRO called MSG_SERVICES2) + + IF $M_INCLUDE ; IF message class was requested + $M_INC var ; Include it as a message class + ENDIF ; ENDIF + ENDM ; NEXT variable + ; + IF $M_SERVICE ; IF it any services were requested THEN + INCLUDE MSGSERV.ASM ; THEN include module to get service + ENDIF ; ENDIF + +ENDM +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; MSG_SERVICES2 Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +MSG_SERVICES2 Macro varlist2 ; MACRO used in source routine + ; + ; FOR each variable in the list + IRP var2, + ; For each service predefined + IRP serv2, + ;AN003; IF it IS a service (defined above) + IFDIF , + ELSE ; + serv2 = TRUE ; Let the assembler know about the service + $M_SERVICE = TRUE ; Let the macro know it was a service + $M_INCLUDE = FALSE ; Let the macro know it wasn't a class + ENDIF ; ENDIF + ENDM ; NEXT service + ENDM ; NEXT variable +ENDM ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; $M_INC Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +$M_INC Macro ext ; + ; +INCLUDE &ext ; + ; +ENDM ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; $M_BUILD_PTRS Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +$M_BUILD_PTRS Macro nummsg ; + ; + $M_INDEX = 0 ; +IF COMR ; IF this is resident COMMAND.COM + $M_MAKE_COMR ; +ELSE ; ELSE + IF COMT ; IF this is transient COMMAND.COM + $M_MAKE_COMT ; + ELSE ; ELSE + ; + $M_INDEX = 0 ; + $M_COUNT = 0 ; Build normal utilities + ; + REPT nummsg ; + $M_COUNT = $M_COUNT + 1 ; + $M_MAKE %$M_COUNT ; + ENDM ; + ENDIF ; +ENDIF ; +ENDM ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; $M_MAKE Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +$M_MAKE Macro $m_append ; +IF FARmsg ; + CALL FAR PTR $M_CLS_&$m_append ; Get addressibilty to class &$M_APPEND (ES:DI) + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX+2,ES ; Move into first avaliable table location + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ; +ELSE ; + CALL $M_CLS_&$m_append ; Get addressibilty to class &$M_APPEND (ES:DI) + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ; +ENDIF ; +$M_INDEX = $M_INDEX + 4 ; Set next available table location + ; +ENDM ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; $M_MAKE_COMR Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +$M_MAKE_COMR macro ; + ; + CALL $M_CLS_3 ; Get addressibilty to class A + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ; +$M_INDEX = $M_INDEX + 4 ; Set next available table location + ; + CALL $M_CLS_4 ; Get addressibilty to class B + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ; +$M_INDEX = $M_INDEX + 4 ; Set next available table location + ; + CALL $M_CLS_5 ; Get addressibilty to class C + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ; +$M_INDEX = $M_INDEX + 4 ; Set next available table location + ; + CALL $M_CLS_6 ; Get addressibilty to class D + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ; +$M_INDEX = $M_INDEX + 4 ; Set next available table location + ; + CALL $M_CLS_7 ; Get addressibilty to class E + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ; +$M_INDEX = $M_INDEX + 4 ; Set next available table location + ; +ENDM ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; $M_MAKE_COMT Macro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +$M_MAKE_COMT macro ; + ; + CALL $M_CLS_8 ; Get addressibilty to class A + MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ; +$M_INDEX = $M_INDEX + 4 ; Set next available table location + ; +ENDM ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/INC/SYSVAR.C b/v4.0/src/INC/SYSVAR.C new file mode 100644 index 0000000..300d02f --- /dev/null +++ b/v4.0/src/INC/SYSVAR.C @@ -0,0 +1,49 @@ +/* return the system variables in sysVars */ + +#include "sysvar.h" +#include +#include "jointype.h" + +GetVars(pSVars) +struct sysVarsType *pSVars ; +{ + struct sysVarsType far *vptr ; + int i ; + + union REGS ir ; + register union REGS *iregs = &ir ; /* Used for DOS calls */ + struct SREGS syssegs ; + + iregs->h.ah = GETVARS ; /* Function 0x52 */ + intdosx(iregs, iregs, &syssegs) ; + + *(long *)(&vptr) = (((long)syssegs.es) << 16)+(iregs->x.bx & 0xffffL) ; + + for (i=0 ; i <= sizeof(*pSVars) ; i++) + *((char *)pSVars+i) = *((char far *)vptr+i) ; + +} + + + + +PutVars(pSVars) +struct sysVarsType *pSVars ; +{ + struct sysVarsType far *vptr ; + int i ; + + union REGS ir ; + register union REGS *iregs = &ir ; /* Used for DOS calls */ + struct SREGS syssegs ; + + iregs->h.ah = GETVARS ; /* Function 0x52 */ + intdosx(iregs, iregs, &syssegs) ; + + *(long *)(&vptr) = (((long)syssegs.es) << 16)+(iregs->x.bx & 0xffffL) ; + + for (i=0 ; i <= sizeof(*pSVars) ; i++) + *((char far *)vptr+i) = *((char *)pSVars+i) ; + +} + \ No newline at end of file diff --git a/v4.0/src/INC/SYSVAR.INC b/v4.0/src/INC/SYSVAR.INC new file mode 100644 index 0000000..4a5a1fc --- /dev/null +++ b/v4.0/src/INC/SYSVAR.INC @@ -0,0 +1,77 @@ +; SCCSID = @(#)sysvar.asm 1.1 85/04/10 +include version.inc + +SysInitVars STRUC +SYSI_DPB DD ? ; DPB chain +SYSI_SFT DD ? ; SFT chain +SYSI_CLOCK DD ? ; CLOCK device +SYSI_CON DD ? ; CON device +SYSI_MAXSEC DW ? ; maximum sector size +SYSI_BUF DD ? ; points to Hashinitvar +SYSI_CDS DD ? ; CDS list +SYSI_FCB DD ? ; FCB chain +SYSI_Keep DW ? ; keep count +SYSI_NUMIO DB ? ; Number of block devices +SYSI_NCDS DB ? ; number of CDS's +SYSI_DEV DD ? ; device list +SYSI_ATTR DW ? ; null device attribute word +SYSI_STRAT DW ? ; null device strategy entry point +SYSI_INTER DW ? ; null device interrupt entry point +SYSI_NAME DB 8 DUP(?) ; null device name +SYSI_SPLICE DB 0 ; TRUE -> splicees being done +SYSI_IBMDOS_SIZE DW ? ; DOS size in paragraphs +SYSI_IFS_DOSCALL@ DD ? ; IFS DOS service rountine entry +SYSI_IFS DD ? ; IFS header chain +SYSI_BUFFERS DW ?,0 ; BUFFERS= values (m,n) +SYSI_BOOT_DRIVE DB ? ; boot drive A=1 B=2,.. +SYSI_DWMOVE DB 0 ; 1 if 386 machine +SYSI_EXT_MEM DW 0 ; Extended memory size in KB. +SysInitVars ENDS + +;This is added for more information exchage between DOS, BIOS. +;DOS will give the pointer to SysInitTable in ES:DI. - J.K. 5/29/86 +SysInitVars_Ext struc +SYSI_InitVars DD 0 ; Points to the above structure. +SYSI_Country_Tab DD 0 ; DOS_Country_cdpg_info +SysInitVars_Ext ends + +;The SYSI_BUF of SysInitVars points to the follwong structure +EMS_MAP_BUFF_SIZE EQU 12 ; EMS map buffer size + +Buffinfo STRUC +Hash_ptr DD ? ; pointer to Hash table +Hash_count DW ? ; number of Hash entries +Cache_ptr DD ? ; pointer to secondary cache +Cache_count DW 0 ; number of secondary cache entries + +IF BUFFERFLAG + +EMS_SAFE_FLAG DB 1 +EMS_LAST_PAGE DW 0, 0 +EMS_FIRST_PAGE DW 0, 0 +EMS_NPA640 DW 0 + +ENDIF + +EMS_mode DB -1 ; no EMS = -1 +EMS_handle DW ? ; EMS handle for buffers +EMS_PageFrame_Number DW -1 ; EMS page frame number +EMS_Seg_Cnt DW 1 ; EMS segment count +EMS_Page_Frame DW -1 ; EMS page frame segment address +EMS_reserved DW 0 ; EMS segment count + +IF BUFFERFLAG +EMS_Map_Buff DB 0 ; map buffer +ELSE +EMS_Map_Buff DB 12 dup(0) +ENDIF + +Buffinfo ENDS + + + + + + + + \ No newline at end of file diff --git a/v4.0/src/INC/VECTOR.INC b/v4.0/src/INC/VECTOR.INC new file mode 100644 index 0000000..f653784 --- /dev/null +++ b/v4.0/src/INC/VECTOR.INC @@ -0,0 +1,72 @@ +; SCCSID = @(#)vector.asm 1.1 85/04/10 +BREAK + +Asmvar AltVect + +INTTAB EQU 20H +INTBASE EQU 4 * inttab +ENTRYPOINT EQU INTBASE+40H + + IF ALTVECT +ALTTAB EQU 0F0H +ALTBASE EQU 4 * ALTTAB + ENDIF + +; +; interrupt assignments +; + IF NOT ALTVECT +int_abort EQU INTTAB ; abort process +int_command EQU int_abort+1 ; call MSDOS +int_terminate EQU int_abort+2 ; int to terminate address +int_ctrl_c EQU int_abort+3 ; ^c trapper +int_fatal_abort EQU int_abort+4 ; hard disk error +int_disk_read EQU int_abort+5 ; logical sector disk read +int_disk_write EQU int_abort+6 ; logical sector disk write +int_keep_process EQU int_abort+7 ; terminate program and stay + ; resident +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +int_spooler EQU int_abort+8 ; spooler call +int_fastcon EQU int_abort+9 ; fast CON interrupt +int_IBM EQU int_abort+10; critical section maintenance +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + ELSE +int_abort EQU INTTAB ; abort process +int_command EQU int_abort+1 ; call MSDOS +int_terminate EQU ALTTAB ; int to terminate address +int_ctrl_c EQU int_terminate+1 ; ^c trapper +int_fatal_abort EQU int_terminate+2 ; hard disk error +int_disk_read EQU int_abort+5 ; logical sector disk read +int_disk_write EQU int_abort+6 ; logical sector disk write +int_keep_process EQU int_abort+7 ; terminate program and stay resident +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +int_spooler EQU int_terminate+3 ; spooler call +int_fastcon EQU int_abort+9 ; fast CON interrupt +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; + ENDIF + +addr_int_abort EQU 4 * int_abort +addr_int_command EQU 4 * int_command +addr_int_terminate EQU 4 * int_terminate +addr_int_ctrl_c EQU 4 * int_ctrl_c +addr_int_fatal_abort EQU 4 * int_fatal_abort +addr_int_disk_read EQU 4 * int_disk_read +addr_int_disk_write EQU 4 * int_disk_write +addr_int_keep_process EQU 4 * int_keep_process +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +addr_int_spooler EQU 4 * int_spooler +addr_int_fastcon EQU 4 * int_fastcon +addr_int_IBM EQU 4 * int_IBM +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; diff --git a/v4.0/src/INC/VERSION.INC b/v4.0/src/INC/VERSION.INC new file mode 100644 index 0000000..eb90e2a --- /dev/null +++ b/v4.0/src/INC/VERSION.INC @@ -0,0 +1,106 @@ +; Some modules really want TRUE to be 0FFH. Best to let them have their way. +ifndef TRUE + TRUE EQU 0FFFFh +endif +ifndef TRUEBYTE + TRUEBYTE EQU 0FFh +endif +ifndef FALSE + FALSE EQU 0 +endif + +; +; Use the following switches to control cmacros.inc +; +?PLM = 0 +?WIN = 0 + +memS EQU 1 ; Small model +; +; Use the switches below to produce the standard Microsoft version or the IBM +; version of the operating system +; +; The below chart will indicate how to set the switches to build the various +; versions +; +; IBMVER IBMCOPYRIGHT +; -------------------------------------------------------- +; IBM Version | TRUE TRUE +; -------------------------------------------------------- +; MS Version | FALSE FALSE +; -------------------------------------------------------- +; Clone Version | TRUE FALSE +; +IBMVER EQU TRUE +IBMCOPYRIGHT EQU FALSE + +BUFFERFLAG EQU NOT IBMCOPYRIGHT + +ifndef MSVER +MSVER EQU NOT IBMVER +endif +IBM EQU IBMVER +; +; + IF1 + IF IBMVER + IF IBMCOPYRIGHT + %OUT ... IBM version build switch on ... + ELSE + %OUT ... CLONE version build switch on ... + ENDIF + ELSE + IF NOT IBMCOPYRIGHT + %OUT ... MS version build switch on ... + ELSE + %OUT !!!!!!!!! VERSION SWITCHES SET INCORECTLY !!!!!!!!! + %OUT !!!!!!!!! CHECK SETTINGS IN INC\VERSION.INC !!!!!!!!! + ENDIF + ENDIF + ENDIF +; +; +;*************************************************************************** +;* The following switches are for DBCS or SBCS support * +;* * +;* Set INTERNAT EQU TRUE FOR DBCS * +;* Set INTERNAT EQU FALSE FOR SBCS * +;* * +;*************************************************************************** +; +IBMJAPVER EQU FALSE ;If TRUE set KANJI true also + +; +; Switch INTERNAT for DBCS support +; +INTERNAT EQU FALSE +; + IF INTERNAT +KANJI EQU TRUE +IBMJAPAN EQU TRUE + ELSE +KANJI EQU FALSE +IBMJAPAN EQU FALSE + ENDIF + +ifndef altvect ; avoid jerking off vector.inc +ALTVECT EQU FALSE ;Switch to build ALTVECT version +endif + +; +; Country code switches +; The default contry code is assumed as USA. +; + IF INTERNAT + KOREA EQU TRUE + JAPAN EQU FALSE + ELSE + KOREA EQU FALSE + JAPAN EQU FALSE + ENDIF +; + IF1 + IF INTERNAT +%OUT Internat(ECS) version build switch on + ENDIF + ENDIF diff --git a/v4.0/src/INC/VERSIONA.INC b/v4.0/src/INC/VERSIONA.INC new file mode 100644 index 0000000..e6796bd --- /dev/null +++ b/v4.0/src/INC/VERSIONA.INC @@ -0,0 +1,18 @@ + +major_version equ 4 ;Major DOS version +minor_version equ 00 ;Minor DOS Version + +expected_version equ (MINOR_VERSION SHL 8)+MAJOR_VERSION + + if1 + %OUT ... for DOS Version 4.00 ... + endif + + ;****************************** + ;Each assembler program should: + ; mov ah,030h ;DOS Get Version function + ; int 021h ;Version ret. in AX,minor version first + ; cmp ax,expected_version ;ALL utilities should check for an + ; jne error_handler ; EXACT version match. + ;****************************** + diff --git a/v4.0/src/INC/YESNO.ASM b/v4.0/src/INC/YESNO.ASM new file mode 100644 index 0000000..58fdf8d --- /dev/null +++ b/v4.0/src/INC/YESNO.ASM @@ -0,0 +1,4 @@ +; This is for contry Yes and No + PUBLIC NLS_YES,NLS_yes2,NLS_NO,NLS_no2 +include msdos.cl3 + \ No newline at end of file diff --git a/v4.0/src/INC/_PARSE.ASM b/v4.0/src/INC/_PARSE.ASM new file mode 100644 index 0000000..0ed10e4 --- /dev/null +++ b/v4.0/src/INC/_PARSE.ASM @@ -0,0 +1,117 @@ +page 60,132 +name _parse +title C to PARSER interface +;------------------------------------------------------------------- +; +; MODULE: _parse +; +; PURPOSE: Supplies an interface between C programs and +; the DOS 3.30 parser +; +; CALLING FORMAT: +; parse(&inregs,&outregs); +; +; DATE: 5-21-87 +; +;------------------------------------------------------------------- + +; extrn sysparse:far + + public _parse + +;------------------------------------------------------------------- + +; SET FOR SUBST +; ------------- + +FarSW equ 0 ; make sysparse be a NEAR proc +TimeSW equ 0 ; Check time format +FileSW equ 1 ; Check file specification +CAPSW equ 1 ; Perform CAPS if specified +CmpxSW equ 0 ; Check complex list +NumSW equ 0 ; Check numeric value +KeySW equ 0 ; Support keywords +SwSW equ 1 ; Support switches +Val1SW equ 0 ; Support value definition 1 +Val2SW equ 0 ; Support value definition 2 +Val3SW equ 0 ; Support value definition 3 +DrvSW equ 1 ; Support drive only format +QusSW equ 0 ; Support quoted string format +;------------------------------------------------------------------- + +_DATA segment byte public 'DATA' +_DATA ends + +_TEXT segment byte public 'CODE' + + ASSUME CS: _TEXT + ASSUME DS: _DATA + +;------------------------------------------------------------------- +include parse.asm ; include the parser +;------------------------------------------------------------------- + +_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 + +; int 3 ; debugger + +;------------------------------------------------------------------- + call sysparse ; call the parser +;------------------------------------------------------------------- + +; int 3 ; debugger + + 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 + + \ No newline at end of file -- cgit v1.2.3