0
|
1 ********************************************************************
|
|
2 * s16550_large - 16550 serial driver
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
|
8 * 28 Patched by Bob Brose to fix IRQ poll table BOB ??/??/??
|
|
9 * duplication bug
|
|
10
|
|
11 nam s16550
|
|
12 ttl os9 device driver
|
|
13
|
|
14 * Disassembled 02/04/02 22:41:55 by Disasm v1.6 (C) 1988 by RML
|
|
15
|
|
16 ifp1
|
|
17 use defsfile
|
|
18 use scfdefs
|
|
19 endc
|
|
20
|
|
21 tylg set Drivr+Objct
|
|
22 atrv set ReEnt+rev
|
|
23 rev set $01
|
|
24
|
|
25 mod eom,name,tylg,atrv,start,size
|
|
26
|
|
27 u0000 rmb 1
|
|
28 u0001 rmb 2
|
|
29 u0003 rmb 1
|
|
30 u0004 rmb 1
|
|
31 u0005 rmb 1
|
|
32 u0006 rmb 2
|
|
33 u0008 rmb 1
|
|
34 u0009 rmb 1
|
|
35 u000A rmb 1
|
|
36 u000B rmb 1
|
|
37 u000C rmb 1
|
|
38 u000D rmb 1
|
|
39 u000E rmb 1
|
|
40 u000F rmb 1
|
|
41 u0010 rmb 4
|
|
42 u0014 rmb 2
|
|
43 u0016 rmb 3
|
|
44 u0019 rmb 2
|
|
45 u001B rmb 2
|
|
46 u001D rmb 1
|
|
47 u001E rmb 1
|
|
48 u001F rmb 1
|
|
49 u0020 rmb 1
|
|
50 u0021 rmb 1
|
|
51 u0022 rmb 1
|
|
52 u0023 rmb 2
|
|
53 u0025 rmb 2
|
|
54 u0027 rmb 1
|
|
55 u0028 rmb 1
|
|
56 u0029 rmb 1
|
|
57 u002A rmb 2
|
|
58 u002C rmb 2
|
|
59 u002E rmb 2
|
|
60 u0030 rmb 2
|
|
61 u0032 rmb 2
|
|
62 u0034 rmb 1
|
|
63 u0035 rmb 1
|
|
64 u0036 rmb 2
|
|
65 u0038 rmb 2
|
|
66 u003A rmb 1
|
|
67 u003B rmb 1
|
|
68 u003C rmb 2
|
|
69 u003E rmb 2
|
|
70 u0040 rmb 1
|
|
71 u0041 rmb 2
|
|
72 u0043 rmb 1
|
|
73 u0044 rmb 52
|
|
74 u0078 rmb 8
|
|
75 u0080 rmb 128
|
|
76 U0100 rmb 0
|
|
77 size equ .
|
|
78
|
|
79 fcb $03
|
|
80
|
|
81 name fcs /s16550/
|
|
82 fcb 28
|
|
83
|
|
84 L0015 fcb $03
|
|
85
|
|
86 start lbra Init
|
|
87 lbra Read
|
|
88 lbra Write
|
|
89 lbra GetStat
|
|
90 lbra SetStat
|
|
91 lbra Term
|
|
92
|
|
93 Init clrb
|
|
94 pshs dp,b,cc
|
|
95 lbsr L05C3
|
|
96 ldd <u0001
|
|
97 addd #$0002
|
|
98 pshs y
|
|
99 leax >L07E0,pcr
|
|
100 leay >L05D7,pcr
|
|
101 os9 F$IRQ
|
|
102 puls y
|
|
103 bcc L004A
|
|
104 puls a,cc
|
|
105 orcc #Carry
|
|
106 puls pc,dp
|
|
107 L004A lda <$11,y
|
|
108 cmpa #$1C
|
|
109 bls L005F
|
|
110 lda <$2E,y
|
|
111 anda #$10
|
|
112 sta <u001F
|
|
113 lda <$2E,y
|
|
114 anda #$0F
|
|
115 bne L0061
|
|
116 L005F lda #$01
|
|
117 L0061 clrb
|
|
118 pshs u
|
|
119 os9 F$SRqMem
|
|
120 tfr u,x
|
|
121 puls u
|
|
122 bcc L0087
|
|
123 stb $01,s
|
|
124 ldx #$0000
|
|
125 ldd <u0001
|
|
126 addd #$0002
|
|
127 pshs y
|
|
128 leay >L05D7,pcr
|
|
129 os9 F$IRQ
|
|
130 puls y
|
|
131 puls dp,b,cc
|
|
132 orcc #Carry
|
|
133 rts
|
|
134 L0087 stx <u0032
|
|
135 stx <u002C
|
|
136 stx <u002E
|
|
137 std <u0036
|
|
138 leax d,x
|
|
139 stx <u0030
|
|
140 tfr a,b
|
|
141 clra
|
|
142 orb #$02
|
|
143 andb #$0E
|
|
144 lslb
|
|
145 lslb
|
|
146 lslb
|
|
147 lslb
|
|
148 tstb
|
|
149 bpl L00A3
|
|
150 ldb #$80
|
|
151 L00A3 pshs b,a
|
|
152 ldd <u0036
|
|
153 subd ,s++
|
|
154 std <u002A
|
|
155 leax <u0044,u
|
|
156 stx <u003E
|
|
157 stx <u0038
|
|
158 stx <u003A
|
|
159 leax >u0100,u
|
|
160 stx <u003C
|
|
161 ldd #$00BC
|
|
162 std <u0041
|
|
163 clr <u0034
|
|
164 clr <u0035
|
|
165 clr <u0040
|
|
166 ldd <$26,y
|
|
167 std <u001D
|
|
168 lbsr L0318
|
|
169 ldx <u0001
|
|
170 lda $05,x
|
|
171 lda ,x
|
|
172 lda $05,x
|
|
173 lda $06,x
|
|
174 anda #$B0
|
|
175 sta <u0020
|
|
176 clrb
|
|
177 bita #$10
|
|
178 bne L00E2
|
|
179 orb #$02
|
|
180 L00E2 bita #$20
|
|
181 bne L00E8
|
|
182 orb #$01
|
|
183 L00E8 stb <u0028
|
|
184 orcc #IntMasks
|
|
185 lda >L0015,pcr
|
|
186 bmi L00F5
|
|
187 sta >$FF7F
|
|
188 L00F5 lda >$FF23
|
|
189 anda #$FC
|
|
190 sta >$FF23
|
|
191 lda >$FF22
|
|
192 lda >$0092
|
|
193 ora #$01
|
|
194 sta >$0092
|
|
195 sta >$FF92
|
|
196 puls pc,dp,b,cc
|
|
197 Write clrb
|
|
198 pshs dp,b,cc
|
|
199 lbsr L05C3
|
|
200 ldx <u0038
|
|
201 sta ,x+
|
|
202 cmpx <u003C
|
|
203 bcs L011D
|
|
204 ldx <u003E
|
|
205 L011D orcc #IntMasks
|
|
206 cmpx <u003A
|
|
207 bne L0138
|
|
208 pshs x
|
|
209 lbsr L05AD
|
|
210 puls x
|
|
211 ldu >$0050
|
|
212 ldb <u0019,u
|
|
213 beq L0136
|
|
214 cmpb #$03
|
|
215 bls L013E
|
|
216 L0136 bra L011D
|
|
217 L0138 stx <u0038
|
|
218 inc <u0040
|
|
219 bsr L0140
|
|
220 L013E puls pc,dp,b,cc
|
|
221 L0140 lda #$0F
|
|
222 bra L0146
|
|
223 lda #$0D
|
|
224 L0146 ldx <u0001
|
|
225 sta $01,x
|
|
226 rts
|
|
227
|
|
228 Read clrb
|
|
229 pshs dp,b,cc
|
|
230 lbsr L05C3
|
|
231 orcc #IntMasks
|
|
232 ldd <u0034
|
|
233 beq L0169
|
|
234 cmpd #$0010
|
|
235 lbne L018F
|
|
236 andcc #^IntMasks
|
|
237 bsr L01BD
|
|
238 L0163 orcc #IntMasks
|
|
239 ldd <u0034
|
|
240 bne L018F
|
|
241 L0169 lbsr L05AD
|
|
242 ldx >$0050
|
|
243 ldb <$19,x
|
|
244 beq L0178
|
|
245 cmpb #$03
|
|
246 bls L018A
|
|
247 L0178 ldb $0C,x
|
|
248 andb #$02
|
|
249 bne L018A
|
|
250 ldb <u000E
|
|
251 bne L01A6
|
|
252 ldb <u0005
|
|
253 beq L0163
|
|
254 orcc #IntMasks
|
|
255 bra L0169
|
|
256 L018A puls dp,a,cc
|
|
257 orcc #Carry
|
|
258 rts
|
|
259 L018F subd #$0001
|
|
260 std <u0034
|
|
261 ldx <u002E
|
|
262 lda ,x+
|
|
263 cmpx <u0030
|
|
264 bne L019E
|
|
265 ldx <u0032
|
|
266 L019E stx <u002E
|
|
267 andcc #^IntMasks
|
|
268 ldb <u000E
|
|
269 beq L01BB
|
|
270 L01A6 stb <$3A,y
|
|
271 clr <u000E
|
|
272 puls dp,a,cc
|
|
273 bitb #$20
|
|
274 beq L01B6
|
|
275 ldb #$F4
|
|
276 orcc #Carry
|
|
277 rts
|
|
278 L01B6 ldb #$DC
|
|
279 orcc #Carry
|
|
280 rts
|
|
281 L01BB puls pc,dp,b,cc
|
|
282 L01BD pshs cc
|
|
283 ldx <u0001
|
|
284 ldb <u0028
|
|
285 bitb #$70
|
|
286 beq L01D9
|
|
287 bitb #$20
|
|
288 beq L01DB
|
|
289 orcc #IntMasks
|
|
290 ldb <u0028
|
|
291 andb #$DF
|
|
292 stb <u0028
|
|
293 lda $04,x
|
|
294 ora #$02
|
|
295 sta $04,x
|
|
296 L01D9 puls pc,cc
|
|
297 L01DB bitb #$10
|
|
298 beq L01EF
|
|
299 orcc #IntMasks
|
|
300 ldb <u0028
|
|
301 andb #$EF
|
|
302 stb <u0028
|
|
303 lda $04,x
|
|
304 ora #$01
|
|
305 sta $04,x
|
|
306 bra L01D9
|
|
307 L01EF bitb #$40
|
|
308 beq L01D9
|
|
309 ldb <u000F
|
|
310 orcc #IntMasks
|
|
311 stb <u0043
|
|
312 lbsr L0140
|
|
313 ldb <u0028
|
|
314 andb #$BF
|
|
315 stb <u0028
|
|
316 bra L01D9
|
|
317
|
|
318 GetStat clrb
|
|
319 pshs dp,b,cc
|
|
320 lbsr L05C3
|
|
321 cmpa #$01
|
|
322 bne L0226
|
|
323 ldd <u0034
|
|
324 beq L021E
|
|
325 tsta
|
|
326 beq L0217
|
|
327 ldb #$FF
|
|
328 L0217 ldx $06,y
|
|
329 stb $02,x
|
|
330 lbra L0316
|
|
331 L021E puls b,cc
|
|
332 orcc #Carry
|
|
333 ldb #$F6
|
|
334 puls pc,dp
|
|
335 L0226 cmpa #$28
|
|
336 bne L024E
|
|
337 ldd <u001D
|
|
338 tst <u001F
|
|
339 beq L0236
|
|
340 bitb #$04
|
|
341 bne L0236
|
|
342 andb #$F7
|
|
343 L0236 ldx $06,y
|
|
344 std $08,x
|
|
345 clrb
|
|
346 lda <u0020
|
|
347 bita #$80
|
|
348 bne L0243
|
|
349 orb #$10
|
|
350 L0243 bita #$20
|
|
351 bne L0249
|
|
352 orb #$40
|
|
353 L0249 stb $02,x
|
|
354 lbra L0316
|
|
355 L024E cmpa #$06
|
|
356 bne L0256
|
|
357 clrb
|
|
358 lbra L0316
|
|
359 L0256 cmpa #$C1
|
|
360 bne L026F
|
|
361 ldx $06,y
|
|
362 ldd #$00BC
|
|
363 std $06,x
|
|
364 clra
|
|
365 ldb <u0040
|
|
366 std $08,x
|
|
367 ldb <u0028
|
|
368 andb #$07
|
|
369 stb $02,x
|
|
370 lbra L0316
|
|
371 L026F cmpa #$D0
|
|
372 bne L02DD
|
|
373 ldb <u000E
|
|
374 lbne L01A6
|
|
375 orcc #IntMasks
|
|
376 ldd <u0030
|
|
377 subd <u002E
|
|
378 cmpd <u0034
|
|
379 bcs L0288
|
|
380 ldd <u0034
|
|
381 beq L021E
|
|
382 L0288 andcc #^IntMasks
|
|
383 ldu $06,y
|
|
384 cmpd u0008,u
|
|
385 bls L0293
|
|
386 ldd u0008,u
|
|
387 L0293 std u0008,u
|
|
388 beq L02DB
|
|
389 pshs b,a
|
|
390 pshs u,y,x
|
|
391 std $02,s
|
|
392 ldd <u002E
|
|
393 std ,s
|
|
394 ldd u0006,u
|
|
395 std $04,s
|
|
396 ldx >$0050
|
|
397 ldb $06,x
|
|
398 lda >$00D0
|
|
399 puls u,y,x
|
|
400 orcc #IntMasks
|
|
401 os9 F$Move
|
|
402 ldd <u0034
|
|
403 subd ,s
|
|
404 std <u0034
|
|
405 andcc #^IntMasks
|
|
406 cmpd #$0010
|
|
407 bhi L02CD
|
|
408 addd ,s
|
|
409 cmpd #$0010
|
|
410 bls L02CD
|
|
411 lbsr L01BD
|
|
412 L02CD puls b,a
|
|
413 ldx <u002E
|
|
414 leax d,x
|
|
415 cmpx <u0030
|
|
416 bne L02D9
|
|
417 ldx <u0032
|
|
418 L02D9 stx <u002E
|
|
419 L02DB bra L0316
|
|
420 L02DD cmpa #$D2
|
|
421 bne L02F5
|
|
422 ldd #$0B04
|
|
423 ldy $06,y
|
|
424 std $01,y
|
|
425 ldd #$0077
|
|
426 std $06,y
|
|
427 ldd #$0001
|
|
428 std $08,y
|
|
429 bra L0316
|
|
430 L02F5 cmpa #$26
|
|
431 bne L030E
|
|
432 ldx $06,y
|
|
433 ldy $03,y
|
|
434 ldy $04,y
|
|
435 clra
|
|
436 ldb <$2C,y
|
|
437 std $06,x
|
|
438 ldb <$2D,y
|
|
439 std $08,x
|
|
440 bra L0316
|
|
441 L030E puls b,cc
|
|
442 orcc #Carry
|
|
443 ldb #$D0
|
|
444 puls pc,dp
|
|
445 L0316 puls pc,dp,b,cc
|
|
446 L0318 pshs u
|
|
447 tfr b,a
|
|
448 leau >L07E3,pcr
|
|
449 ldx <u0001
|
|
450 andb #$0F
|
|
451 lslb
|
|
452 lslb
|
|
453 leau b,u
|
|
454 lsra
|
|
455 lsra
|
|
456 lsra
|
|
457 lsra
|
|
458 lsra
|
|
459 eora #$03
|
|
460 anda #$03
|
|
461 pshs a,cc
|
|
462 lda <u001D
|
|
463 lsra
|
|
464 lsra
|
|
465 anda #$38
|
|
466 ora $01,s
|
|
467 sta $01,s
|
|
468 ora #$80
|
|
469 orcc #IntMasks
|
|
470 sta $03,x
|
|
471 ldd ,u++
|
|
472 exg a,b
|
|
473 std ,x
|
|
474 lda $01,s
|
|
475 sta $03,x
|
|
476 ldd ,u
|
|
477 sta <u0021
|
|
478 ora #$06
|
|
479 sta $02,x
|
|
480 stb <u0029
|
|
481 puls pc,u,a,cc
|
|
482
|
|
483 SetStat clrb
|
|
484 pshs dp,b,cc
|
|
485 lbsr L05C3
|
|
486 cmpa #$D1
|
|
487 lbne L03F5
|
|
488 ldu $06,y
|
|
489 ldx u0006,u
|
|
490 ldd u0008,u
|
|
491 pshs x,b,a
|
|
492 beq L03D3
|
|
493 L036F ldd <u003A
|
|
494 cmpd <u003E
|
|
495 bne L037D
|
|
496 ldd <u003C
|
|
497 subd #$0001
|
|
498 bra L0387
|
|
499 L037D subd #$0001
|
|
500 cmpd <u0038
|
|
501 bcc L0387
|
|
502 ldd <u003C
|
|
503 L0387 subd <u0038
|
|
504 beq L03D8
|
|
505 cmpd ,s
|
|
506 bls L0392
|
|
507 ldd ,s
|
|
508 L0392 pshs b,a
|
|
509 ldx >$0050
|
|
510 lda $06,x
|
|
511 ldb >$00D0
|
|
512 ldu <u0038
|
|
513 ldx $04,s
|
|
514 ldy ,s
|
|
515 orcc #IntMasks
|
|
516 os9 F$Move
|
|
517 ldd ,s
|
|
518 ldu <u0038
|
|
519 leau d,u
|
|
520 cmpu <u003C
|
|
521 bcs L03B5
|
|
522 ldu <u003E
|
|
523 L03B5 stu <u0038
|
|
524 clra
|
|
525 ldb <u0040
|
|
526 addd ,s
|
|
527 stb <u0040
|
|
528 andcc #^IntMasks
|
|
529 ldd ,s
|
|
530 ldx $04,s
|
|
531 leax d,x
|
|
532 stx $04,s
|
|
533 ldd $02,s
|
|
534 subd ,s++
|
|
535 std ,s
|
|
536 bne L036F
|
|
537 lbsr L0140
|
|
538 L03D3 leas $04,s
|
|
539 lbra L0543
|
|
540 L03D8 orcc #IntMasks
|
|
541 lbsr L0140
|
|
542 lbsr L05AD
|
|
543 ldx >$0050
|
|
544 ldb <$19,x
|
|
545 beq L03EC
|
|
546 cmpb #$03
|
|
547 bls L03D3
|
|
548 L03EC ldb $0C,x
|
|
549 andb #$02
|
|
550 bne L03D3
|
|
551 lbra L036F
|
|
552 L03F5 cmpa #$28
|
|
553 bne L0426
|
|
554 ldy $06,y
|
|
555 ldd $08,y
|
|
556 tst <u001F
|
|
557 beq L0408
|
|
558 bitb #$04
|
|
559 bne L0408
|
|
560 orb #$08
|
|
561 L0408 std <u001D
|
|
562 lbsr L0318
|
|
563 clr <u0022
|
|
564 tst <u000C
|
|
565 bne L0423
|
|
566 tst <u000B
|
|
567 bne L0423
|
|
568 tst <u000D
|
|
569 bne L0423
|
|
570 ldb <u001D
|
|
571 bitb #$04
|
|
572 bne L0423
|
|
573 inc <u0022
|
|
574 L0423 lbra L0543
|
|
575 L0426 cmpa #$2B
|
|
576 bne L0441
|
|
577 ldx <u0001
|
|
578 lda $04,x
|
|
579 pshs x,a
|
|
580 anda #$FE
|
|
581 sta $04,x
|
|
582 ldx #$001E
|
|
583 os9 F$Sleep
|
|
584 puls x,a
|
|
585 sta $04,x
|
|
586 lbra L0543
|
|
587 L0441 cmpa #$1D
|
|
588 bne L0491
|
|
589 orcc #IntMasks
|
|
590 ldx <u0001
|
|
591 lda <u0028
|
|
592 ora #$08
|
|
593 sta <u0028
|
|
594 lda #$0D
|
|
595 sta $01,x
|
|
596 clr <u0040
|
|
597 ldd <u003E
|
|
598 std <u003A
|
|
599 std <u0038
|
|
600 lda <u0021
|
|
601 ora #$04
|
|
602 sta $02,x
|
|
603 clra
|
|
604 sta ,x
|
|
605 L0464 lda $05,x
|
|
606 anda #$40
|
|
607 bne L0476
|
|
608 andcc #^IntMasks
|
|
609 ldx #$0001
|
|
610 os9 F$Sleep
|
|
611 ldx <u0001
|
|
612 bra L0464
|
|
613 L0476 lda $03,x
|
|
614 ora #$40
|
|
615 sta $03,x
|
|
616 ldx #$001E
|
|
617 os9 F$Sleep
|
|
618 ldx <u0001
|
|
619 anda #$BF
|
|
620 sta $03,x
|
|
621 lda <u0028
|
|
622 anda #$F7
|
|
623 sta <u0028
|
|
624 lbra L0543
|
|
625 L0491 cmpa #$C2
|
|
626 bne L04A7
|
|
627 ldb <u0028
|
|
628 andb #$F8
|
|
629 stb <u0028
|
|
630 tst <u0040
|
|
631 lbeq L0543
|
|
632 lbsr L0140
|
|
633 lbra L0543
|
|
634 L04A7 cmpa #$1A
|
|
635 bne L04C4
|
|
636 lda $05,y
|
|
637 ldy $06,y
|
|
638 ldb $07,y
|
|
639 orcc #IntMasks
|
|
640 ldx <u0034
|
|
641 bne L04BD
|
|
642 std <u0025
|
|
643 lbra L0543
|
|
644 L04BD puls cc
|
|
645 os9 F$Send
|
|
646 puls pc,dp,b
|
|
647 L04C4 cmpa #$1B
|
|
648 bne L04D5
|
|
649 lda $05,y
|
|
650 cmpa <u0025
|
|
651 bne L04D2
|
|
652 clra
|
|
653 clrb
|
|
654 std <u0025
|
|
655 L04D2 lbra L0543
|
|
656 L04D5 cmpa #$9A
|
|
657 bne L04E4
|
|
658 lda $05,y
|
|
659 ldy $06,y
|
|
660 ldb $07,y
|
|
661 std <u0023
|
|
662 bra L0543
|
|
663 L04E4 cmpa #$9B
|
|
664 bne L04F6
|
|
665 orcc #IntMasks
|
|
666 lda $05,y
|
|
667 cmpa <u0023
|
|
668 bne L04F4
|
|
669 clra
|
|
670 clrb
|
|
671 std <u0023
|
|
672 L04F4 bra L0543
|
|
673 L04F6 cmpa #$2A
|
|
674 lbne L0511
|
|
675 orcc #IntMasks
|
|
676 lda $05,y
|
|
677 ldx #$0000
|
|
678 cmpa <u0025
|
|
679 bne L0509
|
|
680 stx <u0025
|
|
681 L0509 cmpa <u0023
|
|
682 bne L050F
|
|
683 stx <u0023
|
|
684 L050F bra L0543
|
|
685 L0511 cmpa #$C3
|
|
686 bne L052B
|
|
687 orcc #IntMasks
|
|
688 ldb #$0D
|
|
689 stb $01,x
|
|
690 ldd <u003E
|
|
691 std <u0038
|
|
692 std <u003A
|
|
693 clr <u0040
|
|
694 ldb <u0021
|
|
695 orb #$04
|
|
696 stb $02,x
|
|
697 bra L0543
|
|
698 L052B cmpa #$29
|
|
699 bne L053B
|
|
700 ldx <u0001
|
|
701 lda #$03
|
|
702 sta $04,x
|
|
703 ldb #$0F
|
|
704 stb $01,x
|
|
705 bra L0543
|
|
706 L053B puls b,cc
|
|
707 orcc #Carry
|
|
708 ldb #$D0
|
|
709 puls pc,dp
|
|
710 L0543 puls pc,dp,b,cc
|
|
711
|
|
712 Term clrb
|
|
713 pshs dp,b,cc
|
|
714 lbsr L05C3
|
|
715 orcc #IntMasks
|
|
716 clra
|
|
717 clrb
|
|
718 std <u0034
|
|
719 ldx <u0032
|
|
720 stx <u002C
|
|
721 stx <u002E
|
|
722 pshs x,b,a
|
|
723 ldb $04,s
|
|
724 tfr b,cc
|
|
725 ldx >$0050
|
|
726 lda ,x
|
|
727 sta <u0004
|
|
728 sta <u0003
|
|
729 L0566 orcc #IntMasks
|
|
730 tst <u0040
|
|
731 bne L0576
|
|
732 ldx <u0001
|
|
733 ldb $05,x
|
|
734 eorb #$20
|
|
735 andb #$20
|
|
736 beq L0585
|
|
737 L0576 orcc #IntMasks
|
|
738 lbsr L05AD
|
|
739 ldd $02,s
|
|
740 std <u002C
|
|
741 ldd ,s
|
|
742 std <u0034
|
|
743 bra L0566
|
|
744 L0585 leas $04,s
|
|
745 clr $01,x
|
|
746 clr $04,x
|
|
747 andcc #^IntMasks
|
|
748 ldd <u0036
|
|
749 pshs u
|
|
750 ldu <u0032
|
|
751 os9 F$SRtMem
|
|
752 puls u
|
|
753 ldx #$0000
|
|
754 ldd <u0001
|
|
755 addd #$0002
|
|
756 pshs y
|
|
757 leay >L05D7,pcr
|
|
758 os9 F$IRQ
|
|
759 puls y
|
|
760 puls pc,dp,b,cc
|
|
761 L05AD ldd >$0050
|
|
762 sta <u0005
|
|
763 tfr d,x
|
|
764 lda $0C,x
|
|
765 ora #$08
|
|
766 sta $0C,x
|
|
767 andcc #^IntMasks
|
|
768 ldx #$0001
|
|
769 os9 F$Sleep
|
|
770 rts
|
|
771 L05C3 pshs u
|
|
772 puls dp
|
|
773 leas $01,s
|
|
774 rts
|
|
775
|
|
776 L05CA fdb $0160,$0115,$001b,$01bb,$0004,$0004,$002a
|
|
777
|
|
778 * IRQ Service Routine
|
|
779 L05D7 fcb $5f
|
|
780 L05D8 pshs dp,b,cc
|
|
781 bsr L05C3
|
|
782 clr <u0027
|
|
783 ldy <u0001
|
|
784 ldb $02,y
|
|
785 bitb #$01
|
|
786 beq L05F4
|
|
787 tfr a,b
|
|
788 andb #$0E
|
|
789 bne L05F4
|
|
790 puls cc
|
|
791 orcc #Carry
|
|
792 puls pc,dp
|
|
793 L05F4 leax >L05CA,pcr
|
|
794 andb #$0E
|
|
795 abx
|
|
796 tfr pc,d
|
|
797 addd ,x
|
|
798 tfr d,pc
|
|
799 L0601 ldb $02,y
|
|
800 bitb #$01
|
|
801 beq L05F4
|
|
802 lda <u0005
|
|
803 beq L0616
|
|
804 clrb
|
|
805 stb <u0005
|
|
806 tfr d,x
|
|
807 lda $0C,x
|
|
808 anda #$F7
|
|
809 sta $0C,x
|
|
810 L0616 puls pc,dp,b,cc
|
|
811 ldx <u002C
|
|
812 lda $05,y
|
|
813 bmi L062B
|
|
814 ldb <u0029
|
|
815 L0620 bsr L0651
|
|
816 decb
|
|
817 bne L0620
|
|
818 bra L0629
|
|
819 ldx <u002C
|
|
820 L0629 lda $05,y
|
|
821 L062B bita #$1E
|
|
822 beq L0634
|
|
823 lbsr L07BF
|
|
824 bra L0629
|
|
825 L0634 bita #$01
|
|
826 beq L063C
|
|
827 L0638 bsr L0651
|
|
828 bra L0629
|
|
829 L063C tst <u0027
|
|
830 bne L064D
|
|
831 ldd <u0025
|
|
832 beq L064D
|
|
833 stb <u0027
|
|
834 os9 F$Send
|
|
835 clra
|
|
836 clrb
|
|
837 std <u0025
|
|
838 L064D stx <u002C
|
|
839 bra L0601
|
|
840 L0651 lda ,y
|
|
841 beq L0679
|
|
842 tst <u0022
|
|
843 bne L0679
|
|
844 cmpa <u000C
|
|
845 bne L0662
|
|
846 lda #$02
|
|
847 lbra L06FD
|
|
848 L0662 cmpa <u000B
|
|
849 bne L066B
|
|
850 lda #$03
|
|
851 lbra L06FD
|
|
852 L066B cmpa <u000F
|
|
853 beq L06E3
|
|
854 cmpa <u0010
|
|
855 beq L06F2
|
|
856 cmpa <u000D
|
|
857 lbeq L070A
|
|
858 L0679 pshs b
|
|
859 sta ,x+
|
|
860 cmpx <u0030
|
|
861 bne L0683
|
|
862 ldx <u0032
|
|
863 L0683 cmpx <u002E
|
|
864 bne L0697
|
|
865 ldb #$02
|
|
866 orb <u000E
|
|
867 stb <u000E
|
|
868 cmpx <u0032
|
|
869 bne L0693
|
|
870 ldx <u0030
|
|
871 L0693 leax -$01,x
|
|
872 bra L06A5
|
|
873 L0697 stx <u002C
|
|
874 ldd <u0034
|
|
875 addd #$0001
|
|
876 std <u0034
|
|
877 cmpd <u002A
|
|
878 beq L06A7
|
|
879 L06A5 puls pc,b
|
|
880 L06A7 ldb <u0028
|
|
881 bitb #$70
|
|
882 bne L06A5
|
|
883 lda <u001D
|
|
884 bita #$02
|
|
885 beq L06BF
|
|
886 orb #$20
|
|
887 stb <u0028
|
|
888 lda $04,y
|
|
889 anda #$FD
|
|
890 sta $04,y
|
|
891 bra L06A5
|
|
892 L06BF bita #$01
|
|
893 beq L06CF
|
|
894 orb #$10
|
|
895 stb <u0028
|
|
896 lda $04,y
|
|
897 anda #$FE
|
|
898 sta $04,y
|
|
899 bra L06A5
|
|
900 L06CF bita #$08
|
|
901 beq L06A5
|
|
902 orb #$40
|
|
903 stb <u0028
|
|
904 lda <u0010
|
|
905 beq L06A5
|
|
906 sta <u0043
|
|
907 ldb #$0F
|
|
908 stb $01,y
|
|
909 bra L06A5
|
|
910 L06E3 lda <u0028
|
|
911 anda #$FB
|
|
912 sta <u0028
|
|
913 tst <u0040
|
|
914 beq L06F1
|
|
915 lda #$0F
|
|
916 sta $01,y
|
|
917 L06F1 rts
|
|
918 L06F2 lda <u0028
|
|
919 ora #$04
|
|
920 sta <u0028
|
|
921 lda #$0D
|
|
922 sta $01,y
|
|
923 rts
|
|
924 L06FD pshs b
|
|
925 tfr a,b
|
|
926 lda <u0003
|
|
927 stb <u0027
|
|
928 os9 F$Send
|
|
929 puls pc,b
|
|
930 L070A ldu <u0009
|
|
931 beq L0711
|
|
932 sta <u0008,u
|
|
933 L0711 rts
|
|
934 ldx <u003A
|
|
935 lda <u0043
|
|
936 ble L071E
|
|
937 sta ,y
|
|
938 anda #$80
|
|
939 sta <u0043
|
|
940 L071E tst <u0040
|
|
941 beq L0757
|
|
942 ldb <u0028
|
|
943 bitb #$08
|
|
944 bne L0757
|
|
945 andb #$07
|
|
946 andb <u001D
|
|
947 bne L0757
|
|
948 ldb <u003B
|
|
949 negb
|
|
950 cmpb #$0F
|
|
951 bls L0737
|
|
952 ldb #$0F
|
|
953 L0737 cmpb <u0040
|
|
954 bls L073D
|
|
955 ldb <u0040
|
|
956 L073D pshs b
|
|
957 L073F lda ,x+
|
|
958 sta ,y
|
|
959 decb
|
|
960 bne L073F
|
|
961 cmpx <u003C
|
|
962 bcs L074C
|
|
963 ldx <u003E
|
|
964 L074C stx <u003A
|
|
965 ldb <u0040
|
|
966 subb ,s+
|
|
967 stb <u0040
|
|
968 L0754 lbra L0601
|
|
969 L0757 lda #$0D
|
|
970 sta $01,y
|
|
971 bra L0754
|
|
972 lda $06,y
|
|
973 tfr a,b
|
|
974 andb #$B0
|
|
975 stb <u0020
|
|
976 ldb <u0028
|
|
977 andb #$FC
|
|
978 bita #$10
|
|
979 bne L076F
|
|
980 orb #$02
|
|
981 L076F bita #$20
|
|
982 bne L0775
|
|
983 orb #$01
|
|
984 L0775 bita #$08
|
|
985 beq L07AF
|
|
986 bita #$80
|
|
987 bne L0799
|
|
988 lda <u001D
|
|
989 bita #$10
|
|
990 beq L0791
|
|
991 ldx <u0016
|
|
992 beq L0791
|
|
993 lda #$01
|
|
994 L0789 sta <$3F,x
|
|
995 ldx <$3D,x
|
|
996 bne L0789
|
|
997 L0791 lda #$20
|
|
998 ora <u000E
|
|
999 sta <u000E
|
|
1000 andb #$FB
|
|
1001 L0799 tst <u0027
|
|
1002 bne L07AF
|
|
1003 stb <u0028
|
|
1004 ldd <u0023
|
|
1005 tstb
|
|
1006 beq L07B1
|
|
1007 os9 F$Send
|
|
1008 stb <u0027
|
|
1009 clra
|
|
1010 clrb
|
|
1011 std <u0023
|
|
1012 bra L07B1
|
|
1013 L07AF stb <u0028
|
|
1014 L07B1 lda #$0F
|
|
1015 sta $01,y
|
|
1016 lbra L0601
|
|
1017 lda $05,y
|
|
1018 bsr L07BF
|
|
1019 lbra L0601
|
|
1020 L07BF pshs b
|
|
1021 clrb
|
|
1022 bita #$02
|
|
1023 beq L07C8
|
|
1024 orb #$04
|
|
1025 L07C8 bita #$04
|
|
1026 beq L07CE
|
|
1027 orb #$01
|
|
1028 L07CE bita #$08
|
|
1029 beq L07D4
|
|
1030 orb #$02
|
|
1031 L07D4 bita #$10
|
|
1032 bne L07DE
|
|
1033 orb #$08
|
|
1034 orb <u000E
|
|
1035 stb <u000E
|
|
1036 L07DE puls pc,b
|
|
1037
|
|
1038 * IRQ Flip/Mask/Priority Bytes
|
|
1039 L07E0 fcb $01,$01,$80
|
|
1040 L07E3 fcb $28
|
|
1041 fdb $e901,$010f,$0001,$0107,$8041,$0403
|
|
1042 fdb $c081,$0801,$e0c1,$0e00,$f0c1,$0e00,$78c1,$0e00
|
|
1043 fdb $3c81,$0800,$1e81,$0800,$1481,$0800,$0f81,$0800
|
|
1044 fdb $0a81,$0800,$0a81,$0800,$0a81,$0800,$0a81,$0800
|
|
1045 fdb $2581
|
|
1046 fcb $08
|
|
1047
|
|
1048 emod
|
|
1049 eom equ *
|
|
1050 end
|
|
1051
|