annotate level1/modules/sio.asm @ 1724:f389c6bca482

New clock2_*.asm files split from single clock2.asm for more source clarity
author boisy
date Fri, 20 Aug 2004 11:11:58 +0000
parents 763d9ccd8769
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1475
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
1 ********************************************************************
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
2 * SIO - CoCo Serial driver
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
3 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
4 * $Id$
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
5 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
7 * Comment
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
9 * 9 ????/??/?? ???
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
10 * Original Tandy L2 distribution version.
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
11 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
12 * 10 ????/??/?? ???
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
13 * Added baud delay table for NitrOS-9.
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
14 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
15 * 11 2003/12/15 Boisy G. Pitre
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
16 * Merged Level 1 and Level 2 sources for now.
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
17
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
18 nam SIO
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
19 ttl CoCo Serial driver
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
20
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
21 * Disassembled 98/08/23 20:58:36 by Disasm v1.6 (C) 1988 by RML
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
22
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
23 ifp1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
24 use defsfile
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
25 endc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
26
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
27 tylg set Drivr+Objct
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
28 atrv set ReEnt+rev
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
29 rev set $00
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
30 edition set 9
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
31
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
32 mod eom,name,tylg,atrv,start,size
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
33
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
34 fcb UPDAT.
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
35
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
36 name fcs /SIO/
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
37 fcb edition
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
38
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
39 IFGT Level-1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
40
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
41 u0000 rmb 29
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
42 u001D rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
43 u001E rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
44 u001F rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
45 u0020 rmb 2
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
46 u0022 rmb 2
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
47 u0024 rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
48 u0025 rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
49 size equ .
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
50
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
51 * Baud Rate Delay Table
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
52 DelayTbl
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
53 IFEQ H6309
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
54 * 6809 delay values (1.89MHz)
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
55 fdb $090C 110 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
56 fdb $034C 300 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
57 fdb $01A2 600 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
58 fdb $00CE 1200 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
59 fdb $0062 2400 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
60 fdb $002E 4800 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
61 fdb $0012 9600 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
62 fdb $0003 32000 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
63 ELSE
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
64 * 6309 native mode delay values (1.89MHz)
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
65 fdb $090C 110 baud (Unchanged, unknown)
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
66 fdb $03D0 300 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
67 fdb $01A2 600 baud (Unchanged, unknown)
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
68 fdb $00F0 1200 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
69 fdb $0073 2400 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
70 fdb $0036 4800 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
71 fdb $0017 9600 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
72 fdb $0003 32000 baud (Unchanged, unknown)
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
73 ENDC
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
74
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
75 start lbra Init
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
76 lbra Read
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
77 lbra Write
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
78 lbra GetStat
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
79 lbra SetStat
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
80 lbra Term
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
81
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
82 * Init
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
83 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
84 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
85 * Y = address of device descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
86 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
87 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
88 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
89 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
90 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
91 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
92 Init pshs cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
93 orcc #IntMasks
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
94 ldx #PIA1Base
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
95 clr $01,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
96 ldd <IT.COL,y get col/row bytes
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
97 std <u0024,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
98 lda #$FE
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
99 sta ,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
100 lda #$36
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
101 sta $01,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
102 lda ,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
103 ldd <IT.PAR,y get parity/baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
104 lbsr L0148
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
105 puls cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
106 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
107
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
108 * Term
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
109 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
110 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
111 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
112 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
113 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
114 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
115 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
116 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
117 Term rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
118
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
119 * Read
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
120 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
121 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
122 * Y = address of path descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
123 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
124 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
125 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
126 * A = character read
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
127 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
128 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
129 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
130 Read bsr L00AC
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
131 bcs L00C8
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
132 ldb #$08
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
133 pshs b,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
134 tst <u001E,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
135 beq L0066
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
136 dec $01,s
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
137 L0066 bra L0077
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
138 L0068 lda <PD.BAU,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
139 anda #$0F
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
140 cmpa #$07
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
141 beq L0077
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
142 ldx #$0001
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
143 os9 F$Sleep
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
144 L0077 pshs y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
145 ldy #$FFFF
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
146 L007D lda >PIA1Base+2
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
147 leay -$01,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
148 beq L008B
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
149 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
150 bcs L007D
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
151 puls y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
152 bra L0090
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
153 L008B puls y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
154 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
155 bcs L0068
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
156 L0090 orcc #IntMasks
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
157 clra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
158 bsr L00D5
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
159 L0095 bsr L00CE
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
160 ldb >PIA1Base+2
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
161 lsrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
162 rora
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
163 dec $01,s
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
164 bne L0095
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
165 bsr L00D5
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
166 tst <u001E,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
167 beq L00A8
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
168 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
169 L00A8 puls b,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
170 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
171 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
172 L00AC pshs a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
173 lda <PD.BAU,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
174 anda #$0F
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
175 cmpa #$08
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
176 bcc L00C4
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
177 lsla
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
178 leax >DelayTbl,pcr
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
179 ldd a,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
180 std <u0020,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
181 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
182 puls pc,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
183 L00C4 ldb #E$BMode
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
184 puls a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
185 L00C8 orcc #Carry
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
186 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
187 L00CB stb >PIA1Base
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
188 L00CE pshs b,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
189 ldd <u0020,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
190 bra L00DC
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
191 L00D5 pshs b,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
192 ldd <u0020,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
193 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
194 rorb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
195 L00DC subd #$0001
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
196 bne L00DC
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
197 puls pc,b,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
198
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
199 * Write
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
200 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
201 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
202 * A = character to write
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
203 * Y = address of path descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
204 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
205 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
206 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
207 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
208 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
209 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
210 Write bsr L00AC
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
211 bcs L00C8
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
212 ldb #$09
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
213 pshs b,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
214 orcc #IntMasks
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
215 tst <u001E,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
216 beq L00F4
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
217 dec $01,s
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
218 L00F4 andcc #^Carry
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
219 L00F6 ldb #$02
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
220 bcs L00FB
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
221 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
222 L00FB bsr L00CB
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
223 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
224 dec $01,s
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
225 bne L00F6
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
226 ldb <u001D,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
227 beq L010B
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
228 andb #$FE
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
229 bsr L00CB
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
230 L010B ldb #$02
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
231 bsr L00CB
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
232 tst <u001F,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
233 beq L0118
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
234 ldb #$02
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
235 bsr L00CB
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
236 L0118 puls pc,b,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
237
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
238 * GetStat
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
239 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
240 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
241 * A = function code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
242 * Y = address of path descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
243 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
244 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
245 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
246 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
247 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
248 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
249 GetStat cmpa #SS.EOF
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
250 bne L0120
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
251 L011E clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
252 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
253 L0120 ldx PD.RGS,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
254 cmpa #SS.ScSiz
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
255 beq L0131
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
256 cmpa #SS.ComSt
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
257 bne L017E
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
258 ldd <u0022,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
259 std R$Y,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
260 bra L011E
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
261 L0131 ldx PD.RGS,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
262 clra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
263 ldb <u0024,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
264 std R$X,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
265 ldb <u0025,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
266 std R$Y,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
267 bra L011E
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
268
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
269 * SetStat
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
270 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
271 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
272 * A = function code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
273 * Y = address of path descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
274 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
275 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
276 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
277 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
278 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
279 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
280 SetStat cmpa #SS.ComSt
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
281 bne L017E
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
282 ldx PD.RGS,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
283 ldd R$Y,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
284 L0148 std <u0022,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
285 clra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
286 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
287 std <u001D,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
288 sta <u001F,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
289 ldd <u0022,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
290 tstb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
291 bpl L015C
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
292 inc <u001F,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
293 L015C bitb #$40
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
294 bne L017A
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
295 bitb #$20
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
296 beq L0167
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
297 inc <u001E,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
298 L0167 bita #$20
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
299 beq L0179
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
300 bita #$80
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
301 beq L017A
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
302 inc <u001D,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
303 bita #$40
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
304 bne L0179
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
305 inc <u001D,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
306 L0179 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
307 L017A comb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
308 ldb #E$BMode
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
309 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
310 L017E comb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
311 ldb #E$UnkSvc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
312 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
313
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
314 ELSE
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
315
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
316 rmb V.SCF
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
317 u001D rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
318 u001E rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
319 u001F rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
320 BaudCnt rmb 2 baud rate counter
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
321 u0022 rmb 2
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
322 u0024 rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
323 u0025 rmb 1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
324 size equ .
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
325
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
326 BaudTbl fdb $0482 110 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
327 fdb $01A2 300 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
328 fdb $00CD 600 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
329 fdb $0063 1200 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
330 fdb $002D 2400 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
331 fdb $0013 4800 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
332 fdb $0005 9600 baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
333
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
334 start lbra Init
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
335 lbra Read
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
336 lbra Write
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
337 lbra GetStat
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
338 lbra SetStat
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
339 lbra Term
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
340
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
341 * Init
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
342 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
343 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
344 * Y = address of device descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
345 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
346 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
347 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
348 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
349 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
350 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
351 Init pshs cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
352 orcc #IntMasks
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
353 ldx #PIA1Base
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
354 clr $01,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
355 ldd <IT.COL,y get col/row bytes
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
356 std <u0024,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
357 lda #$FE
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
358 sta ,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
359 lda #$36
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
360 sta $01,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
361 lda ,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
362 ldd <IT.PAR,y get parity/baud
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
363 lbsr L014D
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
364 puls cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
365 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
366
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
367 * Term
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
368 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
369 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
370 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
371 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
372 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
373 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
374 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
375 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
376 Term rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
377
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
378 * Read
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
379 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
380 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
381 * Y = address of path descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
382 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
383 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
384 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
385 * A = character read
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
386 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
387 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
388 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
389 Read bsr L00B1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
390 bcs L00CD
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
391 ldb #$08
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
392 pshs b,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
393 tst <u001E,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
394 beq L0066
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
395 dec $01,s
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
396 L0066 bra L006E
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
397 L0068 ldx #$0001
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
398 os9 F$Sleep
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
399 L006E lda >PIA1Base+2
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
400 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
401 pshs x,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
402 lda >$FF69
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
403 bpl L0091
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
404 lda >PIA1Base+3
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
405 bita #$01
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
406 beq L0091
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
407 bita #$80
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
408 beq L0091
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
409 orcc #Entire
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
410 leax <L0091,pcr
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
411 pshs x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
412 pshs u,y,x,dp,b,a,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
413 jmp [D.SvcIRQ]
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
414 L0091 puls x,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
415 bcs L0068
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
416 orcc #IntMasks
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
417 clra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
418 bsr L00DA
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
419 L009A bsr L00D3
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
420 ldb >PIA1Base+2
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
421 lsrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
422 rora
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
423 dec $01,s
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
424 bne L009A
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
425 bsr L00DA
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
426 tst <u001E,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
427 beq L00AD
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
428 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
429 L00AD puls b,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
430 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
431 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
432 L00B1 pshs a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
433 lda <PD.BAU,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
434 anda #$0F mask out baud rate
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
435 cmpa #B19200
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
436 bcc L00C9
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
437 lsla
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
438 leax >BaudTbl,pcr
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
439 ldd a,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
440 std <BaudCnt,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
441 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
442 puls pc,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
443 L00C9 ldb #E$BMode
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
444 puls a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
445 L00CD orcc #Carry
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
446 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
447 L00D0 stb >PIA1Base
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
448 L00D3 pshs b,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
449 ldd <BaudCnt,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
450 bra L00E1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
451 L00DA pshs b,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
452 ldd <BaudCnt,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
453 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
454 rorb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
455 L00E1 subd #$0001
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
456 bne L00E1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
457 puls pc,b,a
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
458
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
459 * Write
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
460 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
461 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
462 * A = character to write
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
463 * Y = address of path descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
464 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
465 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
466 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
467 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
468 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
469 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
470 Write bsr L00B1
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
471 bcs L00CD
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
472 ldb #$09
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
473 pshs b,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
474 orcc #IntMasks
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
475 tst <u001E,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
476 beq L00F9
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
477 dec $01,s
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
478 L00F9 andcc #^Carry
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
479 L00FB ldb #$02
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
480 bcs L0100
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
481 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
482 L0100 bsr L00D0
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
483 lsra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
484 dec $01,s
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
485 bne L00FB
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
486 ldb <u001D,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
487 beq L0110
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
488 andb #$FE
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
489 bsr L00D0
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
490 L0110 ldb #$02
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
491 bsr L00D0
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
492 tst <u001F,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
493 beq L011D
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
494 ldb #$02
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
495 bsr L00D0
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
496 L011D puls pc,b,cc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
497
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
498 * GetStat
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
499 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
500 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
501 * A = function code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
502 * Y = address of path descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
503 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
504 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
505 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
506 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
507 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
508 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
509 GetStat cmpa #SS.EOF
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
510 bne L0125
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
511 L0123 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
512 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
513 L0125 ldx PD.RGS,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
514 cmpa #SS.ScSiz
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
515 beq L0136
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
516 cmpa #SS.ComSt
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
517 bne L0183
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
518 ldd <u0022,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
519 std R$Y,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
520 bra L0123
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
521 L0136 ldx PD.RGS,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
522 clra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
523 ldb <u0024,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
524 std R$X,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
525 ldb <u0025,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
526 std R$Y,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
527 bra L0123
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
528
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
529 * SetStat
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
530 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
531 * Entry:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
532 * A = function code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
533 * Y = address of path descriptor
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
534 * U = address of device memory area
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
535 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
536 * Exit:
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
537 * CC = carry set on error
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
538 * B = error code
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
539 *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
540 SetStat cmpa #SS.ComSt
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
541 bne L0183
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
542 ldx PD.RGS,y
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
543 ldd R$Y,x
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
544 L014D std <u0022,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
545 clra
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
546 clrb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
547 std <u001D,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
548 sta <u001F,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
549 ldd <u0022,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
550 tstb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
551 bpl L0161
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
552 inc <u001F,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
553 L0161 bitb #$40
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
554 bne L017F
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
555 bitb #$20
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
556 beq L016C
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
557 inc <u001E,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
558 L016C bita #$20
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
559 beq L017E
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
560 bita #$80
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
561 beq L017F
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
562 inc <u001D,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
563 bita #$40
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
564 bne L017E
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
565 inc <u001D,u
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
566 L017E rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
567 L017F comb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
568 ldb <E$BMode
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
569 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
570 L0183 comb
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
571 ldb #E$UnkSvc
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
572 rts
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
573
1526
cb587a441cae Fixed END in wrong place
boisy
parents: 1475
diff changeset
574 ENDC
cb587a441cae Fixed END in wrong place
boisy
parents: 1475
diff changeset
575
1475
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
576 emod
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
577 eom equ *
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
578 end
bc58ae73351e sio replaces rs232
boisy
parents:
diff changeset
579