Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/format_d64.asm @ 990:3c51c59f97c4
Small cosmetic changes
author | boisy |
---|---|
date | Fri, 21 Feb 2003 13:18:13 +0000 |
parents | 7dea3d77ba0b |
children |
rev | line source |
---|---|
162 | 1 ******************************************************************** |
2 * Format - Initialize disk media | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
8 * 18 From Dragon OS-9 Level One VR 01.02.00 |
162 | 9 |
10 * The Dragon edition is slightly different from the Color Computer's | |
11 * Even though the strings "Change from 96tpi to 48tpi? " | |
12 * and "Double sided? " are in here Dragon doesn't use them. | |
13 | |
14 nam Format | |
15 ttl Initialize disk media | |
16 | |
17 * Disassembled 02/07/09 18:53:41 by Disasm v1.6 (C) 1988 by RML | |
18 | |
19 ifp1 | |
20 use defsfile | |
21 endc | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
22 |
162 | 23 tylg set Prgrm+Objct |
24 atrv set ReEnt+rev | |
25 rev set $01 | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
26 edition set 18 |
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
27 |
162 | 28 mod eom,name,tylg,atrv,start,size |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
29 |
162 | 30 u0000 rmb 1 |
31 u0001 rmb 1 | |
32 PathNm rmb 1 | |
33 u0003 rmb 1 | |
34 u0004 rmb 1 | |
35 u0005 rmb 2 | |
36 u0007 rmb 1 | |
37 u0008 rmb 1 | |
38 u0009 rmb 1 | |
39 u000A rmb 1 | |
40 u000B rmb 1 | |
41 u000C rmb 2 | |
42 u000E rmb 1 | |
43 u000F rmb 1 | |
44 u0010 rmb 1 | |
45 u0011 rmb 1 | |
46 u0012 rmb 1 | |
47 u0013 rmb 2 | |
48 u0015 rmb 1 | |
49 u0016 rmb 1 | |
50 u0017 rmb 1 | |
51 u0018 rmb 1 | |
52 u0019 rmb 1 | |
53 u001A rmb 1 | |
54 u001B rmb 1 | |
55 u001C rmb 1 | |
56 u001D rmb 2 | |
57 u001F rmb 1 | |
58 u0020 rmb 2 | |
59 u0022 rmb 1 | |
60 u0023 rmb 1 | |
61 u0024 rmb 1 | |
62 ClustSz rmb 1 | |
63 u0026 rmb 1 | |
64 u0027 rmb 1 | |
65 u0028 rmb 1 | |
66 u0029 rmb 1 | |
67 u002A rmb 1 | |
68 u002B rmb 1 | |
69 u002C rmb 1 | |
70 u002D rmb 2 | |
71 u002F rmb 1 | |
72 u0030 rmb 1 | |
73 u0031 rmb 1 | |
74 u0032 rmb 1 | |
75 u0033 rmb 1 | |
76 u0034 rmb 2 | |
77 u0036 rmb 2 | |
78 u0038 rmb 2 | |
79 u003A rmb 1 | |
80 u003B rmb 2 | |
81 u003D rmb 2 | |
82 u003F rmb 4 | |
83 u0043 rmb 1 | |
84 u0044 rmb 2 | |
85 u0046 rmb 1 | |
86 DevPath rmb 1 Contains "/" | |
87 Device rmb 13 | |
88 u0055 rmb 15 | |
89 u0064 rmb 3 | |
90 u0067 rmb 32 | |
91 u0087 rmb 40 | |
92 u00AF rmb 14 | |
93 u00BD rmb 12 | |
94 DateBf rmb 5 | |
95 u00CE rmb 9 | |
96 u00D7 rmb 17 | |
97 u00E8 rmb 6 | |
98 u00EE rmb 177 | |
99 u019F rmb 2 | |
100 u01A1 rmb 2 | |
101 u01A3 rmb 12 | |
102 DDBuf rmb 256 | |
103 u02AF rmb 3 | |
104 u02B2 rmb 9924 | |
105 u2976 rmb 451 | |
106 size equ . | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
107 |
162 | 108 name fcs /Format/ |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
109 fcb edition |
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
110 |
162 | 111 L0014 fcb $00 |
112 fcb $00 | |
113 L0016 fcb $00 | |
114 fcb $00 | |
115 L0018 fcb $00 | |
116 fcb $00 | |
117 L001A fcb $80 | |
118 fcb $E5 e | |
119 fcb $80 | |
120 fcb $E5 e | |
121 fcb $00 | |
122 fcb $00 | |
123 L0020 fcb $01 | |
124 fcb $00 | |
125 fcb $28 ( | |
126 fcb $FF | |
127 fcb $06 | |
128 fcb $00 | |
129 fcb $01 | |
130 fcb $FC | |
131 fcb $0C | |
132 fcb $FF | |
133 fcb $00 | |
134 fcb $00 | |
135 fcb $06 | |
136 fcb $00 | |
137 fcb $01 | |
138 fcb $FE | |
139 fcb $04 | |
140 fcb $00 | |
141 fcb $01 | |
142 fcb $F7 w | |
143 fcb $0A | |
144 fcb $FF | |
145 fcb $06 | |
146 fcb $00 | |
147 fcb $01 | |
148 fcb $FB | |
149 fcb $80 | |
150 fcb $E5 e | |
151 fcb $80 | |
152 fcb $E5 e | |
153 fcb $01 | |
154 fcb $F7 w | |
155 fcb $0A | |
156 fcb $FF | |
157 fcb $00 | |
158 fcb $00 | |
159 fcb $FF | |
160 fcb $00 | |
161 fcb $43 C | |
162 fcb $01 | |
163 fcb $28 ( | |
164 L0049 fcb $50 P | |
165 fcb $4E N | |
166 fcb $0C | |
167 fcb $00 | |
168 fcb $03 | |
169 fcb $F6 v | |
170 fcb $01 | |
171 fcb $FC | |
172 fcb $20 | |
173 fcb $4E N | |
174 fcb $00 | |
175 fcb $00 | |
176 fcb $0C | |
177 fcb $00 | |
178 fcb $03 | |
179 fcb $F5 u | |
180 fcb $01 | |
181 fcb $FE | |
182 fcb $04 | |
183 fcb $00 | |
184 fcb $01 | |
185 fcb $F7 w | |
186 fcb $16 | |
187 fcb $4E N | |
188 fcb $0C | |
189 fcb $00 | |
190 fcb $03 | |
191 fcb $F5 u | |
192 fcb $01 | |
193 fcb $FB | |
194 fcb $80 | |
195 fcb $E5 e | |
196 fcb $80 | |
197 fcb $E5 e | |
198 fcb $01 | |
199 fcb $F7 w | |
200 fcb $16 | |
201 fcb $4E N | |
202 fcb $00 | |
203 fcb $00 | |
204 fcb $4E N | |
205 fcb $00 | |
206 fcb $90 | |
207 fcb $01 | |
208 fcb $52 R | |
209 L0076 fcb $20 | |
210 fcb $4E N | |
211 fcb $00 | |
212 fcb $00 | |
213 fcb $08 | |
214 fcb $00 | |
215 fcb $03 | |
216 fcb $F5 u | |
217 fcb $01 | |
218 fcb $FE | |
219 fcb $04 | |
220 fcb $00 | |
221 fcb $01 | |
222 fcb $F7 w | |
223 fcb $16 | |
224 fcb $4E N | |
225 fcb $0C | |
226 fcb $00 | |
227 fcb $03 | |
228 fcb $F5 u | |
229 fcb $01 | |
230 fcb $FB | |
231 fcb $80 | |
232 fcb $E5 e | |
233 fcb $80 | |
234 fcb $E5 e | |
235 fcb $01 | |
236 fcb $F7 w | |
237 fcb $18 | |
238 fcb $4E N | |
239 fcb $00 | |
240 fcb $00 | |
241 fcb $4E N | |
242 fcb $00 | |
243 fcb $2C , | |
244 fcb $01 | |
245 fcb $50 P | |
246 start equ * | |
247 stu <u0000 | |
248 bsr L00BE | |
249 bsr L00CF | |
250 bsr L011A | |
251 lbsr L0295 | |
252 lbsr AskBoth | |
253 lbsr L04A9 | |
254 lbsr L0589 | |
255 lbsr L05BF | |
256 lbsr L07C0 | |
257 ldu <u0044 | |
258 os9 I$Detach | |
259 clrb | |
260 Exit os9 F$Exit | |
261 | |
262 L00BE leay PathNm,u | |
263 pshs y | |
264 leay >u00AF,u | |
265 L00C6 clr ,-y | |
266 cmpy ,s | |
267 bhi L00C6 | |
268 puls pc,y | |
269 | |
270 L00CF lda ,x+ | |
271 cmpa #'/ | |
272 beq L00DA | |
273 L00D5 ldb #E$BPNam | |
274 lbra ErrExit | |
275 L00DA os9 F$PrsNam | |
276 lbcs ErrExit | |
277 lda #'/ | |
278 cmpa ,y | |
279 beq L00D5 | |
280 sty <u0020 | |
281 * | |
282 * Copy device name from arg to DevPath | |
283 leay <DevPath,u | |
284 L00ED sta ,y+ | |
285 lda ,x+ | |
286 decb | |
287 bpl L00ED | |
288 leax <Device,u | |
289 lda #$20 | |
290 sta ,y | |
291 | |
292 clra 0 = Use device capabilities | |
293 os9 I$Attach | |
294 lbcs ErrExit | |
295 stu <u0044 | |
296 ldu <u0000 | |
297 lda #$40 | |
298 ldb #$20 | |
299 std ,y | |
300 lda #WRITE. | |
301 leax <DevPath,u | |
302 os9 I$Open | |
303 bcs Exit | |
304 sta <PathNm | |
305 rts | |
306 L011A bsr L0122 | |
307 bsr L015D | |
308 lbsr L0216 | |
309 rts | |
310 | |
311 L0122 leax >DDBuf,u | |
312 clrb | |
313 os9 I$GetStt | |
314 bcs Exit | |
315 ldb $07,x | |
316 stb <u0012 | |
317 ldb $04,x | |
318 pshs b | |
319 andb #$01 | |
320 stb <u0010 | |
321 puls b | |
322 lsrb | |
323 andb #$01 | |
324 stb <u0011 | |
325 ldd $05,x | |
326 std <u0013 | |
327 ldb $03,x | |
328 stb <u001B | |
329 andb #$20 | |
330 stb <u0046 | |
331 ldd $09,x | |
332 std <u0017 | |
333 ldd $0B,x | |
334 std <u0019 | |
335 ldb $0D,x | |
336 stb <u001F | |
337 ldb #$01 | |
338 stb <ClustSz | |
339 clrb | |
340 rts | |
341 L015D ldx <u0020 | |
342 L015F leay >L0188,pcr | |
343 bsr L0176 | |
344 bcs L017F | |
345 pshs b,a | |
346 ldd $02,y | |
347 leay d,y | |
348 puls b,a | |
349 jsr ,y | |
350 bcc L015F | |
351 lbra Exit | |
352 L0176 lda ,x+ | |
353 L0178 cmpa ,y | |
354 bne L0180 | |
355 ldb $01,y | |
356 clra | |
357 L017F rts | |
358 L0180 leay $04,y | |
359 tst ,y | |
360 bne L0178 | |
361 coma | |
362 rts | |
363 L0188 fdb $5259,$002c,$7259,$0028 | |
364 fdb $2200,$002d,$3a00,$005d,$4300,$0022,$6300,$001e | |
365 fdb $2800,$0013,$2900,$000f,$2c00,$000b,$2000,$0007 | |
366 fdb $00d7,$1039,$d71c,$39d7,$1239,$0c46,$3931,$c867 | |
367 | |
368 ldb #$20 | |
369 L01C2 lda ,x+ | |
370 cmpa #$22 | |
371 beq L01D9 | |
372 sta ,y+ | |
373 decb | |
374 bne L01C2 | |
375 L01CD ldb ,x+ | |
376 cmpb #$22 | |
377 beq L01DF | |
378 cmpb #$20 | |
379 bcc L01CD | |
380 bra L01DF | |
381 L01D9 lda #$20 | |
382 cmpb #$20 | |
383 beq L01E3 | |
384 L01DF leay -$01,y | |
385 lda ,y | |
386 L01E3 adda #$80 | |
387 sta ,y | |
388 clrb | |
389 rts | |
390 lbsr L08AF | |
391 ldd <u001D | |
392 std <u0013 | |
393 rts | |
394 lbsr L08AF | |
395 ldd <u001D | |
396 tsta | |
397 beq L01FB | |
398 ldb #$01 | |
399 L01FB stb <u001F | |
400 L01FD rts | |
401 lbsr L08AF | |
402 ldd <u001D | |
403 tsta | |
404 beq L0208 | |
405 ldb #$01 | |
406 L0208 stb <ClustSz | |
407 negb | |
408 decb | |
409 andb <ClustSz | |
410 beq L0214 | |
411 ldb #$01 | |
412 stb <ClustSz | |
413 L0214 clrb | |
414 rts | |
415 L0216 leax >Title,pcr | |
416 lbsr L0272 | |
417 leay >DDBuf,u | |
418 ldx $0B,y | |
419 tst <u0010 | |
420 beq L0229 | |
421 ldx $09,y | |
422 L0229 stx <u0017 | |
423 leax >FmtMsg,pcr | |
424 ldy #FmtMLen | |
425 lbsr L0276 | |
426 leax <DevPath,u | |
427 tfr x,y | |
428 L023B lda ,y+ | |
429 cmpa #$40 | |
430 bne L023B | |
431 pshs y | |
432 lda #$0D | |
433 sta -$01,y | |
434 lbsr L0272 | |
435 puls y | |
436 lda #$40 | |
437 sta -$01,y | |
438 lda <u001C | |
439 bne L01FD | |
440 L0254 leax >Query,pcr | |
441 ldy #QueryLen | |
442 lbsr GetYN | |
443 anda #$DF | |
444 cmpa #'Y | |
445 beq L01FD | |
446 clrb | |
447 cmpa #'N | |
448 lbeq Exit | |
449 bra L0254 | |
450 L026E leax >HelpCR,pcr | |
451 L0272 ldy #$0050 | |
452 L0276 lda #$01 | |
453 os9 I$WritLn | |
454 rts | |
455 * | |
456 * Read a one-byte answer | |
457 * | |
458 GetYN pshs u,y,x,b,a | |
459 bsr L0276 | |
460 leax ,s | |
461 ldy #$0001 | |
462 clra | |
463 os9 I$Read | |
464 lbcs Exit | |
465 bsr L026E | |
466 puls u,y,x,b,a | |
467 anda #$7F | |
468 rts | |
469 | |
470 L0295 leax >L001A,pcr | |
471 stx <u000A | |
472 ldb <u001B | |
473 bitb #$C0 | |
474 bne L02B9 | |
475 ldb <u0046 | |
476 beq L02AB | |
477 leax >L0076,pcr | |
478 bra L02B9 | |
479 L02AB leax >L0020,pcr | |
480 stx <u000A | |
481 tst <u0010 | |
482 beq L02B9 | |
483 leax >L0049,pcr | |
484 L02B9 stx <u000C | |
485 clra | |
486 ldb <u0012 | |
487 tfr d,y | |
488 clrb | |
489 ldx <u0013 | |
490 bsr L0303 | |
491 exg d,x | |
492 subd #$0001 | |
493 bcc L02CE | |
494 leax -$01,x | |
495 L02CE exg d,x | |
496 ldy <u0017 | |
497 bsr L0303 | |
498 exg d,x | |
499 addd <u0019 | |
500 std <u0023 | |
501 exg d,x | |
502 adcb #$00 | |
503 stb <u0022 | |
504 lda #$08 | |
505 pshs a | |
506 ldx <u0023 | |
507 ldb <u0022 | |
508 bsr L034C | |
509 lda <ClustSz | |
510 pshs a | |
511 bsr L034C | |
512 tstb | |
513 beq L02FE | |
514 leax >ClustMsg,pcr | |
515 lbsr L0272 | |
516 lbra L0528 | |
517 L02FE leas $02,s | |
518 stx <u0026 | |
519 rts | |
520 L0303 lda #$08 | |
521 L0305 clr ,-s | |
522 deca | |
523 bne L0305 | |
524 sty ,s | |
525 stb $02,s | |
526 stx $03,s | |
527 L0311 ldd ,s | |
528 beq L0334 | |
529 lsra | |
530 rorb | |
531 std ,s | |
532 bcc L0327 | |
533 ldd $03,s | |
534 addd $06,s | |
535 std $06,s | |
536 lda $02,s | |
537 adca $05,s | |
538 sta $05,s | |
539 L0327 ldd $03,s | |
540 lslb | |
541 rola | |
542 std $03,s | |
543 lda $02,s | |
544 rola | |
545 sta $02,s | |
546 bra L0311 | |
547 L0334 leas $05,s | |
548 puls pc,x,b | |
549 L0338 pshs x,b | |
550 lsr ,s | |
551 ror $01,s | |
552 ror $02,s | |
553 puls x,b | |
554 exg d,x | |
555 adcb #$00 | |
556 adca #$00 | |
557 exg d,x | |
558 adcb #$00 | |
559 L034C lsr $02,s | |
560 bne L0338 | |
561 rts | |
562 | |
563 AskBoth tst <u001B | |
564 bpl L036B | |
565 leax >Both,pcr | |
566 ldy #BothLen | |
567 lbsr GetYN | |
568 anda #$DF | |
569 cmpa #'Y | |
570 beq L036B | |
571 cmpa #'N | |
572 bne AskBoth | |
573 rts | |
574 | |
575 L036B lda <PathNm | |
576 ldb #SS.Reset | |
577 os9 I$SetStt | |
578 lbcs Exit | |
579 ldd #$0000 | |
580 std <u0003 | |
581 inca | |
582 sta <u0007 | |
583 L037E clr <u0005 | |
584 L0380 bsr L03DA | |
585 leax >u00AF,u | |
586 ldu <u0003 | |
587 clrb | |
588 tst <u0010 | |
589 beq L039B | |
590 tst <u0046 | |
591 bne L0399 | |
592 tst <u0004 | |
593 bne L0399 | |
594 tst <u0005 | |
595 beq L039B | |
596 L0399 orb #$02 | |
597 L039B tst <u0011 | |
598 beq L03A1 | |
599 orb #$04 | |
600 L03A1 lda <u0005 | |
601 beq L03A7 | |
602 orb #$01 | |
603 L03A7 tfr d,y | |
604 lda <PathNm | |
605 ldb #SS.WTrk | |
606 os9 I$SetStt | |
607 lbcs Exit | |
608 ldu <u0000 | |
609 ldb <u0005 | |
610 incb | |
611 stb <u0005 | |
612 cmpb <u0012 | |
613 bcs L0380 | |
614 ldd <u0003 | |
615 addd #$0001 | |
616 std <u0003 | |
617 cmpd <u0013 | |
618 bcs L037E | |
619 rts | |
620 L03CC ldy <u000E | |
621 L03CF ldd ,y++ | |
622 beq L03E9 | |
623 L03D3 stb ,x+ | |
624 deca | |
625 bne L03D3 | |
626 bra L03CF | |
627 L03DA lda <u001B | |
628 bita #$C0 | |
629 beq L03EA | |
630 ldy <u000C | |
631 leax >u00AF,u | |
632 bsr L03CF | |
633 L03E9 rts | |
634 L03EA ldy <u000C | |
635 ldb <u0018 | |
636 tst <u0046 | |
637 bne L0400 | |
638 tst <u0004 | |
639 bne L0400 | |
640 tst <u0005 | |
641 bne L0400 | |
642 ldy <u000A | |
643 ldb <u001A | |
644 L0400 sty <u000E | |
645 stb <u0009 | |
646 stb <u0016 | |
647 bsr L0466 | |
648 leax >u00AF,u | |
649 bsr L03CF | |
650 sty <u000E | |
651 L0412 bsr L03CC | |
652 dec <u0009 | |
653 bne L0412 | |
654 lda ,y+ | |
655 sty <u000E | |
656 stx <u003B | |
657 leay >u2976,u | |
658 sty <u001D | |
659 tfr a,b | |
660 L0428 std ,x++ | |
661 cmpx <u001D | |
662 bcs L0428 | |
663 ldy <u000E | |
664 ldd ,y++ | |
665 std <u003D | |
666 ldd ,y | |
667 std <u003F | |
668 clr <u0009 | |
669 leax >u00AF,u | |
670 ldd <u003D | |
671 leay >u0087,u | |
672 L0445 leax d,x | |
673 ldd <u0004 | |
674 std ,x | |
675 ldb <u0009 | |
676 lda b,y | |
677 incb | |
678 stb <u0009 | |
679 ldb <u0007 | |
680 tst <u0046 | |
681 beq L0459 | |
682 inca | |
683 L0459 std $02,x | |
684 lda <u0009 | |
685 cmpa <u0016 | |
686 bcc L0465 | |
687 ldd <u003F | |
688 bra L0445 | |
689 L0465 rts | |
690 L0466 pshs y,b | |
691 tfr b,a | |
692 ldb <u0004 | |
693 cmpb #$01 | |
694 bhi L0492 | |
695 leax >u0087,u | |
696 leay a,x | |
697 ldb <u001F | |
698 bne L0481 | |
699 L047A leax >Abort,pcr | |
700 lbra L0676 | |
701 L0481 cmpb <u0016 | |
702 bhi L047A | |
703 nega | |
704 pshs y,x,b,a | |
705 clra | |
706 L0489 sta ,x | |
707 inca | |
708 cmpa <u0016 | |
709 bne L0494 | |
710 leas $06,s | |
711 L0492 puls pc,y,b | |
712 L0494 ldb <u001F | |
713 abx | |
714 cmpx $04,s | |
715 bcs L049F | |
716 ldb ,s | |
717 leax b,x | |
718 L049F cmpx $02,s | |
719 bne L0489 | |
720 leax $01,x | |
721 stx $02,s | |
722 bra L0489 | |
723 L04A9 lbsr L081B | |
724 ldd <u0023 | |
725 std $01,x DD.TOT+1 | |
726 ldb <u0022 | |
727 stb ,x DD.TOT? | |
728 ldd <u0017 | |
729 std <$11,x DD.SPT? | |
730 stb $03,x DD.TKS? | |
731 lda <ClustSz | |
732 sta $07,x DD.BIT+1 | |
733 clra | |
734 ldb <u0026 | |
735 tst <u0027 | |
736 beq L04C9 | |
737 addd #$0001 | |
738 L04C9 addd #$0001 | |
739 addd #$0010 | |
740 std $09,x DD.DIR? | |
741 clra | |
742 tst <u0010 | |
743 beq L04D8 | |
744 ora #$02 | |
745 L04D8 ldb <u0012 | |
746 cmpb #$01 | |
747 beq L04E0 | |
748 ora #$01 | |
749 L04E0 tst <u0011 | |
750 beq L04E6 | |
751 ora #$04 | |
752 L04E6 sta <$10,x DD.FMT? | |
753 ldd <u0026 | |
754 std $04,x | |
755 lda #$FF | |
756 sta $0D,x Is FF always put in DD.ATT? | |
757 leax >DateBf,u | |
758 os9 F$Time | |
759 leax >u00CE,u | |
760 leay <u0067,u | |
761 tst ,y | |
762 beq L050B | |
763 L0503 lda ,y+ | |
764 sta ,x+ | |
765 bpl L0503 | |
766 bra L053E | |
767 L050B leax >DName,pcr | |
768 ldy #DNameLen | |
769 lbsr L0276 | |
770 leax >u00CE,u | |
771 ldy #$0021 | |
772 clra | |
773 os9 I$ReadLn | |
774 bcc L052F | |
168
3a847d2b4492
Cobbler, OS9Gen and format are all hardware dependent.
roug
parents:
162
diff
changeset
|
775 cmpa #E$EOF |
162 | 776 bne L050B |
777 L0528 leax >Aborted,pcr | |
778 lbra L0676 | |
779 L052F tfr y,d | |
780 leax d,x | |
781 clr ,-x | |
782 decb | |
783 beq L050B | |
784 lda ,-x | |
785 ora #$80 | |
786 sta ,x | |
787 L053E leax >DateBf,u | |
788 leay <$40,x | |
789 pshs y | |
790 ldd #$0000 | |
791 L054A addd ,x++ | |
792 cmpx ,s | |
793 bcs L054A | |
794 leas $02,s | |
795 std >u00BD,u | |
796 ldd >L0014,pcr | |
797 std >u019F,u | |
798 ldd >L0016,pcr | |
799 std >u01A1,u | |
800 ldd >L0018,pcr | |
801 std >u01A3,u | |
802 lda <PathNm | |
803 ldb #SS.Opt | |
804 leax >u00EE,u | |
805 os9 I$GetStt | |
806 ldb #SS.Reset | |
807 os9 I$SetStt | |
808 lbcs Exit | |
809 leax >u00AF,u | |
810 lbra L0827 | |
811 L0589 lda <PathNm | |
812 os9 I$Close | |
813 leax <DevPath,u | |
814 lda #READ. | |
815 os9 I$Open | |
816 lbcs L0672 | |
817 sta <PathNm | |
818 leax >u00AF,u | |
819 ldy #$0100 | |
820 os9 I$Read | |
821 lbcs L0672 | |
822 lda <PathNm | |
823 os9 I$Close | |
824 leax <DevPath,u | |
825 lda #UPDAT. | |
826 os9 I$Open | |
827 lbcs L0672 | |
828 sta <PathNm | |
829 rts | |
830 L05BF lda <u001B | |
831 clr <u0043 | |
832 bita #$80 | |
833 beq L05DE | |
834 L05C7 leax >Verify,pcr | |
835 ldy #VerifyLen | |
836 lbsr GetYN | |
837 anda #$DF | |
838 cmpa #'Y | |
839 beq L05DE | |
840 cmpa #'N | |
841 bne L05C7 | |
842 | |
843 sta <u0043 | |
844 L05DE ldd <u0019 | |
845 std <u0015 | |
846 clra | |
847 clrb | |
848 std <u0034 | |
849 std <u0003 | |
850 std <u0008 | |
851 std <u0030 | |
852 stb <u002F | |
853 sta <u003A | |
854 leax >DDBuf,u | |
855 stx <u0036 | |
856 lbsr L081F | |
857 leax >$0100,x | |
858 stx <u0038 | |
859 clra | |
860 ldb #$01 | |
861 std <u0032 | |
862 lda <ClustSz | |
863 sta <u0029 | |
864 clr <u0028 | |
865 clra | |
866 ldb <u0026 | |
867 tst <u0027 | |
868 beq L0614 | |
869 addd #$0001 | |
870 L0614 addd #$0009 | |
871 addd #$0010 | |
872 std <u002B | |
873 lda <ClustSz | |
874 L061E lsra | |
875 bcs L062F | |
876 lsr <u002B | |
877 ror <u002C | |
878 bcc L061E | |
879 inc <u002C | |
880 bne L061E | |
881 inc <u002B | |
882 bra L061E | |
883 L062F ldb <u002C | |
884 stb <u002D | |
885 lda <ClustSz | |
886 mul | |
887 std <u002B | |
888 subd #$0001 | |
889 subb <u0026 | |
890 sbca #$00 | |
891 subd #$0010 | |
892 tst <u0027 | |
893 beq L0649 | |
894 subd #$0001 | |
895 L0649 stb <u002A | |
896 L064B tst <u0043 | |
897 bne L067D | |
898 lda <PathNm | |
899 leax >u00AF,u | |
900 ldy #$0100 | |
901 os9 I$Read | |
902 bcc L067D | |
903 os9 F$PErr | |
904 lbsr L084B | |
905 lda #$FF | |
906 sta <u0028 | |
907 tst <u002F | |
908 bne L067D | |
909 ldx <u0030 | |
910 cmpx <u002B | |
911 bhi L067D | |
912 L0672 leax >BadSect,pcr | |
913 L0676 lbsr L0272 | |
914 clrb | |
915 lbra Exit | |
916 L067D ldd <u0008 | |
917 addd #$0001 | |
918 std <u0008 | |
919 cmpd <u0015 | |
920 bcs L06C2 | |
921 clr <u0008 | |
922 clr <u0009 | |
923 tst <u0043 | |
924 bne L06B7 | |
925 lda #$20 | |
926 pshs a | |
927 lda <u0004 | |
928 lbsr L0724 | |
929 pshs b,a | |
930 lda <u0003 | |
931 lbsr L0724 | |
932 pshs b | |
933 tfr s,x | |
934 ldy #$0004 | |
935 lbsr L0276 | |
936 lda $02,s | |
937 cmpa #$46 | |
938 bne L06B5 | |
939 lbsr L026E | |
940 L06B5 leas $04,s | |
941 L06B7 ldd <u0003 | |
942 addd #$0001 | |
943 std <u0003 | |
944 ldd <u0017 | |
945 std <u0015 | |
946 L06C2 dec <u0029 | |
947 bne L06D8 | |
948 bsr L0701 | |
949 tst <u0028 | |
950 bne L06D2 | |
951 ldx <u0034 | |
952 leax $01,x | |
953 stx <u0034 | |
954 L06D2 clr <u0028 | |
955 lda <ClustSz | |
956 sta <u0029 | |
957 L06D8 ldb <u002F | |
958 ldx <u0030 | |
959 leax $01,x | |
960 bne L06E1 | |
961 incb | |
962 L06E1 cmpb <u0022 | |
963 bcs L06E9 | |
964 cmpx <u0023 | |
965 bcc L06F0 | |
966 L06E9 stb <u002F | |
967 stx <u0030 | |
968 lbra L064B | |
969 L06F0 lda #$FF | |
970 sta <u0028 | |
971 leay >DDBuf,u | |
972 L06F8 cmpy <u0036 | |
973 beq L073C | |
974 bsr L0701 | |
975 bra L06F8 | |
976 L0701 ldx <u0036 | |
977 lda <u0028 | |
978 rora | |
979 rol ,x+ | |
980 inc <u003A | |
981 lda <u003A | |
982 cmpa #$08 | |
983 bcs L0723 | |
984 clr <u003A | |
985 stx <u0036 | |
986 cmpx <u0038 | |
987 bne L0723 | |
988 bsr L0780 | |
989 leax >DDBuf,u | |
990 stx <u0036 | |
991 lbsr L081F | |
992 L0723 rts | |
993 L0724 tfr a,b | |
994 lsra | |
995 lsra | |
996 lsra | |
997 lsra | |
998 andb #$0F | |
999 addd #$3030 | |
1000 cmpa #$39 | |
1001 bls L0735 | |
1002 adda #$07 | |
1003 L0735 cmpb #$39 | |
1004 bls L073B | |
1005 addb #$07 | |
1006 L073B rts | |
1007 L073C lbsr L026E | |
1008 leax >NumGood,pcr | |
1009 ldy #NumGoodLen | |
1010 lbsr L0276 | |
1011 ldb <ClustSz | |
1012 clra | |
1013 ldx <u0034 | |
1014 pshs x,a | |
1015 L0751 lsrb | |
1016 bcs L075C | |
1017 lsl $02,s | |
1018 rol $01,s | |
1019 rol ,s | |
1020 bra L0751 | |
1021 L075C puls x,a | |
1022 ldb #$0D | |
1023 pshs b | |
1024 tfr d,y | |
1025 tfr x,d | |
1026 tfr b,a | |
1027 bsr L0724 | |
1028 pshs b,a | |
1029 tfr x,d | |
1030 bsr L0724 | |
1031 pshs b,a | |
1032 tfr y,d | |
1033 bsr L0724 | |
1034 pshs b,a | |
1035 tfr s,x | |
1036 lbsr L0272 | |
1037 leas $07,s | |
1038 rts | |
1039 L0780 pshs y | |
1040 clra | |
1041 ldb #$01 | |
1042 cmpd <u0032 | |
1043 bne L079B | |
1044 leax >DDBuf,u | |
1045 clra | |
1046 ldb <u002D | |
1047 tfr d,y | |
1048 clrb | |
1049 os9 F$AllBit | |
1050 lbcs L0672 | |
1051 L079B lbsr L0835 | |
1052 leax >DDBuf,u | |
1053 lbsr L0827 | |
1054 ldd <u0022 | |
1055 cmpd <u002F | |
1056 bcs L07B7 | |
1057 bhi L07B4 | |
1058 ldb <u0024 | |
1059 cmpb <u0031 | |
1060 bcc L07B7 | |
1061 L07B4 lbsr L084B | |
1062 L07B7 ldd <u0032 | |
1063 addd #$0001 | |
1064 std <u0032 | |
1065 puls pc,y | |
1066 L07C0 ldd #$0010 | |
1067 addd <u0032 | |
1068 std <u0032 | |
1069 bsr L0835 | |
1070 leax >u02AF,u | |
1071 bsr L081F | |
1072 leax >u02B2,u | |
1073 os9 F$Time | |
1074 leax >u02AF,u | |
1075 lda #$BF | |
1076 sta ,x | |
1077 lda #$02 | |
1078 sta $08,x | |
1079 clra | |
1080 ldb #$40 | |
1081 std $0B,x | |
1082 ldb <u002A | |
1083 decb | |
1084 stb <$14,x | |
1085 ldd <u0032 | |
1086 addd #$0001 | |
1087 std <$11,x | |
1088 bsr L0827 | |
1089 bsr L081B | |
1090 ldd #$2EAE | |
1091 std ,x | |
1092 stb <$20,x | |
1093 ldd <u0032 | |
1094 std <$1E,x | |
1095 std <$3E,x | |
1096 bsr L0827 | |
1097 bsr L081B | |
1098 ldb <u002A | |
1099 L080F decb | |
1100 bne L0813 | |
1101 rts | |
1102 L0813 pshs b | |
1103 bsr L0827 | |
1104 puls b | |
1105 bra L080F | |
1106 L081B leax >u00AF,u | |
1107 L081F clra | |
1108 clrb | |
1109 L0821 sta d,x | |
1110 decb | |
1111 bne L0821 | |
1112 rts | |
1113 L0827 lda <PathNm | |
1114 ldy #$0100 | |
1115 os9 I$Write | |
1116 lbcs Exit | |
1117 rts | |
1118 L0835 clra | |
1119 ldb <u0032 | |
1120 tfr d,x | |
1121 lda <u0033 | |
1122 clrb | |
1123 tfr d,u | |
1124 L083F lda <PathNm | |
1125 os9 I$Seek | |
1126 ldu <u0000 | |
1127 lbcs Exit | |
1128 rts | |
1129 L084B ldx <u002F | |
1130 lda <u0031 | |
1131 clrb | |
1132 addd #$0100 | |
1133 tfr d,u | |
1134 bcc L083F | |
1135 leax $01,x | |
1136 bra L083F | |
1137 ldd ,y | |
1138 leau >u00AF,u | |
1139 leax >L08A3,pcr | |
1140 ldy #$2F20 | |
1141 L0869 leay >$0100,y | |
1142 subd ,x | |
1143 bcc L0869 | |
1144 addd ,x++ | |
1145 pshs b,a | |
1146 ldd ,x | |
1147 tfr y,d | |
1148 beq L0891 | |
1149 ldy #$2F30 | |
1150 cmpd #$3020 | |
1151 bne L088B | |
1152 ldy #$2F20 | |
1153 tfr b,a | |
1154 L088B sta ,u+ | |
1155 puls b,a | |
1156 bra L0869 | |
1157 L0891 sta ,u+ | |
1158 lda #$0D | |
1159 sta ,u | |
1160 ldu <u0000 | |
1161 leas $02,s | |
1162 leax >u00AF,u | |
1163 lbsr L0272 | |
1164 rts | |
1165 L08A3 | |
1166 fdb $2710,$03e8,$0064,$000a,$0001,$0000 | |
1167 | |
1168 L08AF ldd #$0000 | |
1169 L08B2 bsr L08C2 | |
1170 bcs L08BC | |
1171 bne L08B2 | |
1172 std <u001D | |
1173 bne L08C1 | |
1174 L08BC ldd #$0001 | |
1175 std <u001D | |
1176 L08C1 rts | |
1177 L08C2 pshs y,b,a | |
1178 ldb ,x+ | |
1179 subb #$30 | |
1180 cmpb #$0A | |
1181 bcc L08E0 | |
1182 lda #$00 | |
1183 ldy #$000A | |
1184 L08D2 addd ,s | |
1185 bcs L08DE | |
1186 leay -$01,y | |
1187 bne L08D2 | |
1188 std ,s | |
203 | 1189 andcc #^Zero |
162 | 1190 L08DE puls pc,y,b,a |
203 | 1191 L08E0 orcc #Zero |
162 | 1192 puls pc,y,b,a |
1193 | |
1194 ErrExit lda #$02 | |
1195 os9 F$PErr | |
1196 leax <HelpMsg,pcr | |
1197 ldy #$0154 | |
1198 lda #$02 | |
1199 os9 I$WritLn | |
1200 clrb | |
1201 os9 F$Exit | |
1202 | |
1203 Title fcb C$LF | |
1204 fcc "DRAGON FORMAT UTILITY" | |
1205 HelpCR fcb C$CR | |
1206 HelpMsg fcc "Use: FORMAT /devname <opts>" | |
1207 fcb C$LF | |
1208 fcc " opts: R - Ready" | |
1209 fcb C$LF | |
1210 fcc / "disk name"/ | |
1211 fcb C$LF,C$CR | |
1212 FmtMsg fcc "Formatting drive " | |
1213 FmtMLen equ *-FmtMsg | |
1214 | |
1215 Query fcc "y (yes) or n (no)" | |
1216 fcb C$LF | |
1217 fcc "Ready? " | |
1218 QueryLen equ *-Query | |
1219 | |
1220 Abort fcc "ABORT Interleave value out of range" | |
1221 fcb C$CR | |
1222 DName fcc "Disk name: " | |
1223 DNameLen equ *-DName | |
1224 fcc "How many Cylinders (Tracks?) : " | |
1225 BadSect fcc "Bad system sector, " | |
1226 Aborted fcc "FORMAT ABORTED" | |
1227 fcb C$CR | |
1228 ClustMsg fcc "Cluster size mismatch" | |
1229 fcb C$CR | |
1230 fcc "Double density? " | |
1231 TPIChg fcc "Change from 96tpi to 48tpi? " | |
1232 DSided fcc "Double sided? " | |
1233 NumGood fcc "Number of good sectors: $" | |
1234 NumGoodLen equ *-NumGood | |
1235 Both fcc "Both PHYSICAL and LOGICAL format? " | |
1236 BothLen equ *-Both | |
1237 Verify fcc "Physical Verify desired? " | |
1238 VerifyLen equ *-Verify | |
1239 | |
1240 emod | |
1241 eom equ * | |
1242 end |