0
|
1 ********************************************************************
|
|
2 * CCIO - OS-9 Level One V2 CoCo I/O driver
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
201
|
8 * 12 From Tandy OS-9 Level One VR 02.00.00
|
0
|
9
|
|
10 nam CCIO
|
|
11 ttl OS-9 Level One V2 CoCo I/O driver
|
|
12
|
|
13 ifp1
|
|
14 use defsfile
|
|
15 use scfdefs
|
|
16 endc
|
|
17
|
|
18 tylg set Drivr+Objct
|
|
19 atrv set ReEnt+rev
|
|
20 rev set $01
|
201
|
21 edition set 12
|
0
|
22
|
|
23 mod eom,name,tylg,atrv,start,size
|
|
24
|
|
25 u0000 rmb 3
|
|
26 u0003 rmb 1
|
|
27 u0004 rmb 1
|
|
28 u0005 rmb 4
|
|
29 u0009 rmb 2
|
|
30 u000B rmb 1
|
|
31 u000C rmb 1
|
|
32 u000D rmb 11
|
|
33 u0018 rmb 1
|
|
34 u0019 rmb 1
|
|
35 u001A rmb 1
|
|
36 u001B rmb 2
|
|
37 u001D rmb 7
|
|
38 u0024 rmb 1
|
|
39 u0025 rmb 1
|
|
40 u0026 rmb 2
|
|
41 u0028 rmb 1
|
|
42 u0029 rmb 4
|
|
43 u002D rmb 1
|
|
44 u002E rmb 1
|
|
45 u002F rmb 1
|
|
46 u0030 rmb 1
|
|
47 u0031 rmb 1
|
|
48 u0032 rmb 1
|
|
49 u0033 rmb 2
|
|
50 u0035 rmb 2
|
|
51 u0037 rmb 9
|
|
52 u0040 rmb 2
|
|
53 u0042 rmb 2
|
|
54 u0044 rmb 1
|
|
55 u0045 rmb 2
|
|
56 u0047 rmb 1
|
|
57 u0048 rmb 1
|
|
58 u0049 rmb 2
|
|
59 u004B rmb 5
|
|
60 u0050 rmb 1
|
|
61 u0051 rmb 1
|
|
62 u0052 rmb 1
|
|
63 u0053 rmb 2
|
|
64 u0055 rmb 6
|
|
65 u005B rmb 2
|
|
66 u005D rmb 2
|
|
67 u005F rmb 1
|
|
68 u0060 rmb 1
|
|
69 u0061 rmb 2
|
|
70 u0063 rmb 2
|
|
71 u0065 rmb 1
|
|
72 u0066 rmb 1
|
|
73 u0067 rmb 1
|
|
74 u0068 rmb 1
|
|
75 u0069 rmb 1
|
|
76 u006A rmb 1
|
|
77 u006B rmb 1
|
|
78 u006C rmb 1
|
|
79 u006D rmb 1
|
|
80 u006E rmb 1
|
|
81 u006F rmb 1
|
|
82 u0070 rmb 1
|
|
83 u0071 rmb 1
|
|
84 u0072 rmb 6
|
|
85 u0078 rmb 1
|
|
86 u0079 rmb 1
|
|
87 u007A rmb 128
|
|
88 size equ .
|
|
89
|
256
|
90 fcb UPDAT.+EXEC.
|
0
|
91
|
|
92 name fcs /CCIO/
|
|
93 fcb edition
|
|
94
|
|
95 start lbra Init
|
|
96 lbra Read
|
|
97 lbra Write
|
|
98 lbra GetStat
|
|
99 lbra SetStat
|
|
100 lbra Term
|
|
101
|
|
102 * Init
|
|
103 *
|
|
104 * Entry:
|
|
105 * Y = address of device descriptor
|
|
106 * U = address of device memory area
|
|
107 *
|
|
108 * Exit:
|
|
109 * CC = carry set on error
|
|
110 * B = error code
|
|
111 *
|
|
112 Init stu >D.KbdSta store devmem ptr
|
|
113 clra
|
|
114 leax <u001D,u
|
|
115 ldb #$5D
|
|
116 L002E sta ,x+
|
|
117 decb
|
|
118 bne L002E
|
|
119 coma A = $FF
|
|
120 comb B = $FF
|
|
121 stb <u0050,u
|
|
122 std <u005F,u
|
|
123 std <u0061,u
|
|
124 lda #$3C
|
|
125 sta <u0051,u
|
|
126 leax >AltIRQ,pcr
|
|
127 stx >D.AltIRQ
|
|
128 leax >L03CC,pcr
|
|
129 stx <u005B,u
|
|
130 leax >L050F,pcr
|
|
131 stx <u005D,u
|
|
132 ldd <$26,y
|
|
133 lbra L05CE
|
|
134
|
|
135 * Term
|
|
136 *
|
|
137 * Entry:
|
|
138 * U = address of device memory area
|
|
139 *
|
|
140 * Exit:
|
|
141 * CC = carry set on error
|
|
142 * B = error code
|
|
143 *
|
|
144 Term pshs cc
|
|
145 orcc #IRQMask
|
|
146 ldx >D.Clock
|
|
147 stx >D.AltIRQ
|
|
148 puls pc,cc
|
|
149
|
|
150 * Read
|
|
151 *
|
|
152 * Entry:
|
|
153 * Y = address of path descriptor
|
|
154 * U = address of device memory area
|
|
155 *
|
|
156 * Exit:
|
|
157 * A = character read
|
|
158 * CC = carry set on error
|
|
159 * B = error code
|
|
160 *
|
|
161 Read leax <u007A,u
|
|
162 ldb <u0079,u
|
|
163 orcc #IRQMask
|
|
164 cmpb <u0078,u
|
|
165 beq L0082
|
|
166 abx
|
|
167 lda ,x
|
|
168 bsr L009D
|
|
169 stb <u0079,u
|
|
170 andcc #^(IRQMask+Carry)
|
|
171 rts
|
|
172 L0082 lda V.BUSY,u
|
|
173 sta V.WAKE,u
|
|
174 andcc #^IRQMask
|
|
175 ldx #$0000
|
|
176 os9 F$Sleep
|
|
177 clr V.WAKE,u
|
|
178 ldx <D.Proc
|
|
179 ldb <P$Signal,x
|
|
180 beq Read
|
|
181 cmpb #$04
|
|
182 bcc Read
|
|
183 coma
|
|
184 rts
|
|
185 L009D incb
|
|
186 cmpb #$7F
|
|
187 bls L00A3
|
|
188 clrb
|
|
189 L00A3 rts
|
|
190
|
|
191 AltIRQ ldu >D.KbdSta
|
|
192 ldb <u0032,u
|
|
193 beq L00B7
|
|
194 ldb <u002F,u
|
|
195 beq L00B7
|
|
196 lda <u0030,u
|
|
197 lbsr L03CC
|
|
198 L00B7 ldx #PIA.U4
|
|
199 clra
|
|
200 clrb
|
|
201 std <u006A,u
|
|
202 bsr L00E8
|
|
203 bne L00CC
|
|
204 clr $02,x
|
|
205 lda ,x
|
|
206 coma
|
|
207 anda #$7F
|
|
208 bne L00F1
|
|
209 L00CC clra
|
|
210 clrb
|
|
211 std <u006E,u
|
|
212 coma
|
|
213 tst <u006D,u
|
|
214 bne L00DA
|
|
215 sta <u005F,u
|
|
216 L00DA stb <u006D,u
|
|
217 comb
|
|
218 sta <u0060,u
|
|
219 std <u0061,u
|
|
220 L00E4 jmp [>D.Clock]
|
|
221 L00E8 comb
|
|
222 stb $02,x
|
|
223 ldb ,x
|
|
224 comb
|
|
225 andb #$03
|
|
226 rts
|
|
227 L00F1 bsr L015C
|
|
228 bmi L00CC
|
|
229 clrb
|
|
230 bsr L00E8
|
|
231 bne L00CC
|
|
232 cmpa <u006F,u
|
|
233 bne L010E
|
|
234 ldb <u0051,u
|
|
235 beq L010A
|
|
236 decb
|
|
237 L0105 stb <u0051,u
|
|
238 bra L00E4
|
|
239 L010A ldb #$05
|
|
240 bra L011A
|
|
241 L010E sta <u006F,u
|
|
242 ldb #$05
|
|
243 tst <u006B,u
|
|
244 bne L0105
|
|
245 ldb #$3C
|
|
246 L011A stb <u0051,u
|
|
247 ldb <u0078,u
|
|
248 leax <u007A,u
|
|
249 abx
|
|
250 lbsr L009D
|
|
251 cmpb <u0079,u
|
|
252 beq L012F
|
|
253 stb <u0078,u
|
|
254 L012F sta ,x
|
|
255 beq L014F
|
|
256 cmpa u000D,u
|
|
257 bne L013F
|
|
258 ldx u0009,u
|
|
259 beq L014F
|
|
260 sta $08,x
|
|
261 bra L014F
|
|
262 L013F ldb #$03
|
|
263 cmpa u000B,u
|
|
264 beq L014B
|
|
265 ldb #$02
|
|
266 cmpa u000C,u
|
|
267 bne L014F
|
|
268 L014B lda u0003,u
|
|
269 bra L0153
|
|
270 L014F ldb #S$Wake
|
|
271 lda V.WAKE,u
|
|
272 L0153 beq L0158
|
|
273 os9 F$Send
|
|
274 L0158 clr V.WAKE,u
|
|
275 bra L00E4
|
|
276 L015C clra
|
|
277 clrb
|
|
278 std <u0066,u
|
|
279 std <u0068,u
|
|
280 coma
|
|
281 comb
|
|
282 std <u0063,u
|
|
283 sta <u0065,u
|
|
284 deca
|
|
285 sta $02,x
|
|
286 L016F lda ,x
|
|
287 coma
|
|
288 anda #$7F
|
|
289 beq L0183
|
|
290 ldb #$FF
|
|
291 L0178 incb
|
|
292 lsra
|
|
293 bcc L017F
|
|
294 lbsr L0221
|
|
295 L017F cmpb #$06
|
|
296 bcs L0178
|
|
297 L0183 inc <u0068,u
|
|
298 orcc #Carry
|
|
299 rol $02,x
|
|
300 bcs L016F
|
|
301 lbsr L0289
|
|
302 bmi L020A
|
|
303 cmpa <u005F,u
|
|
304 bne L0199
|
|
305 inc <u006B,u
|
|
306 L0199 sta <u005F,u
|
|
307 beq L01B9
|
|
308 suba #$1A
|
|
309 bhi L01B9
|
|
310 adda #$1A
|
|
311 ldb <u0067,u
|
|
312 bne L01E9
|
|
313 adda #$40
|
|
314 ldb <u0066,u
|
|
315 eorb <u0050,u
|
|
316 andb #$01
|
|
317 bne L01E9
|
|
318 adda #$20
|
|
319 bra L01E9
|
|
320 L01B9 ldb #$03
|
|
321 mul
|
|
322 lda <u0066,u
|
|
323 beq L01C4
|
|
324 incb
|
|
325 bra L01CB
|
|
326 L01C4 lda <u0067,u
|
|
327 beq L01CB
|
|
328 addb #$02
|
|
329 L01CB lda <u006C,u
|
|
330 beq L01D4
|
|
331 cmpb #$11
|
|
332 ble L0208
|
|
333 L01D4 cmpb #$4C
|
|
334 blt L01DD
|
|
335 inc <u0069,u
|
|
336 subb #$06
|
|
337 L01DD pshs x
|
|
338 leax >L0321,pcr
|
|
339 lda b,x
|
|
340 puls x
|
|
341 bmi L01FD
|
|
342 L01E9 ldb <u0069,u
|
|
343 beq L01FA
|
|
344 cmpa #$3F
|
|
345 bls L01F8
|
|
346 cmpa #$5B
|
|
347 bcc L01F8
|
|
348 ora #$20
|
|
349 L01F8 ora #$80
|
|
350 L01FA andcc #^Negative
|
|
351 rts
|
|
352 L01FD inc <u006D,u
|
|
353 ldb <u006B,u
|
|
354 bne L0208
|
|
355 com <u0050,u
|
|
356 L0208 orcc #Negative
|
|
357 L020A rts
|
|
358 L020B pshs b,a
|
|
359 clrb
|
|
360 orcc #Carry
|
|
361 inca
|
|
362 L0211 rolb
|
|
363 deca
|
|
364 bne L0211
|
|
365 bra L0219
|
|
366 L0217 pshs b,a
|
|
367 L0219 orb <u006A,u
|
|
368 stb <u006A,u
|
|
369 puls pc,b,a
|
|
370 L0221 pshs b,a
|
|
371 cmpb #$03
|
|
372 bne L0230
|
|
373 lda <u0068,u
|
|
374 cmpa #$03
|
|
375 blt L0230
|
|
376 bsr L020B
|
|
377 L0230 lslb
|
|
378 lslb
|
|
379 lslb
|
|
380 addb <u0068,u
|
|
381 beq L025D
|
|
382 cmpb #$33
|
|
383 bne L0243
|
|
384 inc <u0069,u
|
|
385 ldb #$04
|
|
386 bra L0219
|
|
387 L0243 cmpb #$31
|
|
388 beq L024B
|
|
389 cmpb #$34
|
|
390 bne L0252
|
|
391 L024B inc <u0067,u
|
|
392 ldb #$02
|
|
393 bra L0219
|
|
394 L0252 cmpb #$37
|
|
395 bne L0262
|
|
396 com <u0066,u
|
|
397 ldb #$01
|
|
398 bra L0219
|
|
399 L025D ldb #$04
|
|
400 bsr L0217
|
|
401 clrb
|
|
402 L0262 pshs x
|
|
403 leax <u0063,u
|
|
404 bsr L026D
|
|
405 puls x
|
|
406 puls pc,b,a
|
|
407 L026D pshs a
|
|
408 lda ,x
|
|
409 bpl L0279
|
|
410 stb ,x
|
|
411 ldb #$01
|
|
412 puls pc,a
|
|
413 L0279 lda $01,x
|
|
414 bpl L0283
|
|
415 stb $01,x
|
|
416 ldb #$02
|
|
417 puls pc,a
|
|
418 L0283 stb $02,x
|
|
419 ldb #$03
|
|
420 puls pc,a
|
|
421 L0289 pshs y,x,b
|
|
422 bsr L02EE
|
|
423 ldb <u006E,u
|
|
424 beq L02C5
|
|
425 leax <u0060,u
|
|
426 pshs b
|
|
427 L0297 leay <u0063,u
|
|
428 ldb #$03
|
|
429 lda ,x
|
|
430 bmi L02B6
|
|
431 L02A0 cmpa ,y
|
|
432 bne L02AA
|
|
433 clr ,y
|
|
434 com ,y
|
|
435 bra L02B6
|
|
436 L02AA leay $01,y
|
|
437 decb
|
|
438 bne L02A0
|
|
439 lda #$FF
|
|
440 sta ,x
|
|
441 dec <u006E,u
|
|
442 L02B6 leax $01,x
|
|
443 dec ,s
|
|
444 bne L0297
|
|
445 leas $01,s
|
|
446 ldb <u006E,u
|
|
447 beq L02C5
|
|
448 bsr L0309
|
|
449 L02C5 leax <u0063,u
|
|
450 lda #$03
|
|
451 L02CA ldb ,x+
|
|
452 bpl L02DE
|
|
453 deca
|
|
454 bne L02CA
|
|
455 ldb <u006E,u
|
|
456 beq L02EA
|
|
457 decb
|
|
458 leax <u0060,u
|
|
459 lda b,x
|
|
460 bra L02E8
|
|
461 L02DE tfr b,a
|
|
462 leax <u0060,u
|
|
463 bsr L026D
|
|
464 stb <u006E,u
|
|
465 L02E8 puls pc,y,x,b
|
|
466 L02EA orcc #Negative
|
|
467 puls pc,y,x,b
|
|
468 L02EE ldd <u0066,u
|
|
469 bne L0301
|
|
470 lda #$03
|
|
471 leax <u0063,u
|
|
472 L02F8 ldb ,x
|
|
473 beq L0302
|
|
474 leax $01,x
|
|
475 deca
|
|
476 bne L02F8
|
|
477 L0301 rts
|
|
478 L0302 comb
|
|
479 stb ,x
|
|
480 inc <u0069,u
|
|
481 rts
|
|
482 L0309 leax <u0060,u
|
|
483 bsr L0314
|
|
484 leax $01,x
|
|
485 bsr L0314
|
|
486 leax -$01,x
|
|
487 L0314 lda ,x
|
|
488 bpl L0320
|
|
489 ldb $01,x
|
|
490 bmi L0320
|
|
491 sta $01,x
|
|
492 stb ,x
|
|
493 L0320 rts
|
|
494
|
|
495 L0321 fcb $00
|
|
496 fdb $4060,$0c1c,$130a,$1a12,$0818,$1009,$1911
|
|
497 fdb $2020,$2030,$3081,$3121,$7c32,$2200,$3323,$7e34
|
|
498 fdb $2400,$3525,$0036,$2600,$3727,$5e38,$285b,$3929
|
|
499 fdb $5d3a,$2a00,$3b2b,$002c,$3c7b,$2d3d,$5f2e,$3e7d
|
|
500 fdb $2f3f,$5c0d,$0d0d,$0000,$0005,$031b,$3133,$3532,$3436
|
|
501
|
|
502 * Write
|
|
503 *
|
|
504 * Entry:
|
|
505 * A = character to write
|
|
506 * Y = address of path descriptor
|
|
507 * U = address of device memory area
|
|
508 *
|
|
509 * Exit:
|
|
510 * CC = carry set on error
|
|
511 * B = error code
|
|
512 *
|
|
513 Write ldb <u0025,u
|
|
514 bne L03A3
|
|
515 sta <u0052,u
|
|
516 cmpa #$20
|
|
517 bcc L038E
|
|
518 cmpa #$1E
|
|
519 bcc L03B8
|
|
520 cmpa #$0F
|
|
521 lbcc L063B
|
|
522 cmpa #$07
|
|
523 lbeq L07C6
|
|
524 L038E lda <u0053,u
|
|
525 L0391 ldb #$03
|
|
526 L0393 leax <u0072,u
|
|
527 ldx a,x
|
|
528 beq L039F
|
|
529 lda <u0052,u
|
|
530 L039D jmp b,x
|
|
531 L039F comb
|
|
532 ldb #$DD
|
|
533 rts
|
|
534 L03A3 cmpb #$02
|
|
535 beq L03B0
|
|
536 sta <u0029,u
|
|
537 clr <u0025,u
|
|
538 jmp [<u0026,u]
|
|
539 L03B0 sta <u0028,u
|
|
540 dec <u0025,u
|
|
541 clrb
|
|
542 rts
|
|
543 L03B8 beq L03C5
|
|
544 leax <L03C7,pcr
|
|
545 L03BD ldb #$01
|
|
546 L03BF stx <u0026,u
|
|
547 stb <u0025,u
|
|
548 L03C5 clrb
|
|
549 rts
|
|
550 L03C7 ldb #$03
|
|
551 lbra L055F
|
|
552 L03CC pshs x,a
|
|
553 stb <u002F,u
|
|
554 lda >PIA.U8+2
|
|
555 anda #$07
|
|
556 ora ,s+
|
|
557 tstb
|
|
558 bne L03DE
|
|
559 ora <u0071,u
|
|
560 L03DE sta >PIA.U8+2
|
|
561 sta <u0030,u
|
|
562 tstb
|
|
563 bne L03F5
|
|
564 stb >$FFC0
|
|
565 stb >$FFC2
|
|
566 stb >$FFC4
|
|
567 lda <u001D,u
|
|
568 bra L0401
|
|
569 L03F5 stb >$FFC0
|
|
570 stb >$FFC3
|
|
571 stb >$FFC5
|
|
572 lda <u0033,u
|
|
573 L0401 ldb #$07
|
|
574 ldx #$FFC6
|
|
575 lsra
|
|
576 L0407 lsra
|
|
577 bcs L0410
|
|
578 sta ,x+
|
|
579 leax $01,x
|
|
580 bra L0414
|
|
581 L0410 leax $01,x
|
|
582 sta ,x+
|
|
583 L0414 decb
|
|
584 bne L0407
|
|
585 clrb
|
|
586 puls pc,x
|
164
|
587
|
|
588 GRFO fcs /GRFO/
|
|
589 CO32 fcs /CO32/
|
|
590 CO80 fcs /CO80/
|
0
|
591
|
|
592 * GetStat
|
|
593 *
|
|
594 * Entry:
|
|
595 * A = function code
|
|
596 * Y = address of path descriptor
|
|
597 * U = address of device memory area
|
|
598 *
|
|
599 * Exit:
|
|
600 * CC = carry set on error
|
|
601 * B = error code
|
|
602 *
|
164
|
603 GetStat sta <u0052,u
|
|
604 cmpa #SS.Ready
|
0
|
605 bne L0439
|
|
606 lda <u0079,u
|
|
607 suba <u0078,u
|
|
608 lbeq L0660
|
164
|
609 SSEOF clrb
|
0
|
610 rts
|
164
|
611 L0439 cmpa #SS.EOF
|
|
612 beq SSEOF
|
|
613 ldx PD.RGS,y
|
|
614 cmpa #SS.Joy
|
|
615 beq SSJOY
|
|
616 cmpa #SS.ScSiz
|
|
617 beq SSSCSIZ
|
|
618 cmpa #SS.KySns
|
|
619 beq SSKYSNS
|
|
620 cmpa #SS.DStat
|
|
621 lbeq SSDSTAT
|
0
|
622 ldb #$06
|
|
623 lbra L055F
|
164
|
624
|
|
625 SSKYSNS ldb <u006A,u
|
|
626 stb R$A,x
|
0
|
627 clrb
|
|
628 rts
|
164
|
629
|
|
630 SSSCSIZ clra
|
0
|
631 ldb <u002D,u
|
|
632 std $04,x
|
|
633 ldb <u002E,u
|
|
634 std $06,x
|
|
635 clrb
|
|
636 rts
|
164
|
637
|
|
638 SSJOY pshs y,cc
|
0
|
639 orcc #IRQMask
|
|
640 lda #$FF
|
|
641 sta >PIA.U4+2
|
|
642 ldb >PIA.U4
|
|
643 ldy $04,x
|
|
644 bne L0481
|
|
645 andb #$01
|
|
646 bne L0485
|
|
647 bra L0486
|
|
648 L0481 andb #$02
|
|
649 beq L0486
|
|
650 L0485 clra
|
|
651 L0486 sta $01,x
|
|
652 lda >PIA.U4+3
|
|
653 ora #$08
|
|
654 ldy $04,x
|
|
655 bne L0494
|
|
656 anda #$F7
|
|
657 L0494 sta >PIA.U4+3
|
|
658 lda >PIA.U4+1
|
|
659 anda #$F7
|
|
660 bsr L04B3
|
|
661 std $04,x
|
|
662 lda >PIA.U4+1
|
|
663 ora #$08
|
|
664 bsr L04B3
|
|
665 pshs b,a
|
|
666 ldd #$003F
|
|
667 subd ,s++
|
|
668 std $06,x
|
|
669 clrb
|
|
670 puls pc,y,cc
|
|
671 L04B3 sta >PIA.U4+1
|
|
672 lda #$7F
|
|
673 ldb #$40
|
|
674 bra L04C7
|
|
675 L04BC lsrb
|
|
676 cmpb #$01
|
|
677 bhi L04C7
|
|
678 lsra
|
|
679 lsra
|
|
680 tfr a,b
|
|
681 clra
|
|
682 rts
|
|
683 L04C7 pshs b
|
|
684 sta >PIA.U8
|
|
685 tst >PIA.U4
|
|
686 bpl L04D5
|
|
687 adda ,s+
|
|
688 bra L04BC
|
|
689 L04D5 suba ,s+
|
|
690 bra L04BC
|
164
|
691
|
|
692 SSDSTAT lbsr L065B
|
0
|
693 bcs L050E
|
|
694 ldd <u0045,u
|
|
695 bsr L050F
|
|
696 tfr a,b
|
|
697 andb ,x
|
|
698 L04E7 bita #$01
|
|
699 bne L04F6
|
|
700 lsra
|
|
701 lsrb
|
|
702 tst <u0024,u
|
|
703 bmi L04E7
|
|
704 lsra
|
|
705 lsrb
|
|
706 bra L04E7
|
|
707 L04F6 pshs b
|
|
708 ldb <u004B,u
|
|
709 andb #$FC
|
|
710 orb ,s+
|
|
711 ldx $06,y
|
|
712 stb $01,x
|
|
713 ldd <u0045,u
|
|
714 std $06,x
|
|
715 ldd <u0033,u
|
|
716 std $04,x
|
|
717 clrb
|
|
718 L050E rts
|
|
719 L050F pshs y,b,a
|
|
720 ldb <u0024,u
|
|
721 bpl L0517
|
|
722 lsra
|
|
723 L0517 lsra
|
|
724 lsra
|
|
725 pshs a
|
|
726 ldb #$BF
|
|
727 subb $02,s
|
|
728 lda #$20
|
|
729 mul
|
|
730 addb ,s+
|
|
731 adca #$00
|
|
732 ldy <u0033,u
|
|
733 leay d,y
|
|
734 lda ,s
|
|
735 sty ,s
|
|
736 anda <u0044,u
|
|
737 ldx <u0042,u
|
|
738 lda a,x
|
|
739 puls pc,y,x
|
|
740
|
|
741 * SetStat
|
|
742 *
|
|
743 * Entry:
|
|
744 * A = function code
|
|
745 * Y = address of path descriptor
|
|
746 * U = address of device memory area
|
|
747 *
|
|
748 * Exit:
|
|
749 * CC = carry set on error
|
|
750 * B = error code
|
|
751 *
|
|
752 SetStat sta <u0052,u
|
164
|
753 ldx PD.RGS,y
|
|
754 cmpa #SS.ComSt
|
|
755 lbeq SSCOMST
|
|
756 cmpa #SS.AAGBf
|
|
757 beq SSAAGBF
|
|
758 cmpa #SS.SLGBf
|
|
759 beq SSSLGBF
|
|
760 cmpa #SS.KySns
|
0
|
761 bne L055D
|
164
|
762 ldd R$X,x
|
0
|
763 beq L0558
|
|
764 ldb #$FF
|
|
765 L0558 stb <u006C,u
|
|
766 L055B clrb
|
|
767 L055C rts
|
|
768 L055D ldb #$09
|
|
769 L055F pshs b
|
|
770 lda <u0053,u
|
|
771 lbsr L0393
|
|
772 puls a
|
|
773 bcc L055B
|
|
774 tst <u0072,u
|
|
775 beq L055C
|
|
776 tfr a,b
|
|
777 clra
|
|
778 lbra L0393
|
164
|
779
|
|
780 SSAAGBF ldb <u0031,u
|
0
|
781 lbeq L0660
|
|
782 pshs b
|
|
783 leay <u0037,u
|
|
784 ldd ,y
|
|
785 beq L058E
|
|
786 leay $02,y
|
|
787 inc ,s
|
|
788 ldd ,y
|
|
789 bne L059E
|
|
790 L058E lbsr L0685
|
|
791 bcs L05A1
|
|
792 std ,y
|
|
793 std $04,x
|
|
794 puls b
|
|
795 clra
|
|
796 std $06,x
|
|
797 clrb
|
|
798 rts
|
|
799 L059E ldb #E$BMode
|
|
800 coma
|
|
801 L05A1 puls pc,a
|
164
|
802
|
|
803 SSSLGBF ldb <u0031,u
|
0
|
804 lbeq L0660
|
164
|
805 ldd R$Y,x
|
0
|
806 cmpd #$0002
|
|
807 bhi L05C8
|
|
808 leay <u0035,u
|
|
809 lslb
|
|
810 ldd b,y
|
|
811 beq L05C8
|
|
812 std <u0033,u
|
|
813 ldd $04,x
|
|
814 beq L05C3
|
|
815 ldb #$01
|
|
816 L05C3 stb <u0032,u
|
|
817 clrb
|
|
818 rts
|
|
819 L05C8 comb
|
|
820 ldb #E$BMode
|
|
821 rts
|
|
822
|
164
|
823 SSCOMST ldd R$Y,x
|
0
|
824 L05CE bita #$02
|
|
825 bne L05E9
|
|
826 ldb #$10
|
|
827 bita #$01
|
|
828 bne L05D9
|
|
829 clrb
|
|
830 L05D9 stb <u0071,u
|
|
831 lda #$02
|
|
832 ldx #$2010
|
|
833 pshs u,y,x,a
|
164
|
834 leax >CO32,pcr
|
0
|
835 bra L05F4
|
|
836 L05E9 lda #$04
|
|
837 ldx #$5018
|
|
838 pshs u,y,x,a
|
164
|
839 leax >CO80,pcr
|
0
|
840 L05F4 bsr L0601
|
|
841 puls u,y,x,a
|
|
842 bcs L0600
|
|
843 stx <u002D,u
|
|
844 sta <u0053,u
|
|
845 L0600 rts
|
|
846 L0601 bita <u0070,u
|
|
847 beq L0608
|
|
848 L0606 clrb
|
|
849 rts
|
|
850 L0608 pshs y,x,a
|
|
851 lbsr L062E
|
|
852 bcc L061F
|
|
853 ldx $01,s
|
|
854 pshs u
|
|
855 os9 F$Load
|
|
856 puls u
|
|
857 bcc L061F
|
|
858 puls y,x,a
|
|
859 lbra L039F
|
|
860 L061F leax <u0072,u
|
|
861 lda ,s
|
|
862 sty a,x
|
|
863 puls y,x,a
|
|
864 ldb #$00
|
|
865 lbra L0393
|
|
866 L062E pshs u
|
|
867 lda #Systm+Objct
|
|
868 os9 F$Link
|
|
869 puls pc,u
|
|
870
|
|
871 L0637 fdb $0055,$aaff
|
|
872
|
|
873 L063B cmpa #$15
|
|
874 bcc L0664
|
|
875 cmpa #$0F
|
|
876 beq L06B4
|
|
877 suba #$10
|
|
878 bsr L065B
|
|
879 bcs L0663
|
|
880 leax <L0651,pcr
|
|
881 lsla
|
|
882 ldd a,x
|
|
883 jmp d,x
|
|
884
|
|
885 L0651 fdb $0140,$00fd,$0111,$0160,$016f
|
|
886
|
|
887 L065B ldb <u0031,u
|
|
888 bne L0606
|
|
889 L0660 comb
|
|
890 ldb #E$NotRdy
|
|
891 L0663 rts
|
|
892 L0664 bsr L065B
|
|
893 bcs L0663
|
|
894 ldx <u0072,u
|
|
895 bne L0681
|
|
896 pshs y,a
|
|
897 bne L067F
|
164
|
898 leax >GRFO,pcr
|
0
|
899 bsr L062E
|
|
900 bcc L067B
|
|
901 puls pc,y,a
|
|
902 L067B sty <u0072,u
|
|
903 L067F puls y,a
|
|
904 L0681 clra
|
|
905 lbra L0391
|
|
906 L0685 pshs u
|
|
907 ldd #$1900
|
|
908 os9 F$SRqMem
|
|
909 bcc L0691
|
|
910 puls pc,u
|
|
911 L0691 tfr u,d
|
|
912 puls u
|
|
913 tfr a,b
|
|
914 bita #$01
|
|
915 beq L069F
|
|
916 adda #$01
|
|
917 bra L06A1
|
|
918 L069F addb #$18
|
|
919 L06A1 pshs u,a
|
|
920 tfr b,a
|
|
921 clrb
|
|
922 tfr d,u
|
|
923 ldd #$0100
|
|
924 os9 F$SRtMem
|
|
925 puls u,a
|
|
926 bcs L06B3
|
|
927 clrb
|
|
928 L06B3 rts
|
|
929 L06B4 leax <L06BC,pcr
|
|
930 ldb #$02
|
|
931 lbra L03BF
|
|
932 L06BC ldb <u0031,u
|
|
933 bne L06D1
|
|
934 bsr L0685
|
|
935 bcs L06EF
|
|
936 std <u0033,u
|
|
937 std <u0035,u
|
|
938 inc <u0031,u
|
|
939 lbsr L07B1
|
|
940 L06D1 lda <u0029,u
|
|
941 sta <u004B,u
|
|
942 anda #$03
|
|
943 leax >L0637,pcr
|
|
944 lda a,x
|
|
945 sta <u0047,u
|
|
946 sta <u0048,u
|
|
947 lda <u0028,u
|
|
948 cmpa #$01
|
|
949 bls L06F0
|
|
950 comb
|
|
951 ldb #E$BMode
|
|
952 L06EF rts
|
|
953 L06F0 tsta
|
|
954 beq L0710
|
|
955 ldd #$C003
|
|
956 std <u0049,u
|
|
957 lda #$01
|
|
958 sta <u0024,u
|
|
959 lda #$E0
|
|
960 ldb <u0029,u
|
|
961 andb #$08
|
|
962 beq L0709
|
|
963 lda #$F0
|
|
964 L0709 ldb #$03
|
|
965 leax <L0742,pcr
|
|
966 bra L072D
|
|
967 L0710 ldd #$8001
|
|
968 std <u0049,u
|
|
969 lda #$FF
|
|
970 tst <u0047,u
|
|
971 beq L0723
|
|
972 sta <u0047,u
|
|
973 sta <u0048,u
|
|
974 L0723 sta <u0024,u
|
|
975 lda #$F0
|
|
976 ldb #$07
|
|
977 leax <L0746,pcr
|
|
978 L072D stb <u0044,u
|
|
979 stx <u0042,u
|
|
980 ldb <u0029,u
|
|
981 andb #$04
|
|
982 lslb
|
|
983 pshs b
|
|
984 ora ,s+
|
|
985 ldb #$01
|
|
986 lbra L03CC
|
|
987
|
|
988 L0742 fcb $c0,$30,$0c,$03
|
|
989 L0746 fcb $80,$40,$20,$10,$08,$04,$02,$01
|
|
990 fcb $30,$8C,$03,$16,$fC,$69,$6f,$C8,$28
|
|
991 fcb $A6,$C8,$24,$2B,$03,$6C,$C8,$28,$16
|
|
992 fcb $FF,$6F,$30,$C8,$35,$10,$8E,$00,$00
|
|
993 fcb $C6,$03,$34,$44
|
|
994
|
|
995 L076D ldd #$1800
|
|
996 ldu ,x++
|
|
997 beq L077A
|
|
998 sty -$02,x
|
|
999 os9 F$SRtMem
|
|
1000 L077A dec ,s
|
|
1001 bgt L076D
|
|
1002 ldu ,x
|
|
1003 beq L0788
|
|
1004 ldd #$0200
|
|
1005 os9 F$SRtMem
|
|
1006 L0788 puls u,b
|
|
1007 clra
|
|
1008 sta <u0031,u
|
|
1009 lbra L03CC
|
|
1010 leax <L0797,pcr
|
|
1011 lbra L03BD
|
|
1012 L0797 lda <u0029,u
|
|
1013 tst <u0024,u
|
|
1014 bpl L07A7
|
|
1015 ldb #$FF
|
|
1016 anda #$01
|
|
1017 beq L07B1
|
|
1018 bra L07B2
|
|
1019 L07A7 anda #$03
|
|
1020 leax >L0637,pcr
|
|
1021 ldb a,x
|
|
1022 bra L07B2
|
|
1023 L07B1 clrb
|
|
1024 L07B2 ldx <u0033,u
|
|
1025 leax >$1801,x
|
|
1026 L07B9 stb ,-x
|
|
1027 cmpx <u0033,u
|
|
1028 bhi L07B9
|
|
1029 clra
|
|
1030 clrb
|
|
1031 std <u0045,u
|
|
1032 rts
|
|
1033 L07C6 pshs b,a
|
|
1034 lda >PIA.U4+1
|
|
1035 ldb >PIA.U4+3
|
|
1036 pshs b,a
|
|
1037 anda #$F7
|
|
1038 andb #$F7
|
|
1039 sta >PIA.U4+1
|
|
1040 stb >PIA.U4+3
|
|
1041 lda >PIA.U8+3
|
|
1042 pshs a
|
|
1043 ora #$08
|
|
1044 sta >PIA.U8+3
|
|
1045 ldb #$0A
|
|
1046 L07E6 lda #$FE
|
|
1047 bsr L0800
|
|
1048 lda #$02
|
|
1049 bsr L0800
|
|
1050 decb
|
|
1051 bne L07E6
|
|
1052 puls a
|
|
1053 sta >PIA.U8+3
|
|
1054 puls b,a
|
|
1055 sta >PIA.U4+1
|
|
1056 stb >PIA.U4+3
|
|
1057 puls pc,b,a
|
|
1058 L0800 sta >PIA.U8
|
|
1059 lda #$80
|
|
1060 L0805 inca
|
|
1061 bne L0805
|
|
1062 rts
|
|
1063
|
|
1064 emod
|
|
1065 eom equ *
|
|
1066 end
|