-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathtemp
129 lines (129 loc) · 2.05 KB
/
temp
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
;
;TEST IF JOB(.X) IS DONE YET
;IF NOT DONE RETURN
;IF OK THEN RETURN ELSE REDO IT
;
TSTJOB LDA JOBS,X
BMI NOTYET
CMP #2
BCC OK
CMP #8 ;CHECK FOR WP SWITCH ON
BEQ QUIT
DEC ERRCNT,X ;REDO UNTIL ERRCNT=0
BNE AGAIN
BIT JOBRTN ;RETURN WITH .A=ERROR?
BMI OK
;
RECOV
TYA ;SAVE .Y
PHA
LDA DRVNUM ;SAVE DRIVE #
PHA
LDA LSTJOB,X
AND #1
STA DRVNUM ;SET ACTIVE DRIVE #
BIT REVCNT
BVS REC5 ;NO TRACK OFFSET
;
LDA #0
STA EPTR ;CLR OFFSET TABLE PTR
STA TOFF ;CLR TOTAL OFFSET
REC1
LDY EPTR
LDA OFFSET,Y
PHA
CLC
ADC TOFF ;KEEP TRACK OF TOTAL OFFSET
STA TOFF
PLA
JSR SCOMP ;CHANGE TO S-MAGNITUDE
LDY DRVNUM
STA PHASE,Y ;SET OFFSET FOR CONTRL
REC2
LDA PHASE,Y
BNE REC2 ;WAIT
;
INC EPTR ;BUMP TABLE PTR
JSR DOREC ;DO THE RECOVERY
CMP #2 ;ERROR CODE < 2?
BCC REC3 ;JOB WORKED
;
LDY EPTR
LDA OFFSET,Y
BNE REC1 ;NULL INDICATES END
REC3
LDA TOFF
JSR SCOMP
EOR #$80 ;NEGATE IN S-MAG.
LDY DRVNUM
STA PHASE,Y ;RESTOR HEAD TO ORIG. TRACK
REC4
LDA PHASE,Y
BNE REC4 ;WAIT
;
LDA JOBS,X
CMP #2
BCC REC9 ;NO ERROR
REC5
BIT REVCNT ;CHECK BUMP-ON FLAG
BPL REC7 ;NO BUMP
QUIT
JSR ERROR
REC7 ;DO THE BUMP
LDA #BUMP
ORA DRVNUM
STA JOBS,X
REC8
LDA JOBS,X
BMI REC8 ;WAIT
;
JSR DOREC ;TRY ONE LAST SET
CMP #2
BCS QUIT ;IT CLEARLY AIN'T GONNA WORK
REC9
PLA
STA DRVNUM ;RESTORE DRIVE #
PLA
TAY ;RESTORE .Y
OK CLC ;C=0 DONE OK
RTS
;
AGAIN LDA LSTJOB,X
STA JOBS,X
NOTYET SEC ;C=1 NOT YET
RTS
;
;
; WAIT UNTIL JOB(.X) IS DONE
; RETURN WHEN DONE
;
WATJOB JSR TSTJOB
BCS WATJOB
PHA ;CLR JOBRTN FLAG
LDA #0
STA JOBRTN
PLA
RTS
;
; SET HEADER OF ACTIVE BUFFER OF THE
; CURRENT LINDX TO TRACK,SECTOR,ID
;
SETHDR JSR GETACT
SETH
ASL A
ASL A
ASL A
TAY
LDA TRACK
STA HDRS+2,Y ;SET TRACK
LDA SECTOR
STA HDRS+3,Y ;SET SECTOR
LDA DRVNUM ;GET PROPER ID(DRVNUM)
ASL A
TAX
LDA DSKID,X
STA HDRS,Y
LDA DSKID+1,X
STA HDRS+1,Y
RTS
;