     1                                  ;*****************************************************************************
     2                                  ;*****************************************************************************
     3                                  ;UTILITY NAME: FORMAT.COM
     4                                  ;
     5                                  ;MODULE NAME: FORINIT.SAL
     6                                  ;
     7                                  ;
     8                                  ;
     9                                  ; =============
    10                                  ; = Main_Init =
    11                                  ; =============
    12                                  ;   =
    13                                  ;   ====================     ==================
    14                                  ;   ==Init_Input_Output=======Preload_Messages=
    15                                  ;   ====================    ===================
    16                                  ;   =			    ======================   =====================
    17                                  ;   =			    ==Check_For_FS_Switch=====Parse_For_FS_Switch=
    18                                  ;   =			    ======================  ======================
    19                                  ;   =			    =			    =================
    20                                  ;   =			    =			    ==EXEC_FS_Format=
    21                                  ;   =			    =			     ================
    22                                  ;   =			    ======================   =================
    23                                  ;   =			    ==Parse_Command_Line =====Interpret_Parse=
    24                                  ;   =			     =====================   =================
    25                                  ;   ======================== ====================
    26                                  ;   ==Validate_Target_Drive===Check_Target_Drive=
    27                                  ;   =============================================
    28                                  ;   =			    ====================
    29                                  ;   =			    ==Check_For_Network=
    30                                  ;   =			    ====================
    31                                  ;   =			    ========================
    32                                  ;   =			    ==Check_Translate_Drive=
    33                                  ;   =			     =======================
    34                                  ;   ===============
    35                                  ;   ==Hook_CNTRL_C=
    36                                  ;    ==============
    37                                  ;
    38                                  ;
    39                                  ; Change List: AN000 - New code DOS 3.3 spec additions
    40                                  ;	       AC000 - Changed code DOS 3.3 spec additions
    41                                  ;*****************************************************************************
    42                                  ;*****************************************************************************
    43                                  
    44                                  section data public align=16 class=DATA
    45                                  
    46                                  
    47 00000000 00                      Command_Line db NO
    48 00000001 0000                    PSP_Segment dw	0
    49                                  
    50                                  ;These should stay togather
    51                                  ; ---------------------------------------	;				;AN000;
    52 00000003 202020202020202020-     FS_String_Buffer db 13 dup(" ") 		;				;AN000;
    52 0000000C 20202020           
    53 00000010 464D542E45584500        FS_String_End db "FMT.EXE",0			;				;AN000;
    54                                  Len_FS_String_End equ $ - FS_String_End 	;				;AN000;
    55                                  						;				;AN000;
    56                                  ;----------------------------------------
    57                                  
    58 00000018 80                      Vol_Label_Count  db 80h 			;an000; dms;max. string length
    59 00000019 00                      Vol_Label_Len	 db 00h 			;an000; dms;len. entered
    60 0000001A 000000000000000000-     Vol_Label_Buffer db 80h dup(0)			;				;AN000;
    60 00000023 000000000000000000-
    60 0000002C 000000000000000000-
    60 00000035 000000000000000000-
    60 0000003E 000000000000000000-
    60 00000047 000000000000000000-
    60 00000050 000000000000000000-
    60 00000059 000000000000000000-
    60 00000062 000000000000000000-
    60 0000006B 000000000000000000-
    60 00000074 000000000000000000-
    60 0000007D 000000000000000000-
    60 00000086 000000000000000000-
    60 0000008F 000000000000000000-
    60 00000098 0000               
    61                                  Vol_Label_Buffer_Length equ $ - Vol_Label_Buffer ;				 ;AN000;
    62                                  
    63 0000009A 000000000000000000-     Command_Line_Buffer db 80h dup(0)		;				;AN000;
    63 000000A3 000000000000000000-
    63 000000AC 000000000000000000-
    63 000000B5 000000000000000000-
    63 000000BE 000000000000000000-
    63 000000C7 000000000000000000-
    63 000000D0 000000000000000000-
    63 000000D9 000000000000000000-
    63 000000E2 000000000000000000-
    63 000000EB 000000000000000000-
    63 000000F4 000000000000000000-
    63 000000FD 000000000000000000-
    63 00000106 000000000000000000-
    63 0000010F 000000000000000000-
    63 00000118 0000               
    64                                  Command_Line_Length equ $ - Command_Line_Buffer ;				;AN000;
    65 0000011A 00                      Fatal_Error db	0				;				;AN000;
    66                                  
    67 0000011B ????                    Command_Old_Ptr dw	?
    68                                  
    69                                  ; (no prior section) ; data	ends
    70                                  
    71                                  section code public align=16 class=CODE
    72                                  	assume	cs:code,ds:data,es:data
    73                                  ; (no prior section) ; code	ends
    74                                  
    75                                  ;
    76                                  ;*****************************************************************************
    77                                  ; Include files
    78                                  ;*****************************************************************************
    79                                  ;
    80                                  
    81                                  [list -]
   134                              <1> 
    83                                  %include "formacro.mac"
     1                              <1> ;
     2                              <1> ;******************************************************************************
     3                              <1> ; Message Macro Definitions
     4                              <1> ;******************************************************************************
     5                              <1> ;
     6                              <1> 
     7                              <1>       EXTRN Display_Interface:near
     8                              <1> 
     9                              <1> 
    10                              <1> ; NASM original macros
    11                              <1> 
    12                              <1> ;-----------------------------------------------------------------------------
    13                              <1> 
    14                              <1> %imacro Message 1.nolist
    15                              <1>         mov     dx,offset %1 wrt data
    16                              <1>         call    Display_Interface
    17                              <1> %endmacro
    18                              <1> 
    19                              <1> ;-----------------------------------------------------------------------------
    20                              <1> 
    21                              <1> %imacro Parse_Message 0.nolist
    22                              <1>         push    ds
    23                              <1>         mov     dx,data
    24                              <1>         mov     ds,dx
    25                              <1>         mov     word ptr [Parse_Error_Msg],ax
    26                              <1>         mov     dx,offset Parse_Error_Msg       ;                               ;AN000;
    27                              <1>         call    Display_Interface               ;                               ;AN000;
    28                              <1>         pop     ds                              ;
    29                              <1> %endmacro
    30                              <1> 
    31                              <1> ;-----------------------------------------------------------------------------
    32                              <1> 
    33                              <1> %imacro Extended_Message 0.nolist
    34                              <1>         push    ds
    35                              <1>         mov     dx,data
    36                              <1>         mov     ds,dx
    37                              <1>         mov     word ptr [Extended_Error_Msg],ax
    38                              <1>         mov     dx,offset Extended_Error_Msg wrt data
    39                              <1>         call    Display_Interface               ;                               ;AN000;
    40                              <1>         pop     ds
    41                              <1> %endmacro
    42                              <1> 
    43                              <1> ;
    44                              <1> ;*****************************************************************************
    45                              <1> ; General Macro's
    46                              <1> ;*****************************************************************************
    47                              <1> ;
    48                              <1> 
    49                              <1> %imacro Procedure 1.nolist
    50                              <1> %1    proc
    51                              <1> Public  %1
    52                              <1> %endmacro
    53                              <1> 
    54                              <1> ;-----------------------------------------------------------------------------
    55                              <1> 
    56                              <1> %imacro DOS_Call 1.nolist
    57                              <1>         mov     ah, %1
    58                              <1>         int     21h
    59                              <1> %endmacro
    60                              <1> ;-----------------------------------------------------------------------------
    61                              <1> 
    62                              <1> %imacro Popff 0.nolist
    63                              <1>         jmp strict short $+3
    64                              <1>         iret
    65                              <1>         push cs
    66                              <1>         call near $-2
    67                              <1> %endmacro
    68                              <1> 
    69                              <1> ;-----------------------------------------------------------------------------
    70                              <1> 
    71                              <1> %imacro Set_Data_Segment 0.nolist
    72                              <1>         push    ax
    73                              <1>         mov     ax,data                         ;Point to data segment
    74                              <1>         mov     ds,ax                           ;
    75                              <1>         push    ds
    76                              <1>         pop     es
    77                              <1>         pop     ax
    78                              <1> assume  ds:data,es:data
    79                              <1> %endmacro
    80                              <1> 
    81                              <1> ; end of NASM original macros
    84                                  %include "syscall.mac"
     1                              <1> ;	SCCSID = @(#)syscall.asm	1.1 85/04/10
     2                              <1> ;BREAK <system call definitions>
     3                              <1> ;SUBTTL	system call definitions
     4                              <1> ;PAGE
     5                              <1> 
     6                              <1> Abort				EQU 0	;  0	  0
     7                              <1> Std_Con_Input			EQU 1	;  1	  1
     8                              <1> Std_Con_Output			EQU 2	;  2	  2
     9                              <1> Std_Aux_Input			EQU 3	;  3	  3
    10                              <1> Std_Aux_Output			EQU 4	;  4	  4
    11                              <1> Std_Printer_Output		EQU 5	;  5	  5
    12                              <1> Raw_Con_IO			EQU 6	;  6	  6
    13                              <1> Raw_Con_Input			EQU 7	;  7	  7
    14                              <1> Std_Con_Input_No_Echo		EQU 8	;  8	  8
    15                              <1> Std_Con_String_Output		EQU 9	;  9	  9
    16                              <1> Std_Con_String_Input		EQU 10	; 10	  A
    17                              <1> Std_Con_Input_Status		EQU 11	; 11	  B
    18                              <1> Std_Con_Input_Flush		EQU 12	; 12	  C
    19                              <1> Disk_Reset			EQU 13	; 13	  D
    20                              <1> Set_Default_Drive		EQU 14	; 14	  E
    21                              <1> FCB_Open			EQU 15	; 15	  F
    22                              <1> FCB_Close			EQU 16	; 16	 10
    23                              <1> Dir_Search_First		EQU 17	; 17	 11
    24                              <1> Dir_Search_Next 		EQU 18	; 18	 12
    25                              <1> FCB_Delete			EQU 19	; 19	 13
    26                              <1> FCB_Seq_Read			EQU 20	; 20	 14
    27                              <1> FCB_Seq_Write			EQU 21	; 21	 15
    28                              <1> FCB_Create			EQU 22	; 22	 16
    29                              <1> FCB_Rename			EQU 23	; 23	 17
    30                              <1> Get_Default_Drive		EQU 25	; 25	 19
    31                              <1> Set_DMA 			EQU 26	; 26	 1A
    32                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    33                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    34                              <1> ;									   ;
    35                              <1> Get_Default_DPB 		EQU 31	; 31	 1F
    36                              <1> ;									   ;
    37                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    38                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    39                              <1> FCB_Random_Read 		EQU 33	; 33	 21
    40                              <1> FCB_Random_Write		EQU 34	; 34	 22
    41                              <1> Get_FCB_File_Length		EQU 35	; 35	 23
    42                              <1> Get_FCB_Position		EQU 36	; 36	 24
    43                              <1> Set_Interrupt_Vector		EQU 37	; 37	 25
    44                              <1> Create_Process_Data_Block	EQU 38	; 38	 26
    45                              <1> FCB_Random_Read_Block		EQU 39	; 39	 27
    46                              <1> FCB_Random_Write_Block		EQU 40	; 40	 28
    47                              <1> Parse_File_Descriptor		EQU 41	; 41	 29
    48                              <1> Get_Date			EQU 42	; 42	 2A
    49                              <1> Set_Date			EQU 43	; 43	 2B
    50                              <1> Get_Time			EQU 44	; 44	 2C
    51                              <1> Set_Time			EQU 45	; 45	 2D
    52                              <1> Set_Verify_On_Write		EQU 46	; 46	 2E
    53                              <1> ; Extended functionality group
    54                              <1> Get_DMA 			EQU 47	; 47	 2F
    55                              <1> Get_Version			EQU 48	; 48	 30
    56                              <1> Keep_Process			EQU 49	; 49	 31
    57                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    58                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    59                              <1> ;									   ;
    60                              <1> Get_DPB 			EQU 50	; 50	 32
    61                              <1> ;									   ;
    62                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    63                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    64                              <1> Set_CTRL_C_Trapping		EQU 51	; 51	 33
    65                              <1> Get_InDOS_Flag			EQU 52	; 52	 34
    66                              <1> Get_Interrupt_Vector		EQU 53	; 53	 35
    67                              <1> Get_Drive_Freespace		EQU 54	; 54	 36
    68                              <1> Char_Oper			EQU 55	; 55	 37
    69                              <1> International			EQU 56	; 56	 38
    70                              <1> ;   Directory Group
    71                              <1> MKDir				EQU 57	; 57	 39
    72                              <1> RMDir				EQU 58	; 58	 3A
    73                              <1> CHDir				EQU 59	; 59	 3B
    74                              <1> ;   File Group
    75                              <1> Creat				EQU 60	; 60	 3C
    76                              <1> Open				EQU 61	; 61	 3D
    77                              <1> Close				EQU 62	; 62	 3E
    78                              <1> Read				EQU 63	; 63	 3F
    79                              <1> Write				EQU 64	; 64	 40
    80                              <1> Unlink				EQU 65	; 65	 41
    81                              <1> LSeek				EQU 66	; 66	 42
    82                              <1> CHMod				EQU 67	; 67	 43
    83                              <1> IOCtl				EQU 68	; 68	 44
    84                              <1> XDup				EQU 69	; 69	 45
    85                              <1> XDup2				EQU 70	; 70	 46
    86                              <1> Current_Dir			EQU 71	; 71	 47
    87                              <1> ;    Memory Group
    88                              <1> Alloc				EQU 72	; 72	 48
    89                              <1> Dealloc 			EQU 73	; 73	 49
    90                              <1> Setblock			EQU 74	; 74	 4A
    91                              <1> ;    Process Group
    92                              <1> Exec				EQU 75	; 75	 4B
    93                              <1> Exit				EQU 76	; 76	 4C
    94                              <1> WaitProcess			EQU 77	; 77	 4D
    95                              <1> Find_First			EQU 78	; 78	 4E
    96                              <1> ;   Special Group
    97                              <1> Find_Next			EQU 79	; 79	 4F
    98                              <1> ; SPECIAL SYSTEM GROUP
    99                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   100                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   101                              <1> ;									   ;
   102                              <1> Set_Current_PDB 		EQU 80	; 80	 50
   103                              <1> Get_Current_PDB 		EQU 81	; 81	 51
   104                              <1> Get_In_Vars			EQU 82	; 82	 52
   105                              <1> SetDPB				EQU 83	; 83	 53
   106                              <1> ;									   ;
   107                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   108                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   109                              <1> Get_Verify_On_Write		EQU 84	; 84	 54
   110                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   111                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   112                              <1> ;									   ;
   113                              <1> Dup_PDB 			EQU 85	; 85	 55
   114                              <1> ;									   ;
   115                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   116                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   117                              <1> Rename				EQU 86	; 86	 56
   118                              <1> File_Times			EQU 87	; 87	 57
   119                              <1> AllocOper			EQU 88	; 88	 58
   120                              <1> ; Network extention system calls
   121                              <1> GetExtendedError		EQU 89	; 89	 59
   122                              <1> CreateTempFile			EQU 90	; 90	 5A
   123                              <1> CreateNewFile			EQU 91	; 91	 5B
   124                              <1> LockOper			EQU 92	; 92	 5C Lock and Unlock
   125                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   126                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   127                              <1> ;									   ;
   128                              <1> ServerCall			EQU 93	; 93	 5D CommitAll, ServerDOSCall,
   129                              <1> 					;	    CloseByName, CloseUser,
   130                              <1> 					;	    CloseUserProcess,
   131                              <1> 					;	    GetOpenFileList
   132                              <1> ;									   ;
   133                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   134                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   135                              <1> UserOper			EQU 94	; 94	 5E Get and Set
   136                              <1> AssignOper			EQU 95	; 95	 5F On, Off, Get, Set, Cancel
   137                              <1> xNameTrans			EQU 96	; 96	 60
   138                              <1> PathParse			EQU 97	; 97	 61
   139                              <1> GetCurrentPSP			EQU 98	; 98	 62
   140                              <1> Hongeul 			EQU 99	; 99	 63
   141                              <1> ECS_CALL			EQU 99	; 99	 63  ;; DBCS support
   142                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   143                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   144                              <1> ;									   ;
   145                              <1> Set_Printer_Flag		EQU 100 ; 100	 64
   146                              <1> ;									   ;
   147                              <1> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   148                              <1> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   149                              <1> GetExtCntry			EQU 101 ; 101	 65
   150                              <1> GetSetCdPg			EQU 102 ; 102	 66
   151                              <1> ExtHandle			EQU 103 ; 103	 67
   152                              <1> Commit				EQU 104 ; 104	 68
   153                              <1> GetSetMediaID			EQU 105 ; 105	 69
   154                              <1> IFS_IOCTL			EQU 107 ; 107	 6B
   155                              <1> ExtOpen 			EQU 108 ; 108	 6C
   156                              <1> ;
   157                              <1> ;
   158                              <1> Set_Oem_Handler 		EQU 248 ; 248	 F8
   159                              <1> OEM_C1				EQU 249 ; 249	 F9
   160                              <1> OEM_C2				EQU 250 ; 250	 FA
   161                              <1> OEM_C3				EQU 251 ; 251	 FB
   162                              <1> OEM_C4				EQU 252 ; 252	 FC
   163                              <1> OEM_C5				EQU 253 ; 253	 FD
   164                              <1> OEM_C6				EQU 254 ; 254	 FE
   165                              <1> OEM_C7				EQU 255 ; 255	 FF
    85                                  %include "ioctl.mac"
     1                              <1> 
     2                              <1> %warning out: IOCTL.INC...
     2          ******************  <1>  warning: out: IOCTL.INC... [-w+user]
     3                              <1> ; THESE ARE ALL THE IMPORTANT STRUCTURES AND EQUATES FOR IOCTL
     4                              <1> ;==============================================================================
     5                              <1> ;REVISION HISTORY:
     6                              <1> ;AN000 - New for DOS Version 4.00 - J.K.
     7                              <1> ;AC000 - Changed for DOS Version 4.00 - J.K.
     8                              <1> ;AN00x - PTM number for DOS Version 4.00 - J.K.
     9                              <1> ;==============================================================================
    10                              <1> ;AN001; D241 Provide support of Multi-track Format/Verify	   9/23/87 J.K.
    11                              <1> ;AN002; P1535 Unformatted hard file problem			  10/15/87 J.K.
    12                              <1> ;AN003; D490 IOCTL subfunction 63h,43h,64h,44h conflicts with OS2  2/26/88 J.K.
    13                              <1> ;==============================================================================
    14                              <1> 
    15                              <1> ;*** J.K.
    16                              <1> ;General Guide -
    17                              <1> ;Category Code:
    18                              <1> ; 0... .... DOS Defined
    19                              <1> ; 1... .... User defined
    20                              <1> ; .xxx xxxx Code
    21                              <1> 
    22                              <1> ;Function Code:
    23                              <1> ; 0... .... Return error if unsupported
    24                              <1> ; 1... .... Ignore if unsupported
    25                              <1> ; .0.. .... Intercepted by DOS
    26                              <1> ; .1.. .... Passed to driver
    27                              <1> ; ..0. .... Sends data/commands to device
    28                              <1> ; ..1. .... Quries data/info from device
    29                              <1> ; ...x .... Subfunction
    30                              <1> ;
    31                              <1> ; Note that "Sends/queries" data bit is intended only to regularize the
    32                              <1> ; function set.  It plays no critical role; some functions may contain both
    33                              <1> ; command and query elements. The convention is that such commands are
    34                              <1> ; defined as "sends data".
    35                              <1> 
    36                              <1> ;*****************************;*
    37                              <1> ; BLOCK DRIVERS 	      ;*
    38                              <1> ;*****************************;*
    39                              <1> 
    40                              <1> ; IOCTL SUB-FUNCTIONS
    41                              <1> IOCTL_GET_DEVICE_INFO	EQU	0
    42                              <1> IOCTL_SET_DEVICE_INFO	EQU	1
    43                              <1> IOCTL_READ_HANDLE	EQU	2
    44                              <1> IOCTL_WRITE_HANDLE	EQU	3
    45                              <1> IOCTL_READ_DRIVE	EQU	4
    46                              <1> IOCTL_WRITE_DRIVE	EQU	5
    47                              <1> IOCTL_GET_INPUT_STATUS	EQU	6
    48                              <1> IOCTL_GET_OUTPUT_STATUS EQU	7
    49                              <1> IOCTL_CHANGEABLE?	EQU	8
    50                              <1> IOCTL_DeviceLocOrRem?	EQU	9
    51                              <1> IOCTL_HandleLocOrRem?	EQU	0Ah   ;10
    52                              <1> IOCTL_SHARING_RETRY	EQU	0Bh   ;11
    53                              <1> GENERIC_IOCTL_HANDLE	EQU	0Ch   ;12
    54                              <1> GENERIC_IOCTL		EQU	0Dh   ;13
    55                              <1> 
    56                              <1> ; GENERIC IOCTL CATEGORY CODES
    57                              <1> IOC_OTHER		EQU	0	; Other device control J.K. 4/29/86
    58                              <1> IOC_SE			EQU	1	; SERIAL DEVICE CONTROL
    59                              <1> IOC_TC			EQU	2	; TERMINAL CONTROL
    60                              <1> IOC_SC			EQU	3	; SCREEN CONTROL
    61                              <1> IOC_KC			EQU	4	; KEYBOARD CONTROL
    62                              <1> IOC_PC			EQU	5	; PRINTER CONTROL
    63                              <1> IOC_DC			EQU	8	; DISK CONTROL (SAME AS RAWIO)
    64                              <1> 
    65                              <1> ; GENERIC IOCTL SUB-FUNCTIONS
    66                              <1> RAWIO			EQU	8
    67                              <1> 
    68                              <1> ; RAWIO SUB-FUNCTIONS
    69                              <1> GET_DEVICE_PARAMETERS	EQU	60H
    70                              <1> SET_DEVICE_PARAMETERS	EQU	40H
    71                              <1> READ_TRACK		EQU	61H
    72                              <1> WRITE_TRACK		EQU	41H
    73                              <1> VERIFY_TRACK		EQU	62H
    74                              <1> FORMAT_TRACK		EQU	42H
    75                              <1> GET_MEDIA_ID		EQU	66h		;AN000;AN003;changed from 63h
    76                              <1> SET_MEDIA_ID		EQU	46h		;AN000;AN003;changed from 43h
    77                              <1> GET_ACCESS_FLAG 	EQU	67h		;AN002;AN003;Unpublished function.Changed from 64h
    78                              <1> SET_ACCESS_FLAG 	EQU	47h		;AN002;AN003;Unpublished function.Changed from 44h
    79                              <1> 
    80                              <1> ; SPECIAL FUNCTION FOR GET DEVICE PARAMETERS
    81                              <1> BUILD_DEVICE_BPB	EQU	000000001B
    82                              <1> 
    83                              <1> ; SPECIAL FUNCTIONS FOR SET DEVICE PARAMETERS
    84                              <1> INSTALL_FAKE_BPB	EQU	000000001B
    85                              <1> ONLY_SET_TRACKLAYOUT	EQU	000000010B
    86                              <1> TRACKLAYOUT_IS_GOOD	EQU	000000100B
    87                              <1> 
    88                              <1> ; SPECIAL FUNCTION FOR FORMAT TRACK
    89                              <1> STATUS_FOR_FORMAT		EQU	000000001B
    90                              <1> DO_FAST_FORMAT			equ	000000010B	;AN001;
    91                              <1> ; CODES RETURNED FROM FORMAT STATUS CALL
    92                              <1> FORMAT_NO_ROM_SUPPORT		EQU	000000001B
    93                              <1> FORMAT_COMB_NOT_SUPPORTED	EQU	000000010B
    94                              <1> 
    95                              <1> ; DEVICETYPE VALUES
    96                              <1> MAX_SECTORS_IN_TRACK	EQU	63	; MAXIMUM SECTORS ON A DISK.(Was 40 in DOS 3.2)
    97                              <1> DEV_5INCH		EQU	0
    98                              <1> DEV_5INCH96TPI		EQU	1
    99                              <1> DEV_3INCH720KB		EQU	2
   100                              <1> DEV_8INCHSS		EQU	3
   101                              <1> DEV_8INCHDS		EQU	4
   102                              <1> DEV_HARDDISK		EQU	5
   103                              <1> DEV_OTHER		EQU	7
   104                              <1> 
   105                              <1> MAX_DEV_TYPE		EQU	7	; MAXIMUM DEVICE TYPE THAT WE
   106                              <1> 					; CURRENTLY SUPPORT.
   107                              <1> 
   108                              <1> %include "bpb.mac"
     1                              <2> 	%warning out: BPB.INC...
     1          ******************  <2>  warning: out: BPB.INC... [-w+user]
     2                              <2> ;	SCCSID = @(#)BPB.ASM	1.1 85/04/29
     3                              <2> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     4                              <2> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     5                              <2> ;									   ;
     6                              <2> 
     7                              <2> ; BIOS PARAMETER BLOCK DEFINITION
     8                              <2> ; THIS STRUCTURE IS USED TO BUILD A FULL DPB
     9                              <2> 
    10                              <2> BPBLOCK STRUC
    11 00000000 ????                <2> BPSECSZ DW	?			; SIZE IN BYTES OF PHYSICAL SECTOR
    12 00000002 ??                  <2> BPCLUS	DB	?			; SECTORS/ALLOC UNIT
    13 00000003 ????                <2> BPRES	DW	?			; NUMBER OF RESERVED SECTORS
    14 00000005 ??                  <2> BPFTCNT DB	?			; NUMBER OF FATS
    15 00000006 ????                <2> BPDRCNT DW	?			; NUMBER OF DIRECTORY ENTRIES
    16 00000008 ????                <2> BPSCCNT DW	?			; TOTAL NUMBER OF SECTORS
    17 0000000A ??                  <2> BPMEDIA DB	?			; MEDIA DESCRIPTOR BYTE
    18 0000000B ????                <2> BPFTSEC DW	?			; NUMBER OF SECTORS TAKEN UP BY ONE FAT
    19                              <2> BPBLOCK ENDS
    20                              <2> 
    21                              <2> A_BPB			STRUC
    22 00000000 ????                <2> BPB_BYTESPERSECTOR	DW	?
    23 00000002 ??                  <2> BPB_SECTORSPERCLUSTER	DB	?
    24 00000003 ????                <2> BPB_RESERVEDSECTORS	DW	?
    25 00000005 ??                  <2> BPB_NUMBEROFFATS	DB	?
    26 00000006 ????                <2> BPB_ROOTENTRIES 	DW	?
    27 00000008 ????                <2> BPB_TOTALSECTORS	DW	?
    28 0000000A ??                  <2> BPB_MEDIADESCRIPTOR	DB	?
    29 0000000B ????                <2> BPB_SECTORSPERFAT	DW	?
    30 0000000D ????                <2> BPB_SECTORSPERTRACK	DW	?
    31 0000000F ????                <2> BPB_HEADS		DW	?
    32 00000011 ????                <2> BPB_HIDDENSECTORS	DW	?
    33 00000013 ????                <2> 			DW	?
    34 00000015 ????                <2> BPB_BIGTOTALSECTORS	DW	?
    35 00000017 ????                <2> 			DW	?
    36 00000019 ????????????        <2> 			DB	6 DUP(?)
    37                              <2> A_BPB			ENDS
    38                              <2> ;									   ;
    39                              <2> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    40                              <2> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   109                              <1> 
   110                              <1> A_SECTORTABLE	    STRUC
   111 00000000 ????                <1> ST_SECTORNUMBER 	DW	?
   112 00000002 ????                <1> ST_SECTORSIZE		DW	?
   113                              <1> A_SECTORTABLE	    ENDS
   114                              <1> 
   115                              <1> A_DEVICEPARAMETERS  STRUC
   116 00000000 ??                  <1> DP_SPECIALFUNCTIONS	DB	?
   117 00000001 ??                  <1> DP_DEVICETYPE		DB	?
   118 00000002 ????                <1> DP_DEVICEATTRIBUTES	DW	?
   119 00000004 ????                <1> DP_CYLINDERS		DW	?
   120 00000006 ??                  <1> DP_MEDIATYPE		DB	?
   121 00000007 <res 1Fh>           <1> DP_BPB			DB	A_BPB_struc_size DUP (?)
   122 00000026 ????                <1> DP_TRACKTABLEENTRIES	DW	?
   123 00000028 <res FCh>           <1> DP_SECTORTABLE		DB MAX_SECTORS_IN_TRACK * A_SECTORTABLE_struc_size DUP (?)
   124                              <1> A_DEVICEPARAMETERS  ENDS
   125                              <1> 
   126                              <1> A_TRACKREADWRITEPACKET STRUC
   127 00000000 ??                  <1> TRWP_SPECIALFUNCTIONS	DB	?
   128 00000001 ????                <1> TRWP_HEAD		DW	?
   129 00000003 ????                <1> TRWP_CYLINDER		DW	?
   130 00000005 ????                <1> TRWP_FIRSTSECTOR	DW	?
   131 00000007 ????                <1> TRWP_SECTORSTOREADWRITE DW	?
   132 00000009 ????????            <1> TRWP_TRANSFERADDRESS	DD	?
   133                              <1> A_TRACKREADWRITEPACKET ENDS
   134                              <1> 
   135                              <1> ;AN001; - FP_TRACKCOUNT is only meaningful when FP_SPECIALFUNCTIONS bit 1 = 1.
   136                              <1> A_FORMATPACKET	    STRUC
   137 00000000 ??                  <1> FP_SPECIALFUNCTIONS	DB	?
   138 00000001 ????                <1> FP_HEAD 		DW	?
   139 00000003 ????                <1> FP_CYLINDER		DW	?
   140 00000005 ????                <1> FP_TRACKCOUNT		DW	? ;1
   141                              <1> A_FORMATPACKET	    ENDS
   142                              <1> 
   143                              <1> A_VERIFYPACKET	    STRUC
   144 00000000 ??                  <1> VP_SPECIALFUNCTIONS	DB	?
   145 00000001 ????                <1> VP_HEAD 		DW	?
   146 00000003 ????                <1> VP_CYLINDER		DW	?
   147                              <1> A_VERIFYPACKET	    ENDS
   148                              <1> 
   149                              <1> A_MEDIA_ID_INFO     STRUC
   150 00000000 ????                <1> MI_LEVEL		DW	? ;0		;J.K. 87 Info. level
   151 00000002 ????????            <1> MI_SERIAL		DD	?		;J.K. 87 Serial #
   152 00000006 <res Bh>            <1> MI_LABEL		DB     11 DUP (?) ;(' ')     ;J.K. 87 volume label
   153 00000011 ????????????????    <1> MI_SYSTEM		DB	8 DUP (?) ;(' ')     ;J.K. 87 File system type
   154                              <1> A_MEDIA_ID_INFO     ENDS
   155                              <1> 
   156                              <1> A_DISKACCESS_CONTROL	STRUC			;AN002; Unpublished function. Only for Hard file.
   157 00000000 ??                  <1> DAC_SPECIALFUNCTIONS	DB	? ;0		;AN002; Always 0
   158 00000001 ??                  <1> DAC_ACCESS_FLAG 	DB	? ;0		;AN002; Non Zero - allow disk I/O to unformatted hard file
   159                              <1> A_DISKACCESS_CONTROL	ENDS			;AN002; 0 - Disallow disk I/O to unformatted hard file
   160                              <1> 
   161                              <1> ;********************************;*
   162                              <1> ; CHARACTER DEVICES (PRINTERS)	 ;*
   163                              <1> ;********************************;*
   164                              <1> 
   165                              <1> ;RAWIO SUB-FUNCTIONS
   166                              <1> GET_RETRY_COUNT 	EQU	65H
   167                              <1> SET_RETRY_COUNT 	EQU	45H
   168                              <1> 
   169                              <1> A_RETRYCOUNT	    STRUC
   170 00000000 ????                <1> RC_COUNT		DW	?
   171                              <1> A_RETRYCOUNT	    ENDS
   172                              <1> 
   173                              <1> ;********************************;*		;J.K. 4/29/86
   174                              <1> ; CHARACTER DEVICES (SCREEN)	 ;*
   175                              <1> ;********************************;*		;J.K. 4/29/86
   176                              <1> ;
   177                              <1> ;SC_MODE_INFO	 struc
   178                              <1> ;SC_INFO_LENGTH 	 DW	 9
   179                              <1> ;SC_MODE		 DB	 0
   180                              <1> ;SC_COLORS		 DW	 0
   181                              <1> ;SC_WIDTH		 DW	 0
   182                              <1> ;SC_LENGTH		 DW	 0
   183                              <1> ;SC_MODE_INFO	 ends
   184                              <1> ;
   185                              <1> ;SC_INFO_PACKET_LENGTH	 EQU	 9		 ;LENGTH OF THE INFO PACKET.
   186                              <1> 
   187                              <1> ;SUBFUNCTIONS FOR CON$GENIOCTL
   188                              <1> ;GET_SC_MODE		 EQU	 60h
   189                              <1> ;SET_SC_MODE		 EQU	 40h
   190                              <1> ;The following subfunctions are reserved for installable CODE PAGE switch
   191                              <1> ;console devices. - J.K. 4/29/86
   192                              <1> ;Get_active_codepage	 equ	 6Ah
   193                              <1> ;Invoke_active_codepage  equ	 4Ah
   194                              <1> ;Start_designate_codepage equ	 4Ch
   195                              <1> ;End_designate_codepage  equ	 4Dh
   196                              <1> ;Get_list_of_designated_codepage equ 6Bh
   197                              <1> ;J.K. 4/29/86 *** End of Con$genioctl equates & structures
    86                                  %include "forequ.mac"
     1                              <1> ;                               ;     ;
     2                              <1> 
     3                              <1> NO      equ     0
     4                              <1> YES     equ     ~ NO
     5                              <1> FSExec  equ     NO                              ;an018; dms;conditional assembly
     6                              <1> ShipDisk equ    NO                              ;an000; dms;ship disk flag
     7                              <1> 
     8                              <1> Boot_ID equ   0AA55h
     9                              <1> DOS_Found equ   0
    10                              <1> 
    11                              <1> Not_Include     equ     0
    12                              <1> Do_Include         equ     1
    13                              <1> 
    14                              <1> INIT    equ     0
    15                              <1> 
    16                              <1> FAT12_File_System equ 01h
    17                              <1> FAT16_File_System equ 04h
    18                              <1> New_File_System equ 06h
    19                              <1> 
    20                              <1> FS_String_Max_Length    equ     5
    21                              <1> 
    22                              <1> Paragraph_Size  equ     16                      ;                               ;AN005;
    23                              <1> Len_FS_String_Buffer    equ     13
    24                              <1> 
    25                              <1> Net_Check equ   1200h
    26                              <1> Assign_Check equ 8000h
    27                              <1> 
    28                              <1> Found_Yes equ   1
    29                              <1> Found_No equ    0
    30                              <1> 
    31                              <1> Asciiz_End equ  0
    32                              <1> DBCS    equ     81h
    33                              <1> DBCS_Blank equ  40h
    34                              <1> DBCS_Vector_Size equ 2
    35                              <1> End_Of_Vector equ 0
    36                              <1> 
    37                              <1> 
    38                              <1> Blank   equ     " "
    39                              <1> 
    40                              <1> Label_Length equ 11
    41                              <1> CR      equ     13
    42                              <1> 
    43                              <1> DBCS_VECTOR equ NO
    44                              <1> 
    45                              <1> ;Limits
    46                              <1> BIG_FAT_THRESHOLD equ 4086
    47                              <1> 
    48                              <1> ;-------------------------------------------------------------------------------
    49                              <1> 
    50                              <1> 
    51                              <1> 
    52                              <1> 
    53                              <1> 
    54                              <1> DRNUM   EQU     5CH
    55                              <1> 
    56                              <1> 
    57                              <1> 
    58                              <1> ; Exit status defines
    59                              <1> ExitOK  equ     0
    60                              <1> ExitCtrlC equ   3
    61                              <1> ExitFatal equ   4
    62                              <1> ExitNo  equ     5
    63                              <1> 
    64                              <1> 
    65                              <1> ;-------------------------------------------------------------------------------
    66                              <1> ; These are the data structures which we will need
    67                              <1> 
    68                              <1> 
    69                              <1> Media_ID struc
    70 00000000 ????                <1> Media_ID_Info_Level dw ?
    71 00000002 ????????            <1> Media_ID_Serial_Number dd ?
    72 00000006 <res Bh>            <1> Media_ID_Volume_Label db 11 dup(?)
    73 00000011 ????????????????    <1> Media_ID_File_System db 8 dup(?)
    74                              <1> Media_ID ends
    75                              <1> 
    76                              <1> 
    77                              <1> Relative_Sector_Buffer  struc                   ;                               ;AN000;
    78                              <1> 
    79 00000000 ????                <1> Start_Sector_Low        dw      ?               ;Low word of RBA sector         ;AN000;
    80 00000002 ????                <1> Start_Sector_High       dw      ?               ;High word of RBA sector        ;AN000;
    81 00000004 ????                <1> Number_Sectors          dw      ?               ;Number of sectors              ;AN000;
    82 00000006 ????                <1> Buffer_Offset           dw      ?               ;Address of data buffer         ;AN000;
    83 00000008 ????                <1> Buffer_Segment          dw      ?               ;                               ;AN000;
    84                              <1> 
    85                              <1> Relative_Sector_Buffer ends                     ;                               ;AN000;
    86                              <1> 
    87                              <1> 
    88                              <1> ;Per system file data structure
    89                              <1> 
    90                              <1> a_FileStructure struc
    91 00000000 ????                <1> fileHandle DW   ?
    92 00000002 ????                <1> fileSizeInParagraphs DW ?
    93 00000004 ????????            <1> fileSizeInBytes DD ?
    94 00000008 ????????            <1> fileOffset DD   ?
    95 0000000C ????                <1> fileStartSegment DW ?
    96 0000000E ????                <1> fileDate DW     ?
    97 00000010 ????                <1> fileTime DW     ?
    98                              <1> a_FileStructure ends
    99                              <1> 
   100                              <1> ;-------------------------------------------------------------------------------
   101                              <1> 
   102                              <1> LOGBOOTSECT equ 1
   103                              <1> Set_Drv_Owner equ 0Fh                           ; IOCTL subfunction
   104                              <1> Custom_Media equ 0F0H                           ; Media byte for custom format
   105                              <1> Dual_8_Media equ 0FFh                           ; Dual sided 8 sectored
   106                              <1> Single_8_Media equ 0FEh                         ; Single sided 8 sectored
   107                              <1> Dual_9_Media equ 0FDh                           ; Dual sided 9 sectored
   108                              <1> Single_9_Media equ 0FCh                         ; Single sided 9 sectored
   109                              <1> Dual_15_Media equ 0F9h                          ; Dual sided 15 sectored
   110                              <1> Fixed_Disk equ  0F8h                            ; Fixed Disk
   111                              <1> Invalid_Drive   equ     000Fh                   ; Extended error 15
   112                              <1> Max_Format_Size equ     0FFFFh                  ; Max bytes to Format           ;an015; dms;
   113                              <1> Multi_Track_Format      equ     02h             ; Multi-track format            ;an015; dms;
   114                              <1> Single_Track_Format     equ     00h             ; Single track format           ;an015; dms;
   115                              <1> Select_Disk_Message     equ     0ADC1h          ; an016; dms;
    87                                  %include "forparse.mac"
     1                              <1> 
     2                              <1> 
     3                              <1> 
     4                              <1> section data
     5                              <1> 
     6                              <1> ;
     7                              <1> ;*****************************************************************************
     8                              <1> ; Publics
     9                              <1> ;*****************************************************************************
    10                              <1> ;
    11                              <1> 
    12                              <1> 	Public	Drive_Letter_Buffer
    13                              <1> 	Public	Switch_Buffer
    14                              <1> 	Public	Switch_Num_Buffer
    15                              <1> 	Public	Switch_String_Buffer
    16                              <1> 
    17                              <1> 
    18                              <1> ;
    19                              <1> ;***************************************************************************
    20                              <1> ; Equates
    21                              <1> ;***************************************************************************
    22                              <1> ;
    23                              <1> 
    24                              <1> ;Match Flags
    25                              <1> 
    26                              <1> Numeric_Value		equ	8000h		;				;AN000;
    27                              <1> Signed_Numeric_Value	equ	4000h		;				;AN000;
    28                              <1> Simple_String		equ	2000h		;				;AN000;
    29                              <1> Date_String		equ	1000h		;				;AN000;
    30                              <1> Time_String		equ	0800h		;				;AN000;
    31                              <1> Complex_List		equ	0400h		;				;AN000;
    32                              <1> Filespec		equ	0200h		;				;AN000;
    33                              <1> Drive_Only		equ	0100h		;				;AN000;
    34                              <1> Quoted_String		equ	0080h		;				;AN000;
    35                              <1> Ignore_Colon		equ	0010h		;				;AN000;
    36                              <1> Repeats_Allowed 	equ	0002h		;				;AN000;
    37                              <1> Optional		equ	0001h		;				;AN000;
    38                              <1> 
    39                              <1> ;Function_Flags
    40                              <1> 
    41                              <1> File_Table_Capitalize	equ	1		;				;AN000;
    42                              <1> Char_Table_Capitalize	equ	2		;				;AN000;
    43                              <1> Remove_Colon		equ	10h		;				;AN000;
    44                              <1> 
    45                              <1> ;Extra delimeters and EOL
    46                              <1> 
    47                              <1> Delimiters_Only 	equ	1		;				;AN000;
    48                              <1> EOL_Or_Delimiters	equ	2		;				;AN000;
    49                              <1> 
    50                              <1> Semi_Colon		equ	";"             ;                               ;AN000;
    51                              <1> Tab			equ	09h		;				;AN000;
    52                              <1> Colon			equ	":"             ;                               ;AN000;
    53                              <1> 
    54                              <1> 
    55                              <1> ;Parse Errors
    56                              <1> 
    57                              <1> No_Error		equ	0		;				;AN000;
    58                              <1> Too_Many_Operands	equ	1		;				;AN000;
    59                              <1> Operand_Missing 	equ	2		;				;AN000;
    60                              <1> Not_In_Switch_List	equ	3		;				;AN000;
    61                              <1> Not_In_Keyword_List	equ	4		;				;AN000;
    62                              <1> Out_Of_Range		equ	6		;				;AN000;
    63                              <1> Not_In_Value_List	equ	7		;				;AN000;
    64                              <1> Not_In_String_List	equ	8		;				;AN000;
    65                              <1> Syntax_Error		equ	9		;				;AN000;
    66                              <1> End_Of_Parse		equ	-1		;				;AN000;
    67                              <1> 
    68                              <1> ;Return types
    69                              <1> 
    70                              <1> Type_Reserved		equ	0		;				;AN000;
    71                              <1> Type_Number		equ	1		;				;AN000;
    72                              <1> Type_List_Index 	equ	2		;				;AN000;
    73                              <1> Type_String		equ	3		;				;AN000;
    74                              <1> Type_Complex		equ	4		;				;AN000;
    75                              <1> Type_Filespec		equ	5		;				;AN000;
    76                              <1> Type_Drive		equ	6		;				;AN000;
    77                              <1> Type_Date		equ	7		;				;AN000;
    78                              <1> Type_Time		equ	8		;				;AN000;
    79                              <1> Type_Quoted_String	equ	9		;				;AN000;
    80                              <1> 
    81                              <1> ;Other
    82                              <1> 
    83                              <1> None			equ	0		;				;AN000;
    84                              <1> No_Error		equ	0		;				;AN000;
    85                              <1> Switch_Found		equ	0FFFFh		;				;AN000;
    86                              <1> Range_Ok		equ	1		;				;AN000;
    87                              <1> Command_Line_Parms	equ	81h		;				;AN000;
    88                              <1> 
    89                              <1> ;
    90                              <1> ;*****************************************************************************
    91                              <1> ; Parse Structures
    92                              <1> ;*****************************************************************************
    93                              <1> ;
    94                              <1> 
    95                              <1> Control 	 struc
    96                              <1> 
    97 00000000 ????                <1> Match_Flags	dw	?
    98 00000002 ????                <1> Function_Flags	dw	?
    99 00000004 ????                <1> Result		dw	?
   100 00000006 ????                <1> Values		dw	?
   101 00000008 ??                  <1> Num_Keywords	db	?
   102 00000009 ??                  <1> Keyword 	db	?
   103                              <1> 
   104                              <1> Control 	ends
   105                              <1> 
   106                              <1> Drive_Letter_Return	struc			;				;AN000;
   107                              <1> 
   108 00000000 ??                  <1> Drive_Type	db	?			;				;AN000;
   109 00000001 ??                  <1> Drive_Item_Tag	db	?			;				;AN000;
   110 00000002 ????                <1> Drive_Pointer	dw	?			;				;AN000;
   111 00000004 ??                  <1> Drive_Number	db	?			;A=1, B=2, C=3			;AN000;
   112 00000005 ????????????????    <1> Drive_debug	db	8 dup(?)
   113                              <1> 
   114                              <1> Drive_Letter_Return	ends			;				;AN000;
   115                              <1> 
   116                              <1> Switch_Return	 struc				;				;AN000;
   117                              <1> 
   118 00000000 ??                  <1> Switch_Type	db	?			;				;AN000;
   119 00000001 ??                  <1> Switch_Item_Tag db	?			;				;AN000;
   120 00000002 ????                <1> Switch_Pointer	dw	?			;				;AN000;
   121 00000004 ????????            <1> Switch_Debug	db	4 dup(?)
   122                              <1> 
   123                              <1> Switch_Return	 ends				;				;AN000;
   124                              <1> 
   125                              <1> Switch_Num_Return    struc			;				;AN000;
   126                              <1> 
   127 00000000 ??                  <1> Switch_Num_Type     db	    ?			    ;				    ;AN000;
   128 00000001 ??                  <1> Switch_Num_Item_Tag db	    ?			    ;				    ;AN000;
   129 00000002 ????                <1> Switch_Num_Pointer  dw	    ?			    ;				    ;AN000;
   130 00000004 ????                <1> Switch_Number_Low   dw	    ?		    ;				    ;AN000;
   131 00000006 ????                <1> Switch_Number_High  dw	    ?		    ;				    ;AN000;
   132                              <1> 
   133                              <1> Switch_Num_Return    ends			;				;AN000;
   134                              <1> 
   135                              <1> Switch_String_Return   struc			;				;AN000;
   136                              <1> 
   137 00000000 ??                  <1> Switch_String_Type     db      ?		       ;			       ;AN000;
   138 00000001 ??                  <1> Switch_String_Item_Tag db      ?		       ;			       ;AN000;
   139 00000002 ????                <1> Switch_String_Pointer  dw      ?		       ;			       ;AN000;
   140 00000004 ????                <1> Switch_String_Off	dw	?		;				;AN000;
   141 00000006 ????                <1> Switch_String_Seg	dw	?		;				;AN000;
   142                              <1> 
   143                              <1> Switch_String_Return ends			;				;AN000;
   144                              <1> 
   145                              <1> 
   146                              <1> ;
   147                              <1> ;**************************************************************************
   148                              <1> ; Parse tables
   149                              <1> ;**************************************************************************
   150                              <1> ;
   151                              <1> 
   152                              <1> %IF FSExec					;conditionally assemble /FS:	;an018; dms;
   153                              <1> 
   154                              <1> Switch_FS_Table       label byte		;				;AN000;
   155                              <1> 
   156                              <1> 	dw	Drive_Control_Definition	;Point to next level		;AN000;
   157                              <1> 	db	0				;				;AN000;
   158                              <1> 
   159                              <1> %ENDIF						;end conditional assembly /FS:	;an018; dms;
   160                              <1> 
   161                              <1> Command_Line_Table label byte			;				;AN000;
   162                              <1> 
   163 0000011D [2001]              <1> 	dw	Command_Control 		;Point to next level		;AN000;
   164 0000011F 00                  <1> 	db	0				;				;AN000;
   165                              <1> 
   166                              <1> ;
   167                              <1> ;**************************************************************************
   168                              <1> ;Define Positionals, Switches and Keywords
   169                              <1> ;**************************************************************************
   170                              <1> ;
   171                              <1> 
   172                              <1> 
   173                              <1> %IF FSExec					;conditionally assemble /FS:	;an018; dms;
   174                              <1> 
   175                              <1> Drive_Control_Definition label byte		;				;AN000;
   176                              <1> 
   177                              <1> 	db	1,1				;Only drive letter posistional	;AN000;
   178                              <1> 	dw	Positional_Control		;Pointer to control table	;AN000;
   179                              <1> 	db	1				;1 switch			;AN000;
   180                              <1> 	dw	Switch_FS_Control		;				;AN000;
   181                              <1> 	db	None				;No Keywords (maxk)		;AN000;
   182                              <1> 
   183                              <1> %ENDIF						;end conditional assembly /FS:	;an018; dms;
   184                              <1> 
   185                              <1> Command_Control label byte			;				;AN000;
   186                              <1> 
   187 00000120 0101                <1> 	db	1,1				;Only drive letter posistional	;AN000;
   188 00000122 [3E01]              <1> 	dw	Positional_Control		;Pointer to control table	;AN000;
   189                              <1> %IF ShipDisk
   190                              <1> 	db	13				;if /Z switch needed		;an000; dms;
   191                              <1> %ELSE
   192 00000124 0C                  <1> 	db	12				;				;AC001;
   193                              <1> %ENDIF
   194 00000125 [4701]              <1> 	dw	Switch_V_Control		;Without quotes 		AN000;
   195 00000127 [5301]              <1> 	dw	Switch_S_Control		;				;AN000;
   196 00000129 [5F01]              <1> 	dw	Switch_4_Control		;				;AN000;
   197 0000012B [6B01]              <1> 	dw	Switch_1_Control		;				;AN000;
   198 0000012D [7701]              <1> 	dw	Switch_8_Control		;				;AN000;
   199 0000012F [8301]              <1> 	dw	Switch_B_Control		;				;AN000;
   200 00000131 [8F01]              <1> 	dw	Switch_T_Control		;				;AN000;
   201 00000133 [9B01]              <1> 	dw	Switch_N_Control		;				;AN000;
   202 00000135 [A701]              <1> 	dw	Switch_Select_Control		;				;AN000;
   203 00000137 [B801]              <1> 	dw	Switch_Backup_Control		;				;AN000;
   204 00000139 [C901]              <1> 	dw	Switch_Autotest_Control 	;				;AN000;
   205 0000013B [DC01]              <1> 	dw	Switch_F_Control		;				;AC001;
   206                              <1> %IF ShipDisk
   207                              <1> 	dw	Switch_Z_Control		;1 sector/cluster switch	;an000; dms;
   208                              <1> %ENDIF
   209 0000013D 00                  <1> 	db	None				;No Keywords (maxk)		;AN000;
   210                              <1> 
   211                              <1> ;
   212                              <1> ;**************************************************************************
   213                              <1> ;Control Tables
   214                              <1> ;**************************************************************************
   215                              <1> ;
   216                              <1> 
   217                              <1> Positional_Control label byte			;				;AN000;
   218                              <1> 
   219 0000013E 0001                <1> 	dw	Drive_Only			;Match_Flag			;AN000;
   220 00000140 0000                <1> 	dw	None				;No function flags		;AN000;
   221 00000142 [E402]              <1> 	dw	Drive_Letter_Buffer		;Where it will be returned	;AN000;
   222 00000144 [5302]              <1> 	dw	No_Value			;No value ranges defined	;AN000;
   223 00000146 00                  <1> 	db	None				;No defined switches/keywords	;AN000;
   224                              <1> 
   225                              <1> %IF FSExec					;conditionally assemble /FS:	;an018; dms;
   226                              <1> 
   227                              <1> Switch_FS_Control label byte
   228                              <1> 	dw	Simple_String			;/FS:xxxxx			;AN000;
   229                              <1> 	dw	File_Table_Capitalize		;Make it uppercase		;AN000;
   230                              <1> 	dw	Switch_String_Buffer		;				;AN000;
   231                              <1> 	dw	No_Value			;				;AN000;
   232                              <1> 	db	1				;				;AN000;
   233                              <1> 	db	"/FS",0                         ;                               ;AN000;
   234                              <1> 
   235                              <1> %ENDIF						;end conditional assembly /FS:	;an018; dms;
   236                              <1> 
   237                              <1> Switch_V_Control label byte			;				;AN000;
   238                              <1> 
   239 00000147 8120                <1> 	dw	Simple_String+Quoted_String+Optional ;/v:xxxxxxxx		;AN000;
   240 00000149 0100                <1> 	dw	File_Table_Capitalize		;				;AN000;
   241 0000014B [0103]              <1> 	dw	Switch_String_Buffer		;				;AN000;
   242 0000014D [5302]              <1> 	dw	No_Value			;				;AN000;
   243 0000014F 01                  <1> 	db	1				;				;AN000;
   244 00000150 2F5600              <1> 	db	"/V",0                          ;                               ;AN000;
   245                              <1> 
   246                              <1> Switch_S_Control label byte			;				;AN000;
   247                              <1> 
   248 00000153 0000                <1> 	dw	None				;				;AN000;
   249 00000155 0000                <1> 	dw	None				;				;AN000;
   250 00000157 [F102]              <1> 	dw	Switch_Buffer			;				;AN000;
   251 00000159 [5302]              <1> 	dw	No_Value			;				;AN000;
   252 0000015B 01                  <1> 	db	1				;				;AN000;
   253 0000015C 2F5300              <1> 	db	"/S",0                          ;                               ;AN000;
   254                              <1> 
   255                              <1> Switch_4_Control label byte			;				;AN000;
   256                              <1> 
   257 0000015F 0000                <1> 	dw	None				;				;AN000;
   258 00000161 0000                <1> 	dw	None				;				;AN000;
   259 00000163 [F102]              <1> 	dw	Switch_Buffer			;				;AN000;
   260 00000165 [5302]              <1> 	dw	No_Value			;				;AN000;
   261 00000167 01                  <1> 	db	1				;				;AN000;
   262 00000168 2F3400              <1> 	db	"/4",0                          ;                               ;AN000;
   263                              <1> 
   264                              <1> Switch_1_Control label byte			;				;AN000;
   265                              <1> 
   266 0000016B 0000                <1> 	dw	None				;				;AN000;
   267 0000016D 0000                <1> 	dw	None				;				;AN000;
   268 0000016F [F102]              <1> 	dw	Switch_Buffer			;				;AN000;
   269 00000171 [5302]              <1> 	dw	No_Value			;				;AN000;
   270 00000173 01                  <1> 	db	1				;				;AN000;
   271 00000174 2F3100              <1> 	db	"/1",0                          ;                               ;AN000;
   272                              <1> 
   273                              <1> Switch_8_Control label byte			;				;AN000;
   274                              <1> 
   275 00000177 0000                <1> 	dw	None				;				;AN000;
   276 00000179 0000                <1> 	dw	None				;				;AN000;
   277 0000017B [F102]              <1> 	dw	Switch_Buffer			;				;AN000;
   278 0000017D [5302]              <1> 	dw	No_Value			;				;AN000;
   279 0000017F 01                  <1> 	db	1				;				;AN000;
   280 00000180 2F3800              <1> 	db	"/8",0                          ;                               ;AN000;
   281                              <1> 
   282                              <1> Switch_B_Control label byte			;				;AN000;
   283                              <1> 
   284 00000183 0000                <1> 	dw	None				;				;AN000;
   285 00000185 0000                <1> 	dw	None				;				;AN000;
   286 00000187 [F102]              <1> 	dw	Switch_Buffer			;				;AN000;
   287 00000189 [5302]              <1> 	dw	No_Value			;				;AN000;
   288 0000018B 01                  <1> 	db	1				;				;AN000;
   289 0000018C 2F4200              <1> 	db	"/B",0                          ;                               ;AN000;
   290                              <1> 
   291                              <1> Switch_T_Control label byte			;				;AN000;
   292                              <1> 
   293 0000018F 0080                <1> 	dw	Numeric_Value			;				;AN000;
   294 00000191 0000                <1> 	dw	None				;				;AN000;
   295 00000193 [F902]              <1> 	dw	Switch_Num_Buffer		;				;AN000;
   296 00000195 [E801]              <1> 	dw	Switch_T_Value			;				;AN000;
   297 00000197 01                  <1> 	db	1				;				;AN000;
   298 00000198 2F5400              <1> 	db	"/T",0                          ;                               ;AN000;
   299                              <1> 
   300                              <1> Switch_N_Control label byte			;				;AN000;
   301                              <1> 
   302 0000019B 0080                <1> 	dw	Numeric_Value			;				;AN000;
   303 0000019D 0000                <1> 	dw	None				;				;AN000;
   304 0000019F [F902]              <1> 	dw	Switch_Num_Buffer		;				;AN000;
   305 000001A1 [F301]              <1> 	dw	Switch_N_Value			;				;AN000;
   306 000001A3 01                  <1> 	db	1				;				;AN000;
   307 000001A4 2F4E00              <1> 	db	"/N",0                          ;                               ;AN000;
   308                              <1> 
   309                              <1> Switch_Select_Control label byte		;				;AN000;
   310                              <1> 
   311 000001A7 0000                <1> 	dw	None				;				;AN000;
   312 000001A9 0000                <1> 	dw	None				;				;AN000;
   313 000001AB [F102]              <1> 	dw	Switch_Buffer			;				;AN000;
   314 000001AD [5302]              <1> 	dw	No_Value			;				;AN000;
   315 000001AF 01                  <1> 	db	1				;				;AN000;
   316 000001B0 2F53454C45435400    <1> 	db	"/SELECT",0                     ;                               ;AN000;
   317                              <1> 
   318                              <1> Switch_Backup_Control label byte		;				;AN000;
   319                              <1> 
   320 000001B8 0000                <1> 	dw	None				;				;AN000;
   321 000001BA 0000                <1> 	dw	None				;				;AN000;
   322 000001BC [F102]              <1> 	dw	Switch_Buffer			;				;AN000;
   323 000001BE [5302]              <1> 	dw	No_Value			;				;AN000;
   324 000001C0 01                  <1> 	db	1				;				;AN000;
   325 000001C1 2F4241434B555000    <1> 	db	"/BACKUP",0                     ;                               ;AN000;
   326                              <1> 
   327                              <1> Switch_Autotest_Control label byte		;				;AN000;
   328                              <1> 
   329 000001C9 0000                <1> 	dw	None				;				;AN000;
   330 000001CB 0000                <1> 	dw	None				;				;AN000;
   331 000001CD [F102]              <1> 	dw	Switch_Buffer			;				;AN000;
   332 000001CF [5302]              <1> 	dw	No_Value			;				;AN000;
   333 000001D1 01                  <1> 	db	1				;				;AN000;
   334 000001D2 2F4155544F54455354- <1> 	db	"/AUTOTEST",0                   ;                               ;AN000;
   334 000001DB 00                  <1>
   335                              <1> 
   336                              <1> Switch_F_Control label byte			;				;AN001;
   337 000001DC 0020                <1> 	dw	Simple_String			;/F:xxxxx			;AN001;
   338 000001DE 0100                <1> 	dw	File_Table_Capitalize		;Make it uppercase		;AN001;
   339 000001E0 [0103]              <1> 	dw	Switch_String_Buffer		;				;AN001;
   340 000001E2 [FE01]              <1> 	dw	Switch_Size_Value		;				;AN001;
   341 000001E4 01                  <1> 	db	1				;				;AN001;
   342 000001E5 2F4600              <1> 	db	"/F",0                          ;                               ;AN001;
   343                              <1> 
   344                              <1> %IF ShipDisk
   345                              <1> 
   346                              <1> Switch_Z_Control label	byte			;control structure for /Z	;an000; dms;
   347                              <1> 	dw	None				;				;an000; dms;
   348                              <1> 	dw	None				;				;an000; dms;
   349                              <1> 	dw	Switch_Buffer			;				;an000; dms;
   350                              <1> 	dw	No_Value			;				;an000; dms;
   351                              <1> 	db	1				;				;an000; dms;
   352                              <1> 	db	"/Z",0                          ;                               ;an000; dms;
   353                              <1> 
   354                              <1> %ENDIF
   355                              <1> 
   356                              <1> ;
   357                              <1> ;************************************************************************
   358                              <1> ; PARSE Value Lists
   359                              <1> ;************************************************************************
   360                              <1> ;
   361                              <1> 
   362                              <1> Switch_T_Value label byte			;				;AN000;
   363                              <1> 
   364 000001E8 01                  <1> 	db	1				;Range only			;ANOOO;
   365 000001E9 01                  <1> 	db	1				;1 range			;ANOOO;
   366                              <1> Range_OK equ Range_Ok	; NASM port equate
   367 000001EA 01                  <1> 	db	Range_OK			;Item_Tag			;ANOOO;
   368 000001EB 01000000            <1> 	dd	1				;1 is low bound 		;ANOOO;
   369 000001EF 00040000            <1> 	dd	1024				;2**10 is max			;AN000;
   370                              <1> 
   371                              <1> Switch_N_Value label byte			;				;AN000;
   372                              <1> 
   373 000001F3 01                  <1> 	db	1				;Range only			;ANOOO;
   374 000001F4 01                  <1> 	db	1				;1 range			;ANOOO;
   375 000001F5 01                  <1> 	db	Range_OK			;Item_Tag			;ANOOO;
   376 000001F6 01000000            <1> 	dd	1				;1 is low bound 		;ANOOO;
   377 000001FA 40000000            <1> 	dd	64				;2**6  is max			;AN000;
   378                              <1> 
   379                              <1> Switch_Size_Value	label	byte		;				;AN001;
   380                              <1> 
   381 000001FE 03                  <1> 	db	3				;Look for strings		;AN001;
   382 000001FF 00                  <1> 	db	0				;No ranges			;AN001;
   383 00000200 00                  <1> 	db	0				;No numerics			;AN001;
   384 00000201 1B                  <1> 	db	27				;16 possible strings		;AN001;
   385 00000202 01                  <1> 	db	Size_160			;				;AN001;
   386 00000203 [5402]              <1> 	dw	String_160k_1			;/F:160 			;AN001;
   387 00000205 01                  <1> 	db	Size_160			;				;AN001;
   388 00000206 [5802]              <1> 	dw	String_160k_2			;/F:160K			;AN001;
   389 00000208 01                  <1> 	db	Size_160			;				;AN001;
   390 00000209 [5D02]              <1> 	dw	String_160k_3			;/F:160KB			;AN001;
   391 0000020B 02                  <1> 	db	Size_180			;				;AN001;
   392 0000020C [6302]              <1> 	dw	String_180k_1			;/F:180 			;AN001;
   393 0000020E 02                  <1> 	db	Size_180			;				;AN001;
   394 0000020F [6702]              <1> 	dw	String_180k_2			;/F:180K			;AN001;
   395 00000211 02                  <1> 	db	Size_180			;				;AN001;
   396 00000212 [6C02]              <1> 	dw	String_180k_3			;/F:180KB			;AN001;
   397 00000214 04                  <1> 	db	Size_320			;				;AN001;
   398 00000215 [7202]              <1> 	dw	String_320k_1			;/F:320 			;AN001;
   399 00000217 04                  <1> 	db	Size_320			;				;AN001;
   400 00000218 [7602]              <1> 	dw	String_320k_2			;/F:320K			;AN001;
   401 0000021A 04                  <1> 	db	Size_320			;				;AN001;
   402 0000021B [7B02]              <1> 	dw	String_320k_3			;/F:320KB			;AN001;
   403 0000021D 08                  <1> 	db	Size_360			;				;AN001;
   404 0000021E [8102]              <1> 	dw	String_360k_1			;/F:360 			;AN001;
   405 00000220 08                  <1> 	db	Size_360			;				;AN001;
   406 00000221 [8502]              <1> 	dw	String_360k_2			;/F:360K			;AN001;
   407 00000223 08                  <1> 	db	Size_360			;				;AN001;
   408 00000224 [8A02]              <1> 	dw	String_360k_3			;/F:360KB			;AN001;
   409 00000226 10                  <1> 	db	Size_720			;				;AN001;
   410 00000227 [9002]              <1> 	dw	String_720k_1			;/F:720 			;AN001;
   411 00000229 10                  <1> 	db	Size_720			;				;AN001;
   412 0000022A [9402]              <1> 	dw	String_720k_2			;/F:720K			;AN001;
   413 0000022C 10                  <1> 	db	Size_720			;				;AN001;
   414 0000022D [9902]              <1> 	dw	String_720k_3			;/F:720KB			;AN001;
   415 0000022F 20                  <1> 	db	Size_1200			;				;AN001;
   416 00000230 [9F02]              <1> 	dw	String_1200k_1			;/F:1200			;AN001;
   417 00000232 20                  <1> 	db	Size_1200			;				;AN001;
   418 00000233 [A402]              <1> 	dw	String_1200k_2			;/F:1200K			;AN001;
   419 00000235 20                  <1> 	db	Size_1200			;				;AN001;
   420 00000236 [AA02]              <1> 	dw	String_1200k_3			;/F:1200KB			;AN001;
   421 00000238 20                  <1> 	db	Size_1200			;				;AN001;
   422 00000239 [B102]              <1> 	dw	String_1200k_4			;/F:1.2 			;AN001;
   423 0000023B 20                  <1> 	db	Size_1200			;				;AN001;
   424 0000023C [B502]              <1> 	dw	String_1200k_5			;/F:1.2M			;AN001;
   425 0000023E 20                  <1> 	db	Size_1200			;				;AN001;
   426 0000023F [BA02]              <1> 	dw	String_1200k_6			;/F:1.2MB			;AN001;
   427 00000241 40                  <1> 	db	Size_1440			;				;AN001;
   428 00000242 [C002]              <1> 	dw	String_1440k_1			;/F:1440			;AN001;
   429 00000244 40                  <1> 	db	Size_1440			;				;AN001;
   430 00000245 [C502]              <1> 	dw	String_1440k_2			;/F:1440K			;AN001;
   431 00000247 40                  <1> 	db	Size_1440			;				;AN001;
   432 00000248 [CB02]              <1> 	dw	String_1440k_3			;/F:1440KB			;AN001;
   433 0000024A 40                  <1> 	db	Size_1440			;				;AN001;
   434 0000024B [D202]              <1> 	dw	String_1440k_4			;/F:1.44			;AN001;
   435 0000024D 40                  <1> 	db	Size_1440			;				;AN001;
   436 0000024E [D702]              <1> 	dw	String_1440k_5			;/F:1.44M			;AN001;
   437 00000250 40                  <1> 	db	Size_1440			;				;AN001;
   438 00000251 [DD02]              <1> 	dw	String_1440k_6			;/F:1.44MB			;AN001;
   439                              <1> 
   440                              <1> 
   441                              <1> No_Value	label	byte			;				;AN000;
   442 00000253 00                  <1> 	db	0				;				;AN000;
   443                              <1> 
   444                              <1> ;
   445                              <1> ;*****************************************************************************
   446                              <1> ; Data Area for value lists
   447                              <1> ;*****************************************************************************
   448                              <1> ;
   449                              <1> 
   450                              <1> ;
   451                              <1> ;The following are a list of the allowed strings for the /F:xxxxx switch.
   452                              <1> ;
   453                              <1> 
   454 00000254 31363000            <1> String_160k_1	db	"160"  ,Asciiz_End      ;                               ;AN001;
   455 00000258 3136304B00          <1> String_160k_2	db	"160K" ,Asciiz_End      ;                               ;AN001;
   456 0000025D 3136304B4200        <1> String_160k_3	db	"160KB" ,Asciiz_End      ;                               ;AN001;
   457 00000263 31383000            <1> String_180k_1	db	"180"  ,Asciiz_End      ;                               ;AN001;
   458 00000267 3138304B00          <1> String_180k_2	db	"180K" ,Asciiz_End      ;                               ;AN001;
   459 0000026C 3138304B4200        <1> String_180k_3	db	"180KB" ,Asciiz_End      ;                               ;AN001;
   460 00000272 33323000            <1> String_320k_1	db	"320"  ,Asciiz_End      ;                               ;AN001;
   461 00000276 3332304B00          <1> String_320k_2	db	"320K" ,Asciiz_End      ;                               ;AN001;
   462 0000027B 3332304B4200        <1> String_320k_3	db	"320KB" ,Asciiz_End      ;                               ;AN001;
   463 00000281 33363000            <1> String_360k_1	db	"360"  ,Asciiz_End      ;                               ;AN001;
   464 00000285 3336304B00          <1> String_360k_2	db	"360K" ,Asciiz_End      ;                               ;AN001;
   465 0000028A 3336304B4200        <1> String_360k_3	db	"360KB" ,Asciiz_End      ;                               ;AN001;
   466 00000290 37323000            <1> String_720k_1	db	"720"  ,Asciiz_End      ;                               ;AN001;
   467 00000294 3732304B00          <1> String_720k_2	db	"720K" ,Asciiz_End      ;                               ;AN001;
   468 00000299 3732304B4200        <1> String_720k_3	db	"720KB" ,Asciiz_End      ;                               ;AN001;
   469 0000029F 3132303000          <1> String_1200k_1	db	"1200" ,Asciiz_End      ;                               ;AN001;
   470 000002A4 313230304B00        <1> String_1200k_2	db	"1200K",Asciiz_End      ;                               ;AN001;
   471 000002AA 313230304B4200      <1> String_1200k_3	db	"1200KB",Asciiz_End      ;                               ;AN001;
   472 000002B1 312E3200            <1> String_1200k_4	db	"1.2" ,Asciiz_End      ;                               ;AN001;
   473 000002B5 312E324D00          <1> String_1200k_5	db	"1.2M" ,Asciiz_End      ;                               ;AN001;
   474 000002BA 312E324D4200        <1> String_1200k_6	db	"1.2MB" ,Asciiz_End      ;                               ;AN001;
   475 000002C0 3134343000          <1> String_1440k_1	db	"1440" ,Asciiz_End      ;                               ;AN001;
   476 000002C5 313434304B00        <1> String_1440k_2	db	"1440K",Asciiz_End      ;                               ;AN001;
   477 000002CB 313434304B4200      <1> String_1440k_3	db	"1440KB",Asciiz_End      ;                               ;AN001;
   478 000002D2 312E343400          <1> String_1440k_4	db	"1.44",Asciiz_End      ;                               ;AN001;
   479 000002D7 312E34344D00        <1> String_1440k_5	db	"1.44M",Asciiz_End      ;                               ;AN001;
   480 000002DD 312E34344D4200      <1> String_1440k_6	db	"1.44MB",Asciiz_End      ;                               ;AN001;
   481                              <1> 
   482                              <1> ;
   483                              <1> ;************************************************************************
   484                              <1> ; PARSE Return Buffers
   485                              <1> ;************************************************************************
   486                              <1> ;
   487                              <1> 
   488                              <1> Drive_Letter_Buffer: ; NASM structure instance
   489                              <1> Drive_Letter_Return_size equ Drive_Letter_Return_struc_size	; NASM port equate
   490                              <1> istruc Drive_Letter_Return
   491 000002E4 ??<rep Dh>          <1> iend
   492                              <1> Switch_Buffer: ; NASM structure instance
   493                              <1> Switch_Return_size equ Switch_Return_struc_size	; NASM port equate
   494                              <1> istruc Switch_Return
   495 000002F1 ??<rep 8h>          <1> iend
   496                              <1> Switch_Num_Buffer: ; NASM structure instance
   497                              <1> Switch_Num_Return_size equ Switch_Num_Return_struc_size	; NASM port equate
   498                              <1> istruc Switch_Num_Return
   499 000002F9 ??<rep 8h>          <1> iend
   500                              <1> Switch_String_Buffer: ; NASM structure instance
   501                              <1> Switch_String_Return_size equ Switch_String_Return_struc_size	; NASM port equate
   502                              <1> istruc Switch_String_Return
   503 00000301 ??<rep 8h>          <1> iend
   504                              <1> 
   505                              <1> ; (no prior section) ; data	ends
   506                              <1> 
   507                              <1> ;
   508                              <1> ;*****************************************************************************
   509                              <1> ; SysParse Routines
   510                              <1> ;*****************************************************************************
   511                              <1> ;
   512                              <1> 
   513                              <1> 
   514                              <1> section code
   515                              <1> 	assume cs:code,ds:Data
   516                              <1> 
   517                              <1> %ixdefine FarSW	Not_Include							;AN000;
   518                              <1> %ixdefine DateSW	Not_Include			;				;AN000;
   519                              <1> %ixdefine TimeSW	Not_Include			;				;AN000;
   520                              <1> %ixdefine FileSW	Do_Include			;				;AN000;
   521                              <1> %ixdefine CAPSW	Do_Include			;				;AN000;
   522                              <1> %ixdefine CmpxSW	Not_Include			;				;AN000;
   523                              <1> %ixdefine NumSW	Do_Include			;				;AN000;
   524                              <1> %ixdefine KeySW	Not_Include			;				;AN000;
   525                              <1> %ixdefine SwSW	Do_Include			;				;AN000;
   526                              <1> DO_Include equ Do_Include	; NASM port equate
   527                              <1> %ixdefine Val1SW	DO_Include			;				;AN000;
   528                              <1> %ixdefine Val2SW	Not_Include			;				;AN000;
   529                              <1> %ixdefine Val3SW	Do_Include			;				;AN001;
   530                              <1> %ixdefine DrvSW	Do_Include			;				;AN000;
   531                              <1> %ixdefine QusSW	Do_Include			;				;AN000;
   532                              <1> 
   533                              <1> ;=== Push trace listing source: parse.nas
   534                              <1> %include "parse.nas"				;				;AN000; ; NASM included file
     1                              <2> ;	PAGE				;AN000;
     2                              <2> ;  $SALUT (4,4,8,41)
     3                              <2> ;(deleted).XLIST
     4                              <2> ;(deleted)INCLUDE   STRUC.INC ;AN020;structured macro definitions for .IF,.ELSE etc.
     5                              <2> ;(deleted).LIST
     6                              <2> ;
     7                              <2> ; NOTE:   basesw must be set properly to allow the PARSER to access psdata.
     8                              <2> ;	   - basesw undefined	 means	 CS seg. override for psdata access.
     9                              <2> ;	   - basesw = 1 	 means	 DS seg. override for psdata access &
    10                              <2> ;					 DS must point to psdata.
    11                              <2> ;	   - basesw = 0 	 means	 ES seg. override for psdata access &
    12                              <2> ;					 ES must point to psdata.
    13                              <2> ;
    14                              <2> ;
    15                              <2> %IFNDEF basesw				;AN022;
    16                              <2>  %idefine psdata_seg	CS		;AN022;
    17                              <2> %ELSE					;AN022;
    18                              <2>    %IF  basesw				;AN022;IF "basesw  EQU  1" specified by caller THEN
    19                              <2>     %idefine psdata_seg	DS		;AN022;
    20                              <2>    %ELSE				;AN022;
    21                              <2>     %idefine psdata_seg	ES		;AN022;ELSE only other choice is ES (basesw EQU 0)
    22                              <2>    %ENDIF				;AN022;
    23                              <2> %ENDIF					;AN022;
    24                              <2> 
    25                              <2> %ifndef incsw				;AN000; (tm03) Someone doesn't want to include psdata
    26                              <2>  %iassign incsw	 1			;AN000; include psdata.inc (tm03)
    27                              <2> %endif					;AN000; (tm03)
    28                              <2> %if incsw				;AN000; If incsw = 1 then (tm03)
    29                              <2>    %include "psdata.mac"			;AN000;    include psdata.inc (tm03)
     1                              <3> ;*******************************************************************
     2                              <3> ; Parser include file
     3                              <3> ;*******************************************************************
     4                              <3> 	%warning out: INCLUDING COMP=COMMON DSN=PSDATA.INC...;AN000;
     4          ******************  <3>  warning: out: INCLUDING COMP=COMMON DSN=PSDATA.INC... [-w+user]
     5                              <3> ;
     6                              <3> ;**** Default assemble switches definition *************************
     7                              <3> 
     8                              <3> %ifndef	FarSW				;AN000;
     9                              <3> %iassign FarSW 0			;AN000; Near call expected
    10                              <3> %endif					;AN000;
    11                              <3> 
    12                              <3> %ifndef	DateSW				;AN000;
    13                              <3> %iassign DateSW 1			;AN000; Check date format
    14                              <3> %endif					;AN000;
    15                              <3> 
    16                              <3> %ifndef	TimeSW				;AN000;
    17                              <3> %iassign TimeSW 1			;AN000; Check time format
    18                              <3> %endif					;AN000;
    19                              <3> 
    20                              <3> %ifndef	FileSW				;AN000;
    21                              <3> %iassign FileSW 1			;AN000; Check file specification
    22                              <3> %endif					;AN000;
    23                              <3> 
    24                              <3> %ifndef	CAPSW				;AN000;
    25                              <3> %iassign CAPSW 1			;AN000; Perform CAPS if specified
    26                              <3> %endif					;AN000;
    27                              <3> 
    28                              <3> %ifndef	CmpxSW				;AN000;
    29                              <3> %iassign CmpxSW 1			;AN000; Check complex list
    30                              <3> %endif					;AN000;
    31                              <3> 
    32                              <3> %ifndef	NumSW				;AN000;
    33                              <3> %iassign NumSW 1			;AN000; Check numeric value
    34                              <3> %endif					;AN000;
    35                              <3> 
    36                              <3> %ifndef	KeySW				;AN000;
    37                              <3> %iassign KeySW 1			;AN000; Support keywords
    38                              <3> %endif					;AN000;
    39                              <3> 
    40                              <3> %ifndef	SwSW				;AN000;
    41                              <3> %iassign SwSW 1			;AN000; Support switches
    42                              <3> %endif					;AN000;
    43                              <3> 
    44                              <3> %ifndef	Val1SW				;AN000;
    45                              <3> %iassign Val1SW 1			;AN000; Support value definition 1
    46                              <3> %endif					;AN000;
    47                              <3> 
    48                              <3> %ifndef	Val2SW				;AN000;
    49                              <3> %iassign Val2SW 1			;AN000; Support value definition 2
    50                              <3> %endif					;AN000;
    51                              <3> 
    52                              <3> %ifndef	Val3SW				;AN000;
    53                              <3> %iassign Val3SW 1			;AN000; Support value definition 3
    54                              <3> %endif					;AN000;
    55                              <3> 
    56                              <3> %ifndef	DrvSW				;AN000;
    57                              <3> %iassign DrvSW 1			;AN000; Support drive only format
    58                              <3> %endif					;AN000;
    59                              <3> 
    60                              <3> %ifndef	QusSW				;AN000;
    61                              <3> %iassign QusSW 1			;AN000; Support quoted string format
    62                              <3> %endif					;AN000;
    63                              <3> 
    64                              <3> %ifndef	LFEOLSW 			;AN028;
    65                              <3> %iassign LFEOLSW 1			;AN028; Accept Line feed (0AH) as end of line
    66                              <3> %endif					;AN028;
    67                              <3> 
    68                              <3> ;**** Equation field
    69                              <3> ;-------- Character code definition
    70                              <3> 
    71                              <3> D_P_DBSP1	   equ	81h		;AN000; 1st byte of DBCS blank
    72                              <3> D_P_DBSP2	   equ	40h		;AN000; 2nd byte of DBCS blank
    73                              <3> D_P_Period	   equ	"."             ;AN020;
    74                              <3> D_P_Slash	   equ	"/"             ;AN020;
    75                              <3> D_P_Space	   equ	" "             ;AN000; SBCS blank
    76                              <3> D_P_Comma	   equ	","             ;AN000;
    77                              <3> D_P_Switch	   equ	"/"             ;AN000;
    78                              <3> D_P_Keyword	   equ	"="             ;AN000;
    79                              <3> D_P_Colon	   equ	":"             ;AN000;
    80                              <3> D_P_Plus 	   equ	"+"             ;AN000;
    81                              <3> D_P_Minus	   equ	"-"             ;AN000;
    82                              <3> D_P_Rparen	   equ	")"             ;AN000;
    83                              <3> D_P_Lparen	   equ	"("             ;AN000;
    84                              <3> ;(deleted ;AN025;) D_P_SQuote	      equ  "'"
    85                              <3> D_P_DQuote	   equ	'"'             ;AN000;
    86                              <3> D_P_NULL 	   equ	0		;AN000;
    87                              <3> D_P_TAB		   equ	9		;AN000;
    88                              <3> D_P_CR		   equ	0Dh		;AN000;
    89                              <3> D_P_LF		   equ	0Ah		;AN000;
    90                              <3> D_P_ASCII80	   equ	80h		;AN000; ASCII 80h character code
    91                              <3> 
    92                              <3> ;-------- Masks
    93                              <3> D_P_Make_Lower	   equ	20h		;AN000; make lower case character
    94                              <3> D_P_Make_Upper	   equ	0ffh-D_P_Make_Lower ;AN000; make upper case character
    95                              <3> 
    96                              <3> ;		   PAGE 		   ;AN000;
    97                              <3> ;-------- DOS function call related equs
    98                              <3> 
    99                              <3> D_P_DOS_Get_CDI	   equ	3800h		;AN000; get country dependent information
   100                              <3> 					; by this call, following information
   101                              <3> D_P_CDI		   struc		;AN000; is returned.
   102 00000000 ????                <3> D_P_CDI_DateF	   dw	? ;0		;AN000;
   103 00000002 ??????????          <3> D_P_CDI_Money	   db	?,?,?,?,? ;0,0,0,0,0	;AN000;
   104 00000007 ????                <3> D_P_CDI_1000	   db	?,? ;0,0		;AN000;
   105 00000009 ????                <3> D_P_CDI_Dec	   db	?,? ;0,0		;AN000;
   106 0000000B ????                <3> D_P_CDI_DateS	   db	?,? ;0,0		;AN000;
   107 0000000D ????                <3> D_P_CDI_TimeS	   db	?,? ;0,0		;AN000;
   108 0000000F ??                  <3> 		   db	? ;0		;AN000;
   109 00000010 ??                  <3> 		   db	? ;0		;AN000;
   110 00000011 ??                  <3> D_P_CDI_TimeF	   db	? ;0		;AN000;
   111 00000012 ????????            <3> 		   dw	?,? ;0,0		;AN000;
   112 00000016 ????                <3> 		   db	?,? ;0,0		;AN000;
   113 00000018 <res Ah>            <3> 		   dw	5 dup (?) ;(0)	;AN000;
   114                              <3> D_P_CDI		   ends 		;AN000;
   115                              <3> 
   116                              <3> D_P_Date_MDY	   equ	0		;AN000;
   117                              <3> D_P_Date_DMY	   equ	1		;AN000;
   118                              <3> D_P_Date_YMD	   equ	2		;AN000;
   119                              <3> ;-------------
   120                              <3> D_P_DOS_GetEV	   equ	6300h		;AN000; get DBCS EV call
   121                              <3> 					;AN000; DS:SI will points to DBCS EV
   122                              <3> ;-------------
   123                              <3> D_P_DOS_Get_TBL	   equ	65h		;AN000; get uppercase table call
   124                              <3> 					;AN000; following parameters are set
   125                              <3> 					;AN000; to get casemap table.
   126                              <3> D_P_DOSTBL_Def	   equ	-1		;AN000; get default
   127                              <3> D_P_DOSTBL_BL	   equ	5		;AN000; buffer length for Tbl pointer
   128                              <3> D_P_DOSTBL_File	   equ	4		;AN000; get file uppercase table
   129                              <3> D_P_DOSTBL_Char	   equ	2		;AN000; get character uppercase table
   130                              <3> 					; By this call following information
   131                              <3> 					; is returned.
   132                              <3> D_P_DOS_TBL	   struc		;AN000;
   133 00000000 ??                  <3> D_P_DOS_InfoID	   db	? ;0		;AN000; information id for the table
   134 00000001 ????                <3> D_P_DOS_TBL_Off	   dw	? ;0		;AN000; offset address of the table
   135 00000003 ????                <3> D_P_DOS_TBL_Seg	   dw	? ;0		;AN000; segment address of the table
   136                              <3> D_P_DOS_TBL	   ends 		;AN000;
   137                              <3> ;		   PAGE 		;AN000;
   138                              <3> ;---------------------------------------------------------------------------------------------------------
   139                              <3> ; PARMS 	LABEL	BYTE
   140                              <3> ;		DW	PARMSX
   141                              <3> ;		DB	2			; NUMBER OF STRINGS (0, 1, 2)
   142                              <3> ;		DB	length			; LENGTH OF THE NEXT LIST, 0 IF NONE
   143                              <3> ;		DB	" .. "                  ; EXTRA DELIMITER LIST,
   144                              <3> ;						; TYPICAL ARE ";", "="
   145                              <3> ;						; "," & WHITESPACE ALWAYS
   146                              <3> ;		DB	length			; LENGTH OF THE NEXT LIST, 0 IF NONE
   147                              <3> ;		DB	" .. "                  ; EXTRA END OF LINE LIST, CR, LF OR 0 ALWAYS
   148                              <3> ;---------------------------------------------------------------------------------------------------------
   149                              <3> 
   150                              <3> ;-------------------------------- PARMS block structure
   151                              <3> D_P_PARMS_Blk	   struc		;AN000;
   152 00000000 ????                <3> D_P_PARMSX_Address  dw	? ;0		;AN000; Address of PARMSX
   153 00000002 ??                  <3> D_P_Num_Extra	   db	? ;0		;AN000; Number of extra stuff
   154 00000003 ??                  <3> D_P_Len_Extra_Delim db	? ;0		;AN000; Length of extra delimiter
   155                              <3> D_P_PARMS_Blk	   ends 		;AN000;
   156                              <3> 
   157                              <3> D_P_Len_PARMS	   equ	4		;AN000;
   158                              <3> D_P_I_Use_Default   equ	0		;AN000; no extra stuff specified
   159                              <3> D_P_I_Have_Delim    equ	1		;AN000; extra delimiter specified
   160                              <3> D_P_I_Have_EOL	   equ	2		;AN000; extra EOL specified
   161                              <3> 
   162                              <3> ;---------------------------------------------------------------------------------------------------------
   163                              <3> ; PARMSX	LABEL	BYTE
   164                              <3> ;		DB	minp,maxp		; MIN, MAX POSITIONAL OPERANDS ALLOWED
   165                              <3> ;		DW	CONTROL 		; DESCRIPTION OF POSITIONAL 1
   166                              <3> ;		:				; REPEATS maxp-1 TIMES
   167                              <3> ;		DB	maxs			; # OF SWITCHES
   168                              <3> ;		DW	CONTROL 		; DESCRIPTION OF SWITCH 1
   169                              <3> ;		:				; REPEATS maxs-1 TIMES
   170                              <3> ;		DB	maxk			; # OF KEYWORD
   171                              <3> ;		DW	CONTROL 		; DESCRIPTION OF KEYWORD 1
   172                              <3> ;		:				; REPEATS maxk-1 TIMES
   173                              <3> ;---------------------------------------------------------------------------------------------------------
   174                              <3> 
   175                              <3> ;-------------------------------- PARMSX block structure
   176                              <3> D_P_PARMSX_Blk	   struc		;AN000;
   177 00000000 ??                  <3> D_P_MinP 	   db	? ;0		;AN000; Minimum positional number
   178 00000001 ??                  <3> D_P_Maxp 	   db	? ;0		;AN000; Maximum positional number
   179 00000002 ????                <3> D_P_1st_Control	   dw	? ;0		;AN000; Address of the 1st CONTROL block
   180                              <3> D_P_PARMSX_Blk	   ends 		;AN000;
   181                              <3> ;		   PAGE 		;AN000;
   182                              <3> ;---------------------------------------------------------------------------------------------------------
   183                              <3> ; << Control field definition  >>
   184                              <3> ;
   185                              <3> ;
   186                              <3> ;CONTROL   LABEL   BYTE
   187                              <3> ;	   DW	   MATCH_FLAGS	   ; CONTROLS TYPE MATCHED
   188                              <3> ;				   ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED)
   189                              <3> ;				   ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE CHECKED)
   190                              <3> ;				   ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED)
   191                              <3> ;				   ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED)
   192                              <3> ;				   ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED)
   193                              <3> ;				   ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED)
   194                              <3> ;				   ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED)
   195                              <3> ;				   ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED)
   196                              <3> ;				   ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED)
   197                              <3> ;				   ; 0010H=IGNORE ":" AT END IN MATCH
   198                              <3> ;				   ; 0002H=REPEATS ALLOWED
   199                              <3> ;				   ; 0001H=OPTIONAL
   200                              <3> ;	   DW	   FUNCTION_FLAGS
   201                              <3> ;				   ; 0001H=CAP RESULT BY FILE TABLE
   202                              <3> ;				   ; 0002H=CAP RESULT BY CHAR TABLE
   203                              <3> ;				   ; 0010H=REMOVE ":" AT END
   204                              <3> ; (tm10)			   ; 0020H=colon is not necessary for switch
   205                              <3> ;	   DW	   RESULT	   ; RESULT BUFFER
   206                              <3> ;	   DW	   VALUES	   ; VALUE LISTS
   207                              <3> ;	   DB	   nid		   ; NUMBER OF KEYWORD/SWITCH SYNONYMS IN FOLLOWING LIST
   208                              <3> ;	   DB	   "...",0         ; IF n >0, KEYWORD 1
   209                              <3> ;	   :
   210                              <3> ;
   211                              <3> ;Note:
   212                              <3> ;    - The MATCH_FLAG is bit significant. You can set, for example, TIME bit and
   213                              <3> ;      DATE bit simalteniously.
   214                              <3> ;
   215                              <3> ;      The parser examins each bit along with the following priority.
   216                              <3> ;
   217                              <3> ;      COMPLEX -> DATE -> TIME -> NUMERIC VAL -> SIGNED NUMERIC VAL -> DRIVE ->
   218                              <3> ;      FILE SPEC -> SIMPLE STRING.
   219                              <3> ;
   220                              <3> ;
   221                              <3> ;    - When the FUNCTION_FLAG is 0001 or 0002, the STRING pointed to by a pointer
   222                              <3> ;      in the result buffer is capitalized.
   223                              <3> ;
   224                              <3> ;    - Match_Flags 0001H and 0002H have meaning only for the positional.
   225                              <3> ;
   226                              <3> ;
   227                              <3> ;    - The "...",0 (bottom most line) does require '=' or '/'. When you need a
   228                              <3> ;      switch, for example, '/A', then STRING points to;
   229                              <3> ;
   230                              <3> ;			DB    1 	; number of following synonyms
   231                              <3> ;			DB   '/A',0
   232                              <3> ;
   233                              <3> ;      When you need a keyword, for example, 'CODEPAGE=', then "...",0 will be;
   234                              <3> ;
   235                              <3> ;			DB    1 	; number of following synonyms
   236                              <3> ;			DB   'CODEPAGE=',0
   237                              <3> ;
   238                              <3> ;
   239                              <3> ;    - "..." must consist of upper case characters only because the parser
   240                              <3> ;      performs pattern matching after converting input to upper case (by
   241                              <3> ;      using the current country upper case table)
   242                              <3> ;
   243                              <3> ;
   244                              <3> ;    - One "..." can contain only one switch or keyword. If you need, for
   245                              <3> ;      example /A and /B, the format will be;
   246                              <3> ;
   247                              <3> ;			DB    2 	; number of following synonyms
   248                              <3> ;			DB    '/A',0
   249                              <3> ;			DB    '/B',0
   250                              <3> ;---------------------------------------------------------------------------------------------------------
   251                              <3> 
   252                              <3> ;**** Match_Flags
   253                              <3> 
   254                              <3> D_P_Num_Val	   equ	8000h		;AN000; Numeric Value
   255                              <3> D_P_SNum_Val	   equ	4000h		;AN000; Signed numeric value
   256                              <3> D_P_Simple_S	   equ	2000h		;AN000; Simple string
   257                              <3> D_P_Date_S	   equ	1000h		;AN000; Date string
   258                              <3> D_P_Time_S	   equ	0800h		;AN000; Time string
   259                              <3> D_P_Cmpx_S	   equ	0400h		;AN000; Complex string
   260                              <3> D_P_File_Spc	   equ	0200h		;AN000; File Spec
   261                              <3> D_P_Drv_Only	   equ	0100h		;AN000; Drive Only
   262                              <3> D_P_Qu_String	   equ	0080h		;AN000; Quoted string
   263                              <3> D_P_Ig_Colon	   equ	0010h		;AN000; Ignore colon at end in match
   264                              <3> D_P_Repeat	   equ	0002h		;AN000; Repeat allowed
   265                              <3> D_P_Optional	   equ	0001h		;AN000; Optional
   266                              <3> 
   267                              <3> ;**** Function flags
   268                              <3> 
   269                              <3> D_P_CAP_File	   equ	0001h		;AN000; CAP result by file table
   270                              <3> D_P_CAP_Char	   equ	0002h		;AN000; CAP result by character table
   271                              <3> D_P_Rm_Colon	   equ	0010h		;AN000; Remove ":" at the end
   272                              <3> D_P_colon_is_not_necessary equ 0020h	;AN000;(tm10) /+10 and /+:10
   273                              <3> 
   274                              <3> ;-------------------------------- Control block structure
   275                              <3> D_P_Control_Blk	   struc		;AN000;
   276 00000000 ????                <3> D_P_Match_Flag	   dw	? ;0		;AN000; Controls type matched
   277 00000002 ????                <3> D_P_Function_Flag   dw	? ;0		;AN000; Function should be taken
   278 00000004 ????                <3> D_P_Result_Buf	   dw	? ;0		;AN000; Result buffer address
   279 00000006 ????                <3> D_P_Value_List	   dw	? ;0		;AN000; Value list address
   280 00000008 ??                  <3> D_P_nid		   db	? ;0		;AN000; # of keyword/SW synonyms
   281 00000009 ??                  <3> D_P_KeyorSW	   db	? ;0		;AN000; keyword or sw
   282                              <3> D_P_Control_Blk	   ends 		;AN000;
   283                              <3> ;		   PAGE 		;AN000;
   284                              <3> ;---------------------------------------------------------------------------------------------------------
   285                              <3> ; << Value List Definition >>
   286                              <3> ;
   287                              <3> ;VALUES 	LABEL	BYTE
   288                              <3> ;		DB	nval			; NUMBER OF VALUE DEFINITIONS (0 - 3)
   289                              <3> ;	     =
   290                              <3> ;	     =	DB	nrng			; NUMBER OF RANGES
   291                              <3> ;	     = =DB	ITEM_TAG		; RETURN VALUE IF RANGE MATCHED
   292                              <3> ;	     = =DD	X,Y			; RANGE OF VALUES
   293                              <3> ;	     =	:
   294                              <3> ;	     =	DB	nnval			; NUMBER OF CHOICES
   295                              <3> ;	     = =DB	ITEM_TAG		; RETURN VALUE IF NUMBER CHOICE MATCHED
   296                              <3> ;	     = =DD	VALUE			; SPECIFIC CHOICE IF NUMBER
   297                              <3> ;	     =	:
   298                              <3> ;	     =	DB	nstrval 		; NUMBER OF CHOICES
   299                              <3> ;	     = =DB	ITEM_TAG		; RETURN VALUE IF STRING CHOICE MATCHED
   300                              <3> ;	     = =DW	STRING			; SPECIFIC CHOICE IF STING
   301                              <3> ;	     =	:
   302                              <3> ;
   303                              <3> ;STRING 	DB	"...",0                 ; ASCIIZ STRING IMAGE
   304                              <3> ;
   305                              <3> ;Note:
   306                              <3> ;    - ITEM_TAG must not be 0FFH, which will be used in the result buffer
   307                              <3> ;      when no choice lists are provided.
   308                              <3> ;
   309                              <3> ;    - STRING must consist of upper case characters only because the parser
   310                              <3> ;      performs pattern matching after converting input to upper case (by
   311                              <3> ;      using the current country upper case table)
   312                              <3> ;---------------------------------------------------------------------------------------------------------
   313                              <3> 
   314                              <3> D_P_nval_None	   equ	0		;AN000; no value list ID
   315                              <3> D_P_nval_Range	   equ	1		;AN000; range list ID
   316                              <3> D_P_nval_Value	   equ	2		;AN000; value list ID
   317                              <3> D_P_nval_String	   equ	3		;AN000; string list ID
   318                              <3> D_P_Len_Range	   equ	9		;AN000; Length of a range choice(two DD plus one DB)
   319                              <3> D_P_Len_Value	   equ	5		;AN000; Length of a value choice(one DD plus one DB)
   320                              <3> D_P_Len_String	   equ	3		;AN000; Length of a string choice(one DW plus one DB)
   321                              <3> D_P_No_nrng	   equ	0		;AN000; (tm07) no nrng. nnval must not be 0.
   322                              <3> 
   323                              <3> D_P_Val_List	   struc		;AN000;
   324 00000000 ??                  <3> D_P_NumofList	   db	? ;0		;AN000; number of following choice
   325 00000001 ????                <3> D_P_Val_XL	   dw	? ;0		;AN000; lower word of value
   326 00000003 ????                <3> D_P_Val_XH	   dw	? ;0		;AN000; higher word of value
   327 00000005 ????                <3> D_P_Val_YL	   dw	? ;0		;AN000; lower word of another value
   328 00000007 ????                <3> D_P_Val_YH	   dw	? ;0		;AN000; higher word of another value
   329                              <3> D_P_Val_List	   ends 		;AN000;
   330                              <3> ;		   PAGE 		;AN000;
   331                              <3> ;---------------------------------------------------------------------------------------------------------
   332                              <3> ; << Result Buffer Definition  >>
   333                              <3> ;
   334                              <3> ;RESULT 	LABEL	BYTE			; BELOW FILLED IN FOR DEFAULTS
   335                              <3> ;		DB	type			; TYPE RETURNED: 0=RESERVED,
   336                              <3> ;						;	1=NUMBER, 2=LIST INDEX,
   337                              <3> ;						;	3=STRING, 4=COMPLEX,
   338                              <3> ;						;	5=FILESPEC, 6=DRIVE
   339                              <3> ;						;	7=DATE, 8=TIME
   340                              <3> ;						;	9=QUOTED STRING
   341                              <3> ;		DB	ITEM_TAG		; MATCHED ITEM TAG
   342                              <3> ;
   343                              <3> ;		dw	synonym@		; es:@ points to found SYNONYM if provided.
   344                              <3> ;
   345                              <3> ;
   346                              <3> ;	    =	DD	n			; VALUE IF NUMBER
   347                              <3> ;	    = or
   348                              <3> ;	    =	DW	i			; INDEX (OFFSET) INTO VALUE LIST
   349                              <3> ;	    =					; (ES presents Segment address)
   350                              <3> ;	    = or
   351                              <3> ;	    =	DD	STRING			; OFFSET OF STRING VALUE
   352                              <3> ;	    = or
   353                              <3> ;	    =	DB	drv			; DRIVE NUMBER (1-A, 2-B,..., 26-Z)
   354                              <3> ;	    = or
   355                              <3> ;	    =	DW	YEAR	   ;(1980-2099)  IN CASE OF DATE
   356                              <3> ;	    =	DB	MONTH	   ;(1-12)	 Note: Range check is not performed.
   357                              <3> ;	    =	DB	DATE	   ;(1-31)	       0 is filled when the corresponding field was not specified.
   358                              <3> ;	    = or
   359                              <3> ;	    =	DB	HOUR	   ;(0-23)	  IN CASE OF TIME
   360                              <3> ;	    =	DB	MINUTES    ;(0-59)	  Note: Range check is not performed .
   361                              <3> ;	    =	DB	SECONDS    ;(0-59)		0 is filled when the corresponding field was not specified .
   362                              <3> ;	    =	DB	HUNDREDTHS ;(0-99)
   363                              <3> ;	    =
   364                              <3> ;
   365                              <3> ;
   366                              <3> ;Note: ITEM_TAG is 0FFH when the caller does not specify the choice
   367                              <3> ;      list.
   368                              <3> ;
   369                              <3> ;      YEAR: If the input value for the year is less than 100, parser
   370                              <3> ;	     adds 1900 to it.  For example, when 87 is input to parser for
   371                              <3> ;	     the year value, he returns 1987.
   372                              <3> ;---------------------------------------------------------------------------------------------------------
   373                              <3> 
   374                              <3> ;-------------------------------- Result block structure
   375                              <3> D_P_Result_Blk	   struc		;AN000;
   376 00000000 ??                  <3> D_P_Type 	   db	? ;0		;AN000; Type returned
   377 00000001 ??                  <3> D_P_Item_Tag	   db	? ;0		;AN000; Matched item tag
   378 00000002 ????                <3> D_P_SYNONYM_Ptr	   dw	? ;0		;AN000; pointer to Synonym list returned
   379 00000004 ????????            <3> D_P_Picked_Val	   db	?,?,?,? ;0,0,0,0 	;AN000; value
   380                              <3> D_P_Result_Blk	   ends 		;AN000;
   381                              <3> ;--------------------------------
   382                              <3> ;**** values for the type field in the result block
   383                              <3> 
   384                              <3> D_P_EOL		   equ	0		;AN000; End of line
   385                              <3> D_P_Number	   equ	1		;AN000; Number
   386                              <3> D_P_List_Idx	   equ	2		;AN000; List Index
   387                              <3> D_P_String	   equ	3		;AN000; String
   388                              <3> D_P_Complex	   equ	4		;AN000; Complex
   389                              <3> D_P_File_Spec	   equ	5		;AN000; File Spec
   390                              <3> D_P_Drive	   equ	6		;AN000; Drive
   391                              <3> D_P_Date_F	   equ	7		;AN000; Date
   392                              <3> D_P_Time_F	   equ	8		;AN000; Time
   393                              <3> D_P_Quoted_String   equ	9		;AN000; Quoted String
   394                              <3> 
   395                              <3> D_P_No_Tag	   equ	0FFH		;AN000; No ITEM_TAG found
   396                              <3> ;**** Return code
   397                              <3> ;
   398                              <3> ; following return code will be returned in the AX register.
   399                              <3> 
   400                              <3> D_P_No_Error	   equ	0		;AN000; No error
   401                              <3> D_P_Too_Many	   equ	1		;AN000; Too many operands
   402                              <3> D_P_Op_Missing	   equ	2		;AN000; Required operand missing
   403                              <3> D_P_Not_In_SW	   equ	3		;AN000; Not in switch list provided
   404                              <3> D_P_Not_In_Key	   equ	4		;AN000; Not in keyword list provided
   405                              <3> D_P_Out_Of_Range    equ	6		;AN000; Out of range specified
   406                              <3> D_P_Not_In_Val	   equ	7		;AN000; Not in value list provided
   407                              <3> D_P_Not_In_Str	   equ	8		;AN000; Not in string list provided
   408                              <3> D_P_Syntax	   equ	9		;AN000; Syntax error
   409                              <3> D_P_RC_EOL	   equ	-1		;AN000; End of command line
   410                              <3> 
   411                              <3> ;		   PAGE 		;AN000;
   412                              <3> ;********************** Local Data *************************************
   413 00000000 0000                <3> D_P_ORDINAL	   dw	0		;AN000; Operand ordinal save area
   414 00000002 0000                <3> D_P_RC		   dw	0		;AN000; Return code from parser
   415 00000004 0000                <3> D_P_SI_Save	   dw	0		;AN000; Pointer of command buffer
   416 00000006 0000                <3> D_P_DX		   dw	0		;AN000; Return result buffer address
   417 00000008 00                  <3> D_P_Terminator	   db	0		;AN000; Terminator code (ASCII)
   418 00000009 0000                <3> D_P_DBCSEV_OFF	   dw	0		;AN000; Offset of DBCS EV
   419 0000000B 0000                <3> D_P_DBCSEV_SEG	   dw	0		;AN000; Segment of DBCS EV
   420 0000000D 0000                <3> D_P_Flags	   dw	0		;AN000; Parser internal flags
   421                              <3> labelsize D_P_Flags1, byte, D_P_Flags ;AN038; to reference first byte flags
   422                              <3> labelsize D_P_Flags2, byte, D_P_Flags+1 ;AN038; to reference second byte flags only
   423                              <3> 
   424                              <3> ;in second byte of D_P_Flags, referenced as D_P_Flags2:
   425                              <3> D_P_equ		   equ	01h	      ;AN000; "=" packed in string buffet
   426                              <3> D_P_Neg		   equ	02h	      ;AN000; Negative value
   427                              <3> D_P_Time12	   equ	04h	      ;AN000; set when PM is specified
   428                              <3> D_P_Key_Cmp	   equ	08h	      ;AN000; set when keyword compare
   429                              <3> D_P_SW_Cmp	   equ	10h	      ;AN000; set when switch compare
   430                              <3> D_P_Extra	   equ	20h	      ;AN000; set when extra delimiter found
   431                              <3> D_P_SW		   equ	40h	      ;AN000; set when switch found (tm08)
   432                              <3> D_P_Signed	   equ	80h	      ;AN000; signed numeric specified
   433                              <3> 
   434                              <3> ;in first byte of D_P_Flags, referenced as D_P_Flags1:
   435                              <3> D_P_time12am	   equ	01h	      ;AN038; set when AM is specified on time
   436                              <3> D_P_TIME_AGAIN	   EQU	02H	      ;AN039; SET WHEN READY TO RE-PARSE TIME
   437                              <3> 
   438 0000000F 0000                <3> D_P_SaveSI_Cmpx	   dw	0		;AN000; save si for later use by complex
   439 00000011 0000                <3> D_P_KEYorSW_Ptr	   dw	0		;AN000; points next to "=" or ":" code
   440 00000013 0000                <3> D_P_Save_EOB	   dw	0		;AN000; save pointer to EOB
   441 00000015 0000                <3> D_P_Found_SYNONYM   dw	0		;AN000; es:@ points to found synonym
   442                              <3> 
   443 00000017 000000000000000000- <3> D_P_STRING_BUF	   db	128 dup(0)	;AN000; Pick a operand from command line
   443 00000020 000000000000000000- <3>
   443 00000029 000000000000000000- <3>
   443 00000032 000000000000000000- <3>
   443 0000003B 000000000000000000- <3>
   443 00000044 000000000000000000- <3>
   443 0000004D 000000000000000000- <3>
   443 00000056 000000000000000000- <3>
   443 0000005F 000000000000000000- <3>
   443 00000068 000000000000000000- <3>
   443 00000071 000000000000000000- <3>
   443 0000007A 000000000000000000- <3>
   443 00000083 000000000000000000- <3>
   443 0000008C 000000000000000000- <3>
   443 00000095 0000                <3>
   444                              <3> D_P_STRING_BUF_END  equ	$		;AN000;
   445                              <3> %IF		   TimeSw		;AN039; For TIME only
   446                              <3> D_P_ORIG_ORD	   DW	0		;AN039; ORIGINAL ORDINAL FROM CX
   447                              <3> D_P_ORIG_STACK	   DW	0		;AN039; ORIGINAL VALUE OF STACK FROM SP
   448                              <3> D_P_ORIG_SI	   DW	0		;AN039; ORIGINAL START PARSE POINTER FROM SI
   449                              <3> %endif					;AN039;
   450                              <3> %IF		   DateSw+TimeSw	;AN000;(Check if date or time format is supported)
   451                              <3> ;------------------------------
   452                              <3> ;
   453                              <3> D_P_Got_Time	   db	0		;AN023; if 1, use Time delimiters
   454                              <3> D_P_NeedToBeRead    equ	0ffffh		;AN000;
   455                              <3> 
   456                              <3> D_P_COUNTRY_INFO: ; NASM structure instance
   457                              <3> D_P_CDI_size equ D_P_CDI_struc_size	; NASM port equate
   458                              <3> istruc D_P_CDI
   459                              <3> at D_P_CDI_DateF
   460                              <3> 	dw D_P_NeedToBeRead
   461                              <3> iend
   462                              <3> ;
   463                              <3> D_P_1st_Val	   dw	0		;AN000; used when process date or time
   464                              <3> D_P_2nd_Val	   dw	0		;AN000; used when process date or time
   465                              <3> D_P_3rd_Val	   dw	0		;AN000; used when process date or time
   466                              <3> D_P_4th_Val	   dw	0		;AN000; used when process date or time
   467                              <3> ;------------------------------
   468                              <3> %endif					;AN000;(of DateSW+TimeSW)
   469 00000097 FF                  <3> D_P_Char_CAP_Ptr    db	0ffh		;AN000; info id
   470 00000098 0000                <3> 		   dw	0		;AN000; offset	of char case map table
   471 0000009A 0000                <3> 		   dw	0		;AN000; segment of char case map table
   472                              <3> %IF		   CAPSW		;AN000;(Check if uppercase conversion is supported)
   473 0000009C FF                  <3> D_P_File_CAP_Ptr    db	0ffh		;AN000; info id
   474 0000009D 0000                <3> 		   dw	0		;AN000; offset	of file case map table
   475 0000009F 0000                <3> 		   dw	0		;AN000; segment of file case map table
   476                              <3> %endif					;AN000;(of CAPSW)
   477                              <3> ; (tm06) IF	   FileSW		;AN000;(Check if file spec is supported)
   478                              <3> %IF		   FileSW+DrvSW 	;AN000;(Check if file spec is supported)
   479 000000A1 5B5D7C3C3E2B3D3B22  <3> D_P_FileSp_Char	   db	'[]|<>+=;"'     ;AN000; delimitter of file spec
   480                              <3> D_P_FileSp_Len	   equ	$-D_P_FileSp_Char ;AN000;
   481                              <3> %endif					;AN000;(of FileSW)
   482                              <3> ; (tm05) IF	   QusSW		;AN000;(Check if quoted string is supported)
   483                              <3> ;(deleted ;AN025;) IF		      QusSW+CmpxSW	   ; (tm05) ;AN000;(Check if quoted string is supported)
   484                              <3> ;(deleted ;AN025;) D_P_SorD_Quote      db   0		   ;AN000; keep double or single quote
   485                              <3> ;(deleted ;AN025;) %endif				   ;AN000;(of QueSW)
   486                              <3> %IF		   KeySW		;AN029; if keywords supported
   487                              <3> D_P_count_to_eol    dw	0		;AN029; count of chars not including EOL
   488                              <3> ;	REGISTER EQUATES - SPECIAL USAGE FOR REGISTERS
   489                              <3> %idefine D_P_REG_BH_CG_SW	BH		;AN029;0="NO CHANGES MADE", FF=CHANGES MADE
   490                              <3> %idefine D_P_REG_BL_DQ_SW	BL		;AN029;0=NOT IN QUOTES,FF=IN QUOTES
   491                              <3> 
   492                              <3> D_P_DOUBLE_QUOTE    EQU	'"'            ;AN029;
   493                              <3> D_P_BL_EQ	   EQU	"= "            ;AN029;
   494                              <3> D_P_EQ_BL	   EQU	" ="            ;AN029;
   495                              <3> D_P_TB_EQ	   EQU	093DH		;AN029; ;"<TAB>="
   496                              <3> D_P_EQ_TB	   EQU	3D09H		;AN029; ;"=<TAB>"
   497                              <3> %endif					;AN029; IF KeySW Supported
   498                              <3> 
   499                              <3> ; delimiter parsing
   500                              <3> D_P_colon_period    equ	01		;AN032; check for colon & period
   501                              <3> D_P_period_only	   equ	02		;AN032; check only for period
   502                              <3> 
   503                              <3> ;filespec error flag
   504 000000AA 00                  <3> D_P_err_flag	   db	00		;AN033; flag set if filespec parsing error
   505                              <3> 					;AN033;  was detected.
   506                              <3> D_P_error_filespec  equ	01		;AN033; mask to set flag
   507                              <3> ;***********************************************************************
    30                              <2> %endif					;AN000; endif		  (tm03)
    31                              <2> ;   PAGE 				;AN000;
    32                              <2>    %warning out: INCLUDING COMP=COMMON DSN=PARSE.ASM...;AN000;
    32          ******************  <2>  warning: out: INCLUDING COMP=COMMON DSN=PARSE.ASM... [-w+user]
    33                              <2> ;***********************************************************************
    34                              <2> ; SysParse;
    35                              <2> ;
    36                              <2> ;  Function : Parser Entry
    37                              <2> ;
    38                              <2> ;  Input: DS:SI -> command line
    39                              <2> ;	  ES:DI -> parameter block
    40                              <2> ;	  psdata_seg -> psdata.inc
    41                              <2> ;	  CX = operand ordinal
    42                              <2> ;
    43                              <2> ;	  Note:  ES is the segment containing all the control blocks defined
    44                              <2> ;		 by the caller, except for the DOS COMMAND line parms, which
    45                              <2> ;		 is in DS.
    46                              <2> ;
    47                              <2> ;  Output: CY = 1   error of caller, means invalid parameter block or
    48                              <2> ;		    invalid value list. But this parser does NOT implement
    49                              <2> ;		    this feature. Therefore CY always zero.
    50                              <2> ;
    51                              <2> ;	   CY = 0   AX = return code
    52                              <2> ;		    BL = terminated delimiter code
    53                              <2> ;		    CX = new operand ordinal
    54                              <2> ;		    SI = set past scaned operand
    55                              <2> ;		    DX = selected result buffer
    56                              <2> ;
    57                              <2> ; Use:	D_P_Skip_Delim, D_P_Chk_EOL, D_P_Chk_Delim, D_P_Chk_DBCS
    58                              <2> ;	D_P_Chk_Swtch, D_P_Chk_Pos_Control, D_P_Chk_Key_Control
    59                              <2> ;	D_P_Chk_Sw_Control, D_P_Fill_Result
    60                              <2> ;
    61                              <2> ; Vars: D_P_Ordinal(RW), D_P_RC(RW), D_P_SI_Save(RW), D_P_DX(R), D_P_Terminator(R)
    62                              <2> ;	D_P_SaveSI_Cmpx(W), D_P_Flags(RW), D_P_Found_SYNONYM(R), D_P_Save_EOB(W)
    63                              <2> ;
    64                              <2> ;-------- Modification History -----------------------------------------
    65                              <2> ;
    66                              <2> ;  4/04/87 : Created by K. K,
    67                              <2> ;  4/28/87 : D_P_Val_YH assemble error (tm01)
    68                              <2> ;	   : JMP SHORT assemble error (tm02)
    69                              <2> ;  5/14/87 : Someone doesn't want to include psdata (tm03)
    70                              <2> ;  6/12/87 : D_P_Bridge is missing when TimeSw equ 0 and (CmpxSw equ 1 or
    71                              <2> ;	     DateSW equ 1)	      (tm04)
    72                              <2> ;  6/12/87 : D_P_SorD_Quote is missing when QusSw equ 0 and CmpxSW equ 1
    73                              <2> ;				      (tm05) in PSDATA.INC
    74                              <2> ;  6/12/87 : D_P_FileSp_Char and D_P_FileSP_Len are missing
    75                              <2> ;	     when FileSW equ 0 and DrvSW equ 1 (tm06) in PSDATA.INC
    76                              <2> ;  6/18/87 : $VAL1 and $VAL3, $VAL2 and $VAL3 can be used in the same
    77                              <2> ;	     value-list block	      (tm07)
    78                              <2> ;  6/20/87 : Add D_P_SW to check if there's an omiting parameter after
    79                              <2> ;	     switch (keyword) or not. If there is, backup si for next call
    80                              <2> ;	     (tm08)
    81                              <2> ;  6/24/87 : Complex Item checking does not work correctly when CmpSW equ 1
    82                              <2> ;	     and DateSW equ 0 and TimeSW equ 0 (tm09)
    83                              <2> ;  6/24/87 : New function flag D_P_colon_is_not_necessary for switch
    84                              <2> ;	     /+15 and /+:15 are allowed for user (tm10)
    85                              <2> ;  6/29/87 : ECS call changes DS register but it causes the address problem
    86                              <2> ;	     in user's routines. D_P_Chk_DBCS (tm11)
    87                              <2> ;  7/10/87 : Switch with no_match flag (0x0000H) does not work correctly
    88                              <2> ;					  (tm12)
    89                              <2> ;  7/10/87 : Invalid switch/keyword does not work correctly
    90                              <2> ;					  (tm13)
    91                              <2> ;  7/10/87 : Drive_only breaks 3 bytes after the result buffer
    92                              <2> ;					  (tm14)
    93                              <2> ;  7/12/87 : Too_Many_Operands sets DX=0 as the PARSE result
    94                              <2> ;					  (tm15)
    95                              <2> ;  7/24/87 : Negative lower bound on numeric ranges cause trouble
    96                              <2> 
    97                              <2> ;  7/24/87 : Quoted strings being returned with quotes.
    98                              <2> 
    99                              <2> ;  7/28/87 : Kerry S (;AN018;)
   100                              <2> ;	     Non optional value on switch (match flags<>0 and <>1) not flagged
   101                              <2> ;	     as an error when missing.	Solution: return error 2.  Modules
   102                              <2> ;	     affected: D_P_Chk_SW_Control.
   103                              <2> 
   104                              <2> ;  7/29/87 : Kerry S (;AN019;)
   105                              <2> ;	     Now allow the optional bit in match flags for switches.  This
   106                              <2> ;	     allows the switch to be encountered with a value or without a
   107                              <2> ;	     value and no error is returned.
   108                              <2> ;
   109                              <2> 
   110                              <2> ;  8/28/87 : Ed K, Kerry S (;AN020;)
   111                              <2> ;  9/14/87   In PROC D_P_Get_DecNum, when checking for field separators
   112                              <2> ;	     within a date response, instead of checking just for the one
   113                              <2> ;	     character defined by the COUNTRY DEPENDENT INFO, check for
   114                              <2> ;	     all three chars, "-", "/", and ".". Change D_P_Chk_Switch to allow
   115                              <2> ;	     slashes in date strings when DateSw (assembler switch) is set.
   116                              <2> 
   117                              <2> ;  9/1/87  : Kerry S (;AN021)
   118                              <2> ;	     In PROC D_P_String_Comp, when comparing the switch or keyword on
   119                              <2> ;	     the command line with the string in the control block the
   120                              <2> ;	     comparing was stopping at a colon (switch) or equal (keyword)
   121                              <2> ;	     on the command line and assuming a match.	This allowed a shorter
   122                              <2> ;	     string on the command line than in the synonym list in the control
   123                              <2> ;	     block.  I put in a test for a null in the control block so the
   124                              <2> ;	     string in the control block must be the same length as the string
   125                              <2> ;	     preceeding the colon or equal on the command line.
   126                              <2> 
   127                              <2> ;  8/28/87 : Kerry S (;AN022;)
   128                              <2> ;	     All references to data in PSDATA.INC had CS overrides.  This caused
   129                              <2> ;	     problems for people who included it themselves in a segment other
   130                              <2> ;	     than CS.  Added switch to allow including PSDATA.INC in any
   131                              <2> ;	     segment.
   132                              <2> 
   133                              <2> ;  9/16/87 : Ed K (;AN023;) PTM1040
   134                              <2> ;	     in D_P_set_cdi PROC, it assumes CS points to psdata. Change Push CS
   135                              <2> ;	     into PUSH PSDATA_SEG.  In D_P_Get_DecNum PROC, fix AN020
   136                              <2> ;	     forced both TIME and DATE to use the delims, "-","/",".".
   137                              <2> ;	     Created FLag, in D_P_time_Format PROC, to request the delim in
   138                              <2> ;	     BL be used if TIME is being parsed.
   139                              <2> 
   140                              <2> ;  9/24/87 : Ed K
   141                              <2> ;	     Removed the include to STRUC.INC.	Replaced the STRUC macro
   142                              <2> ;	     invocations with their normally expanded code; made comments
   143                              <2> ;	     out of the STRUC macro invocation statements to maintain readability.
   144                              <2> 
   145                              <2> ;  9/24/87 : Ed K (;AN024;) PTM1222
   146                              <2> ;	     When no CONTROL for a keyword found, tried to fill in RESULT
   147                              <2> ;	     pointed to by non-existant CONTROL.
   148                              <2> 
   149                              <2> ; 10/15/87 : Ed K (;AN025;) PTM1672
   150                              <2> ;	     A quoted text string can be framed only by double quote.  Remove
   151                              <2> ;	     support to frame quoted text string with single quote.
   152                              <2> ;	     (apostrophe) D_P_SorD_Quote is removed from PSDATA.INC.
   153                              <2> ;	     D_P_SQuote EQU also removed from PSDATA.INC.  Any references to
   154                              <2> ;	     single quote in PROC prologues are left as is for history reasons.
   155                              <2> 
   156                              <2> ;	     This fixes another bug, not mentioned in p1672, in that two
   157                              <2> ;	     quote chars within a quoted string is supposed to be reported as
   158                              <2> ;	     one quote character, but is reported as two quotes.  This changed
   159                              <2> ;	     two instructions in PROC D_P_Quoted_Str.
   160                              <2> 
   161                              <2> ;	     Also fixed are several JMP that caused a NOP, these changed to
   162                              <2> ;	     have the SHORT operator to avoid the unneeded NOP.
   163                              <2> 
   164                              <2> ;	     The code and PSDATA.INC have been aligned for ease of reading.
   165                              <2> 
   166                              <2> ; 10/26/87 : Ed K (;AN026;) PTM2041, DATE within SWITCH, BX reference to
   167                              <2> ;	     psdata buffer should have psdata_seg.
   168                              <2> 
   169                              <2> ; 10/27/87 : Ed K (;AN027;) PTM2042 comma between keywords implies
   170                              <2> ;	     positional missing.
   171                              <2> 
   172                              <2> ; 11/06/87 : Ed K (;AN028;) PTM 2315 Parser should not use line feed
   173                              <2> ;	     as a line delimiter, should use carriage return.
   174                              <2> ;	     Define switch: LFEOLSW, if on, accept LF as end of line char.
   175                              <2> 
   176                              <2> ; 11/11/87 : Ed K (;AN029;) PTM 1651 GET RID OF WHITESPACE AROUND "=".
   177                              <2> 
   178                              <2> ; 11/18/87 : Ed K (;AN030;) PTM 2551 If filename is just "", then
   179                              <2> ;	     endless loop since SI is returned still pointing to start
   180                              <2> ;	     of that parm.
   181                              <2> 
   182                              <2> ; 11/19/87 : Ed K (;AN031;) PTM 2585 date & time getting bad values.
   183                              <2> ;	     Vector to returned string has CS instead of Psdata_Seg, but
   184                              <2> ;	     when tried to fix it on previous version, changed similar
   185                              <2> ;	     but wrong place.
   186                              <2> 
   187                              <2> ; 12/09/87 : Bill L (;AN032;) PTM 2772 colon and period are now valid
   188                              <2> ;	     delimiters between hours, minutes, seconds for time. And period
   189                              <2> ;	     and comma are valid delimiters between seconds and 100th second.
   190                              <2> 
   191                              <2> ; 12/14/87 : Bill L (;AN033;) PTM 2722 if illegal delimiter characters
   192                              <2> ;	     in a filespec, then flag an error.
   193                              <2> 
   194                              <2> ; 12/22/87 : Bill L (;AN034;)	    All local data to parser is now
   195                              <2> ;	     indexed off of the psdata_seg equate instead of the DS register.
   196                              <2> ;	     Using this method, DS can point to the segment of PSP or to psdata
   197                              <2> ;  -->	     local parser data. Why were some references to local data changed
   198                              <2> ;	     to do this before, but not all ?????
   199                              <2> 
   200                              <2> ; 02/02/88 : Ed K (;AC035;) INSPECT utility, suggests optimizations.
   201                              <2> 
   202                              <2> ; 02/05/88 : Ed K (;AN036;) P3372-UPPERCASE TRANSLATION, PSDATA_SEG HOSED.
   203                              <2> ;
   204                              <2> ; 02/08/88 : Ed K (;AN037;) P3410-AVOID POP OF CS, CHECK BASESW FIRST.
   205                              <2> 
   206                              <2> ; 02/19/88 : Ed K (;AN038;) p3524 above noon and "am" should be error
   207                              <2> 
   208                              <2> ; 02/23/88 : Ed K (;AN039;) p3518 accept "comma" and "period" as decimal
   209                              <2> ;	     separator in TIME before hundredths field.
   210                              <2> ;
   211                              <2> ;***********************************************************************
   212                              <2> %IF FarSW				;AN000;(Check if need far return)
   213                              <2> SysParse proc far			;AN000;
   214                              <2> %ELSE					;AN000;
   215                              <2> SysParse proc near			;AN000;
   216                              <2> %ENDIF					;AN000;(of FarSW)
   217                              <2> ;	$SALUT	(4,9,17,41)
   218 000000AB 2EC706[0D00]0000    <2> 	mov	word [psdata_seg:D_P_Flags],0	;AC034; Clear all internal flags
   219                              <2> %IF	TimeSw				;AN039; FOR TIME ONLY
   220                              <2> 	MOV    [PSDATA_SEG:D_P_ORIG_ORD],CX ;AN039; ORIGINAL ORDINAL FROM CX
   221                              <2> 	MOV    [PSDATA_SEG:D_P_ORIG_STACK],SP ;AN039; ORIGINAL VALUE OF STACK FROM SP
   222                              <2> 	MOV    [PSDATA_SEG:D_P_ORIG_SI],SI ;AN039; ORIGINAL START PARSE POINTER FROM SI
   223                              <2> D_P_REDO_TIME:				;AN039; try to parse time again
   224                              <2> %ENDIF					;AN039; FOR TIME ONLY
   225 000000B2 FC                  <2> 	cld				      ;AN000; confirm forward direction
   226                              <2> D_P_ordinal equ D_P_ORDINAL	; NASM port label
   227 000000B3 2E890E[0000]        <2> 	mov	[psdata_seg:D_P_ordinal],cx      ;AC034; save operand ordinal
   228 000000B8 2EC706[0200]0000    <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error  ;AC034; Assume no error
   229 000000BF 2EC706[1500]0000    <2> 	mov	word [psdata_seg:D_P_Found_SYNONYM],0 ;AC034; initalize synonym pointer
   230                              <2> 
   231 000000C6 2EC706[0600]0000    <2> 	mov	word [psdata_seg:D_P_DX],0   ;AC034; (tm15)
   232                              <2> %IF KeySW				;AN029;
   233                              <2> ;IN CASE THE USER PUT OPTIONAL WHITESPACE CHARS AROUND THE "=" USED IN
   234                              <2> ;KEYWORD DEFINITIONS, SCAN THE COMMAND LINE AND COMPRESS OUT ANY WHITESPACES
   235                              <2> ;NEXT TO "=" BEFORE STARTING THE USUAL PARSING.
   236                              <2>        push	 cx			;AN029;
   237                              <2>        push	 dx			;AN029;
   238                              <2>        push	 di			;AN029;
   239                              <2> 
   240                              <2>        push	 si			;AN029; remember where command line starts
   241                              <2>        mov	 cx,-1			;AN029; init counter
   242                              <2> ;      $do
   243                              <2> D_P_loc_eol:				;AN029;
   244                              <2> 	  inc	    cx			;AN029; bump counter of chars up to EOL
   245                              <2> 	  lodsb 			;AN029; get a char from command line
   246                              <2> 	  CALL	    D_P_Chk_EOL		;AN029; see if AL is EOL char
   247                              <2> 
   248                              <2> ;      enddo z
   249                              <2> D_P_loc_EOL equ D_P_loc_eol	; NASM port label
   250                              <2>        jnz	 D_P_loc_EOL		;AN029; not found that EOL char
   251                              <2> 
   252                              <2> D_P_count_to_EOL equ D_P_count_to_eol	; NASM port label
   253                              <2>        mov	 [psdata_seg:D_P_count_to_EOL],cx ;AN029;AC034;; save count of chars up to EOL
   254                              <2>        pop	 si			;AN029; restore start of command line
   255                              <2> 
   256                              <2> ;scan command string for combinations including "=",
   257                              <2> ;      and replace each with just the simple "="
   258                              <2> 
   259                              <2> ;REPEAT UNTIL ONE PASS IS MADE WHEREIN NO CHANGES WERE MADE
   260                              <2> ;  $do
   261                              <2> D_P_DO1: 			   ;AN029;
   262                              <2>        push si			   ;AN029; remember where string started
   263                              <2> D_P_COUNT_TO_EOL equ D_P_count_to_eol	; NASM port label
   264                              <2>        MOV  CX,[psdata_seg:D_P_COUNT_TO_EOL] ;AN029;AC034;; set  count to no. chars in string,
   265                              <2> 				   ;AN029; not counting the EOL char
   266                              <2>        XOR  BX,BX		   ;AN029;SET D_P_REG_BL_DQ_SW TO "NOT IN QUOTES", AND...
   267                              <2> 				   ;AN029;SET D_P_REG_BH_CG_SW TO "NO CHANGES MADE"
   268                              <2> ;MAKE ONE PASS THRU THE STRING, LOOKING AT EACH CHARACTER
   269                              <2> ;      $do			   ;AN029;
   270                              <2> D_P_DO2: 			   ;AN029;
   271                              <2> D_P_double_quote equ D_P_DOUBLE_QUOTE	; NASM port equate
   272                              <2> 	   cmp	BYTE PTR [SI],D_P_double_quote ;AN029;
   273                              <2> ;	   $if	e		   ;AN029;if a double quote was found
   274                              <2> 	   JNE D_P_IF3		   ;AN029;
   275                              <2> 	       NOT  D_P_REG_BL_DQ_SW ;AN029;TOGGLE THE DOUBLE QUOTE STATE SWITCH
   276                              <2> ;	   $endif		   ;AN029;
   277                              <2> D_P_IF3: 			   ;AN029;
   278                              <2> 	   OR	D_P_REG_BL_DQ_SW,D_P_REG_BL_DQ_SW ;AN029;IS THE DOUBLE QUOTE SWITCH SET?
   279                              <2> ;	   $if	Z		   ;AN029;IF NOT IN DOUBLE QUOTES
   280                              <2> 	   JNZ D_P_IF5		   ;AN029;
   281                              <2> 	       mov  ax,word ptr [si] ;AN029; get pair to be checked out
   282                              <2> 	       cmp  ax,D_P_BL_EQ    ;AN029;" ="
   283                              <2> ;	       $if  e,or	   ;AN029;
   284                              <2> 	       JE D_P_LL6	   ;AN029;
   285                              <2> 	       cmp  ax,D_P_EQ_BL    ;AN029;"= "
   286                              <2> ;	       $if  e,or	   ;AN029;
   287                              <2> 	       JE D_P_LL6	   ;AN029;
   288                              <2> 	       cmp  ax,D_P_EQ_TB    ;AN029; "=<tab>"
   289                              <2> ;	       $if  e,or	   ;AN029;
   290                              <2> 	       JE D_P_LL6	   ;AN029;
   291                              <2> 	       cmp  ax,D_P_TB_EQ    ;AN029;"<tab>="
   292                              <2> ;	       $if  e		   ;AN029;if this pair to be replaced with a single "="
   293                              <2> 	       JNE D_P_IF6	   ;AN029;
   294                              <2> D_P_LL6: 			   ;AN029;
   295                              <2> 		   mov	BYTE PTR [SI],D_P_Keyword ;AN029; "="
   296                              <2> 		   inc	si	   ;AN029;point to next char after the new "="
   297                              <2> 		   mov	di,si	   ;AN029;move target right after new "="
   298                              <2> 
   299                              <2> 		   push si	   ;AN029;remember where i am, right after new "="
   300                              <2> 		   PUSH CX	   ;AN029;SAVE CURRENT COUNT
   301                              <2> 		   inc	si	   ;AN029;source is one beyond that
   302                              <2> 		   push es	   ;AN029;remember the extra segment
   303                              <2> 		   push ds	   ;AN029;temporarily, set source seg and
   304                              <2> 		   pop	es	   ;AN029; target seg to the command line seg
   305                              <2> 		   rep	movsb	   ;AN029;move chars left one position
   306                              <2> 		   pop	es	   ;AN029;restore the extra segment
   307                              <2> 		   POP	CX	   ;AN029;RESTORE CURRENT COUNT
   308                              <2> 		   pop	si	   ;AN029;back to where I was
   309                              <2> 
   310                              <2> 		   DEC	SI	   ;AN029;LOOK AT FIRST CHAR JUST MOVED
   311                              <2> 		   MOV	D_P_REG_BH_CG_SW,-1 ;AN029;set switch to say "a change was made"
   312                              <2> 		   DEC	word [psdata_seg:D_P_COUNT_TO_EOL] ;AN029;AC034;;because just threw away a char
   313                              <2> 		   dec	CX	   ;AN029;DITTO
   314                              <2> ;	       $endif		   ;AN029;comparand pair found?
   315                              <2> D_P_IF6: 			   ;AN029;
   316                              <2> ;	   $endif		   ;AN029;double quote switch?
   317                              <2> D_P_IF5: 			   ;AN029;
   318                              <2> 	   inc	si		   ;AN029;bump index to look at next char in command string
   319                              <2> 	   dec	CX		   ;AN029;one less char to look at
   320                              <2> ;(deleted ;AC035;)  CMP  CX,0		    ;AN029;is char count all gone yet?
   321                              <2> ;      $enddo LE		   ;AN029;quit if no more chars
   322                              <2>        JNLE D_P_DO2		   ;AN029;
   323                              <2>        pop  si			   ;AN029;remember where string started
   324                              <2>        OR   D_P_REG_BH_CG_SW,D_P_REG_BH_CG_SW ;AN029;WAS "A CHANGE MADE"?
   325                              <2> ;  $enddo Z			   ;AN029;QUIT when no changes were made
   326                              <2>    JNZ D_P_DO1			   ;AN029;
   327                              <2>    pop	di			   ;AN029;
   328                              <2>    pop	dx			   ;AN029;
   329                              <2>    pop	cx			   ;AN029;
   330                              <2> 
   331                              <2> ;NOW THAT ALL WHITESPACE SURROUNDING "=" HAVE BEEN COMPRESSED OUT,
   332                              <2> ;RESUME NORMAL PARSING...
   333                              <2> %ENDIF					;AN029; KEYWORDS SUPPORTED?
   334 000000CD E86007              <2> 	call	D_P_Skip_Delim		;AN000; Move si to 1st non white space
   335 000000D0 7313                <2> 	jnc	D_P_Start		;AN000; If EOL is not encountered, do parse
   336                              <2> 
   337                              <2> ;--------------------------- End of Line
   338 000000D2 B8FFFF              <2> 	mov	ax,D_P_RC_EOL		;AN000; set exit code to -1
   339 000000D5 53                  <2> 	push	bx			;AN000;
   340 000000D6 268B1D              <2> 	mov	bx,[es:di + D_P_PARMSX_Address] ;AN000; Get the PARMSX address to
   341 000000D9 263A0F              <2> 	cmp	cl,[es:bx + D_P_MinP]	;AN000; check ORDINAL to see if the minimum
   342 000000DC 7303                <2> 	jae	D_P_Fin			;AN000; positional found.
   343                              <2> 
   344 000000DE B80200              <2> 	mov	ax,D_P_Op_Missing	;AN000; If no, set exit code to missing operand
   345                              <2> D_P_Fin: 				;AN000;
   346 000000E1 5B                  <2> 	pop	bx			;AN000;
   347 000000E2 E91D01              <2> 	jmp	D_P_Single_Exit		;AN000; return to the caller
   348                              <2> 
   349                              <2> ;---------------------------
   350                              <2> D_P_Start:				;AN000;
   351 000000E5 2E8936[0F00]        <2> 	mov	[psdata_seg:D_P_SaveSI_Cmpx],si ;AN000;AC034;  save ptr to command line for later use by complex,
   352 000000EA 53                  <2> 	push	bx			;AN000; quoted string or file spec.
   353 000000EB 57                  <2> 	push	di			;AN000;
   354 000000EC 55                  <2> 	push	bp			;AN000;
   355 000000ED 8D1E[1700]          <2> 	lea	bx,[D_P_STRING_BUF] ;AC034; set buffer to copy from command string
   356 000000F1 2EF606[0E00]20      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Extra ;AC034; 3/9 extra delimiter encountered ?
   357 000000F7 7543                <2> 	jne	D_P_Pack_End		;AN000; 3/9 if yes, no need to copy
   358                              <2> 
   359                              <2> D_P_Pack_Loop:				;AN000;
   360 000000F9 AC                  <2> 	lodsb				;AN000; Pick a operand from buffer
   361 000000FA E8F007              <2> 	call	D_P_Chk_Switch		;AN000; Check switch character
   362 000000FD 723C                <2> 	jc	D_P_Pack_End_BY_EOL	;AN020; if carry set found delimiter type slash, need backup si, else continue
   363                              <2> 
   364 000000FF E85407              <2> 	call	D_P_Chk_EOL		;AN000; Check EOL character
   365 00000102 7437                <2> 	je	D_P_Pack_End_BY_EOL	;AN000; need backup si
   366                              <2> 
   367 00000104 E88507              <2> 	call	D_P_Chk_Delim		;AN000; Check delimiter
   368 00000107 7518                <2> 	jne	D_P_PL01 		;AN000; If no, process next byte
   369                              <2> 
   370 00000109 2EF606[0E00]20      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Extra ;AC034; 3/9 If yes and white spec,
   371                              <2> ; (tm08)jne	D_P_Pack_End		;AN000; 3/9 then
   372                              <2> D_P_Pack_End_backup_si equ D_P_PAck_End_backup_si	; NASM port label
   373 0000010F 7505                <2> 	jne	D_P_Pack_End_backup_si	;AN000; (tm08)
   374                              <2> 
   375 00000111 E81C07              <2> 	call	D_P_Skip_Delim		;AN000; skip subsequent white space,too
   376 00000114 EB26                <2> 	jmp	short D_P_Pack_End	;AN000; finish copy by placing NUL at end
   377                              <2> 
   378                              <2> D_P_PAck_End_backup_si:			;AN000; (tm08)
   379 00000116 2EF606[0E00]41      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_SW+D_P_equ ;AN000;AC034;  (tm08)
   380 0000011C 741E                <2> 	je	D_P_Pack_End		;AN000; (tm08)
   381                              <2> 
   382 0000011E 4E                  <2> 	dec	si			;AN000; (tm08)
   383 0000011F EB1B                <2> 	jmp	short D_P_Pack_End	;AN025; (tm08)
   384                              <2> 
   385                              <2> D_P_PL01:				;AN000;
   386 00000121 2E8807              <2> 	mov	[psdata_seg:bx],al	;AN000; move byte to STRING_BUF
   387 00000124 3C3D                <2> 	cmp	al,D_P_Keyword		;AN000; if it is equal character,
   388 00000126 7506                <2> 	jne	D_P_PL00 		;AN000; then
   389                              <2> 
   390 00000128 2E800E[0E00]01      <2> 	or	byte [psdata_seg:D_P_Flags2],D_P_equ ;AC034; remember it in flag
   391                              <2> D_P_PL00:				;AN000;
   392 0000012E 43                  <2> 	inc	bx			;AN000; ready to see next byte
   393 0000012F E8D907              <2> 	call	D_P_Chk_DBCS		;AN000; was it 1st byte of DBCS ?
   394 00000132 73C5                <2> 	jnc	D_P_Pack_Loop		;AN000; if no, process to next byte
   395                              <2> 
   396 00000134 AC                  <2> 	lodsb				;AN000; if yes, store
   397 00000135 2E8807              <2> 	mov	[psdata_seg:bx],al	;AN000;    2nd byte of DBCS
   398 00000138 43                  <2> 	inc	bx			;AN000; update pointer
   399 00000139 EBBE                <2> 	jmp	short D_P_Pack_Loop	;AN000; process to next byte
   400                              <2> 
   401                              <2> D_P_Pack_End_BY_EOL:			;AN000;
   402 0000013B 4E                  <2> 	dec	si			;AN000; backup si pointer
   403                              <2> D_P_Pack_End:				;AN000;
   404 0000013C 2E8936[0400]        <2> 	mov	[psdata_seg:D_P_SI_Save],si     ;AC034; save next pointer, SI
   405 00000141 2EC60700            <2> 	mov	byte ptr [psdata_seg:bx],D_P_NULL ;AN000; put NULL at the end
   406 00000145 2E891E[1300]        <2> 	mov	[psdata_seg:D_P_Save_EOB],bx    ;AC034; 3/17/87 keep the address for later use of complex
   407 0000014A 268B1D              <2> 	mov	bx,[es:di + D_P_PARMSX_Address] ;AN000; get PARMSX address
   408 0000014D 8D36[1700]          <2> 	lea	si,[D_P_STRING_BUF]  ;AC034;
   409 00000151 2E803C2F            <2> 	cmp	byte ptr [psdata_seg:si],D_P_Switch ;AN000; the operand begins w/ switch char ?
   410 00000155 7430                <2> 	je	D_P_SW_Manager		     ;AN000; if yes, process as switch
   411                              <2> 
   412 00000157 2EF606[0E00]01      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_equ   ;AC034; the operand includes equal char ?
   413                              <2> D_P_Key_manager equ D_P_Key_Manager	; NASM port label
   414 0000015D 7554                <2> 	jne	D_P_Key_manager		     ;AN000; if yes, process as keyword
   415                              <2> 
   416                              <2> D_P_Positional_Manager:			;AN000; else process as positional
   417                              <2> D_P_MaxP equ D_P_Maxp	; NASM port equate
   418 0000015F 268A4701            <2> 	mov	al,[es:bx + D_P_MaxP]	;AN000; get maxp
   419 00000163 30E4                <2> 	xor	ah,ah			;AN000; ax = maxp
   420 00000165 2E3906[0000]        <2> 	cmp	[psdata_seg:D_P_ORDINAL],ax ;AC034; too many positional ?
   421 0000016A 7312                <2> 	jae	D_P_Too_Many_Error	;AN000; if yes, set exit code to too many
   422                              <2> 
   423 0000016C 2EA1[0000]          <2> 	mov	ax,[psdata_seg:D_P_ORDINAL] ;AC034; see what the current ordinal
   424 00000170 D1E0                <2> 	shl	ax,1			;AN000; ax = ax*2
   425 00000172 43                  <2> 	inc	bx			;AC035; add '2' to
   426 00000173 43                  <2> 	inc	bx			;AC035;  BX reg
   427                              <2> 					;AN000; now bx points to 1st CONTROL
   428                              <2> ;(changed ;AC035;) add	   bx,2 	;AN000; now bx points to 1st CONTROL
   429 00000174 01C3                <2> 	add	bx,ax			;AN000; now bx points to specified CONTROL address
   430 00000176 268B1F              <2> 	mov	bx,[es:bx]		;AN000; now bx points to specified CONTROL itself
   431 00000179 E88800              <2> 	call	D_P_Chk_Pos_Control	;AN000; Do process for positional
   432 0000017C EB69                <2> 	jmp	short D_P_Return_to_Caller ;AN000; and return to the caller
   433                              <2> 
   434                              <2> D_P_Too_Many_Error:			;AN000;
   435 0000017E 2EC706[0200]0100    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Too_Many ;AC034; set exit code
   436 00000185 EB60                <2> 	jmp	short D_P_Return_to_Caller ;AN000; and return to the caller
   437                              <2> ;
   438                              <2> D_P_SW_Manager:				;AN000;
   439 00000187 268A4701            <2> 	mov	al,[es:bx + D_P_MaxP]	;AN000; get maxp
   440 0000018B 30E4                <2> 	xor	ah,ah			;AN000; ax = maxp
   441 0000018D 40                  <2> 	inc	ax			;AN000;
   442 0000018E D1E0                <2> 	shl	ax,1			;AN000; ax = (ax+1)*2
   443 00000190 01C3                <2> 	add	bx,ax			;AN000; now bx points to maxs
   444 00000192 268A0F              <2> 	mov	cl,[es:bx]		;AN000;
   445 00000195 30ED                <2> 	xor	ch,ch			;AN000; cx = maxs
   446 00000197 09C9                <2> 	or	cx,cx			;AN000; at least one switch ?
   447 00000199 740F                <2> 	je	D_P_SW_Not_Found 	;AN000;
   448                              <2> 
   449 0000019B 43                  <2> 	inc	bx			;AN000; now bx points to 1st CONTROL address
   450                              <2> 
   451                              <2> D_P_SW_Mgr_Loop: 			;AN000;
   452 0000019C 53                  <2> 	push	bx			;AN000;
   453 0000019D 268B1F              <2> 	mov	bx,[es:bx]		;AN000; bx points to Switch CONTROL itself
   454 000001A0 E8C600              <2> 	call	D_P_Chk_SW_Control	;AN000; do process for switch
   455 000001A3 5B                  <2> 	pop	bx			;AN000;
   456 000001A4 7341                <2> 	jnc	D_P_Return_to_Caller	;AN000; if the CONTROL is for the switch, exit
   457                              <2> 
   458 000001A6 43                  <2> 	inc	bx			;AC035; add '2' to
   459 000001A7 43                  <2> 	inc	bx			;AC035;  BX reg
   460                              <2> 					;AN000; else bx points to the next CONTROL
   461                              <2> ;(changed ;AC035;)  add     bx,2	;AN000; else bx points to the next CONTROL
   462 000001A8 E2F2                <2> 	loop	D_P_SW_Mgr_Loop		;AN000; and loop
   463                              <2> 
   464                              <2> D_P_SW_Not_Found:			;AN000;
   465 000001AA 2EC706[0200]0300    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Not_In_SW ;AC034; here no CONTROL for the switch has
   466 000001B1 EB34                <2> 	jmp	short D_P_Return_to_Caller0    ;AN000; not been found, means error.
   467                              <2> ;
   468                              <2> D_P_Key_Manager: 			;AN000;
   469 000001B3 268A4701            <2> 	mov	al,[es:bx + D_P_MaxP]	;AN000; get maxp
   470 000001B7 30E4                <2> 	xor	ah,ah			;AN000; ax = maxp
   471 000001B9 40                  <2> 	inc	ax			;AN000;
   472 000001BA D1E0                <2> 	shl	ax,1			;AN000; ax = (ax+1)*2
   473 000001BC 01C3                <2> 	add	bx,ax			;AN000; now bx points to maxs
   474 000001BE 268A07              <2> 	mov	al,[es:bx]		;AN000;
   475 000001C1 30E4                <2> 	xor	ah,ah			;AN000; ax = maxs
   476 000001C3 D1E0                <2> 	shl	ax,1			;AN000;
   477 000001C5 40                  <2> 	inc	ax			;AN000; ax = ax*2+1
   478 000001C6 01C3                <2> 	add	bx,ax			;AN000; now bx points to maxk
   479 000001C8 268A0F              <2> 	mov	cl,[es:bx]		;AN000;
   480 000001CB 30ED                <2> 	xor	ch,ch			;AN000; cx = maxk
   481 000001CD 09C9                <2> 	or	cx,cx			;AN000; at least one keyword ?
   482 000001CF 740F                <2> 	je	D_P_Key_Not_Found	;AN000;
   483                              <2> 
   484 000001D1 43                  <2> 	inc	bx			;AN000; now bx points to 1st CONTROL
   485                              <2> 
   486                              <2> D_P_Key_Mgr_Loop:			;AN000;
   487 000001D2 53                  <2> 	push	bx			;AN000;
   488 000001D3 268B1F              <2> 	mov	bx,[es:bx]		;AN000; bx points to keyword CONTROL itself
   489 000001D6 E85D00              <2> 	call	D_P_Chk_Key_Control	;AN000; do process for keyword
   490 000001D9 5B                  <2> 	pop	bx			;AN000;
   491 000001DA 730B                <2> 	jnc	D_P_Return_to_Caller	;AN000; if the CONTROL is for the keyword, exit
   492                              <2> 
   493 000001DC 43                  <2> 	inc	bx			;AC035; add '2' to
   494 000001DD 43                  <2> 	inc	bx			;AC035;  BX reg
   495                              <2> 					;AN000; else bx points to the next CONTROL
   496                              <2> ;(changed ;AC035;)  add     bx,2	;AN000; else bx points to the next CONTROL
   497 000001DE E2F2                <2> 	loop	D_P_Key_Mgr_Loop 	;AN000; and loop
   498                              <2> 
   499                              <2> D_P_Key_Not_Found:			;AN000;
   500 000001E0 2EC706[0200]0400    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Not_In_Key ;AC034; here no CONTROL for the keyword has
   501                              <2> D_P_Return_to_Caller0:			;AN000; not been found, means error.
   502                              <2> 
   503                              <2> ;(deleted ;AN024;)	 mov	 bx,[es:bx-2]		 ;AN000; (tm13) backup bx
   504                              <2> 
   505                              <2> ;(deleted ;AN024;)	 mov	 al,D_P_String		 ;AN000; Set
   506                              <2> ;(deleted ;AN024;)	 mov	 ah,D_P_No_Tag		 ;AN000;     result
   507                              <2> ;(deleted ;AN024;)	 call	 D_P_Fill_Result 	 ;AN000;	    buffer
   508                              <2> 
   509                              <2> D_P_Return_to_Caller:			;AN000;
   510 000001E7 5D                  <2> 	pop	bp			;AN000;
   511 000001E8 5F                  <2> 	pop	di			;AN000;
   512 000001E9 5B                  <2> 	pop	bx			;AN000;
   513                              <2> D_P_Ordinal equ D_P_ORDINAL	; NASM port label
   514 000001EA 2E8B0E[0000]        <2> 	mov	cx,[psdata_seg:D_P_Ordinal]    ;AC034; return next ordinal
   515 000001EF 2EA1[0200]          <2> 	mov	ax,[psdata_seg:D_P_RC]	    ;AC034; return exit code
   516 000001F3 2E8B36[0400]        <2> 	mov	si,[psdata_seg:D_P_SI_Save]    ;AC034; return next operand pointer
   517 000001F8 2E8B16[0600]        <2> 	mov	dx,[psdata_seg:D_P_DX]	    ;AC034; return result buffer address
   518 000001FD 2E8A1E[0800]        <2> 	mov	bl,[psdata_seg:D_P_Terminator] ;AC034; return delimiter code found
   519                              <2> D_P_Single_Exit: 			;AN000;
   520 00000202 F8                  <2> 	clc				;AN000;
   521 00000203 C3                  <2> 	ret				;AN000;
   522                              <2> SysParse endp				;AN000;
   523                              <2> ;PAGE					;AN000;
   524                              <2> ;***********************************************************************
   525                              <2> ; D_P_Chk_Pos_Control
   526                              <2> ;
   527                              <2> ; Function: Parse CONTROL block for a positional
   528                              <2> ;
   529                              <2> ; Input:     ES:BX -> CONTROL block
   530                              <2> ;	     psdata_seg:SI -> D_P_STRING_BUF
   531                              <2> ;
   532                              <2> ; Output:    None
   533                              <2> ;
   534                              <2> ; Use:	 D_P_Fill_Result, D_P_Check_Match_Flags
   535                              <2> ;
   536                              <2> ; Vars: D_P_Ordinal(W), D_P_RC(W)
   537                              <2> ;***********************************************************************
   538                              <2> D_P_Chk_Pos_Control proc 		;AN000;
   539 00000204 50                  <2> 	push	ax			;AN000;
   540 00000205 268B07              <2> 	mov	ax,[es:bx + D_P_Match_Flag] ;AN000;
   541 00000208 A90200              <2> 	test	ax,D_P_Repeat		;AN000; repeat allowed ?
   542 0000020B 7505                <2> 	jne	D_P_CPC00		;AN000; then do not increment ORDINAL
   543                              <2> 
   544 0000020D 2EFF06[0000]        <2> 	inc	word [psdata_seg:D_P_ORDINAL]	;AC034; update the ordinal
   545                              <2> D_P_CPC00:				;AN000;
   546 00000212 2E803C00            <2> 	cmp	byte ptr [psdata_seg:si],D_P_NULL ;AN000; no data ?
   547 00000216 7519                <2> 	jne	D_P_CPC01		;AN000;
   548                              <2> 
   549 00000218 A90100              <2> 	test	ax,D_P_Optional		;AN000; yes, then is it optional ?
   550 0000021B 7509                <2> 	jne	D_P_CPC02		;AN000;
   551                              <2> 
   552 0000021D 2EC706[0200]0200    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Op_Missing ;AC034; no, then error	     3/17/87
   553 00000224 EB0E                <2> 	jmp	short D_P_CPC_Exit	;AN000;
   554                              <2> 
   555                              <2> D_P_CPC02:				;AN000;
   556 00000226 50                  <2> 	push	ax			;AN000;
   557 00000227 B003                <2> 	mov	al,D_P_String		;AN000; if it is optional return NULL
   558 00000229 B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; no item tag indication
   559 0000022B E89E00              <2> 	call	D_P_Fill_Result		;AN000;
   560 0000022E 58                  <2> 	pop	ax			;AN000;
   561 0000022F EB03                <2> 	jmp	short D_P_CPC_Exit	;AN000;
   562                              <2> 
   563                              <2> D_P_CPC01:				;AN000;
   564 00000231 E81D01              <2> 	call	D_P_Check_Match_Flags	;AN000;
   565                              <2> D_P_CPC_Exit:				;AN000;
   566 00000234 58                  <2> 	pop	ax			;AN000;
   567 00000235 C3                  <2> 	ret				;AN000;
   568                              <2> D_P_Chk_Pos_Control endp 		;AN000;
   569                              <2> ;PAGE					;AN000;
   570                              <2> ;***********************************************************************
   571                              <2> ; D_P_Chk_Key_Control
   572                              <2> ;
   573                              <2> ; Function: Parse CONTROL block for a keyword
   574                              <2> ;
   575                              <2> ; Input:     ES:BX -> CONTROL block
   576                              <2> ;	     psdata_seg:SI -> D_P_STRING_BUF
   577                              <2> ;
   578                              <2> ; Output:    CY = 1 : not match
   579                              <2> ;
   580                              <2> ; Use:	 D_P_Fill_Result, D_P_Search_KEYorSW, D_P_Check_Match_Flags
   581                              <2> ;
   582                              <2> ; Vars: D_P_RC(W), D_P_SaveSI_Cmpx(W), D_P_KEYorSW_Ptr(R), D_P_Flags(W)
   583                              <2> ;***********************************************************************
   584                              <2> D_P_Chk_Key_Control proc 		;AN000;
   585                              <2> %IF	KeySW				;AN000;(Check if keyword is supported)
   586                              <2> 	or	byte [psdata_seg:D_P_Flags2],D_P_Key_Cmp ;AC034; Indicate keyword for later string comparison
   587                              <2> 	call	D_P_Search_KEYorSW	;AN000; Search the keyword in the CONTROL block
   588                              <2> 	jc	D_P_Chk_Key_Err0 	;AN000; not found, then try next CONTROL
   589                              <2> 
   590                              <2> 	and	byte [psdata_seg:D_P_Flags2],0ffh-D_P_Key_Cmp ;AC034; reset the indicator previously set
   591                              <2> ;
   592                              <2> 	push	ax			     ;AN000;	      keyword=
   593                              <2> 	mov	ax,[psdata_seg:D_P_KEYorSW_Ptr] ;AC034;	      ^       ^
   594                              <2> 	sub	ax,si			;AN000;  SI	KEYorSW
   595                              <2> 	add	[psdata_seg:D_P_SaveSI_Cmpx],ax ;AC034; update for complex, quoted or file spec.
   596                              <2> 	pop	ax			;AN000;
   597                              <2> ;
   598                              <2> 	mov	si,[psdata_seg:D_P_KEYorSW_Ptr] ;AC034; set si just after equal char
   599                              <2> 	cmp	byte ptr [psdata_seg:si],D_P_NULL ;AN000; any data after equal ?
   600                              <2> 	je	D_P_Chk_Key_Err1 	;AN000; if no, syntax error
   601                              <2> 
   602                              <2> 	call	D_P_Check_Match_Flags	;AN000; else, process match flags
   603                              <2> 	clc				;AN000;
   604                              <2> 	jmp	short D_P_Chk_Key_Exit	;AN000;
   605                              <2> 
   606                              <2> D_P_Chk_Key_Err0:			;AN000;
   607                              <2> 	stc				;AN000; not found in keyword synonym list
   608                              <2> 	jmp	short D_P_Chk_Key_Exit	;AN000;
   609                              <2> 
   610                              <2> D_P_Chk_Key_Err1:			;AN000;
   611                              <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; no parameter is not specified after "="
   612                              <2> D_P_Chk_Key_ErrExit:			;AN000;
   613                              <2> 	push	ax			;AN000;
   614                              <2> 	mov	al,D_P_String		;AN000; set
   615                              <2> 	mov	ah,D_P_No_Tag		;AN000;    result
   616                              <2> 	call	D_P_Fill_Result		;AN000; 	 buffer
   617                              <2> 	pop	ax			;AN000;
   618                              <2> 	clc				;AN000;
   619                              <2> D_P_Chk_Key_Exit:			;AN000;
   620                              <2> 	ret				;AN000;
   621                              <2> %ELSE					;AN000;(of IF KeySW)
   622 00000236 F9                  <2> 	stc				;AN000;this logic works when the KeySW
   623 00000237 C3                  <2> 	ret				;AN000;is reset.
   624                              <2> %ENDIF					;AN000;(of KeySW)
   625                              <2> D_P_Chk_Key_Control endp 		;AN000;
   626                              <2> ;PAGE					;AN000;
   627                              <2> ;***********************************************************************
   628                              <2> %IF	KeySW+SwSW			;AN000;(Check if keyword or switch is supported)
   629                              <2> ; D_P_Search_KEYorSW:
   630                              <2> ;
   631                              <2> ; Function: Seach specified keyword or switch from CONTROL
   632                              <2> ;
   633                              <2> ; Input:     ES:BX -> CONTROL block
   634                              <2> ;	     psdata_seg:SI -> D_P_STRING_BUF
   635                              <2> ;
   636                              <2> ; Output:    CY = 1 : not match
   637                              <2> ;
   638                              <2> ; Use:	 D_P_String_Comp, D_P_MoveBP_NUL, D_P_Found_SYNONYM
   639                              <2> ;***********************************************************************
   640                              <2> D_P_Search_KEYorSW proc			;AN000;
   641 00000238 55                  <2> 	push	bp			;AN000;
   642 00000239 51                  <2> 	push	cx			;AN000;
   643 0000023A 268A4F08            <2> 	mov	cl,[es:bx + D_P_nid]	;AN000; Get synonym count
   644 0000023E 30ED                <2> 	xor	ch,ch			;AN000; and set it to cx
   645 00000240 09C9                <2> 	or	cx,cx			;AN000; No synonyms specified ?
   646 00000242 740D                <2> 	je	D_P_KEYorSW_Not_Found	;AN000; then indicate not found by CY
   647                              <2> 
   648                              <2> D_P_KEYorSW equ D_P_KeyorSW	; NASM port equate
   649 00000244 8D6F09              <2> 	lea	bp,[bx + D_P_KEYorSW]	;AN000; BP points to the 1st synonym
   650                              <2> D_P_KEYorSW_Loop:			;AN000;
   651 00000247 E80204              <2> 	call	D_P_String_Comp		;AN000; compare string in buffer w/ the synonym
   652 0000024A 7308                <2> 	jnc	D_P_KEYorSW_Found	;AN000; If match, set it to synonym pointer
   653                              <2> 
   654 0000024C E80E00              <2> 	call	D_P_MoveBP_NUL		;AN000; else, bp points to the next string
   655 0000024F E2F6                <2> 	loop	D_P_KEYorSW_Loop 	;AN000; loop nid times
   656                              <2> D_P_KEYorSW_Not_Found:			;AN000;
   657 00000251 F9                  <2> 	stc				;AN000; indicate not found in synonym list
   658 00000252 EB06                <2> 	jmp	short D_P_KEYorSW_Exit	;AN000; and exit
   659                              <2> 
   660                              <2> D_P_KEYorSW_Found:			;AN000;
   661 00000254 2E892E[1500]        <2> 	mov	[psdata_seg:D_P_Found_SYNONYM],bp ;AC034; set synonym pointer
   662 00000259 F8                  <2> 	clc				;AN000; indicate found
   663                              <2> D_P_KEYorSW_Exit:			;AN000;
   664 0000025A 59                  <2> 	pop	cx			;AN000;
   665 0000025B 5D                  <2> 	pop	bp			;AN000;
   666 0000025C C3                  <2> 	ret				;AN000;
   667                              <2> D_P_Search_KEYorSW endp			;AN000;
   668                              <2> ;***********************************************************************
   669                              <2> ; D_P_MoveBP_NUL
   670                              <2> ;***********************************************************************
   671                              <2> D_P_MoveBP_NUL proc			;AN000;
   672                              <2> D_P_MBP_Loop:				;AN000;
   673 0000025D 26807E0000          <2> 	cmp	byte ptr [es:bp],D_P_NULL ;AN000; Increment BP that points
   674 00000262 7403                <2> 	je	D_P_MBP_Exit		;AN000; to the synomym list
   675                              <2> 
   676 00000264 45                  <2> 	inc	bp			;AN000; until
   677 00000265 EBF6                <2> 	jmp	short D_P_MBP_Loop	;AN000; NULL encountered.
   678                              <2> 
   679                              <2> D_P_MBP_Exit:				;AN000;
   680 00000267 45                  <2> 	inc	bp			;AN000; bp points to next to NULL
   681 00000268 C3                  <2> 	ret				;AN000;
   682                              <2> D_P_MoveBP_NUL endp			;AN000;
   683                              <2> %ENDIF					;AN000;(of KeySW+SwSW)
   684                              <2> ;PAGE					;AN000;
   685                              <2> ;***********************************************************************
   686                              <2> ; D_P_Chk_SW_Control
   687                              <2> ;
   688                              <2> ; Function: Parse CONTROL block for a switch
   689                              <2> ;
   690                              <2> ; Input:     ES:BX -> CONTROL block
   691                              <2> ;	     psdata_seg:SI -> D_P_STRING_BUF
   692                              <2> ;
   693                              <2> ; Output:    CY = 1 : not match
   694                              <2> ;
   695                              <2> ; Use:	 D_P_Fill_Result, D_P_Search_KEYorSW, D_P_Check_Match_Flags
   696                              <2> ;
   697                              <2> ; Vars:  D_P_SaveSI_Cmpx(W), D_P_KEYorSW_Ptr(R), D_P_Flags(W)
   698                              <2> ;***********************************************************************
   699                              <2> D_P_Chk_SW_Control proc			;AN000;
   700                              <2> 
   701                              <2> 
   702                              <2> %IF	SwSW				;AN000;(Check if switch is supported)
   703                              <2> D_P_Sw_Cmp equ D_P_SW_Cmp	; NASM port equate
   704 00000269 2E800E[0E00]10      <2> 	or	byte [psdata_seg:D_P_Flags2],D_P_Sw_Cmp ;AC034; Indicate switch for later string comparison
   705 0000026F E8C6FF              <2> 	call	D_P_Search_KEYorSW	;AN000; Search the switch in the CONTROL block
   706 00000272 724A                <2> 	jc	D_P_Chk_SW_Err0		;AN000; not found, then try next CONTROL
   707                              <2> 
   708 00000274 2E8026[0E00]EF      <2> 	and	byte [psdata_seg:D_P_Flags2],0ffh-D_P_Sw_Cmp ;AC034; reset the indicator previously set
   709                              <2> ;
   710 0000027A 50                  <2> 	push	ax			;AN000; 	      /switch:
   711 0000027B 2EA1[1100]          <2> 	mov	ax,[psdata_seg:D_P_KEYorSW_Ptr] ;AC034;	      ^       ^
   712 0000027F 29F0                <2> 	sub	ax,si			;AN000;  SI	KEYorSW
   713 00000281 2E0106[0F00]        <2> 	add	[psdata_seg:D_P_SaveSI_Cmpx],ax ;AC034; update for complex list
   714 00000286 58                  <2> 	pop	ax			;AN000;
   715                              <2> ;
   716 00000287 2E8B36[1100]        <2> 	mov	si,[psdata_seg:D_P_KEYorSW_Ptr] ;AC034; set si at the end or colon
   717 0000028C 2E803C00            <2> 	cmp	byte ptr [psdata_seg:si],D_P_NULL ;AN000; any data after colon
   718 00000290 7526                <2> 	jne	D_P_CSW00		;AN000; if yes, process match flags
   719                              <2> 
   720 00000292 2E807CFF3A          <2> 	cmp	byte ptr [psdata_seg:si-1],D_P_Colon ;AN000; if no, the switch terminated by colon ?
   721 00000297 7509                <2> 	jne	D_P_Chk_if_data_required ;AN000; if yes,
   722                              <2> 
   723 00000299 2EC706[0200]0900    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; return syntax error
   724 000002A0 EB1F                <2> 	jmp	short D_P_Chk_SW_Exit	;AN000;
   725                              <2> 
   726                              <2> D_P_Chk_if_data_required:		;AN018; no data, no colon
   727 000002A2 26833F00            <2> 	cmp	word [es:bx + D_P_Match_Flag],0 ;AN018; should have data? zero match flag means switch followed by nothing is OK
   728 000002A6 7419                <2> 	je	D_P_Chk_SW_Exit		;AN018; match flags not zero so should have something if optional bit is not on
   729                              <2> 
   730 000002A8 26F7070100          <2> 	test	word [es:bx + D_P_Match_Flag],D_P_Optional ;AN019; see if no value is valid
   731 000002AD 7512                <2> 	jnz	D_P_Chk_SW_Exit		;AN019; if so, then leave, else yell
   732                              <2> 
   733 000002AF 2EC706[0200]0200    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Op_Missing ;AC034; return required operand missing
   734 000002B6 EB09                <2> 	jmp	short D_P_Chk_SW_Exit	;AN018;
   735                              <2> 
   736                              <2> D_P_CSW00:				;AN000;
   737 000002B8 E89600              <2> 	call	D_P_Check_Match_Flags	;AN000; process match flag
   738 000002BB F8                  <2> 	clc				;AN000; indicate match
   739 000002BC EB0D                <2> 	jmp	short D_P_Chk_SW_Single_Exit ;AN000;
   740                              <2> 
   741                              <2> D_P_Chk_SW_Err0: 			;AN000;
   742 000002BE F9                  <2> 	stc				;AN000; not found in switch synonym list
   743 000002BF EB0A                <2> 	jmp	short D_P_Chk_SW_Single_Exit ;AN000;
   744                              <2> 
   745                              <2> D_P_Chk_SW_Exit: 			;AN000;
   746 000002C1 50                  <2> 	push	ax			;AN000;
   747 000002C2 B003                <2> 	mov	al,D_P_String		;AN000; set
   748 000002C4 B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000;    result
   749 000002C6 E80300              <2> 	call	D_P_Fill_Result		;AN000; 	 buffer
   750 000002C9 58                  <2> 	pop	ax			;AN000;
   751 000002CA F8                  <2> 	clc				;AN000;
   752                              <2> D_P_Chk_SW_Single_Exit:			;AN000;
   753 000002CB C3                  <2> 	ret				;AN000;
   754                              <2> %ELSE					;AN000;(of IF SwSW)
   755                              <2> 	stc				;AN000; this logic works when the SwSW
   756                              <2> 	ret				;AN000; is reset.
   757                              <2> %ENDIF					;AN000;(of SwSW)
   758                              <2> D_P_Chk_SW_Control endp			;AN000;
   759                              <2> ;PAGE					;AN000;
   760                              <2> ;***********************************************************************
   761                              <2> ; D_P_Fill_Result
   762                              <2> ;
   763                              <2> ; Function: Fill the result buffer
   764                              <2> ;
   765                              <2> ; Input:    AH = Item tag
   766                              <2> ;	    AL = type
   767                              <2> ;		  AL = 1: CX,DX has 32bit number (CX = high)
   768                              <2> ;		  AL = 2: DX has index(offset) into value list
   769                              <2> ;		  AL = 6: DL has driver # (1-A, 2-B, ... , 26 - Z)
   770                              <2> ;		  AL = 7: DX has year, CL has month and CH has date
   771                              <2> ;		  AL = 8: DL has hours, DH has minutes, CL has secondsn,
   772                              <2> ;			  amd CH has hundredths
   773                              <2> ;		  AL = else: psdata_seg:SI points to returned string buffer
   774                              <2> ;	    ES:BX -> CONTROL block
   775                              <2> ;
   776                              <2> ; Output:   None
   777                              <2> ;
   778                              <2> ; Use:	D_P_Do_CAPS_String, D_P_Remove_Colon, D_P_Found_SYNONYM
   779                              <2> ;
   780                              <2> ; Vars: D_P_DX(W)
   781                              <2> ;***********************************************************************
   782                              <2> D_P_Fill_Result proc			;AN000;
   783 000002CC 57                  <2> 	push	di			;AN000;
   784 000002CD 268B7F04            <2> 	mov	di,[es:bx + D_P_Result_Buf] ;AN000; di points to result buffer
   785 000002D1 2E893E[0600]        <2> 	mov	[psdata_seg:D_P_DX],di	;AC034; set returned result address
   786 000002D6 268805              <2> 	mov	[es:di + D_P_Type],al	;AN000; store type
   787 000002D9 26886501            <2> 	mov	[es:di + D_P_Item_Tag],ah	;AN000; store item tag
   788 000002DD 50                  <2> 	push	ax			;AN000;
   789 000002DE 2EA1[1500]          <2> 	mov	ax,[psdata_seg:D_P_Found_SYNONYM] ;AC034; if yes,
   790 000002E2 26894502            <2> 	mov	[es:di + D_P_SYNONYM_Ptr],ax ;AN000;   then set it to the result
   791 000002E6 58                  <2> 	pop	ax			;AN000;
   792                              <2> D_P_RLT04:				;AN000;
   793 000002E7 3C01                <2> 	cmp	al,D_P_Number		;AN000; if number
   794 000002E9 750A                <2> 	jne	D_P_RLT00		;AN000;
   795                              <2> 
   796                              <2> D_P_RLT02:				;AN000;
   797 000002EB 26895504            <2> 	mov	word ptr [es:di + D_P_Picked_Val],dx ;AN000; then store 32bit
   798 000002EF 26894D06            <2> 	mov	word ptr [es:di+2 + D_P_Picked_Val],cx ;AN000;	number
   799 000002F3 EB5A                <2> 	jmp	short D_P_RLT_Exit	;AN000;
   800                              <2> 
   801                              <2> D_P_RLT00:				;AN000;
   802 000002F5 3C02                <2> 	cmp	al,D_P_List_Idx		;AN000; if list index
   803 000002F7 7506                <2> 	jne	D_P_RLT01		;AN000;
   804                              <2> 
   805 000002F9 26895504            <2> 	mov	word ptr [es:di + D_P_Picked_Val],dx ;AN000; then store list index
   806 000002FD EB50                <2> 	jmp	short D_P_RLT_Exit	;AN000;
   807                              <2> 
   808                              <2> D_P_RLT01:				;AN000;
   809 000002FF 3C07                <2> 	cmp	al,D_P_Date_F		;AN000; Date format ?
   810 00000301 74E8                <2> 	je	D_P_RLT02		;AN000;
   811                              <2> 
   812 00000303 3C08                <2> 	cmp	al,D_P_Time_F		;AN000; Time format ?
   813 00000305 74E4                <2> 	je	D_P_RLT02		;AN000;
   814                              <2> ;
   815 00000307 3C06                <2> 	cmp	al,D_P_Drive		;AN000; drive format ?
   816 00000309 7506                <2> 	jne	D_P_RLT03		;AN000;
   817                              <2> 
   818 0000030B 26885504            <2> 	mov	byte ptr [es:di + D_P_Picked_Val],dl ;AN000; store drive number
   819 0000030F EB3E                <2> 	jmp	short D_P_RLT_Exit	;AN000;
   820                              <2> 
   821                              <2> D_P_RLT03:				;AN000;
   822 00000311 3C04                <2> 	cmp	al,D_P_Complex		;AN000; complex format ?
   823 00000313 750F                <2> 	jne	D_P_RLT05		;AN000;
   824                              <2> 
   825 00000315 2EA1[0F00]          <2> 	mov	ax,[psdata_seg:D_P_SaveSI_Cmpx] ;AC034; then get pointer in command buffer
   826 00000319 40                  <2> 	inc	ax			;AN000; skip left Parentheses
   827 0000031A 26894504            <2> 	mov	word ptr [es:di + D_P_Picked_Val],ax ;AN000; store offset
   828 0000031E 268C5D06            <2> 	mov	word ptr [es:di+2 + D_P_Picked_Val],ds ;AN000; store segment
   829 00000322 EB2B                <2> 	jmp	short D_P_RLT_Exit	;AN000;
   830                              <2> 
   831                              <2> D_P_RLT05:				;AN000;
   832                              <2> ;------------------------  AL = 3, 5, or 9
   833 00000324 26897504            <2> 	mov	word ptr [es:di + D_P_Picked_Val],si ;AN000; store offset of STRING_BUF
   834                              <2> ;(replaced ;AN031;)  mov word ptr [es:di+word].D_P_Picked_Val,cs ;AN000; store segment of STRING_BUF
   835 00000328 268C4D06            <2> 	mov	word ptr [es:di+2 + D_P_Picked_Val],Psdata_Seg ;AN031; store segment of STRING_BUF
   836                              <2> ;
   837 0000032C 50                  <2> 	push	ax			;AN000;
   838 0000032D 26F6470201          <2> 	test	byte ptr [es:bx + D_P_Function_Flag],D_P_CAP_File ;AN000; need CAPS by file table?
   839 00000332 7404                <2> 	je	D_P_RLT_CAP00		;AN000;
   840                              <2> 
   841 00000334 B004                <2> 	mov	al,D_P_DOSTBL_File	;AN000; use file upper case table
   842 00000336 EB09                <2> 	jmp	short D_P_RLT_CAP02	;AN000;
   843                              <2> 
   844                              <2> D_P_RLT_CAP00:				;AN000;
   845 00000338 26F6470202          <2> 	test	byte ptr [es:bx + D_P_Function_Flag],D_P_CAP_Char ;AN000; need CAPS by char table ?
   846 0000033D 7405                <2> 	je	D_P_RLT_CAP01		;AN000;
   847                              <2> 
   848 0000033F B002                <2> 	mov	al,D_P_DOSTBL_Char	;AN000; use character upper case table
   849                              <2> D_P_RLT_CAP02:				;AN000;
   850 00000341 E8FC00              <2> 	call	D_P_Do_CAPS_String	;AN000;  process CAPS along the table
   851                              <2> D_P_RLT_CAP01:				;AN000;
   852 00000344 58                  <2> 	pop	ax			;AN000;
   853 00000345 26F6470210          <2> 	test	byte ptr [es:bx + D_P_Function_Flag],D_P_Rm_Colon ;AN000; removing colon at end ?
   854 0000034A 7403                <2> 	je	D_P_RLT_Exit		;AN000;
   855                              <2> 
   856 0000034C E8CB00              <2> 	call	D_P_Remove_Colon 	;AN000; then process it.
   857                              <2> D_P_RLT_Exit:				;AN000;
   858 0000034F 5F                  <2> 	pop	di			;AN000;
   859 00000350 C3                  <2> 	ret				;AN000;
   860                              <2> D_P_Fill_Result endp			;AN000;
   861                              <2> ;PAGE					;AN000;
   862                              <2> ;***********************************************************************
   863                              <2> ; D_P_Check_Match_Flags
   864                              <2> ;
   865                              <2> ; Function:  Check the mutch_flags and make the exit code and set the
   866                              <2> ;	     result buffer
   867                              <2> ;
   868                              <2> ;	    Check for types in this order:
   869                              <2> ;		Complex
   870                              <2> ;		Date
   871                              <2> ;		Time
   872                              <2> ;		Drive
   873                              <2> ;		Filespec
   874                              <2> ;		Quoted String
   875                              <2> ;		Simple String
   876                              <2> ;
   877                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
   878                              <2> ;	     ES:BX -> CONTROL block
   879                              <2> ;
   880                              <2> ; Output:    None
   881                              <2> ;
   882                              <2> ; Use:	     D_P_Value, P$_SValue, D_P_Simple_String, D_P_Date_Format
   883                              <2> ;	     D_P_Time_Format, D_P_Complex_Format, D_P_File_Foemat
   884                              <2> ;	     D_P_Drive_Format
   885                              <2> ;***********************************************************************
   886                              <2> D_P_Check_Match_Flags proc		;AN000;
   887 00000351 2EC606[AA00]00      <2> 	mov	byte [psdata_seg:D_P_err_flag],D_P_NULL ;AN033;AC034;; clear filespec error flag.
   888 00000357 50                  <2> 	push	ax			;AN000;
   889 00000358 268B07              <2> 	mov	ax,[es:bx + D_P_Match_Flag] ;AN000; load match flag(16bit) to ax
   890                              <2> 
   891 0000035B 09C0                <2> 	or	ax,ax			;AC035; test ax for zero
   892                              <2> ;(changed ;AC035;)  cmp     ax,0	;AN000; (tm12)
   893 0000035D 7518                <2> 	jne	D_P_Mat			;AN000; (tm12)
   894                              <2> 
   895 0000035F 50                  <2> 	push	ax			;AN000; (tm12)
   896 00000360 53                  <2> 	push	bx			;AN000; (tm12)
   897 00000361 52                  <2> 	push	dx			;AN000; (tm12)
   898 00000362 57                  <2> 	push	di			;AN000; (tm12)
   899 00000363 2EC706[0200]0900    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; (tm12)
   900 0000036A B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; (tm12)
   901 0000036C B003                <2> 	mov	al,D_P_String		;AN000; (tm12)
   902 0000036E E85BFF              <2> 	call	D_P_Fill_Result		;AN000; (tm12)
   903 00000371 5F                  <2> 	pop	di			;AN000; (tm12)
   904 00000372 5A                  <2> 	pop	dx			;AN000; (tm12)
   905 00000373 5B                  <2> 	pop	bx			;AN000; (tm12)
   906 00000374 58                  <2> 	pop	ax			;AN000; (tm12)
   907 00000375 EB02                <2> 	jmp	short D_P_Bridge 	;AC035; (tm12)
   908                              <2> 
   909                              <2> D_P_Mat: 				;AN000; (tm12)
   910                              <2> 
   911                              <2> %IF	CmpxSW				;AN000;(Check if complex item is supported)
   912                              <2> 	test	ax,D_P_Cmpx_S		;AN000; Complex string
   913                              <2> 	je	D_P_Match01		;AN000;
   914                              <2> 
   915                              <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
   916                              <2> 	call	D_P_Complex_Format	;AN000; do process
   917                              <2> 	cmp	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type
   918                              <2> 	jne	D_P_Bridge		;AN000;
   919                              <2> 
   920                              <2> D_P_Match01:				;AN000;
   921                              <2> %ENDIF					;AN000;(of CmpxSW)
   922                              <2> %IF	DateSW				;AN000;(Check if date format is supported)
   923                              <2> 	test	ax,D_P_Date_S		;AN000; Date string
   924                              <2> 	je	D_P_Match02		;AN000;
   925                              <2> 
   926                              <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
   927                              <2> 	call	D_P_Date_Format		;AN000; do process
   928                              <2> 	cmp	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type
   929                              <2> 	jne	D_P_Bridge		;AN000;
   930                              <2> 
   931                              <2> D_P_Match02:				;AN000;
   932                              <2> %ENDIF					;AN000;(of DateSW)
   933                              <2> %IF	TimeSW				;AN000;(Check if time format is supported)
   934                              <2> 	test	ax,D_P_Time_S		;AN000; Time string
   935                              <2> 	je	D_P_Match03		;AN000;
   936                              <2> 
   937                              <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
   938                              <2> 	call	D_P_Time_Format		;AN000; do process
   939                              <2> 	cmp	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type
   940                              <2> ;	je	D_P_Match03		;AN000:
   941                              <2> 
   942                              <2> 	jne	D_P_Bridge		;AN000; (tm09)
   943                              <2> 
   944                              <2> %ENDIF					;AN000;(of TimeSW)  (tm04)
   945 00000377 EB03                <2> 	jmp	short D_P_Match03	;AN025; (tm09)
   946                              <2> 
   947                              <2> D_P_Bridge:				;AN000;
   948                              <2> ;	jmp	short D_P_Match_Exit (tm02)
   949                              <2> 
   950 00000379 E98500              <2> 	jmp	D_P_Match_Exit		;AN000; (tm02)
   951                              <2> 
   952                              <2> D_P_Match03:				;AN000;
   953                              <2> ; ENDIF ;AN000;(of TimeSW) (tm04)
   954                              <2> %IF	NumSW				;AN000;(Check if numeric value is supported)
   955 0000037C A90080              <2> 	test	ax,D_P_Num_Val		;AN000; Numeric value
   956 0000037F 7412                <2> 	je	D_P_Match04		;AN000;
   957                              <2> 
   958 00000381 2EC706[0200]0000    <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
   959 00000388 E84601              <2> 	call	D_P_Value		;AN000; do process
   960 0000038B 2E833E[0200]09      <2> 	cmp	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type
   961 00000391 756E                <2> 	jne	D_P_Match_Exit		;AN000;
   962                              <2> 
   963                              <2> D_P_Match04:				;AN000;
   964                              <2> D_P_SNUM_Val equ D_P_SNum_Val	; NASM port equate
   965 00000393 A90040              <2> 	test	ax,D_P_SNUM_Val		;AN000; Signed numeric value
   966 00000396 7412                <2> 	je	D_P_Match05		;AN000;
   967                              <2> 
   968 00000398 2EC706[0200]0000    <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
   969 0000039F E80B01              <2> 	call	D_P_SValue		;AN000; do process
   970 000003A2 2E833E[0200]09      <2> 	cmp	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type
   971 000003A8 7557                <2> 	jne	D_P_Match_Exit		;AN000;
   972                              <2> 
   973                              <2> D_P_Match05:				;AN000;
   974                              <2> %ENDIF					;AN000;(of NumSW)
   975                              <2> %IF	DrvSW				;AN000;(Check if drive only is supported)
   976 000003AA A90001              <2> 	test	ax,D_P_Drv_Only		;AN000; Drive only
   977 000003AD 7415                <2> 	je	D_P_Match06		;AN000;
   978                              <2> 
   979 000003AF 2EC706[0200]0000    <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
   980 000003B6 E8AD03              <2> 	call	D_P_File_Format		;AN000; 1st, call file format
   981 000003B9 E83004              <2> 	call	D_P_Drive_Format 	;AN000; check drive format, next
   982 000003BC 2E833E[0200]09      <2> 	cmp	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examinee the next type
   983 000003C2 753D                <2> 	jne	D_P_Match_Exit		;AN000;
   984                              <2> 
   985                              <2> D_P_Match06:				;AN000;
   986                              <2> %ENDIF					;AN000;(of DrvSW)
   987                              <2> %IF	FileSW				;AN000;(Check if file spec is supported)
   988 000003C4 A90002              <2> 	test	ax,D_P_File_Spc		;AN000; File spec
   989 000003C7 7412                <2> 	je	D_P_Match07		;AN000;
   990                              <2> 
   991 000003C9 2EC706[0200]0000    <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
   992 000003D0 E89303              <2> 	call	D_P_File_Format		;AN000; do process
   993 000003D3 2E833E[0200]09      <2> 	cmp	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type
   994 000003D9 7526                <2> 	jne	D_P_Match_Exit		;AN000;
   995                              <2> 
   996                              <2> D_P_Match07:				;AN000;
   997                              <2> %ENDIF					;AN000;(of FileSW)
   998                              <2> %IF	QusSW				;AN000;(Check if quoted string is supported)
   999 000003DB A98000              <2> 	test	ax,D_P_Qu_String 	;AN000; Quoted string
  1000 000003DE 7412                <2> 	je	D_P_Match08		;AN000;
  1001                              <2> 
  1002 000003E0 2EC706[0200]0000    <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
  1003 000003E7 E80503              <2> 	call	D_P_Quoted_Format	;AN000; do process
  1004 000003EA 2E833E[0200]09      <2> 	cmp	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; if error, examine the next type
  1005 000003F0 750F                <2> 	jne	D_P_Match_Exit		;AN000;
  1006                              <2> 
  1007                              <2> D_P_Match08:				;AN000;
  1008                              <2> %ENDIF					;AN000;(of QusSW)
  1009 000003F2 A90020              <2> 	test	ax,D_P_Simple_S		;AN000; Simple string
  1010 000003F5 740A                <2> 	je	D_P_Match09		;AN000;
  1011                              <2> 
  1012 000003F7 2EC706[0200]0000    <2> 	mov	word [psdata_seg:D_P_RC],D_P_No_Error ;AC034; assume no error
  1013 000003FE E8E201              <2> 	call	D_P_Simple_String	;AN000; do process
  1014                              <2> ;;;;	cmp	psdata_seg:D_P_RC,D_P_Syntax ;AC034; These two lines will be alive
  1015                              <2> ;;;;	jne	D_P_Match_Exit			   ;when extending the match_flags.
  1016                              <2> D_P_Match09:				;AN000;
  1017                              <2> D_P_Match_Exit:				;AN000;
  1018 00000401 2E803E[AA00]01      <2> 	cmp	byte [psdata_seg:D_P_err_flag],D_P_error_filespec ;AC034; bad filespec ?
  1019 00000407 750F                <2> 	jne	D_P_Match2_Exit		;AN033; no, continue
  1020 00000409 2E833E[0200]00      <2> 	cmp	word [psdata_seg:D_P_RC],D_P_No_Error ;AN033;AC034;; check for other errors ?
  1021 0000040F 7507                <2> 	jne	D_P_Match2_Exit		;AN033; no, continue
  1022 00000411 2EC706[0200]0900    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AN033;AC034;; set error flag
  1023                              <2> D_P_Match2_Exit: 			;AN033;
  1024 00000418 58                  <2> 	pop	ax			;AN000;
  1025 00000419 C3                  <2> 	ret				;AN000;
  1026                              <2> D_P_Check_Match_Flags endp		;AN000;
  1027                              <2> ;PAGE					;AN000;
  1028                              <2> ;***********************************************************************
  1029                              <2> ; D_P_Remove_Colon;
  1030                              <2> ;
  1031                              <2> ; Function: Remove colon at end
  1032                              <2> ;
  1033                              <2> ; Input:    psdata_seg:SI points to string buffer to be examineed
  1034                              <2> ;
  1035                              <2> ; Output:   None
  1036                              <2> ;
  1037                              <2> ; Use:	D_P_Chk_DBCS
  1038                              <2> ;***********************************************************************
  1039                              <2> D_P_Remove_Colon proc			;AN000;
  1040 0000041A 50                  <2> 	push	ax			;AN000;
  1041 0000041B 56                  <2> 	push	si			;AN000;
  1042                              <2> D_P_RCOL_Loop:				;AN000;
  1043 0000041C 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000; get character
  1044 0000041F 08C0                <2> 	or	al,al			;AN000; end of string ?
  1045 00000421 741A                <2> 	je	D_P_RCOL_Exit		;AN000; if yes, just exit
  1046                              <2> 
  1047 00000423 3C3A                <2> 	cmp	al,D_P_Colon		;AN000; is it colon ?
  1048 00000425 750D                <2> 	jne	D_P_RCOL00		;AN000;
  1049                              <2> 
  1050 00000427 2E807C0100          <2> 	cmp	byte ptr [psdata_seg:si+1],D_P_NULL ;AN000; if so, next is NULL ?
  1051 0000042C 7506                <2> 	jne	D_P_RCOL00		;AN000; no, then next char
  1052                              <2> 
  1053 0000042E 2EC60400            <2> 	mov	byte ptr [psdata_seg:si],D_P_NULL ;AN000; yes, remove colon
  1054 00000432 EB09                <2> 	jmp	short D_P_RCOL_Exit	;AN000; and exit.
  1055                              <2> 
  1056                              <2> D_P_RCOL00:				;AN000;
  1057 00000434 E8D404              <2> 	call	D_P_Chk_DBCS		;AN000; if not colon, then check if
  1058 00000437 7301                <2> 	jnc	D_P_RCOL01		;AN000; DBCS leading byte.
  1059                              <2> 
  1060 00000439 46                  <2> 	inc	si			;AN000; if yes, skip trailing byte
  1061                              <2> D_P_RCOL01:				;AN000;
  1062 0000043A 46                  <2> 	inc	si			;AN000; si points to next byte
  1063 0000043B EBDF                <2> 	jmp	short D_P_RCOL_Loop	;AN000; loop until NULL encountered
  1064                              <2> 
  1065                              <2> D_P_RCOL_Exit:				;AN000;
  1066 0000043D 5E                  <2> 	pop	si			;AN000;
  1067 0000043E 58                  <2> 	pop	ax			;AN000;
  1068 0000043F C3                  <2> 	ret				;AN000;
  1069                              <2> D_P_Remove_Colon endp			;AN000;
  1070                              <2> ;PAGE					;AN000;
  1071                              <2> ;***********************************************************************
  1072                              <2> ; D_P_Do_CAPS_String;
  1073                              <2> ;
  1074                              <2> ; Function: Perform capitalization along with the file case map table
  1075                              <2> ;	    or character case map table.
  1076                              <2> ;
  1077                              <2> ; Input:    AL = 2 : Use character table
  1078                              <2> ;	    AL = 4 : Use file table
  1079                              <2> ;	    psdata_seg:SI points to string buffer to be capitalized
  1080                              <2> ;
  1081                              <2> ; Output:   None
  1082                              <2> ;
  1083                              <2> ; Use:	D_P_Do_CAPS_Char, D_P_Chk_DBCS
  1084                              <2> ;***********************************************************************
  1085                              <2> D_P_Do_CAPS_String proc			;AN000;
  1086 00000440 56                  <2> 	push	si			;AN000;
  1087 00000441 52                  <2> 	push	dx			;AN000;
  1088 00000442 88C2                <2> 	mov	dl,al			;AN000; save info id
  1089                              <2> 
  1090                              <2> D_P_DCS_Loop:				;AN000;
  1091 00000444 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000; load charater and
  1092 00000447 E8C104              <2> 	call	D_P_Chk_DBCS		;AN000; check if DBCS leading byte
  1093 0000044A 720C                <2> 	jc	D_P_DCS00		;AN000; if yes, do not need CAPS
  1094                              <2> 
  1095 0000044C 08C0                <2> 	or	al,al			;AN000; end of string ?
  1096 0000044E 740C                <2> 	je	D_P_DCS_Exit		;AN000; then exit.
  1097                              <2> 
  1098 00000450 E80C00              <2> 	call	D_P_Do_CAPS_Char 	;AN000; Here a SBCS char need to be CAPS
  1099 00000453 2E8804              <2> 	mov	[psdata_seg:si],al	;AN000; stored upper case char to buffer
  1100 00000456 EB01                <2> 	jmp	short D_P_DCS01		;AN000; process nexit
  1101                              <2> D_P_DCS00:				;AN000;
  1102 00000458 46                  <2> 	inc	si			;AN000; skip DBCS leading and trailing byte
  1103                              <2> D_P_DCS01:				;AN000;
  1104 00000459 46                  <2> 	inc	si			;AN000; si point to next byte
  1105 0000045A EBE8                <2> 	jmp	short D_P_DCS_Loop	;AN000; loop until NULL encountered
  1106                              <2> D_P_DCS_Exit:				;AN000;
  1107 0000045C 5A                  <2> 	pop	dx			;AN000;
  1108 0000045D 5E                  <2> 	pop	si			;AN000;
  1109 0000045E C3                  <2> 	ret				;AN000;
  1110                              <2> D_P_Do_CAPS_String endp			;AN000;
  1111                              <2> ;PAGE					;AN000;
  1112                              <2> ;***********************************************************************
  1113                              <2> ; D_P_Do_CAPS_Char;
  1114                              <2> ;
  1115                              <2> ; Function: Perform capitalization along with the file case map table
  1116                              <2> ;	    or character case map table.
  1117                              <2> ;
  1118                              <2> ; Input:    DL = 2 : Use character table
  1119                              <2> ;	    DL = 4 : Use file table
  1120                              <2> ;	    AL = character to be capitalized
  1121                              <2> ;
  1122                              <2> ; Output:   None
  1123                              <2> ;
  1124                              <2> ; Use:	INT 21h /w AH=65h
  1125                              <2> ;***********************************************************************
  1126                              <2> D_P_Do_CAPS_Char proc			;AN000;
  1127 0000045F 3C80                <2> 	cmp	al,D_P_ASCII80		;AN000; need upper case table ?
  1128 00000461 730C                <2> 	jae	D_P_DCC_Go		;AN000;
  1129                              <2> 
  1130 00000463 3C61                <2> 	cmp	al,"a"                  ;AN000; if no,
  1131 00000465 7245                <2> 	jb	D_P_CAPS_Ret		;AN000;   check if  "a" <= AL <= "z"
  1132                              <2> 
  1133 00000467 3C7A                <2> 	cmp	al,"z"                  ;AN000;
  1134 00000469 7741                <2> 	ja	D_P_CAPS_Ret		;AN000;   if yes, make CAPS
  1135                              <2> 
  1136 0000046B 24DF                <2> 	and	al,D_P_Make_Upper	;AN000;   else do nothing.
  1137 0000046D EB3D                <2> 	jmp	short D_P_CAPS_Ret	;AN000;
  1138                              <2> 
  1139                              <2> D_P_DCC_Go:				;AN000;
  1140 0000046F 53                  <2> 	push	bx			;AN000;
  1141 00000470 06                  <2> 	push	es			;AN000;
  1142 00000471 57                  <2> 	push	di			;AN000;
  1143                              <2> %IF	CAPSW				;AN000;(Check if uppercase conversion is supported)
  1144 00000472 8D3E[9C00]          <2> 	lea	di,[D_P_File_CAP_Ptr] ;AC034;
  1145 00000476 80FA04              <2> 	cmp	dl,D_P_DOSTBL_File	;AN000; Use file CAPS table ?
  1146 00000479 7404                <2> 	je	D_P_DCC00		;AN000;
  1147                              <2> 
  1148                              <2> %ENDIF					;AN000;(of CAPSW)
  1149 0000047B 8D3E[9700]          <2> 	lea	di,[D_P_Char_CAP_Ptr] ;AC034; or use char CAPS table ?
  1150                              <2> D_P_DCC00:				;AN000;
  1151 0000047F 2E3815              <2> 	cmp	[psdata_seg:di],dl	;AN000; already got table address ?
  1152 00000482 7417                <2> 	je	D_P_DCC01		;AN000; if no,
  1153                              <2> 
  1154                              <2> ;In this next section, ES will be used to pass a 5 byte workarea to INT 21h,
  1155                              <2> ; the GET COUNTYRY INFO call.  This usage of ES is required by the function
  1156                              <2> ; call, regardless of what base register is currently be defined as PSDATA_SEG.
  1157                              <2> ;BASESW EQU 0 means that ES is the psdata_seg reg.
  1158                              <2> 
  1159                              <2> %IFDEF BASESW				;AN037; If BASESW has been defined, and
  1160                              <2>   %IFN BASESW				;AN037; If ES is psdata base
  1161                              <2> 	push	PSDATA_SEG		;AN037; save current base reg
  1162                              <2>   %ENDIF 				;AN037;
  1163                              <2> %ENDIF					;AN037;
  1164                              <2> 
  1165 00000484 50                  <2> 	push	ax			;AN000; get CAPS table thru DOS call
  1166 00000485 51                  <2> 	push	cx			;AN000;
  1167 00000486 52                  <2> 	push	dx			;AN000;
  1168                              <2> 
  1169                              <2> 
  1170 00000487 0E                  <2> 	push	PSDATA_SEG		;AC036; pass current base seg into
  1171                              <2> 					;(Note: this used to push CS.  BUG...
  1172 00000488 07                  <2> 	pop	es			;AN000;   ES reg, required for
  1173                              <2> 					;get extended country information
  1174 00000489 B465                <2> 	mov	ah,D_P_DOS_Get_TBL	;AN000; get extended CDI
  1175 0000048B 88D0                <2> 	mov	al,dl			;AN000; upper case table
  1176 0000048D BBFFFF              <2> 	mov	bx,D_P_DOSTBL_Def	;AN000; get active CON
  1177 00000490 B90500              <2> 	mov	cx,D_P_DOSTBL_BL 	;AN000; buffer length
  1178 00000493 BAFFFF              <2> 	mov	dx,D_P_DOSTBL_Def	;AN000; get for default code page
  1179                              <2> 					;DI already set to point to buffer
  1180 00000496 CD21                <2> 	int	21h			;AN000; es:di point to buffer that
  1181                              <2> 					;now has been filled in with info
  1182 00000498 5A                  <2> 	pop	dx			;AN000;
  1183 00000499 59                  <2> 	pop	cx			;AN000;
  1184 0000049A 58                  <2> 	pop	ax			;AN000;
  1185                              <2> %IFDEF BASESW				;AN037; If BASESW has been defined, and
  1186                              <2>   %IFN BASESW				;AN037; If ES is psdata base
  1187                              <2> 	pop	PSDATA_SEG		;AN037; restore current base reg
  1188                              <2>   %ENDIF 				;AN037;
  1189                              <2> %ENDIF					;AN037;
  1190                              <2> D_P_DCC01:				;AN000;
  1191                              <2> 
  1192                              <2> ;In this next section, ES will be used as the base of the XLAT table, provided
  1193                              <2> ; by the previous GET COUNTRY INFO DOS call.  This usage of ES is made
  1194                              <2> ; regardless of which base reg is currently the PSDATA_SEG reg.
  1195                              <2> 
  1196                              <2> %IFDEF BASESW				;AN037; If BASESW has been defined, and
  1197                              <2>   %IFN BASESW				;AN037; If ES is psdata base
  1198                              <2> 	push	PSDATA_SEG		;AN037; save current base reg
  1199                              <2>   %ENDIF 				;AN037;
  1200                              <2> %ENDIF					;AN037;
  1201 0000049B 2E8B5D01            <2> 	mov	bx,[psdata_seg:di+D_P_DOS_TBL_Off] ;AN000; get offset of table
  1202 0000049F 2E8E4503            <2> 	mov	es,[psdata_seg:di+D_P_DOS_TBL_Seg] ;AN000; get segment of table
  1203 000004A3 43                  <2> 	inc	bx			;AC035; add '2' to
  1204 000004A4 43                  <2> 	inc	bx			;AC035;  BX reg
  1205                              <2> 					;AN000; skip length field
  1206                              <2> ;(changed ;AN035;) add	   bx,word	;AN000; skip length field
  1207 000004A5 2C80                <2> 	sub	al,D_P_ASCII80		;AN000; make char to index
  1208 000004A7 26D7                <2> 	es xlatb 		;AN000; perform case map
  1209                              <2> 
  1210                              <2> %IFDEF BASESW				;AN037; If BASESW has been defined, and
  1211                              <2>   %IFN BASESW				;AN037; If ES is psdata base
  1212                              <2> 	pop	PSDATA_SEG		;AN037; restore current base reg
  1213                              <2>   %ENDIF 				;AN037;
  1214                              <2> %ENDIF					;AN037;
  1215 000004A9 5F                  <2> 	pop	di			;AN000;
  1216 000004AA 07                  <2> 	pop	es			;AN000;
  1217 000004AB 5B                  <2> 	pop	bx			;AN000;
  1218                              <2> D_P_CAPS_Ret:				;AN000;
  1219 000004AC C3                  <2> 	ret				;AN000;
  1220                              <2> D_P_Do_CAPS_Char endp			;AN000;
  1221                              <2> ;PAGE					;AN000;
  1222                              <2> ;***********************************************************************
  1223                              <2> %IF	NumSW				;AN000;(Check if numeric value is supported)
  1224                              <2> ; D_P_Value / D_P_SValue
  1225                              <2> ;
  1226                              <2> ; Function:  Make 32bit value from psdata_seg:SI and see value list
  1227                              <2> ;	     and make result buffer.
  1228                              <2> ;	     D_P_SValue is an entry point for the signed value
  1229                              <2> ;	     and this will simply call D_P_Value after the handling
  1230                              <2> ;	     of the sign character, "+" or "-"
  1231                              <2> ;
  1232                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  1233                              <2> ;	     ES:BX -> CONTROL block
  1234                              <2> ;
  1235                              <2> ; Output:    None
  1236                              <2> ;
  1237                              <2> ; Use:	D_P_Fill_Result, D_P_Check_OVF
  1238                              <2> ;
  1239                              <2> ; Vars: D_P_RC(W), D_P_Flags(RW)
  1240                              <2> ;***********************************************************************
  1241                              <2> D_P_SValue proc				;AN000; when signed value here
  1242 000004AD 50                  <2> 	push	ax			;AN000;
  1243 000004AE 2E800E[0E00]80      <2> 	or	byte [psdata_seg:D_P_Flags2],D_P_Signed	    ;AC034; indicate a signed numeric
  1244 000004B4 2E8026[0E00]FD      <2> 	and	byte [psdata_seg:D_P_Flags2],0ffh-D_P_Neg  ;AC034; assume positive value
  1245 000004BA 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000; get sign
  1246 000004BD 3C2B                <2> 	cmp	al,D_P_Plus		;AN000; "+" ?
  1247 000004BF 740A                <2> 	je	D_P_SVal00		;AN000;
  1248                              <2> 
  1249 000004C1 3C2D                <2> 	cmp	al,D_P_Minus		;AN000; "-" ?
  1250 000004C3 7507                <2> 	jne	D_P_Sval01		;AN000; else
  1251                              <2> 
  1252 000004C5 2E800E[0E00]02      <2> 	or	byte [psdata_seg:D_P_Flags2],D_P_Neg ;AC034; set this is negative value
  1253                              <2> D_P_SVal00:				;AN000;
  1254 000004CB 46                  <2> 	inc	si			;AN000; skip sign char
  1255                              <2> D_P_Sval01:				;AN000;
  1256 000004CC E80200              <2> 	call	D_P_Value		;AN000; and process value
  1257 000004CF 58                  <2> 	pop	ax			;AN000;
  1258 000004D0 C3                  <2> 	ret				;AN000;
  1259                              <2> D_P_SValue endp				;AN000;
  1260                              <2> ;***********************************************************************
  1261                              <2> D_P_Value proc				;AN000;
  1262 000004D1 50                  <2> 	push	ax			;AN000;
  1263 000004D2 51                  <2> 	push	cx			;AN000;
  1264 000004D3 52                  <2> 	push	dx			;AN000;
  1265 000004D4 56                  <2> 	push	si			;AN000;
  1266 000004D5 31C9                <2> 	xor	cx,cx			;AN000; cx = higher 16 bits
  1267 000004D7 31D2                <2> 	xor	dx,dx			;AN000; dx = lower 16 bits
  1268 000004D9 53                  <2> 	push	bx			;AN000; save control pointer
  1269                              <2> D_P_Value_Loop:				;AN000;
  1270 000004DA 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000; get character
  1271 000004DD 08C0                <2> 	or	al,al			;AN000; end of line ?
  1272 000004DF 7442                <2> 	je	D_P_Value00		;AN000;
  1273                              <2> 
  1274 000004E1 E8F100              <2> 	call	D_P_0099 		;AN000; make asc(0..9) to bin(0..9)
  1275 000004E4 7239                <2> 	jc	D_P_Value_Err0		;AN000;
  1276                              <2> 
  1277 000004E6 30E4                <2> 	xor	ah,ah			;AN000;
  1278 000004E8 89C5                <2> 	mov	bp,ax			;AN000; save binary number
  1279 000004EA D1E2                <2> 	shl	dx,1			;AN000; to have 2*x
  1280 000004EC D1D1                <2> 	rcl	cx,1			;AN000; shift left w/ carry
  1281 000004EE E8D200              <2> 	call	D_P_Check_OVF		;AN000; Overflow occurred ?
  1282 000004F1 722C                <2> 	jc	D_P_Value_Err0		;AN000; then error, exit
  1283                              <2> 
  1284 000004F3 89D3                <2> 	mov	bx,dx			;AN000; save low(2*x)
  1285 000004F5 89C8                <2> 	mov	ax,cx			;AN000; save high(2*x)
  1286 000004F7 D1E2                <2> 	shl	dx,1			;AN000; to have 4*x
  1287 000004F9 D1D1                <2> 	rcl	cx,1			;AN000; shift left w/ carry
  1288 000004FB E8C500              <2> 	call	D_P_Check_OVF		;AN000; Overflow occurred ?
  1289 000004FE 721F                <2> 	jc	D_P_Value_Err0		;AN000; then error, exit
  1290                              <2> 
  1291 00000500 D1E2                <2> 	shl	dx,1			;AN000; to have 8*x
  1292 00000502 D1D1                <2> 	rcl	cx,1			;AN000; shift left w/ carry
  1293 00000504 E8BC00              <2> 	call	D_P_Check_OVF		;AN000; Overflow occurred ?
  1294 00000507 7216                <2> 	jc	D_P_Value_Err0		;AN000; then error, exit
  1295                              <2> 
  1296 00000509 01DA                <2> 	add	dx,bx			;AN000; now have 10*x
  1297 0000050B 11C1                <2> 	adc	cx,ax			;AN000; 32bit ADD
  1298 0000050D E8B300              <2> 	call	D_P_Check_OVF		;AN000; Overflow occurred ?
  1299 00000510 720D                <2> 	jc	D_P_Value_Err0		;AN000; then error, exit
  1300                              <2> 
  1301 00000512 01EA                <2> 	add	dx,bp			;AN000; Add the current one degree decimal
  1302 00000514 83D100              <2> 	adc	cx,0			;AN000; if carry, add 1 to high 16bit
  1303 00000517 E8A900              <2> 	call	D_P_Check_OVF		;AN000; Overflow occurred ?
  1304 0000051A 7203                <2> 	jc	D_P_Value_Err0		;AN000; then error, exit
  1305                              <2> 
  1306 0000051C 46                  <2> 	inc	si			;AN000; update pointer
  1307 0000051D EBBB                <2> 	jmp	short D_P_Value_Loop	;AN000; loop until NULL encountered
  1308                              <2> ;
  1309                              <2> D_P_Value_Err0:				;AN000;
  1310 0000051F 5B                  <2> 	pop	bx			;AN000;
  1311 00000520 E98D00              <2> 	jmp	D_P_Value_Err		;AN000; Bridge
  1312                              <2> ;
  1313                              <2> D_P_Value00:				;AN000;
  1314 00000523 5B                  <2> 	pop	bx			;AN000; restore control pointer
  1315 00000524 2EF606[0E00]02      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Neg ;AC034; here cx,dx = 32bit value
  1316 0000052A 740A                <2> 	je	D_P_Value01		;AN000; was it negative ?
  1317                              <2> 
  1318 0000052C F7D1                <2> 	not	cx			;AN000; +
  1319 0000052E F7D2                <2> 	not	dx			;AN000; |- Make 2's complement
  1320 00000530 83C201              <2> 	add	dx,1			;AN000; |
  1321 00000533 83D100              <2> 	adc	cx,0			;AN000; +
  1322                              <2> D_P_Value01:				;AN000; / nval =0
  1323 00000536 268B7706            <2> 	mov	si,[es:bx + D_P_Value_List] ;AN000; si points to value list
  1324 0000053A 268A04              <2> 	mov	al,[es:si]		;AN000; get nval
  1325 0000053D 3C00                <2> 	cmp	al,D_P_nval_None 	;AN000; no value list ?
  1326 0000053F 7507                <2> 	jne	D_P_Value02		;AN000;
  1327                              <2> 
  1328 00000541 B001                <2> 	mov	al,D_P_Number		;AN000; Set type
  1329 00000543 B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; No ITEM_TAG set
  1330 00000545 EB74                <2> 	jmp	D_P_Value_Exit		;AN000;
  1331 00000547 90                  <2> 	nop	; identicalise
  1332                              <2> 
  1333                              <2> D_P_Value02:				;AN000; / nval = 1
  1334                              <2> %IF	Val1SW				;AN000;(Check if value list id #1 is supported)
  1335                              <2> ;(tm07) cmp	al,D_P_nval_Range	;AN000; have range list ?
  1336                              <2> ;(tm07) jne	D_P_Value03		;AN000;
  1337                              <2> 
  1338 00000548 46                  <2> 	inc	si			;AN000;
  1339 00000549 268A04              <2> 	mov	al,[es:si]		;AN000; al = number of range
  1340 0000054C 3C00                <2> 	cmp	al,D_P_No_nrng		;AN000; (tm07)
  1341 0000054E 7460                <2> 	je	D_P_Value03		;AN000; (tm07)
  1342                              <2> 
  1343 00000550 46                  <2> 	inc	si			;AN000; si points to 1st item_tag
  1344                              <2> D_P_Val02_Loop:				;AN000;
  1345 00000551 2EF606[0E00]80      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Signed ;AC034;
  1346 00000557 751E                <2> 	jne	D_P_Val02_Sign		;AN000;
  1347                              <2> 
  1348 00000559 263B4C03            <2> 	cmp	cx,[es:si+D_P_Val_XH]	;AN000; comp cx with XH
  1349 0000055D 7236                <2> 	jb	D_P_Val02_Next		;AN000;
  1350                              <2> 
  1351 0000055F 7706                <2> 	ja	D_P_Val_In		;AN000;
  1352                              <2> 
  1353 00000561 263B5401            <2> 	cmp	dx,[es:si+D_P_Val_XL]	;AN000; comp dx with XL
  1354 00000565 722E                <2> 	jb	D_P_Val02_Next		;AN000;
  1355                              <2> 
  1356                              <2> D_P_Val_In:				;AN000;
  1357                              <2> ;;;;;;	cmp	cx,es:D_P_Val_YH]	; comp cx with YH (tm01)
  1358 00000567 263B4C07            <2> 	cmp	cx,[es:si+D_P_Val_YH]	;AN000; comp cx with YH (tm01)
  1359 0000056B 7728                <2> 	ja	D_P_Val02_Next		;AN000;
  1360                              <2> 
  1361 0000056D 723A                <2> 	jb	D_P_Val_Found		;AN000;
  1362                              <2> 
  1363 0000056F 263B5405            <2> 	cmp	dx,[es:si+D_P_Val_YL]	;AN000; comp dx with YL
  1364 00000573 7720                <2> 	ja	D_P_Val02_Next		;AN000;
  1365                              <2> 
  1366 00000575 EB32                <2> 	jmp	short D_P_Val_Found	;AN000;
  1367                              <2> 
  1368                              <2> D_P_Val02_Sign:				;AN000;
  1369 00000577 263B4C03            <2> 	cmp	cx,[es:si+D_P_Val_XH]	;AN000; comp cx with XH
  1370 0000057B 7C18                <2> 	jl	D_P_Val02_Next		;AN000;
  1371                              <2> 
  1372 0000057D 7F06                <2> 	jg	D_P_SVal_In		;AN000;
  1373                              <2> 
  1374 0000057F 263B5401            <2> 	cmp	dx,[es:si+D_P_Val_XL]	;AN000; comp dx with XL
  1375 00000583 7C10                <2> 	jl	D_P_Val02_Next		;AN000;
  1376                              <2> 
  1377                              <2> D_P_SVal_In:				;AN000;
  1378 00000585 263B4C07            <2> 	cmp	cx,[es:si+D_P_Val_YH]	;AN000; comp cx with YH
  1379 00000589 7F0A                <2> 	jg	D_P_Val02_Next		;AN000;
  1380                              <2> 
  1381 0000058B 7C1C                <2> 	jl	D_P_Val_Found		;AN000;
  1382                              <2> 
  1383 0000058D 263B5405            <2> 	cmp	dx,[es:si+D_P_Val_YL]	;AN000; comp dx with YL
  1384 00000591 7F02                <2> 	jg	D_P_Val02_Next		;AN000;
  1385                              <2> 
  1386 00000593 EB14                <2> 	jmp	short D_P_Val_Found	;AN000;
  1387                              <2> 
  1388                              <2> D_P_Val02_Next:				;AN000;
  1389 00000595 83C609              <2> 	add	si,D_P_Len_Range 	;AN000;
  1390 00000598 FEC8                <2> 	dec	al			;AN000; loop nrng times in AL
  1391 0000059A 75B5                <2> 	jne	D_P_Val02_Loop		;AN000;
  1392                              <2> 					; / Not found
  1393                              <2> D_P_Out_of_Range equ D_P_Out_Of_Range	; NASM port equate
  1394 0000059C 2EC706[0200]0600    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Out_of_Range ;AC034;
  1395 000005A3 B001                <2> 	mov	al,D_P_Number		;AN000;
  1396 000005A5 B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; No ITEM_TAG set
  1397 000005A7 EB12                <2> 	jmp	short D_P_Value_Exit	;AN000;
  1398                              <2> 
  1399                              <2> %ENDIF					;AN000;(of Val1SW)
  1400                              <2> %IF	Val1SW+Val2SW			;AN000;(Check if value list id #1 or #2 is supported)
  1401                              <2> D_P_Val_Found:				;AN000;
  1402 000005A9 B001                <2> 	mov	al,D_P_Number		;AN000;
  1403 000005AB 268A24              <2> 	mov	ah,[es:si]		;AN000; found ITEM_TAG set
  1404 000005AE EB0B                <2> 	jmp	short D_P_Value_Exit	;AN000;
  1405                              <2> 
  1406                              <2> %ENDIF					;AN000;(of Val1SW+Val2SW)
  1407                              <2> D_P_Value03:				;AN000; / nval = 2
  1408                              <2> %IF	Val2SW				;AN000;(Check if value list id #2 is supported)
  1409                              <2> ;;;;	cmp	al,D_P_nval_Value	; have match list ? ASSUME nval=2,
  1410                              <2> ;;;;	jne	D_P_Value04		; even if it is 3 or more.
  1411                              <2> ;(tm07) inc	si			;AN000;
  1412                              <2> ;(tm07) mov	al,[es:si]		;AN000; al = nrng
  1413                              <2> 	mov	ah,D_P_Len_Range 	;AN000;
  1414                              <2> 	mul	ah			;AN000;  Skip nrng field
  1415                              <2> 	inc	ax			;AN000;
  1416                              <2> 	add	si,ax			;AN000; si points to nnval
  1417                              <2> 	mov	al,[es:si]		;AN000; get nnval
  1418                              <2> 	inc	si			;AN000; si points to 1st item_tag
  1419                              <2> D_P_Val03_Loop:				;AN000;
  1420                              <2> 	cmp	cx,[es:si+D_P_Val_XH]	;AN000; comp cx with XH
  1421                              <2> 	jne	D_P_Val03_Next		;AN000;
  1422                              <2> 
  1423                              <2> 	cmp	dx,[es:si+D_P_Val_XL]	;AN000; comp dx with XL
  1424                              <2> 	je	D_P_Val_Found		;AN000;
  1425                              <2> 
  1426                              <2> D_P_Val03_Next:				;AN000;
  1427                              <2> 	add	si,D_P_Len_Value 	;AN000; points to next value choice
  1428                              <2> 	dec	al			;AN000; loop nval times in AL
  1429                              <2> 	jne	D_P_Val03_Loop		;AN000;
  1430                              <2> 					;AN000; / Not found
  1431                              <2> D_P_Not_in_Val equ D_P_Not_In_Val	; NASM port equate
  1432                              <2> 	mov	word [psdata_seg:D_P_RC],D_P_Not_in_Val ;AC034;
  1433                              <2> 	mov	al,D_P_Number		;AN000;
  1434                              <2> 	mov	ah,D_P_No_Tag		;AN000; No ITEM_TAG set
  1435                              <2> 	jmp	short D_P_Value_Exit	;AN000;
  1436                              <2> 
  1437                              <2> %ENDIF					;AN000;(of Val2SW)
  1438                              <2> D_P_Value04:				;AN000; / nval = 3 or else
  1439                              <2> D_P_Value_Err:				;AN000;
  1440 000005B0 2EC706[0200]0900    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034;
  1441 000005B7 B003                <2> 	mov	al,D_P_String		;AN000; Set type
  1442 000005B9 B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; No ITEM_TAG set
  1443                              <2> D_P_Value_Exit:				;AN000;
  1444 000005BB E80EFD              <2> 	call	D_P_Fill_Result		;AN000;
  1445 000005BE 5E                  <2> 	pop	si			;AN000;
  1446 000005BF 5A                  <2> 	pop	dx			;AN000;
  1447 000005C0 59                  <2> 	pop	cx			;AN000;
  1448 000005C1 58                  <2> 	pop	ax			;AN000;
  1449 000005C2 C3                  <2> 	ret				;AN000;
  1450                              <2> D_P_Value endp				;AN000;
  1451                              <2> ;PAGE					;AN000;
  1452                              <2> ;***********************************************************************
  1453                              <2> ; D_P_Check_OVF
  1454                              <2> ;
  1455                              <2> ; Function:  Check if overflow is occurred with consideration of
  1456                              <2> ;	     signed or un-signed numeric value
  1457                              <2> ;
  1458                              <2> ; Input:     Flag register
  1459                              <2> ;
  1460                              <2> ; Output:    CY = 1  :	Overflow
  1461                              <2> ;
  1462                              <2> ; Vars:     D_P_Flags(R)
  1463                              <2> ;***********************************************************************
  1464                              <2> D_P_Check_OVF proc			;AN000;
  1465 000005C3 9C                  <2> 	pushf				;AN000;
  1466 000005C4 2EF606[0E00]02      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Neg ;AC034; is it negative value ?
  1467 000005CA 7502                <2> 	jne	D_P_COVF 		;AN000; if no, check overflow
  1468                              <2> 
  1469 000005CC 9D                  <2> 	popf				;AN000; by the CY bit
  1470 000005CD C3                  <2> 	ret				;AN000;
  1471                              <2> 
  1472                              <2> D_P_COVF:				;AN000;
  1473 000005CE 9D                  <2> 	popf				;AN000; else,
  1474 000005CF 7002                <2> 	jo	D_P_COVF00		;AN000; check overflow by the OF
  1475                              <2> 
  1476 000005D1 F8                  <2> 	clc				;AN000; indicate it with CY bit
  1477 000005D2 C3                  <2> 	ret				;AN000; CY=0 means no overflow
  1478                              <2> 
  1479                              <2> D_P_COVF00:				;AN000;
  1480 000005D3 F9                  <2> 	stc				;AN000; and CY=1 means overflow
  1481 000005D4 C3                  <2> 	ret				;AN000;
  1482                              <2> D_P_Check_OVF endp			;AN000;
  1483                              <2> %ENDIF					;AN000;(of FarSW)
  1484                              <2> ;***********************************************************************
  1485                              <2> ; D_P_0099;
  1486                              <2> ;
  1487                              <2> ; Function:  Make ASCII 0-9 to Binary 0-9
  1488                              <2> ;
  1489                              <2> ; Input:     AL = character code
  1490                              <2> ;
  1491                              <2> ; Output:    CY = 1 : AL is not number
  1492                              <2> ;	     CY = 0 : AL contains binary value
  1493                              <2> ;***********************************************************************
  1494                              <2> D_P_0099 proc				;AN000;
  1495 000005D5 3C30                <2> 	cmp	al,"0"                  ;AN000;
  1496 000005D7 7208                <2> 	jb	D_P_0099Err		;AN000;  must be 0 =< al =< 9
  1497                              <2> 
  1498 000005D9 3C39                <2> 	cmp	al,"9"                  ;AN000;
  1499 000005DB 7704                <2> 	ja	D_P_0099Err		;AN000;  must be 0 =< al =< 9
  1500                              <2> 
  1501 000005DD 2C30                <2> 	sub	al,"0"                  ;AN000; make char -> bin
  1502 000005DF F8                  <2> 	clc				;AN000; indicate no error
  1503 000005E0 C3                  <2> 	ret				;AN000;
  1504                              <2> 
  1505                              <2> D_P_0099Err:				;AN000;
  1506 000005E1 F9                  <2> 	stc				;AN000; indicate error
  1507 000005E2 C3                  <2> 	ret				;AN000;
  1508                              <2> D_P_0099 endp				;AN000;
  1509                              <2> ;PAGE					;AN000;
  1510                              <2> ;***********************************************************************
  1511                              <2> ; D_P_Simple_String
  1512                              <2> ;
  1513                              <2> ; Function:  See value list for the simple string
  1514                              <2> ;	     and make result buffer.
  1515                              <2> ;
  1516                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  1517                              <2> ;	     ES:BX -> CONTROL block
  1518                              <2> ;
  1519                              <2> ; Output:    None
  1520                              <2> ;
  1521                              <2> ; Use:	D_P_Fill_Result, D_P_String_Comp
  1522                              <2> ;
  1523                              <2> ; Vars: D_P_RC(W)
  1524                              <2> ;***********************************************************************
  1525                              <2> D_P_Simple_String proc			;AN000;
  1526 000005E3 50                  <2> 	push	ax			;AN000;
  1527 000005E4 53                  <2> 	push	bx			;AN000;
  1528 000005E5 52                  <2> 	push	dx			;AN000;
  1529 000005E6 57                  <2> 	push	di			;AN000;
  1530 000005E7 268B7F06            <2> 	mov	di,[es:bx + D_P_Value_List] ;AN000; di points to value list
  1531 000005EB 268A05              <2> 	mov	al,[es:di]		;AN000; get nval
  1532 000005EE 08C0                <2> 	or	al,al			;AN000; no value list ?
  1533 000005F0 7504                <2> 	jne	D_P_Sim00		;AN000; then
  1534                              <2> 
  1535 000005F2 B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; No ITEM_TAG set
  1536 000005F4 EB4C                <2> 	jmp	short D_P_Sim_Exit	;AN000; and set result buffer
  1537                              <2> 
  1538                              <2> D_P_Sim00:				;AN000;
  1539                              <2> %IF	Val3SW+KeySW			;AN000;(Check if keyword or value list id #3 is supported)
  1540 000005F6 3C03                <2> 	cmp	al,D_P_nval_String	;AN000; String choice list provided ?
  1541 000005F8 753F                <2> 	jne	D_P_Sim01		;AN000; if no, syntax error
  1542                              <2> 
  1543 000005FA 47                  <2> 	inc	di			;AN000;
  1544 000005FB 268A05              <2> 	mov	al,[es:di]		;AN000; al = nrng
  1545 000005FE B409                <2> 	mov	ah,D_P_Len_Range 	;AN000;
  1546 00000600 F6E4                <2> 	mul	ah			;AN000;  Skip nrng field
  1547 00000602 40                  <2> 	inc	ax			;AN000; ax = (nrng*9)+1
  1548 00000603 01C7                <2> 	add	di,ax			;AN000; di points to nnval
  1549 00000605 268A05              <2> 	mov	al,[es:di]		;AN000; get nnval
  1550 00000608 B405                <2> 	mov	ah,D_P_Len_Value 	;AN000;
  1551 0000060A F6E4                <2> 	mul	ah			;AN000; Skip nnval field
  1552 0000060C 40                  <2> 	inc	ax			;AN000; ax = (nnval*5)+1
  1553 0000060D 01C7                <2> 	add	di,ax			;AN000; di points to nstrval
  1554 0000060F 268A05              <2> 	mov	al,[es:di]		;AN000; get nstrval
  1555 00000612 47                  <2> 	inc	di			;AC035; add '2' to
  1556 00000613 47                  <2> 	inc	di			;AC035;  DI reg
  1557                              <2> 					;AN000; di points to 1st string in list
  1558                              <2> ;(replaced ;AC035;) add     di,2	;AN000; di points to 1st string in list
  1559                              <2> D_P_Sim_Loop:				;AN000;
  1560 00000614 268B2D              <2> 	mov	bp,[es:di]		;AN000; get string pointer
  1561 00000617 E83200              <2> 	call	D_P_String_Comp		;AN000; compare it with operand
  1562 0000061A 7312                <2> 	jnc	D_P_Sim_Found		;AN000; found on list ?
  1563                              <2> 
  1564 0000061C 83C703              <2> 	add	di,D_P_Len_String	;AN000; if no, point to next choice
  1565 0000061F FEC8                <2> 	dec	al			;AN000; loop nstval times in AL
  1566 00000621 75F1                <2> 	jne	D_P_Sim_Loop		;AN000;
  1567                              <2> 					;AN000; / Not found
  1568 00000623 2EC706[0200]0800    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Not_In_Str ;AC034;
  1569 0000062A B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; No ITEM_TAG set
  1570 0000062C EB14                <2> 	jmp	short D_P_Sim_Exit	;AN000;
  1571                              <2> 
  1572                              <2> D_P_Sim_Found:				;AN000;
  1573 0000062E 268A65FF            <2> 	mov	ah,[es:di-1]		;AN000; set item_tag
  1574 00000632 B002                <2> 	mov	al,D_P_List_Idx		;AN000;
  1575 00000634 268B15              <2> 	mov	dx,[es:di]		;AN000; get address of STRING
  1576 00000637 EB0B                <2> 	jmp	short D_P_Sim_Exit0	;AN000;
  1577                              <2> %ENDIF					;AN000;(of Val3SW+KeySW)
  1578                              <2> D_P_Sim01:				;AN000;
  1579 00000639 2EC706[0200]0900    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034;
  1580 00000640 B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; No ITEM_TAG set
  1581                              <2> D_P_Sim_Exit:				;AN000;
  1582 00000642 B003                <2> 	mov	al,D_P_String		;AN000; Set type
  1583                              <2> D_P_Sim_Exit0:				;AN000;
  1584 00000644 E885FC              <2> 	call	D_P_Fill_Result		;AN000;
  1585 00000647 5F                  <2> 	pop	di			;AN000;
  1586 00000648 5A                  <2> 	pop	dx			;AN000;
  1587 00000649 5B                  <2> 	pop	bx			;AN000;
  1588 0000064A 58                  <2> 	pop	ax			;AN000;
  1589 0000064B C3                  <2> 	ret				;AN000;
  1590                              <2> D_P_Simple_String endp			;AN000;
  1591                              <2> ;PAGE					;AN000;
  1592                              <2> ;***********************************************************************
  1593                              <2> ; D_P_String_Comp:
  1594                              <2> ;
  1595                              <2> ; Function:  Compare two string
  1596                              <2> ;
  1597                              <2> ; Input:     psdata_seg:SI -> 1st string
  1598                              <2> ;	     ES:BP -> 2nd string  (Must be upper case)
  1599                              <2> ;	     ES:BX -> CONTROL block
  1600                              <2> ;
  1601                              <2> ; Output:    CY = 1 if not match
  1602                              <2> ;
  1603                              <2> ; Use:	D_P_Chk_DBCS, D_P_Do_CAPS_Char
  1604                              <2> ;
  1605                              <2> ; Vars: D_P_KEYor_SW_Ptr(W), D_P_Flags(R). D_P_KEYorSW_Ptr
  1606                              <2> ;***********************************************************************
  1607                              <2> D_P_String_Comp proc			;AN000;
  1608 0000064C 50                  <2> 	push	ax			;AN000;
  1609 0000064D 55                  <2> 	push	bp			;AN000;
  1610 0000064E 52                  <2> 	push	dx			;AN000;
  1611 0000064F 56                  <2> 	push	si			;AN000;
  1612 00000650 B202                <2> 	mov	dl,D_P_DOSTBL_Char	;AN000; use character case map table
  1613                              <2> D_P_SCOM_Loop:				;AN000;
  1614 00000652 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000; get command character
  1615 00000655 E8B302              <2> 	call	D_P_Chk_DBCS		;AN000; DBCS ?
  1616 00000658 723C                <2> 	jc	D_P_SCOM00		;AN000; yes,DBCS
  1617                              <2> 
  1618 0000065A E802FE              <2> 	call	D_P_Do_CAPS_Char 	;AN000; else, upper case map before comparison
  1619                              <2> %IF	KeySW+SwSW			;AN000;(Check if keyword or switch is supported)
  1620 0000065D 2EF606[0E00]08      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Key_Cmp ;AC034; keyword search ?
  1621 00000663 740D                <2> 	je	D_P_SCOM04		;AN000;
  1622                              <2> 
  1623 00000665 3C3D                <2> 	cmp	al,D_P_Keyword		;AN000; "=" is delimiter
  1624 00000667 751F                <2> 	jne	D_P_SCOM03		;AN000;IF "=" on command line AND  (bp+1=> char after the "=" in synonym list)
  1625                              <2> 
  1626 00000669 26807E0100          <2> 	cmp	byte ptr [es:bp+1],D_P_NULL ;AN021;   at end of keyword string in the control block THEN
  1627                              <2> D_P_SCOM_DIFFER equ D_P_SCOM_Differ	; NASM port label
  1628 0000066E 7571                <2> 	jne	D_P_SCOM_DIFFER		;AN021;
  1629                              <2> 
  1630 00000670 EB13                <2> 	jmp	short D_P_SCOM05 	;AN000;   keyword found in synonym list
  1631                              <2> 
  1632                              <2> D_P_SCOM04:				;AN000;
  1633 00000672 2EF606[0E00]10      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_SW_Cmp ;AC034; switch search ?
  1634 00000678 740E                <2> 	je	D_P_SCOM03		;AN000;
  1635                              <2> 
  1636 0000067A 3C3A                <2> 	cmp	al,D_P_Colon		;AN000; ":" is delimiter, at end of switch on command line
  1637 0000067C 750A                <2> 	jne	D_P_SCOM03		;AN000; continue compares
  1638                              <2> 
  1639 0000067E 26807E0000          <2> 	cmp	byte ptr [es:bp],D_P_NULL ;AN021; IF at end of switch on command AND
  1640 00000683 755C                <2> 	jne	D_P_SCOM_DIFFER		;AN021;   at end of switch string in the control block THEN
  1641                              <2> 
  1642                              <2> D_P_SCOM05:				;AN000;   found a match
  1643 00000685 46                  <2> 	inc	si			;AN000; si points to just after "=" or ":"
  1644 00000686 EB5C                <2> 	jmp	short D_P_SCOM_Same	;AN000; exit
  1645                              <2> 
  1646                              <2> D_P_SCOM03:				;AN000;
  1647                              <2> %ENDIF					;AN000;(of KeySW+SwSW)
  1648 00000688 263A4600            <2> 	cmp	al,[es:bp]		;AN000; compare operand w/ a synonym
  1649 0000068C 751D                <2> 	jne	D_P_SCOM_Differ0 	;AN000; if different, check ignore colon option
  1650                              <2> 
  1651 0000068E 08C0                <2> 	or	al,al			;AN000; end of line
  1652 00000690 7452                <2> 	je	D_P_SCOM_Same		;AN000; if so, exit
  1653                              <2> 
  1654 00000692 46                  <2> 	inc	si			;AN000; update operand pointer
  1655 00000693 45                  <2> 	inc	bp			;AN000; 	   and synonym pointer
  1656 00000694 EB13                <2> 	jmp	short D_P_SCOM01 	;AN000; loop until NULL or "=" or ":" found in case
  1657                              <2> 
  1658                              <2> D_P_SCOM00:				;AN000; Here al is DBCS leading byte
  1659 00000696 263A4600            <2> 	cmp	al,[es:bp]		;AN000; compare leading byte
  1660 0000069A 7545                <2> 	jne	D_P_SCOM_Differ		;AN000; if not match, say different
  1661                              <2> 
  1662 0000069C 46                  <2> 	inc	si			;AN000; else, load next byte
  1663 0000069D 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000; and
  1664 000006A0 45                  <2> 	inc	bp			;AN000;
  1665 000006A1 263A4600            <2> 	cmp	al,[es:bp]		;AN000; compare 2nd byte
  1666 000006A5 753A                <2> 	jne	D_P_SCOM_Differ		;AN000; if not match, say different, too
  1667                              <2> 
  1668 000006A7 46                  <2> 	inc	si			;AN000; else update operand pointer
  1669 000006A8 45                  <2> 	inc	bp			;AN000; 		and synonym pointer
  1670                              <2> D_P_SCOM01:				;AN000;
  1671 000006A9 EBA7                <2> 	jmp	short D_P_SCOM_Loop	;AN000; loop until NULL or "=" or "/" found in case
  1672                              <2> 
  1673                              <2> D_P_SCOM_Differ0:			;AN000;
  1674                              <2> 
  1675                              <2> %IF	SwSW				;AN000;(tm10)
  1676 000006AB 2EF606[0E00]40      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_SW ;AC034;(tm10)
  1677 000006B1 740F                <2> 	je	D_P_not_applicable	;AN000;(tm10)
  1678                              <2> 
  1679 000006B3 26F747022000        <2> 	test	word [es:bx + D_P_Function_Flag],D_P_colon_is_not_necessary ;AN000;(tm10)
  1680 000006B9 7407                <2> 	je	D_P_not_applicable	;AN000;(tm10)
  1681                              <2> 
  1682 000006BB 26807E0000          <2> 	cmp	byte ptr [es:bp],D_P_NULL ;AN000;(tm10)
  1683                              <2> ;(deleted ;AN025;) jne D_P_not_applicable ;AN000;(tm10)
  1684 000006C0 7422                <2> 	je	D_P_SCOM_Same		;AN025;(tm10)
  1685                              <2> 
  1686                              <2> D_P_not_applicable:			;AN000;(tm10)
  1687                              <2> %ENDIF					;AN000;(tm10)
  1688                              <2> 
  1689 000006C2 26F7071000          <2> 	test	word [es:bx + D_P_Match_Flag],D_P_Ig_Colon ;AN000; ignore colon option specified ?
  1690 000006C7 7418                <2> 	je	D_P_SCOM_Differ		;AN000; if no, say different.
  1691                              <2> 
  1692 000006C9 3C3A                <2> 	cmp	al,D_P_Colon		;AN000; End up with ":" and
  1693 000006CB 7509                <2> 	jne	D_P_SCOM02		;AN000;    subseqently
  1694                              <2> 
  1695 000006CD 26807E0000          <2> 	cmp	byte ptr [es:bp],D_P_NULL ;AN000;       NULL ?
  1696 000006D2 750D                <2> 	jne	D_P_SCOM_Differ		;AN000; if no, say different
  1697                              <2> 
  1698 000006D4 EB0E                <2> 	jmp	short D_P_SCOM_Same	;AN000; else, say same
  1699                              <2> 
  1700                              <2> D_P_SCOM02:				;AN000;
  1701 000006D6 3C00                <2> 	cmp	al,D_P_NULL		;AN000; end up NULL and :
  1702 000006D8 7507                <2> 	jne	D_P_SCOM_Differ		;AN000;
  1703                              <2> 
  1704 000006DA 26807E003A          <2> 	cmp	byte ptr [es:bp],D_P_Colon ;AN000; if no, say different
  1705 000006DF 7403                <2> 	je	D_P_SCOM_Same		;AN000; else, say same
  1706                              <2> 
  1707                              <2> D_P_SCOM_Differ: 			;AN000;
  1708 000006E1 F9                  <2> 	stc				;AN000; indicate not found
  1709 000006E2 EB06                <2> 	jmp	short D_P_SCOM_Exit	;AN000;
  1710                              <2> 
  1711                              <2> D_P_SCOM_Same:				;AN000;
  1712 000006E4 2E8936[1100]        <2> 	mov	[psdata_seg:D_P_KEYorSW_Ptr],si ;AC034; for later use by keyword or switch
  1713 000006E9 F8                  <2> 	clc				;AN000; indicate found
  1714                              <2> D_P_SCOM_Exit:				;AN000;
  1715 000006EA 5E                  <2> 	pop	si			;AN000;
  1716 000006EB 5A                  <2> 	pop	dx			;AN000;
  1717 000006EC 5D                  <2> 	pop	bp			;AN000;
  1718 000006ED 58                  <2> 	pop	ax			;AN000;
  1719 000006EE C3                  <2> 	ret				;AN000;
  1720                              <2> D_P_String_Comp endp			;AN000;
  1721                              <2> ;PAGE					;AN000;
  1722                              <2> ;***********************************************************************
  1723                              <2> %IF	DateSW				;AN000;(Check if date format is supported)
  1724                              <2> ; D_P_Date_Format
  1725                              <2> ;
  1726                              <2> ; Function:  Convert a date string to DOS date format for int 21h
  1727                              <2> ;	     with format validation.
  1728                              <2> ;
  1729                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  1730                              <2> ;	     ES:BX -> CONTROL block
  1731                              <2> ;
  1732                              <2> ; Output:    None
  1733                              <2> ;
  1734                              <2> ; Use:	D_P_Fill_Result, D_P_Set_CDI, D_P_Get_DecNum
  1735                              <2> ;
  1736                              <2> ; Vars: D_P_RC(W), D_P_1st_Val(RW), D_P_2nd_Val(RW), D_P_3rd_Val(RW)
  1737                              <2> ;***********************************************************************
  1738                              <2> D_P_Date_Format proc			;AN000;
  1739                              <2> 	push	ax			;AN000;
  1740                              <2> 	push	cx			;AN000;
  1741                              <2> 	push	dx			;AN000;
  1742                              <2> 	push	si			;AN000;
  1743                              <2> 	push	bx			;AN000;
  1744                              <2> 	push	si			;AN000;
  1745                              <2> 	call	D_P_Set_CDI		;AN000; set country dependent information before process
  1746                              <2> ;	mov	bl,[psdata_seg:si].D_P_CDI_DateS ;load date separator ;AN020; (deleted)
  1747                              <2> ;					note: the country info is still needed
  1748                              <2> ;					to determine the order of the fields,
  1749                              <2> ;					but the separator char is no longer used.
  1750                              <2> 	pop	si			;AN000;
  1751                              <2> 	mov	word [psdata_seg:D_P_1st_Val],0 ;AC034; set initial value
  1752                              <2> 	mov	word [psdata_seg:D_P_2nd_Val],0 ;AC034; set initial value
  1753                              <2> 	mov	word [psdata_seg:D_P_3rd_Val],0 ;AC034; set initial value
  1754                              <2> 	call	D_P_Get_DecNum		;AN000; get 1st number
  1755                              <2> 	jc	D_P_DateF_Err0		;AN000;-----------------------+
  1756                              <2> 
  1757                              <2> 	mov	[psdata_seg:D_P_1st_Val],ax ;AC034;	      |
  1758                              <2> 	or	bl,bl			;AN000; end of line ?	      |
  1759                              <2> 	je	D_P_DateF_YMD		;AN000; 		      |
  1760                              <2> 
  1761                              <2> 	call	D_P_Get_DecNum		;AN000; get 2nd number	      |
  1762                              <2> 	jc	D_P_DateF_Error		;AN000; 		      |
  1763                              <2> 
  1764                              <2> 	mov	[psdata_seg:D_P_2nd_Val],ax ;AC034;	      |
  1765                              <2> 	or	bl,bl			;AN000; end of line ?	      |
  1766                              <2> 	je	D_P_DateF_YMD		;AN000; 		      |
  1767                              <2> 
  1768                              <2> 	call	D_P_Get_DecNum		;AN000; get 3rd number	      |
  1769                              <2> D_P_DateF_Err0:				;AN000; Bridge	  <-----------+
  1770                              <2> 	jc	D_P_DateF_Error		;AN000;
  1771                              <2> 
  1772                              <2> 	mov	[psdata_seg:D_P_3rd_Val],ax ;AC034;
  1773                              <2> 	or	bl,bl			;AN000; end of line ?
  1774                              <2> 	jne	D_P_DateF_Error		;AN000;
  1775                              <2> 
  1776                              <2> D_P_DateF_YMD:				;AN000;
  1777                              <2> D_P_Country_Info equ D_P_COUNTRY_INFO	; NASM port label
  1778                              <2> 	mov	bx,[psdata_seg:D_P_Country_Info + D_P_CDI_DateF] ;AC034; get date format
  1779                              <2> 	cmp	bx,D_P_Date_YMD		;AN000;
  1780                              <2> 	je	D_P_DateF00		;AN000;
  1781                              <2> 
  1782                              <2> 	mov	ax,[psdata_seg:D_P_1st_Val] ;AC034;
  1783                              <2> 	or	ah,ah			;AN000;
  1784                              <2> 	jne	D_P_DateF_Error		;AN000;
  1785                              <2> 
  1786                              <2> 	mov	cl,al			;AN000; set month
  1787                              <2> 	mov	ax,[psdata_seg:D_P_2nd_Val] ;AC034;
  1788                              <2> 	or	ah,ah			;AN000; if overflow, error.
  1789                              <2> 	jne	D_P_DateF_Error		;AN000;
  1790                              <2> 
  1791                              <2> 	mov	ch,al			;AN000; set date
  1792                              <2> 	mov	dx,[psdata_seg:D_P_3rd_Val] ;AC034; set year
  1793                              <2> 	cmp	bx,D_P_Date_DMY		;AN000; from here format = MDY
  1794                              <2> 	jne	D_P_DateF01		;AN000; if it is DMY
  1795                              <2> 
  1796                              <2> 	xchg	ch,cl			;AN000;  then swap M <-> D
  1797                              <2> D_P_DateF01:				;AN000;
  1798                              <2> 	jmp	short D_P_DateF02	;AN000;
  1799                              <2> 
  1800                              <2> D_P_DateF00:				;AN000; / here format = YMD
  1801                              <2> 	mov	dx,[psdata_seg:D_P_1st_Val] ;AC034; set year
  1802                              <2> 	mov	ax,[psdata_seg:D_P_2nd_Val] ;AC034;
  1803                              <2> 	or	ah,ah			;AN000; if overflow, error
  1804                              <2> 	jne	D_P_DateF_Error		;AN000;
  1805                              <2> 
  1806                              <2> 	mov	cl,al			;AN000; set month
  1807                              <2> 	mov	ax,[psdata_seg:D_P_3rd_Val] ;AC034;
  1808                              <2> 	or	ah,ah			;AN000; if overflow, error
  1809                              <2> 	jne	D_P_DateF_Error		;AN000;
  1810                              <2> 
  1811                              <2> 	mov	ch,al			;AN000; set date
  1812                              <2> D_P_DateF02:				;AN000;
  1813                              <2> 	cmp	dx,100			;AN000; year is less that 100 ?
  1814                              <2> 	jae	D_P_DateF03		;AN000;
  1815                              <2> 
  1816                              <2> 	add	dx,1900 		;AN000; set year 19xx
  1817                              <2> D_P_DateF03:				;AN000;
  1818                              <2> 	pop	bx			;AN000; recover CONTROL block
  1819                              <2> 	pop	si			;AN000; recover string pointer
  1820                              <2> 	mov	ah,D_P_No_Tag		;AN000; set
  1821                              <2> 	mov	al,D_P_Date_F		;AN000;     result
  1822                              <2> 	call	D_P_Fill_Result		;AN000; 	   buffer
  1823                              <2> 	jmp	short D_P_Date_Format_Exit ;AN000;	to Date
  1824                              <2> 
  1825                              <2> D_P_DateF_Error: 			;AN000;
  1826                              <2> 	pop	bx			;AN000; recover CONTROL block
  1827                              <2> 	pop	si			;AN000; recover string pointer
  1828                              <2> 	mov	ah,D_P_No_Tag		;AN000; set
  1829                              <2> 	mov	al,D_P_String		;AN000;     result
  1830                              <2> 	call	D_P_Fill_Result		;AN000; 	   buffer  to string
  1831                              <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; indicate syntax error
  1832                              <2> D_P_Date_Format_Exit:			;AN000;
  1833                              <2> 	pop	dx			;AN000;
  1834                              <2> 	pop	cx			;AN000;
  1835                              <2> 	pop	ax			;AN000;
  1836                              <2> 	ret				;AN000;
  1837                              <2> D_P_Date_Format endp			;AN000;
  1838                              <2> %ENDIF					;AN000;(of DateSW)
  1839                              <2> ;PAGE					;AN000;
  1840                              <2> ;***********************************************************************
  1841                              <2> %IF	TimeSW+DateSW			;AN000;(Check if time or date format is supported)
  1842                              <2> ; D_P_Set_CDI:
  1843                              <2> ;
  1844                              <2> ; Function: Read CDI from DOS if it has not been read yet
  1845                              <2> ;
  1846                              <2> ; Input:    None
  1847                              <2> ;
  1848                              <2> ; Output:   psdata_seg:SI -> CDI
  1849                              <2> ;
  1850                              <2> ; Use:	INT 21h w/ AH = 38h
  1851                              <2> ;***********************************************************************
  1852                              <2> D_P_Set_CDI proc 			;AN000;
  1853                              <2> 	lea	si,[D_P_Country_Info] ;AC034;
  1854                              <2> 	cmp	word [psdata_seg:si + D_P_CDI_DateF],D_P_NeedToBeRead ;AN000; already read ?
  1855                              <2> 	je	D_P_Read_CDI		;AN000;
  1856                              <2> 
  1857                              <2> 	jmp	short D_P_Set_CDI_Exit	;AN000; then do nothing
  1858                              <2> 
  1859                              <2> D_P_Read_CDI:				;AN000; else read CDI thru DOS
  1860                              <2> 	push	ds			;AN000;
  1861                              <2> 	push	dx			;AN000;
  1862                              <2> 	push	ax			;AN000;
  1863                              <2> 	push	PSDATA_SEG		;AC023;
  1864                              <2> 	pop	ds			;AN000; set segment register
  1865                              <2> 	mov	ax,D_P_DOS_Get_CDI	;AN000; get country information
  1866                              <2> 	mov	dx,si			;AN000; set offset of CDI in local data area
  1867                              <2> 	int	21h			;AN000;
  1868                              <2> 	pop	ax			;AN000;
  1869                              <2> 	pop	dx			;AN000;
  1870                              <2> 	pop	ds			;AN000;
  1871                              <2> D_P_Set_CDI_Exit:			;AN000;
  1872                              <2> 	ret				;AN000;
  1873                              <2> D_P_Set_CDI endp 			;AN000;
  1874                              <2> ;PAGE					;AN000;
  1875                              <2> ;***********************************************************************
  1876                              <2> ; D_P_Get_DecNum:
  1877                              <2> ;
  1878                              <2> ; Function:  Read a chcrater code from psdata_seg:SI until specified delimiter
  1879                              <2> ;	     or NULL encountered. And make a decimal number.
  1880                              <2> ;
  1881                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  1882                              <2> ;
  1883                              <2> ; Output:    BL = delimiter code or NULL
  1884                              <2> ;	     AX = Decimal number
  1885                              <2> ;	     SI advanced to the next number
  1886                              <2> ;	     CY = 1 : Syntax error, AL = Latest examineed number
  1887                              <2> ;
  1888                              <2> ; Use:	D_P_0099
  1889                              <2> ;***********************************************************************
  1890                              <2> D_P_Get_DecNum proc			;AN000;
  1891                              <2> 	push	cx			;AN000;
  1892                              <2> 	push	dx			;AN000;
  1893                              <2> 	xor	cx,cx			;AN000; cx will have final value
  1894                              <2> D_P_GetNum_Loop: 			;AN000;
  1895                              <2> 	mov	al,[psdata_seg:si]	;AN000; load character
  1896                              <2> 	or	al,al			;AN000; end of line ?
  1897                              <2> 	je	D_P_GetNum00		;AN000; if yes, exit
  1898                              <2> 
  1899                              <2> 	cmp	byte [psdata_seg:D_P_Got_Time],0 ;AC034; ;is this numeric in a time field?    ;AC023
  1900                              <2> 	je	D_P_Do_Date_Delims	;AN000;no, go check out Date delimiters  ;AC023
  1901                              <2> 
  1902                              <2> ; Determine which delimiter(s) to check for.  Colon & period  or period only
  1903                              <2> 	cmp	bl,D_P_colon_period	;AN032; ;Time
  1904                              <2> 	jne	D_P_Do_Time_Delim1	;AN032; ;only check for period
  1905                              <2> 
  1906                              <2> 	cmp	al,D_P_Colon		;AN032; ;Is this a valid delimiter ?
  1907                              <2> 	je	D_P_GetNum01		;AN032; ;yes, exit
  1908                              <2> 
  1909                              <2> D_P_Do_Time_Delim1:			;AN000;
  1910                              <2> 	cmp	al,D_P_Period		;;AC032;;AC023;Is this a valid delimiter ?
  1911                              <2> 	je	D_P_GetNum01		;AC023; yes, exit
  1912                              <2> 
  1913                              <2> 	jmp	short D_P_Neither_Delims ;AN023;
  1914                              <2> 
  1915                              <2> D_P_Do_Date_Delims:			;AN000;
  1916                              <2> ;Regardless of the date delimiter character specified in the country
  1917                              <2> ;dependent information, check for the presence of any one of these
  1918                              <2> ;three field delimiters: "-", "/", or ".".
  1919                              <2> 	cmp	al,D_P_Minus		;AN020;is this a date delimiter character?
  1920                              <2> 	je	D_P_GetNum01		;AN020;if yes, exit
  1921                              <2> 
  1922                              <2> 	cmp	al,D_P_Slash		;AN020;is this a date delimiter character?
  1923                              <2> 	je	D_P_GetNum01		;AN020;if yes, exit
  1924                              <2> 
  1925                              <2> 	cmp	al,D_P_Period		;AN020;is this a date delimiter character?
  1926                              <2> 	je	D_P_GetNum01		;AN000; if yes, exit
  1927                              <2> 
  1928                              <2> D_P_Neither_Delims:			;AN023;
  1929                              <2> 
  1930                              <2> 	call	D_P_0099 		;AN000; convert it to binary
  1931                              <2> 	jc	D_P_GetNum_Exit		;AN000; if error exit
  1932                              <2> 
  1933                              <2> 	mov	ah,0			;AN000;
  1934                              <2> 	xchg	ax,cx			;AN000;
  1935                              <2> 	mov	dx,10			;AN000;
  1936                              <2> 	mul	dx			;AN000; ax = ax * 10
  1937                              <2> 	or	dx,dx			;AN000; overflow
  1938                              <2> 	jne	D_P_GetNum02		;AN000; then exit
  1939                              <2> 
  1940                              <2> 	add	ax,cx			;AN000;
  1941                              <2> 	jc	D_P_GetNum_Exit		;AN000;
  1942                              <2> 
  1943                              <2> 	xchg	ax,cx			;AN000;
  1944                              <2> 	inc	si			;AN000;
  1945                              <2> 	jmp	short D_P_GetNum_Loop	;AN000;
  1946                              <2> 
  1947                              <2> D_P_GetNum00:				;AN000;
  1948                              <2> 	mov	bl,al			;AN000; set bl to NULL
  1949                              <2> 	clc				;AN000; indicate no error
  1950                              <2> 	jmp	short D_P_GetNum_Exit	;AN000;
  1951                              <2> 
  1952                              <2> D_P_GetNum01:				;AN000;
  1953                              <2> 	inc	si			;AN000; si points to next number
  1954                              <2> 	clc				;AN000; indicate no error
  1955                              <2> 	jmp	short D_P_GetNum_Exit	;AN000;
  1956                              <2> 
  1957                              <2> D_P_GetNum02:				;AN000;
  1958                              <2> 	stc				;AN000; indicate error
  1959                              <2> D_P_GetNum_Exit: 			;AN000;
  1960                              <2> 	mov	ax,cx			;AN000;return value
  1961                              <2> 	pop	dx			;AN000;
  1962                              <2> 	pop	cx			;AN000;
  1963                              <2> 	ret				;AN000;
  1964                              <2> D_P_Get_DecNum endp			;AN000;
  1965                              <2> %ENDIF					;AN000;(of TimeSW+DateSW)
  1966                              <2> ;PAGE					;AN000;
  1967                              <2> ;***********************************************************************
  1968                              <2> %IF	TimeSW				;AN000;(Check if time format is supported)
  1969                              <2> ; D_P_Time_Format
  1970                              <2> ;
  1971                              <2> ; Function:  Convert a time string to DOS time format for int 21h
  1972                              <2> ;	     with format validation.
  1973                              <2> ;
  1974                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  1975                              <2> ;	     ES:BX -> CONTROL block
  1976                              <2> ;
  1977                              <2> ; Output:    None
  1978                              <2> ;
  1979                              <2> ; Use:	D_P_Fill_Result, D_P_Set_CDI, D_P_Get_DecNum, D_P_Time_2412
  1980                              <2> ;
  1981                              <2> ; Vars: D_P_RC(W), D_P_Flags(R), D_P_1st_Val(RW), D_P_2nd_Val(RW)
  1982                              <2> ;	D_P_3rd_Val(RW), D_P_4th_Val(RW)
  1983                              <2> ;***********************************************************************
  1984                              <2> D_P_Time_Format proc			;AN000;
  1985                              <2> 	push	ax			;AN000;
  1986                              <2> 	push	cx			;AN000;
  1987                              <2> 	push	dx			;AN000;
  1988                              <2> 	push	si			;AN000;
  1989                              <2> 	push	bx			;AN000;
  1990                              <2> 	push	si			;AN000;
  1991                              <2> 	call	D_P_Set_CDI		;AN000; Set country independent
  1992                              <2> 					; information before process
  1993                              <2> ;(AN032; deleted)  mov	   bl,[psdata_seg:si].D_P_CDI_TimeS ;load time separator
  1994                              <2> ;(AN032; deleted)  mov	   bh,[psdata_seg:si].D_P_CDI_Dec ;load decimal separator
  1995                              <2> 	test	byte ptr [psdata_seg:si + D_P_CDI_TimeF],1 ;AN000; 24 hour system
  1996                              <2> 	pop	si			;AN000;
  1997                              <2> 	jne	D_P_TimeF00		;AN000; if no, means 12 hour system
  1998                              <2> 
  1999                              <2> 	call	D_P_Time_2412		;AN000; this routine handle "am" "pm"
  2000                              <2> D_P_TimeF00:				;AN000;
  2001                              <2> 	mov	word [psdata_seg:D_P_1st_Val],0 ;AC034; set initial value
  2002                              <2> 	mov	word [psdata_seg:D_P_2nd_Val],0 ;AC034; set initial value
  2003                              <2> 	mov	word [psdata_seg:D_P_3rd_Val],0 ;AC034; set initial value
  2004                              <2> 	mov	word [psdata_seg:D_P_4th_Val],0 ;AC034; set initial value
  2005                              <2> 	mov	byte [psdata_seg:D_P_Got_Time],1 ;AN023;AC034;; use time delimiter
  2006                              <2> 	mov	bl,D_P_colon_period	;AN032; flag, indicates use of
  2007                              <2> 					; delimiters between hours,
  2008                              <2> 					;  minutes,seconds
  2009                              <2> 	call	D_P_Get_DecNum		;AN000; get 1st number
  2010                              <2> 	jc	D_P_TimeF_Err0		;AN000;
  2011                              <2> 
  2012                              <2> 	mov	[psdata_seg:D_P_1st_Val],ax ;AC034;
  2013                              <2> 	or	bl,bl			;AN000; end of line ?
  2014                              <2> D_P_TimeF_Rlt equ D_P_TimeF_RLT	; NASM port label
  2015                              <2> 	je	D_P_TimeF_Rlt		;AN000;
  2016                              <2> 
  2017                              <2> 	call	D_P_Get_DecNum		;AN000; get 2nd number
  2018                              <2> 	jc	D_P_TimeF_Err0		;AC038; if OK
  2019                              <2> 
  2020                              <2> 	mov	[psdata_seg:D_P_2nd_Val],ax ;AC034;
  2021                              <2> 	or	bl,bl			;AN000; end of line ?
  2022                              <2> 	je	D_P_TimeF_Rlt		;AN000;
  2023                              <2> 
  2024                              <2> ;(;AN032; deleted) mov	   bl,bh		   ;set decimal separator
  2025                              <2> 	mov	bl,D_P_period_only	;AN032; flag, which to decimal separator
  2026                              <2> 	call	D_P_Get_DecNum		;AN000; get 3rd number
  2027                              <2> 	jc	D_P_TimeF_Err0		;AC039; if problem, bridge to error
  2028                              <2> 
  2029                              <2> 	mov	[psdata_seg:D_P_3rd_Val],ax ;AC034;
  2030                              <2> 	or	bl,bl			;AN000; end of line ?
  2031                              <2> ;(DELETED ;AN039;)  je D_P_TimeF_Rlt	;AN000;
  2032                              <2> 	jne	D_P_Time_4		;AN039; NOT END OF LINE,
  2033                              <2> 					;AN039;   GO TO 4TH NUMBER
  2034                              <2> D_P_Time_Again equ D_P_TIME_AGAIN	; NASM port equate
  2035                              <2> 	test	byte [psdata_seg:D_P_Flags1],D_P_Time_Again ;AN039; HAS TIME PARSE
  2036                              <2> 					;AN039;    BEEN REPEATED?
  2037                              <2> 	jnz	D_P_TimeF_Rlt		;AN039; yes, this is really
  2038                              <2> 					;AN039;   the end of line
  2039                              <2> 					;AN039; no, time has not been repeated
  2040                              <2> 	mov	si,[psdata_seg:D_P_SI_Save] ;AN039; get where parser quit
  2041                              <2> 					 ;AN039;   in command line
  2042                              <2> 	cmp	byte ptr [si-1],D_P_Comma ;AN039; look at delimiter
  2043                              <2> 					;AN039;   from command line
  2044                              <2> 	jne	D_P_TimeF_Rlt		;AN039; was not a comma, this is
  2045                              <2> 					;AN039;  really end of line
  2046                              <2> 					;AN039; is comma before hundredths,
  2047                              <2> 					;AN039;   redo TIME
  2048                              <2> 	mov	byte ptr [si-1],D_P_Period ;AN039; change that ambiguous
  2049                              <2> 					;AN039;    comma to a decimal point
  2050                              <2> 					;AN039;     parse can understand
  2051                              <2> 	mov	word [psdata_seg:D_P_Flags],0	;AN039; Clear all internal flags
  2052                              <2> 	or	byte [psdata_seg:D_P_Flags1],D_P_Time_Again ;AN039; indicate TIME
  2053                              <2> 					;AN039; is being repeated
  2054                              <2> 	mov	cx,[psdata_seg:D_P_ORIG_ORD] ;AN039; ORIGINAL ORDINAL FROM CX
  2055                              <2> 	mov	sp,[psdata_seg:D_P_ORIG_STACK] ;AN039; ORIGINAL VALUE
  2056                              <2> 					 ;AN039;   OF STACK FROM SP
  2057                              <2> 	mov	si,[psdata_seg:D_P_ORIG_SI] ;AN039; ORIGINAL START
  2058                              <2> 					 ;AN039;   PARSE POINTER FROM SI
  2059                              <2> D_P_Redo_Time equ D_P_REDO_TIME	; NASM port label
  2060                              <2> 	jmp	D_P_Redo_Time		;AN039; go try TIME again
  2061                              <2> ; ===============================================================
  2062                              <2> D_P_Time_4:				;AN039; READY FOR 4TH (HUNDREDTHS) NUMBER
  2063                              <2> 	call	D_P_Get_DecNum		;AN000; get 4th number
  2064                              <2> D_P_TimeF_Err0:				;AN000; Bridge
  2065                              <2> 	jc	D_P_TimeF_Error		;AN000;
  2066                              <2> 
  2067                              <2> 	mov	[psdata_seg:D_P_4th_Val],ax ;AC034;
  2068                              <2> 	or	bl,bl			;AN000; After hundredth, no data allowed
  2069                              <2> 	jne	D_P_TimeF_Error		;AN000; if some, then error
  2070                              <2> 
  2071                              <2> D_P_TimeF_RLT:				;AN000;
  2072                              <2> 	mov	ax,[psdata_seg:D_P_1st_Val] ;AC034;
  2073                              <2> 	or	ah,ah			;AN000; if overflow then error
  2074                              <2> 	jne	D_P_TimeF_Err		;AN000;
  2075                              <2> 
  2076                              <2> D_P_Time12am equ D_P_time12am	; NASM port equate
  2077                              <2> 	test	byte [psdata_seg:D_P_Flags1],D_P_Time12am ;AN038;if "am" specified
  2078                              <2> 	jz	D_P_Time_notAM		;AN038;skip if no "AM" specified
  2079                              <2> 					;since "AM" was specified,
  2080                              <2> 	cmp	al,12			;AN038: if hour specified as later than noon
  2081                              <2> 	ja	D_P_TimeF_Err		;AN038; error if "AM" on more than noon
  2082                              <2> 	jne	D_P_Time_notAM		;AN038; for noon exactly,
  2083                              <2> 
  2084                              <2> 	xor	al,al			;AN038; set hour = zero
  2085                              <2> D_P_Time_notAM:				;AN038;
  2086                              <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Time12 ;AC034; if 12 hour system and pm is specified
  2087                              <2> 	je	D_P_TimeSkip00		;AN000; then
  2088                              <2> 
  2089                              <2> 	cmp	al,12			;AN038; if 12:00 o'clock already
  2090                              <2> 	je	D_P_TimeSkip00		;AN038; it is PM already
  2091                              <2> 
  2092                              <2> 	add	al,12			;AN000; add 12 hours to make it afternoon
  2093                              <2> 	jc	D_P_TimeF_Err		;AN000; if overflow then error
  2094                              <2> 
  2095                              <2> 	cmp	al,24			;AN038; after adding 12, now cannot be >24
  2096                              <2> 	ja	D_P_TimeF_Err		;AN038; if too big, error
  2097                              <2> 
  2098                              <2> D_P_TimeSkip00:				;AN000;
  2099                              <2> 	mov	dl,al			;AN000; set hour
  2100                              <2> 	mov	ax,[psdata_seg:D_P_2nd_Val] ;AC034;
  2101                              <2> 	or	ah,ah			;AN000; if overflow then error
  2102                              <2> 	jne	D_P_TimeF_Err		;AN000;
  2103                              <2> 
  2104                              <2> 	mov	dh,al			;AN000; set minute
  2105                              <2> 	mov	ax,[psdata_seg:D_P_3rd_Val] ;AC034;
  2106                              <2> 	or	ah,ah			;AN000; if overflow then error
  2107                              <2> 	jne	D_P_TimeF_Err		;AN000;
  2108                              <2> 
  2109                              <2> 	mov	cl,al			;AN000; set second
  2110                              <2> 	mov	ax,[psdata_seg:D_P_4th_Val] ;AC034;
  2111                              <2> 	or	ah,ah			;AN000; if overflow then error
  2112                              <2> 	jne	D_P_TimeF_Err		;AN000;
  2113                              <2> 
  2114                              <2> 	mov	ch,al			;AN000; set hundredth
  2115                              <2> 	pop	bx			;AN000; recover CONTROL block
  2116                              <2> 	pop	si			;AN000; recover string pointer
  2117                              <2> 	mov	ah,D_P_No_Tag		;AN000; set
  2118                              <2> 	mov	al,D_P_Time_F		;AN000;    result
  2119                              <2> 	call	D_P_Fill_Result		;AN000; 	 buffer
  2120                              <2> 	jmp	short D_P_Time_Format_Exit ;AN000;    to time
  2121                              <2> 
  2122                              <2> D_P_TimeF_Error: 			;AN000;
  2123                              <2> D_P_TimeF_Err:				;AN000;
  2124                              <2> 	pop	bx			;AN000; recover CONTROL block
  2125                              <2> 	pop	si			;AN000; recover string pointer
  2126                              <2> 	mov	ah,D_P_No_Tag		;AN000; set
  2127                              <2> 	mov	al,D_P_String		;AN000;     result
  2128                              <2> 	call	D_P_Fill_Result		;AN000; 	  buffer to string
  2129                              <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; return syntax error
  2130                              <2> D_P_Time_Format_Exit:			;AN000;
  2131                              <2> 	mov	byte [psdata_seg:D_P_Got_Time],0 ;AN023;AC034;; finished with this time field
  2132                              <2> 	pop	dx			;AN000;
  2133                              <2> 	pop	cx			;AN000;
  2134                              <2> 	pop	ax			;AN000;
  2135                              <2> 	ret				;AN000;
  2136                              <2> D_P_Time_Format endp			;AN000;
  2137                              <2> ;PAGE					;AN000;
  2138                              <2> ;***********************************************************************
  2139                              <2> ; D_P_Time_2412:
  2140                              <2> ;
  2141                              <2> ; Function:  Remove "a", "p", "am", or "pm" from the end of stinrg
  2142                              <2> ;
  2143                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  2144                              <2> ;
  2145                              <2> ; Output:    Set D_P_Time12 flag when the string is terminated by "p"
  2146                              <2> ;	     or "pm"
  2147                              <2> ;
  2148                              <2> ; Vars:  D_P_Flags(W)
  2149                              <2> ;***********************************************************************
  2150                              <2> D_P_Time_2412 proc			;AN000;
  2151                              <2> 	push	ax			;AN000;
  2152                              <2> 	push	si			;AN000;
  2153                              <2> D_P_T12_Loop:				;AN000;
  2154                              <2> 	mov	al,[psdata_seg:si]	;AN000; Move
  2155                              <2> 	inc	si			;AN000;     si
  2156                              <2> 	or	al,al			;AN000;       to
  2157                              <2> 	jne	D_P_T12_Loop		;AN000; 	end of string
  2158                              <2> 
  2159                              <2> 	mov	al,[psdata_seg:si-2] ;AN000; get char just before NULL
  2160                              <2> 	or	al,D_P_Make_Lower	;AN000; lower case map
  2161                              <2> 	cmp	al,"p"                  ;AN000; only "p" of "pm" ?
  2162                              <2> 	je	D_P_T1200		;AN000;
  2163                              <2> 
  2164                              <2> 	cmp	al,"a"                  ;AN000; only "a" of "am" ?
  2165                              <2> 	je	D_P_T1201		;AN000;
  2166                              <2> 
  2167                              <2> 	cmp	al,"m"                  ;AN000; "m" of "am" or "pm"
  2168                              <2> 	jne	D_P_T12_Exit		;AN000;
  2169                              <2> 
  2170                              <2> 	dec	si			;AN000;
  2171                              <2> 	mov	al,[psdata_seg:si-2] ;AN000;
  2172                              <2> D_P_Make_lower equ D_P_Make_Lower	; NASM port equate
  2173                              <2> 	or	al,D_P_Make_lower	;AN000; lower case map
  2174                              <2> 	cmp	al,"p"                  ;AN000; "p" of "pm" ?
  2175                              <2> 	je	D_P_T1200		;AN000;
  2176                              <2> 
  2177                              <2> 	cmp	al,"a"                  ;AN000; "a" of "am" ?
  2178                              <2> 	je	D_P_T1201		;AN000; go process "a"
  2179                              <2> 
  2180                              <2> 	jmp	short D_P_T12_Exit	;AN000; no special chars found
  2181                              <2> 
  2182                              <2> D_P_T1200:				;AN000; "P" found
  2183                              <2> 	or	byte [psdata_seg:D_P_Flags2],D_P_Time12 ;AC034; flag "PM" found
  2184                              <2> 	jmp	short D_P_Tclr_chr	;AN038; go clear the special char
  2185                              <2> 
  2186                              <2> D_P_T1201:				;AN000; "A" found
  2187                              <2> D_P_Time12AM equ D_P_time12am	; NASM port equate
  2188                              <2> 	or	byte [psdata_seg:D_P_Flags1],D_P_Time12AM ;AN038; flag "AM" found
  2189                              <2> D_P_Tclr_chr:				;AN038;
  2190                              <2> 	mov	byte ptr [psdata_seg:si-2],D_P_NULL ;AN000; null out special char
  2191                              <2> D_P_T12_Exit:				;AN000;
  2192                              <2> 	pop	si			;AN000;
  2193                              <2> 	pop	ax			;AN000;
  2194                              <2> 	ret				;AN000;
  2195                              <2> D_P_Time_2412 endp			;AN000;
  2196                              <2> %ENDIF					;AN000;(of TimeSW)
  2197                              <2> ;PAGE					;AN000;
  2198                              <2> ;***********************************************************************
  2199                              <2> %IF	CmpxSW				;AN000;(Check if complex item is supported)
  2200                              <2> ; D_P_Complex_Format:
  2201                              <2> ;
  2202                              <2> ; Function:  Check if the input string is valid complex format.
  2203                              <2> ;	     And set the result buffer.
  2204                              <2> ;
  2205                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  2206                              <2> ;	     ES:BX -> CONTROL block
  2207                              <2> ;
  2208                              <2> ; Output:    None
  2209                              <2> ;
  2210                              <2> ; Use:	D_P_Fill_Result, D_P_Chk_DBCS, D_P_Chk_EOL, D_P_Skip_Delim
  2211                              <2> ;	D_P_Quoted_str, D_P_Chk_DSQuote
  2212                              <2> ;
  2213                              <2> ; Vars: D_P_RC(W), D_P_SI_Save(W), D_P_SaveSI_Cmpx(R), D_P_Save_EOB(R)
  2214                              <2> ;***********************************************************************
  2215                              <2> D_P_Complex_Format proc			;AN000;
  2216                              <2> 	push	ax			;AN000;
  2217                              <2> 	push	bx			;AN000;
  2218                              <2> 	push	si			;AN000;
  2219                              <2> 	mov	bx,[psdata_seg:D_P_SaveSI_Cmpx] ;AC034; bx points to user buffer
  2220                              <2> 	cmp	byte ptr [bx],D_P_Lparen ;AN000; 1st char = left parentheses
  2221                              <2> 	jne	D_P_Cmpx_Err		;AN000;
  2222                              <2> 
  2223                              <2> 	xor	ah,ah			;AN000; ah = parentheses counter
  2224                              <2> D_P_Cmpx_Loop:				;AN000;
  2225                              <2> 	mov	al,[bx] 		;AN000; load character from command buffer
  2226                              <2> 	call	D_P_Chk_EOL		;AN000; if it is one of EOL
  2227                              <2> 	je	D_P_CmpxErr0		;AN000; then error exit.
  2228                              <2> 
  2229                              <2> 	cmp	al,D_P_Lparen		;AN000; left parentheses ?
  2230                              <2> 	jne	D_P_Cmpx00		;AN000; then
  2231                              <2> 
  2232                              <2> 	inc	ah			;AC035; add '1' to AH reg
  2233                              <2> 					;AN000; increment parentheses counter
  2234                              <2> ;(replaced ;AC035;) add     ah,1	;AN000; increment parentheses counter
  2235                              <2> 	jc	D_P_CmpxErr0		;AN000; if overflow, error
  2236                              <2> D_P_Cmpx00:				;AN000;
  2237                              <2> 	cmp	al,D_P_Rparen		;AN000; right parentheses ?
  2238                              <2> 	jne	D_P_Cmpx01		;AN000; then
  2239                              <2> 
  2240                              <2> 	dec	ah			;AC035; subtract '1' from AH reg
  2241                              <2> 					;AN000; decrement parentheses counter
  2242                              <2> ;(changed ;AC035;) sub	   ah,1 	;AN000; decrement parentheses counter
  2243                              <2> 	jc	D_P_CmpxErr0		;AN000; if overflow error
  2244                              <2> 
  2245                              <2> 	je	D_P_Cmpx03		;AN000; ok, valid complex
  2246                              <2> 
  2247                              <2> D_P_Cmpx01:				;AN000;
  2248                              <2> ;(deleted ;AN025;) call D_P_Chk_DSQuote	;AN000; double or single quotation mark ? 3/17/KK
  2249                              <2> 	cmp	al,D_P_DQuote		;AN025; double quotation mark?
  2250                              <2> 	jne	D_P_Cmpx04		;AN000; 3/17/KK
  2251                              <2> 
  2252                              <2> 	mov	[psdata_seg:si],al	;AN000; here quoted string is found in the complex list.
  2253                              <2> 	inc	si			;AN000;
  2254                              <2> 	inc	bx			;AN000; bx points to 2nd character
  2255                              <2> 	call	D_P_Quoted_Str		;AN000; skip pointers until closing of quoted string
  2256                              <2> 	jc	D_P_CmpxErr0		;AN000; if error in quoted string syntax then exit
  2257                              <2> 
  2258                              <2> 	jmp	short D_P_Cmpx05 	;AN000;
  2259                              <2> 
  2260                              <2> D_P_Cmpx04:				;AN000;
  2261                              <2> 	call	D_P_Chk_DBCS		;AN000; was it a lead byte of DBCS ?
  2262                              <2> 	jnc	D_P_Cmpx02		;AN000;
  2263                              <2> 
  2264                              <2> 	mov	[psdata_seg:si],al	;AN000; then store 1st byte
  2265                              <2> 	inc	si			;AN000;
  2266                              <2> 	inc	bx			;AN000;
  2267                              <2> 	mov	al,[bx] 		;AN000; load 2nd byte
  2268                              <2> D_P_Cmpx02:				;AN000;
  2269                              <2> 	mov	[psdata_seg:si],al	;AN000; store SBCS or 2nd byte of DBCS
  2270                              <2> D_P_Cmpx05:				;AN000;
  2271                              <2> 	inc	si			;AN000;
  2272                              <2> 	inc	bx			;AN000;
  2273                              <2> 	jmp	short D_P_Cmpx_Loop	;AN000; loop
  2274                              <2> ;----					;AN000;
  2275                              <2> D_P_Cmpx03:				;AN000;
  2276                              <2> 	mov	byte ptr [psdata_seg:si],al ;AN000;
  2277                              <2> 	mov	byte ptr [psdata_seg:si+1],D_P_NULL ;AN000;
  2278                              <2> 	mov	byte ptr [bx],D_P_NULL	;AN000; replace right parentheses with NULL
  2279                              <2> 	mov	si,bx			;AN000; skip whitespaces
  2280                              <2> 	inc	si			;AN000;     after
  2281                              <2> 	call	D_P_Skip_Delim		;AN000;        right parentheses
  2282                              <2> 	mov	[psdata_seg:D_P_SI_Save],si ;AC034; save next pointer, SI
  2283                              <2> 	jmp	short D_P_Cmpx_Exit	;AN000;
  2284                              <2> 
  2285                              <2> D_P_CmpxErr0:				;AN000;
  2286                              <2> 	mov	si,[psdata_seg:D_P_Save_EOB] ;AC034; if EOF encountered, restore
  2287                              <2> 	mov	byte ptr [psdata_seg:si],D_P_NULL ;AN000; EOB mark
  2288                              <2> D_P_Cmpx_Err:				;AN000;
  2289                              <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034;
  2290                              <2> D_P_Cmpx_Exit:				;AN000;
  2291                              <2> 	mov	ah,D_P_No_Tag		;AN000;
  2292                              <2> 	mov	al,D_P_Complex		;AN000;
  2293                              <2> 	pop	si			;AN000;
  2294                              <2> 	pop	bx			;AN000;
  2295                              <2> 	call	D_P_Fill_Result		;AN000;
  2296                              <2> 	pop	ax			;AN000;
  2297                              <2> 	ret				;AN000;
  2298                              <2> D_P_Complex_Format endp			;AN000;
  2299                              <2> %ENDIF					;AN000;(of CpmxSW)
  2300                              <2> ;PAGE					;AN000;
  2301                              <2> ;***********************************************************************
  2302                              <2> %IF	QusSW				;AN000;(Check if quoted string is supported)
  2303                              <2> ; D_P_Quoted_Format:
  2304                              <2> ;
  2305                              <2> ; Function:  Check if the input string is valid quoted string format.
  2306                              <2> ;	     And set the result buffer.
  2307                              <2> ;
  2308                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  2309                              <2> ;	     ES:BX -> CONTROL block
  2310                              <2> ;
  2311                              <2> ; Output:    None
  2312                              <2> ;
  2313                              <2> ; Use:	D_P_Fill_Result, D_P_Chk_DBCS, D_P_Chk_EOL, D_P_Skip_Delim
  2314                              <2> ;	D_P_Chk_DSQuote, D_P_Quoted_Str
  2315                              <2> ;
  2316                              <2> ; Vars: D_P_RC(W), D_P_SI_Save(W), D_P_SaveSI_Cmpx(R),D_P_Save_EOB(R)
  2317                              <2> ;***********************************************************************
  2318                              <2> D_P_Quoted_Format proc			;AN000;
  2319 000006EF 50                  <2> 	push	ax			;AN000;
  2320 000006F0 53                  <2> 	push	bx			;AN000;
  2321 000006F1 56                  <2> 	push	si			;AN000;
  2322 000006F2 2E8B1E[0F00]        <2> 	mov	bx,[psdata_seg:D_P_SaveSI_Cmpx] ;AC034; bx points to user buffer
  2323 000006F7 8A07                <2> 	mov	al,byte ptr [bx]	;AN000; get 1st character
  2324                              <2> ;(deleted ;AN025;) call D_P_Chk_DSQuote	;AN000; is it single or double quote ?
  2325 000006F9 3C22                <2> 	cmp	al,D_P_DQuote		;AN025; double quotation mark?
  2326 000006FB 7521                <2> 	jne	D_P_Qus_Err		;AN000; if no, error
  2327                              <2> 
  2328                              <2> ;	mov	[psdata_seg:si],al	;AN000; move it to internal buffer
  2329                              <2> ;	inc	si			;AN000;
  2330 000006FD 43                  <2> 	inc	bx			;AN000; bx points to 2nd character
  2331 000006FE E82F00              <2> 	call	D_P_Quoted_Str		;AN000; skip pointers to the closing of quoted string
  2332 00000701 7212                <2> 	jc	D_P_Qus_Err0		;AN000; if invali quoted string syntax, exit
  2333                              <2> 
  2334 00000703 2EC6440100          <2> 	mov	byte ptr [psdata_seg:si+1],D_P_NULL ;AN000; end up with NULL
  2335 00000708 89DE                <2> 	mov	si,bx			;AN000;
  2336 0000070A 46                  <2> 	inc	si			;AN000;
  2337 0000070B E82201              <2> 	call	D_P_Skip_Delim		;AN000; skip whitespaces after closing quote
  2338 0000070E 2E8936[0400]        <2> 	mov	[psdata_seg:D_P_SI_Save],si ;AC034; save next pointer, SI
  2339 00000713 EB10                <2> 	jmp	short D_P_Qus_Exit	;AN000;
  2340                              <2> 
  2341                              <2> D_P_Qus_Err0:				;AN000;
  2342 00000715 2E8B36[1300]        <2> 	mov	si,[psdata_seg:D_P_Save_EOB] ;AC034; if EOF encountered, restore
  2343 0000071A 2EC60400            <2> 	mov	byte ptr [psdata_seg:si],D_P_NULL ;AN000; EOB mark
  2344                              <2> D_P_Qus_Err:				;AN000;AN000
  2345 0000071E 2EC706[0200]0900    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034; indicate syntax error
  2346                              <2> D_P_Qus_Exit:				;AN000;
  2347 00000725 B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; set
  2348 00000727 B009                <2> 	mov	al,D_P_Quoted_String	;AN000;    result
  2349 00000729 5E                  <2> 	pop	si			;AN000; 	 buffer
  2350 0000072A 5B                  <2> 	pop	bx			;AN000; 	       to
  2351 0000072B E89EFB              <2> 	call	D_P_Fill_Result		;AN000; 		 quoted string
  2352 0000072E 58                  <2> 	pop	ax			;AN000;
  2353 0000072F C3                  <2> 	ret				;AN000;
  2354                              <2> D_P_Quoted_Format endp			;AN000;
  2355                              <2> %ENDIF					;AN000;(of QusSW)
  2356                              <2> ;PAGE					;AN000;
  2357                              <2> ;***********************************************************************
  2358                              <2> ; D_P_Chk_DSQuote;
  2359                              <2> ;
  2360                              <2> ; Function: Check if AL is double quotation or single quotation
  2361                              <2> ;
  2362                              <2> ; Input:    AL = byte to be examineed
  2363                              <2> ;
  2364                              <2> ; Output:   ZF on if AL is single or double quotetaion
  2365                              <2> ;
  2366                              <2> ; Vars:  D_P_SorD_Quote(W)
  2367                              <2> ;***********************************************************************
  2368                              <2> %IF	QusSW+CmpxSW			;AN000;(Check if quoted string or complex item is supported)
  2369                              <2> ;(deleted ;AN025;) D_P_Chk_DSQuote proc			   ;
  2370                              <2> ;(deleted ;AN025;)	   mov	   D_P_SorD_Quote,D_P_SQuote ; 3/17/87   assume single quote
  2371                              <2> ;(deleted ;AN025;)	   cmp	   al,D_P_DQuote 	   ; 1st char = double quotation ?
  2372                              <2> ;(deleted ;AN025;)	   jne	   D_P_CDSQ00		   ; 3/17/87
  2373                              <2> ;(deleted ;AN025;)	   mov	   D_P_SorD_Quote,al	   ; 3/17/87 set bigning w/ double quote
  2374                              <2> ;(deleted ;AN025;)	   ret				   ; 3/17/87
  2375                              <2> ;(deleted ;AN025;) D_P_CDSQ00:				   ; 3/17/87
  2376                              <2> ;(deleted ;AN025;)	   cmp	   al,D_P_SQuote 	   ; 1st char = single quotation ?
  2377                              <2> ;(deleted ;AN025;)	   ret				   ;
  2378                              <2> ;(deleted ;AN025;) D_P_Chk_DSQuote endp			   ;
  2379                              <2> ;    PAGE				;AN000;
  2380                              <2> ;***********************************************************************
  2381                              <2> ; D_P_Quoted_Str:
  2382                              <2> ;
  2383                              <2> ; Function:  Copy chracacter from ES:BX to psdata_seg:SI until closing single
  2384                              <2> ;	     (double) quotation found.
  2385                              <2> ;
  2386                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  2387                              <2> ;	     ES:BX -> Operand in command buffer
  2388                              <2> ;
  2389                              <2> ; Output:    CY on indicates EOF encounterd before closing quotation
  2390                              <2> ;	     BX and SI
  2391                              <2> ;
  2392                              <2> ;
  2393                              <2> ; Vars: D_P_SorD_Quote(R)
  2394                              <2> ;***********************************************************************
  2395                              <2> D_P_Quoted_Str proc			;AN000;
  2396 00000730 50                  <2> 	push	ax			;AN000;
  2397                              <2> D_P_Qus_Loop:				;AN000;
  2398 00000731 8B07                <2> 	mov	ax,[bx] 		;AN000; 3/17/87
  2399 00000733 E82001              <2> 	call	D_P_Chk_EOL		;AN000;
  2400 00000736 7424                <2> 	je	D_P_Qustr_Err0		;AN000;
  2401                              <2> 
  2402                              <2> ;(deleted ;AN025;) cmp al,D_P_SorD_Quote ;AN000; quotation ?   3/17/87
  2403 00000738 3C22                <2> 	cmp	al,D_P_DQuote		;AN025; double quote?
  2404 0000073A 750D                <2> 	jne	D_P_Qus00		;AN000;
  2405                              <2> 
  2406                              <2> ;(deleted ;AN025;) cmp ah,D_P_SorD_Quote ;AN000; contiguous quotation 3/17/87
  2407 0000073C 80FC22              <2> 	cmp	ah,D_P_DQuote		;AN025; double quote?
  2408 0000073F 751E                <2> 	jne	D_P_Qus02		;AN000;
  2409                              <2> 
  2410                              <2> ;(deleted ;AN025:) mov word ptr [psdata_seg:si],ax ;AN000; 3/17/87
  2411 00000741 2E8804              <2> 	mov	byte ptr [psdata_seg:si],al ;AN025; save one of the quotes
  2412                              <2> ;(deleted ;AN025:) add si,2		;AN000;
  2413                              <2> 
  2414 00000744 46                  <2> 	inc	si			;AC035; add '1' to SI reg
  2415                              <2> 					;AN025; adjust target index
  2416                              <2> ;(changed ;AC035;) add	   si,1 	;AN025; adjust target index
  2417 00000745 43                  <2> 	inc	bx			;AC035; add '2' to
  2418 00000746 43                  <2> 	inc	bx			;AC035;  BX reg
  2419                              <2> 					;AN000; adjust source index by 2 to skip extra quote
  2420                              <2> ;(changed ;AC035;) add	   bx,2 	;AN000; adjust source index by 2 to skip extra quote
  2421 00000747 EBE8                <2> 	jmp	short D_P_Qus_Loop	;AN000;
  2422                              <2> 
  2423                              <2> D_P_Qus00:				;AN000;
  2424 00000749 E8BF01              <2> 	call	D_P_Chk_DBCS		;AN000; was it a lead byte of DBCS ?
  2425 0000074C 7307                <2> 	jnc	D_P_Qus01		;AN000;
  2426                              <2> 
  2427 0000074E 2E8804              <2> 	mov	[psdata_seg:si],al	;AN000; store 1st byte
  2428 00000751 46                  <2> 	inc	si			;AN000;
  2429 00000752 43                  <2> 	inc	bx			;AN000;
  2430 00000753 8A07                <2> 	mov	al,[bx] 		;AN000; load 2nd byte
  2431                              <2> D_P_Qus01:				;AN000;
  2432 00000755 2E8804              <2> 	mov	[psdata_seg:si],al	;AN000; store SBCS or 2nd byte of DBCS
  2433 00000758 46                  <2> 	inc	si			;AN000;
  2434 00000759 43                  <2> 	inc	bx			;AN000;
  2435 0000075A EBD5                <2> 	jmp	short D_P_Qus_Loop	;AN000;
  2436                              <2> 
  2437                              <2> D_P_Qustr_Err0:				;AN000;
  2438 0000075C F9                  <2> 	stc				;AN000; indicate error
  2439 0000075D EB05                <2> 	jmp	short D_P_Quoted_Str_Exit ;AN000;
  2440                              <2> 
  2441                              <2> D_P_Qus02:				;AN000;
  2442 0000075F 2EC60400            <2> 	mov	byte ptr [psdata_seg:si],0 ;AN000;
  2443 00000763 F8                  <2> 	clc				;AN000; indicate no error
  2444                              <2> D_P_Quoted_Str_Exit:			;AN000;
  2445 00000764 58                  <2> 	pop	ax			;AN000;
  2446 00000765 C3                  <2> 	ret				;AN000;
  2447                              <2> D_P_Quoted_Str endp			;AN000;
  2448                              <2> %ENDIF					;AN000;(of QusSW+CmpxSW)
  2449                              <2> ;PAGE					;AN000;
  2450                              <2> ;***********************************************************************
  2451                              <2> %IF	FileSW+DrvSW			;AN000;(Check if file spec or drive only is supported)
  2452                              <2> ; D_P_File_Format;
  2453                              <2> ;
  2454                              <2> ; Function:  Check if the input string is valid file spec format.
  2455                              <2> ;	     And set the result buffer.
  2456                              <2> ;
  2457                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  2458                              <2> ;	     ES:BX -> CONTROL block
  2459                              <2> ;
  2460                              <2> ; Output:    None
  2461                              <2> ;
  2462                              <2> ; Use:	D_P_Fill_Result, D_P_Chk_DBCS, D_P_FileSp_Chk
  2463                              <2> ;
  2464                              <2> ; Vars: D_P_RC(W), D_P_SI_Save(W), D_P_Terminator(W), D_P_SaveSI_Cmpx(R)
  2465                              <2> ;	D_P_SaveSI_Cmpx(R)
  2466                              <2> ;***********************************************************************
  2467                              <2> D_P_File_Format proc			;AN000;
  2468 00000766 50                  <2> 	push	ax			;AN000;
  2469 00000767 57                  <2> 	push	di			;AN000;
  2470 00000768 56                  <2> 	push	si			;AN000;
  2471                              <2> D_P_SaveSI_cmpx equ D_P_SaveSI_Cmpx	; NASM port label
  2472 00000769 2E8B3E[0F00]        <2> 	mov	di,[psdata_seg:D_P_SaveSI_cmpx] ;AC034; get user buffer address
  2473                              <2> D_P_FileF_Loop0: 			;AN000; / skip special characters
  2474 0000076E 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000; load character
  2475 00000771 08C0                <2> 	or	al,al			;AN000; end of line ?
  2476 00000773 7413                <2> 	je	D_P_FileF_Err		;AN000; if yes, error exit
  2477                              <2> 
  2478 00000775 E85F00              <2> 	call	D_P_FileSp_Chk		;AN000; else, check if file special character
  2479 00000778 7524                <2> 	jne	D_P_FileF03		;AN000; if yes,
  2480                              <2> 
  2481                              <2> ;AN033; deleted   inc	  di			  ;skip
  2482                              <2> ;AN033; deleted   inc	  si			  ;   the
  2483                              <2> ;AN033; deleted   jmp	  short D_P_FileF_Loop0	  ;	  character
  2484 0000077A 2EC606[AA00]01      <2> 	mov	byte [psdata_seg:D_P_err_flag],D_P_error_filespec ;AN033;AC034;; set error flag- bad char.
  2485 00000780 5E                  <2> 	pop	si			;AN033;
  2486 00000781 2EC60400            <2> 	mov	byte ptr [psdata_seg:si],D_P_NULL ;AN033;
  2487 00000785 5F                  <2> 	pop	di			;AN033;
  2488 00000786 EB3F                <2> 	jmp	short D_P_FileF02	;AN033;
  2489                              <2> 
  2490                              <2> 
  2491                              <2> D_P_FileF_Err:				;AN000;
  2492 00000788 5E                  <2> 	pop	si			;AN000;
  2493 00000789 2EC60400            <2> 	mov	byte ptr [psdata_seg:si],D_P_NULL ;AN000;
  2494                              <2> ;(deleted ;AN030;) mov di,D_P_SaveSI_cmpx ;AN000; get user buffer address
  2495                              <2> ;(deleted ;AN030;) mov D_P_SI_Save,di	 ;AN000; update pointer to user buffer
  2496 0000078D 5F                  <2> 	pop	di			;AN000;
  2497 0000078E 26F7070100          <2> 	test	word [es:bx + D_P_Match_Flag],D_P_Optional ;AN000; is it optional ?
  2498 00000793 7532                <2> 	jne	D_P_FileF02		;AN000;
  2499                              <2> 
  2500 00000795 2EC706[0200]0200    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Op_Missing ;AC034; 3/17/87
  2501 0000079C EB29                <2> 	jmp	short D_P_FileF02	;AN000;
  2502                              <2> 
  2503                              <2> D_P_FileF03:				;AN000;
  2504 0000079E 58                  <2> 	pop	ax			;AN000; discard save si
  2505 0000079F 56                  <2> 	push	si			;AN000; save new si
  2506                              <2> D_P_FileF_Loop1: 			;AN000;
  2507 000007A0 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000; load character (not special char)
  2508 000007A3 08C0                <2> 	or	al,al			;AN000; end of line ?
  2509 000007A5 741E                <2> 	je	D_P_FileF_RLT		;AN000;
  2510                              <2> 
  2511 000007A7 E82D00              <2> 	call	D_P_FileSp_Chk		;AN000; File special character ?
  2512 000007AA 740B                <2> 	je	D_P_FileF00		;AN000;
  2513                              <2> 
  2514 000007AC E85C01              <2> 	call	D_P_Chk_DBCS		;AN000; no, then DBCS ?
  2515 000007AF 7302                <2> 	jnc	D_P_FileF01		;AN000;
  2516 000007B1 47                  <2> 	inc	di			;AN000; if yes, skip next byte
  2517 000007B2 46                  <2> 	inc	si			;AN000;
  2518                              <2> D_P_FileF01:				;AN000;
  2519 000007B3 47                  <2> 	inc	di			;AN000;
  2520 000007B4 46                  <2> 	inc	si			;AN000;
  2521 000007B5 EBE9                <2> 	jmp	short D_P_FileF_Loop1	;AN000;
  2522                              <2> ;
  2523                              <2> D_P_FileF00:				;AN000;
  2524 000007B7 2EA2[0800]          <2> 	mov	[psdata_seg:D_P_Terminator],al ;AC034;
  2525 000007BB 2EC60400            <2> 	mov	byte ptr [psdata_seg:si],D_P_NULL ;AN000; update end of string
  2526 000007BF 47                  <2> 	inc	di			;AN000;
  2527 000007C0 2E893E[0400]        <2> 	mov	[psdata_seg:D_P_SI_Save],di ;AC034; update next pointer in command line
  2528                              <2> D_P_FileF_RLT:				;AN000;
  2529 000007C5 5E                  <2> 	pop	si			;AN000;
  2530 000007C6 5F                  <2> 	pop	di			;AN000;
  2531                              <2> D_P_FileF02:				;AN000;
  2532                              <2> 
  2533 000007C7 58                  <2> 	pop	ax			;AN000; (tm14)
  2534 000007C8 A90002              <2> 	test	ax,D_P_File_Spc		;AN000; (tm14)
  2535 000007CB 7409                <2> 	je	D_P_Drv_Only_Exit	;AN000; (tm14)
  2536                              <2> 
  2537 000007CD 50                  <2> 	push	ax			;AN000;  (tm14)
  2538                              <2> 
  2539 000007CE B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000; set
  2540 000007D0 B005                <2> 	mov	al,D_P_File_Spec 	;AN000;    result
  2541 000007D2 E8F7FA              <2> 	call	D_P_Fill_Result		;AN000; 	 buffer to file spec
  2542 000007D5 58                  <2> 	pop	ax			;AN000;
  2543                              <2> 
  2544                              <2> D_P_Drv_Only_Exit:			;AN000; (tm14)
  2545                              <2> 
  2546 000007D6 C3                  <2> 	ret				;AN000;
  2547                              <2> D_P_File_Format endp			;AN000;
  2548                              <2> ;PAGE					;AN000;
  2549                              <2> ;***********************************************************************
  2550                              <2> ; D_P_FileSp_Chk
  2551                              <2> ;
  2552                              <2> ; Function:  Check if the input byte is one of file special characters
  2553                              <2> ;
  2554                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  2555                              <2> ;	     AL = character code to be examineed
  2556                              <2> ;
  2557                              <2> ; Output:    ZF = 1 , AL is one of special characters
  2558                              <2> ;***********************************************************************
  2559                              <2> D_P_FileSp_Chk proc			;AN000;
  2560 000007D7 53                  <2> 	push	bx			;AN000;
  2561 000007D8 51                  <2> 	push	cx			;AN000;
  2562 000007D9 8D1E[A100]          <2> 	lea	bx,[D_P_FileSp_Char] ;AC034; special character table
  2563 000007DD B90900              <2> 	mov	cx,D_P_FileSp_Len	;AN000; load length of it
  2564                              <2> D_P_FileSp_Loop: 			;AN000;
  2565 000007E0 2E3A07              <2> 	cmp	al,[psdata_seg:bx]	;AN000; is it one of special character ?
  2566 000007E3 7404                <2> 	je	D_P_FileSp_Exit		;AN000;
  2567                              <2> 
  2568 000007E5 43                  <2> 	inc	bx			;AN000;
  2569 000007E6 E2F8                <2> 	loop	D_P_FileSp_Loop		;AN000;
  2570                              <2> 
  2571 000007E8 41                  <2> 	inc	cx			;AN000; reset ZF
  2572                              <2> D_P_FileSp_Exit: 			;AN000;
  2573 000007E9 59                  <2> 	pop	cx			;AN000;
  2574 000007EA 5B                  <2> 	pop	bx			;AN000;
  2575 000007EB C3                  <2> 	ret				;AN000;
  2576                              <2> D_P_FileSp_Chk endp			;AN000;
  2577                              <2> %ENDIF					;AN000;(of FileSW+DrvSW)
  2578                              <2> ;PAGE					;AN000;
  2579                              <2> ;***********************************************************************
  2580                              <2> %IF	DrvSW				;AN000;(Check if drive only is supported)
  2581                              <2> ; D_P_Drive_Format;
  2582                              <2> ;
  2583                              <2> ; Function:  Check if the input string is valid drive only format.
  2584                              <2> ;	     And set the result buffer.
  2585                              <2> ;
  2586                              <2> ; Input:     psdata_seg:SI -> D_P_STRING_BUF
  2587                              <2> ;	     ES:BX -> CONTROL block
  2588                              <2> ;
  2589                              <2> ; Output:    None
  2590                              <2> ;
  2591                              <2> ; Use:	D_P_Fill_Result, D_P_Chk_DBCS
  2592                              <2> ;
  2593                              <2> ; Vars: D_P_RC(W)
  2594                              <2> ;***********************************************************************
  2595                              <2> D_P_Drive_Format proc			;AN000;
  2596 000007EC 50                  <2> 	push	ax			;AN000;
  2597 000007ED 52                  <2> 	push	dx			;AN000;
  2598 000007EE 2E8A04              <2> 	mov	al,[psdata_seg:si]	;AN000;
  2599 000007F1 08C0                <2> 	or	al,al			;AN000; if null string
  2600 000007F3 7438                <2> 	je	D_P_Drv_Exit		;AN000; do nothing
  2601                              <2> 
  2602 000007F5 E81301              <2> 	call	D_P_Chk_DBCS		;AN000; is it leading byte ?
  2603 000007F8 722C                <2> 	jc	D_P_Drv_Err		;AN000;
  2604                              <2> 
  2605 000007FA 2E837C013A          <2> 	cmp	word ptr [psdata_seg:si+1],D_P_Colon ;AN000; "d", ":", 0  ?
  2606 000007FF 740E                <2> 	je	D_P_DrvF00		;AN000;
  2607                              <2> 
  2608 00000801 26F7071000          <2> 	test	word [es:bx + D_P_Match_Flag],D_P_Ig_Colon ;AN000; colon can be ignored?
  2609 00000806 741E                <2> 	je	D_P_Drv_Err		;AN000;
  2610                              <2> 
  2611 00000808 2E807C0100          <2> 	cmp	byte ptr [psdata_seg:si+1],D_P_NULL ;AN000; "d", 0  ?
  2612 0000080D 7517                <2> 	jne	D_P_Drv_Err		;AN000;
  2613                              <2> 
  2614                              <2> D_P_DrvF00:				;AN000;
  2615 0000080F 0C20                <2> 	or	al,D_P_Make_Lower	;AN000; lower case
  2616 00000811 3C61                <2> 	cmp	al,"a"                  ;AN000; drive letter must
  2617 00000813 7211                <2> 	jb	D_P_Drv_Err		;AN000; in range of
  2618                              <2> 
  2619 00000815 3C7A                <2> 	cmp	al,"z"                  ;AN000; "a" - "z"
  2620 00000817 770D                <2> 	ja	D_P_Drv_Err		;AN000; if no, error
  2621                              <2> 
  2622 00000819 2C60                <2> 	sub	al,"a"-1                ;AN000; make text drive to binary drive
  2623 0000081B 88C2                <2> 	mov	dl,al			;AN000; set
  2624 0000081D B4FF                <2> 	mov	ah,D_P_No_Tag		;AN000;    result
  2625 0000081F B006                <2> 	mov	al,D_P_Drive		;AN000; 	 buffer
  2626 00000821 E8A8FA              <2> 	call	D_P_Fill_Result		;AN000; 	       to drive
  2627 00000824 EB07                <2> 	jmp	short D_P_Drv_Exit	;AN000;
  2628                              <2> 
  2629                              <2> D_P_Drv_Err:				;AN000;
  2630 00000826 2EC706[0200]0900    <2> 	mov	word [psdata_seg:D_P_RC],D_P_Syntax ;AC034;
  2631                              <2> D_P_Drv_Exit:				;AN000;
  2632 0000082D 5A                  <2> 	pop	dx			;AN000;
  2633 0000082E 58                  <2> 	pop	ax			;AN000;
  2634 0000082F C3                  <2> 	ret				;AN000;
  2635                              <2> D_P_Drive_Format endp			;AN000;
  2636                              <2> %ENDIF					;AN000;(of DrvSW)
  2637                              <2> ;PAGE					;AN000;
  2638                              <2> ;***********************************************************************
  2639                              <2> ; D_P_Skip_Delim;
  2640                              <2> ;
  2641                              <2> ; Function: Skip delimiters specified in the PARMS list, white space
  2642                              <2> ;	    and comma.
  2643                              <2> ;
  2644                              <2> ; Input:    DS:SI -> Command String
  2645                              <2> ;	    ES:DI -> Parameter List
  2646                              <2> ;
  2647                              <2> ; Output:   CY = 1 if the end of line encounterd
  2648                              <2> ;	    CY = 0 then SI move to 1st non-delimiter character
  2649                              <2> ;	    AL = Last examineed character
  2650                              <2> ;
  2651                              <2> ; Use:	    D_P_Chk_EOL, D_P_Chk_Delim,
  2652                              <2> ;
  2653                              <2> ; Vars:     D_P_Flags(R)
  2654                              <2> ;***********************************************************************
  2655                              <2> D_P_Skip_Delim proc			;AN000;
  2656                              <2> D_P_Skip_Delim_Loop:			;AN000;
  2657 00000830 AC                  <2> 	LODSB				;AN000;
  2658 00000831 E82200              <2> 	call	D_P_Chk_EOL		;AN000; is it EOL character ?
  2659 00000834 7418                <2> 	je	D_P_Skip_Delim_CY	;AN000; if yes, exit w/ CY on
  2660                              <2> 
  2661 00000836 E85300              <2> 	call	D_P_Chk_Delim		;AN000; is it one of delimiters ?
  2662 00000839 7516                <2> 	jne	D_P_Skip_Delim_NCY	;AN000; if no, exit w/ CY off
  2663                              <2> 
  2664 0000083B 2EF606[0E00]20      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Extra ;AC034; extra delim or comma found ?
  2665 00000841 74ED                <2> 	je	D_P_Skip_Delim_Loop	;AN000; if no, loop
  2666                              <2> 
  2667 00000843 2EF606[0E00]41      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_SW+D_P_equ ;AC034; /x , or xxx=zzz , (tm08)
  2668 00000849 7409                <2> 	je	short D_P_Exit_At_Extra	;AN000; no switch, no keyword (tm08)
  2669                              <2> 
  2670 0000084B 4E                  <2> 	dec	si			;AN000; backup si for next call (tm08)
  2671 0000084C EB06                <2> 	jmp	short D_P_Exit_At_Extra	;AN000; else exit w/ CY off
  2672                              <2> 
  2673                              <2> D_P_Skip_Delim_CY:			;AN000;
  2674 0000084E F9                  <2> 	stc				;AN000; indicate EOL
  2675 0000084F EB01                <2> 	jmp	short D_P_Skip_Delim_Exit ;AN000;
  2676                              <2> 
  2677                              <2> D_P_Skip_Delim_NCY:			;AN000;
  2678 00000851 F8                  <2> 	clc				;AN000; indicate non delim
  2679                              <2> D_P_Skip_Delim_Exit:			;AN000; in this case, need
  2680 00000852 4E                  <2> 	dec	si			;AN000;  backup index pointer
  2681 00000853 C3                  <2> 	ret				;AN000;
  2682                              <2> 
  2683                              <2> D_P_Exit_At_Extra:			;AN000;
  2684 00000854 F8                  <2> 	clc				;AN000; indicate extra delim
  2685 00000855 C3                  <2> 	ret				;AN000;
  2686                              <2> D_P_Skip_Delim endp			;AN000;
  2687                              <2> ;PAGE					;AN000;
  2688                              <2> ;***********************************************************************
  2689                              <2> ; D_P_Chk_EOL;
  2690                              <2> ;
  2691                              <2> ; Function: Check if AL is one of End of Line characters.
  2692                              <2> ;
  2693                              <2> ; Input:    AL = character code
  2694                              <2> ;	    ES:DI -> Parameter List
  2695                              <2> ;
  2696                              <2> ; Output:   ZF = 1 if one of End of Line characters
  2697                              <2> ;**********************************************************************
  2698                              <2> D_P_Chk_EOL proc 			;AN000;
  2699 00000856 53                  <2> 	push	bx			;AN000;
  2700 00000857 51                  <2> 	push	cx			;AN000;
  2701 00000858 3C0D                <2> 	cmp	al,D_P_CR		;AN000; Carriage return ?
  2702 0000085A 742D                <2> 	je	D_P_Chk_EOL_Exit 	;AN000;
  2703                              <2> 
  2704 0000085C 3C00                <2> 	cmp	al,D_P_NULL		;AN000; zero ?
  2705 0000085E 7429                <2> 	je	D_P_Chk_EOL_Exit 	;AN000;
  2706                              <2> 
  2707                              <2> %IF LFEOLSW				;AN028; IF LF TO BE ACCEPTED AS EOL
  2708 00000860 3C0A                <2> 	cmp	al,D_P_LF		;AN000; Line feed ?
  2709 00000862 7425                <2> 	je	D_P_Chk_EOL_Exit 	;AN000;
  2710                              <2> %ENDIF					;AN028;
  2711                              <2> 
  2712 00000864 26807D0202          <2> 	cmp	byte ptr [es:di + D_P_Num_Extra],D_P_I_Have_EOL ;AN000; EOL character specified ?
  2713 00000869 721E                <2> 	jb	D_P_Chk_EOL_Exit 	;AN000;
  2714                              <2> 
  2715 0000086B 31DB                <2> 	xor	bx,bx			;AN000;
  2716 0000086D 268A5D03            <2> 	mov	bl,[es:di + D_P_Len_Extra_Delim] ;AN000; get length of delimiter list
  2717 00000871 83C304              <2> 	add	bx,D_P_Len_PARMS 	;AN000; skip it
  2718 00000874 26803900            <2> 	cmp	byte ptr [es:bx+di],D_P_I_Use_Default ;AN000; No extra EOL character ?
  2719 00000878 740D                <2> 	je	D_P_Chk_EOL_NZ		;AN000;
  2720                              <2> 
  2721 0000087A 31C9                <2> 	xor	cx,cx			;AN000; Get number of extra chcracter
  2722 0000087C 268A09              <2> 	mov	cl,[es:bx+di]		;AN000;
  2723                              <2> D_P_Chk_EOL_Loop:			;AN000;
  2724 0000087F 43                  <2> 	inc	bx			;AN000;
  2725 00000880 263A01              <2> 	cmp	al,[es:bx+di]		;AN000; Check extra EOL character
  2726 00000883 7404                <2> 	je	D_P_Chk_EOL_Exit 	;AN000;
  2727                              <2> 
  2728 00000885 E2F8                <2> 	loop	D_P_Chk_EOL_Loop 	;AN000;
  2729                              <2> 
  2730                              <2> D_P_Chk_EOL_NZ:				;AN000;
  2731 00000887 3C0D                <2> 	cmp	al,D_P_CR		;AN000; reset ZF
  2732                              <2> D_P_Chk_EOL_Exit:			;AN000;
  2733 00000889 59                  <2> 	pop	cx			;AN000;
  2734 0000088A 5B                  <2> 	pop	bx			;AN000;
  2735 0000088B C3                  <2> 	ret				;AN000;
  2736                              <2> D_P_Chk_EOL endp 			;AN000;
  2737                              <2> ;PAGE					;AN000;
  2738                              <2> ;***********************************************************************
  2739                              <2> ; D_P_Chk_Delim;
  2740                              <2> ;
  2741                              <2> ; Function: Check if AL is one of delimiter characters.
  2742                              <2> ;	    if AL+[si] is DBCS blank, it is replaced with two SBCS
  2743                              <2> ;	    blanks.
  2744                              <2> ;
  2745                              <2> ; Input:    AL = character code
  2746                              <2> ;	    DS:SI -> Next Character
  2747                              <2> ;	    ES:DI -> Parameter List
  2748                              <2> ;
  2749                              <2> ; Output:   ZF = 1 if one of delimiter characters
  2750                              <2> ;	    SI points to the next character
  2751                              <2> ; Vars:  D_P_Terminator(W), D_P_Flags(W)
  2752                              <2> ;***********************************************************************
  2753                              <2> D_P_Chk_Delim proc			;AN000;
  2754 0000088C 53                  <2> 	push	bx			;AN000;
  2755 0000088D 51                  <2> 	push	cx			;AN000;
  2756 0000088E 2EC606[0800]20      <2> 	mov	byte [psdata_seg:D_P_Terminator],D_P_Space   ;AC034; Assume terminated by space
  2757 00000894 2E8026[0E00]DF      <2> 	and	byte [psdata_seg:D_P_Flags2],0ffh-D_P_Extra ;AC034;
  2758 0000089A 3C20                <2> 	cmp	al,D_P_Space		;AN000; Space ?
  2759 0000089C 7436                <2> 	je	D_P_Chk_Delim_Exit	;AN000;
  2760                              <2> 
  2761 0000089E 3C09                <2> 	cmp	al,D_P_TAB		;AN000; TAB ?
  2762 000008A0 7432                <2> 	je	D_P_Chk_Delim_Exit	;AN000;
  2763                              <2> 
  2764 000008A2 3C2C                <2> 	cmp	al,D_P_Comma		;AN000; Comma ?
  2765 000008A4 7431                <2> 	je	D_P_Chk_Delim_Exit0	;AN000;
  2766                              <2> 
  2767                              <2> D_P_Chk_Delim00: 			;AN000;
  2768 000008A6 3C81                <2> 	cmp	al,D_P_DBSP1		;AN000; 1st byte of DBCS Space ?
  2769 000008A8 750C                <2> 	jne	D_P_Chk_Delim01		;AN000;
  2770                              <2> 
  2771 000008AA 803C40              <2> 	cmp	byte ptr [si],D_P_DBSP2	;AN000; 2nd byte of DBCS Space ?
  2772 000008AD 7507                <2> 	jne	D_P_Chk_Delim01		;AN000;
  2773                              <2> 
  2774 000008AF B020                <2> 	mov	al,D_P_Space		;AN000;
  2775 000008B1 46                  <2> 	inc	si			;AN000; make si point to next character
  2776 000008B2 38C0                <2> 	cmp	al,al			;AN000; Set ZF
  2777 000008B4 EB1E                <2> 	jmp	short D_P_Chk_Delim_Exit ;AN000;
  2778                              <2> 
  2779                              <2> D_P_Chk_Delim01: 			;AN000;
  2780 000008B6 26807D0201          <2> 	cmp	byte ptr [es:di + D_P_Num_Extra],D_P_I_Have_Delim ;AN000; delimiter character specified ?
  2781 000008BB 7217                <2> 	jb	D_P_Chk_Delim_Exit	;AN000;
  2782                              <2> 
  2783 000008BD 31C9                <2> 	xor	cx,cx			;AN000;
  2784 000008BF 268A4D03            <2> 	mov	cl,[es:di + D_P_Len_Extra_Delim] ;AN000; get length of delimiter list
  2785 000008C3 09C9                <2> 	or	cx,cx			;AN000; No extra Delim character ?
  2786 000008C5 740B                <2> 	je	D_P_Chk_Delim_NZ 	;AN000;
  2787                              <2> 
  2788 000008C7 BB0300              <2> 	mov	bx,D_P_Len_PARMS-1	;AN000; set bx to 1st extra delimiter
  2789                              <2> D_P_Chk_Delim_Loop:			;AN000;
  2790 000008CA 43                  <2> 	inc	bx			;AN000;
  2791 000008CB 263A01              <2> 	cmp	al,[es:bx+di]		;AN000; Check extra Delim character
  2792 000008CE 7407                <2> 	je	D_P_Chk_Delim_Exit0	;AN000;
  2793                              <2> 
  2794 000008D0 E2F8                <2> 	loop	D_P_Chk_Delim_Loop	;AN000; examine all extra delimiter
  2795                              <2> 
  2796                              <2> D_P_Chk_Delim_NZ:			;AN000;
  2797 000008D2 3C20                <2> 	cmp	al,D_P_Space		;AN000; reset ZF
  2798                              <2> D_P_Chk_Delim_Exit:			;AN000;
  2799                              <2> ;;;;	jne	D_P_ChkDfin
  2800                              <2> ;;;;	mov	psdata_seg:D_P_Terminator,al ;AN034;
  2801                              <2> D_P_ChkDfin:				;AN000;
  2802 000008D4 59                  <2> 	pop	cx			;AN000;
  2803 000008D5 5B                  <2> 	pop	bx			;AN000;
  2804 000008D6 C3                  <2> 	ret				;AN000;
  2805                              <2> 
  2806                              <2> D_P_Chk_Delim_Exit0:			;AN000;
  2807 000008D7 2EA2[0800]          <2> 	mov	[psdata_seg:D_P_Terminator],al ;AC034; keep terminated delimiter
  2808                              <2> D_P_Equ equ D_P_equ	; NASM port equate
  2809 000008DB 2EF606[0E00]01      <2> 	test	byte [psdata_seg:D_P_Flags2],D_P_Equ  ;AN027;AC034;; if terminating a key=
  2810 000008E1 7506                <2> 	jnz	D_P_No_Set_Extra 	;AN027; then do not set the EXTRA bit
  2811                              <2> 
  2812 000008E3 2E800E[0E00]20      <2> 	or	byte [psdata_seg:D_P_Flags2],D_P_Extra ;AC034; flag terminated extra delimiter or comma
  2813                              <2> D_P_No_Set_Extra:			;AN027;
  2814 000008E9 38C0                <2> 	cmp	al,al			;AN000; set ZF
  2815 000008EB EBE7                <2> 	jmp	short D_P_Chk_Delim_Exit ;AN000;
  2816                              <2> 
  2817                              <2> D_P_Chk_Delim endp			;AN000;
  2818                              <2> ;PAGE					;AN000;
  2819                              <2> ;***********************************************************************
  2820                              <2> ; D_P_Chk_Switch;
  2821                              <2> ;
  2822                              <2> ; Function: Check if AL is the switch character not in first position of
  2823                              <2> ;	    D_P_STRING_BUF
  2824                              <2> ;
  2825                              <2> ; Input:    AL = character code
  2826                              <2> ;	    BX = current pointer within D_P_String_Buf
  2827                              <2> ;	    SI =>next char on command line (following the one in AL)
  2828                              <2> ;
  2829                              <2> ; Output:   CF = 1 (set)if AL is switch character, and not in first
  2830                              <2> ;		 position, and has no chance of being part of a date string,
  2831                              <2> ;		 i.e. should be treated as a delimiter.
  2832                              <2> 
  2833                              <2> ;	    CF = 0 (reset, cleared) if AL is not a switch char, is in the first
  2834                              <2> ;		 position, or is a slash but may be part of a date string, i.e.
  2835                              <2> ;		 should not be treated as a delimiter.
  2836                              <2> ;
  2837                              <2> ; Vars:  D_P_Terminator(W)
  2838                              <2> 
  2839                              <2> ; Use:	 D_P_0099
  2840                              <2> ;***********************************************************************
  2841                              <2> D_P_Chk_Switch proc			;AN000;
  2842                              <2> 
  2843                              <2> ;AN020;; Function: Check if AL is the switch character from 2nd position of D_P_STRING_BUF
  2844                              <2> ;AN020;; Output:   ZF = 1 if switch character
  2845                              <2> ;AN020;;	lea	bp,D_P_STRING_BUF ;AN000;
  2846                              <2> ;AN020;;	cmp	bx,bp		 ;AN000; 1st position ?
  2847                              <2> ;AN020;;	je	D_P_Chk_S_Exit_1  ;AN000;
  2848                              <2> ;AN020;;	cmp	al,D_P_Switch	 ;AN000;
  2849                              <2> ;AN020;;	jmp	short D_P_Chk_S_Exit_0  ;AN000;
  2850                              <2> ;AN020;;D_P_Chk_S_Exit_1:		       ;AN000;
  2851                              <2> ;AN020;;	cmp	al,D_P_Switch	 ;AN000; (tm08)
  2852                              <2> ;AN020;;	jne	D_P_Nop		;AN000; (tm08)
  2853                              <2> ;AN020;;	or	D_P_Flags2,D_P_SW  ;AN000; (tm08) It could be valid switch
  2854                              <2> ;AN020;;D_P_Nop: 			;AN000; (tm08)
  2855                              <2> ;AN020;;	inc	bp		       ;AN000;
  2856                              <2> ;AN020;;	cmp	bx,bp		       ;AN000; reset ZF
  2857                              <2> ;AN020;;D_P_Chk_S_Exit_0:		       ;AN000;
  2858                              <2> ;AN020;;	jne	D_P_Chk_S_Exit	       ;AN000;
  2859                              <2> ;AN020;;	mov	   D_P_Terminator,al    ;AN000; store switch character
  2860                              <2> ;AN020;;D_P_Chk_S_Exit:			       ;AN000;
  2861                              <2> 
  2862                              <2> D_P_String_Buf equ D_P_STRING_BUF	; NASM port label
  2863 000008ED 8D2E[1700]          <2> 	LEA	BP,[D_P_String_Buf] ;AN020;AC034; BP=OFFSET of D_P_String_Buf even in group addressing
  2864                              <2> ;	.IF <BX NE BP> THEN		;AN020;IF not first char THEN
  2865 000008F1 39EB                <2> 	cmp	BX,BP			;AN000;
  2866 000008F3 740A                <2> 	je	D_P_STRUC_L2		;AN000;
  2867                              <2> 
  2868                              <2> ;	    .IF <AL EQ D_P_Switch> THEN	;AN020;otherwise see if a slash
  2869 000008F5 3C2F                <2> 	    cmp     AL,D_P_Switch	;AN000;
  2870 000008F7 7503                <2> 	    jne     D_P_STRUC_L5 	;AN000;
  2871                              <2> 
  2872 000008F9 F9                  <2> 		STC			;AN020;not in first position and is slash, now see if might be in date string
  2873                              <2> %IF	DateSw				;AN020;caller looking for date, see if this may be part of one
  2874                              <2> 		PUSH	AX		;AN020;save input char
  2875                              <2> 		MOV	AL,[PSDATA_SEG:BX-1] ;AN026;AL=char before the current char
  2876                              <2> 		CALL	D_P_0099 	;AN020;return carry set if not numeric
  2877                              <2> ;		.IF   NC ;AND		;AN020;IF previous char numeric AND
  2878                              <2> 		jc	D_P_STRUC_L7	;AN000;
  2879                              <2> 
  2880                              <2> 		    MOV     AL,[SI]	;AN020;AL=char after the current char
  2881                              <2> 		    CALL    D_P_0099	;AN020;return carry set if not numeric
  2882                              <2> ;(deleted)	    .IF     NC THEN	;AN020;IF next char numeric THEN could be a date
  2883                              <2> ;(deleted)		CLC		;AN020;reset CF so "/" not treated as a delimiter
  2884                              <2> ;(deleted)	    .ENDIF		;AN026;
  2885                              <2> ;		.ENDIF			;AN020;ENDIF looks like date (number/number)
  2886                              <2> D_P_STRUC_L7:				;AN000;
  2887                              <2> 		POP	AX		;AN020;restore AL to input char
  2888                              <2> %ENDIF					;AN020;DateSw
  2889                              <2> ;	    .ELSE			;AN020;
  2890 000008FA EB0E                <2> 	    jmp     short D_P_STRUC_L1	;AN000;
  2891                              <2> 
  2892                              <2> D_P_STRUC_L5:				;AN000;
  2893 000008FC F8                  <2> 		CLC			;AN020;not a slash
  2894                              <2> ;	    .ENDIF			;AN020;
  2895                              <2> ;	.ELSE				;AN020;is first char in the buffer, ZF=0
  2896 000008FD EB0B                <2> 	jmp	short D_P_STRUC_L1	;AN000;
  2897                              <2> 
  2898                              <2> D_P_STRUC_L2:				;AN000;
  2899                              <2> ;	    .IF <AL EQ D_P_Switch> THEN	;AN020;
  2900 000008FF 3C2F                <2> 	    cmp     AL,D_P_Switch	;AN000;
  2901 00000901 7506                <2> 	    jne     D_P_STRUC_L12	;AN000;
  2902                              <2> 
  2903 00000903 2E800E[0E00]40      <2> 		OR	byte [psdata_seg:D_P_Flags2],D_P_SW ;AN020;AC034;;could be valid switch, first char and is slash
  2904                              <2> ;	    .ENDIF			;AN020;
  2905                              <2> D_P_STRUC_L12:				;AN000;
  2906 00000909 F8                  <2> 	    CLC 			;AN020;CF=0 indicating first char
  2907                              <2> ;	.ENDIF				;AN020;
  2908                              <2> D_P_STRUC_L1:				;AN000;
  2909                              <2> 
  2910 0000090A C3                  <2> 	ret				;AN000;
  2911                              <2> D_P_Chk_Switch endp			;AN000;
  2912                              <2> ;	PAGE				;AN000;
  2913                              <2> ;**************************************************************************
  2914                              <2> ; D_P_Chk_DBCS:
  2915                              <2> ;
  2916                              <2> ;  Function: Check if a specified byte is in ranges of the DBCS lead bytes
  2917                              <2> ;
  2918                              <2> ;  Input:
  2919                              <2> ;	  AL	= Code to be examineed
  2920                              <2> ;
  2921                              <2> ;  Output:
  2922                              <2> ;	  If CF is on then a lead byte of DBCS
  2923                              <2> ;
  2924                              <2> ; Use: INT 21h w/AH=63
  2925                              <2> ;
  2926                              <2> ; Vars:  D_P_DBCSEV_Seg(RW), D_P_DBCSEV_Off(RW)
  2927                              <2> ;***************************************************************************
  2928                              <2> D_P_Chk_DBCS PROC			;AN000;
  2929                              <2> ;
  2930 0000090B 1E                  <2> 	PUSH	DS			;AN000;
  2931 0000090C 56                  <2> 	PUSH	SI			;AN000;
  2932 0000090D 53                  <2> 	PUSH	bx			;AN000; (tm11)
  2933 0000090E 2E833E[0B00]00      <2> 	CMP	word [psdata_seg:D_P_DBCSEV_SEG],0 ;AC034; ALREADY SET ?
  2934 00000914 7527                <2> 	JNE	D_P_DBCS00		;AN000;
  2935                              <2> 
  2936 00000916 50                  <2> 	PUSH	AX			;AN000;
  2937                              <2> ;	PUSH	BX			;AN000; (tm11)
  2938 00000917 1E                  <2> 	PUSH	ds			;AN000; (tm11)
  2939 00000918 51                  <2> 	PUSH	CX			;AN000;
  2940 00000919 52                  <2> 	PUSH	DX			;AN000;
  2941 0000091A 57                  <2> 	PUSH	DI			;AN000;
  2942 0000091B 55                  <2> 	PUSH	BP			;AN000;
  2943 0000091C 06                  <2> 	PUSH	ES			;AN000;
  2944 0000091D 31F6                <2> 	XOR	SI,SI			;AN000;
  2945 0000091F 8EDE                <2> 	MOV	DS,SI			;AN000;
  2946 00000921 B80063              <2> 	MOV	AX,D_P_DOS_GetEV 	;AN000; GET DBCS EV CALL
  2947 00000924 CD21                <2> 	INT	21H			;AN000;
  2948                              <2> 
  2949                              <2> ;	MOV	AX,DS			;AN000; (tm11)
  2950                              <2> ;	OR	AX,AX			;AN000; (tm11)
  2951 00000926 8CDB                <2> 	MOV	bx,DS			;AN000; (tm11)
  2952 00000928 09DB                <2> 	OR	bx,bx			;AN000; (tm11)
  2953 0000092A 07                  <2> 	POP	ES			;AN000;
  2954 0000092B 5D                  <2> 	POP	BP			;AN000;
  2955 0000092C 5F                  <2> 	POP	DI			;AN000;
  2956 0000092D 5A                  <2> 	POP	DX			;AN000;
  2957 0000092E 59                  <2> 	POP	CX			;AN000;
  2958                              <2> ;	POP	BX			;AN000; (tm11)
  2959 0000092F 1F                  <2> 	POP	ds			;AN000; (tm11)
  2960 00000930 58                  <2> 	POP	AX			;AN000;
  2961 00000931 7429                <2> 	JE	D_P_NON_DBCS		;AN000;
  2962                              <2> 
  2963                              <2> D_P_DBCS02:				;AN000;
  2964 00000933 2E8936[0900]        <2> 	MOV	[psdata_seg:D_P_DBCSEV_OFF],SI ;AC034; save EV offset
  2965                              <2> ;	MOV	psdata_seg:D_P_DBCSEV_SEG,DS ;AC034; save EV segment
  2966 00000938 2E891E[0B00]        <2> 	MOV	[psdata_seg:D_P_DBCSEV_SEG],bx ;AC034; save EV segment (tm11)
  2967                              <2> D_P_DBCS00:				;AN000;
  2968 0000093D 2E8B36[0900]        <2> 	MOV	SI,[psdata_seg:D_P_DBCSEV_OFF] ;AC034; load EV offset
  2969 00000942 2E8E1E[0B00]        <2> 	MOV	DS,[psdata_seg:D_P_DBCSEV_SEG] ;AC034; and segment
  2970                              <2> 
  2971                              <2> D_P_DBCS_LOOP:				;AN000;
  2972 00000947 833C00              <2> 	CMP	WORD PTR [SI],0 	;AN000; zero vector ?
  2973 0000094A 7410                <2> 	JE	D_P_NON_DBCS		;AN000; then exit
  2974                              <2> 
  2975 0000094C 3A04                <2> 	CMP	AL,[SI] 		;AN000;
  2976 0000094E 7208                <2> 	JB	D_P_DBCS01		;AN000; Check if AL is in
  2977                              <2> 
  2978 00000950 3A4401              <2> 	CMP	AL,[SI+1]		;AN000;   range of
  2979 00000953 7703                <2> 	JA	D_P_DBCS01		;AN000;      the vector
  2980                              <2> 
  2981 00000955 F9                  <2> 	STC				;AN000; if yes, indicate DBCS and exit
  2982 00000956 EB05                <2> 	JMP	short D_P_DBCS_EXIT	;AN000;
  2983                              <2> 
  2984                              <2> D_P_DBCS01:				;AN000;
  2985 00000958 46                  <2> 	INC	SI			;AC035; add '2' to
  2986 00000959 46                  <2> 	INC	SI			;AC035;  SI reg
  2987                              <2> 					;AN000; get next vector
  2988                              <2> ;(changed ;AC035;) ADD	   SI,2 	;AN000; get next vector
  2989 0000095A EBEB                <2> 	JMP	short D_P_DBCS_LOOP	;AN000; loop until zero vector found
  2990                              <2> 
  2991                              <2> D_P_NON_DBCS:				;AN000;
  2992 0000095C F8                  <2> 	CLC				;AN000; indicate SBCS
  2993                              <2> D_P_DBCS_EXIT:				;AN000;
  2994 0000095D 5B                  <2> 	POP	bx			;AN000; (tm11)
  2995 0000095E 5E                  <2> 	POP	SI			;AN000;
  2996 0000095F 1F                  <2> 	POP	DS			;AN000;
  2997 00000960 C3                  <2> 	RET				;AN000;
  2998                              <2> D_P_Chk_DBCS ENDP			;AN000;
   535                              <1> ;=== Pop trace listing source
   536                              <1> 
   537                              <1> 
   538                              <1> ; (no prior section) ; code	ends
    88                                  %include "forswtch.mac"
     1                              <1> ;FORMAT Pre-defined switches
     2                              <1>  SWITCH_S EQU		0001h			   ; System transfer
     3                              <1>  SWITCH_V EQU		0002h			   ; Volume ID prompt
     4                              <1>  SWITCH_BACKUP EQU	0004h
     5                              <1>  SWITCH_C EQU		0008h
     6                              <1>  SWITCH_T EQU		0010h
     7                              <1>  SWITCH_N EQU		0020h
     8                              <1>  SWITCH_1 EQU		0040h
     9                              <1>  SWITCH_4 EQU		0080h
    10                              <1>  SWITCH_8 EQU		0100h
    11                              <1>  SWITCH_B EQU		0200h
    12                              <1>  SWITCH_SELECT	EQU	0400h
    13                              <1>  SWITCH_AUTOTEST EQU	0800h
    14                              <1>  SWITCH_F	EQU	1000h
    15                              <1>  SWITCH_FS	EQU	2000h
    16                              <1> 
    17                              <1> %IF ShipDisk
    18                              <1> 
    19                              <1>  SWITCH_Z	EQU	4000h							;an000; dms;1 sector/cluster switch
    20                              <1> 
    21                              <1> %ENDIF
    22                              <1> 
    23                              <1> ;
    24                              <1> ; The following is a list of equates to define each IBM defined diskette size
    25                              <1> ; for use with the /F switch
    26                              <1> 
    27                              <1> 
    28                              <1> Size_160	equ	0001h			;Flag settings for size switch	;AN000;
    29                              <1> Size_180	equ	0002h			;				;AN000;
    30                              <1> Size_320	equ	0004h			;				;AN000;
    31                              <1> Size_360	equ	0008h			;				;AN000;
    32                              <1> Size_720	equ	0010h			;				;AN000;
    33                              <1> Size_1200	equ	0020h			;				;AN000;
    34                              <1> Size_1440	equ	0040h			;				;AN000;
    35                              <1> 
    36                              <1> 
    37                              <1> 
    89                                  [list +]
    90                                  
    91                                  ;
    92                                  ;*****************************************************************************
    93                                  ; Public Data
    94                                  ;*****************************************************************************
    95                                  ;
    96                                  
    97                                  	Public	FS_String_Buffer
    98                                  	Public	Command_Line
    99                                  	Public	Fatal_Error
   100                                  	Public	Vol_Label_Count
   101                                  	Public	Vol_Label_Buffer
   102                                  	Public	PSP_Segment
   103                                  	Public	Command_Old_Ptr
   104                                  
   105                                  
   106                                  ;
   107                                  ;*****************************************************************************
   108                                  ; Public Routines
   109                                  ;*****************************************************************************
   110                                  ;
   111                                  
   112                                  
   113                                  	Public	Main_Init
   114                                  
   115                                  ;
   116                                  ;*****************************************************************************
   117                                  ; External Routine Declarations
   118                                  ;*****************************************************************************
   119                                  ;
   120                                  
   121                                  	Extrn	Main_Routine:Near
   122                                  	Extrn	SysLoadMsg:Near
   123                                  	Extrn	Get_11_Characters:Near
   124                                  	Extrn	ControlC_Handler:Near
   125                                  	Extrn	SysDispMsg:Near
   126                                  	Extrn	SysLoadMsg:Near
   127                                  
   128                                  %IF FSExec					;/FS: conditional assembly	;an018; dms;
   129                                  
   130                                  	Extrn	EXEC_FS_Format:Near
   131                                  
   132                                  %ENDIF						;/FS: conditional assembly end	;an018;dms;
   133                                  
   134                                  	Extrn	GetDeviceParameters:Near
   135                                  ;
   136                                  ;*****************************************************************************
   137                                  ; External Data Declarations
   138                                  ;*****************************************************************************
   139                                  ;
   140                                  
   141                                  	Extrn	SwitchMap:Word
   142                                  	Extrn	ExitStatus:Byte
   143                                  	Extrn	Drive:Byte
   144                                  	Extrn	DriveLetter:Byte
   145                                  	Extrn	TranSrc:Byte
   146                                  	Extrn	TrackCnt:Word
   147                                  	Extrn	NumSectors:Word
   148                                  	Extrn	BIOSFile:Byte
   149                                  	Extrn	DOSFile:Byte
   150                                  	Extrn	CommandFile:Byte
   151                                  	Extrn	MsgNeedDrive:Byte
   152                                  	Extrn	MsgBadVolumeID:Byte
   153                                  	Extrn	MsgBadDrive:Byte
   154                                  	Extrn	MsgAssignedDrive:Byte
   155                                  	Extrn	MsgNetDrive:Byte
   156                                  	Extrn	Parse_Error_Msg:Byte
   157                                  	Extrn	Extended_Error_Msg:Byte
   158                                  	Extrn	SizeMap:Byte
   159                                  	Extrn	MsgSameSwitch:Byte
   160                                  	Extrn	Org_AX:word			;an000; dms;AX on prog. entry
   161                                  	Extrn	DeviceParameters:Byte		;an000; dms;
   162                                  	Extrn	FAT_Flag:Byte			;an000; dms;
   163                                  	Extrn	Sublist_MsgParse_Error:Dword	;an000; dms;
   164                                  
   165                                  
   166                                  section code
   167                                  
   168                                  ;*****************************************************************************
   169                                  ;Routine name:	Main_Init
   170                                  ;*****************************************************************************
   171                                  ;
   172                                  ;Description: Main control routine for init section
   173                                  ;
   174                                  ;Called Procedures: Message (macro)
   175                                  ;		    Check_DOS_Version
   176                                  ;		    Init_Input_Output
   177                                  ;		    Validate_Target_Drive
   178                                  ;		    Hook_CNTRL_C
   179                                  ;
   180                                  ;Input: None
   181                                  ;
   182                                  ;Output: None
   183                                  ;
   184                                  ;Change History: Created	5/1/87	       MT
   185                                  ;
   186                                  ;Psuedocode
   187                                  ; ---------
   188                                  ;
   189                                  ;	Get PSP segment
   190                                  ;	Fatal_Error = NO
   191                                  ;	Setup I/O (CALL Init_Input_Output)
   192                                  ;	IF !Fatal_Error
   193                                  ;	   Check target drive letter (CALL Validate_Target_Drive)
   194                                  ;	   IF !Fatal_Error
   195                                  ;	      Set up Control Break (CALL Hook_CNTRL_C)
   196                                  ;	      IF !Fatal_Error
   197                                  ;		 CALL Main_Routine
   198                                  ;	      ENDIF
   199                                  ;	   ENDIF
   200                                  ;	ENDIF
   201                                  ;	Exit program
   202                                  ;*****************************************************************************
   203                                  
   204                                  Procedure Main_Init				;				;AN000;
   205                                  
   206                                  
   207 00000961 50B8[ssss]8ED81E07-     	Set_Data_Segment			;Set DS,ES to Data segment	;AN000;
   207 00000969 58                 
   208 0000096A B462CD21                	DOS_Call GetCurrentPSP			;Get PSP segment address
   209 0000096E 891E[0100]              	mov	[PSP_Segment],bx			;Save it for later
   210                                  No equ NO	; NASM port equate
   211 00000972 C606[1A01]00            	mov	byte [Fatal_Error],No			;Init the error flag		;AN000;
   212 00000977 E82700                  	call	Init_Input_Output		;Setup messages and parse	;AN000;
   213                                  Yes equ YES	; NASM port equate
   214 0000097A 803E[1A01]FF            	cmp	byte [Fatal_Error],Yes 		;Error occur?			;AN000;
   215                                  ;	$IF	NE				;Nope, keep going		;AN000;
   216 0000097F 7417                    	JE DD_IF1
   217 00000981 E88C02                  	   call    Validate_Target_Drive	;Check drive letter		;AN000;
   218 00000984 803E[1A01]FF            	   cmp	   byte [Fatal_Error],Yes		;Error occur?			;AN000;
   219                                  ;	   $IF	   NE				;Nope, keep going		;AN000;
   220 00000989 740D                    	   JE DD_IF2
   221 0000098B E82803                  	      call    Hook_CNTRL_C		;Set CNTRL -Break hook		;AN000;
   222 0000098E 803E[1A01]FF            	      cmp     byte [Fatal_Error],Yes		;Error occur?			;AN000;
   223                                  ;	      $IF     NE			;Nope, keep going		;AN000;
   224 00000993 7403                    	      JE DD_IF3
   225 00000995 E8(0000)                		 call	 Main_Routine		;Go do the real program 	;AN000;
   226                                  ;	      $ENDIF				;				;AN000;
   227                                  DD_IF3:
   228                                  ;	   $ENDIF				;				;AN000;
   229                                  DD_IF2:
   230                                  ;	$ENDIF					;				;AN000;
   231                                  DD_IF1:
   232 00000998 A0[0000]                	mov	al,[ExitStatus]			;Get Errorlevel 		;AN000;
   233 0000099B B44CCD21                	DOS_Call Exit				;Exit program			;AN000;
   234 0000099F CD20                    	int	20h				;If other exit fails		;AN000;
   235                                  
   236                                  Main_Init endp					;				;AN000;
   237                                  
   238                                  ;*****************************************************************************
   239                                  ;Routine name: Init_Input_Output
   240                                  ;*****************************************************************************
   241                                  ;
   242                                  ;Description: Initialize messages, Parse command line, allocate memory as
   243                                  ;	      needed. If there is a /FS switch, go handle it first as
   244                                  ;	      syntax of IFS format may be different from FAT format.
   245                                  ;
   246                                  ;Called Procedures: Preload_Messages
   247                                  ;		    Parse_For_FS_Switch
   248                                  ;		    Parse_Command_Line
   249                                  ;
   250                                  ;Change History: Created	4/1/87	       MT
   251                                  ;
   252                                  ;Input: PSP command line at 81h and length at 80h
   253                                  ;	Fatal_Error  = No
   254                                  ;
   255                                  ;Output: Fatal_Error = YES/NO
   256                                  ;
   257                                  ;Psuedocode
   258                                  ;----------
   259                                  ;
   260                                  ;	Load messages (CALL Preload_Messages)
   261                                  ;	IF !Fatal_Error
   262                                  ;	   See if EXEC another file system (CALL Parse_For_FS_Switch)
   263                                  ;	   IF !FATAL_Error (in this case means FS was found and exec'd)
   264                                  ;	      CALL Parse_Command_Line
   265                                  ;	      IF !Fatal_Error
   266                                  ;		 CALL Interpret_Parse
   267                                  ;	      ENDIF
   268                                  ;	   ENDIF
   269                                  ;	ENDIF
   270                                  ;	ret
   271                                  ;*****************************************************************************
   272                                  
   273                                  Procedure Init_Input_Output			;				;AN000;
   274                                  
   275 000009A1 50B8[ssss]8ED81E07-     	Set_Data_Segment			;Set DS,ES to Data segment	;AN000;
   275 000009A9 58                 
   276 000009AA E81800                  	call	Preload_Messages		;Load up message retriever	;AN000;
   277                                  
   278                                  %IF FSExec					;/FS: conditional assembly	;an018; dms;
   279                                  
   280                                  	cmp	byte [Fatal_Error],YES 		;Quit?				;AN000;
   281                                  ;	$IF	NE				;Nope, keep going		;AN000;
   282                                  	JE DD_IF7
   283                                  	   call    Check_For_FS_Switch		;Specify FS other than FAT?	;AN000;
   284                                  
   285                                  %ENDIF						;/FS: conditional assembly end	;an018;dms;
   286                                  
   287 000009AD 803E[1A01]FF            	   cmp	   byte [Fatal_Error],YES		;drive is invalid for format?	;an000;
   288                                  ;	   $if	   ne				;no				;an000;
   289 000009B2 7410                    	   JE DD_IF8
   290 000009B4 E82500                  		   call    Parse_Command_Line ;Parse in command line input	;AN000;
   291 000009B7 803E[1A01]FF            		   cmp	   byte [Fatal_Error],YES	;Quit?				;AN000;
   292                                  ;		   $IF	   NE			;Nope, keep going		;AN000;
   293 000009BC 7406                    		   JE DD_IF9
   294 000009BE E82C03                  			   call    Determine_FAT_Non_FAT;see if drive was non_FAT ;an000;
   295 000009C1 E80003                  			   call    Check_For_Invalid_Drive;Drive joined?	;an000;
   296                                  ;		   $ENDIF			;				;AN000;
   297                                  DD_IF9:
   298                                  ;	    $ENDIF				;				;AN000;
   299                                  DD_IF8:
   300                                  
   301                                  %IF FSExec					;/FS: conditional assembly	;an018; dms;
   302                                  
   303                                  ;	$ENDIF					;				;an000;
   304                                  DD_IF7:
   305                                  
   306                                  %ENDIF						;/FS: conditional assembly end	;an018;dms;
   307                                  
   308 000009C4 C3                      	ret					;				;AN000;
   309                                  
   310                                  Init_Input_Output endp				;				;AN000;
   311                                  
   312                                  ;*****************************************************************************
   313                                  ;Routine name: Preload_Messages
   314                                  ;*****************************************************************************
   315                                  ;
   316                                  ;Description: Preload messages using common message retriever routines.
   317                                  ;
   318                                  ;Called Procedures: SysLoadMsg
   319                                  ;
   320                                  ;
   321                                  ;Change History: Created	5/1/87	       MT
   322                                  ;
   323                                  ;Input: Fatal_Error = NO
   324                                  ;
   325                                  ;Output: Fatal_Error = YES/NO
   326                                  ;
   327                                  ;Psuedocode
   328                                  ;----------
   329                                  ;
   330                                  ;	Preload All messages (Call SysLoadMsg)
   331                                  ;	IF error
   332                                  ;	   Display SysLoadMsg error message
   333                                  ;	   Fatal_Error = YES
   334                                  ;	ENDIF
   335                                  ;	ret
   336                                  ;*****************************************************************************
   337                                  
   338                                  Procedure Preload_Messages			;				;AN000;
   339                                  						;
   340 000009C5 50B8[ssss]8ED81E07-     	Set_Data_Segment			;Set DS,ES to Data segment	;AN000;
   340 000009CD 58                 
   341 000009CE E8(0000)                	call	SysLoadMsg			;Preload the messages		;AN000;
   342                                  ;	$IF	C				;Error? 			;AN000;
   343 000009D1 7308                    	JNC DD_IF13
   344 000009D3 E8(0000)                	   call    SysDispMsg			;Display preload msg		;AN000;
   345 000009D6 C606[1A01]FF            	   mov	   byte [Fatal_Error], YES		;Indicate error exit		;AN000;
   346                                  ;	$ENDIF					;				;AN000;
   347                                  DD_IF13:
   348 000009DB C3                      	ret					;				;AN000;
   349                                  
   350                                  Preload_Messages endp				;				;AN000;
   351                                  
   352                                  
   353                                  
   354                                  msgSameSwitch equ MsgSameSwitch	; NASM port label
   355                                  
   356                                  %IF FSExec					;/FS: conditional assembly	;an018; dms;
   357                                  
   358                                  
   359                                  ;*****************************************************************************
   360                                  ;Routine name: Check_For_FS_Switch
   361                                  ;*****************************************************************************
   362                                  ;
   363                                  ;Description: Parse to see if /FS switch entered, and if so, go EXEC the
   364                                  ;	      asked for file system. Set Fatal_Error = YES if FS found
   365                                  ;	      If we do find /FS, we need to build a string of xxxxxfmt.exe,0
   366                                  ;	      where xxxxx is the first 5 characters or less of /FS:xxxxx
   367                                  ;
   368                                  ;Called Procedures: Parse_For_FS_Switch
   369                                  ;		    EXEC_FS_Format
   370                                  ;
   371                                  ;Change History: Created	6/21/87 	MT
   372                                  ;
   373                                  ;Input: Fatal_Error = NO
   374                                  ;
   375                                  ;Output: Fatal_Error = YES/NO
   376                                  ;	 Exit_Status set
   377                                  ;
   378                                  ;Psuedocode
   379                                  ;----------
   380                                  ;
   381                                  ;	Parse for /FS switch (CALL Parse_For_FS_Switch)
   382                                  ;	IF !FATAL_ERROR
   383                                  ;	   IF /FS found
   384                                  ;	      Point at what was entered on /FS:xxxxx
   385                                  ;	      DO
   386                                  ;	      LEAVE end of entered string
   387                                  ;		Got good char, move into path
   388                                  ;	      ENDDO already got 5 chars (max in xxxxxfmt.exe)
   389                                  ;	      Tack on the rest of the string  (fmt.exe,0)
   390                                  ;	      Go exec the needed format (CALL EXEC_FS_Format)
   391                                  ;	   ENDIF
   392                                  ;	ENDIF
   393                                  ;	ret
   394                                  ;*****************************************************************************
   395                                  
   396                                  Procedure Check_For_FS_Switch			;				;AN000;
   397                                  						;AN000;
   398                                  	Set_Data_Segment			;Set DS,ES to Data segment	;AN000;
   399                                  	call	Parse_For_FS_Switch		;See if /FS entered		;AN000;
   400                                  	cmp	byte [Fatal_Error],YES 		;Bad stuff entered??		;AN000;
   401                                  ;	$IF	NE				;Nope, cruise onward		;AN000;
   402                                  	JE DD_IF15
   403                                  	   cmp	   word [Switch_String_Buffer + Switch_Pointer],offset Switch_FS_Control + Keyword ; ;AN000;
   404                                  ;	   $IF	   E				;We got the switch		;AN000;
   405                                  	   JNE DD_IF16
   406                                  	      mov     byte [Switch_FS_Control + Keyword],20h ;an000; dms;remove switch from table
   407                                  Switch_FS equ SWITCH_FS	; NASM port equate
   408                                  	      test    word [SwitchMap],Switch_FS	;Have this already?		;AN002;
   409                                  ;	      $IF     Z 			;Nope				;AN002;
   410                                  	      JNZ DD_IF17
   411                                  		 push	 ds			;Get addressibility		;AN000;
   412                                  		 pop	 es			; "  "	  "  "			;AN000;
   413                                  						;
   414                                  		 assume  ds:nothing,es:data	;				;AN000;
   415                                  						;
   416                                  		 mov	 ax,[es:Switch_String_Buffer + Switch_String_Seg] ;Get the entered FS ;AN000;
   417                                  		 mov	 ds,ax			;				;AN000;
   418                                  		 mov	 si,[es:Switch_String_Buffer + Switch_String_Off] ; 	       ;AN000;
   419                                  		 mov	 cx,FS_String_Max_Length ;				 ;AN000;
   420                                  		 mov	 di,offset FS_String_Buffer ;			   ;AN000;
   421                                  ;		 $DO				;Move whatever user entered	;AN000;
   422                                  DD_DO18:
   423                                  ASCIIZ_End equ Asciiz_End	; NASM port equate
   424                                  		    cmp     byte ptr [si],ASCIIZ_End ;End of the string?	   ;AN000;
   425                                  ;		 $LEAVE  E			;Yep				;AN000;
   426                                  		 JE DD_EN18
   427                                  		    movsb			;Put character in buffer	;AN000;
   428                                  		    dec     cx			;Dec character counter
   429                                  		    cmp     cx,0		;Nope, reached max # chars?	;AN000;
   430                                  ;		 $ENDDO  E			;Yes				;AN000;
   431                                  		 JNE DD_DO18
   432                                  DD_EN18:
   433                                  		 Set_Data_Segment		;Set DS,ES to Data segment	;AN000;
   434                                  		 mov	 cx,Len_FS_String_End	;Tack the FMT.EXE onto it	   ;AN000;
   435                                  		 mov	 si,offset FS_String_End ;DI still points at string	    ;AN000;
   436                                  		 rep	 movsb			;We now have Asciiz path!	;AN000;
   437                                  		 call	 EXEC_FS_Format 	;Go try to EXEC it..... 	;AN000;
   438                                  ;	      $ELSE				;				;AN002;
   439                                  	      JMP SHORT DD_EN17
   440                                  DD_IF17:
   441                                  		 Message msgSameSwitch		;				;AN002;
   442                                  		 mov	 byte [Fatal_Error],Yes	;				;AN002;
   443                                  ;	      $ENDIF				;				;AN002;
   444                                  DD_EN17:
   445                                  ;	   $ENDIF				;				;AN000;
   446                                  DD_IF16:
   447                                  ;	$ENDIF					;				;AN000;
   448                                  DD_IF15:
   449                                  	ret					;				;AN000;
   450                                  
   451                                  Check_For_FS_Switch endp			;				;AN000;
   452                                  
   453                                  ;*****************************************************************************
   454                                  ;Routine name: Parse_For_FS_Switch
   455                                  ;*****************************************************************************
   456                                  ;
   457                                  ;Description: Copy the command line. Parse the new command line (Parse routines
   458                                  ;	      destroy the data being parsed, so need to work on copy so that
   459                                  ;	      complete command line can be passed to child format).
   460                                  ;	      The only thing we care about is if the /FS: switch exists, so
   461                                  ;	      parse until  end of command line found. If there was an error,
   462                                  ;	      and it occurred on the /FS switch, then give parse error,
   463                                  ;	      otherwise ignore the parse error, because it might be something
   464                                  ;	      file system specific that doesn't meet DOS syntax rules. Also
   465                                  ;	      check for drive letter, as it is alway required.
   466                                  ;
   467                                  ;Called Procedures: Message (macro)
   468                                  ;		    SysLoadMsg
   469                                  ;		    Preload_Error
   470                                  ;		    SysParse
   471                                  ;
   472                                  ;Change History: Created	5/1/87	       MT
   473                                  ;
   474                                  ;Input: Command line at 80h in PSP
   475                                  ;	   Fatal_Error = NO
   476                                  ;	   PSP_Segment
   477                                  ;
   478                                  ;Output: Fatal_Error = YES/NO
   479                                  ;
   480                                  ;Psuedocode
   481                                  ;----------
   482                                  ;	Copy command line to buffer
   483                                  ;	DO
   484                                  ;	   Parse command line (Call SysParse)
   485                                  ;	LEAVE end of parse
   486                                  ;	ENDDO found /FS
   487                                  ;	IF drive letter not found (This assumes drive letter before switches)
   488                                  ;	   Tell user
   489                                  ;	   Fatal_Error = YES
   490                                  ;	ENDIF
   491                                  ;	ret
   492                                  ;*****************************************************************************
   493                                  
   494                                  Procedure Parse_For_FS_Switch			;				;AN000;
   495                                  						;
   496                                  	Set_Data_Segment			;Set DS,ES to Data segment	;AN000;
   497                                  Init equ INIT	; NASM port equate
   498                                  	mov	byte [Drive_Letter_Buffer + Drive_Number],Init ; 			;AN000;
   499                                  	mov	cx,[PSP_Segment]			;Get segment of PSP		;AN000;
   500                                  	mov	ds,cx				;  "  "    "  " 		;AN000;
   501                                  	assume	ds:nothing			;
   502                                  						;
   503                                  	mov	si,Command_Line_Parms		;Point at command line		;AN000;
   504                                  	mov	di,offset Command_Line_Buffer wrt data ;Where to put a copy of it	   ;AN000;
   505                                  	mov	cx,Command_Line_Length		;How long was input?		;AN000;
   506                                  	repnz	movsb				;Copy it			;AN000;
   507                                  	Set_Data_Segment			;Set DS,ES to Data segment	;AN000;
   508                                  	xor	cx,cx				;				;AN000;
   509                                  	xor	dx,dx				;Required for SysParse call	;AN000;
   510                                  	mov	si,offset Command_Line_Buffer	;Pointer to parse line		  ;AN000;
   511                                  	mov	di,offset Switch_FS_Table	;Pointer to control table	   ;AN000;
   512                                  ;	$DO					;Setup parse call		;AN000;
   513                                  DD_DO25:
   514                                  	   call    SysParse			;Go parse			;AN000;
   515                                  	   cmp	   ax,End_Of_Parse		;Check for end of parse 	;AN000;
   516                                  ;	$LEAVE	E,OR				;Exit if it is end, or		;AN000;
   517                                  	JE DD_EN25
   518                                  	   cmp	   ax,Operand_Missing		; exit if positional missing	;AN000;
   519                                  ;	$LEAVE	E				;In other words, no drive letter;AN000;
   520                                  	JE DD_EN25
   521                                  	   cmp	   word [Switch_String_Buffer + Switch_Pointer],offset Switch_FS_Control + Keyword ;AN000;
   522                                  ;	$ENDDO	E				;Exit if we find /FS		;AN000;
   523                                  	JNE DD_DO25
   524                                  DD_EN25:
   525                                  	cmp	byte [Drive_Letter_Buffer + Drive_Type],Type_Drive ;Check for drive letter found;AN000;
   526                                  ;	$IF	NE				;Did we not find one?		;AN000;
   527                                  	JE DD_IF28
   528                                  msgNeedDrive equ MsgNeedDrive	; NASM port label
   529                                  	   MESSAGE msgNeedDrive 		;Must enter drive letter	;AN000;
   530                                  	   mov	   byte [Fatal_Error],Yes		;Indicate error on exit 	;AN000;
   531                                  ;	$ENDIF					;				;AN000;
   532                                  DD_IF28:
   533                                  	ret					;				;AN000;
   534                                  
   535                                  Parse_For_FS_Switch endp			;				;AN000;
   536                                  
   537                                  
   538                                  %ENDIF						;/FS: conditional assembly end	;an018;dms;
   539                                  
   540                                  
   541                                  ;*****************************************************************************
   542                                  ;Routine name: Parse_Command_Line
   543                                  ;*****************************************************************************
   544                                  ;
   545                                  ;Description: Parse the command line. Check for errors, and display error and
   546                                  ;		 exit program if found. Use parse error messages except in case
   547                                  ;		 of no parameters, which has its own message
   548                                  ;
   549                                  ;Called Procedures: Message (macro)
   550                                  ;		    SysParse
   551                                  ;		    Interpret_Parse
   552                                  ;
   553                                  ;Change History: Created	5/1/87	       MT
   554                                  ;
   555                                  ;Input: Fatal_Error = NO
   556                                  ;	PSP_Segment
   557                                  ;
   558                                  ;Output: Fatal_Error = YES/NO
   559                                  ;
   560                                  ;
   561                                  ;Psuedocode
   562                                  ;----------
   563                                  ;
   564                                  ;	Assume Fatal_Error = NO on entry
   565                                  ;	SEARCH
   566                                  ;	EXITIF Fatal_Error = YES,OR  (This can be set by Interpret_Parse)
   567                                  ;	   Parse command line (CALL SysParse)
   568                                  ;	EXITIF end of parsing command line
   569                                  ;	   Figure out last thing parsed (Call Interpret_Parse)
   570                                  ;	ORELSE
   571                                  ;	   See if parse error
   572                                  ;	LEAVE parse error,OR
   573                                  ;	   See what was parsed (Call Interpret_Parse)
   574                                  ;	LEAVE if interpret error such as bad volume label
   575                                  ;	ENDLOOP
   576                                  ;	   Display parse error message and print error operand
   577                                  ;	   Fatal_Error = YES
   578                                  ;	ENDSRCH
   579                                  ;	ret
   580                                  ;*****************************************************************************
   581                                  
   582                                  Procedure Parse_Command_Line			;				;AN000;
   583                                  
   584 000009DC 50B8[ssss]8ED81E07-     	Set_Data_Segment			;Set DS,ES to Data segment	;AN000;
   584 000009E4 58                 
   585 000009E5 1E                      	push	ds
   586 000009E6 8B0E[0100]              	mov	cx,[PSP_Segment]			;Get segment of PSP		;AN000;
   587 000009EA 8ED9                    	mov	ds,cx				;  "  "    "  " 		;AN000;
   588                                  
   589                                  	assume	ds:nothing,es:data
   590                                  
   591 000009EC 31C9                    	xor	cx,cx				;Parse table @DI		;AN000;
   592 000009EE 31D2                    	xor	dx,dx				;Parse line @SI 		;AN000;
   593 000009F0 BE8100                  	mov	si,Command_Line_Parms		;Pointer to parse line		;AN000;
   594 000009F3 268936[1B01]            	mov	word ptr [es:Command_Old_Ptr],si
   595 000009F8 BF[1D01]                	mov	di,offset Command_Line_Table ;Pointer to control table	;AN000;
   596                                  ;	$SEARCH 				;Loop until all parsed		;AN000;
   597                                  DD_DO30:
   598 000009FB 26803E[1A01]FF          	   cmp	   byte [es:Fatal_Error],Yes		;Interpret something bad?	;AN000;
   599                                  ;	$EXITIF E,OR				;If so, don't parse any more    ;AN000;
   600 00000A01 7408                    	JE DD_LL31
   601 00000A03 E8A5F6                  	   call    SysParse			;Go parse			;AN000;
   602 00000A06 83F8FF                  	   cmp	   ax,End_Of_Parse		;Check for end of parse 	;AN000;
   603                                  ;	$EXITIF E				;Is it? 			;AN000;
   604 00000A09 7502                    	JNE DD_IF30
   605                                  DD_LL31:
   606                                  						;All done			;AN000;
   607                                  ;	$ORELSE 				;Not end			;AN000;
   608 00000A0B EB3B                    	JMP SHORT DD_SR30
   609                                  DD_IF30:
   610 00000A0D 83F800                  	   cmp	   ax,0 			;Check for parse error		;AN000;
   611                                  ;	$LEAVE	NE				;Stop if there was one		;AN000;
   612 00000A10 750A                    	JNE DD_EN30
   613 00000A12 268936[1B01]            	   mov	word ptr [es:Command_Old_Ptr],si
   614 00000A17 E83000                  	   call    Interpret_Parse		;Go find what we parsed 	;AN000;
   615                                  ;	$ENDLOOP				;Parse error, see what it was	;AN000;
   616 00000A1A EBDF                    	JMP SHORT DD_DO30
   617                                  DD_EN30:
   618 00000A1C C60400                  	   mov	byte ptr [si],0
   619 00000A1F 57                      	   push di
   620 00000A20 50                      	   push ax
   621 00000A21 BF[0000]                	   mov	di,offset Sublist_MsgParse_Error
   622 00000A24 26A1[1B01]              	   mov	ax,word ptr [es:Command_Old_Ptr]
   623 00000A28 26894502                	   mov	word ptr [es:di+2],ax
   624 00000A2C 268C5D04                	   mov	word ptr [es:di+4],ds
   625 00000A30 58                      	   pop	ax
   626 00000A31 5F                      	   pop	di
   627 00000A32 1EBA[ssss]8EDAA3-       	   PARSE_MESSAGE			;Display parse error		;AN000;
   627 00000A39 [0000]BA[0000]E8-  
   627 00000A3F (0000)1F           
   628 00000A42 26C606[1A01]FF          	   mov	   byte [es:Fatal_Error],YES		;Indicate death!		;AN000;
   629                                  ;	$ENDSRCH				;				;AN000;
   630                                  DD_SR30:
   631 00000A48 1F                      	pop	ds				;				;AN000;
   632 00000A49 C3                      	ret					;				;AN000;
   633                                  
   634                                  Parse_Command_Line endp 			;				;AN000;
   635                                  
   636                                  ;*****************************************************************************
   637                                  ;Routine name: Interpret_Parse
   638                                  ;*****************************************************************************
   639                                  ;
   640                                  ;Description: Set the SwitchMap  field with the switches found on the
   641                                  ;	      command line. Get the drive letter. /FS will be handled before
   642                                  ;	      here, will not be seen in this parse or accepted. Also, if /V
   643                                  ;	      see if volume label entered and verify it is good, setting up
   644                                  ;	      FCB for later create
   645                                  ;
   646                                  ;Called Procedures: Get_11_Characters
   647                                  ;
   648                                  ;Change History: Created	5/1/87	       MT
   649                                  ;
   650                                  ;Input: Fatal_Error = NO
   651                                  ;
   652                                  ;Output: SwitchMap set
   653                                  ;	 DriveLetter set
   654                                  ;	 DriveNum set A=0,B=1 etc...
   655                                  ;	 Command_Line = YES/NO
   656                                  ;	 Fatal_Error = YES/NO
   657                                  ;
   658                                  ;Psuedocode
   659                                  ;----------
   660                                  ;
   661                                  ;	IF Drive letter parsed
   662                                  ;	Drive = Parsed drive number -1
   663                                  ;	DriveLetter = (Parsed drive number - 1) +'A'
   664                                  ;	ENDIF
   665                                  ;	IF /1
   666                                  ;	  or	SwitchMap,Switch_1
   667                                  ;	ENDIF
   668                                  ;	IF /4
   669                                  ;	  or	SwitchMap,Switch_4
   670                                  ;	ENDIF
   671                                  ;	IF /8
   672                                  ;	  or	SwitchMap,Switch_8
   673                                  ;	ENDIF
   674                                  ;	IF /S
   675                                  ;	  or	SwitchMap,Switch_S
   676                                  ;	ENDIF
   677                                  ;	IF /BACKUP
   678                                  ;	  or	SwitchMap,Switch_BACKUP
   679                                  ;	ENDIF
   680                                  ;	IF /B
   681                                  ;	  or	SwitchMap,Switch_B
   682                                  ;	ENDIF
   683                                  ;	IF /T
   684                                  ;	  or	SwitchMap,Switch_T
   685                                  ;	  TrackCnt = entered value
   686                                  ;	ENDIF
   687                                  ;	IF /N
   688                                  ;	  or	SwitchMap,Switch_N
   689                                  ;	  NumSectors = entered value
   690                                  ;	ENDIF
   691                                  ;	IF /SELECT
   692                                  ;	  or	SwitchMap,Switch_SELECT
   693                                  ;	ENDIF
   694                                  ;	IF /V
   695                                  ;	  or	SwitchMap,Switch_V
   696                                  ;	  IF string entered
   697                                  ;	     Build ASCIIZ string for next call (CALL Build_String)
   698                                  ;	     Verify DBCS and setup FCB (CALL Get_11_Characters)
   699                                  ;	     Command_Line = YES
   700                                  ;		IF error
   701                                  ;		  Invalid label message
   702                                  ;		  Fatal_Error = YES
   703                                  ;		ENDIF
   704                                  ;	  ENDIF
   705                                  ;	ENDIF
   706                                  ;	IF /AUTOTEST
   707                                  ;	  or	SwitchMap,Switch_AUTOTEST
   708                                  ;	ENDIF
   709                                  ;
   710                                  ;	IF /F
   711                                  ;	  or	SwitchMap,Switch_F
   712                                  ;	  or	Size_Map,Item_Tag
   713                                  ;	ENDIF
   714                                  ;	IF /Z	(only if assembled)
   715                                  ;	  or	SwitchMap,Switch_Z
   716                                  ;	ENDIF
   717                                  ;	ret
   718                                  ;*****************************************************************************
   719                                  
   720                                  Procedure Interpret_Parse			;				;AN000;
   721                                  
   722 00000A4A 1E                      	push	ds				;Save segment			;AN000;
   723 00000A4B 56                      	push	si				;Restore SI for parser		;AN000;
   724 00000A4C 51                      	push	cx				;				;AN000;
   725 00000A4D 57                      	push	di				;
   726 00000A4E 50B8[ssss]8ED81E07-     	Set_Data_Segment			;Set DS,ES to Data segment	;AN000;
   726 00000A56 58                 
   727 00000A57 803E[E402]06            	cmp	byte [Drive_Letter_Buffer + Drive_Type],Type_Drive ;Have drive letter?	 ;AN000;
   728                                  ;	$IF	E				;Yes, save info 		;AN000;
   729 00000A5C 750D                    	JNE DD_IF36
   730 00000A5E A0[E802]                	   mov	   al,[Drive_Letter_Buffer + Drive_Number] ;Get drive entered	   ;AN000;
   731 00000A61 FEC8                    	   dec	   al				;Make it 0 based		;AN000;
   732 00000A63 A2[0000]                	   mov	   [Drive],al			; "  "	  "  "			;AN000;
   733 00000A66 0441                    	   add	   al,'A'			;Make it a drive letter 	;AN000;
   734 00000A68 A2[0000]                	   mov	   [DriveLetter],al		;Save it			;AN000;
   735                                  ;	$ENDIF					;				;AN000;
   736                                  DD_IF36:
   737 00000A6B 813E[F302][7401]        	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_1_Control + Keyword ;;AN000;
   738                                  ;	$IF	E				;				;AN000;
   739 00000A71 750A                    	JNE DD_IF38
   740 00000A73 C606[7401]20            	   mov	   byte [Switch_1_Control + Keyword],20h ;an000; dms;remove switch from table
   741                                  Switch_1 equ SWITCH_1	; NASM port equate
   742 00000A78 830E[0000]40            	   or	   word [SwitchMap],Switch_1		;				;AN000;
   743                                  ;	$ENDIF					;				;AN000;
   744                                  DD_IF38:
   745 00000A7D 813E[F302][6801]        	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_4_Control + Keyword ;;AN000;
   746                                  ;	$IF	E				;				;AN000;
   747 00000A83 750B                    	JNE DD_IF40
   748 00000A85 C606[6801]20            	   mov	   byte [Switch_4_Control + Keyword],20h ;an000; dms;remove switch from table
   749                                  Switch_4 equ SWITCH_4	; NASM port equate
   750 00000A8A 810E[0000]8000          	   or	   word [SwitchMap],Switch_4		;				;AN000;
   751                                  ;	$ENDIF					;				;AN000;
   752                                  DD_IF40:
   753 00000A90 813E[F302][8001]        	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_8_Control + Keyword ;;AN000;
   754                                  ;	$IF	E				;				;AN000;
   755 00000A96 750B                    	JNE DD_IF42
   756 00000A98 C606[8001]20            	   mov	   byte [Switch_8_Control + Keyword],20h ;an000; dms;remove switch from table
   757                                  Switch_8 equ SWITCH_8	; NASM port equate
   758 00000A9D 810E[0000]0001          	   or	   word [SwitchMap],Switch_8		;				;AN000;
   759                                  ;	$ENDIF					;				;AN000;
   760                                  DD_IF42:
   761 00000AA3 813E[F302][5C01]        	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_S_Control + Keyword ;;AN000;
   762                                  ;	$IF	E				;				;AN000;
   763 00000AA9 750A                    	JNE DD_IF44
   764 00000AAB C606[5C01]20            	   mov	   byte [Switch_S_Control + Keyword],20h ;an000; dms;remove switch from table
   765                                  Switch_S equ SWITCH_S	; NASM port equate
   766 00000AB0 830E[0000]01            	   or	   word [SwitchMap],Switch_S		;				;AN000;
   767                                  ;	$ENDIF					;				;AN000;
   768                                  DD_IF44:
   769 00000AB5 813E[F302][C101]        	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_Backup_Control + Keyword ;AN000;
   770                                  ;	$IF	E				;				;AN000;
   771 00000ABB 750A                    	JNE DD_IF46
   772 00000ABD C606[C101]20            	   mov	   byte [Switch_Backup_Control + Keyword],20h ;an000; dms;remove switch from table
   773                                  Switch_Backup equ SWITCH_BACKUP	; NASM port equate
   774 00000AC2 830E[0000]04            	   or	   word [SwitchMap],Switch_Backup	;				;AN000;
   775                                  ;	$ENDIF					;				;AN000;
   776                                  DD_IF46:
   777 00000AC7 813E[F302][B001]        	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_Select_Control + Keyword ;AN000;
   778                                  ;	$IF	E				;				;AN000;
   779 00000ACD 750B                    	JNE DD_IF48
   780 00000ACF C606[B001]20            	   mov	   byte [Switch_Select_Control + Keyword],20h ;an000; dms;remove switch from table
   781                                  Switch_Select equ SWITCH_SELECT	; NASM port equate
   782 00000AD4 810E[0000]0004          	   or	   word [SwitchMap],Switch_Select	;				;AN000;
   783                                  ;	$ENDIF					;				;AN000;
   784                                  DD_IF48:
   785 00000ADA 813E[F302][8C01]        	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_B_Control + Keyword ;AN000;
   786                                  ;	$IF	E				;				;AN000;
   787 00000AE0 750B                    	JNE DD_IF50
   788 00000AE2 C606[8C01]20            	   mov	   byte [Switch_B_Control + Keyword],20H
   789                                  Switch_B equ SWITCH_B	; NASM port equate
   790 00000AE7 810E[0000]0002          	   or	   word [SwitchMap],Switch_B		;				;AN000;
   791                                  ;	$ENDIF					;				;AN000;
   792                                  DD_IF50:
   793 00000AED 813E[FB02][9801]        	cmp	word [Switch_Num_Buffer + Switch_Num_Pointer],offset Switch_T_Control + Keyword ;AN000;
   794                                  ;	$IF	E				;				;AN000;
   795 00000AF3 752B                    	JNE DD_IF52
   796 00000AF5 C606[9801]20            	   mov	   byte [Switch_T_Control + Keyword],20h ;an000; dms;remove switch from table
   797 00000AFA C706[FB02]0000          	   mov	   word [Switch_Num_Buffer + Switch_Num_Pointer],0 ;Init for next switch ;AN008;
   798                                  Switch_T equ SWITCH_T	; NASM port equate
   799 00000B00 F706[0000]1000          	   test    word [SwitchMap],Switch_T		;Don't allow if switch already  ;AN002;
   800                                  ;	   $IF	   Z				; entered			;AN002;
   801 00000B06 750D                    	   JNZ DD_IF53
   802 00000B08 830E[0000]10            	      or      word [SwitchMap],Switch_T	;				;AN000;
   803 00000B0D A1[FD02]                	      mov     ax,[Switch_Num_Buffer + Switch_Number_Low] ;Get entered tracks   ;AN000;
   804 00000B10 A3[0000]                	      mov     [TrackCnt],ax		;1024 or less, so always dw	;AN000;
   805                                  ;	   $ELSE				;				;AN002;
   806 00000B13 EB0B                    	   JMP SHORT DD_EN53
   807                                  DD_IF53:
   808 00000B15 BA[0000]E8(0000)        	      Message msgSameSwitch		;				;AN002;
   809 00000B1B C606[1A01]FF            	      mov     byte [Fatal_Error],Yes		;				;AN002;
   810                                  ;	   $ENDIF				;				;AN000;
   811                                  DD_EN53:
   812                                  ;	$ENDIF					;				;AN002;
   813                                  DD_IF52:
   814 00000B20 813E[FB02][A401]        	cmp	word [Switch_Num_Buffer + Switch_Num_Pointer],offset Switch_N_Control + Keyword ;AN000;
   815                                  ;	$IF	E				;				;AN000;
   816 00000B26 752D                    	JNE DD_IF57
   817 00000B28 C606[A401]20            	   mov	   byte [Switch_N_Control + Keyword],20h ;an000; dms;remove switch from table
   818 00000B2D C706[FB02]0000          	   mov	   word [Switch_Num_Buffer + Switch_Num_Pointer],0 ;Init for next switch ;AN008;
   819                                  Switch_N equ SWITCH_N	; NASM port equate
   820 00000B33 F706[0000]2000          	   test    word [SwitchMap],Switch_N		;Make sure switch not already	;AN002;
   821                                  ;	   $IF	   Z				; entered			;AN002;
   822 00000B39 750F                    	   JNZ DD_IF58
   823 00000B3B 830E[0000]20            	      or      word [SwitchMap],Switch_N	;				;AN000;
   824 00000B40 A1[FD02]                	      mov     ax,[Switch_Num_Buffer + Switch_Number_Low] ;Get entered tracks   ;AN000;
   825 00000B43 30E4                    	      xor     ah,ah			;clear high byte		;an000;
   826 00000B45 A3[0000]                	      mov     [NumSectors],ax		;Save tracks per sector 	;AN000;
   827                                  ;	   $ELSE				;				;AN002;
   828 00000B48 EB0B                    	   JMP SHORT DD_EN58
   829                                  DD_IF58:
   830 00000B4A BA[0000]E8(0000)        	      Message msgSameSwitch		;				;AN002;
   831 00000B50 C606[1A01]FF            	      mov     byte [Fatal_Error],Yes		;				;AN002;
   832                                  ;	   $ENDIF				;				;AN000;
   833                                  DD_EN58:
   834                                  ;	$ENDIF					;				;AN002;
   835                                  DD_IF57:
   836 00000B55 813E[0303][5001]        	cmp	word [Switch_String_Buffer + Switch_String_Pointer],offset Switch_V_Control + Keyword ;AN000;
   837                                  ;	$IF	E				;If /v and haven't already done ;AN000;
   838 00000B5B 7560                    	JNE DD_IF62
   839 00000B5D C706[0303]0000          	   mov	   word [Switch_String_Buffer + Switch_String_Pointer],0 ;Init for next switch ;AN008;
   840 00000B63 C606[5001]20            	   mov	   byte [Switch_V_Control + Keyword],20h ;an000; dms;remove switch from table
   841                                  Switch_V equ SWITCH_V	; NASM port equate
   842 00000B68 F706[0000]0200          	   test    word [SwitchMap],Switch_V		; it - Only allow one /V entry	;AN002;
   843                                  ;	   $IF	   Z				;				;AN002;
   844 00000B6E 7542                    	   JNZ DD_IF63
   845 00000B70 830E[0000]02            	      or      word [SwitchMap],Switch_V	;Set /v indicator		;AN000;
   846 00000B75 8B36[0703]              	      mov     si,[Switch_String_Buffer + Switch_String_Seg] ;Get string address ;;AN000;
   847 00000B79 8EDE                    	      mov     ds,si			;				;AN000;
   848                                  
   849                                  	      assume  ds:nothing
   850                                  
   851 00000B7B 268B36[0503]            	      mov     si,[es:Switch_String_Buffer + Switch_String_Off] ;		   ;AN000;
   852 00000B80 803C00                  	      cmp     byte ptr [si],None	;Is there a string there?	;AN000;
   853                                  ;	      $IF     NE			;Yep				;AN000;
   854 00000B83 742B                    	      JE DD_IF64
   855 00000B85 FC                      		 cld				;				;AN000;
   856 00000B86 BF[1A00]                		 mov	 di,offset Vol_Label_Buffer ;Point at buffer to move string;AN000;
   857 00000B89 B90C00                  		 mov	 cx,Label_Length+1	;Max length of string		;AN000;
   858 00000B8C F3A4                    		 rep	 movsb			;This will copy string & always ;AN000;
   859                                  						; leave ASCIIZ end in buffer,	;     ;
   860                                  						; which is init'd to 13 dup(0)  ;     ;
   861 00000B8E BE[1A00]                		 mov	 si,offset Vol_Label_Buffer ;Point at string 	   ;AN000;
   862 00000B91 50B8[ssss]8ED81E07-     		 Set_Data_Segment		;Set DS,ES to Data segment	;AN000;
   862 00000B99 58                 
   863 00000B9A C606[0000]FF            		 mov	 byte [Command_Line],YES	;Set flag indicating vol label	;AN000;
   864 00000B9F E8(0000)                		 call	 Get_11_Characters	;Check DBCS and build FCB	;AN000;
   865                                  ;		 $IF	 C			;Bad DBCS setup 		;AN000;
   866 00000BA2 730C                    		 JNC DD_IF65
   867                                  msgBadVolumeID equ MsgBadVolumeID	; NASM port label
   868 00000BA4 BA[0000]E8(0000)        		    Message msgBadVolumeID	;Tell user			;AN000;
   869 00000BAA 26C606[1A01]FF          		    mov     byte [es:Fatal_Error],YES	;Indicate time to quit		;AN000;
   870                                  ;		 $ENDIF 			;				;AN000;
   871                                  DD_IF65:
   872                                  ;	      $ENDIF				;				;AN000;
   873                                  DD_IF64:
   874                                  ;	   $ELSE				;				;AN002;
   875 00000BB0 EB0B                    	   JMP SHORT DD_EN63
   876                                  DD_IF63:
   877 00000BB2 BA[0000]E8(0000)        	      Message msgSameSwitch		;				;AN002;
   878 00000BB8 C606[1A01]FF            	      mov     byte [Fatal_Error],Yes		;				;AN002;
   879                                  ;	   $ENDIF				;				;AN002;
   880                                  DD_EN63:
   881                                  ;	$ENDIF					;				;AN000;
   882                                  DD_IF62:
   883 00000BBD 813E[F302][D201]        	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_Autotest_Control + Keyword ;AN000;
   884                                  ;	$IF	E				;				;AN000;
   885 00000BC3 750B                    	JNE DD_IF71
   886 00000BC5 C606[D201]20            	   mov	   byte [Switch_Autotest_Control + Keyword],20h ;an000; dms;remove switch from table
   887                                  Switch_Autotest equ SWITCH_AUTOTEST	; NASM port equate
   888 00000BCA 810E[0000]0008          	   or	   word [SwitchMap],Switch_Autotest	;				;AN000;
   889                                  ;	$ENDIF					;				;AN000;
   890                                  DD_IF71:
   891                                  
   892                                  %IF ShipDisk
   893                                  
   894                                  	cmp	word [Switch_Buffer + Switch_Pointer],offset Switch_Z_Control + Keyword	;an000; dms;/Z switch?
   895                                  ;	$IF	E				;				;an000; dms;yes
   896                                  	JNE DD_IF73
   897                                  	   mov	   byte [Switch_Z_Control + Keyword],20h 				;an000; dms;remove switch from table
   898                                  Switch_Z equ SWITCH_Z	; NASM port equate
   899                                  	   or	   word [SwitchMap],Switch_Z		;				;an000; dms;signal switch found
   900                                  ;	$ENDIF					;				;an000; dms;
   901                                  DD_IF73:
   902                                  
   903                                  %ENDIF
   904                                  
   905 00000BD0 813E[0303][E501]        	cmp	word [Switch_String_Buffer + Switch_Pointer],offset Switch_F_Control + Keyword ;  ;AN000;
   906                                  ;	$IF	E				;				;AN000;
   907 00000BD6 7533                    	JNE DD_IF75
   908 00000BD8 C606[E501]20            	   mov	   byte [Switch_F_Control + Keyword],20h ;an000; dms;remove switch from table
   909 00000BDD C706[0303]0000          	   mov	   word [Switch_String_Buffer + Switch_Pointer],0			;an000; dms; clear out ptr for next iteration
   910 00000BE3 C706[FB02]0000          	   mov	   word [Switch_Num_Buffer + Switch_Num_Pointer],0 ;Init for next switch ;AN008;
   911                                  Switch_F equ SWITCH_F	; NASM port equate
   912 00000BE9 F706[0000]0010          	   test    word [SwitchMap],Switch_F		; it - do this because SysParse ;AN002;
   913                                  ;	   $IF	   Z				; reuses string buffer each time;AN002;
   914 00000BEF 750F                    	   JNZ DD_IF76
   915 00000BF1 810E[0000]0010          	      or      word [SwitchMap],Switch_F	;				;AN000;
   916 00000BF7 A0[0203]                	      mov     al,[Switch_String_Buffer + Switch_String_Item_Tag] ; Indicate what size;AN000;
   917 00000BFA 0806[0000]              	      or      [SizeMap],al		;				;AN000;
   918                                  ;	   $ELSE				;				;AN002;
   919 00000BFE EB0B                    	   JMP SHORT DD_EN76
   920                                  DD_IF76:
   921 00000C00 BA[0000]E8(0000)        	      Message msgSameSwitch		;				;AN002;
   922 00000C06 C606[1A01]FF            	      mov     byte [Fatal_Error],Yes		;				;AN002;
   923                                  ;	   $ENDIF				;				;AN002;
   924                                  DD_EN76:
   925                                  ;	$ENDIF					;				;AN000;
   926                                  DD_IF75:
   927 00000C0B 5F                      	pop	di				;Restore parse regs		;AN000;
   928 00000C0C 59                      	pop	cx				;				;AN000;
   929 00000C0D 5E                      	pop	si				;				;AN000;
   930 00000C0E 1F                      	pop	ds				;				;AN000;
   931 00000C0F C3                      	ret					;				;AN000;
   932                                  
   933                                  Interpret_Parse endp				;				;AN000;
   934                                  
   935                                  
   936                                  
   937                                  ;*****************************************************************************
   938                                  ;Routine name: Validate_Target_Drive
   939                                  ;*****************************************************************************
   940                                  ;
   941                                  ;Description: Control routine for validating the specified format target drive.
   942                                  ;	      If any of the called routines find an error, they will print
   943                                  ;	      message and terminate program, without returning to this routine
   944                                  ;
   945                                  ;Called Procedures: Check_Target_Drive
   946                                  ;		    Check_For_Network
   947                                  ;		    Check_Translate_Drive
   948                                  ;
   949                                  ;Change History: Created	5/1/87	       MT
   950                                  ;
   951                                  ;Input: Fatal_Error = NO
   952                                  ;
   953                                  ;Output: Fatal_Error = YES/NO
   954                                  ;
   955                                  ;Psuedocode
   956                                  ;----------
   957                                  ;
   958                                  ;	CALL Check_Target_Drive
   959                                  ;	IF !Fatal_Error
   960                                  ;	   CALL Check_For_Network
   961                                  ;	   IF !Fatal_Error
   962                                  ;	      CALL Check_Translate_Drive
   963                                  ;	   ENDIF
   964                                  ;	ENDIF
   965                                  ;	ret
   966                                  ;*****************************************************************************
   967                                  
   968                                  Procedure Validate_Target_Drive 		;				;AN000;
   969                                  						;
   970 00000C10 E81500                  	call	Check_Target_Drive		;See if valid drive letter	;AN000;
   971 00000C13 803E[1A01]FF            	cmp	byte [Fatal_Error],YES 		;Can we continue?		;AN000;
   972                                  ;	$IF	NE				;Yep				;AN000;
   973 00000C18 740D                    	JE DD_IF80
   974 00000C1A E83E00                  	   call    Check_For_Network		;See if Network drive letter	;AN000;
   975 00000C1D 803E[1A01]FF            	   cmp	   byte [Fatal_Error],YES		;Can we continue?		;AN000;
   976                                  ;	   $IF	   NE				;Yep				;AN000;
   977 00000C22 7403                    	   JE DD_IF81
   978 00000C24 E86500                  	      call    Check_Translate_Drive	;See if Subst, Assigned 	;AN000;
   979                                  ;	   $ENDIF				;- Fatal_Error passed back	;AN000;
   980                                  DD_IF81:
   981                                  ;	$ENDIF					;				;AN000;
   982                                  DD_IF80:
   983 00000C27 C3                      	ret					;				;AN000;
   984                                  
   985                                  Validate_Target_Drive endp			;				;AN000;
   986                                  
   987                                  ;*****************************************************************************
   988                                  ;Routine name: Check_Target_Drive
   989                                  ;*****************************************************************************
   990                                  ;
   991                                  ;Description: Check to see if valid DOS drive by checking if drive is
   992                                  ;	      removable. If error, the drive is invalid. Save default
   993                                  ;	      drive info.
   994                                  ;
   995                                  ;Called Procedures: Message (macro)
   996                                  ;
   997                                  ;Change History: Created	5/1/87	       MT
   998                                  ;
   999                                  ;Input: Fatal_Error = NO
  1000                                  ;
  1001                                  ;Output: BIOSFile = default drive letter
  1002                                  ;	 DOSFile = default drive letter
  1003                                  ;	 CommandFile = default drive letter
  1004                                  ;	 Fatal_Error = YES/NO
  1005                                  ;
  1006                                  ;Psuedocode
  1007                                  ;----------
  1008                                  ;
  1009                                  ;	Get default drive (INT 21h, AH = 19h)
  1010                                  ;	Convert it to drive letter
  1011                                  ;	Save into BIOSFile,DOSFile,CommandFile
  1012                                  ;	See if drive removable (INT 21h, AX=4409h IOCtl)
  1013                                  ;	IF error - drive invalid
  1014                                  ;	   Display Invalid drive message
  1015                                  ;	   Fatal_Error= YES
  1016                                  ;	ENDIF
  1017                                  ;	ret
  1018                                  ;*****************************************************************************
  1019                                  
  1020                                  Procedure Check_Target_Drive			;				;AN000;
  1021                                  						;
  1022 00000C28 B419CD21                	DOS_Call Get_Default_Drive		;Find the current drive 	;AC000;
  1023 00000C2C 0441                    	add	al,'A'				;Convert to drive letter	;     ;
  1024 00000C2E A2[0000]                	mov	[BIOSFile],al			;Put it into path strings	;     ;
  1025 00000C31 A2[0000]                	mov	[DOSFile],al			;   "  "	"  "		;     ;
  1026 00000C34 A2[0000]                	mov	[CommandFile],al			;   "  "	"  "		;     ;
  1027 00000C37 8A1E[0000]              	mov	bl,[Drive]			;Set up for next call		;AN000;
  1028 00000C3B FEC3                    	inc	bl				;A=1,B=2 for IOCtl call 	;AN000;
  1029 00000C3D B009                    	mov	al,09h				;See if drive is local		;AC000;
  1030 00000C3F B444CD21                	DOS_Call IOCtl				;-this will fail if bad drive	;AC000;
  1031                                  ;	$IF	C				;CY means invalid drive 	;AC000;
  1032 00000C43 7315                    	JNC DD_IF84
  1033 00000C45 1EBA[ssss]8EDAA3-       	   Extended_Message			;Print message			;AC000;
  1033 00000C4C [0000]BA[0000]E8-  
  1033 00000C52 (0000)1F           
  1034 00000C55 C606[1A01]FF            	   mov	   byte [Fatal_Error],Yes		;Indicate error 		;AN000;
  1035                                  ;	$ENDIF					;				;AN000;
  1036                                  DD_IF84:
  1037 00000C5A C3                      	ret					;And we're outa here            ;AN000;
  1038                                  
  1039                                  Check_Target_Drive endp 			;				;AN000;
  1040                                  
  1041                                  ;*****************************************************************************
  1042                                  ;Routine name: Check_For_Network
  1043                                  ;*****************************************************************************
  1044                                  ;
  1045                                  ;Description: See if target drive isn't local, or if it is a shared drive. If
  1046                                  ;	      so, exit with error message. The IOCtl call is not checked for
  1047                                  ;	      an error because it is called previously in another routine, and
  1048                                  ;	      invalid drive is the only error it can generate. That condition
  1049                                  ;	      would not get this far
  1050                                  ;
  1051                                  ;Called Procedures: Message (macro)
  1052                                  ;
  1053                                  ;Change History: Created	5/1/87	       MT
  1054                                  ;
  1055                                  ;Input: Drive
  1056                                  ;	   Fatal_Error = NO
  1057                                  ;
  1058                                  ;Output: Fatal_Error = YES/NO
  1059                                  ;
  1060                                  ;Psuedocode
  1061                                  ;----------
  1062                                  ;	See if drive is local (INT 21h, AX=4409 IOCtl)
  1063                                  ;	IF not local
  1064                                  ;	   Display network message
  1065                                  ;	   Fatal_ERROR = YES
  1066                                  ;	ELSE
  1067                                  ;	   IF  8000h bit set on return
  1068                                  ;	      Display assign message
  1069                                  ;	      Fatal_Error = YES
  1070                                  ;	   ENDIF
  1071                                  ;	ENDIF
  1072                                  ;	ret
  1073                                  ;*****************************************************************************
  1074                                  
  1075                                  Procedure Check_For_Network			;				;AN000;
  1076                                  						;
  1077 00000C5B 8A1E[0000]              	mov	bl,[Drive]			;Drive is 0=A, 1=B		;     ;
  1078 00000C5F FEC3                    	inc	bl				;Get 1=A, 2=B for IOCtl call	;     ;
  1079 00000C61 B009                    	mov	al,09h				;See if drive is local or remote;AC000;
  1080 00000C63 B444CD21                	DOS_CALL IOCtl				;We will not check for error	;AC000;
  1081 00000C67 F7C20012                	test	dx,Net_Check			;if (x & 1200H)(redir or shared);     ;
  1082                                  ;	$IF	NZ				;Found a net drive		;AC000;
  1083 00000C6B 740D                    	JZ DD_IF86
  1084 00000C6D BA[0000]E8(0000)        	   Message MsgNetDrive			;Tell 'em                       ;AC000;
  1085 00000C73 C606[1A01]FF            	   mov	   byte [Fatal_Error],Yes		;Indicate bad stuff		;AN000;
  1086                                  ;	$ELSE					;Local drive, now check assign	;AN000;
  1087 00000C78 EB11                    	JMP SHORT DD_EN86
  1088                                  DD_IF86:
  1089 00000C7A F7C20080                	   test    dx,Assign_Check		;8000h bit is bad news		;     ;
  1090                                  ;	   $IF	   NZ				;Found it			;AC000;
  1091 00000C7E 740B                    	   JZ DD_IF88
  1092 00000C80 BA[0000]E8(0000)        	      Message MsgAssignedDrive		;Tell error			;AC000;
  1093 00000C86 C606[1A01]FF            	      mov     byte [Fatal_Error],Yes		;Indicate bad stuff		;AN000;
  1094                                  ;	   $ENDIF				;				;AN000;
  1095                                  DD_IF88:
  1096                                  ;	$ENDIF					;				;AN000;
  1097                                  DD_EN86:
  1098 00000C8B C3                      	ret					;				;AN000;
  1099                                  
  1100                                  Check_For_Network endp				;				;AN000;
  1101                                  
  1102                                  ;*****************************************************************************
  1103                                  ;Routine name: Check_Translate_Drive
  1104                                  ;*****************************************************************************
  1105                                  ;
  1106                                  ;Description: Do a name translate call on the drive letter to see if it is
  1107                                  ;	      assigned by SUBST or ASSIGN
  1108                                  ;
  1109                                  ;Called Procedures: Message (macro)
  1110                                  ;
  1111                                  ;Change History: Created	5/1/87	       MT
  1112                                  ;
  1113                                  ;Input: Drive
  1114                                  ;	   Fatal_Error = NO
  1115                                  ;
  1116                                  ;Output: Fatal_Error = YES/NO
  1117                                  ;
  1118                                  ;Psuedocode
  1119                                  ;----------
  1120                                  ;	Put drive letter in ASCIIZ string "d:\",0
  1121                                  ;	Do name translate call (INT 21)
  1122                                  ;	IF drive not same
  1123                                  ;	   Display assigned message
  1124                                  ;	   Fatal_Error = YES
  1125                                  ;	ENDIF
  1126                                  ;	ret
  1127                                  ;*****************************************************************************
  1128                                  
  1129                                  Procedure Check_Translate_Drive 		;				;AN000;
  1130                                  						;
  1131 00000C8C 8A1E[0000]              	mov	bl,[Drive]			;Get drive			;     ;
  1132 00000C90 001E[0000]              	add	byte ptr [TranSrc],bl		;Make string "d:\"		;     ;
  1133 00000C94 BE[0000]                	mov	si,offset TranSrc		;Point to translate string	;     ;
  1134 00000C97 1E                      	push	ds				;Set ES=DS (Data segment)	;     ;
  1135 00000C98 07                      	pop	es				;     "  "	"  "		;     ;
  1136 00000C99 BF[9A00]                	mov	di,offset Command_Line_Buffer	;Point at output buffer 	;     ;
  1137 00000C9C B460CD21                	DOS_Call xNameTrans			;Get real path			;AC000;
  1138 00000CA0 8A1E[0000]              	mov	bl,byte ptr [TranSrc]		;Get drive letter from path	;     ;
  1139 00000CA4 3A1E[9A00]              	cmp	bl,byte ptr [Command_Line_Buffer] ;Did drive letter change?	;     ;
  1140                                  ;	$IF	NE				;If not the same, it be bad	;AC000;
  1141 00000CA8 740B                    	JE DD_IF91
  1142 00000CAA BA[0000]E8(0000)        	   Message MsgAssignedDrive		;Tell user			;AC000;
  1143 00000CB0 C606[1A01]FF            	   mov	   byte [Fatal_Error],Yes		;Setup error flag		;AN000;
  1144                                  ;	$ENDIF					;				;AN000;
  1145                                  DD_IF91:
  1146 00000CB5 C3                      	ret					;				;AN000;
  1147                                  
  1148                                  Check_Translate_Drive endp			;				;AN000;
  1149                                  
  1150                                  ;*****************************************************************************
  1151                                  ;Routine name: Hook_CNTRL_C
  1152                                  ;*****************************************************************************
  1153                                  ;
  1154                                  ;Description: Change the interrupt handler for INT 13h to point to the
  1155                                  ;	      ControlC_Handler routine
  1156                                  ;
  1157                                  ;Called Procedures: None
  1158                                  ;
  1159                                  ;Change History: Created	4/21/87 	MT
  1160                                  ;
  1161                                  ;Input: None
  1162                                  ;
  1163                                  ;Output: None
  1164                                  ;
  1165                                  ;Psuedocode
  1166                                  ;----------
  1167                                  ;
  1168                                  ;	Point at ControlC_Handler routine
  1169                                  ;	Set interrupt handler (INT 21h, AX=2523h)
  1170                                  ;	ret
  1171                                  ;*****************************************************************************
  1172                                  
  1173                                  Procedure Hook_CNTRL_C				;				;AN000;
  1174                                  						;
  1175 00000CB6 B023                    	mov	al,23H				;Specify CNTRL handler		;     ;
  1176 00000CB8 BA[0000]                	mov	dx, offset ControlC_Handler	;Point at it			;     ;
  1177 00000CBB 1E                      	push	ds				;Save data seg			;     ;
  1178 00000CBC 0E                      	push	cs				;Point to code segment		;     ;
  1179 00000CBD 1F                      	pop	ds				;				;     ;
  1180 00000CBE B425CD21                	DOS_Call Set_Interrupt_Vector		;Set the INT 23h handler	;AC000;
  1181 00000CC2 1F                      	pop	ds				;Get Data degment back		;     ;
  1182 00000CC3 C3                      	ret					;				;AN000;
  1183                                  
  1184                                  Hook_CNTRL_C endp				;				;AN000;
  1185                                  
  1186                                  ;=========================================================================
  1187                                  ; Check_For_Invalid_Drive	: This routine checks the AX received by
  1188                                  ;				  FORMAT on its entry.	This value will
  1189                                  ;				  tell us if we are attempting to format
  1190                                  ;				  a JOINED drive.
  1191                                  ;
  1192                                  ;	Inputs	: Org_AX	- AX on entry to FORMAT
  1193                                  ;
  1194                                  ;	Outputs : Fatal_Error	- Yes if AL contained FFh
  1195                                  ;=========================================================================
  1196                                  
  1197                                  Procedure Check_For_Invalid_Drive		;an000; dms;
  1198                                  
  1199 00000CC4 50                      	push	ax				;an000; dms;save ax
  1200 00000CC5 803E[0000]FF            	cmp	byte [FAT_Flag],Yes			;an000; dms;FAT system?
  1201                                  ;	$if	e				;an000; dms;yes
  1202 00000CCA 751F                    	JNE DD_IF93
  1203 00000CCC A1[0000]                		mov	ax,[Org_AX]		;an000; dms;get its org. value
  1204 00000CCF 3CFF                    		cmp	al,0ffh 		;an000; dms;Invalid drive?
  1205                                  ;		$if	e			;an000; dms;yes
  1206 00000CD1 7518                    		JNE DD_IF94
  1207 00000CD3 C606[1A01]FF            			mov	byte [Fatal_Error],YES ;an000; dms;flag an error
  1208 00000CD8 B80F00                  			mov	ax,Invalid_Drive;an000; dms;error message
  1209 00000CDB 1EBA[ssss]8EDAA3-       			Extended_Message	;an000; dms;tell error
  1209 00000CE2 [0000]BA[0000]E8-  
  1209 00000CE8 (0000)1F           
  1210                                  ;		$endif				;an000; dms;
  1211                                  DD_IF94:
  1212                                  ;	$endif					;an000; dms;
  1213                                  DD_IF93:
  1214 00000CEB 58                      	pop	ax				;an000; dms;
  1215 00000CEC C3                      	ret					;an000; dms;
  1216                                  
  1217                                  Check_For_Invalid_Drive endp			;an000; dms;
  1218                                  
  1219                                  
  1220                                  ;=========================================================================
  1221                                  ; Determine_FAT_Non_FAT 	- This routine determines whether or
  1222                                  ;				  not a device is formatted to a FAT
  1223                                  ;				  specification versus a Non-FAT
  1224                                  ;				  specification.
  1225                                  ;
  1226                                  ;	Inputs	: DX - Pointer to device parameters buffer
  1227                                  ;
  1228                                  ;	Outputs : DeviceParameters - buffer containing BPB.
  1229                                  ;
  1230                                  ;	Date	: 11/6/87
  1231                                  ;=========================================================================
  1232                                  
  1233                                  Procedure Determine_FAT_Non_FAT 						;an012; dms;
  1234                                  
  1235 00000CED 50                      	push	ax								;an012; dms;save regs
  1236 00000CEE 52                      	push	dx								;an012; dms;
  1237                                  
  1238                                  deviceParameters equ DeviceParameters	; NASM port label
  1239 00000CEF 8D16[0000]              	lea	dx, [deviceParameters]						;an012; dms;point to buffer
  1240                                  DP_SpecialFunctions equ DP_SPECIALFUNCTIONS	; NASM port equate
  1241 00000CF3 C606[0000]00            	mov	byte [deviceParameters + DP_SpecialFunctions], 0 			;an012; dms;get default BPB
  1242 00000CF8 E8(0000)                	call	GetDeviceParameters						;an012; dms;make the call
  1243                                  ;	$if	nc								;an012; dms;no error occurred
  1244 00000CFB 721C                    	JC DD_IF97
  1245                                  BPB_NumberOfFATS equ BPB_NUMBEROFFATS	; NASM port equate
  1246 00000CFD 803E[0C00]00            		cmp	byte [DeviceParameters + DP_BPB + BPB_NumberOfFATS],00h	;an012; dms;non-FAT system?
  1247                                  ;		$if	e							;an012; dms;yes
  1248 00000D02 7510                    		JNE DD_IF98
  1249 00000D04 C606[0000]00            			mov	byte [FAT_Flag],No					;an012; dms;signal system non-FAT
  1250 00000D09 B8075F                  			mov	ax,5f07h					;an012; dms;allow access to disk
  1251 00000D0C 8A16[0000]              			mov	dl,[Drive]					;an012; dms;get 0 based driver number
  1252 00000D10 CD21                    			int	21h						;an012; dms;allow access to the drive
  1253                                  ;		$else								;an012; dms;FAT system
  1254 00000D12 EB05                    		JMP SHORT DD_EN98
  1255                                  DD_IF98:
  1256 00000D14 C606[0000]FF            			mov	byte [FAT_Flag],Yes					;an012; dms;flag FAT system
  1257                                  ;		$endif								;an012; dms;
  1258                                  DD_EN98:
  1259                                  ;	$endif									;an012; dms;
  1260                                  DD_IF97:
  1261                                  
  1262 00000D19 5A                      	pop	dx								;an012; dms;restore regs
  1263 00000D1A 58                      	pop	ax								;an012; dms;
  1264                                  
  1265 00000D1B C3                      	ret									;an012; dms;
  1266                                  
  1267                                  Determine_FAT_Non_FAT	endp							;an012; dms;
  1268                                  
  1269                                  
  1270                                  
  1271                                  
  1272                                  ; (no prior section) ; code	ends
  1273                                  	end
