Mercurial > hg > Members > kono > nitros9-code
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 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Backup - Make a backup copy of a disk | |
3 * | |
4 * $Id$ | |
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 | 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 | 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 | 23 |
24 nam Backup | |
25 ttl Make a backup copy of a disk | |
26 | |
27 * Disassembled 02/04/03 23:08:04 by Disasm v1.6 (C) 1988 by RML | |
28 | |
29 ifp1 | |
30 use defsfile | |
31 endc | |
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 | 37 tylg set Prgrm+Objct |
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 | 41 |
42 mod eom,name,tylg,atrv,start,size | |
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 | 46 u0002 rmb 2 |
47 u0004 rmb 5 | |
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 | 53 noprompt rmb 1 0 = prompt user, 1 = do not prompt user |
54 srcerr rmb 1 source disk error code on I$Read | |
55 curlsn rmb 3 current 24-bit LSN counter used while backing up | |
56 sctbuf rmb 2 sector buffer pointer | |
57 numpages rmb 1 number of 256 byte pages we can use for backup buffer | |
58 pagcntr rmb 1 256 byte page counter (for backup buffer) | |
59 dstdev rmb 32 | |
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 | 63 stack rmb 80 |
64 * Important, the next two lines MUST STAY TOGETHER because of assumptions | |
65 * about their location in the code. | |
66 dstlsn0 rmb 256 | |
67 srclsn0 rmb 256 | |
68 backbuff rmb 14*256 reserve pages for backup buffer | |
0 | 69 size equ . |
70 | |
71 name fcs /Backup/ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
72 fcb edition |
0 | 73 |
2148 | 74 defparms fcc "/d0 /d1" |
0 | 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 | 80 fcb C$LF |
81 fcc " [/dev1 [/dev2]]" | |
82 fcb C$LF | |
83 fcc " e - abort if read error" | |
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 | 87 fcc " p - do not prompt user" |
88 fcb C$LF | |
0 | 89 fcc " s - single drive prompts" |
90 fcb C$LF | |
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 | 93 L00A0 fcb $80+C$CR |
0 | 94 L00A1 fcc "Ready to backup from" |
1758 | 95 L00B5 fcb $80+C$SPAC |
2148 | 96 to fcs " to " |
97 ok fcc "Ok" | |
98 ask fcs " ?: " | |
99 rdysrc fcs "Ready Source, hit a key: " | |
100 rdydst fcs "Ready Destination, hit a key: " | |
0 | 101 L00F7 fcs "Sector $" |
2148 | 102 sctscpd fcs "Sectors copied: $" |
103 vfypass fcb C$LF | |
0 | 104 fcc "Verify pass" |
1758 | 105 fcb $80+C$CR |
2148 | 106 sctvfd fcs "Sectors verified: $" |
107 scratch fcb C$LF | |
0 | 108 fcc " is being scratched" |
1758 | 109 fcb $80+C$CR |
2148 | 110 notsame fcc "Disks not formatted identically" |
0 | 111 fcb C$LF |
2148 | 112 bkabort fcc "Backup Aborted" |
1758 | 113 fcb $80+C$CR |
0 | 114 |
2148 | 115 * Here's how registers are set when this process is forked: |
116 * | |
117 * +-----------------+ <-- Y (highest address) | |
118 * ! Parameter ! | |
119 * ! Area ! | |
120 * +-----------------+ <-- X, SP | |
121 * ! Data Area ! | |
122 * +-----------------+ | |
123 * ! Direct Page ! | |
124 * +-----------------+ <-- U, DP (lowest address) | |
125 * | |
126 * D = parameter area size | |
127 * PC = module entry point abs. address | |
128 * CC = F=0, I=0, others undefined | |
129 | |
130 * The start of the program is here. | |
131 start leas >stack,u move stack pointer to here | |
132 pshs b,a save parameter area size | |
133 pshs u save lowest addr | |
134 tfr y,d move top of parameter area to Y | |
135 subd ,s++ D=Y-U | |
136 subd #backbuff-stack | |
137 * A = number of 256 byte pages that are available for backup buffer | |
138 sta <numpages | |
1758 | 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 | 141 clr <errabrt |
142 clr <dontvfy | |
2148 | 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 | 146 ldd ,s++ get parameter length |
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 | 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 | 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 | 160 Chk4P lda -$01,x load A with prev char and backup X one byte |
161 eora #'P check for "do not prompt user" flag | |
162 anda #$DF mask it | |
163 bne Chk4S branch if not option | |
164 inc <noprompt | |
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 | 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 | 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 | 181 inc <fileflg update flag |
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 | 187 eorb #'V |
188 andb #$DF | |
189 bne L01D7 | |
190 ldd ,x+ | |
1758 | 191 cmpb #'0 |
0 | 192 bcc L01D7 |
1758 | 193 inc <dontvfy |
0 | 194 bra L0199 |
195 L01D7 lda ,-x | |
2148 | 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 | 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 | 205 ldy <bufptr |
0 | 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 | 212 L01F7 lda ,x+ |
213 cmpa #C$SPAC | |
214 beq L01F7 | |
215 cmpa #C$COMA | |
216 beq L01F7 | |
217 cmpa #C$CR | |
218 bne L020B | |
1758 | 219 inc <pmptsng |
0 | 220 ldx <u0002 |
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 | 224 leax -$01,x |
2148 | 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 | 227 ldy <bufptr |
0 | 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 | 230 leay >ask,pcr |
231 lbsr getkey | |
0 | 232 comb |
233 eora #'Y | |
234 anda #$DF | |
2148 | 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 | 238 ldx <u0002 |
1758 | 239 ldd #'@*256+C$SPAC |
0 | 240 L0238 cmpb ,x+ |
241 bne L0238 | |
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 | 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 | 249 leax >srclsn0,u |
1758 | 250 ldy #256 |
2148 | 251 os9 I$Read read LSN 0 of source |
0 | 252 bcs L027C |
253 ldx <u0004 | |
2148 | 254 leay <dstdev,u |
0 | 255 L0267 ldb ,x+ |
256 stb ,y+ | |
257 cmpb #C$SPAC | |
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 | 260 std -$01,y |
2148 | 261 leax <dstdev,u |
0 | 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 | 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 | 276 clr <curlsn |
277 clr <curlsn+1 | |
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 | 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 | 283 leax >dstlsn0,u |
1758 | 284 ldy #256 |
2148 | 285 os9 I$Read read LSN0 of destination |
0 | 286 pshs u,x |
287 ldx #$0000 | |
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 | 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 | 292 ldd >256,x check for source/dest disk having same number of sectors |
0 | 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 | 295 ldb >$0102,x |
296 cmpb $02,x | |
1758 | 297 beq DsksOk |
2148 | 298 DsksNOk leay >notsame,pcr |
0 | 299 lbra L03B6 |
2148 | 300 DsksOk leax >dstlsn0,u X now points to source LSN0 |
0 | 301 lda #$BF |
2148 | 302 sta <DD.OPT,x |
303 leay <DD.NAM,x | |
0 | 304 lbsr L044B |
2148 | 305 leay >scratch,pcr |
0 | 306 lbsr L0456 |
2148 | 307 leay >ok,pcr |
308 lbsr getkey get a key from the stdin | |
0 | 309 comb |
310 eora #'Y | |
311 anda #$DF | |
2148 | 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 | 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 | 324 ldy #256 |
2148 | 325 os9 I$Write write it to destination |
326 lbcs L03AF | |
0 | 327 pshs u |
328 ldx #$0000 | |
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 | 331 puls u |
2148 | 332 lbcs L03AF added Feb 8, 2008 BGP |
333 leax >srclsn0,u | |
0 | 334 os9 I$Read |
335 lbcs L03AF | |
2148 | 336 copyloop leay >rdysrc,pcr |
337 lbsr doprompt possibly show "ready source" message | |
338 lda <numpages | |
339 sta <pagcntr | |
340 leax >dstlsn0,u | |
0 | 341 lbsr L0403 |
342 lbsr L0419 | |
2148 | 343 ldd <sctbuf |
344 leax >dstlsn0,u | |
345 stx <sctbuf | |
346 subd <sctbuf | |
0 | 347 beq L035C |
348 tfr d,y | |
1758 | 349 lda <dstpath |
2148 | 350 * DriveWire Note: backup /x1 /d1 returns error 247 at this I$Write! |
0 | 351 os9 I$Write |
352 bcs L03AF | |
2148 | 353 L035C lda <srcerr |
0 | 354 cmpa #E$EOF |
2148 | 355 bne copyloop |
356 leay >sctscpd,pcr | |
0 | 357 lbsr L0470 |
1758 | 358 tst <dontvfy |
2148 | 359 bne exit |
1758 | 360 * Verification code |
2148 | 361 leay >vfypass,pcr |
0 | 362 lbsr L0456 |
1758 | 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 | 370 clr <curlsn |
371 clr <curlsn+1 | |
372 clr <curlsn+2 | |
373 clr <srcerr | |
374 L0396 lda <numpages | |
375 sta <pagcntr | |
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 | 378 lda <srcerr |
0 | 379 cmpa #E$EOF |
380 bne L0396 | |
2148 | 381 leay >sctvfd,pcr |
0 | 382 lbsr L0470 |
2148 | 383 bra exit |
0 | 384 L03AF os9 F$PErr |
2148 | 385 leay >bkabort,pcr |
0 | 386 L03B6 lbsr L0456 |
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 | 389 os9 F$Exit |
1758 | 390 L03BF ldy #256 |
391 lda <srcpath | |
0 | 392 os9 I$Read |
393 bcc L03DC | |
2148 | 394 stb <srcerr |
0 | 395 cmpb #E$EOF |
396 beq L040D | |
397 lbsr L046C | |
2148 | 398 ldb <srcerr |
1758 | 399 tst <errabrt |
0 | 400 bne L03AF |
401 os9 F$PErr | |
2148 | 402 L03DC ldd <curlsn+1 get lower 16 bits of current LSN |
403 addd #$0001 increment | |
404 std <curlsn+1 and save back | |
405 bcc L03E7 branch if no carry | |
406 inc <curlsn else increment bits 23-16 of LSN | |
407 L03E7 tst <srcerr | |
0 | 408 beq L03FD |
409 pshs u | |
2148 | 410 ldx <curlsn get curlsn in X |
411 tfr b,a put bits 7-0 of LSN into bits 15-8 | |
412 clrb and clear B | |
413 tfr d,u transfer to U | |
1758 | 414 lda <srcpath |
0 | 415 os9 I$Seek |
416 puls u | |
2148 | 417 clr <srcerr |
418 L03FD ldx <sctbuf | |
1758 | 419 leax >256,x |
2148 | 420 L0403 stx <sctbuf |
421 lda <pagcntr | |
0 | 422 suba #$01 |
2148 | 423 sta <pagcntr |
0 | 424 bcc L03BF |
425 L040D rts | |
1758 | 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 | 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 | 436 L0419 leay >rdydst,pcr |
437 doprompt tst <pmptsng single disk backup prompt? | |
438 beq L0439 if not, just return | |
439 getkey bsr L0456 | |
0 | 440 pshs y,x,b,a |
441 leax ,s | |
442 ldy #$0001 | |
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 | 445 leay >L00A0,pcr |
446 bsr L0456 | |
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 | 462 L043A pshs x |
463 os9 F$PrsNam | |
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 | 466 L0443 lda ,x+ |
467 bsr L04A5 | |
468 decb | |
469 bpl L0443 | |
470 rts | |
1758 | 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 | 474 bsr L04A5 |
475 lda ,y+ | |
476 bpl L044B | |
477 L0455 rts | |
478 L0456 bsr L044B | |
479 pshs y,x,a | |
1758 | 480 ldd <bufptr |
481 leax <strbuf,u | |
482 stx <bufptr | |
483 subd <bufptr | |
0 | 484 tfr d,y |
485 lda #$02 | |
486 os9 I$WritLn | |
487 puls pc,y,x,a | |
488 L046C leay >L00F7,pcr | |
489 L0470 bsr L044B | |
2148 | 490 lda <curlsn |
0 | 491 bsr L0486 |
492 inc <u0009 | |
2148 | 493 lda <curlsn+1 |
0 | 494 bsr L0488 |
2148 | 495 lda <curlsn+2 |
0 | 496 bsr L0488 |
497 leay >L00B5,pcr | |
498 bra L0456 | |
499 L0486 clr <u0009 | |
500 L0488 pshs a | |
501 lsra | |
502 lsra | |
503 lsra | |
504 lsra | |
505 bsr L0494 | |
506 puls a | |
507 anda #$0F | |
508 L0494 tsta | |
509 beq L0499 | |
510 sta <u0009 | |
511 L0499 tst <u0009 | |
512 beq L0455 | |
513 adda #$30 | |
514 cmpa #$39 | |
515 bls L04A5 | |
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 | 521 puls pc,x |
522 | |
523 emod | |
524 eom equ * | |
525 end |