-
Notifications
You must be signed in to change notification settings - Fork 82
/
trnsfr
254 lines (254 loc) · 3.24 KB
/
trnsfr
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
.PAGE 'TRANSFER'
;TRANSFER FILENAME FROM CMD TO BUFFER
; A: STRING SIZE
; X: STARTING INDEX IN CMDBUF
; Y: BUFFER #
TRNAME PHA
JSR FNDLMT
JSR TRCMBF
PLA
SEC
SBC STRSIZ
TAX
BEQ TN20
BCC TN20
.SKIP
LDA #$A0
TN10 STA (DIRBUF),Y
INY
DEX
BNE TN10
TN20 RTS
.SKIP 2
;TRANSFER CMD BUFFER TO OTHER BUFFER
; USES CURRENT BUFFER PTR
; LIMIT: ENDING INDEX+1 IN CMD BUF
; X: STARTING INDEX IN CMD BUF
; Y: BUFFER #
.SKIP
TRCMBF TYA
ASL A
TAY
LDA BUFTAB,Y
STA DIRBUF
LDA BUFTAB+1,Y
STA DIRBUF+1
LDY #0
;
TR10 LDA CMDBUF,X
STA (DIRBUF),Y
INY
BEQ TR20
INX
CPX LIMIT
BCC TR10
TR20 RTS
;
;
;FIND THE LIMIT OF THE STRING IN CMDBUF
; POINTED TO BY X
.SKIP
FNDLMT LDA #0
STA STRSIZ
TXA
PHA
FL05
LDA CMDBUF,X
CMP #',
BEQ FL10
CMP #'=
BEQ FL10
INC STRSIZ
INX
LDA #15
CMP STRSIZ
BCC FL10
CPX CMDSIZ
BCC FL05
FL10 STX LIMIT
PLA
TAX
RTS
.SKIP
.PAGE 'TRNSFR-GETNAM'
; GET FILE ENTRY FROM DIRECTORY
; CALLED BY STDIR, GETDIR
GETNAM LDA SA ;SAVE VARIABLES
PHA
LDA LINDX
PHA
JSR GNSUB
PLA ;RESTORE VARIABLES
STA LINDX
PLA
STA SA
RTS
.SKIP
GNSUB LDA #IRSA
STA SA
JSR FNDRCH
JSR GETPNT
LDA ENTFND
BPL GN05 ;MORE FILES
LDA DRVFLG
BNE GN050
JSR MSGFRE ;SEND BLOCKS FREE
CLC ;(C=0): END
RTS ;TERMINATE
.SKIP
GN05 LDA DRVFLG ;(DRVFLG=0):
BEQ GN10 ; SEND FILE NAME
GN050
DEC DRVFLG ;(DRVFLG=-1):NEW DIR
BNE GN051
DEC DRVFLG ;(DRVFLG=-1):
JSR TOGDRV ; SEND BLOCKS FREE
JSR MSGFRE
SEC
JMP TOGDRV
.SKIP
GN051 LDA #0
STA NBTEMP+1
STA DRVFLG ;RESET FLAG
JSR NEWDIR
SEC
RTS
.SKIP
GN10 LDX #DIRLEN ;SET NUMBER BLOCKS
LDY #29 ; & ADJUST SPACING
LDA (DIRBUF),Y
STA NBTEMP+1
BEQ GN12
LDX #DIRLEN-2
GN12 DEY
LDA (DIRBUF),Y
STA NBTEMP
CPX #DIRLEN-2
BEQ GN14
CMP #10
BCC GN14
DEX
CMP #100
BCC GN14
DEX
.SKIP
GN14 JSR BLKNB ;CLEAR NAME BUFFER
.SKIP
LDA (DIRBUF),Y ;SET TYPE CHARS
PHA
ASL A ;(USED IN BCS)
BPL GN15
LDA #'<
STA NAMBUF+1,X
GN15
PLA
AND #$F
TAY
LDA TP2LST,Y
STA NAMBUF,X
DEX
LDA TP1LST,Y
STA NAMBUF,X
DEX
LDA TYPLST,Y
STA NAMBUF,X
DEX
DEX
BCS GN20 ;(FROM ASL)
LDA #'* ;FILE NOT CLOSED
STA NAMBUF+1,X
GN20 LDA #$A0
STA NAMBUF,X
DEX
LDY #18
GN22 LDA (DIRBUF),Y
STA NAMBUF,X
DEX
DEY
CPY #3
BCS GN22
.SKIP
LDA #'" ;SEND NAME IN QUOTES
STA NAMBUF,X
GN30 INX
CPX #$20
BCS GN35
LDA NAMBUF,X
CMP #'"
BEQ GN35
CMP #$A0
BNE GN30
GN35 LDA #'"
STA NAMBUF,X
GN37 INX
CPX #$20
BCS GN40
LDA #$7F
AND NAMBUF,X
STA NAMBUF,X
BPL GN37
.SKIP
GN40 JSR FNDFIL
SEC
GN45 RTS
.SKIP
BLKNB LDY #NBSIZ ;BLANK NAMBUF
LDA #$20
BLKNB1 STA NAMBUF-1,Y
DEY
BNE BLKNB1
RTS
.SKIP
;NEW DIRECTORY IN LISTING
NEWDIR
JSR BAM2X
JSR REDBAM
JSR BLKNB
LDA #$FF
STA TEMP
LDX DRVNUM
STX NBTEMP
LDA #0
STA NBTEMP+1
LDX JOBNUM
LDA BUFIND,X
STA DIRBUF+1
LDA DSKNAM
STA DIRBUF
LDY #22
.SKIP
ND10 LDA (DIRBUF),Y
CMP #$A0
BNE ND20
LDA #'1 ;VERSION # 1
.BYTE $2C
ND15
LDA (DIRBUF)Y
CMP #$A0
BNE ND20
;
LDA #$20
ND20
STA NAMBUF+2,Y
DEY
BPL ND15
LDA #$12
STA NAMBUF
LDA #'"
STA NAMBUF+1
STA NAMBUF+18
LDA #$20
STA NAMBUF+19
RTS
.SKIP
MSGFRE JSR BLKNB
LDY #MSGLEN-1
MSG1 LDA FREMSG,Y
STA NAMBUF,Y
DEY
BPL MSG1
JMP NUMFRE
.SKIP
FREMSG .BYTE 'BLOCKS FREE.'
MSGLEN =*-FREMSG
.END