-
Notifications
You must be signed in to change notification settings - Fork 82
/
duplct1.src
70 lines (58 loc) · 1.65 KB
/
duplct1.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.page
.subttl 'duplct1.src'
; controller format disk
jformat lda #71
sta maxtrk ; double sided
lda #3
jsr seth
ldx #3 ; job #3
lda #0
sta fmtsid ; side zero first
lda #$f0 ; format cmd
sta tsttrk ; init speed var
sta jobs,x ; give job to controller
jsr stbctl ; wake him up
cmp #2 ; error?
bcs 1$ ; br, error
;read track one sector zero
ldy #3 ; retries
4$ lda #1 ; track 1
sta hdrs+6 ; *
lda #0 ; sector 0
sta hdrs+7 ; *
lda #$80 ; read
sta jobs,x ; give job to controller
jsr stbctl ; wake him up
cmp #2 ; error?
bcc 5$ ; br, ok...
dey
bpl 4$ ; try 3 times
bcs 1$ ; bra
5$ lda #1
sta fmtsid ; side one second
lda #$f0 ; format cmd
sta tsttrk ; init speed var
sta jobs,x ; give job to controller
jsr stbctl ; wake him up
cmp #2 ; error?
bcs 1$ ; br, error
;read track thirty-six sector zero
ldy #3 ; retries
6$ lda #36 ; track 36
sta hdrs+6 ; *
lda #0 ; sector 0
sta hdrs+7 ; *
lda #$80 ; read
sta jobs,x ; give job to controller
jsr stbctl ; wake him up
cmp #2 ; error?
bcs 3$ ; br, bad
rts ; ok
3$ dey
bpl 6$ ; keep trying
1$ ldx #0 ; set for offset for buffer to det. trk & sect.
bit jobrtn ; return on error ?
stx jobrtn ; clr
bpl 7$
rts ; back to caller
7$ jmp error