Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-1


					PAGE	90,132			;AN000;A2
					TITLE	DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS
				;****************** START OF SPECIFICATIONS *****************************
				; MODULE NAME: DCOPYPAR.SAL
				;
				; DESCRIPTIVE NAME: Handle the definition of the DOS command line parameters
				;		    and the interface to the DOS system PARSER.
				;
				;FUNCTION: The static data areas are prescribed by the DOS system PARSER
				;	   to define the several parameters presented to DISKCOPY.  These
				;	   data areas are passed to the PARSER, and its responses checked
				;	   to determine the nature of the user's specifications.  Any errors
				;	   found in the user's parameters are defined in messages back
				;	   to the user.
				;
				; ENTRY POINT: PARSER, near
				;
				; INPUT: (DOS COMMAND LINE PARAMETERS)
				;
				;	      [d:][path] DISKCOPY  [d: [d:]][/1]
				;
				;	 WHERE
				;	      [d:][path] - Path where the DISKCOPY command resides.
				;
				;	      [d:] - To specify the Source drive
				;
				;	      [d:] - To specify the Destination drive
				;
				;	      [/1] - To copy only the first side of the diskette,
				;		     regardless of the diskette or drive type.
				;
				;	Upon entry to PARSER in this module,
				;	"CURRENT_PARM" = offset to start of parm text in command string
				;	"ORDINAL" = initialized to zero
				;	PSP+81H = text of DOS command line parms string
				
				; EXIT-NORMAL:
				;      "SOURCE_DRIVE" = CHAR OF FIRST DRIVE ID SPECIFIED, BLANK IF NONE
				;      "TARGET_DRIVE" = CHAR OF SECOND DRIVE ID IF BOTH SPECIFIED, BLANK
				;		   IF NONE OR ONLY ONE SPECIFIED
				;      "USER_OPTION" = 01 ON IF /1, -1 IF /1 NOT SPECIFIED.
				
				; EXIT-ERROR:
				;      IF ERROR, ERROR MESSAGE IS DISPLAYED, AND "EXITFL" HAS "EXPAR".
				
				; INTERNAL REFERENCES:
				;    ROUTINES:
				;	PARSER:NEAR Call the system Parser to decode command line
				;	PARSE_ERROR:NEAR Display the appropriate Parse error message.
				
				;    DATA AREAS:
				;	The several parameter control blocks, defined by the System
				;	PARSER interface, defining the DISKCOPY parameters.
				
				; EXTERNAL REFERENCES:
				;    ROUTINES:
				;	SENDMSG:NEAR	Uses Msg Descriptor to drive message handler.
				;	SYSPARSE:NEAR	System Command Line Common Parser.
				;
				;    DATA AREAS:
				;	EXITFL:BYTE	Errorlevel return code.
				;	MSGNUM_PARSE:WORD Message descriptor for all parse errors.
				;	USER_OPTION:BYTE /1 parm indicator
				;	SOURCE_DRIVE:BYTE character of first specified drive
				;	TARGET_DRIVE:BYTE character of second specified drive
				;
				; NOTES:
				;	 This module should be processed with the SALUT preprocessor
				;	 with the re-alignment not requested, as:
				;
				;		SALUT DCOPYPAR,NUL
				;
				;	 To assemble these modules, the alphabetical or sequential
				;	 ordering of segments may be used.
				;
				;	 For LINK instructions, refer to the PROLOG of the main module,
				;	 DISKCOPY.SAL.
				;
				;PROGRAM AUTHOR: DOS 4.00 EMK
				;****************** END OF SPECIFICATIONS *****************************
				; =  =	=  =  =  =  =  =  =  =	=  =
					INCLUDE PATHMAC.INC		;AN015;PATHGEN MACRO
			     C	;;***********************************************************************
			     C	;; NAME: pathlabl
			     C	;; DESC: creates a public label at the spot it is placed, using the name
			     C	;;       given.
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-2


			     C	;; INPUT: either module name or procedure name
			     C	;; OUTPUT: public label
			     C	;; LOGIC: LBL-parameter-name will have four values -
			     C	;;            - one for each pass (2)
			     C	;;            - one for start and one for stop
			     C	;;        if LBL is not defined, it is first pass, at beginning label
			     C	;;              - set it to 1 and create the start label
			     C	;;        if LBL = 1, it is first pass, at end label
			     C	;;              - set it to 2 and create stop label
			     C	;;        if LBL = 2, it is second pass, at beginning label
			     C	;;              - set it to 3 and create the start label
			     C	;;        if LBL = 3, it is second pass, at end label
			     C	;;              - set it to 4 and create stop label
			     C	;;        if LBL = 4, it is second pass,
			     C	;;              - this macro has been invoked more than twice with same parm
			     C	;;              - issue error message
			     C	;;***********************************************************************
			     C	
			     C	pathlabl MACRO pnam
			     C	IFNDEF LBL_&pnam                        ;;IF THIS IS THE FIRST TIME,
			     C	    LBL_&pnam = 0                       ;;DEFINE IT, INITIALLY ZERO
			     C	ELSE                                    ;;SINCE IT IS DEFINED
			     C	    IF (LBL_&pnam GT 3)                 ;;IF USED TOO MANY TIMES,
			     C	        .ERR NON-UNIQUE OPERAND ON PATHLABL
			     C	        EXITM                           ;;ABORT THIS GENERATION
			     C	    ENDIF
			     C	ENDIF
			     C	
			     C	IF (LBL_&pnam EQ 0) OR (LBL_&pnam EQ 2) ;;ready for START?
			     C	    $$A_START_&pnam:                    ;;create START label
			     C	    PUBLIC $$A_START_&pnam              ;;make it public
			     C	ELSE                                    ;;SINCE SWITCH MAY BE 1 OR 3,
			     C	    $$A_STOP_&pnam:                     ;;create STOP label
			     C	    PUBLIC $$A_STOP_&pnam               ;;make it public
			     C	ENDIF
			     C	LBL_&pnam = LBL_&pnam + 1               ;;INCREMENT SWITCH
			     C	ENDM
				; =  =	=  =  =  =  =  =  =  =	=  =
				HEADER	MACRO	TEXT			;;AN000;
				.XLIST					;;AN000;
					SUBTTL	TEXT			;;AN000;
				.LIST					;;AN000;
					PAGE				;;AN000;
					ENDM				;;AN000;
				; =  =	=  =  =  =  =  =  =  =	=  =
				;		      $SALUT (4,23,28,36) ;AN000;
				;		LOCAL EQUATES
				
 = 0000				FALSE		      EQU  0	   ;AN000;RETURN VALUES FOR
 = FFFF				TRUE		      EQU  NOT FALSE ;AN000; /1 SWITCH
 = 0041				CHAR_A		      EQU  "A"	   ;AN000;ASCII VALUE OF CHARACTER "A"
 = 0020				BLANK		      EQU  " "	   ;AN001;
 = 0000				NUL		      EQU  0	   ;AN003;
				; =  =	=  =  =  =  =  =  =  =	=  =
				;		EXIT CODES FROM SYSPARSE (WHEN CY=0)
				
 = 0000				SYSPRM_EX_OK	      EQU  0	   ;AN000; no error
 = 0001				SYSPRM_EX_MANY	      EQU  1	   ;AN000; too many operands
 = 0002				SYSPRM_EX_MISSING     EQU  2	   ;AN000; required operand missing
 = 0003				SYSPRM_EX_NOT_SWLIST  EQU  3	   ;AN000; not in switch list provided
 = 0004				SYSPRM_EX_NOT_KEYLIST EQU  4	   ;AN000; not in keyword list provided
 = 0006				SYSPRM_EX_RANGE       EQU  6	   ;AN000; out of range specified
 = 0007				SYSPRM_EX_VALUE       EQU  7	   ;AN000; not in value list provided
 = 0008				SYSPRM_EX_STRING      EQU  8	   ;AN000; not in string list provided
 = 0009				SYSPRM_EX_SYNTAX      EQU  9	   ;AN000; syntax error
 =-0001				SYSPRM_EX_EOL	      EQU  -1	   ;AN000; end of command line
				; =  =	=  =  =  =  =  =  =  =	=  =
						      HEADER <STRUC - DEFINITIONS OF EXTERNAL CONTROL BLOCKS> ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-3
STRUC - DEFINITIONS OF EXTERNAL CONTROL BLOCKS			;          

				PSP		      STRUC	   ;AN000;
 0000  0080[					      DB   80H DUP (?) ;AN000;SKIP OVER FIRST HALF OF PSP
	   ??			
			 ]	
				
 0080  00			PSP_PARMLEN	      DB   ?	   ;AN000;NUMBER OF BYTES IN DOS COMMAND LINE
 0081  007F[			PSP_COMMAND	      DB   127 DUP(?) ;AN000;TEXT OF DOS COMMAND LINE
	   ??			
			 ]	
				
 0100				PSP		      ENDS	   ;AN000;
				
				MSG_DESC	      STRUC	   ;AN003;
 0000  0000			MSG_NUM 	      DW   ?	   ;AN003;MESSAGE NUMBER (TO AX)
 0002  0000			MSG_HANDLE	      DW   ?	   ;AN003;HANDLE OF OUTPUT DEVICE (TO BX)
 0004  0000			MSG_SUBLIST	      DW   ?	   ;AN003;POINTER TO SUBLIST (TO SI)
 0006  0000			MSG_COUNT	      DW   ?	   ;AN003;SUBSTITUTION COUNT (TO CX)
 0008  0000			MSG_CLASS	      DW   ?	   ;AN003;MESSAGE CLASS (IN HIGH BYTE, TO DH)
								   ; LOW BYTE HAS 0 (FUNCTION "NO INPUT", TO DL)
 000A				MSG_DESC	      ENDS	   ;AN003;
				
 = 0001				ONE_SUBS	      EQU  1	   ;AN003;NUMBER OF VARIABLES
				
				SUBLIST 	      STRUC	   ;AN000;
 0000  00			SUB_SIZE	      DB   ?	   ;AN003;SUBLIST SIZE (POINTER TO NEXT SUBLIST)
 0001  00			SUB_RES 	      DB   ?	   ;AN003;RESERVED
								   ;NEXT FIELD IS TO BE USED AS A DOUBLE WORD
 0002  0000			SUB_VALUE	      DW   ?	   ;AN003;TIME, DATE, OR PTR TO DATA ITEM
 0004  0000			SUB_VALUE_SEG	      DW   ?	   ;AN003;SEG ID OF PTR
								   ;(ABOVE FIELD MUST BE FILLED AT EXECUTION TIME
								   ; IF THIS IS A .COM FILE)
 0006  00			SUB_ID		      DB   ?	   ;AN003;N OF %N
 0007  00			SUB_FLAGS	      DB   ?	   ;AN003;DATA TYPE FLAGS
 0008  00			SUB_MAX_WIDTH	      DB   ?	   ;AN003;MAXIMUM FIELD WIDTH (0=UNLIMITED)
 0009  00			SUB_MIN_WIDTH	      DB   ?	   ;AN003;MINIMUM FIELD WIDTH
 000A  00			SUB_PAD_CHAR	      DB   ?	   ;AN003;CHARACTER FOR PAD FIELD
								   ; CAN BE " ", "0" OR ",".
								   ; "," CAUSES INSERTION OF THE ACTIVE
								   ; THOUSANDS SEPARATOR BETWEEN EVERY 3 DIGITS.
 000B				SUBLIST 	      ENDS	   ;AN003;
				
				; =  =	=  =  =  =  =  =  =  =	=  =
						      HEADER <PARSING WORKAREAS> ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-4
PARSING WORKAREAS			;                                       

				;	     $SALUT (4,14,19,36)   ;AN000;
					     EXTRN EXPAR:ABS	   ;AN000;ERRORLEVEL VALUE FOR BAD PARMS
					     EXTRN FINE:ABS	   ;AN000;RETURN STATUS INDICATOR
 0000				CSEG	     SEGMENT PARA PUBLIC 'CODE' ;AN000;
					     ASSUME CS:CSEG,DS:CSEG,ES:CSEG,SS:CSEG ;AN000;
				
					     EXTRN SENDMSG:NEAR    ;AN000;USES MSG DESCRIPTOR TO DRIVE MESSAGE HANDLR
					     EXTRN SYSPARSE:NEAR   ;AN000;SYSTEM COMMAND LINE PARSER
				
					     EXTRN EXITFL:BYTE	   ;AN000;ERRORLEVEL RETURN CODE
				
					     EXTRN SOURCE_DRIVE:BYTE ;AN000;FIRST DRIVE LETTER SPECIFIED IN PARMS
					     EXTRN TARGET_DRIVE:BYTE ;AN000;SECOND DRIVE LETTER SPECIFIED
				
					     EXTRN USER_OPTION:BYTE ;AN000;NO OPTION (-1)  /1 (1), INVALID (9)
 =-0001				NO_OPTION    EQU  -1		   ;AN000;NO OPTION "/1" SPECIFIED
 = 0001				OPTION_1     EQU  1		   ;AN000;OPTION "/1" SPECIFIED
					     EXTRN MSGNUM_PARSE:WORD ;AN000;MESSAGE DESCRIPTOR FOR ALL PARSE ERRORS
					     EXTRN MSGNUM_INVALID_PARM2:WORD ;AN005;HELP INFO
					     EXTRN SUBLIST_PARSE:WORD ;AN003;POINTS TO INVALID PARM
				; =  =	=  =  =  =  =  =  =  =	=  =
				
 0000  0081			CURRENT_PARM DW   81H		   ;AN000;POINTER INTO COMMAND OF NEXT OPERAND
					     PUBLIC CURRENT_PARM   ;AN000;
				
 0002  0000			ORDINAL      DW   0		   ;AN000;ORDINAL NUMBER OF WHICH PARM TO PARSE
					     PUBLIC ORDINAL	   ;AN000;
				
				; =  =	=  =  =  =  =  =  =  =	=  =
					     HEADER <DOS COMMAND LINE PARSER CONTROL BLOCKS> ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-5
DOS COMMAND LINE PARSER CONTROL BLOCKS			;                  

				
				;INPUT PARAMETERS CONTROL BLOCK, POINTED TO BY ES:DI WHEN CALLING PARSER
				
					     PUBLIC PARMS	   ;AN000;LET LINK MAKE PARMS BLOCK ADDRESSABLE
 0004				PARMS	     LABEL BYTE 	   ;AN000;PARMS CONTROL BLOCK
 0004  0007 R				     DW   PARMSX	   ;AN000;POINTER TO PARMS EXTENSION
 0006  00				     DB   0		   ;AN000; NUMBER OF STRINGS (0, 1, 2)
								   ; NEXT LIST WOULD BE EXTRA DELIM LIST
								   ;  (,& WHITESPACE ALWAYS)
								   ; NEXT LIST WOULD BE EXTRA END OF LINE LIST
								   ;  (CR,LF,0 ALWAYS)
				
				;SYSTEM PARSER PARAMETER EXTENSION CONTROL BLOCK
 0007				PARMSX	     LABEL BYTE 	   ;AN000;PARMS EXTENSION CONTROL BLOCK
 0007  00 02				     DB   0,2		   ;AN000; MIN, MAX POSITIONAL OPERANDS ALLOWED
 0009  0011 R				     DW   CONTROL_POS	   ;AN000; DESCRIPTION OF POSITIONAL 1
 000B  0011 R				     DW   CONTROL_POS	   ;AN000; DESCRIPTION OF POSITIONAL 2
				
 000D  01				     DB   1		   ;AN000; MAX SWITCH OPERANDS ALLOWED
 000E  0020 R				     DW   CONTROL_SW	   ;AN000; DESCRIPTION OF SWITCH 1
				
 0010  00				     DB   0		   ;AN000; MAX KEYWORD OPERANDS ALLOWED
								   ; THERE IS NO CONTROL BLOCK
								   ;  DEFINING KEYWORDS
				
				; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
					     HEADER <POSITIONAL PARM DESCRIPTOR BLOCK> ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-6
POSITIONAL PARM DESCRIPTOR BLOCK			;                        

				;PARSER CONTROL BLOCK DEFINING THE ONLY POSITIONAL PARAMETER, OPTIONAL
				
				;FIRST POSITIONAL PARAMETER IS:
				;	[D:] - SPECIFY THE SOURCE DRIVE.
				
					     PUBLIC CONTROL_POS    ;AN000;LET LINK MAKE THIS ADDRESSABLE
 0011				CONTROL_POS  LABEL BYTE 	   ;AN000;FIRST POSITIONAL DESCRIPTOR FOR FILESPEC,
								   ; OPTIONAL
 0011  0101				     DW   0101H 	   ;AN000; CONTROLS TYPE MATCHED
								   ; SELECTED BITS: "DRIVE ONLY" AND "OPTIONAL"
				
								   ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED)
								   ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE
								   ;   CHECKED)
								   ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED)
								   ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED)
								   ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED)
								   ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED)
								   ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED)
								   ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED)
								   ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED)
								   ; 0010H=IGNORE ":" AT END IN MATCH
								   ; 0002H=REPEATS ALLOWED
								   ; 0001H=OPTIONAL
				
 0013  0002				     DW   0002H 	   ;AN000;FUNCTION_FLAGS
								   ; 0001H=CAP RESULT BY FILE TABLE
								   ; 0002H=CAP RESULT BY CHAR TABLE
								   ; 0010H=REMOVE ":" AT END
 0015  001B R				     DW   RESULT1	   ;AN000; RESULT BUFFER
 0017  001A R				     DW   NOVALS	   ;AN000; NO VALUE LISTS
 0019  00				     DB   0		   ;AN000; NUMBER OF KEYWORD/SWITCH SYNONYMS
								   ;   IN FOLLOWING LIST
				
				;VALUE CONTROL BLOCK FOR THE POSITIONAL PARAMETERS
 001A  00			NOVALS	     DB   0		   ;AN000;NO VALUE DEFINITIONS
				
				;RESULTS CONTROL BLOCK FOR THE POSITIONAL PARAMETER
 001B				RESULT1      LABEL BYTE 	   ;AN000; BELOW FILLED IN FOR DEFAULTS
 001B  06				     DB   6		   ;AN000; TYPE RETURNED: 0=RESERVED,
								   ;	   1=NUMBER, 2=LIST INDEX,
								   ;	   3=STRING, 4=COMPLEX,
								   ;	   5=FILESPEC, 6=DRIVE
								   ;	   7=DATE, 8=TIME
								   ;	   9=QUOTED STRING
 001C  FF			RESULT_TAG   DB   0FFH		   ;AN000; MATCHED ITEM TAG
 001D  0000				     DW   0		   ;AN000;POINTER TO SYNONYM
				
 001F  00			RESULT_PTR1  DB   ?		   ;AN000;DRIVE NUMBER (A=1, B=2, ETC)
				
				; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
					     HEADER <SWITCH PARM DESCRIPTOR BLOCK> ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-7
SWITCH PARM DESCRIPTOR BLOCK			;                            

				;PARSER CONTROL BLOCK DEFINING THE ONLY SWITCH, OPTIONAL
				
				;THE SWITCH IS "/1", MEANING ONLY COPY FIRST SIDE.
				
					     PUBLIC CONTROL_SW	   ;AN000;LET LINK MAKE THIS ADDRESSABLE
 0020				CONTROL_SW   LABEL BYTE 	   ;AN000;SWITCH DESCRIPTOR FOR /1
 0020  0001				     DW   0001H 	   ;AN000; CONTROLS TYPE MATCHED
								   ;SELECTED BITS: "OPTIONAL"
								   ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED)
								   ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE
								   ;   CHECKED)
								   ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED)
								   ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED)
								   ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED)
								   ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED)
								   ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED)
								   ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED)
								   ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED)
								   ; 0010H=IGNORE ":" AT END IN MATCH
								   ; 0002H=REPEATS ALLOWED
								   ; 0001H=OPTIONAL
				
 0022  0002				     DW   0002H 	   ;AN000;FUNCTION_FLAGS
								   ; 0001H=CAP RESULT BY FILE TABLE
								   ; 0002H=CAP RESULT BY CHAR TABLE
								   ; 0010H=REMOVE ":" AT END
				
 0024  002C R				     DW   RESULTSW1	   ;AN000; RESULT BUFFER
 0026  001A R				     DW   NOVALS	   ;AN000; VALUE LISTS
 0028  01				     DB   1		   ;AN000; NUMBER OF KEYWORD/SWITCH SYNONYMS
								   ;   IN FOLLOWING LIST
 0029  2F 31 00			SW_1	     DB   "/1",0	   ;AN000; IF n >0, SWITCH 1
				
				;RESULTS CONTROL BLOCK FOR THE SWITCHES
 002C				RESULTSW1    LABEL BYTE 	   ;AN000; BELOW FILLED IN FOR DEFAULTS
 002C  03				     DB   3		   ;AN000; TYPE RETURNED: 0=RESERVED,
								   ;	   1=NUMBER, 2=LIST INDEX,
								   ;	   3=STRING, 4=COMPLEX,
								   ;	   5=FILESPEC, 6=DRIVE
								   ;	   7=DATE, 8=TIME
								   ;	   9=QUOTED STRING
 002D  FF				     DB   0FFh		   ;AN000; MATCHED ITEM TAG
				
 002E  0000				     DW   0		   ;AN000; SYNONYM POINTER (BASED ON ES:)
 0030  00000000			RESULT_PTR2  DD   ?		   ;AN000; OFFSET OF STRING VALUE
				; =  =	=  =  =  =  =  =  =  =	=  =
					     PATHLABL DCOPYPAR	   ;AN015;
 0034                        1	    $$A_START_DCOPYPAR:                    ; 
					     HEADER <PARSER - ASK SYSPARM TO DECODE PARAMETERS> ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-8
PARSER - ASK SYSPARM TO DECODE PARAMETERS			;               

				;  $SALUT (4,4,9,36)		   ;AN000;
 0034				PARSER PROC NEAR		   ;AN000;
				   PUBLIC PARSER		   ;AN000;
				
				;INPUT: "CURRENT_PARM" = OFFSET TO NEXT PARM IN COMMAND STRING
				;	"ORDINAL" = COUNT OF NEXT PARM TO PARSE
				;	PSP+81H = TEXT OF DOS COMMAND LINE PARMS STRING
				;OUTPUT: "SOURCE_DRIVE" = VALUE OF FIRST DRIVE ID SPECIFIED, 0 IF NONE
				;	 "TARGET_DRIVE" = VALUE OF SECOND DRIVE ID IF BOTH SPECIFIED, 0
				;		     IF NONE OR ONLY ONE SPECIFIED
				;	 "USER_OPTION" = "OPTION_1" IF /1 SPECIFIED, -1 IF NOT SPECIFIED
				;	IF ERROR, ERROR MESSAGE IS DISPLAYED, AND "EXITFL" HAS "EXPAR".
				;	DX="FINE" IF NO ERROR, OR HAS OFFSET OF PARSE ERROR DESCRIPTOR IF PROBLEM
				; =  =	=  =  =  =  =  =  =  =	=  =
				
 0034  C6 06 0000 E FF		   MOV	USER_OPTION, NO_OPTION	   ;AN000;ASSUME NO /1 IS ENTERED.
				;  $SEARCH COMPLEX		   ;AN000;LOOP THRU COMMAND LINE
 0039  EB 2F			   JMP SHORT $$SS1
 003B				$$DO1:
								   ;LOOKING AT RETURN CODE FROM SYSPARSE...
 003B  3D 0000			       CMP  AX,SYSPRM_EX_OK	   ;AN000;WERE THERE ANY ERRORS?
				;  $EXITIF NE			   ;AN000;HAD A PROBLEM
 003E  74 05			   JE $$IF1
 0040  E8 0084 R		       CALL PARSE_ERROR 	   ;AN000;DISPLAY REASON FOR ERROR
				
				;  $ORELSE			   ;AN000;SINCE NO PROBLEM, SO FAR
 0043  EB 3E			   JMP SHORT $$SR1
 0045				$$IF1:
 0045  89 0E 0002 R		       MOV  ORDINAL,CX		   ;AN000;SAVE UPDATED COUNT
 0049  89 36 0000 R		       MOV  CURRENT_PARM,SI	   ;AN000;REMEMBER HOW FAR I GOT
 004D  8B DA			       MOV  BX,DX		   ;AN000;SET DATA BASE REG TO POINT TO THIS OPERAND
 004F  81 FB 001B R		       CMP  BX,OFFSET RESULT1	   ;AN000;WAS POSITIONAL PARM SPECIFIED?
				;      $IF  E			   ;AN000;IF POSITIONAL PARM SPECIFIED,
 0053  75 0B			       JNE $$IF4
 0055  8B F1				   MOV	SI,CX		   ;AN000;USE COUNT OF POSITIONALS AS INDEX
 0057  A0 001F R			   MOV	AL,RESULT_PTR1	   ;AN000;GET VALUE OF DRIVE (A=1, B=2, ETC)
 005A  88 84 FFFF E			   MOV	SOURCE_DRIVE-1[SI],AL ;AN000;SAVE RESPONSE VALUE
								   ;IN EITHER SOURCE_DRIVE OR TARGET_DRIVE
								   ;ACCORDING TO ORDINAL IN SI (FROM CX)
				;      $ELSE			   ;AN000;SINCE NOT POSITIONAL PARM SPECIFIED
 005E  EB 0A			       JMP SHORT $$EN4
 0060				$$IF4:
 0060  C6 06 0029 R 20			   MOV	SW_1,BLANK	   ;AN001;AVOID GETTING DUPLICATE SWITCH
 0065  C6 06 0000 E 01			   MOV	USER_OPTION,OPTION_1 ;AN000;MUST HAVE BEEN THE SWITCH, /1
				;      $ENDIF			   ;AN000;
 006A				$$EN4:
				;  $STRTSRCH			   ;AN000;
 006A				$$SS1:
 006A  8D 3E 0004 R		       LEA  DI,PARMS		   ;AN000; ES:DI = PARSE CONTROL DEFINITON
 006E  8B 36 0000 R		       MOV  SI,CURRENT_PARM	   ;AN000; DS:SI = COMMAND STRING, NEXT PARM
 0072  33 D2			       XOR  DX,DX		   ;AN000; RESERVED, INIT TO ZERO
 0074  8B 0E 0002 R		       MOV  CX,ORDINAL		   ;AN000; OPERAND ORDINAL, INITIALLY ZERO
 0078  E8 0000 E		       CALL SYSPARSE		   ;AN000;LOOK AT DOS PARMS
								   ; AX=EXIT CODE
								   ; BL=TERMINATED DELIMETER CODE
								   ; CX=NEW OPERAND ORDINAL
								   ; SI=SET TO PAST SCANNED OPERAND
								   ; DX=SELECTED RESULT BUFFER
 007B  3D FFFF			       CMP  AX,SYSPRM_EX_EOL	   ;AN000; IS THAT THE END OF THE PARMS?
								   ;IF NOT, LOOP BACK AND FIND OUT
								   ; WHAT THAT PARM IS
				;  $ENDLOOP E			   ;AN000;END OF LIST
 007E  75 BB			   JNE $$DO1
 0080  BA 0000 E		       MOV  DX,FINE		   ;AN000;REPORT THAT PARSER WENT OK
				;  $ENDSRCH			   ;AN000;FINISHED WITH DOS COMMAND LINE
 0083				$$SR1:
 0083  C3			   RET				   ;AN000;RETURN TO CALLER
 0084				PARSER ENDP			   ;AN000;
				; =  =	=  =  =  =  =  =  =  =	=  =
				   HEADER <PARSE_ERROR - DISPLAY REASON FOR PARSE ERROR> ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Page     1-9
PARSE_ERROR - DISPLAY REASON FOR PARSE ERROR			;            

 0084				PARSE_ERROR PROC NEAR		   ;AN000;
				;INPUT:  AX - ERROR NUMBER RETURNED FROM PARSE.
				;	 "CURRENT_PARM" - OFFSET TO WHERE THE BAD PARM STARTED
				;OUTPUT: APPROPRIATE ERROR MESSAGE IS PREPARED FOR DISPLAY.
				;	 DX IS SET TO OFFSET OF PARSE ERROR DESCRIPTOR.
				; =  =	=  =  =  =  =  =  =  =	=  =
				
 0084  A3 0000 E		   MOV	MSGNUM_PARSE,AX 	   ;AN000;PASS MESSAGE NUMBER TO DESCRIPTOR
 0087  C6 06 0000 E 00 E	   MOV	EXITFL,EXPAR		   ;AN000;ERRORLEVEL CODE TO "PARM ERROR"
 008C  A1 0000 R		   MOV	AX,CURRENT_PARM 	   ;AN003;GET POINTER TO START OF BAD PARM
 008F  3B F0			   CMP	SI,AX			   ;AN003;HAS THE INDEX TO COMMAND LINE MOVED?
				;  $IF	NE			   ;AN003;YES, THERE IS A FAULTY PARM
 0091  74 12			   JE $$IF10
 0093  C6 04 00			       MOV  BYTE PTR [SI],NUL	   ;AN003;DELIMIT THE BAD PARM
 0096  A3 0002 E		       MOV  SUBLIST_PARSE.SUB_VALUE,AX ;AN000;POINT SUBLIST TO BAD PARM
				
 0099  C7 06 0004 E 0000 E	       MOV  MSGNUM_PARSE.MSG_SUBLIST,OFFSET SUBLIST_PARSE ;AN003;POINT TO SUBLIST
 009F  C7 06 0006 E 0001	       MOV  MSGNUM_PARSE.MSG_COUNT,ONE_SUBS ;AN003;SET COUNT OF SUBLISTS TO ONE
				;  $ENDIF			   ;AN003;INDEX MOVED?
 00A5				$$IF10:
 00A5  BF 0000 E		   MOV	DI,OFFSET MSGNUM_PARSE	   ;AC005;PASS BACK OFFSET TO PARSE ERR DESCRIPTOR
 00A8  E8 0000 E		   CALL SENDMSG 		   ;AN005;DISPLAY THE ERROR MESSAGE
				
								   ; "Do not specify filename(s)",CR,LF
								   ; "Command Format: DISKCOPY d: d: [/1]",CR,LF
 00AB  BA 0000 E		   MOV	DX,OFFSET MSGNUM_INVALID_PARM2 ;AN005;DISPLAY HELP INFO
 00AE  C3			   RET				   ;AN000;RETURN TO CALLER
 00AF				PARSE_ERROR ENDP		   ;AN000;
				; =  =	=  =  =  =  =  =  =  =	=  =
				   PATHLABL DCOPYPAR		   ;AN015;
 00AF                        1	    $$A_STOP_DCOPYPAR:                     ; 
 00AF				CSEG ENDS			   ;AN000;
				   END				   ;AN000;

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Symbols-1


Macros:

		N a m e			Lines

HEADER . . . . . . . . . . . . .  	   4
PATHLABL . . . . . . . . . . . .  	  16

Structures and Records:

                N a m e                 Width   # fields
                                        Shift   Width   Mask    Initial

MSG_DESC . . . . . . . . . . . .  	000A	0005
  MSG_NUM  . . . . . . . . . . .  	0000
  MSG_HANDLE . . . . . . . . . .  	0002
  MSG_SUBLIST  . . . . . . . . .  	0004
  MSG_COUNT  . . . . . . . . . .  	0006
  MSG_CLASS  . . . . . . . . . .  	0008
PSP  . . . . . . . . . . . . . .  	0100	0003
  PSP_PARMLEN  . . . . . . . . .  	0080
  PSP_COMMAND  . . . . . . . . .  	0081
SUBLIST  . . . . . . . . . . . .  	000B	0009
  SUB_SIZE . . . . . . . . . . .  	0000
  SUB_RES  . . . . . . . . . . .  	0001
  SUB_VALUE  . . . . . . . . . .  	0002
  SUB_VALUE_SEG  . . . . . . . .  	0004
  SUB_ID . . . . . . . . . . . .  	0006
  SUB_FLAGS  . . . . . . . . . .  	0007
  SUB_MAX_WIDTH  . . . . . . . .  	0008
  SUB_MIN_WIDTH  . . . . . . . .  	0009
  SUB_PAD_CHAR . . . . . . . . .  	000A

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

CSEG . . . . . . . . . . . . . .  	00AF	PARA	PUBLIC	'CODE'

Symbols:            

                N a m e         	Type	 Value	 Attr

BLANK  . . . . . . . . . . . . .  	NUMBER	0020	

CHAR_A . . . . . . . . . . . . .  	NUMBER	0041	
CONTROL_POS  . . . . . . . . . .  	L BYTE	0011	CSEG	Global
CONTROL_SW . . . . . . . . . . .  	L BYTE	0020	CSEG	Global
CURRENT_PARM . . . . . . . . . .  	L WORD	0000	CSEG	Global

EXITFL . . . . . . . . . . . . .  	V BYTE	0000	CSEG	External
EXPAR  . . . . . . . . . . . . .  	NUMBER	0000		Communal

FALSE  . . . . . . . . . . . . .  	NUMBER	0000	
FINE . . . . . . . . . . . . . .  	NUMBER	0000		Communal

LBL_DCOPYPAR . . . . . . . . . .  	NUMBER	0004	

MSGNUM_INVALID_PARM2 . . . . . .  	V WORD	0000	CSEG	External
MSGNUM_PARSE . . . . . . . . . .  	V WORD	0000	CSEG	External

NOVALS . . . . . . . . . . . . .  	L BYTE	001A	CSEG
NO_OPTION  . . . . . . . . . . .  	NUMBER	-0001	
NUL  . . . . . . . . . . . . . .  	NUMBER	0000	

ONE_SUBS . . . . . . . . . . . .  	NUMBER	0001	
OPTION_1 . . . . . . . . . . . .  	NUMBER	0001	
ORDINAL  . . . . . . . . . . . .  	L WORD	0002	CSEG	Global

PARMS  . . . . . . . . . . . . .  	L BYTE	0004	CSEG	Global
PARMSX . . . . . . . . . . . . .  	L BYTE	0007	CSEG
PARSER . . . . . . . . . . . . .  	N PROC	0034	CSEG	Global	Length = 0050
PARSE_ERROR  . . . . . . . . . .  	N PROC	0084	CSEG	Length = 002B

RESULT1  . . . . . . . . . . . .  	L BYTE	001B	CSEG
RESULTSW1  . . . . . . . . . . .  	L BYTE	002C	CSEG
RESULT_PTR1  . . . . . . . . . .  	L BYTE	001F	CSEG
RESULT_PTR2  . . . . . . . . . .  	L DWORD	0030	CSEG
RESULT_TAG . . . . . . . . . . .  	L BYTE	001C	CSEG

SENDMSG  . . . . . . . . . . . .  	L NEAR	0000	CSEG	External
SOURCE_DRIVE . . . . . . . . . .  	V BYTE	0000	CSEG	External
SUBLIST_PARSE  . . . . . . . . .  	V WORD	0000	CSEG	External
SW_1 . . . . . . . . . . . . . .  	L BYTE	0029	CSEG
SYSPARSE . . . . . . . . . . . .  	L NEAR	0000	CSEG	External
SYSPRM_EX_EOL  . . . . . . . . .  	NUMBER	-0001	
SYSPRM_EX_MANY . . . . . . . . .  	NUMBER	0001	
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:57
DCOPYPAR.SAL - LOOK AT COMMAND LINE PARMS                   Symbols-2


SYSPRM_EX_MISSING  . . . . . . .  	NUMBER	0002	
SYSPRM_EX_NOT_KEYLIST  . . . . .  	NUMBER	0004	
SYSPRM_EX_NOT_SWLIST . . . . . .  	NUMBER	0003	
SYSPRM_EX_OK . . . . . . . . . .  	NUMBER	0000	
SYSPRM_EX_RANGE  . . . . . . . .  	NUMBER	0006	
SYSPRM_EX_STRING . . . . . . . .  	NUMBER	0008	
SYSPRM_EX_SYNTAX . . . . . . . .  	NUMBER	0009	
SYSPRM_EX_VALUE  . . . . . . . .  	NUMBER	0007	

TARGET_DRIVE . . . . . . . . . .  	V BYTE	0000	CSEG	External
TRUE . . . . . . . . . . . . . .  	NUMBER	FFFF	

USER_OPTION  . . . . . . . . . .  	V BYTE	0000	CSEG	External

$$A_START_DCOPYPAR . . . . . . .  	L NEAR	0034	CSEG	Global
$$A_STOP_DCOPYPAR  . . . . . . .  	L NEAR	00AF	CSEG	Global
$$DO1  . . . . . . . . . . . . .  	L NEAR	003B	CSEG
$$EN4  . . . . . . . . . . . . .  	L NEAR	006A	CSEG
$$IF1  . . . . . . . . . . . . .  	L NEAR	0045	CSEG
$$IF10 . . . . . . . . . . . . .  	L NEAR	00A5	CSEG
$$IF4  . . . . . . . . . . . . .  	L NEAR	0060	CSEG
$$SR1  . . . . . . . . . . . . .  	L NEAR	0083	CSEG
$$SS1  . . . . . . . . . . . . .  	L NEAR	006A	CSEG
@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  dcopypar		
@VERSION . . . . . . . . . . . .  	TEXT  510		


    456 Source  Lines
    516 Total   Lines
     82 Symbols

  46976 + 237930 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
