Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/format.asm @ 556:28a203bbd2cc
findstr and signal finished.
author | roug |
---|---|
date | Tue, 22 Oct 2002 19:09:04 +0000 |
parents | b6c34acda06c |
children | 92b575ffa143 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
312 | 2 * Format - Disk format program |
0 | 3 * |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
312 | 8 * 22 From Tandy OS-9 Level Two Vr. 2.00.01 |
0 | 9 |
10 nam Format | |
312 | 11 ttl Disk format program |
0 | 12 |
312 | 13 * Disassembled 02/07/17 11:00:13 by Disasm v1.6 (C) 1988 by RML |
0 | 14 |
15 ifp1 | |
104 | 16 use defsfile |
312 | 17 use rbfdefs |
0 | 18 endc |
119 | 19 |
0 | 20 tylg set Prgrm+Objct |
21 atrv set ReEnt+rev | |
22 rev set $01 | |
312 | 23 edition set $16 |
119 | 24 |
0 | 25 mod eom,name,tylg,atrv,start,size |
119 | 26 |
312 | 27 SavedU rmb 2 |
28 DiskPath rmb 1 | |
29 CurrTrak rmb 2 | |
0 | 30 u0005 rmb 2 |
312 | 31 CurrSct rmb 1 |
0 | 32 u0008 rmb 1 |
33 u0009 rmb 1 | |
312 | 34 u000A rmb 2 |
0 | 35 u000C rmb 2 |
312 | 36 u000E rmb 2 |
37 MFM rmb 1 | |
0 | 38 u0011 rmb 1 |
312 | 39 T4896 rmb 1 |
40 u0013 rmb 1 | |
41 u0014 rmb 1 | |
42 NCyls rmb 2 | |
0 | 43 u0017 rmb 1 |
44 u0018 rmb 1 | |
312 | 45 Sectors rmb 1 |
0 | 46 u001A rmb 1 |
312 | 47 Sectors0 rmb 1 |
0 | 48 u001C rmb 1 |
312 | 49 DType rmb 1 |
50 u001E rmb 1 | |
0 | 51 u001F rmb 1 |
312 | 52 u0020 rmb 1 |
53 Interlv rmb 1 | |
54 u0022 rmb 2 | |
0 | 55 u0024 rmb 1 |
312 | 56 u0025 rmb 1 |
0 | 57 u0026 rmb 1 |
58 u0027 rmb 1 | |
59 u0028 rmb 1 | |
60 u0029 rmb 1 | |
61 u002A rmb 1 | |
62 u002B rmb 1 | |
63 u002C rmb 1 | |
312 | 64 u002D rmb 1 |
65 u002E rmb 1 | |
0 | 66 u002F rmb 1 |
67 u0030 rmb 1 | |
68 u0031 rmb 1 | |
69 u0032 rmb 1 | |
70 u0033 rmb 1 | |
312 | 71 u0034 rmb 1 |
72 u0035 rmb 1 | |
0 | 73 u0036 rmb 2 |
74 u0038 rmb 2 | |
312 | 75 u003A rmb 2 |
76 u003C rmb 1 | |
0 | 77 u003D rmb 2 |
312 | 78 u003F rmb 2 |
79 u0041 rmb 2 | |
0 | 80 u0043 rmb 1 |
312 | 81 u0044 rmb 1 |
82 u0045 rmb 1 | |
83 DTEntry rmb 2 | |
84 u0048 rmb 1 | |
85 STOff rmb 2 | |
86 u004B rmb 1 | |
87 u004C rmb 1 | |
88 u004D rmb 1 | |
89 u004E rmb 1 | |
90 u004F rmb 1 | |
91 u0050 rmb 5 | |
0 | 92 u0055 rmb 15 |
312 | 93 u0064 rmb 7 |
94 u006B rmb 4 | |
95 u006F rmb 32 | |
96 u008F rmb 40 | |
97 u00B7 rmb 14 | |
98 u00C5 rmb 12 | |
99 TimePkt rmb 5 | |
100 u00D6 rmb 18 | |
101 u00E8 rmb 14 | |
102 u00F6 rmb 177 | |
103 u01A7 rmb 2 | |
104 u01A9 rmb 2 | |
105 u01AB rmb 12 | |
106 OptBuf rmb 256 | |
107 u02B7 rmb 3 | |
108 u02BA rmb 9924 | |
109 u297E rmb 451 | |
0 | 110 size equ . |
119 | 111 |
112 name fcs /Format/ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
168
diff
changeset
|
113 fcb edition |
119 | 114 |
312 | 115 L0014 fdb $0000 |
116 L0016 fdb $0000 | |
117 L0018 fdb $0000 | |
118 L001A fdb $80E5 | |
119 fdb $80E5 | |
120 fdb $0000 | |
121 L0020 fdb $0100 | |
122 fdb $28FF | |
123 fdb $0600 | |
124 fdb $01FC | |
125 fdb $0CFF | |
126 fdb $0000 | |
127 fdb $0600 | |
128 fdb $01FE | |
129 fdb $0400 | |
130 fdb $01F7 | |
131 fdb $0AFF | |
132 fdb $0600 | |
133 fdb $01FB | |
134 fdb $80E5 | |
135 fdb $80E5 | |
136 fdb $01F7 | |
137 fdb $0AFF | |
138 fdb $0000 | |
139 fcb $Ff | |
140 fdb $0043 | |
141 fdb $0128 | |
142 L0049 fdb $504E | |
143 fdb $0C00 | |
144 fdb $03F6 | |
145 fdb $01Fc | |
146 fdb $204E | |
147 fdb $0000 | |
148 fdb $0C00 | |
149 fdb $03F5 | |
150 fdb $01FE | |
151 fdb $0400 | |
152 fdb $01F7 | |
153 fdb $164E | |
154 fdb $0C00 | |
155 fdb $03F5 | |
156 fdb $01FB | |
157 fdb $80E5 | |
158 fdb $80E5 | |
159 fdb $01F7 | |
160 fdb $164E | |
161 fdb $0000 | |
162 fcb $4E | |
0 | 163 fcb $00 |
164 fcb $90 | |
165 fcb $01 | |
166 fcb $52 R | |
167 L0076 fcb $20 | |
168 fcb $4E N | |
169 fcb $00 | |
170 fcb $00 | |
312 | 171 fcb $0C |
0 | 172 fcb $00 |
173 fcb $03 | |
174 fcb $F5 u | |
175 fcb $01 | |
176 fcb $FE | |
177 fcb $04 | |
178 fcb $00 | |
179 fcb $01 | |
180 fcb $F7 w | |
181 fcb $16 | |
182 fcb $4E N | |
183 fcb $0C | |
184 fcb $00 | |
185 fcb $03 | |
186 fcb $F5 u | |
187 fcb $01 | |
188 fcb $FB | |
189 fcb $80 | |
190 fcb $E5 e | |
191 fcb $80 | |
192 fcb $E5 e | |
193 fcb $01 | |
194 fcb $F7 w | |
195 fcb $18 | |
196 fcb $4E N | |
197 fcb $00 | |
198 fcb $00 | |
199 fcb $4E N | |
200 fcb $00 | |
312 | 201 fcb $30 0 |
0 | 202 fcb $01 |
312 | 203 fcb $54 T |
204 | |
205 start stu <SavedU | |
206 bsr ClrWork cleark work area | |
207 bsr OpenDev get device name and open it | |
0 | 208 bsr L011A |
312 | 209 lbsr GetDTyp |
210 lbsr L03C7 | |
211 lbsr L052F | |
212 lbsr L0612 | |
213 lbsr L0648 | |
214 lbsr L0843 | |
215 ldu <DTEntry | |
0 | 216 os9 I$Detach |
217 clrb | |
312 | 218 L00BB os9 F$Exit |
219 ClrWork leay DiskPath,u | |
0 | 220 pshs y |
312 | 221 leay >u00B7,u |
0 | 222 L00C6 clr ,-y |
223 cmpy ,s | |
224 bhi L00C6 | |
225 puls pc,y | |
162 | 226 |
312 | 227 OpenDev lda ,x+ |
228 cmpa #PDELIM | |
0 | 229 beq L00DA |
162 | 230 L00D5 ldb #E$BPNam |
312 | 231 lbra L0961 |
0 | 232 L00DA os9 F$PrsNam |
312 | 233 lbcs L0961 |
234 lda #PDELIM | |
0 | 235 cmpa ,y |
236 beq L00D5 | |
312 | 237 sty <u0022 |
238 leay <u004F,u | |
0 | 239 L00ED sta ,y+ |
240 lda ,x+ | |
241 decb | |
242 bpl L00ED | |
312 | 243 leax <u0050,u |
244 lda #C$SPAC | |
0 | 245 sta ,y |
312 | 246 clra |
0 | 247 os9 I$Attach |
312 | 248 lbcs L0961 |
249 stu <DTEntry | |
250 ldu <SavedU | |
251 lda #PENTIR | |
252 ldb #C$SPAC | |
0 | 253 std ,y |
162 | 254 lda #WRITE. |
312 | 255 leax <u004F,u |
0 | 256 os9 I$Open |
312 | 257 bcs L00BB |
258 sta <DiskPath | |
0 | 259 rts |
162 | 260 |
312 | 261 L011A bsr GetOpts |
262 bsr L0183 | |
263 lbsr L025E | |
264 rts | |
265 | |
266 GetOpts leax >OptBuf,u | |
0 | 267 clrb |
268 os9 I$GetStt | |
312 | 269 bcs L00BB |
270 ldb PD.SID-PD.OPT,x | |
271 stb <u0013 | |
272 stb <u0014 | |
273 ldb PD.SToff-PD.OPT,x | |
274 beq L0143 | |
275 tfr b,a | |
276 anda #$0F | |
277 sta <STOff | |
278 lsrb | |
279 lsrb | |
280 lsrb | |
281 lsrb | |
282 stb <u004B | |
283 L0143 ldb PD.DNS-PD.OPT,x | |
0 | 284 pshs b |
312 | 285 andb #DNS.MFM |
286 stb <MFM | |
287 stb <u0011 | |
288 ldb ,s | |
289 lsrb | |
290 pshs b | |
291 andb #$01 (PD.DTD) | |
292 stb <T4896 | |
0 | 293 puls b |
294 lsrb | |
312 | 295 andb <u0011 |
296 stb <u004C | |
297 puls b | |
0 | 298 ldb #$01 |
312 | 299 stb <u004D |
300 beq L0169 | |
301 stb <u004B | |
302 clr <STOff | |
303 L0169 ldd PD.CYL-PD.OPT,x | |
304 std <NCyls | |
305 ldb PD.TYP-PD.OPT,x | |
306 stb <DType | |
307 ldd PD.SCT-PD.OPT,x | |
308 std <Sectors | |
309 ldd PD.T0S-PD.OPT,x | |
310 std <Sectors0 | |
311 ldb PD.ILV-PD.OPT,x | |
312 stb <Interlv | |
313 ldb #$01 | |
314 stb <u0027 | |
0 | 315 clrb |
316 rts | |
312 | 317 L0183 ldx <u0022 |
318 L0185 leay >OptTbl,pcr | |
319 bsr L019C | |
320 bcs L01A5 | |
0 | 321 pshs b,a |
322 ldd $02,y | |
323 leay d,y | |
324 puls b,a | |
325 jsr ,y | |
312 | 326 bcc L0185 |
327 lbra L00BB | |
328 L019C lda ,x+ | |
329 L019E cmpa ,y | |
330 bne L01A6 | |
0 | 331 ldb $01,y |
332 clra | |
312 | 333 L01A5 rts |
334 L01A6 leay $04,y | |
0 | 335 tst ,y |
312 | 336 bne L019E |
0 | 337 coma |
338 rts | |
119 | 339 |
312 | 340 OptTbl |
341 opt.1 fcc /R/ | |
342 fcc /Y/ | |
343 fdb DoReady-opt.1 | |
344 opt.2 fcc /r/ | |
345 fcc /Y/ | |
346 fdb DoReady-opt.2 | |
347 opt.3 fcc /"/ | |
348 fcb $00 | |
349 fdb DoQuote-opt.3 | |
350 opt.4 fcc /:/ | |
351 fcb $00 | |
352 fdb DoColon-opt.4 | |
353 opt.5 fcc /1/ | |
354 fcb $01 | |
355 fdb Do1-opt.5 | |
356 opt.6 fcc /2/ | |
357 fcb $02 | |
358 fdb Do2-opt.6 | |
359 opt.7 fcc /'/ | |
360 fcb 0 | |
361 fdb DoSQuote-opt.7 | |
362 opt.8 fcc /L/ | |
363 fcb $01 | |
364 fdb DoL-opt.8 | |
365 opt.9 fcc /l/ | |
366 fcb 01 | |
367 fdb DoL-opt.9 | |
368 opt.10 fcc /(/ | |
369 fcb $00 | |
370 fdb DoLParen-opt.10 | |
371 opt.11 fcc /)/ | |
372 fcb $00 | |
373 fdb DoRParen-opt.11 | |
374 opt.12 fcc /,/ | |
375 fcb $00 | |
376 fdb DoComa-opt.12 | |
377 opt.13 fcb C$SPAC | |
378 fcb 00 | |
379 fdb DoSpace-opt.13 | |
119 | 380 |
312 | 381 fcb $00 |
382 | |
383 cmpb <u0011 | |
384 bgt L01FE | |
385 cmpb <u004C | |
386 blt L01FE | |
387 stb <MFM | |
388 clrb | |
389 | |
390 DoComa | |
391 DoRParen | |
392 DoLParen | |
393 DoSpace rts | |
394 | |
395 DoReady stb <u001E | |
396 rts | |
397 | |
398 Do2 | |
399 Do1 cmpb <u0013 | |
400 bgt L01FE | |
401 stb <u0013 | |
402 clrb | |
403 rts | |
404 | |
405 DoL stb <u004E | |
406 clrb | |
407 rts | |
408 | |
409 L01FE leax >AbortOp,pcr | |
410 lbra L06F9 | |
411 | |
412 DoQuote leay <u006F,u | |
413 ldb #C$SPAC | |
414 L020A | |
415 koQuote lda ,x+ | |
416 cmpa #'" | |
417 beq L0221 | |
0 | 418 sta ,y+ |
419 decb | |
312 | 420 bne L020A |
421 L0215 ldb ,x+ | |
422 cmpb #'" | |
423 beq L0227 | |
424 cmpb #C$SPAC | |
425 bcc L0215 | |
426 bra L0227 | |
427 L0221 lda #C$SPAC | |
428 cmpb #C$SPAC | |
429 beq L022B | |
430 L0227 leay -$01,y | |
0 | 431 lda ,y |
312 | 432 L022B adda #$80 |
0 | 433 sta ,y |
434 clrb | |
435 rts | |
312 | 436 |
437 DoSQuote lbsr L092C | |
438 ldd <u001F | |
439 std <NCyls | |
0 | 440 rts |
312 | 441 |
442 DoColon lbsr L092C | |
443 ldd <u001F | |
0 | 444 tsta |
312 | 445 beq L0243 |
0 | 446 ldb #$01 |
312 | 447 L0243 stb <Interlv |
448 rts | |
449 lbsr L092C | |
450 ldd <u001F | |
0 | 451 tsta |
312 | 452 beq L0250 |
0 | 453 ldb #$01 |
312 | 454 L0250 stb <u0027 |
0 | 455 negb |
456 decb | |
312 | 457 andb <u0027 |
458 beq L025C | |
0 | 459 ldb #$01 |
312 | 460 stb <u0027 |
461 L025C clrb | |
462 L025D rts | |
463 L025E leax >Title,pcr | |
464 lbsr L02E2 | |
465 leay >OptBuf,u | |
466 ldx PD.T0S-PD.OPT,y | |
467 tst <MFM | |
468 beq L0271 | |
469 ldx PD.SCT-PD.OPT,y | |
470 L0271 stx <Sectors | |
119 | 471 leax >FmtMsg,pcr |
472 ldy #FmtMLen | |
312 | 473 lbsr L02E6 |
474 leax <u004F,u | |
0 | 475 tfr x,y |
312 | 476 L0283 lda ,y+ |
477 cmpa #PENTIR | |
478 bne L0283 | |
0 | 479 pshs y |
312 | 480 lda #C$CR |
0 | 481 sta -$01,y |
312 | 482 lbsr L02E2 |
0 | 483 puls y |
312 | 484 lda #PENTIR |
0 | 485 sta -$01,y |
312 | 486 lda <u001E |
487 bne L02BC | |
488 tst <DType | |
489 bpl L02AB | |
490 leax >HDFmt,pcr | |
491 ldy #$002A | |
492 lbsr L02E6 | |
493 L02AB leax >Query,pcr | |
119 | 494 ldy #QueryLen |
312 | 495 lbsr L02EC |
0 | 496 anda #$DF |
162 | 497 cmpa #'Y |
312 | 498 bne L02D5 |
499 L02BC tst <DType | |
500 bpl L025D | |
501 leax >HDFmt,pcr | |
502 ldy #$0038 | |
503 lbsr L02EC | |
504 anda #$DF | |
505 cmpa #'Y | |
506 beq L025D | |
0 | 507 clrb |
312 | 508 lbra L00BB |
509 L02D5 clrb | |
162 | 510 cmpa #'N |
312 | 511 lbeq L00BB |
512 bra L02AB | |
513 L02DE leax >HelpCR,pcr | |
514 L02E2 ldy #80 | |
515 L02E6 lda #$01 | |
0 | 516 os9 I$WritLn |
517 rts | |
312 | 518 L02EC pshs u,y,x,b,a |
519 bsr L02E6 | |
0 | 520 leax ,s |
521 ldy #$0001 | |
522 clra | |
523 os9 I$Read | |
312 | 524 lbcs L00BB |
525 bsr L02DE | |
0 | 526 puls u,y,x,b,a |
527 anda #$7F | |
528 rts | |
162 | 529 |
312 | 530 GetDTyp leax >L001A,pcr |
0 | 531 stx <u000A |
312 | 532 ldb <DType |
533 bitb #TYP.HARD+TYP.NSF | |
534 bne L0323 | |
535 tst <u004D | |
536 beq L031B | |
0 | 537 leax >L0076,pcr |
312 | 538 bra L032D |
539 L031B leax >L0020,pcr | |
540 tst <MFM | |
541 beq L032D | |
542 L0323 stx <u000A | |
0 | 543 leax >L0049,pcr |
312 | 544 tst <u004C |
545 beq L032F | |
546 L032D stx <u000A | |
547 L032F stx <u000C | |
0 | 548 clra |
312 | 549 ldb <u0013 |
0 | 550 tfr d,y |
551 clrb | |
312 | 552 ldx <NCyls |
553 bsr L0379 | |
0 | 554 exg d,x |
555 subd #$0001 | |
312 | 556 bcc L0344 |
0 | 557 leax -$01,x |
312 | 558 L0344 exg d,x |
559 ldy <Sectors | |
560 bsr L0379 | |
0 | 561 exg d,x |
312 | 562 addd <Sectors0 |
563 std <u0025 | |
0 | 564 exg d,x |
565 adcb #$00 | |
312 | 566 stb <u0024 |
0 | 567 lda #$08 |
568 pshs a | |
312 | 569 ldx <u0025 |
570 ldb <u0024 | |
571 bsr L03C2 | |
572 lda <u0027 | |
0 | 573 pshs a |
312 | 574 bsr L03C2 |
0 | 575 tstb |
312 | 576 beq L0374 |
119 | 577 leax >ClustMsg,pcr |
312 | 578 lbsr L02E2 |
579 lbra L05B1 | |
580 L0374 leas $02,s | |
581 stx <u0028 | |
0 | 582 rts |
312 | 583 L0379 lda #$08 |
584 L037B clr ,-s | |
0 | 585 deca |
312 | 586 bne L037B |
0 | 587 sty ,s |
588 stb $02,s | |
589 stx $03,s | |
312 | 590 L0387 ldd ,s |
591 beq L03AA | |
0 | 592 lsra |
593 rorb | |
594 std ,s | |
312 | 595 bcc L039D |
0 | 596 ldd $03,s |
597 addd $06,s | |
598 std $06,s | |
599 lda $02,s | |
600 adca $05,s | |
601 sta $05,s | |
312 | 602 L039D ldd $03,s |
0 | 603 lslb |
604 rola | |
605 std $03,s | |
606 lda $02,s | |
607 rola | |
608 sta $02,s | |
312 | 609 bra L0387 |
610 L03AA leas $05,s | |
0 | 611 puls pc,x,b |
312 | 612 L03AE pshs x,b |
0 | 613 lsr ,s |
614 ror $01,s | |
615 ror $02,s | |
616 puls x,b | |
617 exg d,x | |
618 adcb #$00 | |
619 adca #$00 | |
620 exg d,x | |
621 adcb #$00 | |
312 | 622 L03C2 lsr $02,s |
623 bne L03AE | |
0 | 624 rts |
312 | 625 L03C7 tst <u004E |
626 bne L03E4 | |
627 tst <DType | |
628 bpl L03E5 | |
119 | 629 leax >Both,pcr |
630 ldy #BothLen | |
312 | 631 lbsr L02EC |
0 | 632 anda #$DF |
162 | 633 cmpa #'Y |
312 | 634 beq L03E5 |
162 | 635 cmpa #'N |
312 | 636 bne L03C7 |
637 L03E4 rts | |
638 L03E5 lda <DiskPath | |
119 | 639 ldb #SS.Reset |
0 | 640 os9 I$SetStt |
312 | 641 lbcs L00BB |
0 | 642 ldd #$0000 |
312 | 643 std <CurrTrak |
0 | 644 inca |
312 | 645 sta <CurrSct |
646 L03F8 clr <u0005 | |
647 L03FA bsr L045C | |
648 leax >u00B7,u | |
649 ldd <CurrTrak | |
650 addd <u0048 | |
651 tfr d,u | |
0 | 652 clrb |
312 | 653 tst <u004D |
654 bne L041B | |
655 tst <MFM | |
656 beq L041D | |
657 tst <u004C | |
658 bne L041B | |
659 tst <CurrTrak+1 | |
660 bne L041B | |
0 | 661 tst <u0005 |
312 | 662 beq L041D |
663 L041B orb #$02 | |
664 L041D tst <T4896 | |
665 beq L0423 | |
0 | 666 orb #$04 |
312 | 667 L0423 lda <u0005 |
668 beq L0429 | |
0 | 669 orb #$01 |
312 | 670 L0429 tfr d,y |
671 lda <DiskPath | |
119 | 672 ldb #SS.WTrk |
0 | 673 os9 I$SetStt |
312 | 674 lbcs L00BB |
675 ldu <SavedU | |
0 | 676 ldb <u0005 |
677 incb | |
678 stb <u0005 | |
312 | 679 cmpb <u0013 |
680 bcs L03FA | |
681 ldd <CurrTrak | |
0 | 682 addd #$0001 |
312 | 683 std <CurrTrak |
684 cmpd <NCyls | |
685 bcs L03F8 | |
0 | 686 rts |
312 | 687 L044E ldy <u000E |
688 L0451 ldd ,y++ | |
689 beq L046B | |
690 L0455 stb ,x+ | |
0 | 691 deca |
312 | 692 bne L0455 |
693 bra L0451 | |
694 L045C lda <DType | |
0 | 695 bita #$C0 |
312 | 696 beq L046C |
0 | 697 ldy <u000C |
312 | 698 leax >u00B7,u |
699 bsr L0451 | |
700 L046B rts | |
701 L046C ldy <u000C | |
702 ldb <u001A | |
703 tst <CurrTrak+1 | |
704 bne L047E | |
0 | 705 tst <u0005 |
312 | 706 bne L047E |
0 | 707 ldy <u000A |
312 | 708 ldb <u001C |
709 L047E sty <u000E | |
0 | 710 stb <u0009 |
312 | 711 stb <u0018 |
712 bsr L04EC | |
713 leax >u00B7,u | |
714 bsr L0451 | |
0 | 715 sty <u000E |
312 | 716 L0490 bsr L044E |
0 | 717 dec <u0009 |
312 | 718 bne L0490 |
0 | 719 lda ,y+ |
720 sty <u000E | |
312 | 721 stx <u003D |
722 leay >u297E,u | |
723 sty <u001F | |
0 | 724 tfr a,b |
312 | 725 L04A6 std ,x++ |
726 cmpx <u001F | |
727 bcs L04A6 | |
0 | 728 ldy <u000E |
729 ldd ,y++ | |
312 | 730 std <u003F |
0 | 731 ldd ,y |
312 | 732 std <u0041 |
0 | 733 clr <u0009 |
312 | 734 leax >u00B7,u |
735 ldd <u003F | |
736 leay >u008F,u | |
737 L04C3 leax d,x | |
738 ldd <CurrTrak+1 | |
739 adda <STOff | |
0 | 740 std ,x |
741 ldb <u0009 | |
742 lda b,y | |
743 incb | |
744 stb <u0009 | |
312 | 745 ldb <CurrSct |
746 adda <u004B | |
747 bcs L04E5 | |
748 std $02,x | |
0 | 749 lda <u0009 |
312 | 750 cmpa <u0018 |
751 bcc L04E4 | |
752 ldd <u0041 | |
753 bra L04C3 | |
754 L04E4 rts | |
755 L04E5 leax >AbortSct,pcr | |
756 lbra L06F9 | |
757 L04EC pshs y,b | |
0 | 758 tfr b,a |
312 | 759 ldb <CurrTrak+1 |
0 | 760 cmpb #$01 |
312 | 761 bhi L0518 |
762 leax >u008F,u | |
0 | 763 leay a,x |
312 | 764 ldb <Interlv |
765 bne L0507 | |
766 L0500 leax >AbortIlv,pcr | |
767 lbra L06F9 | |
768 L0507 cmpb <u0018 | |
769 bhi L0500 | |
0 | 770 nega |
771 pshs y,x,b,a | |
772 clra | |
312 | 773 L050F sta ,x |
0 | 774 inca |
312 | 775 cmpa <u0018 |
776 bne L051A | |
0 | 777 leas $06,s |
312 | 778 L0518 puls pc,y,b |
779 L051A ldb <Interlv | |
0 | 780 abx |
781 cmpx $04,s | |
312 | 782 bcs L0525 |
0 | 783 ldb ,s |
784 leax b,x | |
312 | 785 L0525 cmpx $02,s |
786 bne L050F | |
0 | 787 leax $01,x |
788 stx $02,s | |
312 | 789 bra L050F |
790 L052F lbsr L0898 | |
791 ldd <u0025 | |
0 | 792 std $01,x |
312 | 793 ldb <u0024 |
0 | 794 stb ,x |
312 | 795 ldd <Sectors |
0 | 796 std <$11,x |
797 stb $03,x | |
312 | 798 lda <u0027 |
0 | 799 sta $07,x |
800 clra | |
312 | 801 ldb <u0028 |
802 tst <u0029 | |
803 beq L054F | |
0 | 804 addd #$0001 |
312 | 805 L054F addd #$0001 |
0 | 806 std $09,x |
807 clra | |
312 | 808 tst <MFM |
809 beq L0561 | |
0 | 810 ora #$02 |
312 | 811 tst <u004C |
812 beq L0561 | |
813 ora #$08 | |
814 L0561 ldb <u0013 | |
0 | 815 cmpb #$01 |
312 | 816 beq L0569 |
0 | 817 ora #$01 |
312 | 818 L0569 tst <T4896 |
819 beq L056F | |
0 | 820 ora #$04 |
312 | 821 L056F sta <$10,x |
822 ldd <u0028 | |
0 | 823 std $04,x |
824 lda #$FF | |
825 sta $0D,x | |
312 | 826 leax >TimePkt,u |
0 | 827 os9 F$Time |
312 | 828 leax >u00D6,u |
829 leay <u006F,u | |
0 | 830 tst ,y |
312 | 831 beq L0594 |
832 L058C lda ,y+ | |
0 | 833 sta ,x+ |
312 | 834 bpl L058C |
835 bra L05C7 | |
836 L0594 leax >DName,pcr | |
119 | 837 ldy #DNameLen |
312 | 838 lbsr L02E6 |
839 leax >u00D6,u | |
0 | 840 ldy #$0021 |
841 clra | |
842 os9 I$ReadLn | |
312 | 843 bcc L05B8 |
168
3a847d2b4492
Cobbler, OS9Gen and format are all hardware dependent.
roug
parents:
162
diff
changeset
|
844 cmpa #E$EOF |
312 | 845 bne L0594 |
846 L05B1 leax >Aborted,pcr | |
847 lbra L06F9 | |
848 L05B8 tfr y,d | |
0 | 849 leax d,x |
850 clr ,-x | |
851 decb | |
312 | 852 beq L0594 |
0 | 853 lda ,-x |
854 ora #$80 | |
855 sta ,x | |
312 | 856 L05C7 leax >TimePkt,u |
0 | 857 leay <$40,x |
858 pshs y | |
859 ldd #$0000 | |
312 | 860 L05D3 addd ,x++ |
0 | 861 cmpx ,s |
312 | 862 bcs L05D3 |
0 | 863 leas $02,s |
312 | 864 std >u00C5,u |
0 | 865 ldd >L0014,pcr |
312 | 866 std >u01A7,u |
0 | 867 ldd >L0016,pcr |
312 | 868 std >u01A9,u |
0 | 869 ldd >L0018,pcr |
312 | 870 std >u01AB,u |
871 lda <DiskPath | |
119 | 872 ldb #SS.Opt |
312 | 873 leax >u00F6,u |
0 | 874 os9 I$GetStt |
119 | 875 ldb #SS.Reset |
0 | 876 os9 I$SetStt |
312 | 877 lbcs L00BB |
878 leax >u00B7,u | |
879 lbra L08A4 | |
880 L0612 lda <DiskPath | |
0 | 881 os9 I$Close |
312 | 882 leax <u004F,u |
162 | 883 lda #READ. |
0 | 884 os9 I$Open |
312 | 885 lbcs L06F5 |
886 sta <DiskPath | |
887 leax >u00B7,u | |
888 ldy #256 | |
0 | 889 os9 I$Read |
312 | 890 lbcs L06F5 |
891 lda <DiskPath | |
0 | 892 os9 I$Close |
312 | 893 leax <u004F,u |
162 | 894 lda #UPDAT. |
0 | 895 os9 I$Open |
312 | 896 lbcs L06F5 |
897 sta <DiskPath | |
0 | 898 rts |
312 | 899 L0648 lda <DType |
900 clr <u0045 | |
0 | 901 bita #$80 |
312 | 902 beq L0667 |
903 L0650 leax >Verify,pcr | |
904 ldy #VerifyL | |
905 lbsr L02EC | |
0 | 906 anda #$DF |
312 | 907 cmpa #$59 |
908 beq L0667 | |
909 cmpa #$4E | |
910 bne L0650 | |
911 sta <u0045 | |
912 L0667 ldd <Sectors0 | |
913 std <u0017 | |
0 | 914 clra |
915 clrb | |
312 | 916 std <u0036 |
917 std <CurrTrak | |
0 | 918 std <u0008 |
312 | 919 std <u0032 |
920 stb <u0031 | |
921 sta <u003C | |
922 leax >OptBuf,u | |
923 stx <u0038 | |
924 lbsr L089C | |
0 | 925 leax >$0100,x |
312 | 926 stx <u003A |
0 | 927 clra |
928 ldb #$01 | |
312 | 929 std <u0034 |
930 lda <u0027 | |
931 sta <u002B | |
932 clr <u002A | |
0 | 933 clra |
312 | 934 ldb <u0028 |
935 tst <u0029 | |
936 beq L069D | |
0 | 937 addd #$0001 |
312 | 938 L069D addd #$0009 |
939 std <u002D | |
940 lda <u0027 | |
941 L06A4 lsra | |
942 bcs L06B5 | |
943 lsr <u002D | |
944 ror <u002E | |
945 bcc L06A4 | |
946 inc <u002E | |
947 bne L06A4 | |
948 inc <u002D | |
949 bra L06A4 | |
950 L06B5 ldb <u002E | |
951 stb <u002F | |
952 lda <u0027 | |
0 | 953 mul |
312 | 954 std <u002D |
0 | 955 subd #$0001 |
312 | 956 subb <u0028 |
0 | 957 sbca #$00 |
312 | 958 tst <u0029 |
959 beq L06CC | |
0 | 960 subd #$0001 |
312 | 961 L06CC stb <u002C |
962 L06CE tst <u0045 | |
963 bne L0700 | |
964 lda <DiskPath | |
965 leax >u00B7,u | |
966 ldy #256 | |
0 | 967 os9 I$Read |
312 | 968 bcc L0700 |
0 | 969 os9 F$PErr |
312 | 970 lbsr L08C8 |
0 | 971 lda #$FF |
312 | 972 sta <u002A |
973 tst <u0031 | |
974 bne L0700 | |
975 ldx <u0032 | |
976 cmpx <u002D | |
977 bhi L0700 | |
978 L06F5 leax >BadSect,pcr | |
979 L06F9 lbsr L02E2 | |
0 | 980 clrb |
312 | 981 lbra L00BB |
982 L0700 ldd <u0008 | |
0 | 983 addd #$0001 |
984 std <u0008 | |
312 | 985 cmpd <u0017 |
986 bcs L0745 | |
0 | 987 clr <u0008 |
988 clr <u0009 | |
312 | 989 tst <u0045 |
990 bne L073A | |
0 | 991 lda #$20 |
992 pshs a | |
312 | 993 lda <CurrTrak+1 |
994 lbsr L07A7 | |
0 | 995 pshs b,a |
312 | 996 lda <CurrTrak |
997 lbsr L07A7 | |
0 | 998 pshs b |
999 tfr s,x | |
1000 ldy #$0004 | |
312 | 1001 lbsr L02E6 |
0 | 1002 lda $02,s |
1003 cmpa #$46 | |
312 | 1004 bne L0738 |
1005 lbsr L02DE | |
1006 L0738 leas $04,s | |
1007 L073A ldd <CurrTrak | |
0 | 1008 addd #$0001 |
312 | 1009 std <CurrTrak |
1010 ldd <Sectors | |
1011 std <u0017 | |
1012 L0745 dec <u002B | |
1013 bne L075B | |
1014 bsr L0784 | |
1015 tst <u002A | |
1016 bne L0755 | |
1017 ldx <u0036 | |
0 | 1018 leax $01,x |
312 | 1019 stx <u0036 |
1020 L0755 clr <u002A | |
1021 lda <u0027 | |
1022 sta <u002B | |
1023 L075B ldb <u0031 | |
1024 ldx <u0032 | |
0 | 1025 leax $01,x |
312 | 1026 bne L0764 |
0 | 1027 incb |
312 | 1028 L0764 cmpb <u0024 |
1029 bcs L076C | |
1030 cmpx <u0025 | |
1031 bcc L0773 | |
1032 L076C stb <u0031 | |
1033 stx <u0032 | |
1034 lbra L06CE | |
1035 L0773 lda #$FF | |
1036 sta <u002A | |
1037 leay >OptBuf,u | |
1038 L077B cmpy <u0038 | |
1039 beq L07BF | |
1040 bsr L0784 | |
1041 bra L077B | |
1042 L0784 ldx <u0038 | |
1043 lda <u002A | |
0 | 1044 rora |
1045 rol ,x+ | |
312 | 1046 inc <u003C |
1047 lda <u003C | |
0 | 1048 cmpa #$08 |
312 | 1049 bcs L07A6 |
1050 clr <u003C | |
1051 stx <u0038 | |
1052 cmpx <u003A | |
1053 bne L07A6 | |
1054 bsr L0803 | |
1055 leax >OptBuf,u | |
1056 stx <u0038 | |
1057 lbsr L089C | |
1058 L07A6 rts | |
1059 L07A7 tfr a,b | |
0 | 1060 lsra |
1061 lsra | |
1062 lsra | |
1063 lsra | |
1064 andb #$0F | |
1065 addd #$3030 | |
1066 cmpa #$39 | |
312 | 1067 bls L07B8 |
0 | 1068 adda #$07 |
312 | 1069 L07B8 cmpb #$39 |
1070 bls L07BE | |
0 | 1071 addb #$07 |
312 | 1072 L07BE rts |
1073 L07BF lbsr L02DE | |
119 | 1074 leax >NumGood,pcr |
1075 ldy #NumGoodLen | |
312 | 1076 lbsr L02E6 |
1077 ldb <u0027 | |
0 | 1078 clra |
312 | 1079 ldx <u0036 |
0 | 1080 pshs x,a |
312 | 1081 L07D4 lsrb |
1082 bcs L07DF | |
0 | 1083 lsl $02,s |
1084 rol $01,s | |
1085 rol ,s | |
312 | 1086 bra L07D4 |
1087 L07DF puls x,a | |
0 | 1088 ldb #$0D |
1089 pshs b | |
1090 tfr d,y | |
1091 tfr x,d | |
1092 tfr b,a | |
312 | 1093 bsr L07A7 |
0 | 1094 pshs b,a |
1095 tfr x,d | |
312 | 1096 bsr L07A7 |
0 | 1097 pshs b,a |
1098 tfr y,d | |
312 | 1099 bsr L07A7 |
0 | 1100 pshs b,a |
1101 tfr s,x | |
312 | 1102 lbsr L02E2 |
0 | 1103 leas $07,s |
1104 rts | |
312 | 1105 L0803 pshs y |
0 | 1106 clra |
1107 ldb #$01 | |
312 | 1108 cmpd <u0034 |
1109 bne L081E | |
1110 leax >OptBuf,u | |
0 | 1111 clra |
312 | 1112 ldb <u002F |
0 | 1113 tfr d,y |
1114 clrb | |
1115 os9 F$AllBit | |
312 | 1116 lbcs L06F5 |
1117 L081E lbsr L08B2 | |
1118 leax >OptBuf,u | |
1119 lbsr L08A4 | |
1120 ldd <u0024 | |
1121 cmpd <u0031 | |
1122 bcs L083A | |
1123 bhi L0837 | |
1124 ldb <u0026 | |
1125 cmpb <u0033 | |
1126 bcc L083A | |
1127 L0837 lbsr L08C8 | |
1128 L083A ldd <u0034 | |
0 | 1129 addd #$0001 |
312 | 1130 std <u0034 |
0 | 1131 puls pc,y |
312 | 1132 L0843 bsr L08B2 |
1133 leax >u02B7,u | |
1134 bsr L089C | |
1135 leax >u02BA,u | |
0 | 1136 os9 F$Time |
312 | 1137 leax >u02B7,u |
0 | 1138 lda #$BF |
1139 sta ,x | |
1140 lda #$02 | |
1141 sta $08,x | |
1142 clra | |
1143 ldb #$40 | |
1144 std $0B,x | |
312 | 1145 ldb <u002C |
0 | 1146 decb |
1147 stb <$14,x | |
312 | 1148 ldd <u0034 |
0 | 1149 addd #$0001 |
1150 std <$11,x | |
312 | 1151 bsr L08A4 |
1152 bsr L0898 | |
0 | 1153 ldd #$2EAE |
1154 std ,x | |
1155 stb <$20,x | |
312 | 1156 ldd <u0034 |
0 | 1157 std <$1E,x |
1158 std <$3E,x | |
312 | 1159 bsr L08A4 |
1160 bsr L0898 | |
1161 ldb <u002C | |
1162 decb | |
1163 L088C decb | |
1164 bne L0890 | |
0 | 1165 rts |
312 | 1166 L0890 pshs b |
1167 bsr L08A4 | |
0 | 1168 puls b |
312 | 1169 bra L088C |
1170 L0898 leax >u00B7,u | |
1171 L089C clra | |
0 | 1172 clrb |
312 | 1173 L089E sta d,x |
0 | 1174 decb |
312 | 1175 bne L089E |
0 | 1176 rts |
312 | 1177 L08A4 lda <DiskPath |
1178 ldy #256 | |
0 | 1179 os9 I$Write |
312 | 1180 lbcs L00BB |
0 | 1181 rts |
312 | 1182 L08B2 clra |
1183 ldb <u0034 | |
0 | 1184 tfr d,x |
312 | 1185 lda <u0035 |
0 | 1186 clrb |
1187 tfr d,u | |
312 | 1188 L08BC lda <DiskPath |
0 | 1189 os9 I$Seek |
312 | 1190 ldu <SavedU |
1191 lbcs L00BB | |
0 | 1192 rts |
312 | 1193 L08C8 ldx <u0031 |
1194 lda <u0033 | |
0 | 1195 clrb |
1196 addd #$0100 | |
1197 tfr d,u | |
312 | 1198 bcc L08BC |
0 | 1199 leax $01,x |
312 | 1200 bra L08BC |
0 | 1201 ldd ,y |
312 | 1202 leau >u00B7,u |
1203 leax >L0920,pcr | |
0 | 1204 ldy #$2F20 |
312 | 1205 L08E6 leay >$0100,y |
0 | 1206 subd ,x |
312 | 1207 bcc L08E6 |
0 | 1208 addd ,x++ |
1209 pshs b,a | |
1210 ldd ,x | |
1211 tfr y,d | |
312 | 1212 beq L090E |
0 | 1213 ldy #$2F30 |
1214 cmpd #$3020 | |
312 | 1215 bne L0908 |
0 | 1216 ldy #$2F20 |
1217 tfr b,a | |
312 | 1218 L0908 sta ,u+ |
0 | 1219 puls b,a |
312 | 1220 bra L08E6 |
1221 L090E sta ,u+ | |
1222 lda #C$CR | |
0 | 1223 sta ,u |
312 | 1224 ldu <SavedU |
0 | 1225 leas $02,s |
312 | 1226 leax >u00B7,u |
1227 lbsr L02E2 | |
0 | 1228 rts |
119 | 1229 |
312 | 1230 L0920 fdb $2710,$03e8,$0064,$000a,$0001,$0000 |
119 | 1231 |
312 | 1232 L092C ldd #$0000 |
1233 L092F bsr L093F | |
1234 bcs L0939 | |
1235 bne L092F | |
1236 std <u001F | |
1237 bne L093E | |
1238 L0939 ldd #$0001 | |
1239 std <u001F | |
1240 L093E rts | |
1241 L093F pshs y,b,a | |
0 | 1242 ldb ,x+ |
1243 subb #$30 | |
1244 cmpb #$0A | |
312 | 1245 bcc L095D |
0 | 1246 lda #$00 |
1247 ldy #$000A | |
312 | 1248 L094F addd ,s |
1249 bcs L095B | |
0 | 1250 leay -$01,y |
312 | 1251 bne L094F |
0 | 1252 std ,s |
203 | 1253 andcc #^Zero |
312 | 1254 L095B puls pc,y,b,a |
1255 L095D orcc #Zero | |
0 | 1256 puls pc,y,b,a |
312 | 1257 L0961 lda #$02 |
0 | 1258 os9 F$PErr |
119 | 1259 leax <HelpMsg,pcr |
0 | 1260 ldy #$0154 |
1261 lda #$02 | |
1262 os9 I$WritLn | |
1263 clrb | |
1264 os9 F$Exit | |
312 | 1265 |
119 | 1266 Title fcb C$LF |
1267 fcc "COLOR COMPUTER FORMATTER" | |
1268 HelpCR fcb C$CR | |
1269 | |
1270 HelpMsg fcc "Use: FORMAT /devname <opts>" | |
1271 fcb C$LF | |
312 | 1272 fcc " opts: R - Ready" |
1273 fcb C$LF | |
1274 fcc " L - Logical format only" | |
119 | 1275 fcb C$LF |
1276 fcc / "disk name"/ | |
312 | 1277 fcb C$LF |
1278 fcc " 1/2 - number of sides" | |
1279 fcb C$LF | |
1280 fcc " 'No. of cylinders' (in decimal)" | |
1281 fcb C$LF | |
1282 fcc " :Interleave value: (in decimal)" | |
1283 fcb C$CR | |
1284 HelpLen equ *-HelpMsg | |
119 | 1285 |
1286 FmtMsg fcc "Formatting drive " | |
1287 FmtMLen equ *-FmtMsg | |
1288 | |
1289 Query fcc "y (yes) or n (no)" | |
1290 fcb C$LF | |
1291 fcc "Ready? " | |
1292 QueryLen equ *-Query | |
312 | 1293 AbortIlv fcc "ABORT Interleave value out of range" |
1294 fcb C$CR | |
1295 AbortSct fcc "ABORT Sector number out of range" | |
1296 fcb C$CR | |
1297 AbortOp fcc "ABORT Option not allowed on Device" | |
119 | 1298 fcb C$CR |
1299 DName fcc "Disk name: " | |
1300 DNameLen equ *-DName | |
1301 fcc "How many Cylinders (Tracks?) : " | |
1302 BadSect fcc "Bad system sector, " | |
1303 Aborted fcc "FORMAT ABORTED" | |
1304 fcb C$CR | |
1305 ClustMsg fcc "Cluster size mismatch" | |
1306 fcb C$CR | |
1307 fcc "Double density? " | |
312 | 1308 fcc "Track 0 Double density? " |
119 | 1309 TPIChg fcc "Change from 96tpi to 48tpi? " |
1310 DSided fcc "Double sided? " | |
1311 NumGood fcc "Number of good sectors: $" | |
1312 NumGoodLen equ *-NumGood | |
312 | 1313 HDFmt fcc "WARNING: You are formatting a HARD Disk.." |
1314 fcb C$LF | |
1315 fcc "Are you sure? " | |
1316 HDFmtLen equ *-HDFmt | |
119 | 1317 Both fcc "Both PHYSICAL and LOGICAL format? " |
1318 BothLen equ *-Both | |
1319 Verify fcc "Physical Verify desired? " | |
312 | 1320 VerifyL equ *-Verify |
119 | 1321 |
0 | 1322 emod |
1323 eom equ * | |
119 | 1324 end |