-
Notifications
You must be signed in to change notification settings - Fork 82
/
tsutil
192 lines (192 loc) · 2.1 KB
/
tsutil
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
.PAGE 'TSUTIL'
;*
;*
;*********************************
;*
;* SCRUB
;*
;* WRITE OUT BUFFER IF DIRTY
;*
;*********************************
;*
;*
SCRUB
JSR GAFLGS
BVC SCR1 ;NOT DIRTY
;
JSR WRTOUT
JSR WATJOB
SCR1 RTS
;*
;*
;*********************************
;*
;* SETLNK
;*
;* PUT TRACK,SECTOR INTO BUFFER
;*
;*********************************
;*
;*
SETLNK JSR SET00
;
LDA TRACK
STA (DIRBUF),Y
INY
LDA SECTOR
STA (DIRBUF),Y
JMP SDIRTY
;
;*
;*
;********************************
;*
;* GETLNK
;*
;* GET LINK FROM BUFFER INTO
;* TRACK AND SECTOR
;*
;********************************
;*
;*
GETLNK JSR SET00
;
LDA (DIRBUF),Y
STA TRACK
INY
LDA (DIRBUF),Y
STA SECTOR
RTS
;*
;*
;********************************
;*
;* NULLNK
;*
;* SET TRACK LINK=0 & SECTOR
;* LINK=LAST NON-ZERO CHAR.
;*
;*********************************
;*
;*
NULLNK
JSR SET00
LDA #0
STA (DIRBUF)Y
INY
LDX LINDX
LDA NR,X
TAX
DEX
TXA
STA (DIRBUF)Y
RTS
;
;*
;*
;*******************************
;*
;* SET00
;*
;* SETUP UP POINTER TO BUFFER
;*
;*******************************
;*
;*
SET00 JSR GETACT
ASL A
TAX
LDA BUFTAB+1,X
STA DIRBUF+1
LDA #0
STA DIRBUF
LDY #0
RTS
;
;*
;*
;*******************************
;*
;* GETHDR
;*
;* READ TRACK,SETOR FROM HEADER
;*
;*******************************
;*
;*
CURBLK JSR FNDRCH
GETHDR JSR GETACT
STA JOBNUM
ASL A
TAY
LDA HDRS,Y ;4/12**************
STA TRACK
LDA HDRS+1,Y ;4/12**************
STA SECTOR
RTS
;
;*
;*
;******************************
;*
;* WRTAB,RDAB WRTOUT,RDIN
;* WRTSS,RDSS
;*
;******************************
;*
;*
WRTAB LDA #WRITE
STA CMD
BNE SJ10
;
RDAB LDA #READ
STA CMD
BNE SJ10
;
WRTOUT LDA #WRITE
STA CMD
BNE SJ20
;
RDIN LDA #READ
STA CMD
BNE SJ20
;
WRTSS LDA #WRITE
STA CMD
BNE RDS5
;
RDSS LDA #READ
RDS5 STA CMD
LDX LINDX
LDA SS,X
TAX
BPL SJ30 ;WAS...BNE SJ30
;
SJ10 JSR SETHDR
JSR GETACT
TAX
LDA DRVNUM
STA LSTJOB,X
SJ20 JSR CDIRTY
JSR GETACT
TAX
SJ30 JMP SETLJB
;*
;*
;*
;***************************
;*
;* RDLNK
;*
;***************************
;*
;*
RDLNK LDA #0
JSR SETPNT
JSR GETBYT
STA TRACK
JSR GETBYT
STA SECTOR
RTS
;
.END