Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/backup.asm @ 556:28a203bbd2cc
findstr and signal finished.
author | roug |
---|---|
date | Tue, 22 Oct 2002 19:09:04 +0000 |
parents | e9ce43cc215e |
children | 617c1b90e623 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Backup - Make a backup copy of a disk | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
8 * 8 From Tandy OS-9 Level One VR 02.00.00 |
0 | 9 |
10 nam Backup | |
11 ttl Make a backup copy of a disk | |
12 | |
13 * Disassembled 02/04/03 23:08:04 by Disasm v1.6 (C) 1988 by RML | |
14 | |
15 ifp1 | |
16 use defsfile | |
17 endc | |
18 | |
19 tylg set Prgrm+Objct | |
20 atrv set ReEnt+rev | |
21 rev set $01 | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
22 edition set $08 |
0 | 23 |
24 mod eom,name,tylg,atrv,start,size | |
25 | |
26 u0000 rmb 1 | |
27 u0001 rmb 1 | |
28 u0002 rmb 2 | |
29 u0004 rmb 5 | |
30 u0009 rmb 1 | |
31 u000A rmb 1 | |
32 u000B rmb 1 | |
33 u000C rmb 1 | |
34 u000D rmb 1 | |
35 u000E rmb 1 | |
36 u000F rmb 1 | |
37 u0010 rmb 1 | |
38 u0011 rmb 2 | |
39 u0013 rmb 1 | |
40 u0014 rmb 1 | |
41 u0015 rmb 32 | |
42 u0035 rmb 32 | |
43 u0055 rmb 2 | |
44 u0057 rmb 424 | |
45 u01FF rmb 81 | |
46 u0250 rmb 256 | |
47 u0350 rmb 3840 | |
48 size equ . | |
49 | |
50 name fcs /Backup/ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
51 fcb edition |
0 | 52 |
53 L0014 fcc "/d0 /d1" | |
54 fcb C$CR | |
55 L001C fcb C$LF | |
56 fcc "Use: Backup [e] [s] [-v]" | |
57 fcb C$LF | |
58 fcc " [/dev1 [/dev2]]" | |
59 fcb C$LF | |
60 fcc " e - abort if read error" | |
61 fcb C$LF | |
62 fcc " s - single drive prompts" | |
63 fcb C$LF | |
64 fcc " -v - inhibit verify pass" | |
65 L00A0 fcb $8D | |
66 L00A1 fcc "Ready to backup from" | |
67 L00B5 fcb $A0 | |
68 L00B6 fcc " to" | |
69 fcb $A0 | |
70 L00BA fcc "Ok" | |
71 L00BC fcc " ?:" | |
72 fcb $A0 | |
73 L00C0 fcc "Ready Source, hit a key:" | |
74 fcb $A0 | |
75 L00D9 fcc "Ready Destination, hit a key:" | |
76 fcb $A0 | |
77 L00F7 fcs "Sector $" | |
78 L00FF fcs "Sectors copied: $" | |
79 L0112 fcb C$LF | |
80 fcc "Verify pass" | |
81 fcb $8D | |
82 L011F fcs "Sectors verified: $" | |
83 L0132 fcb C$LF | |
84 fcc " is being scratched" | |
85 fcb $8D | |
86 L0147 fcc "Disks not formatted identically" | |
87 fcb C$LF | |
88 L0167 fcc "Backup Aborted" | |
89 fcb $8D | |
90 | |
91 start leas >u01FF,u | |
92 pshs b,a | |
93 pshs u | |
94 tfr y,d | |
95 subd ,s++ | |
96 subd #$0250 | |
97 sta <u0013 | |
98 clr <u000B | |
99 clr <u000A | |
100 clr <u000C | |
101 clr <u000D | |
102 leay <u0057,u | |
103 sty <u0055 | |
104 ldd ,s++ | |
105 beq L01E3 | |
106 L0199 ldd ,x+ | |
107 cmpa #C$SPAC | |
108 beq L0199 | |
109 cmpa #C$COMA | |
110 beq L0199 | |
111 eora #'E | |
112 anda #$DF | |
113 bne L01B1 | |
114 cmpb #$30 | |
115 bcc L01B1 | |
116 inc <u000A | |
117 bra L0199 | |
118 L01B1 lda -$01,x | |
119 eora #'S | |
120 anda #$DF | |
121 bne L01C1 | |
122 cmpb #$30 | |
123 bcc L01C1 | |
124 inc <u000B | |
125 bra L0199 | |
126 L01C1 ldd -$01,x | |
127 cmpa #'- | |
128 bne L01D7 | |
129 eorb #'V | |
130 andb #$DF | |
131 bne L01D7 | |
132 ldd ,x+ | |
133 cmpb #$30 | |
134 bcc L01D7 | |
135 inc <u000C | |
136 bra L0199 | |
137 L01D7 lda ,-x | |
138 cmpa #PDELIM | |
139 beq L01E7 | |
140 cmpa #C$CR | |
141 lbne L040E | |
142 L01E3 leax >L0014,pcr | |
143 L01E7 leay >L00A1,pcr | |
144 lbsr L044B | |
145 ldy <u0055 | |
146 sty <u0002 | |
147 lbsr L043A | |
148 L01F7 lda ,x+ | |
149 cmpa #C$SPAC | |
150 beq L01F7 | |
151 cmpa #C$COMA | |
152 beq L01F7 | |
153 cmpa #C$CR | |
154 bne L020B | |
155 inc <u000B | |
156 ldx <u0002 | |
157 lda ,x+ | |
158 L020B cmpa #PDELIM | |
159 lbne L040E | |
160 leax -$01,x | |
161 leay >L00B6,pcr | |
162 lbsr L044B | |
163 ldy <u0055 | |
164 sty <u0004 | |
165 lbsr L043A | |
166 leay >L00BC,pcr | |
167 lbsr L0421 | |
168 comb | |
169 eora #'Y | |
170 anda #$DF | |
171 lbne L03BA | |
172 ldx <u0002 | |
173 ldd #$4020 | |
174 L0238 cmpb ,x+ | |
175 bne L0238 | |
176 std -$01,x | |
177 ldx <u0002 | |
178 lda #READ. | |
179 os9 I$Open | |
180 bcs L027C | |
181 leax >u0350,u | |
182 ldy #$0100 | |
183 os9 I$Read | |
184 bcs L027C | |
185 os9 I$Close | |
186 ldx <u0002 | |
187 lda #READ. | |
188 os9 I$Open | |
189 bcs L027C | |
190 sta <u0000 | |
191 ldx <u0004 | |
192 leay <u0015,u | |
193 L0267 ldb ,x+ | |
194 stb ,y+ | |
195 cmpb #C$SPAC | |
196 bne L0267 | |
197 ldd #$4020 | |
198 std -$01,y | |
199 leax <u0015,u | |
200 lda #READ.+WRITE. | |
201 os9 I$Open | |
202 L027C lbcs L03AF | |
203 sta <u0001 | |
204 clr <u000E | |
205 clr <u000F | |
206 clr <u0010 | |
207 lbsr L0419 | |
208 lda <u0001 | |
209 leax >u0250,u | |
210 ldy #$0100 | |
211 os9 I$Read | |
212 pshs u,x | |
213 ldx #$0000 | |
214 leau ,x | |
215 os9 I$Seek | |
216 puls u,x | |
217 bcs L027C | |
218 ldd >$0100,x | |
219 cmpd ,x | |
220 bne L02B7 | |
221 ldb >$0102,x | |
222 cmpb $02,x | |
223 beq L02BE | |
224 L02B7 leay >L0147,pcr | |
225 lbra L03B6 | |
226 L02BE leax >u0250,u | |
227 lda #$BF | |
228 sta <$3F,x | |
229 leay <$1F,x | |
230 lbsr L044B | |
231 leay >L0132,pcr | |
232 lbsr L0456 | |
233 leay >L00BA,pcr | |
234 lbsr L0421 | |
235 comb | |
236 eora #'Y | |
237 anda #$DF | |
238 lbne L03BA | |
239 lda <u0001 | |
240 leax >u0350,u | |
241 ldy #$0100 | |
242 os9 I$Write | |
243 lbcs L03AF | |
244 pshs u | |
245 ldx #$0000 | |
246 leau ,x | |
247 os9 I$Seek | |
248 puls u | |
249 leax >u0350,u | |
250 os9 I$Read | |
251 lbcs L03AF | |
252 os9 I$Close | |
253 leax <u0015,u | |
254 lda #$02 | |
255 os9 I$Open | |
256 lbcs L03AF | |
257 sta <u0001 | |
258 leax <u0035,u | |
259 ldb #SS.OPT | |
260 os9 I$GetStt | |
261 ldb #$01 | |
262 stb $08,x | |
263 ldb #SS.OPT | |
264 os9 I$SetStt | |
265 lbcs L03AF | |
266 L0332 leay >L00C0,pcr | |
267 lbsr L041D | |
268 lda <u0013 | |
269 sta <u0014 | |
270 leax >u0250,u | |
271 lbsr L0403 | |
272 lbsr L0419 | |
273 ldd <u0011 | |
274 leax >u0250,u | |
275 stx <u0011 | |
276 subd <u0011 | |
277 beq L035C | |
278 tfr d,y | |
279 lda <u0001 | |
280 os9 I$Write | |
281 bcs L03AF | |
282 L035C lda <u000D | |
283 cmpa #E$EOF | |
284 bne L0332 | |
285 leay >L00FF,pcr | |
286 lbsr L0470 | |
287 tst <u000C | |
288 bne L03BA | |
289 leay >L0112,pcr | |
290 lbsr L0456 | |
291 lda <u0000 | |
292 os9 I$Close | |
293 bcs L03AF | |
294 lda <u0001 | |
295 os9 I$Close | |
296 bcs L03AF | |
297 leax <u0015,u | |
298 lda #READ. | |
299 os9 I$Open | |
300 bcs L03AF | |
301 sta <u0000 | |
302 clr <u000E | |
303 clr <u000F | |
304 clr <u0010 | |
305 clr <u000D | |
306 L0396 lda <u0013 | |
307 sta <u0014 | |
308 leax >u0250,u | |
309 bsr L0403 | |
310 lda <u000D | |
311 cmpa #E$EOF | |
312 bne L0396 | |
313 leay >L011F,pcr | |
314 lbsr L0470 | |
315 bra L03BA | |
316 L03AF os9 F$PErr | |
317 leay >L0167,pcr | |
318 L03B6 lbsr L0456 | |
319 comb | |
320 L03BA ldb #$00 | |
321 os9 F$Exit | |
322 L03BF ldy #$0100 | |
323 lda <u0000 | |
324 os9 I$Read | |
325 bcc L03DC | |
326 stb <u000D | |
327 cmpb #E$EOF | |
328 beq L040D | |
329 lbsr L046C | |
330 ldb <u000D | |
331 tst <u000A | |
332 bne L03AF | |
333 os9 F$PErr | |
334 L03DC ldd <u000F | |
335 addd #$0001 | |
336 std <u000F | |
337 bcc L03E7 | |
338 inc <u000E | |
339 L03E7 tst <u000D | |
340 beq L03FD | |
341 pshs u | |
342 ldx <u000E | |
343 tfr b,a | |
344 clrb | |
345 tfr d,u | |
346 lda <u0000 | |
347 os9 I$Seek | |
348 puls u | |
349 clr <u000D | |
350 L03FD ldx <u0011 | |
351 leax >$0100,x | |
352 L0403 stx <u0011 | |
353 lda <u0014 | |
354 suba #$01 | |
355 sta <u0014 | |
356 bcc L03BF | |
357 L040D rts | |
358 L040E leax <u0057,u | |
359 stx <u0055 | |
360 leay >L001C,pcr | |
361 bra L03B6 | |
362 L0419 leay >L00D9,pcr | |
363 L041D tst <u000B | |
364 beq L0439 | |
365 L0421 bsr L0456 | |
366 pshs y,x,b,a | |
367 leax ,s | |
368 ldy #$0001 | |
369 clra | |
370 os9 I$Read | |
371 leay >L00A0,pcr | |
372 bsr L0456 | |
373 puls y,x,b,a | |
374 anda #$7F | |
375 L0439 rts | |
376 L043A pshs x | |
377 os9 F$PrsNam | |
378 puls x | |
379 bcs L040E | |
380 L0443 lda ,x+ | |
381 bsr L04A5 | |
382 decb | |
383 bpl L0443 | |
384 rts | |
385 L044B lda ,y | |
386 anda #$7F | |
387 bsr L04A5 | |
388 lda ,y+ | |
389 bpl L044B | |
390 L0455 rts | |
391 L0456 bsr L044B | |
392 pshs y,x,a | |
393 ldd <u0055 | |
394 leax <u0057,u | |
395 stx <u0055 | |
396 subd <u0055 | |
397 tfr d,y | |
398 lda #$02 | |
399 os9 I$WritLn | |
400 puls pc,y,x,a | |
401 L046C leay >L00F7,pcr | |
402 L0470 bsr L044B | |
403 lda <u000E | |
404 bsr L0486 | |
405 inc <u0009 | |
406 lda <u000F | |
407 bsr L0488 | |
408 lda <u0010 | |
409 bsr L0488 | |
410 leay >L00B5,pcr | |
411 bra L0456 | |
412 L0486 clr <u0009 | |
413 L0488 pshs a | |
414 lsra | |
415 lsra | |
416 lsra | |
417 lsra | |
418 bsr L0494 | |
419 puls a | |
420 anda #$0F | |
421 L0494 tsta | |
422 beq L0499 | |
423 sta <u0009 | |
424 L0499 tst <u0009 | |
425 beq L0455 | |
426 adda #$30 | |
427 cmpa #$39 | |
428 bls L04A5 | |
429 adda #$07 | |
430 L04A5 pshs x | |
431 ldx <u0055 | |
432 sta ,x+ | |
433 stx <u0055 | |
434 puls pc,x | |
435 | |
436 emod | |
437 eom equ * | |
438 end |