comparison level1/cmds/backup.asm @ 2176:a33c34f7f897

I have removed what seemed useless Close Open routines and relocated the verification turn off routine. In the process of doing this, I have made the preservation of the destination disk ID selectable with a SAVEID variable at the beginning of the code. The default is make a full backup including the disk ID same as current.
author robertgault
date Sat, 15 Nov 2008 04:52:35 +0000
parents aaff55744d7d
children 342db2db851a
comparison
equal deleted inserted replaced
2175:c61efe434615 2176:a33c34f7f897
12 * 9 2005/05/03 Robert Gault 12 * 9 2005/05/03 Robert Gault
13 * Folded in a new option F to permit a .dsk image file to be used 13 * Folded in a new option F to permit a .dsk image file to be used
14 * instead of dev1. Full path or local file can be used. There is 14 * instead of dev1. Full path or local file can be used. There is
15 * still a comparison of LSN0 to make sure that a disk actually has 15 * still a comparison of LSN0 to make sure that a disk actually has
16 * been formatted for the correct number of sides and tracks. 16 * been formatted for the correct number of sides and tracks.
17 * 10 2008/11/12 Robert Gault
18 * Removed what seemed unnecessary Close and reOpen lines.
19 * Relocated verification turn off routine.
20 * Preservation of new disk ID is now possible per Gene's idea.
21 * SAVEID is a switch to select save/no_save of ID on destination disk.
22 * Copy and Verification start at LSN1 since LSN0 gets checked several times anyway.
17 23
18 nam Backup 24 nam Backup
19 ttl Make a backup copy of a disk 25 ttl Make a backup copy of a disk
20 26
21 * Disassembled 02/04/03 23:08:04 by Disasm v1.6 (C) 1988 by RML 27 * Disassembled 02/04/03 23:08:04 by Disasm v1.6 (C) 1988 by RML
23 ifp1 29 ifp1
24 use defsfile 30 use defsfile
25 endc 31 endc
26 32
27 DOHELP set 1 33 DOHELP set 1
34 * Default 0 means do not save destination disk ID. 1 means save it. RG
35 SAVEID set 0
28 36
29 tylg set Prgrm+Objct 37 tylg set Prgrm+Objct
30 atrv set ReEnt+rev 38 atrv set ReEnt+rev
31 rev set $00 39 rev set $00
32 edition set $09 40 edition set 10
33 41
34 mod eom,name,tylg,atrv,start,size 42 mod eom,name,tylg,atrv,start,size
35 43
36 srcpath rmb 1 path of source disk 44 srcpath rmb 1 path of source disk
37 dstpath rmb 1 path of destination disk 45 dstpath rmb 1 path of destination disk
234 std -$01,x 242 std -$01,x
235 L0238b ldx <u0002 243 L0238b ldx <u0002
236 lda #READ. 244 lda #READ.
237 os9 I$Open open source device (the one we're backing up) 245 os9 I$Open open source device (the one we're backing up)
238 bcs L027C branch if error 246 bcs L027C branch if error
247 * Relocated since Close Open is removed. RG
248 sta <srcpath save path to source
239 leax >srclsn0,u 249 leax >srclsn0,u
240 ldy #256 250 ldy #256
241 os9 I$Read read LSN 0 of source 251 os9 I$Read read LSN 0 of source
242 bcs L027C 252 bcs L027C
243 os9 I$Close
244 ldx <u0002
245 lda #READ.
246 os9 I$Open
247 bcs L027C
248 sta <srcpath save path to source
249 ldx <u0004 253 ldx <u0004
250 leay <dstdev,u 254 leay <dstdev,u
251 L0267 ldb ,x+ 255 L0267 ldb ,x+
252 stb ,y+ 256 stb ,y+
253 cmpb #C$SPAC 257 cmpb #C$SPAC
257 leax <dstdev,u 261 leax <dstdev,u
258 lda #READ.+WRITE. 262 lda #READ.+WRITE.
259 os9 I$Open open destination device (the one we're writing to) 263 os9 I$Open open destination device (the one we're writing to)
260 L027C lbcs L03AF 264 L027C lbcs L03AF
261 sta <dstpath save destination path 265 sta <dstpath save destination path
266 * Relocated so that Close Open can be removed. RG
267 leax <optbuf,u
268 ldb #SS.OPT
269 os9 I$GetStt
270 ldb #$01
271 stb PD.VFY,x turn off verify
272 ldb #SS.OPT
273 os9 I$SetStt
274 lbcs L03AF
275 *
262 clr <curlsn 276 clr <curlsn
263 clr <curlsn+1 277 clr <curlsn+1
264 clr <curlsn+2 278 clr <curlsn+2
279 * This starts copy routine at LSN1 instead of LSN0. RG
280 inc <curlsn+2
265 lbsr L0419 281 lbsr L0419
266 lda <dstpath get destination path 282 lda <dstpath get destination path
267 leax >dstlsn0,u 283 leax >dstlsn0,u
268 ldy #256 284 ldy #256
269 os9 I$Read read LSN0 of destination 285 os9 I$Read read LSN0 of destination
294 eora #'Y 310 eora #'Y
295 anda #$DF 311 anda #$DF
296 lbne exit exit if not ok to scratch 312 lbne exit exit if not ok to scratch
297 lda <dstpath get destination path 313 lda <dstpath get destination path
298 leax >srclsn0,u get src LSN0 read earlier 314 leax >srclsn0,u get src LSN0 read earlier
315 ifne SAVEID
316 * New routine to preserved destination disk ID. Gene's idea. RG
317 pshs d
318 leay >dstlsn0,u
319 ldd <DD.DSK,y
320 std <DD.DSK,x
321 puls d
322 endif
323 *
299 ldy #256 324 ldy #256
300 os9 I$Write write it to destination 325 os9 I$Write write it to destination
301 lbcs L03AF 326 lbcs L03AF
302 pshs u 327 pshs u
303 ldx #$0000 328 ldx #$0000
306 puls u 331 puls u
307 lbcs L03AF added Feb 8, 2008 BGP 332 lbcs L03AF added Feb 8, 2008 BGP
308 leax >srclsn0,u 333 leax >srclsn0,u
309 os9 I$Read 334 os9 I$Read
310 lbcs L03AF 335 lbcs L03AF
311 os9 I$Close close path
312 leax <dstdev,u
313 lda #WRITE.
314 os9 I$Open open destination in write only mode
315 lbcs L03AF
316 sta <dstpath save new destination path
317 leax <optbuf,u
318 ldb #SS.OPT
319 os9 I$GetStt
320 ldb #$01
321 stb PD.VFY,x turn off verify
322 ldb #SS.OPT
323 os9 I$SetStt
324 lbcs L03AF
325
326 copyloop leay >rdysrc,pcr 336 copyloop leay >rdysrc,pcr
327 lbsr doprompt possibly show "ready source" message 337 lbsr doprompt possibly show "ready source" message
328 lda <numpages 338 lda <numpages
329 sta <pagcntr 339 sta <pagcntr
330 leax >dstlsn0,u 340 leax >dstlsn0,u
366 clr <curlsn+2 376 clr <curlsn+2
367 clr <srcerr 377 clr <srcerr
368 L0396 lda <numpages 378 L0396 lda <numpages
369 sta <pagcntr 379 sta <pagcntr
370 leax >dstlsn0,u 380 leax >dstlsn0,u
371 bsr L0403 381 lbsr L0403
372 lda <srcerr 382 lda <srcerr
373 cmpa #E$EOF 383 cmpa #E$EOF
374 bne L0396 384 bne L0396
375 leay >sctvfd,pcr 385 leay >sctvfd,pcr
376 lbsr L0470 386 lbsr L0470
377 bra exit 387 bra exit
378 L03AF os9 F$PErr 388 L03AF os9 F$PErr
379 leay >bkabort,pcr 389 leay >bkabort,pcr
380 L03B6 lbsr L0456 390 L03B6 lbsr L0456
381 comb 391 comb
382 exit ldb #$00 392 exit ldb #$00
383 os9 F$Exit 393 os9 F$Exit
384 L03BF ldy #256 394 L03BF ldy #256
385 lda <srcpath 395 lda <srcpath
386 os9 I$Read 396 os9 I$Read
387 bcc L03DC 397 bcc L03DC
421 ShowHelp equ * 431 ShowHelp equ *
422 IFNE DOHELP 432 IFNE DOHELP
423 leax <strbuf,u get address of buffer 433 leax <strbuf,u get address of buffer
424 stx <bufptr store as current buffer pointer 434 stx <bufptr store as current buffer pointer
425 leay >HelpMsg,pcr point to help message data 435 leay >HelpMsg,pcr point to help message data
426 bra L03B6 436 lbra L03B6
427 ELSE 437 ELSE
428 bra exit 438 bra exit
429 ENDC 439 ENDC
430 L0419 leay >rdydst,pcr 440 L0419 leay >rdydst,pcr
431 doprompt tst <pmptsng single disk backup prompt? 441 doprompt tst <pmptsng single disk backup prompt?