241
|
1 ********************************************************************
|
257
|
2 * KBVDIO - keyboard/video driver
|
241
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
|
8 * - Original Dragon Data distribution version
|
|
9
|
|
10 nam KBVDIO
|
|
11 ttl os9 device driver
|
|
12
|
|
13 * Disassembled 02/04/21 22:37:57 by Disasm v1.6 (C) 1988 by RML
|
|
14
|
|
15 ifp1
|
|
16 use defsfile
|
|
17 endc
|
257
|
18
|
241
|
19 tylg set Drivr+Objct
|
|
20 atrv set ReEnt+rev
|
|
21 rev set $01
|
257
|
22 edition set 4
|
|
23
|
241
|
24 mod eom,name,tylg,atrv,start,size
|
257
|
25
|
241
|
26 u0000 rmb 2
|
|
27 u0002 rmb 1
|
|
28 u0003 rmb 1
|
|
29 u0004 rmb 1
|
|
30 u0005 rmb 4
|
|
31 u0009 rmb 2
|
|
32 u000B rmb 1
|
|
33 u000C rmb 1
|
|
34 u000D rmb 11
|
|
35 u0018 rmb 1
|
|
36 u0019 rmb 1
|
|
37 u001A rmb 1
|
|
38 u001B rmb 1
|
|
39 u001C rmb 1
|
|
40 u001D rmb 2
|
|
41 u001F rmb 2
|
|
42 u0021 rmb 1
|
|
43 u0022 rmb 1
|
|
44 u0023 rmb 1
|
|
45 u0024 rmb 1
|
|
46 u0025 rmb 1
|
|
47 u0026 rmb 2
|
|
48 u0028 rmb 1
|
|
49 u0029 rmb 2
|
|
50 u002B rmb 1
|
|
51 u002C rmb 1
|
|
52 u002D rmb 2
|
|
53 u002F rmb 1
|
|
54 u0030 rmb 1
|
|
55 u0031 rmb 2
|
|
56 u0033 rmb 1
|
|
57 u0034 rmb 1
|
|
58 u0035 rmb 1
|
|
59 u0036 rmb 1
|
|
60 u0037 rmb 1
|
|
61 u0038 rmb 1
|
|
62 u0039 rmb 1
|
|
63 u003A rmb 1
|
|
64 u003B rmb 2
|
|
65 u003D rmb 1
|
|
66 u003E rmb 1
|
|
67 u003F rmb 1
|
|
68 u0040 rmb 1
|
|
69 u0041 rmb 1
|
|
70 u0042 rmb 1
|
|
71 u0043 rmb 1
|
|
72 u0044 rmb 1
|
|
73 u0045 rmb 1
|
|
74 u0046 rmb 1
|
|
75 u0047 rmb 1
|
|
76 u0048 rmb 1
|
|
77 u0049 rmb 1
|
|
78 u004A rmb 1
|
|
79 u004B rmb 10
|
|
80 u0055 rmb 26
|
|
81 u006F rmb 91
|
|
82 size equ .
|
|
83 fcb $07
|
257
|
84
|
|
85 name fcs /KBVDIO/
|
|
86 fcb edition
|
242
|
87
|
257
|
88 start lbra Init
|
|
89 lbra Read
|
|
90 lbra Write
|
|
91 lbra GetStat
|
|
92 lbra SetStat
|
|
93 lbra Term
|
|
94
|
|
95 Init lbsr L02BA
|
241
|
96 lbra L002D
|
|
97 L002D pshs cc
|
|
98 orcc #$10
|
257
|
99 stu >D.KbdSta
|
|
100 ldd >D.IRQ
|
|
101 std >D.AltIRQ
|
241
|
102 leax >L00B0,pcr
|
257
|
103 stx >D.IRQ
|
241
|
104 ldx #$FF00
|
|
105 stx <u003B,u
|
|
106 clra
|
|
107 clrb
|
|
108 std <u0048,u
|
|
109 sta $01,x
|
|
110 sta ,x
|
|
111 sta $03,x
|
|
112 comb
|
|
113 stb <u003D,u
|
|
114 stb $02,x
|
|
115 stb <u003F,u
|
|
116 stb <u0040,u
|
|
117 stb <u0041,u
|
|
118 lda #$34
|
|
119 sta $01,x
|
|
120 lda #$3F
|
|
121 sta $03,x
|
|
122 lda $02,x
|
|
123 puls pc,cc
|
|
124 ldb #$F5
|
|
125 orcc #$01
|
|
126 rts
|
257
|
127 GetStat cmpa #$01
|
241
|
128 bne L0082
|
|
129 lda <u0049,u
|
|
130 suba <u0048,u
|
|
131 bne L00AE
|
|
132 ldb #$F6
|
|
133 bra L009A
|
|
134 L0082 cmpa #$06
|
|
135 beq L00AE
|
|
136 cmpa #$12
|
242
|
137 lbeq L04E0+4
|
241
|
138 cmpa #$13
|
|
139 lbeq L085F
|
|
140 cmpa #$1C
|
|
141 lbeq L04CD
|
257
|
142
|
|
143 SetStat ldb #E$UnkSvc
|
|
144 L009A orcc #Carry
|
241
|
145 rts
|
257
|
146
|
|
147 Term pshs cc
|
241
|
148 orcc #$10
|
257
|
149 ldx >D.AltIRQ
|
|
150 stx >D.IRQ
|
241
|
151 puls pc,cc
|
257
|
152
|
241
|
153 L00A9 incb
|
|
154 cmpb #$7F
|
|
155 bls L00AF
|
|
156 L00AE clrb
|
|
157 L00AF rts
|
257
|
158 L00B0 ldu >D.KbdSta
|
241
|
159 ldx <u003B,u
|
|
160 lda $03,x
|
|
161 bmi L00BE
|
257
|
162 jmp [>D.SvcIRQ]
|
241
|
163 L00BE lda $02,x
|
|
164 lda #$FF
|
|
165 sta $02,x
|
|
166 lda ,x
|
|
167 coma
|
|
168 anda #$03
|
|
169 bne L00D4
|
|
170 clr $02,x
|
|
171 lda ,x
|
|
172 coma
|
|
173 anda #$7F
|
|
174 bne L00F1
|
|
175 L00D4 clra
|
|
176 coma
|
|
177 sta <u003F,u
|
|
178 sta <u0040,u
|
|
179 sta <u0041,u
|
257
|
180 L00DF lda >D.DskTmr
|
241
|
181 beq L00ED
|
|
182 deca
|
257
|
183 sta >D.DskTmr
|
241
|
184 bne L00ED
|
|
185 sta >$FF48
|
257
|
186 L00ED jmp [>D.AltIRQ]
|
241
|
187 L00F1 bsr L013F
|
|
188 bmi L00DF
|
|
189 sta <u0047,u
|
|
190 cmpa #$1F
|
|
191 bne L0101
|
|
192 com <u003D,u
|
|
193 bra L00DF
|
|
194 L0101 ldb <u0048,u
|
|
195 leax <u004A,u
|
|
196 abx
|
|
197 bsr L00A9
|
|
198 cmpb <u0049,u
|
|
199 beq L0112
|
|
200 stb <u0048,u
|
|
201 L0112 sta ,x
|
|
202 beq L0132
|
|
203 cmpa u000D,u
|
|
204 bne L0122
|
|
205 ldx u0009,u
|
|
206 beq L0132
|
|
207 sta $08,x
|
|
208 bra L0132
|
|
209 L0122 ldb #$03
|
|
210 cmpa u000B,u
|
|
211 beq L012E
|
|
212 ldb #$02
|
|
213 cmpa u000C,u
|
|
214 bne L0132
|
|
215 L012E lda u0003,u
|
|
216 bra L0136
|
|
217 L0132 ldb #$01
|
|
218 lda u0005,u
|
|
219 L0136 beq L013B
|
|
220 os9 F$Send
|
|
221 L013B clr u0005,u
|
|
222 bra L00DF
|
|
223 L013F clra
|
|
224 sta <u003E,u
|
|
225 sta <u0045,u
|
|
226 sta <u0046,u
|
|
227 coma
|
|
228 sta <u0042,u
|
|
229 sta <u0043,u
|
|
230 sta <u0044,u
|
|
231 deca
|
|
232 sta $02,x
|
|
233 L0156 lda ,x
|
|
234 coma
|
|
235 anda #$7F
|
|
236 beq L0169
|
|
237 ldb #$FF
|
|
238 L015F incb
|
|
239 lsra
|
|
240 bcc L0165
|
|
241 bsr L01AF
|
|
242 L0165 cmpb #$06
|
|
243 bcs L015F
|
|
244 L0169 inc <u003E,u
|
|
245 orcc #$01
|
|
246 rol $02,x
|
|
247 bcs L0156
|
|
248 lbsr L01F8
|
|
249 bmi L01AE
|
|
250 suba #$1B
|
|
251 bcc L0191
|
|
252 adda #$1B
|
|
253 ldb <u0046,u
|
|
254 bne L0190
|
|
255 adda #$40
|
|
256 ldb <u0045,u
|
|
257 eorb <u003D,u
|
|
258 andb #$01
|
|
259 bne L0190
|
|
260 adda #$20
|
|
261 L0190 rts
|
|
262 L0191 ldb #$03
|
|
263 mul
|
|
264 lda <u0045,u
|
|
265 beq L019C
|
|
266 incb
|
|
267 bra L01A3
|
|
268 L019C lda <u0046,u
|
|
269 beq L01A3
|
|
270 addb #$02
|
|
271 L01A3 pshs x
|
|
272 leax >L023E,pcr
|
|
273 clra
|
|
274 lda d,x
|
|
275 puls x
|
|
276 L01AE rts
|
|
277 L01AF pshs b
|
|
278 cmpb #$06
|
|
279 beq L01BF
|
|
280 cmpb #$01
|
|
281 bhi L01BD
|
|
282 addb #$04
|
|
283 bra L01BF
|
|
284 L01BD subb #$02
|
|
285 L01BF lslb
|
|
286 lslb
|
|
287 lslb
|
|
288 addb <u003E,u
|
|
289 cmpb #$31
|
|
290 bne L01CE
|
|
291 inc <u0046,u
|
|
292 puls pc,b
|
|
293 L01CE cmpb #$37
|
|
294 bne L01D7
|
|
295 com <u0045,u
|
|
296 puls pc,b
|
|
297 L01D7 pshs x
|
|
298 leax <u0042,u
|
|
299 bsr L01E2
|
|
300 puls x
|
|
301 puls pc,b
|
|
302 L01E2 pshs a
|
|
303 lda ,x
|
|
304 bpl L01EC
|
|
305 stb ,x
|
|
306 puls pc,a
|
|
307 L01EC lda $01,x
|
|
308 bpl L01F4
|
|
309 stb $01,x
|
|
310 puls pc,a
|
|
311 L01F4 stb $02,x
|
|
312 puls pc,a
|
|
313 L01F8 pshs y,x,b
|
|
314 leax <u003F,u
|
|
315 ldb #$03
|
|
316 pshs b
|
|
317 L0201 leay <u0042,u
|
|
318 ldb #$03
|
|
319 lda ,x
|
|
320 bmi L021D
|
|
321 L020A cmpa ,y
|
|
322 bne L0214
|
|
323 clr ,y
|
|
324 com ,y
|
|
325 bra L021D
|
|
326 L0214 leay $01,y
|
|
327 decb
|
|
328 bne L020A
|
|
329 lda #$FF
|
|
330 sta ,x
|
|
331 L021D leax $01,x
|
|
332 dec ,s
|
|
333 bne L0201
|
|
334 leas $01,s
|
|
335 leax <u0042,u
|
|
336 lda #$03
|
|
337 L022A ldb ,x+
|
|
338 bpl L0235
|
|
339 deca
|
|
340 bne L022A
|
|
341 orcc #$08
|
|
342 puls pc,y,x,b
|
|
343 L0235 leax <u003F,u
|
|
344 bsr L01E2
|
|
345 tfr b,a
|
|
346 puls pc,y,x,b
|
|
347 L023E inc <u001C
|
|
348 sync
|
|
349 dec <u001A
|
|
350 nop
|
|
351 lsl <u0018
|
|
352 fcb $10
|
|
353 rol <u0019
|
|
354 fcb $11
|
|
355 bra L026C
|
242
|
356 bra L027D+1
|
241
|
357 leax -$01,x
|
|
358 leay $01,y
|
|
359 inc >$3222
|
|
360 neg <u0033
|
242
|
361 bls L02D6+1
|
241
|
362 pshs y,b
|
|
363 neg <u0035
|
|
364 bcs L025F
|
|
365 L025F pshu y,b,a
|
|
366 neg <u0037
|
242
|
367 beq L02C2+1
|
241
|
368 fcb $38 8
|
242
|
369 bvc L02C2+1
|
241
|
370 rts
|
242
|
371 bvs L02C7+1
|
241
|
372 abx
|
|
373 L026C bpl L026E
|
|
374 L026E rti
|
|
375 bmi L0271
|
|
376 L0271 bge L02AF
|
|
377 tim #$2D,>$3D5F
|
242
|
378 bgt L02B6+1
|
241
|
379 tst >$2F3F
|
|
380 incb
|
242
|
381 L027D tst <u000D
|
241
|
382 tst <u0000
|
|
383 neg <u0000
|
|
384 eim #$03,<u001B
|
257
|
385
|
|
386 Read leax <u004A,u
|
241
|
387 ldb <u0049,u
|
|
388 orcc #$10
|
|
389 cmpb <u0048,u
|
|
390 beq L029F
|
|
391 abx
|
|
392 lda ,x
|
|
393 lbsr L00A9
|
|
394 stb <u0049,u
|
|
395 andcc #$EE
|
|
396 rts
|
|
397 L029F lda u0004,u
|
|
398 sta u0005,u
|
|
399 andcc #$EF
|
|
400 ldx #$0000
|
|
401 os9 F$Sleep
|
|
402 clr u0005,u
|
|
403 ldx <u004B
|
|
404 L02AF ldb <$36,x
|
257
|
405 beq Read
|
241
|
406 cmpb #$04
|
257
|
407 L02B6 bcc Read
|
241
|
408 coma
|
|
409 rts
|
|
410 L02BA pshs y,x
|
|
411 clr <u0025,u
|
|
412 clr <u002C,u
|
242
|
413 L02C2 pshs u
|
241
|
414 ldd #$0300
|
242
|
415 L02C7 os9 F$SRqMem
|
241
|
416 tfr u,d
|
|
417 tfr u,x
|
|
418 bita #$01
|
|
419 beq L02D8
|
|
420 leax >$0100,x
|
242
|
421 L02D6 bra L02DC
|
241
|
422 L02D8 leau >$0200,u
|
|
423 L02DC ldd #$0100
|
|
424 os9 F$SRtMem
|
|
425 puls u
|
|
426 stx <u001D,u
|
|
427 clra
|
|
428 clrb
|
|
429 bsr L0303
|
|
430 stx <u0021,u
|
|
431 leax >$0200,x
|
|
432 stx <u001F,u
|
|
433 lbsr L0459
|
|
434 lda #$60
|
|
435 sta <u0023,u
|
|
436 sta <u002B,u
|
|
437 clrb
|
|
438 puls pc,y,x
|
|
439 L0303 pshs x,a
|
|
440 lda >$FF22
|
|
441 anda #$07
|
|
442 ora ,s+
|
|
443 sta >$FF22
|
|
444 tstb
|
|
445 bne L0320
|
|
446 stb >$FFC0
|
|
447 stb >$FFC2
|
|
448 stb >$FFC4
|
|
449 lda <u001D,u
|
|
450 bra L032C
|
|
451 L0320 stb >$FFC0
|
|
452 stb >$FFC3
|
|
453 stb >$FFC5
|
|
454 lda <u002D,u
|
|
455 L032C ldb #$07
|
|
456 ldx #$FFC6
|
|
457 lsra
|
|
458 L0332 lsra
|
|
459 bcs L033B
|
|
460 sta ,x+
|
|
461 leax $01,x
|
|
462 bra L033F
|
|
463 L033B leax $01,x
|
|
464 sta ,x+
|
|
465 L033F decb
|
|
466 bne L0332
|
|
467 clrb
|
|
468 puls pc,x
|
257
|
469 Write ldb <u0025,u
|
241
|
470 bne L0387
|
|
471 tsta
|
|
472 bmi L0371
|
|
473 cmpa #$1F
|
|
474 bls L03BC
|
|
475 cmpa #$7C
|
|
476 bne L0359
|
|
477 lda #$61
|
|
478 bra L0371
|
|
479 L0359 cmpa #$7E
|
|
480 bne L0361
|
|
481 lda #$6D
|
|
482 bra L0371
|
|
483 L0361 cmpa #$60
|
|
484 bcs L036B
|
|
485 suba #$20
|
|
486 ora #$40
|
|
487 bra L0371
|
|
488 L036B cmpa #$40
|
|
489 bcs L0371
|
|
490 suba #$40
|
|
491 L0371 ldx <u0021,u
|
|
492 eora #$40
|
|
493 sta ,x+
|
|
494 stx <u0021,u
|
|
495 cmpx <u001F,u
|
|
496 bcs L0382
|
|
497 bsr L039C
|
|
498 L0382 lbsr L0415
|
|
499 clrb
|
|
500 rts
|
|
501 L0387 cmpb #$01
|
|
502 beq L0394
|
|
503 clr <u0025,u
|
|
504 sta <u0029,u
|
|
505 jmp [<u0026,u]
|
|
506 L0394 sta <u0028,u
|
|
507 inc <u0025,u
|
|
508 clrb
|
|
509 rts
|
|
510 L039C ldx <u001D,u
|
|
511 leax <$20,x
|
|
512 L03A2 ldd ,x++
|
|
513 std <-$22,x
|
|
514 cmpx <u001F,u
|
|
515 bcs L03A2
|
|
516 leax <-$20,x
|
|
517 stx <u0021,u
|
|
518 lda #$20
|
|
519 ldb #$60
|
|
520 L03B6 stb ,x+
|
|
521 deca
|
|
522 bne L03B6
|
|
523 L03BB rts
|
|
524 L03BC cmpa #$1B
|
|
525 bcc L03BB
|
|
526 cmpa #$10
|
|
527 bcs L03CE
|
|
528 ldb <u002C,u
|
|
529 bne L03CE
|
|
530 ldb #$F6
|
|
531 orcc #$01
|
|
532 rts
|
|
533 L03CE leax <L03D6,pcr
|
|
534 lsla
|
|
535 ldd a,x
|
|
536 jmp d,x
|
|
537 L03D6 stu >$C400
|
|
538 cmpa <u0000
|
242
|
539 fcb $A5
|
|
540 fcb $00 bita $00,x
|
|
541 subb <$FF
|
241
|
542 andb #$FF
|
|
543 andb #$00
|
|
544 eim #$FF,>$C400
|
242
|
545 fcb $67 asr $00,x
|
|
546 fcb $00
|
|
547 fcb $E2 sbcb $00,x
|
|
548 fcb $00
|
241
|
549 fcb $4E N
|
|
550 stu >$C400
|
|
551 subd #$0036
|
242
|
552 neg <$00F2
|
241
|
553 oim #$4A,<u0002
|
|
554 bgt L03FB
|
|
555 rol <u0002
|
|
556 L03FB sex
|
|
557 aim #$4E,<u0002
|
|
558 rolb
|
|
559 aim #$72,<u0002
|
|
560 stu <u0002
|
|
561 orb <u0002
|
|
562 adca #$02
|
|
563 anda #$03
|
242
|
564 fcb $A8
|
|
565 L040C fcb $8D
|
|
566 fcb $64
|
|
567 fcb $1F
|
241
|
568 fcb $10
|
|
569 andb #$E0
|
|
570 stb <u0022,u
|
|
571 L0415 ldx <u0021,u
|
|
572 lda ,x
|
|
573 sta <u0023,u
|
|
574 lda #$20
|
|
575 sta ,x
|
|
576 andcc #$FE
|
|
577 rts
|
|
578 bsr L0472
|
|
579 leax <$20,x
|
|
580 cmpx <u001F,u
|
|
581 bcs L0438
|
|
582 leax <-$20,x
|
|
583 pshs x
|
|
584 lbsr L039C
|
|
585 puls x
|
|
586 L0438 stx <u0021,u
|
|
587 bra L0415
|
|
588 bsr L0472
|
|
589 cmpx <u001D,u
|
|
590 bls L0449
|
|
591 leax -$01,x
|
|
592 stx <u0021,u
|
|
593 L0449 bra L0415
|
|
594 bsr L0472
|
|
595 leax $01,x
|
|
596 cmpx <u001F,u
|
|
597 bcc L0457
|
|
598 stx <u0021,u
|
|
599 L0457 bra L0415
|
|
600 L0459 bsr L0467
|
|
601 lda #$60
|
|
602 L045D sta ,x+
|
|
603 cmpx <u001F,u
|
|
604 bcs L045D
|
|
605 lbra L0415
|
|
606 L0467 bsr L0472
|
|
607 ldx <u001D,u
|
|
608 stx <u0021,u
|
|
609 lbra L0415
|
|
610 L0472 ldx <u0021,u
|
|
611 lda <u0023,u
|
|
612 sta ,x
|
|
613 rts
|
|
614 leax <L0481,pcr
|
|
615 lbra L064B
|
|
616 L0481 bsr L0472
|
|
617 ldb <u0029,u
|
|
618 subb #$20
|
|
619 lda #$20
|
|
620 mul
|
|
621 addb <u0028,u
|
|
622 adca #$00
|
|
623 subd #$0020
|
|
624 addd <u001D,u
|
|
625 cmpd <u001F,u
|
|
626 bcc L04A3
|
|
627 std <u0021,u
|
|
628 lbsr L0415
|
|
629 clrb
|
|
630 L04A3 lbra L0415
|
|
631 lbsr L040C
|
|
632 ldb #$20
|
|
633 lda #$60
|
|
634 ldx <u0021,u
|
|
635 L04B0 sta ,x+
|
|
636 decb
|
|
637 bne L04B0
|
|
638 lbra L0415
|
|
639 bsr L0472
|
|
640 leax <-$20,x
|
|
641 cmpx <u001D,u
|
|
642 bcs L04C5
|
|
643 stx <u0021,u
|
|
644 L04C5 lbra L0415
|
|
645 clra
|
|
646 clrb
|
|
647 lbra L0303
|
|
648 L04CD ldx $06,y
|
|
649 ldd <u001D,u
|
|
650 std $04,x
|
|
651 ldd <u0021,u
|
|
652 std $06,x
|
|
653 ldb <u003D,u
|
|
654 stb $01,x
|
|
655 clrb
|
|
656 rts
|
|
657 L04E0 neg <u0055
|
242
|
658 fcb $AA ora [>$A6C8]
|
|
659 fcb $FF
|
|
660 fcb $A6
|
|
661 fcb $C8
|
241
|
662 bge L050E
|
242
|
663 eim #$C6,<$F6
|
241
|
664 orcc #$01
|
|
665 rts
|
|
666 ldd <u0034,u
|
|
667 lbsr L0684
|
|
668 tfr a,b
|
|
669 andb ,x
|
|
670 L04F8 bita #$01
|
|
671 bne L0507
|
|
672 lsra
|
|
673 lsrb
|
|
674 tst <u0024,u
|
|
675 bmi L04F8
|
|
676 lsra
|
|
677 lsrb
|
|
678 bra L04F8
|
|
679 L0507 pshs b
|
|
680 ldb <u003A,u
|
|
681 andb #$FC
|
|
682 L050E orb ,s+
|
|
683 ldx $06,y
|
|
684 stb $01,x
|
|
685 ldd <u0034,u
|
|
686 std $06,x
|
|
687 ldd <u002D,u
|
|
688 std $04,x
|
|
689 clrb
|
|
690 rts
|
|
691 leax <L0526,pcr
|
|
692 lbra L064B
|
|
693 L0526 ldb <u002C,u
|
|
694 bne L0566
|
|
695 pshs u
|
|
696 ldd #$1900
|
|
697 os9 F$SRqMem
|
|
698 tfr u,d
|
|
699 puls u
|
|
700 bcs L0585
|
|
701 tfr a,b
|
|
702 bita #$01
|
|
703 beq L0543
|
|
704 adda #$01
|
|
705 bra L0545
|
|
706 L0543 addb #$18
|
|
707 L0545 pshs u,a
|
|
708 tfr b,a
|
|
709 clrb
|
|
710 tfr d,u
|
|
711 ldd #$0100
|
|
712 os9 F$SRtMem
|
|
713 puls u,a
|
|
714 bcs L0585
|
|
715 clrb
|
|
716 std <u002D,u
|
|
717 addd #$1800
|
|
718 std <u002F,u
|
|
719 inc <u002C,u
|
|
720 lbsr L0624
|
|
721 L0566 lda <u0029,u
|
|
722 sta <u003A,u
|
|
723 anda #$03
|
|
724 leax >L04E0,pcr
|
|
725 lda a,x
|
|
726 sta <u0036,u
|
|
727 sta <u0037,u
|
|
728 lda <u0028,u
|
|
729 cmpa #$01
|
|
730 bls L0586
|
|
731 ldb #$CB
|
|
732 orcc #$01
|
|
733 L0585 rts
|
|
734 L0586 tsta
|
|
735 beq L05A6
|
|
736 ldd #$C003
|
|
737 std <u0038,u
|
|
738 lda #$01
|
|
739 sta <u0024,u
|
|
740 lda #$E0
|
|
741 ldb <u0029,u
|
|
742 andb #$08
|
|
743 beq L059F
|
|
744 lda #$F0
|
|
745 L059F ldb #$03
|
|
746 leax <L05D3,pcr
|
|
747 bra L05BE
|
|
748 L05A6 ldd #$8001
|
|
749 std <u0038,u
|
|
750 lda #$FF
|
|
751 sta <u0036,u
|
|
752 sta <u0037,u
|
|
753 sta <u0024,u
|
|
754 lda #$F0
|
|
755 ldb #$07
|
|
756 leax <L05D7,pcr
|
|
757 L05BE stb <u0033,u
|
|
758 stx <u0031,u
|
|
759 ldb <u0029,u
|
|
760 andb #$04
|
|
761 lslb
|
|
762 pshs b
|
|
763 ora ,s+
|
|
764 ldb #$01
|
|
765 lbra L0303
|
|
766 L05D3 subb #$30
|
|
767 inc <u0003
|
|
768 L05D7 suba #$40
|
|
769 bra L05EB
|
|
770 lsl <u0004
|
|
771 aim #$01,<u0030
|
|
772 cmpx #$0316
|
|
773 oim #$9C,<u006F
|
|
774 eorb #$28
|
|
775 lda <u0024,u
|
|
776 L05EB bmi L05F0
|
|
777 inc <u0028,u
|
|
778 L05F0 lbra L0566
|
|
779 pshs u
|
|
780 ldu <u002D,u
|
|
781 ldd #$1800
|
|
782 os9 F$SRtMem
|
|
783 puls u
|
|
784 clr <u002C,u
|
|
785 rts
|
|
786 leax <L060A,pcr
|
|
787 lbra L0781
|
|
788 L060A lda <u0029,u
|
|
789 tst <u0024,u
|
|
790 bpl L061A
|
|
791 ldb #$FF
|
|
792 anda #$01
|
|
793 beq L0624
|
|
794 bra L0625
|
|
795 L061A anda #$03
|
|
796 leax >L04E0,pcr
|
|
797 ldb a,x
|
|
798 bra L0625
|
|
799 L0624 clrb
|
|
800 L0625 ldx <u002D,u
|
|
801 L0628 stb ,x+
|
|
802 cmpx <u002F,u
|
|
803 bcs L0628
|
|
804 clra
|
|
805 clrb
|
|
806 std <u0034,u
|
|
807 rts
|
|
808 L0635 ldd <u0028,u
|
|
809 cmpb #$C0
|
|
810 bcs L063E
|
|
811 ldb #$BF
|
|
812 L063E tst <u0024,u
|
|
813 bmi L0644
|
|
814 lsra
|
|
815 L0644 std <u0028,u
|
|
816 rts
|
|
817 leax <L0653,pcr
|
|
818 L064B stx <u0026,u
|
|
819 inc <u0025,u
|
|
820 clrb
|
|
821 rts
|
|
822 L0653 bsr L0635
|
|
823 std <u0034,u
|
|
824 clrb
|
|
825 rts
|
|
826 clr <u0036,u
|
|
827 bra L065F
|
|
828 L065F leax <L0664,pcr
|
|
829 bra L064B
|
|
830 L0664 bsr L0635
|
|
831 std <u0034,u
|
|
832 bsr L0673
|
|
833 lda <u0037,u
|
|
834 sta <u0036,u
|
|
835 clrb
|
|
836 rts
|
|
837 L0673 bsr L0684
|
|
838 tfr a,b
|
|
839 comb
|
|
840 andb ,x
|
|
841 stb ,x
|
|
842 anda <u0036,u
|
|
843 ora ,x
|
|
844 sta ,x
|
|
845 rts
|
|
846 L0684 pshs y,b,a
|
|
847 ldb <u0024,u
|
|
848 bpl L068C
|
|
849 lsra
|
|
850 L068C lsra
|
|
851 lsra
|
|
852 pshs a
|
|
853 ldb #$BF
|
|
854 subb $02,s
|
|
855 lda #$20
|
|
856 mul
|
|
857 addb ,s+
|
|
858 adca #$00
|
|
859 ldy <u002D,u
|
|
860 leay d,y
|
|
861 lda ,s
|
|
862 sty ,s
|
|
863 anda <u0033,u
|
|
864 ldx <u0031,u
|
|
865 lda a,x
|
|
866 puls pc,y,x
|
|
867 clr <u0036,u
|
|
868 bra L06B5
|
|
869 L06B5 leax <L06BA,pcr
|
|
870 bra L064B
|
|
871 L06BA lbsr L0635
|
|
872 leas -$0E,s
|
|
873 std $0C,s
|
|
874 bsr L0684
|
|
875 stx $02,s
|
|
876 sta $01,s
|
|
877 ldd <u0034,u
|
|
878 bsr L0684
|
|
879 sta ,s
|
|
880 clra
|
|
881 clrb
|
|
882 std $04,s
|
|
883 lda #$BF
|
|
884 suba <u0035,u
|
|
885 sta <u0035,u
|
|
886 lda #$BF
|
|
887 suba <u0029,u
|
|
888 sta <u0029,u
|
|
889 lda #$FF
|
|
890 sta $06,s
|
|
891 clra
|
|
892 ldb <u0034,u
|
|
893 subb <u0028,u
|
|
894 sbca #$00
|
|
895 bpl L06F7
|
|
896 nega
|
|
897 negb
|
|
898 sbca #$00
|
|
899 neg $06,s
|
|
900 L06F7 std $08,s
|
|
901 bne L0700
|
|
902 ldd #$FFFF
|
|
903 std $04,s
|
|
904 L0700 lda #$E0
|
|
905 sta $07,s
|
|
906 clra
|
|
907 ldb <u0035,u
|
|
908 subb <u0029,u
|
|
909 sbca #$00
|
|
910 bpl L0715
|
|
911 nega
|
|
912 negb
|
|
913 sbca #$00
|
|
914 neg $07,s
|
|
915 L0715 std $0A,s
|
|
916 bra L0721
|
|
917 L0719 sta ,s
|
|
918 ldd $04,s
|
|
919 subd $0A,s
|
|
920 std $04,s
|
|
921 L0721 lda ,s
|
|
922 tfr a,b
|
|
923 anda <u0036,u
|
|
924 comb
|
|
925 andb ,x
|
|
926 pshs b
|
|
927 ora ,s+
|
|
928 sta ,x
|
|
929 cmpx $02,s
|
|
930 bne L073B
|
|
931 lda ,s
|
|
932 cmpa $01,s
|
|
933 beq L076F
|
|
934 L073B ldd $04,s
|
|
935 bpl L0749
|
|
936 addd $08,s
|
|
937 std $04,s
|
|
938 lda $07,s
|
|
939 leax a,x
|
|
940 bra L0721
|
|
941 L0749 lda ,s
|
|
942 ldb $06,s
|
|
943 bpl L075F
|
|
944 lsla
|
|
945 ldb <u0024,u
|
|
946 bmi L0756
|
|
947 lsla
|
|
948 L0756 bcc L0719
|
|
949 lda <u0039,u
|
|
950 leax -$01,x
|
|
951 bra L0719
|
|
952 L075F lsra
|
|
953 ldb <u0024,u
|
|
954 bmi L0766
|
|
955 lsra
|
|
956 L0766 bcc L0719
|
|
957 lda <u0038,u
|
|
958 leax $01,x
|
|
959 bra L0719
|
|
960 L076F ldd $0C,s
|
|
961 std <u0034,u
|
|
962 leas $0E,s
|
|
963 lda <u0037,u
|
|
964 sta <u0036,u
|
|
965 clrb
|
|
966 rts
|
|
967 leax <L0789,pcr
|
|
968 L0781 stx <u0026,u
|
|
969 com <u0025,u
|
|
970 clrb
|
|
971 rts
|
|
972 L0789 leas -$04,s
|
|
973 ldb <u0029,u
|
|
974 stb $01,s
|
|
975 clra
|
|
976 sta ,s
|
|
977 addb $01,s
|
|
978 adca #$00
|
|
979 nega
|
|
980 negb
|
|
981 sbca #$00
|
|
982 addd #$0003
|
|
983 std $02,s
|
|
984 L07A0 lda ,s
|
|
985 cmpa $01,s
|
|
986 bcc L07D2
|
|
987 ldb $01,s
|
|
988 bsr L07E0
|
|
989 clra
|
|
990 ldb $02,s
|
|
991 bpl L07BA
|
|
992 ldb ,s
|
|
993 lslb
|
|
994 rola
|
|
995 lslb
|
|
996 rola
|
|
997 addd #$0006
|
|
998 bra L07CA
|
|
999 L07BA dec $01,s
|
|
1000 clra
|
|
1001 ldb ,s
|
|
1002 subb $01,s
|
|
1003 sbca #$00
|
|
1004 lslb
|
|
1005 rola
|
|
1006 lslb
|
|
1007 rola
|
|
1008 addd #$000A
|
|
1009 L07CA addd $02,s
|
|
1010 std $02,s
|
|
1011 inc ,s
|
|
1012 bra L07A0
|
|
1013 L07D2 lda ,s
|
|
1014 cmpa $01,s
|
|
1015 bne L07DC
|
|
1016 ldb $01,s
|
|
1017 bsr L07E0
|
|
1018 L07DC leas $04,s
|
|
1019 clrb
|
|
1020 rts
|
|
1021 L07E0 leas -$08,s
|
|
1022 sta ,s
|
|
1023 clra
|
|
1024 std $02,s
|
|
1025 nega
|
|
1026 negb
|
|
1027 sbca #$00
|
|
1028 std $06,s
|
|
1029 ldb ,s
|
|
1030 clra
|
|
1031 std ,s
|
|
1032 nega
|
|
1033 negb
|
|
1034 sbca #$00
|
|
1035 std $04,s
|
|
1036 ldx $06,s
|
|
1037 bsr L0829
|
|
1038 ldd $04,s
|
|
1039 ldx $02,s
|
|
1040 bsr L0829
|
|
1041 ldd ,s
|
|
1042 ldx $02,s
|
|
1043 bsr L0829
|
|
1044 ldd ,s
|
|
1045 ldx $06,s
|
|
1046 bsr L0829
|
|
1047 ldd $02,s
|
|
1048 ldx ,s
|
|
1049 bsr L0829
|
|
1050 ldd $02,s
|
|
1051 ldx $04,s
|
|
1052 bsr L0829
|
|
1053 ldd $06,s
|
|
1054 ldx $04,s
|
|
1055 bsr L0829
|
|
1056 ldd $06,s
|
|
1057 ldx ,s
|
|
1058 bsr L0829
|
|
1059 leas $08,s
|
|
1060 rts
|
|
1061 L0829 pshs b,a
|
|
1062 ldb <u0035,u
|
|
1063 clra
|
|
1064 leax d,x
|
|
1065 cmpx #$0000
|
|
1066 bmi L083B
|
|
1067 cmpx #$00BF
|
|
1068 ble L083D
|
|
1069 L083B puls pc,b,a
|
|
1070 L083D ldb <u0034,u
|
|
1071 clra
|
|
1072 tst <u0024,u
|
|
1073 bmi L0848
|
|
1074 lslb
|
|
1075 rola
|
|
1076 L0848 addd ,s++
|
|
1077 tsta
|
|
1078 beq L084E
|
|
1079 rts
|
|
1080 L084E pshs b
|
|
1081 tfr x,d
|
|
1082 puls a
|
|
1083 tst <u0024,u
|
|
1084 lbmi L0673
|
|
1085 lsra
|
|
1086 lbra L0673
|
|
1087 L085F ldx $06,y
|
|
1088 pshs y,cc
|
|
1089 orcc #$10
|
|
1090 lda #$FF
|
|
1091 clr >$FF02
|
|
1092 ldb >$FF00
|
|
1093 ldy $04,x
|
|
1094 bne L0878
|
|
1095 andb #$01
|
|
1096 bne L087C
|
|
1097 bra L087D
|
|
1098 L0878 andb #$02
|
|
1099 beq L087D
|
|
1100 L087C clra
|
|
1101 L087D sta $01,x
|
|
1102 lda >$FF03
|
|
1103 ora #$08
|
|
1104 ldy $04,x
|
|
1105 bne L088B
|
|
1106 anda #$F7
|
|
1107 L088B sta >$FF03
|
|
1108 lda >$FF01
|
|
1109 anda #$F7
|
|
1110 bsr L08AA
|
|
1111 std $04,x
|
|
1112 lda >$FF01
|
|
1113 ora #$08
|
|
1114 bsr L08AA
|
|
1115 pshs b,a
|
|
1116 ldd #$003F
|
|
1117 subd ,s++
|
|
1118 std $06,x
|
|
1119 clrb
|
|
1120 puls pc,y,cc
|
|
1121 L08AA sta >$FF01
|
|
1122 clrb
|
|
1123 bsr L08BA
|
|
1124 bsr L08BA
|
|
1125 bsr L08BA
|
|
1126 bsr L08BA
|
|
1127 lsrb
|
|
1128 lsrb
|
|
1129 clra
|
|
1130 rts
|
|
1131 L08BA pshs b
|
|
1132 lda #$7F
|
|
1133 tfr a,b
|
|
1134 L08C0 lsrb
|
|
1135 cmpb #$03
|
|
1136 bhi L08CC
|
|
1137 lsra
|
|
1138 lsra
|
|
1139 tfr a,b
|
|
1140 addb ,s+
|
|
1141 rts
|
|
1142 L08CC addb #$02
|
|
1143 andb #$FC
|
|
1144 pshs b
|
|
1145 anda #$FC
|
|
1146 sta >$FF20
|
|
1147 tst >$FF00
|
|
1148 bpl L08E0
|
|
1149 adda ,s+
|
|
1150 bra L08C0
|
|
1151 L08E0 suba ,s+
|
|
1152 bra L08C0
|
257
|
1153
|
241
|
1154 emod
|
|
1155 eom equ *
|
257
|
1156 end
|
|
1157
|