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