10
20 :
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250 lptr=&A8
260 FOR P=0 TO 1
270 P%=&900
280 [OPT P*3
290 LDA #&00:STA lptr+0
300 LDA #&0A:STA lptr+1
310 LDY #0
320 :
330 \ Check command parameters to check for DFS *COPY syntax
340 \ ------------------------------------------------------
350 \ Returns A=0 DFS "*COPY d d name" syntax
360 \ A<>0 Generic "*COPY name name (options)" syntax
370 \
380 .CheckCopyCommand
390 TYA:PHA :\ Save line pointer
400 JSR chkdigit:BCS newcopy :\ COPY x x<>digit
410 PHA
420 JSR chkspc:BCS newcopy1 :\ COPY nxxxx 1st param not drive
430 PLA
440 CMP (lptr),Y:BEQ newcopy :\ COPY x y x=y
450 JSR chkdigit:BCS newcopy :\ COPY x y y<>digit
460 JSR chkspc:BCS newcopy :\ COPY n nxxxx 2nd param not drive number
470 CMP #ASC" ":BCC newcopy :\ COPY x y only two parameters
480 LDX #2 :\ option count
490 .loop
500 LDA (lptr),Y
510 CMP #ASC"~":BEQ newcopy :\ COPY x y ...~... copy option
520 CMP #ASC"*":BEQ oldcopy :\ COPY x y ..*.... wildcard filename
530 CMP #ASC"#":BEQ oldcopy :\ COPY x y ...#... wildcard filename
540 CMP #ASC".":BEQ oldcopy :\ COPY x y xxx.xxx directory name
550 CMP #ASC" ":BNE chknext
560 DEX:BEQ newcopy :\ COPY x y zzz zzz multiple options
570 JSR skipspc
580 .chknext
590 INY:CMP #13:BNE loop
600 .oldcopy
610 PLA:TAY:LDA #0:RTS :\ DFS COPY parameters
620 .newcopy1
630 PLA
640 .newcopy
650 PLA:TAY:LDA #1:RTS :\ Generic COPY parameters
660 :
670 .chkspc
680 INY:LDA (lptr),Y
690 CMP #ASC" ":BNE chkdigit1 :\ SEC=no following space
700 .skipspc
710 INY:LDA (lptr),Y
720 CMP #ASC" ":BEQ skipspc
730 CLC:RTS :\ CLC=follow space, and skipped
740 :
750 .chkdigit
760 LDA (lptr),Y
770 CMP #ASC"0":BCC chkdigit1 :\ SEC=not a digit
780 CMP #ASC"9"+1:BCC chkdigit2 :\ CLC=is a digit
790 .chkdigit1
800 SEC
810 .chkdigit2
820 RTS
830 ]NEXT