-
Notifications
You must be signed in to change notification settings - Fork 84
/
copall
103 lines (103 loc) · 1.59 KB
/
copall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.PAGE 'COPY ALL'
;
; SET UP SUBROUTINE
;
PUPS1 LDA #0
STA REC
STA DRVCNT
STA FILTRK
STA FILTRK+1
LDA FILDRV+1 ;GET DRIVE NUMBER
AND #1 ;ONLY
STA DRVNUM
ORA #1
STA DELSEC ;NONZERO
LDA FILTBL+1 ;FN1=FN2
STA FILTBL
RTS
;
.END
.PAGE 'COPY ALL'
;
; COPY DISK TO DISK ROUTINES
;
CPYDTD LDA FILTBL+1 ;SAVE IN TEMP
STA TEMP
LDY #40 ;40 CHAR BUFFER
LDX CMDSIZ ;PREP TO MOVE
STY CMDSIZ ;END OF FILENAME2
MOVLP1 DEY
DEX
LDA CMDBUF,X ;MOV FN LIFO
STA CMDBUF,Y
CPX TEMP ;ACTUAL F2 VAL
BNE MOVLP1
STY FILTBL+1 ;POINTER TO F2
MOVLP2 JSR OPTSCH
JSR PUPS1 ;SETUP FIRST PASS
JSR FFST ;FIRST MATCH
BPL FIXIT ;ENTRY FOUND?
BMI ENDIT ;NO
;
EXLP0 PLA ;PULL NEEDED VARS
STA DIRSEC
PLA
STA FILTBL+1
PLA
STA LSTBUF
PLA
STA FILCNT
PLA
STA INDEX
PLA
STA FOUND
PLA
STA DELIND
PLA
STA DRVFLG
;
EXLP1 JSR PUPS1 ;SET UP VARS
JSR FFRE ;NEXT MATCH
BPL FIXIT ;FOUND ONE?
ENDIT JMP ENDCMD ;NO! SO BYE
;
FIXIT LDA DRVFLG ;PUSH NEEDED VARS
PHA
LDA DELIND
PHA
LDA FOUND
PHA
LDA INDEX
PHA
LDA FILCNT
PHA
LDA LSTBUF
PHA
LDA FILTBL+1
PHA
LDA DIRSEC
PHA
;
EXLP2 JSR TRFNME ;TRANSFER NAME
LDA #1 ;FAKE OUT LOOKUP
STA F1CNT
STA F2CNT
JSR LOOKUP
LDA #1
STA F1CNT
LDA #2 ;REAL
STA F2CNT
JSR CY ;COPY IT
JMP EXLP0 ;NEXT ONE FOLKS
;
; TRANSFER NAME (DIRBUF) TO CMDBUF
;
TRFNME LDY #3 ;BOTH INDEXES
STY FILTBL ;BEGINING OF FILENAME1
TRF0 LDA (DIRBUF)Y ;MOVE IT
STA CMDBUF,Y
INY
CPY #19 ;ALL 16 CHARS PASSED?
BNE TRF0
RTS
.END