-
Notifications
You must be signed in to change notification settings - Fork 84
/
dskintsf.src
338 lines (269 loc) · 5.98 KB
/
dskintsf.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
.page
.subttl dskintsf
; error display routine
; blinks the (error #)+1 in all three leds
pezro ldx #0 ;error #1 for zero page
.byte $2c ;skip next two bytes
perr ldx temp ;get error #
txs ;use stack as storage reg.
pe20 tsx ;restore error #
pe30 lda #led0+led1
ora ledprt
jmp pea7a
; turn on led !!!!patch so ddrb led is output!!!!
rea7d tya ;clear inner ctr !!!!patch return!!!!
pd10 clc
pd20 adc #1 ;count inner ctr
bne pd20
dey ;done ?
bne pd10 ;no
lda ledprt
and #$ff-led0-led1
sta ledprt ;turn off all leds
pe40 ;wait
tya ;clear inner ctr
pd11 clc
pd21 adc #1 ;count inner ctr
bne pd21
dey ;done ?
bne pd11 ;no
dex ;blinked # ?
bpl pe30 ;no - blink again
cpx #$fc ;waited between counts ?
bne pe40 ;no
beq pe20 ;always - all again
dskint sei
cld
;---------rom05-bc---09/12/84------------
ldx #$ff ;no photosensor 1541-II (FAB)
; ldx #$fe ;set ddra1 (pa1=photo sensor)
;----------------------------------------
;---------------------------------------
jmp patch5 ;***rom-05 8/18/83
;---------------------------------------
dkit10 inx ;let .x:=0
;*********************************
;
; power up diagnostic
;
;*********************************
ldy #0
ldx #0
pu10 txa ;fill z-page accend pattern
sta $0,x
inx
bne pu10
pu20 txa ;check pattern by inc...
cmp $0,x ;...back to orig #
bne pezro ;bad bits
pu30
inc $0,x ;bump contents
iny
bne pu30 ;not done
cmp $0,x ;check for good count
bne pezro ;something's wrong
sty $0,x ;leave z-page zeroed
lda $0,x ;check it
bne pezro ;wrong
inx ;next!
bne pu20 ;not all done
; test two 64k-bit roms
;
; enter x=start page
; exit if ok
;
; 8-bit sums (including carry) of each 8K half must equal the
; msb of 8k starting adr. (eg., sum of $C000-DFFF must be $C0).
; there are sum adjustment bytes at $C001 and $FFE5. FAB.
rm10 inc temp ;next error #
stx ip+1 ;save page, start x=0
lda #0
sta ip ;zero lo indirect
tay
ldx #32 ;32 pages in 8k rom
clc
rt10 dec ip+1 ;do it backwards
rt20 adc (ip),y ;total checksum in a
iny
bne rt20
dex
bne rt10
adc #0 ;add in last carry
; sta $00, adj value at $ffe5, get value $c001, chg to adc #0,
; add +28 to $ffe5, done !
tax ;save lower page in x
cmp ip+1 ;correct ?
bne perr2 ;no - show error number
; nop ;replace above branch with NOP for debug only
; nop
cpx #$c0 ;done both roms ?
bne rm10 ;no
; nop ;replace above branch with NOP for debug only
; nop
;----------------------------------
; test all common ram
cr20 lda #$01 ;start of 1st block
cr30 sta ip+1 ;save page #
inc temp ;bump error #
; enter x=# of pages in block
; ip ptr to first page in block
; exit if ok
ramtst ldx #7 ;save page count
ra10 tya ;fill with adr sensitive pattern
clc
adc ip+1
sta (ip),y
iny
bne ra10
inc ip+1
dex
bne ra10
ldx #7 ;restore page count
ra30 dec ip+1 ;check pattern backwards
ra40 dey
tya ;gen pattern again
clc
adc ip+1
cmp (ip),y ;ok ?
bne perr2 ;no - show error #
eor #$ff ;yes - test inverse pattern
sta (ip),y
eor (ip),y ;ok ?
sta (ip),y ;leave memory zero
bne perr2 ;no - show error #
tya
bne ra40
dex
bne ra30
beq diagok
perr2 jmp perr
diagok
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
jmp ptch15 ;*rom ds 09/03/85*
; ldx #topwrt
; txs
rtch15 ;return
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
lda ledprt ;clear leds
and #$ff-led0-led1
sta ledprt
lda #1 ;neg edge of atn
sta pcr1
lda #%10000010
sta ifr1
sta ier1
lda pb ;compute primary addr
and #%01100000 ;pb5 and pb6 are unused line
asl a ;shift to lower
rol a
rol a
rol a
ora #$48 ;talk address
sta tlkadr
eor #$60 ;listen address
sta lsnadr
; initialize buffer pntr table
inttab ldx #0
ldy #0
intt1 lda #0
sta buftab,x
inx
lda bufind,y
sta buftab,x
inx
iny
cpy #bfcnt
bne intt1
lda #<cmdbuf ;set pntr to cmdbuf
sta buftab,x
inx
lda #>cmdbuf
sta buftab,x
inx
lda #<errbuf ;set pntr to errbuf
sta buftab,x
inx
lda #>errbuf
sta buftab,x
lda #$ff
ldx #maxsa
dskin1 sta lintab,x
dex
bpl dskin1
ldx #mxchns-1
dskin2
sta buf0,x ;set buffers as unused
sta buf1,x
sta ss,x
dex
bpl dskin2
lda #bfcnt ;set buffer pointers
sta buf0+cmdchn
lda #bfcnt+1
sta buf0+errchn
lda #$ff
sta buf0+blindx
sta buf1+blindx
lda #errchn
sta lintab+errsa
lda #cmdchn+$80
sta lintab+cmdsa
lda #lxint ;lindx 0 to 5 free
sta linuse
lda #rdylst
sta chnrdy+cmdchn
lda #rdytlk
sta chnrdy+errchn
lda #$e0
sta bufuse
lda #$ff
sta bufuse+1
lda #1
sta wpsw
sta wpsw+1
jsr usrint ;init user jmp
jsr lruint
;**********************************
;
; controller initialization
;
;**********************************
;-----***rom05-bc***9/12/84----------
jsr cntint
; jsr ptch10 ;bump & controller init.
; ;FAB 07/22/87 for 1541-II patch removed to eliminate head bump
;------------------------------------
; set indirect vectors
lda #<diagok
sta vnmi
lda #>diagok
sta vnmi+1
lda #10 ;set up sector offset
sta secinc
lda #5
sta revcnt ;set up recovery count
; *******************************
; *
; * seterr
; * set up power on error msg
; *
; * cbm dos v2.0 (c)1979
; *
; *******************************
seterr lda #$73
jsr errts0
;
; must be contiguous to .file idle
;
;********************************
; init the serial bus
;
;********************************
;-------rom -05 8/18/83-----------------
lda #$00 ;data hi, clock hi,atna hi
sta pb
lda #%00011010 ;atna,clkout,datout
sta ddrb1
;---------------------------------------
jsr boot
; .end