forked from mist64/cbmsrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsutil.src
192 lines (192 loc) · 3.27 KB
/
tsutil.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
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