annotate level1/cmds/backup.asm @ 2286:d3c1d1258b42

Updated from Aaron's sources
author boisy
date Tue, 29 Dec 2009 02:34:05 +0000
parents ab8593f90f03
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * Backup - Make a backup copy of a disk
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 921
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 921
diff changeset
7 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 921
diff changeset
9 * 8 ????/??/??
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 921
diff changeset
10 * From Tandy OS-9 Level Two VR 02.00.01.
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
11 *
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
12 * 9 2005/05/03 Robert Gault
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
13 * Folded in a new option F to permit a .dsk image file to be used
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
14 * instead of dev1. Full path or local file can be used. There is
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
15 * still a comparison of LSN0 to make sure that a disk actually has
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
16 * been formatted for the correct number of sides and tracks.
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.
robertgault
parents: 2148
diff changeset
17 * 10 2008/11/12 Robert Gault
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.
robertgault
parents: 2148
diff changeset
18 * Removed what seemed unnecessary Close and reOpen lines.
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.
robertgault
parents: 2148
diff changeset
19 * Relocated verification turn off routine.
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.
robertgault
parents: 2148
diff changeset
20 * Preservation of new disk ID is now possible per Gene's idea.
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.
robertgault
parents: 2148
diff changeset
21 * SAVEID is a switch to select save/no_save of ID on destination disk.
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.
robertgault
parents: 2148
diff changeset
22 * Copy and Verification start at LSN1 since LSN0 gets checked several times anyway.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 nam Backup
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 ttl Make a backup copy of a disk
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 * Disassembled 02/04/03 23:08:04 by Disasm v1.6 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
33 DOHELP set 1
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.
robertgault
parents: 2148
diff changeset
34 * Default 0 means do not save destination disk ID. 1 means save it. RG
2178
ab8593f90f03 Drat! I had SAVEID set for save. It is now the default of not save.
robertgault
parents: 2177
diff changeset
35 SAVEID set 0
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
36
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 atrv set ReEnt+rev
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 921
diff changeset
39 rev set $00
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.
robertgault
parents: 2148
diff changeset
40 edition set 10
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
44 srcpath rmb 1 path of source disk
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
45 dstpath rmb 1 path of destination disk
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 u0002 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 u0004 rmb 5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 u0009 rmb 1
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
49 errabrt rmb 1 abort if read error flag (1 = abort, 0 = don't)
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
50 pmptsng rmb 1 single disk copy prompt flag (1 = prompt for single, 0 = don't)
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
51 dontvfy rmb 1 don't verify backup (1 = Don't!, 0 = do)
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
52 fileflg rmb 1 0 = disk, 1 = file (.dsk) to disk; RG
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
53 noprompt rmb 1 0 = prompt user, 1 = do not prompt user
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
54 srcerr rmb 1 source disk error code on I$Read
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
55 curlsn rmb 3 current 24-bit LSN counter used while backing up
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
56 sctbuf rmb 2 sector buffer pointer
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
57 numpages rmb 1 number of 256 byte pages we can use for backup buffer
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
58 pagcntr rmb 1 256 byte page counter (for backup buffer)
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
59 dstdev rmb 32
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
60 optbuf rmb 32 SS/GS OPT buffer
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
61 bufptr rmb 2 buffer pointer
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
62 strbuf rmb 424 buffer
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
63 stack rmb 80
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
64 * Important, the next two lines MUST STAY TOGETHER because of assumptions
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
65 * about their location in the code.
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
66 dstlsn0 rmb 256
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
67 srclsn0 rmb 256
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
68 backbuff rmb 14*256 reserve pages for backup buffer
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 name fcs /Backup/
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 0
diff changeset
72 fcb edition
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
74 defparms fcc "/d0 /d1"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 fcb C$CR
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
76 IFNE DOHELP
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
77 * Added F option; RG
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
78 HelpMsg fcb C$LF
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
79 fcc "Use: Backup [e] [f] [s] [-v]"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 fcc " [/dev1 [/dev2]]"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 fcc " e - abort if read error"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 fcb C$LF
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
85 fcc " f - replace dev1 with .dsk image file"
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
86 fcb C$LF
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
87 fcc " p - do not prompt user"
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
88 fcb C$LF
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 fcc " s - single drive prompts"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 fcc " -v - inhibit verify pass"
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
92 ENDC
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
93 L00A0 fcb $80+C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 L00A1 fcc "Ready to backup from"
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
95 L00B5 fcb $80+C$SPAC
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
96 to fcs " to "
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
97 ok fcc "Ok"
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
98 ask fcs " ?: "
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
99 rdysrc fcs "Ready Source, hit a key: "
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
100 rdydst fcs "Ready Destination, hit a key: "
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 L00F7 fcs "Sector $"
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
102 sctscpd fcs "Sectors copied: $"
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
103 vfypass fcb C$LF
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 fcc "Verify pass"
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
105 fcb $80+C$CR
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
106 sctvfd fcs "Sectors verified: $"
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
107 scratch fcb C$LF
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 fcc " is being scratched"
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
109 fcb $80+C$CR
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
110 notsame fcc "Disks not formatted identically"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 fcb C$LF
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
112 bkabort fcc "Backup Aborted"
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
113 fcb $80+C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
115 * Here's how registers are set when this process is forked:
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
116 *
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
117 * +-----------------+ <-- Y (highest address)
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
118 * ! Parameter !
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
119 * ! Area !
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
120 * +-----------------+ <-- X, SP
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
121 * ! Data Area !
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
122 * +-----------------+
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
123 * ! Direct Page !
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
124 * +-----------------+ <-- U, DP (lowest address)
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
125 *
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
126 * D = parameter area size
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
127 * PC = module entry point abs. address
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
128 * CC = F=0, I=0, others undefined
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
129
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
130 * The start of the program is here.
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
131 start leas >stack,u move stack pointer to here
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
132 pshs b,a save parameter area size
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
133 pshs u save lowest addr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
134 tfr y,d move top of parameter area to Y
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
135 subd ,s++ D=Y-U
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
136 subd #backbuff-stack
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
137 * A = number of 256 byte pages that are available for backup buffer
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
138 sta <numpages
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
139 clr <pmptsng
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
140 clr <fileflg
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
141 clr <errabrt
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
142 clr <dontvfy
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
143 clr <srcerr
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
144 leay <strbuf,u get address of our buffer
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
145 sty <bufptr and save its pointer here
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
146 ldd ,s++ get parameter length
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
147 beq L01E3 if parameter length is 0, use defaults
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
148 L0199 ldd ,x+ get two bytes of command line prompt
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
149 cmpa #C$SPAC space?
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
150 beq L0199 continue if so
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
151 cmpa #C$COMA comma?
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
152 beq L0199 continue if so
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
153 eora #'E check for "abort if read error" flag
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
154 anda #$DF mask it
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
155 bne Chk4P branch if not option
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
156 cmpb #'0
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
157 bcc Chk4P branch if char after option is > $30
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
158 inc <errabrt else set flag
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
159 bra L0199 and continue parsing
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
160 Chk4P lda -$01,x load A with prev char and backup X one byte
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
161 eora #'P check for "do not prompt user" flag
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
162 anda #$DF mask it
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
163 bne Chk4S branch if not option
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
164 inc <noprompt
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
165 bra L0199
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
166 Chk4S lda -$01,x load A with prev char and backup X one byte
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
167 eora #'S check for "single drive prompts" flag
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
168 anda #$DF mask it
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
169 bne Chkimg branch if not option
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
170 cmpb #'0
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
171 bcc L01C1 branch if char after option is > $30
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
172 inc <pmptsng else set flag
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
173 bra L0199 and continue parsing
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
174 * New routine to check for new option F; RG
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
175 Chkimg lda -1,x get prev char
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
176 eora #'F test for disk image to drive
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
177 anda #$DF
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
178 bne L01C1
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
179 cmpb #'0
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
180 bcc L01C1
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
181 inc <fileflg update flag
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
182 bra L0199 keep reading
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
183 * End of new routine
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
184 L01C1 ldd -$01,x load A with prev char and backup X one byte
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
185 cmpa #'- dash?
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
186 bne L01D7 branch if not
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 eorb #'V
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 andb #$DF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 bne L01D7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 ldd ,x+
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
191 cmpb #'0
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192 bcc L01D7
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
193 inc <dontvfy
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 bra L0199
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 L01D7 lda ,-x
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
196 tst <fileflg don't look for / if image file, take anything; RG
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
197 bne L01E7
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
198 cmpa #PDELIM path delimiter?
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
199 beq L01E7 branch if so
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
200 cmpa #C$CR carriage return?
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
201 lbne ShowHelp if not, show some help
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
202 L01E3 leax >defparms,pcr
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
203 L01E7 leay >L00A1,pcr ready to backup
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
204 lbsr L044B ready message
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
205 ldy <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 sty <u0002
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
207 tst <fileflg don't use F$PrsNam if an image file;RG
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
208 bne L01F7a
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
209 lbsr L043A parse name
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
210 bra L01F7
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
211 L01F7a lbsr getnm look for space or comma if file instead of device; RG
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 L01F7 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 cmpa #C$SPAC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214 beq L01F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 cmpa #C$COMA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 beq L01F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 cmpa #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 bne L020B
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
219 inc <pmptsng
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 ldx <u0002
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 lda ,x+
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
222 L020B cmpa #PDELIM path delimiter?
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
223 lbne ShowHelp if not, show some help
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 leax -$01,x
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
225 leay >to,pcr "to"
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
226 lbsr L044B print
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
227 ldy <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 sty <u0004
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
229 lbsr L043A parse path
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
230 leay >ask,pcr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
231 lbsr getkey
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233 eora #'Y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 anda #$DF
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
235 lbne exit
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
236 tst <fileflg
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
237 bne L0238b if file instead of device don't add @
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 ldx <u0002
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
239 ldd #'@*256+C$SPAC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 L0238 cmpb ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 bne L0238
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 std -$01,x
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
243 L0238b ldx <u0002
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 lda #READ.
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
245 os9 I$Open open source device (the one we're backing up)
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
246 bcs L027C branch if error
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.
robertgault
parents: 2148
diff changeset
247 * Relocated since Close Open is removed. RG
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.
robertgault
parents: 2148
diff changeset
248 sta <srcpath save path to source
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
249 leax >srclsn0,u
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
250 ldy #256
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
251 os9 I$Read read LSN 0 of source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 bcs L027C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 ldx <u0004
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
254 leay <dstdev,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255 L0267 ldb ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 stb ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
257 cmpb #C$SPAC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
258 bne L0267
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
259 ldd #'@*256+C$SPAC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 std -$01,y
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
261 leax <dstdev,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 lda #READ.+WRITE.
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
263 os9 I$Open open destination device (the one we're writing to)
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 L027C lbcs L03AF
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
265 sta <dstpath save destination path
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.
robertgault
parents: 2148
diff changeset
266 * Relocated so that Close Open can be removed. RG
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.
robertgault
parents: 2148
diff changeset
267 leax <optbuf,u
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.
robertgault
parents: 2148
diff changeset
268 ldb #SS.OPT
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.
robertgault
parents: 2148
diff changeset
269 os9 I$GetStt
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.
robertgault
parents: 2148
diff changeset
270 ldb #$01
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.
robertgault
parents: 2148
diff changeset
271 stb PD.VFY,x turn off verify
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.
robertgault
parents: 2148
diff changeset
272 ldb #SS.OPT
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.
robertgault
parents: 2148
diff changeset
273 os9 I$SetStt
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.
robertgault
parents: 2148
diff changeset
274 lbcs L03AF
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.
robertgault
parents: 2148
diff changeset
275 *
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
276 clr <curlsn
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
277 clr <curlsn+1
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
278 clr <curlsn+2
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.
robertgault
parents: 2148
diff changeset
279 * This starts copy routine at LSN1 instead of LSN0. RG
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.
robertgault
parents: 2148
diff changeset
280 inc <curlsn+2
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281 lbsr L0419
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
282 lda <dstpath get destination path
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
283 leax >dstlsn0,u
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
284 ldy #256
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
285 os9 I$Read read LSN0 of destination
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 pshs u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287 ldx #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
288 leau ,x
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
289 os9 I$Seek reseek to start of disk
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
290 puls u,x
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
291 bcs L027C branch if error
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
292 ldd >256,x check for source/dest disk having same number of sectors
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
293 cmpd ,x
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
294 bne DsksNOk branch if different
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 ldb >$0102,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 cmpb $02,x
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
297 beq DsksOk
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
298 DsksNOk leay >notsame,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 lbra L03B6
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
300 DsksOk leax >dstlsn0,u X now points to source LSN0
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 lda #$BF
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
302 sta <DD.OPT,x
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
303 leay <DD.NAM,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
304 lbsr L044B
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
305 leay >scratch,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
306 lbsr L0456
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
307 leay >ok,pcr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
308 lbsr getkey get a key from the stdin
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
310 eora #'Y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
311 anda #$DF
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
312 lbne exit exit if not ok to scratch
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
313 lda <dstpath get destination path
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
314 leax >srclsn0,u get src LSN0 read earlier
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.
robertgault
parents: 2148
diff changeset
315 ifne SAVEID
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.
robertgault
parents: 2148
diff changeset
316 * New routine to preserved destination disk ID. Gene's idea. RG
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.
robertgault
parents: 2148
diff changeset
317 pshs d
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.
robertgault
parents: 2148
diff changeset
318 leay >dstlsn0,u
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.
robertgault
parents: 2148
diff changeset
319 ldd <DD.DSK,y
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.
robertgault
parents: 2148
diff changeset
320 std <DD.DSK,x
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.
robertgault
parents: 2148
diff changeset
321 puls d
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.
robertgault
parents: 2148
diff changeset
322 endif
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.
robertgault
parents: 2148
diff changeset
323 *
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
324 ldy #256
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
325 os9 I$Write write it to destination
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
326 lbcs L03AF
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
328 ldx #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
329 leau ,x
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
330 os9 I$Seek seek to LSN0
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
331 puls u
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
332 lbcs L03AF added Feb 8, 2008 BGP
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
333 leax >srclsn0,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
334 os9 I$Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
335 lbcs L03AF
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
336 copyloop leay >rdysrc,pcr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
337 lbsr doprompt possibly show "ready source" message
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
338 lda <numpages
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
339 sta <pagcntr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
340 leax >dstlsn0,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
341 lbsr L0403
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
342 lbsr L0419
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
343 ldd <sctbuf
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
344 leax >dstlsn0,u
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
345 stx <sctbuf
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
346 subd <sctbuf
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
347 beq L035C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
348 tfr d,y
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
349 lda <dstpath
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
350 * DriveWire Note: backup /x1 /d1 returns error 247 at this I$Write!
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
351 os9 I$Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
352 bcs L03AF
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
353 L035C lda <srcerr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
354 cmpa #E$EOF
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
355 bne copyloop
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
356 leay >sctscpd,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
357 lbsr L0470
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
358 tst <dontvfy
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
359 bne exit
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
360 * Verification code
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
361 leay >vfypass,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
362 lbsr L0456
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
363 lda <dstpath
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
364 sta <srcpath save newly acquired path number
2177
342db2db851a Removed more Close Open code. Now Copy and Verification loops indeed start at LSN1, not LSN0.
robertgault
parents: 2176
diff changeset
365 pshs u
342db2db851a Removed more Close Open code. Now Copy and Verification loops indeed start at LSN1, not LSN0.
robertgault
parents: 2176
diff changeset
366 ldx #$0000
342db2db851a Removed more Close Open code. Now Copy and Verification loops indeed start at LSN1, not LSN0.
robertgault
parents: 2176
diff changeset
367 leau 1,x
342db2db851a Removed more Close Open code. Now Copy and Verification loops indeed start at LSN1, not LSN0.
robertgault
parents: 2176
diff changeset
368 os9 I$Seek seek to LSN0
342db2db851a Removed more Close Open code. Now Copy and Verification loops indeed start at LSN1, not LSN0.
robertgault
parents: 2176
diff changeset
369 puls u
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
370 clr <curlsn
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
371 clr <curlsn+1
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
372 clr <curlsn+2
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
373 clr <srcerr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
374 L0396 lda <numpages
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
375 sta <pagcntr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
376 leax >dstlsn0,u
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.
robertgault
parents: 2148
diff changeset
377 lbsr L0403
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
378 lda <srcerr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
379 cmpa #E$EOF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
380 bne L0396
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
381 leay >sctvfd,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
382 lbsr L0470
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
383 bra exit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
384 L03AF os9 F$PErr
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
385 leay >bkabort,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
386 L03B6 lbsr L0456
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
387 comb
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.
robertgault
parents: 2148
diff changeset
388 exit ldb #$00
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
389 os9 F$Exit
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
390 L03BF ldy #256
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
391 lda <srcpath
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
392 os9 I$Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
393 bcc L03DC
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
394 stb <srcerr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
395 cmpb #E$EOF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
396 beq L040D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
397 lbsr L046C
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
398 ldb <srcerr
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
399 tst <errabrt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
400 bne L03AF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
401 os9 F$PErr
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
402 L03DC ldd <curlsn+1 get lower 16 bits of current LSN
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
403 addd #$0001 increment
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
404 std <curlsn+1 and save back
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
405 bcc L03E7 branch if no carry
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
406 inc <curlsn else increment bits 23-16 of LSN
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
407 L03E7 tst <srcerr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
408 beq L03FD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
409 pshs u
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
410 ldx <curlsn get curlsn in X
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
411 tfr b,a put bits 7-0 of LSN into bits 15-8
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
412 clrb and clear B
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
413 tfr d,u transfer to U
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
414 lda <srcpath
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
415 os9 I$Seek
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
416 puls u
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
417 clr <srcerr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
418 L03FD ldx <sctbuf
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
419 leax >256,x
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
420 L0403 stx <sctbuf
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
421 lda <pagcntr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
422 suba #$01
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
423 sta <pagcntr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
424 bcc L03BF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
425 L040D rts
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
426
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
427 ShowHelp equ *
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
428 IFNE DOHELP
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
429 leax <strbuf,u get address of buffer
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
430 stx <bufptr store as current buffer pointer
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
431 leay >HelpMsg,pcr point to help message data
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.
robertgault
parents: 2148
diff changeset
432 lbra L03B6
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
433 ELSE
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
434 bra exit
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
435 ENDC
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
436 L0419 leay >rdydst,pcr
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
437 doprompt tst <pmptsng single disk backup prompt?
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
438 beq L0439 if not, just return
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
439 getkey bsr L0456
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
440 pshs y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
441 leax ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
442 ldy #$0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
443 clra
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
444 os9 I$Read read byte from stdin
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
445 leay >L00A0,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
446 bsr L0456
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
447 puls y,x,b,a
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
448 anda #$7F clear hi bit
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
449 L0439 rts
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
450 * New routine needed as F$PrsNam will stop at the second "/";RG
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
451 getnm pshs x skip to end of file name;RG
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
452 ldb #-1
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
453 gtnm2 lda ,x+
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
454 incb
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
455 cmpa #C$SPAC
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
456 beq gtnm3
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
457 cmpa #C$COMA
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
458 bne gtnm2
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
459 gtnm3 puls x
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
460 bra L0443
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
461 * End of new routine;RG
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
462 L043A pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
463 os9 F$PrsNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
464 puls x
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 200
diff changeset
465 bcs ShowHelp
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
466 L0443 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
467 bsr L04A5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
468 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
469 bpl L0443
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
470 rts
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
471
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
472 L044B lda ,y get char at Y
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
473 anda #$7F strip off hi bit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
474 bsr L04A5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
475 lda ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
476 bpl L044B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
477 L0455 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
478 L0456 bsr L044B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
479 pshs y,x,a
1758
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
480 ldd <bufptr
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
481 leax <strbuf,u
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
482 stx <bufptr
a8bb0834424e commented backup
boisy
parents: 1325
diff changeset
483 subd <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
484 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
485 lda #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
486 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
487 puls pc,y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
488 L046C leay >L00F7,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
489 L0470 bsr L044B
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
490 lda <curlsn
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
491 bsr L0486
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
492 inc <u0009
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
493 lda <curlsn+1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
494 bsr L0488
2148
aaff55744d7d comments updated
boisy
parents: 1830
diff changeset
495 lda <curlsn+2
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
496 bsr L0488
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
497 leay >L00B5,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
498 bra L0456
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
499 L0486 clr <u0009
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
500 L0488 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
501 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
502 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
503 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
504 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
505 bsr L0494
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
506 puls a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
507 anda #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
508 L0494 tsta
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
509 beq L0499
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
510 sta <u0009
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
511 L0499 tst <u0009
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
512 beq L0455
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
513 adda #$30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
514 cmpa #$39
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
515 bls L04A5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
516 adda #$07
1830
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
517 L04A5 pshs x save X on stack
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
518 ldx <bufptr load 'next' ptr
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
519 sta ,x+ save A at location and inc ptr
d1f2f21d6af7 Added Robert Gault's 'F' option mod to backup for DSK images
boisy
parents: 1758
diff changeset
520 stx <bufptr save 'next' ptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
521 puls pc,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
522
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
523 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
524 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
525 end