summaryrefslogtreecommitdiff
path: root/v4.0/src/INC
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/INC
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/INC')
-rw-r--r--v4.0/src/INC/ARENA.INC30
-rw-r--r--v4.0/src/INC/BOOT.INC64
-rw-r--r--v4.0/src/INC/BOOT11.INC64
-rw-r--r--v4.0/src/INC/BOOTFORM.INC47
-rw-r--r--v4.0/src/INC/BPB.INC41
-rw-r--r--v4.0/src/INC/BUFFER.INC77
-rw-r--r--v4.0/src/INC/BUGTYP.ASM49
-rw-r--r--v4.0/src/INC/CASRN.INC59
-rw-r--r--v4.0/src/INC/CASVAR.INC88
-rw-r--r--v4.0/src/INC/CDS.C132
-rw-r--r--v4.0/src/INC/CMACROS.INC932
-rw-r--r--v4.0/src/INC/COMSUBS.LIBbin0 -> 9728 bytes
-rw-r--r--v4.0/src/INC/CONST2.ASM211
-rw-r--r--v4.0/src/INC/COPYRIGH.INC2
-rw-r--r--v4.0/src/INC/CPMFCB.INC125
-rw-r--r--v4.0/src/INC/CPUTYPE.INC39
-rw-r--r--v4.0/src/INC/CURDIR.INC45
-rw-r--r--v4.0/src/INC/DBCS.OFF2
-rw-r--r--v4.0/src/INC/DBCS.ON2
-rw-r--r--v4.0/src/INC/DBCS.SW2
-rw-r--r--v4.0/src/INC/DEVSYM.INC207
-rw-r--r--v4.0/src/INC/DIRENT.INC61
-rw-r--r--v4.0/src/INC/DIVMES.ASM11
-rw-r--r--v4.0/src/INC/DOSCNTRY.INC114
-rw-r--r--v4.0/src/INC/DOSMAC.INC630
-rw-r--r--v4.0/src/INC/DOSSEG.ASM25
-rw-r--r--v4.0/src/INC/DOSSYM.INC157
-rw-r--r--v4.0/src/INC/DPB.C38
-rw-r--r--v4.0/src/INC/DPB.INC35
-rw-r--r--v4.0/src/INC/DPL.ASM15
-rw-r--r--v4.0/src/INC/DSEG.INC208
-rw-r--r--v4.0/src/INC/EA.INC72
-rw-r--r--v4.0/src/INC/ERROR.INC155
-rw-r--r--v4.0/src/INC/ERRTST.C310
-rw-r--r--v4.0/src/INC/EXE.INC78
-rw-r--r--v4.0/src/INC/FASTOPEN.INC148
-rw-r--r--v4.0/src/INC/FASTSEEK.INC22
-rw-r--r--v4.0/src/INC/FASTXXXX.INC12
-rw-r--r--v4.0/src/INC/FILEMODE.INC56
-rw-r--r--v4.0/src/INC/FIND.INC25
-rw-r--r--v4.0/src/INC/IFSSYM.INC670
-rw-r--r--v4.0/src/INC/INTNAT.INC39
-rw-r--r--v4.0/src/INC/IOCTL.INC211
-rw-r--r--v4.0/src/INC/KSTRING.C118
-rw-r--r--v4.0/src/INC/LOCK.INC24
-rw-r--r--v4.0/src/INC/MACRO.DEF19
-rw-r--r--v4.0/src/INC/MAKEFILE54
-rw-r--r--v4.0/src/INC/MFT.INC176
-rw-r--r--v4.0/src/INC/MI.INC19
-rw-r--r--v4.0/src/INC/MSBDS.INC128
-rw-r--r--v4.0/src/INC/MSDATA.ASM33
-rw-r--r--v4.0/src/INC/MSDATA2.ASM33
-rw-r--r--v4.0/src/INC/MSDOSME.ASM17
-rw-r--r--v4.0/src/INC/MSGDCL.INC108
-rw-r--r--v4.0/src/INC/MSGHAN.INC153
-rw-r--r--v4.0/src/INC/MSGSERV.ASM3133
-rw-r--r--v4.0/src/INC/MSHALO.ASM247
-rw-r--r--v4.0/src/INC/MSHEAD.ASM134
-rw-r--r--v4.0/src/INC/MSTABLE.ASM16
-rw-r--r--v4.0/src/INC/MS_DATA.ASM194
-rw-r--r--v4.0/src/INC/MULT.INC184
-rw-r--r--v4.0/src/INC/NIBDOS.ASM7
-rw-r--r--v4.0/src/INC/PARSE.ASM2974
-rw-r--r--v4.0/src/INC/PATHMAC.INC44
-rw-r--r--v4.0/src/INC/PCGEQU.INC184
-rw-r--r--v4.0/src/INC/PCINPUT.INC3794
-rw-r--r--v4.0/src/INC/PDB.INC51
-rw-r--r--v4.0/src/INC/POSTEQU.INC262
-rw-r--r--v4.0/src/INC/PRINTF.ASM415
-rw-r--r--v4.0/src/INC/PRINTF.OBJbin0 -> 1159 bytes
-rw-r--r--v4.0/src/INC/PSDATA.INC504
-rw-r--r--v4.0/src/INC/REDIRSYM.INC174
-rw-r--r--v4.0/src/INC/SF.INC168
-rw-r--r--v4.0/src/INC/SHELL.MEUbin0 -> 4588 bytes
-rw-r--r--v4.0/src/INC/SHELLRD.EQU1155
-rw-r--r--v4.0/src/INC/SHELLRD.INC5111
-rw-r--r--v4.0/src/INC/SMDOSSYM.INC157
-rw-r--r--v4.0/src/INC/SMIFSSYM.INC62
-rw-r--r--v4.0/src/INC/STRING.C94
-rw-r--r--v4.0/src/INC/STRING.OBJbin0 -> 608 bytes
-rw-r--r--v4.0/src/INC/STRUC.INC702
-rw-r--r--v4.0/src/INC/SYSCALL.INC166
-rw-r--r--v4.0/src/INC/SYSMSG.INC443
-rw-r--r--v4.0/src/INC/SYSVAR.C49
-rw-r--r--v4.0/src/INC/SYSVAR.INC77
-rw-r--r--v4.0/src/INC/VECTOR.INC72
-rw-r--r--v4.0/src/INC/VERSION.INC106
-rw-r--r--v4.0/src/INC/VERSIONA.INC18
-rw-r--r--v4.0/src/INC/YESNO.ASM4
-rw-r--r--v4.0/src/INC/_PARSE.ASM117
90 files changed, 27010 insertions, 0 deletions
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 @@
1; SCCSID = @(#)arena.asm 1.1 85/04/09
2BREAK <Memory arena structure>
3
4;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
5; C A V E A T P R O G R A M M E R ;
6; ;
7;
8; arena item
9;
10arena STRUC
11arena_signature DB ? ; 4D for valid item, 5A for last item
12arena_owner DW ? ; owner of arena item
13arena_size DW ? ; size in paragraphs of item
14arena_reserved DB 3 DUP(?) ; reserved
15arena_name DB 8 DUP(?) ; owner file name
16arena ENDS
17
18;
19; CAUTION: The routines in ALLOC.ASM rely on the fact that arena_signature
20; and arena_owner_system are all equal to zero and are contained in DI. Change
21; them and change ALLOC.ASM.
22
23arena_owner_system EQU 0 ; free block indication
24
25arena_signature_normal EQU 4Dh ; valid signature, not end of arena
26arena_signature_end EQU 5Ah ; valid signature, last block in arena
27; ;
28; C A V E A T P R O G R A M M E R ;
29;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
30 \ 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 @@
1 db 0EBH,03CH,090H,04DH,053H,044H,04FH,053H
2 db 034H,02EH,030H,000H,002H,008H,001H,000H
3 db 002H,000H,002H,003H,051H,0F8H,008H,000H
4 db 011H,000H,004H,000H,001H,000H,000H,000H
5 db 000H,000H,000H,000H,080H,000H,029H,000H
6 db 000H,000H,000H,04EH,04FH,020H,04EH,041H
7 db 04DH,045H,020H,020H,020H,020H,046H,041H
8 db 054H,031H,032H,020H,020H,020H,0FAH,033H
9 db 0C0H,08EH,0D0H,0BCH,000H,07CH,016H,007H
10 db 0BBH,078H,000H,036H,0C5H,037H,01EH,056H
11 db 016H,053H,0BFH,03EH,07CH,0B9H,00BH,000H
12 db 0FCH,0F3H,0A4H,006H,01FH,0C6H,045H,0FEH
13 db 00FH,08BH,00EH,018H,07CH,088H,04DH,0F9H
14 db 089H,047H,002H,0C7H,007H,03EH,07CH,0FBH
15 db 0CDH,013H,072H,07CH,033H,0C0H,039H,006H
16 db 013H,07CH,074H,008H,08BH,00EH,013H,07CH
17 db 089H,00EH,020H,07CH,0A0H,010H,07CH,0F7H
18 db 026H,016H,07CH,003H,006H,01CH,07CH,013H
19 db 016H,01EH,07CH,003H,006H,00EH,07CH,083H
20 db 0D2H,000H,0A3H,050H,07CH,089H,016H,052H
21 db 07CH,0A3H,049H,07CH,089H,016H,04BH,07CH
22 db 0B8H,020H,000H,0F7H,026H,011H,07CH,08BH
23 db 01EH,00BH,07CH,003H,0C3H,048H,0F7H,0F3H
24 db 001H,006H,049H,07CH,083H,016H,04BH,07CH
25 db 000H,0BBH,000H,005H,08BH,016H,052H,07CH
26 db 0A1H,050H,07CH,0E8H,087H,000H,072H,020H
27 db 0B0H,001H,0E8H,0A1H,000H,072H,019H,08BH
28 db 0FBH,0B9H,00BH,000H,0BEH,0DBH,07DH,0F3H
29 db 0A6H,075H,00DH,08DH,07FH,020H,0BEH,0E6H
30 db 07DH,0B9H,00BH,000H,0F3H,0A6H,074H,018H
31 db 0BEH,093H,07DH,0E8H,051H,000H,032H,0E4H
32 db 0CDH,016H,05EH,01FH,08FH,004H,08FH,044H
33 db 002H,0CDH,019H,058H,058H,058H,0EBH,0E8H
34 db 0BBH,000H,007H,0B9H,003H,000H,0A1H,049H
35 db 07CH,08BH,016H,04BH,07CH,050H,052H,051H
36 db 0E8H,03AH,000H,072H,0E6H,0B0H,001H,0E8H
37 db 054H,000H,059H,05AH,058H,072H,0C9H,005H
38 db 001H,000H,083H,0D2H,000H,003H,01EH,00BH
39 db 07CH,0E2H,0E2H,08AH,02EH,015H,07CH,08AH
40 db 016H,024H,07CH,08BH,01EH,049H,07CH,0A1H
41 db 04BH,07CH,0EAH,000H,000H,070H,000H,0ACH
42 db 00AH,0C0H,074H,029H,0B4H,00EH,0BBH,007H
43 db 000H,0CDH,010H,0EBH,0F2H,03BH,016H,018H
44 db 07CH,073H,019H,0F7H,036H,018H,07CH,0FEH
45 db 0C2H,088H,016H,04FH,07CH,033H,0D2H,0F7H
46 db 036H,01AH,07CH,088H,016H,025H,07CH,0A3H
47 db 04DH,07CH,0F8H,0C3H,0F9H,0C3H,0B4H,002H
48 db 08BH,016H,04DH,07CH,0B1H,006H,0D2H,0E6H
49 db 00AH,036H,04FH,07CH,08BH,0CAH,086H,0E9H
50 db 08AH,016H,024H,07CH,08AH,036H,025H,07CH
51 db 0CDH,013H,0C3H,00DH,00AH,04EH,06FH,06EH
52 db 02DH,053H,079H,073H,074H,065H,06DH,020H
53 db 064H,069H,073H,06BH,020H,06FH,072H,020H
54 db 064H,069H,073H,06BH,020H,065H,072H,072H
55 db 06FH,072H,00DH,00AH,052H,065H,070H,06CH
56 db 061H,063H,065H,020H,061H,06EH,064H,020H
57 db 070H,072H,065H,073H,073H,020H,061H,06EH
58 db 079H,020H,06BH,065H,079H,020H,077H,068H
59 db 065H,06EH,020H,072H,065H,061H,064H,079H
60 db 00DH,00AH,000H,049H,04FH,020H,020H,020H
61 db 020H,020H,020H,053H,059H,053H,04DH,053H
62 db 044H,04FH,053H,020H,020H,020H,053H,059H
63 db 053H,000H,000H,000H,000H,000H,000H,000H
64 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 @@
1 db 0EBH,027H,090H,008H,000H,014H,000H,000H
2 db 000H,000H,000H,000H,000H,000H,000H,000H
3 db 000H,000H,000H,000H,000H,000H,000H,000H
4 db 000H,000H,000H,000H,000H,000H,000H,000H
5 db 000H,000H,000H,000H,000H,000H,000H,0CDH
6 db 019H,0FAH,08CH,0C8H,08EH,0D8H,033H,0D2H
7 db 08EH,0D2H,0BCH,000H,07CH,0FBH,0B8H,060H
8 db 000H,08EH,0D8H,08EH,0C0H,033H,0D2H,08BH
9 db 0C2H,0CDH,013H,072H,069H,0E8H,085H,000H
10 db 072H,0DDH,02EH,083H,03EH,003H,07CH,008H
11 db 074H,006H,02EH,0C6H,006H,064H,07DH,002H
12 db 0BBH,000H,000H,02EH,08BH,00EH,003H,07CH
13 db 051H,0B0H,009H,02AH,0C1H,0B4H,000H,08BH
14 db 0F0H,056H,033H,0D2H,033H,0C0H,08AH,0C5H
15 db 02EH,0F6H,036H,064H,07DH,08AH,0E8H,08AH
16 db 0F4H,08BH,0C6H,0B4H,002H,0CDH,013H,072H
17 db 02DH,05EH,059H,02EH,029H,036H,005H,07CH
18 db 074H,01FH,08BH,0C6H,02EH,0F7H,026H,065H
19 db 07DH,003H,0D8H,0FEH,0C5H,0B1H,001H,051H
20 db 0BEH,008H,000H,02EH,03BH,036H,005H,07CH
21 db 07CH,005H,02EH,08BH,036H,005H,07CH,0EBH
22 db 0C0H,0EAH,000H,000H,060H,000H,0BEH,067H
23 db 07DH,0E8H,002H,000H,0EBH,0FEH,032H,0FFH
24 db 02EH,0ACH,024H,07FH,074H,00BH,056H,0B4H
25 db 00EH,0BBH,007H,000H,0CDH,010H,05EH,0EBH
26 db 0EFH,0C3H,0E9H,033H,0FFH,0BBH,000H,000H
27 db 0B9H,004H,000H,0B8H,001H,002H,0CDH,013H
28 db 01EH,072H,033H,08CH,0C8H,08EH,0D8H,0BFH
29 db 000H,000H,0B9H,00BH,000H,026H,080H,00DH
30 db 020H,026H,080H,04DH,020H,020H,047H,0E2H
31 db 0F4H,0BFH,000H,000H,0BEH,08BH,07DH,0B9H
32 db 00BH,000H,0FCH,0F3H,0A6H,075H,00FH,0BFH
33 db 020H,000H,0BEH,097H,07DH,0B9H,00BH,000H
34 db 0F3H,0A6H,075H,002H,01FH,0C3H,0BEH,01BH
35 db 07DH,0E8H,0A2H,0FFH,0B4H,000H,0CDH,016H
36 db 01FH,0F9H,0C3H,00DH,00AH,04EH,06FH,06EH
37 db 02DH,053H,079H,073H,074H,065H,06DH,020H
38 db 064H,069H,073H,06BH,020H,06FH,072H,020H
39 db 064H,069H,073H,06BH,020H,065H,072H,072H
40 db 06FH,072H,00DH,00AH,052H,065H,070H,06CH
41 db 061H,063H,065H,020H,061H,06EH,064H,020H
42 db 073H,074H,072H,069H,06BH,065H,020H,061H
43 db 06EH,079H,020H,06BH,065H,079H,020H,077H
44 db 068H,065H,06EH,020H,072H,065H,061H,064H
45 db 079H,00DH,00AH,000H,001H,000H,002H,00DH
46 db 00AH,044H,069H,073H,06BH,020H,042H,06FH
47 db 06FH,074H,020H,066H,061H,069H,06CH,075H
48 db 072H,065H,00DH,00AH,000H,04DH,069H,063H
49 db 072H,06FH,073H,06FH,066H,074H,02CH,049H
50 db 06EH,063H,020H,069H,062H,06DH,062H,069H
51 db 06FH,020H,020H,063H,06FH,06DH,030H,069H
52 db 062H,06DH,064H,06FH,073H,020H,020H,063H
53 db 06FH,06DH,030H,005H,0C6H,006H,077H,02FH
54 db 0FFH,083H,07EH,0FCH,000H,075H,00BH,080H
55 db 07EH,0F7H,03BH,075H,005H,0C6H,006H,076H
56 db 02FH,0FFH,089H,0ECH,05DH,0CAH,004H,000H
57 db 000H,000H,000H,000H,000H,000H,000H,000H
58 db 000H,000H,000H,000H,000H,000H,000H,000H
59 db 000H,000H,000H,000H,000H,000H,000H,000H
60 db 000H,000H,000H,000H,000H,000H,000H,000H
61 db 000H,000H,000H,000H,000H,000H,000H,000H
62 db 000H,000H,000H,000H,000H,000H,000H,000H
63 db 000H,000H,000H,000H,000H,000H,000H,000H
64 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 @@
1 %OUT BOOTFORM.INC...
2;****************************************************************************
3;AN000; - Structure of the Extended IBMBOOT record for DOS -. J.K.
4;AN001; - D304 Include PHYDRV, CURHD to the header structure 11/09/87 J.K.
5;****************************************************************************
6
7BOOT_SIZE EQU 512
8EXT_BOOT_SIGNATURE EQU 41 ;Extended boot signature
9;
10EXT_BPB_INFO STRUC
11EBPB_BYTESPERSECTOR DW ?
12EBPB_SECTORSPERCLUSTER DB ?
13EBPB_RESERVEDSECTORS DW ?
14EBPB_NUMBEROFFATS DB ?
15EBPB_ROOTENTRIES DW ?
16EBPB_TOTALSECTORS DW ?
17EBPB_MEDIADESCRIPTOR DB ?
18EBPB_SECTORSPERFAT DW ?
19EBPB_SECTORSPERTRACK DW ?
20EBPB_HEADS DW ?
21EBPB_HIDDENSECTOR DD ?
22EBPB_BIGTOTALSECTORS DD ?
23EXT_BPB_INFO ENDS
24;
25;AN001; EXT_PHYDRV, EXT_CURHD included in the header for OS2.
26EXT_IBMBOOT_HEADER STRUC
27EXT_BOOT_JUMP DB 3 DUP (?)
28EXT_BOOT_OEM DB 8 DUP (?)
29EXT_BOOT_BPB DB type EXT_BPB_INFO dup (?)
30EXT_PHYDRV DB 80h
31EXT_CURHD DB 0
32EXT_BOOT_SIG DB EXT_BOOT_SIGNATURE
33EXT_BOOT_SERIAL DD ?
34EXT_BOOT_VOL_LABEL DB 11 DUP (?)
35EXT_SYSTEM_ID DB 8 DUP (?)
36EXT_IBMBOOT_HEADER ENDS
37;
38BOOT_SIGNATURE = word ptr (BOOT_SIZE-2)
39
40;
41;J.K. This is the number of sectors (of size 512 bytes) that will cover
42;the size of IBMLOAD program. IBMBOOT program has to at least read this
43;many sectors, and these sectors should be the first cluster and consecutive.
44;Make sure IBMBOOT program uses the same value as this.
45IBMLOADSIZE equ 3 ;Number of sectors IBMBOOT program should read in.
46
47
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 @@
1 %OUT BPB.INC...
2; SCCSID = @(#)BPB.ASM 1.1 85/04/29
3;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
4; C A V E A T P R O G R A M M E R ;
5; ;
6
7; BIOS PARAMETER BLOCK DEFINITION
8; THIS STRUCTURE IS USED TO BUILD A FULL DPB
9
10BPBLOCK STRUC
11BPSECSZ DW ? ; SIZE IN BYTES OF PHYSICAL SECTOR
12BPCLUS DB ? ; SECTORS/ALLOC UNIT
13BPRES DW ? ; NUMBER OF RESERVED SECTORS
14BPFTCNT DB ? ; NUMBER OF FATS
15BPDRCNT DW ? ; NUMBER OF DIRECTORY ENTRIES
16BPSCCNT DW ? ; TOTAL NUMBER OF SECTORS
17BPMEDIA DB ? ; MEDIA DESCRIPTOR BYTE
18BPFTSEC DW ? ; NUMBER OF SECTORS TAKEN UP BY ONE FAT
19BPBLOCK ENDS
20
21A_BPB STRUC
22BPB_BYTESPERSECTOR DW ?
23BPB_SECTORSPERCLUSTER DB ?
24BPB_RESERVEDSECTORS DW ?
25BPB_NUMBEROFFATS DB ?
26BPB_ROOTENTRIES DW ?
27BPB_TOTALSECTORS DW ?
28BPB_MEDIADESCRIPTOR DB ?
29BPB_SECTORSPERFAT DW ?
30BPB_SECTORSPERTRACK DW ?
31BPB_HEADS DW ?
32BPB_HIDDENSECTORS DW ?
33 DW ?
34BPB_BIGTOTALSECTORS DW ?
35 DW ?
36 DB 6 DUP(?)
37A_BPB ENDS
38; ;
39; C A V E A T P R O G R A M M E R ;
40;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
41 \ 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 @@
1; SCCSID = @(#)buffer.asm 1.1 85/04/09
2BREAK <Disk I/O Buffer Header>
3;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
4; C A V E A T P R O G R A M M E R ;
5; ;
6
7; Field definition for I/O buffer information
8
9BUFFINFO STRUC
10buf_next DW ? ; Pointer to next buffer in list
11buf_prev DW ? ; Pointer to prev buffer in list
12buf_ID DB ? ; Drive of buffer (bit 7 = 0)
13 ; SFT table index (bit 7 = 1)
14 ; = FFH if buffer free
15buf_flags DB ? ; Bit 7 = 1 if Remote file buffer
16 ; = 0 if Local device buffer
17 ; Bit 6 = 1 if buffer dirty
18 ; Bit 5 = Reserved
19 ; Bit 4 = Search bit (bit 7 = 1)
20 ; Bit 3 = 1 if buffer is DATA
21 ; Bit 2 = 1 if buffer is DIR
22 ; Bit 1 = 1 if buffer is FAT
23 ; Bit 0 = Reserved
24buf_sector DD ? ; Sector number of buffer (bit 7 = 0)
25; The next two items are often refed as a word (bit 7 = 0)
26buf_wrtcnt DB ? ; For FAT sectors, # times sector written out
27buf_wrtcntinc DW ? ; " " " , # sectors between each write
28buf_DPB DD ? ; Pointer to drive parameters
29buf_fill DW ? ; How full buffer is (bit 7 = 1)
30buf_reserved DB ? ; make DWORD boundary for 386
31BUFFINFO ENDS
32
33buf_offset EQU DWORD PTR buf_sector
34 ;For bit 7 = 1, this is the byte
35 ;offset of the start of the buffer in
36 ;the file pointed to by buf_ID. Thus
37 ;the buffer starts at location
38 ;buf_offset in the file and contains
39 ;buf_fill bytes.
40
41BUFINSIZ EQU SIZE BUFFINFO
42 ; Size of structure in bytes
43
44buf_Free EQU 0FFh ; buf_id of free buffer
45
46;Flag byte masks
47buf_isnet EQU 10000000B
48buf_dirty EQU 01000000B
49;***
50buf_visit EQU 00100000B
51;***
52buf_snbuf EQU 00010000B
53
54buf_isDATA EQU 00001000B
55buf_isDIR EQU 00000100B
56buf_isFAT EQU 00000010B
57buf_type_0 EQU 11110001B ; AND sets type to "none"
58
59buf_NetID EQU BUFINSIZ
60
61;
62; Buffer Hash Entry Structure
63
64BUFFER_HASH_ENTRY STRUC ; DOS 4.00
65EMS_PAGE_NUM DW -1 ; logical page number for EMS handle
66BUFFER_BUCKET DD ? ; pointer to buffers
67DIRTY_COUNT DB 0 ; number of dirty buffers
68BUFFER_RESERVED DB 0 ; reserved
69BUFFER_HASH_ENTRY ENDS
70
71MaxBuffinBucket EQU 15 ; Max number of buffers per bucket
72MaxBucketinPage EQU 2 ; Max number of buckets per 16kb page
73
74
75; ;
76; C A V E A T P R O G R A M M E R ;
77;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
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 @@
1; SCCSID = @(#)bugtyp.asm 1.1 85/04/09
2;
3; debugging types and levels for MSDOS
4;
5
6TypAccess EQU 0001h
7 LevSFN EQU 0000h
8 LevBUSY EQU 0001h
9
10TypShare EQU 0002h
11 LevShEntry EQU 0000h
12 LevMFTSrch EQU 0001h
13
14TypSect EQU 0004h
15 LevEnter EQU 0000h
16 LevLeave EQU 0001h
17 LevReq EQU 0002h
18
19TypSMB EQU 0008h
20 LevSMBin EQU 0000h
21 LevSMBout EQU 0001h
22 LevParm EQU 0002h
23 LevASCIZ EQU 0003h
24 LevSDB EQU 0004h
25 LevVarlen EQU 0005h
26
27TypNCB EQU 0010h
28 LevNCBin EQU 0000h
29 LevNCBout EQU 0001h
30
31TypSeg EQU 0020h
32 LevAll EQU 0000h
33
34TypSyscall EQU 0040h
35 LevLog EQU 0000h
36 LevArgs EQU 0001h
37
38TypInt24 EQU 0080h
39 LevLog EQU 0000h
40
41TypProlog EQU 0100h
42 LevLog EQU 0000h
43
44TypInt EQU 0200h
45 LevLog equ 0000h
46
47typFCB equ 0400h
48 LevLog equ 0000h
49 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 @@
1;
2; CAS Routine Numbers
3;
4; Revised: 10-05-87
5;
6BX_RN EQU 3009H ;DRAWBOX PCBOXDR FABOXDR
7CC_RN EQU 2100H ;CALCLOR PCCOLOR FACOLOR
8CR_RN EQU 2101H ;CROWCOL PCROWCL FAROWCL
9CE_RN EQU 5000H ;CRITERR PCCRITE FACRITE
10CM_RN EQU 3001H ;COMPRSS PCCOMPS FACOMPS
11CRD_RN EQU 210BH ; PCCLRRD
12CWR_RN EQU 210CH ; PCCLRWR
13DTS_RN EQU 4001H ;DATES PCDATES FADATES
14FF_RN EQU 1300H ;FINDFLS PCFINDF FAFINDF
15GV_RN EQU 2102H ;GETVIDO PCGVIDO FAGVIDO
16GE_RN EQU 4000H ;GETEQUP PCGEQUP FAGEQUP
17HWR_RN EQU 2108H ; PCHLPRD
18HRD_RN EQU 2109H ; PCHLPWR
19INS_RN EQU 300BH ;INSTRG PCINSTR FAINSTR
20I2S_RN EQU 3000H ;CIS PCIN2ST FAIN2ST
21MB_RN EQU 2400H ;MAKEBEEP PCMBEEP FAMBEEP
22MO_RN EQU 3002H ;MOVECON PCMOVEC FAMOVEC
23MI_RN EQU 3003H ;MOVEINT PCMOVEI FAMOVEI
24MS_RN EQU 1200H ;TRACKER PCTRACK
25MX_RN EQU 3004H ;MOVEMIX PCMOVEM FAMOVEM
26PM_RN EQU 2103H ;PANMAN PCPANEL FAPANEL
27PWR_RN EQU 2106H ; PCPANWR
28PRD_RN EQU 210AH ; PCPANRD
29QM_RN EQU 2111H ; PCDISPQ
30SF_RN EQU 2107H ;SETFLAG PCSTATF FASTATF
31SV_RN EQU 2104H ;SETVIDO PCSVIDO FASVIDO
32SK_RN EQU 1102H ;SIMKEY PCSIMKY FASIMKY
33SRD_RN EQU 210DH ; PCSCRRD
34SWR_RN EQU 210EH ; PCSCRWR
35SM_RN EQU 300DH ; PCPANSM
36SCB_RN EQU 2105H ;SLCTOPT PCSLCTP
37SO_RN EQU 2105H ;SLCTOPT FASLCTP
38SS_RN EQU 3005H ;STRGSRT PCSORTS FASORTS
39SSC_RN EQU 300AH ;STRSTRC PCSTRST FASTRST
40TMS_RN EQU 4002H ;TIMES PCTIMES FATIMES
41WN_RN EQU 3007H ;WINDOW PCWINDO FAWINDO
42S2I_RN EQU 300EH ; PCST2IN
43WWP_RN EQU 300FH ; PCWWRAP PCGRPRD
44GWR_RN EQU 3010H ; PCGRPWR PCGRPWR
45GRD_RN EQU 3011H ; PCGRPRD PCGRPRD
46IWR_RN EQU 3012H ; PCINPWR PCINPWR
47IRD_RN EQU 3013H ; PCINPRD PCINPRD
48M1_RN EQU 3014H ; PCMSDRV
49M1_RN EQU 3014H ; PCIBMDRV
50INC_RN EQU 3015H ; PCINCHA PCINCHA
51DBC_RN EQU 3016H ; PCINDBC PCINDBC
52C0H_RN EQU 3017H ; PCGEQUP
53MRD_RN EQU 3018H ;
54NWR_RN EQU 3019H ;
55IN_RN EQU 301AH ; PCINPUT PCINPUT
56MG_RN EQU 301BH ; PCINPUT PCINPUT
57MWR_RN EQU 301CH ; PCMEUWR PCMEUWR
58;
59 \ 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 @@
1;
2; Revised: 02-15-88
3;
4CASRM EQU 0 ;Set to zero (0) to create an
5 ; object module to put in the
6 ; CAS Library. Set to one (1)
7 ; to create the CAS Routine
8 ; Manager version of the routine.
9;
10CASFAR EQU 1 ;Set to zero (0) to create an
11 ; object module that is called
12 ; as a near procedure. Set to
13 ; one (1) to create an object
14 ; module that is called as a far
15 ; procedure.
16;
17COPYRIGHT EQU 1 ;Set to zero (0) to include
18 ; Copyright 1988 Microsoft
19 ; (1) to exclude Copyright 1988 Microsoft
20 ; notice.
21;
22SMODE EQU 2 ;Set to one (1) for Interpertive
23 ; BASIC. Set to two (2) for
24 ; Compiled BASIC.
25;
26CASINT EQU 7FH ;CAS Routine Manager interupt
27;
28CASFILEID EQU 01234H ;This CAS file identification
29 ; is found at the beginning of all
30 ; CAS files in the first word
31PANELOBJID EQU 0FFH ;This is the panel object
32 ; identification number that is
33 ; found inside a valid CAS file's
34 ; object list when panels have
35 ; been saved inside a file
36HELPOBJID EQU 0FEH ;This is the help/error object
37 ; identification number that is
38 ; found inside a valid CAS file's
39 ; object list when helps have
40 ; been saved inside a file
41COLOROBJID EQU 0FDH ;This is the color object
42 ; identification number that is
43 ; found inside a valid CAS file's
44 ; object list when colors have
45 ; been saved inside a file
46INPUTOBJID EQU 0FCH ;This is the input object
47 ; identification number that is
48 ; found inside a valid CAS file's
49 ; object list when input fields
50 ; have been saved inside a file
51DIALOGOBJID EQU 0FBH ;This is the dialog object
52 ; identification number that is
53 ; found inside a valid CAS file's
54 ; object list when dialogs have
55 ; been saved inside a file
56SCROLLOBJID EQU 0FAH ;This is the scroll field object
57 ; identification number that is
58 ; found inside a valid CAS file's
59 ; object list when scroll fields
60 ; have been saved inside a file
61TRANSOBJID EQU 0F9H ;This is the translation object
62 ; identification number that is
63 ; found inside a valid CAS file's
64 ; object list when a translation
65 ; table has been saved inside a
66 ; file
67GRAPHOBJID EQU 0F8H ;This is the graphic field object
68 ; identification number that is
69 ; found inside a valid CAS file's
70 ; object list when a graphic
71 ; fields has been saved inside a
72 ; file
73MENUOBJID EQU 0F7H ;This is the maintain menu object
74 ; identification number that is
75 ; found inside a valid CAS file's
76 ; object list when a menu table
77 ; has been saved inside a file
78MAXNUMOBJS EQU 20 ;Maximum possible number of
79 ; objects types reserved in CAS
80 ; data files. (i.e. panel, help,
81 ; error, color, input objects,,,)
82;
83LIBVER MACRO
84 DB "Version 4.0" ;CAS library version number
85ENDM
86;
87INCLUDE CASRN.INC ;Include the CAS routine numbers
88;
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 @@
1/* cds utilities */
2/* #include "types.h" */
3#include "sysvar.h"
4#include "cds.h"
5#include "dpb.h"
6#include <dos.h>
7#include "jointype.h"
8
9extern struct sysVarsType SysVars ;
10
11char fGetCDS(i, pLCDS)
12int i ;
13struct CDSType *pLCDS ;
14{
15 struct CDSType far *cptr ;
16 int j ;
17 /* Get pointer to CDS */
18 if (i >= 0 && i < SysVars.cCDS) {
19 *(long *)(&cptr) = SysVars.pCDS + (i * sizeof(*pLCDS)) ;
20
21 /* Copy CDS to our program */
22 for (j=0 ; j < sizeof(*pLCDS) ; j++)
23 *((char *)pLCDS+j) = *((char far *)cptr+j) ;
24
25 return TRUE ;
26 } ;
27 return FALSE ;
28}
29
30
31
32
33char fPutCDS(i, pLCDS)
34int i ;
35struct CDSType *pLCDS ;
36{
37 struct CDSType far *cptr ;
38 int j ;
39
40 if (i >= 0 && i < SysVars.cCDS) {
41 *(long *)(&cptr) = SysVars.pCDS + (i * sizeof(*pLCDS)) ;
42
43 for (j=0 ; j < sizeof(*pLCDS) ; j++)
44 *((char far *)cptr+j) = *((char *)pLCDS+j) ;
45
46 return TRUE ;
47 } ;
48 return FALSE ;
49}
50
51/* returns TRUE if drive i is a physical drive. Physical means that logical
52 * drive n corresponds with physical drive n. This is the case ONLY if the
53 * CDS is inuse and the DPB corresponding to the CDS has the physical drive
54 * equal to the original drive.
55 */
56
57char fPhysical(i)
58int i ;
59{
60 struct DPBType DPB ;
61 struct DPBType *pd = &DPB ;
62 struct DPBType far *dptr ;
63 int j ;
64
65 struct CDSType CDS ;
66
67 if (!fGetCDS(i, &CDS))
68 return FALSE ;
69
70 if (TESTFLAG(CDS.flags,CDSNET | CDSSPLICE | CDSLOCAL))
71 return FALSE ;
72
73 *(long *)(&dptr) = CDS.pDPB ;
74
75 for (j=0 ; j < sizeof(DPB) ; j++)
76 *((char *)pd+j) = *((char far *)dptr+j) ;
77
78 return(i == DPB.drive) ;
79}
80
81/* return TRUE if the specified drive is a network drive. i is a 0-based
82 * quantity
83 */
84
85/* MODIFICATION HISTORY
86 *
87 * M000 June 5/85 Barrys
88 * Removed extra net check.
89 */
90
91char fNet(i)
92int i ;
93{
94 union REGS ir ;
95 register union REGS *iregs = &ir ; /* Used for DOS calls */
96
97 struct CDSType CDS ;
98
99 if (!fGetCDS(i, &CDS))
100 return FALSE ;
101
102 iregs->x.ax = IOCTL9 ; /* Function 0x4409 */
103 iregs->x.bx = i + 1 ;
104 intdos(iregs, iregs) ;
105
106/*** M000
107 return(TESTFLAG(CDS.flags,CDSNET) || TESTFLAG(iregs->x.dx,0x1000)) ;
108/***/
109 return(TESTFLAG(CDS.flags,CDSNET)) ;
110}
111
112
113/* return TRUE if the specified drive is a shared drive. i is a 0-based
114 * quantity
115 */
116char fShared(i)
117int i ;
118{
119 struct CDSType CDS ;
120 union REGS ir ;
121 register union REGS *iregs = &ir ; /* Used for DOS calls */
122
123 if (!fGetCDS(i, &CDS))
124 return FALSE ;
125
126 iregs->x.ax = IOCTL9 ; /* Function 0x4409 */
127 iregs->x.bx = i + 1 ;
128 intdos(iregs, iregs) ;
129
130 return TESTFLAG(CDS.flags,CDSNET) || TESTFLAG(iregs->x.dx,0x0200) ;
131}
132 \ 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 @@
1comment $
2cmacros - assembly macros for interfacing to HHLs
3(C)Copyright 1984, 1988 Microsoft Corporation
4$
5if1
6outif MACRO name,defval,onmsg,offmsg
7 ifndef name
8 ifb <defval>
9 name=0
10 else
11 name=defval
12 endif
13 endif
14 if name
15 name=1
16 ifnb <onmsg>
17 %out ! onmsg
18 endif
19 else
20 ifnb <offmsg>
21 %out ! offmsg
22 endif
23 endif
24endm
25
26error MACRO msg
27bug
28%out E r r o r ----- msg
29ENDM
30%out cMacros Version 1.04
31outif memS,0,<Small Model>
32outif memM,0,<Medium Model>
33outif memL,0,<Large Model>
34outif memC,0,<Compact Model>
35outif memH,0,<Huge Model>
36memMOD= memS + memM + memL + memC + memH
37if memMOD ne 1
38if memMOD eq 0
39memS= 1
40outif memS,0,<Small Model>
41else
42error <Must have only 1 memory model selected>
43endif
44endif
45sizeC= memM + memL + memH
46sizeD= memL + memC + (memH*2)
47outif ?DF,0,<No segments or groups will be defined>
48outif ?WIN,0,<Windows Support>
49outif ?PLM,0,<PLM calling convention>
50endif
51 .XCREF
52 .XCREF ?N,?AX,?AH,?AL,?BX,?BH
53 .XCREF ?BL,?CX,?CH,?CL,?DX,?DH
54 .XCREF ?DL,?SI,?DI,?ES,?DS,?BP
55 .XCREF ?SP,?SS,?CS
56 .XCREF ?RSL,?CPD,?argl,?argc,?BA
57 .XCREF ?ACB,???,?PO
58 .XCREF ?PAS,?PC
59 .XCREF Uconcat,mPush,mPop
60 .XCREF ?RI,?pp,?pp1,?al1
61 .XCREF ?aD,?AP,?Atal,?pd,?dd,?dd1,?ex1,?cas
62 .XCREF ?pg,?pg1,?aloc,?cs1,?cs2
63 .XCREF ?lb1,?lblpu
64 .XCREF ?DF,?PLM,?WIN,?IA,?PU,?ADJ
65 .CREF
66?RSL = 0
67?CPD = 0
68?ArgL = 0
69?ArgC = 0
70?BA = 0
71?ACB = 0
72??? = 0
73?PO = 0
74?PAS = 0
75?PC = 0
76?IA = 0
77?PU = 0
78?ADJ = 0
79?lblpu = 0
80?N = 0000000000000000B
81?AX = 0000000000000011B
82?AH = 0000000000000001B
83?AL = 0000000000000010B
84?BX = 0000000000001100B
85?BH = 0000000000000100B
86?BL = 0000000000001000B
87?CX = 0000000000110000B
88?CH = 0000000000010000B
89?CL = 0000000000100000B
90?DX = 0000000011000000B
91?DH = 0000000001000000B
92?DL = 0000000010000000B
93?SI = 0000000100000000B
94?DI = 0000001000000000B
95?ES = 0000010000000000B
96?DS = 0000100000000000B
97?BP = 0001000000000000B
98?SP = 0010000000000000B
99?SS = 0100000000000000B
100?CS = 1000000000000000B
101uconcat macro n1,n2,o1,o2,p1,p2
102n1&n2 o1&o2 p1&p2
103endm
104mpush macro rV
105irp x,<ax,bx,cx,dx,si,di,es,ds,bp,sp,ss,cs>
106if rV AND ?&&x
107push x
108endif
109endm
110endm
111mpop macro rV
112irp x,<cs,ss,sp,bp,ds,es,di,si,dx,cx,bx,ax>
113if rV AND ?&&x
114pop x
115endif
116endm
117endm
118SAVE macro rL
119?RSL = 0
120?RI ?RSL,<rL>
121endm
122smashes macro n,rL
123 .xcref
124 .xcref ?SM&n
125 .cref
126?SM&n = 0
127?RI ?SM&n,<rL>
128endm
129?RI macro n,rL
130irp x,<rL>
131ifdef ?&&x
132n = n or ?&&x
133endif
134endm
135endm
136parmB macro nl
137?pp <&nL>,<byte>,2,1
138endm
139parmW macro nl
140?pp <&nL>,<word>,2,2
141endm
142parmD macro nl
143ife ?PLM
144irp x,<nL>
145?pp <&&x>,<DWORD>,0,4
146?pp <Off_&&x>,<WORD>,2,2
147?pp <Seg_&&x>,<WORD>,2,2
148endm
149else
150irp x,<nL>
151?pp <Seg_&&x>,<WORD>,2,2
152?pp <Off_&&x>,<WORD>,2,2
153?pp <&&x>,<DWORD>,0,4
154endm
155endif
156endm
157parmQ macro nl
158?pp <&nL>,<QWORD>,8,8
159endm
160parmT macro nl
161?pp <&nL>,<TBYTE>,10,10
162endm
163if sizeC
164parmCP macro nl
165parmD <nl>
166endm
167else
168parmCP macro nl
169parmW <nl>
170endm
171endif
172if sizeD
173parmDP macro nl
174parmD <nl>
175endm
176else
177parmDP macro nl
178parmW <nl>
179endm
180endif
181?pp macro nL,t,l,s
182if ?CPD
183 .xcref
184ife ?PLM
185irp x,<nL>
186?pp1 x,<t>,%?PO,%?adj,%(?PO+?adj)
187?PO = ?PO + l
188 .xcref ?T&&x
189?T&&x = s
190endm
191else
192irp x,<nL>
193?PO = ?PO + l
194?pp1 x,<t>,%?PO,%?adj,%(?PO+?adj)
195 .xcref ?T&&x
196?T&&x = s
197endm
198endif
199 .cref
200else
201%out Parm(s) "&nl" declared outside proc def.
202endif
203endm
204?pp1 macro n,t,o,a,b
205ife ?PLM
206n equ t ptr [bp+b]
207else
208n equ t ptr [bp+a+?PO-o]
209endif
210endm
211localB macro nL
212?aLoc <&nL>,<BYTE ptr>,1,1,0
213endm
214localW macro nL
215?aLoc <&nL>,<WORD PTR>,2,2,1
216endm
217localD macro nL
218irp x,<nL>
219?aLoc <Seg_&&x>,<WORD PTR>,2,2,1
220?aLoc <Off_&&x>,<WORD PTR>,2,2,1
221?aLoc <&&x>,<DWORD PTR>,0,4,1
222endm
223endm
224localQ macro nL
225?aLoc <&nL>,<QWORD PTR>,8,8,1
226endm
227localT macro nL
228?aLoc <&nL>,<TBYTE PTR>,10,10,1
229endm
230if sizeC
231localCP macro nL
232localD <nL>
233endm
234else
235localCP macro nL
236localW <nL>
237endm
238endif
239if sizeD
240localDP macro nL
241localD <nL>
242endm
243else
244localDP macro nL
245localW <nL>
246endm
247endif
248localV macro n,a
249?aLoc <&n>,,%(&a),0,1
250endm
251?aLoc macro nL,t,l,s,a
252if ?CPD
253 .xcref
254??? = ??? + l
255if a
256??? = ((??? + 1) AND 0FFFEH)
257endif
258irp x,<nL>
259?aL1 x,<t>,%???
260 .xcref ?T&&x
261?T&&x = s
262endm
263 .cref
264else
265%out Locals "&nl" declared outside procedure def.
266endif
267endm
268?aL1 macro n,t,o
269if ?IA
270n equ t [bp-?IA-o]
271else
272n equ t [bp-o]
273endif
274endm
275globalB macro n,i,s
276?aD <n>,1
277?dd n,1,<BYTE>,<DB>,<i>,<s>
278endm
279globalW macro n,i,s
280?aD <n>,2
281?dd n,1,<WORD>,<DW>,<i>,<s>
282endm
283globalD macro n,i,s
284?aD <n>,4
285?dd n,1,<DWORD>,<DD>,<i>,<s>
286endm
287globalQ macro n,i,s
288?aD <n>,8
289?dd n,1,<QWORD>,<DQ>,<i>,<s>
290endm
291globalT macro n,i,s
292?aD <n>,10
293?dd n,1,<TBYTE>,<DT>,<i>,<s>
294endm
295if sizeC
296globalCP macro n,i,s
297globalD n,<i>,<s>
298endm
299else
300globalCP macro n,i,s
301globalW n,<i>,<s>
302endm
303endif
304if sizeD
305globalDP macro n,i,s
306globalD n,<i>,<s>
307endm
308else
309globalDP macro n,i,s
310globalW n,<i>,<s>
311endm
312endif
313staticB macro n,i,s
314?aD <n>,1
315?dd n,0,<BYTE>,<DB>,<i>,<s>
316endm
317staticW macro n,i,s
318?aD <n>,2
319?dd n,0,<WORD>,<DW>,<i>,<s>
320endm
321staticD macro n,i,s
322?aD <n>,4
323?dd n,0,<DWORD>,<DD>,<i>,<s>
324endm
325staticQ macro n,i,s
326?aD <n>,8
327?dd n,0,<QWORD>,<DQ>,<i>,<s>
328endm
329staticT macro n,i,s
330?aD <n>,10
331?dd n,0,<TBYTE>,<DT>,<i>,<s>
332endm
333if sizeC
334staticCP macro n,i,s
335staticD n,<i>,<s>
336endm
337else
338staticCP macro n,i,s
339staticW n,<i>,<s>
340endm
341endif
342if sizeD
343staticDP macro n,i,s
344staticD n,<i>,<s>
345endm
346else
347staticDP macro n,i,s
348staticW n,<i>,<s>
349endm
350endif
351?dd macro n,p,t,d,i,s
352ife ?PLM
353n label t
354?dd1 _&n,p,<d>,<i>,<s>
355else
356?dd1 n,p,<d>,<i>,<s>
357endif
358endm
359?dd1 macro n,p,d,i,s
360if p
361PUBLIC n
362endif
363ifb <s>
364n d i
365else
366ifb <i>
367n d s DUP (?)
368else
369n d s DUP (i)
370endif
371endif
372endm
373externB macro nL
374?ex1 <&nL>,1,<BYTE>
375endm
376externW macro nL
377?ex1 <&nL>,2,<WORD>
378endm
379externD macro nL
380?ex1 <&nL>,4,<DWORD>
381endm
382externQ macro nL
383?ex1 <&nL>,8,<QWORD>
384endm
385externT macro nL
386?ex1 <&nL>,10,<TBYTE>
387endm
388externNP macro nL
389?ex1 <&nL>,2,<NEAR>
390endm
391externFP macro nL
392?ex1 <&nL>,4,<FAR>
393endm
394if sizeC
395externP macro nL
396?ex1 <&nL>,4,<FAR>
397endm
398else
399externP macro nL
400?ex1 <&nL>,2,<NEAR>
401endm
402endif
403if sizeC
404externCP macro nL
405?ex1 <&nL>,4,<DWORD>
406endm
407else
408externCP macro nL
409?ex1 <&nL>,2,<WORD>
410endm
411endif
412if sizeD
413externDP macro nL
414?ex1 <&nL>,4,<DWORD>
415endm
416else
417externDP macro nL
418?ex1 <&nL>,2,<WORD>
419endm
420endif
421?ex1 macro nL,s,d
422irp x,<nL>
423 .xcref
424 .xcref ?T&&x
425 .cref
426?T&&x = s
427ife ?PLM
428extrn _&&x:&d
429x equ _&&x
430else
431extrn x:&d
432endif
433endm
434endm
435labelB macro nL
436?lb1 <&nL>,1,<BYTE>
437endm
438labelW macro nL
439?lb1 <&nL>,2,<WORD>
440endm
441labelD macro nL
442?lb1 <&nL>,4,<DWORD>
443endm
444labelQ macro nL
445?lb1 <&nL>,8,<QWORD>
446endm
447labelT macro nL
448?lb1 <&nL>,10,<TBYTE>
449endm
450labelNP macro nL
451?lb1 <&nL>,2,<NEAR>
452endm
453labelFP macro nL
454?lb1 <&nL>,4,<FAR>
455endm
456if sizeC
457labelP macro nL
458?lb1 <&nL>,4,<FAR>
459endm
460else
461labelP macro nL
462?lb1 <&nL>,2,<NEAR>
463endm
464endif
465if sizeC
466labelCP macro nL
467?lb1 <&nL>,4,<DWORD>
468endm
469else
470labelCP macro nL
471?lb1 <&nL>,2,<WORD>
472endm
473endif
474if sizeD
475labelDP macro nL
476?lb1 <&nL>,4,<DWORD>
477endm
478else
479labelDP macro nL
480?lb1 <&nL>,2,<WORD>
481endm
482endif
483?lb1 macro nL,s,d
484?lblpu = 0
485irp x,<nL>
486ifidn <x>,<PUBLIC>
487?lblpu = 1
488else
489 .xcref
490 .xcref ?T&&x
491 .cref
492?T&&x = s
493ife ?PLM
494if ?lblpu
495public _&&x
496endif
497_&&x label &d
498x equ _&&x
499else
500if ?lblpu
501public x
502endif
503x label &d
504endif
505endif
506endm
507endm
508defB macro nL
509?aD <&nL>,1
510endm
511defW macro nL
512?aD <&nL>,2
513endm
514defD macro nL
515?aD <&nL>,4
516endm
517defQ macro nL
518?aD <&nL>,8
519endm
520defT macro nL
521?aD <&nL>,10
522endm
523if sizeC
524defCP macro nL
525defD <nL>
526endm
527else
528defCP macro nL
529defW <nL>
530endm
531endif
532if sizeD
533defDP macro nL
534defD <nL>
535endm
536else
537defDP macro nL
538defW <nL>
539endm
540endif
541?aD macro nL,s
542irp x,<nL>
543 .xcref
544 .xcref ?T&&x
545 .cref
546?T&&x = s
547endm
548endm
549regPtr macro n,S,O
550 .xcref
551 .xcref ?T&n,?SR&n,?OR&n
552 .cref
553?T&n = 0FFFFH
554?SR&n = 0
555?RI ?SR&n,<&S>
556?OR&n = 0
557?RI ?OR&n,<&O>
558endm
559arg macro aL
560irp x,<aL>
561?argc = ?argc + 1
562?Atal <x>,%?argc
563endm
564endm
565?Atal macro n,i
566 .xcref
567 .xcref ?ALI&i
568 .cref
569?ALI&i &macro
570?AP n
571&endm
572endm
573?AP macro n
574?argl = ?argl + 2
575ifdef ?T&n
576ife ?T&n-1
577push word ptr (n)
578exitm
579endif
580ife ?T&n-2
581push n
582exitm
583endif
584ife ?T&n-4
585push word ptr (n)+2
586push word ptr (n)
587?argl = ?argl + 2
588exitm
589endif
590ife ?T&n-8
591push word ptr (n)+6
592push word ptr (n)+4
593push word ptr (n)+2
594push word ptr (n)
595?argl = ?argl + 6
596exitm
597endif
598ife ?T&n-0FFFFH
599mpush %(?SR&n),1
600mpush %(?OR&n),1
601?argl = ?argl + 2
602exitm
603endif
604ife ?T&n
605push word ptr (n)
606exitm
607endif
608endif
609push n
610endm
611ife ?PLM
612ccall macro n,a,sleaze
613ifnb <a>
614Arg <a>
615endif
616ifdef ?SM&n
617?RSL = ?RSL AND ?SM&n
618endif
619mpush %?RSL
620?argl = 0
621?ACB = ?argc
622rept ?argc
623uconcat <?ALI>,%?ACB
624uconcat <purge>,,<?ALI>,%?ACB
625?ACB = ?ACB - 1
626endm
627ife ?PLM
628ifb <sleaze>
629call _&n
630else
631call n
632endif
633else
634call n
635endif
636if ?argl
637add sp,?argl
638endif
639mpop %?RSL
640?RSL = 0
641?argc = 0
642?argl = 0
643endm
644else
645ccall macro n,a
646ifnb <a>
647Arg <a>
648endif
649ifdef ?SM&n
650?RSL = ?RSL AND ?SM&n
651endif
652mpush %?RSL
653?argl = 0
654?ACB = 1
655rept ?argc
656uconcat <?ALI>,%?ACB
657uconcat <purge>,,<?ALI>,%?ACB
658?ACB = ?ACB + 1
659endm
660ife ?PLM
661call _&n
662else
663call n
664endif
665mpop %?RSL
666?RSL = 0
667?argc = 0
668?argl = 0
669endm
670endif
671cProc macro n,cl,s
672?pd n,<cl>,<s>,4
673endm
674?pd macro n,c,a,i
675if ?CPD
676?UTPE
677endif
678?CPD = 1
679??? = 0
680?argc = 0
681?BA = 0
682?PO = 0
683?PU = 0
684?IA = 0
685?adj = i
686?PAS = 0
687ifnb <a>
688?RI ?PAS,<a>
689endif
690?PC = sizeC
691irp x,<c>
692ifidn <x>,<FAR>
693?PC = 1
694endif
695ifidn <x>,<NEAR>
696?PC = 0
697endif
698ifidn <x>,<PUBLIC>
699?PU = 1
700endif
701endm
702if ?PC
703if ?WIN
704?IA = 2
705endif
706?adj = ?adj + 2
707endif
708ife ?PLM
709ife ?PC
710n label near
711else
712n label far
713endif
714?pg <_&n>,%?PU,%?PC,%?PAS
715else
716?pg <n>,%?PU,%?PC,%?PAS
717endif
718endm
719?pg macro n,p,c,a
720 .xcref
721 cBegin &macro g
722 .xcref
723 ?pg1 <n>,c,a,%?PO
724 ?CPD = 0
725 ?argc = 0
726 ?BA = 1
727 ??? = (???+1) AND 0FFFEH
728 if p
729 PUBLIC n
730 endif
731 ife c
732 n proc NEAR
733 else
734 n proc FAR
735 endif
736 ifidn <g>,<nogen>
737 if ???+?PO+a
738 %out <cBegin - possible invalid use of nogen>
739 endif
740 else
741 if ?IA
742 mov ax,ds
743 nop
744 inc bp
745 push bp
746 mov bp,sp
747 push ds
748 mov ds,ax
749 else
750 push bp
751 mov bp,sp
752 endif
753 if ???
754 sub sp,???
755 endif
756 mPush a,1
757 endif
758 .cref
759 purge cBegin
760 &endm
761 ?UTPE &macro
762 %out Unterminated Procedure Definition: "&n"
763 &endm
764endm
765
766?pg1 macro n,c,a,o
767 .xcref
768 cEnd &macro g
769 .xcref
770 ?BA = 0
771 ifidn <g>,<nogen>
772 if o+a
773 %out <cEnd - possible invalid use of nogen>
774 endif
775 else
776 mPop a,1
777 if ?IA
778 sub bp,2
779 mov sp,bp
780 pop ds
781 pop bp
782 dec bp
783 else
784 mov sp,bp
785 pop bp
786 endif
787 ife ?PLM
788 ret
789 else
790 ret o
791 endif
792 endif
793 n endp
794 .cref
795 purge cEnd
796 &endm
797 .cref
798endm
799
800assumes macro s,g
801local assumed
802assumed = 0
803ifidn <code>,<g>
804?cas <s>
805assumed = 1
806endif
807ifidn <CODE>,<g>
808?cas <s>
809assumed = 1
810endif
811ifidn <data>,<g>
812assume s&:dgroup
813assumed = 1
814endif
815ifidn <DATA>,<g>
816assume s&:dgroup
817assumed = 1
818endif
819ife assumed
820assume s&:&g
821endif
822endm
823if sizeC
824?cas macro s
825assume s&:_TEXT
826endm
827else
828?cas macro s
829assume s&:IGROUP
830endm
831endif
832createSeg macro n,ln,a,co,cl,grp
833ifnb <grp>
834ifidn <grp>,<IGROUP>
835ife sizeC
836addSeg IGROUP,n
837endif
838else
839addSeg grp,n
840endif
841endif
842ifnb <cl>
843n segment a co '&cl'
844else
845n segment a co
846endif
847n ends
848?cs1 <n>,<ln>
849endm
850if1
851ASMpass=1
852else
853ASMpass=2
854endif
855addSeg macro grp,seg
856ifndef def_&grp
857def_&grp= 0
858endif
859if def_&grp ne ASMpass
860add_&grp &macro s
861in_&grp <seg>,s
862&endm
863in_&grp &macro sl,s
864ifb <s>
865grp group sl
866else
867add_&grp &macro ns
868in_&grp <sl,s>,ns
869&endm
870endif
871&endm
872def_&grp=ASMpass
873else
874add_&grp seg
875endif
876endm
877defGrp macro nam
878addSeg nam
879endm
880?cs1 macro n,ln
881begin&ln &macro
882?cs2 <n>
883n segment
884&endm
885endm
886
887?cs2 macro n
888 sEnd &macro
889 n ends
890 &endm
891endm
892
893sBegin macro ln
894 begin&ln
895endm
896
897ife ?DF
898 createSeg _TEXT,code,byte,public,CODE,IGROUP
899 createSeg _DATA,data,word,public,DATA,DGROUP
900 if ?WIN
901 ife sizeC
902 createSeg _INITTEXT,initcode,byte,public,CODE,IGROUP
903 createSeg _INITDATA,initdata,word,public,DATA,DGROUP
904 endif
905 endif
906 ife sizeC
907 defGrp IGROUP
908 endif
909 defGrp DGROUP
910 if sizeC
911 codeOFFSET equ OFFSET _TEXT:
912 else
913 codeOFFSET equ OFFSET IGROUP:
914 endif
915 dataOFFSET equ OFFSET DGROUP:
916endif
917
918errnz macro x
919 if2
920 if x
921 errnz1 <x>,%(x)
922 endif
923 endif
924endm
925
926errnz1 macro x1,x2
927 = *ERRNZ* x1 = x2
928endm
929
930errn$ macro l,x
931 errnz <OFFSET $ - OFFSET l x>
932endm
diff --git a/v4.0/src/INC/COMSUBS.LIB b/v4.0/src/INC/COMSUBS.LIB
new file mode 100644
index 0000000..18215a9
--- /dev/null
+++ b/v4.0/src/INC/COMSUBS.LIB
Binary files 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 @@
1; SCCSID = @(#)const2.asm 1.4 85/07/24
2TITLE CONST2 - More constants data
3NAME CONST2
4
5.xlist
6.xcref
7INCLUDE DOSSYM.INC
8include dosseg.asm
9INCLUDE DEVSYM.INC
10.cref
11.list
12
13Break <Initialized data and data used at DOS initialization>
14
15;
16; We need to identify the parts of the data area that are relevant to tasks
17; and those that are relevant to the system as a whole. Under 3.0, the system
18; data will be gathered with the system code. The process data under 2.x will
19; be available for swapping and under 3.0 it will be allocated per-process.
20;
21; The data that is system data will be identified by [SYSTEM] in the comments
22; describing that data item.
23;
24
25 AsmVars <Kanji, Debug, Redirector, ShareF>
26
27CONSTANTS SEGMENT WORD PUBLIC 'CONST'
28
29;
30; Table of routines for assignable devices
31;
32; MSDOS allows assignment if the following standard devices:
33; stdin (usually CON input)
34; stdout (usually CON output)
35; auxin (usually AUX input)
36; auxout (usually AUX output)
37; stdlpt (usually PRN output)
38;
39; SPECIAL NOTE:
40; Status of a file is a strange idea. We choose to handle it in this
41; manner: If we're not at end-of-file, then we always say that we have a
42; character. Otherwise, we return ^Z as the character and set the ZERO
43; flag. In this manner we can support program written under the old DOS
44; (they use ^Z as EOF on devices) and programs written under the new DOS
45; (they use the ZERO flag as EOF).
46
47; Default SFTs for boot up
48
49Public CONST001S,CONST001E
50CONST001s label byte
51 PUBLIC sftabl
52sftabl LABEL DWORD ; [SYSTEM] file table
53 DW -1 ; [SYSTEM] link to next table
54 DW -1 ; [SYSTEM] link seg to next table
55 DW sf_default_number ; [SYSTEM] Number of entries in table
56 DB sf_default_number DUP ( (SIZE sf_entry) DUP (0)); [SYSTEM]
57
58; the next two variables relate to the position of the logical stdout/stdin
59; cursor. They are only meaningful when stdin/stdout are assigned to the
60; console.
61 I_am CARPOS,BYTE ; [SYSTEM] cursor position in stdin
62 I_am STARTPOS,BYTE ; [SYSTEM] position of cursor at beginning of buffered input call
63 I_am INBUF,128 ; [SYSTEM] general device input buffer
64 I_am CONBUF,131 ; [SYSTEM] The rest of INBUF and console buffer
65
66 I_am PFLAG,BYTE ; [SYSTEM] printer echoing flag
67 I_am VERFLG,BYTE ; [SYSTEM] Initialize with verify off
68 I_am CharCo,BYTE,<00000011B> ; [SYSTEM] Allows statchks every 4 chars...
69 I_am chSwitch,BYTE,<'/'> ; [SYSTEM] current switch character
70 I_am AllocMethod,BYTE ; [SYSTEM] how to alloc first(best)last
71 I_am fShare,BYTE,<0> ; [SYSTEM] TRUE => sharing installed
72 I_am DIFFNAM,BYTE,<1> ; [SYSTEM] Indicates when MYNAME has
73 ; changed
74 I_am MYNAME,16,<32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32>
75 ; [SYSTEM] My network name
76
77
78;
79; The following table is a list of addresses that the sharer patches to be
80; PUSH AX to enable the critical sections
81;
82PUBLIC CritPatch
83CritPatch LABEL WORD
84IRP sect,<critDisk,critDevice>
85IF (NOT REDIRECTOR) AND (NOT SHAREF)
86 Short_Addr E&sect
87 Short_Addr L&sect
88ELSE
89 DW 0
90 DW 0
91ENDIF
92ENDM
93 DW 0
94
95;
96; WARNING!!! PRINT and PSPRINT *REQUIRE* ErrorMode to precede INDOS.
97; Also, IBM server 1.0 requires this also.
98;
99 EVEN ; Force swap area to start on word boundry
100PUBLIC SWAP_START
101SWAP_START LABEL BYTE
102 I_am ErrorMode,BYTE ; Flag for INT 24 processing
103 I_am INDOS,BYTE,<0> ; DOS status for interrupt processing
104 I_am WPErr,BYTE,<-1> ; Write protect error flag
105 I_am EXTERR_LOCUS,BYTE ; Extended Error Locus
106 I_am EXTERR,WORD,<0> ; Extended Error code
107
108;WARNING Following two bytes Accessed as word in $GetExtendedError
109 I_am EXTERR_ACTION,BYTE ; Extended Error Action
110 I_am EXTERR_CLASS,BYTE ; Extended Error Class
111; end warning
112
113 I_am EXTERRPT,DWORD ; Extended Error pointer
114 I_am DMAADD,DWORD,<80h,?> ; User's disk transfer address (disp/seg)
115 I_am CurrentPDB,WORD ; Current process identifier
116 I_am ConC_spsave,WORD ; saved SP before ^C
117 I_am exit_code,WORD ; exit code of last proc.
118 I_am CURDRV,BYTE ; Default drive (init A)
119 I_am CNTCFLAG,BYTE,<0> ; ^C check in dispatch disabled
120 ; F.C. 2/17/86
121 I_am CPSWFLAG,BYTE,<0> ; Code Page Switching Flag DOS 4.00
122 I_am CPSWSAVE,BYTE,<0> ; copy of above in case of ABORT
123 EVEN
124 PUBLIC Swap_Always
125 Swap_Always LABEL BYTE
126 I_am USER_IN_AX,WORD ; User INPUT AX value (used for
127 ; extended error type stuff. NOTE:
128 ; does not have Correct value on
129 ; 1-12, OEM, Get/Set CurrentPDB,
130 ; GetExtendedError system calls
131 I_am PROC_ID,WORD,<0> ; PID for sharing (0 = local)
132 I_am USER_ID,WORD,<0> ; Machine for sharing (0 = local)
133 I_am FirstArena,WORD ; first free block found
134 I_am BestArena,WORD ; best free block found
135 I_am LastArena,WORD ; last free block found
136 I_am EndMem,WORD ; End of memory used in DOSINIT
137 I_am LASTENT,WORD ; Last entry for directory search
138
139 I_am FAILERR,BYTE,<0> ; NZ if user did FAIL on I 24
140 I_am ALLOWED,BYTE,<0> ; Allowed I 24 answers (see allowed_)
141 I_am NoSetDir,BYTE ; true -> do not set directory
142 I_am DidCTRLC,BYTE ; true -> we did a ^C exit
143 I_am SpaceFlag,BYTE ; true -> embedded spaces are allowed in FCB
144; Warning! The following items are accessed as a WORD in TIME.ASM
145 EVEN
146 I_am DAY,BYTE,<0> ; Day of month
147 I_am MONTH,BYTE,<0> ; Month of year
148 I_am YEAR,WORD,<0> ; Year (with century)
149 I_am DAYCNT,WORD,<-1> ; Day count from beginning of year
150 I_am WEEKDAY,BYTE,<0> ; Day of week
151; end warning
152 I_am CONSWAP,BYTE ; TRUE => console was swapped during device read
153 I_am IDLEINT,BYTE,<1> ; TRUE => idle int is allowed
154 I_am fAborting,BYTE,<0> ; TRUE => abort in progress
155
156; Combination of all device call parameters
157 PUBLIC DEVCALL ;
158DEVCALL SRHEAD <> ; basic header for disk packet
159 PUBLIC CALLUNIT
160CALLUNIT LABEL BYTE ; unit number for disk
161CALLFLSH LABEL WORD ;
162 I_am CALLMED,BYTE ; media byte
163CALLBR LABEL DWORD ;
164 PUBLIC CALLXAD ;
165CALLXAD LABEL DWORD ;
166 I_am CALLRBYT,BYTE ;
167 PUBLIC CALLVIDM ;
168CALLVIDM LABEL DWORD ;
169 DB 3 DUP(?) ;
170 PUBLIC CallBPB ;
171CALLBPB LABEL DWORD ;
172 I_am CALLSCNT,WORD ;
173 PUBLIC CALLSSEC
174CALLSSEC LABEL WORD ;
175 DW ? ;
176 I_am CALLVIDRW,DWORD ;
177 ;
178 I_am CALLNEWSC,DWORD ; starting sector for >32mb
179 I_am CALLDEVAD,DWORD ; stash for device entry point
180 ;
181; Same as above for I/O calls ;
182 ;
183 PUBLIC IOCall ;
184IOCALL SRHEAD <> ;
185IOFLSH LABEL WORD ;
186 PUBLIC IORCHR ;
187IORCHR LABEL BYTE ;
188 I_am IOMED,BYTE ;
189 I_am IOXAD,DWORD ;
190 I_am IOSCNT,WORD ;
191 I_am IOSSEC,WORD ;
192; Call struct for DSKSTATCHK ;
193 I_am DSKSTCALL,2,<DRDNDHL,0> ;
194 I_am DSKSTCOM,1,<DEVRDND> ;
195 I_am DSKSTST,WORD ;
196 DB 8 DUP (0) ;
197 I_am DSKCHRET,BYTE ;
198 short_addr DEVIOBUF ;
199 DW ? ; DOS segment set at Init
200 I_AM DSKSTCNT,WORD,<1> ;
201 DW 0 ;
202
203 I_am CreatePDB,BYTE ; flag for creating a process
204 PUBLIC Lock_Buffer ;
205Lock_Buffer LABEL DWORD ;MS. DOS Lock Buffer for Ext Lock
206 DD ? ;MS. position
207 DD ? ;MS. length
208CONST001e label byte
209
210CONSTANTS ENDS
211 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 @@
1 DB "MS DOS Version 4.00 (C)Copyright 1988 Microsoft Corp"
2 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 @@
1; SCCSID = @(#)cpmfcb.asm 1.1 85/04/10
2; SCCSID = @(#)cpmfcb.asm 1.1 85/04/10
3;BREAK <File Control Block definition>
4
5;
6; Field definition for FCBs
7; The FCB has the following structure:
8;
9; +---------------------------+
10; | Drive indicator(byte) |
11; +---------------------------+
12; | Filename (8 chars) |
13; +---------------------------+
14; | Extension (3 chars) |
15; +---------------------------+
16; | Current Extent(word) |
17; +---------------------------+
18; | Record size (word) |
19; +---------------------------+
20; | File Size (2 words) |
21; +---------------------------+
22; | Date of write |
23; +---------------------------+
24; | Time of write |
25; +---------------------------+
26;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
27; C A V E A T P R O G R A M M E R ;
28; ;
29; +---------------------------+
30; | 8 bytes reserved |
31; +---------------------------+
32; ;
33; C A V E A T P R O G R A M M E R ;
34;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
35; | next record number |
36; +---------------------------+
37; | random record number |
38; +---------------------------+
39;
40
41sys_fcb STRUC
42fcb_drive DB ?
43fcb_name DB 8 DUP (?)
44fcb_ext DB 3 DUP (?)
45fcb_EXTENT DW ?
46fcb_RECSIZ DW ? ; Size of record (user settable)
47fcb_FILSIZ DW ? ; Size of file in bytes; used with the
48 ; following word
49fcb_DRVBP DW ? ; BP for SEARCH FIRST and SEARCH NEXT
50fcb_FDATE DW ? ; Date of last writing
51fcb_FTIME DW ? ; Time of last writing
52;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
53; C A V E A T P R O G R A M M E R ;
54; ;
55fcb_reserved DB 8 DUP (?) ; RESERVED
56; ;
57; C A V E A T P R O G R A M M E R ;
58;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
59fcb_NR DB ? ; Next record
60fcb_RR DB 4 DUP (?) ; Random record
61sys_fcb ENDS
62
63FILDIRENT = fcb_FILSIZ ; Used only by SEARCH FIRST and SEARCH
64 ; NEXT
65
66fcb_sfn EQU BYTE PTR fcb_reserved
67
68; Note that fcb_net_handle, fcb_nsl_drive, fcb_nsld_drive and fcb_l_drive
69; all must point to the same byte. Otherwise, the FCBRegen will fail.
70; NOTE about this byte (fcb_nsl_drive)
71; The high two bits of this byte are used as follows to indicate the FCB type
72; 00 means a local file or device with sharing loaded
73; 10 means a remote (network) file
74; 01 means a local file with no sharing loaded
75; 11 means a local device with no sharing loaded
76
77;
78; Network FCB
79;
80fcb_net_drive EQU BYTE PTR fcb_reserved+1
81fcb_net_handle EQU WORD PTR fcb_reserved+2
82fcb_netID EQU DWORD PTR fcb_reserved+4
83
84;
85; No sharing local file FCB
86;
87fcb_nsl_drive EQU BYTE PTR fcb_reserved+1
88fcb_nsl_bits EQU BYTE PTR fcb_reserved+2
89fcb_nsl_firclus EQU WORD PTR fcb_reserved+3
90fcb_nsl_dirsec EQU WORD PTR fcb_reserved+5
91fcb_nsl_dirpos EQU BYTE PTR fcb_reserved+7
92
93;
94; No sharing local device FCB
95;
96fcb_nsld_drive EQU BYTE PTR fcb_reserved+1
97fcb_nsld_drvptr EQU DWORD PTR fcb_reserved+2
98
99;
100; Sharing local FCB
101;
102fcb_l_drive EQU BYTE PTR fcb_reserved+1
103fcb_l_firclus EQU WORD PTR fcb_reserved+2
104fcb_l_mfs EQU WORD PTR fcb_reserved+4
105fcb_l_attr EQU BYTE PTR fcb_reserved+6
106
107;
108; Bogusness: the four cases are:
109;
110; local file 00
111; local device 40
112; local sharing C0
113; network 80
114;
115; Since sharing and network collide, we cannot use a test instruction for
116; deciding whether a network or a share check in involved
117;
118FCBDEVICE EQU 040h
119FCBNETWORK EQU 080h
120FCBSHARE EQU 0C0h
121
122; FCBSPECIAL must be able to mask off both net and share
123FCBSPECIAL EQU 080h
124FCBMASK EQU 0C0h
125 \ 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 @@
1; Note: this must be a macro, and not a subroutine in the BIOS since
2; it is called from both CODE and SYSINITSEG.
3;
4;------GET_CPU_TYPE------------------------------------------------------------May, 88 by MW
5; Returns: AX = 0 if 8086 or 8088
6; = 1 if 80286
7; = 2 if 80386
8;
9Get_CPU_Type macro
10 pushf
11 push bx ; preserve bx
12 xor bx, bx ; init bx to zero
13
14 xor ax,ax ; 0000 into AX
15 push ax ; put it on the stack...
16 popf ; ...then shove it into the flags
17 pushf ; get it back out of the flags...
18 pop ax ; ...and into ax
19 and ax,0F000h ; mask off high four bits
20 cmp ax,0F000h ; was it all 1's?
21 je cpu_8086 ; aye; it's an 8086 or 8088
22
23 mov ax,0F000h ; now try to set the high four bits..
24 push ax
25 popf
26 pushf
27 pop ax ; ...and see what happens
28 and ax,0F000h ; any high bits set ?
29 jz cpu_286 ; nay; it's an 80286
30
31cpu_386: ; bx starts as zero
32 inc bx ; inc twice if 386
33cpu_286: ; just inc once if 286
34 inc bx
35cpu_8086: ; don't inc at all if 086
36 mov ax, bx ; put CPU type value in ax
37 pop bx ; restore original bx
38 popf
39 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 @@
1; SCCSID = @(#)curdir.asm 1.1 85/04/10
2; SCCSID = @(#)curdir.asm 1.1 85/04/10
3BREAK <Current directory list structure>
4;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
5; C A V E A T P R O G R A M M E R ;
6; ;
7; CDS items are used bu the internal routines to store cluster numbers and ;
8; network identifiers for each logical name. The ID field is used dually, ;
9; both as net ID and for a cluster number for local devices. In the case ;
10; of local devices, the cluster number will be -1 if there is a potential ;
11; of the disk being changed or if the path must be recracked. The END ;
12; field is the location of the end of the definition. No .. is allowed ;
13; past this point ;
14
15DIRSTRLEN EQU 64+3 ; Max length in bytes of directory strings
16TEMPLEN EQU DIRSTRLEN*2
17
18curdir_list STRUC
19curdir_text DB DIRSTRLEN DUP (?) ; text of assignment and curdir
20curdir_flags DW ? ; various flags
21curdir_devptr DD ? ; local pointer to DPB or net device
22curdir_ID DW ? ; cluster of current dir (net ID)
23 DW ?
24curdir_user_word DW ?
25curdir_end DW ? ; end of assignment
26curdir_type DB ? ; IFS drive (2=ifs, 4=netuse)
27curdir_ifs_hdr DD ? ; Ptr to File System Header
28curdir_fsda DB 2 DUP (?) ; File System Dependent Data Area
29curdir_list ENDS
30
31curdirLen EQU Size curdir_list ; Needed for screwed up
32 ; ASM87 which doesn't allow
33 ; Size directive as a macro
34 ; argument
35curdir_netID EQU DWORD PTR curdir_ID
36
37;Flag word masks
38curdir_isnet EQU 1000000000000000B
39curdir_isifs EQU 1000000000000000B ; DOS 4.00
40curdir_inuse EQU 0100000000000000B
41curdir_splice EQU 0010000000000000B
42curdir_local EQU 0001000000000000B
43; ;
44; C A V E A T P R O G R A M M E R ;
45;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
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 @@
1DBCS = FALSE
2 \ 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 @@
1DBCS = TRUE
2 \ 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 @@
1DBCS = FALSE
2 \ 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 @@
1 %OUT DEVSYM.INC...
2; SCCSID = @(#)DEVSYM.ASM 1.10 85/09/04
3; SCCSID = @(#)DEVSYM.ASM 1.10 85/09/04
4
5; THE DEVICE TABLE LIST HAS THE FORM:
6SYSDEV STRUC
7SDEVNEXT DD ? ;POINTER TO NEXT DEVICE HEADER
8SDEVATT DW ? ;ATTRIBUTES OF THE DEVICE
9SDEVSTRAT DW ? ;STRATEGY ENTRY POINT
10SDEVINT DW ? ;INTERRUPT ENTRY POINT
11SDEVNAME DB 8 DUP (?) ;NAME OF DEVICE (ONLY FIRST BYTE USED FOR BLOCK)
12SYSDEV ENDS
13
14;
15; ATTRIBUTE BIT MASKS
16;
17; CHARACTER DEVICES:
18;
19; BIT 15 -> MUST BE 1
20; 14 -> 1 IF THE DEVICE UNDERSTANDS IOCTL CONTROL STRINGS
21; 13 -> 1 IF THE DEVICE SUPPORTS OUTPUT-UNTIL-BUSY
22; 12 -> UNUSED
23; 11 -> 1 IF THE DEVICE UNDERSTANDS OPEN/CLOSE
24; 10 -> MUST BE 0
25; 9 -> MUST BE 0
26; 8 -> UNUSED
27; 7 -> UNUSED
28; 6 -> UNUSED
29; 5 -> UNUSED
30; 4 -> 1 IF DEVICE IS RECIPIENT OF INT 29H
31; 3 -> 1 IF DEVICE IS CLOCK DEVICE
32; 2 -> 1 IF DEVICE IS NULL DEVICE
33; 1 -> 1 IF DEVICE IS CONSOLE OUTPUT
34; 0 -> 1 IF DEVICE IS CONSOLE INPUT
35;
36; BLOCK DEVICES:
37;
38; BIT 15 -> MUST BE 0
39; 14 -> 1 IF THE DEVICE UNDERSTANDS IOCTL CONTROL STRINGS
40; 13 -> 1 IF THE DEVICE DETERMINES MEDIA BY EXAMINING THE FAT ID BYTE.
41; THIS REQUIRES THE FIRST SECTOR OF THE FAT TO *ALWAYS* RESIDE IN
42; THE SAME PLACE.
43; 12 -> UNUSED
44; 11 -> 1 IF THE DEVICE UNDERSTANDS OPEN/CLOSE/REMOVABLE MEDIA
45; 10 -> MUST BE 0
46; 9 -> MUST BE 0
47; 8 -> UNUSED
48; 7 -> UNUSED
49; 6 -> IF DEVICE HAS SUPPORT FOR GETMAP/SETMAP OF LOGICAL DRIVES.
50; IF THE DEVICE UNDERSTANDS GENERIC IOCTL FUNCTION CALLS.
51; 5 -> UNUSED
52; 4 -> UNUSED
53; 3 -> UNUSED
54; 2 -> UNUSED
55; 1 -> UNUSED
56; 0 -> UNUSED
57;
58
59DEVTYP EQU 8000H ; BIT 15 - 1 IF CHAR, 0 IF BLOCK
60CHARDEV EQU 8000H
61DEVIOCTL EQU 4000H ; BIT 14 - CONTROL MODE BIT
62ISFATBYDEV EQU 2000H ; BIT 13 - DEVICE USES FAT ID BYTES,
63 ; COMP MEDIA.
64OUTTILBUSY EQU 2000H ; OUTPUT UNTIL BUSY IS ENABLED
65ISNET EQU 1000H ; BIT 12 - 1 IF A NET DEVICE, 0 IF
66 ; NOT. CURRENTLY BLOCK ONLY.
67DEVOPCL EQU 0800H ; BIT 11 - 1 IF THIS DEVICE HAS
68 ; OPEN,CLOSE AND REMOVABLE MEDIA
69 ; ENTRY POINTS, 0 IF NOT
70
71EXTENTBIT EQU 0400H ; BIT 10 - CURRENTLY 0 ON ALL DEVS
72 ; THIS BIT IS RESERVED FOR FUTURE USE
73 ; TO EXTEND THE DEVICE HEADER BEYOND
74 ; ITS CURRENT FORM.
75
76; NOTE BIT 9 IS CURRENTLY USED ON IBM SYSTEMS TO INDICATE "DRIVE IS SHARED".
77; SEE IOCTL FUNCTION 9. THIS USE IS NOT DOCUMENTED, IT IS USED BY SOME
78; OF THE UTILITIES WHICH ARE SUPPOSED TO FAIL ON SHARED DRIVES ON SERVER
79; MACHINES (FORMAT,CHKDSK,RECOVER,..).
80
81DEV320 EQU 0040H ;BIT 6 - FOR BLOCK DEVICES, THIS
82 ;DEVICE SUPPORTS SET/GET MAP OF
83 ;LOGICAL DRIVES, AND SUPPORTS
84 ;GENERIC IOCTL CALLS.
85 ;FOR CHARACTER DEVICES, THIS
86 ;DEVICE SUPPORTS GENERIC IOCTL.
87 ;THIS IS A DOS 3.2 DEVICE DRIVER.
88ISSPEC EQU 0010H ;BIT 4 - THIS DEVICE IS SPECIAL
89ISCLOCK EQU 0008H ;BIT 3 - THIS DEVICE IS THE CLOCK DEVICE.
90ISNULL EQU 0004H ;BIT 2 - THIS DEVICE IS THE NULL DEVICE.
91ISCOUT EQU 0002H ;BIT 1 - THIS DEVICE IS THE CONSOLE OUTPUT.
92ISCIN EQU 0001H ;BIT 0 - THIS DEVICE IS THE CONSOLE INPUT.
93EXTDRVR EQU 0002H ;BIT 1 - BLOCK DEVICE EXTNDED DRIVER
94
95;STATIC REQUEST HEADER
96SRHEAD STRUC
97REQLEN DB ? ;LENGTH IN BYTES OF REQUEST BLOCK
98REQUNIT DB ? ;DEVICE UNIT NUMBER
99REQFUNC DB ? ;TYPE OF REQUEST
100REQSTAT DW ? ;STATUS WORD
101 DB 8 DUP(?) ;RESERVED FOR QUEUE LINKS
102SRHEAD ENDS
103
104;STATUS WORD MASKS
105STERR EQU 8000H ;BIT 15 - ERROR
106STBUI EQU 0200H ;BIT 9 - BUISY
107STDON EQU 0100H ;BIT 8 - DONE
108STECODE EQU 00FFH ;ERROR CODE
109; 2/12/KK
110; Interim character identifier 2/12/KK
111Ddkey EQU 0000010000000000B ; 2/12/KK
112
113;FUNCTION CODES
114DEVINIT EQU 0 ;INITIALIZATION
115DINITHL EQU 26 ;SIZE OF INIT HEADER
116DEVMDCH EQU 1 ;MEDIA CHECK
117DMEDHL EQU 15 ;SIZE OF MEDIA CHECK HEADER
118DEVBPB EQU 2 ;GET BPB
119DEVRDIOCTL EQU 3 ;IOCTL READ
120DBPBHL EQU 22 ;SIZE OF GET BPB HEADER
121DEVRD EQU 4 ;READ
122DRDWRHL EQU 22 ;SIZE OF RD/WR HEADER
123DEVRDND EQU 5 ;NON DESTRUCTIVE READ NO WAIT (CHARACTER DEVS)
124DRDNDHL EQU 14 ;SIZE OF NON DESTRUCTIVE READ HEADER
125DEVIST EQU 6 ;INPUT STATUS
126DSTATHL EQU 13 ;SIZE OF STATUS HEADER
127DEVIFL EQU 7 ;INPUT FLUSH
128DFLSHL EQU 15 ;SIZE OF FLUSH HEADER
129DEVWRT EQU 8 ;WRITE
130DEVWRTV EQU 9 ;WRITE WITH VERIFY
131DEVOST EQU 10 ;OUTPUT STATUS
132DEVOFL EQU 11 ;OUTPUT FLUSH
133DEVWRIOCTL EQU 12 ;IOCTL WRITE
134DEVOPN EQU 13 ;DEVICE OPEN
135DEVCLS EQU 14 ;DEVICE CLOSE
136DOPCLHL EQU 13 ;SIZE OF OPEN/CLOSE HEADER
137DEVRMD EQU 15 ;REMOVABLE MEDIA
138REMHL EQU 13 ;SIZE OF REMOVABLE MEDIA HEADER
139GENIOCTL EQU 19
140; THE NEXT THREE ARE USED IN DOS 4.0
141; 20
142; 21
143; 22
144DEVGETOWN EQU 23 ;GET DEVICE OWNER
145DEVSETOWN EQU 24 ;SET DEVICE OWNER
146OWNHL EQU 13 ;SIZE OF DEVICE OWNER HEADER
147
148DEVOUT EQU 16 ; OUTPUT UNTIL BUSY.
149DEVOUTL EQU DEVWRT ; LENGTH OF OUTPUT UNTIL BUSY
150
151; GENERIC IOCTL REQUEST STRUCTURE
152; SEE THE DOS 4.0 DEVICE DRIVER SPEC FOR FURTHER ELABORATION.
153;
154IOCTL_REQ STRUC
155 DB (SIZE SRHEAD) DUP(?)
156 ; GENERIC IOCTL ADDITION.
157MAJORFUNCTION DB ? ;FUNCTION CODE
158MINORFUNCTION DB ? ;FUNCTION CATEGORY
159REG_SI DW ?
160REG_DI DW ?
161GENERICIOCTL_PACKET DD ? ; POINTER TO DATA BUFFER
162IOCTL_REQ ENDS
163
164; DEFINITIONS FOR IOCTL_REQ.MINORFUNCTION
165GEN_IOCTL_WRT_TRK EQU 40H
166GEN_IOCTL_RD_TRK EQU 60H
167GEN_IOCTL_FN_TST EQU 20H ; USED TO DIFF. BET READS AND WRTS
168
169;; 32-bit absolute read/write input list structure
170
171ABS_32RW STRUC
172SECTOR_RBA DD ? ; relative block address
173ABS_RW_COUNT DW ? ; number of sectors to be transferred
174BUFFER_ADDR DD ? ; data addrress
175ABS_32RW ENDS
176
177;; media ID info
178
179MEDIA_ID_INFO STRUC
180MEDIA_level DW 0 ; info level
181MEDIA_Serial DD 0 ; serial #
182MEDIA_Label DB 11 dup (' ') ;volume label
183MEDIA_System DB 8 dup (' ') ;system type
184MEDIA_ID_INFO ENDS
185
186;; equates for DOS34_FLAG
187
188IFS_ABSRW EQU 00001H ;IFS absolute read/write
189NO_IFS_ABSRW EQU 0FFFEH ;no IFS absolute read/write
190IFS_DRIVE_RESET EQU 00002H ;IFS drvive reset
191NO_IFS_DRIVE_RESET EQU 0FFFDH ;no IFS drive reset
192FROM_DISK_RESET EQU 00004H ;from disk reset
193NO_FROM_DISK_RESET EQU 0FFFBH ;not from disk reset
194From_String_Output EQU 00008H ;from con string output
195NO_From_String_Output EQU 0FFF7H ;not from con string output
196From_DOS_WRITE EQU 00010H ;from dos_write
197NO_From_DOS_WRITE EQU 0FFEFH ;not from dos_write
198Force_I24_Fail EQU 00020H ;form IFS CALL BACK
199NO_Force_I24_Fail EQU 0FFDFH ;not form IFS CALL BACK
200Disable_EOF_I24 EQU 00040H ;disable EOF int24 for input status
201NO_Disable_EOF_I24 EQU 0FFBFH ;disable EOF int24 for input status
202DBCS_VOLID EQU 00080H ;indicate from volume id
203DBCS_VOLID2 EQU 00100H ;indicate 8th char is DBCS
204CTRL_BREAK_FLAG EQU 00200H ;indicate control break is input
205NO_CTRL_BREAK_FLAG EQU 0FDFFH ;reset control break
206SEARCH_FASTOPEN EQU 00400H ;set fastopen flag for search
207X25_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 @@
1; SCCSID = @(#)dirent.asm 1.1 85/04/10
2; SCCSID = @(#)dirent.asm 1.1 85/04/10
3Break <Directory entry>
4
5;
6; +---------------------------+
7; | (12 BYTE) filename/ext | 0 0
8; +---------------------------+
9; | (BYTE) attributes | 11 B
10; +---------------------------+
11; | (10 BYTE) reserved | 12 C
12; +---------------------------+
13; | (WORD) time of last write | 22 16
14; +---------------------------+
15; | (WORD) date of last write | 24 18
16; +---------------------------+
17; | (WORD) First cluster | 26 1A
18; +---------------------------+
19; | (DWORD) file size | 28 1C
20; +---------------------------+
21;
22; First byte of filename = E5 -> free directory entry
23; = 00 -> end of allocated directory
24; Time: Bits 0-4=seconds/2, bits 5-10=minute, 11-15=hour
25; Date: Bits 0-4=day, bits 5-8=month, bits 9-15=year-1980
26;
27
28dir_entry STRUC
29dir_name DB 11 DUP (?) ; file name
30dir_attr DB ? ; attribute bits
31dir_codepg dw ? ; code page DOS 4.00
32dir_extcluster dw ? ; extended attribute starting cluster
33dir_attr2 db ? ; reserved
34dir_pad DB 5 DUP (?) ; reserved for expansion
35dir_time DW ? ; time of last write
36dir_date DW ? ; date of last write
37dir_first DW ? ; first allocation unit of file
38dir_size_l DW ? ; low 16 bits of file size
39dir_size_h DW ? ; high 16 bits of file size
40dir_entry ENDS
41
42attr_read_only EQU 1h
43attr_hidden EQU 2h
44attr_system EQU 4h
45attr_volume_id EQU 8h
46attr_directory EQU 10h
47attr_archive EQU 20h
48attr_device EQU 40h ; This is a VERY special bit.
49 ; NO directory entry on a disk EVER
50 ; has this bit set. It is set non-zero
51 ; when a device is found by GETPATH
52
53attr_all EQU attr_hidden+attr_system+attr_directory
54 ; OR of hard attributes for FINDENTRY
55
56attr_ignore EQU attr_read_only+attr_archive+attr_device
57 ; ignore this(ese) attribute(s) during
58 ; search first/next
59
60attr_changeable EQU attr_read_only+attr_hidden+attr_system+attr_archive
61 ; 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 @@
1; THIS IS THE ONLY DOS "MESSAGE". IT DOES NOT NEED A TERMINATOR.
2 PUBLIC DIVMES
3Public DIVM001S,DIVM001E
4DIVM001S label byte
5
6include msdos.cl1
7
8 PUBLIC DivMesLen
9DivMesLen DW $-DivMes ; Length of the above message in bytes
10DIVM001E label byte
11 \ 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 @@
1;
2;Equates for COUNTRY INFORMATION.
3SetCountryInfo EQU 1 ;country info
4SetUcase EQU 2 ;uppercase table
5SetLcase EQU 3 ;lowercase table (Reserved)
6SetUcaseFile EQU 4 ;uppercase file spec table
7SetFileList EQU 5 ;valid file character list
8SetCollate EQU 6 ;collating sequence
9SetDBCS EQU 7 ;double byte character set
10SetALL EQU -1 ;all the entries
11
12
13;DOS country and code page information table structure.
14;Internally, DOS gives a pointer to this table.
15;IBMBIO, MODE and NLSFUNC modules communicate with DOS through
16;this structure.
17DOS_country_cdpg_info struc
18ccInfo_reserved db 8 dup (?) ;reserved for internal use
19ccPath_CountrySys db 64 dup (0);path and filename for country info
20ccSysCodePage dw 0 ;system code page id
21ccNumber_of_entries dw 6 ; 6 entries
22ccSetUcase db SetUcase
23ccUcase_ptr dd ? ;pointer to Ucase table
24
25ccSetUcaseFile db SetUcaseFile
26ccFileUcase_ptr dd ? ;pointer to File Ucase table
27
28ccSetFileList db SetFileList
29ccFileChar_ptr dd ? ;pointer to File char list table
30
31ccSetCollate db SetCollate
32ccCollate_ptr dd ? ;pointer to collate table
33
34ccSetDBCS db SetDBCS
35ccDBCS_ptr dd ? ;pointer to DBCS table
36
37ccSetCountryInfo db SetCountryInfo
38ccCountryInfoLen dw ? ;length of country info
39ccDosCountry dw ? ;active country code id
40ccDosCodePage dw ? ;active code page id
41ccDFormat dw ? ;date format
42ccCurSymbol db " ",0;5 byte of (currency symbol+0)
43cc1000Sep db " ",0 ;2 byte of (1000 sep. + 0)
44ccDecSep db " ",0 ;2 byte of (Decimal sep. + 0)
45ccDateSep db " ",0 ;2 byte of (date sep. + 0)
46ccTimeSep db " ",0 ;2 byte of (time sep. + 0)
47ccCFormat db ? ;currency format flags
48ccCSigDigits db ? ;# of digits in currency
49ccTFormat db ? ;time format
50ccMono_Ptr dd ? ;monocase routine entry point
51ccListSep db " ",0 ;data list separator
52ccReserved_area dw 5 dup(?);reserved
53
54DOS_country_cdpg_info ends
55
56;Ucase table
57CC_UCASE_TAB struc
58ccUcase_leng dw 128
59ccUcase_data db 128 dup (?)
60CC_UCASE_TAB ends
61
62;File Ucase table
63CC_FILE_UCASE_TAB struc
64ccFileucase_leng dw 128
65ccFileucase_data db 128 dup (?)
66CC_FILE_UCASE_TAB ends
67
68;File char list
69CC_FILE_CHAR_TAB struc
70ccFilechar_leng dw ?
71ccFilechar_data db 46 dup (?)
72CC_FILE_CHAR_TAB ends
73
74;collate table
75CC_COLLATE_TAB struc
76ccCollate_leng dw 256
77ccCollate_data db 256 dup (?)
78CC_COLLATE_TAB ends
79
80;DBCS table - for DOS 4.00
81CC_DBCS_TAB struc
82ccDBCS_leng dw 6
83ccDBCS_data db 6 dup (?)
84CC_DBCS_TAB ends
85
86; 2/12/KK
87; Define subfunctions of ECS_call ( 63H ) 2/12/KK
88; 2/12/KK
89GetLeadBTBL EQU 0 ; 2/12/KK
90SetInterimMode EQU 1 ; 2/12/KK
91GetInterimMode EQU 2 ; 2/12/KK
92 ; 2/12/KK
93NonInterimMode EQU 0 ; 2/12/KK
94InterimMode EQU 1 ; 2/12/KK
95
96OLD_COUNTRY_SIZE equ (type DOS_country_cdpg_info - ccDFormat - 10)
97NEW_COUNTRY_SIZE equ (type DOS_country_cdpg_info - ccDosCountry)
98
99;CAPITALIZATION equates
100CAP_ONE_CHAR equ 20H
101CAP_STRING equ 21H
102CAP_ASCIIZ equ 22H
103CHECK_YES_NO equ 23H
104UPPER_TABLE equ 80H
105
106;NLS_YES equ 59H
107;NLS_yes2 equ 79H
108;NLS_NO equ 4EH
109;NLS_no2 equ 6EH
110
111
112
113
114
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 @@
1; SCCSID = @(#)dosmac.asm 1.1 85/04/10
2; SCCSID = @(#)dosmac.asm 1.1 85/04/10
3;
4; Macro file for MSDOS.
5;
6
7TRUE EQU 0FFFFh
8FALSE EQU 0
9
10SUBTTL BREAK a listing into pages and give new subtitles
11PAGE
12BREAK MACRO subtitle
13 SUBTTL subtitle
14 PAGE
15ENDM
16.xcref break
17
18BREAK <ASMVAR - handle assembly variables once and for all>
19
20AsmVars Macro varlist
21IRP var,<varlist>
22AsmVar var
23ENDM
24ENDM
25
26AsmVar Macro var
27IFNDEF var
28var = FALSE
29ENDIF
30ENDM
31
32BREAK <I_NEED: declare a variable external, if necessary, and allocate a size>
33
34;
35; declare a variable external and allocate a size
36;
37AsmVar InstalledData
38I_NEED MACRO sym,len
39IF NOT InstalledData
40 DATA SEGMENT WORD PUBLIC 'DATA'
41 IFIDN <len>,<WORD>
42 EXTRN &sym:WORD
43 ELSE
44 IFIDN <len>,<DWORD>
45 EXTRN &sym:DWORD
46 ELSE
47 EXTRN &sym:BYTE
48 ENDIF
49 ENDIF
50 DATA ENDS
51ENDIF
52ENDM
53 .xcref I_need
54
55;
56; call a procedure that may be external. The call will be short.
57;
58invoke MACRO name
59.xcref
60 IF2
61 IFNDEF name
62 EXTRN name:NEAR
63 ENDIF
64 ENDIF
65.cref
66 CALL name
67ENDM
68.xcref invoke
69
70PAGE
71;
72; jump to a label that may be external. The jump will be near.
73;
74transfer MACRO name
75.xcref
76 IF2
77 IFNDEF name
78 EXTRN name:NEAR
79 ENDIF
80 ENDIF
81.cref
82 JUMP name
83ENDM
84.xcref transfer
85
86;
87; get a short address in a word
88;
89short_addr MACRO name
90 IFDIF <name>,<?>
91.xcref
92 IF2
93 IFNDEF name
94 EXTRN name:NEAR
95 ENDIF
96 ENDIF
97.cref
98 DW OFFSET DOSGROUP:name
99 ELSE
100 DW ?
101 ENDIF
102ENDM
103.xcref short_addr
104
105;
106; get a long address in a dword
107;
108long_addr MACRO name
109.xcref
110 IF2
111 IFNDEF name
112 EXTRN name:NEAR
113 ENDIF
114 ENDIF
115.cref
116 DD name
117ENDM
118.xcref long_addr
119
120;
121; declare a PROC near or far but PUBLIC nonetheless
122;
123.xcref ?frame
124.xcref ?aframe
125.xcref ?stackdepth
126.xcref ?initstack
127?frame = 0 ; initial
128?aframe = 0 ; initial
129?stackdepth = 0 ; initial stack size
130?initstack = 0 ; initial stack size
131
132procedure MACRO name,distance
133 ?frame = 0
134 ?aframe = 2 ;; remember the pushed BP
135 PUBLIC name
136 IF1
137 %OUT name... pass 1
138 ENDIF
139 IF2
140 %OUT name... pass 2
141 ENDIF
142name PROC distance
143 ?initstack = ?stackdepth ;; beginning of procedure
144ENDM
145.xcref procedure
146
147;
148; end a procedure and check that stack depth is preserved
149;
150EndProc MACRO name, chk
151 IFDIF <chk>,<NoCheck> ;; check the stack size
152 IF2
153 IF ?initstack NE ?stackdepth ;; is it different?
154 %OUT ***** Possible stack size error in name *****
155 ENDIF
156 ENDIF
157 ENDIF
158name ENDP
159ENDM
160.xcref endproc
161PAGE
162;
163; define a data item to be public and of an appropriate size/type
164;
165
166I_AM MACRO name,size,init
167;; declare the object public
168 PUBLIC name
169;; declare the type of the object
170 IFIDN <size>,<WORD>
171name LABEL WORD
172 I_AM_SIZE = 1
173 I_AM_LEN = 2
174 ELSE
175 IFIDN <size>,<DWORD>
176name LABEL DWORD
177 I_AM_SIZE = 2
178 I_AM_LEN = 2
179 ELSE
180 IFIDN <size>,<BYTE>
181name LABEL BYTE
182 I_AM_SIZE = 1
183 I_AM_LEN = 1
184 ELSE
185name LABEL BYTE
186 I_AM_SIZE = size
187 I_AM_LEN = 1
188 ENDIF
189 ENDIF
190 ENDIF
191;; if no initialize then allocate blank storage
192 IFB <init>
193 DB I_AM_SIZE*I_AM_LEN DUP (?)
194 ELSE
195IF NOT InstalledData
196 IRP itm,<init>
197 IF I_AM_LEN EQ 1
198 DB itm
199 ELSE
200 DW itm
201 ENDIF
202 I_AM_SIZE = I_AM_SIZE - 1
203 ENDM
204 IF I_AM_SIZE NE 0
205 %out ***** initialization of name not complete *****
206 ENDIF
207ELSE
208 DB I_AM_SIZE*I_AM_LEN DUP (?)
209ENDIF
210 ENDIF
211ENDM
212.xcref I_AM
213.xcref I_AM_SIZE
214.xcref I_AM_LEN
215I_AM_SIZE = 0
216I_AM_LEN = 0
217
218PAGE
219
220;
221; define an entry in a procedure
222;
223entry macro name
224 PUBLIC name
225name:
226endm
227.xcref entry
228
229BREAK <ERROR - store an error code then jump to a label>
230
231error macro code
232.xcref
233 MOV AL,code
234 transfer SYS_RET_ERR
235.cref
236ENDM
237.xcref error
238
239BREAK <JUMP - real jump that links up shortwise>
240;
241; given a label <lbl> either 2 byte jump to another label <lbl>_J
242; if it is near enough or 3 byte jump to <lbl>
243;
244
245jump macro lbl
246 local a
247.xcref
248
249 ifndef lbl&_J ;; is this the first invocation
250a: JMP lbl
251 ELSE
252 IF (lbl&_J GE $) OR ($-lbl&_J GT 126)
253a: JMP lbl ;; is the jump too far away?
254 ELSE
255a: JMP lbl&_J ;; do the short one...
256 ENDIF
257 ENDIF
258 lbl&_j = a
259.cref
260endm
261.xcref jump
262
263BREAK <RETURN - return from a function>
264
265return macro x
266 local a
267.xcref
268a:
269 RET
270ret_l = a
271.cref
272endm
273.xcref return
274
275BREAK <CONDRET - conditional return>
276
277condret macro cc,ncc
278 local a
279.xcref
280.xcref a
281.cref
282 ifdef ret_l ;; if ret_l is defined
283 if (($ - ret_l) le 126) and ($ gt ret_l)
284 ;; if ret_l is near enough then
285 a: j&cc ret_l ;; a: j<CC> to ret_l
286 ret_&cc = a ;; define ret_<CC> to be a:
287 exitm
288 endif
289 endif
290 ifdef ret_&cc ;; if ret_<CC> defined
291 if (($ - ret_&cc) le 126) and ($ gt ret_&cc)
292 ;; if ret_<CC> is near enough
293 a: j&cc ret_&cc ;; a: j<CC> to ret_<CC>
294 ret_&cc = a ;; define ret_<CC> to be a:
295 exitm
296 endif
297 endif
298 j&ncc a ;; j<NCC> a:
299 return ;; return
300 a: ;; a:
301 ret_&cc = ret_l ;; define ret_<CC> to be ret_l
302endm
303.xcref condret
304
305BREAK <RETZ - return if zero, links up shortwise if necessary>
306
307retz macro
308 condret z,nz
309endm
310.xcref retz
311
312BREAK <RETNZ - return if not zero, links up shortwise if necessary>
313
314retnz macro
315 condret nz,z
316endm
317.xcref retnz
318
319BREAK <RETC - return if carry set, links up shortwise if necessary>
320
321retc macro
322 condret c,nc
323endm
324.xcref retc
325
326BREAK <RETNC - return if not carry, links up shortwise if necessary>
327
328retnc macro
329 condret nc,c
330endm
331.xcref retnc
332
333BREAK <CONTEXT - set the DOS context to a particular register>
334
335context macro r
336 PUSH SS
337 POP r
338 ASSUME r:DOSGROUP
339endm
340.xcref context
341
342BREAK <SaveReg - save a set of registers>
343
344SaveReg MACRO reglist ;; push those registers
345IRP reg,<reglist>
346 ?stackdepth = ?stackdepth + 1
347 PUSH reg
348ENDM
349ENDM
350.xcref SaveReg
351
352BREAK <RestoreReg - unsave some registers>
353
354RestoreReg MACRO reglist ;; pop those registers
355IRP reg,<reglist>
356 ?stackdepth = ?stackdepth - 1
357 POP reg
358ENDM
359ENDM
360.xcref RestoreReg
361
362BREAK <Critical section macros>
363
364EnterCrit MACRO section
365 Invoke E&section
366ENDM
367
368LeaveCrit MACRO section
369 Invoke L&section
370ENDM
371
372Break <message - display a message>
373
374AsmVars <ShareF,Cargs,Redirector>
375
376if debug
377fmt MACRO typ,lev,fmts,args
378local a,b,c
379 PUSHF
380IFNB <typ>
381 TEST BugTyp,typ
382 JZ c
383 CMP BugLev,lev
384 JB c
385ENDIF
386 PUSH AX
387 PUSH BP
388 MOV BP,SP
389If (not sharef) and (not redirector)
390Table segment
391a db fmts,0
392Table ends
393 MOV AX,OFFSET DOSGROUP:a
394else
395 jmp short b
396a db fmts,0
397if sharef
398b: mov ax,offset share:a
399else
400b: mov ax,offset netwrk:a
401endif
402endif
403 PUSH AX
404cargs = 2
405IRP item,<args>
406IFIDN <AX>,<item>
407 MOV AX,[BP+2]
408ELSE
409 MOV AX,item
410ENDIF
411 PUSH AX
412cargs = cargs + 2
413ENDM
414 invoke PFMT
415 ADD SP,Cargs
416 POP BP
417 POP AX
418c:
419 POPF
420ENDM
421else
422fmt macro
423endm
424endif
425
426Break <DOSAssume - validate assumes>
427
428AsmVar Debug,$temp
429
430IF debug
431DOSAssume Macro reg,reglist,message
432local a,b
433 IFIDN <reg>,<CS>
434 $temp = 1
435 ELSE
436 IFIDN <reg>,<SS>
437 $temp = 0
438 ELSE
439 %out ***** Invalid DOS register reg in DOSAssume *****
440 ENDIF
441 ENDIF
442 IRP r,<reglist>
443 IFIDN <r>,<DS>
444 $temp = $temp OR 2
445 ELSE
446 IFIDN <r>,<ES>
447 $temp = $temp OR 4
448 ELSE
449 %out ***** Invalid register reg in DOSAssume *****
450 ENDIF
451 ENDIF
452 ENDM
453 PUSH AX
454 MOV AX,$temp
455 PUSH AX
456IF SHAREF
457 MOV AX,OFFSET a
458ELSE
459 MOV AX,OFFSET DOSGroup:a
460ENDIF
461 PUSH AX
462 Invoke SegCheck
463 POP AX
464IF NOT SHAREF
465Table SEGMENT
466a DB message,0
467Table ends
468ELSE
469 JMP SHORT a
470b DB message,0
471a:
472ENDIF
473IRP r,<reglist>
474 ASSUME r:DOSGroup
475ENDM
476ENDM
477ELSE
478DOSAssume Macro reg,reglist,message
479IRP r,<reglist>
480 ASSUME r:DOSGroup
481ENDM
482ENDM
483ENDIF
484
485BREAK <ASSERT - make assertions about registers>
486
487IF DEBUG
488Assert MACRO kind, objs, message
489 LOCAL a,b
490 IFIDN <kind>,<Z>
491 CMP objs,0
492 JZ a
493 fmt <>,<>,<message>
494a:
495 ELSE
496 IFIDN <kind>,<NZ>
497 CMP objs,0
498 JNZ a
499 fmt <>,<>,<message>
500a:
501 ELSE
502 PUSH AX
503 IRP obj,<objs>
504 PUSH obj
505 ENDM
506 IF SHAREF
507 MOV AX,OFFSET b
508 ELSE
509 MOV AX,OFFSET DOSGroup:b
510 ENDIF
511 PUSH AX
512 IFIDN <kind>,<ISBUF>
513 Invoke BUFCheck
514 ENDIF
515 IFIDN <kind>,<ISSFT>
516 Invoke SFTCheck
517 ENDIF
518 IFIDN <kind>,<ISDPB>
519 Invoke DPBCheck
520 ENDIF
521 POP AX
522 IF SHAREF
523 JMP SHORT a
524b DB Message,0
525a:
526 ELSE
527Table segment
528b db Message,0
529Table ends
530 ENDIF
531 ENDIF
532 ENDIF
533ENDM
534ELSE
535Assert Macro
536ENDM
537ENDIF
538
539Break <CallInstall - hook to installable pieces>
540
541CallInstall MACRO name,mpx,fn,save,restore
542IF Installed
543 IFNB <save>
544 SaveReg <save>
545 ENDIF
546 MOV AX,(mpx SHL 8) + fn
547 INT 2Fh
548 IFNB <restore>
549 RestoreReg <restore>
550 ENDIF
551ELSE
552 Invoke name
553ENDIF
554ENDM
555
556Break <Stack frame manipulators>
557
558localvar macro name,length
559local a
560 ifidn <length>,<BYTE>
561 ?frame = ?frame + 1
562 a = ?frame
563 name EQU BYTE PTR [BP-a]
564 else
565 ifidn <length>,<WORD>
566 ?frame = ?frame + 2
567 a = ?frame
568 name EQU WORD PTR [BP-a]
569 else
570 ifidn <length>,<DWORD>
571 ?frame = ?frame + 4
572 a = ?frame
573 name EQU DWORD PTR [BP-a]
574 name&l EQU WORD PTR [BP-a]
575 name&h EQU WORD PTR [BP-a+2]
576 else
577 ?frame = ?frame + length
578 a = ?frame
579 name EQU BYTE PTR [BP-a]
580 endif
581 endif
582 endif
583endm
584
585enter macro
586 push bp
587 mov bp,sp
588 sub sp,?frame
589endm
590
591leave macro
592 mov sp,bp
593 pop bp
594endm
595
596Argvar macro name,length
597local a
598 ifidn <length>,<BYTE>
599 a = ?aframe
600 ?aframe = ?aframe + 1
601 name EQU BYTE PTR [BP+a]
602 else
603 ifidn <length>,<WORD>
604 a = ?aframe
605 ?aframe = ?aframe + 2
606 name EQU WORD PTR [BP+a]
607 else
608 ifidn <length>,<DWORD>
609 a = ?aframe
610 ?aframe = ?aframe + 4
611 name EQU DWORD PTR [BP+a]
612 name&l EQU WORD PTR [BP+a]
613 name&h EQU WORD PTR [BP+a+2]
614 else
615 a = ?aframe
616 ?aframe = ?aframe + length
617 name EQU BYTE PTR [BP+a]
618 endif
619 endif
620 endif
621endm
622
623BREAK <errnz - generate compilation errors>
624
625errnz macro x
626if x NE 0
627 %out ***** FATAL error: x <> 0
628foobar
629endif
630endm
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 @@
1; SCCSID = @(#)dosseg.asm 1.1 85/04/10
2; SCCSID = @(#)dosseg.asm 1.1 85/04/10
3;
4; segment ordering for MSDOS
5;
6
7START SEGMENT BYTE PUBLIC 'START'
8START ENDS
9
10CONSTANTS SEGMENT WORD PUBLIC 'CONST'
11CONSTANTS ENDS
12
13DATA SEGMENT WORD PUBLIC 'DATA'
14DATA ENDS
15
16TABLE SEGMENT BYTE PUBLIC 'TABLE'
17TABLE ENDS
18
19CODE SEGMENT BYTE PUBLIC 'CODE'
20CODE ENDS
21
22LAST SEGMENT PARA PUBLIC 'LAST'
23LAST ENDS
24
25DOSGROUP 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 @@
1; SCCSID = @(#)dossym.asm 1.1 85/04/10
2; SCCSID = @(#)dossym.asm 1.1 85/04/10
3 PAGE 80,132
4TRUE EQU 0FFFFh
5FALSE EQU 0
6
7Installed = TRUE
8IFNDEF DEBUG
9 DEBUG = FALSE
10ENDIF
11
12include dbcs.sw
13include dosmac.INC
14
15include VERSIONA.INC
16
17IF2
18 %OUT DOSSYM in Pass 2
19ENDIF
20
21BREAK <Control character definitions>
22
23c_DEL EQU 7Fh ; ASCII rubout or delete previous char
24c_BS EQU 08h ; ^H ASCII backspace
25c_CR EQU 0Dh ; ^M ASCII carriage return
26c_LF EQU 0Ah ; ^J ASCII linefeed
27c_ETB EQU 17h ; ^W ASCII end of transmission
28c_NAK EQU 15h ; ^U ASCII negative acknowledge
29c_ETX EQU 03h ; ^C ASCII end of text
30c_HT EQU 09h ; ^I ASCII tab
31
32BREAK <Read This and Weep>
33
34;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
35; ;
36; C A V E A T P R O G R A M M E R ;
37; ;
38; Certain structures, constants and system calls below are private to ;
39; the DOS and are extremely version-dependent. They may change at any ;
40; time at the implementors' whim. As a result, they must not be ;
41; documented to the general public. If an extreme case arises, they ;
42; must be documented with this warning. ;
43; ;
44; Those structures and constants that are subject to the above will be ;
45; marked and bracketed with the flag: ;
46; ;
47; C A V E A T P R O G R A M M E R ;
48; ;
49;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
50
51include bpb.INC
52
53include buffer.INC
54
55BREAK <User stack inside of system call and SysVars>
56; Location of user registers relative user stack pointer
57
58user_environ STRUC
59user_AX DW ?
60user_BX DW ?
61user_CX DW ?
62user_DX DW ?
63user_SI DW ?
64user_DI DW ?
65user_BP DW ?
66user_DS DW ?
67user_ES DW ?
68user_IP DW ?
69user_CS DW ?
70user_F DW ?
71user_environ ENDS
72
73include sysvar.INC
74
75include vector.INC
76
77include mult.INC
78
79BREAK <Disk map>
80; MSDOS partitions the disk into 4 sections:
81;
82; phys sector 0: +-------------------+
83; | | boot/reserved |
84; | +-------------------+
85; | | File allocation |
86; v | table(s) |
87; | (multiple copies |
88; | are kept) |
89; +-------------------+
90; | Directory |
91; +-------------------+
92; | File space |
93; +-------------------+
94; | Unaddressable |
95; | (to end of disk) |
96; +-------------------+
97;
98; All partition boundaries are sector boundaries. The size of the FAT is
99; adjusted to maximize the file space addressable.
100
101include dirent.INC
102
103BREAK <File allocation Table information>
104;
105; The File Allocation Table uses a 12-bit entry for each allocation unit on
106; the disk. These entries are packed, two for every three bytes. The contents
107; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result
108; to the base address of the Allocation Table; 3) fetching the 16-bit word
109; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift
110; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex). Entry
111; number zero is used as an end-of-file trap in the OS and is passed to the
112; BIOS to help determine disk format. Entry 1 is reserved for future use.
113; The first available allocation unit is assigned entry number two, and even
114; though it is the first, is called cluster 2. Entries greater than 0FF8H
115; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero
116; are unallocated. Otherwise, the contents of a FAT entry is the number of
117; the next cluster in the file.
118;
119; Clusters with bad sectors are tagged with FF7H. Any non-zero number would
120; do because these clusters show as allocated, but are not part of any
121; allocation chain and thus will never be allocated to a file. A particular
122; number is selected so that disk checking programs know what to do (ie. a
123; cluster with entry FF7H which is not in a chain is not an error).
124
125include dpb.INC
126
127include curdir.INC
128
129include cpmfcb.INC
130
131include find.INC
132
133include pdb.INC
134
135include exe.INC
136
137include sf.INC
138
139include arena.INC
140
141include intnat.INC
142
143include mi.INC
144
145fChk equ 1
146fDelim equ 2
147fSpChk equ 4
148fFCB equ 8
149
150include filemode.INC
151
152include error.INC
153
154include syscall.INC
155
156SUBTTL
157 \ 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 @@
1/* dpb.c - retrieve DPB for physical drive */
2
3#include "types.h"
4#include "sysvar.h"
5#include "dpb.h"
6#include "cds.h"
7
8extern char NoMem[], ParmNum[], BadParm[] ;
9extern struct sysVarsType SysVars ;
10
11
12/* Walk the DPB list trying to find the appropriate DPB */
13
14long GetDPB(i)
15int i ;
16{
17 struct DPBType DPB ;
18 struct DPBType *pd = &DPB ;
19 struct DPBType far *dptr ;
20 int j ;
21
22 *(long *)(&dptr) = DPB.nextDPB = SysVars.pDPB ;
23 DPB.drive = -1 ;
24
25 while (DPB.drive != i) {
26 if ((int)DPB.nextDPB == -1)
27 return -1L ;
28
29 *(long *)(&dptr) = DPB.nextDPB ;
30
31 for (j=0 ; j < sizeof(DPB) ; j++)
32 *((char *)pd+j) = *((char far *)dptr+j) ;
33
34 } ;
35 return (long)dptr ;
36}
37
38 \ 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 @@
1; SCCSID = @(#)dpb.asm 1.1 85/04/10
2; SCCSID = @(#)dpb.asm 1.1 85/04/10
3BREAK <DPB structure>
4;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
5; C A V E A T P R O G R A M M E R ;
6; ;
7dpb STRUC
8dpb_drive DB ? ; Logical drive # assoc with DPB (A=0,B=1,...)
9dpb_UNIT DB ? ; Driver unit number of DPB
10dpb_sector_size DW ? ; Size of physical sector in bytes
11dpb_cluster_mask DB ? ; Sectors/cluster - 1
12dpb_cluster_shift DB ? ; Log2 of sectors/cluster
13dpb_first_FAT DW ? ; Starting record of FATs
14dpb_FAT_count DB ? ; Number of FATs for this drive
15dpb_root_entries DW ? ; Number of directory entries
16dpb_first_sector DW ? ; First sector of first cluster
17dpb_max_cluster DW ? ; Number of clusters on drive + 1
18dpb_FAT_size DW ? ;;Number of records occupied by FAT
19dpb_dir_sector DW ? ; Starting record of directory
20dpb_driver_addr DD ? ; Pointer to driver
21dpb_media DB ? ; Media byte
22dpb_first_access DB ? ; This is initialized to -1 to force a media
23 ; check the first time this DPB is used
24dpb_next_dpb DD ? ; Pointer to next Drive parameter block
25dpb_next_free DW ? ; Cluster # of last allocated cluster
26dpb_free_cnt DW ? ; Count of free clusters, -1 if unknown
27dpb ENDS
28
29DPBSIZ EQU SIZE dpb ; Size of the structure in bytes
30
31DSKSIZ = dpb_max_cluster ; Size of disk (temp used during init only)
32; ;
33; C A V E A T P R O G R A M M E R ;
34;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
35 \ 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 @@
1; SCCSID = @(#)dpl.asm 1.1 85/04/10
2; SCCSID = @(#)dpl.asm 1.1 85/04/10
3DPL STRUC
4DPL_AX DW ? ; AX register
5DPL_BX DW ? ; BX register
6DPL_CX DW ? ; CX register
7DPL_DX DW ? ; DX register
8DPL_SI DW ? ; SI register
9DPL_DI DW ? ; DI register
10DPL_DS DW ? ; DS register
11DPL_ES DW ? ; ES register
12DPL_reserved DW ? ; Reserved
13DPL_UID DW ? ; User (Machine) ID (0 = local macine)
14DPL_PID DW ? ; Process ID (0 = local user PID)
15DPL 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 @@
1;---Revised 8-17-84 FOR KBX (ADDED ADDITIONAL KEYBOARD FLAG - KB_FLAG_3)
2;----------------------------------------
3; 0286 INTERRUPT LOCATIONS (READ):
4;----------------------------------------
5ABS0 SEGMENT AT 0
6STG_LOC0 LABEL BYTE
7 ORG 2*4
8NMI_PTR LABEL WORD
9 ORG 5*4
10INT5_PTR LABEL WORD
11 ORG 8*4
12INT_ADDR LABEL WORD
13INT_PTR LABEL DWORD
14 ORG 10H*4
15VIDEO_INT LABEL WORD
16 ORG 13H*4 ; NEW FDISK
17ORG_VECTOR LABEL DWORD
18 ORG 18H*4
19BASIC_PTR LABEL WORD
20 ORG 19H*4
21BOOT_VEC LABEL DWORD
22BOOT_VECTOR LABEL DWORD
23 ORG 1DH*4
24PARM_PTR LABEL DWORD ; POINTER TO VIDEO PARMS
25 ORG 1EH*4
26DISK_POINTER LABEL DWORD
27 ORG 01FH*4
28EXT_PTR LABEL DWORD
29 ORG 40H*4 ; DISKETTE POINTER
30DISK_VECTOR LABEL DWORD
31 ORG 41H*4
32HF_TBL_VEC LABEL DWORD
33 ORG 46H*4
34HF1_TBL_VEC LABEL DWORD
35 ORG 70H*4
36SLAVE_INT_PTR LABEL DWORD
37RTC_INT_VEC LABEL DWORD ; REAL TIME CLOCK INT
38 ORG 76H*4 ; FIXED DISK INTERRUPT VECTOR
39HDISK_INT LABEL DWORD
40 ORG 400H
41DATA_AREA LABEL BYTE ;ABSOLUTE LOCATION OF DATA SEGMENT
42DATA_WORD LABEL WORD
43 ORG 0500H
44MFG_TEST_RTN LABEL FAR
45 ORG 7C00H
46BOOT_LOCN LABEL FAR
47ABS0 ENDS
48PAGE
49;------------------------------------------------
50; STACK -- USED DURING INITIALIZATION ONLY :
51;------------------------------------------------
52STACK SEGMENT AT 30H
53 DW 128 DUP(?)
54TOS LABEL WORD
55STACK ENDS
56;----------------------------------------
57; ROM BIOS DATA AREAS :
58;----------------------------------------
59DATA SEGMENT AT 40H
60;DATA_BASE LABEL BYTE
61RS232_BASE DW 4 DUP(?) ; ADDRESSES OF RS232 ADAPTERS
62PRINTER_BASE DW 4 DUP(?) ; ADDRESSES OF PRINTERS
63EQUIP_FLAG DW 1 DUP(?) ; INSTALLED HARDWARE
64MFG_TST DB 1 DUP(?) ; INITIALIZATION FLAG
65MEMORY_SIZE DW 1 DUP(?) ; MEMORY SIZE IN K BYTES
66MFG_ERR_FLAG DB 1 DUP(?) ; SCRATCHPAD FOR MANUFACTURING
67 DB 1 DUP(?) ; ERROR CODES
68PAGE
69;----------------------------------------
70; KEYBOARD DATA AREAS :
71;----------------------------------------
72KB_FLAG DB 1 DUP(?)
73KB_FLAG_1 DB 1 DUP(?) ; SECOND BYTE OF KEYBOARD STATUS
74ALT_INPUT DB 1 DUP(?) ; STORAGE FOR ALTERNATE KEYPAD ENTRY
75BUFFER_HEAD DW 1 DUP(?) ; POINTER TO HEAD OF KEYBOARD BUFFER
76BUFFER_TAIL DW 1 DUP(?) ; POINTER TO TAIL OF KEYBOARD BUFFER
77KB_BUFFER DW 16 DUP(?) ; ROOM FOR 15 ENTRIES
78KB_BUFFER_END LABEL WORD
79
80;------ HEAD = TAIL INDICATES THAT THE BUFFER IS EMPTY
81
82;----------------------------------------
83; DISKETTE DATA AREAS :
84;----------------------------------------
85SEEK_STATUS DB 1 DUP(?) ; DRIVE RECALIBRATION STATUS
86 ; BIT 3-0 = DRIVE 3-0 NEEDS RECAL
87 ; BEFORE NEXT SEEK IF BIT IS = 0
88MOTOR_STATUS DB 1 DUP(?) ; MOTOR STATUS
89 ; BIT 3-0 = DRIVE 3-0 IS CURRENTLY
90 ; RUNNING
91 ; BIT 7 = CURRENT OPERATION IS A WRITE,
92 ; REQUIRES DELAY
93MOTOR_COUNT DB 1 DUP(?) ; TIME OUT COUNTER FOR DRIVE TURN OFF
94DISKETTE_STATUS DB 1 DUP(?) ; RETURN CODE STATUS BYTE
95CMD_BLOCK LABEL BYTE
96HD_ERROR LABEL BYTE
97NEC_STATUS DB 7 DUP(?) ; STATUS BYTES FROM NEC
98PAGE
99;----------------------------------------
100; VIDEO DISPLAY DATA AREA :
101;----------------------------------------
102CRT_MODE DB 1 DUP(?) ; CURRENT CRT MODE
103CRT_COLS DW 1 DUP(?) ; NUMBER OF COLUMNS ON SCREEN
104CRT_LEN DW 1 DUP(?) ; LENGTH OF REGEN IN BYTES
105CRT_START DW 1 DUP(?) ; STARTING ADDRESS IN REGEN BUFFER
106CURSOR_POSN DW 8 DUP(?) ; CURSOR FOR EACH OF UP TO 8 PAGES
107CURSOR_MODE DW 1 DUP(?) ; CURRENT CURSOR MODE SETTING
108ACTIVE_PAGE DB 1 DUP(?) ; CURRENT PAGE BEING DISPLAYED
109ADDR_6845 DW 1 DUP(?) ; BASE ADDRESS FOR ACTIVE DISPLAY CARD
110CRT_MODE_SET DB 1 DUP(?) ; CURRENT SETTING OF THE 3X8 REGISTER
111CRT_PALLETTE DB 1 DUP(?) ; CURRENT PALLETTE SETTING COLOR CARD
112PAGE
113;----------------------------------------
114; POST DATA AREA :
115;----------------------------------------
116IO_ROM_INIT DW 1 DUP(?) ; PNTR TO OPTIONAL I/O ROM INIT ROUTINE
117IO_ROM_SEG DW 1 DUP(?) ; POINTER TO IO ROM SEGMENT
118INTR_FLAG DB 1 DUP(?) ; FLAG TO INDICATE AN INTERRUPT HAPPEND
119;----------------------------------------
120; TIMER DATA AREA :
121;----------------------------------------
122TIMER_LOW DW 1 DUP(?) ; LOW WORD OF TIMER COUNT
123TIMER_HIGH DW 1 DUP(?) ; HIGH WORD OF TIMER COUNT
124TIMER_OFL DB 1 DUP(?) ; TIMER HAS ROLLED OVER SINCE LAST READ
125;----------------------------------------
126; SYSTEM DATA AREA :
127;----------------------------------------
128BIOS_BREAK DB 1 DUP(?) ; BIT 7=1 IF BREAK KEY HAS BEEN HIT
129RESET_FLAG DW 1 DUP(?) ; WORD=1234H IF KEYBOARD RESET UNDERWAY
130PAGE
131;----------------------------------------
132; HARD FILE DATA AREAS :
133;----------------------------------------
134DISK_STATUS1 DB 1 DUP(?)
135HF_NUM DB 1 DUP(?)
136CONTROL_BYTE DB 1 DUP(?)
137PORT_OFF DB 1 DUP(?)
138;------------------------------------------------------
139; PRINTER AND RS232 TIME-OUT VARIABLES :
140;------------------------------------------------------
141PRINT_TIM_OUT DB 4 DUP(?)
142RS232_TIM_OUT DB 4 DUP(?)
143;----------------------------------------
144; ADDITIONAL KEYBOARD DATA AREA :
145;----------------------------------------
146BUFFER_START DW 1 DUP(?)
147BUFFER_END DW 1 DUP(?)
148;---------------------------------------
149; ADDITIONAL FLOPPY DATA ;
150;---------------------------------------
151 ORG 8BH
152LASTRATE DB 1 DUP(?) ; LAST DATA RATE SELECTED
153PAGE
154;---------------------------------------
155; ADDITIONAL HARD FILE DATA :
156;---------------------------------------
157 ORG 8CH
158HF_STATUS DB 1 DUP(?) ; STATUS REGISTER
159HF_ERROR DB 1 DUP(?) ; ERROR REGISTER
160HF_INT_FLAG DB 1 DUP(?) ; HARD FILE INTERRUPT FLAG
161HF_CNTRL DB 1 DUP(?) ; COMBO HARD FILE/FLOPPY CARD BIT 0=1
162;----------------------------------------
163; ADDITIONAL DISKETTE AREA :
164;----------------------------------------
165 ORG 90H
166DSK_STATE LABEL BYTE
167 DB 1 DUP(?) ; DRIVE 0 MEDIA STATE
168 DB 1 DUP(?) ; DRIVE 1 MEDIA STATE
169 DB 1 DUP(?) ; DRIVE 0 OPERATION START STATE
170 DB 1 DUP(?) ; DRIVE 1 OPERATION START STATE
171DSK_TRK DB 1 DUP(?) ; DRIVE 0 PRESENT CYLINDER
172 DB 1 DUP(?) ; DRIVE 1 PRESENT CYLINDER
173 DB 1 DUP(?) ; RESERVED
174;---------------------------------------- AEV
175; ADDITIONAL KEYBOARD FLAG FOR KBX: AEV
176;---------------------------------------- AEV
177 ORG 96H ; AEV
178KB_FLAG_3 DB 1 DUP(?) ; AEV
179;----------------------------------------
180; ADDITIONAL KEYBOARD LED FLAG :
181;----------------------------------------
182 ORG 97H
183KB_FLAG_2 DB 1 DUP(?)
184PAGE
185;----------------------------------------
186; REAL TIME CLOCK DATA AREA :
187;----------------------------------------
188 ORG 98H
189USER_FLAG DW 1 DUP(?) ; OFFSET ADDR OF USERS WAIT FLAG
190USER_FLAG_SEG DW 1 DUP(?) ; SEG ADDR OF USER WAIT FLAG
191RTC_LOW DW 1 DUP(?) ; LOW WORD OF USER WAIT FLAG
192RTC_HIGH DW 1 DUP(?) ; HIGH WORD OF USER WAIT FLAG
193RTC_WAIT_FLAG DB 1 DUP(?) ; WAIT ACTIVE FLAG
194DATA ENDS
195;----------------------------------------
196; EXTRA DATA AREA :
197;----------------------------------------
198XXDATA SEGMENT AT 50H
199STATUS_BYTE DB 1 DUP(?)
200XXDATA ENDS
201;----------------------------------------
202; VIDEO DISPLAY BUFFER :
203;----------------------------------------
204VIDEO_RAM SEGMENT AT 0B800H
205REGEN LABEL BYTE
206REGENW LABEL WORD
207 DB 16384 DUP(?)
208VIDEO_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 @@
1
2;Get/Set Extended Attrbute Equates
3
4;The following equates are for EA types
5
6EAISUNDEF equ 00H ; undefined
7EAISLOGICAL equ 01H ; logical (0 or 1), 1 byte
8EAISBINARY equ 02H ; binary integer 1, 2, or 4 bytes
9EAISASCII equ 03H ; ASCII , 0 to 128 bytes
10EAISDATE equ 04H ; DOS file date format, 2 bytes
11EAISTIME equ 05H ; DOS file time format, 2 bytes
12
13;The following equates are for EA flags
14
15EASYSTEM equ 8000H ; system defined, bultin
16EAREADONLY equ 4000H ; read-only , cannot be changed
17EAHIDDEN equ 2000H ; hidden from ATTRIB
18EACREATEONLY equ 1000H ; settable only at create time
19
20;The following equates are for EA failure reason code (set by DOS)
21
22EARCSUCCESS equ 00H ; success
23EARCNOTFOUND equ 01H ; name not found
24EARCNOSPACE equ 02H ; no space to hold name or value
25EARCNOTNOW equ 03H ; name can't be set on this function
26EARCNOTEVER equ 04H ; name can't be set
27EARCUNDEF equ 05H ; name known to IFS but not supported
28EARCDEFBAD equ 06H ; EA definition bad (type,length, etc)
29EARCACCESS equ 07H ; EA access denied
30EARCBADVAL equ 08H ; bad value
31EARCDEVERROR equ 09H ; device error
32EARCUNKNOWN equ 0FFFFH ; unknown cause
33
34
35;The following equates are for EA file type
36
37EAEXISTING equ 00H ; existing file
38EARTL equ 02H ; right to left
39EAEXECUTABLE equ 03H ; executable program
40EAINSTALLABLE equ 04H ; installable executable program
41EAOVERLAY equ 05H ; program overlay
42EADEV_DRIVER equ 06H ; device driver
43EAIFS_DRIVER equ 07H ; ifs deriver
44
45
46
47
48By_Create equ 0000010B ; set by Extended Open (create)
49BY_XA equ 0000100B ; set by Get/Set XA by Handle
50
51;Extended Attribute Structure
52
53EA STRUC ; extended attribute list
54EA_TYPE DB ? ; type
55EA_FLAGS DW ? ; flags
56EA_RC DB ? ; reason code
57EA_NAMELEN DB ? ; name length
58EA_VALLEN DW ? ; value length
59EA_NAME DB ? ; name
60EA ENDS
61
62
63;Query Extended Attribute list
64
65QEA STRUC ; extended attribute list
66QEA_TYPE DB ? ; type
67QEA_FLAGS DW ? ; flags
68QEA_NAMELEN DB ? ; name length
69QEA_NAME DB ? ; name
70QEA ENDS
71
72 \ 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 @@
1; SCCSID = @(#)error.asm 1.1 85/04/10
2; SCCSID = @(#)error.asm 1.1 85/04/10
3BREAK <Xenix error codes>
4
5;
6; XENIX calls all return error codes through AX. If an error occurred then
7; the carry bit will be set and the error code is in AX. If no error occurred
8; then the carry bit is reset and AX contains returned info.
9;
10; Since the set of error codes is being extended as we extend the operating
11; system, we have provided a means for applications to ask the system for a
12; recommended course of action when they receive an error.
13;
14; The GetExtendedError system call returns a universal error, an error
15; location and a recommended course of action. The universal error code is
16; a symptom of the error REGARDLESS of the context in which GetExtendedError
17; is issued.
18;
19
20;
21; These are the 2.0 error codes
22;
23error_invalid_function EQU 1
24error_file_not_found EQU 2
25error_path_not_found EQU 3
26error_too_many_open_files EQU 4
27error_access_denied EQU 5
28error_invalid_handle EQU 6
29error_arena_trashed EQU 7
30error_not_enough_memory EQU 8
31error_invalid_block EQU 9
32error_bad_environment EQU 10
33error_bad_format EQU 11
34error_invalid_access EQU 12
35error_invalid_data EQU 13
36;**** reserved EQU 14 ; *****
37error_invalid_drive EQU 15
38error_current_directory EQU 16
39error_not_same_device EQU 17
40error_no_more_files EQU 18
41;
42; These are the universal int 24 mappings for the old INT 24 set of errors
43;
44error_write_protect EQU 19
45error_bad_unit EQU 20
46error_not_ready EQU 21
47error_bad_command EQU 22
48error_CRC EQU 23
49error_bad_length EQU 24
50error_Seek EQU 25
51error_not_DOS_disk EQU 26
52error_sector_not_found EQU 27
53error_out_of_paper EQU 28
54error_write_fault EQU 29
55error_read_fault EQU 30
56error_gen_failure EQU 31
57;
58; These are the new 3.0 error codes reported through INT 24
59;
60error_sharing_violation EQU 32
61error_lock_violation EQU 33
62error_wrong_disk EQU 34
63error_FCB_unavailable EQU 35
64error_sharing_buffer_exceeded EQU 36
65error_Code_Page_Mismatched EQU 37 ; DOS 4.00 ;AN000;
66error_handle_EOF EQU 38 ; DOS 4.00 ;AN000;
67error_handle_Disk_Full EQU 39 ; DOS 4.00 ;AN000;
68;
69; New OEM network-related errors are 50-79
70;
71error_not_supported EQU 50
72;
73; End of INT 24 reportable errors
74;
75error_file_exists EQU 80
76error_DUP_FCB EQU 81 ; *****
77error_cannot_make EQU 82
78error_FAIL_I24 EQU 83
79;
80; New 3.0 network related error codes
81;
82error_out_of_structures EQU 84
83error_Already_assigned EQU 85
84error_invalid_password EQU 86
85error_invalid_parameter EQU 87
86error_NET_write_fault EQU 88
87error_sys_comp_not_loaded EQU 90 ; DOS 4.00 ;AN000;
88
89BREAK <Interrupt 24 error codes>
90
91error_I24_write_protect EQU 0
92error_I24_bad_unit EQU 1
93error_I24_not_ready EQU 2
94error_I24_bad_command EQU 3
95error_I24_CRC EQU 4
96error_I24_bad_length EQU 5
97error_I24_Seek EQU 6
98error_I24_not_DOS_disk EQU 7
99error_I24_sector_not_found EQU 8
100error_I24_out_of_paper EQU 9
101error_I24_write_fault EQU 0Ah
102error_I24_read_fault EQU 0Bh
103error_I24_gen_failure EQU 0Ch
104; NOTE: Code 0DH is used by MT-DOS.
105error_I24_wrong_disk EQU 0Fh
106
107; THE FOLLOWING ARE MASKS FOR THE AH REGISTER ON Int 24
108
109Allowed_FAIL EQU 00001000B
110Allowed_RETRY EQU 00010000B
111Allowed_IGNORE EQU 00100000B
112;NOTE: ABORT is ALWAYS allowed
113
114I24_operation EQU 00000001B ;Z if READ,NZ if Write
115I24_area EQU 00000110B ; 00 if DOS
116 ; 01 if FAT
117 ; 10 if root DIR
118 ; 11 if DATA
119I24_class EQU 10000000B ;Z if DISK, NZ if FAT or char
120
121BREAK <GetExtendedError CLASSes ACTIONs LOCUSs>
122
123; Values for error CLASS
124
125errCLASS_OutRes EQU 1 ; Out of Resource
126errCLASS_TempSit EQU 2 ; Temporary Situation
127errCLASS_Auth EQU 3 ; Permission problem
128errCLASS_Intrn EQU 4 ; Internal System Error
129errCLASS_HrdFail EQU 5 ; Hardware Failure
130errCLASS_SysFail EQU 6 ; System Failure
131errCLASS_Apperr EQU 7 ; Application Error
132errCLASS_NotFnd EQU 8 ; Not Found
133errCLASS_BadFmt EQU 9 ; Bad Format
134errCLASS_Locked EQU 10 ; Locked
135errCLASS_Media EQU 11 ; Media Failure
136errCLASS_Already EQU 12 ; Collision with Existing Item
137errCLASS_Unk EQU 13 ; Unknown/other
138
139; Values for error ACTION
140
141errACT_Retry EQU 1 ; Retry
142errACT_DlyRet EQU 2 ; Delay Retry, retry after pause
143errACT_User EQU 3 ; Ask user to regive info
144errACT_Abort EQU 4 ; abort with clean up
145errACT_Panic EQU 5 ; abort immediately
146errACT_Ignore EQU 6 ; ignore
147errACT_IntRet EQU 7 ; Retry after User Intervention
148
149; Values for error LOCUS
150
151errLOC_Unk EQU 1 ; No appropriate value
152errLOC_Disk EQU 2 ; Random Access Mass Storage
153errLOC_Net EQU 3 ; Network
154errLOC_SerDev EQU 4 ; Serial Device
155errLOC_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 @@
1/* 0 */
2#include "comsub.h"
3#include "dpb.h"
4#include <dos.h>
5#include "jointype.h"
6
7extern unsigned char *com_substr() ; /* ;AN000; DBCS enabled */
8extern char getdrv() ;
9
10union REGS inregs, outregs; /* ;AN000; Regs for Int21 */
11struct SREGS segregs; /* ;AN000; Segment regs for Int21 */
12
13#define GET_DBCS_VEC 0x6300 /* ;AN000; Int21 Get DBCS Vector */
14#define DBLNULL "00" /* ;AN000; */
15#define NULL 0 /* ;AN000; */
16
17#define KANJI TRUE
18
19/* return FALSE if drive is valid AND the path is not a prefix of a non-root
20 * current directory.
21 */
22char fPathErr(p)
23char *p ;
24{
25 char buf[MAXARG] ;
26 int d ;
27#ifdef KANJI
28 char *p1;
29#endif
30
31 if (p[1] == ':')
32 d = *p-'A'+1 ;
33 else
34 d = 0 ;
35
36 if (curdir(buf, d) == -1) /* drive is invalid => error */
37 return(TRUE) ;
38
39 if (strlen(buf) == 3) /* current directory is root => OK */
40 return(FALSE) ;
41
42 if (strpre(p, buf)) {
43#ifdef KANJI
44 p1 = p;
45 while (*p1 != NULL) {
46 if(testkanj(*p1 & 0xFF))
47 p1 += 2 ;
48 else
49 if((*p1++ == '\\') && (*p1 == NULL))
50 return(TRUE) ;
51 }
52#else
53 if (p[strlen(p)-1] == '\\') /* prefix matched, prefix had...*/
54 return(TRUE) ; /* ...trailing / => valid ... */
55 /* ...prefix => ERROR */
56#endif
57 d = buf[strlen(p)] ;
58 if (d == 0 || d == '\\') /* prefix matched,... */
59 return(TRUE) ; /* ...prefix had no trailing /, */
60 /* ...next char was / => ... */
61 /* ...valid prefix => ERROR */
62 } ;
63
64 return(FALSE) ; /* drive letter good and not valid prefix => OK */
65}
66
67
68strpre(pre, tot)
69 char *pre;
70 char *tot;
71{
72 return(!strncmp(pre, tot, strlen(pre)));
73}
74
75
76
77Fatal(p)
78char *p ;
79{
80 printf("%s\n", p) ;
81 exit(1) ;
82}
83
84
85
86
87ffirst(pb, attr, pfbuf)
88char *pb ;
89int attr ;
90struct findType *pfbuf ;
91{
92 union REGS regs ;
93
94 /* set DMA to point to buffer */
95
96 regs.h.ah = 0x1A ;
97 regs.x.dx = (unsigned) pfbuf ;
98 intdos (&regs, &regs) ;
99
100 /* perform system call */
101
102 regs.h.ah = 0x4E ;
103 regs.x.cx = attr ;
104 regs.x.dx = (unsigned) pb ;
105 intdos (&regs, &regs) ;
106
107 return (regs.x.cflag ? -1 : 0) ;
108}
109
110fnext (pfbuf)
111struct findType *pfbuf;
112{
113 union REGS regs;
114
115 /* set DMA to point to buffer */
116 regs.h.ah = 0x1A;
117 regs.x.dx = (unsigned) pfbuf;
118 intdos (&regs, &regs);
119 /* perform system call */
120 regs.h.ah = 0x4F;
121 intdos (&regs, &regs);
122 return (regs.x.cflag ? -1 : 0) ;
123}
124
125
126char *strbscan(str, class)
127char *str ;
128char *class ;
129{
130 char *p ;
131
132 p = com_substr(str, class) ; /* :AN000; DBCS function */
133 return((p == NULL) ? (str + strlen(str)) : p) ;
134}
135
136
137
138
139
140/* curdir.c - return text of current directory for a particular drive */
141
142
143curdir (dst, drive)
144char *dst ;
145int drive ;
146{
147 union REGS regs ;
148
149 *dst++ = PathChr ;
150 regs.h.ah = 0x47 ;
151 regs.h.dl = drive ;
152 regs.x.si = (unsigned) dst ;
153 intdos (&regs, &regs) ;
154 return(regs.x.cflag ? -1 : 0) ;
155}
156
157
158
159
160/*
161 rootpath
162*/
163
164/*** rootpath -- convert a pathname argument to root based cannonical form
165 *
166 * rootpath determines the current directory, appends the path argument (which
167 * may affect which disk the current directory is relative to), and qualifies
168 * "." and ".." references. The result is a complete, simple, path name with
169 * drive specifier.
170 *
171 * If the relative path the user specifies does not include a drive spec., the
172 * default drive will be used as the base. (The default drive will never be
173 * changed.)
174 *
175 * entry: relpath -- pointer to the pathname to be expanded
176 * fullpath -- must point to a working buffer, see warning
177 * exit: fullpath -- the full path which results
178 * return: true if an error occurs, false otherwise
179 *
180 * calls: curdir, getdrv
181 *
182 * warning: fullpath must point to a working buffer large enough to hold the
183 * longest possible relative path argument plus the longest possible
184 * current directory path.
185 *
186 */
187int rootpath(relpath, fullpath)
188char *relpath ;
189char *fullpath ;
190{
191 int drivenum ;
192 char tempchar;
193 register char *lead, *follow ;
194 char *p1, *p2;
195
196
197 /* extract drive spec */
198 drivenum = getdrv() ;
199 if ((*relpath != NULL) && (relpath[1] == COLON)) {
200 drivenum = relpath[0] - 'A' ;
201 relpath += 2 ;
202 }
203 fullpath[0] = (char) ('A' + drivenum) ;
204 fullpath[1] = COLON ;
205
206 /* append relpath to fullpath/base */
207 if (*relpath == PathChr) {
208 /* relpath starts at base */
209 strcpy(fullpath+2, relpath) ;
210 }
211 else {
212 /* must get base path first */
213 if (curdir(fullpath+2, drivenum+1))
214 return(TRUE) ; /* terrible error */
215 if ((*relpath != ASCNULL) && (strlen(fullpath) > 3))
216 strcat(fullpath, "\\") ;
217 strcat(fullpath, relpath) ;
218 }
219
220
221 /* convert path to cannonical form */
222 lead = fullpath ;
223 while(*lead != ASCNULL) {
224 /* mark next path segment */
225 follow = lead ;
226 lead = (char *) com_substr(follow+1, "\\") ; /* ;AC000; */
227 if (lead == NULL)
228 lead = fullpath + strlen(fullpath) ;
229 tempchar = *lead ;
230 if (tempchar == PathChr)
231 tempchar = BACKSLASH ; /* make breaks uniform */
232 *lead = ASCNULL ;
233
234 /* "." segment? */
235 if (strcmp(follow+1, ".") == 0) {
236 *lead = tempchar ;
237 strcpy(follow, lead) ; /* remove "." segment */
238 lead = follow ;
239 }
240
241 /* ".." segment? */
242 else if (strcmp(follow+1, "..") == 0) {
243 *lead = tempchar ;
244 tempchar = *follow ;
245 *follow = NULL ;
246 p2 = fullpath - 1 ;
247 while(*(p2=strbscan(p1=p2+1,"\\")) != NULL) ;
248 /* p1 now points to the start of the previous element */
249 *follow = tempchar ;
250 if(p1 == fullpath)
251 return(TRUE) ; /* tried to .. the root */
252 follow = p1 - 1 ; /* follow points to path sep */
253 strcpy(follow, lead) ; /* remove ".." segment */
254 lead = follow ;
255 }
256
257 /* normal segment */
258 else
259 *lead = tempchar ;
260 }
261 if (strlen(fullpath) == 2) /* 'D:' or some such */
262 strcat(fullpath, "\\") ;
263
264 return(FALSE) ;
265}
266
267
268/* getdrv - return current drive as a character */
269
270
271char getdrv()
272{
273 union REGS regs ;
274
275 regs.h.ah = CURDISK ; /* Function 0x19 */
276 intdos (&regs, &regs) ;
277 return(regs.h.al) ;
278}
279
280testkanj(c)
281unsigned char c;
282{
283 char fix_es_reg[1]; /* ;AN000; Fixes es reg after "far" */
284 char far * fptr; /* ;AN000; Pts to DBCS vector */
285 unsigned * ptr; /* ;AN000; Input to fptr */
286 unsigned int got_dbcs; /* ;AN000; Flag */
287
288 inregs.x.ax = GET_DBCS_VEC; /* ;AN000; 0x6300 */
289 intdosx(&inregs,&outregs,&segregs); /* ;AN000; Int21 */
290
291 got_dbcs = FALSE; /* ;AN000; Initialize */
292
293 ptr = (unsigned *)&fptr; /* ;AN000; Int21 returns DS:SI */
294 *ptr = outregs.x.si; /* ;AN000; as ptr to DBCS */
295 ptr++; /* ;AN000; vector, now fill */
296 *ptr = segregs.ds; /* ;AN000; in our pointer */
297
298 for (fptr; *(unsigned far *)fptr != (unsigned)DBLNULL; fptr += 2) /* ;AN000; */
299 { /* ;AN000; */
300 if ( (c >= (char)*fptr) && (c <= (char)*(fptr+1)) ) /* ;AN000; Is char */
301 { /* ;AN000; within the range? */
302 got_dbcs = TRUE; /* ;AN000; Char is DBCS */
303 break; /* ;AN000; */
304 } /* ;AN000; */
305 } /* ;AN000; */
306
307 strcpy(fix_es_reg,NULL); /* ;AN000; Repair ES reg */
308 return(got_dbcs); /* ;AN000; */
309}
310 \ 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 @@
1; SCCSID = @(#)exe.asm 1.1 85/04/10
2; SCCSID = @(#)exe.asm 1.1 85/04/10
3BREAK <EXEC and EXE file structures>
4;
5; EXEC arg block - load/go program
6;
7
8;
9; The following get used as arguments to the EXEC system call. They indicate
10; whether or not the program is executed or whether or not a program header
11; gets created.
12;
13exec_func_no_execute EQU 1 ; no execute bit
14exec_func_overlay EQU 2 ; overlay bit
15
16Exec0 STRUC
17Exec0_environ DW ? ; seg addr of environment
18Exec0_com_line DD ? ; pointer to asciz command line
19Exec0_5C_FCB DD ? ; default fcb at 5C
20Exec0_6C_FCB DD ? ; default fcb at 6C
21Exec0 ENDS
22
23Exec1 STRUC
24Exec1_environ DW ? ; seg addr of environment
25Exec1_com_line DD ? ; pointer to asciz command line
26Exec1_5C_FCB DD ? ; default fcb at 5C
27Exec1_6C_FCB DD ? ; default fcb at 6C
28Exec1_SP DW ? ; stack pointer of program
29Exec1_SS DW ? ; stack seg register of program
30Exec1_IP DW ? ; entry point IP
31Exec1_CS DW ? ; entry point CS
32Exec1 ENDS
33
34Exec3 STRUC
35Exec3_load_addr DW ? ; seg address of load point
36Exec3_reloc_fac DW ? ; relocation factor
37Exec3 ENDS
38
39;
40; Exit codes in upper byte
41;
42Exit_terminate EQU 0
43Exit_abort EQU 0
44Exit_Ctrl_C EQU 1
45Exit_Hard_Error EQU 2
46Exit_Keep_process EQU 3
47
48;
49; EXE file header
50;
51
52EXE_file STRUC
53exe_signature DW ? ; must contain 4D5A (yay zibo!)
54exe_len_mod_512 DW ? ; low 9 bits of length
55exe_pages DW ? ; number of 512b pages in file
56exe_rle_count DW ? ; count of reloc entries
57exe_par_dir DW ? ; number of paragraphs before image
58exe_min_BSS DW ? ; minimum number of para of BSS
59exe_max_BSS DW ? ; max number of para of BSS
60exe_SS DW ? ; stack of image
61exe_SP DW ? ; SP of image
62exe_chksum DW ? ; checksum of file (ignored)
63exe_IP DW ? ; IP of entry
64exe_CS DW ? ; CS of entry
65exe_rle_table DW ? ; byte offset of reloc table
66exe_iov DW ? ; overlay number (0 for root)
67exe_sym_tab DD ? ; offset of symbol table in file
68EXE_file ENDS
69
70exe_valid_signature EQU 5A4Dh
71exe_valid_old_signature EQU 4D5Ah
72
73symbol_entry STRUC
74sym_value DD ?
75sym_type DW ?
76sym_len DB ?
77sym_name DB 255 dup (?)
78symbol_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 @@
1;
2; EXPORT DATE: 9/11
3;Equates for FASTOPEN.
4
5;FASTOPEN NAME CACHING Subfunctions
6FONC_Look_up equ 1
7FONC_insert equ 2
8FONC_delete equ 3
9FONC_update equ 4
10FONC_purge equ 5 ;reserved for the future use.
11
12;FASTOPEN EXTENT CACHING Subfunctions
13FSK_Open equ 11 ;AN000;
14FSK_Close equ 12 ;AN000;
15FSK_Delete equ 13 ;AN000;
16FSK_Lookup equ 14 ;AN000;
17FSK_Insert equ 15 ;AN000;
18FSK_Trunc equ 16 ;AN000;
19
20HeaderSize equ 8 ; size of file header (8 bytes) ;AN000;
21ExtendSize equ 8 ; size of extend (8 bytes) ;AN000;
22Num_Of_Pages equ 1 ; number of pages ;AN000;
23Num_Of_Segs equ 2 ; number of frame segments ;AN000;
24Stayresident equ 04ch ; terminate and stay resident function code
25
26
27;Equates used in DOS.
28FastOpen_Set equ 00000001B
29FastOpen_Reset equ 11111110B
30Lookup_Success equ 00000010B
31Lookup_Reset equ 11111101B
32Special_Fill_Set equ 00000100B
33Special_Fill_Reset equ 11111011B
34No_Lookup equ 00001000B
35Set_For_Search equ 00010000B ;DCR 167
36
37
38;============= FastOpen Data Structures =====================
39
40Fastopen_Entry STRUC ;Fastopen Entry pointer in DOS
41Fastopen_Entry_size dw 4 ;size of the following
42Fastopen_Name_Caching dd ?
43;Fastopen_FatChain_Caching dd ? ;reserved for future use
44Fastopen_Entry ENDS
45;
46
47
48CMPCT_DIR_INFO STRUC ;compact version of Dir Info.
49CDI_file_name db 11 dup (' ')
50CDI_file_attr db ?
51CDI_codepage dw ?
52CDI_extcluster dw ?
53CDI_attr2 db ?
54CDI_time dw ?
55CDI_date dw ?
56CDI_cluster dw ?
57CDI_filesize dd ?
58CMPCT_DIR_INFO ENDS
59;
60
61ORIG_DIR_INFO STRUC
62ODI_head db 17 dup (?)
63ODI_skip db 5 dup (0) ;reserved for DOS. FASTOPEN does not
64ODI_tail db 10 dup (?) ; use ODI_skip part.
65ORIG_DIR_INFO ENDS
66;
67
68ODI_head_leng equ 17
69ODI_skip_leng equ 5
70ODI_tail_leng equ 10
71;
72
73FASTOPEN_EXTENDED_INFO STRUC
74FEI_dirpos db 0
75FEI_dirsec dd 0
76FEI_clusnum dw 0
77FEI_lastent dw 0 ; for search first
78FEI_dirstart dw 0 ; for search first
79FASTOPEN_EXTENDED_INFO ENDS
80;
81
82NAME_RECORD STRUC
83nLRU_ptr dw -1
84nMRU_ptr dw -1 ;reverse of nLRU_ptr
85nChild_ptr dw -1
86nSibling_ptr dw -1
87nBackward_ptr dw -1 ;points to preceding node
88nCmpct_Dir_Info db size Cmpct_Dir_Info dup (' ')
89nExtended_Info db size Fastopen_Extended_Info dup (?)
90NAME_RECORD ENDS
91;
92
93DRIVE_CACHE_HEADER STRUC ;drive cache header
94DCH_LRU_ROOT dw 0 ;Header of the LRU chain of this drive
95DCH_MRU_ROOT dw 0 ;offset to the last entry of LRU chain
96DCH_Child_ptr dw -1 ;the first child in Name cache seg.
97DCH_Sibling_ptr dw -1 ;points to the next drive cache header
98DCH_Drive_letter db 'C' ;drive letter
99DCH_Num_Entries dw 0 ;Number of entries in the Name cache.
100DCH_Name_Buff dw 0 ;pointer to name cahe buffer
101DRIVE_CACHE_HEADER ENDS
102;
103
104
105
106
107
108;======== FAST SEEK FUNCTION DATA STRUCTURES =======================
109
110DRIVE_HEADER STRUC ; Drive header structure ;AN000;
111Drive_Number dw 0 ; drive number ;AN000;
112Extent_Count dw 0 ; reserved for debugging
113MRU_Hdr_Ptr dw 0 ; pointer to OPEN Queue
114Free_ptr dw 0 ; pointer to FREE buffer ;AN000;
115Close_Ptr dw 0 ; pointer to CLOSE Queue ;AN000;
116Buff_Size dw 0 ; cache buffer size including header ;AN000;
117Free_Size dw 0 ; size of Free area in bytes
118Next_Drv_Hdr_Ptr dw 0 ; pointer to next drive header
119DRIVE_HEADER ENDS
120
121
122
123FILE_HEADER STRUC ; File header structure ;AN000;
124FH_Phys_Clus_Num dw 0 ; starting physcial clustnum of file ;AN000;
125FH_Refer_Count dw 0 ; reference count ;AN000;
126FH_Next_Extn_Ptr dw 0 ; pointer to first extent of the file;AN000;
127FH_Next_Hdr_Ptr dw 0 ; pointer to next file header ;AN000;
128FH_MRU_Extn_Ptr dw 0 ; pointer to MRU extent
129 dw 0
130 dw 0
131 dw 0
132FILE_HEADER ENDS ;AN000;
133
134
135
136EXTENT_HEADER STRUC ; extend header structure ;AN000;
137EH_Logic_Clus_Num dw 0 ; starting logical clus num of extent;AN000;
138EH_Phys_Clus_Num dw 0 ; starting physical clus numof extnt;AN000;
139EH_Count dw 0 ; range of logical clusnum in the extnt
140EH_Next_Extn_Ptr dw 0 ; pointer to next extent ;AN000;
141EH_Prev_Extn_Ptr dw 0 ; pointer to previous extent ;AN000;
142EH_Next_LRU_Ptr dw 0 ; pointer to next LRU extent
143EH_Prev_LRU_Ptr dw 0 ; pointer tp previous LRU extent
144 dw 0
145EXTENT_HEADER ENDS
146
147
148
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 @@
1;
2;Equates for FASTSEEK.
3;
4;FASTSEEK flags
5;
6FS_begin equ 00000001B
7FS_end equ 11111110B
8FS_insert equ 00000010B
9FS_no_insert equ 11111101B
10
11;FASTSEEK EXTENT CACHING Subfunctions
12FSEC_open equ 11
13FSEC_close equ 12
14FSEC_delete equ 13
15FSEC_lookup equ 14
16FSEC_insert equ 15
17FSEC_truncate equ 16
18;
19;Equates used in DOS.
20
21
22;
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 @@
1; Fastxxx equates
2FastOpen_ID equ 1
3FastSeek_ID equ 2
4Fast_yes equ 10000000B ; fastxxx flag
5
6;Structure definitions
7;
8Fasttable_Entry struc ; Fastxxx Entry pointer in DOS
9Fast_Entry_Num dw 2 ; number of entries
10FastOpen_Seek dd ? ; fastopen & fastseek entry address
11Fasttable_Entry ends
12;
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 @@
1; SCCSID = @(#)filemode.asm 1.1 85/04/10
2; SCCSID = @(#)filemode.asm 1.1 85/04/10
3BREAK <Standard I/O assignments>
4
5stdin EQU 0
6stdout EQU 1
7stderr EQU 2
8stdaux EQU 3
9stdprn EQU 4
10
11BREAK <File modes>
12
13access_mask EQU 0FH
14open_for_read EQU 00h
15open_for_write EQU 01h
16open_for_both EQU 02h
17
18sharing_mask EQU 0F0H
19sharing_compat EQU 000H
20sharing_deny_both EQU 010H
21sharing_deny_write EQU 020H
22sharing_deny_read EQU 030H
23sharing_deny_none EQU 040H
24sharing_net_FCB EQU 070h
25sharing_no_inherit EQU 080H
26
27BREAK <Extended Open>
28
29no_code_page_check EQU 0100H
30int_24_error EQU 2000H
31auto_commit_write EQU 4000H
32ext_open_on EQU 01H
33ext_file_not_exists EQU 04H
34ext_open_I24_off EQU 02H
35io_mode_id EQU 00000010B
36reserved_bits_mask EQU 0FE00H
37exists_mask EQU 0FH
38not_exists_mask EQU 0F0H
39action_opened EQU 01H
40action_created_opened EQU 02H
41action_replaced_opened EQU 03H
42
43ext_exists_open EQU 01H
44ext_exists_fail EQU 0H
45ext_nexists_create EQU 10H
46
47
48
49ext_open_parm struc
50ext_set_list dd ?
51ext_num_of_parm dw ?
52ext_open_parm ends
53
54
55
56 \ 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 @@
1; SCCSID = @(#)find.asm 1.1 85/04/10
2; SCCSID = @(#)find.asm 1.1 85/04/10
3Break <find first/next buffer>
4
5find_buf STRUC
6;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
7; C A V E A T P R O G R A M M E R ;
8; ;
9find_buf_drive DB ? ; drive of search
10find_buf_name DB 11 DUP (?) ; formatted name
11find_buf_sattr DB ? ; attribute of search
12find_buf_LastEnt DW ? ; LastEnt
13find_buf_DirStart DW ? ; DirStart
14find_buf_NetID DB 4 DUP (?) ; Reserved for NET
15; ;
16; C A V E A T P R O G R A M M E R ;
17;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
18
19find_buf_attr DB ? ; attribute found
20find_buf_time DW ? ; time
21find_buf_date DW ? ; date
22find_buf_size_l DW ? ; low(size)
23find_buf_size_h DW ? ; high(size)
24find_buf_pname DB 13 DUP (?) ; packed name
25find_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 @@
1 PAGE ,132 ;
2; SCCSID = @(#)ifssym.inc 1.0 87/05/11
3;******************************************************************************
4; IFS Symbol File
5;
6; REVISION HISTORY:
7; A000 Original version 4.00 May 1987
8; A001 DCR 158 - merge unc info in attach start/status requests 8/87 RGAZZIA
9; A002 DCR 187 - ctrl req renumber, make attach type byte 8/87 RGAZZIA
10; A003 PTM 764 - printer attach problems 8/87 RGAZZIA
11; A004 PTM ???? - Write Only locks on Read/Write 10/27 FEIGENBAUM
12; A005 DCR 285 - remove Extended Attribute/Lock support 1/88 RG
13; A006 PTM 2827 error proc 1/88 RG
14; A007 PTM 3334- reset envirn subfunc to eop 2/88 RMG
15; A008 PTM 3745- commit across net problem due to sft flags problem 3/88 RMG
16; A009 PTM 3810- new sft unique id in sff 3/88 RMG
17; A010 PTM 4392- ditch sf_iomode,cp 4/18/88 RMG
18;
19; LOD - 414
20;
21;******************************************************************************
22 ;AN000;
23SUBTTL IFS Driver Header ;AN000;
24PAGE ;AN000;
25 ;AN000;
26IFSHEADER STRUC ;AN000;
27IFS_NEXT DD -1 ; Next header in list (-1=end) ;AN000;
28IFS_NAME DB " " ; IFS name ;AN000;
29IFS_ATTRIBUTE DW ? ; Attributes ;AN000;
30IFS_VERSION DW 0 ; Request level supported ;AN000;
31IFS_DOSCALL@ DD ? ; DOS interface routine ;AN000;
32 ; (set by TUPPER before the init call) ;AN000;
33IFS_CALL@ DW ? ; Function entry point ;AN000;
34IFSHEADER ENDS ;AN000;
35 ;AN000;
36; ifs_attribute equates ;AN000;
37 ;AN000;
38IFSDEVICE EQU 8000H ; Supports single device/file functions ;AN000;
39IFSDISK EQU 4000H ; Supports multi-file functions ;AN000;
40IFSUNC EQU 2000H ; Support UNC (nameless) connection ;AN000;
41IFSREMOTE EQU 0800H ; File system is remote ;AN000;
42IFSFILTER EQU 0400H ; FS will filter (if off, use DOS ;AN000;
43 ; standard, cap & 8.3) ;AN000;
44IFSIOCTL EQU 0002H ; Supports IOCTL functions ;AN000;
45IFSUSESHARE EQU 0001H ; Uses DOS share support (vs own share) ;AN000;
46 ;AN000;
47 ;AN000;
48SUBTTL IFSRH - IFS Request Header ;AN000;
49PAGE ;AN000;
50 ;AN000;
51; IFS Request Header ;AN000;
52 ;AN000;
53IFSRH STRUC ;AN000;
54IFSR_LENGTH DW ? ; Total length of request ;AN000;
55IFSR_FUNCTION DB ? ; Requested function ;AN000;
56IFSR_RETCODE DW ? ; Explicit error ;AN000;
57IFSR_RETCLASS DB ? ; Error class ;AN000;
58IFSR_RESV1 DB 16 DUP(0) ; DOS reserved ;AN000;
59IFSR_FCN_PARMS DB 50 DUP(0) ; Additional parameters ;AN000;
60IFSRH ENDS ;AN000;
61 ;AN000;
62; IFSR_FUNCTION codes ;AN000;
63; Control requests: ;AN000;
64IFSINIT EQU 1 ;AN000;
65IFSATTSTART EQU 2 ;AN000;
66IFSATTSTAT EQU 3 ;AC002;
67IFSATTEND EQU 4 ;AC002;
68IFSEXECAPI EQU 5 ;AC002;
69IFSCRITMSG EQU 6 ;AC002;
70IFSUPDATECB EQU 7 ;AC002;
71 ;AN000;
72; IFSR_APIFUNC codes: ;AN000;
73; Int 21 mapped requests: ;AN000;
74IFSDRIVERESET EQU 1 ;AN000;
75IFSDISKATTR EQU 2 ;AN000;
76IFSMKDIR EQU 3 ;AN000;
77IFSRMDIR EQU 4 ;AN000;
78IFSCHDIR EQU 5 ;AN000;
79IFSDELFILE EQU 6 ;AN000;
80IFSRENFILE EQU 7 ;AN000;
81IFSSEARCHFILE EQU 8 ;AN000;
82IFSOPENFILE EQU 9 ;AN000;
83IFSLSEEKFILE EQU 10 ;AN000;
84IFSREADFILE EQU 11 ;AN000;
85IFSWRITEFILE EQU 12 ;AN000;
86IFSLOCKFILE EQU 13 ;AN000;
87IFSCLOSEFILE EQU 14 ;AN000;
88IFSFILEATTR EQU 15 ;AN000;
89IFSDEPIOCTL EQU 16 ;AN000;
90IFSDEVIOCTL EQU 17 ;AN000;
91IFSEOP EQU 18 ;AN000;
92IFSEOCID EQU 19 ;AN000;
93 ;AN000;
94SUBTTL Control Request Parameter Macro ;AN000;
95PAGE ;AN000;
96 ;AN000;
97IFSR_FCN_DEF MACRO fcn ;AN000;
98 ;AN000;
99 IFIDN <fcn>,<INIT> ;AN000;
100 IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS ; command parameters ;AN000;
101 IFSR_RESSIZE = WORD PTR IFSR_FCN_PARMS+4 ; driver total size ;AN000;
102 LENGTH_INIT EQU IFSR_RESSIZE-IFSRH+2 ;AN000;
103 ;AN000;
104 ELSE ;AN000;
105 IFIDN <fcn>,<ATTSTART> ;AN000;
106 IFSR_TYPE = BYTE PTR IFSR_FCN_PARMS ; attach type ;AC001;
107 IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS+2 ; command parameters ;AN000;
108 IFSR_DEVICE_CB@ = DWORD PTR IFSR_FCN_PARMS+6 ; CD/DF ;AN000;
109 IFSR_USER_WORD = WORD PTR IFSR_FCN_PARMS+10 ; for unc deviceless attach ;AN001;
110 LENGTH_ATTSTART EQU IFSR_USER_WORD-IFSRH+2 ;AC001;/;AC004;
111 ;AN000;
112 ELSE ;AN000;
113 IFIDN <fcn>,<ATTSTAT> ;AN000;
114 IFSR_TYPE = BYTE PTR IFSR_FCN_PARMS ; attach type ;AC001;
115 IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS+2 ; command parameters ;AN000;
116 IFSR_DEVICE_CB@ = DWORD PTR IFSR_FCN_PARMS+6 ; CD/DF ;AN000;
117 IFSR_USER_WORD = WORD PTR IFSR_FCN_PARMS+10 ; for unc deviceless attach ;AN001;
118 IFSR_MAX_XMITT_SIZE = WORD PTR IFSR_FCN_PARMS+12 ; redir-maximum transmit size ;AN001;
119 IFSR_NET_NAME_ID = WORD PTR IFSR_FCN_PARMS+14 ; redir-net name id ;AN001;
120 IFSR_LSN = WORD PTR IFSR_FCN_PARMS+16 ; redir-low byte=local session # ;AN001;
121 IFSR_DEVICE_STATUS = BYTE PTR IFSR_FCN_PARMS+18 ; redir-interesting bits ;AN001;
122 LENGTH_ATTSTAT EQU IFSR_DEVICE_STATUS-IFSRH+2 ;AC001;
123 ;AN000;
124 ELSE ;AN000;
125 IFIDN <fcn>,<ATTEND> ;AN000;
126 IFSR_DEVICE_CB@ = DWORD PTR IFSR_FCN_PARMS ; CD/DF ;AN000;
127 IFSR_NAME@ = DWORD PTR IFSR_FCN_PARMS+4 ; UNC deviceless detach ;AN000;
128 LENGTH_ATTEND EQU IFSR_NAME@-IFSRH+4 ;AN000;
129 ;AN000;
130 ELSE ;AN000;
131 IFIDN <fcn>,<EXECAPI> ;AN000;
132 IFSR_APIFUNC = BYTE PTR IFSR_FCN_PARMS ; API function code ;AN000;
133 IFSR_ERROR_CLASS = BYTE PTR IFSR_FCN_PARMS+1 ; DOS extended error class ;AN000;
134 IFSR_ERROR_ACTION = BYTE PTR IFSR_FCN_PARMS+2 ; DOS extended error action ;AN000;
135 IFSR_ERROR_LOCUS = BYTE PTR IFSR_FCN_PARMS+3 ; DOS extended error locus ;AN000;
136 IFSR_ALLOWED = BYTE PTR IFSR_FCN_PARMS+4 ; DOS extended error locus ;AN000;
137 IFSR_I24_COUNT = BYTE PTR IFSR_FCN_PARMS+5 ; critical error retry count ;AN000;
138 ; 0=first time ;AN000;
139 IFSR_I24_RESP = BYTE PTR IFSR_FCN_PARMS+6 ; critical error response ;AN000;
140 ; 0=ignore 1=retry ;AN000;
141 IFSR_DEVICE_CB@ = DWORD PTR IFSR_FCN_PARMS+8 ; device (CD or DF) ;AN000;
142 IFSR_OPEN_CB@ = DWORD PTR IFSR_FCN_PARMS+12 ; open file instance (SF) ;AN000;
143 IFSR_API_PARMS = BYTE PTR IFSR_FCN_PARMS+16 ;AN000;
144 ;AN000;
145 ELSE ;AN000;
146 IFIDN <fcn>,<CRITMSG> ;AN000;
147 IFSR_MSG@ = DWORD PTR IFSR_FCN_PARMS ; message buffer address ;AN000;
148 IFSR_MSG_TYPE = BYTE PTR IFSR_FCN_PARMS+4 ; message type ;AN000;
149 ; 1=message is printed in form ;AN000;
150 ; <message> ;AN000;
151 ; Abort,Retry,Ignore,Fail ;AN000;
152 ; 0=message is printed in form ;AN000;
153 ; <message> error (read/writ)ing (drive/device) XXX ; ;AN000;
154 ; Abort,Retry,Ignore,Fail ;AN000;
155 ;AN000;
156 LENGTH_CRITMSG EQU IFSR_MSG_TYPE-IFSRH+2 ;AN000;
157 ;AN000;
158 ELSE ;AN000;
159 IFIDN <fcn>,<UPDATECB> ;AN000;
160 IFSR_CB@ = DWORD PTR IFSR_FCN_PARMS ; control block address ;AN000;
161 IFSR_TYPE = BYTE PTR IFSR_FCN_PARMS+4 ; control block type ;AN000;
162 IFSOPEN EQU 0 ; open instance (SFT) entry ;AN000;
163 IFSCB EQU -1 ; see control block type field ;AN000;
164 LENGTH_UPDATECB EQU IFSR_TYPE-IFSRH+2 ;AN000;
165 ;AN000;
166 ENDIF ;AN000;
167 ENDIF ;AN000;
168 ENDIF ;AN000;
169 ENDIF ;AN000;
170 ENDIF ;AN000;
171 ENDIF ;AN000;
172 ENDIF ;AN000;
173 ENDM ;AN000;
174 ;AN000;
175SUBTTL INT 21H Mapped Request Parameter Macro ;AN000;
176PAGE ;AN000;
177 ;AN000;
178IFSR_API_DEF MACRO fcn ;AN000;
179 ;AN000;
180 IFIDN <fcn>,<DRIVERESET> ;AN000;
181 IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 0=flush ;AN000;
182 LENGTH_DRIVERESET EQU IFSR_FUNC-IFSRH+2 ;AN000;
183 ;AN000;
184 ELSE ;AN000;
185 IFIDN <fcn>,<DISKATTR> ;AN000;
186 IFSR_ALLOCUNITS = WORD PTR IFSR_API_PARMS ; # allocation units ;AN000;
187 IFSR_ALLOCSIZE = WORD PTR IFSR_API_PARMS+2 ; allocation unit sectors ;AN000;
188 IFSR_SECTSIZE = WORD PTR IFSR_API_PARMS+4 ; sector size ;AN000;
189 IFSR_AVAILALLOC = WORD PTR IFSR_API_PARMS+6 ; free allocation units ;AN000;
190 IFSR_FSID = BYTE PTR IFSR_API_PARMS+8 ; file system media id ;AN000;
191 LENGTH_DISKATTR EQU IFSR_FSID-IFSRH+2 ;AN000;
192 ;AN000;
193 ELSE ;AN000;
194 IFIDN <fcn>,<MKDIR> ;AN000;
195 IFSR_NAME@ = DWORD PTR IFSR_API_PARMS ; asciiz name to process ;AN000;
196 LENGTH_MKDIR EQU IFSR_NAME@-IFSRH+4 ;AN000;
197 ;AN000;
198 ELSE ;AN000;
199 IFIDN <fcn>,<RMDIR> ;AN000;
200 IFSR_NAME@ = DWORD PTR IFSR_API_PARMS ; asciiz name to process ;AN000;
201 LENGTH_RMDIR EQU IFSR_NAME@-IFSRH+4 ;AN000;
202 ;AN000;
203 ELSE ;AN000;
204 IFIDN <fcn>,<CHDIR> ;AN000;
205 IFSR_NAME@ = DWORD PTR IFSR_API_PARMS ; asciiz name to process ;AN000;
206 LENGTH_CHDIR EQU IFSR_NAME@-IFSRH+4 ;AN000;
207 ;AN000;
208 ELSE ;AN000;
209 IFIDN <fcn>,<DELFILE> ;AN000;
210 IFSR_MATCHATTR_47 = WORD PTR IFSR_API_PARMS ; format 00000000e0a00shr ;AN000;
211 IFSR_NAME@ = DWORD PTR IFSR_API_PARMS+2 ; file to delete ;AN000;
212 LENGTH_DELFILE EQU IFSR_NAME@-IFSRH+4 ;AN000;
213 ;AN000;
214 ELSE ;AN000;
215 IFIDN <fcn>,<RENFILE> ;AN000;
216 IFSR_MATCHATTR = WORD PTR IFSR_API_PARMS ; format 00000000e0a00shr ;AN000;
217 IFSR_NAME1@ = DWORD PTR IFSR_API_PARMS+2 ; file to rename ;AN000;
218 IFSR_NAME2@ = DWORD PTR IFSR_API_PARMS+6 ; new file name ;AN000;
219 LENGTH_RENFILE EQU IFSR_NAME2@-IFSRH+4 ;AN000;
220 ;AN000;
221 ELSE ;AN000;
222 IFIDN <fcn>,<SEARCHFILE> ;AN000;
223 IFSR_SUBFUNC = BYTE PTR IFSR_API_PARMS ; 1=first, 2=next ;AN000;
224 IFSR_CONTINFO@ = DWORD PTR IFSR_API_PARMS+2 ; continuation info addr ;AN000;
225 IFSR_MATCHATTR = WORD PTR IFSR_API_PARMS+6 ; format 0000000re0advshr (1st) ;AN000;
226 IFSR_NAME@ = DWORD PTR IFSR_API_PARMS+8 ; asciiz name to process (1st) ;AN000;
227 LENGTH_SEARCHFILE EQU IFSR_NAME@-IFSRH+4 ;AN000;
228 ;AN000;
229 ELSE ;AN000;
230 IFIDN <fcn>,<OPENFILE> ;AN000;
231 IFSR_MODE = WORD PTR IFSR_API_PARMS ; open mode ;AN000;
232 ; format: 0WF0000CISSS0AAA ;AN000;
233 ; AAA=access code 0=read,1=write ;AN000;
234 ; 2=read/write ;AN000;
235 ; SSS=sharing mode 0=compatibility ;AN000;
236 ; 1=deny r/w, 2=deny write ;AN000;
237 ; 3=deny read, 4=deny none ;AN000;
238 ; I 0=pass handle to child, 1=no inheri;AN000;t
239 ; C 0=validate cp, 1=no cp check ;AN000;
240 ; F 0=int 24H, 1=return error on ;AN000;
241 ; this open & any I/O to this handle ;AN000;
242 ; W 0=no commit, 1=auto-commit on ;AN000;
243 ; write ;AN000;
244 IFSR_FLAG = WORD PTR IFSR_API_PARMS+2 ; function control; format=CE ;AN000;
245 ; C=does not exist action ;AN000;
246 ; 0=fail, 1=create ;AN000;
247 ; E=exists action ;AN000;
248 ; 0=fail, 1=open, 2=replace/open ;AN000;
249 IFSR_CP = WORD PTR IFSR_API_PARMS+4 ; global code page ;AN000;
250 IFSR_CPSW = BYTE PTR IFSR_API_PARMS+6 ; CPSW flag ;AN000;
251 IFSR_NAME@ = DWORD PTR IFSR_API_PARMS+8 ; asciiz name to open ;AN000;
252 IFSR_PARMS@ = DWORD PTR IFSR_API_PARMS+12 ; format:
253 ; DD EA address
254 ; DW #parms
255 ; DB IOMODE ID ;AN000;
256 ; DW IO Mode ;AN000;
257 IFSR_MATCHATTR = WORD PTR IFSR_API_PARMS+16 ; format 00000000e0advshr ;AN000;
258 IFSR_ACTION = WORD PTR IFSR_API_PARMS+18 ;AN000;
259 LENGTH_OPENFILE EQU IFSR_ACTION-IFSRH+2 ;AN000;
260 ;AN000;
261 ELSE ;AN000;
262 IFIDN <fcn>,<LSEEKFILE> ;AN000;
263 IFSR_MODE = BYTE PTR IFSR_API_PARMS ; see INT 21H AH=42H ;AN000;
264 IFSR_POSITION = DWORD PTR IFSR_API_PARMS+2 ; displacement of LSEEK ;AN000;
265 LENGTH_LSEEKFILE EQU IFSR_POSITION-IFSRH+4 ;AN000;
266 ;AN000;
267 ELSE ;AN000;
268 IFIDN <fcn>,<READFILE> ;AN000;
269;IFSR_MODE = BYTE PTR IFSR_API_PARMS ;AD005;
270 IFSR_COUNT = WORD PTR IFSR_API_PARMS+2 ;AN000;
271 IFSR_BUFFER@ = DWORD PTR IFSR_API_PARMS+4 ;AN000;
272 LENGTH_READFILE EQU IFSR_BUFFER@-IFSRH+4 ;AN000;
273 ;AN000;
274 ELSE ;AN000;
275 IFIDN <fcn>,<WRITEFILE> ;AN000;
276;IFSR_MODE = BYTE PTR IFSR_API_PARMS ;AD005;
277 IFSR_COUNT = WORD PTR IFSR_API_PARMS+2 ;AN000;
278 IFSR_BUFFER@ = DWORD PTR IFSR_API_PARMS+4 ;AN000;
279 LENGTH_WRITEFILE EQU IFSR_BUFFER@-IFSRH+4 ;AN000;
280 ;AN000;
281 ELSE ;AN000;
282 IFIDN <fcn>,<LOCKFILE> ;AN000;
283;IFSR_MODE = BYTE PTR IFSR_API_PARMS ; bit 0: 0=lock all operations ;AD005;
284 ; 1=lock only write operations ;AD005;
285 IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 0=LOCK, 1=UNLOCK ;AC005;
286;IFSR_COUNT = WORD PTR IFSR_API_PARMS+2 ;AD005;
287;IFSR_RANGE@ = DWORD PTR IFSR_API_PARMS+4 ;AD005;
288 IFSR_LK_POSITION = DWORD PTR IFSR_API_PARMS+2 ;AN005;
289 IFSR_LK_LENGTH = DWORD PTR IFSR_API_PARMS+6 ;AN005;
290 LENGTH_LOCKFILE EQU IFSR_LK_LENGTH-IFSRH+4 ;AC005;
291 ;AN000;
292 ELSE ;AN000;
293 IFIDN <fcn>,<CLOSEFILE> ;AN000;
294 IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 0=CLOSE, 1=COMMIT ;AN000;
295 LENGTH_CLOSEFILE EQU IFSR_FUNC-IFSRH+2 ;AN000;
296 ;AN000;
297 ELSE ;AN000;
298 IFIDN <fcn>,<FILEATTR> ;AN000;
299 IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 0=get, 1=set by handle ;AN000;
300 ; 2=get, 3=set by name ;AN000;
301 IFSR_SUBFUNC = BYTE PTR IFSR_API_PARMS+2 ; 0=none,2=EA List, 3-EA names ;AN000;
302 ; 2,3 used only on IFSR_FUNC=0,1 ;AN000;
303 IFSR_BUFFER1@ = DWORD PTR IFSR_API_PARMS+4 ; if IFSR_TYPE=2,3 ;AN000;
304 IFSR_BUFFER2@ = DWORD PTR IFSR_API_PARMS+8 ; if IFSR_TYPE=2 ;AN000;
305 IFSR_COUNT = WORD PTR IFSR_API_PARMS+12 ; if IFSR_TYPE=2,3 ;AN000;
306 ; Following present only if IFSR_FUNC=2,3 ;AN000;
307 IFSR_MATCHATTR = WORD PTR IFSR_API_PARMS+14 ; format 0000000re0advshr ;AN000;
308 IFSR_NAME@ = DWORD PTR IFSR_API_PARMS+16 ; ASCIIZ file name ;AN000;
309 IFSR_SIZE = DWORD PTR IFSR_API_PARMS+20 ; file size ;AN000;
310 IFSR_DATE = WORD PTR IFSR_API_PARMS+24 ; file date ;AN000;
311 IFSR_TIME = WORD PTR IFSR_API_PARMS+26 ; file time ;AN000;
312 IFSR_ATTR = WORD PTR IFSR_API_PARMS+28 ; format 0000000re0advshr ;AN000;
313 LENGTH_FILEATTR EQU IFSR_ATTR-IFSRH+2 ;AN000;
314 ;AN000;
315 ELSE ;AN000;
316 IFIDN <fcn>,<DEPIOCTL> ;AN000;
317 IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 00 Generic IOCTL by device # ;AN000;
318 ; 01 Generic IOCTL by handle ;AN000;
319 ; 02 FS IOCTL query OS type ;AN000;
320 IFSR_BUFFER@ = DWORD PTR IFSR_API_PARMS+2 ; set on queries ;AN000;
321 IFSR_BUFSIZE = WORD PTR IFSR_API_PARMS+6 ; Buffer size set for IFSR_FUNC=2 ;AN000;
322 ; FUNC dependent parameters ;AN000;
323 ; For generic ;AN000;
324 IFSR_CATEGORY = BYTE PTR IFSR_API_PARMS+8 ; generic subfunctions ;AN000;
325 IFSR_CTLFUNC = BYTE PTR IFSR_API_PARMS+9 ; see INT 21H AH=6BH ;AN000;
326 LENGTH_DEPIOCTL EQU IFSR_CTLFUNC-IFSRH+1 ;AN000;
327 ;AN000;
328 ELSE ;AN000;
329 IFIDN <fcn>,<DEVIOCTL> ;AN000;
330 IFSR_FUNC = BYTE PTR IFSR_API_PARMS ; 00 Generic IOCTL by device # ;AN000;
331 ; 01 Generic IOCTL by handle ;AN000;
332 ; 02 FS IOCTL query OS type ;AN000;
333 IFSR_BUFFER@ = DWORD PTR IFSR_API_PARMS+2 ; set on queries ;AN000;
334 IFSR_BUFSIZE = WORD PTR IFSR_API_PARMS+6 ; buffer size set for IFSR_FUNC=2 ;AN000;
335 ; FUNC dependent parameters ;AN000;
336 ; For generic ;AN000;
337 IFSR_CATEGORY = BYTE PTR IFSR_API_PARMS+8 ; generic subfunctions ;AN000;
338 IFSR_CTLFUNC = BYTE PTR IFSR_API_PARMS+9 ; see INT 21H AH=6BH ;AN000;
339 LENGTH_DEVIOCTL EQU IFSR_CTLFUNC-IFSRH+1 ;AN000;
340 ;AN000;
341 ELSE ;AN000;
342 IFIDN <fcn>,<EOP> ;AN000;
343 IFSR_PID = WORD PTR IFSR_API_PARMS ; process ID ;AN000;
344 IFSR_SUBFUNC = BYTE PTR IFSR_API_PARMS+2 ; 0=NORMAL EXIT, 1=ABORT EXIT ;AN000;
345 LENGTH_EOP EQU IFSR_SUBFUNC-IFSRH+2 ;AN000;
346 ;AN000;
347 ELSE ;AN000;
348 IFIDN <fcn>,<EOCID> ;AN000;
349 IFSR_UID = WORD PTR IFSR_API_PARMS ; process ID ;AN000;
350 LENGTH_EOCID EQU IFSR_UID-IFSRH+2 ;AN000;
351 ;AN000;
352 ENDIF ;AN000;
353 ENDIF ;AN000;
354 ENDIF ;AN000;
355 ENDIF ;AN000;
356 ENDIF ;AN000;
357 ENDIF ;AN000;
358 ENDIF ;AN000;
359 ENDIF ;AN000;
360 ENDIF ;AN000;
361 ENDIF ;AN000;
362 ENDIF ;AN000;
363 ENDIF ;AN000;
364 ENDIF ;AN000;
365 ENDIF ;AN000;
366 ENDIF ;AN000;
367 ENDIF ;AN000;
368 ENDIF ;AN000;
369 ENDIF ;AN000;
370 ENDIF ;AN000;
371 ENDM ;AN000;
372 ;AN000;
373SUBTTL Request Data ;AN000;
374PAGE ;AN000;
375 ;AN000;
376; Attach types ;AN000;
377;;;aliasTYPE_ALIAS EQU 0 ;AN000;
378TYPE_DEVICE EQU 1 ;AN000;
379TYPE_DRIVE EQU 2 ;AN000;
380TYPE_NET_DEVICE EQU 3 ;AN000;
381TYPE_NET_DRIVE EQU 4 ;AN000;
382; Attach cmds ;AN000;
383GET_MODE EQU 0 ;AN000;
384SET_MODE EQU 1 ;AN000;
385GET_ASSIGN_LIST EQU 2 ;AN000;
386DEFINE_MACRO EQU 3 ;AN000;
387CANCEL_ATTACH EQU 4 ;AN000;
388 ;AN000;
389ATTACH_PARMS STRUC ;AN000;
390AP_COUNT DW ? ;AN000;
391AP_STRING DB ? ;AN000;
392ATTACH_PARMS ENDS ;AN000;
393 ;AN000;
394; Critical Error Message types ;AN000;
395CRIT_MSG_TYPE_1 equ 1
396TYPE1 EQU 1 ;AN000;
397TYPE0 EQU 0 ;AN000;
398 ;AN000;
399; Control Block types ;AN000;
400CBTYPE_SFF EQU 0 ;AN000;
401CBTYPE_CD EQU 1 ;AN000;
402CBTYPE_DF EQU 2 ;AN000;
403CBTYPE_DUMMYCD EQU 3 ;AN000;
404 ;AN000;
405; Drive Reset equates ;AN000;
406FUNC_FLUSH EQU 0 ;AN000;
407FUNC_FLUSH_INVALIDATE EQU 1 ;AN000;
408 ;AN000;
409; Search File equates ;AN000;
410IFSSEARCH_FIRST EQU 1 ;AN000;
411IFSSEARCH_NEXT EQU 2 ;AN000;
412 ;AN000;
413; Open/Create type ;AN000;
414TYPE_NONE EQU 0 ;AN000;
415NOTEXIST_ACT_FAIL = 0 ;+BAF
416NOTEXIST_ACT_CREATE = 1 ;+BAF
417EXIST_ACT_FAIL = 0 ;+BAF
418EXIST_ACT_OPEN = 1 ;+BAF
419EXIST_ACT_REP_OPEN = 2 ;+BAF
420
421FILE_OPENED = 1
422FILE_CREATED = 2
423FILE_REPLACED = 3
424 ;AN000;
425; Read/Write equates ;AN000;
426;MODE_READ EQU 0 ;AD005;
427;MODE_WRITE EQU 0 ;AD005;
428;MODE_LOCK_READ EQU 1 ;AD005;
429;MODE_WRITE_UNLOCK EQU 1 ;AD005;
430;MODE_WRITE_SFPOS EQU 00H ;AD005;
431;MODE_WRITE_SFSIZE EQU 02H ;AD005;
432;MODE_ADD_MASK EQU 00000010B ; do I need this??? ;AD005;
433 ;AN000;
434; Lock equates ;AN000;
435;MODE_LOCK_ALL EQU 0 ;AD005;
436;MODE_LOCK_WRITE EQU 1 ;AD005;
437FUNC_LOCK EQU 0 ;AN000;
438FUNC_UNLOCK EQU 1 ;AN000;
439;MODE_ADD_MASK EQU 00000010B ;AD005;
440;MODE_WO_MASK EQU 10000000B ;AN004; BAF ;AD005;
441;LOCK_RANGE_STRUC STRUC ;AD005;
442; IFSR_LOCK_POSITION DD ? ;AD005;
443; IFSR_LOCK_LENGTH DD ? ;AD005;
444;LOCK_RANGE_STRUC ENDS ;AD005;
445
446 ;AN000;
447; Close equates ;AN000;
448FUNC_CLOSE EQU 0 ;AN000;
449FUNC_COMMIT EQU 1 ;AN000;
450 ;AN000;
451; LSeek equates ;AN000;
452MODE2 EQU 2 ;AN000;
453 ;AN000;
454; File Attribute equates ;AN000;
455FUNC_GET_BY_HANDLE EQU 0 ;AN000;
456FUNC_SET_BY_HANDLE EQU 1 ;AN000;
457FUNC_GET_BY_NAME EQU 2 ;AN000;
458FUNC_SET_BY_NAME EQU 3 ;AN000;
459SUBFUNC_INLINE EQU 0 ;AN000;
460SUBFUNC_EA EQU 2 ;AN000;
461SUBFUNC_EA_NAMES EQU 3 ;AN000;
462 ;AN000;
463; FS Dependent IOCTL ;AN000;
464GEN_IOCTL_BY_DEVNUM EQU 0 ;AN000;
465GEN_IOCTL_BY_HANDLE EQU 1 ;AN000;
466QUERY_OS_TYPE EQU 2 ;AN000;
467CATEGORY_FS EQU 0 ;AN000;
468CATEGORY_REDIR EQU 1 ;AN000;
469PRINTER_SET_STRING EQU 2 ;AN000;
470PRINTER_GET_STRING EQU 3 ;AN000;
471PRINTER_SET_FLAGS EQU 4 ;AN000;
472PRINTER_GET_FLAGS EQU 5 ;AN000;
473CTLFUNC_PRINTER_SET_STRING EQU 00100001B ;AN000;
474CTLFUNC_PRINTER_GET_STRING EQU 00000001B ;AN000;
475CTLFUNC_PRINTER_SET_FLAGS EQU 00100010B ;AN000;
476CTLFUNC_PRINTER_GET_FLAGS EQU 00000010B ;AN000;
477CTLFUNC_DEVECHOCHECK EQU 00000011B ;AN000;
478CTLFUNC_GET_UNC_ITEM EQU 00000100B ;AN000;
479CTLFUNC_DEVCLOSE EQU 00000101B ;AN000;
480CTLFUNC_DEVOPER EQU 00000110B ;AN000;
481CTLFUNC_PRINT_ON EQU 00100111B ;AN000;
482CTLFUNC_PRINT_OFF EQU 00000111B ;AN000;
483CLOSE_SPOOL_FILES EQU 9 ;AN000;
484LENGTH_DEVECHOCHECK_BUFFER EQU 1 ;AN000;
485 ;AN000;
486; FS Device IOCTL ;AN000;
487READ_DEVICE EQU 2 ;AN000;
488WRITE_DEVICE EQU 3 ;AN000;
489CHAR_GENERIC EQU 0CH ;AN000;
490BLOCK_GENERIC EQU 0DH ;AN000;
491 ;AN000;
492; End of Process equates ;AN000;
493EOP_NORMAL EQU 0 ;AN000;
494EOP_ABORT EQU 1 ;AN000;
495RESET_ENVIRONMENT EQU 2
496 ;AN000;
497SUBTTL Request Return Classes/Codes ;AN000;
498PAGE ;AN000;
499 ;AN000;
500; IFS Request Return Codes ;AN000;
501IFSR_NO_ERROR EQU 0 ;AN000;
502IFSR_NONSPEC_ERROR EQU 1 ;AN000;
503IFSR_NOT_FOUND_ERROR EQU 2 ;AN000;
504IFSR_ACCESS_DENIED EQU 3 ;AN000;
505IFSR_DEVICE_TYPE_MISMATCH EQU 4 ;AN000;
506IFSR_NO_SUBFCN_SUPPORT EQU -2 ;AN000;
507IFSR_NO_FCN_SUPPORT EQU -1 ;AN000;
508 ;AN000;
509; IFS Request Return Classes ;AN000;
510IFSR_INT21H_ERROR EQU 1 ;AN000;
511IFSR_DRIVER_ERROR EQU 2 ;AN000;
512IFSR_INT21H_CRITER EQU 3 ;AN000;
513IFSR_DEVICE_ERROR EQU 4 ;AN006;
514IFSR_BAD_FORMAT EQU -1 ;AN000;
515
516;
517; Int 24H
518NO_RETRY = 0
519I24_RESP_IGNORE = 0
520I24_RESP_RETRY = 1
521
522 ;AN000;
523; IFS_DOSCALL@ function equates ;AN000;
524; Block Device Driver Requests ;AN000;
525CALL_INTERRUPT_ROUTINE EQU 1 ;AN000;
526READ_SECTORS EQU 2 ;AN000;
527WRITE_SECTORS EQU 3 ;AN000;
528FIND_SECTOR EQU 8 ;AN000;
529MARK_SECTOR_CHANGED EQU 9 ;AN000;
530; Buffer Cache Requests ;AN000;
531WRITE_DOS_BUFFER EQU 10 ;AN000;
532READ_DOS_BUFFER EQU 11 ;AN000;
533FREE_DOS_BUFFER EQU 12 ;AN000;
534FLUSH_DOS_BUFFERS EQU 13 ;AN000;
535; Get DOS Variable ;AN000;
536GET_DOS_VALUE EQU 32 ;AN000;
537ACTIVE_PROCESS_INFO EQU 1 ;AN000;
538CPSW_INFORMATION EQU 2 ;AN000;
539BREAK_INFORMATION EQU 3 ;AN000;
540VERIFY_INFORMATION EQU 4 ;AN000;
541CONFIG_SYS_VALUES EQU 5 ;AN000;
542 DOS_VALUE_BUFFER STRUC ;AN000;
543 VAL_BUF_SIZE DW 14 ;AN000;
544 VAL_BUF_FILES DW 0 ;AN000;
545 VAL_BUF_FCBS DW 0 ;AN000;
546 DW 0 ;AN000;
547 VAL_BUF_BUFS DW 0 ;AN000;
548 DW 0 ;AN000;
549 VAL_BUF_LDRV DW 0 ;AN000;
550 VAL_BUF_SSZ DW 0 ;AN000;
551 DOS_VALUE_BUFFER ENDS ;AN000;
552MACHINE_NAME EQU 6 ;AN000;
553COUNTRY_INFO EQU 7 ;AN000;
554SHARE_RETRY_COUNT EQU 8 ;AN000;
555; Get Assign Mode ;AN000;
556GET_ASSIGN_MODE EQU 33 ;AN000;
557DEVICE_MACRO = 3
558DRIVE_MACRO = 4
559PAUSE_MODE_ON = 1
560PAUSE_MODE_OFF = 0
561;
562DOS2NET_DATE = 34
563NET2DOS_DATE = 35
564DOS_STRCMP = 36
565DOS_STRCPY = 37
566USE_SYSTEM_TIMEDATE = 0
567USE_USER_TIMEDATE = 1
568;
569 ;AN000;
570 ;AN000;
571SUBTTL Pseudo Block Structures: SF, CD, DF ;AN000;
572PAGE ;AN000;
573; SFF - Pseudo SFT ;AN000;
574; This structure is used to pass pertinent SFT information ;AN000;
575; to IFS driver. ;AN000;
576 ;AN000;
577SFF STRUC ; Open File Control Block ;AN000;
578SFF_TYPE DB 0,0 ; Identifies SFF ;AN000;
579SFF_FLAGS DW ? ; Control flags ;AN000;
580 ; 4000H=don't set date/time on close ;AN009;
581 ; 0080H=device (vs file) ;AN009;
582 ; 0040H=File clean ;AN008;
583SFF_MODE DW ? ; Mode of access. ;AN000;
584 ; 8000H=FCB (vs handle)[this moved from flags];AC008;
585SFF_RESV1 DW ? ; IO mode. ;AC023; iomode
586SFF_ATTR DW ? ; File attr.FORMAT : 0000000re0advshr ;AN000;
587SFF_UID DW ? ; User ID ;AN000;
588SFF_PID DW ? ; Process ID ;AN000;
589SFF_SIZE DD ? ; File size ;AN000;
590SFF_POSITION DD ? ; Read/Write pointer ;AN000;
591SFF_TIME DW ? ; File time ;AN000;
592SFF_DATE DW ? ; File date ;AN000;
593SFF_NAME DB 8 DUP (?) ; Name ;AN000;
594SFF_EXT DB 3 DUP (?) ; Extension ;AN000;
595SFF_RESV2 DW 0 ; Code page ;AC024; cp
596SFF_SF_ID DW 0 ; Unique SFT entry identifier ;AN009;
597SFF_RESV DB 12 DUP(0) ; Reserved ;AC009;
598SFF_FSDA DB 8 DUP(?) ; File System Dependent Data Area ;AN000;
599SFF ENDS ;AN000;
600 ;AN000;
601; sff_flags bits
602SFF_Close_NoDate EQU 4000H ; 4000H=don't set date/time on close ;AN009;
603SFF_IsDevice EQU 0080H ; 0080H=device (vs file) ;AN009;
604SFF_FileClean EQU 0040H ; 0040H=File clean ;AN008;
605SFF_Device_Raw EQU 0020H ; 0020H=Device raw ;AN008;
606SFF_Net_Spool EQU 0000100000000000B
607; sff_mode bits
608SFF_IsFCB EQU 8000H ; 8000H=FCB (vs handle)[this moved from flags];AC008;
609
610; CD - Pseudo CDS ;AN000;
611; This structure is used to pass pertinent CDS information ;AN000;
612; to IFS driver. ;AN000;
613 ;AN000;
614CD STRUC ;AN000;
615CD_TYPE DB 1,0 ; Identifies CD ;AN000;
616CD_END DW ? ; End of assignment in CD_TEXT ;AN000;
617CD_TEXT DB 67 DUP (?) ; Text of assignment and curdir ;AN000;
618CD_RESV DB 5 DUP(0) ; Reserved ;AN000;
619CD_FSDA DB 8 DUP(?) ; File System Dependent Data Area ;AN000;
620CD ENDS ;AN000;
621 ;AN000;
622; DF - Pseudo DFL ;AN000;
623; This structure is used to pass pertinent DFL information ;AN000;
624; to IFS driver. ;AN000;
625
626DFL STRUC ;AN000;
627DFL_TYPE DB 2,0 ; Identifies DFL ;AN000;
628DFL_DEV_NAME DB 8 DUP (?) ; Device name ;AN000;
629DFL_FSDA DB 8 DUP (?) ; File System Dependent Data Area ;AN000;
630DFL ENDS ;AN000;
631 ;AN000;
632SUBTTL Search Continuation Information ;AN000;
633PAGE ;AN000;
634CONTINFO STRUC ;AN000;
635CI_SEARCH_FN DB 8 DUP(?) ; SEARCH FILE NAME ;AN000;
636CI_SEARCH_FN_EXT DB 3 DUP(?) ; SEARCH FILE EXTENSION ;AN000;
637CI_SEARCH_ATTR DB ? ; SEARCH ATTRIBUTE ;AN000;
638CI_FSDA DB 8 DUP(?) ; FSDA ;AN000;
639 ; Directory entry: ;AN000;
640CI_FOUND_FN DB 8 DUP(?) ; FOUND FILE NAME ;AN000;
641CI_FOUND_FN_EXT DB 3 DUP(?) ; FOUND FILE EXTENSION ;AN000;
642CI_FOUND_ATTRL DB ? ; FOUND ATTRIBUTE LOW ??? DB/DD ;AN000;
643CI_CP DW ? ; FILE CODE PAGE (OR 0) ;AN000;
644CI_RESV1 DW ? ; RESERVED ;AN000;
645CI_FOUND_ATTRH DB ? ; FOUND ATTRIBUTE HIGH ;AN000;
646CI_RESV2 DB 5 DUP(?) ; RESERVED ;AN000;
647CI_FILE_TIME DW ? ; FILE TIME ;AN000;
648CI_FILE_DATE DW ? ; FILE DATE ;AN000;
649CI_FSWORD DW ? ; MEANING FILE SYSTEM SPECIFIC ;AN000;
650 ; (STARTING CLUSTER IN FAT) ;AN000;
651CI_FILE_SIZE DD ? ; FILE SIZE ;AN000;
652CONTINFO ENDS ;AN000;
653
654
655CATEGORY_PRINTER EQU 5
656
657CTLFUNC_SELECT EQU 4AH
658CTLFUNC_QUERY_SELECTED EQU 6AH
659CTLFUNC_QUERY_PREPLIST EQU 6BH
660
661DEV_OPER_BUFFER STRUC
662 OPER_FUNC DB ?
663 TRUNC_FLAG DB ?
664DEV_OPER_BUFFER ENDS
665
666PACKET STRUC ; device ioctl buffer info
667 PACKLEN DW 2 ; length of packet in bytes
668 PACKCPID DW ? ; code page id
669PACKET ENDS
670
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 @@
1; SCCSID = @(#)intnat.asm 1.1 85/04/10
2BREAK <International data structure format>
3
4;
5; Current structure of the data returned by the international call
6;
7internat_block STRUC
8Date_tim_format DW ? ; 0-USA, 1-EUR, 2-JAP
9Currency_sym DB ? ; Currency Symbol 5 bytes
10 DB ?
11 DB ?
12 DB ?
13 DB ?
14Thous_sep DB ? ; Thousands separator 2 bytes
15 DB ?
16Decimal_sep DB ? ; Decimal separator 2 bytes
17 DB ?
18Date_sep DB ? ; Date separator 2 bytes
19 DB ?
20Time_sep DB ? ; Decimal separator 2 bytes
21 DB ?
22Bit_field DB ? ; Bit values
23 ; Bit 0 = 0 if currency symbol first
24 ; = 1 if currency symbol last
25 ; Bit 1 = 0 if No space after currency symbol
26 ; = 1 if space after currency symbol
27Currency_cents DB ? ; Number of places after currency dec point
28Time_24 DB ? ; 1 if 24 hour time, 0 if 12 hour time
29Map_call DW ? ; Address of case mapping call (DWORD)
30 DW ? ; THIS IS TWO WORDS SO IT CAN BE INITIALIZED
31 ; in pieces.
32Data_sep DB ? ; Data list separator character
33 DB ?
34internat_block ENDS
35
36;
37; Max size of the block returned by the INTERNATIONAL call
38;
39internat_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 @@
1
2%OUT IOCTL.INC...
3; THESE ARE ALL THE IMPORTANT STRUCTURES AND EQUATES FOR IOCTL
4;==============================================================================
5;REVISION HISTORY:
6;AN000 - New for DOS Version 4.00 - J.K.
7;AC000 - Changed for DOS Version 4.00 - J.K.
8;AN00x - PTM number for DOS Version 4.00 - J.K.
9;==============================================================================
10;AN001; D241 Provide support of Multi-track Format/Verify 9/23/87 J.K.
11;AN002; P1535 Unformatted hard file problem 10/15/87 J.K.
12;AN003; D490 IOCTL subfunction 63h,43h,64h,44h conflicts with OS2 2/26/88 J.K.
13;==============================================================================
14
15;*** J.K.
16;General Guide -
17;Category Code:
18; 0... .... DOS Defined
19; 1... .... User defined
20; .xxx xxxx Code
21
22;Function Code:
23; 0... .... Return error if unsupported
24; 1... .... Ignore if unsupported
25; .0.. .... Intercepted by DOS
26; .1.. .... Passed to driver
27; ..0. .... Sends data/commands to device
28; ..1. .... Quries data/info from device
29; ...x .... Subfunction
30;
31; Note that "Sends/queries" data bit is intended only to regularize the
32; function set. It plays no critical role; some functions may contain both
33; command and query elements. The convention is that such commands are
34; defined as "sends data".
35
36;*****************************;*
37; BLOCK DRIVERS ;*
38;*****************************;*
39
40; IOCTL SUB-FUNCTIONS
41IOCTL_GET_DEVICE_INFO EQU 0
42IOCTL_SET_DEVICE_INFO EQU 1
43IOCTL_READ_HANDLE EQU 2
44IOCTL_WRITE_HANDLE EQU 3
45IOCTL_READ_DRIVE EQU 4
46IOCTL_WRITE_DRIVE EQU 5
47IOCTL_GET_INPUT_STATUS EQU 6
48IOCTL_GET_OUTPUT_STATUS EQU 7
49IOCTL_CHANGEABLE? EQU 8
50IOCTL_DeviceLocOrRem? EQU 9
51IOCTL_HandleLocOrRem? EQU 0Ah ;10
52IOCTL_SHARING_RETRY EQU 0Bh ;11
53GENERIC_IOCTL_HANDLE EQU 0Ch ;12
54GENERIC_IOCTL EQU 0Dh ;13
55
56; GENERIC IOCTL CATEGORY CODES
57IOC_OTHER EQU 0 ; Other device control J.K. 4/29/86
58IOC_SE EQU 1 ; SERIAL DEVICE CONTROL
59IOC_TC EQU 2 ; TERMINAL CONTROL
60IOC_SC EQU 3 ; SCREEN CONTROL
61IOC_KC EQU 4 ; KEYBOARD CONTROL
62IOC_PC EQU 5 ; PRINTER CONTROL
63IOC_DC EQU 8 ; DISK CONTROL (SAME AS RAWIO)
64
65; GENERIC IOCTL SUB-FUNCTIONS
66RAWIO EQU 8
67
68; RAWIO SUB-FUNCTIONS
69GET_DEVICE_PARAMETERS EQU 60H
70SET_DEVICE_PARAMETERS EQU 40H
71READ_TRACK EQU 61H
72WRITE_TRACK EQU 41H
73VERIFY_TRACK EQU 62H
74FORMAT_TRACK EQU 42H
75GET_MEDIA_ID EQU 66h ;AN000;AN003;changed from 63h
76SET_MEDIA_ID EQU 46h ;AN000;AN003;changed from 43h
77GET_ACCESS_FLAG EQU 67h ;AN002;AN003;Unpublished function.Changed from 64h
78SET_ACCESS_FLAG EQU 47h ;AN002;AN003;Unpublished function.Changed from 44h
79
80; SPECIAL FUNCTION FOR GET DEVICE PARAMETERS
81BUILD_DEVICE_BPB EQU 000000001B
82
83; SPECIAL FUNCTIONS FOR SET DEVICE PARAMETERS
84INSTALL_FAKE_BPB EQU 000000001B
85ONLY_SET_TRACKLAYOUT EQU 000000010B
86TRACKLAYOUT_IS_GOOD EQU 000000100B
87
88; SPECIAL FUNCTION FOR FORMAT TRACK
89STATUS_FOR_FORMAT EQU 000000001B
90DO_FAST_FORMAT equ 000000010B ;AN001;
91; CODES RETURNED FROM FORMAT STATUS CALL
92FORMAT_NO_ROM_SUPPORT EQU 000000001B
93FORMAT_COMB_NOT_SUPPORTED EQU 000000010B
94
95; DEVICETYPE VALUES
96MAX_SECTORS_IN_TRACK EQU 63 ; MAXIMUM SECTORS ON A DISK.(Was 40 in DOS 3.2)
97DEV_5INCH EQU 0
98DEV_5INCH96TPI EQU 1
99DEV_3INCH720KB EQU 2
100DEV_8INCHSS EQU 3
101DEV_8INCHDS EQU 4
102DEV_HARDDISK EQU 5
103DEV_OTHER EQU 7
104
105MAX_DEV_TYPE EQU 7 ; MAXIMUM DEVICE TYPE THAT WE
106 ; CURRENTLY SUPPORT.
107
108;J.K. Bug in MASM 3. A_BPB will be defined in PASS1 and, in PASS2 the
109;compiler does not include BPB.INC and it will be treated as undefined.
110IF1
111 BPBINPASS1 = 0
112 IFNDEF A_BPB
113 INCLUDE BPB.INC
114 BPBINPASS1 = 1
115 ENDIF
116ELSE
117 IF BPBINPASS1
118 INCLUDE BPB.INC
119 ENDIF
120ENDIF
121
122A_SECTORTABLE STRUC
123ST_SECTORNUMBER DW ?
124ST_SECTORSIZE DW ?
125A_SECTORTABLE ENDS
126
127A_DEVICEPARAMETERS STRUC
128DP_SPECIALFUNCTIONS DB ?
129DP_DEVICETYPE DB ?
130DP_DEVICEATTRIBUTES DW ?
131DP_CYLINDERS DW ?
132DP_MEDIATYPE DB ?
133DP_BPB DB SIZE A_BPB DUP (?)
134DP_TRACKTABLEENTRIES DW ?
135DP_SECTORTABLE DB MAX_SECTORS_IN_TRACK * SIZE A_SECTORTABLE DUP (?)
136A_DEVICEPARAMETERS ENDS
137
138A_TRACKREADWRITEPACKET STRUC
139TRWP_SPECIALFUNCTIONS DB ?
140TRWP_HEAD DW ?
141TRWP_CYLINDER DW ?
142TRWP_FIRSTSECTOR DW ?
143TRWP_SECTORSTOREADWRITE DW ?
144TRWP_TRANSFERADDRESS DD ?
145A_TRACKREADWRITEPACKET ENDS
146
147;AN001; - FP_TRACKCOUNT is only meaningful when FP_SPECIALFUNCTIONS bit 1 = 1.
148A_FORMATPACKET STRUC
149FP_SPECIALFUNCTIONS DB ?
150FP_HEAD DW ?
151FP_CYLINDER DW ?
152FP_TRACKCOUNT DW 1
153A_FORMATPACKET ENDS
154
155A_VERIFYPACKET STRUC
156VP_SPECIALFUNCTIONS DB ?
157VP_HEAD DW ?
158VP_CYLINDER DW ?
159A_VERIFYPACKET ENDS
160
161A_MEDIA_ID_INFO STRUC
162MI_LEVEL DW 0 ;J.K. 87 Info. level
163MI_SERIAL DD ? ;J.K. 87 Serial #
164MI_LABEL DB 11 DUP (' ') ;J.K. 87 volume label
165MI_SYSTEM DB 8 DUP (' ') ;J.K. 87 File system type
166A_MEDIA_ID_INFO ENDS
167
168A_DISKACCESS_CONTROL STRUC ;AN002; Unpublished function. Only for Hard file.
169DAC_SPECIALFUNCTIONS DB 0 ;AN002; Always 0
170DAC_ACCESS_FLAG DB 0 ;AN002; Non Zero - allow disk I/O to unformatted hard file
171A_DISKACCESS_CONTROL ENDS ;AN002; 0 - Disallow disk I/O to unformatted hard file
172
173;********************************;*
174; CHARACTER DEVICES (PRINTERS) ;*
175;********************************;*
176
177;RAWIO SUB-FUNCTIONS
178GET_RETRY_COUNT EQU 65H
179SET_RETRY_COUNT EQU 45H
180
181A_RETRYCOUNT STRUC
182RC_COUNT DW ?
183A_RETRYCOUNT ENDS
184
185;********************************;* ;J.K. 4/29/86
186; CHARACTER DEVICES (SCREEN) ;*
187;********************************;* ;J.K. 4/29/86
188;
189;SC_MODE_INFO struc
190;SC_INFO_LENGTH DW 9
191;SC_MODE DB 0
192;SC_COLORS DW 0
193;SC_WIDTH DW 0
194;SC_LENGTH DW 0
195;SC_MODE_INFO ends
196;
197;SC_INFO_PACKET_LENGTH EQU 9 ;LENGTH OF THE INFO PACKET.
198
199;SUBFUNCTIONS FOR CON$GENIOCTL
200;GET_SC_MODE EQU 60h
201;SET_SC_MODE EQU 40h
202;The following subfunctions are reserved for installable CODE PAGE switch
203;console devices. - J.K. 4/29/86
204;Get_active_codepage equ 6Ah
205;Invoke_active_codepage equ 4Ah
206;Start_designate_codepage equ 4Ch
207;End_designate_codepage equ 4Dh
208;Get_list_of_designated_codepage equ 6Bh
209;J.K. 4/29/86 *** End of Con$genioctl equates & structures
210
211
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 @@
1#include "internat.h"
2#include <dos.h>
3#define NULL 0
4#define TRUE 0xffff
5#define FALSE 0
6#define KANJI TRUE
7char haveinttab = FALSE;
8/*
9 * ECS Support - This module provides support for international >7FH and
10 * TWO-BYTE character sets. The toupper routine uses the DOS MAP_CASE call.
11 * In addition, STRING.C contains a default_tab containing a default lead
12 * byte table for two byte character sets. If single byte operation is
13 * desired, modify this table as follows: ="\000". If this utility
14 * is run on a DOS with Function 63H support, the default table will
15 * be replaced by the table in the DOS. The lbtbl_ptr is the far ptr to
16 * which ever table is in use.
17*/
18long lbtbl_ptr;
19char *default_tab="\201\237\340\374\000\000";
20char have_lbtbl = FALSE;
21
22struct InterTbl Currtab;
23
24int toupper(c)
25int c;
26{
27 union REGS regs ;
28
29 if(!haveinttab) {
30 regs.x.ax = 0x3800 ;
31 regs.x.dx = (unsigned) &Currtab ;
32 intdos (&regs, &regs) ; /* INIT the table */
33
34 haveinttab = TRUE;
35 }
36
37 return(IToupper(c,Currtab.casecall));
38
39}
40
41char *strupr(string)
42char *string;
43{
44 register char *p1;
45
46 p1 = string;
47 while (*p1 != NULL) {
48 /*
49 * A note about the following " & 0xFF" stuff. This is
50 * to prevent the damn C compiler from converting bytes
51 * to words with the CBW instruction which is NOT correct
52 * for routines like toupper
53 */
54#ifdef KANJI
55 if(testkanj(*p1 & 0xFF))
56 p1 += 2 ;
57 else
58 *p1++ = toupper(*p1 & 0xFF);
59#else
60 *p1++ = toupper(*p1 & 0xFF);
61#endif
62 }
63 return(string);
64}
65
66char *strpbrk(string1,string2)
67char *string1;
68char *string2;
69{
70 register char *p1;
71
72 while (*string1 != NULL) {
73 /*
74 * A note about the following " & 0xFF" stuff. This is
75 * to prevent the damn C compiler from converting bytes
76 * to words with the CBW instruction which is NOT correct
77 * for routines like toupper
78 */
79#ifdef KANJI
80 if(testkanj(*string1 & 0xFF))
81 string1 += 2 ;
82 else {
83#endif
84 p1 = string2;
85 while (*p1 != NULL) {
86 if(*p1++ == *string1)
87 return(string1);
88 }
89 string1++;
90#ifdef KANJI
91 }
92#endif
93
94 }
95 return(NULL); /* no matches found */
96}
97
98#ifdef KANJI
99testkanj(c)
100unsigned char c;
101{
102 long *p1;
103 union REGS regs ;
104 int i;
105
106 p1 = (long *)&lbtbl_ptr ;
107 if (!have_lbtbl ) {
108 (char far *)lbtbl_ptr = (char far *)default_tab ; /* Load offset in pointer */
109 get_lbtbl( p1 );
110 have_lbtbl=TRUE;
111 }
112
113 if ( test_ecs( c, lbtbl_ptr ))
114 return(TRUE);
115 else
116 return(FALSE);
117}
118#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 @@
1;
2;Equates for LOCK
3;
4;LOCK functions
5;
6Lock_all equ 0
7Unlock_all equ 1
8Lock_mul_range equ 2
9Unlock_mul_range equ 3
10Lock_read equ 4
11Write_unlock equ 5
12Lock_add equ 6
13
14;
15;Structure for Lock buffer
16
17LockBuf STRUC
18
19 Lock_position DD ? ; file position for LOCK
20 Lock_length DD ? ; number of bytes to LOCK
21
22LockBuf ENDS
23;
24 \ 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 @@
1 PAGE
2;***************************************************************************;
3; MACRO DEFINITION ;
4;***************************************************************************;
5
6PRINT MACRO MESSAGE
7 MOV DX,OFFSET MESSAGE&_PTR
8 PUSH DX
9 PUSH CS
10 CALL PRINTF
11ENDM
12
13
14
15INPUT MACRO MESSAGE
16 PRINT MESSAGE
17 CALL PROMPT
18ENDM
19 \ 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 @@
1#*************************** makefile for inc ****************************
2
3msg =..\messages
4dos =..\dos
5inc =..\inc
6hinc =..\h
7
8#
9####################### dependencies begin here. #########################
10#
11
12all: errtst.obj sysvar.obj cds.obj dpb.obj nibdos.obj \
13 const2.obj msdata.obj msdosme.obj mstable.obj msgserv.asm
14
15errtst.obj: errtst.c \
16 $(hinc)\types.h \
17 $(hinc)\comsub.h \
18 $(hinc)\dpb.h
19
20sysvar.obj: sysvar.c \
21 $(hinc)\types.h \
22 $(hinc)\sysvar.h
23
24cds.obj: cds.c \
25 $(hinc)\types.h \
26 $(hinc)\sysvar.h \
27 $(hinc)\cds.h \
28 $(hinc)\dpb.h
29
30dpb.obj: dpb.c \
31 $(hinc)\dpb.h \
32 dpb.inc
33
34nibdos.obj: nibdos.asm $(dos)\mssw.asm $(dos)\msconst.asm \
35 dossym.inc dosseg.asm mshead.asm
36
37const2.obj: const2.asm dossym.inc devsym.inc \
38 dosseg.asm
39
40msdata.obj: msdata.asm $(dos)\mssw.asm dosseg.asm \
41 dosmac.inc msdata.asm $(dos)\msinit.asm \
42 devsym.inc vector.inc buffer.inc \
43 dirent.inc dpb.inc curdir.inc \
44 find.inc pdb.inc \
45 sf.inc arena.inc mi.inc
46
47msdosme.obj: msdosme.asm $(dos)\mssw.asm dosseg.asm \
48 $(dos)\dosmes.asm dosmac.inc intnat.inc \
49 divmes.asm
50
51mstable.obj: mstable.asm $(dos)\mssw.asm \
52 $(dos)\ms_table.asm dossym.inc dosseg.asm \
53 $(dos)\misc2.asm
54
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 @@
1BREAK <MFT Definitions>
2
3;** MSDOS MFT definitions
4;
5; The Master File Table (MFT) associates the cannonicalized pathnames, lock
6; records and SFTs for all files open on this machine.
7;
8; The MFT implementation employs a single memory buffer which is used from
9; both ends. This gives the effect (at least until they run into each
10; other) of two independent buffers.
11;
12; MFT buffer
13; ==========
14; The MFT buffer contains MFT name records and free space. It uses a
15; classic heap architecture: freed name records are marked free and
16; conglomerated with any adjacent free space. When one is to create a name
17; entry the free list is searched first-fit. The list of name and free
18; records is always terminated by a single END record.
19;
20; LOCK buffer
21; ===========
22; The lock buffer contains fixed format records containing record locking
23; information. Since they are fixed format the space is handled as a series
24; of chains: one for each MFT name record and one for the free list. No
25; garbage collection is necessary.
26;
27; Space allocation
28; ================
29; The MFT is managed as a heap. Empty blocks are allocated on a first-fit
30; basis. If there is no single large enough empty block the list is garbage
31; collected.
32;
33; MFT name records:
34;
35; 8 16 8 16 32 16 n
36; |------|-----|-----|------|------|------|---------~~~~~~---------|
37; | FLAG | LEN | SUM | LPTR | SPTR | SERL | <.asciz string> |
38; --------------------------------------------------~~~~~~----------
39;
40; FLAG = record type flag
41; LEN = total byte length of record.
42; SUM = sum of bytes in asciz string. Used to speed
43; searches
44; LPTR= pointer to first record in lock chain segment
45; is MFT segment
46; SPTR= pointer to first sft in sft chain
47; SERL= serial number
48; <string> = name string, zero-byte terminated. There
49; may be garbage bytes following the 00 byte;
50; these are counted in the LEN field.
51;
52;
53; MFT free records
54;
55; 8 16
56; |------|-----|----~~~~~~~~~~~~~~~~~~~~~~~~~~~---------|
57; | FLAG | LEN | free |
58; ------------------~~~~~~~~~~~~~~~~~~~~~~~~~~~----------
59;
60; FLAG = record type flag
61; LEN = total byte length of record.
62;
63;
64; MFT END records
65;
66; 8
67; |------|
68; | FLAG |
69; --------
70;
71; FLAG = record type flag
72
73;** MFT definitions
74;*
75;* NOTE: the flag and length fields are identical for all record types
76;* (except the END type has no length) This must remain so as
77;* some code depends upon it.
78;*
79;* NOTE: Many routines check for "n-1" of the N flag values and if no
80;* match is found assume the flag value must be the remaining
81;* possibility. If you add or remove flag values you must check
82;* all references to mft_flag.
83
84MFT_entry STRUC
85
86mft_flag DB ? ; flag/len field
87mft_len DW ?
88mft_sum DB ? ; string sum word
89mft_lptr DW ? ; LCK pointer
90mft_sptr DD ? ; sft pointer
91mft_serl DW ? ; serial number
92mft_name DB ? ; offset to start of name
93
94MFT_entry ENDS
95
96MFLG_NAM EQU 1 ; min value for name record
97MFLG_FRE EQU 0 ; free record
98MFLG_END EQU -1 ; end record
99
100;* Record Lock Record (RLR):
101;
102; 16 32 32 32
103; |-------|--------|--------|--------|
104; | NEXT | FBA | LBA | SPTR |
105; | | lo hi | lo hi | |
106; ------------|--------|--------------
107;
108; CHAIN = pointer to next RLR. 0 if end
109; FBA = offset of 1st byte of locked region
110; LBA = offset of last byte of locked region
111; SPTR = pointer to SFT lock was issued on
112
113RLR_entry STRUC
114
115rlr_next DW ? ; chain to next RLR, 0 if end
116rlr_fba DW ? ; first byte addr (offset) of reigion
117 DW ?
118rlr_lba DW ? ; last byte addr of region
119 DW ?
120rlr_sptr DD ? ; SFT pointer
121rlr_pid dw ? ; process id of issuer
122rlr_type dw ? ; lock type
123RLR_entry ENDS
124
125rlr_lall equ 00h ; lock all ops
126rlr_lwr equ 01h ; lock write ops
127
128;
129; A pictorial diagram for the linkages is as follows:
130;
131; +---sptr------+
132; V |
133; +---+<----------|---sptr------+------------+
134; |SFT+----+ | | |
135; +-+-+ | +-+-+ +--+-+ +--+-+
136; V +--->|MFT+-lptr->-|LOCK+-next->|LOCK+->0
137; +---+ | +---+ +----+ +----+
138; |SFT+----+ ^
139; +-+-+ |
140; | |
141; +-------------+
142;
143;
144
145;**
146;
147; Interesting behavior should be noted:
148;
149; The sharer must maintain information on files in three forms:
150;
151; local/remote handles. These are normal handles and behave in no
152; strange manner. They are identified by SF_mode not having the
153; sfIsFCB flag nor by having the sf_mode = 70. No problems with
154; locking. No problems with open. No problems with close.
155; CloseByName will iterate closes until the mft disappears.
156; CloseUser will iterate closes until no SFT for the particular user
157; appears. CloseProcess will iterate closes until no SFT for the
158; particular user/process appears.
159;
160; local FCBs. There are no corresponding SFT's for these as the SFTs
161; are cached but will be valid for the particular file. There is
162; one SFT for each open on a file by a specific process. These are
163; identified the sfIsFCB flag in the sf_mode field. When multiple
164; opens occur, we merely find the sf pertinent to the file and
165; process. Close decrements the ref count. CloseByName, CloseUser,
166; CloseProcess will iterate closes until no more SFTs exist.
167;
168; handles with mode 70. These represent FCB's open across the network.
169; As such, identical sfts may have been collapsed by the $open code.
170; This results in a reuse of the same SFT. The $Open code must
171; correctly set the ref-count for the sft to reflect the number of
172; collapses that have occurred. These are identified by a 70 in the
173; SF_mode field. There can be no locking on these SFTs. Open must
174; scan the list of SFTs for the file and increment its ref count
175; appropriately.
176 \ 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 @@
1; SCCSID = @(#)mi.asm 1.1 85/04/10
2BREAK <Machine instruction, flag definitions and character types>
3
4mi_INT EQU 0CDh
5mi_Long_JMP EQU 0EAh
6mi_Long_CALL EQU 09Ah
7mi_Long_RET EQU 0CBh
8mi_Near_RET EQU 0C3h
9
10; xxxxoditszxaxpxc
11f_Overflow EQU 0000100000000000B
12f_Direction EQU 0000010000000000B
13f_Interrupt EQU 0000001000000000B
14f_Trace EQU 0000000100000000B
15f_Sign EQU 0000000010000000B
16f_Zero EQU 0000000001000000B
17f_Aux EQU 0000000000010000B
18f_Parity EQU 0000000000000100B
19f_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 @@
1
2%OUT MSBDS.INC...
3; SCCSID = @(#)IBMBDS.ASM 1.9 85/09/16
4;==============================================================================
5;REVISION HISTORY:
6;AN000 - New for DOS Version 4.00 - J.K.
7;AC000 - Changed for DOS Version 4.00 - J.K.
8;AN00x - PTM number for DOS Version 4.00 - J.K.
9;==============================================================================
10;AN001; D113 Disable I/O access to unformatted media 9/03/87 J.K.
11;==============================================================================
12
13; VALUES FOR VARIOUS FLAGS IN BDS.FLAGS.
14
15FNON_REMOVABLE EQU 01H ;FOR NON-REMOVABLE MEDIA
16FCHANGELINE EQU 02H ;IF CHANGELINE SUPPORTED ON DRIVE
17RETURN_FAKE_BPB EQU 04H ; WHEN SET, DON'T DO A BUILD BPB
18 ; JUST RETURN THE FAKE ONE
19GOOD_TRACKLAYOUT EQU 08H ; THE TRACK LAYOUT HAS NO FUNNY SECTORS
20; FCHANGED_BY_FORMAT EQU 08H
21FI_AM_MULT EQU 10H ;IF MORE THAN ONE LOGICAL FOR THIS PHYSICAL
22FI_OWN_PHYSICAL EQU 20H ;SIGNIFY LOGICAL OWNER OF THIS PHYSICAL
23FCHANGED EQU 40H ;INDICATES MEDIA CHANGED
24SET_DASD_TRUE EQU 80H ; SET DASD BEFORE NEXT FORMAT
25FCHANGED_BY_FORMAT EQU 100H ;MEDIA CHANGED BY FORMAT
26UNFORMATTED_MEDIA EQU 200H ;AN001; Fixed disk only
27
28;
29; VARIOUS FORM FACTORS TO DESCRIBE MEDIA
30;
31FF48TPI EQU 0
32FF96TPI EQU 1
33FFSMALL EQU 2
34FFHARDFILE EQU 5
35FFOTHER EQU 7
36
37BDS_TYPE STRUC
38LINK DD ? ; LINK TO NEXT BDS
39DRIVENUM DB ? ; INT 13 DRIVE NUMBER
40DRIVELET DB ? ; DOS DRIVE NUMBER
41BYTEPERSEC DW ? ; NUMBER OF BYTES/SEC
42SECPERCLUS DB ? ; SEC PER ALLOCATION UNIT
43RESSEC DW ? ; NUMBER OF RESERVED SECTORS
44CFAT DB ? ; NUMBER OF FATS
45CDIR DW ? ; NUMBER OF DIRECTORY ENTRIES
46DRVLIM DW ? ; NUMBER OF SECTORS ON MEDIUM
47MEDIAD DB ? ; MEDIA DESCRIPTOR BYTE
48CSECFAT DW ? ; NUMBER OF SECTORS/FAT
49SECLIM DW ? ; SECTORS PER TRACK
50HDLIM DW ? ; MAX NUMBER OF HEADS
51HIDSEC_L DW ? ; NUMBER OF HIDDEN SECTORS
52HIDSEC_H dw 0 ;J.K.87
53DRVLIM_L dw 0 ;J.K.87
54DRVLIM_H dw 0 ;J.K.87
55FATSIZ DB ? ; FLAGS...
56OPCNT DW ? ; OPEN REF. COUNT
57FORMFACTOR DB ? ; FORM FACTOR INDEX
58FLAGS DW ? ; VARIOUS FLAGS
59CCYLN DW ? ; MAX NUMBER OF CYLINDERS
60RBYTEPERSEC DW ? ; RECOMMENDED BPB
61RSECPERCLUS DB ?
62RRESSEC DW ?
63RCFAT DB ?
64RCDIR DW ?
65RDRVLIM DW ?
66RMEDIAD DB ?
67RCSECFAT DW ?
68RSECLIM DW ?
69RHDLIM DW ?
70RHIDSEC_L DW ?
71RHIDSEC_H DW 0 ;J.K.87
72RDRVLIM_L dw 0 ;J.K.87
73RDRVLIM_H dw 0 ;J.K.87
74RESERVE DB 6 DUP (?) ; RESERVED FOR FUTURE
75TRACK DB ? ; LAST TRACK ACCESSED ON DRIVE
76TIM_LO DW ? ; TIME OF LAST ACCESS. KEEP
77TIM_HI DW ? ; THESE CONTIGUOUS.
78VOLID DB 12 DUP (?) ; VOLUME ID OF MEDIUM
79VOL_SERIAL dd 0 ;J.K.87 Current volume serial number from Boot record
80FILESYS_Id db 9 dup (0) ;J.K.87 Current file system id from Boot record
81BDS_TYPE ENDS
82
83BPBSIZE = TRACK - RBYTEPERSEC ; SIZE IN BYTES OF RECBPB AREA IN THE BDS
84
85
86;*********************************************************************
87; BDS structure for mini disk - J.K. 4/7/86
88;*********************************************************************
89
90BDSM_type struc
91mlink DW -1 ;Link to next structure
92 DW ?
93mdriveNum DB 80 ;Int 13 Drive Number
94mdriveLet DB 3 ;Logical Drive Number
95mBytePerSec DW 512
96mSecPerClus DB 1 ;Sectors/allocation unit
97mRESSEC DW 1 ;Reserved sectors for DOS
98mcFAT DB 2 ;No. of allocation tables
99mcDIR DW 16 ;Number of directory entries
100mDRVLIM DW 0 ;Number of sectors (at 512 bytes each)
101mMediad DB 11111000B ;Media descriptor
102mcSecFat DW 1 ;Number of FAT sectors
103mSECLIM DW 0 ;Sector limit
104mHDLIM DW 0 ;Head limit
105mHIDSEC_L DW 0 ;Hidden sector count
106mHidsec_H dw 0 ;J.K.87
107mDrvlim_L dw 0 ;J.K.87
108mDrvlim_H dw 0 ;J.K.87
109mFatSiz DB 0 ;TRUE => bigfat
110mOPCNT DW 0 ;Open Ref. Count
111mFormFactor DB 3 ;Form Factor
112mFLAGS DW 0020H ;Various Flags
113mcCyln dw 40 ;max number of cylinders
114mRecBPB db 31 dup (0) ;Recommended BPB for drive
115mTrack db -1
116IsMini dw 1 ;Overlapping TIM_LOH
117Hidden_Trks dw 0 ;Overlapping TIM_HIH
118mVOLID DB "NO NAME " ;Volume ID for this disk
119 DB 0 ;ASCIZII for "NO NAME "
120mVol_Serial dd 0 ;Current volume serial number from Boot record
121mFileSys_Id db "FAT12 " ;Current file system id from Boot record
122 db 0
123
124BDSM_type ENDS
125;******************************************************************************
126Max_mini_dsk_num = 23 ;J.K. 4/7/86 - max # of mini disk ibmbio can support
127;
128
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 @@
1; SCCSID = @(#)ibmdata.asm 1.1 85/04/10
2;
3; DATA Segment for DOS.
4;
5
6.xlist
7.xcref
8include mssw.asm
9include dosseg.asm
10debug = FALSE ; No dossym (too big)
11INCLUDE DOSMAC.INC
12INCLUDE SF.INC
13INCLUDE DIRENT.INC
14INCLUDE CURDIR.INC
15INCLUDE DPB.INC
16INCLUDE BUFFER.INC
17INCLUDE ARENA.INC
18INCLUDE VECTOR.INC
19INCLUDE DEVSYM.INC
20INCLUDE PDB.INC
21INCLUDE FIND.INC
22INCLUDE MI.INC
23.cref
24.list
25
26TITLE IBMDATA - DATA segment for DOS
27NAME IBMDATA
28
29installed = TRUE
30
31include ms_data.asm
32include msinit.asm
33 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 @@
1; SCCSID = @(#)ibmdata.asm 1.1 85/04/10
2;
3; DATA Segment for DOS
4;
5
6.xlist
7.xcref
8include mssw.asm
9include dosseg.asm
10debug = FALSE ; No dossym (too big)
11INCLUDE DOSMAC.INC
12INCLUDE SF.INC
13INCLUDE DIRENT.INC
14INCLUDE CURDIR.INC
15INCLUDE DPB.INC
16INCLUDE BUFFER.INC
17INCLUDE ARENA.INC
18INCLUDE VECTOR.INC
19INCLUDE DEVSYM.INC
20INCLUDE PDB.INC
21INCLUDE FIND.INC
22INCLUDE MI.INC
23.cref
24.list
25
26TITLE IBMDATA - DATA segment for DOS
27NAME IBMDATA
28
29installed = TRUE
30
31include msdata.asm
32include msinit.asm
33 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 @@
1; SCCSID = @(#)ibmdosmes.asm 1.1 85/04/10
2;
3; Standard device IO for MSDOS (first 12 function calls)
4;
5debug=0
6.xlist
7.xcref
8include mssw.asm
9include dosseg.asm
10.cref
11.list
12
13TITLE IBMDOSMES - DOS OEM dependancies
14NAME IBMDOSMES
15
16include dosmes.asm
17 \ 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 @@
1; This Macro was removed from sysmsg.inc. We had to remove this
2; macro and put it into it's own include file in order to clear up
3; some assembly errors. MS MASM will not allow a public declaration
4; during the second pass of the assembler. IBM MASM will allow this.
5;
6;
7;
8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9;; $M_DECLARE Macro
10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11 ;
12$M_DECLARE macro numcls ;
13 $M_DCOUNT = 0 ;
14 REPT numcls ;
15 $M_DCOUNT = $M_DCOUNT + 1 ;
16 $M_DECLARE2 %$M_DCOUNT ;
17 ENDM ;
18
19 IF COMR
20 IFNDEF $M_RT2 ; If Resident table is not in this assembly,
21 EXTRN $M_RT2:BYTE ; Must be external
22 ELSE
23 PUBLIC $M_RT2
24 ENDIF ;
25 ELSE
26 IFNDEF $M_RT ; If Resident table is not in this assembly,
27 EXTRN $M_RT:BYTE ; Must be external
28 ELSE
29 PUBLIC $M_RT
30 ENDIF ;
31 ENDIF
32
33 $M_CHECK $M_GET_MSG_ADDRESS ; If this subroutine is not in this assembly,
34 $M_CHECK $M_MSGSERV_1 ; If this subroutine is not in this assembly,
35 $M_CHECK $M_MSGSERV_2 ; If this subroutine is not in this assembly,
36
37ENDM ;
38 ;
39$M_DECLARE2 macro innum ;
40 IF NOT COMR ; IF Not resident COMMAND.COM
41 IF NOT COMT ; IF Not transient COMMAND.COM
42 IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
43 IF FARmsg ;
44 EXTRN $M_CLS_&innum:FAR ; Must be external
45 ELSE ;
46 EXTRN $M_CLS_&innum:NEAR ; Must be external
47 ENDIF ;
48 ELSE ; ELSE
49 PUBLIC $M_CLS_&innum ; Label PUBLIC
50 ENDIF ;
51 ELSE ; ELSE
52 IFDIF <$M_CLS_&innum>,<$M_CLS_1> ; IF NOT $M_CLS_1 or
53 IFDIF <$M_CLS_&innum>,<$M_CLS_2> ; IF NOT $M_CLS_2 then
54 IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
55 IF FARmsg ;
56 EXTRN $M_CLS_&innum:FAR ; Must be external
57 ELSE ;
58 EXTRN $M_CLS_&innum:NEAR ; Must be external
59 ENDIF ;
60 ELSE ; ELSE
61 PUBLIC $M_CLS_&innum ; Label PUBLIC
62 ENDIF ;
63 ENDIF ;
64 ENDIF ;
65 ENDIF ;
66 ELSE ; ELSE
67 IFDIF <$M_CLS_&innum>,<$M_CLS_1> ; IF NOT $M_CLS_1 or
68 IFDIF <$M_CLS_&innum>,<$M_CLS_2> ; IF NOT $M_CLS_2 then
69 IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
70 IF FARmsg ;
71 EXTRN $M_CLS_&innum:FAR ; Must be external
72 ELSE ;
73 EXTRN $M_CLS_&innum:NEAR ; Must be external
74 ENDIF ;
75 ELSE ; ELSE
76 PUBLIC $M_CLS_&innum ; Label PUBLIC
77 ENDIF ;
78 ENDIF ;
79 ENDIF ;
80 ENDIF ;
81ENDM ;
82 ;
83$M_CHECK macro parm ;
84 IFNDEF parm ; IF class is not in this assembly,
85 IF FARmsg ;
86 EXTRN parm:FAR ; Must be external
87 ELSE ;
88 EXTRN parm:NEAR ; Must be external
89 ENDIF ;
90 ELSE
91 IF COMR
92 ELSE
93 PUBLIC parm
94 ENDIF
95 ENDIF ;
96ENDM ;
97 ;
98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
99;;
100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
101 ;
102IF1 ;
103 $M_DECLARE %$M_NUM_CLS ; Declare any class not in this assembly
104ENDIF ;
105 ;
106;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
107
108 \ 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 @@
1 IF1 ;AN000;
2 %OUT INCLUDING MSGHAN.INC...;AN000;
3 ENDIF ;AN000;
4;THIS IS A COMMONLY INCLUDED FILE, USED BY (AT LEAST) THE FOLLOWING COMPONENTS:
5;TREE, GRAFTABL, DISKCOMP, DISKCOPY, COMP - WRITTEN OR Revised BY E.K.
6
7; VALUES FOR THE MSG_DESC CONTROL BLOCK
8ONE_SUBS EQU 1 ;AN000;ONE VARIABLE FIELD IN MESSAGE
9TWO_SUBS EQU 2 ;AN000;TWO VARIABLE FIELDS IN MESSAGE
10THREE_SUBS EQU 3 ;AN000;THREE VARIABLE FIELDS IN MESSAGE
11CLASS_1 EQU EXT_ERR_CLASS ;AN000;CLASS 1 (DOS EXTENDED ERRORS)
12CLASS_2 EQU PARSE_ERR_CLASS ;AN000;CLASS 2 (PARSE ERRORS)
13CLASS_A EQU UTILITY_MSG_CLASS ;AN000;CLASS A TYPE MESSAGE
14
15;THIS MESSAGE DESCRIPTOR CONTROL BLOCK IS GENERATED, ONE PER MESSAGE,
16;TO DEFINE THE SEVERAL PARAMETERS THAT ARE EXPECTED TO BE PASSED IN
17;CERTAIN REGISTERS WHEN THE SYSDISPMSG FUNCTION IS TO BE INVOKED.
18
19MSG_DESC STRUC ;AN000;
20MSG_NUM DW 0 ;AN000;MESSAGE NUMBER (TO AX)
21MSG_HANDLE DW STDOUT ;AN000;HANDLE OF OUTPUT DEVICE (TO BX)
22MSG_SUBLIST DW 0 ;AN000;POINTER TO SUBLIST (TO SI)
23MSG_COUNT DW 0 ;AN000;SUBSTITUTION COUNT (TO CX)
24MSG_CLASS DW CLASS_A SHL 8 ;AN000;MESSAGE CLASS (IN HIGH BYTE, TO DH)
25 ; LOW BYTE HAS 0 (FUNCTION "NO INPUT", TO DL)
26MSG_DESC ENDS ;AN000;
27
28; VALUES FOR THE SUBLIST CONTROL BLOCK
29PC_ID_0 EQU 0 ;AN000;ID OF " - " TRAILER TO MESSAGE
30PC_ID_1 EQU 1 ;AN000;ID OF PERCENT VARIABLE FIELD
31PC_ID_2 EQU 2 ;AN000;ID OF PERCENT VARIABLE FIELD
32PC_ID_3 EQU 3 ;AN000;ID OF PERCENT VARIABLE FIELD
33MAX_0 EQU 0 ;AN000;MAXIMUM WIDTH OF STRING FIELD (0=NO LIMIT)
34MIN_1 EQU 1 ;AN000;MINIMUM WIDTH OF STRING FIELD
35PAD_BLK EQU " " ;AN000;CHAR FOR PAD FIELD
36FILL_OFF EQU 0 ;AN000;TO BE REPLACED WITH ACTUAL OFFSET
37FILL_SEG EQU 0 ;AN000;TO BE REPLACED WITH ACTUAL SEG ID
38
39;THIS SUBLIST CONTROL BLOCK, POINTED TO BY SI WHEN SYSDISPMSG IS CALLED
40;FURTHER DESCRIBES THE MESSAGE AND THE VARIABLE FIELDS THE MSG MAY CONTAIN.
41;THERE IS ONE OF THESE CONTROL BLOCKS PER VARIABLE FIELD. ADDITIONAL
42;VARIABLE FIELDS ARE DEFINED IN ADDITIONAL "SUBLIST" CONTROL BLOCKS,
43;CONSECUTIVE AND CONTIGUOUS WITH THIS ONE. THE NUMBER OF THESE CONTROL
44;BLOCKS IS THE SUBSTITUTION COUNT, PASSED IN CS TO SYSDISPMSG, AS DEFINED
45;IN THE ABOVE "MSC_DESC" CONTROL BLOCK.
46
47SUBLIST STRUC ;AN000;
48SUB_SIZE DB 11 ;AN000;SUBLIST SIZE (POINTER TO NEXT SUBLIST)
49SUB_RES DB 0 ;AN000;RESERVED
50 ;NEXT FIELD IS TO BE USED AS A DOUBLE WORD
51SUB_VALUE DW 0 ;AN000;TIME, DATE, OR PTR TO DATA ITEM
52SUB_VALUE_SEG DW 0 ;AN000;SEG ID OF PTR
53 ;(ABOVE FIELD MUST BE FILLED AT EXECUTION TIME
54 ; IF THIS IS A .COM FILE)
55SUB_ID DB 0 ;AN000;N OF %N
56SUB_FLAGS DB 0 ;AN000;DATA TYPE FLAGS
57SUB_MAX_WIDTH DB MAX_0 ;AN000;MAXIMUM FIELD WIDTH (0=UNLIMITED)
58SUB_MIN_WIDTH DB 0 ;AN000;MINIMUM FIELD WIDTH
59SUB_PAD_CHAR DB PAD_BLK ;AN000;CHARACTER FOR PAD FIELD
60 ; CAN BE " ", "0" OR ",".
61 ; "," CAUSES INSERTION OF THE ACTIVE
62 ; THOUSANDS SEPARATOR BETWEEN EVERY 3 DIGITS.
63SUBLIST ENDS ;AN000;
64
65; BITS DEFINED FOR SUB_FLAGS ABOVE
66; FORMAT = A0SSTTTT
67; ³³ ³ ÀÄÄÄ FIELD TYPE
68; ³³ ÀÄÄÄ DATA VARIABLE SIZE
69; ³ÀÄÄÄ RESERVED, MUST BE ZERO
70; ÀÄÄÄ ALIGNMENT INDICATOR
71SF_BITS RECORD F_ALIGN:1,F_RES:1=0,F_SIZE:2,F_TYPE:4;AN000;
72
73; F_ALIGN FIELD, ALIGNMENT INDICATOR
74SF_LEFT EQU 0 ;AN000;LEFT ALIGN
75SF_RIGHT EQU 1 ;AN000;RIGHT ALIGN
76
77; F_RES FIELD, RESERVED, SHOULD BE ZERO
78
79; F_TYPE FIELD, FIELD TYPE
80SF_CHAR EQU 0000B ;AN000;TYPE IS CHARACTER
81; F_SIZE FIELD,
82SF_CH EQU 00B ;AN000;SINGLE CHARACTER
83SF_ASCIIZ EQU 01B ;AN000;ASCIIZ STRING
84
85; F_TYPE FIELD, FIELD TYPE
86SF_UN_BD EQU 0001B ;AN000;UNSIGNED BINARY TO DECIMAL CHARACTER
87; F_SIZE FIELD,
88SF_BYTE EQU 01B ;AN000;DATA IS BYTE SIZED
89SF_WORD EQU 10B ;AN000;DATA IS WORD SIZED
90SF_DWORD EQU 11B ;AN000;DATA IS DOUBLE WORD SIZED
91
92; F_TYPE FIELD, FIELD TYPE
93SF_SIN_BD EQU 0010B ;AN000;SIGNED BINARY TO DECIMAL CHARACTER
94; F_SIZE FIELD,
95;SF_BYTE EQU 01B ;DATA IS BYTE SIZED
96;SF_WORD EQU 10B ;DATA IS WORD SIZED
97;SF_DWORD EQU 11B ;DATA IS DOUBLE WORD SIZED
98
99; F_TYPE FIELD, FIELD TYPE
100SF_UN_BH EQU 0011B ;AN000;UNSIGNED BINARY TO HEXADECIMAL CHARACTER
101; F_SIZE FIELD,
102;SF_BYTE EQU 01B ;DATA IS BYTE SIZED
103;SF_WORD EQU 10B ;DATA IS WORD SIZED
104;SF_DWORD EQU 11B ;DATA IS DOUBLE WORD SIZED
105
106; F_TYPE FIELD, FIELD TYPE
107SF_DATE EQU 0100B ;AN000;DATE TO CHARACTER,
108 ; USING CURRENT COUNTRY FORMAT
109 ;SUB_VALUE HIGH=YEAR
110 ;SUB_VALUE LOW=MMDD
111; F_SIZE FIELD,
112SF_MD EQU 01B ;AN000;MONTH AND DAY ONLY
113SF_MDY2 EQU 10B ;AN000;MONTH,DAY AND YEAR (2 DIGITS)
114SF_MDY4 EQU 11B ;AN000;MONTH,DAY AND YEAR (4 DIGITS)
115
116; F_TYPE FIELD, FIELD TYPE
117SF_TIME_12 EQU 0101B ;AN000;TIME TO CHARACTER, 12 HOUR FORMAT
118 ; USING CURRENT COUNTRY FORMAT
119 ;SUB_VALUE HIGH=HHMM
120 ;SUB_VALUE LOW=SSHH
121; F_SIZE FIELD,
122SF_HHMM EQU 00B ;AN000;HH:MM (ACTIVE TIME FORMAT)
123SF_HHMMSS EQU 01B ;AN000;HH:MM:SS (ACTIVE TIME FORMAT)
124SF_HHMMSSHH EQU 10B ;AN000;HH:MM:SS:HH
125
126; F_TYPE FIELD, FIELD TYPE
127SF_TIME_24 EQU 0110B ;AN000;TIME TO CHARACTER, 24 HOUR FORMAT
128 ; USING CURRENT COUNTRY FORMAT
129 ;SUB_VALUE HIGH=HHMM
130 ;SUB_VALUE LOW=SSHH
131; F_SIZE FIELD,
132;SF_HHMM EQU 00B ;HH:MM (ACTIVE TIME FORMAT)
133;SF_HHMMSS EQU 01B ;HH:MM:SS (ACTIVE TIME FORMAT)
134;SF_HHMMSSHH EQU 10B ;HH:MM:SS:HH
135
136; THE NEXT GROUP ARE ALL CLASS "1" MESSAGES
137
138 PUBLIC MSGNUM_EXTERR;AN000;
139MSGNUM_EXTERR MSG_DESC <,STDERR,,,CLASS_1 SHL 8> ;AN000;ALL EXTENDED DOS ERRORS
140 ;ERROR NUMBER WILL NEED TO BE FILLED IN
141
142; THE NEXT GROUP ARE ALL CLASS "2" MESSAGES
143
144 PUBLIC MSGNUM_PARSE ;AN000;SO PARSE DRIVER CAN FIND IT
145MSGNUM_PARSE MSG_DESC <,STDERR,,,CLASS_2 SHL 8> ;AN000;ALL PARSING ERRORS
146 ;ERROR NUMBER WILL NEED TO BE FILLED IN
147
148; THE NEXT GROUP ARE ALL CLASS "A" MESSAGES
149; THESE ARE THE "CANNED" MESSAGES ALWAYS PRESENT
150
151 PUBLIC MSGNUM_VER ;AN000;
152MSGNUM_VER MSG_DESC <1,STDERR> ;AN000;"Incorrect DOS Version"
153;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 @@
1; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * *
2;
3; MODULE NAME: MSGSERV.SAL
4;
5; DESCRIPTIVE NAME: Message Services SALUT file
6;
7; FUNCTION: This module incorporates all the messages services and
8; is called upon at build time to INCLUDE the code requested
9; by a utility. Code is requested using the macro MSG_SERVICES.
10;
11; ENTRY POINT: Since this a collection of subroutines, entry point is at
12; requested procedure.
13;
14; INPUT: Since this a collection of subroutines, input is dependent on function
15; requested.
16;
17; EXIT-NORMAL: In all cases, CARRY FLAG = 0
18;
19; EXIT-ERROR: In all cases, CARRY FLAG = 1
20;
21; INTERNAL REFERENCES: (list of included subroutines)
22;
23; - SYSLOADMSG
24; - SYSDISPMSG
25; - SYSGETMSG
26;
27;
28; EXTERNAL REFERENCES: None
29;
30; NOTES: At build time, some modules must be included. These are only included
31; once using assembler switches. Other logic is included at the request
32; of the utility.
33;
34; COMR and COMT are assembler switches to conditionally assemble code
35; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident
36; storage and multiple EQUates.
37;
38; REVISION HISTORY: Created MAY 1987
39;
40; Label: DOS - - Message Retriever
41; (c) Copyright 1988 Microsoft
42;
43;
44; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * *
45; Page
46
47; $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting
48
49IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN
50 $M_STRUC = FALSE ;;AN000;; Let the assembler know that we have
51 ;;AN000;; and include them
52
53 PAGE
54 SUBTTL DOS - Message Retriever - MSGSTR.INC Module
55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
56;;
57;; STRUCTURE: $M_SUBLIST_STRUC
58;;
59;; Replacable parameters are described by a sublist structure
60;;
61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
62 ;;
63$M_SUBLIST_STRUC STRUC ;;AN000;;
64 ;;
65 $M_S_SIZE DB 11 ;;AN000;; SUBLIST size (PTR to next SUBLIST)
66 $M_S_RESV DB 0 ;;AN000;; RESERVED
67 $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item
68 $M_S_ID DB ? ;;AN000;; n of %n
69 $M_S_FLAG DB ? ;;AN000;; Data-type flags
70 $M_S_MAXW DB ? ;;AN000;; Maximum field width
71 $M_S_MINW DB ? ;;AN000;; Minimum field width
72 $M_S_PAD DB ? ;;AN000;; Character for Pad field
73 ;;
74$M_SUBLIST_STRUC ENDS ;;AN000;;
75 ;;
76;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77;;
78;; STRUCTURE: $M_CLASS_ID
79;;
80;; Each class will be defined by this structure.
81;;
82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
83 ;;
84$M_CLASS_ID STRUC ;;AN000;;
85 ;;
86 $M_CLS_ID DB -1 ;;AN000;; Class identifer
87 $M_COMMAND_VER DW EXPECTED_VERSION ;;AN003;; COMMAND.COM version check
88 $M_NUM_CLS_MSG DB 0 ;;AN000;; Total number of message in class
89 ;;
90$M_CLASS_ID ENDS ;;
91 ;;AN000;;
92 $M_CLASS_ID_SZ EQU TYPE $M_CLASS_ID ;;AN000;;
93 ;;
94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
95;;
96;; STRUCTURE: $M_ID_STRUC
97;;
98;; Each message will be defined by this structure.
99;;
100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
101 ;;
102$M_ID STRUC ;;AN000;;
103 ;;
104 $M_NUM DW -1 ;;AN000;; Message Number
105 $M_TXT_PTR DW ? ;;AN000;; Pointer to message text
106 ;;
107$M_ID ENDS ;;AN000;;
108 ;;AN000;; Status Flag Values:
109 $M_ID_SZ EQU TYPE $M_ID ;;AN000;;
110 ;;
111;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
112;;
113;; STRUCTURE: $M_RES_ADDRS
114;;
115;; Resident data area definition of variables
116;;
117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
118 ;;
119$M_RES_ADDRS STRUC ;;AN000;;
120 ;;
121 $M_EXT_ERR_ADDRS DD 0 ;;AN000;; Allow pointers to THREE Extended error locations
122 $M_EXT_FILE DD 0 ;;AN001;;
123 $M_EXT_COMMAND DD 0 ;;AN000;;
124 $M_EXT_TERM DD -1 ;;AN000;;
125 $M_PARSE_COMMAND DD 0 ;;AN000;;
126 $M_PARSE_ADDRS DD 0 ;;AN000;; Allow pointers to TWO Parse error locations
127 $M_PARSE_TERM DD -1 ;;AN000;;
128 $M_CRIT_ADDRS DD 0 ;;AN000;; Allow pointers to TWO Critical error locations
129 $M_CRIT_COMMAND DD 0 ;;AN000;;
130 $M_CRIT_TERM DD -1 ;;AN000;;
131 $M_DISK_PROC_ADDR DD -1 ;;AN004;; Address of READ_DISK_PROC
132 $M_CLASS_ADDRS DD $M_NUM_CLS DUP(0) ;;AN000;; Allow pointers to specified classes
133 $M_CLS_TERM DD -1 ;;AN000;;
134 $M_DBCS_VEC DD 0 ;;AN000;; Save DBCS vector
135 $M_HANDLE DW ? ;;AN000;;
136 $M_SIZE DB 0 ;;AN000;;
137 $M_CRLF DB 0DH,0AH ;;AN004;; CR LF message
138 $M_CLASS DB ? ;;AN004;; Saved class
139 $M_RETURN_ADDR DW ? ;;AN000;;
140 $M_MSG_NUM DW $M_NULL ;;AN000;;
141 $M_DIVISOR DW 10 ;;AN000;; Default = 10 (must be a WORD for division)
142 $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP("$") ;;AN000;; Temporary buffer
143 $M_BUF_TERM DB "$" ;;AN000;;
144
145$M_RES_ADDRS ENDS ;;AN000;;
146 ;;
147$M_RES_ADDRS_SZ EQU TYPE $M_RES_ADDRS ;;AN000;;
148 ;;
149;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
150;;
151;; STRUCTURE: $M_COUNTRY_INFO
152;;
153;; Important fields of the Get Country Information call
154;;
155;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
156 ;;
157$M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation
158 ;;
159 $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc
160 $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format
161 $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;;
162 $M_THOU_SEPARA DB ?,0 ;;AN000;; <------- Thou Separator
163 $M_DECI_SEPARA DB ?,0 ;;AN000;; <------- Decimal Separator
164 $M_DATE_SEPARA DB ?,0 ;;AN000;; <------- Date Separator
165 $M_TIME_SEPARA DB ?,0 ;;AN000;; <------- Time Separator
166 $M_CURR_FORMAT DB ? ;;AN000;;
167 $M_SIG_DIGS_CU DB ? ;;AN000;;
168 $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format
169 ;;
170$M_COUNTRY_INFO ENDS ;;AN000;;
171;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
172 ;;
173ELSE ;;AN000;; ELSE if we have already included the STRUCTURES
174;
175; $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section
176
177 IF MSGDATA ;;AN000;; IF this is a request to include the data area
178 MSGDATA = FALSE ;;AN000;; Let the assembler know not to include it again
179 ;;AN000;; and include it
180 PAGE
181 SUBTTL DOS - Message Retriever - MSGRES.TAB Module
182;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
183;;
184;; DATA NAME: $M_RES_TABLE
185;;
186;; REFERENCE LABEL: $M_RT
187;;
188;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
189 ;;
190IF COMR ;;AN000;; Since COMMAND.COM includes this twice
191 $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no
192 $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur
193 $M_ALTLABEL = TRUE ;;AN000;; Flag that label was changed
194ELSE ;;AN000;;
195 $M_RT LABEL BYTE ;;AN000;;
196ENDIF ;;AN000;;
197 $M_RES_ADDRS <> ;;AN000;; Resident addresses
198 ;;
199 include COPYRIGH.INC ;;AN001;; Include Copyright 1988 Microsoft
200 ;;
201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
202 ENDIF ;;AN000;; END of include of Data table
203
204;
205 IF NOT $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN
206 ;; don't include any more code
207 ;;AN000;; Figure out what other code to include
208 IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code
209 IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it)
210 $M_RT EQU $M_RT2 ;;AN003;;
211 ENDIF
212 DISK_PROC = FALSE ;;AN003;; Yes, THEN include it and reset flag
213 PAGE
214 SUBTTL DOS - Message Retriever - DISK_PROC Module
215;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
216;;
217;; PROC NAME: DISK_PROC
218;;
219;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended
220;; errors from disk\diskette
221;; INPUTS: AX has the message number
222;; DX has the message class
223;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is
224;; assumed to be set!!
225;;
226;; OUTPUTS: ES:DI points to message length (BYTE) followed by text
227;;
228;;
229;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
230 ;;
231 PUBLIC READ_DISK_PROC ;;
232 ;;
233READ_DISK_PROC PROC FAR ;;AN003;;
234
235 PUSH AX ;;AN003;; Save everything
236 PUSH BX ;;AN003;;
237 PUSH DX ;;AN003;;
238 PUSH SI ;;AN003;;
239 PUSH BP ;;AN003;;
240 PUSH DS ;;AN003;;
241 PUSH DI ;;AN003;;
242 MOV BP,AX ;;AN003;; Save message number
243 MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function
244 LEA SI,RESGROUP:COMSPEC ;;AN003;; Get addressibilty to COMMAND.COM
245 PUSH CS ;;AN003;;
246 POP DS ;;AN003;;
247 MOV DI,-1 ;;AN003;; No extended attribute list
248 MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error
249 MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag
250 INT 21H ;;AN003;; Open the file
251 POP DI ;;AN003;; Retreive LSEEK pointer
252 ;;AN003;; Error ?
253; $IF NC,LONG ;;AN003;; No,
254 JNC $MXL1
255 JMP $MIF1
256$MXL1:
257 PUSH DI ;;AN003;; Save LSEEK pointer
258 MOV BX,AX ;;AN003;; Set handle in BX
259 MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors
260 XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM
261 MOV DX,DI ;;AN003;;
262 INT 21H ;;AN003;; LSEEK the file
263 POP DX ;;AN003;; Retreive LSEEK pointer
264 ;;AN003;; Error ?
265; $IF NC ;;AN003;; No,
266 JC $MIF2
267 INC CX ;;AN003;; Set flag to first pass
268; $DO ;;AN003;;
269$MDO3:
270 PUSH DX ;;AN003;; Save LSEEK pointer
271 PUSH CX ;;AN003;; Save first pass flag
272 PUSH AX ;;AN003;; Save number of messages (if set yet)
273 XOR SI,SI ;;AN003;; Reset buffer index
274 MOV AH,DOS_READ_BYTE ;;AN003;; Read
275 MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header
276 LEA DX,$M_RT.$M_TEMP_BUF ;;AN003;; into the temp buffer
277 INT 21H ;;AN003;; Read it
278 MOV DI,DX ;;AN003;;
279 POP AX ;;AN003;;
280 POP CX ;;AN003;;
281 OR CX,CX ;;AN003;;
282; $IF NZ ;;AN003;;
283 JZ $MIF4
284 XOR CX,CX ;;AN003;; Set flag to second pass
285 XOR AH,AH ;;AN003;; Get number of messages in class
286 MOV AL,DS:[DI].$M_NUM_CLS_MSG ;;AN003;;
287 MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index
288 CMP DS:[DI].$M_COMMAND_VER,EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM?
289; $ENDIF ;;AN003;;
290$MIF4:
291 POP DX ;;AN003;;
292; $IF Z ;;AN003;; Yes,
293 JNZ $MIF6
294; $SEARCH ;;AN003;;
295$MDO7:
296 CMP BP,WORD PTR $M_RT.$M_TEMP_BUF[SI] ;;AN003;; Is this the message I'm looking for?
297; $EXITIF Z ;;AN003;; Yes, (ZF=1)
298 JNZ $MIF7
299 CLC ;;AN003;; Reset carry, exit search
300; $ORELSE ;;AN003;; No, (ZF=0)
301 JMP SHORT $MSR7
302$MIF7:
303 ADD SI,$M_ID_SZ ;;AN003;; Increment index
304 ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header
305 DEC AX ;;AN003;; Decrement # of messages left
306; $LEAVE Z ;;AN003;; Have we exhausted all messages?
307 JZ $MEN7
308 CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer?
309; $ENDLOOP A ;;AN003;; No, Check next message (ZF=1)
310 JNA $MDO7
311$MEN7:
312 STC ;;AN003;; Yes, (ZF=0) set error (ZF=0)
313; $ENDSRCH ;;AN003;;
314$MSR7:
315; $ELSE ;;AN003;; No,
316 JMP SHORT $MEN6
317$MIF6:
318 XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop
319 STC ;;AN003;; Set Carry
320; $ENDIF ;;AN003;;
321$MEN6:
322; $ENDDO Z ;;AN003;; Get next buffer full if needed
323 JNZ $MDO3
324 ;;AN003;; Error ?
325; $IF NC ;;AN003;; No,
326 JC $MIF16
327 MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message
328 XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM
329 ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header
330 ADD DX,WORD PTR $M_RT.$M_TEMP_BUF[SI]+2 ;;AN003;; Add offset from msg structure
331 INT 21H ;;AN003;; LSEEK the file
332 MOV AH,DOS_READ_BYTE ;;AN003;; Read
333 MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message
334 LEA DX,$M_RT.$M_TEMP_BUF ;;AN003;; into the temp buffer
335 INT 21H ;;AN003;; Read it
336 MOV DI,DX ;;AN003;; into the temp buffer
337 PUSH DS ;;AN003;; into the temp buffer
338 POP ES ;;AN003;; into the temp buffer
339; $ENDIF ;;AN003;;
340$MIF16:
341; $ENDIF ;;AN003;;
342$MIF2:
343 PUSHF ;;AN003;; Close file handle
344 MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle
345 INT 21H ;;AN003;;
346 $M_POPF ;;AN003;;
347; $ENDIF ;;AN003;; Yes there was an error,
348$MIF1:
349 POP DS ;;AN003;;
350 POP BP ;;AN003;;
351 POP SI ;;AN003;;
352 POP DX ;;AN003;;
353 POP BX ;;AN003;;
354 POP AX ;;AN003;;
355 ;;AN003;; abort everything
356 RET ;;AN003;;
357
358READ_DISK_PROC ENDP ;;AN003;;
359;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
360 ENDIF ;;AN003;; END of include for DISK_PROC
361;
362
363 IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO
364 SETSTDIO = FALSE ;;AN000;; Yes, THEN include it and reset flag
365 PAGE
366 SUBTTL DOS - Message Retriever - SETSTDIO Module
367;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
368;;
369;; PROC NAME: SETSTDIO
370;;
371;; FUNCTION:
372;; INPUTS:
373;;
374;; OUPUTS:
375;;
376;;
377;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
378 ;;
379IF FARmsg ;AN001;
380 SETSTDINON PROC FAR ;AN001;
381ELSE ;AN001;
382 SETSTDINON PROC NEAR ;AN001;
383ENDIF ;AN001;
384 PUSH AX ;AN002; Save changed regs
385 PUSH BX ;AN002;
386 PUSH DX ;AN002;
387 MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
388 MOV BX,STDIN ;AN001;
389 XOR DX,DX ;AN001;
390 INT 21H ;AN001;
391
392 OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
393 MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
394 INT 21H ;AN001;
395 POP DX ;AN002; Restore Regs
396 POP BX ;AN002;
397 POP AX ;AN002;
398
399 RET ;AN001;
400 ;AN001;
401 SETSTDINON ENDP ;AN001;
402
403IF FARmsg ;AN001;
404 SETSTDINOFF PROC FAR ;AN001;
405ELSE ;AN001;
406 SETSTDINOFF PROC NEAR ;AN001;
407ENDIF ;AN001;
408
409 PUSH AX ;AN002; Save changed regs
410 PUSH BX ;AN002;
411 PUSH DX ;AN002;
412 MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
413 MOV BX,STDIN ;AN001;
414 XOR DX,DX ;AN001;
415 INT 21H ;AN001;
416
417 AND DH,NOT $M_CRIT_ERR_MASK ;AN001; Turn off bit
418 MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
419 INT 21H ;AN001;
420 POP DX ;AN002; Restore Regs
421 POP BX ;AN002;
422 POP AX ;AN002;
423
424 RET ;AN001;
425
426 SETSTDINOFF ENDP ;AN001;
427
428IF FARmsg ;AN001;
429 SETSTDOUTON PROC FAR ;AN001;
430ELSE ;AN001;
431 SETSTDOUTON PROC NEAR ;AN001;
432ENDIF ;AN001;
433
434 PUSH AX ;AN002; Save changed regs
435 PUSH BX ;AN002;
436 PUSH DX ;AN002;
437 MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
438 MOV BX,STDOUT ;AN001;
439 XOR DX,DX ;AN001;
440 INT 21H ;AN001;
441
442 OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
443 MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
444 INT 21H ;AN001;
445 POP DX ;AN002; Restore Regs
446 POP BX ;AN002;
447 POP AX ;AN002;
448
449 RET ;AN001;
450
451 SETSTDOUTON ENDP ;AN001;
452
453IF FARmsg ;AN001;
454 SETSTDOUTOFF PROC FAR ;AN001;
455ELSE ;AN001;
456 SETSTDOUTOFF PROC NEAR
457ENDIF ;AN001;
458
459 PUSH AX ;AN002; Save changed regs
460 PUSH BX ;AN002;
461 PUSH DX ;AN002;
462 MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
463 MOV BX,STDOUT ;AN001;
464 XOR DX,DX ;AN001;
465 INT 21H ;AN001;
466
467 AND DH,NOT $M_CRIT_ERR_MASK ;AN001; Turn off bit
468 MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
469 INT 21H ;AN001;
470 POP DX ;AN002; Restore Regs
471 POP BX ;AN002;
472 POP AX ;AN002;
473
474 RET ;AN001;
475
476 SETSTDOUTOFF ENDP ;AN001;
477;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
478 ENDIF ;;AN000;; END of include for SETSTDIO
479;
480 IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ?
481 IF COMR ;;AN000;;
482 $M_RT EQU $M_RT2 ;;AN000;;
483 ENDIF
484 LOADmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
485 PAGE
486 SUBTTL DOS - Message Retriever - LOADMSG.ASM Module
487;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
488;;
489;; PROC NAME: SYSLOADMSG
490;;
491;; FUNCTION:
492;; INPUTS:
493;;
494;; OUPUTS:
495;;
496;;
497;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
498 ;;
499IF FARmsg ;;AN000;;
500 SYSLOADMSG PROC FAR ;;AN000;;
501ELSE ;;AN000;;
502 SYSLOADMSG PROC NEAR ;;AN000;;
503ENDIF ;;AN000;;
504 PUSH AX ;;AN000;
505 PUSH BX ;;AN000;
506 PUSH DX ;;AN000;
507 PUSH ES ;;AN000;
508 PUSH DI ;;AN000;
509 XOR CX,CX ;;AN000; Reset to zero
510 MOV ES,CX ;;AN000;
511 XOR DI,DI ;;AN000;
512 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
513 MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM
514 INT 2FH ;;AN000;; Private interface
515 MOV WORD PTR $M_RT.$M_EXT_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
516 MOV WORD PTR $M_RT.$M_EXT_COMMAND,DI ;;AN000;;
517 ;;
518 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
519 MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM
520 INT 2FH ;;AN000;; Private interface
521 MOV WORD PTR $M_RT.$M_PARSE_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
522 MOV WORD PTR $M_RT.$M_PARSE_COMMAND,DI ;;AN000;;
523 ;;
524 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
525 MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM
526 INT 2FH ;;AN000;; Private interface
527 MOV WORD PTR $M_RT.$M_CRIT_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
528 MOV WORD PTR $M_RT.$M_CRIT_COMMAND,DI ;;AN000;;
529
530 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface
531 MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE
532 INT 2FH ;;AN001;; Private interface
533 MOV WORD PTR $M_RT.$M_EXT_FILE+2,ES ;;AN001;; Move into first avaliable table location
534 MOV WORD PTR $M_RT.$M_EXT_FILE,DI ;;AN001;;
535
536IF COMR ;; ** Special case for RESIDENT COMMAND.COM
537 IF2
538 IFNDEF READ_DISK_INFO ;;AN003;;
539 Extrn READ_DISK_PROC:Far ;;AN003;;
540 ENDIF ;;AN003;;
541 ENDIF ;;AN003;;
542ELSE ;;
543 IF FARmsg ;;AN000;;
544 CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors)
545 ELSE ;;AN000;;
546 CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors)
547 ENDIF ;;AN000;;
548 MOV WORD PTR $M_RT.$M_EXT_ERR_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
549 MOV WORD PTR $M_RT.$M_EXT_ERR_ADDRS,DI ;;AN000;;
550 MOV WORD PTR $M_RT.$M_CRIT_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
551 MOV WORD PTR $M_RT.$M_CRIT_ADDRS,DI ;;AN000;;
552 ;;
553 IF FARmsg ;;AN000;;
554 CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors)
555 ELSE ;;AN000;;
556 CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors)
557 ENDIF ;;AN000;;
558 MOV WORD PTR $M_RT.$M_PARSE_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
559 MOV WORD PTR $M_RT.$M_PARSE_ADDRS,DI ;;AN000;;
560ENDIF ;;
561 ;;
562 MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface
563 MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM
564 INT 2FH ;;AN001;; Private interface
565 MOV WORD PTR $M_RT.$M_DISK_PROC_ADDR+2,ES ;;AN001;; Move into first avaliable table location
566 MOV WORD PTR $M_RT.$M_DISK_PROC_ADDR,DI ;;AN001;;
567
568 $M_BUILD_PTRS %$M_NUM_CLS ;;AN000;; Build all utility classes
569 ;;AN000;;
570 CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector
571
572IF NOT NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed
573 CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK
574ENDIF ;;AN000;;
575 ;;AN000;;
576IF NOT NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed
577 CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK
578ENDIF ;;AN000;;
579 ;;AN000;;
580IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed
581 CLC ;;AN000;; Make sure carry is clear
582ELSE ;;AN000;; ELSE
583 PUSH CX ;;AN000;;
584 CALL $M_VERSION_CHECK ;;AN000;; Check Version
585ENDIF ;;AN000;;
586 ;; Error ?
587; $IF NC ;;AN000;; No.
588 JC $MIF20
589IF NOT NOVERCHECKmsg ;;AN000;; IF version check was not supressed
590 POP CX ;;AN000;; Reset stack
591ENDIF ;;AN000;;
592 POP DI ;;AN000;; Restore REGS
593 POP ES ;;AN000;;
594 POP DX ;;AN000;;
595 POP BX ;;AN000;;
596 POP AX ;;AN000;;
597; $ELSE ;;AN000;; Yes,
598 JMP SHORT $MEN20
599$MIF20:
600IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed
601 ADD SP,10 ;;AN000;;
602 STC ;;AN000;; Reset carry flag
603ELSE ;;AN000;; IF version check is to be supressed
604 ADD SP,12 ;;AN000;;
605 STC ;;AN000;; Reset carry flag
606ENDIF ;;AN000;; IF version check is to be supressed
607; $ENDIF ;;AN000;;
608$MEN20:
609 RET ;;AN000;;
610 ;;
611 SYSLOADMSG ENDP ;;AN000;;
612;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
613 PAGE
614 SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc
615;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
616;;
617;; Proc Name: $M_GET_DBCS_VEC
618;;
619;; Function: Get the DBCS vector and save it for later use
620;;
621;; Inputs: None
622;;
623;; Outputs: None
624;;
625;; Regs Changed:
626;;
627;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
628 ;;
629$M_GET_DBCS_VEC PROC NEAR ;;AN000;;
630 ;;
631 PUSH AX ;;AN000;; Save character to check
632 PUSH SI ;;AN000;;
633 PUSH DS ;;AN000;;
634 MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment
635 INT 21H ;;AN000;; Get environment pointer
636 PUSH DS ;;AN000;; Get environment pointer
637 POP ES ;;AN000;; Get environment pointer
638 POP DS ;;AN000;; Get environment pointer
639; $IF NC ;;AN000;;
640 JC $MIF23
641 MOV WORD PTR $M_RT.$M_DBCS_VEC,SI ;;AN000;; Save DBCS Vector
642 MOV WORD PTR $M_RT.$M_DBCS_VEC+2,ES ;;AN000;;
643; $ENDIF ;;AN000;;
644$MIF23:
645 POP SI ;;AN000;;
646 POP AX ;;AN000;; Retrieve character to check
647 RET ;;AN000;; Return
648 ;;
649$M_GET_DBCS_VEC ENDP ;;
650 ;;
651;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
652 IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ?
653 ELSE ;AN001; Yes, THEN include it
654 PAGE
655 SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc
656;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
657;;
658;; Proc Name: $M_CHECKSTDIN
659;;
660;; Function:
661;;
662;; Inputs: None
663;;
664;; Outputs:
665;;
666;; Regs Changed:
667;;
668;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
669 ;;
670$M_CHECKSTDIN PROC NEAR ;AN001;
671
672 MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
673 MOV BX,STDIN ;AN001;
674 XOR DX,DX ;AN001;
675 INT 21H ;AN001;
676
677 OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
678 MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
679 INT 21H ;AN001;
680
681 RET ;AN001;
682
683$M_CHECKSTDIN ENDP ;AN001;
684 ;;
685;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
686 ENDIF ;AN001; END of include for EOF Check
687 IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full?
688 ELSE ;AN001; Yes, THEN include it
689 PAGE
690 SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc
691;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
692;;
693;; Proc Name: $M_CHECKSTDOUT
694;;
695;; Function:
696;;
697;; Inputs: None
698;;
699;; Outputs:
700;;
701;; Regs Changed:
702;;
703;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
704 ;;
705$M_CHECKSTDOUT PROC NEAR ;AN001;
706
707 MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
708 MOV BX,STDOUT ;AN001;
709 XOR DX,DX ;AN001;
710 INT 21H ;AN001;
711
712 OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
713 MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
714 INT 21H ;AN001;
715
716 RET ;AN001;
717
718$M_CHECKSTDOUT ENDP ;AN001;
719 ;;
720;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
721 ENDIF ;AN001; END of include for Disk Full Check
722 IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check?
723 ELSE ;;AN000;; Yes, THEN include it
724 PAGE
725 SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc
726;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
727;;
728;; Proc Name: $M_VERSION_CHECK
729;;
730;; Function: Determine if DOS version is within allowable limits
731;;
732;; Inputs: None
733;;
734;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version
735;; Registers set for SYSDISPMSG
736;; CARRY_FLAG = 0 if Correct DOS version
737;;
738;; Regs Changed: AX
739;;
740;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
741 ;;
742$M_VERSION_CHECK PROC NEAR ;;AN000;;
743 ;;
744 MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC
745 INT 21H ;;AN000;;
746 ;;
747 CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct
748; $IF E ;;AN000;;
749 JNE $MIF25
750 CLC ;;AN000;; Clear the carry flag
751; $ELSE ;;AN000;; ELSE
752 JMP SHORT $MEN25
753$MIF25:
754IF NOT COMR ;; ** Special case for RESIDENT COMMAND.COM
755 CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH
756; $IF B ;;AN000;; No,
757 JNB $MIF27
758 MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support)
759; $ELSE ;;AN000;; Yes,
760 JMP SHORT $MEN27
761$MIF27:
762 MOV BX,STDERR ;;AN000;; Standard Error
763; $ENDIF ;;AN000;;
764$MEN27:
765ELSE
766 MOV BX,NO_HANDLE ;;AN000;; No handle
767ENDIF
768 MOV AX,1 ;;AN000;; Set message # 1
769 MOV CX,NO_REPLACE ;;AN000;; No replacable parms
770 MOV DL,NO_INPUT ;;AN000;; No input
771 MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message
772 STC ;;AN000;; Set Carry Flag
773; $ENDIF ;;AN000;;
774$MEN25:
775 ;;
776 RET ;;AN000;; Return
777 ;;
778$M_VERSION_CHECK ENDP ;;
779 ;;
780;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
781 ENDIF ;;AN000;; END of include for DOS version check
782 ENDIF ;;AN000;; END of include for SYSLOADMSG
783;
784 IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ?
785 IF COMR ;;AN000;;
786 $M_RT EQU $M_RT2 ;;AN000;;
787 ENDIF ;;AN000;;
788 GETmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
789 PAGE
790 SUBTTL DOS - Message Retriever - GETMSG.ASM Module
791;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
792;;
793;; Proc Name: SYSGETMSG
794;;
795;; Function: The GET service returns the segment, offset and size of the
796;; message text to the caller based on a message number.
797;; The GET function will not display the message thus assumes
798;; caller will handle replaceable parameters.
799;;
800;; Inputs:
801;;
802;; Outputs:
803;;
804;; Psuedocode:
805;; Call $M_GET_MSG_ADDRESS
806;; IF MSG_NUM exists THEN
807;; Set DS:SI = MSG_TXT_PTR + 1
808;; CARRY_FLAG = 0
809;; ELSE
810;; CARRY_FLAG = 1
811;; ENDIF
812;;
813;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
814 ;;
815IF FARmsg ;;AN000;;
816 SYSGETMSG PROC FAR ;;AN000;;
817ELSE ;;AN000;;
818 SYSGETMSG PROC NEAR ;;AN000;;
819ENDIF ;;AN000;;
820 ;;
821;; Save registers needed later
822
823 PUSH AX ;;AN000;; Save changed regs
824 PUSH ES ;;AN000;;
825 PUSH DI ;;AN000;;
826 PUSH BP ;;AN000;;
827 ;;
828IF FARmsg ;;AN000;;
829 CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
830ELSE ;;AN000;;
831 CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
832ENDIF ;;AN000;; Return message in ES:DI
833; $IF NC ;;AN000;; Message found?
834 JC $MIF31
835 CMP DH,UTILITY_MSG_CLASS
836 CLC ;;AN000;;
837; $IF NE
838 JE $MIF32
839 PUSH ES ;;AN000;;
840 POP DS ;;AN000;; Return message in DS:SI
841; $ELSE
842 JMP SHORT $MEN32
843$MIF32:
844IF FARmsg ;;AN000;; Yes,
845 PUSH ES ;;AN000;;
846 POP DS ;;AN000;; Return message in DS:SI
847ELSE ;;AN000;;
848 PUSH CS ;;AN000;; Return message in DS:SI
849 POP DS ;;AN000;;
850ENDIF ;;AN000;;
851; $ENDIF ;;AN000;;
852$MEN32:
853 MOV SI,DI ;;AN000;; Return message in DS:SI
854; $ENDIF ;;AN000;;
855$MIF31:
856 ;;
857 POP BP ;;AN000;; Restore changed regs
858 POP DI ;;AN000;;
859 POP ES ;;AN000;;
860 POP AX ;;AN000;;
861 ;;
862 RET ;;AN000;; Return
863 ;;
864 SYSGETMSG ENDP ;;
865;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
866 IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet
867 $M_SUBS = FALSE ;;AN000;; No, then include and reset the flag
868;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
869;;
870;; PROC NAME: $M_GET_MSG_ADDRESS
871;;
872;; FUNCTION: To scan thru classes to return pointer to the message header
873;; INPUTS: Access to $M_RES_ADDRESSES
874;; OUPUTS: IF CX = 0 THEN Message was not found
875;; IF CX > 1 THEN ES:DI points to the specified message
876;; REGS CHANGED: ES,DI,CX
877;;
878;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
879 ;;
880IF FARmsg ;;AN000;;
881 $M_GET_MSG_ADDRESS PROC FAR ;;AN000;;
882ELSE ;;AN000;;
883 $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;;
884ENDIF ;;AN000;;
885 ;;
886 PUSH SI ;;AN000;;
887 PUSH BX ;;AN000;;
888 XOR SI,SI ;;AN000;; Use SI as an index
889 XOR CX,CX ;;AN000;; Use CX as an size
890; $DO ;;AN000;;
891$MDO36:
892 CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested?
893; $IF E ;;AN000;; Yes,
894 JNE $MIF37
895 IF FARmsg ;;AN000;;
896 LES DI,DWORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
897 MOV BX,ES ;;AN000;
898 ELSE ;;AN000;;
899 MOV DI,WORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
900 MOV BX,DI ;;AN000;
901 ENDIF ;;AN000;;
902; $ELSE ;;AN000;; No,
903 JMP SHORT $MEN37
904$MIF37:
905 TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested?
906; $IF NE ;;AN000;; Yes,
907 JE $MIF39
908 LES DI,DWORD PTR $M_RT.$M_PARSE_COMMAND[SI] ;;AN000;; Get address of class
909 MOV BX,ES ;;AN000;
910; $ELSE ;;AN000;; No, extended errors were specified
911 JMP SHORT $MEN39
912$MIF39:
913 CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error?
914; $IF AE,AND ;;AN000;;
915 JNAE $MIF41
916 CMP AX,$M_CRIT_HI ;;AN000;;
917; $IF BE ;;AN000;; Yes,
918 JNBE $MIF41
919 LES DI,DWORD PTR $M_RT.$M_CRIT_ADDRS[SI] ;;AN000;; Get address of class
920 MOV BX,ES ;;AN000;
921; $ELSE ;;AN000;;
922 JMP SHORT $MEN41
923$MIF41:
924 LES DI,DWORD PTR $M_RT.$M_EXT_ERR_ADDRS[SI] ;;AN000;; Get address of class
925 MOV BX,ES ;;AN000;
926; $ENDIF ;;AN000;;
927$MEN41:
928; $ENDIF ;;AN000;;
929$MEN39:
930; $ENDIF ;;AN000;;
931$MEN37:
932 ;;
933 CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes?
934; $IF E ;;AN000;; Yes,
935 JNE $MIF46
936 CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class?
937; $IF E ;;AN000;; Yes,
938 JNE $MIF47
939 STC ;;AN000;; Set the carry flag
940; $ELSE ;;AN000;; No,
941 JMP SHORT $MEN47
942$MIF47:
943 MOV $M_RT.$M_MSG_NUM,AX ;;AN000;; Save message number
944 MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number
945 MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message
946 XOR SI,SI ;;AN000;; Reset the SI index to start again
947 CLC ;;AN000;;
948; $ENDIF ;;AN000;; No,
949$MEN47:
950; $ELSE ;;AN000;;
951 JMP SHORT $MEN46
952$MIF46:
953 CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist?
954; $IF NE ;;AN001;; Yes,
955 JE $MIF51
956 CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message
957; $ENDIF ;;AN000;;
958$MIF51:
959 ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class
960 CLC ;;AN000;;
961; $ENDIF ;;AN000;;
962$MEN46:
963; $LEAVE C ;;AN000;;
964 JC $MEN36
965 OR CX,CX ;;AN000;; Was the message found?
966; $ENDDO NZ,LONG ;;AN000;;
967 JNZ $MXL2
968 JMP $MDO36
969$MXL2:
970$MEN36:
971
972 PUSHF ;;AN006;; Save the flag state
973 CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested?
974; $IF E ;;AN006;; Yes,
975 JNE $MIF56
976 PUSH DX ;;AN006;; Save all needed registers
977 PUSH BP ;;AN006;;
978 PUSH CX ;;AN006;;
979 PUSH ES ;;AN006;;
980 PUSH DI ;;AN006;;
981 PUSH AX ;;AN006;;
982
983 MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed
984 INT 2FH ;;AN006;;
985 CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed?
986 POP AX ;;AN006;; Restore msg number
987; $IF E ;;AN006;; Yes,
988 JNE $MIF57
989 MOV BX,AX ;;AN006;; BX is the extended error number
990 MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number
991 INT 2FH ;;AN006;; Call IFSFUNC
992; $ELSE ;;AN006;; No,
993 JMP SHORT $MEN57
994$MIF57:
995 STC ;;AN006;; Carry conditon
996; $ENDIF ;;AN006;;
997$MEN57:
998
999; $IF C ;;AN006;; Was there an update?
1000 JNC $MIF60
1001 POP DI ;;AN006;; No,
1002 POP ES ;;AN006;; Restore old pointer
1003 POP CX ;;AN006;;
1004; $ELSE ;;AN006;; Yes
1005 JMP SHORT $MEN60
1006$MIF60:
1007 ADD SP,6 ;;AN006;; Throw away old pointer
1008 CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string
1009; $ENDIF ;;AN006;;
1010$MEN60:
1011 POP BP ;;AN006;; Restore other Regs
1012 POP DX ;;AN006;;
1013; $ENDIF ;;AN006;;
1014$MIF56:
1015 $M_POPF ;;AN006;; Restore the flag state
1016
1017 POP BX ;;AN000;;
1018 POP SI ;;AN000;;
1019 RET ;;AN000;; Return ES:DI pointing to the message
1020 ;;
1021$M_GET_MSG_ADDRESS ENDP ;;
1022 ;;
1023$M_SET_LEN_IN_CX PROC NEAR ;;
1024 ;;
1025 PUSH DI ;;AN006;; Save position
1026 PUSH AX ;;AN006;;
1027 MOV CX,-1 ;;AN006;; Set CX for decrements
1028 XOR AL,AL ;;AN006;; Prepare compare register
1029 REPNE SCASB ;;AN006;; Scan for zero
1030 NOT CX ;;AN006;; Change decrement into number
1031 DEC CX ;;AN006;; Don't include the zero
1032 POP AX ;;AN006;;
1033 POP DI ;;AN006;; Restore position
1034 RET ;;AN006;;
1035 ;;
1036$M_SET_LEN_IN_CX ENDP ;;
1037 ;;
1038;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1039;;
1040;; PROC NAME: $M_FIND_SPECIFIED_MSG
1041;;
1042;; FUNCTION: To scan thru message headers until message is found
1043;; INPUTS: ES:DI points to beginning of msg headers
1044;; CX contains the number of messages in class
1045;; DH contains the message class
1046;; OUPUTS: IF CX = 0 THEN Message was not found
1047;; IF CX > 1 THEN ES:DI points to header of specified message
1048;;
1049;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1050 ;;
1051$M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;;
1052 ;;
1053 CMP BX,1 ;;AN004;; Do we have an address to CALL?
1054; $IF E,AND ;;AN004;; Yes,
1055 JNE $MIF64
1056 CMP WORD PTR $M_RT.$M_DISK_PROC_ADDR,-1 ;;AN004;; Do we have an address to CALL?
1057; $IF NE ;;AN004;; Yes,
1058 JE $MIF64
1059 CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err?
1060; $IF E ;;AN004;; . . . and . . .
1061 JNE $MIF65
1062 PUSH AX ;;AN004;; Reset the special message number
1063 MOV AX,$M_RT.$M_MSG_NUM ;;AN004;; Get the old message number
1064 CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
1065 POP AX ;;AN004;; Reset the special message number
1066; $ELSE ;;AN004;; Get the old message number
1067 JMP SHORT $MEN65
1068$MIF65:
1069 CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
1070; $ENDIF ;;AN004;; Get the old message number
1071$MEN65:
1072; $ELSE ;;AN004;;
1073 JMP SHORT $MEN64
1074$MIF64:
1075 XOR CX,CX ;;AN002;; CX = 0 will allow us to
1076 CMP DH,UTILITY_MSG_CLASS ;;AN001;;
1077; $IF NE ;;AN001;;
1078 JE $MIF69
1079 MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN001;; Get number of messages in class
1080; $ELSE ;;AN001;;
1081 JMP SHORT $MEN69
1082$MIF69:
1083IF FARmsg ;;AN001;;
1084 CMP BYTE PTR ES:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
1085ELSE
1086 CMP BYTE PTR CS:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
1087ENDIF
1088; $IF E ;;AN002;; pointer (hopefully)
1089 JNE $MIF71
1090IF FARmsg ;;AN001;;
1091 MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
1092ELSE
1093 MOV CL,BYTE PTR CS:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
1094ENDIF
1095; $ENDIF ;;AN002;; go on to the next class
1096$MIF71:
1097; $ENDIF ;;AN001;;
1098$MEN69:
1099 ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header
1100 STC ;;AN004;; Flag that we haven't found anything yet
1101; $ENDIF ;;AN004;;
1102$MEN64:
1103
1104; $IF C ;;AN004;; Have we found anything yet?
1105 JNC $MIF75
1106 CLC ;;AN004;; No, reset carry
1107; $SEARCH ;;AN000;;
1108$MDO76:
1109 OR CX,CX ;;AN000;; Do we have any to check?
1110; $LEAVE Z ;;AN000;; No, return with CX = 0
1111 JZ $MEN76
1112 CMP DH,UTILITY_MSG_CLASS ;;AN001;;
1113; $IF NE ;;AN001;;
1114 JE $MIF78
1115 CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN001;; Is this the message requested?
1116; $ELSE ;;AN001;;
1117 JMP SHORT $MEN78
1118$MIF78:
1119IF FARmsg ;;AN001;;
1120 CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN000;; Is this the message requested?
1121ELSE
1122 CMP AX,WORD PTR CS:[DI].$M_NUM ;;AN000;; Is this the message requested?
1123ENDIF
1124; $ENDIF
1125$MEN78:
1126; $EXITIF E ;;AN000;;
1127 JNE $MIF76
1128; $ORELSE ;;AN000;
1129 JMP SHORT $MSR76
1130$MIF76:
1131 DEC CX ;;AN000;; No, well do we have more to check?
1132; $LEAVE Z ;;AN000;; No, return with CX = 0
1133 JZ $MEN76
1134 ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header
1135; $ENDLOOP ;;AN000;;
1136 JMP SHORT $MDO76
1137$MEN76:
1138 STC ;;AN000;;
1139; $ENDSRCH ;;AN000;; Check next message
1140$MSR76:
1141; $IF NC ;;AN000;; Did we find the message?
1142 JC $MIF86
1143 CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message?
1144 CLC ;;AN001;;
1145; $IF E ;;AN001;;
1146 JNE $MIF87
1147IF FARmsg ;;AN001;;
1148ELSE ;;AN000;;
1149 PUSH CS ;;AN000;;
1150 POP ES ;;AN000;; Return ES:DI pointing to the message
1151ENDIF
1152; $ENDIF ;;AN001;;
1153$MIF87:
1154 ADD DI,WORD PTR ES:[DI].$M_TXT_PTR ;;AN000;; Prepare ES:DI pointing to the message
1155; $ENDIF ;;AN004;;
1156$MIF86:
1157; $ENDIF ;;AN004;;
1158$MIF75:
1159 ;; Yes, great we can return with CX > 0
1160
1161; $IF NC ;;AN000;; Did we find the message?
1162 JC $MIF91
1163 XOR CH,CH ;;AN000;;
1164 MOV CL,BYTE PTR ES:[DI] ;;AN000;; Move size into CX
1165 INC DI ;;AN000;; Increment past length
1166; $ENDIF ;;AN004;;
1167$MIF91:
1168
1169 MOV $M_RT.$M_SIZE,$M_NULL ;;AN004;; Reset variable
1170 RET ;;AN000;; Return
1171 ;;
1172$M_FIND_SPECIFIED_MSG ENDP ;;AN000;;
1173 ;;
1174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1175 ENDIF ;;AN000;; END of include of common subroutines
1176 ENDIF ;;AN000;; END of include of SYSGETMSG
1177;
1178 IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ?
1179 IF COMR ;;AN000;;
1180 $M_RT EQU $M_RT2 ;;AN000;;
1181 ENDIF ;;AN000;;
1182 DISPLAYmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
1183 PAGE
1184 SUBTTL DOS - Message Retriever - DISPMSG.ASM Module
1185;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1186;;
1187;; Proc Name: SYSDISPMSG
1188;;
1189;; Function: The DISPLAY service will output a defined message to a handle
1190;; requested by the caller. It also provides function to display
1191;; messages when handles are not applicable (ie. DOS function calls
1192;; 00h to 0Ah) Replaceable parameters are allowed and are
1193;; defined previous to entry.
1194;;
1195;; It is assumes that a PRELOAD function has already determined
1196;; the addressibilty internally to the message retriever services.
1197;; Inputs:
1198;;
1199;; Outputs:
1200;;
1201;; Psuedocode:
1202;; Save registers needed later
1203;; Get address of the message requested
1204;; IF Message number exists THEN
1205;; IF replacable parameters were specified THEN
1206;; Display message with replacable parms
1207;; ELSE
1208;; Display string without replacable parms
1209;; ENDIF
1210;; IF character input was requested THEN
1211;; Wait for character input
1212;; ENDIF
1213;; Clear CARRY FLAG
1214;; ELSE
1215;; Set CARRY FLAG
1216;; ENDIF
1217;; Return
1218;;
1219;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1220 ;;
1221IF FARmsg ;;AN000;;
1222 SYSDISPMSG PROC FAR ;;AN000;;
1223ELSE ;;AN000;;
1224 SYSDISPMSG PROC NEAR ;;AN000;;
1225ENDIF ;;AN000;;
1226 ;;
1227;; Save registers and values needed later
1228
1229 PUSH AX ;;AN000;; Save changed REGs
1230 PUSH BX ;;AN000;;
1231 PUSH CX ;;AN000;;
1232 PUSH BP ;;AN000;;
1233 PUSH DI ;;AN000;; Save pointer to input buffer (offset)
1234 PUSH ES ;;AN000;; Save pointer to input buffer (segment)
1235 PUSH DX ;;AN000;; Save Input/Class request
1236
1237 MOV BP,CX ;;AN000;; Use BP to hold replace count
1238 MOV WORD PTR $M_RT.$M_HANDLE,BX ;;AN000;; Save handle
1239 MOV BYTE PTR $M_RT.$M_CLASS,DH ;;AN004;; Save class
1240
1241;; Get address of the message requested
1242
1243IF FARmsg ;;AN000;;
1244 CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
1245ELSE ;;AN000;;
1246 CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
1247ENDIF ;;AN000;;
1248 OR CX,CX ;;AN000;; Was message found?
1249; $IF NZ ;;AN000;; YES, Message address in ES:DI
1250 JZ $MIF93
1251
1252;; Test if replacable parameters were specified
1253
1254 OR BP,BP ;;AN000;; Were replacable parameters requested
1255; $IF Z ;;AN000;;
1256 JNZ $MIF94
1257
1258;; Display string without replacable parms
1259
1260 CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message
1261; $ELSE ;;AN000;;
1262 JMP SHORT $MEN94
1263$MIF94:
1264IF $M_REPLACE ;;AN000;;
1265
1266;; Display message with replacable parms
1267
1268 CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions
1269ENDIF ;;AN000;;
1270; $ENDIF ;;AN000;;
1271$MEN94:
1272; $IF NC
1273 JC $MIF97
1274
1275 POP DX ;;AN000;; Get Input/Class request
1276
1277 CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars.
1278
1279 POP ES ;;AN000;; Get location of input buffer (if specified)
1280 POP DI ;;AN000;;
1281
1282;; Test if character input was requested
1283
1284IF INPUTmsg ;;AN000;;
1285 OR DL,DL ;;AN000;; Was Wait-For-Input requested?
1286; $IF NZ ;;AN000;;
1287 JZ $MIF98
1288 CALL $M_WAIT_FOR_INPUT ;;AN000;;
1289; $ENDIF ;;AN000;;
1290$MIF98:
1291ENDIF ;;AN000;;
1292; $ELSE ;;AN000;;
1293 JMP SHORT $MEN97
1294$MIF97:
1295 ADD SP,6 ;;AN000;;
1296 STC ;;AN000;; Reset carry flag
1297; $ENDIF ;;AN000;;
1298$MEN97:
1299; $ELSE ;;AN000;; No,
1300 JMP SHORT $MEN93
1301$MIF93:
1302 POP ES ;;AN000;; Get pointer to input buffer (segment)
1303 POP DI ;;AN000;; Get base pointer to first sublist (offset)
1304 POP DX ;;AN000;; Get base pointer to first sublist (segment)
1305 STC ;;AN000;; Set carry flag
1306; $ENDIF ;;AN000;;
1307$MEN93:
1308 ;;
1309; $IF NC ;;AN000;; Was there an error?
1310 JC $MIF104
1311 POP BP ;;AN000;; No,
1312 POP CX ;;AN000;;
1313 POP BX ;;AN000;;
1314IF INPUTmsg ;;AN000;;
1315 ADD SP,2 ;;AN000;;
1316ELSE ;AN000;
1317 POP AX ;;AN000;;
1318ENDIF ;;AN000;;
1319; $ELSE ;;AN000;; Yes,
1320 JMP SHORT $MEN104
1321$MIF104:
1322 ADD SP,8 ;;AN000;; Eliminate from stack
1323 STC ;;AN000;;
1324; $ENDIF ;;AN000;;
1325$MEN104:
1326 ;;
1327 RET ;;AN000;; Return
1328 ;;
1329 SYSDISPMSG ENDP ;;AN000;;
1330 ;;
1331;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1332;
1333;;
1334;; PROC NAME: $M_DISPLAY_STRING
1335;;
1336;; FUNCTION: Will display or write string
1337;; INPUTS: ES:DI points to beginning of message
1338;; CX contains the length of string to write (if applicable)
1339;; OUTPUTS: None
1340;; REGS Revised: None
1341;;
1342;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1343 ;;
1344$M_DISPLAY_STRING PROC NEAR ;;AN000;;
1345 ;;
1346 PUSH AX ;;AN000;;
1347 PUSH BX ;;AN000;;
1348 PUSH DX ;;AN000;;
1349 ;;
1350 MOV BX,$M_RT.$M_HANDLE ;;AN000;; Retrieve handle
1351 ;;
1352IF COMR ;; ** Special case for RESIDENT COMMAND.COM
1353 CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string
1354ELSE
1355 CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified?
1356; $IF E ;;AN000;;
1357 JNE $MIF107
1358 CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string
1359; $ELSE ;;AN000;;
1360 JMP SHORT $MEN107
1361$MIF107:
1362 CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle
1363; $ENDIF ;;AN000;;
1364$MEN107:
1365 ;AN001;
1366; $IF C ;;AN000;; Was there an error?
1367 JNC $MIF110
1368 MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes,
1369 MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error
1370 INT 21H ;;AN000;;
1371 XOR AH,AH ;;AN000;; Clear AH
1372 ADD SP,6 ;;AN000;; Clean up stack
1373 STC ;;AN000;; Flag that there was an error
1374; $ELSE ;;AN000;; No,
1375 JMP SHORT $MEN110
1376$MIF110:
1377 CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified?
1378; $IF NE ;;AN000;;
1379 JE $MIF112
1380 CMP AX,CX ;AN001; Was it ALL written?
1381; $IF NE ;AN001; No,
1382 JE $MIF113
1383 CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error
1384 ADD SP,6 ;AN001; Clean up stack
1385 STC ;AN001; Flag that there was an error
1386; $ENDIF ;AN001;
1387$MIF113:
1388; $ENDIF ;AN001;
1389$MIF112:
1390; $ENDIF ;;AN000;;
1391$MEN110:
1392ENDIF
1393; $IF NC ;;AN000;; Was there ANY error?
1394 JC $MIF117
1395 POP DX ;;AN000;; Restore regs
1396 POP BX ;;AN000;;
1397 POP AX ;;AN000;;
1398; $ENDIF ;;AN000;;
1399$MIF117:
1400 RET ;;AN000;; Return
1401 ;;
1402$M_DISPLAY_STRING ENDP ;;AN000;;
1403 ;;
1404;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1405;;
1406;; PROC NAME: $M_DISPLAY_$_STRING
1407;;
1408;; FUNCTION: Will display a $ terminated string
1409;; INPUTS: ES:DI points to beginning of message text (not the length)
1410;; OUPUTS: None
1411;; REGS USED: AX,DX
1412;;
1413;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1414 ;;
1415$M_DISPLAY_$_STRING PROC NEAR ;;AN000;;
1416 ;;
1417 PUSH DS ;;AN000;;
1418 PUSH ES ;;AN000;;
1419 POP DS ;;AN000;; Set DS to segment of message text
1420IF NOT COMR
1421 CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character?
1422; $IF E ;;AN000;; Yes,
1423 JNE $MIF119
1424 MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER
1425 MOV DL,BYTE PTR ES:[DI] ;;AN000;; Get the character
1426 INT 21H ;;AN000;; Write character
1427 POP DS ;;AN000;; Set DS to segment of message text
1428 MOV AL,DL ;;AN000;; Get the character in AL
1429 CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
1430 PUSH DS ;;AN000;;
1431 PUSH ES ;;AN000;;
1432 POP DS ;;AN000;; Set DS to segment of message text
1433; $IF C ;;AN000;; Yes,
1434 JNC $MIF120
1435 MOV DL,BYTE PTR ES:[DI]+1 ;;AN000;; Get the next character
1436 INT 21H ;;AN000;; Write character
1437 CLC ;;AN000;; Clear the DBCS indicator
1438; $ENDIF ;;AN000;;
1439$MIF120:
1440; $ELSE ;;AN000;; No,
1441 JMP SHORT $MEN119
1442$MIF119:
1443ENDIF
1444 MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER
1445; $DO ;;AN002;; No,
1446$MDO123:
1447 OR CX,CX ;;AN002;; Are there any left to display?
1448; $LEAVE Z ;;AN002;; Yes,
1449 JZ $MEN123
1450 MOV DL,BYTE PTR ES:[DI] ;;AN002;; Get the character
1451 INT 21H ;;AN002;; Display the character
1452 INC DI ;;AN002;; Set pointer to next character
1453 DEC CX ;;AN002;; Count this character
1454; $ENDDO Z ;;AN002;; No,
1455 JNZ $MDO123
1456$MEN123:
1457IF NOT COMR
1458; $ENDIF ;;AN000;;
1459$MEN119:
1460ENDIF
1461 CLC ;;AN000;; Char functions used don't return carry as error
1462 POP DS ;;AN000;;
1463 RET ;;AN000;;
1464 ;;
1465$M_DISPLAY_$_STRING ENDP ;;AN000;;
1466 ;;
1467IF NOT COMR
1468;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1469;;
1470;; PROC NAME: $M_DISPLAY_H_STRING
1471;;
1472;; FUNCTION: Will display a string to a specified handle
1473;; INPUTS: ES:DI points to beginning of message
1474;; CX contains the number of bytes to write
1475;; BX contains the handle to write to
1476;; OUPUTS: None
1477;; REGS USED: AX,DX
1478;;
1479;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1480 ;;
1481$M_DISPLAY_H_STRING PROC NEAR ;;AN000;;
1482 ;;
1483 XOR AX,AX ;;AN002;; Set number of bytes written to 0
1484 OR CX,CX ;;AN002;; For performance, don't write if not necessary
1485; $IF NZ ;;AN002;; Any chars to write?
1486 JZ $MIF127
1487 PUSH DS ;;AN000;; Yes,
1488 PUSH ES ;;AN000;;
1489 POP DS ;;AN000;; Set DS to segment of message text
1490 MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle
1491 MOV DX,DI ;;AN000;; Pointer to data to write
1492 CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character?
1493; $IF E ;;AN000;; Yes,
1494 JNE $MIF128
1495 INT 21H ;;AN000;; Write character
1496 POP DS ;;AN000;; Set DS to segment of message text
1497 PUSH AX ;;AN000;;
1498 MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
1499 CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
1500 POP AX ;;AN000;; Set DS to segment of message text
1501 PUSH DS ;;AN000;;
1502 PUSH ES ;;AN000;;
1503 POP DS ;;AN000;; Set DS to segment of message text
1504; $IF C ;;AN000;; Yes,
1505 JNC $MIF129
1506 CLC ;;AN000;; Clear the DBCS indicator
1507 MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle
1508 INC DX ;;AN000;; Point to next character
1509 INT 21H ;;AN000;; Write character
1510; $ENDIF ;;AN000;;
1511$MIF129:
1512; $ELSE ;;AN000;; No,
1513 JMP SHORT $MEN128
1514$MIF128:
1515 INT 21H ;;AN000;; Write String at DS:SI to handle
1516; $ENDIF ;;AN000;;
1517$MEN128:
1518 POP DS ;;AN000;;
1519; $ENDIF ;;AN002;;
1520$MIF127:
1521 ;;
1522 RET ;;AN000;;
1523 ;;
1524$M_DISPLAY_H_STRING ENDP ;;AN000;;
1525 ;;
1526;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1527;;
1528;; PROC NAME: $M_GET_EXT_ERR_39
1529;;
1530;; FUNCTION: Will set registers for extended error #39
1531;; INPUTS: None
1532;; OUPUTS: AX,BX,CX set
1533;; REGS USED:
1534;;
1535;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1536 ;;
1537$M_GET_EXT_ERR_39 PROC NEAR ;AN001;
1538 ;;
1539 MOV AX,EXT_ERR_39 ;AN001; Set AX=39
1540 MOV BX,(ERROR_CLASS_39 SHR 8) + ACTION_39 ;AN001; Set BH=1 BL=4
1541 MOV CH,LOCUS_39 ;AN001; Set CH=1
1542 ;AN001;
1543 RET ;AN001;
1544 ;;
1545$M_GET_EXT_ERR_39 ENDP ;AN001;
1546 ;;
1547;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1548ENDIF
1549;;
1550;; PROC NAME: $M_ADD_CRLF
1551;;
1552;; FUNCTION: Will decide whether to display a CRLF
1553;; INPUTS: DX contains the Input/Class requested
1554;; OUTPUTS: None
1555;; REGS Revised: CX,ES,DI
1556;;
1557;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1558 ;;
1559$M_ADD_CRLF PROC NEAR ;;AN004;;
1560 ;;
1561 CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message?
1562; $IF NE ;;AN004;; No,
1563 JE $MIF134
1564 TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF?
1565; $IF Z ;;AN004;; No,
1566 JNZ $MIF135
1567 PUSH DS ;;AN004;;
1568 POP ES ;;AN004;; Set ES to data segment
1569 LEA DI,$M_RT.$M_CRLF ;;AN004;; Point at CRLF message
1570 MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size
1571 CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF
1572; $ENDIF ;;AN004;;
1573$MIF135:
1574; $ENDIF ;;AN004;;
1575$MIF134:
1576 RET ;;AN004;; Return
1577 ;;
1578$M_ADD_CRLF ENDP ;;AN004;;
1579 ;;
1580;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1581;;
1582;; PROC NAME: $M_IS_IT_DBCS
1583;;
1584;; FUNCTION: Will decide whether character is Single or Double Byte
1585;; INPUTS: AL contains the byte to be checked
1586;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range
1587;; Carry flag = 1 if byte IS in DBCS range
1588;; REGS USED: All restored
1589;;
1590;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1591 ;;
1592$M_IS_IT_DBCS PROC NEAR ;;AN000;;
1593 ;;
1594 PUSH ES ;;AN000;; Save Extra segment register
1595 PUSH DI ;;AN000;; Save SI register
1596 ;;
1597 LES DI,$M_RT.$M_DBCS_VEC ;;AN000;;
1598 OR DI,DI ;;AN000;; Was the DBCS vector set?
1599; $IF NZ ;;AN000;;
1600 JZ $MIF138
1601; $DO ;;AN000;;
1602$MDO139:
1603 CMP WORD PTR ES:[DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag?
1604 CLC ;;AN000;;
1605; $LEAVE E ;;AN000;;
1606 JE $MEN139
1607 ;; No,
1608 CMP AL,BYTE PTR ES:[DI] ;;AN000;; Does the character fall in the DBCS range?
1609; $IF AE,AND ;;AN000;;
1610 JNAE $MIF141
1611 CMP AL,BYTE PTR ES:[DI]+1 ;;AN000;; Does the character fall in the DBCS range?
1612; $IF BE ;;AN000;;
1613 JNBE $MIF141
1614 STC ;;AN000;; Yes,
1615; $ENDIF ;;AN000;; Set carry flag
1616$MIF141:
1617 INC DI ;;AN000;; No,
1618 INC DI ;;AN000;; Go to next vector
1619; $ENDDO ;;AN000;;
1620 JMP SHORT $MDO139
1621$MEN139:
1622; $ENDIF ;;AN000;;
1623$MIF138:
1624
1625 POP DI ;;AN000;;
1626 POP ES ;;AN000;; Restore SI register
1627 RET ;;AN000;; Return
1628 ;;
1629$M_IS_IT_DBCS ENDP ;;AN000;;
1630 ;;
1631;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1632;;
1633;; PROC NAME: $M_CONVERT2ASC
1634;;
1635;; FUNCTION: Convert a binary number to a ASCII string
1636;; INPUTS: DX:AX contains the number to be converted
1637;; $M_RT_DIVISOR contains the divisor
1638;; OUPUTS: CX contains the number of characters
1639;; Top of stack --> Last character
1640;; . . .
1641;; Bot of stack --> First character
1642;; REGS USED:
1643;;
1644;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1645 ;;
1646$M_CONVERT2ASC PROC NEAR ;;AN000;;
1647 ;;
1648 POP [$M_RT.$M_RETURN_ADDR] ;;AN000;; Save Return Address
1649 XOR BX,BX ;;AN000;; Use BP as a swapping register
1650 ;;
1651 XCHG BX,AX ;;AN000;; Initialize - Low Word in BP
1652 XCHG AX,DX ;;AN000;; - High Word in AX
1653; $DO ;;AN000;; DO UNTIL Low Word becomes zero
1654$MDO145:
1655 DIV $M_RT.$M_DIVISOR ;;AN000;; Divide High Word by divisor
1656 XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder
1657 ;; and save reduced High Word in BP
1658 DIV $M_RT.$M_DIVISOR ;;AN000;; Divide Low Word by divisor
1659 CMP DX,9 ;;AN000;; Make a digit of the remainder
1660; $IF A ;;AN000;; IF 10 to 15,
1661 JNA $MIF146
1662 ADD DL,55 ;;AN000;; Make A to F ASCII
1663; $ELSE ;;AN000;; IF 0 to 9,
1664 JMP SHORT $MEN146
1665$MIF146:
1666 ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII
1667; $ENDIF ;;AN000;;
1668$MEN146:
1669 PUSH DX ;;AN000;; Save the digit on the stack
1670 INC CX ;;AN000;; Count that digit
1671 OR AX,AX ;;AN000;; Are we done?
1672; $LEAVE Z,AND ;;AN000;;
1673 JNZ $MLL149
1674 OR BX,BX ;;AN000;; AX and BX must be ZERO!!
1675; $LEAVE Z ;;AN000;; No,
1676 JZ $MEN145
1677$MLL149:
1678IF NOT COMR
1679 CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark
1680; $IF E ;;AN000;; Yes,
1681 JNE $MIF150
1682 CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
1683; $IF E ;;AN000;; Yes,
1684 JNE $MIF151
1685 PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
1686 INC CX ;;AN000;;
1687; $ENDIF ;;AN000;;
1688$MIF151:
1689; $ELSE ;;AN000;; No,
1690 JMP SHORT $MEN150
1691$MIF150:
1692 CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark
1693; $IF E ;;AN000;; Yes,
1694 JNE $MIF154
1695 CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
1696; $IF E ;;AN000;; Yes,
1697 JNE $MIF155
1698 PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
1699 INC CX ;;AN000;;
1700; $ENDIF ;;AN000;;
1701$MIF155:
1702; $ELSE ;;AN000;; No,
1703 JMP SHORT $MEN154
1704$MIF154:
1705 CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark
1706; $IF E ;;AN000;; Yes,
1707 JNE $MIF158
1708 CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
1709; $IF E ;;AN000;; Yes,
1710 JNE $MIF159
1711 PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
1712 INC CX ;;AN000;;
1713; $ENDIF ;;AN000;;
1714$MIF159:
1715; $ENDIF ;;AN000;;
1716$MIF158:
1717; $ENDIF ;;AN000;;
1718$MEN154:
1719; $ENDIF ;;AN000;;
1720$MEN150:
1721ENDIF
1722 XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word
1723 ;;AN000;; and Revised Low Word
1724 XOR DX,DX ;;AN000;; Reset remainder
1725; $ENDDO ;;AN000;; NEXT
1726 JMP SHORT $MDO145
1727$MEN145:
1728 ;;AN000;; Yes,
1729 XOR DX,DX ;;AN000;; Reset remainder
1730 XOR AX,AX ;;AN000;; Reset remainder
1731 PUSH [$M_RT.$M_RETURN_ADDR] ;;AN000;; Restore Return Address
1732 RET ;;AN000;; Return
1733 ;;
1734$M_CONVERT2ASC ENDP ;;AN000;;
1735 ;;
1736;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1737;;
1738;; PROC NAME: $M_DISPLAY_MESSAGE
1739;;
1740;; FUNCTION: Will display or write entire message (with replacable parameters)
1741;; INPUTS: ES:DI points to beginning of message
1742;; DS:SI points to first sublist structure in chain
1743;; BX contains the handle to write to (if applicable)
1744;; CX contains the length of string to write (before substitutions)
1745;; BP contains the count of replacables
1746;;
1747;; OUTPUTS:
1748;; REGS USED: All
1749;;
1750;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1751 ;;
1752$M_DISPLAY_MESSAGE PROC NEAR ;;AN000;;
1753 ;;
1754; $DO ;;AN000;; Note: DS:SI -> message
1755$MDO165:
1756 XOR DX,DX ;;AN000;; Set size = 0
1757 OR CX,CX ;;AN000;; Are we finished the message yet?
1758; $IF NZ ;;AN000;; No,
1759 JZ $MIF166
1760 MOV AH,"%" ;;AN000;; Prepare to scan for %
1761 MOV AL,0 ;;AN004;;
1762 ;;
1763; $DO ;;AN000;; Scan through string until %
1764$MDO167:
1765 CMP BYTE PTR ES:[DI],AH ;;AN000;; Is this character NOT a %
1766; $LEAVE E,AND ;;AN000;; No,
1767 JNE $MLL168
1768 CMP BYTE PTR ES:[DI+1],AH ;;AN000;; Is the next character also a %
1769; $LEAVE NE,AND ;;AN000;; No,
1770 JE $MLL168
1771 CMP AL,AH ;;AN000;; Was the character before a %
1772; $LEAVE NE ;;AN000;; No, GREAT found it
1773 JNE $MEN167
1774$MLL168:
1775 MOV AL,BYTE PTR ES:[DI] ;;AN004;; Yes, (to any of the above)
1776 CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS?
1777; $IF C ;;AN004;; Yes,
1778 JNC $MIF169
1779 INC DI ;;AN004;; Increment past second part
1780; $ENDIF ;;AN004;;
1781$MIF169:
1782 INC DI ;;AN000;; Next character in string
1783 INC DX ;;AN000;; Size = Size + 1
1784 DEC CX ;;AN000;; Decrement total size
1785; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line
1786 JNZ $MDO167
1787$MEN167:
1788; $ENDIF ;;AN000;;
1789$MIF166:
1790 ;;
1791 PUSH SI ;;AN000;; Save beginning of sublists
1792 XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX)
1793 OR BP,BP ;;AN000;; Do we have any replacables to do?
1794; $IF NZ ;;AN000;; Yes,
1795 JZ $MIF173
1796 DEC BP ;;AN000;; Decrement number of replacables
1797
1798;; Search through sublists to find applicable one
1799
1800 CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
1801; $IF E ;;AN000;; No,
1802 JNE $MIF174
1803; $SEARCH ;;AN000;;
1804$MDO175:
1805 MOV AL,$M_SL.$M_S_ID ;;AN000;; Get ID byte
1806 ADD AL,30H ;;AN000;; Convert to ASCII
1807 CMP AL,BYTE PTR ES:[DI]+1 ;;AN000;; Is this the right sublist?
1808; $EXITIF E ;;AN000;;
1809 JNE $MIF175
1810; $ORELSE ;;AN000;; No,
1811 JMP SHORT $MSR175
1812$MIF175:
1813 CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0
1814; $LEAVE E,AND ;;AN000;; Yes,
1815 JNE $MLL178
1816 OR DX,DX ;;AN000;; Are we at the end of the message?
1817; $LEAVE Z ;;AN000;; No,
1818 JZ $MEN175
1819$MLL178:
1820 ADD SI,WORD PTR $M_SL.$M_S_SIZE ;;AN000;; Next SUBLIST
1821; $ENDLOOP ;;AN000;; Yes,
1822 JMP SHORT $MDO175
1823$MEN175:
1824 CMP $M_RT.$M_CLASS,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message?
1825; $IF E ;;AN004;; Yes,
1826 JNE $MIF180
1827 INC DX ;;AN000;; Remember to display CR,LF
1828 INC DX ;;AN000;; at the end of the message
1829 DEC CX ;;AN000;; Adjust message length
1830 DEC CX ;;AN000;;
1831 DEC DI ;;AN000;; Adjust ending address of message
1832 DEC DI ;;AN000;;
1833; $ELSE ;;AN004;; No,
1834 JMP SHORT $MEN180
1835$MIF180:
1836 MOV DX,-1 ;;AN004;; Set special case
1837; $ENDIF ;;AN004;;
1838$MEN180:
1839; $ENDSRCH ;;AN000;;
1840$MSR175:
1841; $ENDIF ;;AN000;;
1842$MIF174:
1843; $ENDIF ;;AN000;;
1844$MIF173:
1845
1846;; Prepare and display this part of message
1847
1848 PUSH DI ;;AN000;; Save pointer to replace number
1849 SUB DI,CX ;;AN000;; Determine beginning of string
1850 CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end)
1851 POP DI ;;AN000;; Get back pointer to replace number
1852 POP CX ;;AN000;; Clean up stack in case error
1853; $LEAVE C,LONG ;;AN000;; Fail if carry was set
1854 JNC $MXL3
1855 JMP $MEN165
1856$MXL3:
1857 PUSH CX ;;AN000;;
1858
1859;; Save and reset pointer registers
1860
1861 MOV CX,DX ;;AN000;; Get the size of the rest of the message
1862 CMP $M_SL.$M_S_ID,$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case?
1863; $IF NE ;;AN000;; No,
1864 JE $MIF187
1865 OR CX,CX ;;AN000;; Are we finished the whole message?
1866; $IF NZ ;;AN000;; No,
1867 JZ $MIF188
1868 DEC CX ;;AN000;; Decrement total size (%)
1869 DEC CX ;;AN000;; Decrement total size (#)
1870 INC DI ;;AN000;; Go past %
1871 INC DI ;;AN000;; Go past replace number
1872; $ELSE ;;AN000;; Yes, (Note this will not leave because INC)
1873 JMP SHORT $MEN188
1874$MIF188:
1875 POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs
1876; $ENDIF ;;AN000;; Yes, Note this will not leave because INC
1877$MEN188:
1878; $ELSE ;;AN000;;
1879 JMP SHORT $MEN187
1880$MIF187:
1881 OR CX,CX ;;AN000;; Are we finished the whole message?
1882; $IF Z ;;AN004;; No,
1883 JNZ $MIF192
1884 POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs
1885; $ELSE ;;AN000;; No,
1886 JMP SHORT $MEN192
1887$MIF192:
1888 CMP CX,-1 ;;AN004;; Are we at the end of the message?
1889; $IF Z ;;AN004;; No,
1890 JNZ $MIF194
1891 XOR CX,CX ;;AN004;;
1892; $ENDIF ;;AN000;;
1893$MIF194:
1894 OR DI,DI ;;AN004;; Turn ZF off
1895; $ENDIF ;;AN000;;
1896$MEN192:
1897; $ENDIF ;;AN000;; Note this will not leave because INC
1898$MEN187:
1899; $LEAVE Z ;;AN000;;
1900 JZ $MEN165
1901 PUSH BP ;;AN000;; Save the replace count
1902 PUSH DI ;;AN000;; Save location to complete message
1903 PUSH ES ;;AN000;;
1904 PUSH CX ;;AN000;; Save size of the rest of the message
1905 XOR CX,CX ;;AN000;; Reset CX used for character count
1906
1907;; Determine what action is required on parameter
1908
1909 CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
1910; $IF E ;;AN000;;
1911 JNE $MIF199
1912
1913IF CHARmsg ;;AN000;; Was Char specified?
1914 TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
1915; $IF Z ;;AN000;;
1916 JNZ $MIF200
1917
1918;; Character type requested
1919 ;;AN000;;
1920 LES DI,DWORD PTR $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter
1921 CALL $M_CHAR_REPLACE ;;AN000;;
1922; $ELSE ;;AN000;; Get the rest of the message to display
1923 JMP SHORT $MEN200
1924$MIF200:
1925ENDIF ;;AN000;;
1926IF NUMmsg ;;AN000;; Was Nnmeric type specified?
1927 TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;;
1928; $IF Z,OR ;;AN000;;
1929 JZ $MLL202
1930 TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;;
1931; $IF Z,OR ;;AN000;;
1932 JZ $MLL202
1933 TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Bin_Hex_Type AND $M_TYPE_MASK ;;AN000;;
1934; $IF Z ;;AN000;;
1935 JNZ $MIF202
1936$MLL202:
1937
1938;; Numeric type requested
1939
1940 LES DI,DWORD PTR $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter
1941 CALL $M_BIN2ASC_REPLACE ;;AN000;;
1942; $ELSE ;;AN000;; Get the rest of the message to display
1943 JMP SHORT $MEN202
1944$MIF202:
1945ENDIF ;;AN000;;
1946IF DATEmsg ;;AN000;; Was date specified?
1947 TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Date_Type AND $M_TYPE_MASK ;;AN000;;
1948; $IF E ;;AN000;;
1949 JNE $MIF204
1950
1951;; Date type requested
1952
1953 CALL $M_DATE_REPLACE ;;AN000;;
1954; $ELSE ;;AN000;; Get the rest of the message to display
1955 JMP SHORT $MEN204
1956$MIF204:
1957ENDIF ;;AN000;;
1958IF TIMEmsg ;;AN000;; Was time (12 hour format) specified?
1959
1960;; Time type requested (Default if we have not matched until here)
1961
1962 CALL $M_TIME_REPLACE ;;AN000;;
1963ENDIF ;;AN000;;
1964
1965IF DATEmsg ;;AN000;;
1966; $ENDIF ;;AN000;;
1967$MEN204:
1968ENDIF ;;AN000;;
1969IF NUMmsg ;;AN000;;
1970; $ENDIF ;;AN000;;
1971$MEN202:
1972ENDIF ;;AN000;;
1973IF CHARmsg ;;AN000;;
1974; $ENDIF ;;AN000;;
1975$MEN200:
1976ENDIF ;;AN000;;
1977
1978IF $M_REPLACE ;;AN000;;
1979;; With the replace information of the Stack, display the replaceable field
1980
1981 CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace
1982ENDIF ;;AN000;;
1983;; None of the above - Extended/Parse replace
1984; $ELSE ;;AN000;;
1985 JMP SHORT $MEN199
1986$MIF199:
1987IF NOT COMR
1988 CALL $M_EXT_PAR_REPLACE ;;AN000;;
1989ENDIF
1990; $ENDIF ;;AN000;;
1991$MEN199:
1992
1993;; We must go back and complete the message after the replacable parameter if there is any left
1994
1995; $IF NC ;;AN000;; IF there was an error displaying then EXIT
1996 JC $MIF211
1997 POP CX ;;AN000;; Get size of the rest of the message
1998 POP ES ;;AN000;; Get address of the rest of the message
1999 POP DI ;;AN000;;
2000 POP BP ;;AN000;; Get replacment count
2001 POP SI ;;AN000;; ELSE get address of first sublist structure
2002; $ELSE ;;AN000;;
2003 JMP SHORT $MEN211
2004$MIF211:
2005 ADD SP,10 ;;AN000;; Clean up stack if error
2006 STC ;;AN000;;
2007; $ENDIF ;;AN000;;
2008$MEN211:
2009 CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
2010; $ENDDO NE,OR ;;AN000;;
2011 JNE $MLL214
2012; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message
2013 JC $MXL4
2014 JMP $MDO165
2015$MXL4:
2016$MLL214:
2017$MEN165:
2018 ;; IF there was an error displaying then EXIT
2019 MOV $M_RT.$M_MSG_NUM,0 ;;AN000;; Reset message number to null
2020 RET ;;AN000;; Return
2021 ;;
2022$M_DISPLAY_MESSAGE ENDP ;;AN000;;
2023IF NOT COMR
2024;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2025;;
2026;; PROC NAME: $M_EXT_PAR_REPLACE
2027;;
2028;; FUNCTION:
2029;; INPUTS:
2030;; OUPUTS:
2031;;
2032;; REGS USED:
2033;;
2034;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2035 ;;
2036$M_EXT_PAR_REPLACE PROC NEAR ;;AN000;;
2037 ;;
2038 XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH)
2039 MOV AX,$M_RT.$M_MSG_NUM ;;AN000;; Prepare for get binary value (LOW)
2040 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
2041 ;;
2042 CALL $M_CONVERT2ASC ;;AN000;;
2043 ;;
2044; $DO ;;AN000;;
2045$MDO215:
2046 POP AX ;;AN000;; Get character in register
2047 MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move char into the buffer
2048 INC BX ;;AN000;; Increase buffer count
2049 CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
2050; $IF E ;;AN000;; Yes,
2051 JNE $MIF216
2052 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
2053; $ENDIF ;;AN000;;
2054$MIF216:
2055 DEC CL ;;AN000;; Have we completed replace?
2056; $ENDDO Z ;;AN000;;
2057 JNZ $MDO215
2058 ;;
2059 MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer
2060 MOV WORD PTR $M_RT.$M_TEMP_BUF[BX],AX ;;AN000;; Move char into the buffer
2061 INC BX ;;AN000;; Increase buffer count
2062 INC BX ;;AN000;; Increase buffer count
2063 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
2064 RET ;;AN000::
2065 ;;
2066$M_EXT_PAR_REPLACE ENDP ;;AN000;;
2067 ;;
2068;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2069ENDIF
2070 IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet
2071 $M_SUBS = FALSE ;;AN000;; No, then include and reset the flag
2072;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2073;;
2074;; PROC NAME: $M_GET_MSG_ADDRESS
2075;;
2076;; FUNCTION: To scan thru classes to return pointer to the message header
2077;; INPUTS: Access to $M_RES_ADDRESSES
2078;; OUPUTS: IF CX = 0 THEN Message was not found
2079;; IF CX > 1 THEN DS:SI points to the specified message
2080;; REGS CHANGED: ES,DI,CX,DS,SI
2081;;
2082;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2083 ;;
2084IF FARmsg ;;AN000;;
2085 $M_GET_MSG_ADDRESS PROC FAR ;;AN000;;
2086ELSE ;;AN000;;
2087 $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;;
2088ENDIF ;;AN000;;
2089 ;;
2090 PUSH SI ;;AN000;;
2091 PUSH BX ;;AN000;;
2092 XOR SI,SI ;;AN000;; Use SI as an index
2093 XOR CX,CX ;;AN000;; Use CX as an size
2094; $DO ;;AN000;;
2095$MDO219:
2096 CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested?
2097; $IF E ;;AN000;; Yes,
2098 JNE $MIF220
2099 IF FARmsg ;;AN000;;
2100 LES DI,DWORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
2101 MOV BX,ES ;;AN000;
2102 ELSE ;;AN000;;
2103 MOV DI,WORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
2104 MOV BX,DI ;;AN000;
2105 ENDIF ;;AN000;;
2106; $ELSE ;;AN000;; No,
2107 JMP SHORT $MEN220
2108$MIF220:
2109 TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested?
2110; $IF NE ;;AN000;; Yes,
2111 JE $MIF222
2112 LES DI,DWORD PTR $M_RT.$M_PARSE_COMMAND[SI] ;;AN000;; Get address of class
2113 MOV BX,ES ;;AN000;
2114; $ELSE ;;AN000;; No, extended errors were specified
2115 JMP SHORT $MEN222
2116$MIF222:
2117 CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error?
2118; $IF AE,AND ;;AN000;;
2119 JNAE $MIF224
2120 CMP AX,$M_CRIT_HI ;;AN000;;
2121; $IF BE ;;AN000;; Yes,
2122 JNBE $MIF224
2123 LES DI,DWORD PTR $M_RT.$M_CRIT_ADDRS[SI] ;;AN000;; Get address of class
2124 MOV BX,ES ;;AN000;
2125; $ELSE ;;AN000;;
2126 JMP SHORT $MEN224
2127$MIF224:
2128 LES DI,DWORD PTR $M_RT.$M_EXT_ERR_ADDRS[SI] ;;AN000;; Get address of class
2129 MOV BX,ES ;;AN000;
2130; $ENDIF ;;AN000;;
2131$MEN224:
2132; $ENDIF ;;AN000;;
2133$MEN222:
2134; $ENDIF ;;AN000;;
2135$MEN220:
2136 ;;
2137 CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes?
2138; $IF E ;;AN000;; Yes,
2139 JNE $MIF229
2140 CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class?
2141; $IF E ;;AN000;; Yes,
2142 JNE $MIF230
2143 STC ;;AN000;; Set the carry flag
2144; $ELSE ;;AN000;; No,
2145 JMP SHORT $MEN230
2146$MIF230:
2147 MOV $M_RT.$M_MSG_NUM,AX ;;AN000;; Save message number
2148 MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number
2149 MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message
2150 XOR SI,SI ;;AN000;; Reset the SI index to start again
2151 CLC ;;AN000;;
2152; $ENDIF ;;AN000;; No,
2153$MEN230:
2154; $ELSE ;;AN000;;
2155 JMP SHORT $MEN229
2156$MIF229:
2157 CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist?
2158; $IF NE ;;AN001;; Yes,
2159 JE $MIF234
2160 CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message
2161; $ENDIF ;;AN000;;
2162$MIF234:
2163 ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class
2164 CLC ;;AN000;;
2165; $ENDIF ;;AN000;;
2166$MEN229:
2167; $LEAVE C ;;AN000;;
2168 JC $MEN219
2169 OR CX,CX ;;AN000;; Was the message found?
2170; $ENDDO NZ,LONG ;;AN000;;
2171 JNZ $MXL5
2172 JMP $MDO219
2173$MXL5:
2174$MEN219:
2175
2176 PUSHF ;;AN006;; Save the flag state
2177 CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested?
2178; $IF E ;;AN006;; Yes,
2179 JNE $MIF239
2180 PUSH DX ;;AN006;; Save all needed registers
2181 PUSH BP ;;AN006;;
2182 PUSH CX ;;AN006;;
2183 PUSH ES ;;AN006;;
2184 PUSH DI ;;AN006;;
2185 PUSH AX ;;AN006;;
2186
2187 MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed
2188 INT 2FH ;;AN006;;
2189 CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed?
2190 POP AX ;;AN006;; Restore msg number
2191; $IF E ;;AN006;; Yes,
2192 JNE $MIF240
2193 MOV BX,AX ;;AN006;; BX is the extended error number
2194 MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number
2195 INT 2FH ;;AN006;; Call IFSFUNC
2196; $ELSE ;;AN006;; No,
2197 JMP SHORT $MEN240
2198$MIF240:
2199 STC ;;AN006;; Carry conditon
2200; $ENDIF ;;AN006;;
2201$MEN240:
2202
2203; $IF C ;;AN006;; Was there an update?
2204 JNC $MIF243
2205 POP DI ;;AN006;; No,
2206 POP ES ;;AN006;; Restore old pointer
2207 POP CX ;;AN006;;
2208; $ELSE ;;AN006;; Yes
2209 JMP SHORT $MEN243
2210$MIF243:
2211 ADD SP,6 ;;AN006;; Throw away old pointer
2212 CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string
2213; $ENDIF ;;AN006;;
2214$MEN243:
2215 POP BP ;;AN006;; Restore other Regs
2216 POP DX ;;AN006;;
2217; $ENDIF ;;AN006;;
2218$MIF239:
2219 $M_POPF ;;AN006;; Restore the flag state
2220
2221 POP BX ;;AN000;;
2222 POP SI ;;AN000;;
2223 RET ;;AN000;; Return ES:DI pointing to the message
2224 ;;
2225$M_GET_MSG_ADDRESS ENDP ;;
2226 ;;
2227$M_SET_LEN_IN_CX PROC NEAR ;;
2228 ;;
2229 PUSH DI ;;AN006;; Save position
2230 PUSH AX ;;AN006;;
2231 MOV CX,-1 ;;AN006;; Set CX for decrements
2232 XOR AL,AL ;;AN006;; Prepare compare register
2233 REPNE SCASB ;;AN006;; Scan for zero
2234 NOT CX ;;AN006;; Change decrement into number
2235 DEC CX ;;AN006;; Don't include the zero
2236 POP AX ;;AN006;;
2237 POP DI ;;AN006;; Restore position
2238 RET ;;AN006;;
2239 ;;
2240$M_SET_LEN_IN_CX ENDP ;;
2241 ;;
2242;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2243;;
2244;; PROC NAME: $M_FIND_SPECIFIED_MSG
2245;;
2246;; FUNCTION: To scan thru message headers until message is found
2247;; INPUTS: ES:DI points to beginning of msg headers
2248;; CX contains the number of messages in class
2249;; DH contains the message class
2250;; OUPUTS: IF CX = 0 THEN Message was not found
2251;; IF CX > 1 THEN ES:DI points to header of specified message
2252;;
2253;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2254 ;;
2255$M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;;
2256 ;;
2257 CMP BX,1 ;;AN004;; Do we have an address to CALL?
2258; $IF E,AND ;;AN004;; Yes,
2259 JNE $MIF247
2260 CMP WORD PTR $M_RT.$M_DISK_PROC_ADDR,-1 ;;AN004;; Do we have an address to CALL?
2261; $IF NE ;;AN004;; Yes,
2262 JE $MIF247
2263 CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err?
2264; $IF E ;;AN004;; . . . and . . .
2265 JNE $MIF248
2266 PUSH AX ;;AN004;; Reset the special message number
2267 MOV AX,$M_RT.$M_MSG_NUM ;;AN004;; Get the old message number
2268 CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
2269 POP AX ;;AN004;; Reset the special message number
2270; $ELSE ;;AN004;; Get the old message number
2271 JMP SHORT $MEN248
2272$MIF248:
2273 CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
2274; $ENDIF ;;AN004;; Get the old message number
2275$MEN248:
2276; $ELSE ;;AN004;;
2277 JMP SHORT $MEN247
2278$MIF247:
2279 XOR CX,CX ;;AN002;; CX = 0 will allow us to
2280 CMP DH,UTILITY_MSG_CLASS ;;AN001;;
2281; $IF NE ;;AN001;;
2282 JE $MIF252
2283 MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN001;; Get number of messages in class
2284; $ELSE ;;AN001;;
2285 JMP SHORT $MEN252
2286$MIF252:
2287IF FARmsg ;;AN001;;
2288 CMP BYTE PTR ES:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
2289ELSE
2290 CMP BYTE PTR CS:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
2291ENDIF
2292; $IF E ;;AN002;; pointer (hopefully)
2293 JNE $MIF254
2294IF FARmsg ;;AN001;;
2295 MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
2296ELSE
2297 MOV CL,BYTE PTR CS:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
2298ENDIF
2299; $ENDIF ;;AN002;; go on to the next class
2300$MIF254:
2301; $ENDIF ;;AN001;;
2302$MEN252:
2303 ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header
2304 STC ;;AN004;; Flag that we haven't found anything yet
2305; $ENDIF ;;AN004;;
2306$MEN247:
2307
2308; $IF C ;;AN004;; Have we found anything yet?
2309 JNC $MIF258
2310 CLC ;;AN004;; No, reset carry
2311; $SEARCH ;;AN000;;
2312$MDO259:
2313 OR CX,CX ;;AN000;; Do we have any to check?
2314; $LEAVE Z ;;AN000;; No, return with CX = 0
2315 JZ $MEN259
2316 CMP DH,UTILITY_MSG_CLASS ;;AN001;;
2317; $IF NE ;;AN001;;
2318 JE $MIF261
2319 CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN001;; Is this the message requested?
2320; $ELSE ;;AN001;;
2321 JMP SHORT $MEN261
2322$MIF261:
2323IF FARmsg ;;AN001;;
2324 CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN000;; Is this the message requested?
2325ELSE
2326 CMP AX,WORD PTR CS:[DI].$M_NUM ;;AN000;; Is this the message requested?
2327ENDIF
2328; $ENDIF
2329$MEN261:
2330; $EXITIF E ;;AN000;;
2331 JNE $MIF259
2332; $ORELSE ;;AN000;
2333 JMP SHORT $MSR259
2334$MIF259:
2335 DEC CX ;;AN000;; No, well do we have more to check?
2336; $LEAVE Z ;;AN000;; No, return with CX = 0
2337 JZ $MEN259
2338 ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header
2339; $ENDLOOP ;;AN000;;
2340 JMP SHORT $MDO259
2341$MEN259:
2342 STC ;;AN000;;
2343; $ENDSRCH ;;AN000;; Check next message
2344$MSR259:
2345; $IF NC ;;AN000;; Did we find the message?
2346 JC $MIF269
2347 CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message?
2348 CLC ;;AN001;;
2349; $IF E ;;AN001;;
2350 JNE $MIF270
2351IF FARmsg ;;AN001;;
2352ELSE ;;AN000;;
2353 PUSH CS ;;AN000;;
2354 POP ES ;;AN000;; Return ES:DI pointing to the message
2355ENDIF
2356; $ENDIF ;;AN001;;
2357$MIF270:
2358 ADD DI,WORD PTR ES:[DI].$M_TXT_PTR ;;AN000;; Prepare ES:DI pointing to the message
2359; $ENDIF ;;AN004;;
2360$MIF269:
2361; $ENDIF ;;AN004;;
2362$MIF258:
2363 ;; Yes, great we can return with CX > 0
2364
2365; $IF NC ;;AN000;; Did we find the message?
2366 JC $MIF274
2367 XOR CH,CH ;;AN000;;
2368 MOV CL,BYTE PTR ES:[DI] ;;AN000;; Move size into CX
2369 INC DI ;;AN000;; Increment past length
2370; $ENDIF ;;AN004;;
2371$MIF274:
2372
2373 MOV $M_RT.$M_SIZE,$M_NULL ;;AN004;; Reset variable
2374 RET ;;AN000;; Return
2375 ;;
2376$M_FIND_SPECIFIED_MSG ENDP ;;AN000;;
2377 ;;
2378;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2379 ENDIF ;;AN000;; END of include of common subroutines
2380;
2381 IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms
2382 $M_REPLACE = FALSE ;;AN000;; Tell the assembler we did
2383 ;;
2384;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2385$M_DISPLAY_REPLACE PROC NEAR ;;AN000;;
2386 ;;
2387 XOR BX,BX ;;AN000;; Use BX for buffer count
2388IF NOT COMR
2389 CMP $M_SL.$M_S_ID,$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII)
2390; $IF E ;;AN000;; Yes,
2391 JNE $MIF276
2392 MOV WORD PTR $M_RT.$M_TEMP_BUF[BX],$M_SPACE_HYP ;;AN000;; Move in a " -"
2393 INC BX ;;AN000;; Increment count
2394 INC BX ;;AN000;; Increment count
2395 MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],$M_SPACE ;;AN000;; Move in a " "
2396 INC BX ;;AN000;; Increment count
2397 CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case
2398; $ENDIF ;;AN000;; If it fails we will catch it later
2399$MIF276:
2400ENDIF
2401
2402 POP BP ;;AN000;; Remember the return address
2403 XOR BX,BX ;;AN000;; Use BX for buffer count
2404 XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack
2405
2406 MOV $M_RT.$M_SIZE,CL ;;AN000;; Save size to later clear stack
2407 MOV AL,BYTE PTR $M_SL.$M_S_MINW ;;AN000;; Get the minimum width
2408 ;;
2409 CMP AL,CL ;;AN000;; Do we need pad chars added?
2410; $IF A ;;AN000;; Yes,
2411 JNA $MIF278
2412 SUB AL,CL ;;AN000;; Calculate how many pad chars are needed.
2413 MOV DH,AL ;;AN000;; Save the number of pad characters
2414 TEST BYTE PTR $M_SL.$M_S_FLAG,Right_Align ;;AN000;; Was replaceable parm to be right aligned?
2415; $IF NZ ;;AN000;; Yes,
2416 JZ $MIF279
2417; $DO ;;AN000;; Begin filling buffer with pad chars
2418$MDO280:
2419 MOV AL,BYTE PTR $M_SL.$M_S_PAD ;;AN000;;
2420 MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move in a pad char
2421 INC BX ;;AN000;;
2422 CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
2423; $IF E ;;AN000;; Yes,
2424 JNE $MIF281
2425 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
2426; $ENDIF ;;AN000;;
2427$MIF281:
2428 DEC DH ;;AN000;; Have we filled with enough pad chars?
2429; $ENDDO Z ;;AN000;; No, next pad character
2430 JNZ $MDO280
2431; $ENDIF ;;AN000;;
2432$MIF279:
2433; $ENDIF ;;AN000;; Yes,
2434$MIF278:
2435 ;;
2436 CMP BYTE PTR $M_SL.$M_S_MAXW,$M_UNLIM_W ;;AN000;; Is maximum width unlimited?
2437; $IF NE ;;AN000;;
2438 JE $MIF286
2439 CMP BYTE PTR $M_SL.$M_S_MAXW,CL ;;AN000;; Will we exceed maximum width?
2440; $IF B ;;AN000;; Yes,
2441 JNB $MIF287
2442 SUB CL,BYTE PTR $M_SL.$M_S_MAXW ;;AN000;; Calculate how many extra chars
2443 MOV DL,CL ;;AN000;; Remember how many chars to pop off
2444 MOV CL,BYTE PTR $M_SL.$M_S_MAXW ;;AN000;; Set new string length
2445; $ENDIF ;;AN000;;
2446$MIF287:
2447; $ENDIF ;;AN000;;
2448$MIF286:
2449 OR CX,CX ;;AN000;;
2450; $IF NZ ;;AN000;;
2451 JZ $MIF290
2452; $DO ;;AN000;; Begin filling buffer with string
2453$MDO291:
2454 TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
2455; $IF Z,AND ;;AN000;;
2456 JNZ $MIF292
2457 TEST $M_SL.$M_S_FLAG,Char_field_ASCIIZ AND $M_SIZE_MASK ; Is this replace a ASCIIZ string?
2458; $IF NZ ;;AN000;; Yes,
2459 JZ $MIF292
2460 MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get first character from string
2461 INC DI ;;AN000;; Next character in string
2462; $ELSE ;;AN000;; No,
2463 JMP SHORT $MEN292
2464$MIF292:
2465 POP AX ;;AN000;; Get character in register
2466; $ENDIF ;;AN000;;
2467$MEN292:
2468 MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move char into the buffer
2469 INC BX ;;AN000;; Increase buffer count
2470 CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
2471; $IF E ;;AN000;; Yes,
2472 JNE $MIF295
2473 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
2474; $ENDIF ;;AN000;;
2475$MIF295:
2476 DEC CL ;;AN000;; Have we completed replace?
2477; $ENDDO Z ;;AN000;; Test again
2478 JNZ $MDO291
2479; $ENDIF ;;AN000;;
2480$MIF290:
2481 ;;
2482 TEST BYTE PTR $M_SL.$M_S_FLAG,Right_Align ;;AN000;; Was replaceable parm to be left aligned?
2483; $IF Z ;;AN000;; Yes,
2484 JNZ $MIF299
2485 OR DH,DH ;;AN000;; Do we need pad chars added?
2486; $IF NZ ;;AN000;; Yes,
2487 JZ $MIF300
2488; $DO ;;AN000;; Begin filling buffer with pad chars
2489$MDO301:
2490 MOV AL,BYTE PTR $M_SL.$M_S_PAD ;;AN000;;
2491 MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move in a pad char
2492 INC BX ;;AN000;;
2493 CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
2494; $IF E ;;AN000;; Yes,
2495 JNE $MIF302
2496 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
2497; $ENDIF ;;AN000;;
2498$MIF302:
2499 DEC DH ;;AN000;; Have we filled with enough pad chars?
2500; $ENDDO Z ;;AN000;; Test again
2501 JNZ $MDO301
2502; $ENDIF ;;AN000;;
2503$MIF300:
2504; $ENDIF ;;AN000;;
2505$MIF299:
2506 ;;
2507 TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
2508; $IF Z,AND ;;AN000;;
2509 JNZ $MIF307
2510 TEST $M_SL.$M_S_FLAG,Char_field_ASCIIZ AND $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string?
2511; $IF NZ ;;AN000;; Yes,
2512 JZ $MIF307
2513; $ELSE ;;AN000;;
2514 JMP SHORT $MEN307
2515$MIF307:
2516 OR DL,DL ;;AN000;;
2517; $IF NE ;;AN000;;
2518 JE $MIF309
2519; $DO ;;AN000;;
2520$MDO310:
2521 POP [$M_RT.$M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable
2522 DEC DL ;;AN000;; Are we done?
2523; $ENDDO Z ;;AN000;;
2524 JNZ $MDO310
2525; $ENDIF ;;AN000;;
2526$MIF309:
2527; $ENDIF ;;AN000;;
2528$MEN307:
2529 CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time
2530 PUSH BP ;;AN000;; Restore the return address
2531 ;;
2532 RET ;;AN000;;
2533 ;;
2534$M_DISPLAY_REPLACE ENDP ;;AN000;;
2535 ;;
2536;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2537;;
2538;; PROC NAME: $M_FLUSH_BUFFER
2539;;
2540;; FUNCTION: Display the contents of the temporary buffer
2541;; INPUTS: DI contains the number of bytes to display
2542;; OUTPUTS: BX reset to zero
2543;;
2544;; REGS USED:
2545;;
2546;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2547 ;;
2548$M_FLUSH_BUF PROC NEAR ;;AN000;;
2549 ;;
2550 PUSH CX ;;AN000;; Save changed regs
2551 PUSH ES ;;AN000;;
2552 PUSH DI ;;AN000;;
2553 PUSH DS ;;AN000;; Set ES pointing to buffer
2554 POP ES ;;AN000;;
2555 ;;
2556 MOV CX,BX ;;AN000;; Set number of bytes to display
2557 XOR BX,BX ;;AN000;; Reset buffer counter
2558 LEA DI,$M_RT.$M_TEMP_BUF ;;AN000;; Reset buffer location pointer
2559 CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer
2560 ;;
2561; $IF NC ;;AN000;; Error?
2562 JC $MIF314
2563 POP DI ;;AN000;; No, Restore changed regs
2564 POP ES ;;AN000;;
2565 POP CX ;;AN000;;
2566; $ELSE ;;AN000;; Yes,
2567 JMP SHORT $MEN314
2568$MIF314:
2569 ADD SP,6 ;;AN000;; Fix stack
2570 STC ;;AN000;;
2571; $ENDIF ;;AN000;; Error?
2572$MEN314:
2573 ;;
2574 RET ;;AN000;; Return
2575 ;;
2576$M_FLUSH_BUF ENDP ;;AN000;;
2577 ;;
2578 ;;
2579 IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace?
2580 $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
2581 $M_CHAR_ONLY = TRUE ;;AN000;; replacement code later
2582;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2583;;
2584;; PROC NAME: $M_CHAR_REPLACE
2585;;
2586;; FUNCTION: Will prepare a single char or ASCIIZ string for replace
2587;; INPUTS: DS:SI points at corresponding SUBLIST
2588;; ES:DI contains the VALUE from SUBLIST
2589;; OUTPUTS: CX contains number of characters on stack
2590;; Top of stack --> Last character
2591;; . . .
2592;; Bot of stack --> First character
2593;;
2594;; OTHER REGS Revised: AX
2595;;
2596;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2597 ;;
2598$M_CHAR_REPLACE PROC NEAR ;;AN000;;
2599 ;;
2600 POP BP ;;AN000;; Save return address
2601 TEST $M_SL.$M_S_FLAG,NOT Char_Field_Char AND $M_SIZE_MASK ;;AN000;; Was Character specified?
2602; $IF Z ;;AN000;; Yes,
2603 JNZ $MIF317
2604 MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
2605 PUSH AX ;;AN000;; Put it on the stack
2606 INC CX ;;AN000;; Increase the count
2607 CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
2608; $IF C ;;AN000;; Yes,
2609 JNC $MIF318
2610 MOV AL,BYTE PTR ES:[DI]+1 ;;AN000;; Get the next character
2611 PUSH AX ;;AN000;; Put it on the stack
2612 CLC ;;AN000;; Clear the carry
2613; $ENDIF ;;AN000;;
2614$MIF318:
2615; $ELSE ;;AN000;; No, it was an ASCIIZ string
2616 JMP SHORT $MEN317
2617$MIF317:
2618; $DO ;;AN000;;
2619$MDO321:
2620 MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
2621 OR AL,AL ;;AN000;; Is it the NULL?
2622; $LEAVE Z ;;AN000;; No,
2623 JZ $MEN321
2624 INC DI ;;AN000;; Next character
2625 INC CX ;;AN000;; Increment the count
2626; $ENDDO ;;AN000;; Yes,
2627 JMP SHORT $MDO321
2628$MEN321:
2629 SUB DI,CX ;;AN000;; Set SI at the beginning of the string
2630; $ENDIF ;;AN000;;
2631$MEN317:
2632 ;;AN000;;
2633 PUSH BP ;;AN000;; Restore return address
2634 RET ;;AN000;; Return
2635 ;;
2636$M_CHAR_REPLACE ENDP ;;AN000;;
2637 ;;
2638;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2639 ENDIF ;;AN000;; END of include of CHAR replace code
2640;
2641 IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace?
2642 $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
2643 $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
2644;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2645;;
2646;; PROC NAME: $M_BIN2ASC_REPLACE
2647;;
2648;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string
2649;; and prepare to display
2650;; INPUTS: DS:SI points at corresponding SUBLIST
2651;; ES:DI contains the VALUE from SUBLIST
2652;; OUTPUTS: CX contains number of characters on stack
2653;; Top of stack --> Last character
2654;; . . .
2655;; Bot of stack --> First character
2656;; OTHER REGS Revised: BX,DX,AX
2657;;
2658;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2659 ;;
2660$M_BIN2ASC_REPLACE PROC NEAR ;;AN000;;
2661 ;;
2662 POP BP ;;AN000;; Save return address
2663 ;;
2664 XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH)
2665 XOR AX,AX ;;AN000;; Prepare for get binary value (LOW)
2666 MOV $M_RT.$M_DIVISOR,$M_BASE16 ;;AN000;; Set default divisor
2667 XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable)
2668IF NOT COMR
2669 TEST $M_SL.$M_S_FLAG,NOT $M_BYTE AND $M_SIZE_MASK ;;AN000;; Was BYTE specified?
2670; $IF Z ;;AN000;;
2671 JNZ $MIF325
2672 MOV AL, BYTE PTR ES:[DI] ;;AN000;; Setup byte in AL
2673 TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
2674; $IF Z ;;AN000;;
2675 JNZ $MIF326
2676 TEST AL,10000000b ;;AN000;; Is this number negative?
2677; $IF NZ ;;AN000;; Yes,
2678 JZ $MIF327
2679 INC BX ;;AN000;; Remember that it was negative
2680 AND AL,01111111b ;;AN000;; Make it positive
2681; $ENDIF ;;AN000;;
2682$MIF327:
2683 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
2684; $ENDIF ;;AN000;;
2685$MIF326:
2686 TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
2687; $IF Z ;;AN000;;
2688 JNZ $MIF330
2689 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
2690; $ENDIF ;;AN000;;
2691$MIF330:
2692; $ELSE ;;AN000;;
2693 JMP SHORT $MEN325
2694$MIF325:
2695ENDIF
2696 TEST $M_SL.$M_S_FLAG,NOT $M_WORD AND $M_SIZE_MASK ;;AN000;; Was WORD specified?
2697; $IF Z ;;AN000;;
2698 JNZ $MIF333
2699 MOV AX, WORD PTR ES:[DI] ;;AN000;; Setup byte in AL
2700 TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;; AN000;; Was Signed binary specified?
2701; $IF Z ;;AN000;;
2702 JNZ $MIF334
2703 TEST AH,10000000b ;;AN000;; Is this number negative?
2704; $IF NZ ;;AN000;; Yes,
2705 JZ $MIF335
2706 INC BX ;;AN000;; Remember that it was negative
2707 AND AH,01111111b ;;AN000;; Make it positive
2708; $ENDIF ;;AN000;;
2709$MIF335:
2710 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
2711; $ENDIF ;;AN000;;
2712$MIF334:
2713 TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
2714; $IF Z ;;AN000;;
2715 JNZ $MIF338
2716 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
2717; $ENDIF ;;AN000;;
2718$MIF338:
2719; $ELSE ;;AN000;;
2720 JMP SHORT $MEN333
2721$MIF333:
2722IF NOT COMR
2723 MOV AX, WORD PTR ES:[DI] ;;AN000;; Setup Double word in DX:AX
2724 MOV DX, WORD PTR ES:[DI]+2 ;;AN000;;
2725 TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
2726; $IF Z ;;AN000;;
2727 JNZ $MIF341
2728 TEST DH,10000000b ;;AN000;; Is this number negative?
2729; $IF NZ ;;AN000;; Yes,
2730 JZ $MIF342
2731 INC BX ;;AN000;; Remember that it was negative
2732 AND DH,01111111b ;;AN000;; Make it positive
2733; $ENDIF ;;AN000;;
2734$MIF342:
2735 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
2736; $ENDIF ;;AN000;;
2737$MIF341:
2738 TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
2739; $IF Z ;;AN000;;
2740 JNZ $MIF345
2741 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
2742; $ENDIF ;;AN000;;
2743$MIF345:
2744ENDIF
2745; $ENDIF ;;AN000;;
2746$MEN333:
2747; $ENDIF ;;AN000;;
2748$MEN325:
2749 ;;
2750 CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string
2751IF NOT COMR
2752 OR BX,BX ;;AN000;;
2753; $IF NZ ;;AN000;; Was number negative?
2754 JZ $MIF349
2755 XOR DX,DX ;;AN000;; Yes,
2756 MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number
2757 PUSH DX ;;AN000;;
2758; $ENDIF ;;AN000;; No,
2759$MIF349:
2760ENDIF
2761 ;;
2762 PUSH BP ;;AN000;; Restore return address
2763 RET ;;AN000;; Return
2764 ;;
2765$M_BIN2ASC_REPLACE ENDP ;;AN000;;
2766 ;;
2767;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2768 ENDIF ;;AN000;; END of include of NUM replace code
2769;
2770 IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace?
2771 $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
2772 $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
2773;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2774;;
2775;; PROC NAME: $M_DATE_REPLACE
2776;;
2777;; FUNCTION: Convert a date to a decimal ASCII string using current
2778;; country format and prepare to display
2779;; INPUTS: DS:SI points at corresponding SUBLIST
2780;; ES:DI points at VALUE from SUBLIST
2781;; OUTPUTS: CX contains number of characters on stack
2782;; Top of stack --> Last character
2783;; . . .
2784;; Bot of stack --> First character
2785;; OTHER REGS Revised: DX, AX
2786;;
2787;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2788 ;;
2789$M_DATE_REPLACE PROC NEAR ;;AN000;;
2790 ;;
2791 POP BP ;;AN000;; Save return address
2792 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
2793 CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT
2794 ;;AN000;; All O.K.?
2795 XOR DX,DX ;;AN000;; Reset DX value
2796 XOR AX,AX ;;AN000;; Reset AX value
2797 CMP WORD PTR $M_RT.$M_DATE_FORMAT,0 ;;AN000;; USA Date Format
2798; $IF E ;;AN000;; Beginning from end: (saved on the stack)
2799 JNE $MIF351
2800 CALL $M_YEAR ;;AN000;; Get Year
2801 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2802 PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
2803 INC CX ;;AN000;; Increment count
2804 XOR AX,AX ;;AN000;; Reset AX value
2805 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
2806 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2807 PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
2808 INC CX ;;AN000;; Increment count
2809 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
2810 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2811; $ENDIF ;;AN000;;
2812$MIF351:
2813 ;;
2814 CMP WORD PTR $M_RT.$M_DATE_FORMAT,1 ;;AN000;; EUROPE Date Format
2815; $IF E ;;AN000;; Beginning from end: (saved on the stack)
2816 JNE $MIF353
2817 CALL $M_YEAR ;;AN000;; Get Year
2818 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2819 PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
2820 INC CX ;;AN000;;
2821 XOR AX,AX ;;AN000;; Reset AX
2822 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
2823 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2824 PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
2825 INC CX ;;AN000;;
2826 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
2827 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2828; $ENDIF ;;AN000;;
2829$MIF353:
2830 ;;
2831 CMP WORD PTR $M_RT.$M_DATE_FORMAT,2 ;;AN000;; JAPAN Date Format
2832; $IF E ;;AN000;; Beginning from end: (saved on the stack)
2833 JNE $MIF355
2834 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
2835 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2836 PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
2837 INC CX ;;AN000;;
2838 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
2839 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2840 PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
2841 INC CX ;;AN000;;
2842 CALL $M_YEAR ;;AN000;; Get Year
2843 CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
2844; $ENDIF ;;AN000;;
2845$MIF355:
2846 ;;
2847 PUSH BP ;;AN000;; Restore return address
2848 RET ;;AN000;; Return
2849 ;;
2850$M_DATE_REPLACE ENDP ;;AN000;;
2851 ;;
2852$M_GET_DATE PROC NEAR ;;AN000;;
2853 MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info
2854 MOV AL,0 ;;AN000;; Get current country info
2855 LEA DX,$M_RT.$M_TEMP_BUF ;;AN000;; Set up addressibility to buffer
2856 INT 21H ;;AN000;;
2857; $IF C ;;AN000;; No,
2858 JNC $MIF357
2859 MOV WORD PTR $M_RT.$M_DATE_FORMAT,$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH)
2860 MOV BYTE PTR $M_RT.$M_DATE_SEPARA,$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL)
2861; $ENDIF ;;AN000;;
2862$MIF357:
2863 RET ;;AN000;;
2864$M_GET_DATE ENDP ;;AN000;;
2865 ;;
2866$M_YEAR PROC NEAR ;;AN000;;
2867 MOV AX,WORD PTR $M_SL.$M_S_VALUE ;;AN000;; Get Year
2868 TEST $M_SL.$M_S_FLAG,Date_MDY_4 AND $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified?
2869; $IF Z ;;AN000;;
2870 JNZ $MIF359
2871 CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year
2872; $IF A ;;AN000;;
2873 JNA $MIF360
2874 MOV AX,$M_MAX_2_YEAR ;;AN000;;
2875; $ENDIF ;;AN000;;
2876$MIF360:
2877; $ENDIF ;;AN000;;
2878$MIF359:
2879 RET ;;AN000;;
2880$M_YEAR ENDP ;;AN000;;
2881 ;;
2882$M_CONVERTDATE PROC NEAR ;;AN000;;
2883 POP WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
2884 MOV $M_RT.$M_SIZE,CL ;;AN000;; Save the size before conversion
2885 CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string
2886 DEC CX ;;AN000;; Test if size only grew by 1
2887 CMP CL,$M_RT.$M_SIZE ;;AN000;; Did size only grow by one
2888; $IF E ;;AN000;; Yes,
2889 JNE $MIF363
2890 MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0)
2891 PUSH AX ;;AN000;; Save it
2892 INC CX ;;AN000;; Count it
2893; $ENDIF ;;AN000;;
2894$MIF363:
2895 INC CX ;;AN000;; Restore CX
2896 PUSH WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
2897 RET ;;AN000;;
2898$M_CONVERTDATE ENDP ;;AN000;;
2899 ;;
2900;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2901 ENDIF ;;AN000;; END of include of DATE replace code
2902;
2903 IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace?
2904 $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
2905 $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
2906;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2907;;
2908;; PROC NAME: $M_TIME_REPLACE
2909;;
2910;; FUNCTION: Convert a time to a decimal ASCII string
2911;; and prepare to display
2912;; INPUTS: DS:SI points at corresponding SUBLIST
2913;; ES:DI points at VALUE from SUBLIST
2914;; OUTPUTS: CX contains number of characters on stack
2915;; Top of stack --> Last character
2916;; . . .
2917;; Bot of stack --> First character
2918;; REGS USED: BP,CX,AX
2919;;
2920;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2921 ;;
2922$M_TIME_REPLACE PROC NEAR ;;AN000;;
2923 ;;
2924 POP BP ;;AN000;; Save return address
2925 MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
2926 CALL $M_GET_TIME ;;AN000;; All O.K.?
2927 TEST $M_SL.$M_S_FLAG,Time_Cty_Type AND $M_TIME_MASK ;;AN000;; Is this a request for current country info?
2928; $IF NZ ;;AN000;; Yes,
2929 JZ $MIF365
2930 CMP BYTE PTR $M_RT.$M_TIME_FORMAT,0 ;;AN000;; Is the current country format 12 Hour?
2931; $IF E ;;AN000;; Yes,
2932 JNE $MIF366
2933 MOV AL,BYTE PTR $M_SL.$M_S_VALUE ;;AN000;; Get Hours
2934 CMP AL,12 ;;AN000;; Is hour 12 or less?
2935; $IF L,OR ;;AN000;; or
2936 JL $MLL367
2937 CMP AL,23 ;;AN000;; Is hour 24 or greater?
2938; $IF G ;;AN000;; Yes,
2939 JNG $MIF367
2940$MLL367:
2941 MOV AL,$M_AM ;;AN000;;
2942 PUSH AX ;;AN000;; Push an "a" to represent AM.
2943 INC CX ;;AN000;;
2944; $ELSE ;;AN000;; No,
2945 JMP SHORT $MEN367
2946$MIF367:
2947 MOV AL,$M_PM ;;AN000;;
2948 PUSH AX ;;AN000;; Push an "p" to represent PM.
2949 INC CX ;;AN000;;
2950; $ENDIF ;;AN000;;
2951$MEN367:
2952; $ENDIF ;;AN000;;
2953$MIF366:
2954; $ENDIF ;;AN000;;
2955$MIF365:
2956 ;;
2957 XOR AX,AX ;;AN000;;
2958 XOR DX,DX ;;AN000;;
2959 TEST $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified?
2960; $IF NZ ;;AN000;;
2961 JZ $MIF372
2962 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Hundreds
2963 CALL $M_CONVERTTIME ;;AN000;;
2964 PUSH WORD PTR $M_RT.$M_DECI_SEPARA ;;AN000;;
2965 INC CX ;;AN000;;
2966; $ENDIF ;;AN000;;
2967$MIF372:
2968 TEST $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified?
2969; $IF NZ,OR ;;AN000;;
2970 JNZ $MLL374
2971 TEST $M_SL.$M_S_FLAG,Time_HHMMSS_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified?
2972; $IF NZ ;;AN000;;
2973 JZ $MIF374
2974$MLL374:
2975 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Seconds
2976 CALL $M_CONVERTTIME ;;AN000;;
2977 PUSH WORD PTR $M_RT.$M_TIME_SEPARA ;;AN000;;
2978 INC CX ;;AN000;;
2979; $ENDIF ;;AN000;;
2980$MIF374:
2981 ;; Do Hour/Min (12 Hour)
2982 MOV AL,BYTE PTR $M_SL.$M_S_VALUE+1 ;;AN000;; Get Minutes
2983 CALL $M_CONVERTTIME ;;AN000;;
2984 PUSH WORD PTR $M_RT.$M_TIME_SEPARA ;;AN000;;
2985 INC CX ;;AN000;;
2986 ;;
2987 MOV AL,BYTE PTR $M_SL.$M_S_VALUE ;;AN000;; Get Hours
2988 TEST $M_SL.$M_S_FLAG,Time_Cty_Type AND $M_TIME_MASK ;;AN000;; Is this a request for current country info?
2989; $IF NZ ;;AN000;; Yes,
2990 JZ $MIF376
2991 CMP BYTE PTR $M_RT.$M_TIME_FORMAT,0 ;;AN000;; Is the current country format 12 Hour?
2992; $IF E ;;AN000;; Yes,
2993 JNE $MIF377
2994 CMP AL,13 ;;AN000;; Is hour less than 12?
2995; $IF GE ;;AN000;; Yes,
2996 JNGE $MIF378
2997 SUB AL,12 ;;AN000;; Set to a 12 hour value
2998; $ENDIF ;;AN000;;
2999$MIF378:
3000 CMP AL,0 ;;AN000;; Is hour less than 12?
3001; $IF E ;;AN000;; Yes,
3002 JNE $MIF380
3003 MOV AL,12 ;;AN000;; Set to a 12 hour value
3004; $ENDIF ;;AN000;;
3005$MIF380:
3006; $ENDIF ;;AN000;;
3007$MIF377:
3008; $ENDIF ;;AN000;;
3009$MIF376:
3010 CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII
3011 ;;
3012 PUSH BP ;;AN000;; Restore return address
3013 RET ;;AN000;; Return
3014 ;;
3015$M_TIME_REPLACE ENDP ;;AN000;;
3016 ;;
3017$M_GET_TIME PROC NEAR ;;AN000;;
3018 MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info
3019 MOV AL,0 ;;AN000;; Get current country info
3020 LEA DX,$M_RT.$M_TEMP_BUF ;;AN000;; Set up addressibility to buffer
3021 INT 21H ;;AN000;;
3022; $IF C ;;AN000;; No,
3023 JNC $MIF384
3024 MOV WORD PTR $M_RT.$M_TIME_FORMAT,$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH)
3025 MOV BYTE PTR $M_RT.$M_TIME_SEPARA,$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL)
3026 MOV BYTE PTR $M_RT.$M_DECI_SEPARA,$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL)
3027; $ENDIF ;;AN000;;
3028$MIF384:
3029 RET ;;AN000;;
3030$M_GET_TIME ENDP ;;AN000;;
3031 ;;
3032$M_CONVERTTIME PROC NEAR ;;AN000;;
3033 POP WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
3034 MOV $M_RT.$M_SIZE,CL ;;AN000;; Save the size before conversion
3035 CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string
3036 DEC CX ;;AN000;; Test if size only grew by 1
3037 CMP CL,$M_RT.$M_SIZE ;;AN000;; Did size only grow by one
3038; $IF E ;;AN000;; Yes,
3039 JNE $MIF386
3040 MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0)
3041 PUSH AX ;;AN000;; Save it
3042 INC CX ;;AN000;; Count it
3043; $ENDIF ;;AN000;;
3044$MIF386:
3045 INC CX ;;AN000;; Restore CX
3046 PUSH WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
3047 RET ;;AN000;;
3048$M_CONVERTTIME ENDP ;;AN000;;
3049 ;;
3050;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3051 ENDIF ;;AN000;; END of include of TIME replace
3052 ENDIF ;;AN000;; END of include of Replacement common code
3053;
3054 IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace?
3055 INPUTmsg = FALSE ;;AN000;; Yes, THEN include it and reset the flag
3056;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3057;;
3058;; PROC NAME: $M_WAIT_FOR_INPUT
3059;;
3060;; FUNCTION: To accept keyed input and return extended key value
3061;; in AX register
3062;; INPUTS: DL contains the DOS function requested for input
3063;; OUPUTS: AX contains the extended key value that was read
3064;; REGS USED:
3065;;
3066;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3067 ;;
3068$M_WAIT_FOR_INPUT PROC NEAR ;;AN000;;
3069 ;;
3070 PUSH CX ;;AN000;; Save CX
3071 PUSH DX ;;AN000;; Save DX
3072 PUSH DS ;;AN000;; Save Data segment
3073 ;;
3074 CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer?
3075; $IF A ;;AN001;; Yes,
3076 JNA $MIF388
3077 MOV AL,DL ;;AN001;; Mov function into AL
3078 AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble
3079 MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function
3080; $ELSE ;;AN001;; No,
3081 JMP SHORT $MEN388
3082$MIF388:
3083 MOV AH,DL ;;AN000;; Put DOS function in AH
3084; $ENDIF ;;AN001;;
3085$MEN388:
3086 PUSH ES ;;AN000;; Get output buffer segment
3087 POP DS ;;AN000;;
3088 MOV DX,DI ;;AN000;; Get output buffer offset in case needed
3089 INT 21H ;;AN000;; Get keyboard input
3090 POP DS ;;AN000;;
3091
3092 CMP DL,DOS_BUF_KEYB_INP ;;AN000;;
3093 CLC ;;AN000;;
3094; $IF NE ;;AN000;; If character input
3095 JE $MIF391
3096 CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS?
3097; $IF C ;;AN000;;
3098 JNC $MIF392
3099 MOV CL,AL ;;AN000;; Save first character
3100 MOV AH,DL ;;AN001;; Get back function
3101 INT 21H ;;AN000;; Get keyboard input
3102 MOV AH,CL ;;AN000;; Retreive first character AX = xxxx
3103 CLC ;;AN000;; Clear carry condition
3104; $ELSE ;;AN000;;
3105 JMP SHORT $MEN392
3106$MIF392:
3107 MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS
3108; $ENDIF ;;AN000;;
3109$MEN392:
3110; $ENDIF ;;AN000;;
3111$MIF391:
3112 ;;
3113; $IF NC ;;AN000;;
3114 JC $MIF396
3115 POP DX ;;AN000;;
3116 POP CX ;;AN000;;
3117; $ELSE ;;AN000;;
3118 JMP SHORT $MEN396
3119$MIF396:
3120 ADD SP,4 ;;AN000;;
3121 STC ;;AN000;; Reset carry flag
3122; $ENDIF ;;AN000;;
3123$MEN396:
3124 RET ;;AN000;; Return
3125 ;;
3126$M_WAIT_FOR_INPUT ENDP ;;AN000;;
3127 ;;
3128;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3129 ENDIF ;;AN000;; END of include of Wait for Input
3130 ENDIF ;;AN000;; END of include of SYSDISPMSG
3131 ENDIF ;;AN000;; END of include of MSG_DATA_ONLY
3132ENDIF ;;AN000;; END of include of Structure only
3133 \ 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 @@
1; SCCSID = @(#)ibmhalo.asm 1.1 85/04/10
2; On 2K (800h) boundaries beginning at address C0000h and ending at EF800h
3; there is a header that describes a block of rom program. This header
4; contains information needed to initialize a module and to provide PCDOS
5; with a set of reserved names for execution.
6;
7; This header has the following format:
8;
9; rom_header STRUC
10; Signature1 DB 55h
11; Signature2 DB AAh
12; rom_length DB ? ; number of 512 byte pieces
13; init_jmp DB 3 dup (?)
14; name_list name_struc <>
15; rom_header ENDS
16;
17; name_struc STRUC
18; name_len DB ?
19; name_text DB ? DUP (?)
20; name_jmp DB 3 DUP (?)
21; name_struc ENDS
22;
23; The name list is a list of names that are reserved by a particular section
24; of a module. This list of names is terminated by a null name (length
25; is zero).
26;
27; Consider now, the PCDOS action when a user enters a command:
28;
29; COMMAND.COM has control.
30; o If location FFFFEh has FDh then
31; o Start scanning at C0000h, every 800h for a byte 55h followed
32; by AAh, stop scan if we get above or = F0000H
33; o When we've found one, compare the name entered by the user
34; with the one found in the rom. If we have a match, then
35; set up the environment for execution and do a long jump
36; to the near jump after the found name.
37; o If no more names in the list, then continue scanning the module
38; for more 55h followed by AAh.
39; o We get to this point only if there is no matching name in the
40; rom. We now look on disk for the command.
41;
42; This gives us the flexibility to execute any rom cartridge without having
43; to 'hard-code' the name of the cartridge into PCDOS. Rom modules that
44; want to be invisible to the DOS should not have any names in their lists
45; (i.e. they have a single null name).
46;
47; Consider a new release of BASIC, say, that patches bugs in the ROM version.
48; Clearly this version will be available on disk. How does a user actually
49; invoke this new BASIC?? He cannot call it BASIC on the disk because the
50; EXEC loader will execute the ROM before it even looks at the disk! Only
51; solution:
52;
53; o Keep things consistent and force the user to have his software named
54; differently from the ROM names (BASIC1, BASIC2, etc).
55
56rom_header STRUC
57 Signature1 DB ?
58 Signature2 DB ?
59 rom_length DB ?
60 init_jmp DB 3 dup (?)
61 name_list DB ?
62rom_header ENDS
63
64name_struc STRUC
65 name_len DB ?
66 name_text DB 1 DUP (?)
67 name_jmp DB 3 DUP (?)
68name_struc ENDS
69
70ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
71
72;
73; Check for IBM PC Jr rom cartrides. DS:DX is a pointer to name
74;
75ROM_SCAN:
76 PUSH ES
77 PUSH SI
78 PUSH DI
79 PUSH CX
80 PUSH AX
81 PUSH BX
82;
83; check for PC Jr signature in rom
84;
85 MOV AX,0F000h
86 MOV ES,AX
87 CMP BYTE PTR ES:[0FFFEh],0FDh
88 JZ SCAN_IT
89NO_ROM:
90 CLC
91ROM_RET:
92 POP BX
93 POP AX
94 POP CX
95 POP DI
96 POP SI
97 POP ES
98 RET
99SCAN_IT:
100;
101; start scanning at C000
102;
103 MOV AX,0C000h
104SCAN_ONE:
105 MOV ES,AX
106 XOR DI,DI
107SCAN_MODULE:
108;
109; check for a valid header
110;
111 CMP WORD PTR ES:[DI],0AA55h
112 JZ SCAN_LIST
113 ADD AX,080h
114SCAN_END:
115 CMP AX,0F000h
116 JB SCAN_ONE
117 JMP NO_ROM
118;
119; trundle down list of names
120;
121SCAN_LIST:
122 MOV BL,ES:[DI].rom_length ; number of 512-byte jobbers
123 XOR BH,BH ; nothing in the high byte
124 SHL BX,1
125 SHL BX,1 ; number of paragraphs
126 ADD BX,7Fh
127 AND BX,0FF80h ; round to 2k
128
129 MOV DI,name_list
130SCAN_NAME:
131 MOV CL,ES:[DI] ; length of name
132 INC DI ; point to name
133 XOR CH,CH
134 OR CX,CX ; zero length name
135 JNZ SCAN_TEST ; nope... compare
136 ADD AX,BX ; yep, skip to next block
137 JMP SCAN_END
138;
139; compare a single name
140;
141SCAN_TEST:
142 MOV SI,DX
143 INC SI
144 REPE CMPSB ; compare name
145 JZ SCAN_FOUND ; success!
146SCAN_NEXT:
147 ADD DI,CX ; failure, next name piece
148 ADD DI,3
149 JMP SCAN_NAME
150;
151; found a name. save entry location
152;
153SCAN_FOUND:
154 CMP BYTE PTR DS:[SI],'?'
155 JZ SCAN_SAVE
156 CMP BYTE PTR DS:[SI],' '
157 JNZ SCAN_NEXT
158SCAN_SAVE:
159 MOV [rom_cs],ES
160 MOV [ROM_ip],DI
161 STC
162 JMP ROM_RET
163
164;
165; execute a rom-placed body of code. allocate largest block
166;
167ROM_EXEC:
168 MOV BX,0FFFFh
169 MOV AH,ALLOC
170 INT int_command
171 MOV AH,ALLOC
172 INT int_command
173 PUSH BX
174 PUSH AX
175;
176; set terminate addresses
177;
178 MOV AX,(set_interrupt_vector SHL 8) + int_terminate
179 PUSH DS
180 MOV DS,[RESSEG]
181 ASSUME DS:RESGROUP
182 MOV DX,OFFSET RESGROUP:EXEC_WAIT
183 INT int_command
184 MOV DX,DS
185 MOV ES,DX
186 ASSUME ES:RESGROUP
187 POP DS
188 ASSUME DS:NOTHING
189;
190; and create program header and dup all jfn's
191;
192 POP DX
193 MOV AH,DUP_PDB
194 INT int_command
195;
196; set up dma address
197;
198 MOV DS,DX
199 MOV DX,080h
200 MOV AH,SET_DMA
201 INT int_command
202;
203; copy in environment info
204;
205 MOV AX,[ENVIRSEG]
206 MOV DS:[PDB_environ],AX
207;
208; set up correct size of block
209;
210 POP BX ; BX has size, DS has segment
211 MOV DX,DS
212 ADD DX,BX
213 MOV DS:[PDB_block_len],DX
214;
215; change ownership of block
216;
217 MOV DX,DS
218 DEC DX
219 MOV DS,DX
220 INC DX
221 MOV DS:[arena_owner],DX
222 MOV DS,DX
223;
224; set up correct stack
225;
226 CMP BX,1000h
227 JB GOT_STACK
228 XOR BX,BX
229GOT_STACK:
230 MOV CL,4
231 SHL BX,CL
232 MOV DX,DS
233 MOV SS,DX
234 MOV SP,BX
235 XOR AX,AX
236 PUSH AX
237;
238; set up initial registers and go to the guy
239;
240 NOT AX
241 PUSH [ROM_CS]
242 PUSH [ROM_IP]
243 MOV ES,DX
244ASSUME ES:NOTHING
245FOOBAR PROC FAR
246 RET
247FOOBAR 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 @@
1; SCCSID = @(#)mshead.asm 1.1 85/04/10
2; TITLE MSHEAD.ASM -- MS-DOS DEFINITIONS
3PAGE
4; MS-DOS High-performance operating system for the 8086 version 1.28
5; by Microsoft MSDOS development group:
6; TP (Ret.)
7; AR
8; NP (Parenting)
9; MZ
10; CP (BIOS) (ret.)
11
12; ****************** Revision History *************************
13; >> EVERY change must noted below!! <<
14;
15; 0.34 12/29/80 General release, updating all past customers
16; 0.42 02/25/81 32-byte directory entries added
17; 0.56 03/23/81 Variable record and sector sizes
18; 0.60 03/27/81 Ctrl-C exit changes, including register save on user stack
19; 0.74 04/15/81 Recognize I/O devices with file names
20; 0.75 04/17/81 Improve and correct buffer handling
21; 0.76 04/23/81 Correct directory size when not 2^N entries
22; 0.80 04/27/81 Add console input without echo, Functions 7 & 8
23; 1.00 04/28/81 Renumber for general release
24; 1.01 05/12/81 Fix bug in `STORE'
25; 1.10 07/21/81 Fatal error trapping, NUL device, hidden files, date & time,
26; RENAME fix, general cleanup
27; 1.11 09/03/81 Don't set CURRENT BLOCK to 0 on open; fix SET FILE SIZE
28; 1.12 10/09/81 Zero high half of CURRENT BLOCK after all (CP/M programs don't)
29; 1.13 10/29/81 Fix classic "no write-through" error in buffer handling
30; 1.20 12/31/81 Add time to FCB; separate FAT from DPT; Kill SMALLDIR; Add
31; FLUSH and MAPDEV calls; allow disk mapping in DSKCHG; Lots
32; of smaller improvements
33; 1.21 01/06/82 HIGHMEM switch to run DOS in high memory
34; 1.22 01/12/82 Add VERIFY system call to enable/disable verify after write
35; 1.23 02/11/82 Add defaulting to parser; use variable escape character Don't
36; zero extent field in IBM version (back to 1.01!)
37; 1.24 03/01/82 Restore fcn. 27 to 1.0 level; add fcn. 28
38; 1.25 03/03/82 Put marker (00) at end of directory to speed searches
39; 1.26 03/03/82 Directory buffers searched as a circular queue, current buffer
40; is searched first when possible to minimize I/O
41; 03/03/82 STORE routine optimized to tack on partial sector tail as
42; full sector write when file is growing
43; 03/09/82 Multiple I/O buffers
44; 03/29/82 Two bugs: Delete all case resets search to start at beginning
45; of directory (infinite loop possible otherwise), DSKRESET
46; must invalidate all buffers (disk and directory).
47; 1.27 03/31/82 Installable device drivers
48; Function call 47 - Get pointer to device table list
49; Function call 48 - Assign CON AUX LIST
50; 04/01/82 Spooler interrupt (INT 28) added.
51; 1.28 04/15/82 DOS retructured to use ASSUMEs and PROC labels around system
52; call entries. Most CS relative references changed to SS
53; relative with an eye toward putting a portion of the DOS in
54; ROM. DOS source also broken into header, data and code pieces
55; 04/15/82 GETDMA and GETVECT calls added as 24 and 32. These calls
56; return the current values.
57; 04/15/82 INDOS flag implemented for interrupt processing along with
58; call to return flag location (call 29)
59; 04/15/82 Volume ID attribute added
60; 04/17/82 Changed ABORT return to user to a long ret from a long jump to
61; avoid a CS relative reference.
62; 04/17/82 Put call to STATCHK in dispatcher to catch ^C more often
63; 04/20/82 Added INT int_upooler into loop ^S wait
64; 04/22/82 Dynamic disk I/O buffer allocation and call to manage them
65; call 49.
66; 04/23/82 Added GETDSKPTDL as call 50, similar to GETFATPT(DL), returns
67; address of DPB
68; 04/29/82 Mod to WRTDEV to look for ^C or ^S at console input when
69; writting to console device via file I/O. Added a console
70; output attribute to devices.
71; 04/30/82 Call to en/dis able ^C check in dispatcher Call 51
72; 04/30/82 Code to allow assignment of func 1-12 to disk files as well
73; as devices.... pipes, redirection now possible
74; 04/30/82 Expanded GETLIST call to 2.0 standard
75; 05/04/82 Change to INT int_fatal_abort callout int HARDERR. DOS SS
76; (data segment) stashed in ES, INT int_fatal_abort routines must
77; preserve ES. This mod so HARDERR can be ROMed.
78; 1.29 06/01/82 Installable block and character devices as per 2.0 spec
79; 06/04/82 Fixed Bug in CLOSE regarding call to CHKFATWRT. It got left
80; out back about 1.27 or so (oops). ARR
81; 1.30 06/07/82 Directory sector buffering added to main DOS buffer queue
82; 1.40 06/15/82 Tree structured directories. XENIX Path Parser MKDIR CHDIR
83; RMDIR Xenix calls
84; 1.41 06/13/82 Made GETBUFFR call PLACEBUF
85; 1.50 06/17/82 FATs cached in buffer pool, get FAT pointer calls disappear
86; Frees up lots of memory.
87; 1.51 06/24/82 BREAKDOWN Revised to do EXACT one sector read/write through
88; system buffers
89; 1.52 06/30/82 OPEN, CLOSE, READ, WRITE, DUP, DUP2, LSEEK implemented
90; 1.53 07/01/82 OPEN CLOSE mod for Xenix calls, saves and gets remote dir
91; 1.54 07/11/82 Function calls 1-12 make use of new 2.0 PDB. Init code
92; changed to set file handle environment.
93; 2.00 08/01/82 Number for IBM release
94; 01/19/83 No environ bug in EXEC
95; 01/19/83 MS-DOS OEM INT 21 extensions (SET_OEM_HANDLER)
96; 01/19/83 Performance bug fix in cooked write to NUL
97; 01/27/83 Growcnt fixed for 32-bits
98; 01/27/83 Find-first problem after create
99; 2.01 02/17/83 International DOS
100; 2.10 03/09/83 Start of NETWORK support
101; New Buffer structure
102; New Sytem file table structure
103; FCB moved to internal representation
104; DOS re-organized
105; 2.11 04/21/83 Continuation of 2.10, preliminary Network
106; device interface.
107; 2.50 09/12/83 More network stuff
108;
109; *************************************************************
110
111INCLUDE DOSSYM.INC
112INCLUDE DEVSYM.INC
113
114Break <SEGMENT DECLARATIONS>
115
116; The following are all of the segments used. They are declared in the order
117; that they should be placed in the executable
118
119;
120; segment ordering for MSDOS
121;
122
123include dosseg.asm
124
125AsmVar <Installed>
126
127START SEGMENT BYTE PUBLIC 'START'
128 ASSUME CS:DOSGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
129 JMP near ptr DOSINIT
130START ENDS
131
132LAST SEGMENT PARA PUBLIC 'LAST'
133 Extrn DOSINIT:NEAR
134LAST 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 @@
1; SCCSID = @(#)ibmtable.asm 1.1 85/04/10
2;
3; Table Segment for DOS
4;
5
6.xlist
7.xcref
8include mssw.asm
9.cref
10.list
11
12TITLE IBMTABLE - Table segment for DOS
13NAME IBMTABLE
14
15include ms_table.asm
16 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 @@
1; SCCSID = @(#)msdata.asm 1.8 85/09/12
2 AsmVars <Kanji, Debug, Redirector, ShareF>
3
4Break <Uninitialized data overlayed by initialization code>
5
6DATA SEGMENT WORD PUBLIC 'DATA'
7; Init code overlaps with data area below
8
9 ORG 0
10PUBLIC MSDAT001S,MSDAT001E
11MSDAT001S label byte
12
13 I_am TIMEBUF,6 ; Time read from clock device
14 I_am DEVIOBUF,2 ; Buffer for I/O under file assignment
15;
16; The following areas are used as temp buffer in EXEC system call
17;
18 I_am OPENBUF,128 ; buffer for name operations
19 I_am RenBuf,128 ; buffer for rename destination
20; Buffer for search calls
21 I_am SEARCHBUF,53 ; internal search buffer
22 I_am DummyCDS,curdirLen
23;
24; End of contiguous buffer
25;
26
27;
28; Temporary directory entry for use by many routines. Device directory
29; entries (bogus) are built here.
30;
31 PUBLIC DevFCB
32DEVFCB LABEL BYTE ; Uses NAME1, NAME2, combined
33; WARNING.. do not alter position of NAME1 relative to DEVFCB
34; without first examining BUILD_DEVICE_ENT. Look carefully at DOS_RENAME
35; as well as it is the only guy who uses NAME2 and DESTSTART.
36 I_am NAME1,12 ; File name buffer
37 I_am NAME2,13 ;
38 I_am DESTSTART,WORD ;
39 DB ((SIZE DIR_ENTRY) - ($ - DEVFCB)) DUP (?)
40;
41; End Temporary directory entry.
42;
43 I_am ATTRIB,BYTE ; storage for file attributes
44 I_am EXTFCB,BYTE ; TRUE => extended FCB in use
45 I_am SATTRIB,BYTE ; Storage for search attributes
46 I_AM open_access,BYTE ; access of open system call
47 I_am FoundDel,BYTE ; true => file was deleted
48 I_am Found_dev,BYTE ; true => search found a device
49 I_am fSplice,BYTE ; true => do a splice in transpath
50 I_am fSharing,BYTE ; TRUE => no redirection
51 I_am SECCLUSPOS,BYTE ; Position of first sector within cluster
52 I_am TRANS,BYTE ;
53 I_am READOP,BYTE ;
54 I_am THISDRV,BYTE ;
55 I_am CLUSFAC,BYTE ;
56 I_am CLUSSPLIT,BYTE ;
57 I_am INSMODE,BYTE ; true => insert mode in buffered read
58 I_am cMeta,BYTE ; count of meta'ed components found
59 I_am VOLID,BYTE ;
60 I_am exit_type,BYTE ; type of exit...
61
62 EVEN
63
64; WARNING - the following two items are accessed as a word
65 I_am CREATING,BYTE ; true => creating a file
66 I_am DELALL,BYTE ; true => deleting everything
67
68 I_am EXITHOLD,DWORD ; Temp location for proc terminate
69 I_am user_SP,WORD ; User SP for system call
70 I_am user_SS,WORD ; User SS for system call
71 I_am CONTSTK,WORD ;
72 I_am THISDPB,DWORD ;
73 I_am CLUSSAVE,WORD ;
74 I_am CLUSSEC,DWORD ;>32mb AC0000
75 I_am PREREAD,WORD ; 0 means preread; 1 means optional
76 I_am FATBYT,WORD ; Used by ALLOCATE
77 I_am FATBYTE,WORD ; Used by $SLEAZEFUNC
78 I_am DEVPT,DWORD ;
79 I_am THISSFT,DWORD ; Address of user SFT
80 I_am THISCDS,DWORD ; Address of current CDS
81 I_am THISFCB,DWORD ; Address of user FCB
82 I_am SFN,WORD,<-1> ; SystemFileNumber found for accessfile
83 I_am JFN,WORD ; JobFileNumber found for accessfile
84 I_am PJFN,DWORD ; PointerJobFileNumber found for accessfile
85 I_am WFP_START,WORD ;
86 I_am REN_WFP,WORD ;
87 I_am CURR_DIR_END,WORD ;
88 I_am NEXTADD,WORD ;
89 I_am LASTPOS,WORD ;
90 I_am CLUSNUM,WORD ;
91 I_am DIRSEC,DWORD ;>32mb AC0000
92 I_am DIRSTART,WORD ;
93 I_am SECPOS,DWORD ;>32mb Position of first sector accessed
94 I_am VALSEC,DWORD ;>32mb Number of valid (previously written)
95 ; sectors
96 I_am BYTSECPOS,WORD ; Position of first byte within sector
97 I_am BYTPOS,4 ; Byte position in file of access
98 I_am BYTCNT1,WORD ; No. of bytes in first sector
99 I_am BYTCNT2,WORD ; No. of bytes in last sector
100 I_am SECCNT,WORD ; No. of whole sectors
101 I_am ENTFREE,WORD ;
102 I_am ENTLAST,WORD ;
103 I_am NXTCLUSNUM,WORD ;
104 I_am GROWCNT,DWORD ;
105 I_am CURBUF,DWORD ;
106 I_am CONSft,DWORD ; SFT of console swapped guy.
107 I_am SaveBX,WORD ;
108 I_am SaveDS,WORD ;
109 I_am restore_tmp,WORD ; return address for restore world
110 I_am NSS,WORD
111 I_am NSP,WORD
112 I_am EXTOPEN_FLAG,WORD,<0> ;FT. extended open input flag ;AN000;
113 I_am EXTOPEN_ON,BYTE,<0> ;FT. extended open conditional flag ;AN000;
114 I_am EXTOPEN_IO_MODE,WORD,<0>;FT. extende open io mode ;AN000;
115 I_am SAVE_DI,WORD ;FT. extende open saved DI ;AN000;
116 I_am SAVE_ES,WORD ;FT. extende open saved ES ;AN000;
117 I_am SAVE_DX,WORD ;FT. extende open saved DX ;AN000;
118 I_am SAVE_CX,WORD ;FT. extende open saved CX ;AN000;
119 I_am SAVE_BX,WORD ;FT. extende open saved BX ;AN000;
120 I_am SAVE_SI,WORD ;FT. extende open saved SI ;AN000;
121 I_am SAVE_DS,WORD ;FT. extende open saved DS ;AN000;
122 I_am HIGH_SECTOR,WORD,<0> ;>32mb higher sector # ;AN000;
123 I_am HIGH_SECTOR_TEMP,WORD,<0>;>32mb high sector # ;AN000;
124 I_am DISK_FULL,BYTE ;>32mb indicating disk full when 1 ;AN000;
125 I_am TEMP_VAR,WORD ; temporary variable for everyone ;AN000;
126 I_am TEMP_VAR2,WORD ; temporary variable 2 for everyone ;AN000;
127 I_am DrvErr,BYTE ; used to save drive error ;AN000;
128 I_am DOS34_FLAG,WORD,<0> ; common flag for DOS 3.4 ;AN000;
129 I_am NO_FILTER_PATH,DWORD ; pointer to orignal path ;AN000;
130 I_am NO_FILTER_DPATH,DWORD ; pointer to orignal path of destination;AN000;
131 I_am Callback_SS,WORD ;AN000; call back SS for system call
132 I_am Callback_SP,WORD ;AN000; call back SP for system call
133 I_am Callback_flag,BYTE,<0> ;AN000; call back flag
134
135
136; make those pushes fast!!!
137EVEN
138StackSize = 180h ; gross but effective
139;;;StackSize = 300h ; This is a "trial" change IBM hasn't
140;;; ; made up their minds about
141
142;
143; WARNING!!!! DskStack may grow into AUXSTACK due to interrupt service.
144; This is NO problem as long as AUXSTACK comes immediately before DSKSTACK
145;
146
147 PUBLIC RENAMEDMA,AuxStack,DskStack,IOStack
148RENAMEDMA LABEL BYTE ; See DOS_RENAME
149
150 DB StackSize DUP (?) ;
151AuxStack LABEL BYTE
152
153 DB StackSize DUP (?) ;
154DskStack LABEL BYTE
155
156 DB StackSize DUP (?) ;
157IOStack LABEL BYTE
158
159
160; patch space for Boca folks.
161; Say What????!!! This does NOT go into the swappable area!
162; NOTE: We include the decl of ibmpatch in ms-dos even though it is not needed.
163; This allows the REDIRector to work on either IBM or MS-DOS.
164
165PUBLIC IBMPATCH
166IBMPATCH label byte
167 I_am PRINTER_FLAG,BYTE,<0> ; [SYSTEM] status of PRINT utility
168 I_am VOLCHNG_FLAG,BYTE,<0> ; [SYSTEM] true if volume label created
169 I_am VIRTUAL_OPEN,BYTE,<0> ; [SYSTEM] non-zero if we opened a virtual file
170
171; Following 4 variables moved to MSDATA.asm from MSTABLE.asm (P4986)
172 I_am FSeek_drive,BYTE ;AN000; fastseek drive #
173 I_am FSeek_firclus,WORD ;AN000; fastseek first cluster #
174 I_am FSeek_logclus,WORD ;AN000; fastseek logical cluster #
175 I_am FSeek_logsave,WORD ;AN000; fastseek returned log clus #
176 I_am ACT_PAGE,WORD,<-1> ;;;;;;; ;BL ; active EMS page ;AN000;
177
178
179SWAP_END LABEL BYTE
180PUBLIC SWAP_END
181
182; THE FOLLOWING BYTE MUST BE HERE, IMMEDIATELY FOLLOWING SWAP_END. IT CANNOT
183; BE USED. If the size of the swap data area is ODD, it will be rounded up
184; to include this byte.
185 DB ?
186
187 DB (512+80+32-(SWAP_END-ibmpatch)) DUP (?)
188
189MSDAT001e label byte
190
191.xall
192
193DATA ENDS
194 \ 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 @@
1; SCCSID = @(#)mult.asm 1.2 85/04/12
2Break <Critical section and Multiplex channels>
3
4;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
5; C A V E A T P R O G R A M M E R ;
6; ;
7; Critical section definitions
8;
9; These below are subject to leave-all sections
10critDisk EQU 1 ; Disk I/O critical section
11critDevice EQU 2 ; Device I/O critical section
12critShare EQU 1 ; Sharer I/O critical section
13critMem EQU 1 ; memory maintenance critical section
14critNet EQU 5 ; network critical section
15critSFT EQU 1 ; sft table allocation
16critIFS EQU 6 ; ifsfunc critical section
17; These below are not subject to leave-all sections
18critASSIGN EQU 8 ; Assign has munged a system call
19; ;
20; C A V E A T P R O G R A M M E R ;
21;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
22
23;
24; The current set of defined multiplex channels is (* means documented):
25;
26; Channel(h) Issuer Receiver Function
27; 00 server PSPRINT print job control
28; *01 print/apps PRINT Queueing of files
29; 02 BIOS REDIR signal open/close of printers
30;
31; 05 command REDIR obtain text of net int 24 message
32; *06 server/assign ASSIGN Install check
33;
34; 08 external driver IBMBIO interface to internal routines
35;
36; 10 sharer/server Sharer install check
37; 11 DOS/server Redir install check/redirection funcs
38; 12 sharer/redir DOS dos functions and structure maint
39; 13 MSNET MSNET movement of NCBs
40; 13 external driver IBMBIO Reset_Int_13, allows installation
41; of alternative INT_13 drivers after
42; boot_up
43; 14 (IBM) DOS NLSFUNC down load NLS country info,DOS 3.3
44; 14 (MS) APPS POPUP MSDOS 4 popup screen functions
45; 15 APPS MSCDEX CD-ROM extensions interface
46; 16 WIN386 WIN386 Windows communications
47; 17 Clipboard WINDOWS Clipboard interface
48; *18 Applications MS-Manger Toggle interface to manager
49; 19 Shell
50; 1A Ansi.sys
51; 1B Fastopen,Vdisk IBMBIO EMS INT 67H stub handler
52;
53; AC Graphics
54; AD NLS (toronto)
55; AE
56; AF Mode
57; B0 GRAFTABL GRAFTABL
58;
59
60
61;MUX 00-3F reserverd for IBM
62;MUX 80-BF reserverd for IBM
63;MUX 40-7F reserved for Microsoft
64;MUX C0-FF users
65
66
67
68MultSHARE EQU 10h ; sharer
69 ; 1 MFT_enter
70 ; 2 MFTClose
71 ; 3 MFTclU
72 ; 4 MFTCloseP
73 ; 5 MFTCloN
74 ; 6 set_block
75 ; 7 clr_block
76 ; 8 chk_block
77 ; 9 MFT_get
78 ; 10 ShSave
79 ; 11 ShChk
80 ; 12 ShCol
81 ; 13 ShCloseFile
82
83MultNET EQU 11h ; Network support
84MultIFS EQU 11h ; Network support
85 ; 1 IFS_RMDIR
86 ; 2 IFS_SEQ_RMDIR
87 ; 3 IFS_MKDIR
88 ; 4 IFS_SEQ_MKDIR
89 ; 5 IFS_CHDIR
90 ; 6 IFS_CLOSE
91 ; 7 IFS_COMMIT
92 ; 8 IFS_READ
93 ; 9 IFS_WRITE
94 ; 10 IFS_LOCK
95 ; 11 IFS_UNLOCK
96 ; 12 IFS_DISK_INFO
97 ; 13 IFS_SET_FILE_ATTRIBUTE
98 ; 14 IFS_SEQ_SET_FILE_ATTRIBUTE
99 ; 15 IFS_GET_FILE_INFO
100 ; 16 IFS_SEQ_GET_FILE_INFO
101 ; 17 IFS_RENAME
102 ; 18 IFS_SEQ_RENAME
103 ; 19 IFS_DELETE
104 ; 20 IFS_SEQ_DELETE
105 ; 21 IFS_OPEN
106 ; 22 IFS_SEQ_OPEN
107 ; 23 IFS_CREATE
108 ; 24 IFS_SEQ_CREATE
109 ; 25 IFS_SEQ_SEARCH_FIRST
110 ; 26 IFS_SEQ_SEARCH_NEXT
111 ; 27 IFS_SEARCH_FIRST
112 ; 28 IFS_SEARCH_NEXT
113 ; 29 IFS_ABORT
114 ; 30 IFS_ASSOPER
115 ; 31 Printer_SET_STRING
116 ; 32 IFSFlushBuf
117 ; 33 IFSBufWrite
118 ; 34 IFSResetEnvironment
119 ; 35 IFSSpoolCheck
120 ; 36 IFSSpoolClose
121
122MultDOS EQU 12h ; DOS call back
123 ; 1 DOS_CLOSE
124 ; 2 RECSET
125 ; 3 Get DOSGROUP
126 ; 4 PATHCHRCMP
127 ; 5 OUT
128 ; 6 NET_I24_ENTRY
129 ; 7 PLACEBUF
130 ; 8 FREE_SFT
131 ; 9 BUFWRITE
132 ; 10 SHARE_VIOLATION
133 ; 11 SHARE_ERROR
134 ; 12 SET_SFT_MODE
135 ; 13 DATE16
136 ; 14 SETVISIT
137 ; 15 SCANPLACE
138 ; 16 SKIPVISIT
139 ; 17 StrCpy
140 ; 18 StrLen
141 ; 19 Ucase
142 ; 20 POINTCOMP
143 ; 21 CHECKFLUSH
144 ; 22 SFFromSFN
145 ; 23 GetCDSFromDrv
146 ; 24 Get_User_Stack
147 ; 25 GetThisDrv
148 ; 26 DriveFromText
149 ; 27 SETYEAR
150 ; 28 DSUM
151 ; 29 DSLIDE
152 ; 30 StrCmp
153 ; 31 initcds
154 ; 32 pjfnfromhandle
155 ; 33 $NameTrans
156 ; 34 CAL_LK
157 ; 35 DEVNAME
158 ; 36 Idle
159 ; 37 DStrLen
160 ; 38 NLS_OPEN DOS 3.3
161 ; 39 $CLOSE DOS 3.3
162 ; 40 NLS_LSEEK DOS 3.3
163 ; 41 $READ DOS 3.3
164 ; 42 FastInit DOS 4.0
165 ; 43 NLS_IOCTL DOS 3.3
166 ; 44 GetDevList DOS 3.3
167 ; 45 NLS_GETEXT DOS 3.3
168 ; 46 MSG_RETRIEVAL DOS 4.0
169 ; 47 FAKE_VERSION DOS 4.0
170 ;
171NLSFUNC EQU 14h ; NLSFUNC CALL , DOS 3.3
172 ; 0 NLSInstall
173 ; 1 ChgCodePage
174 ; 2 GetExtInfo
175 ; 3 SetCodePage
176 ; 4 GetCntry
177 ;
178;FASTOPEN is not chained through INT 2F ; DOS 3.3 F.C.
179; it calls Multdos 42 to set up an entry routine address
180 ; 0 Install status (reserved)
181 ; 1 Lookup
182 ; 2 Insert
183 ; 3 Delete
184 ; 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 @@
1; SCCSID = @(#)nibdos.asm 1.1 85/04/10
2TITLE NIBDOS
3NAME MSDOS_3
4
5include mssw.asm
6include msconst.asm
7 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 @@
1 PAGE ;AN000;
2; $SALUT (4,4,8,41)
3;(deleted).XLIST
4;(deleted)INCLUDE STRUC.INC ;AN020;structured macro definitions for .IF,.ELSE etc.
5;(deleted).LIST
6;
7; NOTE: basesw must be set properly to allow the PARSER to access psdata.
8; - basesw undefined means CS seg. override for psdata access.
9; - basesw = 1 means DS seg. override for psdata access &
10; DS must point to psdata.
11; - basesw = 0 means ES seg. override for psdata access &
12; ES must point to psdata.
13;
14;
15IFNDEF basesw ;AN022;
16 psdata_seg EQU CS ;AN022;
17ELSE ;AN022;
18 IF basesw ;AN022;IF "basesw EQU 1" specified by caller THEN
19 psdata_seg EQU DS ;AN022;
20 ELSE ;AN022;
21 psdata_seg EQU ES ;AN022;ELSE only other choice is ES (basesw EQU 0)
22 ENDIF ;AN022;
23ENDIF ;AN022;
24
25ifndef incsw ;AN000; (tm03) Someone doesn't want to include psdata
26 incsw equ 1 ;AN000; include psdata.inc (tm03)
27endif ;AN000; (tm03)
28if incsw ;AN000; If incsw = 1 then (tm03)
29 include psdata.inc ;AN000; include psdata.inc (tm03)
30endif ;AN000; endif (tm03)
31 PAGE ;AN000;
32IF1 ;AN000;
33 %OUT INCLUDING COMP=COMMON DSN=PARSE.ASM...;AN000;
34ENDIF ;AN000;
35;***********************************************************************
36; SysParse;
37;
38; Function : Parser Entry
39;
40; Input: DS:SI -> command line
41; ES:DI -> parameter block
42; psdata_seg -> psdata.inc
43; CX = operand ordinal
44;
45; Note: ES is the segment containing all the control blocks defined
46; by the caller, except for the DOS COMMAND line parms, which
47; is in DS.
48;
49; Output: CY = 1 error of caller, means invalid parameter block or
50; invalid value list. But this parser does NOT implement
51; this feature. Therefore CY always zero.
52;
53; CY = 0 AX = return code
54; BL = terminated delimiter code
55; CX = new operand ordinal
56; SI = set past scaned operand
57; DX = selected result buffer
58;
59; Use: $P_Skip_Delim, $P_Chk_EOL, $P_Chk_Delim, $P_Chk_DBCS
60; $P_Chk_Swtch, $P_Chk_Pos_Control, $P_Chk_Key_Control
61; $P_Chk_Sw_Control, $P_Fill_Result
62;
63; Vars: $P_Ordinal(RW), $P_RC(RW), $P_SI_Save(RW), $P_DX(R), $P_Terminator(R)
64; $P_SaveSI_Cmpx(W), $P_Flags(RW), $P_Found_SYNONYM(R), $P_Save_EOB(W)
65;
66;-------- Modification History -----------------------------------------
67;
68; 4/04/87 : Created by K. K,
69; 4/28/87 : $P_Val_YH assemble error (tm01)
70; : JMP SHORT assemble error (tm02)
71; 5/14/87 : Someone doesn't want to include psdata (tm03)
72; 6/12/87 : $P_Bridge is missing when TimeSw equ 0 and (CmpxSw equ 1 or
73; DateSW equ 1) (tm04)
74; 6/12/87 : $P_SorD_Quote is missing when QusSw equ 0 and CmpxSW equ 1
75; (tm05) in PSDATA.INC
76; 6/12/87 : $P_FileSp_Char and $P_FileSP_Len are missing
77; when FileSW equ 0 and DrvSW equ 1 (tm06) in PSDATA.INC
78; 6/18/87 : $VAL1 and $VAL3, $VAL2 and $VAL3 can be used in the same
79; value-list block (tm07)
80; 6/20/87 : Add $P_SW to check if there's an omiting parameter after
81; switch (keyword) or not. If there is, backup si for next call
82; (tm08)
83; 6/24/87 : Complex Item checking does not work correctly when CmpSW equ 1
84; and DateSW equ 0 and TimeSW equ 0 (tm09)
85; 6/24/87 : New function flag $P_colon_is_not_necessary for switch
86; /+15 and /+:15 are allowed for user (tm10)
87; 6/29/87 : ECS call changes DS register but it causes the address problem
88; in user's routines. $P_Chk_DBCS (tm11)
89; 7/10/87 : Switch with no_match flag (0x0000H) does not work correctly
90; (tm12)
91; 7/10/87 : Invalid switch/keyword does not work correctly
92; (tm13)
93; 7/10/87 : Drive_only breaks 3 bytes after the result buffer
94; (tm14)
95; 7/12/87 : Too_Many_Operands sets DX=0 as the PARSE result
96; (tm15)
97; 7/24/87 : Negative lower bound on numeric ranges cause trouble
98
99; 7/24/87 : Quoted strings being returned with quotes.
100
101; 7/28/87 : Kerry S (;AN018;)
102; Non optional value on switch (match flags<>0 and <>1) not flagged
103; as an error when missing. Solution: return error 2. Modules
104; affected: $P_Chk_SW_Control.
105
106; 7/29/87 : Kerry S (;AN019;)
107; Now allow the optional bit in match flags for switches. This
108; allows the switch to be encountered with a value or without a
109; value and no error is returned.
110;
111
112; 8/28/87 : Ed K, Kerry S (;AN020;)
113; 9/14/87 In PROC $P_Get_DecNum, when checking for field separators
114; within a date response, instead of checking just for the one
115; character defined by the COUNTRY DEPENDENT INFO, check for
116; all three chars, "-", "/", and ".". Change $P_Chk_Switch to allow
117; slashes in date strings when DateSw (assembler switch) is set.
118
119; 9/1/87 : Kerry S (;AN021)
120; In PROC $P_String_Comp, when comparing the switch or keyword on
121; the command line with the string in the control block the
122; comparing was stopping at a colon (switch) or equal (keyword)
123; on the command line and assuming a match. This allowed a shorter
124; string on the command line than in the synonym list in the control
125; block. I put in a test for a null in the control block so the
126; string in the control block must be the same length as the string
127; preceeding the colon or equal on the command line.
128
129; 8/28/87 : Kerry S (;AN022;)
130; All references to data in PSDATA.INC had CS overrides. This caused
131; problems for people who included it themselves in a segment other
132; than CS. Added switch to allow including PSDATA.INC in any
133; segment.
134
135; 9/16/87 : Ed K (;AN023;) PTM1040
136; in $p_set_cdi PROC, it assumes CS points to psdata. Change Push CS
137; into PUSH PSDATA_SEG. In $P_Get_DecNum PROC, fix AN020
138; forced both TIME and DATE to use the delims, "-","/",".".
139; Created FLag, in $P_time_Format PROC, to request the delim in
140; BL be used if TIME is being parsed.
141
142; 9/24/87 : Ed K
143; Removed the include to STRUC.INC. Replaced the STRUC macro
144; invocations with their normally expanded code; made comments
145; out of the STRUC macro invocation statements to maintain readability.
146
147; 9/24/87 : Ed K (;AN024;) PTM1222
148; When no CONTROL for a keyword found, tried to fill in RESULT
149; pointed to by non-existant CONTROL.
150
151; 10/15/87 : Ed K (;AN025;) PTM1672
152; A quoted text string can be framed only by double quote. Remove
153; support to frame quoted text string with single quote.
154; (apostrophe) $P_SorD_Quote is removed from PSDATA.INC.
155; $P_SQuote EQU also removed from PSDATA.INC. Any references to
156; single quote in PROC prologues are left as is for history reasons.
157
158; This fixes another bug, not mentioned in p1672, in that two
159; quote chars within a quoted string is supposed to be reported as
160; one quote character, but is reported as two quotes. This changed
161; two instructions in PROC $P_Quoted_Str.
162
163; Also fixed are several JMP that caused a NOP, these changed to
164; have the SHORT operator to avoid the unneeded NOP.
165
166; The code and PSDATA.INC have been aligned for ease of reading.
167
168; 10/26/87 : Ed K (;AN026;) PTM2041, DATE within SWITCH, BX reference to
169; psdata buffer should have psdata_seg.
170
171; 10/27/87 : Ed K (;AN027;) PTM2042 comma between keywords implies
172; positional missing.
173
174; 11/06/87 : Ed K (;AN028;) PTM 2315 Parser should not use line feed
175; as a line delimiter, should use carriage return.
176; Define switch: LFEOLSW, if on, accept LF as end of line char.
177
178; 11/11/87 : Ed K (;AN029;) PTM 1651 GET RID OF WHITESPACE AROUND "=".
179
180; 11/18/87 : Ed K (;AN030;) PTM 2551 If filename is just "", then
181; endless loop since SI is returned still pointing to start
182; of that parm.
183
184; 11/19/87 : Ed K (;AN031;) PTM 2585 date & time getting bad values.
185; Vector to returned string has CS instead of Psdata_Seg, but
186; when tried to fix it on previous version, changed similar
187; but wrong place.
188
189; 12/09/87 : Bill L (;AN032;) PTM 2772 colon and period are now valid
190; delimiters between hours, minutes, seconds for time. And period
191; and comma are valid delimiters between seconds and 100th second.
192
193; 12/14/87 : Bill L (;AN033;) PTM 2722 if illegal delimiter characters
194; in a filespec, then flag an error.
195
196; 12/22/87 : Bill L (;AN034;) All local data to parser is now
197; indexed off of the psdata_seg equate instead of the DS register.
198; Using this method, DS can point to the segment of PSP or to psdata
199; --> local parser data. Why were some references to local data changed
200; to do this before, but not all ?????
201
202; 02/02/88 : Ed K (;AC035;) INSPECT utility, suggests optimizations.
203
204; 02/05/88 : Ed K (;AN036;) P3372-UPPERCASE TRANSLATION, PSDATA_SEG HOSED.
205;
206; 02/08/88 : Ed K (;AN037;) P3410-AVOID POP OF CS, CHECK BASESW FIRST.
207
208; 02/19/88 : Ed K (;AN038;) p3524 above noon and "am" should be error
209
210; 02/23/88 : Ed K (;AN039;) p3518 accept "comma" and "period" as decimal
211; separator in TIME before hundredths field.
212;
213;***********************************************************************
214IF FarSW ;AN000;(Check if need far return)
215SysParse proc far ;AN000;
216ELSE ;AN000;
217SysParse proc near ;AN000;
218ENDIF ;AN000;(of FarSW)
219; $SALUT (4,9,17,41)
220 mov psdata_seg:$P_Flags,0 ;AC034; Clear all internal flags
221IF TimeSw ;AN039; FOR TIME ONLY
222 MOV PSDATA_SEG:$P_ORIG_ORD,CX ;AN039; ORIGINAL ORDINAL FROM CX
223 MOV PSDATA_SEG:$P_ORIG_STACK,SP ;AN039; ORIGINAL VALUE OF STACK FROM SP
224 MOV PSDATA_SEG:$P_ORIG_SI,SI ;AN039; ORIGINAL START PARSE POINTER FROM SI
225$P_REDO_TIME: ;AN039; try to parse time again
226ENDIF ;AN039; FOR TIME ONLY
227 cld ;AN000; confirm forward direction
228 mov psdata_seg:$P_ordinal,cx ;AC034; save operand ordinal
229 mov psdata_seg:$P_RC,$P_No_Error ;AC034; Assume no error
230 mov psdata_seg:$P_Found_SYNONYM,0 ;AC034; initalize synonym pointer
231
232 mov word ptr psdata_seg:$P_DX,0 ;AC034; (tm15)
233IF KeySW ;AN029;
234;IN CASE THE USER PUT OPTIONAL WHITESPACE CHARS AROUND THE "=" USED IN
235;KEYWORD DEFINITIONS, SCAN THE COMMAND LINE AND COMPRESS OUT ANY WHITESPACES
236;NEXT TO "=" BEFORE STARTING THE USUAL PARSING.
237 push cx ;AN029;
238 push dx ;AN029;
239 push di ;AN029;
240
241 push si ;AN029; remember where command line starts
242 mov cx,-1 ;AN029; init counter
243; $do
244$P_loc_eol: ;AN029;
245 inc cx ;AN029; bump counter of chars up to EOL
246 lodsb ;AN029; get a char from command line
247 CALL $P_Chk_EOL ;AN029; see if AL is EOL char
248
249; enddo z
250 jnz $P_loc_EOL ;AN029; not found that EOL char
251
252 mov psdata_seg:$P_count_to_EOL,cx ;AN029;AC034;; save count of chars up to EOL
253 pop si ;AN029; restore start of command line
254
255;scan command string for combinations including "=",
256; and replace each with just the simple "="
257
258;REPEAT UNTIL ONE PASS IS MADE WHEREIN NO CHANGES WERE MADE
259; $do
260$P_DO1: ;AN029;
261 push si ;AN029; remember where string started
262 MOV CX,psdata_seg:$P_COUNT_TO_EOL ;AN029;AC034;; set count to no. chars in string,
263 ;AN029; not counting the EOL char
264 XOR BX,BX ;AN029;SET $P_REG_BL_DQ_SW TO "NOT IN QUOTES", AND...
265 ;AN029;SET $P_REG_BH_CG_SW TO "NO CHANGES MADE"
266;MAKE ONE PASS THRU THE STRING, LOOKING AT EACH CHARACTER
267; $do ;AN029;
268$P_DO2: ;AN029;
269 cmp BYTE PTR [SI],$P_double_quote ;AN029;
270; $if e ;AN029;if a double quote was found
271 JNE $P_IF3 ;AN029;
272 NOT $P_REG_BL_DQ_SW ;AN029;TOGGLE THE DOUBLE QUOTE STATE SWITCH
273; $endif ;AN029;
274$P_IF3: ;AN029;
275 OR $P_REG_BL_DQ_SW,$P_REG_BL_DQ_SW ;AN029;IS THE DOUBLE QUOTE SWITCH SET?
276; $if Z ;AN029;IF NOT IN DOUBLE QUOTES
277 JNZ $P_IF5 ;AN029;
278 mov ax,word ptr [si] ;AN029; get pair to be checked out
279 cmp ax,$P_BL_EQ ;AN029;" ="
280; $if e,or ;AN029;
281 JE $P_LL6 ;AN029;
282 cmp ax,$P_EQ_BL ;AN029;"= "
283; $if e,or ;AN029;
284 JE $P_LL6 ;AN029;
285 cmp ax,$P_EQ_TB ;AN029; "=<tab>"
286; $if e,or ;AN029;
287 JE $P_LL6 ;AN029;
288 cmp ax,$P_TB_EQ ;AN029;"<tab>="
289; $if e ;AN029;if this pair to be replaced with a single "="
290 JNE $P_IF6 ;AN029;
291$P_LL6: ;AN029;
292 mov BYTE PTR [SI],$P_Keyword ;AN029; "="
293 inc si ;AN029;point to next char after the new "="
294 mov di,si ;AN029;move target right after new "="
295
296 push si ;AN029;remember where i am, right after new "="
297 PUSH CX ;AN029;SAVE CURRENT COUNT
298 inc si ;AN029;source is one beyond that
299 push es ;AN029;remember the extra segment
300 push ds ;AN029;temporarily, set source seg and
301 pop es ;AN029; target seg to the command line seg
302 rep movsb ;AN029;move chars left one position
303 pop es ;AN029;restore the extra segment
304 POP CX ;AN029;RESTORE CURRENT COUNT
305 pop si ;AN029;back to where I was
306
307 DEC SI ;AN029;LOOK AT FIRST CHAR JUST MOVED
308 MOV $P_REG_BH_CG_SW,-1 ;AN029;set switch to say "a change was made"
309 DEC psdata_seg:$P_COUNT_TO_EOL ;AN029;AC034;;because just threw away a char
310 dec CX ;AN029;DITTO
311; $endif ;AN029;comparand pair found?
312$P_IF6: ;AN029;
313; $endif ;AN029;double quote switch?
314$P_IF5: ;AN029;
315 inc si ;AN029;bump index to look at next char in command string
316 dec CX ;AN029;one less char to look at
317;(deleted ;AC035;) CMP CX,0 ;AN029;is char count all gone yet?
318; $enddo LE ;AN029;quit if no more chars
319 JNLE $P_DO2 ;AN029;
320 pop si ;AN029;remember where string started
321 OR $P_REG_BH_CG_SW,$P_REG_BH_CG_SW ;AN029;WAS "A CHANGE MADE"?
322; $enddo Z ;AN029;QUIT when no changes were made
323 JNZ $P_DO1 ;AN029;
324 pop di ;AN029;
325 pop dx ;AN029;
326 pop cx ;AN029;
327
328;NOW THAT ALL WHITESPACE SURROUNDING "=" HAVE BEEN COMPRESSED OUT,
329;RESUME NORMAL PARSING...
330ENDIF ;AN029; KEYWORDS SUPPORTED?
331 call $P_Skip_Delim ;AN000; Move si to 1st non white space
332 jnc $P_Start ;AN000; If EOL is not encountered, do parse
333
334;--------------------------- End of Line
335 mov ax,$P_RC_EOL ;AN000; set exit code to -1
336 push bx ;AN000;
337 mov bx,es:[di].$P_PARMSX_Address ;AN000; Get the PARMSX address to
338 cmp cl,es:[bx].$P_MinP ;AN000; check ORDINAL to see if the minimum
339 jae $P_Fin ;AN000; positional found.
340
341 mov ax,$P_Op_Missing ;AN000; If no, set exit code to missing operand
342$P_Fin: ;AN000;
343 pop bx ;AN000;
344 jmp $P_Single_Exit ;AN000; return to the caller
345
346;---------------------------
347$P_Start: ;AN000;
348 mov psdata_seg:$P_SaveSI_Cmpx,si ;AN000;AC034; save ptr to command line for later use by complex,
349 push bx ;AN000; quoted string or file spec.
350 push di ;AN000;
351 push bp ;AN000;
352 lea bx,psdata_seg:$P_STRING_BUF ;AC034; set buffer to copy from command string
353 test psdata_seg:$P_Flags2,$P_Extra ;AC034; 3/9 extra delimiter encountered ?
354 jne $P_Pack_End ;AN000; 3/9 if yes, no need to copy
355
356$P_Pack_Loop: ;AN000;
357 lodsb ;AN000; Pick a operand from buffer
358 call $P_Chk_Switch ;AN000; Check switch character
359 jc $P_Pack_End_BY_EOL ;AN020; if carry set found delimiter type slash, need backup si, else continue
360
361 call $P_Chk_EOL ;AN000; Check EOL character
362 je $P_Pack_End_BY_EOL ;AN000; need backup si
363
364 call $P_Chk_Delim ;AN000; Check delimiter
365 jne $P_PL01 ;AN000; If no, process next byte
366
367 test psdata_seg:$P_Flags2,$P_Extra ;AC034; 3/9 If yes and white spec,
368; (tm08)jne $P_Pack_End ;AN000; 3/9 then
369 jne $P_Pack_End_backup_si ;AN000; (tm08)
370
371 call $P_Skip_Delim ;AN000; skip subsequent white space,too
372 jmp short $P_Pack_End ;AN000; finish copy by placing NUL at end
373
374$P_PAck_End_backup_si: ;AN000; (tm08)
375 test psdata_seg:$P_Flags2,$P_SW+$P_equ ;AN000;AC034; (tm08)
376 je $P_Pack_End ;AN000; (tm08)
377
378 dec si ;AN000; (tm08)
379 jmp short $P_Pack_End ;AN025; (tm08)
380
381$P_PL01: ;AN000;
382 mov psdata_seg:[bx],al ;AN000; move byte to STRING_BUF
383 cmp al,$P_Keyword ;AN000; if it is equal character,
384 jne $P_PL00 ;AN000; then
385
386 or psdata_seg:$P_Flags2,$P_equ ;AC034; remember it in flag
387$P_PL00: ;AN000;
388 inc bx ;AN000; ready to see next byte
389 call $P_Chk_DBCS ;AN000; was it 1st byte of DBCS ?
390 jnc $P_Pack_Loop ;AN000; if no, process to next byte
391
392 lodsb ;AN000; if yes, store
393 mov psdata_seg:[bx],al ;AN000; 2nd byte of DBCS
394 inc bx ;AN000; update pointer
395 jmp short $P_Pack_Loop ;AN000; process to next byte
396
397$P_Pack_End_BY_EOL: ;AN000;
398 dec si ;AN000; backup si pointer
399$P_Pack_End: ;AN000;
400 mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI
401 mov byte ptr psdata_seg:[bx],$P_NULL ;AN000; put NULL at the end
402 mov psdata_seg:$P_Save_EOB,bx ;AC034; 3/17/87 keep the address for later use of complex
403 mov bx,es:[di].$P_PARMSX_Address ;AN000; get PARMSX address
404 lea si,psdata_seg:$P_STRING_BUF ;AC034;
405 cmp byte ptr psdata_seg:[si],$P_Switch ;AN000; the operand begins w/ switch char ?
406 je $P_SW_Manager ;AN000; if yes, process as switch
407
408 test psdata_seg:$P_Flags2,$P_equ ;AC034; the operand includes equal char ?
409 jne $P_Key_manager ;AN000; if yes, process as keyword
410
411$P_Positional_Manager: ;AN000; else process as positional
412 mov al,es:[bx].$P_MaxP ;AN000; get maxp
413 xor ah,ah ;AN000; ax = maxp
414 cmp psdata_seg:$P_ORDINAL,ax ;AC034; too many positional ?
415 jae $P_Too_Many_Error ;AN000; if yes, set exit code to too many
416
417 mov ax,psdata_seg:$P_ORDINAL ;AC034; see what the current ordinal
418 shl ax,1 ;AN000; ax = ax*2
419 inc bx ;AC035; add '2' to
420 inc bx ;AC035; BX reg
421 ;AN000; now bx points to 1st CONTROL
422;(changed ;AC035;) add bx,2 ;AN000; now bx points to 1st CONTROL
423 add bx,ax ;AN000; now bx points to specified CONTROL address
424 mov bx,es:[bx] ;AN000; now bx points to specified CONTROL itself
425 call $P_Chk_Pos_Control ;AN000; Do process for positional
426 jmp short $P_Return_to_Caller ;AN000; and return to the caller
427
428$P_Too_Many_Error: ;AN000;
429 mov psdata_seg:$P_RC,$P_Too_Many ;AC034; set exit code
430 jmp short $P_Return_to_Caller ;AN000; and return to the caller
431;
432$P_SW_Manager: ;AN000;
433 mov al,es:[bx].$P_MaxP ;AN000; get maxp
434 xor ah,ah ;AN000; ax = maxp
435 inc ax ;AN000;
436 shl ax,1 ;AN000; ax = (ax+1)*2
437 add bx,ax ;AN000; now bx points to maxs
438 mov cl,es:[bx] ;AN000;
439 xor ch,ch ;AN000; cx = maxs
440 or cx,cx ;AN000; at least one switch ?
441 je $P_SW_Not_Found ;AN000;
442
443 inc bx ;AN000; now bx points to 1st CONTROL address
444
445$P_SW_Mgr_Loop: ;AN000;
446 push bx ;AN000;
447 mov bx,es:[bx] ;AN000; bx points to Switch CONTROL itself
448 call $P_Chk_SW_Control ;AN000; do process for switch
449 pop bx ;AN000;
450 jnc $P_Return_to_Caller ;AN000; if the CONTROL is for the switch, exit
451
452 inc bx ;AC035; add '2' to
453 inc bx ;AC035; BX reg
454 ;AN000; else bx points to the next CONTROL
455;(changed ;AC035;) add bx,2 ;AN000; else bx points to the next CONTROL
456 loop $P_SW_Mgr_Loop ;AN000; and loop
457
458$P_SW_Not_Found: ;AN000;
459 mov psdata_seg:$P_RC,$P_Not_In_SW ;AC034; here no CONTROL for the switch has
460 jmp short $P_Return_to_Caller0 ;AN000; not been found, means error.
461;
462$P_Key_Manager: ;AN000;
463 mov al,es:[bx].$P_MaxP ;AN000; get maxp
464 xor ah,ah ;AN000; ax = maxp
465 inc ax ;AN000;
466 shl ax,1 ;AN000; ax = (ax+1)*2
467 add bx,ax ;AN000; now bx points to maxs
468 mov al,es:[bx] ;AN000;
469 xor ah,ah ;AN000; ax = maxs
470 shl ax,1 ;AN000;
471 inc ax ;AN000; ax = ax*2+1
472 add bx,ax ;AN000; now bx points to maxk
473 mov cl,es:[bx] ;AN000;
474 xor ch,ch ;AN000; cx = maxk
475 or cx,cx ;AN000; at least one keyword ?
476 je $P_Key_Not_Found ;AN000;
477
478 inc bx ;AN000; now bx points to 1st CONTROL
479
480$P_Key_Mgr_Loop: ;AN000;
481 push bx ;AN000;
482 mov bx,es:[bx] ;AN000; bx points to keyword CONTROL itself
483 call $P_Chk_Key_Control ;AN000; do process for keyword
484 pop bx ;AN000;
485 jnc $P_Return_to_Caller ;AN000; if the CONTROL is for the keyword, exit
486
487 inc bx ;AC035; add '2' to
488 inc bx ;AC035; BX reg
489 ;AN000; else bx points to the next CONTROL
490;(changed ;AC035;) add bx,2 ;AN000; else bx points to the next CONTROL
491 loop $P_Key_Mgr_Loop ;AN000; and loop
492
493$P_Key_Not_Found: ;AN000;
494 mov psdata_seg:$P_RC,$P_Not_In_Key ;AC034; here no CONTROL for the keyword has
495$P_Return_to_Caller0: ;AN000; not been found, means error.
496
497;(deleted ;AN024;) mov bx,es:[bx-2] ;AN000; (tm13) backup bx
498
499;(deleted ;AN024;) mov al,$P_String ;AN000; Set
500;(deleted ;AN024;) mov ah,$P_No_Tag ;AN000; result
501;(deleted ;AN024;) call $P_Fill_Result ;AN000; buffer
502
503$P_Return_to_Caller: ;AN000;
504 pop bp ;AN000;
505 pop di ;AN000;
506 pop bx ;AN000;
507 mov cx,psdata_seg:$P_Ordinal ;AC034; return next ordinal
508 mov ax,psdata_seg:$P_RC ;AC034; return exit code
509 mov si,psdata_seg:$P_SI_Save ;AC034; return next operand pointer
510 mov dx,psdata_seg:$P_DX ;AC034; return result buffer address
511 mov bl,psdata_seg:$P_Terminator ;AC034; return delimiter code found
512$P_Single_Exit: ;AN000;
513 clc ;AN000;
514 ret ;AN000;
515SysParse endp ;AN000;
516PAGE ;AN000;
517;***********************************************************************
518; $P_Chk_Pos_Control
519;
520; Function: Parse CONTROL block for a positional
521;
522; Input: ES:BX -> CONTROL block
523; psdata_seg:SI -> $P_STRING_BUF
524;
525; Output: None
526;
527; Use: $P_Fill_Result, $P_Check_Match_Flags
528;
529; Vars: $P_Ordinal(W), $P_RC(W)
530;***********************************************************************
531$P_Chk_Pos_Control proc ;AN000;
532 push ax ;AN000;
533 mov ax,es:[bx].$P_Match_Flag ;AN000;
534 test ax,$P_Repeat ;AN000; repeat allowed ?
535 jne $P_CPC00 ;AN000; then do not increment ORDINAL
536
537 inc psdata_seg:$P_ORDINAL ;AC034; update the ordinal
538$P_CPC00: ;AN000;
539 cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; no data ?
540 jne $P_CPC01 ;AN000;
541
542 test ax,$P_Optional ;AN000; yes, then is it optional ?
543 jne $P_CPC02 ;AN000;
544
545 mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; no, then error 3/17/87
546 jmp short $P_CPC_Exit ;AN000;
547
548$P_CPC02: ;AN000;
549 push ax ;AN000;
550 mov al,$P_String ;AN000; if it is optional return NULL
551 mov ah,$P_No_Tag ;AN000; no item tag indication
552 call $P_Fill_Result ;AN000;
553 pop ax ;AN000;
554 jmp short $P_CPC_Exit ;AN000;
555
556$P_CPC01: ;AN000;
557 call $P_Check_Match_Flags ;AN000;
558$P_CPC_Exit: ;AN000;
559 pop ax ;AN000;
560 ret ;AN000;
561$P_Chk_Pos_Control endp ;AN000;
562PAGE ;AN000;
563;***********************************************************************
564; $P_Chk_Key_Control
565;
566; Function: Parse CONTROL block for a keyword
567;
568; Input: ES:BX -> CONTROL block
569; psdata_seg:SI -> $P_STRING_BUF
570;
571; Output: CY = 1 : not match
572;
573; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags
574;
575; Vars: $P_RC(W), $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W)
576;***********************************************************************
577$P_Chk_Key_Control proc ;AN000;
578IF KeySW ;AN000;(Check if keyword is supported)
579 or psdata_seg:$P_Flags2,$P_Key_Cmp ;AC034; Indicate keyword for later string comparison
580 call $P_Search_KEYorSW ;AN000; Search the keyword in the CONTROL block
581 jc $P_Chk_Key_Err0 ;AN000; not found, then try next CONTROL
582
583 and psdata_seg:$P_Flags2,0ffh-$P_Key_Cmp ;AC034; reset the indicator previously set
584;
585 push ax ;AN000; keyword=
586 mov ax,psdata_seg:$P_KEYorSW_Ptr ;AC034; ^ ^
587 sub ax,si ;AN000; SI KEYorSW
588 add psdata_seg:$P_SaveSI_Cmpx,ax ;AC034; update for complex, quoted or file spec.
589 pop ax ;AN000;
590;
591 mov si,psdata_seg:$P_KEYorSW_Ptr ;AC034; set si just after equal char
592 cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; any data after equal ?
593 je $P_Chk_Key_Err1 ;AN000; if no, syntax error
594
595 call $P_Check_Match_Flags ;AN000; else, process match flags
596 clc ;AN000;
597 jmp short $P_Chk_Key_Exit ;AN000;
598
599$P_Chk_Key_Err0: ;AN000;
600 stc ;AN000; not found in keyword synonym list
601 jmp short $P_Chk_Key_Exit ;AN000;
602
603$P_Chk_Key_Err1: ;AN000;
604 mov psdata_seg:$P_RC,$P_Syntax ;AC034; no parameter is not specified after "="
605$P_Chk_Key_ErrExit: ;AN000;
606 push ax ;AN000;
607 mov al,$P_String ;AN000; set
608 mov ah,$P_No_Tag ;AN000; result
609 call $P_Fill_Result ;AN000; buffer
610 pop ax ;AN000;
611 clc ;AN000;
612$P_Chk_Key_Exit: ;AN000;
613 ret ;AN000;
614ELSE ;AN000;(of IF KeySW)
615 stc ;AN000;this logic works when the KeySW
616 ret ;AN000;is reset.
617ENDIF ;AN000;(of KeySW)
618$P_Chk_Key_Control endp ;AN000;
619PAGE ;AN000;
620;***********************************************************************
621IF KeySW+SwSW ;AN000;(Check if keyword or switch is supported)
622; $P_Search_KEYorSW:
623;
624; Function: Seach specified keyword or switch from CONTROL
625;
626; Input: ES:BX -> CONTROL block
627; psdata_seg:SI -> $P_STRING_BUF
628;
629; Output: CY = 1 : not match
630;
631; Use: $P_String_Comp, $P_MoveBP_NUL, $P_Found_SYNONYM
632;***********************************************************************
633$P_Search_KEYorSW proc ;AN000;
634 push bp ;AN000;
635 push cx ;AN000;
636 mov cl,es:[bx].$P_nid ;AN000; Get synonym count
637 xor ch,ch ;AN000; and set it to cx
638 or cx,cx ;AN000; No synonyms specified ?
639 je $P_KEYorSW_Not_Found ;AN000; then indicate not found by CY
640
641 lea bp,es:[bx].$P_KEYorSW ;AN000; BP points to the 1st synonym
642$P_KEYorSW_Loop: ;AN000;
643 call $P_String_Comp ;AN000; compare string in buffer w/ the synonym
644 jnc $P_KEYorSW_Found ;AN000; If match, set it to synonym pointer
645
646 call $P_MoveBP_NUL ;AN000; else, bp points to the next string
647 loop $P_KEYorSW_Loop ;AN000; loop nid times
648$P_KEYorSW_Not_Found: ;AN000;
649 stc ;AN000; indicate not found in synonym list
650 jmp short $P_KEYorSW_Exit ;AN000; and exit
651
652$P_KEYorSW_Found: ;AN000;
653 mov psdata_seg:$P_Found_SYNONYM,bp ;AC034; set synonym pointer
654 clc ;AN000; indicate found
655$P_KEYorSW_Exit: ;AN000;
656 pop cx ;AN000;
657 pop bp ;AN000;
658 ret ;AN000;
659$P_Search_KEYorSW endp ;AN000;
660;***********************************************************************
661; $P_MoveBP_NUL
662;***********************************************************************
663$P_MoveBP_NUL proc ;AN000;
664$P_MBP_Loop: ;AN000;
665 cmp byte ptr es:[bp],$P_NULL ;AN000; Increment BP that points
666 je $P_MBP_Exit ;AN000; to the synomym list
667
668 inc bp ;AN000; until
669 jmp short $P_MBP_Loop ;AN000; NULL encountered.
670
671$P_MBP_Exit: ;AN000;
672 inc bp ;AN000; bp points to next to NULL
673 ret ;AN000;
674$P_MoveBP_NUL endp ;AN000;
675ENDIF ;AN000;(of KeySW+SwSW)
676PAGE ;AN000;
677;***********************************************************************
678; $P_Chk_SW_Control
679;
680; Function: Parse CONTROL block for a switch
681;
682; Input: ES:BX -> CONTROL block
683; psdata_seg:SI -> $P_STRING_BUF
684;
685; Output: CY = 1 : not match
686;
687; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags
688;
689; Vars: $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W)
690;***********************************************************************
691$P_Chk_SW_Control proc ;AN000;
692
693
694IF SwSW ;AN000;(Check if switch is supported)
695 or psdata_seg:$P_Flags2,$P_Sw_Cmp ;AC034; Indicate switch for later string comparison
696 call $P_Search_KEYorSW ;AN000; Search the switch in the CONTROL block
697 jc $P_Chk_SW_Err0 ;AN000; not found, then try next CONTROL
698
699 and psdata_seg:$P_Flags2,0ffh-$P_Sw_Cmp ;AC034; reset the indicator previously set
700;
701 push ax ;AN000; /switch:
702 mov ax,psdata_seg:$P_KEYorSW_Ptr ;AC034; ^ ^
703 sub ax,si ;AN000; SI KEYorSW
704 add psdata_seg:$P_SaveSI_Cmpx,ax ;AC034; update for complex list
705 pop ax ;AN000;
706;
707 mov si,psdata_seg:$P_KEYorSW_Ptr ;AC034; set si at the end or colon
708 cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; any data after colon
709 jne $P_CSW00 ;AN000; if yes, process match flags
710
711 cmp byte ptr psdata_seg:[si-1],$P_Colon ;AN000; if no, the switch terminated by colon ?
712 jne $P_Chk_if_data_required ;AN000; if yes,
713
714 mov psdata_seg:$P_RC,$P_Syntax ;AC034; return syntax error
715 jmp short $P_Chk_SW_Exit ;AN000;
716
717$P_Chk_if_data_required: ;AN018; no data, no colon
718 cmp es:[bx].$P_Match_Flag,0 ;AN018; should have data? zero match flag means switch followed by nothing is OK
719 je $P_Chk_SW_Exit ;AN018; match flags not zero so should have something if optional bit is not on
720
721 test es:[bx].$P_Match_Flag,$P_Optional ;AN019; see if no value is valid
722 jnz $P_Chk_SW_Exit ;AN019; if so, then leave, else yell
723
724 mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; return required operand missing
725 jmp short $P_Chk_SW_Exit ;AN018;
726
727$P_CSW00: ;AN000;
728 call $P_Check_Match_Flags ;AN000; process match flag
729 clc ;AN000; indicate match
730 jmp short $P_Chk_SW_Single_Exit ;AN000;
731
732$P_Chk_SW_Err0: ;AN000;
733 stc ;AN000; not found in switch synonym list
734 jmp short $P_Chk_SW_Single_Exit ;AN000;
735
736$P_Chk_SW_Exit: ;AN000;
737 push ax ;AN000;
738 mov al,$P_String ;AN000; set
739 mov ah,$P_No_Tag ;AN000; result
740 call $P_Fill_Result ;AN000; buffer
741 pop ax ;AN000;
742 clc ;AN000;
743$P_Chk_SW_Single_Exit: ;AN000;
744 ret ;AN000;
745ELSE ;AN000;(of IF SwSW)
746 stc ;AN000; this logic works when the SwSW
747 ret ;AN000; is reset.
748ENDIF ;AN000;(of SwSW)
749$P_Chk_SW_Control endp ;AN000;
750PAGE ;AN000;
751;***********************************************************************
752; $P_Fill_Result
753;
754; Function: Fill the result buffer
755;
756; Input: AH = Item tag
757; AL = type
758; AL = 1: CX,DX has 32bit number (CX = high)
759; AL = 2: DX has index(offset) into value list
760; AL = 6: DL has driver # (1-A, 2-B, ... , 26 - Z)
761; AL = 7: DX has year, CL has month and CH has date
762; AL = 8: DL has hours, DH has minutes, CL has secondsn,
763; amd CH has hundredths
764; AL = else: psdata_seg:SI points to returned string buffer
765; ES:BX -> CONTROL block
766;
767; Output: None
768;
769; Use: $P_Do_CAPS_String, $P_Remove_Colon, $P_Found_SYNONYM
770;
771; Vars: $P_DX(W)
772;***********************************************************************
773$P_Fill_Result proc ;AN000;
774 push di ;AN000;
775 mov di,es:[bx].$P_Result_Buf ;AN000; di points to result buffer
776 mov psdata_seg:$P_DX,di ;AC034; set returned result address
777 mov es:[di].$P_Type,al ;AN000; store type
778 mov es:[di].$P_Item_Tag,ah ;AN000; store item tag
779 push ax ;AN000;
780 mov ax,psdata_seg:$P_Found_SYNONYM ;AC034; if yes,
781 mov es:[di].$P_SYNONYM_Ptr,ax ;AN000; then set it to the result
782 pop ax ;AN000;
783$P_RLT04: ;AN000;
784 cmp al,$P_Number ;AN000; if number
785 jne $P_RLT00 ;AN000;
786
787$P_RLT02: ;AN000;
788 mov word ptr es:[di].$P_Picked_Val,dx ;AN000; then store 32bit
789 mov word ptr es:[di+2].$P_Picked_Val,cx ;AN000; number
790 jmp short $P_RLT_Exit ;AN000;
791
792$P_RLT00: ;AN000;
793 cmp al,$P_List_Idx ;AN000; if list index
794 jne $P_RLT01 ;AN000;
795
796 mov word ptr es:[di].$P_Picked_Val,dx ;AN000; then store list index
797 jmp short $P_RLT_Exit ;AN000;
798
799$P_RLT01: ;AN000;
800 cmp al,$P_Date_F ;AN000; Date format ?
801 je $P_RLT02 ;AN000;
802
803 cmp al,$P_Time_F ;AN000; Time format ?
804 je $P_RLT02 ;AN000;
805;
806 cmp al,$P_Drive ;AN000; drive format ?
807 jne $P_RLT03 ;AN000;
808
809 mov byte ptr es:[di].$P_Picked_Val,dl ;AN000; store drive number
810 jmp short $P_RLT_Exit ;AN000;
811
812$P_RLT03: ;AN000;
813 cmp al,$P_Complex ;AN000; complex format ?
814 jne $P_RLT05 ;AN000;
815
816 mov ax,psdata_seg:$P_SaveSI_Cmpx ;AC034; then get pointer in command buffer
817 inc ax ;AN000; skip left Parentheses
818 mov word ptr es:[di].$P_Picked_Val,ax ;AN000; store offset
819 mov word ptr es:[di+2].$P_Picked_Val,ds ;AN000; store segment
820 jmp short $P_RLT_Exit ;AN000;
821
822$P_RLT05: ;AN000;
823;------------------------ AL = 3, 5, or 9
824 mov word ptr es:[di].$P_Picked_Val,si ;AN000; store offset of STRING_BUF
825;(replaced ;AN031;) mov word ptr es:[di+word].$P_Picked_Val,cs ;AN000; store segment of STRING_BUF
826 mov word ptr es:[di+2].$P_Picked_Val,Psdata_Seg ;AN031; store segment of STRING_BUF
827;
828 push ax ;AN000;
829 test byte ptr es:[bx].$P_Function_Flag,$P_CAP_File ;AN000; need CAPS by file table?
830 je $P_RLT_CAP00 ;AN000;
831
832 mov al,$P_DOSTBL_File ;AN000; use file upper case table
833 jmp short $P_RLT_CAP02 ;AN000;
834
835$P_RLT_CAP00: ;AN000;
836 test byte ptr es:[bx].$P_Function_Flag,$P_CAP_Char ;AN000; need CAPS by char table ?
837 je $P_RLT_CAP01 ;AN000;
838
839 mov al,$P_DOSTBL_Char ;AN000; use character upper case table
840$P_RLT_CAP02: ;AN000;
841 call $P_Do_CAPS_String ;AN000; process CAPS along the table
842$P_RLT_CAP01: ;AN000;
843 pop ax ;AN000;
844 test byte ptr es:[bx].$P_Function_Flag,$P_Rm_Colon ;AN000; removing colon at end ?
845 je $P_RLT_Exit ;AN000;
846
847 call $P_Remove_Colon ;AN000; then process it.
848$P_RLT_Exit: ;AN000;
849 pop di ;AN000;
850 ret ;AN000;
851$P_Fill_Result endp ;AN000;
852PAGE ;AN000;
853;***********************************************************************
854; $P_Check_Match_Flags
855;
856; Function: Check the mutch_flags and make the exit code and set the
857; result buffer
858;
859; Check for types in this order:
860; Complex
861; Date
862; Time
863; Drive
864; Filespec
865; Quoted String
866; Simple String
867;
868; Input: psdata_seg:SI -> $P_STRING_BUF
869; ES:BX -> CONTROL block
870;
871; Output: None
872;
873; Use: $P_Value, P$_SValue, $P_Simple_String, $P_Date_Format
874; $P_Time_Format, $P_Complex_Format, $P_File_Foemat
875; $P_Drive_Format
876;***********************************************************************
877$P_Check_Match_Flags proc ;AN000;
878 mov psdata_seg:$P_err_flag,$P_NULL ;AN033;AC034;; clear filespec error flag.
879 push ax ;AN000;
880 mov ax,es:[bx].$P_Match_Flag ;AN000; load match flag(16bit) to ax
881
882 or ax,ax ;AC035; test ax for zero
883;(changed ;AC035;) cmp ax,0 ;AN000; (tm12)
884 jne $P_Mat ;AN000; (tm12)
885
886 push ax ;AN000; (tm12)
887 push bx ;AN000; (tm12)
888 push dx ;AN000; (tm12)
889 push di ;AN000; (tm12)
890 mov psdata_seg:$P_RC,$P_Syntax ;AC034; (tm12)
891 mov ah,$P_No_Tag ;AN000; (tm12)
892 mov al,$P_String ;AN000; (tm12)
893 call $P_Fill_Result ;AN000; (tm12)
894 pop di ;AN000; (tm12)
895 pop dx ;AN000; (tm12)
896 pop bx ;AN000; (tm12)
897 pop ax ;AN000; (tm12)
898 jmp short $P_Bridge ;AC035; (tm12)
899
900$P_Mat: ;AN000; (tm12)
901
902IF CmpxSW ;AN000;(Check if complex item is supported)
903 test ax,$P_Cmpx_S ;AN000; Complex string
904 je $P_Match01 ;AN000;
905
906 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
907 call $P_Complex_Format ;AN000; do process
908 cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
909 jne $P_Bridge ;AN000;
910
911$P_Match01: ;AN000;
912ENDIF ;AN000;(of CmpxSW)
913IF DateSW ;AN000;(Check if date format is supported)
914 test ax,$P_Date_S ;AN000; Date string
915 je $P_Match02 ;AN000;
916
917 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
918 call $P_Date_Format ;AN000; do process
919 cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
920 jne $P_Bridge ;AN000;
921
922$P_Match02: ;AN000;
923ENDIF ;AN000;(of DateSW)
924IF TimeSW ;AN000;(Check if time format is supported)
925 test ax,$P_Time_S ;AN000; Time string
926 je $P_Match03 ;AN000;
927
928 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
929 call $P_Time_Format ;AN000; do process
930 cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
931; je $P_Match03 ;AN000:
932
933 jne $P_Bridge ;AN000; (tm09)
934
935ENDIF ;AN000;(of TimeSW) (tm04)
936 jmp short $P_Match03 ;AN025; (tm09)
937
938$P_Bridge: ;AN000;
939; jmp short $P_Match_Exit (tm02)
940
941 jmp $P_Match_Exit ;AN000; (tm02)
942
943$P_Match03: ;AN000;
944; ENDIF ;AN000;(of TimeSW) (tm04)
945IF NumSW ;AN000;(Check if numeric value is supported)
946 test ax,$P_Num_Val ;AN000; Numeric value
947 je $P_Match04 ;AN000;
948
949 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
950 call $P_Value ;AN000; do process
951 cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
952 jne $P_Match_Exit ;AN000;
953
954$P_Match04: ;AN000;
955 test ax,$P_SNUM_Val ;AN000; Signed numeric value
956 je $P_Match05 ;AN000;
957
958 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
959 call $P_SValue ;AN000; do process
960 cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
961 jne $P_Match_Exit ;AN000;
962
963$P_Match05: ;AN000;
964ENDIF ;AN000;(of NumSW)
965IF DrvSW ;AN000;(Check if drive only is supported)
966 test ax,$P_Drv_Only ;AN000; Drive only
967 je $P_Match06 ;AN000;
968
969 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
970 call $P_File_Format ;AN000; 1st, call file format
971 call $P_Drive_Format ;AN000; check drive format, next
972 cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examinee the next type
973 jne $P_Match_Exit ;AN000;
974
975$P_Match06: ;AN000;
976ENDIF ;AN000;(of DrvSW)
977IF FileSW ;AN000;(Check if file spec is supported)
978 test ax,$P_File_Spc ;AN000; File spec
979 je $P_Match07 ;AN000;
980
981 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
982 call $P_File_Format ;AN000; do process
983 cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
984 jne $P_Match_Exit ;AN000;
985
986$P_Match07: ;AN000;
987ENDIF ;AN000;(of FileSW)
988IF QusSW ;AN000;(Check if quoted string is supported)
989 test ax,$P_Qu_String ;AN000; Quoted string
990 je $P_Match08 ;AN000;
991
992 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
993 call $P_Quoted_Format ;AN000; do process
994 cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
995 jne $P_Match_Exit ;AN000;
996
997$P_Match08: ;AN000;
998ENDIF ;AN000;(of QusSW)
999 test ax,$P_Simple_S ;AN000; Simple string
1000 je $P_Match09 ;AN000;
1001
1002 mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
1003 call $P_Simple_String ;AN000; do process
1004;;;; cmp psdata_seg:$P_RC,$P_Syntax ;AC034; These two lines will be alive
1005;;;; jne $P_Match_Exit ;when extending the match_flags.
1006$P_Match09: ;AN000;
1007$P_Match_Exit: ;AN000;
1008 cmp psdata_seg:$P_err_flag,$P_error_filespec ;AC034; bad filespec ?
1009 jne $P_Match2_Exit ;AN033; no, continue
1010 cmp psdata_seg:$P_RC,$P_No_Error ;AN033;AC034;; check for other errors ?
1011 jne $P_Match2_Exit ;AN033; no, continue
1012 mov psdata_seg:$P_RC,$P_Syntax ;AN033;AC034;; set error flag
1013$P_Match2_Exit: ;AN033;
1014 pop ax ;AN000;
1015 ret ;AN000;
1016$P_Check_Match_Flags endp ;AN000;
1017PAGE ;AN000;
1018;***********************************************************************
1019; $P_Remove_Colon;
1020;
1021; Function: Remove colon at end
1022;
1023; Input: psdata_seg:SI points to string buffer to be examineed
1024;
1025; Output: None
1026;
1027; Use: $P_Chk_DBCS
1028;***********************************************************************
1029$P_Remove_Colon proc ;AN000;
1030 push ax ;AN000;
1031 push si ;AN000;
1032$P_RCOL_Loop: ;AN000;
1033 mov al,psdata_seg:[si] ;AN000; get character
1034 or al,al ;AN000; end of string ?
1035 je $P_RCOL_Exit ;AN000; if yes, just exit
1036
1037 cmp al,$P_Colon ;AN000; is it colon ?
1038 jne $P_RCOL00 ;AN000;
1039
1040 cmp byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; if so, next is NULL ?
1041 jne $P_RCOL00 ;AN000; no, then next char
1042
1043 mov byte ptr psdata_seg:[si],$P_NULL ;AN000; yes, remove colon
1044 jmp short $P_RCOL_Exit ;AN000; and exit.
1045
1046$P_RCOL00: ;AN000;
1047 call $P_Chk_DBCS ;AN000; if not colon, then check if
1048 jnc $P_RCOL01 ;AN000; DBCS leading byte.
1049
1050 inc si ;AN000; if yes, skip trailing byte
1051$P_RCOL01: ;AN000;
1052 inc si ;AN000; si points to next byte
1053 jmp short $P_RCOL_Loop ;AN000; loop until NULL encountered
1054
1055$P_RCOL_Exit: ;AN000;
1056 pop si ;AN000;
1057 pop ax ;AN000;
1058 ret ;AN000;
1059$P_Remove_Colon endp ;AN000;
1060PAGE ;AN000;
1061;***********************************************************************
1062; $P_Do_CAPS_String;
1063;
1064; Function: Perform capitalization along with the file case map table
1065; or character case map table.
1066;
1067; Input: AL = 2 : Use character table
1068; AL = 4 : Use file table
1069; psdata_seg:SI points to string buffer to be capitalized
1070;
1071; Output: None
1072;
1073; Use: $P_Do_CAPS_Char, $P_Chk_DBCS
1074;***********************************************************************
1075$P_Do_CAPS_String proc ;AN000;
1076 push si ;AN000;
1077 push dx ;AN000;
1078 mov dl,al ;AN000; save info id
1079
1080$P_DCS_Loop: ;AN000;
1081 mov al,psdata_seg:[si] ;AN000; load charater and
1082 call $P_Chk_DBCS ;AN000; check if DBCS leading byte
1083 jc $P_DCS00 ;AN000; if yes, do not need CAPS
1084
1085 or al,al ;AN000; end of string ?
1086 je $P_DCS_Exit ;AN000; then exit.
1087
1088 call $P_Do_CAPS_Char ;AN000; Here a SBCS char need to be CAPS
1089 mov psdata_seg:[si],al ;AN000; stored upper case char to buffer
1090 jmp short $P_DCS01 ;AN000; process nexit
1091$P_DCS00: ;AN000;
1092 inc si ;AN000; skip DBCS leading and trailing byte
1093$P_DCS01: ;AN000;
1094 inc si ;AN000; si point to next byte
1095 jmp short $P_DCS_Loop ;AN000; loop until NULL encountered
1096$P_DCS_Exit: ;AN000;
1097 pop dx ;AN000;
1098 pop si ;AN000;
1099 ret ;AN000;
1100$P_Do_CAPS_String endp ;AN000;
1101PAGE ;AN000;
1102;***********************************************************************
1103; $P_Do_CAPS_Char;
1104;
1105; Function: Perform capitalization along with the file case map table
1106; or character case map table.
1107;
1108; Input: DL = 2 : Use character table
1109; DL = 4 : Use file table
1110; AL = character to be capitalized
1111;
1112; Output: None
1113;
1114; Use: INT 21h /w AH=65h
1115;***********************************************************************
1116$P_Do_CAPS_Char proc ;AN000;
1117 cmp al,$P_ASCII80 ;AN000; need upper case table ?
1118 jae $P_DCC_Go ;AN000;
1119
1120 cmp al,"a" ;AN000; if no,
1121 jb $P_CAPS_Ret ;AN000; check if "a" <= AL <= "z"
1122
1123 cmp al,"z" ;AN000;
1124 ja $P_CAPS_Ret ;AN000; if yes, make CAPS
1125
1126 and al,$P_Make_Upper ;AN000; else do nothing.
1127 jmp short $P_CAPS_Ret ;AN000;
1128
1129$P_DCC_Go: ;AN000;
1130 push bx ;AN000;
1131 push es ;AN000;
1132 push di ;AN000;
1133IF CAPSW ;AN000;(Check if uppercase conversion is supported)
1134 lea di,psdata_seg:$P_File_CAP_Ptr ;AC034;
1135 cmp dl,$P_DOSTBL_File ;AN000; Use file CAPS table ?
1136 je $P_DCC00 ;AN000;
1137
1138ENDIF ;AN000;(of CAPSW)
1139 lea di,psdata_seg:$P_Char_CAP_Ptr ;AC034; or use char CAPS table ?
1140$P_DCC00: ;AN000;
1141 cmp psdata_seg:[di],dl ;AN000; already got table address ?
1142 je $P_DCC01 ;AN000; if no,
1143
1144;In this next section, ES will be used to pass a 5 byte workarea to INT 21h,
1145; the GET COUNTYRY INFO call. This usage of ES is required by the function
1146; call, regardless of what base register is currently be defined as PSDATA_SEG.
1147;BASESW EQU 0 means that ES is the psdata_seg reg.
1148
1149IFDEF BASESW ;AN037; If BASESW has been defined, and
1150 IFE BASESW ;AN037; If ES is psdata base
1151 push PSDATA_SEG ;AN037; save current base reg
1152 ENDIF ;AN037;
1153ENDIF ;AN037;
1154
1155 push ax ;AN000; get CAPS table thru DOS call
1156 push cx ;AN000;
1157 push dx ;AN000;
1158
1159
1160 push PSDATA_SEG ;AC036; pass current base seg into
1161 ;(Note: this used to push CS. BUG...
1162 pop es ;AN000; ES reg, required for
1163 ;get extended country information
1164 mov ah,$P_DOS_Get_TBL ;AN000; get extended CDI
1165 mov al,dl ;AN000; upper case table
1166 mov bx,$P_DOSTBL_Def ;AN000; get active CON
1167 mov cx,$P_DOSTBL_BL ;AN000; buffer length
1168 mov dx,$P_DOSTBL_Def ;AN000; get for default code page
1169 ;DI already set to point to buffer
1170 int 21h ;AN000; es:di point to buffer that
1171 ;now has been filled in with info
1172 pop dx ;AN000;
1173 pop cx ;AN000;
1174 pop ax ;AN000;
1175IFDEF BASESW ;AN037; If BASESW has been defined, and
1176 IFE BASESW ;AN037; If ES is psdata base
1177 pop PSDATA_SEG ;AN037; restore current base reg
1178 ENDIF ;AN037;
1179ENDIF ;AN037;
1180$P_DCC01: ;AN000;
1181
1182;In this next section, ES will be used as the base of the XLAT table, provided
1183; by the previous GET COUNTRY INFO DOS call. This usage of ES is made
1184; regardless of which base reg is currently the PSDATA_SEG reg.
1185
1186IFDEF BASESW ;AN037; If BASESW has been defined, and
1187 IFE BASESW ;AN037; If ES is psdata base
1188 push PSDATA_SEG ;AN037; save current base reg
1189 ENDIF ;AN037;
1190ENDIF ;AN037;
1191 mov bx,psdata_seg:[di+$P_DOS_TBL_Off] ;AN000; get offset of table
1192 mov es,psdata_seg:[di+$P_DOS_TBL_Seg] ;AN000; get segment of table
1193 inc bx ;AC035; add '2' to
1194 inc bx ;AC035; BX reg
1195 ;AN000; skip length field
1196;(changed ;AN035;) add bx,word ;AN000; skip length field
1197 sub al,$P_ASCII80 ;AN000; make char to index
1198 xlat es:[bx] ;AN000; perform case map
1199
1200IFDEF BASESW ;AN037; If BASESW has been defined, and
1201 IFE BASESW ;AN037; If ES is psdata base
1202 pop PSDATA_SEG ;AN037; restore current base reg
1203 ENDIF ;AN037;
1204ENDIF ;AN037;
1205 pop di ;AN000;
1206 pop es ;AN000;
1207 pop bx ;AN000;
1208$P_CAPS_Ret: ;AN000;
1209 ret ;AN000;
1210$P_Do_CAPS_Char endp ;AN000;
1211PAGE ;AN000;
1212;***********************************************************************
1213IF NumSW ;AN000;(Check if numeric value is supported)
1214; $P_Value / $P_SValue
1215;
1216; Function: Make 32bit value from psdata_seg:SI and see value list
1217; and make result buffer.
1218; $P_SValue is an entry point for the signed value
1219; and this will simply call $P_Value after the handling
1220; of the sign character, "+" or "-"
1221;
1222; Input: psdata_seg:SI -> $P_STRING_BUF
1223; ES:BX -> CONTROL block
1224;
1225; Output: None
1226;
1227; Use: $P_Fill_Result, $P_Check_OVF
1228;
1229; Vars: $P_RC(W), $P_Flags(RW)
1230;***********************************************************************
1231$P_SValue proc ;AN000; when signed value here
1232 push ax ;AN000;
1233 or psdata_seg:$P_Flags2,$P_Signed ;AC034; indicate a signed numeric
1234 and psdata_seg:$P_Flags2,0ffh-$P_Neg ;AC034; assume positive value
1235 mov al,psdata_seg:[si] ;AN000; get sign
1236 cmp al,$P_Plus ;AN000; "+" ?
1237 je $P_SVal00 ;AN000;
1238
1239 cmp al,$P_Minus ;AN000; "-" ?
1240 jne $P_Sval01 ;AN000; else
1241
1242 or psdata_seg:$P_Flags2,$P_Neg ;AC034; set this is negative value
1243$P_SVal00: ;AN000;
1244 inc si ;AN000; skip sign char
1245$P_Sval01: ;AN000;
1246 call $P_Value ;AN000; and process value
1247 pop ax ;AN000;
1248 ret ;AN000;
1249$P_SValue endp ;AN000;
1250;***********************************************************************
1251$P_Value proc ;AN000;
1252 push ax ;AN000;
1253 push cx ;AN000;
1254 push dx ;AN000;
1255 push si ;AN000;
1256 xor cx,cx ;AN000; cx = higher 16 bits
1257 xor dx,dx ;AN000; dx = lower 16 bits
1258 push bx ;AN000; save control pointer
1259$P_Value_Loop: ;AN000;
1260 mov al,psdata_seg:[si] ;AN000; get character
1261 or al,al ;AN000; end of line ?
1262 je $P_Value00 ;AN000;
1263
1264 call $P_0099 ;AN000; make asc(0..9) to bin(0..9)
1265 jc $P_Value_Err0 ;AN000;
1266
1267 xor ah,ah ;AN000;
1268 mov bp,ax ;AN000; save binary number
1269 shl dx,1 ;AN000; to have 2*x
1270 rcl cx,1 ;AN000; shift left w/ carry
1271 call $P_Check_OVF ;AN000; Overflow occurred ?
1272 jc $P_Value_Err0 ;AN000; then error, exit
1273
1274 mov bx,dx ;AN000; save low(2*x)
1275 mov ax,cx ;AN000; save high(2*x)
1276 shl dx,1 ;AN000; to have 4*x
1277 rcl cx,1 ;AN000; shift left w/ carry
1278 call $P_Check_OVF ;AN000; Overflow occurred ?
1279 jc $P_Value_Err0 ;AN000; then error, exit
1280
1281 shl dx,1 ;AN000; to have 8*x
1282 rcl cx,1 ;AN000; shift left w/ carry
1283 call $P_Check_OVF ;AN000; Overflow occurred ?
1284 jc $P_Value_Err0 ;AN000; then error, exit
1285
1286 add dx,bx ;AN000; now have 10*x
1287 adc cx,ax ;AN000; 32bit ADD
1288 call $P_Check_OVF ;AN000; Overflow occurred ?
1289 jc $P_Value_Err0 ;AN000; then error, exit
1290
1291 add dx,bp ;AN000; Add the current one degree decimal
1292 adc cx,0 ;AN000; if carry, add 1 to high 16bit
1293 call $P_Check_OVF ;AN000; Overflow occurred ?
1294 jc $P_Value_Err0 ;AN000; then error, exit
1295
1296 inc si ;AN000; update pointer
1297 jmp short $P_Value_Loop ;AN000; loop until NULL encountered
1298;
1299$P_Value_Err0: ;AN000;
1300 pop bx ;AN000;
1301 jmp $P_Value_Err ;AN000; Bridge
1302;
1303$P_Value00: ;AN000;
1304 pop bx ;AN000; restore control pointer
1305 test psdata_seg:$P_Flags2,$P_Neg ;AC034; here cx,dx = 32bit value
1306 je $P_Value01 ;AN000; was it negative ?
1307
1308 not cx ;AN000; +
1309 not dx ;AN000; |- Make 2's complement
1310 add dx,1 ;AN000; |
1311 adc cx,0 ;AN000; +
1312$P_Value01: ;AN000; / nval =0
1313 mov si,es:[bx].$P_Value_List ;AN000; si points to value list
1314 mov al,es:[si] ;AN000; get nval
1315 cmp al,$P_nval_None ;AN000; no value list ?
1316 jne $P_Value02 ;AN000;
1317
1318 mov al,$P_Number ;AN000; Set type
1319 mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
1320 jmp $P_Value_Exit ;AN000;
1321
1322$P_Value02: ;AN000; / nval = 1
1323IF Val1SW ;AN000;(Check if value list id #1 is supported)
1324;(tm07) cmp al,$P_nval_Range ;AN000; have range list ?
1325;(tm07) jne $P_Value03 ;AN000;
1326
1327 inc si ;AN000;
1328 mov al,es:[si] ;AN000; al = number of range
1329 cmp al,$P_No_nrng ;AN000; (tm07)
1330 je $P_Value03 ;AN000; (tm07)
1331
1332 inc si ;AN000; si points to 1st item_tag
1333$P_Val02_Loop: ;AN000;
1334 test psdata_seg:$P_Flags2,$P_Signed ;AC034;
1335 jne $P_Val02_Sign ;AN000;
1336
1337 cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH
1338 jb $P_Val02_Next ;AN000;
1339
1340 ja $P_Val_In ;AN000;
1341
1342 cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL
1343 jb $P_Val02_Next ;AN000;
1344
1345$P_Val_In: ;AN000;
1346;;;;;; cmp cx,es:$P_Val_YH] ; comp cx with YH (tm01)
1347 cmp cx,es:[si+$P_Val_YH] ;AN000; comp cx with YH (tm01)
1348 ja $P_Val02_Next ;AN000;
1349
1350 jb $P_Val_Found ;AN000;
1351
1352 cmp dx,es:[si+$P_Val_YL] ;AN000; comp dx with YL
1353 ja $P_Val02_Next ;AN000;
1354
1355 jmp short $P_Val_Found ;AN000;
1356
1357$P_Val02_Sign: ;AN000;
1358 cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH
1359 jl $P_Val02_Next ;AN000;
1360
1361 jg $P_SVal_In ;AN000;
1362
1363 cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL
1364 jl $P_Val02_Next ;AN000;
1365
1366$P_SVal_In: ;AN000;
1367 cmp cx,es:[si+$P_Val_YH] ;AN000; comp cx with YH
1368 jg $P_Val02_Next ;AN000;
1369
1370 jl $P_Val_Found ;AN000;
1371
1372 cmp dx,es:[si+$P_Val_YL] ;AN000; comp dx with YL
1373 jg $P_Val02_Next ;AN000;
1374
1375 jmp short $P_Val_Found ;AN000;
1376
1377$P_Val02_Next: ;AN000;
1378 add si,$P_Len_Range ;AN000;
1379 dec al ;AN000; loop nrng times in AL
1380 jne $P_Val02_Loop ;AN000;
1381 ; / Not found
1382 mov psdata_seg:$P_RC,$P_Out_of_Range ;AC034;
1383 mov al,$P_Number ;AN000;
1384 mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
1385 jmp short $P_Value_Exit ;AN000;
1386
1387ENDIF ;AN000;(of Val1SW)
1388IF Val1SW+Val2SW ;AN000;(Check if value list id #1 or #2 is supported)
1389$P_Val_Found: ;AN000;
1390 mov al,$P_Number ;AN000;
1391 mov ah,es:[si] ;AN000; found ITEM_TAG set
1392 jmp short $P_Value_Exit ;AN000;
1393
1394ENDIF ;AN000;(of Val1SW+Val2SW)
1395$P_Value03: ;AN000; / nval = 2
1396IF Val2SW ;AN000;(Check if value list id #2 is supported)
1397;;;; cmp al,$P_nval_Value ; have match list ? ASSUME nval=2,
1398;;;; jne $P_Value04 ; even if it is 3 or more.
1399;(tm07) inc si ;AN000;
1400;(tm07) mov al,es:[si] ;AN000; al = nrng
1401 mov ah,$P_Len_Range ;AN000;
1402 mul ah ;AN000; Skip nrng field
1403 inc ax ;AN000;
1404 add si,ax ;AN000; si points to nnval
1405 mov al,es:[si] ;AN000; get nnval
1406 inc si ;AN000; si points to 1st item_tag
1407$P_Val03_Loop: ;AN000;
1408 cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH
1409 jne $P_Val03_Next ;AN000;
1410
1411 cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL
1412 je $P_Val_Found ;AN000;
1413
1414$P_Val03_Next: ;AN000;
1415 add si,$P_Len_Value ;AN000; points to next value choice
1416 dec al ;AN000; loop nval times in AL
1417 jne $P_Val03_Loop ;AN000;
1418 ;AN000; / Not found
1419 mov psdata_seg:$P_RC,$P_Not_in_Val ;AC034;
1420 mov al,$P_Number ;AN000;
1421 mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
1422 jmp short $P_Value_Exit ;AN000;
1423
1424ENDIF ;AN000;(of Val2SW)
1425$P_Value04: ;AN000; / nval = 3 or else
1426$P_Value_Err: ;AN000;
1427 mov psdata_seg:$P_RC,$P_Syntax ;AC034;
1428 mov al,$P_String ;AN000; Set type
1429 mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
1430$P_Value_Exit: ;AN000;
1431 call $P_Fill_Result ;AN000;
1432 pop si ;AN000;
1433 pop dx ;AN000;
1434 pop cx ;AN000;
1435 pop ax ;AN000;
1436 ret ;AN000;
1437$P_Value endp ;AN000;
1438PAGE ;AN000;
1439;***********************************************************************
1440; $P_Check_OVF
1441;
1442; Function: Check if overflow is occurred with consideration of
1443; signed or un-signed numeric value
1444;
1445; Input: Flag register
1446;
1447; Output: CY = 1 : Overflow
1448;
1449; Vars: $P_Flags(R)
1450;***********************************************************************
1451$P_Check_OVF proc ;AN000;
1452 pushf ;AN000;
1453 test psdata_seg:$P_Flags2,$P_Neg ;AC034; is it negative value ?
1454 jne $P_COVF ;AN000; if no, check overflow
1455
1456 popf ;AN000; by the CY bit
1457 ret ;AN000;
1458
1459$P_COVF: ;AN000;
1460 popf ;AN000; else,
1461 jo $P_COVF00 ;AN000; check overflow by the OF
1462
1463 clc ;AN000; indicate it with CY bit
1464 ret ;AN000; CY=0 means no overflow
1465
1466$P_COVF00: ;AN000;
1467 stc ;AN000; and CY=1 means overflow
1468 ret ;AN000;
1469$P_Check_OVF endp ;AN000;
1470ENDIF ;AN000;(of FarSW)
1471;***********************************************************************
1472; $P_0099;
1473;
1474; Function: Make ASCII 0-9 to Binary 0-9
1475;
1476; Input: AL = character code
1477;
1478; Output: CY = 1 : AL is not number
1479; CY = 0 : AL contains binary value
1480;***********************************************************************
1481$P_0099 proc ;AN000;
1482 cmp al,"0" ;AN000;
1483 jb $P_0099Err ;AN000; must be 0 =< al =< 9
1484
1485 cmp al,"9" ;AN000;
1486 ja $P_0099Err ;AN000; must be 0 =< al =< 9
1487
1488 sub al,"0" ;AN000; make char -> bin
1489 clc ;AN000; indicate no error
1490 ret ;AN000;
1491
1492$P_0099Err: ;AN000;
1493 stc ;AN000; indicate error
1494 ret ;AN000;
1495$P_0099 endp ;AN000;
1496PAGE ;AN000;
1497;***********************************************************************
1498; $P_Simple_String
1499;
1500; Function: See value list for the simple string
1501; and make result buffer.
1502;
1503; Input: psdata_seg:SI -> $P_STRING_BUF
1504; ES:BX -> CONTROL block
1505;
1506; Output: None
1507;
1508; Use: $P_Fill_Result, $P_String_Comp
1509;
1510; Vars: $P_RC(W)
1511;***********************************************************************
1512$P_Simple_String proc ;AN000;
1513 push ax ;AN000;
1514 push bx ;AN000;
1515 push dx ;AN000;
1516 push di ;AN000;
1517 mov di,es:[bx].$P_Value_List ;AN000; di points to value list
1518 mov al,es:[di] ;AN000; get nval
1519 or al,al ;AN000; no value list ?
1520 jne $P_Sim00 ;AN000; then
1521
1522 mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
1523 jmp short $P_Sim_Exit ;AN000; and set result buffer
1524
1525$P_Sim00: ;AN000;
1526IF Val3SW+KeySW ;AN000;(Check if keyword or value list id #3 is supported)
1527 cmp al,$P_nval_String ;AN000; String choice list provided ?
1528 jne $P_Sim01 ;AN000; if no, syntax error
1529
1530 inc di ;AN000;
1531 mov al,es:[di] ;AN000; al = nrng
1532 mov ah,$P_Len_Range ;AN000;
1533 mul ah ;AN000; Skip nrng field
1534 inc ax ;AN000; ax = (nrng*9)+1
1535 add di,ax ;AN000; di points to nnval
1536 mov al,es:[di] ;AN000; get nnval
1537 mov ah,$P_Len_Value ;AN000;
1538 mul ah ;AN000; Skip nnval field
1539 inc ax ;AN000; ax = (nnval*5)+1
1540 add di,ax ;AN000; di points to nstrval
1541 mov al,es:[di] ;AN000; get nstrval
1542 inc di ;AC035; add '2' to
1543 inc di ;AC035; DI reg
1544 ;AN000; di points to 1st string in list
1545;(replaced ;AC035;) add di,2 ;AN000; di points to 1st string in list
1546$P_Sim_Loop: ;AN000;
1547 mov bp,es:[di] ;AN000; get string pointer
1548 call $P_String_Comp ;AN000; compare it with operand
1549 jnc $P_Sim_Found ;AN000; found on list ?
1550
1551 add di,$P_Len_String ;AN000; if no, point to next choice
1552 dec al ;AN000; loop nstval times in AL
1553 jne $P_Sim_Loop ;AN000;
1554 ;AN000; / Not found
1555 mov psdata_seg:$P_RC,$P_Not_In_Str ;AC034;
1556 mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
1557 jmp short $P_Sim_Exit ;AN000;
1558
1559$P_Sim_Found: ;AN000;
1560 mov ah,es:[di-1] ;AN000; set item_tag
1561 mov al,$P_List_Idx ;AN000;
1562 mov dx,es:[di] ;AN000; get address of STRING
1563 jmp short $P_Sim_Exit0 ;AN000;
1564ENDIF ;AN000;(of Val3SW+KeySW)
1565$P_Sim01: ;AN000;
1566 mov psdata_seg:$P_RC,$P_Syntax ;AC034;
1567 mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
1568$P_Sim_Exit: ;AN000;
1569 mov al,$P_String ;AN000; Set type
1570$P_Sim_Exit0: ;AN000;
1571 call $P_Fill_Result ;AN000;
1572 pop di ;AN000;
1573 pop dx ;AN000;
1574 pop bx ;AN000;
1575 pop ax ;AN000;
1576 ret ;AN000;
1577$P_Simple_String endp ;AN000;
1578PAGE ;AN000;
1579;***********************************************************************
1580; $P_String_Comp:
1581;
1582; Function: Compare two string
1583;
1584; Input: psdata_seg:SI -> 1st string
1585; ES:BP -> 2nd string (Must be upper case)
1586; ES:BX -> CONTROL block
1587;
1588; Output: CY = 1 if not match
1589;
1590; Use: $P_Chk_DBCS, $P_Do_CAPS_Char
1591;
1592; Vars: $P_KEYor_SW_Ptr(W), $P_Flags(R). $P_KEYorSW_Ptr
1593;***********************************************************************
1594$P_String_Comp proc ;AN000;
1595 push ax ;AN000;
1596 push bp ;AN000;
1597 push dx ;AN000;
1598 push si ;AN000;
1599 mov dl,$P_DOSTBL_Char ;AN000; use character case map table
1600$P_SCOM_Loop: ;AN000;
1601 mov al,psdata_seg:[si] ;AN000; get command character
1602 call $P_Chk_DBCS ;AN000; DBCS ?
1603 jc $P_SCOM00 ;AN000; yes,DBCS
1604
1605 call $P_Do_CAPS_Char ;AN000; else, upper case map before comparison
1606IF KeySW+SwSW ;AN000;(Check if keyword or switch is supported)
1607 test psdata_seg:$P_Flags2,$P_Key_Cmp ;AC034; keyword search ?
1608 je $P_SCOM04 ;AN000;
1609
1610 cmp al,$P_Keyword ;AN000; "=" is delimiter
1611 jne $P_SCOM03 ;AN000;IF "=" on command line AND (bp+1=> char after the "=" in synonym list)
1612
1613 cmp byte ptr es:[bp+1],$P_NULL ;AN021; at end of keyword string in the control block THEN
1614 jne $P_SCOM_DIFFER ;AN021;
1615
1616 jmp short $P_SCOM05 ;AN000; keyword found in synonym list
1617
1618$P_SCOM04: ;AN000;
1619 test psdata_seg:$P_Flags2,$P_SW_Cmp ;AC034; switch search ?
1620 je $P_SCOM03 ;AN000;
1621
1622 cmp al,$P_Colon ;AN000; ":" is delimiter, at end of switch on command line
1623 jne $P_SCOM03 ;AN000; continue compares
1624
1625 cmp byte ptr es:[bp],$P_NULL ;AN021; IF at end of switch on command AND
1626 jne $P_SCOM_DIFFER ;AN021; at end of switch string in the control block THEN
1627
1628$P_SCOM05: ;AN000; found a match
1629 inc si ;AN000; si points to just after "=" or ":"
1630 jmp short $P_SCOM_Same ;AN000; exit
1631
1632$P_SCOM03: ;AN000;
1633ENDIF ;AN000;(of KeySW+SwSW)
1634 cmp al,es:[bp] ;AN000; compare operand w/ a synonym
1635 jne $P_SCOM_Differ0 ;AN000; if different, check ignore colon option
1636
1637 or al,al ;AN000; end of line
1638 je $P_SCOM_Same ;AN000; if so, exit
1639
1640 inc si ;AN000; update operand pointer
1641 inc bp ;AN000; and synonym pointer
1642 jmp short $P_SCOM01 ;AN000; loop until NULL or "=" or ":" found in case
1643
1644$P_SCOM00: ;AN000; Here al is DBCS leading byte
1645 cmp al,es:[bp] ;AN000; compare leading byte
1646 jne $P_SCOM_Differ ;AN000; if not match, say different
1647
1648 inc si ;AN000; else, load next byte
1649 mov al,psdata_seg:[si] ;AN000; and
1650 inc bp ;AN000;
1651 cmp al,es:[bp] ;AN000; compare 2nd byte
1652 jne $P_SCOM_Differ ;AN000; if not match, say different, too
1653
1654 inc si ;AN000; else update operand pointer
1655 inc bp ;AN000; and synonym pointer
1656$P_SCOM01: ;AN000;
1657 jmp short $P_SCOM_Loop ;AN000; loop until NULL or "=" or "/" found in case
1658
1659$P_SCOM_Differ0: ;AN000;
1660
1661IF SwSW ;AN000;(tm10)
1662 test psdata_seg:$P_Flags2,$P_SW ;AC034;(tm10)
1663 je $P_not_applicable ;AN000;(tm10)
1664
1665 test es:[bx].$P_Function_Flag,$P_colon_is_not_necessary ;AN000;(tm10)
1666 je $P_not_applicable ;AN000;(tm10)
1667
1668 cmp byte ptr es:[bp],$P_NULL ;AN000;(tm10)
1669;(deleted ;AN025;) jne $P_not_applicable ;AN000;(tm10)
1670 je $P_SCOM_Same ;AN025;(tm10)
1671
1672$P_not_applicable: ;AN000;(tm10)
1673ENDIF ;AN000;(tm10)
1674
1675 test es:[bx].$P_Match_Flag,$P_Ig_Colon ;AN000; ignore colon option specified ?
1676 je $P_SCOM_Differ ;AN000; if no, say different.
1677
1678 cmp al,$P_Colon ;AN000; End up with ":" and
1679 jne $P_SCOM02 ;AN000; subseqently
1680
1681 cmp byte ptr es:[bp],$P_NULL ;AN000; NULL ?
1682 jne $P_SCOM_Differ ;AN000; if no, say different
1683
1684 jmp short $p_SCOM_Same ;AN000; else, say same
1685
1686$P_SCOM02: ;AN000;
1687 cmp al,$P_NULL ;AN000; end up NULL and :
1688 jne $P_SCOM_Differ ;AN000;
1689
1690 cmp byte ptr es:[bp],$P_Colon ;AN000; if no, say different
1691 je $p_SCOM_Same ;AN000; else, say same
1692
1693$P_SCOM_Differ: ;AN000;
1694 stc ;AN000; indicate not found
1695 jmp short $P_SCOM_Exit ;AN000;
1696
1697$P_SCOM_Same: ;AN000;
1698 mov psdata_seg:$P_KEYorSW_Ptr,si ;AC034; for later use by keyword or switch
1699 clc ;AN000; indicate found
1700$P_SCOM_Exit: ;AN000;
1701 pop si ;AN000;
1702 pop dx ;AN000;
1703 pop bp ;AN000;
1704 pop ax ;AN000;
1705 ret ;AN000;
1706$P_String_Comp endp ;AN000;
1707PAGE ;AN000;
1708;***********************************************************************
1709IF DateSW ;AN000;(Check if date format is supported)
1710; $P_Date_Format
1711;
1712; Function: Convert a date string to DOS date format for int 21h
1713; with format validation.
1714;
1715; Input: psdata_seg:SI -> $P_STRING_BUF
1716; ES:BX -> CONTROL block
1717;
1718; Output: None
1719;
1720; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum
1721;
1722; Vars: $P_RC(W), $P_1st_Val(RW), $P_2nd_Val(RW), $P_3rd_Val(RW)
1723;***********************************************************************
1724$P_Date_Format proc ;AN000;
1725 push ax ;AN000;
1726 push cx ;AN000;
1727 push dx ;AN000;
1728 push si ;AN000;
1729 push bx ;AN000;
1730 push si ;AN000;
1731 call $P_Set_CDI ;AN000; set country dependent information before process
1732; mov bl,psdata_seg:[si].$P_CDI_DateS ;load date separator ;AN020; (deleted)
1733; note: the country info is still needed
1734; to determine the order of the fields,
1735; but the separator char is no longer used.
1736 pop si ;AN000;
1737 mov psdata_seg:$P_1st_Val,0 ;AC034; set initial value
1738 mov psdata_seg:$P_2nd_Val,0 ;AC034; set initial value
1739 mov psdata_seg:$P_3rd_Val,0 ;AC034; set initial value
1740 call $P_Get_DecNum ;AN000; get 1st number
1741 jc $P_DateF_Err0 ;AN000;-----------------------+
1742
1743 mov psdata_seg:$P_1st_Val,ax ;AC034; |
1744 or bl,bl ;AN000; end of line ? |
1745 je $P_DateF_YMD ;AN000; |
1746
1747 call $P_Get_DecNum ;AN000; get 2nd number |
1748 jc $P_DateF_Error ;AN000; |
1749
1750 mov psdata_seg:$P_2nd_Val,ax ;AC034; |
1751 or bl,bl ;AN000; end of line ? |
1752 je $P_DateF_YMD ;AN000; |
1753
1754 call $P_Get_DecNum ;AN000; get 3rd number |
1755$P_DateF_Err0: ;AN000; Bridge <-----------+
1756 jc $P_DateF_Error ;AN000;
1757
1758 mov psdata_seg:$P_3rd_Val,ax ;AC034;
1759 or bl,bl ;AN000; end of line ?
1760 jne $P_DateF_Error ;AN000;
1761
1762$P_DateF_YMD: ;AN000;
1763 mov bx,psdata_seg:$P_Country_Info.$P_CDI_DateF ;AC034; get date format
1764 cmp bx,$P_Date_YMD ;AN000;
1765 je $P_DateF00 ;AN000;
1766
1767 mov ax,psdata_seg:$P_1st_Val ;AC034;
1768 or ah,ah ;AN000;
1769 jne $P_DateF_Error ;AN000;
1770
1771 mov cl,al ;AN000; set month
1772 mov ax,psdata_seg:$P_2nd_Val ;AC034;
1773 or ah,ah ;AN000; if overflow, error.
1774 jne $P_DateF_Error ;AN000;
1775
1776 mov ch,al ;AN000; set date
1777 mov dx,psdata_seg:$P_3rd_Val ;AC034; set year
1778 cmp bx,$P_Date_DMY ;AN000; from here format = MDY
1779 jne $P_DateF01 ;AN000; if it is DMY
1780
1781 xchg ch,cl ;AN000; then swap M <-> D
1782$P_DateF01: ;AN000;
1783 jmp short $P_DateF02 ;AN000;
1784
1785$P_DateF00: ;AN000; / here format = YMD
1786 mov dx,psdata_seg:$P_1st_Val ;AC034; set year
1787 mov ax,psdata_seg:$P_2nd_Val ;AC034;
1788 or ah,ah ;AN000; if overflow, error
1789 jne $P_DateF_Error ;AN000;
1790
1791 mov cl,al ;AN000; set month
1792 mov ax,psdata_seg:$P_3rd_Val ;AC034;
1793 or ah,ah ;AN000; if overflow, error
1794 jne $P_DateF_Error ;AN000;
1795
1796 mov ch,al ;AN000; set date
1797$P_DateF02: ;AN000;
1798 cmp dx,100 ;AN000; year is less that 100 ?
1799 jae $P_DateF03 ;AN000;
1800
1801 add dx,1900 ;AN000; set year 19xx
1802$P_DateF03: ;AN000;
1803 pop bx ;AN000; recover CONTROL block
1804 pop si ;AN000; recover string pointer
1805 mov ah,$P_No_Tag ;AN000; set
1806 mov al,$P_Date_F ;AN000; result
1807 call $P_Fill_Result ;AN000; buffer
1808 jmp short $P_Date_Format_Exit ;AN000; to Date
1809
1810$P_DateF_Error: ;AN000;
1811 pop bx ;AN000; recover CONTROL block
1812 pop si ;AN000; recover string pointer
1813 mov ah,$P_No_Tag ;AN000; set
1814 mov al,$P_String ;AN000; result
1815 call $P_Fill_Result ;AN000; buffer to string
1816 mov psdata_seg:$P_RC,$P_Syntax ;AC034; indicate syntax error
1817$P_Date_Format_Exit: ;AN000;
1818 pop dx ;AN000;
1819 pop cx ;AN000;
1820 pop ax ;AN000;
1821 ret ;AN000;
1822$P_Date_Format endp ;AN000;
1823ENDIF ;AN000;(of DateSW)
1824PAGE ;AN000;
1825;***********************************************************************
1826IF TimeSW+DateSW ;AN000;(Check if time or date format is supported)
1827; $P_Set_CDI:
1828;
1829; Function: Read CDI from DOS if it has not been read yet
1830;
1831; Input: None
1832;
1833; Output: psdata_seg:SI -> CDI
1834;
1835; Use: INT 21h w/ AH = 38h
1836;***********************************************************************
1837$P_Set_CDI proc ;AN000;
1838 lea si,psdata_seg:$P_Country_Info ;AC034;
1839 cmp psdata_seg:[si].$P_CDI_DateF,$P_NeedToBeRead ;AN000; already read ?
1840 je $P_Read_CDI ;AN000;
1841
1842 jmp short $P_Set_CDI_Exit ;AN000; then do nothing
1843
1844$P_Read_CDI: ;AN000; else read CDI thru DOS
1845 push ds ;AN000;
1846 push dx ;AN000;
1847 push ax ;AN000;
1848 push PSDATA_SEG ;AC023;
1849 pop ds ;AN000; set segment register
1850 mov ax,$P_DOS_Get_CDI ;AN000; get country information
1851 mov dx,si ;AN000; set offset of CDI in local data area
1852 int 21h ;AN000;
1853 pop ax ;AN000;
1854 pop dx ;AN000;
1855 pop ds ;AN000;
1856$P_Set_CDI_Exit: ;AN000;
1857 ret ;AN000;
1858$P_Set_CDI endp ;AN000;
1859PAGE ;AN000;
1860;***********************************************************************
1861; $P_Get_DecNum:
1862;
1863; Function: Read a chcrater code from psdata_seg:SI until specified delimiter
1864; or NULL encountered. And make a decimal number.
1865;
1866; Input: psdata_seg:SI -> $P_STRING_BUF
1867;
1868; Output: BL = delimiter code or NULL
1869; AX = Decimal number
1870; SI advanced to the next number
1871; CY = 1 : Syntax error, AL = Latest examineed number
1872;
1873; Use: $P_0099
1874;***********************************************************************
1875$P_Get_DecNum proc ;AN000;
1876 push cx ;AN000;
1877 push dx ;AN000;
1878 xor cx,cx ;AN000; cx will have final value
1879$P_GetNum_Loop: ;AN000;
1880 mov al,psdata_seg:[si] ;AN000; load character
1881 or al,al ;AN000; end of line ?
1882 je $P_GetNum00 ;AN000; if yes, exit
1883
1884 cmp psdata_seg:$P_Got_Time,0 ;AC034; ;is this numeric in a time field? ;AC023
1885 je $P_Do_Date_Delims ;AN000;no, go check out Date delimiters ;AC023
1886
1887; Determine which delimiter(s) to check for. Colon & period or period only
1888 cmp bl,$P_colon_period ;AN032; ;Time
1889 jne $P_Do_Time_Delim1 ;AN032; ;only check for period
1890
1891 cmp al,$P_Colon ;AN032; ;Is this a valid delimiter ?
1892 je $P_GetNum01 ;AN032; ;yes, exit
1893
1894$P_Do_Time_Delim1: ;AN000;
1895 cmp al,$P_Period ;;AC032;;AC023;Is this a valid delimiter ?
1896 je $P_GetNum01 ;AC023; yes, exit
1897
1898 jmp short $P_Neither_Delims ;AN023;
1899
1900$P_Do_Date_Delims: ;AN000;
1901;Regardless of the date delimiter character specified in the country
1902;dependent information, check for the presence of any one of these
1903;three field delimiters: "-", "/", or ".".
1904 cmp al,$P_Minus ;AN020;is this a date delimiter character?
1905 je $P_GetNum01 ;AN020;if yes, exit
1906
1907 cmp al,$P_Slash ;AN020;is this a date delimiter character?
1908 je $P_GetNum01 ;AN020;if yes, exit
1909
1910 cmp al,$P_Period ;AN020;is this a date delimiter character?
1911 je $P_GetNum01 ;AN000; if yes, exit
1912
1913$P_Neither_Delims: ;AN023;
1914
1915 call $P_0099 ;AN000; convert it to binary
1916 jc $P_GetNum_Exit ;AN000; if error exit
1917
1918 mov ah,0 ;AN000;
1919 xchg ax,cx ;AN000;
1920 mov dx,10 ;AN000;
1921 mul dx ;AN000; ax = ax * 10
1922 or dx,dx ;AN000; overflow
1923 jne $P_GetNum02 ;AN000; then exit
1924
1925 add ax,cx ;AN000;
1926 jc $P_GetNum_Exit ;AN000;
1927
1928 xchg ax,cx ;AN000;
1929 inc si ;AN000;
1930 jmp short $P_GetNum_Loop ;AN000;
1931
1932$P_GetNum00: ;AN000;
1933 mov bl,al ;AN000; set bl to NULL
1934 clc ;AN000; indicate no error
1935 jmp short $P_GetNum_Exit ;AN000;
1936
1937$P_GetNum01: ;AN000;
1938 inc si ;AN000; si points to next number
1939 clc ;AN000; indicate no error
1940 jmp short $P_GetNum_Exit ;AN000;
1941
1942$P_GetNum02: ;AN000;
1943 stc ;AN000; indicate error
1944$P_GetNum_Exit: ;AN000;
1945 mov ax,cx ;AN000;return value
1946 pop dx ;AN000;
1947 pop cx ;AN000;
1948 ret ;AN000;
1949$P_Get_DecNum endp ;AN000;
1950ENDIF ;AN000;(of TimeSW+DateSW)
1951PAGE ;AN000;
1952;***********************************************************************
1953IF TimeSW ;AN000;(Check if time format is supported)
1954; $P_Time_Format
1955;
1956; Function: Convert a time string to DOS time format for int 21h
1957; with format validation.
1958;
1959; Input: psdata_seg:SI -> $P_STRING_BUF
1960; ES:BX -> CONTROL block
1961;
1962; Output: None
1963;
1964; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum, $P_Time_2412
1965;
1966; Vars: $P_RC(W), $P_Flags(R), $P_1st_Val(RW), $P_2nd_Val(RW)
1967; $P_3rd_Val(RW), $P_4th_Val(RW)
1968;***********************************************************************
1969$P_Time_Format proc ;AN000;
1970 push ax ;AN000;
1971 push cx ;AN000;
1972 push dx ;AN000;
1973 push si ;AN000;
1974 push bx ;AN000;
1975 push si ;AN000;
1976 call $P_Set_CDI ;AN000; Set country independent
1977 ; information before process
1978;(AN032; deleted) mov bl,psdata_seg:[si].$P_CDI_TimeS ;load time separator
1979;(AN032; deleted) mov bh,psdata_seg:[si].$P_CDI_Dec ;load decimal separator
1980 test byte ptr psdata_seg:[si].$P_CDI_TimeF,1 ;AN000; 24 hour system
1981 pop si ;AN000;
1982 jne $P_TimeF00 ;AN000; if no, means 12 hour system
1983
1984 call $P_Time_2412 ;AN000; this routine handle "am" "pm"
1985$P_TimeF00: ;AN000;
1986 mov psdata_seg:$P_1st_Val,0 ;AC034; set initial value
1987 mov psdata_seg:$P_2nd_Val,0 ;AC034; set initial value
1988 mov psdata_seg:$P_3rd_Val,0 ;AC034; set initial value
1989 mov psdata_seg:$P_4th_Val,0 ;AC034; set initial value
1990 mov psdata_seg:$P_Got_Time,1 ;AN023;AC034;; use time delimiter
1991 mov bl,$P_colon_period ;AN032; flag, indicates use of
1992 ; delimiters between hours,
1993 ; minutes,seconds
1994 call $P_Get_DecNum ;AN000; get 1st number
1995 jc $P_TimeF_Err0 ;AN000;
1996
1997 mov psdata_seg:$P_1st_Val,ax ;AC034;
1998 or bl,bl ;AN000; end of line ?
1999 je $P_TimeF_Rlt ;AN000;
2000
2001 call $P_Get_DecNum ;AN000; get 2nd number
2002 jc $P_TimeF_Err0 ;AC038; if OK
2003
2004 mov psdata_seg:$P_2nd_Val,ax ;AC034;
2005 or bl,bl ;AN000; end of line ?
2006 je $P_TimeF_Rlt ;AN000;
2007
2008;(;AN032; deleted) mov bl,bh ;set decimal separator
2009 mov bl,$P_period_only ;AN032; flag, which to decimal separator
2010 call $P_Get_DecNum ;AN000; get 3rd number
2011 jc $P_TimeF_Err0 ;AC039; if problem, bridge to error
2012
2013 mov psdata_seg:$P_3rd_Val,ax ;AC034;
2014 or bl,bl ;AN000; end of line ?
2015;(DELETED ;AN039;) je $P_TimeF_Rlt ;AN000;
2016 jne $P_Time_4 ;AN039; NOT END OF LINE,
2017 ;AN039; GO TO 4TH NUMBER
2018 test psdata_seg:$P_Flags1,$P_Time_Again ;AN039; HAS TIME PARSE
2019 ;AN039; BEEN REPEATED?
2020 jnz $P_TimeF_Rlt ;AN039; yes, this is really
2021 ;AN039; the end of line
2022 ;AN039; no, time has not been repeated
2023 mov si,psdata_seg:$P_SI_Save ;AN039; get where parser quit
2024 ;AN039; in command line
2025 cmp byte ptr [si-1],$P_Comma ;AN039; look at delimiter
2026 ;AN039; from command line
2027 jne $P_TimeF_Rlt ;AN039; was not a comma, this is
2028 ;AN039; really end of line
2029 ;AN039; is comma before hundredths,
2030 ;AN039; redo TIME
2031 mov byte ptr [si-1],$P_Period ;AN039; change that ambiguous
2032 ;AN039; comma to a decimal point
2033 ;AN039; parse can understand
2034 mov psdata_seg:$P_Flags,0 ;AN039; Clear all internal flags
2035 or psdata_seg:$P_Flags1,$P_Time_Again ;AN039; indicate TIME
2036 ;AN039; is being repeated
2037 mov cx,psdata_seg:$P_ORIG_ORD ;AN039; ORIGINAL ORDINAL FROM CX
2038 mov sp,psdata_seg:$P_ORIG_STACK ;AN039; ORIGINAL VALUE
2039 ;AN039; OF STACK FROM SP
2040 mov si,psdata_seg:$P_ORIG_SI ;AN039; ORIGINAL START
2041 ;AN039; PARSE POINTER FROM SI
2042 jmp $P_Redo_Time ;AN039; go try TIME again
2043; ===============================================================
2044$P_Time_4: ;AN039; READY FOR 4TH (HUNDREDTHS) NUMBER
2045 call $P_Get_DecNum ;AN000; get 4th number
2046$P_TimeF_Err0: ;AN000; Bridge
2047 jc $P_TimeF_Error ;AN000;
2048
2049 mov psdata_seg:$P_4th_Val,ax ;AC034;
2050 or bl,bl ;AN000; After hundredth, no data allowed
2051 jne $P_TimeF_Error ;AN000; if some, then error
2052
2053$P_TimeF_RLT: ;AN000;
2054 mov ax,psdata_seg:$P_1st_Val ;AC034;
2055 or ah,ah ;AN000; if overflow then error
2056 jne $P_TimeF_Err ;AN000;
2057
2058 test psdata_seg:$P_Flags1,$P_Time12am ;AN038;if "am" specified
2059 jz $P_Time_notAM ;AN038;skip if no "AM" specified
2060 ;since "AM" was specified,
2061 cmp al,12 ;AN038: if hour specified as later than noon
2062 ja $P_TimeF_Err ;AN038; error if "AM" on more than noon
2063 jne $P_Time_notAM ;AN038; for noon exactly,
2064
2065 xor al,al ;AN038; set hour = zero
2066$P_Time_notAM: ;AN038;
2067 test psdata_seg:$P_Flags2,$P_Time12 ;AC034; if 12 hour system and pm is specified
2068 je $P_TimeSkip00 ;AN000; then
2069
2070 cmp al,12 ;AN038; if 12:00 o'clock already
2071 je $P_TimeSkip00 ;AN038; it is PM already
2072
2073 add al,12 ;AN000; add 12 hours to make it afternoon
2074 jc $P_TimeF_Err ;AN000; if overflow then error
2075
2076 cmp al,24 ;AN038; after adding 12, now cannot be >24
2077 ja $P_TimeF_Err ;AN038; if too big, error
2078
2079$P_TimeSkip00: ;AN000;
2080 mov dl,al ;AN000; set hour
2081 mov ax,psdata_seg:$P_2nd_Val ;AC034;
2082 or ah,ah ;AN000; if overflow then error
2083 jne $P_TimeF_Err ;AN000;
2084
2085 mov dh,al ;AN000; set minute
2086 mov ax,psdata_seg:$P_3rd_Val ;AC034;
2087 or ah,ah ;AN000; if overflow then error
2088 jne $P_TimeF_Err ;AN000;
2089
2090 mov cl,al ;AN000; set second
2091 mov ax,psdata_seg:$P_4th_Val ;AC034;
2092 or ah,ah ;AN000; if overflow then error
2093 jne $P_TimeF_Err ;AN000;
2094
2095 mov ch,al ;AN000; set hundredth
2096 pop bx ;AN000; recover CONTROL block
2097 pop si ;AN000; recover string pointer
2098 mov ah,$P_No_Tag ;AN000; set
2099 mov al,$P_Time_F ;AN000; result
2100 call $P_Fill_Result ;AN000; buffer
2101 jmp short $P_Time_Format_Exit ;AN000; to time
2102
2103$P_TimeF_Error: ;AN000;
2104$P_TimeF_Err: ;AN000;
2105 pop bx ;AN000; recover CONTROL block
2106 pop si ;AN000; recover string pointer
2107 mov ah,$P_No_Tag ;AN000; set
2108 mov al,$P_String ;AN000; result
2109 call $P_Fill_Result ;AN000; buffer to string
2110 mov psdata_seg:$P_RC,$P_Syntax ;AC034; return syntax error
2111$P_Time_Format_Exit: ;AN000;
2112 mov psdata_seg:$P_Got_Time,0 ;AN023;AC034;; finished with this time field
2113 pop dx ;AN000;
2114 pop cx ;AN000;
2115 pop ax ;AN000;
2116 ret ;AN000;
2117$P_Time_Format endp ;AN000;
2118PAGE ;AN000;
2119;***********************************************************************
2120; $P_Time_2412:
2121;
2122; Function: Remove "a", "p", "am", or "pm" from the end of stinrg
2123;
2124; Input: psdata_seg:SI -> $P_STRING_BUF
2125;
2126; Output: Set $P_Time12 flag when the string is terminated by "p"
2127; or "pm"
2128;
2129; Vars: $P_Flags(W)
2130;***********************************************************************
2131$P_Time_2412 proc ;AN000;
2132 push ax ;AN000;
2133 push si ;AN000;
2134$P_T12_Loop: ;AN000;
2135 mov al,psdata_seg:[si] ;AN000; Move
2136 inc si ;AN000; si
2137 or al,al ;AN000; to
2138 jne $P_T12_Loop ;AN000; end of string
2139
2140 mov al,psdata_seg:[si-word] ;AN000; get char just before NULL
2141 or al,$P_Make_Lower ;AN000; lower case map
2142 cmp al,"p" ;AN000; only "p" of "pm" ?
2143 je $P_T1200 ;AN000;
2144
2145 cmp al,"a" ;AN000; only "a" of "am" ?
2146 je $P_T1201 ;AN000;
2147
2148 cmp al,"m" ;AN000; "m" of "am" or "pm"
2149 jne $P_T12_Exit ;AN000;
2150
2151 dec si ;AN000;
2152 mov al,psdata_seg:[si-word] ;AN000;
2153 or al,$P_Make_lower ;AN000; lower case map
2154 cmp al,"p" ;AN000; "p" of "pm" ?
2155 je $P_T1200 ;AN000;
2156
2157 cmp al,"a" ;AN000; "a" of "am" ?
2158 je $P_T1201 ;AN000; go process "a"
2159
2160 jmp short $P_T12_Exit ;AN000; no special chars found
2161
2162$P_T1200: ;AN000; "P" found
2163 or psdata_seg:$P_Flags2,$P_Time12 ;AC034; flag "PM" found
2164 jmp short $P_Tclr_chr ;AN038; go clear the special char
2165
2166$P_T1201: ;AN000; "A" found
2167 or psdata_seg:$P_Flags1,$P_Time12AM ;AN038; flag "AM" found
2168$P_Tclr_chr: ;AN038;
2169 mov byte ptr psdata_seg:[si-2],$P_NULL ;AN000; null out special char
2170$P_T12_Exit: ;AN000;
2171 pop si ;AN000;
2172 pop ax ;AN000;
2173 ret ;AN000;
2174$P_Time_2412 endp ;AN000;
2175ENDIF ;AN000;(of TimeSW)
2176PAGE ;AN000;
2177;***********************************************************************
2178IF CmpxSW ;AN000;(Check if complex item is supported)
2179; $P_Complex_Format:
2180;
2181; Function: Check if the input string is valid complex format.
2182; And set the result buffer.
2183;
2184; Input: psdata_seg:SI -> $P_STRING_BUF
2185; ES:BX -> CONTROL block
2186;
2187; Output: None
2188;
2189; Use: $P_Fill_Result, $P_Chk_DBCS, $P_Chk_EOL, $P_Skip_Delim
2190; $P_Quoted_str, $P_Chk_DSQuote
2191;
2192; Vars: $P_RC(W), $P_SI_Save(W), $P_SaveSI_Cmpx(R), $P_Save_EOB(R)
2193;***********************************************************************
2194$P_Complex_Format proc ;AN000;
2195 push ax ;AN000;
2196 push bx ;AN000;
2197 push si ;AN000;
2198 mov bx,psdata_seg:$P_SaveSI_Cmpx ;AC034; bx points to user buffer
2199 cmp byte ptr [bx],$P_Lparen ;AN000; 1st char = left parentheses
2200 jne $P_Cmpx_Err ;AN000;
2201
2202 xor ah,ah ;AN000; ah = parentheses counter
2203$P_Cmpx_Loop: ;AN000;
2204 mov al,[bx] ;AN000; load character from command buffer
2205 call $P_Chk_EOL ;AN000; if it is one of EOL
2206 je $P_CmpxErr0 ;AN000; then error exit.
2207
2208 cmp al,$P_Lparen ;AN000; left parentheses ?
2209 jne $P_Cmpx00 ;AN000; then
2210
2211 inc ah ;AC035; add '1' to AH reg
2212 ;AN000; increment parentheses counter
2213;(replaced ;AC035;) add ah,1 ;AN000; increment parentheses counter
2214 jc $P_CmpxErr0 ;AN000; if overflow, error
2215$P_Cmpx00: ;AN000;
2216 cmp al,$P_Rparen ;AN000; right parentheses ?
2217 jne $P_Cmpx01 ;AN000; then
2218
2219 dec ah ;AC035; subtract '1' from AH reg
2220 ;AN000; decrement parentheses counter
2221;(changed ;AC035;) sub ah,1 ;AN000; decrement parentheses counter
2222 jc $P_CmpxErr0 ;AN000; if overflow error
2223
2224 je $P_Cmpx03 ;AN000; ok, valid complex
2225
2226$P_Cmpx01: ;AN000;
2227;(deleted ;AN025;) call $P_Chk_DSQuote ;AN000; double or single quotation mark ? 3/17/KK
2228 cmp al,$P_DQuote ;AN025; double quotation mark?
2229 jne $P_Cmpx04 ;AN000; 3/17/KK
2230
2231 mov psdata_seg:[si],al ;AN000; here quoted string is found in the complex list.
2232 inc si ;AN000;
2233 inc bx ;AN000; bx points to 2nd character
2234 call $P_Quoted_Str ;AN000; skip pointers until closing of quoted string
2235 jc $P_CmpxErr0 ;AN000; if error in quoted string syntax then exit
2236
2237 jmp short $P_Cmpx05 ;AN000;
2238
2239$P_Cmpx04: ;AN000;
2240 call $P_Chk_DBCS ;AN000; was it a lead byte of DBCS ?
2241 jnc $P_Cmpx02 ;AN000;
2242
2243 mov psdata_seg:[si],al ;AN000; then store 1st byte
2244 inc si ;AN000;
2245 inc bx ;AN000;
2246 mov al,[bx] ;AN000; load 2nd byte
2247$P_Cmpx02: ;AN000;
2248 mov psdata_seg:[si],al ;AN000; store SBCS or 2nd byte of DBCS
2249$P_Cmpx05: ;AN000;
2250 inc si ;AN000;
2251 inc bx ;AN000;
2252 jmp short $P_Cmpx_Loop ;AN000; loop
2253;---- ;AN000;
2254$P_Cmpx03: ;AN000;
2255 mov byte ptr psdata_seg:[si],al ;AN000;
2256 mov byte ptr psdata_seg:[si+byte],$P_NULL ;AN000;
2257 mov byte ptr [bx],$P_NULL ;AN000; replace right parentheses with NULL
2258 mov si,bx ;AN000; skip whitespaces
2259 inc si ;AN000; after
2260 call $P_Skip_Delim ;AN000; right parentheses
2261 mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI
2262 jmp short $P_Cmpx_Exit ;AN000;
2263
2264$P_CmpxErr0: ;AN000;
2265 mov si,psdata_seg:$P_Save_EOB ;AC034; if EOF encountered, restore
2266 mov byte ptr psdata_seg:[si],$P_NULL ;AN000; EOB mark
2267$P_Cmpx_Err: ;AN000;
2268 mov psdata_seg:$P_RC,$P_Syntax ;AC034;
2269$P_Cmpx_Exit: ;AN000;
2270 mov ah,$P_No_Tag ;AN000;
2271 mov al,$P_Complex ;AN000;
2272 pop si ;AN000;
2273 pop bx ;AN000;
2274 call $P_Fill_Result ;AN000;
2275 pop ax ;AN000;
2276 ret ;AN000;
2277$P_Complex_Format endp ;AN000;
2278ENDIF ;AN000;(of CpmxSW)
2279PAGE ;AN000;
2280;***********************************************************************
2281IF QusSW ;AN000;(Check if quoted string is supported)
2282; $P_Quoted_Format:
2283;
2284; Function: Check if the input string is valid quoted string format.
2285; And set the result buffer.
2286;
2287; Input: psdata_seg:SI -> $P_STRING_BUF
2288; ES:BX -> CONTROL block
2289;
2290; Output: None
2291;
2292; Use: $P_Fill_Result, $P_Chk_DBCS, $P_Chk_EOL, $P_Skip_Delim
2293; $P_Chk_DSQuote, $P_Quoted_Str
2294;
2295; Vars: $P_RC(W), $P_SI_Save(W), $P_SaveSI_Cmpx(R),$P_Save_EOB(R)
2296;***********************************************************************
2297$P_Quoted_Format proc ;AN000;
2298 push ax ;AN000;
2299 push bx ;AN000;
2300 push si ;AN000;
2301 mov bx,psdata_seg:$P_SaveSI_Cmpx ;AC034; bx points to user buffer
2302 mov al,byte ptr [bx] ;AN000; get 1st character
2303;(deleted ;AN025;) call $P_Chk_DSQuote ;AN000; is it single or double quote ?
2304 cmp al,$P_DQuote ;AN025; double quotation mark?
2305 jne $P_Qus_Err ;AN000; if no, error
2306
2307; mov psdata_seg:[si],al ;AN000; move it to internal buffer
2308; inc si ;AN000;
2309 inc bx ;AN000; bx points to 2nd character
2310 call $P_Quoted_Str ;AN000; skip pointers to the closing of quoted string
2311 jc $P_Qus_Err0 ;AN000; if invali quoted string syntax, exit
2312
2313 mov byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; end up with NULL
2314 mov si,bx ;AN000;
2315 inc si ;AN000;
2316 call $P_Skip_Delim ;AN000; skip whitespaces after closing quote
2317 mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI
2318 jmp short $P_Qus_Exit ;AN000;
2319
2320$P_Qus_Err0: ;AN000;
2321 mov si,psdata_seg:$P_Save_EOB ;AC034; if EOF encountered, restore
2322 mov byte ptr psdata_seg:[si],$P_NULL ;AN000; EOB mark
2323$P_Qus_Err: ;AN000;AN000
2324 mov psdata_seg:$P_RC,$P_Syntax ;AC034; indicate syntax error
2325$P_Qus_Exit: ;AN000;
2326 mov ah,$P_No_Tag ;AN000; set
2327 mov al,$P_Quoted_String ;AN000; result
2328 pop si ;AN000; buffer
2329 pop bx ;AN000; to
2330 call $P_Fill_Result ;AN000; quoted string
2331 pop ax ;AN000;
2332 ret ;AN000;
2333$P_Quoted_Format endp ;AN000;
2334ENDIF ;AN000;(of QusSW)
2335PAGE ;AN000;
2336;***********************************************************************
2337; $P_Chk_DSQuote;
2338;
2339; Function: Check if AL is double quotation or single quotation
2340;
2341; Input: AL = byte to be examineed
2342;
2343; Output: ZF on if AL is single or double quotetaion
2344;
2345; Vars: $P_SorD_Quote(W)
2346;***********************************************************************
2347IF QusSW+CmpxSW ;AN000;(Check if quoted string or complex item is supported)
2348;(deleted ;AN025;) $P_Chk_DSQuote proc ;
2349;(deleted ;AN025;) mov $P_SorD_Quote,$P_SQuote ; 3/17/87 assume single quote
2350;(deleted ;AN025;) cmp al,$P_DQuote ; 1st char = double quotation ?
2351;(deleted ;AN025;) jne $P_CDSQ00 ; 3/17/87
2352;(deleted ;AN025;) mov $P_SorD_Quote,al ; 3/17/87 set bigning w/ double quote
2353;(deleted ;AN025;) ret ; 3/17/87
2354;(deleted ;AN025;) $P_CDSQ00: ; 3/17/87
2355;(deleted ;AN025;) cmp al,$P_SQuote ; 1st char = single quotation ?
2356;(deleted ;AN025;) ret ;
2357;(deleted ;AN025;) $P_Chk_DSQuote endp ;
2358 PAGE ;AN000;
2359;***********************************************************************
2360; $P_Quoted_Str:
2361;
2362; Function: Copy chracacter from ES:BX to psdata_seg:SI until closing single
2363; (double) quotation found.
2364;
2365; Input: psdata_seg:SI -> $P_STRING_BUF
2366; ES:BX -> Operand in command buffer
2367;
2368; Output: CY on indicates EOF encounterd before closing quotation
2369; BX and SI
2370;
2371;
2372; Vars: $P_SorD_Quote(R)
2373;***********************************************************************
2374$P_Quoted_Str proc ;AN000;
2375 push ax ;AN000;
2376$P_Qus_Loop: ;AN000;
2377 mov ax,[bx] ;AN000; 3/17/87
2378 call $P_Chk_EOL ;AN000;
2379 je $P_Qustr_Err0 ;AN000;
2380
2381;(deleted ;AN025;) cmp al,$P_SorD_Quote ;AN000; quotation ? 3/17/87
2382 cmp al,$P_DQuote ;AN025; double quote?
2383 jne $P_Qus00 ;AN000;
2384
2385;(deleted ;AN025;) cmp ah,$P_SorD_Quote ;AN000; contiguous quotation 3/17/87
2386 cmp ah,$P_DQuote ;AN025; double quote?
2387 jne $P_Qus02 ;AN000;
2388
2389;(deleted ;AN025:) mov word ptr psdata_seg:[si],ax ;AN000; 3/17/87
2390 mov byte ptr psdata_seg:[si],al ;AN025; save one of the quotes
2391;(deleted ;AN025:) add si,2 ;AN000;
2392
2393 inc si ;AC035; add '1' to SI reg
2394 ;AN025; adjust target index
2395;(changed ;AC035;) add si,1 ;AN025; adjust target index
2396 inc bx ;AC035; add '2' to
2397 inc bx ;AC035; BX reg
2398 ;AN000; adjust source index by 2 to skip extra quote
2399;(changed ;AC035;) add bx,2 ;AN000; adjust source index by 2 to skip extra quote
2400 jmp short $P_Qus_Loop ;AN000;
2401
2402$P_Qus00: ;AN000;
2403 call $P_Chk_DBCS ;AN000; was it a lead byte of DBCS ?
2404 jnc $P_Qus01 ;AN000;
2405
2406 mov psdata_seg:[si],al ;AN000; store 1st byte
2407 inc si ;AN000;
2408 inc bx ;AN000;
2409 mov al,[bx] ;AN000; load 2nd byte
2410$P_Qus01: ;AN000;
2411 mov psdata_seg:[si],al ;AN000; store SBCS or 2nd byte of DBCS
2412 inc si ;AN000;
2413 inc bx ;AN000;
2414 jmp short $P_Qus_Loop ;AN000;
2415
2416$P_Qustr_Err0: ;AN000;
2417 stc ;AN000; indicate error
2418 jmp short $P_Quoted_Str_Exit ;AN000;
2419
2420$P_Qus02: ;AN000;
2421 mov byte ptr psdata_seg:[si],0 ;AN000;
2422 clc ;AN000; indicate no error
2423$P_Quoted_Str_Exit: ;AN000;
2424 pop ax ;AN000;
2425 ret ;AN000;
2426$P_Quoted_Str endp ;AN000;
2427ENDIF ;AN000;(of QusSW+CmpxSW)
2428PAGE ;AN000;
2429;***********************************************************************
2430IF FileSW+DrvSW ;AN000;(Check if file spec or drive only is supported)
2431; $P_File_Format;
2432;
2433; Function: Check if the input string is valid file spec format.
2434; And set the result buffer.
2435;
2436; Input: psdata_seg:SI -> $P_STRING_BUF
2437; ES:BX -> CONTROL block
2438;
2439; Output: None
2440;
2441; Use: $P_Fill_Result, $P_Chk_DBCS, $P_FileSp_Chk
2442;
2443; Vars: $P_RC(W), $P_SI_Save(W), $P_Terminator(W), $P_SaveSI_Cmpx(R)
2444; $P_SaveSI_Cmpx(R)
2445;***********************************************************************
2446$P_File_Format proc ;AN000;
2447 push ax ;AN000;
2448 push di ;AN000;
2449 push si ;AN000;
2450 mov di,psdata_seg:$P_SaveSI_cmpx ;AC034; get user buffer address
2451$P_FileF_Loop0: ;AN000; / skip special characters
2452 mov al,psdata_seg:[si] ;AN000; load character
2453 or al,al ;AN000; end of line ?
2454 je $P_FileF_Err ;AN000; if yes, error exit
2455
2456 call $P_FileSp_Chk ;AN000; else, check if file special character
2457 jne $P_FileF03 ;AN000; if yes,
2458
2459;AN033; deleted inc di ;skip
2460;AN033; deleted inc si ; the
2461;AN033; deleted jmp short $P_FileF_Loop0 ; character
2462 mov psdata_seg:$P_err_flag,$P_error_filespec ;AN033;AC034;; set error flag- bad char.
2463 pop si ;AN033;
2464 mov byte ptr psdata_seg:[si],$P_NULL ;AN033;
2465 pop di ;AN033;
2466 jmp short $P_FileF02 ;AN033;
2467
2468
2469$P_FileF_Err: ;AN000;
2470 pop si ;AN000;
2471 mov byte ptr psdata_seg:[si],$P_NULL ;AN000;
2472;(deleted ;AN030;) mov di,$P_SaveSI_cmpx ;AN000; get user buffer address
2473;(deleted ;AN030;) mov $P_SI_Save,di ;AN000; update pointer to user buffer
2474 pop di ;AN000;
2475 test es:[bx].$P_Match_Flag,$P_Optional ;AN000; is it optional ?
2476 jne $P_FileF02 ;AN000;
2477
2478 mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; 3/17/87
2479 jmp short $P_FileF02 ;AN000;
2480
2481$P_FileF03: ;AN000;
2482 pop ax ;AN000; discard save si
2483 push si ;AN000; save new si
2484$P_FileF_Loop1: ;AN000;
2485 mov al,psdata_seg:[si] ;AN000; load character (not special char)
2486 or al,al ;AN000; end of line ?
2487 je $P_FileF_RLT ;AN000;
2488
2489 call $P_FileSp_Chk ;AN000; File special character ?
2490 je $P_FileF00 ;AN000;
2491
2492 call $P_Chk_DBCS ;AN000; no, then DBCS ?
2493 jnc $P_FileF01 ;AN000;
2494 inc di ;AN000; if yes, skip next byte
2495 inc si ;AN000;
2496$P_FileF01: ;AN000;
2497 inc di ;AN000;
2498 inc si ;AN000;
2499 jmp short $P_FileF_Loop1 ;AN000;
2500;
2501$P_FileF00: ;AN000;
2502 mov psdata_seg:$P_Terminator,al ;AC034;
2503 mov byte ptr psdata_seg:[si],$P_NULL ;AN000; update end of string
2504 inc di ;AN000;
2505 mov psdata_seg:$P_SI_Save,di ;AC034; update next pointer in command line
2506$P_FileF_RLT: ;AN000;
2507 pop si ;AN000;
2508 pop di ;AN000;
2509$P_FileF02: ;AN000;
2510
2511 pop ax ;AN000; (tm14)
2512 test ax,$P_File_Spc ;AN000; (tm14)
2513 je $P_Drv_Only_Exit ;AN000; (tm14)
2514
2515 push ax ;AN000; (tm14)
2516
2517 mov ah,$P_No_Tag ;AN000; set
2518 mov al,$P_File_Spec ;AN000; result
2519 call $P_Fill_Result ;AN000; buffer to file spec
2520 pop ax ;AN000;
2521
2522$P_Drv_Only_Exit: ;AN000; (tm14)
2523
2524 ret ;AN000;
2525$P_File_Format endp ;AN000;
2526PAGE ;AN000;
2527;***********************************************************************
2528; $P_FileSp_Chk
2529;
2530; Function: Check if the input byte is one of file special characters
2531;
2532; Input: psdata_seg:SI -> $P_STRING_BUF
2533; AL = character code to be examineed
2534;
2535; Output: ZF = 1 , AL is one of special characters
2536;***********************************************************************
2537$P_FileSp_Chk proc ;AN000;
2538 push bx ;AN000;
2539 push cx ;AN000;
2540 lea bx,psdata_seg:$P_FileSp_Char ;AC034; special character table
2541 mov cx,$P_FileSp_Len ;AN000; load length of it
2542$P_FileSp_Loop: ;AN000;
2543 cmp al,psdata_seg:[bx] ;AN000; is it one of special character ?
2544 je $P_FileSp_Exit ;AN000;
2545
2546 inc bx ;AN000;
2547 loop $P_FileSp_Loop ;AN000;
2548
2549 inc cx ;AN000; reset ZF
2550$P_FileSp_Exit: ;AN000;
2551 pop cx ;AN000;
2552 pop bx ;AN000;
2553 ret ;AN000;
2554$P_FileSp_Chk endp ;AN000;
2555ENDIF ;AN000;(of FileSW+DrvSW)
2556PAGE ;AN000;
2557;***********************************************************************
2558IF DrvSW ;AN000;(Check if drive only is supported)
2559; $P_Drive_Format;
2560;
2561; Function: Check if the input string is valid drive only format.
2562; And set the result buffer.
2563;
2564; Input: psdata_seg:SI -> $P_STRING_BUF
2565; ES:BX -> CONTROL block
2566;
2567; Output: None
2568;
2569; Use: $P_Fill_Result, $P_Chk_DBCS
2570;
2571; Vars: $P_RC(W)
2572;***********************************************************************
2573$P_Drive_Format proc ;AN000;
2574 push ax ;AN000;
2575 push dx ;AN000;
2576 mov al,psdata_seg:[si] ;AN000;
2577 or al,al ;AN000; if null string
2578 je $P_Drv_Exit ;AN000; do nothing
2579
2580 call $P_Chk_DBCS ;AN000; is it leading byte ?
2581 jc $P_Drv_Err ;AN000;
2582
2583 cmp word ptr psdata_seg:[si+byte],$P_Colon ;AN000; "d", ":", 0 ?
2584 je $P_DrvF00 ;AN000;
2585
2586 test es:[bx].$P_Match_Flag,$P_Ig_Colon ;AN000; colon can be ignored?
2587 je $P_Drv_Err ;AN000;
2588
2589 cmp byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; "d", 0 ?
2590 jne $P_Drv_Err ;AN000;
2591
2592$P_DrvF00: ;AN000;
2593 or al,$P_Make_Lower ;AN000; lower case
2594 cmp al,"a" ;AN000; drive letter must
2595 jb $P_Drv_Err ;AN000; in range of
2596
2597 cmp al,"z" ;AN000; "a" - "z"
2598 ja $P_Drv_Err ;AN000; if no, error
2599
2600 sub al,"a"-1 ;AN000; make text drive to binary drive
2601 mov dl,al ;AN000; set
2602 mov ah,$P_No_Tag ;AN000; result
2603 mov al,$P_Drive ;AN000; buffer
2604 call $P_Fill_Result ;AN000; to drive
2605 jmp short $P_Drv_Exit ;AN000;
2606
2607$P_Drv_Err: ;AN000;
2608 mov psdata_seg:$P_RC,$P_Syntax ;AC034;
2609$P_Drv_Exit: ;AN000;
2610 pop dx ;AN000;
2611 pop ax ;AN000;
2612 ret ;AN000;
2613$P_Drive_Format endp ;AN000;
2614ENDIF ;AN000;(of DrvSW)
2615PAGE ;AN000;
2616;***********************************************************************
2617; $P_Skip_Delim;
2618;
2619; Function: Skip delimiters specified in the PARMS list, white space
2620; and comma.
2621;
2622; Input: DS:SI -> Command String
2623; ES:DI -> Parameter List
2624;
2625; Output: CY = 1 if the end of line encounterd
2626; CY = 0 then SI move to 1st non-delimiter character
2627; AL = Last examineed character
2628;
2629; Use: $P_Chk_EOL, $P_Chk_Delim,
2630;
2631; Vars: $P_Flags(R)
2632;***********************************************************************
2633$P_Skip_Delim proc ;AN000;
2634$P_Skip_Delim_Loop: ;AN000;
2635 LODSB ;AN000;
2636 call $P_Chk_EOL ;AN000; is it EOL character ?
2637 je $P_Skip_Delim_CY ;AN000; if yes, exit w/ CY on
2638
2639 call $P_Chk_Delim ;AN000; is it one of delimiters ?
2640 jne $P_Skip_Delim_NCY ;AN000; if no, exit w/ CY off
2641
2642 test psdata_seg:$P_Flags2,$P_Extra ;AC034; extra delim or comma found ?
2643 je $P_Skip_Delim_Loop ;AN000; if no, loop
2644
2645 test psdata_seg:$P_Flags2,$P_SW+$P_equ ;AC034; /x , or xxx=zzz , (tm08)
2646 je short $P_Exit_At_Extra ;AN000; no switch, no keyword (tm08)
2647
2648 dec si ;AN000; backup si for next call (tm08)
2649 jmp short $P_Exit_At_Extra ;AN000; else exit w/ CY off
2650
2651$P_Skip_Delim_CY: ;AN000;
2652 stc ;AN000; indicate EOL
2653 jmp short $P_Skip_Delim_Exit ;AN000;
2654
2655$P_Skip_Delim_NCY: ;AN000;
2656 clc ;AN000; indicate non delim
2657$P_Skip_Delim_Exit: ;AN000; in this case, need
2658 dec si ;AN000; backup index pointer
2659 ret ;AN000;
2660
2661$P_Exit_At_Extra: ;AN000;
2662 clc ;AN000; indicate extra delim
2663 ret ;AN000;
2664$P_Skip_Delim endp ;AN000;
2665PAGE ;AN000;
2666;***********************************************************************
2667; $P_Chk_EOL;
2668;
2669; Function: Check if AL is one of End of Line characters.
2670;
2671; Input: AL = character code
2672; ES:DI -> Parameter List
2673;
2674; Output: ZF = 1 if one of End of Line characters
2675;**********************************************************************
2676$P_Chk_EOL proc ;AN000;
2677 push bx ;AN000;
2678 push cx ;AN000;
2679 cmp al,$P_CR ;AN000; Carriage return ?
2680 je $P_Chk_EOL_Exit ;AN000;
2681
2682 cmp al,$P_NULL ;AN000; zero ?
2683 je $P_Chk_EOL_Exit ;AN000;
2684
2685IF LFEOLSW ;AN028; IF LF TO BE ACCEPTED AS EOL
2686 cmp al,$P_LF ;AN000; Line feed ?
2687 je $P_Chk_EOL_Exit ;AN000;
2688ENDIF ;AN028;
2689
2690 cmp byte ptr es:[di].$P_Num_Extra,$P_I_Have_EOL ;AN000; EOL character specified ?
2691 jb $P_Chk_EOL_Exit ;AN000;
2692
2693 xor bx,bx ;AN000;
2694 mov bl,es:[di].$P_Len_Extra_Delim ;AN000; get length of delimiter list
2695 add bx,$P_Len_PARMS ;AN000; skip it
2696 cmp byte ptr es:[bx+di],$P_I_Use_Default ;AN000; No extra EOL character ?
2697 je $P_Chk_EOL_NZ ;AN000;
2698
2699 xor cx,cx ;AN000; Get number of extra chcracter
2700 mov cl,es:[bx+di] ;AN000;
2701$P_Chk_EOL_Loop: ;AN000;
2702 inc bx ;AN000;
2703 cmp al,es:[bx+di] ;AN000; Check extra EOL character
2704 je $P_Chk_EOL_Exit ;AN000;
2705
2706 loop $P_Chk_EOL_Loop ;AN000;
2707
2708$P_Chk_EOL_NZ: ;AN000;
2709 cmp al,$P_CR ;AN000; reset ZF
2710$P_Chk_EOL_Exit: ;AN000;
2711 pop cx ;AN000;
2712 pop bx ;AN000;
2713 ret ;AN000;
2714$P_Chk_EOL endp ;AN000;
2715PAGE ;AN000;
2716;***********************************************************************
2717; $P_Chk_Delim;
2718;
2719; Function: Check if AL is one of delimiter characters.
2720; if AL+[si] is DBCS blank, it is replaced with two SBCS
2721; blanks.
2722;
2723; Input: AL = character code
2724; DS:SI -> Next Character
2725; ES:DI -> Parameter List
2726;
2727; Output: ZF = 1 if one of delimiter characters
2728; SI points to the next character
2729; Vars: $P_Terminator(W), $P_Flags(W)
2730;***********************************************************************
2731$P_Chk_Delim proc ;AN000;
2732 push bx ;AN000;
2733 push cx ;AN000;
2734 mov psdata_seg:$P_Terminator,$P_Space ;AC034; Assume terminated by space
2735 and psdata_seg:$P_Flags2,0ffh-$P_Extra ;AC034;
2736 cmp al,$P_Space ;AN000; Space ?
2737 je $P_Chk_Delim_Exit ;AN000;
2738
2739 cmp al,$P_TAB ;AN000; TAB ?
2740 je $P_Chk_Delim_Exit ;AN000;
2741
2742 cmp al,$P_Comma ;AN000; Comma ?
2743 je $P_Chk_Delim_Exit0 ;AN000;
2744
2745$P_Chk_Delim00: ;AN000;
2746 cmp al,$P_DBSP1 ;AN000; 1st byte of DBCS Space ?
2747 jne $P_Chk_Delim01 ;AN000;
2748
2749 cmp byte ptr [si],$P_DBSP2 ;AN000; 2nd byte of DBCS Space ?
2750 jne $P_Chk_Delim01 ;AN000;
2751
2752 mov al,$P_Space ;AN000;
2753 inc si ;AN000; make si point to next character
2754 cmp al,al ;AN000; Set ZF
2755 jmp short $P_Chk_Delim_Exit ;AN000;
2756
2757$P_Chk_Delim01: ;AN000;
2758 cmp byte ptr es:[di].$P_Num_Extra,$P_I_Have_Delim ;AN000; delimiter character specified ?
2759 jb $P_Chk_Delim_Exit ;AN000;
2760
2761 xor cx,cx ;AN000;
2762 mov cl,es:[di].$P_Len_Extra_Delim ;AN000; get length of delimiter list
2763 or cx,cx ;AN000; No extra Delim character ?
2764 je $P_Chk_Delim_NZ ;AN000;
2765
2766 mov bx,$P_Len_PARMS-1 ;AN000; set bx to 1st extra delimiter
2767$P_Chk_Delim_Loop: ;AN000;
2768 inc bx ;AN000;
2769 cmp al,es:[bx+di] ;AN000; Check extra Delim character
2770 je $P_Chk_Delim_Exit0 ;AN000;
2771
2772 loop $P_Chk_Delim_Loop ;AN000; examine all extra delimiter
2773
2774$P_Chk_Delim_NZ: ;AN000;
2775 cmp al,$P_Space ;AN000; reset ZF
2776$P_Chk_Delim_Exit: ;AN000;
2777;;;; jne $P_ChkDfin
2778;;;; mov psdata_seg:$P_Terminator,al ;AN034;
2779$P_ChkDfin: ;AN000;
2780 pop cx ;AN000;
2781 pop bx ;AN000;
2782 ret ;AN000;
2783
2784$P_Chk_Delim_Exit0: ;AN000;
2785 mov psdata_seg:$P_Terminator,al ;AC034; keep terminated delimiter
2786 test psdata_seg:$P_Flags2,$P_Equ ;AN027;AC034;; if terminating a key=
2787 jnz $P_No_Set_Extra ;AN027; then do not set the EXTRA bit
2788
2789 or psdata_seg:$P_Flags2,$P_Extra ;AC034; flag terminated extra delimiter or comma
2790$P_No_Set_Extra: ;AN027;
2791 cmp al,al ;AN000; set ZF
2792 jmp short $P_Chk_Delim_Exit ;AN000;
2793
2794$P_Chk_Delim endp ;AN000;
2795PAGE ;AN000;
2796;***********************************************************************
2797; $P_Chk_Switch;
2798;
2799; Function: Check if AL is the switch character not in first position of
2800; $P_STRING_BUF
2801;
2802; Input: AL = character code
2803; BX = current pointer within $P_String_Buf
2804; SI =>next char on command line (following the one in AL)
2805;
2806; Output: CF = 1 (set)if AL is switch character, and not in first
2807; position, and has no chance of being part of a date string,
2808; i.e. should be treated as a delimiter.
2809
2810; CF = 0 (reset, cleared) if AL is not a switch char, is in the first
2811; position, or is a slash but may be part of a date string, i.e.
2812; should not be treated as a delimiter.
2813;
2814; Vars: $P_Terminator(W)
2815
2816; Use: $P_0099
2817;***********************************************************************
2818$P_Chk_Switch proc ;AN000;
2819
2820;AN020;; Function: Check if AL is the switch character from 2nd position of $P_STRING_BUF
2821;AN020;; Output: ZF = 1 if switch character
2822;AN020;; lea bp,$P_STRING_BUF ;AN000;
2823;AN020;; cmp bx,bp ;AN000; 1st position ?
2824;AN020;; je $P_Chk_S_Exit_1 ;AN000;
2825;AN020;; cmp al,$P_Switch ;AN000;
2826;AN020;; jmp short $P_Chk_S_Exit_0 ;AN000;
2827;AN020;;$P_Chk_S_Exit_1: ;AN000;
2828;AN020;; cmp al,$P_Switch ;AN000; (tm08)
2829;AN020;; jne $P_Nop ;AN000; (tm08)
2830;AN020;; or $P_Flags2,$P_SW ;AN000; (tm08) It could be valid switch
2831;AN020;;$P_Nop: ;AN000; (tm08)
2832;AN020;; inc bp ;AN000;
2833;AN020;; cmp bx,bp ;AN000; reset ZF
2834;AN020;;$P_Chk_S_Exit_0: ;AN000;
2835;AN020;; jne $P_Chk_S_Exit ;AN000;
2836;AN020;; mov $P_Terminator,al ;AN000; store switch character
2837;AN020;;$P_Chk_S_Exit: ;AN000;
2838
2839 LEA BP,psdata_seg:$P_String_Buf ;AN020;AC034; BP=OFFSET of $P_String_Buf even in group addressing
2840; .IF <BX NE BP> THEN ;AN020;IF not first char THEN
2841 cmp BX,BP ;AN000;
2842 je $P_STRUC_L2 ;AN000;
2843
2844; .IF <AL EQ $P_Switch> THEN ;AN020;otherwise see if a slash
2845 cmp AL,$P_Switch ;AN000;
2846 jne $P_STRUC_L5 ;AN000;
2847
2848 STC ;AN020;not in first position and is slash, now see if might be in date string
2849IF DateSw ;AN020;caller looking for date, see if this may be part of one
2850 PUSH AX ;AN020;save input char
2851 MOV AL,PSDATA_SEG:[BX-1] ;AN026;AL=char before the current char
2852 CALL $P_0099 ;AN020;return carry set if not numeric
2853; .IF NC ;AND ;AN020;IF previous char numeric AND
2854 jc $P_STRUC_L7 ;AN000;
2855
2856 MOV AL,[SI] ;AN020;AL=char after the current char
2857 CALL $P_0099 ;AN020;return carry set if not numeric
2858;(deleted) .IF NC THEN ;AN020;IF next char numeric THEN could be a date
2859;(deleted) CLC ;AN020;reset CF so "/" not treated as a delimiter
2860;(deleted) .ENDIF ;AN026;
2861; .ENDIF ;AN020;ENDIF looks like date (number/number)
2862$P_STRUC_L7: ;AN000;
2863 POP AX ;AN020;restore AL to input char
2864ENDIF ;AN020;DateSw
2865; .ELSE ;AN020;
2866 jmp short $P_STRUC_L1 ;AN000;
2867
2868$P_STRUC_L5: ;AN000;
2869 CLC ;AN020;not a slash
2870; .ENDIF ;AN020;
2871; .ELSE ;AN020;is first char in the buffer, ZF=0
2872 jmp short $P_STRUC_L1 ;AN000;
2873
2874$P_STRUC_L2: ;AN000;
2875; .IF <AL EQ $P_Switch> THEN ;AN020;
2876 cmp AL,$P_Switch ;AN000;
2877 jne $P_STRUC_L12 ;AN000;
2878
2879 OR psdata_seg:$P_Flags2,$P_SW ;AN020;AC034;;could be valid switch, first char and is slash
2880; .ENDIF ;AN020;
2881$P_STRUC_L12: ;AN000;
2882 CLC ;AN020;CF=0 indicating first char
2883; .ENDIF ;AN020;
2884$P_STRUC_L1: ;AN000;
2885
2886 ret ;AN000;
2887$P_Chk_Switch endp ;AN000;
2888 PAGE ;AN000;
2889;**************************************************************************
2890; $P_Chk_DBCS:
2891;
2892; Function: Check if a specified byte is in ranges of the DBCS lead bytes
2893;
2894; Input:
2895; AL = Code to be examineed
2896;
2897; Output:
2898; If CF is on then a lead byte of DBCS
2899;
2900; Use: INT 21h w/AH=63
2901;
2902; Vars: $P_DBCSEV_Seg(RW), $P_DBCSEV_Off(RW)
2903;***************************************************************************
2904$P_Chk_DBCS PROC ;AN000;
2905;
2906 PUSH DS ;AN000;
2907 PUSH SI ;AN000;
2908 PUSH bx ;AN000; (tm11)
2909 CMP psdata_seg:$P_DBCSEV_SEG,0 ;AC034; ALREADY SET ?
2910 JNE $P_DBCS00 ;AN000;
2911
2912 PUSH AX ;AN000;
2913; PUSH BX ;AN000; (tm11)
2914 PUSH ds ;AN000; (tm11)
2915 PUSH CX ;AN000;
2916 PUSH DX ;AN000;
2917 PUSH DI ;AN000;
2918 PUSH BP ;AN000;
2919 PUSH ES ;AN000;
2920 XOR SI,SI ;AN000;
2921 MOV DS,SI ;AN000;
2922 MOV AX,$P_DOS_GetEV ;AN000; GET DBCS EV CALL
2923 INT 21H ;AN000;
2924
2925; MOV AX,DS ;AN000; (tm11)
2926; OR AX,AX ;AN000; (tm11)
2927 MOV bx,DS ;AN000; (tm11)
2928 OR bx,bx ;AN000; (tm11)
2929 POP ES ;AN000;
2930 POP BP ;AN000;
2931 POP DI ;AN000;
2932 POP DX ;AN000;
2933 POP CX ;AN000;
2934; POP BX ;AN000; (tm11)
2935 POP ds ;AN000; (tm11)
2936 POP AX ;AN000;
2937 JE $P_NON_DBCS ;AN000;
2938
2939$P_DBCS02: ;AN000;
2940 MOV psdata_seg:$P_DBCSEV_OFF,SI ;AC034; save EV offset
2941; MOV psdata_seg:$P_DBCSEV_SEG,DS ;AC034; save EV segment
2942 MOV psdata_seg:$P_DBCSEV_SEG,bx ;AC034; save EV segment (tm11)
2943$P_DBCS00: ;AN000;
2944 MOV SI,psdata_seg:$P_DBCSEV_OFF ;AC034; load EV offset
2945 MOV DS,psdata_seg:$P_DBCSEV_SEG ;AC034; and segment
2946
2947$P_DBCS_LOOP: ;AN000;
2948 CMP WORD PTR [SI],0 ;AN000; zero vector ?
2949 JE $P_NON_DBCS ;AN000; then exit
2950
2951 CMP AL,[SI] ;AN000;
2952 JB $P_DBCS01 ;AN000; Check if AL is in
2953
2954 CMP AL,[SI+BYTE] ;AN000; range of
2955 JA $P_DBCS01 ;AN000; the vector
2956
2957 STC ;AN000; if yes, indicate DBCS and exit
2958 JMP short $P_DBCS_EXIT ;AN000;
2959
2960$P_DBCS01: ;AN000;
2961 INC SI ;AC035; add '2' to
2962 INC SI ;AC035; SI reg
2963 ;AN000; get next vector
2964;(changed ;AC035;) ADD SI,2 ;AN000; get next vector
2965 JMP short $P_DBCS_LOOP ;AN000; loop until zero vector found
2966
2967$P_NON_DBCS: ;AN000;
2968 CLC ;AN000; indicate SBCS
2969$P_DBCS_EXIT: ;AN000;
2970 POP bx ;AN000; (tm11)
2971 POP SI ;AN000;
2972 POP DS ;AN000;
2973 RET ;AN000;
2974$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 @@
1;;***********************************************************************
2;; NAME: pathlabl
3;; DESC: creates a public label at the spot it is placed, using the name
4;; given.
5;; INPUT: either module name or procedure name
6;; OUTPUT: public label
7;; LOGIC: LBL-parameter-name will have four values -
8;; - one for each pass (2)
9;; - one for start and one for stop
10;; if LBL is not defined, it is first pass, at beginning label
11;; - set it to 1 and create the start label
12;; if LBL = 1, it is first pass, at end label
13;; - set it to 2 and create stop label
14;; if LBL = 2, it is second pass, at beginning label
15;; - set it to 3 and create the start label
16;; if LBL = 3, it is second pass, at end label
17;; - set it to 4 and create stop label
18;; if LBL = 4, it is second pass,
19;; - this macro has been invoked more than twice with same parm
20;; - issue error message
21;;***********************************************************************
22IF1
23 %OUT COMPONENT=COMMON, MODULE=PATHMAC.INC ...
24ENDIF
25
26pathlabl MACRO pnam
27IFNDEF LBL_&pnam ;;IF THIS IS THE FIRST TIME,
28 LBL_&pnam = 0 ;;DEFINE IT, INITIALLY ZERO
29ELSE ;;SINCE IT IS DEFINED
30 IF (LBL_&pnam GT 3) ;;IF USED TOO MANY TIMES,
31 .ERR NON-UNIQUE OPERAND ON PATHLABL
32 EXITM ;;ABORT THIS GENERATION
33 ENDIF
34ENDIF
35
36IF (LBL_&pnam EQ 0) OR (LBL_&pnam EQ 2) ;;ready for START?
37 $$A_START_&pnam: ;;create START label
38 PUBLIC $$A_START_&pnam ;;make it public
39ELSE ;;SINCE SWITCH MAY BE 1 OR 3,
40 $$A_STOP_&pnam: ;;create STOP label
41 PUBLIC $$A_STOP_&pnam ;;make it public
42ENDIF
43LBL_&pnam = LBL_&pnam + 1 ;;INCREMENT SWITCH
44ENDM
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 @@
1
2;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B
3; CONDITIONAL ASSEMBLY CONTROLS
4;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B
5WINTHORN EQU 1 ;OS/2 compatible
6
7;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B
8; VIDEO REGISTER PORT ADDRESS EQUATES =B
9; =B
10;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B
11seq_addr EQU 0C4H ;Sequencer Address =B
12seq_data EQU 0C5H ;Sequencer Data =B
13crtc_addr EQU 0D4H ;CRT Controller Address (Color) =B
14crtc_addr_b EQU 0B4H ;CRT Controller Address (Mono) =B
15crtc_data EQU 0D5H ;CRT Controller Data =B
16graph_1_pos EQU 0CCH ;Graphics 1 Position =B
17graph_2_pos EQU 0CAH ;Graphics 2 Position =B
18graph_addr EQU 0CEH ;Graphics 1 & 2 Address =B
19graph_data EQU 0CFH ;Graphics 1 & 2 Data =B
20misc_output EQU 0C2H ;Miscellaneous Output =B
21misc_read EQU 0CCH ;Miscellaneous Output Read Port Address =B
22in_stat_0 EQU 0C2H ;Input Status Register 0 =B
23input_status_b EQU 0BAH ;Feature Control (Mono) =B
24input_status EQU 0DAH ;Feature Control (Color) =B
25attr_read EQU 0C1H ;Attribute Controller Read Address =B
26attr_write EQU 0C0H ;Attribute Controller Write Address =B
27fctrl_read EQU 0CAH ;Feature Control Regiester Read Address =B
28
29;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
30; SEQUENCER ADDRESS REGISTER EQUATES
31;
32;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
33s_reset EQU 00H ;Reset =B
34s_clock EQU 01H ;Clocking Mode =B
35s_map EQU 02H ;Map Mask =B
36s_cgen EQU 03H ;Character Map Select =B
37s_mem EQU 04H ;Memory Mode =B
38
39
40;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
41; GRAPHICS ADDRESS REGISTER EQUATES
42;
43;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
44g_set_reset EQU 00H ;set/reset =B
45g_enbl_set EQU 01H ;enable set/reset =B
46g_clr_comp EQU 02H ;color compare =B
47g_data_rot EQU 03H ;data rotate =B
48g_read_map EQU 04H ;read map select =B
49g_mode EQU 05H ;mode =B
50g_misc EQU 06H ;miscellaneous =B
51g_color EQU 07H ;color don't care =B
52g_bit_mask EQU 08H ;bit mask =B
53
54;---------------------------------------------------------------------+
55; |
56; Miscellaneous Equates |
57; |
58;---------------------------------------------------------------------+
59
60LINELEN EQU 80 ; Length of a Graphics Buffer Line
61COLPELS EQU 8 ; Number of pels per text column
62;DEFROFFU EQU 1 ; Default Pointer Icon Row Center Offset
63;DEFROFFD EQU 14 ; Default Pointer Icon Row Center Offset
64;DEFCOFFR EQU 11 ; Default Pointer Icon Column Center Offst
65;DEFCOFFL EQU 4 ; Default Pointer Icon Column Center Offst
66;ICONROWS EQU 16 ; Number of Rows in Pointer Icon
67;M_WHITE EQU 15 ;default foreground color (icon)
68;M_DAXIS EQU 11 ;default axis mouse pointer
69
70DEFROFFU EQU 1 ; Default Pointer Icon Row Center Offset
71DEFROFFD EQU 14 ; Default Pointer Icon Row Center Offset
72DEFCOFFR EQU 14 ; Default Pointer Icon Column Center Offst
73DEFCOFFL EQU 2 ; Default Pointer Icon Column Center Offst
74ICONROWS EQU 20 ; Number of Rows in Pointer Icon
75M_DAXIS EQU 800 ;default axis mouse pointer
76
77ICONCOLS EQU 16 ; Number of Columns in Pointer Icon
78SHFTMSK EQU 07H ; Column Shift Count Bit Mask (Hi-Res)
79M_BLACK EQU 0 ;default background color (icon)
80M_WHITE EQU 15 ;default foreground color (icon)
81VSICONR EQU 28 ;# pel rows
82VSICONC EQU 2*8 ;# pel columns
83MVSICONR EQU 16 ;minimun pel rows in sb icon
84MHSICONC EQU 3*8 ;minimum pel cols in sb icon
85
86;;
87;; Long Conditional Jump Macros
88;;
89lja macro Farlabel
90 local Nearlabel
91 jna Nearlabel
92 jmp Farlabel
93Nearlabel:
94 endm
95ljae macro Farlabel
96 local Nearlabel
97 jnae Nearlabel
98 jmp Farlabel
99Nearlabel:
100 endm
101ljb macro Farlabel
102 local Nearlabel
103 jnb Nearlabel
104 jmp Farlabel
105Nearlabel:
106 endm
107ljc macro Farlabel
108 local Nearlabel
109 jnc Nearlabel
110 jmp Farlabel
111Nearlabel:
112 endm
113ljbe macro Farlabel
114 local Nearlabel
115 jnbe Nearlabel
116 jmp Farlabel
117Nearlabel:
118 endm
119lje macro Farlabel
120 local Nearlabel
121 jne Nearlabel
122 jmp Farlabel
123Nearlabel:
124 endm
125ljz macro Farlabel
126 local Nearlabel
127 jnz Nearlabel
128 jmp Farlabel
129Nearlabel:
130 endm
131ljg macro Farlabel
132 local Nearlabel
133 jng Nearlabel
134 jmp Farlabel
135Nearlabel:
136 endm
137ljge macro Farlabel
138 local Nearlabel
139 jnge Nearlabel
140 jmp Farlabel
141Nearlabel:
142 endm
143ljl macro Farlabel
144 local Nearlabel
145 jnl Nearlabel
146 jmp Farlabel
147Nearlabel:
148 endm
149ljle macro Farlabel
150 local Nearlabel
151 jnle Nearlabel
152 jmp Farlabel
153Nearlabel:
154 endm
155ljnc macro Farlabel
156 local Nearlabel
157 jc Nearlabel
158 jmp Farlabel
159Nearlabel:
160 endm
161ljne macro Farlabel
162 local Nearlabel
163 je Nearlabel
164 jmp Farlabel
165Nearlabel:
166 endm
167ljnz macro Farlabel
168 local Nearlabel
169 jz Nearlabel
170 jmp Farlabel
171Nearlabel:
172 endm
173ljno macro Farlabel
174 local Nearlabel
175 jo Nearlabel
176 jmp Farlabel
177Nearlabel:
178 endm
179ljo macro Farlabel
180 local Nearlabel
181 jno Nearlabel
182 jmp Farlabel
183Nearlabel:
184 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 @@
1;
2PAGE
3;-----------------------------------------------------------------------------+
4; :
5; Source...: PCINPUT.INC :
6; Created..: 01-01-82 :
7; Standards: 01-07-86 :
8; Revised..: 11-17-87 :
9; Version..: PC DOS :
10; Called as: FAR, NEAR or INT :
11; Public as: INPUT :
12; :
13;-----------------------------------------------------------------------------+
14;
15PAGE
16;-----------------------------------------------------------------------------+
17; :
18; DEFAULT :
19; :
20; Performs the following functions: :
21; :
22; - Initializes pointers and counters :
23; - Initializes input buffer with default value (from screen or strg) :
24; - Set options and display input buffer as default on screen :
25; - Display field delimiters :
26; - Display minus or plus sign :
27; :
28; :
29; Entry: ES:SI = Points to current ICB :
30; DS:DI = Points to PB :
31; :
32; WR_CURSIZE = Current cursor size :
33; :
34; Exit: Default displayed :
35; :
36;-----------------------------------------------------------------------------+
37;
38DEFAULT PROC NEAR
39;
40; Initialize input buffer with default buffer
41;
42 PUSH BP
43 PUSH ES ;save registers
44 PUSH DS
45 PUSH DI
46 PUSH SI
47;
48 MOV DX,ES:[SI]+ICB_FIELDLEN ;save for later ;=W
49 MOV BX,ES:[SI]+ICB_DEFLEN ;save for later ;=W
50;
51 MOV AX,ES:[SI]+ICB_DEFSEG ;get source string segment ;=W
52 MOV DS,AX ;=W
53;
54 MOV AX,ES:[SI]+ICB_FIELDOFF ;get destination offset ;=W
55 MOV DI,AX ;=W
56;
57 MOV AX,ES:[SI]+ICB_FIELDSEG ;get destination segment ;=W
58 MOV CX,ES:[SI]+ICB_DEFOFF ;get source string offset ;=W
59 MOV SI,CX ;=W
60 MOV ES,AX ;=W
61;
62 PUSH DI
63 MOV CX,DX ;clear input buffer ;=W
64 MOV AL,WR_SPACE ;=W
65 CLD ;=W
66 REP STOSB ;=W
67 POP DI
68; ;=W
69 MOV BP,0
70 MOV CX,BX ;initialize number of bytes in ;=W
71 ; default string
72 CMP CX,DX ;check if default string is
73 JBE DEF10 ; longer than input buffer
74;
75 MOV CX,DX ;error set to input buffer leng
76 MOV BP,ICB_STRU ;set error indicating default was
77 ; truncated
78DEF10:
79 CLD
80 REP MOVSB ;move default into input buffer
81;
82 POP SI ;restore registers
83 POP DI
84 POP DS
85 POP ES
86;
87 OR ES:[SI]+ICB_STATUS,BP ;save error status
88 POP BP
89;
90; Calculate row and column of input field and set the desired display attribute
91;
92 MOV AX,ES:[SI]+ICB_ROW ;get input field row
93 MOV [DI]+CR_ROW,AX
94;
95 MOV AX,ES:[SI]+ICB_COL ;get input field column
96 MOV [DI]+CR_COL,AX
97;
98 CALL PCROWCL_CALL ;calculate row and column info
99 ; return CR_RCOFF and CR_BEGROWOFF
100 MOV AL,[DI]+WR_EATTR ;set the entry attribute to the
101 MOV [DI]+WR_CATTR,AL ; current attribute
102;
103; Initialize variables for left justified field
104;
105 TEST ES:[SI]+ICB_OPT1,ICB_RJU ;check if right justified
106 JNE DEF20
107;
108 MOV [DI]+WR_LEFTCHAR,1 ;set left character marker to
109 ;beginning of input field
110 MOV AX,ES:[SI]+ICB_FIELDLEN ;get max field length ;=W
111;
112 TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if horizontal scrolling ;=W
113 JE DEF15 ;no ;=W
114 MOV AX,ES:[SI]+ICB_WIDTH ;get field width for horizontal scrolling ;=W
115 ;because we only show a windowful of field ;=W
116DEF15: ;=W
117 MOV [DI]+WR_RIGHTCHAR,AX ;set ptr to rightmost character ;=W
118 CALL CAL_COORS ;get end of field char, byte ;=W
119 JMP DEF30 ;and next byte positions
120;
121; Initialize variables for right justified field
122;
123DEF20: ;
124 ; code here
125 ;
126;
127; Display default even if password option is active
128;
129DEF30: PUSH ES:[SI]+ICB_OPT1 ;save option word
130;
131 TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active
132 JE DEF40
133;
134 AND ES:[SI]+ICB_OPT1,NOT ICB_PSW
135 ;set option word to force disp
136 ; of default value
137DEF40:
138 MOV AX,2 ;set option to actually display
139 CALL WORD PTR [DI]+WR_DISPLAY ; default value in proper
140 ; justification
141 POP ES:[SI]+ICB_OPT1 ;restore original password
142;
143; Display initial cursor in proper size and location
144;
145 MOV AX,[DI]+IN_CURNOR ;set cursor size for replace
146 MOV [DI]+WR_CURSIZE,AX
147;
148 TEST ES:[SI]+ICB_STATUS,ICB_SINS
149 JE DEF45 ;check if insert is active
150;
151 MOV AX,[DI]+IN_CURINS ;set cursor size for insert
152 MOV [DI]+WR_CURSIZE,AX
153;
154DEF45:
155 CALL CAL_COORS ;calculate coordinates ;=W
156 CALL CURSOR ;initialize cursor size and locat
157;
158; Determine if characters in input buffer are allowonce chars and set flags
159;
160
161 jmp Def65 ;temp until bug in allowonce scan fixed
162
163 PUSH ES ;save registers
164 PUSH SI
165;
166 MOV BX,ES ;set segment of ICB
167 MOV DX,SI ;set offset of ICB
168;
169 MOV CX,ES:[SI]+ICB_FIELDLEN ;get field length
170;
171 PUSH ES:[SI]+ICB_FIELDOFF ;get field offset
172 PUSH ES:[SI]+ICB_FIELDSEG ;get field segment
173 POP ES
174 POP SI
175;
176DEF50: MOV AL,ES:[SI] ;get character from input buffer
177 MOV [DI]+DBC_KS,AL ; and set to PCINDBC PB
178;
179 INC SI ;point to next byte
180;
181 CALL PCINDBC_CALL ;call PCINDBC
182
183 TEST [DI]+DBC_STAT,DBC_DBCS ;check if keystroke double byte
184 JE DEF60
185;
186 CMP CX,0 ;if last loop is double character
187 JBE DEF60 ; and is missing trailing byte
188 ; then, consider a single byte
189;
190 MOV AH,ES:[SI] ;get character from input buffer
191 MOV [DI]+DBC_KS,AH ; and set to PCINDBC PB
192 INC SI ;point to next byte
193 DEC CX ;adjust loop pointer for additial
194 ; character read (double byte)
195;
196DEF60: PUSH ES ;save registers
197 PUSH SI
198;
199 MOV ES,BX ;load ICB
200 MOV SI,DX
201;
202 CALL ON_ALLOWONCE ;Scan the allowonce string for
203 ; the character in AX and set flag
204 ; if found
205 POP SI ;restore registers
206 POP ES
207;
208 LOOP DEF50 ;get next keystroke
209;
210 POP SI ;restore registers
211 POP ES
212;
213; Display field delimiters
214;
215DEF65: ;=W
216 MOV AX,01 ;assume "[ ]" as delimiters ;=W
217; ;=W
218 TEST ES:[SI]+ICB_OPT1,ICB_BEN ;display entry delimiters ;=W
219 JE DEF100 ;no, leave ;=W
220; ;=W
221 TEST ES:[SI]+ICB_OPT3,ICB_WIN ;does field use windowing ;=W
222 JE DEF70 ;no, check others ;=W
223; ;=W
224 TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if delimiter = box ;=W
225 JE DEF90 ;no, display normal delimiters ;=W
226; ;=W
227 MOV AX,06 ;display box ;=W
228 JMP DEF90 ;done with delimiters ;=W
229DEF70: ;=W
230 TEST ES:[SI]+ICB_OPT3,ICB_HOR ;does field use horiz. window ;=W
231 JE DEF80 ;=W
232; ;=W
233 MOV AX,03 ;display "[ >" ;=W
234 CMP ES:[SI]+ICB_HRSTART,01H ;are we at beginning of window ? ;=W
235 JLE DEF80 ;yes ;=W
236;
237 MOV AX,04 ;no, display "< >" ;=W
238DEF80: ;=W
239 CALL DELIMITER ;do it ;=W
240;
241 TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if also need box ;=W
242 JE DEF100 ;=W
243; ;=W
244 MOV AX,06 ;display box ;=W
245DEF90: ;=W
246 CALL DELIMITER ;do it ;=W
247;
248; Display minus or plus sign if active
249;
250DEF100:
251 TEST ES:[SI]+ICB_OPT1,ICB_MUS ;Check if minus/plus sign
252 JE DEFEXIT ; display option is active
253;
254 MOV [DI]+WR_KEYCONF,0 ;initialize to plus sign key
255;
256 TEST ES:[SI]+ICB_OPT1,ICB_SMU ;Check if default is negative
257 JE DEF110
258;
259 OR [DI]+WR_KEYCONF,WR_MUS ;initialize to minus sign key
260;
261DEF110: CALL PLUS_MINUS ;display plus or minus sign and
262 ; set status
263;
264DEFEXIT: ;continue
265;
266 RET
267DEFAULT ENDP
268;
269PAGE
270;-----------------------------------------------------------------------------+
271; :
272; PRE_EXIT :
273; :
274; Performs the following functions: :
275; :
276; - Removes field delimiters :
277; - Inserts commas as specified :
278; - Inserts decimal point as specified :
279; - Adjusts field to specified significant digits :
280; - Displays buffer contents in exit color :
281; - Checks if original default has changed :
282; - Check if entry is in specified numeric range :
283; - Sets minus or plus sign indicator in exit color :
284; - Remove thousand separators from input string buffer :
285; - Restore original cursor position and size, only in text mode :
286; :
287; Entry: ES:SI = Points to current ICB :
288; DS:DI = Points to PB :
289; :
290; Exit: None :
291; :
292;-----------------------------------------------------------------------------+
293;
294PRE_EXIT PROC NEAR
295
296;
297; Inserts commas as specified
298;
299 ;
300 ; Code here
301 ;
302;
303; Inserts decimal point as specified
304;
305 ;
306 ; Code here
307 ;
308;
309; Adjusts field to specified significant digits
310;
311 ;
312 ; Code here
313 ;
314;
315; Calculate color attribute of exit colors
316;
317 TEST ES:[SI]+ICB_OPT1,ICB_XCL ;check if option to use exit
318 JE PRE10 ; colors is active
319;
320 MOV AL,[DI]+WR_XATTR ;set the exit attribute to the
321 MOV [DI]+WR_CATTR,AL ; current attribute
322;
323; Display default value of input buffer in proper justification
324;
325PRE10: MOV [DI]+WR_LEFTCHAR,1 ;set left character
326 MOV AX,ES:[SI]+ICB_FIELDLEN ;set right marker
327;
328 TEST ES:[SI]+ICB_OPT3,ICB_HOR ;horizontal scrolling mode ? ;=W
329 JE PRE15 ;no, display all buffer ;=W
330 MOV AX,ES:[SI]+ICB_WIDTH ;use width instead of all buffer ;=W
331PRE15:
332 MOV [DI]+WR_RIGHTCHAR,AX
333;
334 MOV AX,2 ;set option to actually display
335 CALL WORD PTR [DI]+WR_DISPLAY ; default value in proper
336; ; justification
337; Process minus/plus key options
338;
339 TEST ES:[SI]+ICB_OPT1,ICB_MUS ;Check if minus/plus sign
340 JE PRE40 ; display option is active
341;
342 MOV [DI]+WR_KEYCONF,0 ;initialize to plus sign
343;
344 TEST ES:[SI]+ICB_STATUS,ICB_SMUS
345 JE PRE20 ;Check if sign is negative
346;
347 OR [DI]+WR_KEYCONF,WR_MUS ;initialize to minus sign key
348;
349PRE20: TEST ES:[SI]+ICB_STATUS,ICB_SPUS
350 JE PRE30 ;Check if sign is positive
351;
352 OR [DI]+WR_KEYCONF,WR_PUS ;initialize to plus sign key
353;
354PRE30: CALL PLUS_MINUS ;display plus or minus sign
355 ; according to WR_KEYCONF setting
356;
357; Replace field entry delimiters with exit delimiters
358;
359PRE40: TEST ES:[SI]+ICB_OPT1,ICB_BEX ;check if field delimiters
360 JE PRE60 ; should be displayed on exit
361;
362 MOV AX,2 ;option to remove delimiters
363 CALL DELIMITER ;display delimiters
364;
365 TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if box around field
366 JE PRE60 ; should be displayed
367;
368 MOV AX,7 ;set option to remove box
369 CALL DELIMITER ;display delimiters
370;
371; Check if default value has changed and set return flag
372;
373PRE60: PUSH DS ;save registers
374 PUSH SI
375 PUSH ES
376 PUSH DI
377;
378 MOV CX,ES:[SI]+ICB_DEFLEN ;initialize to default length
379 CMP CX,ES:[SI]+ICB_FIELDLEN ;check if default length is less
380 JBE PRE70 ; than field length
381;
382 MOV CX,ES:[SI]+ICB_FIELDLEN ;initialize to field length
383;
384PRE70: MOV AX,ES:[SI]+ICB_DEFSEG ;compare default string to ;=W
385 MOV DS,AX ;=W
386 MOV AX,ES:[SI]+ICB_FIELDOFF ;=W
387 MOV DI,AX ;=W
388;
389 MOV AX,ES:[SI]+ICB_DEFOFF ; current input string ;=W
390 MOV BX,ES:[SI]+ICB_FIELDSEG ;=W
391 MOV ES,BX ;=W
392 MOV SI,AX ;=W
393;
394 REPE CMPSB ;compare default and input strings
395;
396 POP DI ;restore registers
397 POP ES
398 POP SI
399 POP DS
400;
401 CMP CX,0 ;are we done ? ;=W
402 JE PRE80 ;check if strings compared
403;
404 OR ES:[SI]+ICB_STATUS,ICB_SDEF
405 ;set flag that default changed
406;
407; Check if entry is within specified numeric range, if not set flag
408;
409PRE80: ;
410 ; code here
411 ;
412;
413; Remove thousand separators if specified from input string buffer
414;
415PRE90: ;
416 ; code here
417 ;
418;
419; Restore original cursor position and size
420;
421PRE95:
422 TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ?
423 JE PRE100 ;no, quit
424 CALL CURSOR ;erase the graphics cursor
425PRE100:
426 OR ES:[SI]+ICB_STATUS,ICB_DONE ;exit condition found, exit ;=W
427; ;=W
428; Check if ICB_SAV option selected. If selected, then save contents of the ;=W
429; input buffer to the default buffer. ;=W
430; ;=W
431 TEST ES:[SI]+ICB_OPT4,ICB_SAV ;check ? ;=W
432 JE PRE200 ;no, exit now ;=W
433; ;=W
434 PUSH ES ;save registers ;=W
435 PUSH DS ;=W
436 PUSH DI ;=W
437 PUSH SI ;=W
438; ;=W
439 MOV CX,ES:[SI]+ICB_ENDBYTE ;# of bytes to copy from input ;=W
440 ; buffer to default buffer ;=W
441 MOV ES:[SI]+ICB_DEFLEN,CX ;reset default length
442;
443 MOV AX,ES:[SI]+ICB_FIELDSEG ;get destination segment ;=W
444 MOV DS,AX ;=W
445; ;=W
446 MOV AX,ES:[SI]+ICB_DEFOFF ;get source string offset ;=W
447 MOV DI,AX ;=W
448; ;=W
449 MOV AX,ES:[SI]+ICB_DEFSEG ;get source string segment ;=W
450 MOV BX,ES:[SI]+ICB_FIELDOFF ;get destination offset ;=W
451 MOV SI,BX ;=W
452 MOV ES,AX ;=W
453; ;=W
454 CLD ;=W
455 REP MOVSB ;move default into input buffer ;=W
456; ;=W
457 POP SI ;restore registers ;=W
458 POP DI ;=W
459 POP DS ;=W
460 POP ES ;=W
461PRE200: ;=W
462 RET
463PRE_EXIT ENDP
464; ;=W
465PAGE ;=W
466;-----------------------------------------------------------------------------+ ;=W
467; : ;=W
468; RIGHT_H_JUST : ;=W
469; : ;=W
470; Process keystroke and update display with input buffer changes : ;=W
471; for the following functions: : ;=W
472; : ;=W
473; Home key Up arrow Allowonce replace mode : ;=W
474; End key Down arrow Allowonce insert mode : ;=W
475; Left arrow Control end Allow replace mode : ;=W
476; Right arrow Delete key Allow insert mode : ;=W
477; : ;=W
478;-----------------------------------------------------------------------------+ ;=W
479; ;=W
480RIGHT_H_JUST PROC NEAR ;=W
481; ;=W
482 ; ;=W
483 ; code here ;=W
484 ; ;=W
485; ;=W
486 RET ;=W
487RIGHT_H_JUST ENDP ;=W
488;
489PAGE
490;-----------------------------------------------------------------------------+
491; :
492; RIGHT_JUST :
493; :
494; Process keystroke and update display with input buffer changes :
495; for the following functions: :
496; :
497; Home key Up arrow Allowonce replace mode :
498; End key Down arrow Allowonce insert mode :
499; Left arrow Control end Allow replace mode :
500; Right arrow Delete key Allow insert mode :
501; :
502;-----------------------------------------------------------------------------+
503;
504RIGHT_JUST PROC NEAR
505;
506 ;
507 ; code here
508 ;
509;
510 RET
511RIGHT_JUST ENDP
512; ;=W
513PAGE ;=W
514;-----------------------------------------------------------------------------+ ;=W
515; : ;=W
516; LEFT_H_JUST : ;=W
517; : ;=W
518; Process keystroke and update display with input buffer changes : ;=W
519; for the following functions: : ;=W
520; : ;=W
521; Home key Up arrow Allowonce replace mode : ;=W
522; End key Down arrow Allowonce insert mode : ;=W
523; Left arrow Control end Allow replace mode : ;=W
524; Right arrow Delete key Allow insert mode : ;=W
525; : ;=W
526; : ;=W
527; Following information is used: : ;=W
528; : ;=W
529; : ;=W
530; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W
531; ³ buffer in memory. : ;=W
532; ³ : ;=W
533; ³ ÚÄ (WR_CUBYTE) Byte offset into the input buffer : ;=W
534; ³ ³ of where characters will be added : ;=W
535; ³ ³ to input buffer. : ;=W
536; ³ ³ : ;=W
537; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
538; ³ S ³ L ³ T ³ L ³ T ³ S ³ S ³ ³ ³ ³ ³ ³ ³ ³ : ;=W
539; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
540; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W
541; ³ : ;=W
542; (ICB_FIELDLEN) Length of input field in bytes. : ;=W
543; : ;=W
544; : ;=W
545; The following demonstrates the before and after input buffer : ;=W
546; images. (S = Single byte, L = DBCS lead byte, T = DBCS trailing : ;=W
547; byte) : ;=W
548; : ;=W
549; Deleting a double byte: : ;=W
550; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
551; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ : ;=W
552; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W
553; : ;=W
554; Deleting a single byte: : ;=W
555; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
556; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ L ³ T ³ ³ : ;=W
557; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W
558; : ;=W
559; Backspace removal of a double byte: : ;=W
560; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
561; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ : ;=W
562; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
563; : ;=W
564; Backspace removal of a single byte: : ;=W
565; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
566; ³ S ³ S ³ S ³ S ³ L ³ T ³ ³ S ³ S ³ S ³ L ³ T ³ ³ : ;=W
567; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
568; : ;=W
569; Replacing a double byte with a double byte: : ;=W
570; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
571; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W
572; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W
573; : ;=W
574; Replacing a double byte with a single byte: (Option 1) : ;=W
575; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
576; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ S ³ ³ : ;=W
577; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
578; : ;=W
579; Replacing a double byte with a single byte: (Option 2) : ;=W
580; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
581; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ S ³ : ;=W
582; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
583; : ;=W
584; Replacing a single byte with a single byte: : ;=W
585; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
586; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W
587; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
588; : ;=W
589; Replacing a single byte with a double byte. : ;=W
590; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
591; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ ³ : ;=W
592; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W
593; : ;=W
594; Replacing a single byte with a double byte without enough buffer: : ;=W
595; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
596; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W
597; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
598; : ;=W
599; Inserting a single byte. : ;=W
600; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
601; ³ S ³ L ³ T ³ L ³ T ³ ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W
602; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
603; : ;=W
604; Inserting a single byte without enough buffer generate an error: : ;=W
605; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
606; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W
607; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W
608; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
609; ³ S ³ L ³ T ³ S ³ S ³ ³ ³ S ³ L ³ T ³ S ³ S ³ ³ : ;=W
610; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W
611; : ;=W
612; Inserting a double byte character: : ;=W
613; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
614; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W
615; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W
616; : ;=W
617; : ;=W
618; Entry: ES:SI = Points to current ICB : ;=W
619; DS:DI = Points to PB : ;=W
620; : ;=W
621; INC_KS = Keystroke from returned from PCINCHA : ;=W
622; : ;=W
623; WR_KEYCONF = Bit flag inidicating the options set for INC_KS : ;=W
624; WR_KEYCONF2 keystroke. : ;=W
625; : ;=W
626; Exit: None. : ;=W
627; : ;=W
628;-----------------------------------------------------------------------------+ ;=W
629; ;=W
630LEFT_H_JUST PROC NEAR ;=W
631; ;=W
632; Initialize right and left boundary markers ;=W
633; ;=W
634 TEST [DI]+WR_KEYCONF,WR_MASK ;check to see if editing key entered ;=W
635 JNE LHJ5 ;yes, must check for editing keys ;=W
636 JMP LHJ190 ;no, skip checks for editing keys ;=W
637 ;=W
638; ;=W
639; Process home key ;=W
640; ;=W
641LHJ5: TEST [DI]+WR_KEYCONF,WR_HOM ;check if home key pressed ;=W
642 JE LHJ10 ;=W
643; ;=W
644 ; ;=W
645 ; add ICB_WHM option to process window home key movement ;=W
646 ; ;=W
647; ;=W
648 MOV ES:[SI]+ICB_CURCHAR,1 ;initialize cursor to 1st byte ;=W
649 ; position, assuming no windowing ;=W
650 ; wrap is occurring ;=W
651 MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
652 CALL CAL_COORS ;calculate cursor position ;=W
653 MOV AX,3 ;display delimiters "[ >" ;=W
654 CALL DELIMITER ;display delimiter ;=W
655 JMP LHJEXIT ; returns WR_CURROW, WR_CURROW ;=W
656 ; and WR_CUBYTE ;=W
657; ;=W
658; Process end key ;=W
659; ;=W
660LHJ10: TEST [DI]+WR_KEYCONF,WR_END ;check if home key pressed ;=W
661 JNE LHJ12 ;=W
662 JMP LHJ20
663LHJ12: ;=W
664 ; ;=W
665 ; add ICB_WEN to move cursor to end of current window row ;=W
666 ; ;=W
667; ;=W
668 CALL CAL_COORS ;get current end of field info ;=W
669 MOV AX,[DI]+WR_ENCHAR ;adjust one past end buffer charac ;=W
670 INC AX ;=W
671 MOV ES:[SI]+ICB_CURCHAR,AX ;set current cursor position to ;=W
672 CALL CAL_COORS ;get cursor position ;=W
673 MOV AX,4 ;display delimiters "< >" ;=W
674 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
675 JE LHJ17 ;no ;=W
676 MOV AX,5 ;display delimiters "< ]" ;=W
677 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
678 JE LHJ15
679 MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
680 MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
681 MOV AX,3 ;display delimiters "[ >" ;=W
682 JMP LHJ19 ;exit
683LHJ15:
684 TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
685 JE LHJ16 ;no ;=W
686 OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
687LHJ16: ;=W
688 MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W
689 SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W
690 INC BX ; DBCS support) ;=W
691 MOV [DI]+WR_HRCHAR,BX ;=W
692 JMP LHJ19 ;=W
693LHJ17: ;=W
694 MOV CX,[DI]+WR_CUBYTE ;check if need to adjust horz. ;=W
695 CMP CX,ES:[SI]+ICB_WIDTH ; window ;=W
696 JA LHJ18 ;=W
697 MOV [DI]+WR_HRCHAR,1 ;=W
698 MOV AX,3 ;display delimiters "[ >" ;=W
699 JMP LHJ19 ;=W
700LHJ18: ;=W
701 MOV BX,[DI]+WR_ENBYTE ;yes, adjust it ;=W
702 SUB BX,ES:[SI]+ICB_WIDTH ;=W
703 ADD BX,2 ;=W
704 MOV [DI]+WR_HRCHAR,BX ;=W
705LHJ19: ;=W
706 CALL CAL_COORS ;re-calculate display ;=W
707 CALL DELIMITER ;display delimiter ;=W
708 JMP LHJEXIT ;exit ;=W
709; ;=W
710; Process left arrow ;=W
711; ;=W
712LHJ20: TEST [DI]+WR_KEYCONF,WR_LFT ;check if left arrow key pressed ;=W
713 JE LHJ40 ;=W
714; ;=W
715 ; ;=W
716 ; add ICB_CSW option to wrap cursor from top/bottom end to end ;=W
717 ; ;=W
718; ;=W
719 ; ;=W
720 ; add ICB_WAR option to wrap cursor on same row end to end ;=W
721 ; ;=W
722; ;=W
723 MOV BX,ES:[SI]+ICB_CURCHAR ;get cursor position ;=W
724 CMP BX,1 ;is cursor in first position ? ;=W
725 JA LHJ30 ;no ;=W
726 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
727 JE LHJ23
728 MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W
729 MOV ES:[SI]+ICB_CURCHAR,BX ;wrap to first character position
730 SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W
731 INC BX ; DBCS support) ;=W
732 MOV [DI]+WR_HRCHAR,BX ;=W
733;
734 MOV AX,5 ;display delimiters "< ]" ;=W
735 CALL DELIMITER ;display delimiter ;=W
736 JMP LHJ32 ;exit
737LHJ23:
738 MOV AX,3 ;display delimiters "[ >" ;=W
739 CALL DELIMITER ;display delimiter ;=W
740 TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
741 JE LHJ25 ;no ;=W
742 OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
743 JMP LHJ400 ;=W
744LHJ25: ;=W
745 CALL PCMBEEP_CALL ;error beep ;=W
746 JMP LHJEXIT ;exit ;=W
747LHJ30: ;=W
748 DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position ;=W
749;
750 CMP BX,[DI]+WR_HRCHAR ;is cursor to the left of horz.wind. ? ;=W
751 JG LHJ32 ;no ;=W
752 DEC [DI]+WR_HRCHAR ;yes, adjust horiz. window ;=W
753 MOV AX,4 ;display delimiters "< >" ;=W
754 CALL DELIMITER ;display delimiter ;=W
755LHJ32: ; towards the left ;=W
756 CALL CAL_COORS ;calculate cursor position
757 JMP LHJEXIT ;exit ;=W
758; ;=W
759; Process right arrow ;=W
760; ;=W
761LHJ40: TEST [DI]+WR_KEYCONF,WR_RGT ;check if left arrow key pressed ;=W
762 JE LHJ60 ;=W
763; ;=W
764 ; ;=W
765 ; add ICB_WAR option to wrap cursor on same row end to end ;=W
766 ; ;=W
767; ;=W
768 CALL CAL_COORS ;get cursor position ;=W
769; ;=W
770 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
771 JE LHJ50 ;=W
772; ;=W
773 MOV AX,5 ;display delimiters "< ]" ;=W
774 CALL DELIMITER ;display delimiter ;=W
775 CALL PCMBEEP_CALL ;error beep ;=W
776 JMP LHJEXIT ;exit ;=W
777; ;=W
778LHJ50: INC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position ;=W
779 ; towards the right ;=W
780 MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W
781 ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W
782 CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W
783 JG LHJ52 ;no ;=W
784 INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W
785 MOV AX,4 ;display delimiters "< >" ;=W
786 CALL DELIMITER ;display delimiter ;=W
787LHJ52: ;=W
788 CALL CAL_COORS ;calculate cursor position ;=W
789 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
790 JE LHJ55 ;no ;=W
791 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
792 JE LHJ53
793 MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
794 MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
795 MOV AX,3 ;display delimiters "[ >" ;=W
796 CALL DELIMITER ;display delimiter ;=W
797 JMP LHJ55 ;exit
798LHJ53:
799 DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W
800 MOV AX,5 ;display delimiters "< ]" ;=W
801 CALL DELIMITER ;display delimiter ;=W
802 TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
803 JE LHJ55 ;no ;=W
804 OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
805LHJ55: ;=W
806 CALL CAL_COORS ;calculate cursor position ;=W
807 JMP LHJEXIT ;exit ;=W
808; ;=W
809; Process up arrow ;=W
810; ;=W
811LHJ60: ; ;=W
812 ; adjust cursor position ;=W
813 ; ;=W
814 ;=W
815 ; ;=W
816 ; check for field wrap, exit, error beep ;=W
817 ; ;=W
818; ;=W
819; Process down arrow ;=W
820; ;=W
821LHJ70: ; ;=W
822 ; adjust cursor position ;=W
823 ; ;=W
824 ;=W
825 ; ;=W
826 ; check for field wrap, exit, error beep ;=W
827 ; ;=W
828; ;=W
829; Process cntrl+end key ;=W
830; ;=W
831LHJ80: TEST [DI]+WR_KEYCONF,WR_CED ;check if control+end key pressed ;=W
832 JE LHJ100 ;=W
833; ;=W
834 CALL CAL_COORS ;get cursor position ;=W
835 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
836 JE LHJ90 ;=W
837; ;=W
838 CALL PCMBEEP_CALL ;error beep ;=W
839 JMP LHJEXIT ;exit ;=W
840LHJ90:
841 MOV BX,[DI]+WR_CUBYTE ;delete from current byte position ;=W
842 CALL CLEAR_BUFFER ;=W
843; ;=W
844 CALL CAL_COORS ;calculate cursor position
845 JMP LHJEXIT ;display field, set cursor, exit ;=W
846; ;=W
847; Process delete key ;=W
848; ;=W
849LHJ100: TEST [DI]+WR_KEYCONF,WR_DEL ;check if delete key pressed ;=W
850 JE LHJ130 ;=W
851; ;=W
852 ; ;=W
853 ; Add ICB_WDL option in off state to delete on current line only ;=W
854 ; ;=W
855; ;=W
856 CALL CAL_COORS ;get cursor position ;=W
857; ;=W
858 CMP [DI]+WR_FIELDEND,1 ;check if cursor past end of field ;=W
859 JE LHJ110 ;=W
860; ;=W
861 CALL REMOVE_CHAR ;remove character at current offst ;=W
862 ; and shift remaining in place ;=W
863 CALL CAL_COORS ;calculate cursor position
864 JMP LHJEXIT ;display field, set cursor, exit ;=W
865; ;=W
866LHJ110: CALL PCMBEEP_CALL ;error beep ;=W
867 JMP LHJEXIT ;exit ;=W
868; ;=W
869; Process backspace key ;=W
870; ;=W
871LHJ130: TEST [DI]+WR_KEYCONF,WR_BCK ;check if backspace key pressed ;=W
872 JE LHJ160 ;=W
873; ;=W
874 MOV BX,ES:[SI]+ICB_CURCHAR ;get cursor position ;=W
875 CMP BX,1 ;check if cursor is at first ;=W
876 JA LHJ140 ; field position ;=W
877;
878 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
879 JE LHJ133
880 MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W
881 MOV ES:[SI]+ICB_CURCHAR,BX ;wrap to first character position
882 SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W
883 INC BX ; DBCS support) ;=W
884 MOV [DI]+WR_HRCHAR,BX ;=W
885;
886 MOV AX,5 ;display delimiters "< ]" ;=W
887 CALL DELIMITER ;display delimiter ;=W
888 JMP LHJ145 ;exit
889LHJ133:
890 MOV AX,3 ;display delimiters "[ >" ;=W
891 TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
892 JE LHJ135 ;no ;=W
893 OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
894 CALL DELIMITER ;display delimiter ;=W
895 JMP LHJ400 ;=W
896LHJ135: ;=W
897 CALL DELIMITER ;display delimiter ;=W
898 CALL PCMBEEP_CALL ;error beep ;=W
899 JMP LHJEXIT ;exit ;=W
900LHJ140: ;=W
901 DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position
902 ; towards the left ;=W
903 CMP BX,[DI]+WR_HRCHAR ;is cursor in front of the wind. ? ;=W
904 JG LHJ142 ;no ;=W
905 DEC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W
906 MOV AX,4 ;display delimiters "< >" ;=W
907 CALL DELIMITER ;display delimiter ;=W
908LHJ142: ;=W
909; ;=W
910 CALL CAL_COORS ;get cursor position ;=W
911 CALL REMOVE_CHAR ;remove character at current offst ;=W
912 ; and shift remaining in place ;=W
913LHJ145: ;=W
914 CALL CAL_COORS ;calculate cursor position
915 JMP LHJEXIT ;display field, set cursor, exit ;=W
916; ;=W
917; Process insert key toggle ;=W
918; ;=W
919LHJ160: TEST [DI]+WR_KEYCONF,WR_INS ;check if insert key pressed ;=W
920 JE LHJ180 ; if not, continue ;=W
921; ;=W
922 TEST ES:[SI]+ICB_STATUS,ICB_SINS ;check if in insert mode ? ;=W
923 JE LHJ165 ;no, put in insert mode ;=W
924; ;=W
925 MOV BX,[DI]+IN_CURNOR ;set cursor size for normal ;=W
926 MOV [DI]+WR_CURSIZE,BX ; cursor ;=W
927; ;=W
928 AND ES:[SI]+ICB_STATUS,NOT ICB_SINS ;=W
929 JMP LHJ170 ;turn insert mode off ;=W
930; ;=W
931LHJ165: MOV BX,[DI]+IN_CURINS ;set cursor size for insert ;=W
932 MOV [DI]+WR_CURSIZE,BX ; cursor ;=W
933; ;=W
934 OR ES:[SI]+ICB_STATUS,ICB_SINS ;=W
935 ;turn insert mode on ;=W
936; ;=W
937LHJ170: ;=W
938; ;=W
939 PUSH DS ;save registers ;=W
940 PUSH DI ;=W
941; ;=W
942 MOV DI,40H ;point DS:DI to KB_FLAG in BIOS ;=W
943 MOV DS,DI ;=W
944 MOV DI,17H ;=W
945 MOV AX,[DI] ;get current BIOS KB_FLAG ;=W
946; ;=W
947 AND AX,NOT WR_INSSTATE ;set BIOS insert active flag off ;=W
948; ;=W
949 TEST ES:[SI]+ICB_STATUS,ICB_SINS ;=W
950 JE LHJ175 ;check if insert should be set on ;=W
951; ;=W
952 OR AX,WR_INSSTATE ;set BIOS insert active flag on ;=W
953; ;=W
954LHJ175: POP DI ;restore registers ;=W
955 POP DS ;=W
956; ;=W
957 JMP LHJEXIT ;exit ;=W
958; ;=W
959; Process allowonce key option ;=W
960; ;=W
961LHJ180: ; ;=W
962 ; insert or replace ;=W
963 ; ;=W
964; ;=W
965 ; ;=W
966 ; adjust input buffer ;=W
967 ; ;=W
968; ;=W
969 ; ;=W
970 ; check for field wrap, exit, error beep ;=W
971 ; ;=W
972; ;=W
973 ; ;=W
974 ; adjust cursor position ;=W
975 ; ;=W
976; ;=W
977; Process allowed keystroke in replace mode ;=W
978; ;=W
979LHJ190: TEST [DI]+WR_KEYCONF,WR_ALL ;check if allow key pressed ;=W
980 JNE LHJ195 ;=W
981; ;=W
982 CALL PCMBEEP_CALL ;error beep key not defined ;=W
983 JMP LHJEXIT ;exit ;=W
984; ;=W
985LHJ195: TEST ES:[SI]+ICB_STATUS,ICB_SINS ;=W
986 JE LHJ198 ;check if insert is active ;=W
987; ;=W
988 JMP LHJ270 ;do insert display ;=W
989; ;=W
990LHJ198: ;=W
991 CALL CAL_COORS ;get cursor position ;=W
992 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
993 JE LHJ200 ;=W
994; ;=W
995 CALL PCMBEEP_CALL ;error beep key not defined ;=W
996 JMP LHJEXIT ;exit ;=W
997; ;=W
998; Check if character to be replaced in field buffer is double byte character ;=W
999; ;=W
1000LHJ200: PUSH ES ;save registers ;=W
1001 PUSH SI ;=W
1002; ;=W
1003 PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W
1004 PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W
1005 POP SI ;=W
1006 POP ES ;=W
1007; ;=W
1008 ADD SI,[DI]+WR_CUBYTE ;add cursor offset into buffer ;=W
1009 DEC SI ;make zero based ;=W
1010; ;=W
1011 MOV CX,ES ;save offset of character to ;=W
1012 MOV DX,SI ; replace ;=W
1013; ;=W
1014 MOV AL,ES:[SI] ;get byte that cursor is pointing ;=W
1015 MOV [DI]+DBC_KS,AL ; to check if DBCS ;=W
1016 CALL PCINDBC_CALL ;call routine to check if char ;=W
1017 ; is lead double byte char ;=W
1018; ;=W
1019 POP SI ;restore registers ;=W
1020 POP ES ;=W
1021; ;=W
1022 TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS ;=W
1023 JE LHJ220 ; if no, jump to single byte code ;=W
1024; ;=W
1025; Replace double byte character with double byte character ;=W
1026; ;=W
1027 TEST [DI]+WR_KEYCONF2,WR_DBC ;check if keystroke is DBC ;=W
1028 JE LHJ210 ;continue with single byte ;=W
1029; ;=W
1030 MOV AX,[DI]+INC_KS ;set double byte character to ;=W
1031 ; input buffer replacing ;=W
1032 ; double byte character ;=W
1033 PUSH ES ;=W
1034 PUSH SI ;=W
1035; ;=W
1036 MOV ES,CX ;save offset of character to ;=W
1037 MOV SI,DX ; replace ;=W
1038 MOV ES:[SI],AX ;replace double byte ;=W
1039; ;=W
1040 POP SI ;restore registers ;=W
1041 POP ES ;=W
1042; ;=W
1043 JMP LHJ260 ;exit ;=W
1044; ;=W
1045; Replace double byte character with single byte character ;=W
1046; ;=W
1047LHJ210: MOV AX,[DI]+INC_KS ;get keystroke and replace double ;=W
1048 ; byte with single byte ;=W
1049; ;=W
1050 PUSH ES ;=W
1051 PUSH SI ;=W
1052; ;=W
1053 MOV ES,CX ;save offset of character to ;=W
1054 MOV SI,DX ; replace single byte ;=W
1055 MOV ES:[SI],AL ;=W
1056; ;=W
1057 POP SI ;restore registers ;=W
1058 POP ES ;=W
1059; ;=W
1060 MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte ;=W
1061 MOV [DI]+WR_RIGHTBYTE,AX ;=W
1062; ;=W
1063 MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W
1064 INC AX ;adjust past replaced leading byte ;=W
1065 MOV [DI]+WR_LEFTBYTE,AX ; trailing byte ;=W
1066; ;=W
1067 MOV BX,1 ;set number of positions to shift ;=W
1068 MOV AX,2 ;set option to shift left ;=W
1069 CALL SHIFT ;call shift 1 position toward left ;=W
1070 JMP LHJ260 ;exit ;=W
1071; ;=W
1072; Replace single byte character with single byte character ;=W
1073; ;=W
1074LHJ220: TEST [DI]+WR_KEYCONF2,WR_DBC ;check if double byte character ;=W
1075 JNE LHJ230 ; continue with single byte ;=W
1076; ;=W
1077 MOV AX,[DI]+INC_KS ;get keystroke ;=W
1078; ;=W
1079 PUSH ES ;=W
1080 PUSH SI ;=W
1081; ;=W
1082 MOV ES,CX ;save offset of character to ;=W
1083 MOV SI,DX ; replace single byte ;=W
1084 MOV ES:[SI],AL ;=W
1085; ;=W
1086 POP SI ;restore registers ;=W
1087 POP ES ;=W
1088; ;=W
1089 JMP LHJ260 ;exit ;=W
1090; ;=W
1091; Replace single byte character with double byte character ;=W
1092; ;=W
1093LHJ230: ;=W
1094 CALL CAL_COORS ;calculate cursor position ;=W
1095 MOV BX,[DI]+WR_ENBYTE ;get end byte of input field ;=W
1096 MOV AX,[DI]+WR_ENCHAR ;get end character of field ;=W
1097 CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character ;=W
1098 JA LHJ240 ;=W
1099; ;=W
1100 MOV BX,[DI]+WR_CUBYTE ;set cursor character position ;=W
1101LHJ240: ;=W
1102 MOV AX,ES:[SI]+ICB_FIELDLEN ;get end of field position ;=W
1103 SUB AX,BX ;subtract to get the remaining space ;=W
1104 CMP AX,1 ;will byte fit ? ;=W
1105 JGE LHJ250 ;yes ;=W
1106; ;=W
1107 CALL PCMBEEP_CALL ;error beep because replace char ;=W
1108 JMP LHJEXIT ; will not fit and exit ;=W
1109; ;=W
1110LHJ250: MOV BX,ES:[SI]+ICB_FIELDLEN ;set ending byte ;=W
1111 MOV [DI]+WR_RIGHTBYTE,BX ;=W
1112; ;=W
1113 MOV BX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W
1114 INC BX ;adjust past replaced leading byte ;=W
1115 MOV [DI]+WR_LEFTBYTE,BX ; trailing byte ;=W
1116; ;=W
1117 MOV BX,1 ;set number of positions to shift ;=W
1118 MOV AX,1 ;set option to shift right ;=W
1119 CALL SHIFT ;call shift 1 position toward ;=W
1120 ; left ;=W
1121 MOV AX,[DI]+INC_KS ;get keystroke ;=W
1122; ;=W
1123 PUSH ES ;=W
1124 PUSH SI ;=W
1125; ;=W
1126 MOV ES,CX ;save offset of character to ;=W
1127 MOV SI,DX ; replace double byte ;=W
1128 MOV ES:[SI],AX ;=W
1129; ;=W
1130 POP SI ;restore registers ;=W
1131 POP ES ;=W
1132; ;=W
1133; Calculate new ending and cursor coordinates ;=W
1134; ;=W
1135LHJ260: ;=W
1136 CALL CAL_COORS ;calculate cursor position ;=W
1137 INC ES:[SI]+ICB_CURCHAR ;point to next char ;=W
1138 MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W
1139 ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W
1140 CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W
1141 JG LHJ265 ;no ;=W
1142 INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W
1143 MOV AX,4 ;display delimiters "< >" ;=W
1144 CALL DELIMITER ;display delimiter ;=W
1145LHJ265: ;=W
1146 CALL CAL_COORS ;calculate cursor position ;=W
1147 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
1148 JE LHJ267 ;no ;=W
1149 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
1150 JE LHJ266
1151 MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
1152 MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
1153 MOV AX,3 ;display delimiters "[ >" ;=W
1154 CALL DELIMITER ;display delimiter ;=W
1155 JMP LHJ267 ;exit
1156LHJ266:
1157
1158 DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W
1159 MOV AX,5 ;display delimiters "< ]" ;=W
1160 CALL DELIMITER ;display delimiter ;=W
1161 TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W
1162 JE LHJ267 ;no ;=W
1163 OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
1164LHJ267: ;=W
1165 CALL CAL_COORS ;calculate cursor position ;=W
1166 JMP LHJEXIT ;display field, set cursor, exit ;=W
1167; ;=W
1168; Process allowed keystroke in insert mode ;=W
1169; ;=W
1170LHJ270: ;=W
1171 CALL CAL_COORS ;get cursor position ;=W
1172 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
1173 JE LHJ280 ;=W
1174; ;=W
1175 CALL PCMBEEP_CALL ;error beep key not defined ;=W
1176 JMP LHJEXIT ;exit ;=W
1177; ;=W
1178; Check if enough room available to insert single or double byte character ;=W
1179; ;=W
1180LHJ280: ;=W
1181 MOV CX,ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W
1182 MOV DX,ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W
1183; ;=W
1184 ADD DX,[DI]+WR_CUBYTE ;add cursor offset into buffer ;=W
1185 DEC DX ;make zero based ;=W
1186; ;=W
1187 MOV BX,1 ;initialize to single byte ;=W
1188; ;=W
1189 TEST [DI]+WR_KEYCONF2,WR_DBC ;check for double byte character ;=W
1190 JE LHJ290 ;=W
1191; ;=W
1192 MOV BX,2 ;reset to double byte character ;=W
1193LHJ290: ;=W
1194 PUSH BX ;=W
1195 CALL CAL_COORS ;calculate cursor position ;=W
1196 MOV BX,[DI]+WR_ENBYTE ;get end byte of input field ;=W
1197 MOV AX,[DI]+WR_ENCHAR ;get end character of field ;=W
1198 CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character ;=W
1199 JA LHJ300 ;=W
1200; ;=W
1201 MOV BX,[DI]+WR_CUBYTE ;set cursor character position ;=W
1202LHJ300: ;=W
1203 MOV AX,ES:[SI]+ICB_FIELDLEN ;get end of field position ;=W
1204 SUB AX,BX ;subtract to get the remaining space ;=W
1205 POP BX ;=W
1206 CMP AX,BX ;will byte fit ? ;=W
1207 JGE LHJ310 ;yes ;=W
1208; ;=W
1209 CALL PCMBEEP_CALL ;error beep replace character ;=W
1210 JMP LHJEXIT ; will not fit and exit ;=W
1211; ;=W
1212; Shift to insert single or double byte character, BX= # bytes to shift ;=W
1213; ;=W
1214LHJ310: MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte to make room in ;=W
1215 MOV [DI]+WR_RIGHTBYTE,AX ; buffer by shifting characters ;=W
1216; ;=W
1217 MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W
1218 MOV [DI]+WR_LEFTBYTE,AX ; trailing byte ;=W
1219; ;=W
1220 MOV AX,1 ;set option to shift right, BX= ;=W
1221 ; number of bytes to insert ;=W
1222 CALL SHIFT ;call shift 1 position toward ;=W
1223 ; left ;=W
1224 MOV AX,[DI]+INC_KS ;get keystroke ;=W
1225; ;=W
1226; Insert single byte character ;=W
1227; ;=W
1228 CMP BX,2 ;check how many bytes should be ;=W
1229 JE LHJ320 ; inserted ;=W
1230; ;=W
1231 PUSH ES ;=W
1232 PUSH SI ;=W
1233; ;=W
1234 MOV ES,CX ;save offset of character to ;=W
1235 MOV SI,DX ; replace single byte ;=W
1236 MOV ES:[SI],AL ;insert single byte character ;=W
1237; ;=W
1238 POP SI ;restore registers ;=W
1239 POP ES ;=W
1240; ;=W
1241 JMP LHJ330 ;=W
1242; ;=W
1243; Insert double byte character ;=W
1244; ;=W
1245LHJ320: PUSH ES ;=W
1246 PUSH SI ;=W
1247; ;=W
1248 MOV ES,CX ;save offset of character to ;=W
1249 MOV SI,DX ; replace ;=W
1250 MOV ES:[SI],AX ;insert double byte character ;=W
1251; ;=W
1252 POP SI ;restore registers ;=W
1253 POP ES ;=W
1254; ;=W
1255; Calculate new ending and cursor coordinates ;=W
1256; ;=W
1257LHJ330: ;=W
1258 CALL CAL_COORS ;get new end coordinates ;=W
1259; ;=W
1260 INC ES:[SI]+ICB_CURCHAR ;point to next char ;=W
1261 MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W
1262 ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W
1263 CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W
1264 JG LHJ332 ;no ;=W
1265 INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W
1266 MOV AX,4 ;display delimiters "< >" ;=W
1267 CALL DELIMITER ;display delimiter ;=W
1268LHJ332: ;=W
1269 CALL CAL_COORS ;calculate cursor position
1270 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
1271 JE LHJ335 ;no ;=W
1272 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
1273 JE LHJ333
1274 MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
1275 MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
1276 MOV AX,3 ;display delimiters "[ >" ;=W
1277 CALL DELIMITER ;display delimiter ;=W
1278 JMP LHJ335 ;exit
1279LHJ333:
1280 DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W
1281 MOV AX,5 ;display delimiters "< ]" ;=W
1282 CALL DELIMITER ;display delimiter ;=W
1283 TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W
1284 JE LHJ335 ;no ;=W
1285 OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
1286LHJ335:
1287 CALL CAL_COORS ;calculate cursor position ;=W
1288 JMP LHJEXIT ;display cursor
1289; ;=W
1290; Display field & Exit ;=W
1291; ;=W
1292LHJ400:
1293 CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer ;=W
1294 ; in left justified field ;=W
1295 JMP LHJCUR
1296LHJEXIT: ;=W
1297 CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer ;=W
1298 ; in left justified field ;=W
1299 TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ?
1300 JNE LHJCUR ;cursor is already on, don't turn it on ;=W
1301 CALL CURSOR ;display cursor ;=W
1302LHJCUR:
1303; ;=W
1304 RET ;=W
1305LEFT_H_JUST ENDP ;=W
1306;
1307PAGE
1308;-----------------------------------------------------------------------------+
1309; :
1310; LEFT_JUST :
1311; :
1312; Process keystroke and update display with input buffer changes :
1313; for the following functions: :
1314; :
1315; Home key Up arrow Allowonce replace mode :
1316; End key Down arrow Allowonce insert mode :
1317; Left arrow Control end Allow replace mode :
1318; Right arrow Delete key Allow insert mode :
1319; :
1320; :
1321; Following information is used: :
1322; :
1323; :
1324; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input :
1325; ³ buffer in memory. :
1326; ³ :
1327; ³ ÚÄ (WR_CUBYTE) Byte offset into the input buffer :
1328; ³ ³ of where characters will be added :
1329; ³ ³ to input buffer. :
1330; ³ ³ :
1331; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1332; ³ S ³ L ³ T ³ L ³ T ³ S ³ S ³ ³ ³ ³ ³ ³ ³ ³ :
1333; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ :
1334; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :
1335; ³ :
1336; (ICB_FIELDLEN) Length of input field in bytes. :
1337; :
1338; :
1339; The following demonstrates the before and after input buffer :
1340; images. (S = Single byte, L = DBCS lead byte, T = DBCS trailing :
1341; byte) :
1342; :
1343; Deleting a double byte: :
1344; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1345; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ :
1346; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ :
1347; :
1348; Deleting a single byte: :
1349; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1350; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ L ³ T ³ ³ :
1351; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ :
1352; :
1353; Backspace removal of a double byte: :
1354; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1355; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ :
1356; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ :
1357; :
1358; Backspace removal of a single byte: :
1359; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1360; ³ S ³ S ³ S ³ S ³ L ³ T ³ ³ S ³ S ³ S ³ L ³ T ³ ³ :
1361; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÙ :
1362; :
1363; Replacing a double byte with a double byte: :
1364; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1365; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ :
1366; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ :
1367; :
1368; Replacing a double byte with a single byte: (Option 1) :
1369; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1370; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ S ³ ³ :
1371; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
1372; :
1373; Replacing a double byte with a single byte: (Option 2) :
1374; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1375; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ S ³ :
1376; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
1377; :
1378; Replacing a single byte with a single byte: :
1379; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1380; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ :
1381; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
1382; :
1383; Replacing a single byte with a double byte. :
1384; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1385; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ ³ :
1386; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ :
1387; :
1388; Replacing a single byte with a double byte without enough buffer: :
1389; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1390; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ :
1391; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
1392; :
1393; Inserting a single byte. :
1394; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1395; ³ S ³ L ³ T ³ L ³ T ³ ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ :
1396; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
1397; :
1398; Inserting a single byte without enough buffer generate an error: :
1399; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1400; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ :
1401; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ :
1402; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1403; ³ S ³ L ³ T ³ S ³ S ³ ³ ³ S ³ L ³ T ³ S ³ S ³ ³ :
1404; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ :
1405; :
1406; Inserting a double byte character: :
1407; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
1408; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ :
1409; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ :
1410; :
1411; :
1412; Entry: ES:SI = Points to current ICB :
1413; DS:DI = Points to PB :
1414; :
1415; INC_KS = Keystroke from returned from PCINCHA :
1416; :
1417; WR_KEYCONF = Bit flag inidicating the options set for INC_KS :
1418; WR_KEYCONF2 keystroke. :
1419; :
1420; Exit: None. :
1421; :
1422;-----------------------------------------------------------------------------+
1423;
1424LEFT_JUST PROC NEAR
1425;
1426; Initialize right and left boundary markers
1427;
1428 MOV [DI]+WR_LEFTCHAR,1 ;set left character to beginning
1429 ; of field
1430;
1431 MOV AX,ES:[SI]+ICB_FIELDLEN ;set right marker past end of
1432 INC AX ; field
1433 MOV [DI]+WR_RIGHTCHAR,AX
1434;
1435 TEST [DI]+WR_KEYCONF,WR_MASK ;check to see if editing key entered ;=W
1436 JNE LJ5 ;yes, must check for editing keys ;=W
1437 JMP LJ190 ;no, skip checks for editing keys ;=W
1438
1439;
1440; Process home key
1441;
1442LJ5: TEST [DI]+WR_KEYCONF,WR_HOM ;check if home key pressed
1443 JE LJ10
1444;
1445 ;
1446 ; add ICB_WHM option to process window home key movement
1447 ;
1448;
1449 MOV ES:[SI]+ICB_CURCHAR,1 ;initialize cursor to 1st byte
1450 ; position, assuming no windowing
1451 ; wrap is occurring
1452 CALL CAL_COORS ;get cursor position ;=W
1453 JMP LJEXIT ; returns WR_CURROW, WR_CURROW
1454 ; and WR_CUBYTE
1455;
1456; Process end key
1457;
1458LJ10: TEST [DI]+WR_KEYCONF,WR_END ;check if home key pressed
1459 JE LJ20
1460;
1461 ;
1462 ; add ICB_WEN to move cursor to end of current window row
1463 ;
1464;
1465 CALL CAL_COORS ;get current end of field info ;=W
1466;
1467 MOV AX,[DI]+WR_ENCHAR ;adjust one past end buffer charac
1468 INC AX
1469 MOV ES:[SI]+ICB_CURCHAR,AX ;set current cursor position to
1470 ; end of field
1471 CALL CAL_COORS ;get cursor position ;=W
1472 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
1473 JE LJ17 ;no ;=W
1474 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
1475 JE LJ16
1476 MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
1477 CALL CAL_COORS ;get cursor position
1478 JMP LJEXIT ;exit
1479LJ16:
1480 TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
1481 JE LJ17 ;no ;=W
1482 OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
1483LJ17: ;=W
1484 JMP LJEXIT ;exit
1485;
1486; Process left arrow
1487;
1488LJ20: TEST [DI]+WR_KEYCONF,WR_LFT ;check if left arrow key pressed
1489 JE LJ40
1490;
1491 ;
1492 ; add ICB_WAR option to wrap cursor on same row end to end
1493 ;
1494;
1495 CMP ES:[SI]+ICB_CURCHAR,1 ;check if cursor is at first
1496 JA LJ30 ; field position
1497;
1498 TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
1499 JE LJ25 ;no ;=W
1500 OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
1501 JMP LJCUR ;=W
1502LJ25: ;=W
1503 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
1504 JE LJ27
1505 MOV AX,ES:[SI]+ICB_FIELDLEN ;get last position
1506 MOV ES:[SI]+ICB_CURCHAR,AX ;put as current position
1507 CALL CAL_COORS
1508 JMP LJEXIT
1509LJ27:
1510 CALL PCMBEEP_CALL ;error beep
1511 JMP LJEXIT ;exit
1512;
1513LJ30: DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position
1514 ; towards the left
1515 CALL CAL_COORS ;get cursor position ;=W
1516 JMP LJEXIT ;exit
1517;
1518; Process right arrow
1519;
1520LJ40: TEST [DI]+WR_KEYCONF,WR_RGT ;check if left arrow key pressed
1521 JE LJ60
1522;
1523 ;
1524 ; add ICB_CSW option to wrap cursor from top/bottom end to end
1525 ;
1526;
1527 ;
1528 ; add ICB_AXC option to auto enter if cursor reaches end
1529 ;
1530;
1531 ;
1532 ; add ICB_WAR option to wrap cursor on same row end to end
1533 ;
1534;
1535 CALL CAL_COORS ;get cursor position ;=W
1536 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field
1537 JE LJ50
1538;
1539 CALL PCMBEEP_CALL ;error beep
1540 JMP LJEXIT ;exit
1541;
1542LJ50: INC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position
1543 ; towards the left
1544 CALL CAL_COORS ;get cursor position ;=W
1545 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
1546 JE LJ55 ;no ;=W
1547 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
1548 JE LJ52
1549 MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
1550 CALL CAL_COORS ;get cursor position
1551 JMP LJEXIT ;exit
1552LJ52:
1553 TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
1554 JE LJ55 ;no ;=W
1555 OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
1556LJ55: ;=W
1557 JMP LJEXIT ;exit
1558;
1559; Process up arrow
1560;
1561LJ60: ;
1562 ; adjust cursor position
1563 ;
1564
1565 ;
1566 ; check for field wrap, exit, error beep
1567 ;
1568;
1569; Process down arrow
1570;
1571LJ70: ;
1572 ; adjust cursor position
1573 ;
1574
1575 ;
1576 ; check for field wrap, exit, error beep
1577 ;
1578;
1579; Process cntrl+end key
1580;
1581LJ80: TEST [DI]+WR_KEYCONF,WR_CED ;check if control+end key pressed
1582 JE LJ100
1583;
1584 CALL CAL_COORS ;get cursor position ;=W
1585 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field
1586 JE LJ90
1587;
1588 CALL PCMBEEP_CALL ;error beep
1589 JMP LJEXIT ;exit
1590;
1591LJ90: CALL CAL_COORS ;get current end of field info ;=W
1592;
1593 MOV AX,ES:[SI]+ICB_FIELDLEN ;set rightmost area to refresh on
1594 MOV [DI]+WR_RIGHTDISP,AX ; display to entire field
1595;
1596 MOV BX,[DI]+WR_CUBYTE ;delete from current byte position
1597 CALL CLEAR_BUFFER
1598;
1599 CALL CAL_COORS ;get cursor position ;=W
1600 JMP LJ340 ;display field, set cursor, exit
1601;
1602; Process delete key
1603;
1604LJ100: TEST [DI]+WR_KEYCONF,WR_DEL ;check if delete key pressed
1605 JE LJ130
1606;
1607 ;
1608 ; Add ICB_WDL option in off state to delete on current line only
1609 ;
1610;
1611 CALL CAL_COORS ;get cursor position ;=W
1612 CMP [DI]+WR_FIELDEND,1 ;check if cursor past end of field
1613 JE LJ110
1614;
1615 CALL REMOVE_CHAR ;remove character at current offst
1616 ; and shift remaining in place
1617 JMP LJ340 ;display field, set cursor, exit
1618;
1619LJ110: CALL PCMBEEP_CALL ;error beep
1620 JMP LJEXIT ;exit
1621;
1622; Process backspace key
1623;
1624LJ130: TEST [DI]+WR_KEYCONF,WR_BCK ;check if backspace key pressed
1625 JE LJ160
1626;
1627 CMP ES:[SI]+ICB_CURCHAR,1 ;check if cursor is at first
1628 JA LJ140 ; field position
1629;
1630 TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
1631 JE LJ135 ;no ;=W
1632 OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
1633 JMP LJCUR ;=W
1634LJ135: ;=W
1635 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
1636 JE LJ137
1637 MOV AX,ES:[SI]+ICB_FIELDLEN ;get last position
1638 MOV ES:[SI]+ICB_CURCHAR,AX ;put as current position
1639 CALL CAL_COORS
1640 JMP LJEXIT
1641LJ137:
1642 CALL PCMBEEP_CALL ;error beep
1643 JMP LJEXIT ;exit
1644;
1645LJ140: DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position
1646 ; towards the left
1647 CALL CAL_COORS ;get cursor position ;=W
1648 CALL REMOVE_CHAR ;remove character at current offst
1649 ; and shift remaining in place
1650;
1651 CALL CAL_COORS ;get cursor position ;=W
1652 JMP LJ340 ;display field, set cursor, exit
1653;
1654; Process insert key toggle
1655;
1656LJ160: TEST [DI]+WR_KEYCONF,WR_INS ;check if insert key pressed
1657 JE LJ180 ; if not, continue
1658;
1659 TEST ES:[SI]+ICB_STATUS,ICB_SINS ;check if in insert mode ?
1660 JE LJ165 ;no, put in insert mode
1661;
1662 MOV BX,[DI]+IN_CURNOR ;set cursor size for normal
1663 MOV [DI]+WR_CURSIZE,BX ; cursor
1664;
1665 AND ES:[SI]+ICB_STATUS,NOT ICB_SINS
1666 JMP LJ170 ;turn insert mode off
1667;
1668LJ165: MOV BX,[DI]+IN_CURINS ;set cursor size for insert
1669 MOV [DI]+WR_CURSIZE,BX ; cursor
1670;
1671 OR ES:[SI]+ICB_STATUS,ICB_SINS
1672 ;turn insert mode on
1673;
1674LJ170:
1675;
1676 PUSH DS ;save registers
1677 PUSH DI
1678;
1679 MOV DI,40H ;point DS:DI to KB_FLAG in BIOS
1680 MOV DS,DI
1681 MOV DI,17H
1682 MOV AX,[DI] ;get current BIOS KB_FLAG
1683;
1684 AND AX,NOT WR_INSSTATE ;set BIOS insert active flag off
1685;
1686 TEST ES:[SI]+ICB_STATUS,ICB_SINS
1687 JE LJ175 ;check if insert should be set on
1688;
1689 OR AX,WR_INSSTATE ;set BIOS insert active flag on
1690;
1691LJ175: POP DI ;restore registers
1692 POP DS
1693;
1694 JMP LJEXIT ;exit
1695;
1696; Process allowonce key option
1697;
1698LJ180: ;
1699 ; insert or replace
1700 ;
1701;
1702 ;
1703 ; adjust input buffer
1704 ;
1705;
1706 ;
1707 ; check for field wrap, exit, error beep
1708 ;
1709;
1710 ;
1711 ; adjust cursor position
1712 ;
1713;
1714; Process allowed keystroke in replace mode
1715;
1716LJ190: TEST [DI]+WR_KEYCONF,WR_ALL ;check if allow key pressed
1717 JNE LJ195
1718;
1719 CALL PCMBEEP_CALL ;error beep key not defined
1720 JMP LJEXIT ;exit
1721;
1722LJ195: TEST ES:[SI]+ICB_STATUS,ICB_SINS
1723 JE LJ198 ;check if insert is active
1724;
1725 JMP LJ270 ;do insert display
1726;
1727LJ198:
1728 CALL CAL_COORS ;get cursor position ;=W
1729 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field
1730 JE LJ200
1731;
1732 CALL PCMBEEP_CALL ;error beep key not defined
1733 JMP LJEXIT ;exit
1734;
1735; Check if character to be replaced in field buffer is double byte character
1736;
1737LJ200: PUSH ES ;save registers
1738 PUSH SI
1739;
1740 PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer
1741 PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer
1742 POP SI
1743 POP ES
1744;
1745 ADD SI,[DI]+WR_CUBYTE ;add cursor offset into buffer
1746 DEC SI ;make zero based
1747;
1748 MOV CX,ES ;save offset of character to
1749 MOV DX,SI ; replace
1750;
1751 MOV AL,ES:[SI] ;get byte that cursor is pointing
1752 MOV [DI]+DBC_KS,AL ; to check if DBCS
1753 CALL PCINDBC_CALL ;call routine to check if char
1754 ; is lead double byte char
1755;
1756 POP SI ;restore registers
1757 POP ES
1758;
1759 TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS
1760 JE LJ220 ; if no, jump to single byte code
1761;
1762; Replace double byte character with double byte character
1763;
1764 TEST [DI]+WR_KEYCONF2,WR_DBC ;check if keystroke is DBC
1765 JE LJ210 ;continue with single byte
1766;
1767 MOV AX,[DI]+INC_KS ;set double byte character to
1768 ; input buffer replacing
1769 ; double byte character
1770 PUSH ES
1771 PUSH SI
1772;
1773 MOV ES,CX ;save offset of character to
1774 MOV SI,DX ; replace
1775 MOV ES:[SI],AX ;replace double byte
1776;
1777 POP SI ;restore registers
1778 POP ES
1779;
1780 JMP LJ260 ;exit
1781;
1782; Replace double byte character with single byte character
1783;
1784LJ210: MOV AX,[DI]+INC_KS ;get keystroke and replace double
1785 ; byte with single byte
1786;
1787 PUSH ES
1788 PUSH SI
1789;
1790 MOV ES,CX ;save offset of character to
1791 MOV SI,DX ; replace single byte
1792 MOV ES:[SI],AL
1793;
1794 POP SI ;restore registers
1795 POP ES
1796;
1797 MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte
1798 MOV [DI]+WR_RIGHTBYTE,AX
1799;
1800 MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove
1801 INC AX ;adjust past replaced leading byte ;=W
1802 MOV [DI]+WR_LEFTBYTE,AX ; trailing byte
1803;
1804 MOV BX,1 ;set number of positions to shift
1805 MOV AX,2 ;set option to shift left
1806 CALL SHIFT ;call shift 1 position toward left
1807 JMP LJ260 ;exit
1808;
1809; Replace single byte character with single byte character
1810;
1811LJ220: TEST [DI]+WR_KEYCONF2,WR_DBC ;check if double byte character
1812 JNE LJ230 ; continue with single byte
1813;
1814 MOV AX,[DI]+INC_KS ;get keystroke
1815;
1816 PUSH ES
1817 PUSH SI
1818;
1819 MOV ES,CX ;save offset of character to
1820 MOV SI,DX ; replace single byte
1821 MOV ES:[SI],AL
1822;
1823 POP SI ;restore registers
1824 POP ES
1825;
1826 JMP LJ260 ;exit
1827;
1828; Replace single byte character with double byte character
1829;
1830LJ230: MOV BX,ES:[SI]+ICB_CURCHAR ;set cursor character position
1831 MOV [DI]+WR_LEFTCHAR,BX ; to left marker
1832;
1833 CALL CAL_COORS ;get the current end of field ;=W
1834 ; coordinates
1835 MOV AX,[DI]+WR_ENCHAR ;get end character of field
1836 CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character
1837 JA LJ240
1838;
1839 MOV AX,ES:[SI]+ICB_CURCHAR ;cursor is past last char
1840;
1841LJ240: MOV [DI]+WR_RIGHTCHAR,AX ;set right marker
1842;
1843 MOV BX,1 ;One byte is already available
1844 ; check if room for trailing byte
1845 MOV AX,1 ;set up call to LEFT_DISP to
1846 CALL WORD PTR [DI]+WR_DISPLAY ; determine if additional byte
1847 ; will fit in input buffer
1848 CMP AX,0 ;check if double byte character
1849 JE LJ250 ; will fit
1850;
1851 CALL PCMBEEP_CALL ;error beep because replace char
1852 JMP LJEXIT ; will not fit and exit
1853;
1854LJ250: MOV BX,ES:[SI]+ICB_FIELDLEN ;set ending byte
1855 MOV [DI]+WR_RIGHTBYTE,BX
1856;
1857 MOV BX,[DI]+WR_CUBYTE ;set markers for shift to remove
1858 INC BX ;adjust past replaced leading byte
1859 MOV [DI]+WR_LEFTBYTE,BX ; trailing byte
1860;
1861 MOV BX,1 ;set number of positions to shift
1862 MOV AX,1 ;set option to shift right
1863 CALL SHIFT ;call shift 1 position toward
1864 ; left
1865 MOV AX,[DI]+INC_KS ;get keystroke
1866;
1867 PUSH ES
1868 PUSH SI
1869;
1870 MOV ES,CX ;save offset of character to
1871 MOV SI,DX ; replace double byte
1872 MOV ES:[SI],AX
1873;
1874 POP SI ;restore registers
1875 POP ES
1876;
1877; Calculate new ending and cursor coordinates
1878;
1879LJ260:
1880 MOV BX,[DI]+WR_ENCHAR ;set rightmost area to refresh on ;=W
1881 CALL CAL_COORS ;get new end coordinates ;=W
1882 CMP BX,[DI]+WR_ENCHAR ;is old END_CHAR > new END_CHAR ? ;=W
1883 JG LJ261 ;yes, use old END_CHAR (so display ;=W
1884 MOV BX,[DI]+WR_ENCHAR ; is updated correctly)
1885
1886LJ261: ;set rightmost area to refresh on ;=W
1887 MOV [DI]+WR_RIGHTDISP,BX ; display to new ending character
1888
1889 INC ES:[SI]+ICB_CURCHAR ;point to next char
1890
1891 CALL CAL_COORS ;get cursor position ;=W
1892 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
1893 JE LJ265 ;no ;=W
1894 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
1895 JE LJ262
1896 MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
1897 JMP LJ340 ;display field, set cursor, exit
1898LJ262:
1899 TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W
1900 JE LJ265 ;no ;=W
1901 OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
1902LJ265: ;=W
1903 JMP LJ340 ;display field, set cursor, exit
1904;
1905; Process allowed keystroke in insert mode
1906;
1907LJ270:
1908 CALL CAL_COORS ;get cursor position ;=W
1909 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field
1910 JE LJ280
1911;
1912 CALL PCMBEEP_CALL ;error beep key not defined
1913 JMP LJEXIT ;exit
1914;
1915; Check if enough room available to insert single or double byte character
1916;
1917LJ280:
1918 MOV CX,ES:[SI]+ICB_FIELDSEG ;get segment of input buffer
1919 MOV DX,ES:[SI]+ICB_FIELDOFF ;get offset of input buffer
1920;
1921 ADD DX,[DI]+WR_CUBYTE ;add cursor offset into buffer
1922 DEC DX ;make zero based
1923;
1924 MOV BX,1 ;initialize to single byte
1925;
1926 TEST [DI]+WR_KEYCONF2,WR_DBC ;check for double byte character
1927 JE LJ290
1928;
1929 MOV BX,2 ;reset to double byte character
1930;
1931LJ290: MOV AX,ES:[SI]+ICB_CURCHAR ;set cursor character position
1932 MOV [DI]+WR_LEFTCHAR,AX ; to left marker
1933;
1934 CALL CAL_COORS ;get the current end of field ;=W
1935 ; coordinates
1936 MOV AX,[DI]+WR_ENCHAR ;get end character of field
1937;
1938 CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character
1939 JA LJ300
1940;
1941 MOV AX,ES:[SI]+ICB_CURCHAR ;cursor is past last char
1942 DEC AX
1943;
1944LJ300: MOV [DI]+WR_RIGHTCHAR,AX ;set right marker
1945;
1946 MOV AX,1 ;set up call to LEFT_DISP to
1947 CALL WORD PTR [DI]+WR_DISPLAY ; determine if additional byte
1948 ; will fit in input buffer
1949 ; BX= number of bytes to insert
1950 CMP AX,0 ;check if double byte character
1951 JE LJ310 ; will fit
1952;
1953 CALL PCMBEEP_CALL ;error beep replace character
1954 JMP LJEXIT ; will not fit and exit
1955;
1956; Shift to insert single or double byte character, BX= # bytes to shift
1957;
1958LJ310: MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte to make room in
1959 MOV [DI]+WR_RIGHTBYTE,AX ; buffer by shifting characters
1960;
1961 MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove
1962 MOV [DI]+WR_LEFTBYTE,AX ; trailing byte
1963;
1964 MOV AX,1 ;set option to shift right, BX=
1965 ; number of bytes to insert
1966 CALL SHIFT ;call shift 1 position toward
1967 ; left
1968 MOV AX,[DI]+INC_KS ;get keystroke
1969;
1970; Insert single byte character
1971;
1972 CMP BX,2 ;check how many bytes should be
1973 JE LJ320 ; inserted
1974;
1975 PUSH ES
1976 PUSH SI
1977;
1978 MOV ES,CX ;save offset of character to
1979 MOV SI,DX ; replace single byte
1980 MOV ES:[SI],AL ;insert single byte character
1981;
1982 POP SI ;restore registers
1983 POP ES
1984;
1985 JMP LJ330
1986;
1987; Insert double byte character
1988;
1989LJ320: PUSH ES
1990 PUSH SI
1991;
1992 MOV ES,CX ;save offset of character to
1993 MOV SI,DX ; replace
1994 MOV ES:[SI],AX ;insert double byte character
1995;
1996 POP SI ;restore registers
1997 POP ES
1998;
1999; Calculate new ending and cursor coordinates
2000;
2001LJ330:
2002 CALL CAL_COORS ;get new end coordinates ;=W
2003;
2004 MOV AX,[DI]+WR_ENCHAR ;set rightmost area to refresh on
2005 MOV [DI]+WR_RIGHTDISP,AX ; display to old ending character
2006;
2007 INC ES:[SI]+ICB_CURCHAR ;point to next char
2008;
2009 CALL CAL_COORS ;get cursor position ;=W
2010 CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
2011 JE LJ340 ;no ;=W
2012 TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
2013 JE LJ335
2014 MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
2015 JMP LJ340 ;display field, set cursor, exit
2016LJ335:
2017 TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W
2018 JE LJ340 ;no ;=W
2019 OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
2020;
2021; Display field
2022;
2023LJ340:
2024 MOV AX,ES:[SI]+ICB_CURCHAR ;set left character to cursor
2025 DEC AX ; last cursor position
2026 MOV [DI]+WR_LEFTCHAR,AX
2027;
2028 MOV AX,[DI]+WR_RIGHTDISP ;set right character marker to ;=W
2029 MOV [DI]+WR_RIGHTCHAR,AX ; max possible field length
2030;
2031 CALL CAL_COORS ;get end of field char, byte ;=W
2032 ; and next byte positions
2033
2034 MOV AX,2 ;set display option
2035 CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer
2036 ; in left justified field
2037;
2038; Exit
2039;
2040LJEXIT: ;continue
2041 TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ?
2042 JNE LJCUR ;cursor is already on, don't turn it on ;=W
2043 CALL CURSOR ;display cursor ;=W
2044LJCUR:
2045;
2046 RET
2047LEFT_JUST ENDP
2048;-----------------------------------------------------------------------------+
2049; :
2050; CAL_COORS :
2051; :
2052; Calculates character coordinates based on the display format :
2053; currently active (windowing and horizontal display). :
2054; :
2055; The following examples demonstrate the values that are set on :
2056; exit from this routine: :
2057; :
2058; :
2059; Example: Horizontal field coordinates calculated. :
2060; :
2061; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :
2062; ³123456789012345678901234567890 :
2063; ³2 :
2064; ³3 [sLtLtssss....] :
2065; ^ :
2066; ³ ³ ³ :
2067; ³ ³ ÀÄ WR_ENCHAR = 7 :
2068; ³ ³ WR_ENBYTE = 9 :
2069; ³ ³ WR_RGCHAR = 7 :
2070; ³ ³ :
2071; ³ ÀÄÄÄÄÄÄ WR_CUCHAR = 3 :
2072; ³ WR_CUBYTE = 4 :
2073; ³ WR_UPCHAR = 3 :
2074; ³ WR_DNCHAR = 3 :
2075; ³ WR_CURROW = 3 :
2076; ³ WR_CURCOL = 13 :
2077; ³ :
2078; ÀÄÄÄÄÄÄÄÄÄ WR_LFCHAR = 1 :
2079; WR_HRCHAR = 1 :
2080; :
2081; :
2082; Example: Horizontal field scroll coordinates calculated: :
2083; :
2084; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :
2085; ³123456789012345678901234567890 :
2086; ³2 ÚÄÄÄÄÄ¿ :
2087; ³3 s³LtLt ³Ltsss..... :
2088; ³ÀÄÄÄÄÄÙ ³ :
2089; ³ ³ ^ ³ :
2090; ³ ³ ³ ³ :
2091; ³ ³ ³ À WR_ENCHAR = 7 :
2092; ³ ³ ³ WR_ENBYTE = 10 :
2093; ³ ³ ³ WR_RGCHAR = 7 :
2094; ³ ³ ³ :
2095; ³ ³ ÀÄÄÄÄÄÄÄÄ WR_CUCHAR = 3 :
2096; ³ ³ WR_CUBYTE = 4 :
2097; ³ ³ WR_UPCHAR = 3 :
2098; ³ ³ WR_DNCHAR = 3 :
2099; ³ ³ WR_CURROW = 3 :
2100; ³ ³ WR_CURCOL = 14 :
2101; ³ ³ :
2102; ³ ÀÄÄÄÄÄÄÄÄÄÄ WR_HRCHAR = 2 :
2103; ³ :
2104; ÀÄÄÄÄÄÄÄÄÄÄÄÄ WR_LFCHAR = 1 :
2105; :
2106; :
2107; :
2108; Example: Windowed field coordinates calculated. :
2109; :
2110; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :
2111; ³123456789012345678901234567890 :
2112; ³2 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ WR_LFCHAR= 6 :
2113; ³3 ³ ÚÄÄÄÄÄÄÄÄ WR_UPCHAR= 3 :
2114; ³4 ³ ÚÄijÄÄ¿ :
2115; ³5 ³ ³ABCDE³ :
2116; ³6 ÀÄÄFGHI.³ :
2117; ³7 ³ Ú³³ÀÄÄÄÄÄÄ WR_RGCHAR= 10 :
2118; ³8 Àij³ÀÄÄÄÄÄÄÄ WR_ENCHAR= 9 :
2119; ³9 ³³ :
2120; ³ÀÄÄÄÄÄÄÂÄ WR_CUCHAR= 8 :
2121; ³ ÃÄ WR_CURCOL= 24 :
2122; ³ ÀÄ WR_CURROW= 6 :
2123; ³ :
2124; ÀÄÄÄÄÄÄÄÄÄ WR_DNCHAR= 13 :
2125; :
2126; :
2127; Entry: ICB_CURCHAR = The character position into the input field from :
2128; which the exit coordinates will be calculated. :
2129; :
2130; WR_HRCHAR = The character position into the input field that :
2131; is currently the first displayed character of the :
2132; horizontal window. :
2133; :
2134; ICB_WIDTH = The width of windowed or horizontal scroll field. :
2135; :
2136; ICB_FIELDLEN = Input field buffer length. :
2137; :
2138; ICB_FIELDOFF = Input field buffer offset. :
2139; :
2140; ICB_FIELDSEG = Input field buffer segment. :
2141; :
2142; :
2143; Exit: WR_RGCHAR = Character offset into input buffer of the character :
2144; appearing at the beginning of the current line that :
2145; WR_CUCHAR is located on. :
2146; :
2147; WR_LFCHAR = Character offset into input buffer of the character :
2148; appearing at the end of the current line that :
2149; WR_CUCHAR is located on. :
2150; :
2151; WR_UPCHAR = Character offset into input buffer of the character :
2152; displayed directly above the position that :
2153; WR_CUCHAR is located on. :
2154; :
2155; WR_DNCHAR = Character offset into input buffer of the character :
2156; displayed directly below the position that :
2157; WR_CUCHAR is located on. :
2158; :
2159; WR_ENCHAR = Number of characters currently entered in the :
2160; field. This value may be less than the number :
2161; of bytes used to represent the characters if :
2162; double byte characters are present. :
2163; :
2164; WR_CURROW = Actual row offset into the video buffer of the :
2165; character specified by WR_CURCHAR. :
2166; :
2167; WR_CURCOL = Actual column offset into the video buffer of the :
2168; character specified by WR_CUCHAR. :
2169; :
2170; WR_ENBYTE = Number of bytes currently used to represent :
2171; entered characters in the buffer. This counter :
2172; can be used to calculate the current end :
2173; position of the entered data in the field. :
2174; :
2175; WR_CUBYTE = Number of bytes into input field where WR_CUCHAR :
2176; appears. :
2177; : ;=W
2178; WR_CUCHAR = Offset of current cursor position in input field. : ;=W
2179; : ;=W
2180; WR_HRBYTE = Number of bytes into input field where WR_HRCHAR :
2181; appears. :
2182; :
2183; WR_FIELDEND = Boolean flag, 0 = cursor not past end of field : ;=W
2184; 1 = cursor is past end of field : ;=W
2185; :
2186;-----------------------------------------------------------------------------+
2187;
2188CAL_COORS PROC NEAR
2189;
2190 PUSH AX ;save registers
2191 PUSH BX
2192 PUSH CX
2193 PUSH DX
2194 PUSH ES
2195 PUSH SI
2196 PUSH BP ;=W
2197; ;=W
2198; initialize general variables for all display modes ;=W
2199;
2200 MOV [DI]+WR_FIELDEND,0 ;initialize boolean flag that ;=W
2201 ;cursor is not past end of field ;=W
2202 MOV AX,ES:[SI]+ICB_CURCHAR ;get current char. offset ;=W
2203 MOV [DI]+WR_CUCHAR,AX ;save it ;=W
2204;
2205 MOV AX,ES:[SI]+ICB_ROW ;initialize row offset of field ;=W
2206 DEC AX ;=W
2207 MOV [DI]+WR_CURROW,AX ;char row offset inot video buf ;=W
2208 MOV AX,ES:[SI]+ICB_COL ;initialize col offset of field ;=W
2209 DEC AX ;=W
2210 MOV [DI]+WR_CURCOL,AX ;char col offset into video buf ;=W
2211;
2212 MOV [DI]+WR_LFCHAR,1 ;leftmost character possible char ;=W
2213 MOV [DI]+WR_RGCHAR,1 ;rightmost character possible char ;=W
2214 MOV [DI]+WR_ENBYTE,0 ;end byte of data in input buffer ;=W
2215 MOV [DI]+WR_ENCHAR,0 ;end character in input buffer ;=W
2216 MOV [DI]+WR_HRBYTE,1 ;byte of first char in horz. window ;=W
2217;
2218 MOV AX,[DI]+WR_CUCHAR ;get current position ;=W
2219 MOV [DI]+WR_UPCHAR,1 ;topmost char in current column ;=W
2220 MOV [DI]+WR_DNCHAR,1 ;bottommost char in current column ;=W
2221;
2222 MOV BP,0 ;have not found current char yet ;=W
2223 MOV CX,1 ;counter tracking number of bytes ;=W
2224 MOV DX,1 ;counter tracking number of chars ;=W
2225;
2226; Determine display format of field
2227;
2228 TEST ES:[SI]+ICB_OPT3,ICB_WIN ;check if windowing option on
2229 JE CC10
2230;
2231 JMP CC200 ;process window option
2232;
2233CC10: TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if horizontal scroll option
2234 JE CC20 ; on
2235;
2236 JMP CC100 ;process horizontal scroll
2237;
2238; Process fully displayed horizontal field
2239;
2240CC20: ;=W
2241 MOV [DI]+WR_HRCHAR,1 ;leftmost character possible char
2242;
2243; Examine the next byte in the input buffer
2244;
2245CC30: CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been
2246 JBE CC35 ; scanned and exit
2247;
2248 CMP BP,0 ;found current char yet ? ;=W
2249 JE CC40 ;no, find it ;=W
2250 JMP CCEXIT
2251;
2252CC35: PUSH ES ;save registers
2253 PUSH SI
2254;
2255 PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer
2256 PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer
2257 POP SI
2258 POP ES
2259;
2260 DEC CX ;make byte count zero based
2261 ADD SI,CX ;add byte count to input fld offst
2262 INC CX ;make byte count one based
2263 MOV AL,ES:[SI] ;get byte in input buffer to
2264 MOV [DI]+DBC_KS,AL ; check if DBCS
2265 CALL PCINDBC_CALL ;call routine to check if char
2266 ; is lead double byte char
2267;
2268 POP SI ;restore registers
2269 POP ES
2270;
2271; Check if end data byte and character should be updated
2272;
2273 CMP AL,WR_BLANK ;check if blanking character found
2274 JE CC40 ;now adjust pointers
2275;
2276 MOV [DI]+WR_ENBYTE,CX ;set current byte count
2277 MOV [DI]+WR_ENCHAR,DX ;set current character count
2278 MOV [DI]+WR_RGCHAR,DX ;set right most character
2279;
2280; Check if current character pointer
2281;
2282CC40: CMP [DI]+WR_CUCHAR,DX ;check if current character found
2283 JNE CC50
2284;
2285 MOV BP,1 ;current char found ;=W
2286 MOV [DI]+WR_UPCHAR,DX ;set up and down character
2287 MOV [DI]+WR_DNCHAR,DX ; to current character
2288;
2289 MOV [DI]+WR_CUBYTE,CX ;set current character byte count
2290 ADD [DI]+WR_CURCOL,CX ;set actual column of cursor based
2291 DEC [DI]+WR_CURCOL ; on current character byte count ;=W
2292;
2293; Increment pointers and counters to next character and byte position check
2294;
2295CC50: INC CX ;adjust byte counter
2296 INC DX ;adjust character counter
2297;
2298 TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte
2299 JE CC30
2300;
2301 INC CX ;adjust byte count for trail byte
2302 JMP CC30
2303
2304
2305
2306
2307
2308;
2309; Calculate horizontal scroll coordinates
2310;
2311CC100:
2312 MOV AX,[DI]+WR_CUCHAR ;initialize current character
2313 CMP AX,[DI]+WR_HRCHAR ;horizontal display position must
2314 JAE CC120 ; not be less than current char
2315 ; position
2316 MOV [DI]+WR_HRCHAR,AX ;set current char position as
2317 ; new horizontal position
2318;
2319; Examine the next byte in the input buffer
2320;
2321CC120: CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been
2322 JBE CC122 ; scanned and exit ;=W
2323;
2324 CMP BP,0 ;found current char yet ? ;=W
2325 JE CC130 ;no, find it ;=W
2326;
2327 JMP CCEXIT ;=W
2328CC122: ;=W
2329 PUSH ES ;save registers
2330 PUSH SI
2331;
2332 PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer
2333 PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer
2334 POP SI
2335 POP ES
2336;
2337 DEC CX ;make byte count zero based
2338 ADD SI,CX ;add byte count to input fld offst
2339 INC CX ;make byte count one based
2340 MOV AL,ES:[SI] ;get byte in input buffer to
2341 MOV [DI]+DBC_KS,AL ; check if DBCS
2342 CALL PCINDBC_CALL ;call routine to check if char
2343 ; is lead double byte char
2344;
2345 POP SI ;restore registers
2346 POP ES
2347; ;=W
2348; Set WR_HRBYTE to correct byte count ;=W
2349; ;=W
2350 CMP [DI]+WR_HRCHAR,DX ;is this position the first char ;=W
2351 ;in the horizl. window ? ;=W
2352 JNE CC125 ;no ;=W
2353;
2354 MOV [DI]+WR_HRBYTE,CX ;save # byte for first char in h. wind. ;=W
2355;
2356; Check if end data byte and character should be updated
2357;
2358CC125: CMP AL,WR_BLANK ;check if blanking character found
2359 JE CC130 ;now adjust pointers
2360;
2361 MOV [DI]+WR_ENBYTE,CX ;set current byte count
2362 MOV [DI]+WR_ENCHAR,DX ;set current character count
2363 MOV [DI]+WR_RGCHAR,DX ;set right most character
2364;
2365; Check if current character pointer
2366;
2367CC130: CMP [DI]+WR_CUCHAR,DX ;check if current character found
2368 JNE CC140
2369;
2370 MOV BP,1 ;current char found
2371 MOV [DI]+WR_UPCHAR,DX ;set up and down character
2372 MOV [DI]+WR_DNCHAR,DX ; to current character
2373;
2374 MOV [DI]+WR_CUBYTE,CX ;set current character byte count
2375 MOV BX,CX ;set actual column of cursor based ;=W
2376 ; on current character byte count ;=W
2377 SUB BX,[DI]+WR_HRBYTE ;subtract beginning of horiz. wind. ;=W
2378 ADD [DI]+WR_CURCOL,BX ;add to window offset = new column ;=W
2379;
2380; Increment pointers and counters to next character and byte position check
2381;
2382CC140: INC CX ;adjust byte counter
2383 INC DX ;adjust character counter
2384;
2385 TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte
2386 JE CC120
2387;
2388 INC CX ;adjust byte count for trail byte
2389 JMP CC120
2390
2391
2392
2393
2394
2395;
2396; Calculate windowing coordinates ;=W
2397;
2398CC200: ;=W
2399;
2400; Examine the next byte in the input buffer ;=W
2401;
2402 CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been ;=W
2403 JBE CC235 ; scanned and exit ;=W
2404;
2405 CMP BP,0 ;found current char yet ? ;=W
2406 JE CC240 ;no, find it ;=W
2407;
2408 JMP CCBYE ;boolean flag should have been set ;=W
2409 ; already, if needed ;=W
2410CC235: PUSH ES ;save registers ;=W
2411 PUSH SI ;=W
2412;
2413 PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W
2414 PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W
2415 POP SI ;=W
2416 POP ES ;=W
2417;
2418 DEC CX ;make byte count zero based ;=W
2419 ADD SI,CX ;add byte count to input fld offst ;=W
2420 INC CX ;make byte count one based ;=W
2421 MOV AL,ES:[SI] ;get byte in input buffer to ;=W
2422 MOV [DI]+DBC_KS,AL ; check if DBCS ;=W
2423 CALL PCINDBC_CALL ;call routine to check if char ;=W
2424 ; is lead double byte char ;=W
2425;
2426 POP SI ;restore registers ;=W
2427 POP ES ;=W
2428; ;=W
2429; Check if end data byte and character should be updated ;=W
2430; ;=W
2431 CMP AL,WR_BLANK ;check if blanking character found ;=W
2432 JE CC240 ;now adjust pointers ;=W
2433;
2434 MOV [DI]+WR_ENBYTE,CX ;set current byte count ;=W
2435 MOV [DI]+WR_ENCHAR,DX ;set current character count ;=W
2436 MOV [DI]+WR_RGCHAR,DX ;set right most character ;=W
2437; ;=W
2438; Check if current character pointer ;=W
2439; ;=W
2440CC240:
2441 CMP [DI]+WR_CUCHAR,DX ;check if current character found ;=W
2442 JNE CC250 ;no ;=W
2443;
2444 MOV BP,1 ;found current char
2445 MOV [DI]+WR_CUBYTE,CX ;set current character byte count ;=W
2446;
2447 PUSH DX ;needed for division ;=W
2448 MOV AX,CX ;get current cursor pos. in field ;=W
2449 DEC AX ;make it zero based for divide ;=W
2450;
2451 CMP CX,ES:[SI]+ICB_FIELDLEN ;are we past end of field ? ;=W
2452 JLE CC241 ;no ;=W
2453 MOV [DI]+WR_FIELDEND,1 ;yes, set boolean flag ;=W
2454 DEC AX ;make cursor pos. be inside field ;=W
2455 ; for division ;=W
2456 CWD ;calculate current row,column ;=W
2457 IDIV ES:[SI]+ICB_WIDTH ; row = cur_byte / width-1 ;=W
2458 ; col = cur_byte mod width-1 ;=W
2459 INC DX ;reposition cursor in correct pos. ;=W
2460 JMP CC244 ;=W
2461CC241: ;=W
2462 CWD ;calculate current row,column for ;=W
2463 IDIV ES:[SI]+ICB_WIDTH ; cursor positions inside the field ;=W
2464 ; row = cur_byte / width of field ;=W
2465 ; col = cur_byte mod width of field ;=W
2466CC244: ;=W
2467 ADD [DI]+WR_CURROW,AX ;set actual row of cursor ;=W
2468 ADD [DI]+WR_CURCOL,DX ;set actual column of cursor ;=W
2469;
2470 MOV BX,CX ;calculate WR_LFCHAR ;=W
2471CC245: DEC BX ;get the correct cur_byte ;=W
2472 MOV AX,BX ;cur_byte/width ;=W
2473 CWD ;=W
2474 IDIV ES:[SI]+ICB_WIDTH ;=W
2475 CMP DX,0 ;is the remainder zero ? ;=W
2476 JNE CC245 ;no, not at beginning of row, do again ;=W
2477;
2478 MOV [DI]+WR_LFCHAR,BX ;yes, this is beginning of row ;=W
2479;
2480 POP DX ;=W
2481;
2482; Increment pointers and counters to next character and byte position check ;=W
2483; ;=W
2484CC250: INC CX ;adjust byte counter ;=W
2485 INC DX ;adjust character counter ;=W
2486;
2487 TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte ;=W
2488 JE CC260 ;=W
2489;
2490 INC CX ;adjust byte count for trail byte ;=W
2491CC260:
2492 JMP CC200 ;=W
2493;
2494; Exit
2495;
2496CCEXIT: ;=W
2497 MOV AX,[DI]+WR_CUBYTE ;is cursor past end of field ;=W
2498 CMP AX,ES:[SI]+ICB_FIELDLEN ;?? ;=W
2499 JLE CCBYE ;no ;=W
2500;
2501 MOV [DI]+WR_FIELDEND,1 ;yes, set boolean flag ;=W
2502CCBYE:
2503 MOV AX,[DI]+WR_ENBYTE ;set ICB_ENDBYTE ;=W
2504 MOV ES:[SI]+ICB_ENDBYTE,AX ;=W
2505;
2506 MOV AX,[DI]+WR_HRBYTE ;set ICB_HRSTART ;=W
2507 MOV ES:[SI]+ICB_HRSTART,AX ;=W
2508;
2509 POP BP
2510 POP SI ;restore registers
2511 POP ES
2512 POP DX ;restore registers
2513 POP CX
2514 POP BX
2515 POP AX
2516;
2517 RET
2518CAL_COORS ENDP
2519;
2520PAGE ;=W
2521;-----------------------------------------------------------------------------+ ;=W
2522; : ;=W
2523; SET_DISP_ADDR : ;=W
2524; : ;=W
2525; Determine which display routine to use. The choice is between : ;=W
2526; left justified, right justified, double byte support, no double : ;=W
2527; byte support, windowing, horizontal scrolling. : ;=W
2528; Also pick the justify routine to use. : ;=W
2529; : ;=W
2530; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ : ;=W
2531; ³ DISPLAY ³ : ;=W
2532; ÀÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÙ : ;=W
2533; ÚÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ¿ : ;=W
2534; ÚÄÄÄÄÁÄÄÄÄ¿ ³ ³ ÚÄÄÄÄÁÄÄÄÄÄ¿ ³ ³ : ;=W
2535; ³LEFT_DISP³ ³ ³ ³RIGHT_DISP³ ³ ³ : ;=W
2536; ÀÄÄÄÄÄÄÄÄÄÙ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÙ ³ ³ : ;=W
2537; ÚÄÄÄÄÄÁÄÄÄÄÄ¿ ³ ÚÄÄÄÄÄÄÁÄÄÄÄÄ¿ ³ : ;=W
2538; ³LEFT_H_DISP³ ³ ³RIGHT_H_DISP³ ³ : ;=W
2539; ÀÄÄÄÄÄÄÄÄÄÄÄÙ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ : ;=W
2540; ÚÄÄÄÄÄÁÄÄÄÄ¿ ÚÄÄÄÄÄÄÁÄÄÄÄ¿ : ;=W
2541; ³LEFTS_DISP³ ³RIGHTS_DISP³ : ;=W
2542; ÀÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W
2543; : ;=W
2544; : ;=W
2545; : ;=W
2546; : ;=W
2547; : ;=W
2548; DISPLAY ROUTINES : ;=W
2549; LEFT_DISP - left justified, double byte support, windowing : ;=W
2550; LEFTS_DISP - left justified, no double byte support, windowing : ;=W
2551; LEFT_H_DISP - left justified, double byte support, horizontal scrolling : ;=W
2552; RIGHT_DISP - right justified, double byte support, windowing : ;=W
2553; RIGHTS_DISP - right justified, no double byte support, windowing : ;=W
2554; RIGHT_H_DISP - right justified, double byte support, horizontal scrolling : ;=W
2555; : ;=W
2556; JUSTIFY ROUTINES : ;=W
2557; LEFT_H_JUST - left justified, horizontal scrolling : ;=W
2558; LEFT_JUST - left justified, windowing : ;=W
2559; RIGHT_H_JUST - right justified, horizontal scrolling : ;=W
2560; RIGHT_JUST - right justified, windowing : ;=W
2561; : ;=W
2562; Entry: ES:SI - ICB control block : ;=W
2563; DS:DI - IN control block : ;=W
2564; Exit: none : ;=W
2565; : ;=W
2566;-----------------------------------------------------------------------------+ ;=W
2567; ;=W
2568SET_DISP_ADDR PROC NEAR ;=W
2569;
2570 PUSH AX ;=W
2571 PUSH BX ;=W
2572;
2573 TEST ES:[SI]+ICB_OPT1,ICB_RJU ;check if field right just ;=W
2574 JNE SD20 ;if yes, jump ;=W
2575;
2576; Display value of input buffer left justified ;=W
2577;
2578 TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if field is in horizontial ;=W
2579 JE SD10 ;no, windowing mode ;=W
2580;
2581 MOV AX,OFFSET LEFT_H_DISP ;=W
2582 MOV BX,OFFSET LEFT_H_JUST ;=W
2583;
2584 JMP SDEXIT ;=W
2585SD10: ;=W
2586 MOV AX,OFFSET LEFT_DISP ;=W
2587 MOV BX,OFFSET LEFT_JUST ;=W
2588;
2589 TEST DS:[DI]+IN_OPT,IN_ADBCS ;check if double byte is active ;=W
2590 JNE SDEXIT ;yes ;=W
2591 MOV AX,OFFSET LEFTS_DISP ;no, single byte only ;=W
2592 JMP SDEXIT ;=W
2593;
2594; Display default value of input buffer right justified ;=W
2595;
2596SD20: ;=W
2597 TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if field is in horizontial ;=W
2598 JE SD30 ;no, windowing mode ;=W
2599;
2600 MOV AX,OFFSET RIGHT_H_DISP ;=W
2601 MOV BX,OFFSET RIGHT_H_JUST ;=W
2602;
2603 JMP SDEXIT ;=W
2604SD30: ;=W
2605 MOV AX,OFFSET RIGHT_DISP ;=W
2606 MOV BX,OFFSET RIGHT_DISP ;=W
2607;
2608 TEST DS:[DI]+IN_OPT,IN_ADBCS ;check if double byte is active ;=W
2609 JNE SDEXIT ;yes ;=W
2610 MOV AX,OFFSET RIGHTS_DISP ;no, single byte only ;=W
2611;
2612SDEXIT: ;=W
2613 MOV DS:[DI]+WR_DISPLAY,AX ;save addr of routine to call ;=W
2614 MOV DS:[DI]+WR_JUSTIFY,BX ;save addr of routine to call ;=W
2615;
2616 POP BX ;=W
2617 POP AX ;=W
2618;
2619 RET ;=W
2620SET_DISP_ADDR ENDP ;=W
2621;
2622PAGE ;=W
2623;-----------------------------------------------------------------------------+ ;=W
2624; : ;=W
2625; RIGHTS_DISP : ;=W
2626; : ;=W
2627; Entry: : ;=W
2628; : ;=W
2629; Exit: : ;=W
2630; : ;=W
2631;-----------------------------------------------------------------------------+ ;=W
2632; ;=W
2633RIGHTS_DISP PROC NEAR ;=W
2634; ;=W
2635 ; ;=W
2636 ; code here ;=W
2637 ; ;=W
2638; ;=W
2639 RET ;=W
2640RIGHTS_DISP ENDP ;=W
2641;
2642PAGE
2643;-----------------------------------------------------------------------------+
2644; :
2645; RIGHT_H_DISP :
2646; :
2647; Entry: :
2648; :
2649; Exit: :
2650; :
2651;-----------------------------------------------------------------------------+
2652;
2653RIGHT_H_DISP PROC NEAR
2654;
2655 ;
2656 ; code here
2657 ;
2658;
2659 RET
2660RIGHT_H_DISP ENDP
2661;
2662PAGE ;=W
2663;-----------------------------------------------------------------------------+ ;=W
2664; : ;=W
2665; RIGHT_DISP : ;=W
2666; : ;=W
2667; Entry: : ;=W
2668; : ;=W
2669; Exit: : ;=W
2670; : ;=W
2671;-----------------------------------------------------------------------------+ ;=W
2672; ;=W
2673RIGHT_DISP PROC NEAR ;=W
2674; ;=W
2675 ; ;=W
2676 ; code here ;=W
2677 ; ;=W
2678; ;=W
2679 RET ;=W
2680RIGHT_DISP ENDP ;=W
2681; ;=W
2682PAGE ;=W
2683;-----------------------------------------------------------------------------+ ;=W
2684; : ;=W
2685; LEFT_H_DISP : ;=W
2686; : ;=W
2687; Calculates if the specified character will fit in the input : ;=W
2688; buffer at the specified character position without display. : ;=W
2689; The byte offset where this character should be inserted is : ;=W
2690; returned or a flag indicating that the character will not fit. : ;=W
2691; : ;=W
2692; Displays the specified portion of the input field buffer from : ;=W
2693; the left character marker to the end of the field. The following : ;=W
2694; display options are handled by this routine: : ;=W
2695; : ;=W
2696; - Display of the input field in a wrapped window : ;=W
2697; - Adjustment of double byte characters to prevent malformed : ;=W
2698; characters : ;=W
2699; : ;=W
2700; : ;=W
2701; The following pointers are used: : ;=W
2702; : ;=W
2703; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W
2704; ³ buffer in memory. : ;=W
2705; ³ : ;=W
2706; ³ ÚÄ (WR_HRCHAR) Left marker delimiting the left : ;=W
2707; ³ ³ most character position in the : ;=W
2708; ³ ³ input buffer. : ;=W
2709; ³ ³ : ;=W
2710; ³ ³ : ;=W
2711; ³ ³ : ;=W
2712; ³ ³ : ;=W
2713; ³ ³ : ;=W
2714; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
2715; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ : ;=W
2716; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
2717; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ : ;=W
2718; ³ ³ Area to display (ICB_WIDTH) : ;=W
2719; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W
2720; ³ : ;=W
2721; ICB_FIELDLEN Length of input field in bytes. : ;=W
2722; : ;=W
2723; : ;=W
2724; Entry: ES:SI = Points to current ICB : ;=W
2725; DS:DI = Points to PB : ;=W
2726; : ;=W
2727; WR_CATTR = Logical color attribute to use when updating screen : ;=W
2728; if the use of the color attribute string is not : ;=W
2729; specified. : ;=W
2730; : ;=W
2731; CR_RCOFF = Beginning offset of the upper left input field : ;=W
2732; display corner from the beginning of the video : ;=W
2733; buffer. : ;=W
2734; : ;=W
2735; CR_SCRWIDTH = Width of the video buffer in characters and : ;=W
2736; attributes. : ;=W
2737; : ;=W
2738; WR_HRCHAR = The offset into the input buffer, in characters, : ;=W
2739; of where to begin display. : ;=W
2740; : ;=W
2741; Exit: (none) : ;=W
2742;-----------------------------------------------------------------------------+ ;=W
2743; ;=W
2744LEFT_H_DISP PROC NEAR ;=W
2745;
2746 PUSH ES ;save PB pointers ;=W
2747 PUSH DI ;=W
2748 PUSH BX ;=W
2749 PUSH [DI]+CR_RCOFF ;save input field display offset ;=W
2750; ;=W
2751; Initialize MOVEG parm block ;=W
2752;
2753 MOV AX,ES:[SI]+ICB_FIELDOFF ;get offset of the input buffer ;=W
2754 MOV [DI]+WR_FIELDOFF,AX ;=W
2755 ;=W
2756 MOV AX,ES:[SI]+ICB_FIELDSEG ;get segment of the input buffer ;=W
2757 MOV [DI]+MG_TEXTSEG,AX ;=W
2758 ;=W
2759 MOV AX,ES:[SI]+ICB_ATTROFF ;get offset of color attribute buffer ;=W
2760 MOV [DI]+MG_ATTOFF,AX ;=W
2761 ;=W
2762 MOV AX,ES:[SI]+ICB_ATTRSEG ;get segment of color attribute ;=W
2763 MOV [DI]+MG_ATTSEG,AX ;buffer ;=W
2764 ;=W
2765 MOV AX,[DI]+IN_LVBSEG ;get segment of the LVB ;=W
2766 MOV [DI]+MG_MIXSEG,AX ;=W
2767 ;=W
2768 MOV AL,[DI]+WR_CATTR ;get logical color attribute ;=W
2769 MOV [DI]+MG_SOURCE_A,AL ;=W
2770; ;=W
2771; Display all characters in input buffer starting with WR_HRCHAR ;=W
2772; and continuing until ICB_WIDTH-1 number of characters has been displayed. ;=W
2773;
2774 MOV AX,ES:[SI]+ICB_FIELDOFF ;calcuate beginning character ;=W
2775 ADD AX,[DI]+WR_HRBYTE ;to display ;=W
2776 DEC AX ;=W
2777 MOV [DI]+WR_FIELDOFF,AX ;save it ;=W
2778 MOV [DI]+MG_TEXTOFF,AX ; to display ;=W
2779;
2780 MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W
2781 ;set write attribute option ;=W
2782 ;set use logical attribute option ;=W
2783 TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W
2784 JNE LHD10 ;=W
2785;
2786 OR [DI]+MG_OPT,MG_WC ;set write character option ;=W
2787LHD10: ;=W
2788 MOV AX,ES:[SI]+ICB_WIDTH ;get field width ;=W
2789 MOV [DI]+MG_NUM,AX ;number of words to move into the ;=W
2790 ; LVB ;=W
2791;
2792 MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W
2793 ADD AX,[DI]+CR_RCOFF ; the character to write ;=W
2794 MOV [DI]+MG_MIXOFF,AX ;=W
2795;
2796 CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W
2797; ;=W
2798; Check if last character is DBCS ;=W
2799; ;=W
2800 PUSH ES ;=W
2801 PUSH SI ;=W
2802;
2803 MOV AX,ES:[SI]+ICB_FIELDSEG ;get input buffer segment ;=W
2804 MOV BX,ES:[SI]+ICB_FIELDOFF ;get input buffer offset ;=W
2805 ADD BX,[DI]+WR_HRBYTE ;add offset of beginning of window ;=W
2806 ADD BX,ES:[SI]+ICB_WIDTH ;add width to get last character ;=W
2807 SUB BX,2 ;subtract to get correct byte ;=W
2808 MOV ES,AX ;=W
2809 MOV SI,BX ;=W
2810 MOV AL,ES:[SI] ;get the character ;=W
2811;
2812 POP SI ;=W
2813 POP ES ;=W
2814;
2815 PUSH AX ;=W
2816 MOV [DI]+DBC_KS,AL ;=W
2817 CALL PCINDBC_CALL ;check if char is lead DBCS ;=W
2818 POP AX ;=W
2819 TEST [DI]+DBC_STAT,DBC_DBCS ;is it ? ;=W
2820 JE LHD30 ;no, display the character ;=W
2821;
2822 MOV AL,1DH ;display '', can't split DBCS char ;=W
2823; ;=W
2824; Display the last character ;=W
2825; ;=W
2826LHD30: ;=W
2827 MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W
2828 ;set write attribute option ;=W
2829 ;set use logical attribute option ;=W
2830 TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W
2831 JNE LHD40 ;=W
2832;
2833 OR [DI]+MG_OPT,MG_WC+MG_UC ;set write character option ;=W
2834LHD40: ;=W
2835 MOV [DI]+MG_SOURCE_C,AL ;character to display ;=W
2836 MOV [DI]+MG_NUM,1 ;number of words to move into the ;=W
2837 ; LVB ;=W
2838;
2839 MOV AX,ES:[SI]+ICB_WIDTH ;add width to get last character ;=W
2840 MOV BX,2 ;=W
2841 MUL BX ;x2 to account for attr. bytes ;=W
2842 ADD AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W
2843 ADD AX,[DI]+CR_RCOFF ; the character to write ;=W
2844 SUB AX,2 ;subtract to get correct byte ;=W
2845 MOV [DI]+MG_MIXOFF,AX ;=W
2846;
2847 CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W
2848LHDEXIT: ;=W
2849 POP [DI]+CR_RCOFF ;save input field display offset ;=W
2850 POP BX ;restore registers ;=W
2851 POP DI ;=W
2852 POP ES ;=W
2853;
2854 RET ;=W
2855LEFT_H_DISP ENDP ;=W
2856;
2857PAGE
2858;-----------------------------------------------------------------------------+
2859; :
2860; LEFT_DISP :
2861; :
2862; Calculates if the specified character will fit in the input :
2863; buffer at the specified character position without display. :
2864; The byte offset where this character should be inserted is :
2865; returned or a flag indicating that the character will not fit. :
2866; :
2867; Displays the specified portion of the input field buffer from :
2868; the left character marker to the end of the field. The following :
2869; display options are handled by this routine: :
2870; :
2871; - Display of the input field in a wrapped window :
2872; - Adjustment of double byte characters to prevent malformed :
2873; characters :
2874; :
2875; :
2876; The following pointers are used: :
2877; :
2878; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input :
2879; ³ buffer in memory. :
2880; ³ :
2881; ³ ÚÄ (WR_LEFTCHAR) Left marker delimiting the left :
2882; ³ ³ most character position in the :
2883; ³ ³ input buffer. :
2884; ³ ³ :
2885; ³ ³ Right marker delimiting the right :
2886; ³ ³ most character position in the :
2887; ³ ³ input buffer. (WR_RIGHTCHAR) :
2888; ³ ³ ³ :
2889; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
2890; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ :
2891; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ :
2892; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ :
2893; ³ ³ Area to display :
2894; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :
2895; ³ :
2896; ICB_FIELDLEN Length of input field in bytes. :
2897; :
2898; :
2899; Entry: ES:SI = Points to current ICB :
2900; DS:DI = Points to PB :
2901; :
2902; AX 1 = This option will calculate if the specified number :
2903; of bytes in BX can fit into input buffer at the :
2904; specified character position considering the display :
2905; coordinates and options. No update of the display :
2906; screen will occur. A flag indicating if the bytes :
2907; can be inserted or not is returned. If the bytes :
2908; will fit the offset from the beginning of the input :
2909; field in bytes is returned indicating where the :
2910; characters should be inserted. :
2911; :
2912; 2 = This option will update the display screen in the :
2913; proper format with the input buffer characters :
2914; starting at the specified left offset character :
2915; to the right character marker. :
2916; :
2917; BX = Number of bytes to insert starting at the specified :
2918; character position. :
2919; :
2920; WR_CATTR = Logical color attribute to use when updating screen :
2921; if the use of the color attribute string is not :
2922; specified. :
2923; :
2924; CR_RCOFF = Beginning offset of the upper left input field :
2925; display corner from the beginning of the video :
2926; buffer. :
2927; :
2928; CR_SCRWIDTH = Width of the video buffer in characters and :
2929; attributes. :
2930; :
2931; WR_LEFTCHAR = The offset into the input buffer, in characters, :
2932; of where the specified bytes should fit. :
2933; :
2934; WR_RIGHTCHAR = The offset into the input buffer, in characters, :
2935; of where the right most character position. :
2936; :
2937; :
2938; Exit: If AX on entry is set to 1 then on exit: :
2939; :
2940; AX 0 = The specified number of characters will fit. :
2941; 1 = The specified number of characters will not fit. :
2942; :
2943; WR_LEFTBYTE = The offset into the input buffer, in bytes, of the :
2944; left most character position. :
2945; :
2946; WR_RIGHTBYTE = The offset into the input buffer, in bytes, of the :
2947; right most character position. :
2948; :
2949; :
2950; If AX on entry is set to 2 then the input field buffer is :
2951; displayed on the screen. :
2952; :
2953;-----------------------------------------------------------------------------+
2954;
2955LEFT_DISP PROC NEAR
2956;
2957 PUSH ES ;save PB pointers
2958 PUSH DI
2959 PUSH BX
2960 PUSH [DI]+CR_RCOFF ;save input field display offset
2961;
2962 CALL LEFT_DISP_INIT ;initialize internal counter & vars ;=W
2963;
2964 JMP LF20 ;begin of first row
2965;
2966; Start a new row in LVB
2967;
2968LF10: MOV AX,[DI]+CR_RCOFF ;set ptr into LVB to next row.
2969 ADD AX,[DI]+CR_SCRWIDTH ; Start with current position in
2970 SUB AX,ES:[SI]+ICB_WIDTH ; LVB, add screen width in text
2971 SUB AX,ES:[SI]+ICB_WIDTH ; and attributes, then subtract
2972 MOV [DI]+CR_RCOFF,AX ; the length of the input field
2973 ; twice since length is just in
2974 ; text chars
2975;
2976; Do not start new row
2977;
2978LF20: MOV AX,ES:[SI]+ICB_WIDTH ;counter contains number of bytes
2979 MOV [DI]+WR_CNTR2,AX ; available in current row of
2980 ; input field
2981;
2982; Prepare to place next byte into LVB, verify chars remaining in input buffer
2983;
2984LF30: MOV AX,[DI]+WR_CNTR3 ;check if last character has been
2985 CMP [DI]+WR_RIGHTCHAR,AX ; written in LVB (rightmost)
2986 JGE LF40 ;if not last char jump ?
2987;
2988 JMP LF160 ;yes, last character written
2989 ; prepare to exit
2990;
2991; Check if end of field on display has been reached
2992;
2993LF40: MOV AX,ES:[SI]+ICB_FIELDLEN ;loop if number chars moved is
2994 CMP [DI]+WR_CNTR1,AX ; less than input buffer length
2995 JLE LF50 ;
2996;
2997 JMP LF160
2998;
2999; Not complete
3000;
3001LF50: CMP [DI]+WR_CNTR2,0 ;loop while number of bytes
3002 JE LF10 ; remaining in the row is greater
3003 ; than zero, jump if bytes avail
3004;
3005 CMP [DI]+WR_MOVE,1 ;check if entry option is to
3006 JNE LF60 ; determine if bytes may be
3007 ; inserted in displayed field
3008;
3009 MOV AX,[DI]+WR_LEFTCHAR ;check if insertion calculations
3010 CMP [DI]+WR_CNTR3,AX ; should begin by comparing
3011 JNE LF60 ; current counter with beginning
3012 ; left character marker
3013;
3014 MOV AL,1 ;check if insertion calculations
3015 CMP [DI]+WR_INSDONE,AL ; are complete
3016 JE LF60 ;if yes, jump
3017;
3018; Adjust counters after pretending to insert a character into string and LVB
3019;
3020 MOV AX,[DI]+WR_BYTESINST ;dec number bytes avail in row
3021 ADD [DI]+WR_CNTR1,AX ;inc number bytes moved into LVB
3022 SUB [DI]+WR_CNTR2,AX ;dec number bytes remaining in row
3023 MOV [DI]+WR_INSDONE,1 ;set flag indicating insert calc
3024 JMP LF30 ; complete
3025;
3026; Determine if current byte is a DBCS lead byte
3027;
3028LF60: MOV BX,[DI]+WR_FIELDOFF ;get the current byte in the
3029;
3030 PUSH ES ;save registers
3031 PUSH SI
3032;
3033 PUSH ES:[SI]+ICB_FIELDSEG ; input field buffer
3034 PUSH [DI]+WR_FIELDOFF ;get the current byte in the
3035 POP SI
3036 POP ES
3037;
3038 MOV AL,ES:[SI] ;get character in input buffer
3039;
3040 POP SI ;restore registers
3041 POP ES
3042;
3043 MOV [DI]+DBC_KS,AL
3044;
3045 CALL PCINDBC_CALL ;call routine to check if char
3046 ; is lead double byte char
3047;
3048 TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS
3049 JNE LF70 ;if yes, jump to double byte code
3050;
3051 JMP LF130 ;if no, jump to single byte code
3052;
3053; Current byte is leading byte of a double byte character
3054;
3055LF70: CMP [DI]+WR_CNTR2,1 ;check if there is room in current
3056 JNE LF80 ; row for double byte character
3057;
3058 JMP LF110 ;no room, adjust to next row
3059;
3060; Double byte character fits on current row
3061;
3062LF80: CMP [DI]+WR_MOVE,2 ;check if option to actually
3063 JNE LF100 ; update display is active
3064;
3065 MOV AX,[DI]+WR_LEFTCHAR ;check if character should be
3066 CMP [DI]+WR_CNTR3,AX ; displayed by verifying that
3067 JL LF100 ; current character falls
3068 ; between the left and right
3069 MOV AX,[DI]+WR_RIGHTCHAR ; character markers
3070 CMP [DI]+WR_CNTR3,AX
3071 JG LF100
3072;
3073 MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s)
3074 MOV [DI]+MG_TEXTOFF,AX ; to display
3075;
3076 MOV [DI]+MG_OPT,MG_WA+MG_SC ;set write attribute option
3077;
3078 TEST ES:[SI]+ICB_OPT1,ICB_USC ;use attribute string
3079 JNE LF84
3080;
3081 OR [DI]+MG_OPT,MG_UA ;set use logical attribute option
3082;
3083LF84: TEST ES:[SI]+ICB_OPT1,ICB_PSW ;is option for password write
3084 JNE LF85 ; active
3085;
3086 OR [DI]+MG_OPT,MG_WC ;set write character option
3087;
3088LF85: MOV [DI]+MG_NUM,2 ;number of words to move into LVB
3089 MOV AX,[DI]+IN_LVBOFF ;set actual offset into LVB
3090 ADD AX,[DI]+CR_RCOFF ; where character(s) will be
3091 MOV [DI]+MG_MIXOFF,AX ; written
3092;
3093 CALL PCMOVEG_CALL ;call PCMOVEG to write characters
3094;
3095; Adjust pointers and counters after moving double byte character
3096;
3097LF100: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left
3098 CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and
3099 JNE LF104 ; left chars. See if the current
3100;
3101 MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so
3102 MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4,
3103 JMP LF106 ; into WR_LEFTBYTE
3104;
3105; Update right byte marker
3106;
3107LF104: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left
3108 CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and
3109 JNE LF106 ; left chars. See if the current
3110;
3111 MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so
3112 MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4,
3113 ; into WR_RIGHTBYTE
3114;
3115LF106: ADD [DI]+WR_FIELDOFF,2 ;inc number bytes moved from input
3116 ; buffer
3117 ADD [DI]+CR_RCOFF,4 ;inc pointer into LVB
3118 ADD [DI]+WR_CNTR1,2 ;inc number of bytes moved into
3119 ; LVB
3120 SUB [DI]+WR_CNTR2,2 ;dec number of bytes remain
3121 INC [DI]+WR_CNTR3 ;inc number of characters moved
3122 ; into LVB from input string
3123 ADD [DI]+WR_CNTR4,2 ;inc number of bytes moved from
3124 JMP LF30 ; input string
3125;
3126; Blank fill remaining screen character positions on current row to prevent
3127; double byte character from being split
3128;
3129LF110: CMP [DI]+WR_MOVE,2 ;check if option to update display
3130 JNE LF120 ; is active
3131;
3132 MOV AX,[DI]+WR_LEFTCHAR ;check if current character
3133 CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying
3134 JL LF120 ; that the character falls
3135 ; within the left and right
3136 MOV AX,[DI]+WR_RIGHTCHAR ; character markers
3137 CMP [DI]+WR_CNTR3,AX
3138 JG LF120
3139;
3140 MOV AL,WR_BLANK ;get blanking character
3141 MOV [DI]+MG_SOURCE_C,AL
3142;
3143 MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UC
3144 ;set write attr, char and syn chk
3145 TEST ES:[SI]+ICB_OPT1,ICB_USC
3146 JNE LF114 ;use attribute string
3147;
3148 OR [DI]+MG_OPT,MG_UA ;set use logical attribute option
3149;
3150LF114: TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active
3151 JNE LF115
3152;
3153 OR [DI]+MG_OPT,MG_WC ;set write character option
3154;
3155LF115: MOV [DI]+MG_NUM,1 ;number of words to move into the
3156 ; LVB
3157 MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of
3158 ADD AX,[DI]+CR_RCOFF ; the character to write
3159 MOV [DI]+MG_MIXOFF,AX
3160;
3161 CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s)
3162;
3163; Adjust pointers and counters after writing blanking character to LVB
3164;
3165LF120: ADD [DI]+CR_RCOFF,2 ;inc pointer into the LVB
3166 INC [DI]+WR_CNTR1 ;inc number of bytes moved into
3167 ; the LVB
3168 DEC [DI]+WR_CNTR2 ;dec number of bytes remaining in
3169 JMP LF10 ; the current row
3170;
3171; Byte is a single byte character
3172;
3173LF130: CMP [DI]+WR_MOVE,2 ;check if option to update display
3174 JNE LF150 ; is active
3175;
3176 MOV AX,[DI]+WR_LEFTCHAR ;check if current character
3177 CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying
3178 JL LF150 ; that the character falls
3179;
3180 MOV AX,[DI]+WR_RIGHTCHAR ; character markers
3181 CMP [DI]+WR_CNTR3,AX
3182 JG LF150
3183;
3184 MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s)
3185 MOV [DI]+MG_TEXTOFF,AX ; to display
3186;
3187 MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA
3188 ;set write attribute option
3189 ;set use logical attribute option
3190 TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active
3191 JNE LF135
3192;
3193 OR [DI]+MG_OPT,MG_WC ;set write character option
3194;
3195LF135: MOV [DI]+MG_NUM,1 ;number of words to move into the
3196 ; LVB
3197;
3198 MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of
3199 ADD AX,[DI]+CR_RCOFF ; the character to write
3200 MOV [DI]+MG_MIXOFF,AX
3201;
3202 CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s)
3203;
3204; Adjust pointers and counters after moving single byte character
3205;
3206LF150: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left
3207 CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and
3208 JNE LF154 ; left chars. See if the current
3209;
3210 MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so
3211 MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4,
3212 JMP LF156 ; into WR_LEFTBYTE
3213;
3214; Update right byte marker
3215;
3216LF154: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left
3217 CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and
3218 JNE LF156 ; left chars. See if the current
3219;
3220 MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so
3221 MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4,
3222 ; into WR_RIGHTBYTE
3223;
3224LF156: INC [DI]+WR_FIELDOFF ;inc pointer input buffer
3225 ADD [DI]+CR_RCOFF,2 ;inc pointer into LVB
3226 INC [DI]+WR_CNTR1 ;inc counter with number bytes
3227 ; moved into LVB
3228 DEC [DI]+WR_CNTR2 ;dec counter with number of bytes
3229 ; remaining in current row
3230 ADD [DI]+WR_CNTR3,1 ;inc counter with number of chars
3231 ; moved into the LVB from input
3232 ; buffer
3233 ADD [DI]+WR_CNTR4,1 ;inc counter with number of bytes
3234 JMP LF30 ; moved into the LVB from input
3235 ; buffer
3236;
3237; Completed updating LVB, adjust pointers
3238;
3239LF160: CMP [DI]+WR_MOVE,1 ;Check if option to calculate
3240 JNE LFEXIT ; if chars fit in buffer
3241;
3242; Set up proper return values for insert calculation
3243;
3244 MOV AX,1 ;set flag indicating insert did
3245 ; not fit
3246 MOV BX,[DI]+WR_CNTR3 ;see if input field fit into LVB
3247 DEC BX ; by comparing the right char
3248 CMP [DI]+WR_RIGHTCHAR,BX ; number with the number of chars
3249 JNE LFEXIT ; moved into the LVB. If they
3250 ; are equal the string fit into
3251 ; the LVB.
3252 CMP [DI]+WR_INSDONE,1 ;see if insert has been done
3253 JE LF170 ;if yes set up return values
3254;
3255 MOV BX,ES:[SI]+ICB_FIELDLEN ;if no, then insert is at end of
3256 SUB BX,[DI]+WR_CNTR1 ; line i.e. past right char
3257 INC BX ;see if there is enough room left
3258 CMP BX,[DI]+WR_BYTESINST ; to display char being inserted
3259 JL LFEXIT
3260;
3261LF170: MOV AX,0 ;set flag indicating insert fits
3262;
3263; Restores the registers to entry values and exits
3264;
3265LFEXIT: POP [DI]+CR_RCOFF ;save input field display offset
3266;
3267 POP BX ;restore registers
3268 POP DI
3269 POP ES
3270;
3271 RET
3272LEFT_DISP ENDP
3273;
3274PAGE
3275;-----------------------------------------------------------------------------+ ;=W
3276; : ;=W
3277; LEFTS_DISP (no double byte support) : ;=W
3278; : ;=W
3279; Calculates if the specified character will fit in the input : ;=W
3280; buffer at the specified character position without display. : ;=W
3281; The byte offset where this character should be inserted is : ;=W
3282; returned or a flag indicating that the character will not fit. : ;=W
3283; : ;=W
3284; Displays the specified portion of the input field buffer from : ;=W
3285; the left character marker to the end of the field. The following : ;=W
3286; display options are handled by this routine: : ;=W
3287; : ;=W
3288; - Display of the input field in a wrapped window : ;=W
3289; - Adjustment of double byte characters to prevent malformed : ;=W
3290; characters : ;=W
3291; : ;=W
3292; : ;=W
3293; The following pointers are used: : ;=W
3294; : ;=W
3295; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W
3296; ³ buffer in memory. : ;=W
3297; ³ : ;=W
3298; ³ ÚÄ (WR_LEFTCHAR) Left marker delimiting the left : ;=W
3299; ³ ³ most character position in the : ;=W
3300; ³ ³ input buffer. : ;=W
3301; ³ ³ : ;=W
3302; ³ ³ Right marker delimiting the right : ;=W
3303; ³ ³ most character position in the : ;=W
3304; ³ ³ input buffer. (WR_RIGHTCHAR) : ;=W
3305; ³ ³ ³ : ;=W
3306; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
3307; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ : ;=W
3308; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
3309; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ : ;=W
3310; ³ ³ Area to display : ;=W
3311; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W
3312; ³ : ;=W
3313; ICB_FIELDLEN Length of input field in bytes. : ;=W
3314; : ;=W
3315; : ;=W
3316; Entry: ES:SI = Points to current ICB : ;=W
3317; DS:DI = Points to PB : ;=W
3318; : ;=W
3319; AX 1 = This option will calculate if the specified number : ;=W
3320; of bytes in BX can fit into input buffer at the : ;=W
3321; specified character position considering the display : ;=W
3322; coordinates and options. No update of the display : ;=W
3323; screen will occur. A flag indicating if the bytes : ;=W
3324; can be inserted or not is returned. If the bytes : ;=W
3325; will fit the offset from the beginning of the input : ;=W
3326; field in bytes is returned indicating where the : ;=W
3327; characters should be inserted. : ;=W
3328; : ;=W
3329; 2 = This option will update the display screen in the : ;=W
3330; proper format with the input buffer characters : ;=W
3331; starting at the specified left offset character : ;=W
3332; to the right character marker. : ;=W
3333; : ;=W
3334; BX = Number of bytes to insert starting at the specified : ;=W
3335; character position. : ;=W
3336; : ;=W
3337; WR_CATTR = Logical color attribute to use when updating screen : ;=W
3338; if the use of the color attribute string is not : ;=W
3339; specified. : ;=W
3340; : ;=W
3341; CR_RCOFF = Beginning offset of the upper left input field : ;=W
3342; display corner from the beginning of the video : ;=W
3343; buffer. : ;=W
3344; : ;=W
3345; CR_SCRWIDTH = Width of the video buffer in characters and : ;=W
3346; attributes. : ;=W
3347; : ;=W
3348; WR_LEFTCHAR = The offset into the input buffer, in characters, : ;=W
3349; of where the specified bytes should fit. : ;=W
3350; : ;=W
3351; WR_RIGHTCHAR = The offset into the input buffer, in characters, : ;=W
3352; of where the right most character position. : ;=W
3353; : ;=W
3354; : ;=W
3355; Exit: If AX on entry is set to 1 then on exit: : ;=W
3356; : ;=W
3357; AX 0 = The specified number of characters will fit. : ;=W
3358; 1 = The specified number of characters will not fit. : ;=W
3359; : ;=W
3360; WR_LEFTBYTE = The offset into the input buffer, in bytes, of the : ;=W
3361; left most character position. : ;=W
3362; : ;=W
3363; WR_RIGHTBYTE = The offset into the input buffer, in bytes, of the : ;=W
3364; right most character position. : ;=W
3365; : ;=W
3366; : ;=W
3367; If AX on entry is set to 2 then the input field buffer is : ;=W
3368; displayed on the screen. : ;=W
3369; : ;=W
3370;-----------------------------------------------------------------------------+ ;=W
3371; ;=W
3372LEFTS_DISP PROC NEAR ;=W
3373;
3374 PUSH ES ;save PB pointers ;=W
3375 PUSH DI ;=W
3376 PUSH BX ;=W
3377 PUSH [DI]+CR_RCOFF ;save input field display offset ;=W
3378;
3379 CALL LEFT_DISP_INIT ;initialize internal counters & vars ;=W
3380;
3381 JMP LS20 ;begin of first row ;=W
3382; ;=W
3383; Start a new row in LVB ;=W
3384; ;=W
3385LS10: MOV AX,[DI]+CR_RCOFF ;set ptr into LVB to next row. ;=W
3386 ADD AX,[DI]+CR_SCRWIDTH ; Start with current position in ;=W
3387 SUB AX,ES:[SI]+ICB_WIDTH ; LVB, add screen width in text ;=W
3388 SUB AX,ES:[SI]+ICB_WIDTH ; and attributes, then subtract ;=W
3389 MOV [DI]+CR_RCOFF,AX ; the length of the input field ;=W
3390 ; twice since length is just in ;=W
3391 ; text chars ;=W
3392; ;=W
3393; Do not start new row ;=W
3394; ;=W
3395LS20: MOV AX,ES:[SI]+ICB_WIDTH ;counter contains number of bytes ;=W
3396 MOV [DI]+WR_CNTR2,AX ; available in current row of ;=W
3397 ; input field ;=W
3398; ;=W
3399; Prepare to place next byte into LVB, verify chars remaining in input buffer ;=W
3400; ;=W
3401LS30: MOV AX,[DI]+WR_CNTR3 ;check if last character has been ;=W
3402 CMP [DI]+WR_RIGHTCHAR,AX ; written in LVB (rightmost) ;=W
3403 JGE LS40 ;if not last char jump ? ;=W
3404;
3405 JMP LS160 ;yes, last character written ;=W
3406 ; prepare to exit ;=W
3407; ;=W
3408; Check if end of field on display has been reached ;=W
3409; ;=W
3410LS40: MOV AX,ES:[SI]+ICB_FIELDLEN ;loop if number chars moved is ;=W
3411 CMP [DI]+WR_CNTR1,AX ; less than input buffer length ;=W
3412 JLE LS50 ; ;=W
3413;
3414 JMP LS160 ;=W
3415; ;=W
3416; Not complete ;=W
3417; ;=W
3418LS50: CMP [DI]+WR_CNTR2,0 ;loop while number of bytes ;=W
3419 JE LS10 ; remaining in the row is greater ;=W
3420 ; than zero, jump if bytes avail ;=W
3421;
3422 CMP [DI]+WR_MOVE,1 ;check if entry option is to ;=W
3423 JNE LS130 ; determine if bytes may be ;=W
3424 ; inserted in displayed field ;=W
3425;
3426 MOV AX,[DI]+WR_LEFTCHAR ;check if insertion calculations ;=W
3427 CMP [DI]+WR_CNTR3,AX ; should begin by comparing ;=W
3428 JNE LS130 ; current counter with beginning ;=W
3429 ; left character marker ;=W
3430;
3431 MOV AL,1 ;check if insertion calculations ;=W
3432 CMP [DI]+WR_INSDONE,AL ; are complete ;=W
3433 JE LS130 ;if yes, jump ;=W
3434; ;=W
3435; Adjust counters after pretending to insert a character into string and LVB ;=W
3436; ;=W
3437 MOV AX,[DI]+WR_BYTESINST ;dec number bytes avail in row ;=W
3438 ADD [DI]+WR_CNTR1,AX ;inc number bytes moved into LVB ;=W
3439 SUB [DI]+WR_CNTR2,AX ;dec number bytes remaining in row ;=W
3440 MOV [DI]+WR_INSDONE,1 ;set flag indicating insert calc ;=W
3441 JMP LS30 ; complete ;=W
3442; ;=W
3443; Byte is a single byte character ;=W
3444; ;=W
3445LS130: CMP [DI]+WR_MOVE,2 ;check if option to update display ;=W
3446 JNE LS150 ; is active ;=W
3447;
3448 MOV AX,[DI]+WR_LEFTCHAR ;check if current character ;=W
3449 CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying ;=W
3450 JL LS150 ; that the character falls ;=W
3451 ; within the left and right ;=W
3452 MOV AX,[DI]+WR_RIGHTCHAR ; character markers ;=W
3453 CMP [DI]+WR_CNTR3,AX ;=W
3454 JG LS150 ;=W
3455;
3456 MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s) ;=W
3457 MOV [DI]+MG_TEXTOFF,AX ; to display ;=W
3458;
3459 MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W
3460 ;set write attribute option ;=W
3461 ;set use logical attribute option ;=W
3462 TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W
3463 JNE LS135 ;=W
3464;
3465 OR [DI]+MG_OPT,MG_WC ;set write character option ;=W
3466;
3467LS135: MOV [DI]+MG_NUM,1 ;number of words to move into the ;=W
3468 ; LVB ;=W
3469;
3470 MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W
3471 ADD AX,[DI]+CR_RCOFF ; the character to write ;=W
3472 MOV [DI]+MG_MIXOFF,AX ;=W
3473;
3474 CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W
3475; ;=W
3476; Adjust pointers and counters after moving single byte character ;=W
3477; ;=W
3478LS150: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left ;=W
3479 CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and ;=W
3480 JNE LS154 ; left chars. See if the current ;=W
3481;
3482 MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so ;=W
3483 MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4, ;=W
3484 JMP LS156 ; into WR_LEFTBYTE ;=W
3485; ;=W
3486; Update right byte marker ;=W
3487; ;=W
3488LS154: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left ;=W
3489 CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and ;=W
3490 JNE LS156 ; left chars. See if the current ;=W
3491;
3492 MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so ;=W
3493 MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4, ;=W
3494 ; into WR_RIGHTBYTE ;=W
3495LS156: INC [DI]+WR_FIELDOFF ;inc pointer input buffer ;=W
3496 ADD [DI]+CR_RCOFF,2 ;inc pointer into LVB ;=W
3497 INC [DI]+WR_CNTR1 ;inc counter with number bytes ;=W
3498 ; moved into LVB ;=W
3499 DEC [DI]+WR_CNTR2 ;dec counter with number of bytes ;=W
3500 ; remaining in current row ;=W
3501 ADD [DI]+WR_CNTR3,1 ;inc counter with number of chars ;=W
3502 ; moved into the LVB from input ;=W
3503 ; buffer ;=W
3504 ADD [DI]+WR_CNTR4,1 ;inc counter with number of bytes ;=W
3505 JMP LS30 ; moved into the LVB from input ;=W
3506 ; buffer ;=W
3507; ;=W
3508; Completed updating LVB, adjust pointers ;=W
3509; ;=W
3510LS160: CMP [DI]+WR_MOVE,1 ;Check if option to calculate ;=W
3511 JNE LSEXIT ; if chars fit in buffer ;=W
3512; ;=W
3513; Set up proper return values for insert calculation ;=W
3514; ;=W
3515 MOV AX,1 ;set flag indicating insert did ;=W
3516 ; not fit ;=W
3517 MOV BX,[DI]+WR_CNTR3 ;see if input field fit into LVB ;=W
3518 DEC BX ; by comparing the right char ;=W
3519 CMP [DI]+WR_RIGHTCHAR,BX ; number with the number of chars ;=W
3520 JNE LSEXIT ; moved into the LVB. If they ;=W
3521 ; are equal the string fit into ;=W
3522 ; the LVB. ;=W
3523 CMP [DI]+WR_INSDONE,1 ;see if insert has been done ;=W
3524 JE LS170 ;if yes set up return values ;=W
3525;
3526 MOV BX,ES:[SI]+ICB_FIELDLEN ;if no, then insert is at end of ;=W
3527 SUB BX,[DI]+WR_CNTR1 ; line i.e. past right char ;=W
3528 INC BX ;see if there is enough room left ;=W
3529 CMP BX,[DI]+WR_BYTESINST ; to display char being inserted ;=W
3530 JL LSEXIT ;=W
3531;
3532LS170: MOV AX,0 ;set flag indicating insert fits ;=W
3533; ;=W
3534; Restores the registers to entry values and exits ;=W
3535; ;=W
3536LSEXIT: POP [DI]+CR_RCOFF ;save input field display offset ;=W
3537;
3538 POP BX ;restore registers ;=W
3539 POP DI ;=W
3540 POP ES ;=W
3541;
3542 RET ;=W
3543LEFTS_DISP ENDP ;=W
3544;
3545PAGE
3546;-----------------------------------------------------------------------------+ ;=W
3547; : ;=W
3548; DRAW_DEM : ;=W
3549; Draw a input field delimiter : ;=W
3550; : ;=W
3551; Entry: : ;=W
3552; ES:SI address of icon : ;=W
3553; GC_ROW - character row to display delimiter : ;=W
3554; GC_COL - character column to display delimiter : ;=W
3555; : ;=W
3556; Exit: None : ;=W
3557; : ;=W
3558;-----------------------------------------------------------------------------+ ;=W
3559DRAW_DEM PROC NEAR ;=W
3560;
3561 PUSH AX ;=W
3562 PUSH BX ;=W
3563 PUSH CX ;=W
3564 PUSH DX ;=W
3565 PUSH DI ;=W
3566 PUSH SI ;=W
3567 PUSH DS ;=W
3568 PUSH ES ;=W
3569 PUSH BP ;=W
3570;
3571 MOV BP,AX
3572;
3573 MOV DX,300H + graph_addr ;=W
3574 MOV AH,2 ; Write Mode 2 ;=W
3575 MOV AL,5 ; Write Mode Register ;=W
3576 OUT DX,AX ;=W
3577;
3578 MOV DL,seq_addr ;=W
3579 MOV AH,0FFH ;enable all maps ;=W
3580 MOV AL,s_map ;map mask ;=W
3581 OUT DX,AX ;set the registers ;=W
3582;
3583 MOV AX,[DI]+WR_ROWBYTES ;=W
3584 MOV BX,50H ;=W
3585 MUL BX ;=W
3586 ;=W
3587 MOV BX,[DI]+GC_ROW ;=W
3588 MUL BX ;=W
3589 ADD AX,[DI]+GC_COL ;=W
3590;
3591 MOV BH,[DI]+WR_CATTR ;get current color attribute ;=W
3592;
3593 CMP [DI]+WR_VIDMODE,11H ;check for graphics mode 11H
3594 JNE DD05 ;nop, continue
3595 MOV BH,0FH ;yes, mode 11 is only black &
3596;
3597DD05: MOV CL,4 ;count for shift ;=W
3598 SHR BX,CL ;separate background/foreground ;=W
3599 MOV CL,4 ;count for shift ;=W
3600 SHR BL,CL ;put in low order nibble ;=W
3601 XCHG BL,BH ;foreground/background are reversed ;=W
3602 ; for delimiter
3603; BL = background color, BH = foreground color
3604 CMP BP,02 ;check if we want to remove delimiters ;=W
3605 JNE DD10 ;no, ok ;=W
3606 MOV BH,BL ;make both background color ;=W
3607 ;=W
3608DD10: ;=W
3609 MOV CL,[DI]+WR_VIDMODE ;=W
3610 MOV DX,[DI]+IN_OPT
3611;
3612 PUSH ES ;make DS:SI point to bit maps ;=W
3613 POP DS ;=W
3614;
3615 MOV DI,AX ;=W
3616 MOV AX,0A000H ;=W
3617 MOV ES,AX ;=W
3618;
3619 TEST DX,IN_MCGA ;mode 11H, non-VGA hardware?
3620 JNE DD100 ;if so, go do it
3621;--------------------------------------------- ;=W
3622; Mode 10,11,12 with VGA : ;=W
3623;--------------------------------------------- ;=W
3624 MOV DX,300H + graph_addr ;graphics chip ;=W
3625 XOR CH,CH ;=W
3626;
3627 MOV AL,CL ;save vid mode
3628 MOV CL,0EH ;# pixel rows in delimiter ;=W
3629 CMP AL,10H ;are we in graphics mode 10H
3630 JE DD40 ;yes, # rows ok
3631 ADD CL,2 ;no, mode 11,12 have 16 pixel rows
3632DD40: ; instead of 14 pixel rows.
3633 MOV BP,02H ;# pixel columns/8 in delimiter ;=W
3634;
3635 MOV AH,0FFH ;=W
3636 MOV AL,g_bit_mask ;bit mask index ;=W
3637 OUT DX,AX ;set bit mask ;=W
3638DD50: ;=W
3639 PUSH CX ;=W
3640 PUSH DI ;=W
3641 MOV CX,BP ;=W
3642DD60: ;=W
3643 MOV AH,0FFH ;background ;=W
3644 MOV AL,g_bit_mask ;bit mask index ;=W
3645 OUT DX,AX ;set bit mask ;=W
3646;
3647 MOV AL,ES:[DI] ;latch data ;=W
3648 MOV ES:[DI],BH ;set the dot ;=W
3649;
3650 LODSB ;foreground ;=W
3651 XCHG AL,AH ;=W
3652;
3653 MOV AL,g_bit_mask ;bit mask index ;=W
3654 OUT DX,AX ;set bit mask ;=W
3655;
3656 MOV AL,ES:[DI] ;latch data ;=W
3657 MOV ES:[DI],BL ;set the dot ;=W
3658;
3659 INC DI ;=W
3660 LOOP DD60 ;=W
3661;
3662 POP DI ;=W
3663 ADD DI,LINELEN ;=W
3664 POP CX ;=W
3665 LOOP DD50 ;=W
3666 JMP DDEXIT ;=W
3667;--------------------------------------------- ;=W
3668; Mode 11H with no VGA : ;=W
3669;--------------------------------------------- ;=W
3670DD100: XOR CH,CH
3671 MOV CL,10H ;# pixel rows in delimiter
3672 MOV BP,02H ;# of pixel columns in delimiter
3673
3674DD110: PUSH CX
3675 PUSH DI
3676;
3677 MOV CX,BP
3678;
3679DD120: LODSB ;get icon row
3680;
3681DD130: XOR AL,0FFH
3682 MOV ES:[DI],AL ;set the dot
3683 INC DI
3684 LOOP DD120
3685;
3686 POP DI
3687;
3688 ADD DI,50H ;line length, 80
3689;
3690 POP CX
3691;
3692 LOOP DD110
3693;
3694DDEXIT: POP BP
3695 POP ES
3696 POP DS
3697 POP SI
3698 POP DI
3699 POP DX
3700 POP CX
3701 POP BX
3702 POP AX
3703;
3704 RET
3705DRAW_DEM ENDP
3706;
3707PAGE
3708;-----------------------------------------------------------------------------+ ;=W
3709; : ;=W
3710; GET_MONO_DOS : ;=W
3711; Get segment and offset of the DOS monocasing table and return it : ;=W
3712; : ;=W
3713; Entry: None : ;=W
3714; : ;=W
3715; Exit: None : ;=W
3716; : ;=W
3717;-----------------------------------------------------------------------------+ ;=W
3718GET_MONO_DOS PROC NEAR ;=W
3719;
3720 PUSH SI ;save registers ;=W
3721 PUSH ES ;=W
3722 PUSH DI ;=W
3723;
3724 MOV AH,65H ;extended country info ;=W
3725 MOV AL,02H ;get uppercase table ptrs ;=W
3726 MOV BX,-1 ;default code page ;=W
3727 MOV DX,-1 ;default country id ;=W
3728 MOV CX,05H ;# bytes returned ;=W
3729 PUSH DS ;=W
3730 POP ES ;ES:DI ptrs to return buffer ;=W
3731 MOV DI,OFFSET WR_CUCHAR ;use as temp buffer ;=W
3732;
3733 INT 21H ;=W
3734;
3735 INC DI ;skip info id ;=W
3736 MOV SI,DI ;we need DI so use SI ;=W
3737 POP DI ;=W
3738;
3739 MOV AX,WORD PTR [SI] ;get DOS monocasing table offset ;=W
3740 MOV [DI]+IN_MONOOFF,AX ;save it ;=W
3741 ADD SI,2 ;=W
3742 MOV AX,WORD PTR [SI] ;get DOS monocasing table segment ;=W
3743 MOV [DI]+IN_MONOSEG,AX ;save it ;=W
3744;
3745 POP ES ;restore registers ;=W
3746 POP SI ;=W
3747;
3748 RET ;=W
3749GET_MONO_DOS ENDP
3750;
3751PAGE
3752;-----------------------------------------------------------------------------+ ;=W
3753; : ;=W
3754; GET_DBCS : ;=W
3755; Get segment and offset of the DOS double byte support table. : ;=W
3756; : ;=W
3757; Entry: DS:DI : ;=W
3758; : ;=W
3759; Exit: None : ;=W
3760; : ;=W
3761;-----------------------------------------------------------------------------+ ;=W
3762GET_DBCS PROC NEAR ;=W
3763;
3764 PUSH SI
3765 PUSH ES ;=W
3766 PUSH DI ;=W
3767 PUSH DI ;=W
3768;
3769 MOV AH,65H ;get extended country info
3770 MOV AL,07H ;get DBCS environment table
3771 INT 21H ;DOS function call,vector returned
3772 ; in ES:DI
3773 POP SI ;ptr, SI -> IN_PB
3774 INC DI ;skip over id byte returned
3775 MOV AX,WORD PTR ES:[DI] ;get offset of DBCS table
3776 MOV [DI]+IN_DBCSOFF,AX ;save it
3777;
3778 ADD DI,2 ;skip over offset to get segment
3779 MOV BX,WORD PTR ES:[DI] ;get segment of DBCS table
3780 MOV [DI]+IN_DBCSSEG,BX ;save it
3781;
3782 POP DI
3783;
3784 MOV SI,AX ;Point to DBCS table to get length
3785 MOV ES,BX
3786 MOV AX,WORD PTR ES:[SI]
3787 MOV [DI]+IN_DBCSLEN,AX
3788 ADD [DI]+IN_DBCSOFF,2 ;change offset to point to table
3789;
3790 POP ES
3791 POP SI
3792;
3793 RET
3794GET_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 @@
1; SCCSID = @(#)pdb.asm 1.1 85/04/10
2BREAK <Process data block>
3
4;
5; Process data block (otherwise known as program header)
6;
7
8FilPerProc EQU 20
9
10Process_data_block STRUC
11PDB_Exit_Call DW ? ; INT int_abort system terminate
12PDB_block_len DW ? ; size of execution block
13 DB ?
14PDB_CPM_Call DB 5 DUP (?) ; ancient call to system
15PDB_Exit DD ? ; pointer to exit routine
16PDB_Ctrl_C DD ? ; pointer to ^C routine
17PDB_Fatal_abort DD ? ; pointer to fatal error
18;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
19; C A V E A T P R O G R A M M E R ;
20; ;
21PDB_Parent_PID DW ? ; PID of parent (terminate PID)
22PDB_JFN_Table DB FilPerProc DUP (?)
23 ; indices into system table
24; ;
25; C A V E A T P R O G R A M M E R ;
26;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
27PDB_environ DW ? ; seg addr of environment
28;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
29; C A V E A T P R O G R A M M E R ;
30; ;
31PDB_User_stack DD ? ; stack of self during system calls
32PDB_JFN_Length DW ? ; number of handles allowed
33PDB_JFN_Pointer DD ? ; pointer to JFN table
34PDB_Next_PDB DD ? ; pointer to nested PDB's
35PDB_PAD1 DB 14h DUP (?)
36; ;
37; C A V E A T P R O G R A M M E R ;
38;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
39PDB_Call_system DB 5 DUP (?) ; portable method of system call
40;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
41; C A V E A T P R O G R A M M E R ;
42; ;
43PDB_PAD2 DB 7h DUP (?)
44; ;
45; C A V E A T P R O G R A M M E R ;
46;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
47Process_data_block ENDS
48
49PDB_InterCon EQU BYTE PTR PDB_PAD1 ; 2/12/KK
50PDB_Append EQU BYTE PTR PDB_PAD1+1 ; 2/12/KK
51 \ 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 @@
1; Revised FOR KBX (ADD EQUATES FOR KB_FLAG_3) AEV 8-17-84
2;----------------------------------------------------------------------------
3; EQUATES :
4;----------------------------------------------------------------------------
5TTEST EQU 0 ; CONDITIONAL ASM (TEST2.SRC)
6KY_LOCK EQU 0 ; CONDITIONAL ASM (TEST2.SRC)
7KEY_NUMS EQU 0 ; CONDITIONAL ASM (KYBD.SRC)
8;----------------------------------------------------------------------------
9X287 EQU 0F0H ; MATH PROCESSOR
10;----------------------------------------------------------------------------
11LOOP_POST EQU 020H ; MFG LOOP POST JUMPER
12;----------------------------------------------------------------------------
13REFRESH_BIT EQU 010H ; REFRESH TEST BIT
14;----------------------------------------------------------------------------
15POST_SS EQU 0H ; POST STACK SEGMENT
16POST_SP EQU 8000H ; POST STACK POINTER
17TEMP_STACK_LO EQU 0FFFFH ;
18TEMP_STACK_HI EQU 0 ; SET PROTECTED MODE TEMP_SS
19 ; 0:FFFFH
20;----------------------------------------------------------------------------
21PORT_A EQU 60H ; 8042 KEYBOARD SCAN/DIAG OUTPUTS
22PORT_B EQU 61H ; 8042 READ WRITE REGISTER
23PARITY_ERR EQU 0C0H ; RAM/IO CHANNEL PARITY ERROR
24RAM_PAR_ON EQU 11110011B ; AND THIS VALUE
25RAM_PAR_OFF EQU 00001100B ; OR THIS VALUE
26IO_CHK EQU 01000000B ; IO CHECK?
27PRTY_CHK EQU 10000000B ; PARITY CHECK?
28
29STATUS_PORT EQU 64H ;8042 STATUS PORT
30OUT_BUF_FULL EQU 01H ; 0 = +OUTPUT BUFFER FULL
31INPT_BUF_FULL EQU 02H ; 1 = +INPUT BUFFER FULL
32SYS_FLAG EQU 04H ; 2 = -SYSTEM FLAG -POR/-SELF TEST
33CMD_DATA EQU 08H ; 3 = -COMMAND/+DATA
34KYBD_INH EQU 10H ; 4 = +KEYBOARD INHIBITED
35TRANS_TMOUT EQU 20H ; 5 = +TRANSMIT TIMEOUT
36RCV_TMOUT EQU 40H ; 6 = +RECEIVE TIME OUT
37PARITY_EVEN EQU 80H ; 7 = +PARITY IS EVEN
38SHUT_CMD EQU 0FEH ; CAUSE A SHUTDOWN COMMAND
39INTR_FACE_CK EQU 0ABH ; CHECK 8042 INTERFACE CMD
40KYBD_CLK_DATA EQU 0E0H ; GET KYBD CLOCK AND DATA CMD
41KYBD_CLK EQU 001H ; KEYBOARD CLOCK BIT 0
42;----------MANUFACTURING PORT------------------------------------------------
43MFG_PORT EQU 80H ; MANUFACTURING CHECKPOINT PORT
44;----------MANUFACTURING BIT DEFINITION FOR MFG_ERR_FLAG+1-------------------
45MEM_FAIL EQU 00000001B ; STORAGE TEST FAILED (ERROR 20X)
46PRO_FAIL EQU 00000010B ; VIRTUAL MODE TEST FAILED (ERROR 104)
47LMCS_FAIL EQU 00000100B ; LOW MEG CHIP SELECT FAILED (ERROR 109)
48KYCLK_FAIL EQU 00001000B ; KEYBOARD CLOCK TEST FAILED (ERROR 304)
49KY_SYS_FAIL EQU 00010000B ; KEYBOARD OR SYSTEM FAILED (ERROR 303)
50KYBD_FAIL EQU 00100000B ; KEYBOARD FAILED (ERROR 301)
51DSK_FAIL EQU 01000000B ; DISKETTE TEST FAILED (ERROR 601)
52KEY_FAIL EQU 10000000B ; KEYBOARD LOCKED (ERROR 302)
53;----------8042 INPUT PORT BIT DEFINITION------------------------------------
54BASE_RAM EQU 10H ;BASE R/W MEMORY
55MFG_JMP EQU 20H ;LOOP POST JUMPER
56DSP_JMP EQU 40H ;DISPLAY TYPE JUMPER
57KEY_BD_INHIB EQU 80H ;KEYBOARD INHIBIT SWITCH
58;----------8042 RAM DEFINITION-----------------------------------------------
59INH_KEYBOARD EQU 10H ;BYTE 0 BIT 4 OF 8042 RAM
60;-------------- COMMANDS ----------------------------------------------------
61READ_8042_RAM EQU 20H ; BITS 0-4 = ADDRESS (20-3F)
62WRITE_8042_RAM EQU 60H ;
63SELF_8042_TEST EQU 0AAH ; 8042 SELF TEST
64READ_8042_INPUT EQU 0C0H ; READ 8042 INPUT PORT
65ENA_KBD EQU 0AEH ; ENABLE KEYBOARD COMMAND
66DIS_KBD EQU 0ADH ; DISABLE KEYBOARD COMMAND
67ENABLE_BIT20 EQU 0DFH ; ENABLE ADDR LINE BIT 20
68DISABLE_BIT20 EQU 0DDH ; DISABLE ADDR LINE BIT 20
69;-------------- KEYBOARD/LED COMMANDS --------------------------------------
70KB_MENU EQU 0F1H ; SELECT MENU COMMAND
71KB_TYPA_RD EQU 0F3H ; SET TYPAMATIC RATE/DELAY RWV 10-07-85
72KB_ENABLE EQU 0F4H ; KEYBOARD ENABLE
73KB_MAKE_BREAK EQU 0F7H ; TYPAMATIC
74KB_ECHO EQU 0FEH ; ECHO COMMAND
75KB_RESET EQU 0FFH ; SELF DIAGNOSTIC COMMAND
76LED_CMD EQU 0EDH ; LED WRITE COMMAND
77;--------------- KEYBOARD RESPONSE -----------------------------------------
78KB_OK EQU 0AAH ; RESPONSE FROM SELF DIAG
79KB_ACK EQU 0FAH ; ACKNOWLEDGE FROM TRANSMISSION
80KB_OVER_RUN EQU 0FFH ; OVER RUN
81KB_RESEND EQU 0FEH ; RESEND REQUEST
82KB_BREAK EQU 0F0H ; KEYBOARD BREAK CODE
83;-------------- CMOS EQUATES -------------------------------------------------
84CMOS_PORT EQU 070H ; IO ADDRESS OF CMOS PORT
85CLK_UP EQU 08AH ; CLOCK UPDATE STATUS
86CMOS_ALARM EQU 08BH ;
87CMOS_BEGIN EQU 090H ;
88CMOS_END EQU 0ADH ;
89SHUT_DOWN EQU 08FH ; SHUTDOWN OFFSET
90BATTERY_COND_STATUS EQU 08DH ; BATTERY STATUS
91M_SIZE_HI EQU 0B1H ; IO MEMORY SIZE HIGH BYTE (POST)
92M_SIZE_LO EQU 0B0H ; IO MEMORY SIZE LO BYTE (POST)
93M1_SIZE_HI EQU 096H ; 0->640K CONFIG MEMORY SIZE (SETUP)
94M1_SIZE_LO EQU 095H ; LOW BYTE (SETUP)
95M2_SIZE_HI EQU 098H ; 640K->UP CONFIG MEMORY SIZE (SETUP)
96M2_SIZE_LO EQU 097H ; LOW BYTE (SETUP)
97C_EQUIP EQU 094H ; CMOS EQUIPMENT FLAG
98HD_FILE_TYPE EQU 092H ; HARD FILE TYPE BYTE
99PAGE
100;--------------- CMOS DIAG_STATUS ERROR FLAGS--------------------------------
101DIAG_STATUS EQU 08EH ; CMOS ADDRESS OF DIAG_STATUS
102BAD_BAT EQU 080H ; DEAD BATTERY
103BAD_CKSUM EQU 040H ; CHECKSUM ERROR
104BAD_CONFIG EQU 020H ; MINIMUM CONFIG USED INSTEAD OF CMOS
105W_MEM_SIZE EQU 010H ; MEMORY SIZE NOT EQUAL TO CONFIG
106HF_FAIL EQU 008H ; HARD FILE FAILURE ON INIT
107CMOS_CLK_FAIL EQU 004H ; CMOS CLK NOT UPDATING OR NOT VALID
108;--------------- CMOS INFORMATION FLAGS--------------------------------------
109INFO_STATUS EQU 0B3H ; CMOS ADDRESS OF INFO BYTE
110M640K EQU 080H ; 512K -> 640K CARD INSTALLED
111NEW_INST EQU 040H ; FLAG USED BY CMOS SETUP UTILITY
112HF_BOOT EQU 020H ; BOOT HARD FILE FLAG
113;--------------- INTERRUPT EQUATES ------------------------------------------
114INTA00 EQU 20H ; 8259 PORT
115INTA01 EQU 21H ; 8259 PORT
116EOI EQU 20H
117INTB00 EQU 0A0H ; 2ND 8259
118INTB01 EQU 0A1H ;
119INT_TYPE EQU 070H ; START OF 8259 INTERRUPT TABLE LOCATION
120INT_VIDEO EQU 010H ; VIDEO VECTOR
121;---------------------------------------------------------------------------
122TIMER EQU 40H
123TIM_CTL EQU 43H ; 8253 TIMER CONTROL PORT ADDR
124TIMER0 EQU 40H ; 8253 TIMER/CNTER 0 PORT ADDR
125TMINT EQU 01 ; TIMER 0 INTR RECVD MASK
126;--------------------------------------------------------------------------
127DMA08 EQU 08 ; DMA STATUS REG PORT ADDR
128DMA EQU 00 ; DMA CH.0 ADDR. REG PORT ADDR
129;--------------------------------------------------------------------------
130DMA18 EQU 0D0H ; 2ND DMA STATUS PORT ADDR
131DMA1 EQU 0C0H ; 2ND DMA CH.0 ADDR. REG PORT ADDR
132;--------------------------------------------------------------------------
133DMA_PAGE EQU 81H ; START OF DMA PAGE REGISTERS
134LAST_DMA_PAGE EQU 8FH ; LAST DMA PAGE REGISTER
135;--------------------------------------------------------------------------
136MAX_PERIOD EQU 540H
137MIN_PERIOD EQU 410H
138KBD_IN EQU 60H ; KEYBOARD DATA IN ADDR PORT
139KBDINT EQU 02 ; KEYBOARD INTR MASK
140KB_DATA EQU 60H ; KEYBOARD SCAN CODE PORT
141KB_CTL EQU 61H ; CONTROL BITS FOR KEYBOARD SENSE DATA
142KB_ERR EQU 80H ; KEYBOARD TRANSMIT ERROR FLAG
143;----- SHIFT FLAG EQUATES WITHIN KB_FLAG
144INS_STATE EQU 80H ; INSERT STATE IS ACTIVE
145CAPS_STATE EQU 40H ; CAPS LOCK STATE HAS BEEN TOGGLED
146NUM_STATE EQU 20H ; NUM LOCK STATE HAS BEEN TOGGLED
147SCROLL_STATE EQU 10H ; SCROLL LOCK STATE HAS BEEN TOGGLED
148ALT_SHIFT EQU 08H ; ALTERNATE SHIFT KEY DEPRESSED
149CTL_SHIFT EQU 04H ; CONTROL SHIFT KEY DEPRESSED
150LEFT_SHIFT EQU 02H ; LEFT SHIFT KEY DEPRESSED
151RIGHT_SHIFT EQU 01H ; RIGHT SHIFT KEY DEPRESSED
152;----- SHIFT FLAG EQUATES WITHIN KB_FLAG_1
153INS_SHIFT EQU 80H ; INSERT KEY IS DEPRESSED
154CAPS_SHIFT EQU 40H ; CAPS LOCK KEY IS DEPRESSED
155NUM_SHIFT EQU 20H ; NUM LOCK KEY IS DEPRESSED
156SCROLL_SHIFT EQU 10H ; SCROLL LOCK KEY IS DEPRESSED
157HOLD_STATE EQU 08H ; SUSPEND KEY HAS BEEN TOGGLED
158SYS_SHIFT EQU 04H ; SYSTEM KEY DEPRESSED AND HELD
159L_ALT_SHIFT EQU 02H ; LEFT ALT KEY DOWN RWV 8-28-85
160L_CTL_SHIFT EQU 01H ; LEFT CTL KEY DOWN RWV 8-28-85
161;---------------FLAGS WITHIN KB_FLAG_2
162KB_ERR EQU 80H ; KEYBOARD TRANSMIT ERROR FLAG
163KB_PR_LED EQU 40H ; MODE INDICATOR UPDATE
164KB_FE EQU 20H ; RESEND RECEIVED FLAG
165KB_FA EQU 10H ; ACK RECEIVED
166CIRCUS_SYSTEM EQU 08H ; CIRCUS SYSTEM INDICATOR
167KB_LEDS EQU 07H ; KEYBOARD LED STATE BITS
168; 04H ; CAPS LOCK INDICATOR
169; 02H ; NUM LOCK INDICATOR
170; 01H ; SCROLL LOCK INDICATOR
171;---------------FLAGS WITHIN KB_FLAG_3
172RD_ID EQU 80H ; DOING A READ ID (MUST BE BIT0) AEV
173LC_AB EQU 40H ; LAST CHAR WAS FIRST ID CHAR AEV
174SET_NUM_LK EQU 20H ; FORCE NUM LOCK IF RD ID & KBX AEV
175KBX EQU 10H ; ENHANCED KEYBOARD INSTALLED RWV 7-18-85
176R_ALT_SHIFT EQU 08H ; RIGHT ALT KEY DOWN RWV 7-18-85
177GRAPH_ON EQU 08H ; ALT GRAPHICS KEY DOWN (WT ONLY) AEV
178R_CTL_SHIFT EQU 04H ; RIGHT CTL KEY DOWN RWV 7-18-85
179LC_E0 EQU 02H ; LAST CODE WAS THE E0 HIDDEN CODE RWV 7-18-85
180LC_E1 EQU 01H ; LAST CODE WAS THE E1 HIDDEN CODE RWV 7-18-85
181;----- SCAN CODE EQUATES FOR THE KEYBOARD
182NUM_KEY EQU 69 ; SCAN CODE FOR NUMBER LOCK
183SCROLL_KEY EQU 70 ; SCAN CODE FOR SCROLL LOCK
184ALT_KEY EQU 56 ; SCAN CODE FOR ALTERNATE KEY
185CTL_KEY EQU 29 ; SCAN CODE FOR CONTROL KEY
186CAPS_KEY EQU 58 ; SCAN CODE FOR SHIFT LOCK
187LEFT_KEY EQU 42 ; SCAN CODE FOR LEFT SHIFT
188RIGHT_KEY EQU 54 ; SCAN CODE FOR RIGHT SHIFT
189INS_KEY EQU 82 ; SCAN CODE FOR INSERT KEY
190DEL_KEY EQU 83 ; SCAN CODE FOR DELETE KEY
191SYS_KEY EQU 84 ; SCAN CODE FOR SYSTEM KEY
192;-------------- ENHANCED KEYBOARD EQUATES
193ID_1 EQU 0ABH ; 1ST ID CHAR FOR KBX
194ID_2 EQU 041H ; 2ND ID CHAR FOR KBX AEV
195ID_2A EQU 054H ; ALTERNATE 2ND ID CHAR FOR KBX RWV 8-16-85
196F11_M EQU 87 ; F11 KEY MAKE
197F12_M EQU 88 ; F12 KEY MAKE
198MC_E0 EQU 224 ; GENERAL MARKER CODE
199MC_E1 EQU 225 ; PAUSE KEY MARKER CODE
200
201;-------------- DISKETTE EQUATES
202INT_FLAG EQU 080H ; INTERRUPT OCCURRENCE FLAG
203MOTOR_WAIT EQU 37 ; 2 SECS OF COUNTS FOR MOTOR TURN OFF
204TIME_OUT EQU 80H ; ATTACHMENT FAILED TO RESPOND
205BAD_SEEK EQU 40H ; SEEK OPERATION FAILED
206BAD_NEC EQU 20H ; NEC CONTROLLER HAS FAILED
207BAD_CRC EQU 10H ; BAD CRC ON DISKETTE READ
208DMA_BOUNDARY EQU 09H ; ATTEMPT TO DMA ACROSS 64K BOUNDARY
209BAD_DMA EQU 08H ; DMA OVERRUN ON OPERATION
210MEDIA_CHANGE EQU 06H ; MEDIA REMOVED ON DUAL ATTACH CARD
211RECORD_NOT_FND EQU 04H ; REQUESTED SECTOR NOT FOUND
212WRITE_PROTECT EQU 03H ; WRITE ATTEMPTED ON WRITE PROT DISK
213BAD_ADDR_MARK EQU 02H ; ADDRESS MARK NOT FOUND
214BAD_CMD EQU 01H ; BAD COMMAND PASSED TO DISKETTE I/O
215
216XRATE EQU 02H ; 250KBS DATA TRANSFER RATE
217DUAL EQU 01H ; DUAL ATTACH CARD PRESENT FLAG
218
219DSK_CHG EQU 080H ; DISKETTE CHANGE FLAG MASK BIT
220STATE_MSK EQU 007H ; USED TO STRIP OFF STATE OF MEDIA
221REV_STATE EQU 0F8H ; USED AS MASK FOR STATE BITS
222DETERMINED EQU 010H ; SET STATE DETERMINED IN STATE BITS
223TRAN_MSK EQU 03H ; ISOLATE SHIFTED TRANSFER RATE BITS
224DOUBLE_STEP EQU 020H ; MASK TO TURN ON DOUBLE STEPPING
225MOTOR_MSK EQU 0F0H ; MASK TO CLEAR MOTOR ON BITS
226MAX_DRV EQU 002H ; MAX NUMBER OF DRIVES
227;HOME EQU 010H ; TRACK 0 MASK
228SENSE_DRV_ST EQU 004H ; SENSE DRIVE STATUS COMMAND
229ONE EQU 001H ; SEEK ONE TRACK
230TRK_SLAP EQU 030H ; CRASH STOP (48 TPI DRIVES)
231QUIET_SEEK EQU 00AH ; SEEK TO TRACK 10
232HD12_SETTLE EQU 015D ; 1.2 M HEAD SETTLE TIME
233HD320_SETTLE EQU 020D ; 320 K HEAD SETTLE TIME
234WRITE_OP EQU 080H ; WRITE OPERATION FLAG
235DD_MASK EQU 010H ; MASK TO INDICATE DRIVE IS 80 TRACKS
236PAGE
237;------ DISK CHANGE LINE EQUATES
238NOCHGLN EQU 001H ; NO DISK CHANGE LINE AVAILABLE
239CHGLN EQU 002H ; DISK CHANGE LINE AVAILABLE
240;------ MEDIA/DRIVE STATE INDICATORS
241M326D326 EQU 093H ; STATE MACHINE - 320/360 MEDIA/DRIVE
242M326D12 EQU 074H ; STATE MACHINE - 320/360 MEDIA,1.2DRIVE
243M12D12 EQU 015H ; STATE MACHINE - 1.2 MEDIA/DRIVE
244POA_DUAL EQU 061H ; 300K DATA TRANSFER RATE & STATE 1
245POA_START EQU 080H ; 250K DATA TRANSFER RATE & STATE 0
246TRK_80 EQU 008H ; DISKETTE DRIVE HAS 80 TRACKS
247;------ CMOS NON-VOLATILE RAM EQUATES
248CMOSDSB_ADDR EQU 00EH ; DISKETTE STATUS BYTE ADDRESS
249CADR_PRT EQU 070H ; CMOS ADDRESS PORT ADDRESS
250CDATA_PRT EQU 071H ; CMOS DATA PORT ADDRESS
251CMOS_GOOD EQU 0C0H ; BATTERY AND CHECKSUM INDICATOR
252CMOSDSK_BYTE EQU 010H ; DISKETTE BYTE ADDRESS
253LOWNIB EQU 00FH ; ISOLATE LOW NIBBLE IN REGISTER MASK
254INVALID_DRV EQU 002H ; FIRST INVALID DISKETTE TYPE
255;----------------------------------------
256; TIMER DATA AREA :
257;----------------------------------------
258; COUNTS_SEC EQU 18
259; COUNTS_MIN EQU 1092
260; COUNTS_HOUR EQU 65543
261; COUNTS_DAY EQU 1573040 = 1800B0H
262PAGE
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 @@
1TITLE PRINTF ROUITNE FOR MS-DOS
2;
3; PRINTF(Control String, arg1, arg2,...,argn-1,argn)
4;
5; Characters are output to PFHandle according to the
6; specifications contained in the Control String.
7;
8; The conversion characters are as follow:
9;
10; %c - output the next argument as a character
11; %s - output the next argument as a string
12; %x - output the next argument as a hexidecimal number
13; using abcedf
14; %X - output the next argument as a hexidecimal number
15; using ABCDEF
16; %d - output the next argument as a decimal number
17;
18;
19; Other format specifiers that may precede the conversion character are:
20;
21; - (minus sign) - causes the field to be left-adjusted
22; + (plus sign) - causes the field to be right-adjusted (default)
23; n - digit specifing the minimum field width (default to 1)
24; L - specifing a long integer
25;
26; On entry to PRINTF the stack contains the return address and a pointer
27; to an argument list.
28;
29; ____________________
30; | Ret Addr | <= SP
31; --------------------
32; | Ptr to Arg List |
33; --------------------
34;
35; And the argument list contains the following:
36;
37; String_ptr (a pointer to the control string)
38; Arg 1
39; Arg 2
40; .
41; .
42; .
43; Arg n-1
44; Arg n
45;
46; If the argument is a %s or %c the arg contains a pointer to the string
47; or character.
48;
49; The arguments are used in one-to-one correspondence to % specifiers.
50
51.xlist
52.xcref
53 INCLUDE dossym.asm
54.cref
55.list
56
57printf_CODE SEGMENT public byte
58ASSUME CS:PRINTF_CODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
59
60 PUBLIC PRINTF, PFHandle
61 PUBLIC PRINTF_LAST
62
63PFHandle DW 1
64PRINTF_LEFT DB 0
65PRINTF_LONG DB 0
66PRINTF_HEX DB 0
67TABLE_INDEX DB 0
68S_FLAG DB 0
69PRINTF_WIDTH DW 0
70PRINTF_BASE DW 0
71PAD_CHAR DB " "
72
73PRINTF_TABLE DB "0123456789ABCDEFabcdef"
74
75PRINTF_STACK STRUC
76OLDES DW ?
77OLDDS DW ?
78OLDSI DW ?
79OLDDI DW ?
80OLDAX DW ?
81OLDBX DW ?
82OLDCX DW ?
83OLDDX DW ?
84OLDBP DW ?
85OLDCS DW ?
86OLDIP DW ?
87STRING DW ?
88PRINTF_STACK ENDS
89
90PRINTF_ARGS STRUC
91CONSTR DW ?
92ARG DW ?
93PRINTF_ARGS ENDS
94
95RET_ADDR1 DW ?
96RET_ADDR2 DW ?
97
98BUFSIZ = 20
99PRINTF_BUF DB BUFSIZ DUP (?)
100 db 0 ;This buffer is always nul terminated
101BUFEND DW $-PRINTF_BUF
102
103PRINTF proc far
104 PUSH BP ;Save the callers' registers
105 PUSH DX
106 PUSH CX
107 PUSH BX
108 PUSH AX
109 PUSH DI
110 PUSH SI
111 PUSH ES
112 PUSH DS
113 MOV BP,SP
114 PUSH CS
115 POP ES ;ES points to Printf segment
116 MOV DI,OFFSET PRINTF_BUF ;DI points to the output buffer
117 MOV BP,[BP.STRING] ;BP points to the argument list
118 MOV SI,DS:[BP] ;SI points to the control string
119 XOR BX,BX ;BX is the index into the arg list
120 CALL Clear_flags ; initialize the world
121GET_CHAR:
122 LODSB ;Get a character
123 CMP AL,"%" ;Is it a conversion specifier?
124 JZ CONV_CHAR ;Yes - find out which one
125 OR AL,AL ;Is it the end of the control string?
126 JZ PRINTF_DONE ;Yes - then we're done
127 CALL OUTCHR ;Otherwise store the character
128 JMP SHORT GET_CHAR ;And go get another
129
130PRINTF_DONE:
131 CALL FLUSH
132 POP DS
133 POP ES
134 POP SI
135 POP DI
136 POP AX
137 POP BX
138 POP CX
139 POP DX
140 POP BP
141 POP CS:[RET_ADDR1] ;Fix up the stack
142 POP CS:[RET_ADDR2]
143 POP AX
144 PUSH CS:[RET_ADDR2]
145 PUSH CS:[RET_ADDR1]
146 RET
147
148printf endp
149
150PRINTF_PERCENT:
151 CALL OUTCHR
152 JMP GET_CHAR
153
154CONV_CHAR:
155 ;Look for any format specifiers preceeding the conversion character
156 LODSB
157 CMP AL,"%" ;Just print the %
158 JZ PRINTF_PERCENT
159 CMP AL,"-" ;Right justify the field
160 JZ LEFT_ADJ
161 CMP AL,"+" ;Left justify the field
162 JZ NXT_CONV_CHAR
163 CMP AL,"L" ;Is it a long integer
164 JZ LONG_INT
165 CMP AL,"l"
166 JZ LONG_INT
167 CMP AL,"0" ;Is it a precision specification
168 JB LOOK_CONV_CHAR
169 CMP AL,"9"
170 JA LOOK_CONV_CHAR
171 CMP AL,"0"
172 JNZ NOT_PAD
173 CMP CS:[PRINTF_WIDTH],0
174 JNZ NOT_PAD
175 MOV CS:BYTE PTR [PAD_CHAR],"0"
176NOT_PAD:
177 PUSH AX ;Adjust decimal place on precision
178 MOV AX,10
179 MUL CS:[PRINTF_WIDTH]
180 MOV CS:[PRINTF_WIDTH],AX
181 POP AX
182 XOR AH,AH
183 SUB AL,"0"
184 ADD CS:[PRINTF_WIDTH],AX ;And save the total
185 JMP SHORT NXT_CONV_CHAR
186
187 ;Set the correct flags for the options in a conversion
188
189LEFT_ADJ:
190 INC CS:BYTE PTR[PRINTF_LEFT]
191 JMP SHORT NXT_CONV_CHAR
192
193LONG_INT:
194 INC CS:BYTE PTR[PRINTF_LONG]
195NXT_CONV_CHAR:
196 JMP CONV_CHAR
197
198 ;Look for a conversion character
199
200LOOK_CONV_CHAR:
201 CMP AL,"X"
202 JZ HEX_UP
203
204 ;Make all other conversion characters upper case
205
206 CMP AL,"a"
207 JB CAPS
208 CMP AL,"z"
209 JG CAPS
210 AND AL,0DFH
211CAPS:
212 CMP AL,"X"
213 JZ HEX_LO
214 CMP AL,"D"
215 JZ DECIMAL
216 CMP AL,"C"
217 JZ C_PUT_CHAR
218 CMP AL,"S"
219 JZ S_PUT_STRG
220
221 ;Didn't find any legal conversion character - IGNORE it
222
223 call clear_flags
224 jmp get_char
225
226HEX_LO:
227 MOV CS:[TABLE_INDEX],6 ;Will print lower case hex digits
228HEX_UP:
229 MOV CS:[PRINTF_BASE],16 ;Hex conversion
230 JMP CONV_TO_NUM
231
232DECIMAL:
233 MOV CS:[PRINTF_BASE],10 ;Decimal conversion
234 JMP CONV_TO_NUM
235
236S_PUT_STRG:
237 INC CS:[S_FLAG] ;It's a string specifier
238C_PUT_CHAR:
239 PUSH SI ;Save pointer to control string
240 MOV SI,BX
241 ADD BX,2
242 MOV SI,ds:[BP+SI.ARG] ;Point to the % string or character
243 CMP BYTE PTR CS:[S_FLAG],0
244 JNZ S_PUT_1
245 LODSB
246 cmp al,0
247 jz short c_s_end
248 CALL OUTCHR ;Put it into our buffer
249 JMP SHORT C_S_END
250
251S_PUT_1:
252 mov cx,cs:[printf_width]
253 or cx,cx
254 jz s_put_2
255 cmp cs:byte ptr[printf_left],0
256 jnz s_put_2
257 push si
258 call Pad_string
259 pop si
260s_put_2:
261 push si
262s_put_3:
263 LODSB ;Put them all in our buffer
264 CMP AL,0
265 jz s_put_4
266 CALL OUTCHR
267 jmp short S_PUT_3
268s_put_4:
269 pop si
270 cmp byte ptr[printf_left],0
271 jz c_s_end
272 mov cx,cs:[printf_width]
273 or cx,cx
274 jz c_s_end
275 call Pad_string
276C_S_END:
277 call clear_flags
278 POP SI ;Restore control string pointer
279 JMP GET_CHAR ;Go get another character
280
281pad_string:
282 xor dx,dx
283count_loop:
284 lodsb
285 or al,al
286 jz count_done
287 inc dx
288 jmp short count_loop
289count_done:
290 sub cx,dx
291 jbe count_ret
292 call pad
293count_ret:
294 ret
295
296CONV_TO_NUM:
297
298 PUSH SI ;Save pointer to control string
299 MOV SI,BX ;Get index into argument list
300 ADD BX,2 ;Increment the index
301 MOV AX,ds:[BP+SI.ARG] ;Lo word of number in SI
302 CMP BYTE PTR CS:[PRINTF_LONG],0 ;Is this is a short or long integer?
303 JZ NOT_LONG_INT
304 MOV SI,BX ;Copy index
305 ADD BX,2 ;Increment the index
306 MOV DX,ds:[BP+SI.ARG] ;Hi word of number in BP
307 JMP SHORT DO_CONV
308NOT_LONG_INT:
309 XOR DX,DX ;Hi word is zero
310DO_CONV:
311 PUSH BX ;Save index into arguemnt list
312 MOV si,CS:[PRINTF_BASE]
313 MOV cx,CS:[PRINTF_WIDTH]
314 CALL PNUM
315 CALL PAD
316CONV_DONE:
317 call clear_flags
318 POP BX
319 POP SI
320 jmp get_char
321
322PNUM:
323 DEC CX
324 PUSH AX
325 MOV AX,DX
326 XOR DX,DX
327 DIV SI
328 MOV BX,AX
329 POP AX
330 DIV SI
331 XCHG BX,DX
332 PUSH AX
333 OR AX,DX
334 POP AX
335 JZ DO_PAD
336 PUSH BX
337 CALL PNUM
338 POP BX
339 JMP SHORT REM
340DO_PAD:
341 CMP CS:BYTE PTR[PRINTF_LEFT],0
342 JNZ REM
343 CALL PAD
344REM:
345 MOV AX,BX
346 CMP AL,10
347 JB NOT_HEX
348 CMP CS:BYTE PTR [PRINTF_HEX],0
349 JNZ NOT_HEX
350 ADD AL,CS:BYTE PTR [TABLE_INDEX]
351NOT_HEX:
352 MOV BX,OFFSET PRINTF_TABLE
353 PUSH DS
354 PUSH CS
355 POP DS
356 XLAT 0
357 POP DS
358 push cx
359 CALL OUTCHR
360 pop cx
361 RET
362
363PAD:
364 OR CX,CX
365 JLE PAD_DONE
366 MOV AL,CS:BYTE PTR [PAD_CHAR]
367PAD_LOOP:
368 push cx
369 CALL OUTCHR
370 pop cx
371 LOOP PAD_LOOP
372PAD_DONE:
373 RET
374
375OUTCHR:
376 STOSB
377 CMP DI,offset bufend-1 ;Don't count the nul
378 RETNZ
379 MOV CX,BUFSIZ
380WRITE_CHARS:
381 push bx
382 MOV BX,PFHandle
383 push ds
384 PUSH CS
385 POP DS
386 MOV DX,OFFSET PRINTF_BUF
387 MOV AH,WRITE
388 INT 21H
389 pop ds
390 pop bx
391 MOV DI,OFFSET PRINTF_BUF
392 RET
393
394FLUSH:
395 CMP DI,OFFSET PRINTF_BUF
396 RETZ
397 SUB DI,OFFSET PRINTF_BUF
398 MOV CX,DI
399 call write_chars
400 ret
401
402CLEAR_FLAGS:
403 XOR ax,ax
404 MOV BYTE PTR CS:[PRINTF_LEFT],al ;Reset justifing flag
405 MOV BYTE PTR CS:[PRINTF_LONG],al ;Reset long flag
406 MOV BYTE PTR CS:[TABLE_INDEX],al ;Reset hex table index
407 MOV CS:[PRINTF_WIDTH],ax ;Reinitialize width to 0
408 MOV BYTE PTR CS:[PAD_CHAR]," " ;Reset padding character
409 MOV BYTE PTR CS:[S_FLAG],al ;Clear the string flag
410 ret
411
412PRINTF_LAST LABEL WORD
413printf_CODE ENDS
414 END
415 \ 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
--- /dev/null
+++ b/v4.0/src/INC/PRINTF.OBJ
Binary files 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 @@
1;*******************************************************************
2; Parser include file
3;*******************************************************************
4IF1 ;AN000;
5 %OUT INCLUDING COMP=COMMON DSN=PSDATA.INC...;AN000;
6ENDIF ;AN000;
7;
8;**** Default assemble switches definition *************************
9
10IFNDEF FarSW ;AN000;
11FarSW equ 0 ;AN000; Near call expected
12ENDIF ;AN000;
13
14IFNDEF DateSW ;AN000;
15DateSW equ 1 ;AN000; Check date format
16ENDIF ;AN000;
17
18IFNDEF TimeSW ;AN000;
19TimeSW equ 1 ;AN000; Check time format
20ENDIF ;AN000;
21
22IFNDEF FileSW ;AN000;
23FileSW equ 1 ;AN000; Check file specification
24ENDIF ;AN000;
25
26IFNDEF CAPSW ;AN000;
27CAPSW equ 1 ;AN000; Perform CAPS if specified
28ENDIF ;AN000;
29
30IFNDEF CmpxSW ;AN000;
31CmpxSW equ 1 ;AN000; Check complex list
32ENDIF ;AN000;
33
34IFNDEF NumSW ;AN000;
35NumSW equ 1 ;AN000; Check numeric value
36ENDIF ;AN000;
37
38IFNDEF KeySW ;AN000;
39KeySW equ 1 ;AN000; Support keywords
40ENDIF ;AN000;
41
42IFNDEF SwSW ;AN000;
43SwSW equ 1 ;AN000; Support switches
44ENDIF ;AN000;
45
46IFNDEF Val1SW ;AN000;
47Val1SW equ 1 ;AN000; Support value definition 1
48ENDIF ;AN000;
49
50IFNDEF Val2SW ;AN000;
51Val2SW equ 1 ;AN000; Support value definition 2
52ENDIF ;AN000;
53
54IFNDEF Val3SW ;AN000;
55Val3SW equ 1 ;AN000; Support value definition 3
56ENDIF ;AN000;
57
58IFNDEF DrvSW ;AN000;
59DrvSW equ 1 ;AN000; Support drive only format
60ENDIF ;AN000;
61
62IFNDEF QusSW ;AN000;
63QusSW equ 1 ;AN000; Support quoted string format
64ENDIF ;AN000;
65
66IFNDEF LFEOLSW ;AN028;
67LFEOLSW EQU 1 ;AN028; Accept Line feed (0AH) as end of line
68ENDIF ;AN028;
69
70;**** Equation field
71;-------- Character code definition
72
73$P_DBSP1 equ 81h ;AN000; 1st byte of DBCS blank
74$P_DBSP2 equ 40h ;AN000; 2nd byte of DBCS blank
75$P_Period equ "." ;AN020;
76$P_Slash equ "/" ;AN020;
77$P_Space equ " " ;AN000; SBCS blank
78$P_Comma equ "," ;AN000;
79$P_Switch equ "/" ;AN000;
80$P_Keyword equ "=" ;AN000;
81$P_Colon equ ":" ;AN000;
82$P_Plus equ "+" ;AN000;
83$P_Minus equ "-" ;AN000;
84$P_Rparen equ ")" ;AN000;
85$P_Lparen equ "(" ;AN000;
86;(deleted ;AN025;) $P_SQuote equ "'"
87$P_DQuote equ '"' ;AN000;
88$P_NULL equ 0 ;AN000;
89$P_TAB equ 9 ;AN000;
90$P_CR equ 0Dh ;AN000;
91$P_LF equ 0Ah ;AN000;
92$P_ASCII80 equ 80h ;AN000; ASCII 80h character code
93
94;-------- Masks
95$P_Make_Lower equ 20h ;AN000; make lower case character
96$P_Make_Upper equ 0ffh-$P_Make_Lower ;AN000; make upper case character
97
98 PAGE ;AN000;
99;-------- DOS function call related equs
100
101$P_DOS_Get_CDI equ 3800h ;AN000; get country dependent information
102 ; by this call, following information
103$P_CDI struc ;AN000; is returned.
104$P_CDI_DateF dw 0 ;AN000;
105$P_CDI_Money db 0,0,0,0,0 ;AN000;
106$P_CDI_1000 db 0,0 ;AN000;
107$P_CDI_Dec db 0,0 ;AN000;
108$P_CDI_DateS db 0,0 ;AN000;
109$P_CDI_TimeS db 0,0 ;AN000;
110 db 0 ;AN000;
111 db 0 ;AN000;
112$P_CDI_TimeF db 0 ;AN000;
113 dw 0,0 ;AN000;
114 db 0,0 ;AN000;
115 dw 5 dup(0) ;AN000;
116$P_CDI ends ;AN000;
117
118$P_Date_MDY equ 0 ;AN000;
119$P_Date_DMY equ 1 ;AN000;
120$P_Date_YMD equ 2 ;AN000;
121;-------------
122$P_DOS_GetEV equ 6300h ;AN000; get DBCS EV call
123 ;AN000; DS:SI will points to DBCS EV
124;-------------
125$P_DOS_Get_TBL equ 65h ;AN000; get uppercase table call
126 ;AN000; following parameters are set
127 ;AN000; to get casemap table.
128$P_DOSTBL_Def equ -1 ;AN000; get default
129$P_DOSTBL_BL equ 5 ;AN000; buffer length for Tbl pointer
130$P_DOSTBL_File equ 4 ;AN000; get file uppercase table
131$P_DOSTBL_Char equ 2 ;AN000; get character uppercase table
132 ; By this call following information
133 ; is returned.
134$P_DOS_TBL struc ;AN000;
135$P_DOS_InfoID db 0 ;AN000; information id for the table
136$P_DOS_TBL_Off dw 0 ;AN000; offset address of the table
137$P_DOS_TBL_Seg dw 0 ;AN000; segment address of the table
138$P_DOS_TBL ends ;AN000;
139 PAGE ;AN000;
140;---------------------------------------------------------------------------------------------------------
141; PARMS LABEL BYTE
142; DW PARMSX
143; DB 2 ; NUMBER OF STRINGS (0, 1, 2)
144; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE
145; DB " .. " ; EXTRA DELIMITER LIST,
146; ; TYPICAL ARE ";", "="
147; ; "," & WHITESPACE ALWAYS
148; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE
149; DB " .. " ; EXTRA END OF LINE LIST, CR, LF OR 0 ALWAYS
150;---------------------------------------------------------------------------------------------------------
151
152;-------------------------------- PARMS block structure
153$P_PARMS_Blk struc ;AN000;
154$P_PARMSX_Address dw 0 ;AN000; Address of PARMSX
155$P_Num_Extra db 0 ;AN000; Number of extra stuff
156$P_Len_Extra_Delim db 0 ;AN000; Length of extra delimiter
157$P_PARMS_Blk ends ;AN000;
158
159$P_Len_PARMS equ 4 ;AN000;
160$P_I_Use_Default equ 0 ;AN000; no extra stuff specified
161$P_I_Have_Delim equ 1 ;AN000; extra delimiter specified
162$P_I_Have_EOL equ 2 ;AN000; extra EOL specified
163
164;---------------------------------------------------------------------------------------------------------
165; PARMSX LABEL BYTE
166; DB minp,maxp ; MIN, MAX POSITIONAL OPERANDS ALLOWED
167; DW CONTROL ; DESCRIPTION OF POSITIONAL 1
168; : ; REPEATS maxp-1 TIMES
169; DB maxs ; # OF SWITCHES
170; DW CONTROL ; DESCRIPTION OF SWITCH 1
171; : ; REPEATS maxs-1 TIMES
172; DB maxk ; # OF KEYWORD
173; DW CONTROL ; DESCRIPTION OF KEYWORD 1
174; : ; REPEATS maxk-1 TIMES
175;---------------------------------------------------------------------------------------------------------
176
177;-------------------------------- PARMSX block structure
178$P_PARMSX_Blk struc ;AN000;
179$P_MinP db 0 ;AN000; Minimum positional number
180$P_Maxp db 0 ;AN000; Maximum positional number
181$P_1st_Control dw 0 ;AN000; Address of the 1st CONTROL block
182$P_PARMSX_Blk ends ;AN000;
183 PAGE ;AN000;
184;---------------------------------------------------------------------------------------------------------
185; << Control field definition >>
186;
187;
188;CONTROL LABEL BYTE
189; DW MATCH_FLAGS ; CONTROLS TYPE MATCHED
190; ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED)
191; ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE CHECKED)
192; ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED)
193; ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED)
194; ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED)
195; ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED)
196; ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED)
197; ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED)
198; ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED)
199; ; 0010H=IGNORE ":" AT END IN MATCH
200; ; 0002H=REPEATS ALLOWED
201; ; 0001H=OPTIONAL
202; DW FUNCTION_FLAGS
203; ; 0001H=CAP RESULT BY FILE TABLE
204; ; 0002H=CAP RESULT BY CHAR TABLE
205; ; 0010H=REMOVE ":" AT END
206; (tm10) ; 0020H=colon is not necessary for switch
207; DW RESULT ; RESULT BUFFER
208; DW VALUES ; VALUE LISTS
209; DB nid ; NUMBER OF KEYWORD/SWITCH SYNONYMS IN FOLLOWING LIST
210; DB "...",0 ; IF n >0, KEYWORD 1
211; :
212;
213;Note:
214; - The MATCH_FLAG is bit significant. You can set, for example, TIME bit and
215; DATE bit simalteniously.
216;
217; The parser examins each bit along with the following priority.
218;
219; COMPLEX -> DATE -> TIME -> NUMERIC VAL -> SIGNED NUMERIC VAL -> DRIVE ->
220; FILE SPEC -> SIMPLE STRING.
221;
222;
223; - When the FUNCTION_FLAG is 0001 or 0002, the STRING pointed to by a pointer
224; in the result buffer is capitalized.
225;
226; - Match_Flags 0001H and 0002H have meaning only for the positional.
227;
228;
229; - The "...",0 (bottom most line) does require '=' or '/'. When you need a
230; switch, for example, '/A', then STRING points to;
231;
232; DB 1 ; number of following synonyms
233; DB '/A',0
234;
235; When you need a keyword, for example, 'CODEPAGE=', then "...",0 will be;
236;
237; DB 1 ; number of following synonyms
238; DB 'CODEPAGE=',0
239;
240;
241; - "..." must consist of upper case characters only because the parser
242; performs pattern matching after converting input to upper case (by
243; using the current country upper case table)
244;
245;
246; - One "..." can contain only one switch or keyword. If you need, for
247; example /A and /B, the format will be;
248;
249; DB 2 ; number of following synonyms
250; DB '/A',0
251; DB '/B',0
252;---------------------------------------------------------------------------------------------------------
253
254;**** Match_Flags
255
256$P_Num_Val equ 8000h ;AN000; Numeric Value
257$P_SNum_Val equ 4000h ;AN000; Signed numeric value
258$P_Simple_S equ 2000h ;AN000; Simple string
259$P_Date_S equ 1000h ;AN000; Date string
260$P_Time_S equ 0800h ;AN000; Time string
261$P_Cmpx_S equ 0400h ;AN000; Complex string
262$P_File_Spc equ 0200h ;AN000; File Spec
263$P_Drv_Only equ 0100h ;AN000; Drive Only
264$P_Qu_String equ 0080h ;AN000; Quoted string
265$P_Ig_Colon equ 0010h ;AN000; Ignore colon at end in match
266$P_Repeat equ 0002h ;AN000; Repeat allowed
267$P_Optional equ 0001h ;AN000; Optional
268
269;**** Function flags
270
271$P_CAP_File equ 0001h ;AN000; CAP result by file table
272$P_CAP_Char equ 0002h ;AN000; CAP result by character table
273$P_Rm_Colon equ 0010h ;AN000; Remove ":" at the end
274$P_colon_is_not_necessary equ 0020h ;AN000;(tm10) /+10 and /+:10
275
276;-------------------------------- Control block structure
277$P_Control_Blk struc ;AN000;
278$P_Match_Flag dw 0 ;AN000; Controls type matched
279$P_Function_Flag dw 0 ;AN000; Function should be taken
280$P_Result_Buf dw 0 ;AN000; Result buffer address
281$P_Value_List dw 0 ;AN000; Value list address
282$P_nid db 0 ;AN000; # of keyword/SW synonyms
283$P_KeyorSW db 0 ;AN000; keyword or sw
284$P_Control_Blk ends ;AN000;
285 PAGE ;AN000;
286;---------------------------------------------------------------------------------------------------------
287; << Value List Definition >>
288;
289;VALUES LABEL BYTE
290; DB nval ; NUMBER OF VALUE DEFINITIONS (0 - 3)
291; Ú
292; ³ DB nrng ; NUMBER OF RANGES
293; ³ ÚDB ITEM_TAG ; RETURN VALUE IF RANGE MATCHED
294; ³ ÀDD X,Y ; RANGE OF VALUES
295; ³ :
296; ³ DB nnval ; NUMBER OF CHOICES
297; ³ ÚDB ITEM_TAG ; RETURN VALUE IF NUMBER CHOICE MATCHED
298; ³ ÀDD VALUE ; SPECIFIC CHOICE IF NUMBER
299; ³ :
300; ³ DB nstrval ; NUMBER OF CHOICES
301; ³ ÚDB ITEM_TAG ; RETURN VALUE IF STRING CHOICE MATCHED
302; ³ ÀDW STRING ; SPECIFIC CHOICE IF STING
303; À :
304;
305;STRING DB "...",0 ; ASCIIZ STRING IMAGE
306;
307;Note:
308; - ITEM_TAG must not be 0FFH, which will be used in the result buffer
309; when no choice lists are provided.
310;
311; - STRING must consist of upper case characters only because the parser
312; performs pattern matching after converting input to upper case (by
313; using the current country upper case table)
314;---------------------------------------------------------------------------------------------------------
315
316$P_nval_None equ 0 ;AN000; no value list ID
317$P_nval_Range equ 1 ;AN000; range list ID
318$P_nval_Value equ 2 ;AN000; value list ID
319$P_nval_String equ 3 ;AN000; string list ID
320$P_Len_Range equ 9 ;AN000; Length of a range choice(two DD plus one DB)
321$P_Len_Value equ 5 ;AN000; Length of a value choice(one DD plus one DB)
322$P_Len_String equ 3 ;AN000; Length of a string choice(one DW plus one DB)
323$P_No_nrng equ 0 ;AN000; (tm07) no nrng. nnval must not be 0.
324
325$P_Val_List struc ;AN000;
326$P_NumofList db 0 ;AN000; number of following choice
327$P_Val_XL dw 0 ;AN000; lower word of value
328$P_Val_XH dw 0 ;AN000; higher word of value
329$P_Val_YL dw 0 ;AN000; lower word of another value
330$P_Val_YH dw 0 ;AN000; higher word of another value
331$P_Val_List ends ;AN000;
332 PAGE ;AN000;
333;---------------------------------------------------------------------------------------------------------
334; << Result Buffer Definition >>
335;
336;RESULT LABEL BYTE ; BELOW FILLED IN FOR DEFAULTS
337; DB type ; TYPE RETURNED: 0=RESERVED,
338; ; 1=NUMBER, 2=LIST INDEX,
339; ; 3=STRING, 4=COMPLEX,
340; ; 5=FILESPEC, 6=DRIVE
341; ; 7=DATE, 8=TIME
342; ; 9=QUOTED STRING
343; DB ITEM_TAG ; MATCHED ITEM TAG
344;
345; dw synonym@ ; es:@ points to found SYNONYM if provided.
346;
347;
348; Ú DD n ; VALUE IF NUMBER
349; ³ or
350; ³ DW i ; INDEX (OFFSET) INTO VALUE LIST
351; ³ ; (ES presents Segment address)
352; ³ or
353; ³ DD STRING ; OFFSET OF STRING VALUE
354; ³ or
355; ³ DB drv ; DRIVE NUMBER (1-A, 2-B,..., 26-Z)
356; ³ or
357; ³ DW YEAR ;(1980-2099) IN CASE OF DATE
358; ³ DB MONTH ;(1-12) Note: Range check is not performed.
359; ³ DB DATE ;(1-31) 0 is filled when the corresponding field was not specified.
360; ³ or
361; ³ DB HOUR ;(0-23) IN CASE OF TIME
362; ³ DB MINUTES ;(0-59) Note: Range check is not performed .
363; ³ DB SECONDS ;(0-59) 0 is filled when the corresponding field was not specified .
364; ³ DB HUNDREDTHS ;(0-99)
365; À
366;
367;
368;Note: ITEM_TAG is 0FFH when the caller does not specify the choice
369; list.
370;
371; YEAR: If the input value for the year is less than 100, parser
372; adds 1900 to it. For example, when 87 is input to parser for
373; the year value, he returns 1987.
374;---------------------------------------------------------------------------------------------------------
375
376;-------------------------------- Result block structure
377$P_Result_Blk struc ;AN000;
378$P_Type db 0 ;AN000; Type returned
379$P_Item_Tag db 0 ;AN000; Matched item tag
380$P_SYNONYM_Ptr dw 0 ;AN000; pointer to Synonym list returned
381$P_Picked_Val db 0,0,0,0 ;AN000; value
382$P_Result_Blk ends ;AN000;
383;--------------------------------
384;**** values for the type field in the result block
385
386$P_EOL equ 0 ;AN000; End of line
387$P_Number equ 1 ;AN000; Number
388$P_List_Idx equ 2 ;AN000; List Index
389$P_String equ 3 ;AN000; String
390$P_Complex equ 4 ;AN000; Complex
391$P_File_Spec equ 5 ;AN000; File Spec
392$P_Drive equ 6 ;AN000; Drive
393$P_Date_F equ 7 ;AN000; Date
394$P_Time_F equ 8 ;AN000; Time
395$P_Quoted_String equ 9 ;AN000; Quoted String
396
397$P_No_Tag equ 0FFH ;AN000; No ITEM_TAG found
398;**** Return code
399;
400; following return code will be returned in the AX register.
401
402$P_No_Error equ 0 ;AN000; No error
403$P_Too_Many equ 1 ;AN000; Too many operands
404$P_Op_Missing equ 2 ;AN000; Required operand missing
405$P_Not_In_SW equ 3 ;AN000; Not in switch list provided
406$P_Not_In_Key equ 4 ;AN000; Not in keyword list provided
407$P_Out_Of_Range equ 6 ;AN000; Out of range specified
408$P_Not_In_Val equ 7 ;AN000; Not in value list provided
409$P_Not_In_Str equ 8 ;AN000; Not in string list provided
410$P_Syntax equ 9 ;AN000; Syntax error
411$P_RC_EOL equ -1 ;AN000; End of command line
412
413 PAGE ;AN000;
414;********************** Local Data *************************************
415$P_ORDINAL dw 0 ;AN000; Operand ordinal save area
416$P_RC dw 0 ;AN000; Return code from parser
417$P_SI_Save dw 0 ;AN000; Pointer of command buffer
418$P_DX dw 0 ;AN000; Return result buffer address
419$P_Terminator db 0 ;AN000; Terminator code (ASCII)
420$P_DBCSEV_OFF dw 0 ;AN000; Offset of DBCS EV
421$P_DBCSEV_SEG dw 0 ;AN000; Segment of DBCS EV
422$P_Flags dw 0 ;AN000; Parser internal flags
423$P_Flags1 equ byte ptr $P_Flags ;AN038; to reference first byte flags
424$P_Flags2 equ byte ptr $P_Flags+1 ;AN038; to reference second byte flags only
425
426;in second byte of $P_Flags, referenced as $P_Flags2:
427$P_equ equ 01h ;AN000; "=" packed in string buffet
428$P_Neg equ 02h ;AN000; Negative value
429$P_Time12 equ 04h ;AN000; set when PM is specified
430$P_Key_Cmp equ 08h ;AN000; set when keyword compare
431$P_SW_Cmp equ 10h ;AN000; set when switch compare
432$P_Extra equ 20h ;AN000; set when extra delimiter found
433$P_SW equ 40h ;AN000; set when switch found (tm08)
434$P_Signed equ 80h ;AN000; signed numeric specified
435
436;in first byte of $P_Flags, referenced as $P_Flags1:
437$P_time12am equ 01h ;AN038; set when AM is specified on time
438$P_TIME_AGAIN EQU 02H ;AN039; SET WHEN READY TO RE-PARSE TIME
439
440$P_SaveSI_Cmpx dw 0 ;AN000; save si for later use by complex
441$P_KEYorSW_Ptr dw 0 ;AN000; points next to "=" or ":" code
442$P_Save_EOB dw 0 ;AN000; save pointer to EOB
443$P_Found_SYNONYM dw 0 ;AN000; es:@ points to found synonym
444
445$P_STRING_BUF db 128 dup(0) ;AN000; Pick a operand from command line
446$P_STRING_BUF_END equ $ ;AN000;
447IF TimeSw ;AN039; For TIME only
448$P_ORIG_ORD DW 0 ;AN039; ORIGINAL ORDINAL FROM CX
449$P_ORIG_STACK DW 0 ;AN039; ORIGINAL VALUE OF STACK FROM SP
450$P_ORIG_SI DW 0 ;AN039; ORIGINAL START PARSE POINTER FROM SI
451ENDIF ;AN039;
452IF DateSw+TimeSw ;AN000;(Check if date or time format is supported)
453;------------------------------
454;
455$P_Got_Time db 0 ;AN023; if 1, use Time delimiters
456$P_NeedToBeRead equ 0ffffh ;AN000;
457
458$P_COUNTRY_INFO $P_CDI <$P_NeedToBeRead> ;AN000;
459;
460$P_1st_Val dw 0 ;AN000; used when process date or time
461$P_2nd_Val dw 0 ;AN000; used when process date or time
462$P_3rd_Val dw 0 ;AN000; used when process date or time
463$P_4th_Val dw 0 ;AN000; used when process date or time
464;------------------------------
465ENDIF ;AN000;(of DateSW+TimeSW)
466$P_Char_CAP_Ptr db 0ffh ;AN000; info id
467 dw 0 ;AN000; offset of char case map table
468 dw 0 ;AN000; segment of char case map table
469IF CAPSW ;AN000;(Check if uppercase conversion is supported)
470$P_File_CAP_Ptr db 0ffh ;AN000; info id
471 dw 0 ;AN000; offset of file case map table
472 dw 0 ;AN000; segment of file case map table
473ENDIF ;AN000;(of CAPSW)
474; (tm06) IF FileSW ;AN000;(Check if file spec is supported)
475IF FileSW+DrvSW ;AN000;(Check if file spec is supported)
476$P_FileSp_Char db '[]|<>+=;"' ;AN000; delimitter of file spec
477$P_FileSp_Len equ $-$P_FileSp_Char ;AN000;
478ENDIF ;AN000;(of FileSW)
479; (tm05) IF QusSW ;AN000;(Check if quoted string is supported)
480;(deleted ;AN025;) IF QusSW+CmpxSW ; (tm05) ;AN000;(Check if quoted string is supported)
481;(deleted ;AN025;) $P_SorD_Quote db 0 ;AN000; keep double or single quote
482;(deleted ;AN025;) ENDIF ;AN000;(of QueSW)
483IF KeySW ;AN029; if keywords supported
484$P_count_to_eol dw 0 ;AN029; count of chars not including EOL
485; REGISTER EQUATES - SPECIAL USAGE FOR REGISTERS
486$P_REG_BH_CG_SW EQU BH ;AN029;0="NO CHANGES MADE", FF=CHANGES MADE
487$P_REG_BL_DQ_SW EQU BL ;AN029;0=NOT IN QUOTES,FF=IN QUOTES
488
489$P_DOUBLE_QUOTE EQU """" ;AN029;
490$P_BL_EQ EQU " =" ;AN029;
491$P_EQ_BL EQU "= " ;AN029;
492$P_TB_EQ EQU 093DH ;AN029; ;"<TAB>="
493$P_EQ_TB EQU 3D09H ;AN029; ;"=<TAB>"
494ENDIF ;AN029; IF KeySW Supported
495
496; delimiter parsing
497$P_colon_period equ 01 ;AN032; check for colon & period
498$P_period_only equ 02 ;AN032; check only for period
499
500;filespec error flag
501$P_err_flag db 00 ;AN033; flag set if filespec parsing error
502 ;AN033; was detected.
503$P_error_filespec equ 01 ;AN033; mask to set flag
504;***********************************************************************
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 @@
1; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2; Redirector MACROS
3; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4
5EDW MACRO name
6 extrn name:near
7 DW OFFSET RG:name
8ENDM
9
10; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
11
12CHECK_DIALECT MACRO name
13
14 IF2 ;AN000; If not defined yet,
15 IFNDEF CHECKDIALECT ;AN000; THEN Extrn
16 Extrn CHECKDIALECT&name:NEAR ;AN000;
17 ENDIF ;AN000;
18 ENDIF ;AN000;
19 CALL CHECKDIALECT&name ;AN000; Call the appropriate routine
20
21ENDM
22
23; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24
25CallREDIRSub MACRO name,fn,save,restore ;AN000;
26 IF2 ;AN000; If not defined yet,
27 IFNDEF REDIRSub&fn ;AN000; THEN Extrn
28 Extrn REDIRSub&fn:NEAR ;AN000;
29 ENDIF ;AN000;
30 ENDIF ;AN000;
31 IFNB <save> ;AN000; If not blank
32 SaveReg <save> ;AN000; Save the regs
33 ENDIF ;AN000;
34 CALL REDIRSub&fn ;AN000; Call the appropriate routine
35 IFNB <restore> ;AN000; If not blank
36 RestoreReg <restore> ;AN000; Save the regs
37 ENDIF ;AN000;
38ENDM ;AN000;
39
40; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
41; Redirector structures
42; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
43
44 INCLUDE IFSSYM.INC ;AN000;
45 INCLUDE ERROR.INC ;AN000;
46 INCLUDE FILEMODE.INC ;AN000;
47
48;; CD_FSDA STRUCTURE
49
50 CD_FSDA_OFF EQU WORD PTR CD_FSDA ;AN000;
51 CD_FSDA_SEG EQU WORD PTR CD_FSDA+2 ;AN000;
52 CD_FSDA_FLAGS EQU WORD PTR CD_FSDA+4 ;AN000;
53
54;; DFL_FSDA STRUCTURE
55
56 DF_FSDA_OFF EQU WORD PTR DFL_FSDA ;AN000;
57 DF_FSDA_SEG EQU WORD PTR DFL_FSDA+2 ;AN000;
58 DF_FSDA_FLAGS EQU WORD PTR DFL_FSDA+4 ;AN000;
59
60;; SFF_FSDA STRUCTURE
61
62 SFF_FSDA_OFF EQU WORD PTR SFF_FSDA ;AN000;
63 SFF_FSDA_SEG EQU WORD PTR SFF_FSDA+2 ;AN000;
64 SFF_FSDA_FLAGS EQU WORD PTR SFF_FSDA+4 ;AN000;
65
66;; IFS Structure fixes
67
68 ifsr_fcn_def EXECAPI ;AN000;
69 ifsr_api_def OPENFILE ;AN000;
70IFSR_OPENNAME@ = IFSR_NAME@ ;AN000;
71 ifsr_api_def SEARCHFILE ;AN000;
72IFSR_SRCHNAME@ = IFSR_NAME@ ;AN000;
73 ifsr_api_def MKDIR ;AN000;
74IFSR_DIRNAME@ = IFSR_NAME@ ;AN000;
75 ifsr_api_def DELFILE ;AN000;
76IFSR_DELNAME@ = IFSR_NAME@ ;AN000;
77 ifsr_api_def FILEATTR ;AN000;
78IFSR_ATTRNAME@ = IFSR_NAME@ ;AN000;
79
80; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
81; Redirector Equates
82; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
83
84Get_Interrupt_Vector EQU 35H ;AN000;
85Set_Interrupt_Vector EQU 25H ;AN000;
86Deallocate_memory EQU 49H ;AN000;
87
88GET_SYS_CONFIG EQU 0C000H ;AN000; INT 15H to get configuration
89CONFIG_STRUC STRUC ;AN001;
90 LENGTH DW ? ;AN001;
91 MODEL_BYTE DB ? ;AN001;
92CONFIG_STRUC ENDS ;AN001;
93
94LOWEST_386_MODEL EQU 0F8H ;AN001;
95
96INCOR_DOS EQU 1 ;AN000;
97ALREADY_INST EQU 2 ;AN000;
98NOT_INST EQU 3 ;AN000;
99NET_NOT_STARTED EQU 4 ;AN000;
100INSUFF_MEM EQU 5 ;AN000;
101BAD_PARM EQU 10 ;AN000;
102INSUFFICENT_MEM EQU 76 ;AN001; Extended Error
103
104ONE_REPLACE EQU 1 ;AN000;
105SINGLE_COUNT EQU 1 ;AN000;
106TESTDIALECT = 0 ;AN001;
107
108REDIR_INSTALLED EQU -1 ;AN000;
109REDIR_SYS_INSTALL EQU 0BF80H ;AN000; REDIR.SYS 2FH Function number
110REDIR_EXE_INSTALL EQU 0BF00H ;AN000; REDIR.EXE 2FH Function number
111
112FASSIGN_ON EQU -1 ;AN000;
113FASSIGN_OFF EQU 0 ;AN000;
114FPRINT_ON EQU -1 ;AN000;
115FPRINT_OFF EQU 0 ;AN000;
116
117EXT_ERR_72 EQU 72 ;AN000;
118PSP_ENVIRO_SEG EQU 002CH ;AN000; Offset into the PSP of the Enviroment Segment
119
120PrnIO EQU 17H ; Int vector for Printer IO
121PrntScr EQU 05H ; Int vector for Print Screen
122PrnRdrMark EQU 2 ; Mark for port addr
123
124VER12 EQU 00000010b ;AN001;
125VER13 EQU 00000100b ;AN001;
126
127FIRST_TIME EQU 1 ;AN001;
128SECOND_TIME EQU 2 ;AN001;
129
130SHIFT_BY_7 EQU 7 ;AN001;
131
132HI_BIT_SHARING_MASK EQU 1111111101111111b ;AN001; Turns off Hi bit in nibble
133
134
135;; ###############################################################
136;; MISC.INC
137;; ###############################################################
138
139; NETFILE
140
141attr_read_only = 00000001b
142
143; NETINIT
144
145IFSR_INVALID_CMD = -1 ;AN000;
146
147; NETUTIL
148
149MACRO_4 = 4
150DATE_TIME = 0
151
152
153; NETHAND
154
155LOCK_ALL_OPERS = 0
156POS_LEN_PTR_SIZE = 8 ;AN001; 8 bytes for position/length
157
158FIND_BUF STRUC
159
160find_buf_drive DB ? ; drive of search
161find_buf_name DB 11 DUP (?) ; formatted name
162find_buf_sattr DB ? ; attribute of search
163find_buf_LastEnt DW ? ; LastEnt
164find_buf_DirStart DW ? ; DirStart
165find_buf_NetID DB 4 DUP (?) ; Reserved for NET
166find_buf_attr DB ? ; attribute found
167find_buf_time DW ? ; time
168find_buf_date DW ? ; date
169find_buf_size_l DW ? ; low(size)
170find_buf_size_h DW ? ; high(size)
171find_buf_pname DB 13 DUP (?) ; packed name
172
173FIND_BUF ENDS
174
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 @@
1; SCCSID = @(#)sf.asm 1.1 85/04/10
2BREAK <Internal system file table format>
3;
4; AN000 version 4.00 Jan. 1988
5; AN003 PTM 3680 -- make NAME offset the same as before (<=3.30)
6; AN009 PTM 3839 reorder SFT for MS WINDOWS
7
8;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
9; C A V E A T P R O G R A M M E R ;
10; ;
11;
12; system file table
13;
14
15SF STRUC
16SFLink DD ?
17SFCount DW ? ; number of entries
18SFTable DW ? ; beginning of array of the following
19SF ENDS
20
21;
22; system file table entry
23;
24
25sf_entry STRUC
26sf_ref_count DW ? ; number of processes sharing entry
27 ; if FCB then ref count
28sf_mode DW ? ; mode of access or high bit on if FCB
29sf_attr DB ? ; attribute of file
30sf_flags DW ? ;Bits 8-15
31 ; Bit 15 = 1 if remote file
32 ; = 0 if local file or device
33 ; Bit 14 = 1 if date/time is not to be
34 ; set from clock at CLOSE. Set by
35 ; FILETIMES and FCB_CLOSE. Reset by
36 ; other reseters of the dirty bit
37 ; (WRITE)
38 ; Bit 13 = Pipe bit (reserved)
39 ;
40 ; Bits 0-7 (old FCB_devid bits)
41 ; If remote file or local file, bit
42 ; 6=0 if dirty Device ID number, bits
43 ; 0-5 if local file.
44 ; bit 7=0 for local file, bit 7
45 ; =1 for local I/O device
46 ; If local I/O device, bit 6=0 if EOF (input)
47 ; Bit 5=1 if Raw mode
48 ; Bit 0=1 if console input device
49 ; Bit 1=1 if console output device
50 ; Bit 2=1 if null device
51 ; Bit 3=1 if clock device
52sf_devptr DD ? ; Points to DPB if local file, points
53 ; to device header if local device,
54 ; points to net device header if
55 ; remote
56sf_firclus DW ? ; First cluster of file (bit 15 = 0)
57sf_time DW ? ; Time associated with file
58sf_date DW ? ; Date associated with file
59sf_size DD ? ; Size associated with file
60sf_position DD ? ; Read/Write pointer or LRU count for FCBs
61;
62; Starting here, the next 7 bytes may be used by the file system to store an
63; ID
64;
65sf_cluspos DW ? ; Position of last cluster accessed
66sf_dirsec DD ? ; Sector number of directory sector for
67 ; for this file
68sf_dirpos DB ? ; Offset of this entry in the above
69;
70; End of 7 bytes of file-system specific info.
71;
72sf_name DB 11 DUP (?) ; 11 character name that is in the
73 ; directory entry. This is used by
74 ; close to detect file deleted and
75 ; disk changed errors.
76
77; SHARING INFO
78sf_chain DD ? ; link to next SF
79sf_UID DW ?
80sf_PID DW ?
81sf_MFT DW ?
82sf_lstclus DW ? ;AN009; Last cluster accessed
83sf_IFS_HDR DD ?
84sf_entry ENDS
85
86sf_fsda EQU BYTE PTR sf_cluspos ;DOS 4.00
87sf_serial_ID EQU WORD PTR sf_firclus ;DOS 4.00
88sf_netid EQU BYTE PTR sf_cluspos
89sf_OpenAge EQU WORD PTR sf_position+2
90sf_LRU EQU WORD PTR sf_position
91
92sf_default_number EQU 5h
93
94;
95; Note that we need to mark an SFT as being busy for OPEN/CREATE. This is
96; because an INT 24 may prevent us from 'freeing' it. We mark this as such
97; by placing a -1 in the ref_count field.
98;
99
100sf_busy EQU -1
101
102
103; mode mask for FCB detection
104sf_isfcb EQU 1000000000000000B
105
106; Flag word masks
107sf_isnet EQU 1000000000000000B
108sf_close_nodate EQU 0100000000000000B
109sf_pipe EQU 0010000000000000B
110sf_no_inherit EQU 0001000000000000B
111sf_net_spool EQU 0000100000000000B
112Handle_Fail_I24 EQU 0000000100000000B ;BIT 8 - DISK FULL I24 ERROR
113
114; Local file/device flag masks
115devid_file_clean EQU 40h ; true if file and not written
116devid_file_mask_drive EQU 3Fh ; mask for drive number
117
118devid_device EQU 80h ; true if a device
119devid_device_EOF EQU 40h ; true if end of file reached
120devid_device_raw EQU 20h ; true if in raw mode
121devid_device_special EQU 10h ; true if special device
122devid_device_clock EQU 08h ; true if clock device
123devid_device_null EQU 04h ; true if null device
124devid_device_con_out EQU 02h ; true if console output
125devid_device_con_in EQU 01h ; true if consle input
126; ;
127; C A V E A T P R O G R A M M E R ;
128;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
129
130;
131; structure of devid field as returned by IOCTL is:
132;
133; BIT 7 6 5 4 3 2 1 0
134; |---|---|---|---|---|---|---|---|
135; | I | E | R | S | I | I | I | I |
136; | S | O | A | P | S | S | S | S |
137; | D | F | W | E | C | N | C | C |
138; | E | | | C | L | U | O | I |
139; | V | | | L | K | L | T | N |
140; |---|---|---|---|---|---|---|---|
141; ISDEV = 1 if this channel is a device
142; = 0 if this channel is a disk file
143;
144; If ISDEV = 1
145;
146; EOF = 0 if End Of File on input
147; RAW = 1 if this device is in Raw mode
148; = 0 if this device is cooked
149; ISCLK = 1 if this device is the clock device
150; ISNUL = 1 if this device is the null device
151; ISCOT = 1 if this device is the console output
152; ISCIN = 1 if this device is the console input
153;
154; If ISDEV = 0
155; EOF = 0 if channel has been written
156; Bits 0-5 are the block device number for
157; the channel (0 = A, 1 = B, ...)
158;
159devid_ISDEV EQU 80h
160devid_EOF EQU 40h
161devid_RAW EQU 20h
162devid_SPECIAL EQU 10H
163devid_ISCLK EQU 08h
164devid_ISNUL EQU 04h
165devid_ISCOT EQU 02h
166devid_ISCIN EQU 01h
167
168devid_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
--- /dev/null
+++ b/v4.0/src/INC/SHELL.MEU
Binary files 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 @@
1;
2PAGE
3;-----------------------------------------------------------------------------+
4; :
5; Name: SHELLRD.EQU :
6; :
7; Description: Common internal shell equates :
8; :
9; Revised: 05-05-88 :
10; :
11;-----------------------------------------------------------------------------+
12;
13; Pull down selection to dither (1 bit = 1 selection line)
14;
15DIT_L1 EQU 0000000000000001B ;Pull down selection 1 ;DITHER
16DIT_L2 EQU 0000000000000010B ;Pull down selection 2 ;DITHER
17DIT_L3 EQU 0000000000000100B ;Pull down selection 3 ;DITHER
18DIT_L4 EQU 0000000000001000B ;Pull down selection 4 ;DITHER
19DIT_L5 EQU 0000000000010000B ;Pull down selection 5 ;DITHER
20DIT_L6 EQU 0000000000100000B ;Pull down selection 6 ;DITHER
21DIT_L7 EQU 0000000001000000B ;Pull down selection 7 ;DITHER
22DIT_L8 EQU 0000000010000000B ;Pull down selection 8 ;DITHER
23DIT_L9 EQU 0000000100000000B ;Pull down selection 9 ;DITHER
24DIT_L10 EQU 0000001000000000B ;Pull down selection 10 ;DITHER
25DIT_L11 EQU 0000010000000000B ;Pull down selection 11 ;DITHER
26DIT_L12 EQU 0000100000000000B ;Pull down selection 12 ;DITHER
27DIT_L13 EQU 0001000000000000B ;Pull down selection 13 ;DITHER
28DIT_L14 EQU 0010000000000000B ;Pull down selection 14 ;DITHER
29DIT_L15 EQU 0100000000000000B ;Pull down selection 15 ;DITHER
30DIT_L16 EQU 1000000000000000B ;Pull down selection 16 ;DITHER
31;
32; Input field control block equates
33;
34INP_FILEMASK1 EQU 1 ;file mask input field 1 mul only
35INP_FILEMASK2 EQU 2 ;file mask input field 2 mul only
36INP_AADDT EQU 3 ;add menu item title
37INP_JOHN EQU 4 ;dyanmic input field
38INP_DOSCMDEST EQU 5 ;move/copy destination line
39INP_DOSRFNAM EQU 6 ;rename file field
40INP_DOSRDNAM EQU 7 ;rename directory field
41INP_DOSEXOPT EQU 8 ;start a program
42INP_DOSMDNAM EQU 9 ;make DOS directory field
43INP_CMDLINE EQU 10 ;command line input field
44INP_PASSWORD EQU 11 ;app menu password
45INP_APPMFILE EQU 12 ;app menu filename
46INP_EDITPH EQU 13 ;app menu edit or help/psc
47INP_FILEMASK EQU 14 ;file mask input field
48INP_DOSASSOC EQU 15 ;associate file input field
49INP_HELP EQU 16 ;app help edit field
50INP_DOSCMFROM EQU 17 ;dos services from: input field
51INP_DOMASK EQU 18 ;display options pulldown filemask
52INP_DOSDELDIS EQU 19 ;dos display delete list
53;
54; Scroll ID equates
55;
56SCB_CHELP EQU 1 ;contextual helps
57SCB_IHELP EQU 2 ;indexed helps
58;
59; Help equates for panel position
60;
61HLP_UPPANROW EQU 5 ;upper help panel row
62HLP_UPPANCOL EQU 18 ;upper help panel column
63HLP_LWPANROW EQU 14 ;lower help panel row
64HLP_LWPANCOL EQU 16 ;lower help panel column
65HLP_PANLINES EQU 10 ;number of lines in help panel
66HLPTLINS EQU 12 ;user defined help text lines
67HLPWID EQU 40 ;user defined help text width
68;
69; Application menu location equates
70;
71APP_ROW EQU 7 ;jpw application menu start row
72APP_COLUMN EQU 1 ;jpw application menu start col
73APP_MAXLINES EQU 16
74;
75; Error ID equates
76;
77ERR_PSP EQU 1 ;invalid invocation parameters
78ERR_FILMERR EQU 2 ;file not found
79ERR_PATHERR EQU 3 ;path not found
80ERR_NODA EQU 4 ;dos/app both not active
81ERR_ACCEERR EQU 5 ;access denied
82ERR_APIF EQU 6 ;missing or invalid main menu file
83ERR_INVDEST EQU 7 ;invalid destination path
84ERR_INSM EQU 8 ;insufficent memory available
85ERR_CLRF EQU 9 ;missing or invalid color file
86ERR_BADD EQU 10 ;bad disk or drive door open
87ERR_HELF EQU 11 ;missing or bad help file
88ERR_COMS EQU 12 ;missing COMSPEC in Environment
89ERR_DEAL EQU 13 ;DOS unable to de-allocate memory
90ERR_256K EQU 14 ;inadequate graphics memory avail
91ERR_MODE EQU 15 ;graph mode request not successful
92ERR_MOUS EQU 16 ;missing or bad mouse driver
93ERR_EMPTERR EQU 17 ;empty menu
94ERR_MAXFERR EQU 18 ;maximum number of files/dirs exce
95ERR_WRIPERR EQU 19 ;disk write protected
96ERR_DISKERR EQU 20 ;disk full
97ERR_DRVNERR EQU 21 ;drive not ready
98ERR_NOMARK EQU 22 ;no files marked
99ERR_GENERAL1 EQU 23 ;general error has occurred
100ERR_EMPTY EQU 24 ;file is empty
101ERR_NOPARM EQU 25 ;used of uninitialized psc parm
102ERR_NOQUOTE EQU 26 ;missing quote in PSC syntax
103ERR_BADNUM EQU 27 ;invalid number inside " "
104ERR_PARAOUT EQU 28 ;PSC parameter out of range
105ERR_NOEOL EQU 29 ;missing PSC eol marker
106ERR_BUFOUT EQU 30 ;output buffer exceeded
107ERR_GENERAL EQU 31 ;general error has occurred
108ERR_NORBRAC EQU 32 ;no closing ] in psc
109ERR_BIGTITL EQU 33 ;psc title too big
110ERR_BIGINST EQU 34 ;psc instruction too big
111ERR_BIGPRPT EQU 35 ;psc prompt too big
112ERR_BIGDEF EQU 36 ;psc default input too big
113ERR_BADMOD EQU 37 ;invalid modifier chars in psc
114ERR_NOCOPY EQU 38 ;file cannot be copied on itself
115ERR_NOROOM EQU 39 ;no room on menu
116ERR_LOST EQU 40 ;menu items may be lost
117ERR_BLANK EQU 41 ;blank string to clear G3 messages
118ERR_ROOT EQU 42 ;delete or rename root error messg
119ERR_PDFILE EQU 43 ;shelli.dat file is invalid
120ERR_PDFULL EQU 44 ;menu is full, no room for predefs
121ERR_ASSOC EQU 45 ;associate file limit reached
122ERR_FILEXT EQU 46 ;invalid file ext for association
123ERR_PGMEXT EQU 47 ;invalid prgm ext for association
124ERR_PASSWD EQU 48 ;invalid password
125ERR_INVPARM EQU 49 ;invalid number of parameters
126ERR_DEEP EQU 50 ;too many menu levels deep >5
127ERR_MAXDERR EQU 51 ;max number directories exceeded
128ERR_ASRF EQU 52 ;bad or missing associate filename
129ERR_SGDRCOPY EQU 53 ;single drive copy not supported
130ERR_ONEMARK EQU 54 ;function limited to one file
131ERR_PRTINST EQU 55 ;print not installed
132ERR_PRTQFULL EQU 56 ;print queue full
133ERR_PRTNOSUB EQU 57 ;print cannot be submitted
134ERR_NOHIGHLT EQU 58 ;no files/directories highlighted
135ERR_BADCMD EQU 59 ;pcr 2/26/88
136ERR_BIGFILE EQU 60 ;filespec in psc > 76 chars
137;
138; Color ID equates
139;
140CLR_3 EQU 1 ;shipped text mode color index
141CLR_7 EQU 2 ;shipped monochrome color index
142CLR_10 EQU 3 ;shipped graphics mode 10H/12H
143CLR_11 EQU 4 ;shipped graphics mode 11H index
144;
145; Panel color index record equates
146;
147CLR_LOGO EQU 1 ;Logo Scr
148CLR_BASE EQU 2 ;Base Scr
149CLR_ERROR EQU 3 ;Error
150CLR_HELP EQU 4 ;Help
151CLR_AAB EQU 5 ;action bar
152CLR_FILE1 EQU 7 ;graphics file 1
153CLR_FILE2 EQU 6 ;graphics file 2
154CLR_DIR1 EQU 7 ;graphics directory 1
155CLR_DIR2 EQU 6 ;graphics directory 2
156CLR_DRIVE1 EQU 7 ;graphics drive 1
157CLR_DRIVE2 EQU 6 ;graphics drive 2
158CLR_BARTITLE EQU 8 ;title bar title
159CLR_INSTRUCT1 EQU 10 ;second instruction
160CLR_CMD EQU 11 ;command line
161CLR_STATUS EQU 12 ;graphics status
162CLR_TITLE EQU 13 ;title
163CLR_INSTRUCT EQU 14 ;Instructions
164CLR_POPUP1 EQU 15 ;Popup 1
165CLR_POPUP2 EQU 16 ;Popup 2
166CLR_INDEX EQU 17 ;Reserved
167;
168; Shell panel ID equates
169;
170PAN_DTITLE EQU 1 ;DOS services title text
171PAN_ATITLE EQU 2 ;App menu title text
172PAN_DABFILE EQU 3 ;DOS AAB file command text
173PAN_DABDISP EQU 4 ;DOS AAB display command text
174PAN_DABSHEL EQU 5 ;DOS AAB shell command text
175PAN_DABEXIT EQU 6 ;DOS AAB exit command text
176PAN_AABMAIN EQU 7 ;App AAB maintain command text
177PAN_AABSHEL EQU 8 ;App AAB shell command text
178PAN_AABEXIT EQU 9 ;App AAB exit command text
179PAN_ENTER EQU 10 ;Common action Enter
180PAN_ESC EQU 11 ;Common actions Esc=Cancel
181PAN_F1 EQU 12 ;Common actions F1=Help
182PAN_F5 EQU 13 ;Common actions F5=Index
183PAN_F9 EQU 14 ;Common actions F7=Keys
184PAN_APDMAINP EQU 15 ;App maintain pull down panel
185PAN_APDMAINC EQU 16 ;App maintain pull down panel text
186PAN_APDSHELP EQU 17 ;App shell pull down panel
187PAN_APDSHELC EQU 18 ;App shell pull down panel text
188PAN_APDEXITP EQU 19 ;App exit pull down panel
189PAN_APDEXITC EQU 20 ;App exit pull down panel text
190PAN_DPDFILEP EQU 21 ;DOS file pull down panel
191PAN_DPDFILEC EQU 22 ;DOS file pull down panel text
192PAN_DPDEXITP EQU 23 ;DOS exit pull down panel
193PAN_DPDEXITC EQU 24 ;DOS exit pull down panel text
194PAN_DPDDISPP EQU 25 ;DOS display pull down panel
195PAN_DPDDISPC EQU 26 ;DOS display pull down panel text
196PAN_DPDSHELP EQU 27 ;DOS shell pull down panel
197PAN_DPDSHELC EQU 28 ;DOS shell pull down panel text
198PAN_DSFMT2 EQU 29 ;DOS top single drive/file panel
199PAN_DSFMT3 EQU 30 ;DOS extended directory panel
200PAN_DSFMT4 EQU 31 ;DOS status panel
201PAN_DSFMT6 EQU 32 ;DOS global file search
202PAN_FILEVIEW EQU 33 ;DOS file view panel top template
203PAN_FILEVIEWT EQU 34 ;fileview panel text
204PAN_FVHEX EQU 35 ;DOS hex file view panel bottom
205PAN_FVASCII EQU 36 ;DOS hex file view panel bottom
206PAN_FKEY EQU 37 ;function key panel
207PAN_APPINST2 EQU 38 ;App copy menu item dest instr
208PAN_APPINST5 EQU 39 ;App menu reorder second instr
209PAN_APPINST6 EQU 40 ;App menu operational instr
210PAN_MCP EQU 41 ;Maintain color panel text
211PAN_MCSS EQU 42 ;Maintain color sample panel
212PAN_DSREAD EQU 43 ;DOS reading drive panel text
213PAN_G1 EQU 44 ;general panel 1
214PAN_G1PASSWM EQU 45 ;Enter menu item password panel
215PAN_G1OPT EQU 46 ;DOS file options text
216PAN_G3SORTC EQU 47 ;DOS sort panel text
217PAN_G2 EQU 48 ;General panel 2
218PAN_G2DELM EQU 49 ;delete menu item confirmation
219PAN_G3 EQU 50 ;General panel 3
220PAN_G3COPYT EQU 51 ;DOS file copy panel title
221PAN_G3COPY EQU 52 ;DOS file copy panel in progress
222PAN_G3MOVET EQU 53 ;DOS file move panel title
223PAN_G3MOVE EQU 54 ;DOS file move panel in progress
224PAN_G3DEST EQU 55 ;DOS file copy/move destination
225PAN_G3REPL EQU 56 ;DOS file copy/move replace existg
226PAN_G3ERROR EQU 57 ;DOS file copy/move error
227PAN_G3FILEDL EQU 58 ;DOS file delete in progress txt
228PAN_G3FILEDB EQU 59 ;DOS file delete confirm panel txt
229PAN_G3FILERN EQU 60 ;DOS file rename panel text
230PAN_G3FILEA EQU 61 ;DOS attr change in progress text
231PAN_G3FILEAB EQU 62 ;DOS attr change panel text
232PAN_G3DIRD EQU 63 ;DOS dir delete in progress text
233PAN_G3DIRDB EQU 64 ;DOS dir delete confirm panel text
234PAN_G3DIRM EQU 65 ;DOS dir make panel text
235PAN_G3DIRERN EQU 66 ;directory rename text
236PAN_G3PRED EQU 67 ;APP predefined menu panel text
237PAN_HELP EQU 68 ;Help panel text
238PAN_G5 EQU 69 ;General panel 5
239PAN_G5TEXT EQU 70 ;add program text
240PAN_G5ADDG EQU 71 ;add group text
241PAN_G6 EQU 72 ;General panel 6
242PAN_G6START EQU 73 ;Enter parameters start a program
243PAN_GSTATUS EQU 74 ;graphics status panel
244PAN_ERR EQU 75 ;small error text panel
245PAN_G7 EQU 76 ;small error text panel
246PAN_G7ERROR EQU 77 ;small error text panel
247PAN_JOHN EQU 78 ;PSC dialog panel
248PAN_CLS EQU 79 ;clear screen
249PAN_BTITLE EQU 80 ;app and dos background title
250PAN_BAAB EQU 81 ;app and dos aab background
251PAN_GDIRECTE EQU 82 ;graphics dir extended panel
252PAN_GFILEE EQU 83 ;graphics dir extended panel
253PAN_GFILEG EQU 84 ;graphics global file panel
254PAN_GDIRECTD1 EQU 85 ;graphics multiple directory 1
255PAN_GDIRECTD2 EQU 86 ;graphics multiple directory 2
256PAN_GFILED1 EQU 87 ;graphics multiple file 1
257PAN_GFILED2 EQU 88 ;graphics multiple file 2
258PAN_G7ERROR2 EQU 89 ;reading tree and file error
259PAN_G2ASCO EQU 90 ;association options
260PAN_G3ASCE EQU 91 ;association panel
261PAN_GSTATUSP EQU 92 ;graphics status
262PAN_G7ERROR3 EQU 93 ;app menu error panel/exit to dos
263PAN_G7ERROR4 EQU 94 ;dir and/or file limit reached
264PAN_G3FILEPRT EQU 95 ;DOS file print in progress txt
265PAN_F10 EQU 96 ;Common actions F10=Actions
266PAN_ALTG EQU 97 ;Common actions Alt+G=Mark all
267PAN_ALTU EQU 98 ;Common actions Alt+U=Unmark all
268PAN_F8 EQU 99 ;Common actions F8=Hex/ASCII
269PAN_DOSTOP EQU 100 ;DOS top panel
270PAN_F2 EQU 101 ;F2=Save
271PAN_BLANK EQU 102 ;panel to blank app instructions
272PAN_CMDL EQU 103 ;Shift+F9=Command Line
273PAN_G2FILA EQU 104 ;DOS file attr confirm panel text
274PAN_G2FILD EQU 105 ;DOS display delete list
275PAN_CMDLA EQU 106 ;app menu Shift+F9=Command Line
276PAN_F10A EQU 107 ;app menu f10 key panel text
277PAN_FVESC EQU 108 ;file view escape key panel text
278PAN_DSFMT7 EQU 109 ;single drive panel titles
279PAN_DSFMT8 EQU 110 ;system file list panel titles
280PAN_TOTALNUM EQU 110 ;total number panels *PCR
281;
282; Internal Shell equates for string vector
283;
284STR_AAPEXT EQU 1 ;main application menu extension
285STR_CLREXT EQU 2 ;color profile extension
286STR_APPMFILE EQU 3 ;default app menu filename
287STR_CLRFILE EQU 4 ;default color filename
288STR_HLPFILE EQU 5 ;default help text filename
289STR_MS1FILE EQU 6 ;microsoft serial mouse driver
290STR_MS2FILE EQU 7 ;IBM mouse driver
291STR_COMSPEC EQU 8 ;string to search for in Environ
292STR_EXIT EQU 9 ;command line termination string
293STR_MOSEXT EQU 10 ;mouse extension length
294STR_LBRACKET EQU 11 ;left bracket in PSC
295STR_RBRACKET EQU 12 ;right bracket in PSC
296STR_PERCENT EQU 13 ;percent sign in PSC
297STR_TITLEESC EQU 14 ;title escape in PSC
298STR_INSTRESC EQU 15 ;instruction escape in PSC
299STR_PRMTESC EQU 16 ;prompt escape in PSC
300STR_DEFLTESC EQU 17 ;default escape in PSC source
301STR_LENGESC EQU 18 ;length escape in PSC source
302STR_MODESC EQU 19 ;modifier escape in PSC source
303STR_CLEARESC EQU 20 ;clear escape in PSC source
304STR_QUOTE EQU 21 ;quote in PSC source
305STR_PSCEND EQU 22 ;end of a PSC line
306STR_WALLOW EQU 23 ;allow string
307STR_WVALID EQU 24 ;valid allow string
308STR_REMOVE EQU 25 ;remove default option in PSC's
309STR_WRESEND EQU 26 ;ending psc for resident mode
310STR_WTRANEND EQU 27 ;ending psc for transient mode
311STR_WTITLDEF EQU 28 ;default user prompt tittle text
312STR_WINSTDEF EQU 29 ;default user prompt instr. text
313STR_WPRMTPDEF EQU 30 ;default user prompt prompt text
314STR_DRIVE EQU 31 ;drive escape in PSC source
315STR_PATH EQU 32 ;path escape in PSC source
316STR_LCTITLEESC EQU 33 ;title escape in PSC
317STR_LCINSTRESC EQU 34 ;instruction escape in PSC
318STR_LCPRMTESC EQU 35 ;prompt escape in PSC
319STR_LCDEFLTESC EQU 36 ;default escape in PSC source
320STR_LCLENGESC EQU 37 ;length escape in PSC source
321STR_LCMODESC EQU 38 ;modifier escape in PSC source
322STR_LCCLEARESC EQU 39 ;clear escape in PSC source
323STR_LCREMOVE EQU 40 ;remove default option in PSC's
324STR_DOSEXIT EQU 41 ;ending batch command for dos exit
325STR_CDIR EQU 42 ;change directory command for psc
326STR_TOPTITLE EQU 43 ;title for indexed help panel
327STR_MNAAAB EQU 44 ;Program menu AAB mnemonics
328STR_MNMAIN EQU 45 ;Prog maint pull down mnemonics
329STR_MNASWI EQU 46 ;Prog switch pull down mnemonics
330STR_MNAEXI EQU 47 ;Prog exit pull down mnmemonics
331STR_MNDAAB EQU 48 ;DOS Services AAB mnemonics
332STR_MNFILE EQU 49 ;DOS Services File mnemonics
333STR_MNDSWI EQU 50 ;DOS Services switch mnemonics
334STR_MNDISP EQU 51 ;DOS Services display mnemonics
335STR_MNDEXI EQU 52 ;DOS Services exit mnemonics
336STR_APPMENU EQU 53 ;app menu configured
337STR_DOSSERV EQU 54 ;DOS services configured
338STR_REFBUF EQU 55 ;refresh DOS buffer configured
339STR_TRANS EQU 56 ;transient shell configured
340STR_MODE10H EQU 57 ;graphics mode 10H
341STR_MODE11H EQU 58 ;graphics mode 11H
342STR_MODE12H EQU 59 ;graphics mode 12H
343STR_CLFILE EQU 60 ;color filename
344STR_MULTIPE EQU 61 ;multiple drive display
345STR_CLRACT EQU 62 ;maintain color active
346STR_MENUACT EQU 63 ;menu maintainance active
347STR_EXITDOS EQU 64 ;exit to DOS active
348STR_CMDLINE EQU 65 ;command line active
349STR_PREDACT EQU 66 ;predefined menu active
350STR_MOUSACT EQU 67 ;mouse active
351STR_LEFTACT EQU 68 ;left hand mouse
352STR_SOUDACT EQU 69 ;sound active
353STR_APMFILE EQU 70 ;app main menu filename
354STR_TOTAL EQU 71 ;total structute list
355STR_FILL1 EQU 72 ;fill pattern 1
356STR_ASCEXT EQU 73 ;default association filename
357STR_CHECKM EQU 74 ;check mark
358STR_RETEXEC EQU 75 ;press enter to exit from start
359STR_NOCMD EQU 76 ;no command for EXEC error
360STR_BUTTON EQU 77 ;button mouse fld text for psc pan
361STR_TEXTS EQU 78 ;invocation text mode option
362STR_NLS EQU 79 ;NLS translation invoke option
363STR_NOFILD EQU 80 ;No files in marked directory'
364STR_NOFILM EQU 81 ;No files match file specifier'
365STR_NOFIL EQU 82 ;'No file'
366STR_ROOTN EQU 83 ;'ROOT'
367STR_DTITLE EQU 84 ;DOS Services AAB mnemonics string
368STR_ATITLE EQU 85 ;App Menu AAB mnemonics string
369STR_DABFILE EQU 86 ;File P. down AAB mnemonics string
370STR_DABDISP EQU 87 ;Disp P. down AAB mnemonics string
371STR_DABSHEL EQU 88 ;Prog P. down AAB mnemonics string
372STR_DABEXIT EQU 89 ;Exit P. down AAB mnemonics string
373STR_AABMAIN EQU 90 ;Mait P. down AAB mnemonics string
374STR_AABSHEL EQU 91 ;Prog P. down AAB mnemonics string
375STR_AABEXIT EQU 92 ;Exit P. down AAB mnemonics string
376STR_MORE EQU 93 ;text mode more string
377STR_DIRT EQU 94 ;Directory title
378STR_FILET EQU 95 ;File title
379STR_DFSAVE EQU 96 ;dir/file buffer disk swap option
380STR_BUFO EQU 97 ;dir/file buffer size override
381STR_ASOFILE EQU 98 ;associate file name option
382STR_ASOEXT EQU 99 ;associate file name extension
383STR_DBCS EQU 100 ;DBCS invocation string
384STR_NOCMDM EQU 101 ;insufficient command line memory
385STR_DATE EQU 102 ;date invocation string
386STR_FSTATT EQU 103 ;file status title ;pcr 2/2/88
387STR_COM2 EQU 104 ;COM2 invocation string D491
388STR_ENH EQU 105 ;invocation enhancements
389STR_SCOPYF EQU 106 ;copy file title
390STR_SMOVEF EQU 107 ;move file title
391STR_SDELEF EQU 108 ;delete file title
392STR_SPRINF EQU 109 ;Print file title
393STR_SASSOF EQU 110 ;Associate file title
394STR_SRENMF EQU 111 ;rename file title
395STR_SSTARF EQU 112 ;start a program title
396STR_SATTRF EQU 113 ;change attribute file title
397STR_SREMOD EQU 114 ;Remove directory title
398STR_SMAKED EQU 115 ;Make directory title
399STR_SRENMD EQU 116 ;Rename directory title
400STR_SADDP EQU 117 ;Add program title
401STR_SADDG EQU 118 ;Add group title
402STR_SCHANP EQU 119 ;Change Program title
403STR_SCHANG EQU 120 ;Change Group title
404STR_SDELMI EQU 121 ;Delete menu item title
405STR_SWARN EQU 122 ;Warning title
406STR_SHELP EQU 123 ;Help panel title
407STR_SPWVER EQU 124 ;password verification title
408STR_SDISO EQU 125 ;display options title
409STR_SFILO EQU 126 ;file options title
410STR_RETCMD EQU 127 ;DOS command return prompt
411STR_UTITLE EQU 128 ;User defined PSC title
412STR_PROFACT EQU 129 ;profile switch
413STR_PROEXT EQU 130 ;profile extension
414STR_CDON EQU 131 ;
415STR_CDOFF EQU 132 ;
416STR_CRON EQU 133 ;
417STR_CROFF EQU 134 ;
418STR_ASON EQU 135 ;
419STR_ASOFF EQU 136 ;
420STR_SBNAME EQU 137 ;
421STR_SBEXT EQU 138 ;
422STR_SBSIZE EQU 139 ;
423STR_SBDATE EQU 140 ;
424STR_SBDISK EQU 141 ;
425STR_FILECHK EQU 142 ;PSC /F parameter
426STR_LCFILECHK EQU 143 ;PSC /f parameter
427STR_SN EQU 144 ;>>SN
428;
429; Active button bit maps ;sos 2/2/88
430;
431BUT_ESC EQU 0000000000000001B ;Esc
432BUT_F1 EQU 0000000000000010B ;F1
433BUT_F5 EQU 0000000000000100B ;F5
434BUT_F9 EQU 0000000000001000B ;F9
435BUT_F10 EQU 0000000000010000B ;F10
436BUT_ALTG EQU 0000000000100000B ;Alt+G
437BUT_LFARROW EQU 0000000001000000B ;Left arrow
438BUT_RTARROW EQU 0000000010000000B ;Right arrow
439BUT_ENTER EQU 0000000100000000B ;Enter
440BUT_ALTU EQU 0000001000000000B ;Alt+U
441BUT_PGUP EQU 0000010000000000B ;PgUp
442BUT_PGDN EQU 0000100000000000B ;PgDn
443BUT_STOP EQU 0001000000000000B ;Stop button
444BUT_F8 EQU 0010000000000000B ;F8
445BUT_F2 EQU 0100000000000000B ;F2=Save
446;
447; Internal button bit map vector equates
448;
449BCB_BACK EQU 1 ;key backgrd
450BCB_LFARROW EQU 2 ;Left arrow foregrd
451BCB_RTARROW EQU 3 ;Right arrow foregrd
452BCB_PGUP EQU 4 ;PgUp foregrd
453BCB_PGDN EQU 5 ;PgDn foregrd
454BCB_BACK2 EQU 6 ;PgUp/Dn backgrd
455;
456; 16 byte paragraph size of allocated buffers
457;
458MAX_COLRBUF EQU 106 ;Color buffer (1.7 K)
459MAX_HELPBUF EQU 625 ;help buffer (10.0 K)
460MAX_TEXTBUF EQU 250 ;logical video text only (4.0 K)
461MAX_APPMBUF EQU 1000 ;application menu buffer (16.0 K)
462MAX_DISQBUF EQU 125 ;display queue text only (2.0K)
463;
464MAX_DIR1BUF EQU 500 ;directory buffer 1 ( 8.0 KB)
465MAX_DIR2BUF EQU 500 ;directory buffer 2 ( 8.0 KB)
466MAX_DOSWBUF EQU 640 ;DOS working buffer (10.0 KB)
467MIN_FILEBUF EQU 64 ;minimum DOS file buffer (1.0 KB)
468SM_FILEBUF EQU 640 ;small file buffer (10.0 KB)
469MIN_DIR1BUF EQU 250 ;min directory buffer 1 ( 4.0 KB)
470MIN_DOSWBUF EQU 500 ;min DOS working buffer ( 8.0 KB)
471;
472MAX_EXECBUF EQU 4070 ;app menu/prompt min memy(64.0 KB)
473MAX_WORKBUF EQU 1000 ;working DOS buffer (10.0 KB)
474MAX_DOSPBUF EQU 12250 ;dos serv min memory (196.0 KB)
475MAX_APPPBUF EQU 4070 ;app menu min memory (64.0 KB)
476;
477; Miscellaneous sizes
478;
479MAX_CCSET EQU 4 ;number of user color selections ;pcr 3/4/88
480MAX_CLRECD EQU 12 ;num of bytes per PCPANEL color rc
481MAX_SCRROWS EQU 30 ;mode 11H and 12H require 30 rows
482MAX_REVERSE EQU 0 ;size of mouse reverse high buffer
483MAX_WPARMLEN EQU 127 ;max psc prompt input length
484MAX_WPSCOUT EQU 512 ;max psc size
485;
486; Machine IDs
487;
488MODEL_80 EQU 0F8H ;model 80 hardware VGA
489SUBMD_80 EQU 000H
490MODEL_60 EQU 0FCH ;model 60 hardware VGA
491SUBMD_60 EQU 005H
492MODEL_50 EQU 0FCH ;model 50 hardware VGA
493SUBMD_50 EQU 004H
494MODEL_30 EQU 0FAH ;model 30 hardware MCGA
495SUBMD_30 EQU 000H
496MODEL_25 EQU 0FAH ;model 25 hardware MCGA
497SUBMD_25 EQU 001H
498MODEL_PC EQU 0FFH ;PC Planar board
499SUBMD_PC EQU 000H
500MODEL_XT EQU 0FEH ;XT Planar board
501SUBMD_XT EQU 000H
502MODEL_JR EQU 0FDH ;JR Planar board
503SUBMD_JR EQU 000H
504MODEL_AT EQU 0FCH ;AT Planar board
505SUBMD_AT EQU 000H
506SUBMD_AS EQU 001H ;AT Planar board for skyrocket
507MODEL_CV EQU 0F9H ;convertible
508SUBMD_CV EQU 000H
509;
510; Keystroke equates
511;
512DCLICK EQU 255 ;double click key
513INABOVE EQU 115 ;insert above ctrl+left arrow
514INBELOW EQU 116 ;insert below ctrl+right arrow
515DELETE EQU 89 ;delete shift+F6
516DELALL EQU 118 ;delete cursor to end ctrl+pgdn
517CR EQU 0DH ;ASCII carriage return
518LF EQU 0AH ;ASCII line feed
519UPARROW EQU 72 ;up arrow
520DNARROW EQU 80 ;down arrow
521LFARROW EQU 75 ;left arrow
522RTARROW EQU 77 ;right arrow
523PGUP EQU 73
524PGDN EQU 81
525ESCK EQU 27
526ENTER EQU 13
527SPACE EQU 32
528F1 EQU 59
529F2 EQU 60
530F3 EQU 61
531F4 EQU 62
532F5 EQU 63
533F6 EQU 64
534F7 EQU 65
535F8 EQU 66
536F9 EQU 67
537F10 EQU 68
538F11 EQU 85h ;*PCR
539ALTC EQU 46
540ALTM EQU 50
541ALTD EQU 32
542ALTR EQU 19
543ALTG EQU 34
544ALTU EQU 22
545SAVE EQU 60 ;F2 save help/psc
546EOLMARK EQU 62 ;F4 separate psc lines
547TAB EQU 09 ;tab
548BKTAB EQU 0FH ;back tab
549BKSPC EQU 08 ;backspace
550SHIFTF9 EQU 92 ;Shift+F9
551;
552; Internal SHELLRD PSP invocation option equates (COM_STATE)
553;
554COM_APPM EQU 0000000000000001B ;application menu configured
555COM_DOSS EQU 0000000000000010B ;DOS Services configured
556COM_REFD EQU 0000000000000100B ;refresh directory
557COM_RESS EQU 0000000000001000B ;resident shell
558COM_AUTI EQU 0000000000010000B ;predefined menu installation
559COM_DRV2 EQU 0000000000100000B ;multiple drive display active
560COM_FLCL EQU 0000000001000000B ;command line access is active
561COM_FLMI EQU 0000000010000000B ;maintain menu item active
562COM_FLCS EQU 0000000100000000B ;maintain color selections active
563COM_FLED EQU 0000001000000000B ;exit to DOS is active
564COM_MOUS EQU 0000010000000000B ;mouse is active.
565COM_LFMS EQU 0000100000000000B ;left hand mouse.
566COM_M10H EQU 0001000000000000B ;Graphics EGA mode 10H requested
567COM_M11H EQU 0010000000000000B ;Graphics VGA mode 11H requested
568COM_M12H EQU 0100000000000000B ;Graphics VGA mode 12H requested
569COM_TEXT EQU 1000000000000000B ;text mode 3 or 7 is active
570;
571; Internal SHELLRD PSP invocation option equates (COM_STATE2)
572;
573COM_SOUD EQU 0000000000000001B ;sound active
574COM_NLS EQU 0000000000000010B ;NLS help index translation active
575COM_DFSAVE EQU 0000000000000100B ;dir/file buffer swap option
576COM_BUFO EQU 0000000000001000B ;dir/file buffer size override
577COM_DBCS EQU 0000000000010000B ;DBCS support is active
578COM_DATE EQU 0000000000100000B ;Date is active
579COM_COM2 EQU 0000000001000000B ;COM2 is active D491
580COM_ENHA EQU 0000000010000000B ;Enhancements active
581COM_SNA EQU 0000000100000000B ;>>SN
582;
583; Internal SHELLRD dialog equates (COM_CDIALOG)
584;
585COM_GDRIVE1 EQU 0 ;DOS drive 1 dialog
586COM_GNAME1 EQU 1 ;DOS filemask 1 dialog
587COM_GDIR1 EQU 2 ;DOS directory 1 dialog
588COM_GFILE1 EQU 3 ;DOS file 1 dialog
589COM_GDRIVE2 EQU 4 ;DOS drive 2 dialog
590COM_GNAME2 EQU 5 ;DOS filemask 2 dialog
591COM_GDIR2 EQU 6 ;DOS directory 2 dialog
592COM_GFILE2 EQU 7 ;DOS file 2 dialog
593COM_APPMENU EQU 8 ;app menu screen
594COM_EXITDOS EQU 9 ;exit to DOS
595COM_PEC EQU 10 ;exit to execute PEC
596COM_PAAB EQU 11 ;app menu action bar dialog
597COM_DAAB EQU 12 ;DOS services action bar dialog
598COM_DCLR EQU 13 ;change color dialog
599COM_FIRST EQU 14 ;first time dialog
600;
601; Internal SHELLRD base screen equates (COM_BASESCR)
602;
603COM_DOSSCR1 EQU 1 ;not used
604COM_DOSSCR4 EQU 2 ;multiple display
605COM_DOSSCR2 EQU 3 ;extended directory display
606COM_DOSSCR3 EQU 4 ;global file list
607COM_APPSCR EQU 5 ;application menu
608COM_PRESCR EQU 6 ;predefined menu
609COM_CLRSCR EQU 7 ;color menu
610COM_AFVIEW EQU 8 ;ascii file view
611COM_HFVIEW EQU 9 ;hex file view
612;
613; Internal Shell vector length equates
614;
615COM_ERRVECLEN EQU 3 ;# bytes in each error vector
616COM_STRVECLEN EQU 3 ;# bytes in each string vector
617COM_INVVECLEN EQU 6 ;# bytes in each invoke vector
618COM_KEYVECLEN EQU 6 ;# bytes in each keys vector
619COM_GCBVECLEN EQU 6 ;# bytes in each graphics vector
620COM_PCBVECLEN EQU 4 ;# bytes in each panel vector
621COM_ICBVECLEN EQU 4 ;# bytes in each input vector
622COM_SCBVECLEN EQU 4 ;# bytes in each scroll vector
623COM_BCBVECLEN EQU 2 ;# bytes in each button vector
624COM_MCBVECLEN EQU 2 ;# bytes in each mouse vector
625COM_MGPVECLEN EQU 3 ;# bytes in each group vector
626COM_FLDVECLEN EQU 4 ;# bytes in each fld vector
627COM_CALTABLEN EQU 6 ;# bytes in each fld table entry
628COM_SWITABLEN EQU 3 ;# bytes in each fld table entry
629COM_SWIVECLEN EQU 3 ;# bytes in each fld table entry
630;
631; Field call table ID equates
632;
633;CAL_PREDEF EQU 1 ;predefined app menu
634CAL_APPM EQU 1 ;application menu call table ID
635CAL_CLRSCR EQU 2 ;color screen
636CAL_DOSSCR2 EQU 3 ;dos services screen 2
637CAL_DOSSCR3 EQU 4 ;dos services screen 3
638CAL_DOSSCR4 EQU 5 ;dos services screen 4
639CAL_AFVIEW EQU 6 ;ascii file view
640;
641; Mouse field group equates
642;
643MGG_AABDOS EQU 1 ;AAB for DOS
644MGG_AABFILE EQU 2 ;AAB file pull down group
645MGG_AABDISP EQU 3 ;AAB display pull down group
646MGG_AABSHEL EQU 4 ;AAB file pull down group
647MGG_AABEXIT EQU 5 ;AAB exit pull down group
648MGG_DOSG2 EQU 6 ;DOS G2 popup panel fields
649MGG_DOSVIEW EQU 7 ;DOS file view fields
650MGG_DOSG3 EQU 8 ;DOS G3 esc and help
651MGG_G3FLDS EQU 9 ;DOS G3 pan copy/move file dest
652MGG_G3ATTR EQU 10 ;DOS G3 pan file attribute sele
653MGG_DOSG6 EQU 11 ;DOS G6 pan esc and f1 key fiel
654MGG_AABAPPM EQU 12 ;APP menu actual group
655MGG_AABAOPT EQU 13 ;AAB options pull down group
656MGG_AABAPRG EQU 14 ;AAB program pull down group
657MGG_AABAEXT EQU 15 ;AAB exit pull down group
658MGG_AADDT EQU 16 ;app menu item add title group
659MGG_APPMITM EQU 17 ;App menu item fields (actual appl
660MGG_APPPASS EQU 18 ;App menu add/edit/delete password
661MGG_APPFILN EQU 19 ;App menu add/edit filename field
662MGG_APPCONF EQU 20 ;App menu item delete confirm fiel
663MGG_JOHN EQU 21 ;App menu dynamic user dialog flds
664MGG_ERRFLDS EQU 22 ;DOS small error panel fields
665MGG_G7FLDS EQU 23 ;DOS big error panel
666MGG_G3ERRFLDS EQU 24 ;DOS g3 error fields
667MGG_DOSMULT EQU 25 ;DOS multiple group
668MGG_DOSEXTN EQU 26 ;DOS extended group
669MGG_DOSGLOB EQU 27 ;DOS global group
670MGG_CLR EQU 28 ;App color group
671MGG_LIHELP EQU 29 ;lower help group
672MGG_STATUSR EQU 30 ;status popup panel (right side)
673MGG_STATUSL EQU 31 ;status popup panel (left side)
674MGG_SORTC EQU 32 ;display options panel
675MGG_FILEOPT EQU 33 ;file options panel
676MGG_DOSG2DEL EQU 34 ;delete list panel
677MGG_DOSG3EX EQU 35 ;program parameters
678MGG_DOSG3AS EQU 36 ;associate file extensions
679;
680; Mouse data field ID equates
681;
682MFF_AABFILE EQU 1 ;AAB file
683MFF_AABDISP EQU 2 ;AAB options
684MFF_AABSHEL EQU 3 ;AAB special
685MFF_AABEXIT EQU 4 ;AAB exit
686MFF_AABHELP EQU 5 ;AAB help
687;
688MFF_PDFSTART EQU 6 ;Open
689MFF_PDFPRINT EQU 7 ;print
690MFF_PDFASSOC EQU 8 ;assoc
691MFF_PDFMOVE EQU 9 ;move
692MFF_PDFCOPY EQU 10 ;copy
693MFF_PDFDELETE EQU 11 ;delete
694MFF_PDFRENAME EQU 12 ;rename
695MFF_PDFATTR EQU 13 ;attribute
696MFF_PDFVIEW EQU 14 ;view
697MFF_PDFCREATE EQU 15
698MFF_PDFSELECT EQU 16 ;select all
699MFF_PDFDSELECT EQU 17 ;Deselect all
700MFF_PDFESC EQU 18 ;esc
701;
702MFF_PDSSORT EQU 19 ;display options (sort)
703MFF_PDSFILEOPT EQU 20
704MFF_PDSEXTEND EQU 21 ;show info
705MFF_PDSESC EQU 22 ;esc;
706MFF_PDPSINGLE EQU 23 ;single
707MFF_PDPMULT EQU 24 ;multiple
708MFF_PDPGLOBAL EQU 25 ;system
709MFF_PDPESC EQU 26 ;esc
710;
711MFF_PDEDOSX EQU 27 ;exit to start a program
712MFF_PDERESUME EQU 28 ;resume file system
713MFF_PDEESC EQU 29 ;esc
714;
715MFF_DOSG2FLD1 EQU 30 ;selection field 1
716MFF_DOSG2FLD2 EQU 31 ;selection field 2
717MFF_DOSG2ENTER EQU 32 ;enter
718MFF_DOSG2ESC EQU 33 ;esc
719MFF_DOSG2HLP EQU 34 ;f1
720;
721MFF_DOSVFPGUP EQU 35 ;PgUp
722MFF_DOSVFPGDN EQU 36 ;PgDn
723MFF_DOSVFESC EQU 37 ;Esc (25 rows)
724;
725MFF_DOSG3FLD1 EQU 38 ;selection field 1
726MFF_DOSG3FLD2 EQU 39 ;selection field 2
727MFF_DOSG3CH EQU 40 ;hidden attribute selection
728MFF_DOSG3CO EQU 41 ;read only attr selection
729MFF_DOSG3CA EQU 42 ;archive attribute selection
730MFF_DOSG3ENTER EQU 43 ;enter
731MFF_DOSG3ESC EQU 44 ;esc
732MFF_DOSG3HLP EQU 45 ;help
733;
734MFF_DOSG6ENTER EQU 46 ;enter
735MFF_DOSG6ESC EQU 47 ;Esc
736MFF_DOSG6HLP EQU 48 ;F1
737;
738MFF_GDRIVE1 EQU 49 ;DOS A-Z drive display field
739MFF_GFILEM EQU 50 ;Single Drive filename input fld;
740MFF_AABAOPT EQU 51 ;AAB programs
741MFF_AABAPROG EQU 52 ;AAB groups
742MFF_AABAEXIT EQU 53 ;AAB exit
743;
744MFF_PDASTART EQU 54 ;start program menu
745MFF_PDAADDPSC EQU 55 ;add
746MFF_PDACHANGE EQU 56 ;change
747MFF_PDADELETE EQU 57 ;delete
748MFF_PDACOPY EQU 58 ;copy
749MFF_PDAOESC EQU 59 ;esc field
750;
751MFF_PDADOS EQU 60 ;add group
752MFF_PDACMD EQU 61 ;delete group
753MFF_PDAREM EQU 62 ;remane group
754MFF_PDAREARRG EQU 63 ;rearrange
755MFF_PDAPESC EQU 64 ;esc
756;
757MFF_PDADOSX EQU 65 ;exit to DOS
758MFF_PDARESUME EQU 66 ;resume start a program
759MFF_PDAXESC EQU 67 ;esc
760;
761MFF_AADDTF2 EQU 68 ;app menu add title enter
762MFF_AADDTESC EQU 69 ;app menu add title esc
763MFF_AADDTHLP EQU 70 ;app menu add title help
764;
765MFF_APPMITEM EQU 71 ;app menu item selection field
766MFF_APPMITEMSB EQU 72 ;app menu item scroll bar
767;
768MFF_APPOESC EQU 73 ;app other menu Esc key
769MFF_APPOHLP EQU 74 ;app menu help key
770MFF_APPOCMDL EQU 75 ;app menu Shift+F9=command line
771;
772MFF_APPADPENTR EQU 76 ;app enter
773MFF_APPADPESC EQU 77 ;app add/edit/delete password
774MFF_APPADPHLP EQU 78 ;app add/edit/delete password
775;
776MFF_F8 EQU 79 ;F8=Hex/ASCII
777;
778MFF_APPADKENTR EQU 80 ;app add/edit type enter
779MFF_APPADKESC EQU 81 ;app add/edit type Esc key
780MFF_APPADKHLP EQU 82 ;app add/edit type F1 key
781;
782MFF_APPADFENTR EQU 83 ;app add/edit filename enter
783MFF_APPADFESC EQU 84 ;app add/edit filename Esc
784MFF_APPADFHLP EQU 85 ;app add/edit filename F1
785;
786MFF_APPDECOY EQU 86 ;app delete confirmation yes
787MFF_APPDECON EQU 87 ;app delete confirmation no
788MFF_APPDECOEN EQU 88 ;app delete confirmation enter
789MFF_APPDECOESC EQU 89 ;app delete confirmation Esc
790MFF_APPDECOHLP EQU 90 ;app delete confirmation F1
791;
792MFF_JOHNENTER EQU 91 ;Enter
793MFF_JOHNESC EQU 92 ;Esc key
794MFF_JOHNHLP EQU 93 ;F1 key
795;
796MFF_ERRESC EQU 94 ;Esc key
797MFF_ERRHLP EQU 95 ;F1 key
798;
799MFF_G7FLD1 EQU 96 ;selection field 1
800MFF_G7FLD2 EQU 97 ;selection field 2
801MFF_G7ENTER EQU 98 ;enter
802MFF_G7ESC EQU 99 ;Esc key
803MFF_G7HLP EQU 100 ;F1 key
804;
805MFF_G3EFLD1 EQU 101 ;selection field 1
806MFF_G3EFLD2 EQU 102 ;selection field 2
807;
808MFF_GDRIVE2 EQU 103 ;DOS A-Z drive display field2
809MFF_GFILEM1 EQU 104 ;Mult Drive filename input fld
810MFF_GFILEM2 EQU 105 ;Mult Drive filename input fld
811MFF_GDIRECTD1 EQU 106 ;Mult dir tree field 1
812MFF_GDIRECTDB1 EQU 107 ;Mult dir tree scroll bar 1
813MFF_GDIRECTD2 EQU 108 ;Mult dir tree field 2
814MFF_GDIRECTDB2 EQU 109 ;Mult dir tree scroll bar 2
815MFF_GFILED1 EQU 110 ;Mult file field 1
816MFF_GFILED1B EQU 111 ;Mult file scroll bar 1
817MFF_GFILED2 EQU 112 ;Mult file field 2
818MFF_GFILED2B EQU 113 ;Mult file scroll bar 2
819;
820MFF_GFILEG EQU 114 ;Global file field
821MFF_GFILEGB EQU 115 ;Global file scroll bar
822;
823MFF_GDIRECTE EQU 116 ;Ext dir tree field
824MFF_GDIRECTEB EQU 117 ;Ext dir tree scroll bar
825MFF_GFILEE EQU 118 ;Ext file field 1
826MFF_GFILEEB EQU 119 ;Ext file scroll bar
827;
828MFF_CRARROW EQU 120 ;Color palette right
829MFF_CLARROW EQU 121 ;Color palette left
830;
831MFF_LF1 EQU 122 ;lower help panel F1 field
832MFF_LF5 EQU 123 ;lower help panel F5 field
833MFF_LF9 EQU 124 ;lower help panel F9 field
834MFF_LESC EQU 125 ;lower help panel Esc field
835MFF_LHELP EQU 126 ;lower help panel selection
836MFF_LSB EQU 127 ;lower help panel scroll bar
837;
838MFF_STATRESC EQU 128 ;status esc key
839MFF_STATRHLP EQU 129 ;status F1 key
840MFF_STATLESC EQU 130 ;status esc key
841MFF_STATLHLP EQU 131 ;status F1 key
842;
843MFF_AAB EQU 132 ;background AAB field
844MFF_DOSVFENTER EQU 133 ;enter key for fkey line
845MFF_F10A EQU 134 ;*PCR (AND MFF RENUM)
846MFF_F10 EQU 135 ;F10=Actions
847MFF_ALTG EQU 136 ;Alt+G=Mark all
848MFF_ALTU EQU 137 ;Alt+U=Unmark all
849MFF_CMDL EQU 138 ;Shift+F9=Command Line
850;
851MFF_APPPROG EQU 139 ;add/change title field
852MFF_APPPSC EQU 140 ;add/change psc field
853MFF_APPHELP EQU 141 ;add/change help field
854MFF_APPPASS EQU 142 ;add/change password field
855MFF_APPFILE EQU 143 ;add/change filename field
856;
857MFF_DOSG3FROM EQU 144 ;G3 panel from field
858MFF_DOSG3TO EQU 145 ;G3 panel to field
859;
860MFF_FILEMASK EQU 146 ;filemask input field
861MFF_BYNAME EQU 147 ;sort by name
862MFF_BYEXT EQU 148 ;sort by extension
863MFF_BYDATE EQU 149 ;sort by date
864MFF_BYSIZE EQU 150 ;sort by size
865MFF_BYDISK EQU 151 ;sort by disk order
866MFF_BYNAMEB EQU 152 ;sort by name
867MFF_BYEXTB EQU 153 ;sort by extension
868MFF_BYDATEB EQU 154 ;sort by date
869MFF_BYSIZEB EQU 155 ;sort by size
870MFF_BYDISKB EQU 156 ;sort by disk order
871;
872MFF_DELCONF EQU 157 ;file options delete field
873MFF_REPCONF EQU 158 ;file options replace field
874MFF_MULCONF EQU 159 ;file options across dirs field
875;
876MFF_DELCONFB EQU 160 ;file options delete field
877MFF_REPCONFB EQU 161 ;file options replace field
878MFF_MULCONFB EQU 162 ;file options across dirs field
879;
880MFF_DOSG2DELL EQU 163 ;dos G2 delete list field
881MFF_DOSG2DELLL EQU 164 ;dos G2 delete list field
882MFF_DOSG2DELLR EQU 165 ;dos G2 delete list field
883;
884MFF_GDIRECTD1U EQU 166
885MFF_GDIRECTD1D EQU 167
886MFF_GDIRECTD2U EQU 168
887MFF_GDIRECTD2D EQU 169
888MFF_GFILED1U EQU 170
889MFF_GFILED1D EQU 171
890MFF_GFILED2U EQU 172
891MFF_GFILED2D EQU 173
892MFF_GDIRECTEU EQU 174
893MFF_GDIRECTED EQU 175
894MFF_GFILEEU EQU 176
895MFF_GFILEED EQU 177
896MFF_GFILEGU EQU 178
897MFF_GFILEGD EQU 179
898;
899MFF_DOSG3EXP EQU 180
900MFF_DOSG3EXPL EQU 181
901MFF_DOSG3EXPR EQU 182
902;
903MFF_DOSG3ASE EQU 183
904MFF_DOSG3ASEL EQU 184
905MFF_DOSG3ASER EQU 185
906;
907MFF_DOSG3FROML EQU 186
908MFF_DOSG3FROMR EQU 187
909MFF_DOSG3TOL EQU 188
910MFF_DOSG3TOR EQU 189
911;
912MFF_PDBACK EQU 190 ;pull down panel esc w/click outsi
913MFF_APPPROGLA EQU 191 ;title field left arrow
914MFF_APPPROGRA EQU 192 ;title field right arrow
915MFF_APPPSCLA EQU 193 ;program field left arrow
916MFF_APPPSCRA EQU 194 ;program field right arrow
917MFF_APPHELPLA EQU 195 ;help field left arrow
918MFF_APPHELPRA EQU 196 ;help field right arrow
919;
920MFF_LHELPUA EQU 197 ;lower help panel up arrow
921MFF_LHELPDA EQU 198 ;lower help panel down arrow
922;
923; help on keys, help on help
924;
925HLP_KEYASSIGN EQU 1 ;help on keys
926HLP_HELPONHELP EQU 2 ;help on help
927;
928; general shell helps
929;
930HLP_PROMEUINST EQU 3 ;instruction for progrm menu
931HLP_DOSSERINST EQU 4 ;explain what is dos services
932HLP_MOUSEUSAGE EQU 5 ;explain how to use mouse
933HLP_KEYBDUSAGE EQU 6 ;explain using the keyboard
934;
935; start a program action bar helps
936;
937HLP_AABPROGRAM EQU 7 ;AAB PROGRAM help
938HLP_AABGROUP EQU 8 ;AAB GROUP help
939HLP_AABEXIT EQU 9 ;AAB EXIT function help
940;
941; start a program PROGRAM pulldown helps
942;
943HLP_STARTPROG EQU 10 ;start program help
944HLP_ADDPROG EQU 11 ;add a program help
945HLP_GENCHANGE EQU 12 ;change program help
946HLP_DELMAFUNC EQU 13 ;delete program item
947HLP_COPYMAFUNC EQU 14 ;copy program help
948;
949; start a program GROUP pulldown helps
950;
951HLP_ADDGROUP EQU 15 ;add group help
952HLP_CHNGEGROUP EQU 16 ;change group help
953HLP_DELGROUP EQU 17 ;delete group help
954HLP_REARGROUP EQU 18 ;reorder item help
955;
956; start a program EXIT pulldown helps
957;
958HLP_DOSEXITP EQU 19 ;explain exit to dos
959HLP_RESPRGMENU EQU 20 ;explain how to start a program
960;
961; file system action bar helps
962;
963HLP_GENFILFUNC EQU 21 ;view,delete,copy,move,rename, etc
964HLP_GENOPTIONS EQU 22 ;options help
965HLP_GENSPECIAL EQU 23 ;special help
966HLP_GENEXIFUNC EQU 24 ;EXIT function
967;
968; file system FILE pulldown helps
969;
970HLP_STRTPRGDOS EQU 25 ;DOS service start program list
971HLP_PRINTFILE EQU 26 ;explain how to print file
972HLP_ASSCDOS EQU 27 ;Associate pull down panel
973HLP_MOVEFILE EQU 28 ;explain how to move file
974HLP_COPYFILE EQU 29 ;explain how to copy file
975HLP_DELFILFUNC EQU 30 ;explain how to delete file
976HLP_RENMEFILE EQU 31 ;expalin how to rename file
977HLP_GENCHGATTR EQU 32 ;hidden, readonly, and archive
978HLP_VIEWFILE EQU 33 ;explain how to view file
979HLP_MAKEDIR EQU 34 ;explain how to make a directory
980HLP_SELECTALL EQU 35 ;select all help
981HLP_DSELECTALL EQU 36 ;Deselect all help
982;
983; file system OPTIONS pulldown helps
984;
985HLP_GENFILSRT EQU 37 ;display options, filemask / sort
986HLP_CONFIRM EQU 38 ;file options
987HLP_SINGLEDRV EQU 39 ;explain file status panel
988;
989; file system SPECIAL pulldown helps
990;
991HLP_EXTDIRDIS EQU 40 ;explain extend directory display
992HLP_MULTIDRV EQU 41 ;explain multiple drive display
993HLP_GLOFILELST EQU 42 ;explain global file list display
994;
995; file system EXIT pulldown helps
996;
997HLP_PROGMENU EQU 43 ;defines what is program menu help
998HLP_RESDOSSERV EQU 44 ;explain how to resume dos service
999;
1000; start a program general add program/group help messages
1001;
1002HLP_ADDTITLE EQU 45 ;add title help
1003HLP_ADDPASWRD EQU 46 ;add password help for program or
1004HLP_ADDONLINE EQU 47 ;add online help information
1005HLP_EXPPRGSTRT EQU 48 ;describe program startup command
1006HLP_ADDMFILNAM EQU 49 ;explain steps to create a filenme
1007;
1008; start a program general change program/group help messages
1009;
1010HLP_CHGMEUFILN EQU 50 ;explain change menu item filename
1011HLP_CHGMEUITIL EQU 51 ;detail change menu item title
1012HLP_CHGMEUIHLP EQU 52 ;explain on changing menu item
1013HLP_CHGMEUIPSW EQU 53 ;detail change menu item password
1014HLP_CHGMEUIPSC EQU 54 ;detail change menu item startup
1015;
1016; general start a program help
1017;
1018HLP_PASWRDLIM EQU 55 ;explain password prompt
1019HLP_CHNGECOLOR EQU 56 ;change the color(s) for display
1020HLP_DELMEUCONF EQU 57 ;delete menu item confirmation
1021HLP_NOTDELMEU EQU 58 ;do not delete menu item
1022;
1023; file system file options popup helps
1024;
1025HLP_DELCONF EQU 59 ;explain confirmation for deleting
1026HLP_REPITMCONF EQU 60 ;replace menu item confirmation
1027HLP_DIRSELECT EQU 61 ;select across directory options
1028;
1029; file system display options popup helps
1030;
1031HLP_FILENAME EQU 62 ;explain display by filemask
1032HLP_FILNAMESRT EQU 63 ;explain sorting by file name
1033HLP_FILEXTSRT EQU 64 ;expalin sorting by file extension
1034HLP_FILDATESRT EQU 65 ;explain sorting by file date
1035HLP_FILSIZESRT EQU 66 ;explain sorting by file size
1036HLP_DISKORD EQU 67 ;files displayed by disk order
1037;
1038; file system change attribute popup helps
1039;
1040HLP_HIDFILATTR EQU 68 ;explain hidden file attribute
1041HLP_READONATTR EQU 69 ;explain file read only attribute
1042HLP_ARCHIVATTR EQU 70 ;explain file archive attribute
1043;
1044; file system change attribute marked files popup helps
1045;
1046HLP_CHGONEFILE EQU 71 ;explain how to change mark file
1047HLP_CHGMULTFIL EQU 72 ;explain how to change multi file
1048;
1049; file system remove directory confirmation helps
1050;
1051HLP_NOTREMDIR EQU 73 ;do not remove the directory
1052HLP_REMOVEDIR EQU 74 ;remove the directory
1053;
1054; file system replace file error popup equates
1055;
1056HLP_REPLCESKIP EQU 75 ;skip this file, do not replace
1057HLP_REPLCEFILE EQU 76 ;explain replacing a file
1058;
1059; file system delete file confirm popup equates
1060;
1061HLP_SKIPFILE1 EQU 77 ;explain skip file help and cont
1062HLP_DELFILE EQU 78 ;explain deleteing file
1063;
1064; file system associate file option popup equates
1065;
1066HLP_OPTPRMPT EQU 79 ;use the option prompt
1067HLP_NOOPTPRMPT EQU 80 ;do not use the option prompt
1068;
1069; general file system help
1070;
1071HLP_VIEWDRIVE EQU 81 ;explain viewing a dir for a drive
1072HLP_NEWDIRNAME EQU 82 ;explain renaming directory
1073HLP_COPYDEST EQU 83 ;explain copy to destination
1074HLP_MOVDEST EQU 84 ;explain moving to destination
1075HLP_NEWFILENME EQU 85 ;explain new file name
1076HLP_STRTPRGOPT EQU 86 ;explain starting prog OPTIONS
1077HLP_NEWDIRFNME EQU 87 ;explain specifying new dir name
1078HLP_DIRSTRUCT EQU 88 ;explain the structure of dir
1079HLP_FILELIST EQU 89 ;help for highlighting file list
1080HLP_MARKFILE EQU 90 ;mark file help
1081HLP_ASSEXT EQU 91 ;associate file extensions help
1082HLP_GENVIEW EQU 92 ;general view file help
1083HLP_LISTDEL EQU 93 ;explain list of delete files
1084HLP_MOVFROM EQU 94 ;help for move file from: field
1085HLP_COPYFROM EQU 95 ;help for copy file from: field
1086;
1087; no help available message
1088;
1089HLP_NOHLPMSG EQU 96 ;no help message assigned
1090;
1091; more help for error message for the shell
1092;
1093HLP_SHLMEMREQ EQU 97 ;shell memory requirements
1094HLP_NODOSMEUF EQU 98 ;error msg for no menu file
1095HLP_MISSHLCLRF EQU 99 ;error msg for missing SHELL.CLR
1096HLP_DRIVEFAIL EQU 100 ;error msg for drive failure
1097HLP_MRKACTBAR EQU 101 ;error marking action bar
1098HLP_EMPTYFILE EQU 102 ;empty file, delete entry from lst
1099HLP_DELFILLIMT EQU 103 ;error msg for file limit
1100HLP_EMPTYMENU EQU 104 ;error msg for empty menu
1101HLP_MENULEVEL EQU 105 ;error message for max menu level
1102HLP_PSCQUOTE EQU 106 ;error message for no psc quote
1103HLP_PASSERR EQU 107 ;error message for bad password
1104HLP_PSCBADPARM EQU 108 ;error message for bad param num
1105HLP_PSCBUFOUT EQU 109 ;psc output buffer exceeded
1106HLP_PSCNORBRAC EQU 110 ;missing psc bracket help
1107HLP_PSCTITLE EQU 111 ;psc title too large
1108HLP_PSCINSTR EQU 112 ;psc instruction too large
1109HLP_PSCPROMPT EQU 113 ;psc prompt too large
1110HLP_PSCDEFAULT EQU 114 ;psc default too large
1111HLP_PSCMOD EQU 115 ;invalid modify option letters
1112HLP_COPYONSELF EQU 116 ;no copy file on itself
1113HLP_MENUFULL EQU 117 ;menu is full error
1114HLP_ROOTREDE EQU 118 ;can not rename, delete root
1115HLP_PSCBADNUM EQU 119 ;bad number in psc commands
1116HLP_PSCPARVAL EQU 120 ;use of uninitialized psc param
1117HLP_FILENOFOU EQU 121 ;file not found help
1118HLP_PATHNOFOU EQU 122 ;path not found help
1119HLP_ACCDENIED EQU 123 ;access denied help
1120HLP_DESTINCORR EQU 124 ;destination path incorrect
1121HLP_NOFREEMEM EQU 125 ;DOS unable to free memory
1122HLP_WRITEPRO EQU 126 ;disk write protected
1123HLP_DISKFULL EQU 127 ;disk full error
1124HLP_ASSLIMIT EQU 128 ;association file limit reached
1125HLP_ASSBADEXT EQU 129 ;bad extension for assocation file
1126HLP_ASSBADPRO EQU 130 ;bad program ext for association
1127HLP_INVPARNUM EQU 131 ;invalid number of parameter help
1128HLP_GENERAL EQU 132 ;general error help
1129HLP_INTRO EQU 133 ;shell introduction
1130HLP_DISKFAIL EQU 134 ;disk failure
1131HLP_DIREXMAX EQU 135 ;directories exceed maximum
1132HLP_OPTNOTACT EQU 136 ;option not active
1133HLP_STATUS EQU 137 ;status popup panel text
1134HLP_SGDRCOPY EQU 138 ;single drive copy not supported
1135HLP_ONEMARK EQU 139 ;function limited to one file
1136HLP_PRTINST EQU 140 ;print not installed
1137HLP_PRTQFULL EQU 141 ;print queue full
1138HLP_PRTNOSUB EQU 142 ;print cannot be submitted
1139HLP_BIGFILE EQU 143 ;filespec in psc > 76 chars
1140; *PCR
1141; APP_STATUS flag equates *PCR
1142; *PCR
1143APP_ERROR EQU 0000000000000001B ;general error has occured *PCR
1144APP_PSC EQU 0000000000000010B ;current item is psc *PCR
1145APP_MENU EQU 0000000000000100B ;current item is menu *PCR
1146APP_COPYOP EQU 0000000000001000B ;copy op in process *PCR
1147APP_REORDERDC EQU 0000000000010000B ;double click in reorder op *PCR
1148APP_RETRY EQU 0000000000100000B ;retry operation *PCR
1149APP_NOCLRSC EQU 0000000001000000B ;slctp clear screen *PCR
1150APP_INIT EQU 0000000010000000B ;memory initialization *PCR
1151APP_BIGERR EQU 0000000100000000B ;missing shell.meu error condition *PCR
1152APP_READ EQU 0000001000000000B ;read of menu on disk required *PCR
1153APP_COLRERR EQU 0000010000000000B ;call of proc_error from color chg *PCR
1154APP_REORDEROP EQU 0000100000000000B ;reorder operation in progress *PCR
1155APP_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 @@
1;
2PAGE
3;-----------------------------------------------------------------------------+
4; :
5; Name: SHELLRD.INC :
6; :
7; Description: Include file for SHELLRD.ASM :
8; :
9; Revised: 04-21-88 :
10; :
11;-----------------------------------------------------------------------------+
12;
13PAGE
14;-----------------------------------------------------------------------------+
15; :
16; Name: INIT_GTEXT :
17; :
18; Description: Initialize the PCGRAPH parameter block with the PCB :
19; contained in AX. :
20; :
21; Entry: AX = Panel ID to initialize into PCGRAPH parameter :
22; block. :
23; :
24; Exit: ES:DI = Address of initialized PCGRAPH parameter :
25; block. :
26; :
27; Entry point: INIT_GTEXT :
28; :
29; Notes: None. :
30; :
31; Internal references: None. :
32; :
33; External references: None. :
34; :
35;-----------------------------------------------------------------------------+
36;
37INIT_GTEXT PROC NEAR
38;
39 CALL FAR PTR GET_PCB ;return panel address at ES:DI
40;
41 PUSH ES:[DI]+PCB_FLAGSEG ;flag string segment
42 PUSH ES:[DI]+PCB_FLAGOFF ;flag string offset
43 PUSH ES:[DI]+PCB_EXPANDSEG ;segment of text string
44 PUSH ES:[DI]+PCB_EXPANDOFF ;offset of text string
45 PUSH ES:[DI]+PCB_WIDTH ;width of panel
46 PUSH ES:[DI]+PCB_LROW ;lower right corner
47 PUSH ES:[DI]+PCB_UCOL ;column location of panel
48 PUSH ES:[DI]+PCB_UROW ;row location of panel
49 PUSH ES:[DI]+PCB_CCBID ;Index number of log color
50 MOV AL,ES:[DI]+PCB_OPT4
51;
52 LEA DI,GEN_DATA ;point graphics window structure
53 ; to data area
54 MOV [DI]+G_DRAWT_F,AL ;set flags
55 POP AX ;get color index
56 POP BX ;get upper row
57 MOV [DI]+G_DRAWTROWO,BX ;window row origin (top left)
58 POP [DI]+G_DRAWTCOLO ;window column origin
59 POP CX ;get lower row and calculate
60 SUB CX,BX ; number of lines in text panel
61 INC CX
62 MOV [DI]+G_DRAWTLINES,CX
63 POP [DI]+G_DRAWTLEN ;width of panel text
64;
65 POP WORD PTR [DI].G_DRAWTSTRING
66 ;panel text string address
67 POP WORD PTR [DI+2].G_DRAWTSTRING
68 POP WORD PTR [DI].G_DRAWTFLAGS
69 ;panel text flag string address
70 POP WORD PTR [DI+2].G_DRAWTFLAGS
71;
72 DEC [DI]+G_DRAWTROWO ;window row origin (top left)
73 DEC [DI]+G_DRAWTCOLO ;window column origin
74;
75 MOV BX,G_DRAWT_WA+G_DRAWT_WC+G_DRAWT_UA
76 CMP [DI]+G_DRAWT_F,0 ;check if source flags option used
77 JE IGT10
78;
79 CMP WORD PTR [DI].G_DRAWTFLAGS,0
80 JNE IGT10
81;
82 OR BX,G_DRAWT_UF ;set option to use source flags
83 ; option
84;
85IGT10: MOV [DI]+G_DRAWTOPT,BX ;option word
86 MOV [DI]+G_DRAWTSKIP,0 ;num bytes in source to next line
87;
88 PUSH ES ;save pointer to panel data
89 PUSH DI
90 CALL FAR PTR GET_COLOR ;get color attribute
91 MOV AL,ES:[DI]+CCB_A1 ;get normal panel color
92 POP DI ;point back to panel data
93 POP ES
94 MOV [DI]+G_DRAWT_A,AL ;window attribute
95 MOV [DI]+G_DRAWTOUT,AL ;outline color attribute
96;
97 MOV AX,DATA ;point to segment containing
98 MOV ES,AX ; general data area
99;
100 RET
101INIT_GTEXT ENDP
102;
103PAGE
104;-----------------------------------------------------------------------------+
105; :
106; Name: PROCESS_SCROLL :
107; :
108; Description: Highlight mouse fields in the specified range as :
109; the up and down arrows are used. The range of mouse :
110; fields to highlight are specified in AX and BX with :
111; intervening fields in consecutive order. The help :
112; ID for each selection is calculated from the values :
113; set to COM_HCBIDL and COM_HCBIDH. It is important :
114; that the help equates are in sequential order. :
115; :
116; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :
117; COM_HCBIDL ÄÄ 1. First element to highlight ÄÄÄÄ AX :
118; ³ 2. : : ³ :
119; ³ 3. : : ³ :
120; COM_HCBIDH ÄÄ 4. Last element to highlight ÄÄÄÄ BX :
121; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :
122; :
123; :
124; Entry: AX = First element to highlight :
125; BX = Last element to highlight :
126; :
127; COM_HCBIDL = First element help ID :
128; COM_HCBIDH = Last element help ID :
129; COM_HCBID = Set to desired help ID for all selections:
130; and set COM_HCBIDL and COM_HCBIDH to 0. :
131; :
132; COM_SCROPT = Set scroll option for multiple :
133; selections. COM_HCBID and COM_CURPUPF :
134; must be initialized before entry. :
135; :
136; Exit: COM_MOK 0= Mouse input :
137; 1= Keyboard input :
138; COM_KEY = Keystroke (keyboard or mouse value) :
139; COM_ROW = Row of mouse pointer (text coordinates) :
140; COM_COL = Column of mouse pointer (text coord) :
141; COM_POSITION = Line number of scroll bar element :
142; COM_CURRF = Current mouse field ID :
143; COM_DELTA = Scroll bar delta from current top :
144; element displayed in panel :
145; COM_HCBID = Current help equate :
146; :
147; :
148; Notes: None. :
149; :
150; Entry point: PROCESS_SCROLL :
151; :
152; Internal references: PCTRACK_CALL :
153; PCINPUT_CALL :
154; :
155; External references: None. :
156; :
157;-----------------------------------------------------------------------------+
158;
159PROCESS_SCROLL PROC FAR
160;
161 PUSH AX ;save registers
162 PUSH BX
163 PUSH CX
164 PUSH DX
165 PUSH DI
166 PUSH ES
167 PUSH SI
168 PUSH DS
169;
170; initialize first highlighted field
171;
172 MOV COM_HLPTEMP,0 ;set to unique scroll help
173;
174 CMP COM_HCBIDL,0 ;check if unique scroll item
175 JNE SI04 ; help option active
176;
177 CMP COM_HCBIDH,0
178 JNE SI04
179;
180 PUSH COM_HCBID ;set help ID
181 POP COM_HLPTEMP
182;
183SI04: MOV COM_FLDT,2 ;scroll field type
184;
185 MOV CX,BX ;calulate number of entries
186 SUB CX,AX ; in list
187 XOR CH,CH ;clear to zero
188 ADD CL,'1' ;adjust for string value
189 MOV COM_CNT,CX ;save value
190;
191 CMP COM_SCROPT,1 ;when using this option make
192 JNE SI05 ; sure starting help ID initializd
193 ; to COM_HCBID and the current
194 ; field to highlight COM_CURPUPF
195;
196 MOV DX,AX ;get first field
197 MOV AX,COM_CURPUPF ;make new mouse field the current
198 MOV COM_LASTF,AX ; field
199 JMP SI07
200;
201SI05: MOV CX,COM_HCBIDL ;initialize starting help ID
202 MOV COM_HCBID,CX
203;
204 MOV COM_CURPUPF,AX ;make new mouse field the current
205 MOV COM_LASTF,AX ; field
206 MOV DX,AX ;get first field
207;
208SI07: MOV CX,BX ;get last field
209 CALL FAR PTR LOC_MOUSEF ;get actual mouse field number
210 CALL FAR PTR MOUSE_OFF
211 CALL FAR PTR MOUSE_HIGH ;highlight mouse field
212 CALL FAR PTR MOUSE_ON
213;
214; Poll for keyboard or mouse input
215;
216SI10: CMP COM_HLPTEMP,0 ;check if single help ID selection
217 JE SI11 ; active
218;
219 MOV AX,COM_HLPTEMP ;set single help ID for all scroll
220 MOV COM_HCBID,AX ; selections
221;
222SI11: MOV AX,0 ;turn monocasing off
223 CALL FAR PTR PROCESS_KEY ;get keystroke
224
225 MOV BX,COM_KEY ;get keystroke
226;
227; Exit if mouse action
228;
229SI12: CMP COM_MOK,1 ;check if keyboard input
230 JE SI15
231;
232 CMP BX,ES:[DI]+KY_ENTER ;check if Enter pressed
233 JNE SI13
234;
235 CMP COM_SCROPT,1 ;is this the multiple select opt?
236 JE SI13 ;yes, jump out of procedure
237;
238 MOV AX,COM_CURPUPF ;get current highlighted field
239 CALL FAR PTR GET_MOUSEF ;get mouse structure
240;
241 MOV AX,ES:[DI]+MS_KEYS ;keystroke assigned to field
242 MOV COM_KEY,AX
243 MOV COM_MOK,0 ;set for keystroke input
244;
245SI13: JMP SIEXIT ;mouse action exit
246;
247; Process down arrow key
248;
249SI15: CMP BX,ES:[DI]+KY_DARROW ;check if up arrow pressed
250 JNE SI30
251;
252 CMP COM_CURPUPF,CX ;check if below last field
253 JAE SI20
254;
255 INC COM_HCBID ;point to next help equate
256 INC COM_CURPUPF ;no, point to next field
257 JMP SI45 ;now change highlight
258;
259SI20: PUSH COM_HCBIDL ;initialize help to first field
260 POP COM_HCBID
261 MOV COM_CURPUPF,DX ;yes, point to first field
262 JMP SI45 ;now change highlight
263;
264; process up arrow key
265;
266SI30: CMP BX,ES:[DI]+KY_UARROW ;check if up arrow pressed
267 JNE SI50
268;
269 CMP COM_CURPUPF,DX ;check if above first field
270 JBE SI40
271;
272 DEC COM_HCBID ;point to next help equate
273 DEC COM_CURPUPF ;no, point to previous field
274 JMP SI45
275;
276SI40: PUSH COM_HCBIDH ;initialize help to last field
277 POP COM_HCBID
278 MOV COM_CURPUPF,CX ;yes, point to last field
279;
280; Remove last field highlight and display new highlight
281;
282SI45: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off
283;
284 MOV AX,COM_LASTF ;unhighlight last mouse field
285 CALL FAR PTR LOC_MOUSEF ;get actual field number
286 CALL FAR PTR MOUSE_UNHIGH
287;
288 MOV AX,COM_CURPUPF ;highlight current mouse field
289 CALL FAR PTR LOC_MOUSEF ;get actual field number
290 CALL FAR PTR MOUSE_HIGH
291;
292 CALL FAR PTR MOUSE_ON ;turn mouse pointer on
293;
294 MOV AX,COM_CURPUPF ;set last field as current
295 MOV COM_LASTF,AX
296 JMP SI10 ;poll for next keystroke
297;
298; Process Enter key
299;
300SI50: CMP BX,ES:[DI]+KY_ENTER ;check if Enter pressed
301 JNE SI60
302;
303 CMP COM_SCROPT,1 ;is this the multiple select opt?
304 JE SIEXIT ;yes, jump out of procedure
305;
306 MOV AX,COM_CURPUPF ;get current highlighted field
307 CALL FAR PTR GET_MOUSEF ;get mouse structure
308;
309 MOV AX,ES:[DI]+MS_KEYS ;keystroke assigned to field
310 MOV COM_KEY,AX
311 MOV COM_MOK,0 ;set for keystroke input
312 JMP SIEXIT ;exit process_scroll
313;
314; if escape key, exit
315;
316SI60: CMP BX,ES:[DI]+KY_CANCEL ;check if Escape pressed
317 JNE SI70
318;
319 JMP SIEXIT
320;
321; if not multiple select, exit on number
322;
323SI70: CMP COM_SCROPT,1 ;is this the multiple select opt?
324 JE SI90 ;yes, jump to check space bar
325;
326 CMP BX,'1' ;compare to a one
327 JB SI80
328;
329 CMP BX,COM_CNT ;compare to number of entries
330 JBE SIEXIT
331;
332SI80: JMP SI100 ;poll for next keystroke
333;
334; multiple select, exit on spacebar
335;
336SI90: CMP BX,ES:[DI]+KY_SELECT ;was this the space bar?
337 JE SIEXIT ;yes, exit routine
338;
339SI100: CALL FAR PTR PCMBEEP_CALL ;beep on unknown keystroke P*3940
340 JMP SI10 ;poll for next keystroke
341;
342; Unhighlight field before exit
343;
344SIEXIT: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off
345 MOV AX,COM_CURPUPF ;get last field
346;
347 CALL FAR PTR LOC_MOUSEF
348 CALL FAR PTR MOUSE_UNHIGH ;unhighlight field before exit
349 CALL FAR PTR MOUSE_ON ;turn mouse point on
350;
351 MOV COM_FLDT,0 ;no field type
352;
353 POP DS ;restore registers
354 POP SI
355 POP ES
356 POP DI
357 POP DX
358 POP CX
359 POP BX
360 POP AX
361;
362 RET
363PROCESS_SCROLL ENDP
364;
365PAGE
366;-----------------------------------------------------------------------------+
367; :
368; Name: PROCESS_INPUT :
369; :
370; Description: Display input field contents relative to location of :
371; associated panel and optionally process keystroke :
372; before returning. :
373; :
374; Entry: COM_ICBID = Input field ID to process. :
375; COM_HCBID = Help ID assigned to input field. :
376; COM_INOPT 0= Display data entry :
377; 1= Do not display data entry (Password) :
378; :
379; Exit: ES:DI = Address of input field data :
380; CX = Length of data :
381; AX = Return key :
382; :
383; COM_MOK 0= Mouse input :
384; 1= Keyboard input :
385; COM_KEY = Keystroke (keyboard or mouse value) :
386; COM_ROW = Row of mouse pointer (text coordinates) :
387; COM_COL = Column of mouse pointer (text coord) :
388; COM_CURRF = Current mouse field ID :
389; COM_DELTA = Scroll bar delta from current top :
390; element displayed in panel :
391; :
392; :
393; Entry point: PROCESS_INPUT :
394; :
395; Notes: None. :
396; :
397; Internal references: GET_ICB = Get specified input control block. :
398; :
399; PCINPUT_CALL = Call to external CAS routine. :
400; :
401; External references: None. :
402; :
403;-----------------------------------------------------------------------------+
404;
405PROCESS_INPUT PROC FAR
406;
407 PUSH BX
408 PUSH DX
409;
410; initialize
411;
412 MOV COM_FLDT,1 ;input field
413;
414 MOV IN_CURNOR,0607H ;non-mono cursor size
415;
416 CMP GV_VIDMODE,7 ;check if mono mode
417 JNE PH03
418;
419 MOV IN_CURNOR,0C0DH ;mono cursor size
420;
421; remove mouse pointer
422;
423PH03: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off
424;
425; locate specified input control block
426;
427 MOV AX,COM_ICBID ;get PCINPUT field
428 MOV IN_ICBID,AX
429 CALL FAR PTR GET_ICB ;ES:DI points to ICB
430;
431; initialize, display and exit field
432;
433 AND ES:[DI]+ICB_OPT1,NOT ICB_PSW
434 ;deactivate password option
435 CMP COM_INOPT,0 ;check if password option is on
436 JE PH04
437;
438 OR ES:[DI]+ICB_OPT1,ICB_PSW ;activate password option
439;
440PH04: AND ES:[DI]+ICB_STATUS,NOT ICB_DONE
441 AND ES:[DI]+ICB_STATUS,NOT ICB_SINS
442;
443 MOV ES:[DI]+ICB_CURCHAR,1
444;
445PH05: OR ES:[DI]+ICB_OPT4,ICB_INIT
446 AND ES:[DI]+ICB_OPT3,NOT ICB_KEY
447 CALL FAR PTR PCINPUT_CALL ;initialize field
448 AND ES:[DI]+ICB_OPT4,NOT ICB_INIT
449 OR ES:[DI]+ICB_OPT3,ICB_KEY
450 ;remove initialization option
451;
452; Process field
453;
454PH06: XOR AX,AX
455 OR ES:[DI]+ICB_OPT3,ICB_KEY
456 AND ES:[DI]+ICB_OPT4,NOT ICB_INIT
457 TEST ES:[DI]+ICB_OPT2,ICB_UPC ;check if monocasing option active
458 JE PH07
459;
460 MOV AX,0000000000000001B ;set monocasing option on
461;
462PH07: TEST IN_OPT,IN_UTRAN ;check if translation option actv
463 JE PH10
464;
465 MOV AX,0000000000000010B ;set translation option on
466;
467; display mouse pointer
468;
469PH10: CALL FAR PTR MOUSE_ON ;turn mouse pointer on
470;
471; Poll keyboard and mouse
472;
473 CALL FAR PTR PROCESS_KEY
474 MOV AX,COM_KEY ;get keystroke
475;
476 CMP COM_MOK, 0 ;mouse field?
477 JNE PH12 ;no, continue
478 CMP COM_RSTFLD, 0 ;restrict mouse field?
479 JE PH12 ;no, continue
480 CMP AH, 0 ;extended char?
481 JE PH12 ;no, continue
482 CMP AL,0 ;unrestricted extended char?
483 JE PH12 ;yes, continue
484 CMP AL, COM_RSTFLD ;mouse field in current set?
485 JNE PH11 ;no, return new field index
486 XOR AL, AL ;clear ID byte
487comment |
488 cmp ah, rtarrow ;
489 jne ph1005 ;
490 mov es,in_icbseg ;
491 mov di,in_icboff ;
492 inc es:[di]+icb_hrstart ;
493 INC ES:[DI]+ICB_CURCHAR ;
494 AND ES:[DI]+ICB_OPT3,NOT ICB_KEY
495 OR ES:[DI]+ICB_OPT4,ICB_INIT
496 jmp ph12 ;
497ph1005: cmp ah, lfarrow ;
498 jne ph12 ;
499 mov es,in_icbseg ;
500 mov di,in_icboff ;
501 dec es:[di]+icb_hrstart ;
502 DEC ES:[DI]+ICB_CURCHAR ;
503 AND ES:[DI]+ICB_OPT3,NOT ICB_KEY
504 OR ES:[DI]+ICB_OPT4,ICB_INIT
505 |
506 JMP PH12 ;continue
507PH11: XOR AH, AH ;clear keystroke byte
508;
509PH12: MOV COM_KEY, AX ;update keystroke
510 CALL FAR PTR MOUSE_OFF ;
511;
512; Pass keystroke to input field for processing
513;
514PH50: MOV ES,IN_ICBSEG ;point to current ICB
515 MOV DI,IN_ICBOFF
516 MOV ES:[DI]+ICB_KS,AX ;set keystroke to ICB
517;
518 CALL FAR PTR PCINPUT_CALL ;process input field
519;
520 MOV ES,IN_ICBSEG ;point to current ICB
521 MOV DI,IN_ICBOFF
522;
523 MOV AX,ES:[DI]+ICB_KS ;return keystroke
524;
525 TEST ES:[DI]+ICB_STATUS,ICB_DONE
526 jne ph51
527 jmp PH06 ;check for exit condition
528;
529ph51: CALL FAR PTR MOUSE_ON ;turn mouse pointer on
530 CALL FAR PTR CURSOROFF ;turn hardware cursor off
531 MOV COM_FLDT,0 ;no field type
532 MOV COM_INOPT,0 ;no password option
533;
534 MOV DX,ES:[DI]+ICB_OPT4 ;get option word 4
535;
536 PUSH ES:[DI]+ICB_ENDBYTE ;return length of data
537 PUSH ES:[DI]+ICB_FIELDOFF ;return offset of data
538 PUSH ES:[DI]+ICB_FIELDSEG ;return segment of data
539;
540 POP ES
541 POP DI
542 POP CX
543;
544 TEST DX,ICB_TRUN ;field is DOS pathname?
545 JZ PH60 ;no, continue
546;
547 MOV SI,DI ;save string offset
548 ADD DI,CX ;get end of string offset
549 MOV BYTE PTR ES:[DI],0 ;null-terminate pathname
550 MOV DI,SI ;restore string offset
551;
552 CALL TRUNC_NAME ;truncate DOS names & extensions
553 PUSH ES ;MJK005
554 PUSH DI ;MJK005
555 MOV ES,IN_ICBSEG ;point to current ICB ;MJK005
556 MOV DI,IN_ICBOFF ;MJK005
557 MOV ES:[DI]+ICB_ENDBYTE,CX ;return length of data ;MJK005
558 POP DI ;MJK005
559 POP ES ;MJK005
560;
561PH60: POP DX
562 POP BX
563;
564 RET
565PROCESS_INPUT ENDP
566;
567PAGE
568;-----------------------------------------------------------------------------+
569; :
570; Name: PROCESS_KEY :
571; :
572; Description: Poll keyboard then mouse return only if action :
573; occurs. :
574; :
575; Entry: AX 0000000000000001 = Monocasing :
576; 0000000000000010 = Translation table :
577; :
578; COM_HLPOPT = set to 10 to deactivate help :
579; COM_HCBID = Help ID assigned to input field. :
580; :
581; Exit: COM_MOK 0= Mouse input :
582; 1= Keyboard input :
583; COM_KEY = Keystroke (keyboard or mouse value) :
584; COM_ROW = Row of mouse pointer (text coordinates) :
585; COM_COL = Column of mouse pointer (text coord) :
586; COM_CURRF = Current mouse field ID :
587; COM_DELTA = Scroll bar delta from current top :
588; element displayed in panel :
589; :
590; COM_FLDT 0= no field used to determine if :
591; 1= input field cursor should be displayed :
592; 2= scroll field :
593; :
594; Entry point: PROCESS_KEY :
595; :
596; Notes: None. :
597; :
598; Internal references: PCTRACK_CALL = Call to external CAS routine. :
599; PCINPUT_CALL = Call to external CAS routine. :
600; :
601; External references: None. :
602; :
603;-----------------------------------------------------------------------------+
604;
605PROCESS_KEY PROC FAR
606;
607 PUSH AX ;save registers
608 PUSH BX
609 PUSH CX
610 PUSH DX
611;
612 MOV INC_KS,0 ;initialize to no keystroke
613 MOV INC_OPT,0
614;
615 TEST AX,0000000000000001B ;check if monocasing
616 JE PK05
617;
618 OR INC_OPT,INC_AMONO ;initialize to monocasing
619 CMP IN_MONOSEG,0 ;monocasing table gotten? P5197
620 JNE PK02 ;yes, don't get again P5197
621 CALL GET_MONO_DOS ;get DOS monocasing table P5197
622PK02: ; P5197
623 MOV BX,IN_MONOOFF ;get from PCINPUT control block
624 MOV INC_MONOOFF,BX ;set in PCINCHA control block
625 MOV BX,IN_MONOSEG ;get from PCINPUT control block
626 MOV INC_MONOSEG,BX ;set in PCINCHA control block
627;
628PK05: TEST AX,0000000000000010B ;check if translation table
629 JE PK10
630;
631 OR INC_OPT,INC_UTRAN ;initialize for translation table
632;
633; Poll keyboard for input
634;
635PK10: MOV KS_CHAR,0 ;clear out P*4663
636 TEST COM_PROCFLAG,COM_KPLOCK ;keyboard locked? P*4457
637 JZ PK17 ;no, get keystroke P*4457
638 IN AL,64H ;get keyboard lock bit P*4457
639 TEST AL,10H ;is keyboard locked? P*4457
640 JNZ PK15 ;OK, keyboard not locked P*4457
641 JMP PK40 ;check time/date P*4457
642PK15:
643 CALL INIT_MOUSE ;initialize mouse P*4457
644 CALL MOUSE_ON ;turn on mouse P*4457
645PK17: ; P*4457
646
647
648 MOV AH,1 ;keystroke status MJK013
649 TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732
650 JZ PK17_05 ;no, get normal keystroke P*4732
651 MOV AH,11H ;get extended keystroke P*4732
652PK17_05: ; P*4732
653 INT 16H ;is there any keystrokes? MJK013
654 JZ PK17_10 ;don't save keystroke P*4663
655 MOV KS_CHAR,AX ;save the keystroke MJK013
656PK17_10: ; P*4663
657;
658 CALL PCINCHA_CALL ;call CAS routine
659;
660 CMP INC_KS,0 ;check if keystroke returned
661 JE PK20 ;yes, pass to input field
662;
663 CMP INC_KS, 0003H ;ctrl/c or ctrl/break? P*4663
664 JNE PK18 ;no, continue P*4663
665 MOV AX, KS_CHAR ;get status keystroke P*4663
666 CMP AL, 03H ;same ASCII character? P*4663
667 JE PK19 ;yes, must be ctrl/c P*4663
668 MOV INC_KS, 0 ;ignore ctrl/break P*4663
669 JMP PK40 ;continue P*4663
670PK18: ; p*4663
671
672 CMP INC_KS, 6800H ;keystroke is alt-f1?
673
674 JNE PK19 ;no, continue
675 MOV INC_KS, 8500H ;translate to f11
676;
677PK19: CALL CHK_OVERRUN ;check for overrun keystrokes
678;
679 MOV COM_MOK,1 ;set to indicate keyboard
680 XOR AX,AX ;clear to zero
681 MOV COM_ROW,AX ; pointer row
682 MOV COM_COL,AX ; pointer column
683 MOV COM_DELTA,AX ; scroll bar delta
684 MOV AX,INC_KS ;set keystroke from keyboard
685 MOV COM_KEY,AX
686;
687 MOV AX,COM_CURRF ;sav field ID before help process
688 MOV COM_HELPF,AX
689;
690 JMP PK30
691;
692; Poll mouse for action
693;
694PK20: TEST COM_STATE,COM_MOUS ;check if mouse configured
695 JNE PK22 ; do call if no
696 JMP PK40 ; skip call if yes
697;
698PK22: LEA DI,GEN_DATA ;check mouse for button press
699 MOV [DI]+M_FUNC,M_GET
700 CALL FAR PTR PCTRACK_CALL
701;
702 XOR CH,CH ;clear to zero
703 XOR DH,DH ;clear to zero
704 MOV CL,[DI]+M_GETBUT ;get button pressed
705 MOV DL,[DI]+M_GETFIELD ;get field of current pointer
706;
707 CMP CL, 2 ;process keystroke
708 JNE PK24X
709;
710 TEST COM_STATE2,COM_ENHA
711 JZ PK24X
712;
713 MOV COM_BUT2,1
714 MOV CL, 1
715 JMP PK24
716;
717PK24X: MOV COM_BUT2,0
718 CMP CL,1 ;mouse configuration
719 JE PK24 ; 0= no button pressed
720;
721 CMP CL,4 ; 1= button 1 pressed
722 JE PK24 ; 2= button 2 pressed
723 ; 3= button 3 pressed
724 ; 4= double click button 1
725 JMP PK40
726;
727PK24: OR DL,DL ;check if pointer in active field
728 JNZ PK26 ; when button pressed, if not
729 JMP PK40 ; poll again
730;
731PK26: CMP GE_MODEL,MODEL_AT ;check if AT
732 JNE PK29
733;
734 CMP GE_SUBMODEL,SUBMD_AT ;make sure AT
735 JE PK28
736;
737 CMP GE_SUBMODEL,SUBMD_AS ;make sure AT/skyrocket
738 JNE PK29
739;
740PK28: CALL KEYLOCK ;check if keyboard on AT is
741 JNZ PK29
742;
743 JMP PK40 ; locked, poll again
744;
745PK29: MOV COM_MOK,0 ;set to indicate mouse
746 MOV AX,COM_CURRF ;sav field ID before help process
747 MOV COM_HELPF,AX
748 MOV COM_CURRF,DX ;set current field number
749 MOV AX,[DI]+M_GETROW ;get mouse pointer row where
750 MOV COM_ROW,AX ; button was pressed
751 MOV AX,[DI]+M_GETCOL ;get mouse pointer column where
752 MOV COM_COL,AX ; button was pressed
753 MOV AX,[DI]+M_GETFKEY ;get keystroke assigned to field
754 MOV COM_KEY,AX
755;
756 MOV AX,[DI]+M_GETDELTA ;scroll delta (if in sb field)
757 MOV COM_DELTA,AX
758 XOR CX,CX
759 MOV AX,[DI]+M_GETSPOS ;text row/col position in bar
760 MOV COM_POSITION,AX
761;
762; Check for help option before exit
763;
764PK30: CMP COM_HLPOPT,10 ;check if help deactivated
765 JE PKEXIT ;exit
766;
767 MOV AX,STR_TOTAL ;get keystroke structure
768 CALL FAR PTR GET_STRING ;structure at ES:DI
769;
770 MOV AX,COM_KEY ;get keystroke
771 CMP AX,ES:[DI]+KY_CHELP
772 JNE PKEXIT
773;
774 CALL FAR PTR CURSOROFF ;turn hardware cursor off
775 PUSH COM_HELPF ;save field ID before help process
776 CALL MANAGE_HELP ;process all types of help
777 POP COM_CURRF ;reset original field ID before hl
778;
779 CMP COM_FLDT,1 ;redisplay cursor if input field
780 JNE PK40
781;
782 CALL FAR PTR CURSORON ;turn hardware cursor on
783;
784; Check if date and time should be updated.
785;
786PK40: CALL DISP_DATETIME ;update date/time
787 JMP PK10
788;
789; Exit
790;
791PKEXIT: PUSH ES
792 PUSH DI
793 MOV AX, 40H
794 MOV ES, AX
795 MOV BX, 17H
796 MOV AL, ES:[BX]
797 XOR AH, AH
798 MOV COM_SHIFT, AX
799 POP DI
800 POP ES
801;
802 POP DX ;exit
803 POP CX
804 POP BX
805 POP AX
806;
807 RET
808PROCESS_KEY ENDP
809;
810PAGE
811;-----------------------------------------------------------------------------+
812; P5197 :
813; GET_MONO_DOS :
814; Get segment and offset of the DOS monocasing table and return it :
815; :
816; Entry: None :
817; :
818; Exit: None :
819; P5197 :
820;-----------------------------------------------------------------------------+
821GET_MONO_DOS PROC NEAR
822;
823 PUSH ES ; P5197
824 PUSH DI ; P5197
825 PUSH AX ; P5197
826;
827 MOV AH,65H ;extended country info P5197
828 MOV AL,04H ;get uppercase table ptrs P5197
829 MOV BX,-1 ;default code page P5197
830 MOV DX,-1 ;default country id P5197
831 MOV CX,05H ;# bytes returned P5197
832 PUSH DS
833 POP ES ;ES:DI ptrs to return buf P5197
834 MOV DI,OFFSET TEMP_WKA ;use as temp buffer P5197
835 INT 21H
836 JC GET_MONO_RET
837;
838 INC DI ;skip info id P5197
839;
840 MOV AX,WORD PTR [DI] ;get DOS mono table offset P5197
841 MOV IN_MONOOFF,AX ;save it P5197
842 ADD DI,2
843 MOV AX,WORD PTR [DI] ;get DOS mono table seg P5197
844 MOV IN_MONOSEG,AX ;save it P5197
845;
846GET_MONO_RET:
847 POP AX ; P5197
848 POP DI ;restore registers P5197
849 POP ES ; P5197
850;
851 RET ; P5197
852GET_MONO_DOS ENDP
853;
854PAGE
855;-----------------------------------------------------------------------------+
856; :
857; Name: CHK_OVERRUN :
858; :
859; Description: Check for multiple entries of cursor keys to :
860; eliminate overrun in typeamatic mode. :
861; :
862; Entry: INC_KS = Key stroke :
863; :
864; Exit: INC_KS = Returned keystroke :
865; :
866; Entry point: CHK_OVERRUN :
867; :
868; Notes: Duplicate cursor keystrokes are removed. :
869; :
870; Internal references: PCINCHA_CALL = Call to external CAS routine. :
871; :
872; External references: None. :
873; :
874;-----------------------------------------------------------------------------+
875;
876CHK_OVERRUN PROC NEAR
877;
878 PUSH CX
879 PUSH DI
880 PUSH ES
881;
882 MOV CX,KS_TABLE_LEN ;len of cursor keystroke table
883 ROR CX,1 ;set number of entries
884 MOV AX,DS ;get segment of table
885 MOV ES,AX ;set segment of table
886 MOV DI,OFFSET KS_TABLE ;offset of table
887 MOV AX,INC_KS ;current keystroke
888 CLD
889 REPNZ SCASW ;scan table for keystroke match
890 JNZ CHK_OVRET ;no match found
891;
892CHK_OV10: MOV AH,1 ;keystroke status
893 TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732
894 JZ CHK_OV20 ;no, get normal keystroke P*4732
895 MOV AH,11H ;get extended keystroke P*4732
896CHK_OV20: ; P*4732
897 INT 16H ;check for next keystroke
898 JZ CHK_OVRET ;no, keystroke available
899;
900 CMP AX,KS_CHAR ;is it the same as before MJK013
901 JNE CHK_OVRET ;no, return
902;
903 MOV AH,0 ;keystroke read
904 TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732
905 JZ CHK_OV30 ;no, get normal keystroke P*4732
906 MOV AH,10H ;get extended keystroke P*4732
907CHK_OV30: ; P*4732
908 INT 16H ;remove it
909 JMP CHK_OV10 ;check next keystroke
910;
911CHK_OVRET: POP ES
912 POP DI
913 POP CX
914;
915 RET
916CHK_OVERRUN ENDP
917;
918PAGE
919;-----------------------------------------------------------------------------+
920; :
921; Name: DISP_DATETIME :
922; :
923; Description: display the date and time on the display. :
924; :
925; Entry: COM_STATE2: :
926; COM_DATE = O - no date displayed :
927; 1 - display date and time :
928; :
929; Exit: Display updated :
930; :
931; Entry point: DISP_DATETIME :
932; :
933; Notes: None. :
934; :
935; Internal references: UPDATE_DISPLAY :
936; MOUSE_OFF :
937; MOUSE_ON :
938; :
939; External references: PCDATES_CALL = Call to external CAS routine. :
940; PCTIMES_CALL = Call to external CAS routine. :
941; :
942;-----------------------------------------------------------------------------+
943;
944DISP_DATETIME PROC NEAR
945;
946 PUSH AX ;save registers
947 PUSH BX
948 PUSH CX
949 PUSH DX
950 PUSH SI
951 PUSH DI
952 PUSH ES
953;
954 TEST COM_STATE2,COM_DATE ;is the date option active?
955 JNZ DT_02 ;yes, continue
956 JMP DT_RET ;return
957;
958; Set up to get the date and time.
959;
960DT_02: MOV DI,OFFSET TIME_WKA ;time workarea
961 MOV BX,DS:[DI+4] ;save currect seconds
962;
963 CALL PCDATES_CALL ;get date
964;
965 CALL PCTIMES_CALL ;get time
966;
967 TEST COM_PROCFLAG,COM_NODATE ;should date not be displayed?
968 JNZ DT_RET ;yes, return
969;
970 TEST COM_PROCFLAG,COM_PSCEXEC ;has PSC ended execution?
971 JZ DT_05 ;no, continue
972;
973 AND COM_PROCFLAG,NOT COM_PSCEXEC ;reset PSC ended execution
974 JMP DT_20 ;display time/date
975
976DT_05: MOV AX,COM_BASESCR ;get base screen
977 CMP AX,COM_BASE_WKA ;has it changed?
978 JE DT_10 ;no, see if time has changed
979;
980 MOV COM_BASE_WKA,AX ;save new base screen
981 JMP DT_20 ;continue
982;
983DT_10: CMP BX,DS:[DI+4] ;has the time minutes changed?
984 JE DT_RET ;no, don't update it
985;
986DT_20: MOV SI,PAN_ATITLE ;get panel id for moveg
987 MOV AX,1 ;row to display
988 MOV BX,3 ;column to display
989 MOV CX,LENGTH DATE_WKA ;len of date
990 MOV DX,OFFSET DATE_WKA
991 PUSH DS
992 POP ES
993;
994 CALL FAR PTR MOUSE_OFF ;turn mouse off
995;
996 PUSH AX ;
997 MOV AX, PAN_ATITLE ;set panel id
998 CALL FAR PTR GET_ATTR ;get color attr
999 AND AH, 0F0H ;mask off foreground
1000 CMP AH, 0F0H ;background is white?
1001 POP AX ;
1002 JNE DT_28 ;no, continue
1003 MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816
1004DT_28:
1005
1006; CMP GV_VIDMODE,11H ;mode 11? P*4816
1007; JNE DT_30 ;no, don't underline P*4816
1008; MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816
1009
1010
1011DT_30: ; P*4816
1012 CALL UPDATE_DISPLAY ;display date
1013;
1014 MOV BX,69 ;column to display
1015 MOV CX,LENGTH TIME_WKA ;len of time
1016 MOV DX,OFFSET TIME_WKA
1017;
1018 PUSH AX ;
1019 MOV AX, PAN_ATITLE ;set panel id
1020 CALL FAR PTR GET_ATTR ;get color attr
1021 AND AH, 0F0H ;mask off foreground
1022 CMP AH, 0F0H ;background is white?
1023 POP AX ;
1024 JNE DT_38 ;no, continue
1025 MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816
1026DT_38:
1027
1028
1029; CMP GV_VIDMODE,11H ;mode 11? P*4816
1030; JNE DT_40 ;no, don't underline P*4816
1031; MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816
1032DT_40: ; P*4816
1033 CALL UPDATE_DISPLAY ;display time
1034;
1035 CALL FAR PTR MOUSE_ON ;turn mouse on
1036;
1037DT_RET: POP ES ;restore registers
1038 POP DI
1039 POP SI
1040 POP DX
1041 POP CX
1042 POP BX
1043 POP AX
1044;
1045 RET
1046DISP_DATETIME ENDP
1047;
1048PAGE
1049;-----------------------------------------------------------------------------+
1050; :
1051; Name: KEYLOCK :
1052; :
1053; Description: Determine if AT keyboard lock is on. :
1054; :
1055; Entry: None. :
1056; :
1057; Exit: ZF = 1 : keyboard is locked :
1058; ZF = 0 : keyboard is unlocked :
1059; :
1060; Entry point: KEYLOCK :
1061; :
1062; Notes: None. :
1063; :
1064; Internal references: None. :
1065; :
1066; External references: None. :
1067; :
1068;-----------------------------------------------------------------------------+
1069;
1070KEYLOCK PROC NEAR
1071;
1072 PUSH BX
1073 PUSH CX
1074;
1075 CLI ;disable ints while checking kybd
1076 MOV AL,READ_KBD_INPT ;get kybd read input command
1077 OUT STATUS_PORT,AL ;issue the command
1078 SUB CX,CX ;cls controller count cmd issue
1079;
1080KEYLOCK10: IN AL,STATUS_PORT
1081 TEST AL,INPT_BUF_FULL
1082 LOOPNZ KEYLOCK10 ;wait for command to be accepted
1083 JNZ KEYLOCK50 ;exit if command not accepted
1084;
1085 SUB CX,CX
1086 MOV BL,6
1087;
1088KEYLOCK20: IN AL,STATUS_PORT
1089 TEST AL,OUTPT_BUF_FULL
1090 JNZ KEYLOCK30 ;branch if OBF
1091;
1092 LOOP KEYLOCK20 ;loop until response or timeout
1093 DEC BL ;timeout loop attempted six times
1094 JNZ KEYLOCK20
1095;
1096 INC BL ;set ZF = 0 if no response
1097 JMP KEYLOCK50
1098;
1099KEYLOCK30: IN AL,INPUT_PORT ;read keyboard input port
1100 TEST AL,KYBD_INH ;test to see if kybd lock is on
1101;
1102KEYLOCK50:
1103;
1104KEYLOCK60: STI ;enable ints
1105 POP CX ;restore regs
1106 POP BX
1107;
1108 RET ;Exit
1109KEYLOCK ENDP
1110;
1111PAGE
1112;-----------------------------------------------------------------------------+
1113; :
1114; Name: COMMAND_LINE :
1115; :
1116; Description: Command line dialog. :
1117; :
1118; Entry: COM_OLDCBKOFF = offset of original crtl+break :
1119; COM_OLDCBKSEG = segment of original crtl+break :
1120; COM_CMDBUF = required to invoke COMMAND.COM :
1121; COM_CMDINPBUF = command line input buffer :
1122; COM_CMDINPLEN = length of command line input buf :
1123; COM_CMDBUFLEN = length including '/C' :
1124; COM_CMDDRIVE = current drive and path to display :
1125; COM_CMDPATH for command line input prompt :
1126; KY_COMDLINE = command line Shift + F9 :
1127; KY_LASTCOMD = last command up arrow :
1128; KY_NEXTCOMD = next command dn arrow :
1129; Exit: :
1130; :
1131; Entry point: COMMAND_LINE :
1132; :
1133; Notes: Changed procedure to use a COMMAND.COM PSC execution. :
1134; :
1135; Internal references: PCTRACK_CALL :
1136; :
1137; External references: INT 21H AH=40H Write string to standard output. :
1138; INT 21H AH=25H Set interrupt vector address. :
1139; INT 21H AH=35H Get interrupt vector address. :
1140; INT 21H AH=49H Deallocate memory. :
1141; INT 21H AH=47H Read current directory. :
1142; INT 21H AH=19H Read current disk. :
1143; INT 21H AH=06H Write char to standard output. :
1144; INT 21H AH=4BH EXEC command line. :
1145; :
1146;-----------------------------------------------------------------------------+
1147;
1148COMMAND_LINE PROC FAR
1149
1150 TEST COM_STATE,COM_FLCL ;check if command line active
1151 JNE MC10
1152;
1153 CALL FAR PTR OPT_INACTIVE ;display error panel for inactive *PCR
1154 JMP MCEXIT ;exit
1155;
1156; save registers
1157;
1158MC10: CALL FAR PTR REMOVE_OLDPD ;remove last pull down panel
1159 MOV COM_CURPD,0
1160;
1161 PUSH AX
1162 PUSH BX
1163 PUSH CX
1164 PUSH DX
1165 PUSH BP
1166 PUSH SI
1167 PUSH DI
1168;
1169; disable mouse tracker
1170;
1171 CALL FAR PTR MOUSE_OFF ;turn mouse pointer off
1172 CALL FAR PTR DEL_MOUSEF ;delete all mouse fields
1173 CALL FAR PTR MOUSE_DIS ;disable mouse support
1174;
1175; Set current directory path
1176;
1177 CMP COM_CDIALOG,COM_APPMENU ;check if program menu dialog
1178 JNE MC20 ; don't ask for dir from DOS Serv
1179;
1180 JMP MC30
1181;
1182MC20: CMP COM_CDIALOG,COM_PAAB ;check if program menu dialog
1183 JE MC30 ; don't ask for dir from DOS Serv
1184;
1185 CMP COM_CDIALOG,COM_DCLR ;check if program menu dialog
1186 JE MC30 ; don't ask for dir from DOS Serv
1187;
1188 XOR AX,AX ;get current selected directory
1189 MOV AX,1 ;get current selected dir ;P*4245
1190 CALL RETURN_PATH ; in DOS services
1191;
1192 MOV BX,OFFSET FULLSPEC ;file name
1193 MOV DL,DS:BYTE PTR[BX] ;drive id
1194 CALL SET_DRIVE ;set to the drive
1195;
1196 PUSH DI
1197 MOV AH,0EH ;change to selected drive
1198 MOV DX,DATA
1199 MOV DS,DX
1200 LEA DI,FULLSPEC
1201 MOV DL,[DI]
1202 SUB DL,'A'
1203 INT 21H
1204 POP DI
1205;
1206 MOV AH,3BH ;change to selected directory
1207 MOV DX,DATA
1208 MOV DS,DX
1209 LEA DX,FULLSPEC
1210 INT 21H
1211;
1212; Move in COMSPEC to PSC workarea for new COMMAND.COM PSC execution.
1213;
1214MC30: MOV SI,OFFSET COM_PFILSPEC ;COMSPEC location
1215;
1216 mov dl, byte ptr [si] ;get drive letter of comspec
1217 call set_drive ;set logical drive
1218;
1219 MOV DI,OFFSET PEC_COM ;PSC workarea location
1220 MOV PEC_BYTE,0 ;clear length
1221;
1222MC40: MOV AL,DS:BYTE PTR [SI] ;get character
1223 CMP AL,0 ;end of string?
1224 JE MC50 ;yes, add parm sep char
1225;
1226 MOV DS:BYTE PTR [DI],AL ;put character in PSC workarea
1227 INC PEC_BYTE ;adjust length
1228 INC SI ;point to next COMSPEC char
1229 INC DI ;point to next PSC position
1230 JMP MC40 ;get next character
1231;
1232MC50: MOV DS:BYTE PTR [DI],PEC_SEP ;set parameter seperator char
1233 INC PEC_BYTE ;adjust length
1234 PUSH DS
1235 POP ES ;set segment of PSC workarea
1236 MOV DI,OFFSET PEC_TITLE ;set offset of PSC workarea
1237
1238 OR COM_PROCFLAG,COM_CMDPSC ;set COMMAND.COM PSC exec P*3748
1239 CALL FAR PTR PROCESS_PSC ;set up to process PSC
1240;
1241 POP DI ;restore registers
1242 POP SI
1243 POP BP
1244 POP DX
1245 POP CX
1246 POP BX
1247 POP AX
1248;
1249MCEXIT:
1250;
1251 RET
1252COMMAND_LINE ENDP
1253;
1254PAGE
1255;-----------------------------------------------------------------------------+
1256; :
1257; SET_DRIVE :
1258; :
1259; On a single drive system, set the logical to the physical drive. :
1260; :
1261; Entry: DL - Drive letter :
1262; :
1263; Exit: Logical drive set :
1264; :
1265; Notes: None :
1266; :
1267;-----------------------------------------------------------------------------+
1268;
1269SET_DRIVE PROC NEAR
1270
1271 PUSH BX ; P*4831
1272 PUSH DX ; P*4831
1273 PUSH AX ; P*4831
1274
1275 AND DL,0DFH ; convert it to P*4831
1276 SUB DL,40H ; an binary number. P*4831
1277 MOV BL,DL
1278 MOV AX,440FH ; I/O control P*4831
1279 INT 21H ; set logical drive letter P*4831
1280
1281 POP AX ; P*4831
1282 POP DX ; P*4831
1283 POP BX ; P*4831
1284 RET ; return to caller P*4831
1285
1286SET_DRIVE ENDP
1287;
1288PAGE
1289;-----------------------------------------------------------------------------+
1290; :
1291; Name: PCCLRRD_CALL :
1292; :
1293; Description: Call to PCCLRRD. :
1294; :
1295; Entry: PCCLRRD parameter block initialized. :
1296; :
1297; Exit: PCCLRRD parameter block initialized. :
1298; :
1299; Entry point: PCCLRRD_CALL :
1300; :
1301; Notes: None. :
1302; :
1303; Internal references: None. :
1304; :
1305; External references: None. :
1306; :
1307;-----------------------------------------------------------------------------+
1308;
1309PCCLRRD_CALL PROC NEAR ;*PCR (ENTIRE PROC)
1310;
1311 PUSH DS ;Set segment
1312 POP ES
1313;
1314 PUSH DS
1315 PUSH DI ;Save registers
1316;
1317 LEA DI,CRD_OPT1 ;Set DI to proper parameter block
1318 ; for call
1319IF CASRM
1320 MOV AH,00H ;Make call to CAS-RM
1321 MOV BX,CRD_RN ;Set cas routine number
1322 INT CASINT ;Call routine
1323ELSE
1324 CALL CLRRD
1325ENDIF
1326;
1327; copy the color index vector into buffer below clrrd buffer
1328;
1329 MOV AX,16 ;calc length of color read and
1330 MOV BX,MAX_COLRBUF ; write buffers
1331 MUL BX ;# paragraphs * 16 = # bytes
1332 SUB AX,500 ;leave room for safe buffer
1333 ADD AX,CRD_BUFOFF ;add current crd buf offset
1334 MOV DI,AX
1335 MOV SI,CRD_CCBVECOFF ;get source address
1336 MOV CRD_CCBVECOFF,DI ;set destination offset
1337;
1338 CMP CRD_ERROR,0 ;was there an error
1339 JNE CR_EXIT ;yes, don't overwrite
1340 CMP CRD_DOSERROR,0 ;was there an error
1341 JNE CR_EXIT ;yes, don't overwrite
1342;
1343 MOV ES,CRD_BUFSEG ;set destination segment
1344 MOV CX,CRD_CCBVECLEN ;get the length to move
1345 PUSH DS
1346 MOV AX,CRD_CCBVECSEG ;set source segment
1347 MOV DS,AX
1348;
1349 REP MOVSB ;move the data
1350 POP DS
1351;
1352CR_EXIT: POP DI ;Restore registers
1353 POP DS
1354;
1355 RET
1356PCCLRRD_CALL ENDP
1357;
1358PAGE
1359;-----------------------------------------------------------------------------+
1360; :
1361; Name: SET_DEFAULT :
1362; :
1363; Description: Set default value in specified ICB control block. :
1364; :
1365; Entry: ES:DI = Address of default value. :
1366; CX = Length of string. :
1367; AX = ICB number of input field. :
1368; :
1369; Exit: None. :
1370; :
1371; Entry point: None. :
1372; :
1373; Notes: None. :
1374; :
1375; Internal references: None. :
1376; :
1377; External references: None. :
1378; :
1379;-----------------------------------------------------------------------------+
1380;
1381SET_DEFAULT PROC FAR
1382;
1383 PUSH ES ;save default segment
1384 PUSH DI ;save default offset
1385;
1386 CALL FAR PTR GET_ICB ;get input control block
1387;
1388 MOV ES:[DI]+ICB_CURCHAR,1 ;reset starting cursor position
1389 MOV ES:[DI]+ICB_DEFLEN,CX ;set length
1390 POP ES:[DI]+ICB_DEFOFF ;offset
1391 POP ES:[DI]+ICB_DEFSEG ;segment
1392;
1393 RET
1394SET_DEFAULT ENDP
1395;
1396PAGE
1397;-----------------------------------------------------------------------------+
1398; :
1399; Name: GET_PCB :
1400; :
1401; Description: Return address of specified panel control block. :
1402; :
1403; Entry: AX = Number of PCB vector desired. :
1404; :
1405; COM_PCBVECSEG = PCB vector segment. :
1406; COM_PCBVECOFF = PCB vector offset. :
1407; COM_PCBVECLEN = number of bytes in each vector :
1408; :
1409; Exit: ES:DI = Address of specified PCB :
1410; :
1411; Entry point: :
1412; :
1413; Notes: None. :
1414; :
1415; Internal references: None. :
1416; :
1417; External references: None. :
1418; :
1419;-----------------------------------------------------------------------------+
1420;
1421GET_PCB PROC FAR
1422;
1423 PUSH AX
1424 PUSH BX
1425 PUSH CX
1426 PUSH DX
1427;
1428; read panel control block vector to obtain PCB address
1429;
1430 MOV BX,COM_PCBVECSEG ;get beginning PCB vector address
1431 MOV ES,BX
1432 MOV DI,COM_PCBVECOFF
1433;
1434 DEC AX ;make zero based
1435 MOV BX,COM_PCBVECLEN ;multiply PCB element length by
1436 ; desired vector number in BX
1437 MUL BX ; to determine offset into PCB vec
1438 ADD DI,AX ;add offset inside table
1439 MOV BX,ES:[DI] ;get actual PCB segment
1440 MOV CX,ES:[DI]+2 ;point past PCB seg to get PCB off
1441;
1442 MOV ES,BX ;set ES:DI to panel's actual
1443 MOV DI,CX ; PCB address
1444;
1445 POP DX
1446 POP CX
1447 POP BX
1448 POP AX
1449;
1450 RET
1451GET_PCB ENDP
1452;
1453PAGE
1454;-----------------------------------------------------------------------------+
1455; :
1456; Name: GET_SCB :
1457; :
1458; Description: Return address of specified scroll control block. :
1459; :
1460; Entry: AX = Number of SCB vector desired. :
1461; :
1462; COM_SCBVECSEG = SCB vector segment. :
1463; COM_SCBVECOFF = SCB vector offset. :
1464; COM_SCBVECLEN = number bytes in each vector :
1465; :
1466; Exit: ES:DI = Address of specified SCB :
1467; :
1468; Entry point: :
1469; :
1470; Notes: None. :
1471; :
1472; Internal references: None. :
1473; :
1474; External references: None. :
1475; :
1476;-----------------------------------------------------------------------------+
1477;
1478GET_SCB PROC NEAR
1479;
1480 PUSH AX
1481 PUSH BX
1482 PUSH CX
1483 PUSH DX
1484;
1485; read panel control block vector to obtain SCB address
1486;
1487 MOV BX,COM_SCBVECSEG ;get beginning SCB vector address
1488 MOV ES,BX
1489 MOV DI,COM_SCBVECOFF
1490;
1491 DEC AX ;make zero based
1492 MOV BX,COM_SCBVECLEN ;multiply SCB element length by
1493 ; desired vector number in BX
1494 MUL BX ; to determine offset into SCB vec
1495 ADD DI,AX ;add offset inside table
1496 MOV BX,ES:[DI] ;get actual SCB segment
1497 MOV CX,ES:[DI]+2 ;point past SCB seg to get SCB off
1498;
1499 MOV ES,BX ;set ES:DI to panel's actual
1500 MOV DI,CX ; PCB address
1501;
1502 POP DX
1503 POP CX
1504 POP BX
1505 POP AX
1506;
1507 RET
1508GET_SCB ENDP
1509;
1510PAGE
1511;-----------------------------------------------------------------------------+
1512; :
1513; Name: GET_ICB :
1514; :
1515; Description: Return address of specified input control block. :
1516; :
1517; Entry: AX = Number of ICB vector desired. :
1518; :
1519; COM_ICBVECSEG = ICB vector segment. :
1520; COM_ICBVECOFF = ICB vector offset. :
1521; COM_ICBVECLEN = vector length. :
1522; :
1523; Exit: ES:DI = Address of specified ICB :
1524; :
1525; Entry point: :
1526; :
1527; Notes: None. :
1528; :
1529; Internal references: None. :
1530; :
1531; External references: None. :
1532; :
1533;-----------------------------------------------------------------------------+
1534;
1535GET_ICB PROC FAR
1536;
1537 PUSH AX
1538 PUSH BX
1539 PUSH CX
1540 PUSH DX
1541;
1542; read input control block vector to obtain PCB address
1543;
1544 MOV BX,COM_ICBVECSEG ;get beginning ICB vector address
1545 MOV ES,BX
1546 MOV DI,COM_ICBVECOFF
1547;
1548 DEC AX ;make zero based
1549 MOV BX,COM_ICBVECLEN ;multiply ICB element length by
1550 ; desired vector number in BX
1551 MUL BX ; to determine offset into ICB vec
1552 ADD DI,AX ;add offset inside table
1553 MOV BX,ES:[DI] ;get actual ICB segment
1554 MOV CX,ES:[DI]+2 ;point past ICB seg to get ICB off
1555;
1556 MOV ES,BX ;set ES:DI to input's actual
1557 MOV DI,CX ; ICB address
1558;
1559 TEST COM_STATE,COM_TEXT ;check if in text mode
1560 JE GIEXIT
1561;
1562 AND ES:[DI]+ICB_OPT1,NOT ICB_BOX
1563 ;if in text mode deactivate box
1564 ; option
1565;
1566GIEXIT: POP DX
1567 POP CX
1568 POP BX
1569 POP AX
1570;
1571 RET
1572GET_ICB ENDP
1573;
1574PAGE
1575;-----------------------------------------------------------------------------+
1576; :
1577; Name: GET_ERROR :
1578; :
1579; Description: Return address of error message. :
1580; :
1581; Entry: AX = Number of vector desired. :
1582; :
1583; COM_ERRVECSEG = Error message vector segment. :
1584; COM_ERRVECOFF = Error message vector offset. :
1585; COM_ERRVECLEN = Length of each vector in bytes. :
1586; :
1587; Exit: ES:DI = Address of specified error message. :
1588; AX = length of error message. :
1589; :
1590; Entry point: GET_ERROR :
1591; :
1592; Notes: None. :
1593; :
1594; Internal references: None. :
1595; :
1596; External references: None. :
1597; :
1598;-----------------------------------------------------------------------------+
1599;
1600GET_ERROR PROC FAR
1601;
1602 PUSH BX
1603 PUSH CX
1604 PUSH DX
1605;
1606; read error message vector
1607;
1608 MOV BX,COM_ERRVECSEG ;get beginning vector address
1609 MOV ES,BX
1610 MOV DI,COM_ERRVECOFF
1611;
1612 DEC AX ;make zero based
1613 MOV BX,COM_ERRVECLEN ;multiply element length by
1614 ; desired vector number in BX
1615 MUL BX ; to determine offset into vector
1616 ADD DI,AX ;add offset inside table
1617 MOV CX,ES:[DI] ;get error text offset
1618 XOR AX,AX ;clear to zero
1619 MOV AL,ES:[DI]+2 ;get error text length
1620;
1621 MOV DI,CX ;set ES:DI to panel's actual
1622 ; PCB address
1623;
1624 POP DX
1625 POP CX
1626 POP BX
1627;
1628 RET
1629GET_ERROR ENDP
1630;
1631PAGE
1632;-----------------------------------------------------------------------------+
1633; :
1634; Name: GET_BUTTON :
1635; :
1636; Description: Return address of graphics button. :
1637; :
1638; Entry: AX = Number of vector desired. :
1639; :
1640; COM_BCBVECSEG = vector segment. :
1641; COM_BCBVECOFF = vector offset. :
1642; COM_BCBVECLEN = Length of each vector in bytes. :
1643; :
1644; Exit: ES:DI = Address of specified string. :
1645; :
1646; Entry point: GET_BUTTON :
1647; :
1648; Notes: None. :
1649; :
1650; Internal references: None. :
1651; :
1652; External references: None. :
1653; :
1654;-----------------------------------------------------------------------------+
1655;
1656GET_BUTTON PROC NEAR
1657;
1658 PUSH BX
1659 PUSH CX
1660 PUSH DX
1661;
1662; read keystroke vector
1663;
1664 MOV BX,COM_BCBVECSEG ;get beginning vector address
1665 MOV ES,BX
1666 MOV DI,COM_BCBVECOFF
1667;
1668 DEC AX ;make zero based
1669 MOV BX,COM_BCBVECLEN ;multiply element length by
1670 ; desired vector number in BX
1671 MUL BX ; to determine offset into vector
1672 ADD DI,AX ;add offset inside table
1673 MOV CX,ES:[DI] ;get text offset
1674 MOV DI,CX ;set ES:DI to actual data
1675;
1676 POP DX
1677 POP CX
1678 POP BX
1679;
1680 RET
1681GET_BUTTON ENDP
1682;
1683PAGE
1684;-----------------------------------------------------------------------------+
1685; :
1686; Name: GET_STRING :
1687; :
1688; Description: Return address of string. :
1689; :
1690; Entry: AX = Number of ICB vector desired. :
1691; :
1692; COM_STRVECSEG = String vector segment. :
1693; COM_STRVECOFF = String vector offset. :
1694; COM_STRVECLEN = Length of each vector in bytes. :
1695; :
1696; Exit: ES:DI = Address of specified string. :
1697; AX = length of string. :
1698; :
1699; Entry point: GET_STRING :
1700; :
1701; Notes: None. :
1702; :
1703; Internal references: None. :
1704; :
1705; External references: None. :
1706; :
1707;-----------------------------------------------------------------------------+
1708;
1709GET_STRING PROC FAR
1710;
1711 PUSH DX
1712 PUSH BX
1713 PUSH CX
1714;
1715; read error message vector
1716;
1717 MOV BX,COM_STRVECSEG ;get beginning vector address
1718 MOV ES,BX
1719 MOV DI,COM_STRVECOFF
1720;
1721 DEC AX ;make zero based
1722 MOV BX,COM_STRVECLEN ;multiply element length by
1723 ; desired vector number in BX
1724 MUL BX ; to determine offset into vector
1725 ADD DI,AX ;add offset inside table
1726 MOV CX,ES:[DI] ;get text offset
1727 XOR AX,AX ;clear to zero
1728 MOV AL,ES:[DI]+2 ;get text length
1729;
1730 MOV DI,CX ;set ES:DI to actual data
1731;
1732 POP CX
1733 POP BX
1734 POP DX
1735;
1736 RET
1737GET_STRING ENDP
1738;
1739PAGE
1740;-----------------------------------------------------------------------------+
1741; :
1742; Name: GET_ATTR :
1743; :
1744; Description: Returns the normal and highlight color attributes :
1745; of a specified panel. :
1746; :
1747; :
1748; Entry: AX = Panel ID number. :
1749; :
1750; Exit: AH = Panel's normal color attr :
1751; AL = Panel's highlight color attr :
1752; :
1753; Entry point: GET_ATTR :
1754; :
1755; Notes: None. :
1756; :
1757; Internal references: None. :
1758; :
1759; External references: None. :
1760; :
1761;-----------------------------------------------------------------------------+
1762;
1763GET_ATTR PROC FAR
1764;
1765 PUSH ES ;save registers
1766 PUSH DI
1767;
1768 CALL FAR PTR GET_PCB ;load the panel's PCB in ES:DI
1769 MOV AX,ES:[DI]+PCB_CCBID ;get panel's color index number
1770;
1771 CALL FAR PTR GET_COLOR ;load the color index
1772 MOV AH,ES:[DI]+CCB_A1 ;get the normal color attr
1773 MOV AL,ES:[DI]+CCB_A2 ;get the highlighted color attr
1774;
1775 POP DI ;restore registers
1776 POP ES
1777;
1778 RET
1779GET_ATTR ENDP
1780;
1781PAGE
1782;-----------------------------------------------------------------------------+
1783; :
1784; Name: GET_COLOR :
1785; :
1786; Description: Returns ES:DI pointing to color index specified in :
1787; AX. Use the CCB_PB to reference the desired color :
1788; attributes. :
1789; :
1790; Entry: AX = Color index to return. :
1791; CRD_CCBVECOFF = Offset of color index. :
1792; CRD_CCBVECSEG = Segment of color index. :
1793; :
1794; Exit: ES:DI = Address of color index :
1795; :
1796; Entry point: GET_COLOR :
1797; :
1798; Notes: None. :
1799; :
1800; Internal references: None. :
1801; :
1802; External references: None. :
1803; :
1804;-----------------------------------------------------------------------------+
1805;
1806GET_COLOR PROC FAR
1807;
1808 PUSH AX ;save registers
1809 PUSH BX
1810 PUSH DX
1811;
1812 DEC AX ; default index and make zero
1813 ; based
1814 PUSH CRD_CCBVECSEG ;get color index segment
1815 POP ES
1816;
1817 PUSH CRD_CCBVECOFF ;get color index offset
1818 POP DI
1819;
1820 MOV BX,COM_CCBLEN ;multiply CCB element length by
1821 MUL BX ; desired vector add offset
1822 ADD DI,AX ; to color index offset
1823;
1824 POP DX ;restore registers
1825 POP BX
1826 POP AX
1827;
1828 RET
1829GET_COLOR ENDP
1830;
1831PAGE
1832;-----------------------------------------------------------------------------+
1833; :
1834; Name: SET_SHLVMDOS :
1835; :
1836; Description: Set shell video mode from current DOS video mode. :
1837; :
1838; Entry: COM_STATE = Option word indicating invocation :
1839; parameters passed through PSP. :
1840; :
1841; Exit: PCGVIDO = Parmeter block initialized. :
1842; COM_DVIDMODE = Original DOS video mode. :
1843; COM_SVIDMODE = Current Shell video mode. :
1844; :
1845; Entry point: SET_SHLVMDOS :
1846; :
1847; Notes: None. :
1848; :
1849; Internal references: PCGVIDO_CALL :
1850; :
1851; External references: None. :
1852; :
1853;-----------------------------------------------------------------------------+
1854;
1855SET_SHLVMDOS PROC NEAR
1856;
1857 LEA DI,GEN_DATA ;load offset of PCGRAPH PB
1858 MOV [DI]+G_INITVFLAG,0 ;init to VGA hardware available
1859;
1860; Check if mode 10H requested
1861;
1862 TEST COM_STATE,COM_M10H ;check if graphics mode 10H
1863 JE VMD20 ; requested (EGA/VGA)
1864;
1865 TEST GV_STAT1,GV_256K ;256K memory on EGA card
1866 JNE VMD10
1867;
1868 MOV COM_ERRID,ERR_256K ;set error for less than 256KB
1869 JMP VMDEXIT ; available on graphics adaphter
1870;
1871VMD10: MOV AL,10H ;set for mode 10H
1872 JMP VMD60
1873;
1874; Check if mode 11H requested
1875;
1876VMD20: TEST COM_STATE,COM_M11H ;check if graphics mode 11H
1877 JE VMD40 ; requested (VGA/MCGA)
1878;
1879 TEST GV_STAT1,GV_EGAA ;check if VGA/EGA hardware avail
1880 JNE VMD30
1881;
1882 CMP GE_MODEL,MODEL_30 ;check for MCGA support
1883 JNE VMD30
1884;
1885 OR IN_OPT,IN_MCGA ;MCGA active
1886 MOV [DI]+G_INITVFLAG,G_INITNOVGA
1887 ;no VGA hardware available
1888;
1889VMD30: MOV AL,11H ;set for mode 11H
1890 JMP VMD60
1891;
1892; check if mode 12H requested
1893;
1894VMD40: TEST COM_STATE,COM_M12H ;check if graphics mode 12H
1895 JE VMD70
1896;
1897 TEST GV_STAT1,GV_256K ;256K memory on EGA card
1898 JNE VMD50
1899;
1900 MOV COM_ERRID,ERR_256K ;set error for less than 256KB
1901 JMP VMDEXIT ; available on graphics adaphter
1902;
1903VMD50: MOV AL,12H ;set for mode 12H
1904;
1905; set graphics video mode
1906;
1907VMD60: CMP AL,12H ;check for mode 12H
1908 JE VMD62
1909;
1910 CMP AL,11H ;check for mode 11H
1911 JE VMD62
1912;
1913 JMP VMD65 ;must be mode 10H
1914;
1915VMD62: CMP GE_MODEL,MODEL_30 ;check if model 30
1916 JE VMD65
1917;
1918 CMP GE_MODEL,MODEL_25 ;check if model 25
1919 JE VMD65
1920;
1921 PUSH AX
1922 MOV AX, 1A00H ;BIOS check display
1923 INT 10H
1924 CMP AL, 1AH ;VGA supported?
1925 POP AX
1926 JE VMD65 ;yes, continue
1927;
1928 MOV AL,0 ;set error in video mode
1929 JMP VMD80 ;exit
1930;
1931VMD65: MOV [DI]+G_INITVMODE,AL ;set desired graphics video mode
1932 MOV [DI]+G_FUNC,G_INIT ;initialize graphics support
1933 MOV BX,DATA ;point to general PCGRAPH
1934 MOV ES,BX ; initialize parameter block
1935 PUSH AX
1936 CALL PCGRAPH_CALL ;initialize graphics
1937 POP AX
1938 JMP VMD80
1939;
1940; set text video mode
1941;
1942VMD70: MOV AL,7 ;initialize
1943 CMP AL,COM_DVIDMODE ;if monochrome text mode is active
1944 JE VMD80 ; no need to set mode
1945;
1946 MOV AL,3
1947 CMP AL,COM_DVIDMODE ;if color text mode is active no
1948 JE VMD80 ; need to set mode
1949;
1950 XOR AH,AH ;set to color text mode
1951 PUSH AX ;save
1952 INT 10H
1953 POP AX ;restore
1954;
1955; read all video information and check if mode set successful
1956;
1957VMD80: CALL PCGVIDO_CALL ;get new video information and
1958 CMP AL,GV_VIDMODE ; check if mode set successful
1959 JE VMD100 ;yes
1960;
1961 MOV COM_ERRID,ERR_MODE ;requested video mode failed
1962 JMP VMDEXIT
1963;
1964VMD100: MOV COM_SVIDMODE,AL ;save current shell video mode
1965 cmp al, 7 ;monochrome text mode active?
1966 jne vmd101 ;no, continue
1967 and COM_STATE,not COM_FLCS ;inactivate color change
1968vmd101:
1969 CALL FAR PTR CURSOROFF ;deactive cursor
1970;
1971VMDEXIT: ;exit
1972;
1973 RET
1974SET_SHLVMDOS ENDP
1975;
1976PAGE
1977;-----------------------------------------------------------------------------+
1978; :
1979; Name: SET_DOSVMSHL :
1980; :
1981; Description: Set original DOS video mode from current shell mode :
1982; and disable mouse support :
1983; :
1984; Entry: PCGVIDO = Parmeter block initialized. :
1985; COM_DVIDMODE = Original DOS video mode. :
1986; COM_SVIDMODE = Current Shell video mode. :
1987; COM_STATE = Invocation options. :
1988; :
1989; Exit: PCGVIDO = Parmeter block initialized. :
1990; :
1991; Entry point: SET_DOSVMSHL :
1992; :
1993; Notes: None. :
1994; :
1995; Internal references: PCGVIDO_CALL :
1996; PCTRACK_CALL :
1997; :
1998; External references: None. :
1999; :
2000;-----------------------------------------------------------------------------+
2001;
2002SET_DOSVMSHL PROC NEAR
2003;
2004; Disable mouse support
2005;
2006 CALL FAR PTR MOUSE_DIS ;disable mouse support
2007;
2008; Check if shell is in text mode
2009;
2010VMS10: CMP COM_STATE,COM_TEXT
2011 JNE VMS20
2012;
2013; Terminate shell graphics mode and restore original DOS video mode
2014;
2015 LEA DI,GEN_DATA ;load offset of PCGRAPH PB
2016 MOV [DI]+G_FUNC,G_TERM ;terminate graphics support
2017 MOV BX,DATA ;point to general PCGRAPH
2018 MOV ES,BX ;initialize parameter block
2019 CALL PCGRAPH_CALL ;initialize graphics
2020 JMP VMSEXIT
2021;
2022; Shell is in text video mode, restore original DOS video mode
2023;
2024VMS20: MOV AL,COM_DVIDMODE ;if shell mode and DOS mode are
2025 XOR AH,AH ;shell and DOS modes are different
2026 INT 10H ; reset original DOS mode
2027;
2028; Exit
2029;
2030VMSEXIT: MOV AL,0 ;clear screen
2031 MOV CH,0
2032 MOV CL,0
2033 MOV DX,GV_NUMLINES ;set DH to bottom row
2034 MOV DL,80 ;set DL to screen width in chars
2035 MOV BH,07H ;set white on black color
2036 MOV AH,6
2037 INT 10H
2038;
2039 CALL FAR PTR CURSORON
2040 CALL PCGVIDO_CALL
2041;
2042 RET
2043SET_DOSVMSHL ENDP
2044;
2045PAGE
2046;-----------------------------------------------------------------------------+
2047; :
2048; Name: SET_CMDVMSHL :
2049; :
2050; Description: Set shell command line video mode from current shell :
2051; mode. :
2052; :
2053; Entry: PCGVIDO = Parmeter block initialized. :
2054; COM_DVIDMODE = Original DOS video mode. :
2055; COM_STATE = Invocation options. :
2056; :
2057; Exit: COM_CVIDMODE = Shell command line video mode. :
2058; PCGVIDO = Parmeter block initialized. :
2059; :
2060; Entry point: SET_CMDVMSHL :
2061; :
2062; Notes: None. :
2063; :
2064; Internal references: PCGVIDO_CALL :
2065; :
2066; External references: None. :
2067; :
2068;-----------------------------------------------------------------------------+
2069;
2070SET_CMDVMSHL PROC FAR
2071;
2072; Check if shell text mode is active
2073;
2074 CMP COM_STATE,COM_TEXT
2075 JE CMDEXIT
2076;
2077; Terminate shell graphics mode and restore original DOS video mode
2078;
2079 LEA DI,GEN_DATA ;load offset of PCGRAPH PB
2080 MOV [DI]+G_FUNC,G_TERM ;terminate graphics support
2081 MOV BX,DATA ;point to general PCGRAPH
2082 MOV ES,BX ;initialize parameter block
2083 CALL PCGRAPH_CALL ;initialize graphics
2084;
2085; Set shell command line to text video mode
2086;
2087 MOV AL,7 ;initialize to monochrome mode
2088 CMP COM_DVIDMODE,AL ;check if DOS video mode was
2089 JE CMD10 ; monochrome
2090;
2091 MOV AL,3 ;set color text mode
2092;
2093CMD10: XOR AH,AH ;set command line video mode
2094 INT 10H
2095;
2096; Exit
2097;
2098CMDEXIT: CALL PCGVIDO_CALL
2099;
2100 RET
2101SET_CMDVMSHL ENDP
2102;
2103PAGE
2104;-----------------------------------------------------------------------------+
2105; :
2106; Name: SET_SHLVMCMD :
2107; :
2108; Description: Set shell video mode from shell command line video :
2109; mode. :
2110; :
2111; Entry: COM_STATE = Option word indicating invocation :
2112; parameters passed through PSP. :
2113; :
2114; Exit: PCGVIDO = Parmeter block initialized. :
2115; COM_DVIDMODE = Original DOS video mode. :
2116; COM_SVIDMODE = Current Shell video mode. :
2117; :
2118; Entry point: SET_SHLVMCMD :
2119; :
2120; Notes: None. :
2121; :
2122; Internal references: PCGVIDO_CALL :
2123; :
2124; External references: None. :
2125; :
2126;-----------------------------------------------------------------------------+
2127;
2128SET_SHLVMCMD PROC FAR
2129;
2130; Check if shell graphics modes 10H, 11H, and 12H were active
2131;
2132 LEA DI,GEN_DATA ;load offset of PCGRAPH PB
2133 MOV [DI]+G_INITVFLAG,0
2134;
2135 TEST COM_STATE,COM_M11H ;check if graphics mode 11H
2136 JE SMC20 ; requested (VGA/MCGA)
2137;
2138 TEST GV_STAT1,GV_EGAA ;check if VGA/EGA hardware avail
2139 JNE SMC10
2140;
2141 CMP GE_MODEL,MODEL_30 ;check for MCGA support
2142 JNE SMC10
2143;
2144 OR IN_OPT,IN_MCGA ;MCGA active
2145 MOV [DI]+G_INITVFLAG,G_INITNOVGA
2146 ;no VGA hardware available
2147;
2148SMC10: MOV AL,11H ;set for mode 11H
2149 JMP SMC50
2150;
2151SMC20: CMP COM_SVIDMODE,10H ;check if mode 10 active
2152 JE SMC50
2153;
2154 CMP COM_SVIDMODE,12H ;check if mode 12 active
2155 JE SMC50
2156;
2157 MOV AH,0FH ;get current video mode
2158 INT 10H
2159;
2160 CMP AL,COM_SVIDMODE ;check if command line video mode
2161 JNE SMC30 ; changed and reset if yes
2162;
2163 JMP SMCEXIT
2164;
2165; Switch to monochrome monitor
2166;
2167SMC30: CMP COM_SVIDMODE,3H ;check if color mode should be set
2168 JE SMC40
2169;
2170 PUSH DS
2171;
2172 XOR AX,AX ;clear to zero
2173 MOV ES,AX ;point to BIOS data area and
2174 MOV DL,ES:[410H] ; get mode byte
2175 OR DL,00110000B
2176 MOV ES:[410H],DL
2177 XOR AH,AH ;set color monochrome mode
2178 MOV AL,7H
2179 INT 10H
2180;
2181 POP DS
2182;
2183 JMP SMCEXIT
2184;
2185; Switch to color monitor in text mode 80x25
2186;
2187SMC40: PUSH DS
2188;
2189 XOR AX,AX ;clear to zero
2190 MOV ES,AX ;point to BIOS data area and
2191 MOV DL,ES:[410H] ; get mode byte
2192 AND DL,11001111B
2193 OR DL,00100000B
2194 MOV ES:[410H],DL
2195 XOR AH,AH ;set color mode
2196 MOV AL,3H
2197 INT 10H
2198;
2199 POP DS
2200;
2201 JMP SMCEXIT
2202;
2203; Initialize shell graphics mode from shell command line text mode
2204;
2205SMC50: MOV AH,0FH ;get current video mode
2206 INT 10H
2207;
2208 CMP AL,7H ;check if command line mode set
2209 JNE SMC60 ; for monochrome, if yes reset to
2210 ; graphics monitor
2211;
2212 PUSH DS
2213;
2214 XOR AX,AX ;clear to zero
2215 MOV ES,AX ;point to BIOS data area and
2216 MOV DL,ES:[410H] ; get mode byte
2217 AND DL,11001111B
2218 OR DL,00100000B
2219 MOV ES:[410H],DL
2220 XOR AH,AH ;set color 80x25 mode before
2221 MOV AL,3H ; setting graphics mode
2222 INT 10H
2223;
2224 POP DS
2225;
2226SMC60: LEA DI,GEN_DATA ;load offset of PCGRAPH PB
2227 MOV AL,COM_SVIDMODE ;set the shell graphics video mode
2228 MOV [DI]+G_INITVMODE,AL
2229 MOV [DI]+G_FUNC,G_INIT ;initialize graphics support
2230 MOV BX,DATA ;point to general PCGRAPH
2231 MOV ES,BX ;initialize parameter block
2232 CALL PCGRAPH_CALL ;initialize graphics
2233;
2234; Exit
2235;
2236SMCEXIT: CALL PCGVIDO_CALL
2237;
2238 RET
2239SET_SHLVMCMD ENDP
2240;
2241PAGE
2242;-----------------------------------------------------------------------------+
2243; :
2244; Name: CURSOROFF :
2245; :
2246; Description: Deactivates hardware cursor from display. :
2247; :
2248; Entry: None :
2249; :
2250; Exit: None. :
2251; :
2252; Entry point: CURSOROFF :
2253; :
2254; Notes: None. :
2255; :
2256; Internal references: None. :
2257; :
2258; External references: None. :
2259; :
2260;-----------------------------------------------------------------------------+
2261;
2262CURSOROFF PROC FAR
2263;
2264 PUSH AX ;save registers
2265 PUSH BX
2266 PUSH CX
2267;
2268 MOV AH,3 ;function to get cursor info
2269 MOV BH,0 ;page zero
2270 INT 10H
2271 OR CH,20H ;set bit 6
2272 MOV AH,1 ;function to set cursor
2273 INT 10H
2274;
2275 POP CX ;restore registers
2276 POP BX
2277 POP AX
2278;
2279 RET
2280CURSOROFF ENDP
2281;
2282PAGE
2283;-----------------------------------------------------------------------------+
2284; :
2285; Name: CURSORON :
2286; :
2287; Description: Displays the hardare cursor. :
2288; :
2289; Entry: None. :
2290; :
2291; Exit: None. :
2292; :
2293; Entry point: CURSORON :
2294; :
2295; Notes: None. :
2296; :
2297; Internal references: None. :
2298; :
2299; External references: None. :
2300; :
2301;-----------------------------------------------------------------------------+
2302;
2303CURSORON PROC FAR
2304;
2305 PUSH AX ;save registers
2306 PUSH BX
2307 PUSH CX
2308 PUSH DX ;>>SN
2309;
2310 MOV AH,3 ;function to get cursor info
2311 MOV BH,0 ;page zero
2312 INT 10H
2313 AND CH,NOT 20H ;clear bit 6
2314 MOV AH,1 ;function to set cursor
2315 INT 10H
2316;
2317 POP DX ;>>SN
2318 POP CX ;restore registers
2319 POP BX
2320 POP AX
2321;
2322 RET
2323CURSORON ENDP
2324;
2325PAGE
2326;-----------------------------------------------------------------------------+
2327; :
2328; Name: PCINPUT_CALL :
2329; :
2330; Description: Call to PCINPUT. :
2331; :
2332; Entry: PCINPUT parameter block initialized. :
2333; :
2334; Exit: PCINPUT parameter block initialized. :
2335; :
2336; Entry point: PCINPUT_CALL :
2337; :
2338; Notes: None. :
2339; :
2340; Internal references: None. :
2341; :
2342; External references: None. :
2343; :
2344;-----------------------------------------------------------------------------+
2345;
2346PCINPUT_CALL PROC FAR
2347;
2348 PUSH DS ;set segment
2349 POP ES
2350;
2351 PUSH DS
2352 PUSH DI ;save registers
2353;
2354 TEST COM_STATE2,COM_DBCS ;check if DBCS option active
2355 JE INPT10
2356;
2357 OR IN_OPT,IN_DDBCS+IN_ADBCS ;activate DBCS
2358;
2359INPT10: LEA DI,IN_OPT ;set DI to proper parameter block
2360 ; for call
2361IF CASRM
2362 MOV AH,00H ;make call to CAS-RM
2363 MOV BX,IN_RN ;set CAS routine number
2364 INT CASINT ;call routine
2365ELSE
2366 CALL INPUT
2367ENDIF
2368 POP DI ;restore registers
2369 POP DS
2370;
2371 RET
2372PCINPUT_CALL ENDP
2373;
2374PAGE
2375;-----------------------------------------------------------------------------+
2376; :
2377; Name: PCINCHA_CALL :
2378; :
2379; Description: Call to PCINCHA. :
2380; :
2381; Entry: PCINCHA parameter block initialized. :
2382; :
2383; Exit: PCINCHA parameter block initialized. :
2384; :
2385; Entry point: PCINCHA_CALL :
2386; :
2387; Notes: None. :
2388; :
2389; Internal references: None. :
2390; :
2391; External references: None. :
2392; :
2393;-----------------------------------------------------------------------------+
2394;
2395PCINCHA_CALL PROC NEAR
2396;
2397 PUSH DS ;set segment
2398 POP ES
2399;
2400 PUSH DS
2401 PUSH DI ;save registers
2402;
2403 TEST COM_STATE2,COM_DBCS ;check if DBCS option active
2404 JE INCH10
2405;
2406 OR INC_OPT,INC_DDBCS ;activate DBCS
2407;
2408INCH10: LEA DI,INC_OPT ;set DI to proper parameter block
2409 ; for call
2410IF CASRM
2411 MOV AH,00H ;make call to CAS-RM
2412 MOV BX,INC_RN ;set CAS routine number
2413 INT CASINT ;call routine
2414ELSE
2415 CALL INCHA
2416ENDIF
2417 POP DI ;restore registers
2418 POP DS
2419;
2420 RET
2421PCINCHA_CALL ENDP
2422;
2423PAGE
2424;-----------------------------------------------------------------------------+
2425; :
2426; Name: PCDISPQ_CALL :
2427; :
2428; Description: Call to PCDISPQ. :
2429; :
2430; Entry: PCDISPQ parameter block initialized. :
2431; :
2432; Exit: PCDISPQ parameter block initialized. :
2433; :
2434; Entry point: PCDISPQ_CALL :
2435; :
2436; Notes: None. :
2437; :
2438; Internal references: None. :
2439; :
2440; External references: None. :
2441; :
2442;-----------------------------------------------------------------------------+
2443;
2444PCDISPQ_CALL PROC NEAR
2445;
2446 PUSH DS ;set segment
2447 POP ES
2448;
2449 PUSH DS
2450 PUSH DI ;save registers
2451;
2452 LEA DI,QM_OPT1 ;set DI to proper parameter block
2453 ; for call
2454IF CASRM
2455 MOV AH,00H ;make call to CAS-RM
2456 MOV BX,QM_RN ;set CAS routine number
2457 INT CASINT ;call routine
2458ELSE
2459 CALL DISPQ
2460ENDIF
2461 POP DI ;restore registers
2462 POP DS
2463;
2464 RET
2465PCDISPQ_CALL ENDP
2466;
2467PAGE
2468;-----------------------------------------------------------------------------+
2469; :
2470; Name: PCPANEL_CALL :
2471; :
2472; Description: Initialize for call to PCPANEL including refresh of :
2473; input and scroll fields in the logical video buffer :
2474; before display. :
2475; :
2476; Entry: PCPANEL parameter block initialized. :
2477; :
2478; AX 0= Logical video buffer mode write :
2479; 1= Direct video mode write :
2480; :
2481; Exit: PCPANEL parameter block initialized. :
2482; :
2483; Entry point: PCPANEL_CALL :
2484; :
2485; Notes: None. :
2486; :
2487; Internal references: None. :
2488; :
2489; External references: None. :
2490; :
2491;-----------------------------------------------------------------------------+
2492;
2493PCPANEL_CALL PROC NEAR
2494;
2495; initialize PCDISPQ info for PCPANEL call
2496;
2497 CMP AX,1 ;check if direct video buffer
2498 JE PP10 ; write option active
2499;
2500 MOV BX,QM_PANQUENUM
2501 MOV PM_PANQUENUM,BX ;number of panels in parent queue
2502;
2503 MOV BX,QM_CHDQUENUM
2504 MOV PM_CHDQUENUM,BX ;number panels in child queue
2505;
2506 MOV BX,QM_ACTIVEPAN
2507 MOV PM_ACTIVEPAN,BX ;active parent panel number
2508;
2509 MOV PM_OPT1,PM_DOA+PM_DOV+PM_DOQ+PM_CL
2510 MOV PM_PANPDQNUM,1 ;beg/ending parent PDQ number
2511 MOV PM_PANBRKOFF,0 ;panel off in lvb of break panel
2512;
2513; actual PCPANEL call
2514;
2515PP10: PUSH DS ;set segment
2516 POP ES
2517;
2518 PUSH DS
2519 PUSH DI ;save registers
2520;
2521 LEA DI,PM_OPT1 ;set DI to proper parameter block
2522 ; for call
2523IF CASRM
2524 MOV AH,00H ;make call to CAS-RM
2525 MOV BX,PM_RN ;set CAS routine number
2526 INT CASINT ;call routine
2527ELSE
2528 CALL PANEL
2529ENDIF
2530 POP DI ;restore registers
2531 POP DS
2532;
2533; Exit
2534;
2535PPEXIT: ;exit
2536;
2537 RET
2538PCPANEL_CALL ENDP
2539;
2540PAGE
2541;-----------------------------------------------------------------------------+
2542; :
2543; Name: PCMBEEP_CALL :
2544; :
2545; Description: Call to PCMBEEP. :
2546; :
2547; Entry: PCMBEEP parameter block initialized. :
2548; :
2549; Exit: PCMBEEP parameter block initialized. :
2550; :
2551; Entry point: PCMBEEP_CALL :
2552; :
2553; Notes: None. :
2554; :
2555; Internal references: None. :
2556; :
2557; External references: None. :
2558; :
2559;-----------------------------------------------------------------------------+
2560;
2561PCMBEEP_CALL PROC FAR
2562;
2563 TEST COM_STATE2,COM_SOUD ;check if sound is off
2564 JE BEXIT
2565;
2566 PUSH CX ;save registers
2567 PUSH DX
2568;
2569 PUSH DS ;set segment
2570 POP ES
2571;
2572 PUSH DS
2573 PUSH DI ;save registers
2574;
2575 LEA DI,MB_FREQUENCY ;set DI to proper parameter block
2576 ; for call
2577IF CASRM
2578 MOV AH,00H ;make call to CAS-RM
2579 MOV BX,MB_RN ;set CAS routine number
2580 INT CASINT ;call routine
2581ELSE
2582 CALL MBEEP
2583ENDIF
2584 POP DI ;restore registers
2585 POP DS
2586;
2587 POP DX ;restore registers
2588 POP CX
2589;
2590BEXIT:
2591;
2592 RET
2593PCMBEEP_CALL ENDP
2594;
2595PAGE
2596;-----------------------------------------------------------------------------+
2597; :
2598; Name: PCSLCTP_CALL :
2599
2600; :
2601; Description: Call to PCSLCTP. :
2602; :
2603; Entry: ES:DI = beginning address of PCSLCTP parameter block. :
2604; :
2605; Exit: PCSLCTP parameter block initialized. :
2606; :
2607; Entry point: PCSLCTP_CALL :
2608; :
2609; Notes: None. :
2610; :
2611; Internal references: None. :
2612; :
2613; External references: None. :
2614; :
2615;-----------------------------------------------------------------------------+
2616;
2617PCSLCTP_CALL PROC NEAR
2618;
2619; Initialize color index vector
2620;
2621 MOV AX,PM_CCBVECNUM ;set color index number
2622 MOV ES:[DI]+SCB_CCBVECNUM,AX
2623;
2624 MOV AX,CRD_CCBVECOFF ;set color index offset
2625 MOV ES:[DI]+SCB_CCBVECOFF,AX
2626;
2627 MOV AX,CRD_CCBVECSEG ;set color index segment
2628 MOV ES:[DI]+SCB_CCBVECSEG,AX
2629;
2630IF CASRM
2631 MOV AH,00H ;make call to CAS-RM
2632 MOV BX,SCB_RN ;set CAS routine number
2633 INT CASINT ;call slctopt
2634ELSE
2635 CALL SLCTP
2636ENDIF
2637;
2638 RET
2639PCSLCTP_CALL ENDP
2640;
2641PAGE
2642;-----------------------------------------------------------------------------+
2643; :
2644; Name: PCHLPRD_CALL :
2645; :
2646; Description: Call to PCHLPRD. :
2647; :
2648; Entry: PCHLPRD parameter block initialized. :
2649; :
2650; Exit: PCHLPRD parameter block initialized. :
2651; :
2652; Entry point: PCHLPRD_CALL :
2653; :
2654; Notes: None. :
2655; :
2656; Internal references: None. :
2657; :
2658; External references: None. :
2659; :
2660;-----------------------------------------------------------------------------+
2661;
2662PCHLPRD_CALL PROC NEAR
2663;
2664 PUSH DS ;set segment
2665 POP ES
2666;
2667 PUSH DS
2668 PUSH DI ;save registers
2669;
2670 LEA DI,HRD_OPT1 ;set DI to proper parameter block
2671 ; for call
2672IF CASRM
2673 MOV AH,00H ;make call to CAS-RM
2674 MOV BX,HRD_RN ;set CAS routine number
2675 INT CASINT ;call routine
2676ELSE
2677 CALL HLPRD
2678ENDIF
2679 POP DI ;restore registers
2680 POP DS
2681;
2682 RET
2683PCHLPRD_CALL ENDP
2684;
2685PAGE
2686;-----------------------------------------------------------------------------+
2687; :
2688; Name: PCINSTR_CALL :
2689; :
2690; Description: Call to PCINSTR. :
2691; :
2692; Entry: PCINSTR parameter block initialized. :
2693; :
2694; Exit: PCINSTR parameter block initialized. :
2695; :
2696; Entry point: PCINSTR_CALL :
2697; :
2698; Notes: None. :
2699; :
2700; Internal references: None. :
2701; :
2702; External references: None. :
2703; :
2704;-----------------------------------------------------------------------------+
2705;
2706PCINSTR_CALL PROC NEAR
2707;
2708 PUSH DS ;set segment
2709 POP ES
2710;
2711 PUSH DS
2712 PUSH DI ;save registers
2713;
2714 LEA DI,INS_OPT ;set DI to proper parameter block
2715 ; for call
2716IF CASRM
2717 MOV AH,00H ;make call to CAS-RM
2718 MOV BX,INS_RN ;set CAS routine number
2719 INT CASINT ;call routine
2720ELSE
2721 CALL INSTRN
2722ENDIF
2723 POP DI ;restore registers
2724 POP DS
2725;
2726 RET
2727PCINSTR_CALL ENDP
2728;
2729PAGE
2730;-----------------------------------------------------------------------------+
2731; :
2732; Name: PCGVIDO_CALL :
2733; :
2734; Description: Call to PCGVIDO. :
2735; :
2736; Entry: PCGVIDO parameter block initialized. :
2737; :
2738; Exit: PCGVIDO parameter block initialized. :
2739; :
2740; Entry point: PCGVIDO_CALL :
2741; :
2742; Notes: None. :
2743; :
2744; Internal references: None. :
2745; :
2746; External references: None. :
2747; :
2748;-----------------------------------------------------------------------------+
2749;
2750PCGVIDO_CALL PROC NEAR
2751;
2752 PUSH ES
2753;
2754 PUSH DS ;set segment
2755 POP ES
2756;
2757 PUSH DS
2758 PUSH DI ;save registers
2759;
2760 LEA DI,GV_STAT1 ;set DI to proper parameter block
2761 ; for call
2762;
2763IF CASRM
2764 MOV AH,00H ;make call to CAS-RM
2765 MOV BX,GV_RN ;set CAS routine number
2766 INT CASINT ;call routine
2767ELSE
2768 CALL GVIDO
2769ENDIF
2770 POP DI ;restore registers
2771 POP DS
2772;
2773 POP ES
2774;
2775 RET
2776PCGVIDO_CALL ENDP
2777;
2778PAGE
2779;-----------------------------------------------------------------------------+
2780; :
2781; Name: PCCLRWR_CALL :
2782; :
2783; Description: Call to PCCLRWR. :
2784; :
2785; Entry: PCCLRWR parameter block initialized. :
2786; :
2787; Exit: PCCLRWR parameter block initialized. :
2788; :
2789; Entry point: PCCLRWR_CALL :
2790; :
2791; Notes: None. :
2792; :
2793; Internal references: None. :
2794; :
2795; External references: None. :
2796; :
2797;-----------------------------------------------------------------------------+
2798;
2799PCCLRWR_CALL PROC NEAR
2800;
2801 PUSH DS ;set segment
2802 POP ES
2803;
2804 PUSH DS
2805 PUSH DI ;save registers
2806;
2807 LEA DI,CWR_OPT ;set DI to proper parameter block
2808 ; for call
2809IF CASRM
2810 MOV AH,00H ;make call to CAS-RM
2811 MOV BX,CWR_RN ;set CAS routine number
2812 INT CASINT ;call routine
2813ELSE
2814 CALL CLRWR
2815ENDIF
2816 POP DI ;restore registers
2817 POP DS
2818;
2819 RET
2820PCCLRWR_CALL ENDP
2821;
2822PAGE
2823;-----------------------------------------------------------------------------+
2824; :
2825; Name: PCCRITE_CALL :
2826; :
2827; Description: Call to PCCRITE. :
2828; :
2829; Entry: PCCRITE parameter block initialized. :
2830; :
2831; Exit: PCCRITE parameter block initialized. :
2832; :
2833; Entry point: PCCRITE_CALL :
2834; :
2835; Notes: None. :
2836; :
2837; Internal references: None. :
2838; :
2839; External references: None. :
2840; :
2841;-----------------------------------------------------------------------------+
2842;
2843PCCRITE_CALL PROC NEAR
2844;
2845 PUSH DS ;set segment
2846 POP ES
2847;
2848 PUSH DS
2849 PUSH DI ;save registers
2850;
2851 LEA DI,CE_OPT ;set DI to proper parameter block
2852 ; for call
2853;
2854IF CASRM
2855 MOV AH,00H ;make call to CAS-RM
2856 MOV BX,CE_RN ;set CAS routine number
2857 INT CASINT ;call routine
2858ELSE
2859 CALL CRITE
2860ENDIF
2861 POP DI ;restore registers
2862 POP DS
2863;
2864 RET
2865PCCRITE_CALL ENDP
2866;
2867PAGE
2868;-----------------------------------------------------------------------------+
2869; :
2870; Name: PCWWRAP_CALL :
2871; :
2872; Description: Call to PCWWRAP. :
2873; :
2874; Entry: PCWWRAP parameter block initialized. :
2875; :
2876; Exit: PCWWRAP parameter block initialized. :
2877; :
2878; Entry point: PCWWRAP_CALL :
2879; :
2880; Notes: None. :
2881; :
2882; Internal references: None. :
2883; :
2884; External references: None. :
2885; :
2886;-----------------------------------------------------------------------------+
2887;
2888PCWWRAP_CALL PROC NEAR
2889;
2890 PUSH DS ;set segment
2891 POP ES
2892;
2893 PUSH DS
2894 PUSH DI ;save registers
2895;
2896 LEA DI,WWP_OPT1 ;set DI to proper parameter block
2897 ; for call
2898;
2899IF CASRM
2900 MOV AH,00H ;make call to CAS-RM
2901 MOV BX,WWP_RN ;set CAS routine number
2902 INT CASINT ;call routine
2903ELSE
2904 CALL WWRAP
2905ENDIF
2906 POP DI ;restore registers
2907 POP DS
2908;
2909 RET
2910PCWWRAP_CALL ENDP
2911;
2912PAGE
2913;-----------------------------------------------------------------------------+
2914; :
2915; Name: PCTRACK_CALL :
2916; :
2917; Description: Call to PCTRACK. :
2918; :
2919; Entry: PCTRACK parameter block initialized. :
2920; :
2921; Exit: PCTRACK parameter block initialized. :
2922; :
2923; Entry point: PCTRACK_CALL :
2924; :
2925; Notes: None. :
2926; :
2927; Internal references: None. :
2928; :
2929; External references: None. :
2930; :
2931;-----------------------------------------------------------------------------+
2932;
2933PCTRACK_CALL PROC FAR
2934;
2935 PUSH DS
2936 PUSH DI ;save registers
2937;
2938 PUSH DS ;point to PCTRACK parameter block
2939 POP ES
2940;
2941IF CASRM
2942 MOV AH,00H ;make call to CAS-RM
2943 MOV BX,MS_RN ;set CAS routine number
2944 INT CASINT ;call routine
2945ELSE
2946 CALL TRACK
2947ENDIF
2948 POP DI ;restore registers
2949 POP DS
2950;
2951 RET
2952PCTRACK_CALL ENDP
2953;
2954PAGE
2955;-----------------------------------------------------------------------------+
2956; :
2957; Name: PCGRAPH_CALL :
2958; :
2959; Description: Call to PCGRAPH. :
2960; :
2961; Entry: PCGRAPH parameter block initialized. :
2962; :
2963; Exit: PCGRAPH parameter block initialized. :
2964; :
2965; Entry point: PCGRAPH_CALL :
2966; :
2967; Notes: None. :
2968; :
2969; Internal references: None. :
2970; :
2971; External references: None. :
2972; :
2973;-----------------------------------------------------------------------------+
2974;
2975PCGRAPH_CALL PROC NEAR
2976;
2977 PUSH DS
2978 PUSH DI ;save registers
2979;
2980IF CASRM
2981 MOV AH,00H ;make call to CAS-RM
2982 MOV BX,MS_RN ;set CAS routine number
2983 INT CASINT ;call routine
2984ELSE
2985 CALL GRAPH
2986ENDIF
2987 POP DI ;restore registers
2988 POP DS
2989;
2990 RET
2991PCGRAPH_CALL ENDP
2992;
2993PAGE
2994;-----------------------------------------------------------------------------+
2995; :
2996; Name: PCST2IN_CALL :
2997; :
2998; Description: Call to PCST2IN. :
2999; :
3000; Entry: PCST2IN parameter block initialized. :
3001; :
3002; Exit: PCST2IN parameter block initialized. :
3003; :
3004; Entry point: PCST2IN_CALL :
3005; :
3006; Notes: None. :
3007; :
3008; Internal references: None. :
3009; :
3010; External references: None. :
3011; :
3012;-----------------------------------------------------------------------------+
3013;
3014PCST2IN_CALL PROC NEAR
3015;
3016 PUSH DS ;set segment
3017 POP ES
3018;
3019 PUSH DS
3020 PUSH DI ;save registers
3021;
3022 LEA DI,ST2_OPT1 ;set DI to proper parameter block
3023 ; for call
3024;
3025IF CASRM
3026 MOV AH,00H ;make call to CAS-RM
3027 MOV BX,S2I_RN ;set CAS routine number
3028 INT CASINT ;call routine
3029ELSE
3030 CALL ST2IN
3031ENDIF
3032 POP DI ;restore registers
3033 POP DS
3034;
3035 RET
3036PCST2IN_CALL ENDP
3037;
3038PAGE
3039;-----------------------------------------------------------------------------+
3040; :
3041; Name: PCMOVEC_CALL :
3042; :
3043; Description: Call to PCMOVEC. :
3044; :
3045; Entry: PCMOVEC parameter block initialized. :
3046; :
3047; Exit: PCMOVEC parameter block initialized. :
3048; :
3049; Entry point: PCMOVEC_CALL :
3050; :
3051; Notes: None. :
3052; :
3053; Internal references: None. :
3054; :
3055; External references: None. :
3056; :
3057;-----------------------------------------------------------------------------+
3058;
3059PCMOVEC_CALL PROC NEAR
3060;
3061 PUSH DS ;set segment
3062 POP ES
3063;
3064 PUSH DS
3065 PUSH DI ;save registers
3066;
3067 LEA DI,MO_OPT ;set DI to proper parameter block
3068 ; for call
3069;
3070IF CASRM
3071 MOV AH,00H ;make call to CAS-RM
3072 MOV BX,MO_RN ;set CAS routine number
3073 INT CASINT ;call routine
3074ELSE
3075 CALL MOVEC
3076ENDIF
3077 POP DI ;restore registers
3078 POP DS
3079;
3080 RET
3081PCMOVEC_CALL ENDP
3082;
3083PAGE
3084;-----------------------------------------------------------------------------+
3085; :
3086; Name: SHELLDA_CALL :
3087; :
3088; Description: Call to SHELLDA. :
3089; :
3090; Entry: None :
3091; :
3092; Exit: None :
3093; :
3094; Entry point: SHELLDA_CALL :
3095; :
3096; Notes: None. :
3097; :
3098; Internal references: None. :
3099; :
3100; External references: None. :
3101; :
3102;-----------------------------------------------------------------------------+
3103;
3104SHELLDA_CALL PROC NEAR
3105;
3106 CALL SHELLDA
3107;
3108 RET
3109SHELLDA_CALL ENDP
3110;
3111PAGE
3112;-----------------------------------------------------------------------------+
3113; :
3114; PCROWCL_CALL :
3115; :
3116; Call to PCROWCL. :
3117; :
3118; Entry: PB initialized. :
3119; :
3120; Exit: None :
3121; :
3122; Notes: None :
3123; :
3124;-----------------------------------------------------------------------------+
3125;
3126PCROWCL_CALL PROC NEAR
3127
3128 PUSH ES
3129 PUSH DS ;set segment
3130 POP ES
3131
3132 PUSH DS
3133 PUSH DI ;save registers
3134
3135 LEA DI,CR_SCRWIDTH ;set DI to proper parameter block
3136 ; for call
3137IF CASRM
3138 MOV AH,00H ;make call to CAS-RM
3139 MOV BX,CR_RN ;set CAS routine number
3140 INT CASINT ;call routine
3141ELSE
3142 CALL ROWCL
3143ENDIF
3144 POP DI ;restore registers
3145 POP DS
3146 POP ES
3147;
3148 RET
3149PCROWCL_CALL ENDP
3150;
3151PAGE
3152;-----------------------------------------------------------------------------+
3153; :
3154; PCMOVEG_CALL :
3155; :
3156; Call to PCMOVEG. :
3157; :
3158; Entry: PB initialized. :
3159; :
3160; Exit: None :
3161; :
3162; Notes: None :
3163; :
3164;-----------------------------------------------------------------------------+
3165;
3166PCMOVEG_CALL PROC NEAR
3167
3168 PUSH ES
3169 PUSH DS ;set segment
3170 POP ES
3171
3172 PUSH DS
3173 PUSH DI ;save registers
3174
3175 LEA DI,MG_OPT ;set DI to proper parameter block
3176 ; for call
3177IF CASRM
3178 MOV AH,00H ;make call to CAS-RM
3179 MOV BX,MG_RN ;set CAS routine number
3180 INT CASINT ;call routine
3181ELSE
3182 CALL MOVEG
3183ENDIF
3184 POP DI ;restore registers
3185 POP DS
3186 POP ES
3187;
3188 RET
3189PCMOVEG_CALL ENDP
3190;
3191PAGE
3192;-----------------------------------------------------------------------------+
3193; :
3194; PCGEQUP_CALL :
3195; :
3196; Call to PCGEQUP. :
3197; :
3198; Entry: PB initialized. :
3199; :
3200; Exit: None :
3201; :
3202; Notes: None :
3203; :
3204;-----------------------------------------------------------------------------+
3205;
3206PCGEQUP_CALL PROC NEAR
3207
3208 PUSH ES
3209 PUSH DS ;set segment
3210 POP ES
3211
3212 PUSH DS
3213 PUSH DI ;save registers
3214
3215 LEA DI,GE_OPT ;set DI to proper parameter block
3216 ; for call
3217IF CASRM
3218 MOV AH,00H ;make call to CAS-RM
3219 MOV BX,MG_RN ;set CAS routine number
3220 INT CASINT ;call routine
3221ELSE
3222 CALL GEQUP
3223ENDIF
3224 POP DI ;restore registers
3225 POP DS
3226 POP ES
3227;
3228 RET
3229PCGEQUP_CALL ENDP
3230;
3231PAGE
3232;-----------------------------------------------------------------------------+
3233; :
3234; PCDATES_CALL :
3235; :
3236; Call to PCDATES. :
3237; :
3238; Entry: PB initialized. :
3239; :
3240; Exit: None :
3241; :
3242; Notes: None :
3243; :
3244;-----------------------------------------------------------------------------+
3245;
3246PCDATES_CALL PROC NEAR
3247
3248 PUSH ES
3249 PUSH DS ;set segment
3250 POP ES
3251
3252 PUSH DS
3253 PUSH DI ;save registers
3254
3255 LEA DI,DTS_OPT ;set DI to proper parameter block
3256 ; for call
3257IF CASRM
3258 MOV AH,00H ;make call to CAS-RM
3259 MOV BX,DTS_RN ;set CAS routine number
3260 INT CASINT ;call routine
3261ELSE
3262 CALL DATES
3263ENDIF
3264 POP DI ;restore registers
3265 POP DS
3266 POP ES
3267;
3268 RET
3269PCDATES_CALL ENDP
3270;
3271PAGE
3272;-----------------------------------------------------------------------------+
3273; :
3274; PCTIMES_CALL :
3275; :
3276; Call to PCTIMES. :
3277; :
3278; Entry: PB initialized. :
3279; :
3280; Exit: None :
3281; :
3282; Notes: None :
3283; :
3284;-----------------------------------------------------------------------------+
3285;
3286PCTIMES_CALL PROC NEAR
3287
3288 PUSH ES
3289 PUSH DS ;set segment
3290 POP ES
3291
3292 PUSH DS
3293 PUSH DI ;save registers
3294
3295 LEA DI,TMS_OPT ;set DI to proper parameter block
3296 ; for call
3297IF CASRM
3298 MOV AH,00H ;make call to CAS-RM
3299 MOV BX,TMS_RN ;set CAS routine number
3300 INT CASINT ;call routine
3301ELSE
3302 CALL TIMES
3303ENDIF
3304 POP DI ;restore registers
3305 POP DS
3306 POP ES
3307;
3308 RET
3309PCTIMES_CALL ENDP
3310;
3311PAGE
3312;-----------------------------------------------------------------------------+
3313; :
3314; Name: CHANGE_APPM :
3315; :
3316; Description: Display Application menu screen. :
3317; :
3318; Entry: None. :
3319; :
3320; Exit: COM_CDIALOG :
3321; :
3322; Entry point: CHANGE_APPM :
3323; :
3324; Notes: None. :
3325; :
3326; Internal references: None. :
3327; :
3328; External references: None. :
3329; :
3330;-----------------------------------------------------------------------------+
3331;
3332CHANGE_APPM PROC FAR
3333;
3334 TEST COM_STATE,COM_APPM ;check if app menu active
3335 JNE CAM10
3336;
3337 CALL FAR PTR OPT_INACTIVE ;display error panel for inactive *PCR
3338 JMP CAMEXIT
3339;
3340CAM10: MOV COM_HLPOPT2,0 ;set for normal shell help
3341 MOV COM_HCBIDAAB,HLP_AABPROGRAM
3342 MOV COM_HCBID,HLP_AABPROGRAM
3343;
3344 MOV AX,MFF_AABAOPT ;default to program menu AAB field
3345 CALL FAR PTR LOC_MOUSEF
3346 MOV COM_CURAABF,AX
3347;
3348 MOV APP_SKIN,0 ;set to reinitialize app menu fld
3349 MOV COM_CDIALOG,COM_PAAB ;set for menu action bar dialog
3350 MOV COM_BASESCR,COM_APPSCR ;initialize for display of DOS scr
3351;
3352CAMEXIT:
3353;
3354 RET
3355CHANGE_APPM ENDP
3356;
3357PAGE
3358;-----------------------------------------------------------------------------+
3359; :
3360; Name: ALLOCATE_BUFB :
3361; :
3362; Description: Allocate memory for directory and file buffers. :
3363; :
3364; Entry: COM_STATE2 = Invocation parameters. :
3365; COM_DFSIZE = Optional buffer override size in parags.:
3366; :
3367; MAX_DIR1BUF = Size of directory buffer 1 in paragraph :
3368; MAX_DIR2BUF = Size of directory buffer 2 in paragraph :
3369; MAX_DOSWBUF = Size of view, copy, move working buffer :
3370; MAX_EXECBUF = Size of app menu and/or command prompt :
3371; free space to be made avail to dos in :
3372; resident mode only. :
3373; :
3374; Allocated by one DOS call with COM_DATA4SEG as :
3375; starting segment. :
3376; :
3377; COM_DATA4LEN Optional DOS Services directory :
3378; COM_DATA4OFF list 1 buffer. :
3379; COM_DATA4SEG :
3380; :
3381; COM_DATA5LEN Optional DOS Services directory :
3382; COM_DATA5OFF list 2 buffer. :
3383; COM_DATA5SEG :
3384; :
3385; COM_DATA6LEN Optional DOS Services file list 1 :
3386; COM_DATA6OFF buffer :
3387; COM_DATA6SEG :
3388; :
3389; COM_DATA7LEN Optional DOS Services file list 2 :
3390; COM_DATA7OFF buffer :
3391; COM_DATA7SEG :
3392; :
3393; COM_DATA8LEN Optional DOS Services :
3394; COM_DATA8OFF buffer :
3395; COM_DATA8SEG :
3396; :
3397; Entry point: ALLOCATE_BUFB :
3398; :
3399; Notes: None. :
3400; :
3401; Internal references: None. :
3402; :
3403; External references: INT 21H 48H Allocate memory :
3404; :
3405;-----------------------------------------------------------------------------+
3406;
3407ALLOCATE_BUFB PROC FAR
3408;
3409 TEST COM_STATE,COM_DOSS ;check if DOS Services configured
3410 JNE AMB05 ;exit
3411;
3412 JMP AMBEXIT
3413;
3414; Determine avail memory, calc memory to allocate for shell functions
3415;
3416AMB05: MOV AH,48H ;find out how many parags are aval
3417 MOV BX,0FFFFH ; in BX on return
3418 INT 21H
3419;
3420; adjust for resident mode operation
3421;
3422 TEST COM_STATE,COM_RESS ;check if resident mode is active
3423 JE AMB11 ; if yes, check if prompt or menu
3424 ; options are active, if yes,
3425 ; reduce avail size by 64KB to
3426 ; allow room for command line
3427 ; or prog menu operation
3428;
3429AMB08: CMP BX,MAX_EXECBUF ;64K remaining?
3430 JB AMB_ERR ;no, error
3431;
3432 SUB BX,MAX_EXECBUF ;save 64KB for execution of
3433 ; command prompt or program menu
3434 ; only if in resident mode
3435;
3436AMB11: MOV CX,BX ;save avail paraghs for compare
3437;
3438 TEST COM_STATE,COM_RESS ;check if resident mode is active
3439 JNE AMB12 ; if yes, reserve room required
3440 ; memory for view, copy,,,
3441 ; if not, DOS funcs in shell will
3442 ; automatically allocate memory
3443 ; as needed
3444;
3445 CMP BX,MAX_DOSWBUF ;10K remaining?
3446 JB AMB_ERR ;no, error
3447;
3448 SUB BX,MAX_DOSWBUF ;reserve working memory for copy
3449 ; and view functions (10KB)
3450;
3451; Check for minimum storage to run DOS Services
3452;
3453AMB12: MOV TMP_DOSWBUF,MAX_DOSWBUF ;max work buffer
3454 MOV TMP_DIRBUF,MAX_DIR1BUF ;max directory buffer
3455;
3456 CALL CHK_MINDOS ;check for minimum DOS
3457 JNC AMB30 ;OK to allocate
3458;
3459 TEST COM_STATE2,COM_BUFO ;/B specified?
3460 JZ AMB14 ;no, try for minimum system
3461;
3462 CMP COM_DFSIZE,SM_FILEBUF ;User specified a small file buf?
3463 JA AMB_ERR ;no, /B just too large
3464;
3465AMB14: MOV TMP_DOSWBUF,MIN_DOSWBUF ;min work buffer
3466 MOV TMP_DIRBUF,MIN_DIR1BUF ;min directory buffer
3467 TEST COM_STATE,COM_RESS ;resident mode?
3468 JNZ AMB16 ;yes, no need to adjust avail stg
3469;
3470 ADD BX,MAX_DOSWBUF ;change from 16K
3471 SUB BX,MIN_DOSWBUF ; to 8K for View/Copy buffer
3472;
3473AMB16: CALL CHK_MINDOS ;check for absolutely minimum DOS
3474 JNC AMB30 ;OK to allocate
3475;
3476AMB_ERR: MOV COM_ERRID,ERR_INSM ;insufficent memory available
3477 JMP AMBEXIT
3478;
3479; Allocate required shell memory
3480;
3481AMB30: XOR AX,AX
3482 MOV AH,48H ;set allocate function number
3483 INT 21H ;allocate memory
3484 JNC AMB40 ;check for error
3485;
3486 MOV COM_ERRID,ERR_INSM ;insufficent memory available
3487 JMP AMBEXIT
3488;
3489; Check if resident mode active and preallocate working DOS buffers
3490;
3491AMB40: MOV CX,AX ;save beginning segment
3492;
3493 TEST COM_STATE,COM_RESS ;check if resident mode is active
3494 JE AMB70 ; if yes, pre-allocate required
3495 ; memory for view, copy,,,
3496 ; if not, DOS funcs in shell will
3497 ; automatically allocate memory
3498 ; as needed
3499;
3500 TEST COM_STATE,COM_APPM ;check if app menu active
3501 JNE AMB60
3502;
3503 MOV COM_DATA8SEG,CX ;set segment of DOS work buffer
3504 MOV COM_DATA8OFF,0 ;offset starts at zero
3505 MOV AX,TMP_DOSWBUF ;calculate length of buffer
3506 MOV BX,16 ; in bytes
3507 SUB COM_DFSIZE,AX ;adjust remaining paragraphs
3508 MUL BX
3509 MOV COM_DATA8LEN,AX
3510 ADD CX,MAX_DOSWBUF ;adjust segment
3511 JMP AMB70
3512;
3513AMB60: MOV AX,COM_DATA3SEG ;reuse app menu buffer
3514 MOV COM_DATA8SEG,AX ;set segment
3515 MOV AX,COM_DATA3OFF
3516 MOV COM_DATA8OFF,AX ;set offset
3517 MOV AX,COM_DATA3LEN ;set DOS working buffer size in
3518 MOV COM_DATA8LEN,AX ; bytes
3519;
3520; Use next available memory for dir buffer 1 and 2
3521;
3522AMB70: MOV COM_DATA4SEG,CX ;set segment of directory list 1
3523 MOV COM_DATA4OFF,0 ;offset starts at zero
3524 MOV AX,TMP_DIRBUF ;calculate length of buffer
3525 ADD CX,AX ;adjust new segment
3526 SUB COM_DFSIZE,AX ;adjust remaining paragraphs
3527 MOV BX,16
3528 MUL BX
3529 MOV COM_DATA4LEN,AX ;set length in paragraphs
3530;
3531 TEST COM_STATE,COM_DRV2 ;check if multiple drive display
3532 JE AMB80 ; active
3533;
3534 MOV COM_DATA5SEG,CX ;set segment of directory list 2
3535 MOV COM_DATA5OFF,0 ;offset starts at zero
3536 MOV AX,TMP_DIRBUF ;calculate length of buffer
3537 ADD CX,AX ;adjust new segment
3538 SUB COM_DFSIZE,AX ;adjust remaining paragraphs
3539 MOV BX,16
3540 MUL BX
3541 MOV COM_DATA5LEN,AX ;set length in paragraphs
3542;
3543; Use remaining memory for file buffers 1 and 2
3544;
3545AMB80: MOV COM_DATA6SEG,CX ;set segment of file buf 1
3546 MOV COM_DATA6OFF,0 ;offset starts at zero
3547;
3548 MOV AX,COM_DFSIZE ;get remaining buffer
3549;
3550 TEST COM_STATE,COM_DRV2 ;check if multiple drive display
3551 JE AMB90 ; active
3552;
3553 SHR AX,1 ;divide remaining buffer by 2
3554;
3555AMB90: MOV COM_DATA6LEN,AX ;set file buffer 1 len in paraghs
3556 ADD CX,AX ;adjust new segment
3557 SUB COM_DFSIZE,AX ;adjust remaining buffer paraghs
3558;
3559 TEST COM_STATE,COM_DRV2 ;check if multiple drive display
3560 JE AMBEXIT ; active
3561;
3562 MOV COM_DATA7SEG,CX ;set segment of file buf 2
3563 MOV COM_DATA7OFF,0 ;offset starts at zero
3564 MOV AX,COM_DFSIZE ;set # parags in file buf 2
3565 MOV COM_DATA7LEN,AX
3566;
3567AMBEXIT: ;exit
3568;
3569 RET
3570ALLOCATE_BUFB ENDP
3571;
3572PAGE
3573;
3574;-----------------------------------------------------------------------------+
3575; :
3576; Name: CHK_MINDOS :
3577; :
3578; Description: Check for enough storage to run minimum DOS Services. :
3579; :
3580; Entry: TMP_DOSWBUF - Size of DOS work buffer :
3581; TMP_DIRBUF - Size of DOS directory buffer :
3582; COM_DFSIZE - User specified file buffer size :
3583; BX - Maximum memory available :
3584; :
3585; Exit: Carry flag set :
3586; :
3587; Entry point: CHK_MINDOS :
3588; :
3589; Notes: None. :
3590; :
3591; Internal references: None :
3592; :
3593; External references: None :
3594; :
3595;-----------------------------------------------------------------------------+
3596;
3597CHK_MINDOS PROC NEAR
3598;
3599 XOR AX,AX ;clear out
3600 TEST COM_STATE,COM_RESS ;resident mode?
3601 JZ CHS14 ;no, storage already adjusted
3602;
3603 TEST COM_STATE,COM_APPM ;appl configured?
3604 JNZ CHS14 ;yes, reuse appl workarea
3605;
3606 ADD AX,TMP_DOSWBUF ;10K or 8K for View/Copy buffer
3607;
3608CHS14: ADD AX,TMP_DIRBUF ;8K or 4K for first dir buffer
3609 TEST COM_STATE,COM_DRV2 ;multiple buffers configured?
3610 JZ CHS16 ;no, no second buffer needed
3611;
3612 ADD AX,TMP_DIRBUF ;8K or 4K for second dir buffer
3613;
3614CHS16: TEST COM_STATE2,COM_BUFO ;/B specified?
3615 JZ CHS18 ;no, add in for min file buffer
3616;
3617 ADD AX,COM_DFSIZE ;update total storage needed
3618 CMP BX,AX ;is storage available?
3619 JA CHS17 ;yes
3620;
3621 SUB AX,COM_DFSIZE ;back out and use all of storage
3622 JMP CHS18 ;continue
3623
3624; JB CHS_ERR ;no, display error message
3625;
3626CHS17: MOV BX,AX ;set to allocate storage
3627 JMP CHS20
3628;
3629CHS18: ADD AX,MIN_FILEBUF ;minimun file buffer to alloc
3630 CMP BX,AX ;is storage available
3631 JB CHS_ERR ;no, display error message
3632;
3633CHS20: MOV COM_DFSIZE,BX ;set to allocate all avail storage
3634 JMP CHS_OK
3635;
3636CHS_ERR: STC ;error
3637 JMP CHS_RET
3638;
3639CHS_OK: CLC ;OK
3640
3641CHS_RET: ;exit
3642;
3643 RET
3644CHK_MINDOS ENDP
3645;
3646PAGE
3647;-----------------------------------------------------------------------------+
3648; :
3649; Name: MANAGE_ERROR :
3650; :
3651; Description: Manage error messages. :
3652; :
3653; Entry: COM_ERRID = ID number of error message. :
3654; :
3655; Exit: None. :
3656; :
3657; Entry point: MANAGE_ERROR :
3658; :
3659; Notes: None. :
3660; :
3661; Internal references: GET_ERROR :
3662; :
3663; External references: INT 21H AH=09H Print string to standard output. :
3664; :
3665;-----------------------------------------------------------------------------+
3666;
3667MANAGE_ERROR PROC NEAR
3668;
3669; Process critcal error messages before initialization is complete
3670;
3671 CALL SET_DOSVMSHL ;set DOS video mode from shell
3672 ; video mode
3673;
3674 MOV AX,COM_ERRID ;calculate offset into error
3675 CALL FAR PTR GET_ERROR
3676;
3677 PUSH DS ;save data segment address
3678;
3679 MOV CX,AX ;set message length
3680 MOV DX,DI ;set message offset
3681 MOV AX,ES ;set message segment
3682 MOV DS,AX
3683;
3684 XOR AX,AX ;clear to zero
3685 MOV AH,40H ;set print string function number
3686 MOV BX,1 ;standard output
3687 INT 21H ;print string
3688;
3689 MOV AH,06 ;print <CR> to screen
3690 MOV DL,CR
3691 INT 21H
3692;
3693 MOV AH,06 ;print <LF> to screen
3694 MOV DL,LF
3695 INT 21H
3696;
3697 POP DS ;restore data segment address
3698;
3699 RET
3700MANAGE_ERROR ENDP
3701;
3702PAGE
3703;-----------------------------------------------------------------------------+
3704; :
3705; Name: EXAMINE_PSP :
3706; :
3707; Description: Examine Program Segment Prefix string for current :
3708; SHELLRD.EXE invocation parameters. :
3709; :
3710; Entry: PSP initialized. :
3711; :
3712; Exit: COM_STATE = Option word indicating invocation :
3713; parameters passed through PSP. :
3714; :
3715; Label Bit Description :
3716; -------- --- ----------------------------------- :
3717; COM_APPM 0 0= Application menu not configured. :
3718; 1= Application menu configured. :
3719; COM_DOSS 1 0= DOS Services not configured. :
3720; 1= DOS Services configured. :
3721; COM_REFD 2 0= Do not refresh directory buffer :
3722; during command line or PEC execution:
3723; 1= Refresh directory buffer during :
3724; command line or PEC execution. :
3725; COM_RESS 3 0= Transient shell. :
3726; 1= Resident shell. :
3727; COM_AUTI 4 0= Automatic predefined menu :
3728; installation is not active. :
3729; 1= Automatic predefined menu :
3730; installation is active. :
3731; COM_DRV2 5 0= Multiple drive buffer not active. :
3732; 1= Multiple drive buffer active. :
3733; COM_FLCL 6 0= Command line access is not active. :
3734; 1= Command line access is active. :
3735; COM_FLMI 7 0= Maintain menu item access is not :
3736; active. :
3737; 1= Maintain menu item access is active.:
3738; COM_FLCS 8 0= Maintain color selections access is :
3739; not active. :
3740; 1= Maintain color selections access is :
3741; active. :
3742; COM_FLED 9 0= Exit to DOS is not active. :
3743; 1= Exit to DOS is active. :
3744; COM_MOUS 10 0= Mouse is not active. :
3745; 1= Mouse is active. :
3746; COM_LFMS 11 0= Right hand mouse. :
3747; 1= Left hand mouse. :
3748; COM_M10H 12 0= No function assigned. :
3749; 1= Graphics EGA mode 10H requested :
3750; COM_M11H 13 0= No function assigned. :
3751; 1= Graphics VGA/MCGA mode 11H requested:
3752; COM_M12H 14 0= No function assigned. :
3753; 1= Graphics VGA mode 12H requested :
3754; COM_TEXT 15 0= No function assigned. :
3755; 1= Text mode is requested. :
3756; :
3757; COM_STATE2 = Option word indicating invocation :
3758; parameters passed through PSP. :
3759; :
3760; Label Bit Description :
3761; -------- --- ----------------------------------- :
3762; COM_SOUD 0 0= Sound not active. :
3763; 1= Sound active. :
3764; :
3765; COM_NLS 1 0= Not active. :
3766; 1= NLS help index display option active:
3767; :
3768; COM_DFSAV 2 0= Not active. :
3769; 1= Directory and file save active. :
3770; :
3771; COM_BUFO 3 0= Not active. :
3772; 1= Dir/file buffer size override on. :
3773; :
3774; COM_DBCS 4 0= Not active. :
3775; 1= DBCS active. :
3776; :
3777; COM_DATE 5 0= Not active. :
3778; 1= Date/time active. :
3779; :
3780; COM_COM2 5 0= Not active. D491:
3781; 1= COM2 active. D491:
3782; :
3783; COM_DFSIZE = Size of DOS directory and file buffer :
3784; to allocate in paragraphs. Used only :
3785; if buffer override option is active :
3786; in COM_STATE2. :
3787; :
3788; COM_PSPOFF = Offset of SHELL.EXE PSP :
3789; COM_PSPSEG = Segment of SHELL.EXE PSP :
3790; :
3791; Entry point: EXAMINE_PSP :
3792; :
3793; Notes: EXAMINE_PSP is beginning overlay point for mouse :
3794; driver. :
3795; :
3796; Internal references: MANAGE_ERROR :
3797; PCINSTR_CALL :
3798; :
3799; External references: INT 21H 19H Return current drive :
3800; INT 21H 47H Return current path :
3801; :
3802;-----------------------------------------------------------------------------+
3803;
3804EXAMINE_PSP PROC NEAR
3805;
3806; Intialize to search PSP for invocation options
3807;
3808 MOV INS_OPT,0 ;set to find string
3809 MOV ES, COM_PSPSEG ;get PSP segment
3810 MOV DI, 80H ;get offset of PSP length byte
3811 MOV CL, ES:[DI] ;get PSP length byte
3812 CMP CL, 0 ;any command line options?
3813 JA EP03 ;yes, continue
3814 MOV COM_ERRID,ERR_PSP ;invalid psp command line
3815 JMP EPEXIT ;exit
3816EP03: XOR CH, CH ;clear high byte
3817 MOV SI, COM_PSPOFF ;set offset of PSP
3818 ADD SI, 81H ;get command line buffer
3819 LEA DI, EP_CMDLIN ;set offset of command line buffer
3820 MOV INS_SOFF, DI ;save offset of command buffer
3821 MOV INS_SSEG, DATA ;save segment of command buffer
3822 MOV ES, INS_SSEG ;set segment of command buffer
3823 mov dl, 0 ;init comment flag
3824 mov ins_slen, 0 ;init length of command search str
3825 mov com_cmdact, 0 ;init actual length of commands
3826 mov com_cmdnum, 0 ;init length of commands found
3827;
3828EP034: PUSH DS ;save data seg
3829 MOV DS, COM_PSPSEG ;PSP segment is source seg
3830 mov al, ds:[si] ;
3831 POP DS ;
3832;
3833 cmp al, ' ' ;
3834 jbe ep039 ;
3835;
3836 cmp al, '{' ;
3837 jne ep037 ;
3838 mov dl, 1 ;
3839 jmp ep039 ;
3840;
3841EP037: cmp al, '}' ;
3842 jne ep038 ;
3843 mov dl, 0 ;
3844 jmp ep039 ;
3845;
3846EP038: cmp dl, 1 ;
3847 je ep039 ;
3848;
3849 cmp al, 'a' ;
3850 jb ep0385 ;
3851 cmp al, 'z' ;
3852 ja ep0385 ;
3853 sub al, 32 ;
3854;
3855ep0385: mov es:[di], al ;
3856 inc ins_slen ;
3857 inc com_cmdact ;
3858 inc di ;
3859;
3860ep039: inc si ;
3861 loop ep034 ;
3862;
3863 MOV EP_ENDOFF, DI ;set offset of last byte in buffer
3864;
3865; Check for profile filename /PRO:filename.PRO
3866;
3867EP1900: XOR AX,AX ;get current drive
3868 MOV AH,19H
3869 INT 21H
3870 ADD AL,65 ;convert from # to alpha char
3871 MOV COM_RFILSPEC,AL ;complete current drive and path
3872;
3873 MOV AH,47H ;read current path
3874 MOV DL,0
3875 LEA SI,COM_RFILSPEC+3 ;point past C:\
3876 INT 21H
3877 JNC EP1910 ;check for error
3878;
3879 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
3880 JMP EPEXIT
3881;
3882EP1910: MOV AX,STR_PROFACT ;profile active
3883 CALL CHECK_STRING ;search for string
3884 CMP INS_RSLT,0 ;check if not found, error
3885 JG EP1920
3886;
3887 JMP EP05 ;profile not active get next var
3888;
3889EP1920: ADD COM_CMDNUM,AX
3890;
3891 PUSH INS_FOFF ;save invocation parameter offset
3892;
3893 MOV CX,INS_RSLT ;save starting search point
3894 ADD CX,INS_FLEN ;point past /PRO: to beginning of
3895 ; profile file name
3896;
3897 MOV AX,STR_PROEXT ;profile extension
3898 CALL FAR PTR GET_STRING
3899;
3900 MOV INS_FLEN,AX ;length of find string
3901 MOV INS_FOFF,DI ;offset of find string '.PRO'
3902 MOV INS_FSEG,ES ;segment of string
3903 CALL PCINSTR_CALL ;search for string
3904;
3905 POP INS_FOFF ;restore before exit
3906;
3907 CMP INS_RSLT,0
3908 JG EP1930
3909;
3910 MOV COM_ERRID,ERR_MOUS ;invalid profile file
3911 JMP EPEXIT
3912;
3913EP1930: PUSH SI
3914 PUSH DS
3915;
3916 MOV AX,INS_RSLT
3917 SUB AX,CX ;ending offset - starting offset
3918 ADD AX,INS_FLEN ; + length of extension = # bytes
3919 ; to move
3920 ADD COM_CMDNUM,AX ;
3921 MOV BX,INS_SOFF ;calculate offset of source strg
3922 ADD BX,CX ; to move
3923 DEC BX
3924;
3925 PUSH BX ;save source offset
3926 PUSH INS_SSEG ;save source segment
3927;
3928 MOV CX,AX ; = number of bytes to move
3929 LEA DI,COM_RFILSPEC ;get dest offset
3930;
3931 PUSH DS
3932 PUSH ES
3933 POP DS
3934 POP ES
3935;
3936EP1940: MOV AL,ES:[DI] ;locate end of drive and path
3937 CMP AL,0 ; in shell profile name buffer
3938 JE EP1980
3939;
3940 INC DI ;point to next character
3941 JMP EP1940
3942;
3943EP1980: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
3944 JE EP1990 ; file separator
3945;
3946 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
3947 INC DI ;point to where filename goes
3948;
3949EP1990: POP DS ;now move profile filename string
3950 POP SI ; to end of profile buffer path
3951;
3952 REP MOVSB ;copy profile filespec
3953;
3954 POP DS
3955 POP SI
3956;
3957; Open profile file
3958;
3959 MOV AH, 3DH ;DOS open handle
3960 MOV AL, 010B ;open for read/write
3961 LEA DX, COM_RFILSPEC ;set offset of profile filename
3962 INT 21H ;open profile file
3963 JNC EP_1992 ;continue if no error
3964 MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open
3965 JMP EPEXIT
3966;
3967; Read profile file to command buffer ;
3968;
3969ep_1992: mov dl, 0
3970 mov di, ep_endoff
3971 MOV BX, AX ;set file handle
3972;
3973ep_1993: push dx
3974 MOV AH, 3FH ;DOS read handle
3975 mov cx, 1
3976 lea dx, gen_data
3977 INT 21H ;read profile into buffer
3978 JNC EP_1994 ;continue if no error
3979 pop dx
3980 MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open
3981 JMP EPEXIT
3982
3983EP_1994: ; ADD INS_SLEN, AX ;
3984
3985
3986epx034:
3987 cmp ax, 0 ;
3988 ja epx035
3989;
3990 pop dx
3991 jmp ep1995
3992;
3993epx035: pop dx
3994;
3995 mov al, byte ptr gen_data ;
3996;
3997 cmp al, ' ' ;
3998 jbe epx039 ;
3999;
4000 cmp al, '{' ;
4001 jne epx037 ;
4002 mov dl, 1 ;
4003 jmp epx039 ;
4004;
4005epx037: cmp al, '}' ;
4006 jne epx038 ;
4007 mov dl, 0 ;
4008 jmp epx039 ;
4009;
4010epx038: cmp dl, 1 ;
4011 je epx039 ;
4012;
4013 cmp al, 'a' ;
4014 jb epx0385 ;
4015 cmp al, 'z' ;
4016 ja epx0385 ;
4017 sub al, 32 ;
4018;
4019epx0385: mov [di], al ;
4020 inc ins_slen ;
4021 inc com_cmdact ;
4022 inc di ;
4023;
4024epx039: jmp ep_1993 ;
4025;
4026; Close profile handle
4027;
4028EP1995: MOV AH, 3EH ;
4029 INT 21H ;close handle
4030 JNC EP05 ;continue if no error
4031 MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open
4032 JMP EPEXIT
4033;
4034; Convert command string alpha to upper case
4035;
4036EP05: MOV ES,INS_SSEG ;get PSP command line segment
4037 MOV DI,INS_SOFF ;point to PSP command line string
4038 MOV CX,INS_SLEN ;get length of PSP
4039;
4040 MOV COM_STATE, 0 ;
4041 MOV COM_STATE2,0 ;initialize to zero
4042;
4043 MOV AX,STR_CDON ;
4044 CALL CHECK_STRING ;
4045 CMP INS_RSLT,0 ;
4046 JE EP2510 ;
4047 ADD COM_CMDNUM,AX ;
4048 OR COM_CONFIRM, COM_CONFDEL ;
4049ep2510:
4050 MOV AX,STR_CDOFF ;
4051 CALL CHECK_STRING ;
4052 CMP INS_RSLT,0 ;
4053 JE EP2511 ;
4054 ADD COM_CMDNUM,AX ;
4055 AND COM_CONFIRM,NOT COM_CONFDEL
4056ep2511:
4057 MOV AX,STR_CRON ;
4058 CALL CHECK_STRING ;
4059 CMP INS_RSLT,0 ;
4060 JE EP2520 ;
4061 ADD COM_CMDNUM,AX ;
4062 OR COM_CONFIRM, COM_CONFREPL;
4063ep2520:
4064 MOV AX,STR_CROFF ;
4065 CALL CHECK_STRING ;
4066 CMP INS_RSLT,0 ;
4067 JE EP2521 ;
4068 ADD COM_CMDNUM,AX ;
4069 AND COM_CONFIRM,NOT COM_CONFREPL
4070ep2521:
4071 MOV AX,STR_ASON ;
4072 CALL CHECK_STRING ;
4073 CMP INS_RSLT,0 ;
4074 JE EP2530 ;
4075 ADD COM_CMDNUM,AX ;
4076 OR COM_CONFIRM, COM_ALLOWSEL;
4077ep2530:
4078 MOV AX,STR_ASOFF ;
4079 CALL CHECK_STRING ;
4080 CMP INS_RSLT,0 ;
4081 JE EP2540 ;
4082 ADD COM_CMDNUM,AX ;
4083 AND COM_CONFIRM,NOT COM_ALLOWSEL
4084ep2540:
4085 MOV AX,STR_SBNAME ;
4086 CALL CHECK_STRING ;
4087 CMP INS_RSLT,0 ;
4088 JE EP2550 ;
4089 ADD COM_CMDNUM,AX ;
4090 MOV SORTSTAT, SST_NAME ;
4091 JMP EP2590
4092ep2550:
4093 MOV AX,STR_SBEXT ;
4094 CALL CHECK_STRING ;
4095 CMP INS_RSLT,0 ;
4096 JE EP2560 ;
4097 ADD COM_CMDNUM,AX ;
4098 MOV SORTSTAT, SST_EXT ;
4099 JMP EP2590
4100ep2560:
4101 MOV AX,STR_SBSIZE ;
4102 CALL CHECK_STRING ;
4103 CMP INS_RSLT,0 ;
4104 JE EP2570 ;
4105 ADD COM_CMDNUM,AX ;
4106 MOV SORTSTAT, SST_SIZE ;
4107 JMP EP2590
4108ep2570:
4109 MOV AX,STR_SBDATE ;
4110 CALL CHECK_STRING ;
4111 CMP INS_RSLT,0 ;
4112 JE EP2580 ;
4113 ADD COM_CMDNUM,AX ;
4114 MOV SORTSTAT, SST_DATE ;
4115 JMP EP2590
4116ep2580:
4117 MOV AX,STR_SBDISK ;
4118 CALL CHECK_STRING ;
4119 CMP INS_RSLT,0 ;
4120 JE EP2590 ;
4121 ADD COM_CMDNUM,AX ;
4122 MOV SORTSTAT, 0 ;
4123ep2590:
4124;
4125; Check for NLS translation option for help index display
4126;
4127 MOV AX,STR_NLS ;NLS configured
4128 CALL CHECK_STRING ;search for string
4129 CMP INS_RSLT,0
4130 JE EP25
4131;
4132 ADD COM_CMDNUM,AX ;add length to found length
4133 OR COM_STATE2,COM_NLS ;app menu configured
4134;
4135; Check for application menu option
4136;
4137EP25: MOV AX,STR_APPMENU ;app menu configured
4138 CALL CHECK_STRING ;search for string
4139 CMP INS_RSLT,0
4140 JE EP30
4141;
4142 ADD COM_CMDNUM,AX
4143 OR COM_STATE,COM_APPM ;app menu configured
4144;
4145; Check for DOS Services option
4146;
4147EP30: MOV AX,STR_DOSSERV ;DOS services configured
4148 CALL CHECK_STRING ;search for string
4149 CMP INS_RSLT,0
4150 JE EP50
4151;
4152 ADD COM_CMDNUM,AX
4153 OR COM_STATE,COM_DOSS ;DOS services configured
4154;
4155; Check for transient mode operation
4156;
4157EP50: MOV AX,STR_TRANS ;transient shell configured
4158 CALL CHECK_STRING ;search for string
4159 CMP INS_RSLT,0
4160 JNE EP51
4161;
4162 OR COM_STATE,COM_RESS ;resident shell configured
4163 JMP EP60
4164;
4165EP51: ADD COM_CMDNUM,AX
4166;
4167; Check for hi-res graphics mode operation = Mode 10
4168;
4169EP60: MOV AX,STR_MODE10H ;graphics mode 10H
4170 CALL CHECK_STRING ;search for string
4171 CMP INS_RSLT,0
4172 JE EP62
4173;
4174 ADD COM_CMDNUM,AX
4175 OR COM_STATE,COM_M10H ;activate graphics mode flag
4176 JMP EP74
4177;
4178; Check for hi-res graphics mode operation = Mode 11
4179;
4180EP62: MOV AX,STR_MODE11H ;graphics mode 11H
4181 CALL CHECK_STRING ;search for string
4182 CMP INS_RSLT,0
4183 JE EP64
4184;
4185 ADD COM_CMDNUM,AX
4186 OR COM_STATE,COM_M11H ;activate graphics mode flag
4187 JMP EP74
4188;
4189; Check for hi-res graphics mode operation = Mode 12
4190;
4191EP64: MOV AX,STR_MODE12H ;graphics mode 12H
4192 CALL CHECK_STRING ;search for string
4193 CMP INS_RSLT,0
4194 JE EP65
4195;
4196 ADD COM_CMDNUM,AX
4197 OR COM_STATE,COM_M12H ;activate graphics mode flag
4198 JMP EP74
4199;
4200; Check for text mode operation = Mode 7 or 3
4201;
4202EP65: MOV AX,STR_TEXTS ;graphics mode 12H
4203 CALL CHECK_STRING ;search for string
4204 CMP INS_RSLT,0
4205 JE EP66
4206;
4207 ADD COM_CMDNUM,AX
4208 OR COM_STATE,COM_TEXT ;activate text mode flag
4209 JMP EP74
4210;
4211; User did not set desired video mode, default to highest available
4212;
4213EP66: CMP GE_MODEL,MODEL_30 ;check if model 25 and 30
4214 JNE EP68
4215;
4216 CMP GE_SUBMODEL,SUBMD_30
4217 JE EP67
4218;
4219 CMP GE_SUBMODEL,SUBMD_25
4220 JNE EP68
4221;
4222EP67: OR COM_STATE,COM_M11H ;default to mode 11H
4223 JMP EP74
4224;
4225; Check for VGA video
4226;
4227EP68: MOV AX,1A00H ;BIOS check display
4228 INT 10H ;
4229 CMP AL,1AH ;VGA supported?
4230 JNE EP686 ;no, continue
4231;
4232; VGA video, check for INFOWINDOW display
4233;
4234 CMP BL, 4 ;infowindow display?
4235 JNE EP685 ;no, continue
4236;
4237 OR COM_STATE, COM_M10H ;mode for VGA with infowindow
4238 JMP EP74 ;continue
4239;
4240; VGA video, non-INFOWINDOW, set highest available mode
4241;
4242EP685: MOV AH, 1BH
4243 MOV BX, 0
4244 PUSH DS
4245 POP ES
4246 LEA DI, GEN_DATA
4247 INT 10H
4248 PUSH ES:[DI]
4249 PUSH ES:[DI+2]
4250 POP ES
4251 POP DI
4252;
4253 TEST BYTE PTR ES:[DI+2], 00000100B
4254 JZ EP6851
4255 OR COM_STATE, COM_M12H
4256 JMP EP74
4257EP6851: TEST BYTE PTR ES:[DI+2], 00000010B
4258 JZ EP6852
4259 OR COM_STATE, COM_M11H
4260 JMP EP74
4261EP6852: TEST BYTE PTR ES:[DI+2], 00000001B
4262 JZ EP6853
4263 OR COM_STATE, COM_M10H
4264 JMP EP74
4265EP6853: OR COM_STATE, COM_TEXT
4266 JMP EP74
4267;
4268; Check for EGA video
4269;
4270EP686: MOV AH,12H ;BIOS alternate select
4271 MOV BL,10H ;return EGA info
4272 INT 10H ;
4273 CMP BL,10H ;EGA video?
4274 JNE EP687 ;yes, continue
4275;
4276; CGA or Monochrome video
4277;
4278 OR COM_STATE,COM_TEXT ;text mode operation
4279 JMP EP74 ;continue
4280;
4281; EGA video, check for sufficient memory for mode 10
4282;
4283EP687: CMP BL,3H ;256K available?
4284 JAE EP688 ;yes, continue
4285;
4286 OR COM_STATE,COM_TEXT ;ega has no memory for mode 10
4287 JMP EP74 ;continue
4288;
4289; EGA with 256K, check for cga or monochrome emulation
4290;
4291EP688: AND CL,1111B ;save registers
4292 CMP CL,9
4293 JE EP689
4294;
4295; EGA emulating CGA or Monochrome
4296;
4297 OR COM_STATE,COM_TEXT
4298 JMP EP74
4299;
4300; EGA in EGA mode
4301;
4302EP689: OR COM_STATE,COM_M10H
4303;
4304; Check for application main menu filename
4305;
4306EP74: TEST COM_STATE,COM_APPM ;if app menu not configured do not
4307 JNE EP75 ; search for app main menu filespc
4308;
4309 MOV AX,STR_APMFILE ;app main menu filename
4310 CALL CHECK_STRING ;search for string
4311 CALL PCINSTR_CALL
4312 CMP INS_RSLT,0 ;check if parameter found
4313 JG EP75
4314;
4315 JMP EP112 ;check next parameter
4316;
4317EP75: XOR AX,AX ;get current drive
4318 MOV AH,19H
4319 INT 21H
4320 ADD AL,65 ;convert from # to alpha char
4321 MOV APP_MFILSPEC,AL ;complete current drive and path
4322;
4323 MOV AH,47H ;read current path
4324 MOV DL,0
4325 LEA SI,APP_MFILSPEC+3 ;point past C:\
4326 INT 21H
4327 JNC EP78 ;check for error
4328;
4329 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
4330 JMP EPEXIT
4331;
4332EP78: MOV AX,STR_APMFILE ;app main menu filename
4333 CALL CHECK_STRING ;search for string
4334 CMP INS_RSLT,0
4335 JG EP80
4336;
4337 MOV AX,STR_APPMFILE ;default app menu filename
4338 CALL FAR PTR GET_STRING ;user did not supply new app menu
4339;
4340 PUSH SI ;save data segment
4341 PUSH DS
4342;
4343 PUSH DI ;save filename offset
4344 PUSH ES ;save filename segment
4345;
4346 JMP EP92 ; SHELL.MEU file instead
4347;
4348EP80: PUSH INS_FOFF ;save invocation parameter offset
4349 ADD COM_CMDNUM,AX
4350;
4351 MOV CX,INS_RSLT ;save starting search point
4352 ADD CX,INS_FLEN ;point past /MEU: to beginning of
4353 ; menu file name
4354 MOV AX,STR_AAPEXT ;main application menu extension
4355 CALL FAR PTR GET_STRING
4356;
4357 MOV INS_FLEN,AX ;length of string
4358 MOV INS_FOFF,DI ;offset of string '.MEU'
4359 MOV INS_FSEG,ES ;segment of string
4360 CALL PCINSTR_CALL ;search for string
4361;
4362 POP INS_FOFF
4363;
4364 CMP INS_RSLT,0
4365 JG EP90
4366;
4367 MOV COM_ERRID,ERR_APIF ;invalid main app menu filename
4368 JMP EPEXIT
4369;
4370EP90: PUSH SI ;save data segment
4371 PUSH DS
4372;
4373 MOV AX,INS_RSLT
4374 SUB AX,CX ;ending offset - starting offset
4375 ADD AX,INS_FLEN ; + length of extension = # bytes
4376 ; to move
4377 ADD COM_CMDNUM,AX
4378;
4379 MOV BX,INS_SOFF ;calculate offset of source strg
4380 ADD BX,CX ; to move
4381 DEC BX
4382;
4383 PUSH BX ;save source offset
4384 PUSH INS_SSEG ;save source segment
4385;
4386EP92: MOV CX,AX ; = number of bytes to move
4387 LEA DI,APP_MFILSPEC ;get dest offset
4388;
4389 PUSH DS
4390 PUSH ES
4391 POP DS
4392 POP ES
4393;
4394EP94: MOV AL,ES:[DI] ;locate end of drive and path
4395 CMP AL,0 ; in shell app menu file buffer
4396 JE EP98
4397;
4398 INC DI ;point to next character
4399 JMP EP94
4400;
4401EP98: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4402 JE EP99 ; file separator
4403;
4404 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4405 INC DI ;point to where filename goes
4406;
4407EP99: POP DS ;now move shell menu filename to
4408 POP SI ; end of app menu file path
4409;
4410 REP MOVSB ;copy application menu filespec
4411;
4412 POP DS
4413 POP SI
4414;
4415; Move copy of menu filename to first menu buffer
4416;
4417EP100: MOV AX,STR_APMFILE ;app main menu filename
4418 CALL CHECK_STRING ;search for string
4419 CMP INS_RSLT,0
4420 JG EP103
4421;
4422 MOV AX,STR_APPMFILE ;default app menu filename
4423 CALL FAR PTR GET_STRING ;user did not supply new app menu
4424;
4425 PUSH SI ;save data segment
4426 PUSH DS
4427;
4428 PUSH DI ;save filename offset
4429 PUSH ES ;save filename segment
4430;
4431 JMP EP105 ; SHELL.MEU file instead
4432;
4433EP103: PUSH INS_FOFF ;save invocation parameter offset
4434;
4435 MOV CX,INS_RSLT ;save starting search point
4436 ADD CX,INS_FLEN ;point past /MEU: to beginning of
4437 ; menu file name
4438 MOV AX,STR_AAPEXT ;main application menu extension
4439 CALL FAR PTR GET_STRING
4440;
4441 MOV INS_FLEN,AX ;length of string
4442 MOV INS_FOFF,DI ;offset of string '.MEU'
4443 MOV INS_FSEG,ES ;segment of string
4444 CALL PCINSTR_CALL ;search for string
4445;
4446 POP INS_FOFF
4447;
4448 CMP INS_RSLT,0
4449 JG EP104
4450;
4451 MOV COM_ERRID,ERR_APIF ;invalid main app menu filename
4452 JMP EPEXIT
4453;
4454EP104: PUSH SI ;save data segment
4455 PUSH DS
4456;
4457 MOV AX,INS_RSLT
4458 SUB AX,CX ;ending offset - starting offset
4459 ADD AX,INS_FLEN ; + length of extension = # bytes
4460 ; to move
4461;
4462 MOV BX,INS_SOFF ;calculate offset of source strg
4463 ADD BX,CX ; to move
4464 DEC BX
4465;
4466 PUSH BX ;save source offset
4467 PUSH INS_SSEG ;save source segment
4468;
4469EP105: MOV CX,AX ; = number of bytes to move
4470 LEA DI,APP_MFILNAME ;get dest offset
4471;
4472 PUSH DS
4473 PUSH ES
4474 POP DS
4475 POP ES
4476;
4477EP108: POP DS ;now move shell menu filename to
4478 POP SI ; end of app menu file path
4479;
4480 REP MOVSB ;copy application menu filespec
4481;
4482 POP DS
4483 POP SI
4484;
4485; Check for color filename
4486;
4487EP112: XOR AX,AX ;get current drive
4488 MOV AH,19H
4489 INT 21H
4490 ADD AL,65 ;convert from # to alpha char
4491 MOV COM_CFILSPEC,AL ;complete current drive and path
4492;
4493 MOV AH,47H ;read current path
4494 MOV DL,0
4495 LEA SI,COM_CFILSPEC+3 ;point past C:\
4496 INT 21H
4497 JNC EP115 ;check for error
4498;
4499 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
4500 JMP EPEXIT
4501;
4502EP115: MOV AX,STR_CLFILE ;color filename
4503 CALL CHECK_STRING ;search for string
4504 CMP INS_RSLT,0 ;check if not found, error
4505 JG EP118
4506;
4507 MOV AX,STR_CLRFILE ;default color filename
4508 CALL FAR PTR GET_STRING ;user did not supply new app menu
4509;
4510 PUSH SI ;save data segment
4511 PUSH DS
4512;
4513 PUSH DI ;save offset of filename
4514 PUSH ES ;save segment of filename
4515;
4516 JMP EP122 ; SHELL.CLR file
4517;
4518EP118: PUSH INS_FOFF ;save invocation parameter offset
4519 ADD COM_CMDNUM,AX
4520;
4521 MOV CX,INS_RSLT ;save starting search point
4522 ADD CX,INS_FLEN ;point past /K: to beginning of
4523 ; color file name
4524;
4525 MOV AX,STR_CLREXT ;color profile extension
4526 CALL FAR PTR GET_STRING
4527;
4528 MOV INS_FLEN,AX ;length of find string
4529 MOV INS_FOFF,DI ;offset of find string '.CLR'
4530 MOV INS_FSEG,ES ;segment of string
4531 CALL PCINSTR_CALL ;search for string
4532;
4533 POP INS_FOFF ;restore before exit
4534;
4535 CMP INS_RSLT,0
4536 JG EP120
4537;
4538 MOV COM_ERRID,ERR_CLRF ;invalid user color profile
4539 JMP EPEXIT
4540;
4541EP120: PUSH SI
4542 PUSH DS
4543;
4544 MOV AX,INS_RSLT
4545 SUB AX,CX ;ending offset - starting offset
4546 ADD AX,INS_FLEN ; + length of extension = # bytes
4547 ; to move
4548 ADD COM_CMDNUM,AX
4549 MOV BX,INS_SOFF ;calculate offset of source strg
4550 ADD BX,CX ; to move
4551 DEC BX
4552;
4553 PUSH BX ;save source offset
4554 PUSH INS_SSEG ;save source segment
4555;
4556EP122: MOV CX,AX ; = number of bytes to move
4557 LEA DI,COM_CFILSPEC ;get dest offset
4558;
4559 PUSH DS
4560 PUSH ES
4561 POP DS
4562 POP ES
4563;
4564EP124: MOV AL,ES:[DI] ;locate end of drive and path
4565 CMP AL,0 ; in shell color file buffer
4566 JE EP128
4567;
4568 INC DI ;point to next character
4569 JMP EP124
4570;
4571EP128: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4572 JE EP129 ; file separator
4573;
4574 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4575 INC DI ;point to where filename goes
4576;
4577EP129: POP DS ;now move color filename string
4578 POP SI ; to end of color buffer path
4579;
4580 REP MOVSB ;copy color index filespec
4581;
4582 POP DS
4583 POP SI
4584;
4585; Check for multiple DOS Service drive buffers
4586;
4587EP130: MOV AX,STR_MULTIPE ;multiple drive display
4588 CALL CHECK_STRING ;search for string
4589 CMP INS_RSLT,0
4590 JE EP140
4591;
4592 ADD COM_CMDNUM,AX
4593 OR COM_STATE,COM_DRV2
4594;
4595; Check for active maintain color option
4596;
4597EP140: MOV AX,STR_CLRACT ;color active
4598 CALL CHECK_STRING ;search for string
4599 CMP INS_RSLT,0 ;
4600 JE EP150 ;
4601;
4602 ADD COM_CMDNUM,AX
4603 OR COM_STATE,COM_FLCS ;maintain color is active
4604;
4605; Check for active maintain menu option
4606;
4607EP150: MOV AX,STR_MENUACT ;menu maintainance active
4608 CALL CHECK_STRING ;search for string
4609 CMP INS_RSLT,0
4610 JE EP160
4611;
4612 ADD COM_CMDNUM,AX
4613 OR COM_STATE,COM_FLMI ;maintain menu is active
4614;
4615; Check for active exit to DOS option
4616;
4617EP160: AND FLAG_FSEXIT, NOT DIT_L1 ;turn exit to DOS dither off start
4618 AND FLAG_FDEXIT, NOT DIT_L1 ;turn exit file system dither off
4619;
4620 MOV AX,STR_EXITDOS ;exit to DOS active
4621 CALL CHECK_STRING ;search for string
4622;
4623 OR FLAG_FSEXIT, DIT_L1 ;turn exit to DOS dither on start
4624;
4625 TEST COM_STATE,COM_APPM ;app menu configured
4626 JNZ EP161 ;
4627;
4628 OR FLAG_FDEXIT, DIT_L1 ;turn exit from file system dither
4629 ; on
4630;
4631EP161: CMP INS_RSLT,0
4632 JE EP170
4633;
4634 ADD COM_CMDNUM,AX
4635 OR COM_STATE,COM_FLED ;exit to DOS is active
4636;
4637 AND FLAG_FSEXIT, NOT DIT_L1 ;turn exit to DOS dither off start
4638 AND FLAG_FDEXIT, NOT DIT_L1 ;turn exit file system dither off
4639;
4640; Check for active command line option
4641;
4642EP170: MOV AX,STR_CMDLINE ;command line active
4643 CALL CHECK_STRING ;search for string
4644 CMP INS_RSLT,0
4645 JE EP180
4646;
4647 ADD COM_CMDNUM,AX
4648 OR COM_STATE,COM_FLCL ;command line is active
4649;
4650; Check for predefined menu installation option
4651;
4652EP180: MOV AX,STR_PREDACT ;predefined menu active
4653 CALL CHECK_STRING ;search for string
4654 CMP INS_RSLT,0
4655 JE EP190
4656;
4657 ADD COM_CMDNUM,AX
4658 OR COM_STATE,COM_AUTI ;predefined is active
4659;
4660; Check for mouse filename /MOS:filename.MOS
4661;
4662EP190: XOR AX,AX ;get current drive
4663 MOV AH,19H
4664 INT 21H
4665 ADD AL,65 ;convert from # to alpha char
4666 MOV COM_VFILSPEC,AL ;complete current drive and path
4667;
4668 MOV AH,47H ;read current path
4669 MOV DL,0
4670 LEA SI,COM_VFILSPEC+3 ;point past C:\
4671 INT 21H
4672 JNC EP191 ;check for error
4673;
4674 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
4675 JMP EPEXIT
4676;
4677EP191: MOV AX,STR_MOUSACT ;mouse active
4678 CALL CHECK_STRING ;search for string
4679 CMP INS_RSLT,0 ;check if not found, error
4680 JG EP192
4681;
4682 JMP EP200 ;mouse is not active get next var
4683;
4684EP192: OR COM_STATE,COM_MOUS ;mouse is active
4685 ADD COM_CMDNUM,AX
4686;
4687 PUSH INS_FOFF ;save invocation parameter offset
4688;
4689 MOV CX,INS_RSLT ;save starting search point
4690 ADD CX,INS_FLEN ;point past /MOS: to beginning of
4691 ; mouse file name
4692;
4693 MOV AX,STR_MOSEXT ;mouse extension
4694 CALL FAR PTR GET_STRING
4695;
4696 MOV INS_FLEN,AX ;length of find string
4697 MOV INS_FOFF,DI ;offset of find string '.MOS'
4698 MOV INS_FSEG,ES ;segment of string
4699 CALL PCINSTR_CALL ;search for string
4700;
4701 POP INS_FOFF ;restore before exit
4702;
4703 CMP INS_RSLT,0
4704 JG EP193
4705;
4706 MOV COM_ERRID,ERR_MOUS ;invalid mouse driver
4707 JMP EPEXIT
4708;
4709EP193: PUSH SI
4710 PUSH DS
4711;
4712 MOV AX,INS_RSLT
4713 SUB AX,CX ;ending offset - starting offset
4714 ADD AX,INS_FLEN ; + length of extension = # bytes
4715 ; to move
4716 ADD COM_CMDNUM,AX
4717 MOV BX,INS_SOFF ;calculate offset of source strg
4718 ADD BX,CX ; to move
4719 DEC BX
4720;
4721 PUSH BX ;save source offset
4722 PUSH INS_SSEG ;save source segment
4723;
4724 MOV CX,AX ; = number of bytes to move
4725 LEA DI,COM_VFILSPEC ;get dest offset
4726;
4727 PUSH DS
4728 PUSH ES
4729 POP DS
4730 POP ES
4731;
4732EP194: MOV AL,ES:[DI] ;locate end of drive and path
4733 CMP AL,0 ; in shell mouse file buffer
4734 JE EP198
4735;
4736 INC DI ;point to next character
4737 JMP EP194
4738;
4739EP198: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4740 JE EP199 ; file separator
4741;
4742 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4743 INC DI ;point to where filename goes
4744;
4745EP199: POP DS ;now move mouse filename string
4746 POP SI ; to end of mouse buffer path
4747;
4748 REP MOVSB ;copy mouse index filespec
4749;
4750 POP DS
4751 POP SI
4752;
4753; Check for left hand mouse option
4754;
4755EP200: MOV AX,STR_LEFTACT ;left hand mouse
4756 CALL CHECK_STRING ;search for string
4757 CMP INS_RSLT,0
4758 JE EP205
4759;
4760 ADD COM_CMDNUM,AX
4761 OR COM_STATE,COM_LFMS ;left hand mouse
4762;
4763; Check for sound active option
4764;
4765EP205: MOV AX,STR_SOUDACT ;sound active
4766 CALL CHECK_STRING ;search for string
4767 CMP INS_RSLT,0
4768 JE EP207
4769;
4770 ADD COM_CMDNUM,AX
4771 OR COM_STATE2,COM_SOUD ;sound active
4772;
4773; Check for dir/file buffer save option
4774;
4775EP207: MOV AX,STR_DFSAVE ;check if option active
4776 CALL CHECK_STRING ;search for string
4777 CMP INS_RSLT,0
4778 JE EP210
4779;
4780 ADD COM_CMDNUM,AX
4781 OR COM_STATE2,COM_DFSAVE ;dir/file buffer save option
4782 ; active
4783;
4784; Save filespec of shell.hlp at COM_HFILSPEC
4785;
4786EP210: XOR AX,AX ;get current drive
4787 MOV AH,19H
4788 INT 21H
4789 ADD AL,65 ;convert from # to alpha char
4790 MOV COM_HFILSPEC,AL ;complete current drive and path
4791;
4792 MOV AH,47H ;read current path
4793 MOV DL,0
4794 LEA SI,COM_HFILSPEC+3 ;point past C:\
4795 INT 21H
4796 JNC EP250
4797;
4798 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
4799 JMP EPEXIT
4800;
4801EP250: LEA DI,COM_HFILSPEC ;get dest offset
4802;
4803 MOV AX,DS
4804 MOV ES,AX
4805;
4806EP260: MOV AL,ES:[DI] ;locate end of drive and path
4807 CMP AL,0 ; in shell help file buffer
4808 JE EP270
4809;
4810 INC DI ;point to next character
4811 JMP EP260
4812;
4813EP270: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4814 JE EP275 ; file separator
4815;
4816 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4817 INC DI ;point to where filename goes
4818;
4819EP275: PUSH DS ;save register
4820;
4821 PUSH DI
4822 MOV AX,STR_HLPFILE ;default help text filename
4823 CALL FAR PTR GET_STRING
4824 MOV SI,DI ;get offset of SHELL.HLP
4825 MOV CX,AX ;get length
4826 POP DI
4827;
4828 PUSH ES ;set source segment
4829 POP DS
4830;
4831 REP MOVSB
4832;
4833 POP DS ;restore
4834;
4835; Check for associate filename /ASC:filename.ASC
4836;
4837EP300: XOR AX,AX ;get current drive
4838 MOV AH,19H
4839 INT 21H
4840 ADD AL,65 ;convert from # to alpha char
4841 MOV COM_AFILSPEC,AL ;complete current drive and path
4842;
4843 MOV AH,47H ;read current path
4844 MOV DL,0
4845 LEA SI,COM_AFILSPEC+3 ;point past C:\
4846 INT 21H
4847 JNC EP315 ;check for error
4848;
4849 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
4850 JMP EPEXIT
4851;
4852EP315: MOV AX,STR_ASOFILE ;associate filename /ASO
4853 CALL CHECK_STRING ;search for string
4854 CMP INS_RSLT,0 ;check if not found, error
4855 JG EP318
4856;
4857 MOV AX,STR_ASCEXT ;default associate filename
4858 CALL FAR PTR GET_STRING ;user did not supply new app menu
4859;
4860 PUSH SI ;save data segment
4861 PUSH DS
4862;
4863 PUSH DI ;save offset of filename
4864 PUSH ES ;save segment of filename
4865;
4866 JMP EP322 ; SHELL.ASO file
4867;
4868EP318: PUSH INS_FOFF ;save invocation parameter offset
4869 ADD COM_CMDNUM,AX
4870;
4871 MOV CX,INS_RSLT ;save starting search point
4872 ADD CX,INS_FLEN ;point past /ASO: to beginning of
4873 ; associate file name
4874;
4875 MOV AX,STR_ASOEXT ;assoicate profile extension
4876 CALL FAR PTR GET_STRING
4877;
4878 MOV INS_FLEN,AX ;length of find string
4879 MOV INS_FOFF,DI ;offset of find string '.ASO'
4880 MOV INS_FSEG,ES ;segment of string
4881 CALL PCINSTR_CALL ;search for string
4882;
4883 POP INS_FOFF ;restore before exit
4884;
4885 CMP INS_RSLT,0
4886 JG EP320
4887;
4888 MOV COM_ERRID,ERR_ASRF ;invalid user associate profile
4889 JMP EPEXIT
4890;
4891EP320: PUSH SI
4892 PUSH DS
4893;
4894 MOV AX,INS_RSLT
4895 SUB AX,CX ;ending offset - starting offset
4896 ADD AX,INS_FLEN ; + length of extension = # bytes
4897 ; to move
4898 ADD COM_CMDNUM,AX
4899 MOV BX,INS_SOFF ;calculate offset of source strg
4900 ADD BX,CX ; to move
4901 DEC BX
4902;
4903 PUSH BX ;save source offset
4904 PUSH INS_SSEG ;save source segment
4905;
4906EP322: MOV CX,AX ; = number of bytes to move
4907 LEA DI,COM_AFILSPEC ;get dest offset
4908;
4909 PUSH DS
4910 PUSH ES
4911 POP DS
4912 POP ES
4913;
4914EP324: MOV AL,ES:[DI] ;locate end of drive and path
4915 CMP AL,0 ; in shell associate file buffer
4916 JE EP328
4917;
4918 INC DI ;point to next character
4919 JMP EP324
4920;
4921EP328: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4922 JE EP329 ; file separator
4923;
4924 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4925 INC DI ;point to where filename goes
4926;
4927EP329: POP DS ;now move filename string
4928 POP SI ; to end of buffer path
4929;
4930 REP MOVSB ;copy associate filespec
4931;
4932 POP DS
4933 POP SI
4934;
4935; Check for buffer size override
4936;
4937EP350: MOV AX,STR_BUFO ;buffer size override active
4938 CALL CHECK_STRING ;search for string
4939 CMP INS_RSLT,0
4940 JE EP390
4941;
4942 ADD COM_CMDNUM,AX
4943 MOV AX,INS_SSEG ;segment of PSP
4944 MOV ES,AX
4945 MOV BX,INS_SOFF ;offset of PSP
4946 ADD BX,INS_RSLT ;start of /B: parm
4947 ADD BX,INS_FLEN ;start of kilobyte value
4948 DEC BX ;adjust for zero offset
4949 PUSH BX
4950;
4951EP360: CMP ES:BYTE PTR[BX],'0' ;ASCII digit GE 0
4952 JB EP370 ;no, end of digits
4953;
4954 CMP ES:BYTE PTR[BX],'9' ;ASCII digit LE 9
4955 JA EP370 ;no, end of digits
4956;
4957 INC BX
4958 JMP EP360 ;check next digit
4959;
4960EP370: POP AX
4961 CMP AX,BX ;any digits?
4962 JE EP390 ;no, ignore /B parm
4963;
4964 MOV ST2_OPT1,ST2_DEC16BI+ST2_SETSTRLEN
4965 ;convert ASCII value
4966 MOV ST2_STRGSEG,ES ;segment of value
4967 MOV ST2_STRGOFF,AX ;offset of value
4968 SUB BX,AX ;calculate numbers of digits
4969 MOV ST2_STRGLEN,BX ;set length to convert
4970 ADD COM_CMDNUM,BX
4971;
4972 CALL PCST2IN_CALL ;convert the value
4973;
4974 TEST ST2_ERROR,ST2_OUTOFMEM ;value too large
4975 JNZ EP375 ;yes, set to fail during alloc
4976;
4977 CMP ST2_NUMH,0 ;value too large
4978 JNE EP375 ;yes, set to fail during alloc
4979;
4980 CMP ST2_NUML,960 ;value to large
4981 JB EP380 ;no, attempt to alloc it
4982;
4983EP375: MOV COM_DFSIZE,0F000H ;set to fail during alloc
4984 JMP EP385
4985
4986EP380: MOV AX,ST2_NUML ;get kilobyte value
4987 MOV BX,64 ;convert to paragraphs
4988 MUL BX ;kilo -> para
4989 MOV COM_DFSIZE,AX ;set value to allocate
4990
4991EP385: OR COM_STATE2,COM_BUFO ;buffer size override active
4992;
4993; Check if DBCS is active
4994;
4995EP390: MOV AX,STR_DBCS ;DBCS active
4996 CALL CHECK_STRING ;search for string
4997 CMP INS_RSLT,0
4998 JE EP395
4999;
5000 ADD COM_CMDNUM,AX
5001 OR COM_STATE2,COM_DBCS ;DBCS active
5002;
5003; Check for date/time active option
5004;
5005EP395: MOV AX,STR_DATE ;date active
5006 CALL CHECK_STRING ;search for string
5007 CMP INS_RSLT,0
5008 JE EP397
5009;
5010 ADD COM_CMDNUM,AX
5011 OR COM_STATE2,COM_DATE ;date/time active
5012;
5013; Check for COM2 active option
5014;
5015EP397: MOV AX,STR_COM2 ;COM2 active
5016 CALL CHECK_STRING ;search for string
5017 CMP INS_RSLT,0
5018 JE EP398
5019;
5020 ADD COM_CMDNUM,AX
5021 OR COM_STATE2,COM_COM2 ;COM2 active
5022;
5023; Check for enhancement activation
5024;
5025EP398: MOV AX,STR_ENH ;COM2 active
5026 CALL CHECK_STRING ;search for string
5027 CMP INS_RSLT,0 ;
5028;>>SN JE EP400
5029 JE EP399 ;>>SN
5030;
5031 ADD COM_CMDNUM,AX
5032 OR COM_STATE2,COM_ENHA ;COM2 active
5033; ;>>SN
5034; Check for Special Needs option ;>>SN
5035; ;>>SN
5036EP399: MOV AX, STR_SN ;>>SN
5037 CALL CHECK_STRING ;>>SN
5038 CMP INS_RSLT,0 ;>>SN
5039 JE EP400 ;>>SN
5040; ;>>SN
5041 ADD COM_CMDNUM, AX ;>>SN
5042 OR COM_STATE2,COM_SNA ;>>SN
5043;
5044; Check for invalid parameters
5045;
5046EP400:
5047 MOV AX, COM_CMDACT
5048 CMP AX, COM_CMDNUM
5049 JE EP405
5050;
5051 MOV COM_ERRID,ERR_BADCMD
5052 JMP EPEXIT
5053;
5054; Check for missing invocation parameter errors
5055;
5056EP405: TEST COM_STATE,COM_APPM
5057 JNE EP410
5058;
5059 TEST COM_STATE,COM_DOSS
5060 JNE EP410
5061;
5062 MOV COM_ERRID,ERR_NODA ;dos/app both not active
5063 JMP EPEXIT
5064;
5065; Turn off color selection if mode 11 active
5066;
5067EP410: TEST COM_STATE,COM_M11H ;
5068 JZ EPEXIT ;
5069;
5070 AND COM_STATE, NOT COM_FLCS ;
5071;
5072EPEXIT: ;exit
5073;
5074 RET
5075EXAMINE_PSP ENDP
5076;
5077PAGE
5078;-----------------------------------------------------------------------------+
5079; :
5080; Name: CHECK_STRING :
5081; :
5082; Description: Search for string identified by AX. :
5083; :
5084; Entry: AX = String ID. :
5085; :
5086; Exit: INS_RSLT = Offset into search string where match :
5087; found. :
5088; Entry point: CHECK_STRING :
5089; :
5090; Notes: None. :
5091; :
5092; Internal references: None. :
5093; :
5094; External references: None. :
5095; :
5096;-----------------------------------------------------------------------------+
5097;
5098CHECK_STRING PROC NEAR
5099;
5100 CALL FAR PTR GET_STRING ;get address and length of string
5101;
5102 MOV INS_SPOFF,0 ;start at beginning of command lin
5103 MOV INS_FLEN,AX ;set length of string to find
5104 MOV INS_FOFF,DI ;set offset of string to find
5105 MOV INS_FSEG,ES ;set segment of string to find
5106 CALL PCINSTR_CALL
5107;
5108CHKSEXIT: ;exit
5109;
5110 RET
5111CHECK_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 @@
1; SCCSID = @(#)dossym.asm 1.1 85/04/10
2; SCCSID = @(#)dossym.asm 1.1 85/04/10
3 PAGE 80,132
4TRUE EQU 0FFFFh
5FALSE EQU 0
6
7Installed = TRUE
8IFNDEF DEBUG
9 DEBUG = FALSE
10ENDIF
11
12include dosmac.INC
13INCLUDE VERSIONA.INC ;DEFINE THE MAJOR AND MINOR VERSION NUMBERS
14
15IF2
16 %OUT DOSSYM in Pass 2
17ENDIF
18
19BREAK <Control character definitions>
20
21c_DEL EQU 7Fh ; ASCII rubout or delete previous char
22c_BS EQU 08h ; ^H ASCII backspace
23c_CR EQU 0Dh ; ^M ASCII carriage return
24c_LF EQU 0Ah ; ^J ASCII linefeed
25c_ETB EQU 17h ; ^W ASCII end of transmission
26c_NAK EQU 15h ; ^U ASCII negative acknowledge
27c_ETX EQU 03h ; ^C ASCII end of text
28c_HT EQU 09h ; ^I ASCII tab
29
30BREAK <Read This and Weep>
31
32;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
33; ;
34; C A V E A T P R O G R A M M E R ;
35; ;
36; Certain structures, constants and system calls below are private to ;
37; the DOS and are extremely version-dependent. They may change at any ;
38; time at the implementors' whim. As a result, they must not be ;
39; documented to the general public. If an extreme case arises, they ;
40; must be documented with this warning. ;
41; ;
42; Those structures and constants that are subject to the above will be ;
43; marked and bracketed with the flag: ;
44; ;
45; C A V E A T P R O G R A M M E R ;
46; ;
47;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
48
49include bpb.INC
50
51include buffer.INC
52
53BREAK <User stack inside of system call and SysVars>
54; Location of user registers relative user stack pointer
55
56user_environ STRUC
57user_AX DW ?
58user_BX DW ?
59user_CX DW ?
60user_DX DW ?
61user_SI DW ?
62user_DI DW ?
63user_BP DW ?
64user_DS DW ?
65user_ES DW ?
66user_IP DW ?
67user_CS DW ?
68user_F DW ?
69user_environ ENDS
70
71include sysvar.INC
72
73include vector.INC
74
75;include mult.INC
76
77BREAK <Disk map>
78; MSDOS partitions the disk into 4 sections:
79;
80; phys sector 0: +-------------------+
81; | | boot/reserved |
82; | +-------------------+
83; | | File allocation |
84; v | table(s) |
85; | (multiple copies |
86; | are kept) |
87; +-------------------+
88; | Directory |
89; +-------------------+
90; | File space |
91; +-------------------+
92; | Unaddressable |
93; | (to end of disk) |
94; +-------------------+
95;
96; All partition boundaries are sector boundaries. The size of the FAT is
97; adjusted to maximize the file space addressable.
98
99include dirent.INC
100
101BREAK <File allocation Table information>
102;
103; The File Allocation Table uses a 12-bit entry for each allocation unit on
104; the disk. These entries are packed, two for every three bytes. The contents
105; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result
106; to the base address of the Allocation Table; 3) fetching the 16-bit word
107; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift
108; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex). Entry
109; number zero is used as an end-of-file trap in the OS and is passed to the
110; BIOS to help determine disk format. Entry 1 is reserved for future use.
111; The first available allocation unit is assigned entry number two, and even
112; though it is the first, is called cluster 2. Entries greater than 0FF8H
113; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero
114; are unallocated. Otherwise, the contents of a FAT entry is the number of
115; the next cluster in the file.
116;
117; Clusters with bad sectors are tagged with FF7H. Any non-zero number would
118; do because these clusters show as allocated, but are not part of any
119; allocation chain and thus will never be allocated to a file. A particular
120; number is selected so that disk checking programs know what to do (ie. a
121; cluster with entry FF7H which is not in a chain is not an error).
122
123include dpb.INC
124
125include curdir.INC
126
127;include cpmfcb.INC
128
129;include find.INC
130
131include pdb.INC
132
133include exe.INC
134
135include sf.INC
136
137include arena.INC
138
139include intnat.INC
140
141include mi.INC
142
143fChk equ 1
144fDelim equ 2
145fSpChk equ 4
146fFCB equ 8
147
148;include filemode.INC
149
150;include error.INC
151
152include syscall.INC
153
154include doscntry.inc ;J.K. 5/26/86
155
156SUBTTL
157 \ 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 @@
1
2 PAGE 60,132
3; SCCSID = @(#)smifssym.inc 1.0 87/05/11
4;
5; Modification history:
6; Created: May 11 1987
7;
8; SMifssym is only for IBMBIO. It will only has definitions
9; for IFSHEADER, IFSRH of INIT function.
10; When ifssym.inc is Revised, make sure that SMifssym.inc
11; is also correct. - JK.
12;
13
14;==================
15;IFS drive header
16;=================
17
18 IFSDEVICE EQU 8000H ; Supports single device/file functions
19 IFSDISK EQU 4000H ; Supports multi-file functions
20 IFSUNC EQU 2000H ; Support UNC (nameless) connection
21 IFSREMOTE EQU 0800H ; File system is remote
22 IFSFILTER EQU 0400H ; FS will filter (if off, use DOS
23 ; standard, cap & 8.3)
24 IFSIOCTL EQU 0002H ; Supports IOCTL functions
25 IFSUSESHARE EQU 0001H ; Uses DOS share support (vs own share)
26
27IFSHEADER STRUC
28IFS_NEXT DD -1 ; Next header in list (-1=end)
29IFS_NAME DB " " ; IFS name
30IFS_ATTRIBUTE DW ? ; Attributes
31IFS_VERSION DW 0 ; Request level supported
32IFS_DOSCALL@ DD ? ; DOS interface routine
33 ; (set by TUPPER before the init call)
34IFS_CALL@ DW ? ; Function entry point
35IFSHEADER ENDS
36
37;=====================
38; IFS Request Header
39;=====================
40
41IFSRH STRUC
42IFSR_LENGTH DW ? ; Total length of request
43IFSR_FUNCTION DB ? ; Requested function
44IFSR_RETCODE DB ? ; Explicit error
45IFSR_RETCLASS DB ? ; Error class
46IFSR_RESV1 DB 17 DUP(0) ; DOS reserved
47IFSR_FCN_PARMS DB 38 DUP(0) ; Additional parameters
48IFSRH ENDS
49
50; IFSR_FUNCTION codes
51; Control requests:
52IFSINIT EQU 1
53IFSATTSTART EQU 2
54IFSATTEND EQU 3
55IFSEXECAPI EQU 4
56IFSCRITMSG EQU 5
57IFSCBUPDATE EQU 6
58; INIT function.
59IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS ; command parameters
60IFSR_RESSIZE = WORD PTR IFSR_FCN_PARMS+4 ; driver total size
61LENGTH_INIT EQU IFSR_RESSIZE-IFSRH+2
62
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 @@
1#include "types.h"
2#include "internat.h"
3#include <dos.h>
4
5/* #define KANJI TRUE */
6
7char haveinttab = FALSE;
8
9struct InterTbl Currtab;
10
11int toupper(c)
12int c;
13{
14 union REGS regs ;
15
16 if(!haveinttab) {
17 regs.x.ax = 0x3800 ;
18 regs.x.dx = (unsigned) &Currtab ;
19 intdos (&regs, &regs) ; /* INIT the table */
20
21 haveinttab = TRUE;
22 }
23
24 return(IToupper(c,Currtab.casecall));
25
26}
27
28char *strupr(string)
29char *string;
30{
31 register char *p1;
32
33 p1 = string;
34 while (*p1 != NULL) {
35 /*
36 * A note about the following " & 0xFF" stuff. This is
37 * to prevent the damn C compiler from converting bytes
38 * to words with the CBW instruction which is NOT correct
39 * for routines like toupper
40 */
41#ifdef KANJI
42 if(testkanj(*p1 & 0xFF))
43 p1 += 2 ;
44 else
45 *p1++ = toupper(*p1 & 0xFF);
46#else
47 *p1++ = toupper(*p1 & 0xFF);
48#endif
49 }
50 return(string);
51}
52
53char *strpbrk(string1,string2)
54char *string1;
55char *string2;
56{
57 register char *p1;
58
59 while (*string1 != NULL) {
60 /*
61 * A note about the following " & 0xFF" stuff. This is
62 * to prevent the damn C compiler from converting bytes
63 * to words with the CBW instruction which is NOT correct
64 * for routines like toupper
65 */
66#ifdef KANJI
67 if(testkanj(*string1 & 0xFF))
68 string1 += 2 ;
69 else {
70#endif
71 p1 = string2;
72 while (*p1 != NULL) {
73 if(*p1++ == *string1)
74 return(string1);
75 }
76 string1++;
77#ifdef KANJI
78 }
79#endif
80
81 }
82 return(NULL); /* no matches found */
83}
84
85#ifdef KANJI
86testkanj(c)
87unsigned char c;
88{
89 if((c >= 0x81 && c <= 0x9F) || (c >= 0xE0 && c <= 0xFC))
90 return(TRUE);
91 else
92 return(FALSE);
93}
94#endif
diff --git a/v4.0/src/INC/STRING.OBJ b/v4.0/src/INC/STRING.OBJ
new file mode 100644
index 0000000..27417b5
--- /dev/null
+++ b/v4.0/src/INC/STRING.OBJ
Binary files 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 @@
1;;STRUC--Stucture Macro Library
2;;Optimizing Version 2.30 03/31/87
3
4if1
5$NoConj equ 0
6$And equ 1
7$Or equ 2
8$Short equ 3
9$Near equ 4
10$NearToShort equ 5
11$ncxz equ 6
12$AndOr = 0
13$Temp = 0
14$Temp2 = 0
15$Dist = 0
16
17$NoType equ 10
18$ConjIfType equ 11
19$IfType equ 12
20$ElseType equ 13
21$WhileType equ 14
22$ConjWhileType equ 15
23$RepeatType equ 16
24$ConjUntilType equ 17
25$ForType equ 18
26$ConjLeaveType equ 19
27$SelectType equ 20
28$WhenType equ 21
29$ConjWhenType equ 22
30$OtherwiseType equ $ElseType
31
32$StrucError macro text
33 Structure error -- text
34endm
35
36J macro
37endm
38JN macro
39endm
40
41$BuildJump macro j1,j2
42 j1 macro t
43 .xcref j1
44 j2 t
45 endm
46endm
47
48irp x,<<jeq,je>,<jlt,jl>,<jgt,jg>,<jneq,jne>,<jnlt,jnl>,<jngt,jng>,<jnpe,jpo>,<jnpo,jpe>>
49 $BuildJump x
50endm
51irp x,<<jzero,jz>,<jnzero,jnz>,<jnonzero,jnz>,<jnnonzero,jz>,<jand,jnz>,<jnand,jz>,<jnnand,jnz>>
52 $BuildJump x
53endm
54irp x,<a,ae,b,be,c,e,g,ge,l,le,o,p,s,z,cxz>
55 $BuildJump jnn&x,j&x
56endm
57
58jncxz macro t
59 if $Dist eq $NearToShort
60 jcxz $+5
61 jmp t
62 else
63 jcxz $+4
64 jmp short t
65 endif
66endm
67
68purge $BuildJump
69
70$GetConj macro p1,p2
71 $AndOr = $NoConj
72 irp parm,<p1,p2>
73 ifnb <&parm>
74 irp x,<and,AND,or,OR>
75 ifidn <parm>,<x>
76 $AndOr = $&&&x
77 exitm
78 endif
79 endm
80 endif
81 endm
82endm
83
84$GetDist macro p1,p2
85 irp parm,<p1,p2>
86 ifnb <parm>
87 irp x,<short,SHORT,near,NEAR>
88 ifidn <parm>,<x>
89 $Dist = $&&&x
90 exitm
91 endif
92 endm
93 endif
94 endm
95endm
96
97
98$Poke macro n,m
99 $st&n = m
100.xcref $st&n
101endm
102
103$Peek macro x,n
104 x = $st&n
105endm
106
107$Push macro n
108 $st = $st+1
109 $Poke %$st,n
110endm
111
112$Pop macro x
113 if $st gt 0
114 $Peek x,%$st
115 $st = $st-1
116 else
117 $StrucError <open structure>
118 endif
119endm
120
121$EquateLabel macro last,this
122 if $LastLabelOrg eq $
123 $ll&last = this
124 .xcref $ll&last
125 endif
126endm
127
128$TraceLabel macro n,a,b
129 if $ll&a eq $ll&b
130 $ll&n = b
131 .xcref $ll&n
132 else
133 $TraceLabel n,%$ll&a,%$ll&b
134 endif
135endm
136
137$Label macro n
138 if1
139 $EquateLabel %$LastLabel,n
140 $ll&n = n
141 .xcref $ll&n
142 $LastLabel = n
143 $LastLabelOrg = $
144$l&n:
145 else
146 if $ll&n eq n
147$l&n:
148 else
149 .xcref $l&n
150 .xcref $ll&n
151 endif
152 endif
153endm
154
155$CondJump macro l,tf,c
156 if1
157 ifb <c>
158 $EquateLabel %$LastLabel,l
159 endif
160 ifndef <$ll&l>
161 $ll&l = l
162 .xcref $ll&l
163 endif
164 else
165 $TraceLabel l,l,%$ll&l
166 endif
167 $CondJump2 %$ll&l,tf,c
168endm
169
170$CondJump2 macro l,tf,c
171 if $Dist eq $Short
172 ifb <c>
173 jmp short $l&l
174 else
175 ifidn <tf>,<f>
176 jn&c $l&l
177 else
178 j&c $l&l
179 endif
180 endif
181 else
182 ifnb <c>
183 ifdef $l&l
184 if (($ - $l&l) le 126) and (($l&l - $) le 129)
185 $Dist = $NearToShort
186 $nops = 3
187 ifidn <tf>,<f>
188 jn&c $l&l
189 ifdef $n&c
190 if $n&c eq $ncxz
191 $nops = 0
192 endif
193 endif
194 ifdef $&c
195 if $&c eq $ncxz
196 $nops = 5
197 endif
198 endif
199 else
200 j&c $l&l
201 ifdef $n&c
202 if $n&c eq $ncxz
203 $nops = 5
204 endif
205 endif
206 ifdef $&c
207 if $&c eq $ncxz
208 $nops = 0
209 endif
210 endif
211 endif
212 rept $nops
213 nop
214 endm
215 else
216 ifidn <tf>,<f>
217 j&c $+5
218 else
219 jn&c $+5
220 endif
221 jmp $l&l
222 endif
223 else
224 ifidn <tf>,<f>
225 j&c $+5
226 else
227 jn&c $+5
228 endif
229 jmp $l&l
230 endif
231 else
232 ifdef $l&l
233 ifidn <tf>,<NoFold>
234 jmp $l&l
235 else
236 if (($ - $l&l) le 126) and (($l&l - $) le 129)
237 jmp short $l&l
238 nop
239 else
240 jmp $l&l
241 endif
242 endif
243 else
244 jmp $l&l
245 endif
246 endif
247 endif
248endm
249
250
251$CondLoop macro l,c
252 loop&c $l&l
253endm
254
255$Test macro tgt,a1,a2,a3,a4,x
256 ifb <a1>
257 $StrucError <invalid condition>
258 else
259 ifb <a2>
260 $CondJump %&tgt,a1
261 else
262 ifb <a3>
263 ifdif <a1>,<zero>
264 ifdif <a1>,<nonzero>
265 ifdif <a1>,<ZERO>
266 ifdif <a1>,<NONZERO>
267 $StrucError <invalid condition>
268 exitm
269 endif
270 endif
271 endif
272 endif
273 or a2,a2
274 $CondJump %&tgt,a1
275 else
276 ifb <a4>
277 cmp a1,a3
278 $CondJump %&tgt,a2
279 else
280 ifb <x>
281 ifdif <a1>,<bit>
282 ifdif <a1>,<BIT>
283 $StrucError <invalid condition>
284 exitm
285 endif
286 endif
287 test a2,a4
288 $CondJump %&tgt,a3
289 else
290 $StrucError <invalid condition>
291 endif
292 endif
293 endif
294 endif
295 endif
296endm
297
298$TopTest macro args,n,c,p4,p5
299 $GetConj p4,p5
300 $Dist = $DefDist
301 $GetDist p4,p5
302 if $AndOr eq $NoConj
303 $Test <$sn-1,f>,args
304 $Pop $Temp
305 if $OrFound
306 $Label %$Temp
307 endif
308 $Push n
309 else
310 if $AndOr eq $And
311 $Test <$sn-1,f>,args
312 else
313 $OrFound = 1
314 $Test <$sn,t>,args
315 endif
316 $Push c
317 endif
318endm
319;;*****************************************************************************
320.if macro t,p2,p3
321 $Peek $Temp,%$st
322 if $Temp eq $ConjIfType
323 $Pop $Temp
324 else
325 $OrFound = 0
326 $sn = $sn+1
327 $Push $sn
328 $sn = $sn+1
329 $Push $sn
330 $sn = $sn+1
331 $Push $sn
332 endif
333 $TopTest <t>,$IfType,$ConjIfType,p2,p3
334endm
335;;*****************************************************************************
336.then macro
337 $Peek $Temp,%$st
338 if $Temp ne $IfType
339 if $Temp ne $WhenType
340 $StrucError <then without if or when>
341 endif
342 endif
343endm
344;;*****************************************************************************
345.elseif macro t,p2,p3
346 $Pop $Temp
347 if $Temp ne $IfType
348 $StrucError <elseif without if>
349 exitm
350 endif
351 $OrFound = 0
352 $Pop $Temp
353 $Peek $Temp2,%$st
354 $Dist = $Near
355 $CondJump %$Temp2
356 $Label %$Temp
357 $sn = $sn+1
358 $Push $sn
359 $sn = $sn+1
360 $Push $sn
361 $TopTest <t>,$IfType,$ConjIfType,p2,p3
362endm
363;;*****************************************************************************
364.else macro dist
365 $Pop $Temp
366 if $Temp ne $IfType
367 if $Temp ne $WhenType
368 if $Temp ne $SelectType
369 $StrucError <else without if, when or select>
370 exitm
371 endif
372 endif
373 endif
374 $sn = $sn+1
375 if $Temp eq $SelectType
376 $Push $sn
377 else
378 $Dist = $DefDist
379 $GetDist dist
380 $CondJump %$sn
381 $Pop $Temp
382 $Label %$Temp
383 $Push $sn
384 endif
385 $push $ElseType
386endm
387;;*****************************************************************************
388.endif macro
389 $Pop $Temp
390 if $Temp ne $IfType
391 if $Temp ne $ElseType
392 $StrucError <endif without if>
393 exitm
394 endif
395 endif
396 $Pop $Temp
397 $Label %$Temp
398 $Pop $Temp
399 $Label %$Temp
400endm
401;;*****************************************************************************
402.select macro x
403 $OrFound = 0
404 $sn = $sn+1
405 $Push $sn
406 $Push $SelectType
407endm
408;;*****************************************************************************
409.when macro tst,p2,p3
410 $Pop $Temp
411 if $Temp ne $SelectType
412 if $Temp ne $WhenType
413 if $Temp ne $ConjWhenType
414 $StrucError <when without select>
415 exitm
416 endif
417 endif
418 endif
419 if $Temp ne $ConjWhenType
420 $Dist = $Near
421 $OrFound = 0
422 if $Temp eq $WhenType
423 $Pop $Temp2
424 $Peek $Temp,%$st
425 $CondJump %$Temp
426 $Label %$Temp2
427 endif
428 $sn = $sn+1
429 $Push $sn
430 $sn = $sn+1
431 $Push $sn
432 endif
433 $TopTest <tst>,$WhenType,$ConjWhenType,p2,p3
434endm
435;;*****************************************************************************
436.otherwise macro dist
437 $Pop $Temp
438 if $Temp ne $WhenType
439 if $Temp ne $SelectType
440 if $Temp ne $IfType
441 $StrucError <otherwise without if, when or select>
442 exitm
443 endif
444 endif
445 endif
446 $sn = $sn+1
447 if $Temp eq $SelectType
448 $Push $sn
449 else
450 $Dist = $DefDist
451 $GetDist dist
452 $CondJump %$sn
453 $Pop $Temp
454 $Label %$Temp
455 $Push $sn
456 endif
457 $push $OtherwiseType
458endm
459;;*****************************************************************************
460.endselect macro
461 $Pop $Temp
462 if $Temp ne $WhenType
463 if $Temp ne $OtherwiseType
464 if $Temp ne $SelectType
465 $StrucError <endselect without select>
466 exitm
467 endif
468 endif
469 endif
470 $pop $Temp2
471 if $Temp ne $SelectType
472 $Label %$Temp2
473 $Pop $Temp2
474 $Label %$Temp2
475 endif
476endm
477;;*****************************************************************************
478.while macro t,p2,p3
479 $Peek $Temp,%$st
480 if $Temp eq $ConjWhileType
481 $Pop $Temp
482 else
483 $Push $LoopEnd
484 $OrFound = 0
485 $sn = $sn + 1
486 $Push $sn
487 $Label %$sn
488 $sn = $sn + 2
489 $Push $sn
490 $LoopEnd = $sn - 1
491 endif
492 $TopTest <t>,$WhileType,$ConjWhileType,p2,p3
493endm
494;;*****************************************************************************
495.endwhile macro p1
496 $Pop $Temp
497 if $Temp ne $WhileType
498 $StrucError <endwhile without while>
499 exitm
500 endif
501 $Dist = $Near
502 $Pop $Temp
503 $CondJump %$Temp,NoFold
504 $Label %$Temp+1
505 $Pop $LoopEnd
506endm
507;;*****************************************************************************
508.repeat macro
509 $Push $LoopEnd
510 $Push $LeaveFound
511 $sn = $sn+1
512 $Label %$sn
513 $Push $sn
514 $Push $RepeatType
515 $sn = $sn+1
516 $LoopEnd = $sn
517 $LeaveFound = 0
518endm
519;;*****************************************************************************
520.until macro t,p2,p3
521 $until2 p2,p3,t
522endm
523$until2 macro p2,p3,a1,a2,a3,a4,x
524 $Pop $Temp
525 if $Temp ne $RepeatType
526 if $Temp ne $ConjUntilType
527 $StrucError <until without repeat>
528 exitm
529 endif
530 else
531 $OrFound = 0
532 endif
533 $Dist = $DefDist
534 $GetDist p2,p3
535 $GetConj p2,p3
536
537 if $AndOr eq $NoConj
538 $Pop $Temp
539 ifb <a1>
540 $Dist = $Near
541 $CondJump %$Temp,NoFold
542 else
543 $Test <$Temp,f>,<a1>,<a2>,<a3>,<a4>,<x>
544 endif
545 if $OrFound or $LeaveFound
546 $Label %$Temp+1
547 endif
548 $Pop $LeaveFound
549 $Pop $LoopEnd
550 else
551 $Peek $Temp,%$st
552 if $AndOr eq $And
553 $Test <$Temp,f>,<a1>,<a2>,<a3>,<a4>,<x>
554 else
555 $OrFound = 1
556 $Test <$Temp+1,t>,<a1>,<a2>,<a3>,<a4>,<x>
557 endif
558 $Push $ConjUntilType
559 endif
560endm
561;;*****************************************************************************
562.loop macro cond
563 $Pop $Temp
564 if $Temp ne $RepeatType
565 $StrucError <loop without repeat>
566 exitm
567 endif
568 $Pop $Temp
569 $CondLoop %$Temp,cond
570 if $LeaveFound
571 $Label %$Temp+1
572 endif
573 $Pop $LeaveFound
574 $Pop $LoopEnd
575endm
576;;*****************************************************************************
577.for macro index,equals,start,to,stop,by,step,dist
578 mov index,start
579 $Push $LoopEnd
580 $sn = $sn+1
581 $Push $sn
582 $Label %$sn
583 $sn = $sn+1
584 $LoopEnd = $sn
585 cmp index,stop
586 $Dist = $DefDist
587 ifb <step>
588 $Push 1
589 $GetDist by
590 $CondJump %$sn,t,gt
591 else
592 $GetDist dist
593 $Push %(step)
594 if step lt 0
595 $CondJump %$sn,t,lt
596 else
597 $CondJump %$sn,t,gt
598 endif
599 endif
600 $Push $ForType
601endm
602;;*****************************************************************************
603.next macro index,dist
604 $Pop $Temp
605 if $Temp ne $ForType
606 $StrucError <next without for>
607 exitm
608 endif
609 $Pop $Temp
610 if $Temp eq 1
611 inc index
612 else
613 if $Temp eq -1
614 dec index
615 else
616 add index,$Temp
617 endif
618 endif
619 $Pop $Temp
620 $Dist = $Near
621 $CondJump %$Temp,NoFold
622 $Label %$Temp+1
623 $Pop $LoopEnd
624endm
625;;*****************************************************************************
626.leave macro t,p2,p3
627 $leave2 p2,p3,t
628endm
629$leave2 macro p2,p3,a1,a2,a3,a4,x
630 ife $LoopEnd
631 $StrucError <leave outside a loop>
632 exitm
633 endif
634 $LeaveFound = 1
635 $Peek $Temp,%$st
636 if $Temp eq $ConjLeaveType
637 $Pop $Temp
638 else
639 $OrFound = 0
640 $sn = $sn + 1
641 endif
642 $Dist = 0
643 $GetDist <a1>
644 if $Dist
645 $CondJump %$LoopEnd
646 if $OrFound
647 $Label %$sn
648 endif
649 else
650 $Dist = $DefDist
651 $GetDist p2,p3
652 $GetConj p2,p3
653 if $AndOr eq $NoConj
654 ifb <a1>
655 $CondJump %$LoopEnd,t
656 else
657 $Test <$LoopEnd,t>,<a1>,<a2>,<a3>,<a4>,<x>
658 endif
659 if $OrFound
660 $Label %$sn
661 endif
662 else
663 if $AndOr eq $And
664 $OrFound = 1
665 $Test <$sn,f>,<a1>,<a2>,<a3>,<a4>,<x>
666 else
667 $Test <$LoopEnd,t>,<a1>,<a2>,<a3>,<a4>,<x>
668 endif
669 $Push $ConjLeaveType
670 endif
671 endif
672endm
673;;*****************************************************************************
674else ;else for if1
675$Pop $Temp
676;;if $Temp ne $NoType
677if $st ne 0
678 $StrucError <open structure(s)>
679endif
680.xcref $NoConj,$And,$Or,$Short,$Near,$NearToShort,$AndOr,$Temp,$Temp2,$Dist
681.xcref $NoType,$ConjIfType,$IfType,$ElseType,$WhileType,$ConjWhileType
682.xcref $RepeatType,$ConjUntilType,$ForType,$ConjLeaveType,jncxz
683.xcref $SelectType,$WhenType,$OtherwiseType,$ConjWhenType
684.xcref jeq,jgt,jlt,jneq,jngt,jnlt,jnna,jnnae,jnnb,jnnbe,jnnc,jnncxz
685.xcref jnne,jnng,jnnge,jnnl,jnnle,jnno,jnnp,jnns,jnnz,jnpe,jnpo,$BuildJump
686.xcref $GetConj,$GetDist,$Poke,$Peek,$Push,$Pop,$Label,$CondJump,$CondLoop,$Test
687.xcref $TopTest,$leave2,$until2,$StrucError,j,jn,jand,jnand,jnnand
688.xcref jnnonzero,jnonzero,jnzero,jzero
689.xcref $st,$sn,$OrFound,$LoopEnd,$LeaveFound,$DefDist
690.xcref $LastLabel,$LastLabelOrg,$EquateLabel,$TraceLabel,$CondJump2,$ncxz
691endif
692
693
694$st = 0
695$sn = 0
696$OrFound = 0
697$LoopEnd = 0
698$LeaveFound = 0
699$LastLabel = -1
700$LastLabelOrg = $
701$DefDist= $Short
702$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 @@
1; SCCSID = @(#)syscall.asm 1.1 85/04/10
2;BREAK <system call definitions>
3SUBTTL system call definitions
4PAGE
5
6Abort EQU 0 ; 0 0
7Std_Con_Input EQU 1 ; 1 1
8Std_Con_Output EQU 2 ; 2 2
9Std_Aux_Input EQU 3 ; 3 3
10Std_Aux_Output EQU 4 ; 4 4
11Std_Printer_Output EQU 5 ; 5 5
12Raw_Con_IO EQU 6 ; 6 6
13Raw_Con_Input EQU 7 ; 7 7
14Std_Con_Input_No_Echo EQU 8 ; 8 8
15Std_Con_String_Output EQU 9 ; 9 9
16Std_Con_String_Input EQU 10 ; 10 A
17Std_Con_Input_Status EQU 11 ; 11 B
18Std_Con_Input_Flush EQU 12 ; 12 C
19Disk_Reset EQU 13 ; 13 D
20Set_Default_Drive EQU 14 ; 14 E
21FCB_Open EQU 15 ; 15 F
22FCB_Close EQU 16 ; 16 10
23Dir_Search_First EQU 17 ; 17 11
24Dir_Search_Next EQU 18 ; 18 12
25FCB_Delete EQU 19 ; 19 13
26FCB_Seq_Read EQU 20 ; 20 14
27FCB_Seq_Write EQU 21 ; 21 15
28FCB_Create EQU 22 ; 22 16
29FCB_Rename EQU 23 ; 23 17
30Get_Default_Drive EQU 25 ; 25 19
31Set_DMA EQU 26 ; 26 1A
32;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
33; C A V E A T P R O G R A M M E R ;
34; ;
35Get_Default_DPB EQU 31 ; 31 1F
36; ;
37; C A V E A T P R O G R A M M E R ;
38;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
39FCB_Random_Read EQU 33 ; 33 21
40FCB_Random_Write EQU 34 ; 34 22
41Get_FCB_File_Length EQU 35 ; 35 23
42Get_FCB_Position EQU 36 ; 36 24
43Set_Interrupt_Vector EQU 37 ; 37 25
44Create_Process_Data_Block EQU 38 ; 38 26
45FCB_Random_Read_Block EQU 39 ; 39 27
46FCB_Random_Write_Block EQU 40 ; 40 28
47Parse_File_Descriptor EQU 41 ; 41 29
48Get_Date EQU 42 ; 42 2A
49Set_Date EQU 43 ; 43 2B
50Get_Time EQU 44 ; 44 2C
51Set_Time EQU 45 ; 45 2D
52Set_Verify_On_Write EQU 46 ; 46 2E
53; Extended functionality group
54Get_DMA EQU 47 ; 47 2F
55Get_Version EQU 48 ; 48 30
56Keep_Process EQU 49 ; 49 31
57;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
58; C A V E A T P R O G R A M M E R ;
59; ;
60Get_DPB EQU 50 ; 50 32
61; ;
62; C A V E A T P R O G R A M M E R ;
63;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
64Set_CTRL_C_Trapping EQU 51 ; 51 33
65Get_InDOS_Flag EQU 52 ; 52 34
66Get_Interrupt_Vector EQU 53 ; 53 35
67Get_Drive_Freespace EQU 54 ; 54 36
68Char_Oper EQU 55 ; 55 37
69International EQU 56 ; 56 38
70; Directory Group
71MKDir EQU 57 ; 57 39
72RMDir EQU 58 ; 58 3A
73CHDir EQU 59 ; 59 3B
74; File Group
75Creat EQU 60 ; 60 3C
76Open EQU 61 ; 61 3D
77Close EQU 62 ; 62 3E
78Read EQU 63 ; 63 3F
79Write EQU 64 ; 64 40
80Unlink EQU 65 ; 65 41
81LSeek EQU 66 ; 66 42
82CHMod EQU 67 ; 67 43
83IOCtl EQU 68 ; 68 44
84XDup EQU 69 ; 69 45
85XDup2 EQU 70 ; 70 46
86Current_Dir EQU 71 ; 71 47
87; Memory Group
88Alloc EQU 72 ; 72 48
89Dealloc EQU 73 ; 73 49
90Setblock EQU 74 ; 74 4A
91; Process Group
92Exec EQU 75 ; 75 4B
93Exit EQU 76 ; 76 4C
94WaitProcess EQU 77 ; 77 4D
95Find_First EQU 78 ; 78 4E
96; Special Group
97Find_Next EQU 79 ; 79 4F
98; SPECIAL SYSTEM GROUP
99;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
100; C A V E A T P R O G R A M M E R ;
101; ;
102Set_Current_PDB EQU 80 ; 80 50
103Get_Current_PDB EQU 81 ; 81 51
104Get_In_Vars EQU 82 ; 82 52
105SetDPB EQU 83 ; 83 53
106; ;
107; C A V E A T P R O G R A M M E R ;
108;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
109Get_Verify_On_Write EQU 84 ; 84 54
110;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
111; C A V E A T P R O G R A M M E R ;
112; ;
113Dup_PDB EQU 85 ; 85 55
114; ;
115; C A V E A T P R O G R A M M E R ;
116;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
117Rename EQU 86 ; 86 56
118File_Times EQU 87 ; 87 57
119AllocOper EQU 88 ; 88 58
120; Network extention system calls
121GetExtendedError EQU 89 ; 89 59
122CreateTempFile EQU 90 ; 90 5A
123CreateNewFile EQU 91 ; 91 5B
124LockOper EQU 92 ; 92 5C Lock and Unlock
125;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
126; C A V E A T P R O G R A M M E R ;
127; ;
128ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall,
129 ; CloseByName, CloseUser,
130 ; CloseUserProcess,
131 ; GetOpenFileList
132; ;
133; C A V E A T P R O G R A M M E R ;
134;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
135UserOper EQU 94 ; 94 5E Get and Set
136AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel
137xNameTrans EQU 96 ; 96 60
138PathParse EQU 97 ; 97 61
139GetCurrentPSP EQU 98 ; 98 62
140Hongeul EQU 99 ; 99 63
141ECS_CALL EQU 99 ; 99 63 ;; DBCS support
142;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
143; C A V E A T P R O G R A M M E R ;
144; ;
145Set_Printer_Flag EQU 100 ; 100 64
146; ;
147; C A V E A T P R O G R A M M E R ;
148;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
149GetExtCntry EQU 101 ; 101 65
150GetSetCdPg EQU 102 ; 102 66
151ExtHandle EQU 103 ; 103 67
152Commit EQU 104 ; 104 68
153GetSetMediaID EQU 105 ; 105 69
154IFS_IOCTL EQU 107 ; 107 6B
155ExtOpen EQU 108 ; 108 6C
156;
157;
158Set_Oem_Handler EQU 248 ; 248 F8
159OEM_C1 EQU 249 ; 249 F9
160OEM_C2 EQU 250 ; 250 FA
161OEM_C3 EQU 251 ; 251 FB
162OEM_C4 EQU 252 ; 252 FC
163OEM_C5 EQU 253 ; 253 FD
164OEM_C6 EQU 254 ; 254 FE
165OEM_C7 EQU 255 ; 255 FF
166 \ 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 @@
1 PAGE ,132
2 SUBTTL DOS - Message Retriever - SYSTEM CONTROL file
3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4;; DOS -- Message Retriever
5;; (c) Copyright 1988 Microsoft
6;;
7;; File Name: SYSMSG.INC
8;; ----------
9;;
10;; Description: Message retriever functions are included into source code
11;; ------------ by referencing a MSG_SERVICES macro. That macro is defined
12;; here as well as the logic to include necessary .ASM and .INC
13;; files.
14;;
15;;
16;; Documentation Reference:
17;; ------------------------
18;; DOS -Message Retriever I0 Document - Feb. ?? 1987
19;; DOS -Message Retriever I1 Document - Mar. ?? 1987
20;; DOS -Message Retriever I2 Document - Mar. ?? 1987
21;; DOS -Final Functional Specification Document - Mar ?? 1987
22;;
23;; Procedures Contained in This File:
24;; ---------------------------------
25;; None
26;;
27;; Include Files Required:
28;; -----------------------
29;; MSGSERV.INC := All message services
30;; ???? := ????
31;;
32;; External Procedure References:
33;; ------------------------------
34;; None
35;;
36;; Linkage Instructions:
37;; --------------------
38;; None
39;;
40;; Change History:
41;; ---------------
42;; CREATED March, 1987 RPS
43;;
44;; Psuedocode:
45;; -----------
46;; None
47;;
48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49 ;;
50INCLUDE VERSIONA.INC ;;AN003;;
51
52FALSE = 0 ;;
53TRUE = NOT FALSE ;; List message services and flags
54 ;;
55
56; Control Characters For Message Skeleton file
57
58NULL EQU 00H ;; Null
59BELL EQU 07H ;; Bell
60TAB EQU 09H ;; Tab
61LF EQU 0AH ;; Line Feed
62HOME EQU 0BH ;; Home
63FORMFD EQU 0CH ;; Form Feed
64CR EQU 0DH ;; Carriage Return
65COLON EQU 3AH ;; Colon
66
67; SYSDISPMSG and SYSGETMSG Equates
68
69MSG_SER_CLASS EQU 00H ;; Message Service Class (reserved)
70EXT_ERR_CLASS EQU 01H ;; DOS Extended error class
71PARSE_ERR_CLASS EQU 02H ;; Parse error class
72UTILITY_MSG_CLASS EQU 0FFH ;; Utility message class
73
74NO_HANDLE EQU 0FFFFH ;; No handle specified (Use DOS functions 01H-09H only)
75
76NO_REPLACE EQU 0000H ;; No replacable parameters
77
78; SUBLIST Equates
79
80 Sublist_Length EQU 11 ;; Length of sublist structure
81 Reserved EQU 0 ;; Reserved byte field
82
83 Left_Align EQU 0 ;;00xxxxxx
84 Right_Align EQU 80h ;;10xxxxxx
85
86 Char_type EQU 0 ;;axxx0000 - Character type
87 Char_Field_Char EQU 0 ;;a0000000
88 Char_Field_ASCIIZ EQU 10h ;;a0010000
89
90 Unsgn_Bin_Type EQU 01h ;;axxx0001 - Unsigned Binary to Decimal character
91 Unsgn_Bin_Byte EQU 11h ;;a0010001
92 Unsgn_Bin_Word EQU 21h ;;a0100001
93 Unsgn_Bin_DWord EQU 31h ;;a0110001
94
95 Sgn_Bin_Type EQU 02h ;;axxx0010 - Signed Binary to Decimal character
96 Sgn_Bin_Byte EQU 12h ;;a0010010
97 Sgn_Bin_Word EQU 22h ;;a0100010
98 Sgn_Bin_DWord EQU 32h ;;a0110010
99
100 Bin_Hex_Type EQU 03h ;;axxx0011 - Unsigned Binary to Hexidecimal character
101 Bin_Hex_Byte EQU 13h ;;a0010011
102 Bin_Hex_Word EQU 23h ;;a0100011
103 Bin_Hex_DWord EQU 33h ;;a0110011
104
105 Date_Type EQU 04h ;;axxx0100 - Date to character using current country format
106 Date_MD EQU 14h ;;a0010100
107 Date_MDY_2 EQU 24h ;;a0100100
108 Date_MDY_4 EQU 34h ;;a0110100
109
110 Time_Cty_Type EQU 05h ;;axxx0101 - Time to character using current country format
111 Time_HHMM_Cty EQU 05h ;;a0000101
112 Time_HHMMSS_Cty EQU 15h ;;a0010101
113 Time_HHMMSSHH_Cty EQU 25h ;;a0100101
114
115 Time_24_Type EQU 06h ;;axxx0110 - Time to character using 24 hour format
116 Time_HHMM_24 EQU 06h ;;a0000110
117 Time_HHMMSS_24 EQU 16h ;;a0010110
118 Time_HHMMSSHH_24 EQU 26h ;;a0100110
119
120 $M_EXTPAR_Type EQU 08h ;;axxx1000 - Special case for extended parse replace format
121
122NO_INPUT EQU 00H ;; No input characters
123DOS_KEYB_INP EQU 01H ;; DOS INT 21H - AH=01H := Keyboard Input
124DOS_DIR_CON_INP EQU 07H ;; DOS INT 21H - AH=07H := Direct Console Input Without Echo
125DOS_CON_INP EQU 08H ;; DOS INT 21H - AH=08H := Console Input Without Echo (Check CTL-BK)
126DOS_BUF_KEYB_INP EQU 0AH ;; DOS INT 21H - AH=0AH := Buffered Keyboard Input
127DOS_CLR_KEYB_BUF EQU 0CH ;; DOS INT 21H - AH=0CH := Clear keyboard buffer
128DOS_WRITE_HANDLE EQU 40H ;; DOS INT 21H - AH=40H := Write to a DOS handle
129DOS_DISP_STRING EQU 09H ;; DOS INT 21H - AH=09H := Display $ terminated string
130DOS_DISP_CHAR EQU 02H ;; DOS INT 21H - AH=02H := Display Character
131LOWEST_4CH_VERSION EQU 0002H ;; First DOS version to allow AH = 4CH Exit (VERSION 2.00)
132
133DOS_GET_DBCS_INFO EQU 6300H ;; DOS INT 21H - AX=6507H := Get DBCS Vector Table
134DOS_GET_EXT_ERROR EQU 59H ;; DOS INT 21H - AH=59H := Get Extended Error
135DOS_GET_EXT_ERROR_BX EQU 00H ;; DOS INT 21H - BX=0000H := Version 0
136
137DOS_EXTENDED_OPEN EQU 6C00H ;AN003; DOS INT 21H - AX=6C00H := Extended Open
138NO_CRIT_OPEN EQU 2000H ;AN003; Extended Open Mode bit
139NOT_EX_FAIL_EX_OPEN EQU 0101H ;AN003; Extended Open Flag
140DOS_LSEEK_FILE EQU 4200H ;AN003; DOS INT 21H - AX=4200H := LSEEK file
141DOS_READ_BYTE EQU 3FH ;AN003; DOS INT 21H - AH=3FH := Read byte block
142DOS_CLOSE_FILE EQU 3EH ;AN003; DOS INT 21H - AH=3EH := Close file handle
143
144IFSFUNC_INSTALL_CHECK EQU 0500H ;AN006; IFSFUNC Installation Check
145IFS_GET_ERR_TEXT EQU 0502H ;AN006; IFSFUNC Get Extended Error Text
146IFSFUNC_INSTALLED EQU 0FFH ;AN006; Return code if IFSFUNC is installed
147
148EXT_ERR_39 EQU 39 ;; Insufficent Disk Space EXTENDED ERROR (changed from hex to decimal - eg d201)
149ERROR_CLASS_39 EQU 01H ;; Error Class = 1
150ACTION_39 EQU 04H ;; Suggested Action = 4
151LOCUS_39 EQU 01H ;; Locus = 1
152
153DOS_GET_COUNTRY EQU 38H ;; DOS INT 21H - AH=38H := Get Country Dependant Information
154DOS_GET_VERSION EQU 30H ;; DOS INT 21H - AH=30H := Get DOS Version number
155DOS_IOCTL_GET_INFO EQU 4400H ;; DOS INT 21H - AH=4400H := I/O control for devices
156DOS_IOCTL_SET_INFO EQU 4401H ;; DOS INT 21H - AH=4401H := I/O control for devices
157DOS_GET_EXT_PARSE_ADD EQU 122EH ;; DOS INT 2FH - AX=122EH := Get Extended/Parse error address
158DOS_GET_EXTENDED EQU 00 ;; DOS INT 2FH - AX=122EH - DL=00 := Get Extended address
159DOS_GET_PARSE EQU 02 ;; DOS INT 2FH - AX=122EH - DL=02 := Get Parse address
160DOS_GET_CRITICAL EQU 04 ;; DOS INT 2FH - AX=122EH - DL=04 := Get Critical address
161DOS_GET_FILE EQU 06 ;; DOS INT 2FH - AX=122EH - DL=06 := Get File system dependant
162DOS_GET_ADDR EQU 08 ;; DOS INT 2FH - AX=122EH - DL=08 := Get Address of READ_DISK_PROC
163DOS_SET_ADDR EQU 09 ;; DOS INT 2FH - AX=122EH - DL=09 := Set Address of READ_DISK_PROC
164LOW_NIB_MASK EQU 0FH ;; Mask out the high byte
165DOS_CLR_KEYB_BUF_MASK EQU 0C0H ;; Check if high nibble is C Hex
166$M_CON_INP EQU -1 ;; If DOS INT 21H Function 06H - DL := 0FFH for input
167$M_CRIT_LO EQU 19 ;; First Extended Error considered CRITICAL
168$M_CRIT_HI EQU 39 ;; Last Extended Error considered CRITICAL (EG - D191)
169$M_AM EQU "a" ;; Time format AM indicator
170$M_PM EQU "p" ;; Time format PM indicator
171$M_NEG_SIGN EQU "-" ;; Signed decimal number format negative indicator
172$M_DEF_TIME_FORM EQU 1 ;; Default Time format - 24 hour
173$M_DEF_DATE_FORM EQU 0 ;; Default Time format - 0 := USA format
174$M_DEF_TIME_SEP EQU ":" ;; Default Time separator - ":"
175$M_DEF_DATE_SEP EQU "-" ;; Default Time separator - "-"
176$M_DEF_DECI_SEP EQU "." ;; Default Time hundreds separator - "."
177$M_TIMEDATE_PAD EQU "0" ;; Time/Date PAD character - "0" (ie 12:03p)
178$M_MAX_2_YEAR EQU 99 ;; Maximum 2 digit year
179$M_SINGLE_CHAR EQU 1 ;; A single character is this long ^
180$M_SPECIAL_CASE EQU 30H ;; Special case for replacable parameters %0
181$M_UNLIM_W EQU 0 ;; Unlimited width character
182$M_COMMA EQU "," ;; Default Thousand separate
183$M_CR_LF EQU 0A0DH ;; Default CR/LF
184$M_SPACE_HYP EQU "- " ;; Default Space/Hyphan
185$M_SPACE EQU " " ;; Default Space
186$M_NULL EQU 0 ;; Null
187$M_FIRST_THOU EQU 3 ;; Location of first thousand separator
188$M_SECOND_THOU EQU 6 ;; Location of second thousand separator
189$M_THIRD_THOU EQU 9 ;; Location of third thousand separator
190$M_BASE10 EQU 10 ;; Base 10 for arthmetic
191$M_BASE16 EQU 16 ;; Base 16 for arthmetic
192$M_CLASS_NOT_EXIST EQU 0 ;; Does class exist?
193$M_TERMINATING_FLAG EQU -1 ;; Is there any more classes?
194$M_ADDR_SZ_NEAR EQU 2 ;; Size to increment if NEAR
195$M_ADDR_SZ_FAR EQU 4 ;; Size to increment if FAR
196$M_SL EQU DS:[SI] ;; Refer to SUBLIST as $M_SL
197$M_NO_HANDLE EQU -1 ;; No handle flag
198$M_TEMP_BUF_SZ EQU 64 ;; Size of temporary buffer ;AN003;
199$M_NEXT_DBCS_VECTOR EQU 2 ;; Amount to increment to get next vector
200$M_DBCS_TERM EQU 0000 ;; DBCS vector table terminating flag
201$M_SPECIAL_MSG_NUM EQU 0FFFFH ;; Special generic message number
202$M_CRLF_SIZE EQU 2 ;; Size of the CR LF message
203$M_NO_CRLF_MASK EQU 10000000B ;; Mask to supress CR LF
204$M_ONE_REPLACE EQU 1 ;; Indicate one replacement
205$M_CRIT_ERR_MASK EQU 00000001B ;; Mask to allow EOF/EOI Crit error
206 ;;
207$M_ALIGN_MASK EQU 10000000b ;; Mask for align
208$M_TYPE_MASK EQU 00001111b ;; Mask for types
209$M_SIZE_MASK EQU 00110000b ;; Mask for types
210$M_TIME_MASK EQU 00000001b ;; Mask for TIME
211$M_DATE_MASK EQU 00010000b ;; Mask for TIME
212$M_BYTE EQU 00010000b ;; BYTE indicator
213$M_WORD EQU 00100000b ;; WORD indicator
214$M_DWORD EQU 00110000b ;; DWORD indicator
215
216; Standard reserved DOS handles
217
218STDIN EQU 0000H ;; Standard Input device handle
219STDOUT EQU 0001H ;; Standard Output device handle
220STDERR EQU 0002H ;; Standard Error Output device handle
221STDAUX EQU 0003H ;; Standard Auxiliary device handle
222STDPRN EQU 0004H ;; Standard Printer device handle
223
224; Reserved Message Service equates
225
226NEARmsg = TRUE ;; \
227NOVERCHECKmsg = FALSE ;; |
228MSGDATA = FALSE ;; |
229FARmsg = FALSE ;; |
230GETmsg = FALSE ;; |
231LOADmsg = FALSE ;; |
232DISPLAYmsg = FALSE ;; } Set default cases
233SETSTDIO = FALSE ;; |
234NOCHECKSTDIN = FALSE ;; |
235NOCHECKSTDOUT = FALSE ;; |
236DISK_PROC = FALSE ;; | ;AN003;
237INPUTmsg = FALSE ;; |
238CHARmsg = FALSE ;; |
239NUMmsg = FALSE ;; |
240TIMEmsg = FALSE ;; |
241DATEmsg = FALSE ;; /
242
243IF1 ;;
244COMR = FALSE ;; COMMAND.COM Cases (resident)
245COMT = FALSE ;; (transient)
246ENDIF ;;
247
248$M_STRUC = TRUE ;; Internal message service defaults
249$M_LOAD = TRUE ;;
250$M_SUBS = TRUE ;;
251$M_REPLACE = TRUE ;;
252$M_REPL_DONE = FALSE ;;
253$M_CHAR_ONLY = TRUE ;;
254$M_PARSE_FLAG = TRUE ;;
255$M_EXT_ERR_FLAG = TRUE ;;
256$M_MSGDATA_ONLY = TRUE ;;
257$M_END = FALSE ;;
258$M_EXT_CLS = TRUE ;;
259$M_PAR_CLS = TRUE ;;
260 ;;
261;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
262;; $M_POPF Macro
263;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
264
265$M_POPF MACRO
266 LOCAL $M_MYRET
267 JMP $+3
268$M_MYRET LABEL NEAR
269 IRET
270 PUSH CS
271 CALL $M_MYRET
272ENDM
273
274;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
275;;
276;; Message Retreiver requests
277;;
278;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
279 ;
280MSG_UTILNAME Macro utilname ;
281 ;
282 INCLUDE &utilname.CTL ; Include the control file for the utility
283 $M_STRUC = TRUE ;
284 INCLUDE MSGSERV.ASM ; Get structure definitions
285 ;
286ENDM ;
287 ;
288;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
289;; MSG_SERVICES Macro
290;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
291 ;
292MSG_SERVICES Macro varlist ; MACRO used in source routine
293 ;
294 $M_SERVICE = FALSE ; Reset service flag
295 IRP var,<varlist> ; FOR each variable in the list
296 $M_INCLUDE = TRUE ; Reset include flag
297 ; For each service predefined
298
299IRP serv,<MSGDATA,LOADmsg,NOVERCHECKmsg,DISPLAYmsg,GETmsg,INPUTmsg,CHARmsg,NUMmsg,TIMEmsg,DATEmsg,NEARmsg,FARmsg,COMR,COMT>
300
301 IFDIF <var>,<serv> ; IF it IS a service (defined above)
302 ELSE ;
303 IFDIF <var>,<MSGDATA> ; IF it is NOT the message data space request
304 $M_MSGDATA_ONLY = FALSE ; Instruct the assembler to include all services
305 ENDIF ; ENDIF
306 IRP repl,<CHARmsg,NUMmsg,TIMEmsg,DATEmsg> ; IF it is a replace service
307 IFIDN <var>,<repl> ;
308 $M_REPLACE = TRUE ; Set replace flag
309 ENDIF ;
310 ENDM ;
311 serv = TRUE ; Let the assembler know about the service
312 $M_SERVICE = TRUE ; Let the macro know it was a service
313 $M_INCLUDE = FALSE ; Let the macro know it wasn't a class
314 ENDIF ; ENDIF
315 ENDM ; NEXT service
316
317MSG_SERVICES2 <varlist>
318 ; Continue further checks (If we add any more predefined
319 ; function to the above IRP command, it generates a
320 ; syntax error. We must continue the processing in another
321 ; MACRO called MSG_SERVICES2)
322
323 IF $M_INCLUDE ; IF message class was requested
324 $M_INC var ; Include it as a message class
325 ENDIF ; ENDIF
326 ENDM ; NEXT variable
327 ;
328 IF $M_SERVICE ; IF it any services were requested THEN
329 INCLUDE MSGSERV.ASM ; THEN include module to get service
330 ENDIF ; ENDIF
331
332ENDM
333;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
334;; MSG_SERVICES2 Macro
335;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
336 ;
337MSG_SERVICES2 Macro varlist2 ; MACRO used in source routine
338 ;
339 ; FOR each variable in the list
340 IRP var2,<varlist2>
341 ; For each service predefined
342 IRP serv2,<SETSTDIO,NOCHECKSTDIN,NOCHECKSTDOUT,DISK_PROC>
343 ;AN003; IF it IS a service (defined above)
344 IFDIF <var2>,<serv2>
345 ELSE ;
346 serv2 = TRUE ; Let the assembler know about the service
347 $M_SERVICE = TRUE ; Let the macro know it was a service
348 $M_INCLUDE = FALSE ; Let the macro know it wasn't a class
349 ENDIF ; ENDIF
350 ENDM ; NEXT service
351 ENDM ; NEXT variable
352ENDM ;
353 ;
354;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
355;; $M_INC Macro
356;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
357 ;
358$M_INC Macro ext ;
359 ;
360INCLUDE &ext ;
361 ;
362ENDM ;
363 ;
364;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
365;; $M_BUILD_PTRS Macro
366;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
367 ;
368$M_BUILD_PTRS Macro nummsg ;
369 ;
370 $M_INDEX = 0 ;
371IF COMR ; IF this is resident COMMAND.COM
372 $M_MAKE_COMR ;
373ELSE ; ELSE
374 IF COMT ; IF this is transient COMMAND.COM
375 $M_MAKE_COMT ;
376 ELSE ; ELSE
377 ;
378 $M_INDEX = 0 ;
379 $M_COUNT = 0 ; Build normal utilities
380 ;
381 REPT nummsg ;
382 $M_COUNT = $M_COUNT + 1 ;
383 $M_MAKE %$M_COUNT ;
384 ENDM ;
385 ENDIF ;
386ENDIF ;
387ENDM ;
388 ;
389;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
390;; $M_MAKE Macro
391;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
392 ;
393$M_MAKE Macro $m_append ;
394IF FARmsg ;
395 CALL FAR PTR $M_CLS_&$m_append ; Get addressibilty to class &$M_APPEND (ES:DI)
396 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX+2,ES ; Move into first avaliable table location
397 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
398ELSE ;
399 CALL $M_CLS_&$m_append ; Get addressibilty to class &$M_APPEND (ES:DI)
400 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
401ENDIF ;
402$M_INDEX = $M_INDEX + 4 ; Set next available table location
403 ;
404ENDM ;
405;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
406;; $M_MAKE_COMR Macro
407;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
408 ;
409$M_MAKE_COMR macro ;
410 ;
411 CALL $M_CLS_3 ; Get addressibilty to class A
412 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
413$M_INDEX = $M_INDEX + 4 ; Set next available table location
414 ;
415 CALL $M_CLS_4 ; Get addressibilty to class B
416 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
417$M_INDEX = $M_INDEX + 4 ; Set next available table location
418 ;
419 CALL $M_CLS_5 ; Get addressibilty to class C
420 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
421$M_INDEX = $M_INDEX + 4 ; Set next available table location
422 ;
423 CALL $M_CLS_6 ; Get addressibilty to class D
424 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
425$M_INDEX = $M_INDEX + 4 ; Set next available table location
426 ;
427 CALL $M_CLS_7 ; Get addressibilty to class E
428 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
429$M_INDEX = $M_INDEX + 4 ; Set next available table location
430 ;
431ENDM ;
432;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
433;; $M_MAKE_COMT Macro
434;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
435 ;
436$M_MAKE_COMT macro ;
437 ;
438 CALL $M_CLS_8 ; Get addressibilty to class A
439 MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
440$M_INDEX = $M_INDEX + 4 ; Set next available table location
441 ;
442ENDM ;
443;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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 @@
1/* return the system variables in sysVars */
2
3#include "sysvar.h"
4#include <dos.h>
5#include "jointype.h"
6
7GetVars(pSVars)
8struct sysVarsType *pSVars ;
9{
10 struct sysVarsType far *vptr ;
11 int i ;
12
13 union REGS ir ;
14 register union REGS *iregs = &ir ; /* Used for DOS calls */
15 struct SREGS syssegs ;
16
17 iregs->h.ah = GETVARS ; /* Function 0x52 */
18 intdosx(iregs, iregs, &syssegs) ;
19
20 *(long *)(&vptr) = (((long)syssegs.es) << 16)+(iregs->x.bx & 0xffffL) ;
21
22 for (i=0 ; i <= sizeof(*pSVars) ; i++)
23 *((char *)pSVars+i) = *((char far *)vptr+i) ;
24
25}
26
27
28
29
30PutVars(pSVars)
31struct sysVarsType *pSVars ;
32{
33 struct sysVarsType far *vptr ;
34 int i ;
35
36 union REGS ir ;
37 register union REGS *iregs = &ir ; /* Used for DOS calls */
38 struct SREGS syssegs ;
39
40 iregs->h.ah = GETVARS ; /* Function 0x52 */
41 intdosx(iregs, iregs, &syssegs) ;
42
43 *(long *)(&vptr) = (((long)syssegs.es) << 16)+(iregs->x.bx & 0xffffL) ;
44
45 for (i=0 ; i <= sizeof(*pSVars) ; i++)
46 *((char far *)vptr+i) = *((char *)pSVars+i) ;
47
48}
49 \ 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 @@
1; SCCSID = @(#)sysvar.asm 1.1 85/04/10
2include version.inc
3
4SysInitVars STRUC
5SYSI_DPB DD ? ; DPB chain
6SYSI_SFT DD ? ; SFT chain
7SYSI_CLOCK DD ? ; CLOCK device
8SYSI_CON DD ? ; CON device
9SYSI_MAXSEC DW ? ; maximum sector size
10SYSI_BUF DD ? ; points to Hashinitvar
11SYSI_CDS DD ? ; CDS list
12SYSI_FCB DD ? ; FCB chain
13SYSI_Keep DW ? ; keep count
14SYSI_NUMIO DB ? ; Number of block devices
15SYSI_NCDS DB ? ; number of CDS's
16SYSI_DEV DD ? ; device list
17SYSI_ATTR DW ? ; null device attribute word
18SYSI_STRAT DW ? ; null device strategy entry point
19SYSI_INTER DW ? ; null device interrupt entry point
20SYSI_NAME DB 8 DUP(?) ; null device name
21SYSI_SPLICE DB 0 ; TRUE -> splicees being done
22SYSI_IBMDOS_SIZE DW ? ; DOS size in paragraphs
23SYSI_IFS_DOSCALL@ DD ? ; IFS DOS service rountine entry
24SYSI_IFS DD ? ; IFS header chain
25SYSI_BUFFERS DW ?,0 ; BUFFERS= values (m,n)
26SYSI_BOOT_DRIVE DB ? ; boot drive A=1 B=2,..
27SYSI_DWMOVE DB 0 ; 1 if 386 machine
28SYSI_EXT_MEM DW 0 ; Extended memory size in KB.
29SysInitVars ENDS
30
31;This is added for more information exchage between DOS, BIOS.
32;DOS will give the pointer to SysInitTable in ES:DI. - J.K. 5/29/86
33SysInitVars_Ext struc
34SYSI_InitVars DD 0 ; Points to the above structure.
35SYSI_Country_Tab DD 0 ; DOS_Country_cdpg_info
36SysInitVars_Ext ends
37
38;The SYSI_BUF of SysInitVars points to the follwong structure
39EMS_MAP_BUFF_SIZE EQU 12 ; EMS map buffer size
40
41Buffinfo STRUC
42Hash_ptr DD ? ; pointer to Hash table
43Hash_count DW ? ; number of Hash entries
44Cache_ptr DD ? ; pointer to secondary cache
45Cache_count DW 0 ; number of secondary cache entries
46
47IF BUFFERFLAG
48
49EMS_SAFE_FLAG DB 1
50EMS_LAST_PAGE DW 0, 0
51EMS_FIRST_PAGE DW 0, 0
52EMS_NPA640 DW 0
53
54ENDIF
55
56EMS_mode DB -1 ; no EMS = -1
57EMS_handle DW ? ; EMS handle for buffers
58EMS_PageFrame_Number DW -1 ; EMS page frame number
59EMS_Seg_Cnt DW 1 ; EMS segment count
60EMS_Page_Frame DW -1 ; EMS page frame segment address
61EMS_reserved DW 0 ; EMS segment count
62
63IF BUFFERFLAG
64EMS_Map_Buff DB 0 ; map buffer
65ELSE
66EMS_Map_Buff DB 12 dup(0)
67ENDIF
68
69Buffinfo ENDS
70
71
72
73
74
75
76
77 \ 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 @@
1; SCCSID = @(#)vector.asm 1.1 85/04/10
2BREAK <interrupt definitions>
3
4Asmvar AltVect
5
6INTTAB EQU 20H
7INTBASE EQU 4 * inttab
8ENTRYPOINT EQU INTBASE+40H
9
10 IF ALTVECT
11ALTTAB EQU 0F0H
12ALTBASE EQU 4 * ALTTAB
13 ENDIF
14
15;
16; interrupt assignments
17;
18 IF NOT ALTVECT
19int_abort EQU INTTAB ; abort process
20int_command EQU int_abort+1 ; call MSDOS
21int_terminate EQU int_abort+2 ; int to terminate address
22int_ctrl_c EQU int_abort+3 ; ^c trapper
23int_fatal_abort EQU int_abort+4 ; hard disk error
24int_disk_read EQU int_abort+5 ; logical sector disk read
25int_disk_write EQU int_abort+6 ; logical sector disk write
26int_keep_process EQU int_abort+7 ; terminate program and stay
27 ; resident
28;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
29; C A V E A T P R O G R A M M E R ;
30; ;
31int_spooler EQU int_abort+8 ; spooler call
32int_fastcon EQU int_abort+9 ; fast CON interrupt
33int_IBM EQU int_abort+10; critical section maintenance
34; ;
35; C A V E A T P R O G R A M M E R ;
36;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
37 ELSE
38int_abort EQU INTTAB ; abort process
39int_command EQU int_abort+1 ; call MSDOS
40int_terminate EQU ALTTAB ; int to terminate address
41int_ctrl_c EQU int_terminate+1 ; ^c trapper
42int_fatal_abort EQU int_terminate+2 ; hard disk error
43int_disk_read EQU int_abort+5 ; logical sector disk read
44int_disk_write EQU int_abort+6 ; logical sector disk write
45int_keep_process EQU int_abort+7 ; terminate program and stay resident
46;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
47; C A V E A T P R O G R A M M E R ;
48; ;
49int_spooler EQU int_terminate+3 ; spooler call
50int_fastcon EQU int_abort+9 ; fast CON interrupt
51; ;
52; C A V E A T P R O G R A M M E R ;
53;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
54 ENDIF
55
56addr_int_abort EQU 4 * int_abort
57addr_int_command EQU 4 * int_command
58addr_int_terminate EQU 4 * int_terminate
59addr_int_ctrl_c EQU 4 * int_ctrl_c
60addr_int_fatal_abort EQU 4 * int_fatal_abort
61addr_int_disk_read EQU 4 * int_disk_read
62addr_int_disk_write EQU 4 * int_disk_write
63addr_int_keep_process EQU 4 * int_keep_process
64;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
65; C A V E A T P R O G R A M M E R ;
66; ;
67addr_int_spooler EQU 4 * int_spooler
68addr_int_fastcon EQU 4 * int_fastcon
69addr_int_IBM EQU 4 * int_IBM
70; ;
71; C A V E A T P R O G R A M M E R ;
72;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
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 @@
1; Some modules really want TRUE to be 0FFH. Best to let them have their way.
2ifndef TRUE
3 TRUE EQU 0FFFFh
4endif
5ifndef TRUEBYTE
6 TRUEBYTE EQU 0FFh
7endif
8ifndef FALSE
9 FALSE EQU 0
10endif
11
12;
13; Use the following switches to control cmacros.inc
14;
15?PLM = 0
16?WIN = 0
17
18memS EQU 1 ; Small model
19;
20; Use the switches below to produce the standard Microsoft version or the IBM
21; version of the operating system
22;
23; The below chart will indicate how to set the switches to build the various
24; versions
25;
26; IBMVER IBMCOPYRIGHT
27; --------------------------------------------------------
28; IBM Version | TRUE TRUE
29; --------------------------------------------------------
30; MS Version | FALSE FALSE
31; --------------------------------------------------------
32; Clone Version | TRUE FALSE
33;
34IBMVER EQU TRUE
35IBMCOPYRIGHT EQU FALSE
36
37BUFFERFLAG EQU NOT IBMCOPYRIGHT
38
39ifndef MSVER
40MSVER EQU NOT IBMVER
41endif
42IBM EQU IBMVER
43;
44;
45 IF1
46 IF IBMVER
47 IF IBMCOPYRIGHT
48 %OUT ... IBM version build switch on ...
49 ELSE
50 %OUT ... CLONE version build switch on ...
51 ENDIF
52 ELSE
53 IF NOT IBMCOPYRIGHT
54 %OUT ... MS version build switch on ...
55 ELSE
56 %OUT !!!!!!!!! VERSION SWITCHES SET INCORECTLY !!!!!!!!!
57 %OUT !!!!!!!!! CHECK SETTINGS IN INC\VERSION.INC !!!!!!!!!
58 ENDIF
59 ENDIF
60 ENDIF
61;
62;
63;***************************************************************************
64;* The following switches are for DBCS or SBCS support *
65;* *
66;* Set INTERNAT EQU TRUE FOR DBCS *
67;* Set INTERNAT EQU FALSE FOR SBCS *
68;* *
69;***************************************************************************
70;
71IBMJAPVER EQU FALSE ;If TRUE set KANJI true also
72
73;
74; Switch INTERNAT for DBCS support
75;
76INTERNAT EQU FALSE
77;
78 IF INTERNAT
79KANJI EQU TRUE
80IBMJAPAN EQU TRUE
81 ELSE
82KANJI EQU FALSE
83IBMJAPAN EQU FALSE
84 ENDIF
85
86ifndef altvect ; avoid jerking off vector.inc
87ALTVECT EQU FALSE ;Switch to build ALTVECT version
88endif
89
90;
91; Country code switches
92; The default contry code is assumed as USA.
93;
94 IF INTERNAT
95 KOREA EQU TRUE
96 JAPAN EQU FALSE
97 ELSE
98 KOREA EQU FALSE
99 JAPAN EQU FALSE
100 ENDIF
101;
102 IF1
103 IF INTERNAT
104%OUT Internat(ECS) version build switch on
105 ENDIF
106 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 @@
1
2major_version equ 4 ;Major DOS version
3minor_version equ 00 ;Minor DOS Version
4
5expected_version equ (MINOR_VERSION SHL 8)+MAJOR_VERSION
6
7 if1
8 %OUT ... for DOS Version 4.00 ...
9 endif
10
11 ;******************************
12 ;Each assembler program should:
13 ; mov ah,030h ;DOS Get Version function
14 ; int 021h ;Version ret. in AX,minor version first
15 ; cmp ax,expected_version ;ALL utilities should check for an
16 ; jne error_handler ; EXACT version match.
17 ;******************************
18
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 @@
1; This is for contry Yes and No
2 PUBLIC NLS_YES,NLS_yes2,NLS_NO,NLS_no2
3include msdos.cl3
4 \ 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 @@
1page 60,132
2name _parse
3title C to PARSER interface
4;-------------------------------------------------------------------
5;
6; MODULE: _parse
7;
8; PURPOSE: Supplies an interface between C programs and
9; the DOS 3.30 parser
10;
11; CALLING FORMAT:
12; parse(&inregs,&outregs);
13;
14; DATE: 5-21-87
15;
16;-------------------------------------------------------------------
17
18; extrn sysparse:far
19
20 public _parse
21
22;-------------------------------------------------------------------
23
24; SET FOR SUBST
25; -------------
26
27FarSW equ 0 ; make sysparse be a NEAR proc
28TimeSW equ 0 ; Check time format
29FileSW equ 1 ; Check file specification
30CAPSW equ 1 ; Perform CAPS if specified
31CmpxSW equ 0 ; Check complex list
32NumSW equ 0 ; Check numeric value
33KeySW equ 0 ; Support keywords
34SwSW equ 1 ; Support switches
35Val1SW equ 0 ; Support value definition 1
36Val2SW equ 0 ; Support value definition 2
37Val3SW equ 0 ; Support value definition 3
38DrvSW equ 1 ; Support drive only format
39QusSW equ 0 ; Support quoted string format
40;-------------------------------------------------------------------
41
42_DATA segment byte public 'DATA'
43_DATA ends
44
45_TEXT segment byte public 'CODE'
46
47 ASSUME CS: _TEXT
48 ASSUME DS: _DATA
49
50;-------------------------------------------------------------------
51include parse.asm ; include the parser
52;-------------------------------------------------------------------
53
54_parse proc near
55
56 push bp ; save user's base pointer
57 mov bp,sp ; set bp to current sp
58 push di ; save some registers
59 push si
60
61; copy C inregs into proper registers
62
63 mov di,[bp+4] ; fix di (arg 0)
64
65;-------------------------------------------------------------------
66
67 mov ax,[di+0ah] ; load di
68 push ax ; the di value from inregs is now on stack
69
70 mov ax,[di+00] ; get inregs.x.ax
71 mov bx,[di+02] ; get inregs.x.bx
72 mov cx,[di+04] ; get inregs.x.cx
73 mov dx,[di+06] ; get inregs.x.dx
74 mov si,[di+08] ; get inregs.x.si
75 pop di ; get inregs.x.di from stack
76
77 push bp ; save base pointer
78
79; int 3 ; debugger
80
81;-------------------------------------------------------------------
82 call sysparse ; call the parser
83;-------------------------------------------------------------------
84
85; int 3 ; debugger
86
87 pop bp ; restore base pointer
88 push di ; the di value from call is now on stack
89 mov di,[bp+6] ; fix di (arg 1)
90
91 mov [di+00],ax ; load outregs.x.ax
92 mov [di+02],bx ; load outregs.x.bx
93 mov [di+04],cx ; load outregs.x.cx
94 mov [di+06],dx ; load outregs.x.dx
95 mov [di+08],si ; load outregs.x.si
96
97 xor ax,ax ; clear ax
98 lahf ; get flags into ax
99 mov [di+0ch],ax ; load outregs.x.cflag
100
101 pop ax ; get di from stack
102 mov [di+0ah],ax ; load outregs.x.di
103
104;-------------------------------------------------------------------
105
106 pop si ; restore registers
107 pop di
108 mov sp,bp ; restore sp
109 pop bp ; restore user's bp
110 ret
111
112_parse endp
113
114_TEXT ends ; end code segment
115 end
116
117 \ No newline at end of file