Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/aciapak.asm @ 1287:10957d54bf16
Made all modules rev 0
author | boisy |
---|---|
date | Sat, 30 Aug 2003 20:16:51 +0000 |
parents | 4e235f213651 |
children |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * ACIAPAK - RS-232 Pak driver | |
3 * | |
4 * $Id$ | |
5 * | |
1287 | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
0 | 8 * ------------------------------------------------------------------ |
1287 | 9 * 10 1985/??/?? |
10 * From Tandy OS-9 Level One VR 02.00.00 | |
0 | 11 |
12 nam ACIAPAK | |
13 ttl RS-232 Pak driver | |
14 | |
15 * Disassembled 98/08/23 20:25:56 by Disasm v1.6 (C) 1988 by RML | |
16 | |
1287 | 17 IFP1 |
0 | 18 use defsfile |
19 use scfdefs | |
1287 | 20 ENDC |
0 | 21 |
22 tylg set Drivr+Objct | |
23 atrv set ReEnt+rev | |
1287 | 24 rev set $00 |
201 | 25 edition set 10 |
0 | 26 |
27 mod eom,name,tylg,atrv,start,size | |
28 | |
29 rmb V.SCF SCF storage requirements | |
30 u001D rmb 1 | |
31 u001E rmb 1 | |
32 u001F rmb 1 | |
33 u0020 rmb 1 | |
34 u0021 rmb 1 | |
35 u0022 rmb 1 | |
36 u0023 rmb 1 | |
37 u0024 rmb 1 | |
38 u0025 rmb 2 | |
39 u0027 rmb 1 | |
40 u0028 rmb 1 | |
41 u0029 rmb 1 | |
42 u002A rmb 1 | |
43 u002B rmb 1 | |
44 orgDFIRQ rmb 2 | |
45 u002E rmb 2 | |
46 u0030 rmb 2 | |
47 u0032 rmb 25 | |
48 u004B rmb 34 | |
49 u006D rmb 17 | |
50 u007E rmb 2 | |
51 u0080 rmb 128 | |
52 size equ . | |
256 | 53 |
54 fcb UPDAT. | |
0 | 55 |
56 name fcs /ACIAPAK/ | |
256 | 57 fcb edition |
0 | 58 |
59 start lbra Init | |
60 lbra Read | |
61 lbra Write | |
62 lbra GetStat | |
63 lbra SetStat | |
64 lbra Term | |
65 | |
256 | 66 IRQPckt fcb $00,$80,$0A |
0 | 67 |
68 * Driver supplied D.FIRQ routine | |
69 FIRQRtn tst ,s | |
70 bmi L003B | |
71 leas -$01,s | |
72 pshs y,x,dp,b,a | |
73 lda $08,s | |
74 stu $07,s | |
75 ora #$80 | |
76 pshs a | |
77 L003B jmp [>D.SvcIRQ] | |
78 | |
79 * Init | |
80 * | |
81 * Entry: | |
82 * Y = address of device descriptor | |
83 * U = address of device memory area | |
84 * | |
85 * Exit: | |
86 * CC = carry set on error | |
87 * B = error code | |
88 * | |
89 Init ldx V.PORT,u | |
90 stb $01,x | |
91 ldd <IT.COL,y get column size | |
92 std <u002A,u | |
93 ldd <IT.PAR,y get parity/baud rate | |
94 lbsr L01CF | |
95 ldd V.PORT,u | |
96 addd #$0001 | |
97 leax >IRQPckt,pcr | |
98 leay >L024E,pcr | |
99 os9 F$IRQ | |
100 bcs L0085 | |
101 pshs cc | |
102 orcc #IntMasks | |
103 ldd <D.FIRQ get current D.FIRQ vector | |
104 std <orgDFIRQ,u save it off locally | |
105 leax >FIRQRtn,pcr get our D.FIRQ routine | |
106 stx <D.FIRQ and put it in system global vector | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
256
diff
changeset
|
107 lda >PIA1Base+3 |
0 | 108 anda #$FC |
109 ora #$01 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
256
diff
changeset
|
110 sta >PIA1Base+3 |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
256
diff
changeset
|
111 lda >PIA1Base+2 |
0 | 112 puls cc |
113 lda #$03 | |
114 sta >MPI.Slct | |
115 clrb | |
116 L0085 rts | |
117 | |
118 L0086 orcc #IntMasks | |
119 lda ,x | |
120 lda ,x | |
121 lda $01,x | |
122 ldb $01,x | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
256
diff
changeset
|
123 ldb >PIA1Base+2 |
0 | 124 ldb $01,x |
125 bmi L00FB | |
126 lda #$02 | |
127 sta <u0022,u | |
128 clra | |
129 andb #$60 | |
130 std <u0023,u | |
131 clrb | |
132 std <u001D,u | |
133 std <u0020,u | |
134 sta <u001F,u | |
135 std <u0025,u | |
136 andcc #^IntMasks | |
137 rts | |
138 | |
139 * Read | |
140 * | |
141 * Entry: | |
142 * Y = address of path descriptor | |
143 * U = address of device memory area | |
144 * | |
145 * Exit: | |
146 * A = character read | |
147 * CC = carry set on error | |
148 * B = error code | |
149 * | |
150 L00B2 bsr L00FF | |
151 Read lda <u0023,u | |
152 ble L00CC | |
153 ldb <u001F,u | |
154 cmpb #$0A | |
155 bhi L00CC | |
156 ldb V.XON,u | |
157 orb #$80 | |
158 stb <u0023,u | |
159 ldb #$05 | |
160 lbsr L037D | |
161 L00CC tst <u0025,u | |
162 bne L00FB | |
163 ldb <u001E,u | |
164 leax <u002E,u | |
165 orcc #IntMasks | |
166 cmpb <u001D,u | |
167 beq L00B2 | |
168 abx | |
169 lda ,x | |
170 dec <u001F,u | |
171 incb | |
172 cmpb #$4F | |
173 bls L00EA | |
174 clrb | |
175 L00EA stb <u001E,u | |
176 ldb V.ERR,u | |
177 beq L015E | |
178 stb <PD.ERR,y | |
179 clr V.ERR,u | |
180 comb | |
181 ldb #E$Read | |
182 bra L015F | |
183 L00FB comb | |
184 ldb #E$NotRdy | |
185 rts | |
186 L00FF pshs x,b,a | |
187 lda V.BUSY,u | |
188 sta V.WAKE,u | |
189 andcc #^IntMasks | |
190 ldx #$0000 | |
191 os9 F$Sleep | |
192 ldx <D.Proc | |
193 ldb <P$Signal,x | |
194 beq L0118 | |
256 | 195 cmpb #S$Intrpt |
0 | 196 bls L012E |
197 L0118 clra | |
198 lda P$State,x | |
199 bita #Condem | |
200 bne L012E | |
256 | 201 ldb #E$HangUp |
0 | 202 lda V.ERR,u |
203 bita #$20 | |
204 bne L0129 | |
205 puls pc,x,b,a | |
206 L0129 inc <PD.PST,y | |
207 clr V.ERR,u | |
208 L012E leas $06,s | |
209 coma | |
210 rts | |
211 | |
212 * Write | |
213 * | |
214 * Entry: | |
215 * A = character to write | |
216 * Y = address of path descriptor | |
217 * U = address of device memory area | |
218 * | |
219 * Exit: | |
220 * CC = carry set on error | |
221 * B = error code | |
222 * | |
223 L0132 bsr L00FF | |
224 Write leax <u007E,u | |
225 ldb <u0020,u | |
226 abx | |
227 sta ,x | |
228 incb | |
229 cmpb #$81 | |
230 bls L0143 | |
231 clrb | |
232 L0143 orcc #IntMasks | |
233 cmpb <u0021,u | |
234 beq L0132 | |
235 stb <u0020,u | |
236 lda <u0022,u | |
237 beq L015E | |
238 anda #$FD | |
239 sta <u0022,u | |
240 bne L015E | |
241 ldb #$05 | |
242 lbsr L037D | |
243 L015E clrb | |
244 L015F andcc #^IntMasks | |
245 rts | |
246 | |
247 * GetStat | |
248 * | |
249 * Entry: | |
250 * A = function code | |
251 * Y = address of path descriptor | |
252 * U = address of device memory area | |
253 * | |
254 * Exit: | |
255 * CC = carry set on error | |
256 * B = error code | |
257 * | |
258 GetStat ldx PD.RGS,y | |
259 cmpa #SS.Ready | |
260 bne L0171 | |
261 ldb <u001F,u | |
262 beq L00FB | |
263 stb R$B,x | |
264 L016F clrb | |
265 rts | |
266 L0171 cmpa #SS.EOF | |
267 beq L016F | |
268 cmpa #SS.ScSiz | |
269 beq L0184 | |
270 cmpa #SS.ComSt | |
271 bne L0191 | |
272 ldd <u0028,u | |
273 std R$Y,x | |
274 bra L016F | |
275 L0184 clra | |
276 ldb <u002A,u | |
277 std R$X,x | |
278 ldb <u002B,u | |
279 std R$Y,x | |
280 bra L016F | |
281 L0191 comb | |
282 ldb #E$UnkSvc | |
283 rts | |
284 | |
285 * SetStat | |
286 * | |
287 * Entry: | |
288 * A = function code | |
289 * Y = address of path descriptor | |
290 * U = address of device memory area | |
291 * | |
292 * Exit: | |
293 * CC = carry set on error | |
294 * B = error code | |
295 * | |
296 SetStat ldx PD.RGS,y | |
297 cmpa #SS.SSig | |
298 bne L01B2 | |
299 lda PD.CPR,y | |
300 ldb R$X+1,x | |
301 orcc #IntMasks | |
302 tst <u001F,u | |
303 bne L01AB | |
304 std <u0025,u | |
305 bra L015E | |
306 L01AB andcc #^IntMasks | |
307 os9 F$Send | |
308 clrb | |
309 rts | |
310 L01B2 cmpa #SS.Open | |
311 beq L01FA | |
312 cmpa #SS.Close | |
313 beq L020A | |
314 cmpa #SS.Relea | |
315 bne L01C9 | |
316 lda PD.CPR,y | |
317 cmpa <u0025,u | |
318 bne L016F | |
319 clr <u0025,u | |
320 rts | |
321 L01C9 cmpa #SS.ComSt | |
322 bne L0191 | |
323 ldd R$Y,x | |
324 L01CF std <u0028,u | |
325 andb #$E0 | |
326 pshs b | |
327 ldb <u0029,u | |
328 andb #$07 | |
329 leax <L01F2,pcr | |
330 ldb b,x | |
331 orb ,s+ | |
332 anda #$E0 | |
333 sta V.TYPE,u | |
334 ldx V.PORT,u | |
335 lda $02,x | |
336 anda #$1F | |
337 ora V.TYPE,u | |
338 std $02,x | |
339 bra L0227 | |
340 L01F2 fdb $1316,$1718,$1a1c,$1e1f | |
341 L01FA ldb #$09 | |
342 lda R$Y+1,x | |
343 cmpa #$01 | |
344 bne L0227 | |
345 orcc #IntMasks | |
346 lbsr L037D | |
347 lbra L0086 | |
348 L020A lda R$Y+1,x | |
349 bne L0227 | |
350 ldb #$0B | |
351 lda <u0028,u | |
352 bita #$10 | |
353 beq L0218 | |
354 L0217 clrb | |
355 L0218 pshs b | |
356 bsr L022C | |
357 bcs L0217 | |
358 puls b | |
359 orcc #IntMasks | |
360 lbsr L037D | |
361 andcc #^IntMasks | |
362 L0227 clrb | |
363 rts | |
364 | |
365 L0229 lbsr L00FF | |
366 L022C ldb <u0020,u | |
367 orcc #IntMasks | |
368 cmpb <u0021,u | |
369 bne L0229 | |
370 rts | |
371 | |
372 * Term | |
373 * | |
374 * Entry: | |
375 * U = address of device memory area | |
376 * | |
377 * Exit: | |
378 * CC = carry set on error | |
379 * B = error code | |
380 * | |
381 Term ldx <D.Proc | |
382 lda P$ID,x | |
383 sta V.BUSY,u | |
384 sta V.LPRC,u | |
385 bsr L0217 | |
386 ldd <orgDFIRQ,u get saved D.FIRQ vector | |
387 std <D.FIRQ and put it back in system global | |
388 ldx #$0000 | |
389 os9 F$IRQ deinstall IRQ svc routine | |
390 clrb | |
391 rts | |
392 | |
393 * ISR | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
256
diff
changeset
|
394 L024E ldb >PIA1Base+2 |
0 | 395 ldx V.PORT,u |
396 sta <u0027,u | |
397 tfr a,b | |
398 andb #$60 | |
399 cmpb <u0024,u | |
400 beq L0299 | |
401 tfr b,a | |
402 eorb <u0024,u | |
403 sta <u0024,u | |
404 lda <u0027,u | |
405 bitb #$20 | |
406 beq L028C | |
407 bita #$20 | |
408 beq L028C | |
409 lda <u0028,u | |
410 bita #$10 | |
411 beq L02EC | |
412 ldx <V.PDLHd,u | |
413 beq L0286 | |
256 | 414 L027E inc <PD.PST,x |
415 ldx <PD.PLP,x | |
0 | 416 bne L027E |
417 L0286 lda #$20 | |
418 bsr L02F6 | |
419 bra L02E1 | |
420 L028C bitb #$40 | |
421 beq L02EC | |
422 bita #$40 | |
423 lbne L03AF | |
424 lbra L039E | |
425 L0299 bita #$08 | |
426 bne L02FB | |
427 bita #$10 | |
428 beq L02EC | |
429 lda <u0023,u | |
430 bpl L02B6 | |
431 anda #$7F | |
432 sta ,x | |
433 eora V.XON,u | |
434 sta <u0023,u | |
435 lda <u0022,u | |
436 bne L02DC | |
437 bra L02EC | |
438 L02B6 leay <u007E,u | |
439 ldb <u0021,u | |
440 cmpb <u0020,u | |
441 beq L02D4 | |
442 clra | |
443 lda d,y | |
444 incb | |
445 cmpb #$81 | |
446 bls L02CA | |
447 clrb | |
448 L02CA stb <u0021,u | |
449 sta ,x | |
450 cmpb <u0020,u | |
451 bne L02E1 | |
452 L02D4 lda <u0022,u | |
453 ora #$02 | |
454 sta <u0022,u | |
455 L02DC ldb #$09 | |
456 lbsr L037F | |
457 L02E1 ldb #$01 | |
458 lda V.WAKE,u | |
459 L02E5 beq L02EC | |
460 clr V.WAKE,u | |
461 L02E9 os9 F$Send | |
462 L02EC ldx V.PORT,u | |
463 lda $01,x | |
464 lbmi L024E | |
465 clrb | |
466 rts | |
467 L02F6 ora V.ERR,u | |
468 sta V.ERR,u | |
469 rts | |
470 L02FB bita #$07 | |
471 beq L030F | |
472 tfr a,b | |
473 tst ,x | |
474 anda #$07 | |
475 bsr L02F6 | |
476 lda $02,x | |
477 sta $01,x | |
478 sta $02,x | |
479 bra L02EC | |
480 L030F lda ,x | |
481 beq L032A | |
482 cmpa V.INTR,u | |
483 beq L038D | |
484 cmpa V.QUIT,u | |
485 beq L0391 | |
486 cmpa V.PCHR,u | |
487 beq L0385 | |
488 cmpa V.XON,u | |
489 beq L039E | |
490 cmpa <V.XOFF,u | |
491 lbeq L03AF | |
492 L032A leax <u002E,u | |
493 ldb <u001D,u | |
494 abx | |
495 sta ,x | |
496 incb | |
497 cmpb #$4F | |
498 bls L0339 | |
499 clrb | |
500 L0339 cmpb <u001E,u | |
501 bne L0344 | |
502 lda #$04 | |
503 bsr L02F6 | |
504 bra L02E1 | |
505 L0344 stb <u001D,u | |
506 inc <u001F,u | |
507 tst <u0025,u | |
508 beq L0357 | |
509 ldd <u0025,u | |
510 clr <u0025,u | |
511 bra L02E9 | |
512 L0357 lda <V.XOFF,u | |
513 beq L02E1 | |
514 ldb <u001F,u | |
515 cmpb #$46 | |
516 lbcs L02E1 | |
517 ldb <u0023,u | |
518 lbne L02E1 | |
519 anda #$7F | |
520 sta <V.XOFF,u | |
521 ora #$80 | |
522 sta <u0023,u | |
523 ldb #$05 | |
524 bsr L037D | |
525 lbra L02E1 | |
526 L037D ldx V.PORT,u | |
527 L037F orb V.TYPE,u | |
528 stb $02,x | |
529 clrb | |
530 rts | |
531 L0385 ldx V.DEV2,u | |
532 beq L032A | |
256 | 533 sta V.PAUS,x |
0 | 534 bra L032A |
256 | 535 L038D ldb #S$Intrpt |
0 | 536 bra L0393 |
256 | 537 L0391 ldb #S$Abort |
0 | 538 L0393 pshs a |
539 lda V.LPRC,u | |
540 lbsr L02E5 | |
541 puls a | |
542 bra L032A | |
543 L039E lda <u0022,u | |
544 anda #$FE | |
545 sta <u0022,u | |
546 bne L03AC | |
547 ldb #$05 | |
548 bsr L037F | |
549 L03AC lbra L02EC | |
550 L03AF lda <u0022,u | |
551 bne L03B8 | |
552 ldb #$09 | |
553 bsr L037F | |
554 L03B8 ora #$01 | |
555 sta <u0022,u | |
556 bra L03AC | |
557 | |
558 emod | |
559 eom equ * | |
560 end | |
561 |