Mercurial > hg > Members > kono > nitros9-code
annotate level2/modules/sio.asm @ 615:9c923ba45566
Added proper baud delay rates for most, but not all baud rates
author | boisy |
---|---|
date | Wed, 27 Nov 2002 23:03:39 +0000 |
parents | b3bfa479f8d0 |
children | 5ed7f616e80b |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * SIO - CoCo 3 Serial driver | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
8 * 9 Original Tandy L2 distribution version | |
615
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
9 * 10 Added baud delay table for NitrOS-9 |
0 | 10 |
11 nam SIO | |
12 ttl CoCo 3 Serial driver | |
13 | |
14 * Disassembled 98/08/23 20:58:36 by Disasm v1.6 (C) 1988 by RML | |
15 | |
16 ifp1 | |
17 use defsfile | |
18 endc | |
19 | |
20 tylg set Drivr+Objct | |
21 atrv set ReEnt+rev | |
22 rev set $01 | |
23 edition set 9 | |
24 | |
25 mod eom,name,tylg,atrv,start,size | |
26 | |
27 u0000 rmb 29 | |
28 u001D rmb 1 | |
29 u001E rmb 1 | |
30 u001F rmb 1 | |
31 u0020 rmb 2 | |
32 u0022 rmb 2 | |
33 u0024 rmb 1 | |
34 u0025 rmb 1 | |
35 size equ . | |
36 fcb $03 | |
37 | |
38 name fcs /SIO/ | |
39 fcb edition | |
40 | |
615
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
41 * Baud Rate Delay Table |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
42 DelayTbl |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
43 IFEQ NitrOS9 |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
44 * OS-9 Level Two delay values (1.89MHz) |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
45 fdb $090C 110 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
46 fdb $034C 300 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
47 fdb $01A2 600 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
48 fdb $00CE 1200 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
49 fdb $0062 2400 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
50 fdb $002E 4800 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
51 fdb $0012 9600 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
52 fdb $0003 32000 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
53 ELSE |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
54 * NitrOS-9 Level Two delay values (1.89MHz) |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
55 fdb $090C 110 baud (Unchanged, unknown) |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
56 fdb $03D0 300 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
57 fdb $01A2 600 baud (Unchanged, unknown) |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
58 fdb $00F0 1200 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
59 fdb $0073 2400 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
60 fdb $0036 4800 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
61 fdb $0017 9600 baud |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
62 fdb $0003 32000 baud (Unchanged, unknown) |
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
63 ENDC |
0 | 64 |
65 start lbra Init | |
66 lbra Read | |
67 lbra Write | |
68 lbra GetStat | |
69 lbra SetStat | |
70 lbra Term | |
71 | |
72 * Init | |
73 * | |
74 * Entry: | |
75 * Y = address of device descriptor | |
76 * U = address of device memory area | |
77 * | |
78 * Exit: | |
79 * CC = carry set on error | |
80 * B = error code | |
81 * | |
82 Init pshs cc | |
83 orcc #IntMasks | |
84 ldx #PIA1Base | |
85 clr $01,x | |
86 ldd <IT.COL,y get col/row bytes | |
87 std <u0024,u | |
88 lda #$FE | |
89 sta ,x | |
90 lda #$36 | |
91 sta $01,x | |
92 lda ,x | |
93 ldd <IT.PAR,y get parity/baud | |
94 lbsr L0148 | |
95 puls cc | |
96 clrb | |
97 | |
98 * Term | |
99 * | |
100 * Entry: | |
101 * U = address of device memory area | |
102 * | |
103 * Exit: | |
104 * CC = carry set on error | |
105 * B = error code | |
106 * | |
107 Term rts | |
108 | |
109 * Read | |
110 * | |
111 * Entry: | |
112 * Y = address of path descriptor | |
113 * U = address of device memory area | |
114 * | |
115 * Exit: | |
116 * A = character read | |
117 * CC = carry set on error | |
118 * B = error code | |
119 * | |
120 Read bsr L00AC | |
121 bcs L00C8 | |
122 ldb #$08 | |
123 pshs b,cc | |
124 tst <u001E,u | |
125 beq L0066 | |
126 dec $01,s | |
127 L0066 bra L0077 | |
128 L0068 lda <PD.BAU,y | |
129 anda #$0F | |
130 cmpa #$07 | |
131 beq L0077 | |
132 ldx #$0001 | |
133 os9 F$Sleep | |
134 L0077 pshs y | |
135 ldy #$FFFF | |
136 L007D lda >PIA1Base+2 | |
137 leay -$01,y | |
138 beq L008B | |
139 lsra | |
140 bcs L007D | |
141 puls y | |
142 bra L0090 | |
143 L008B puls y | |
144 lsra | |
145 bcs L0068 | |
146 L0090 orcc #IntMasks | |
147 clra | |
148 bsr L00D5 | |
149 L0095 bsr L00CE | |
150 ldb >PIA1Base+2 | |
151 lsrb | |
152 rora | |
153 dec $01,s | |
154 bne L0095 | |
155 bsr L00D5 | |
156 tst <u001E,u | |
157 beq L00A8 | |
158 lsra | |
159 L00A8 puls b,cc | |
160 clrb | |
161 rts | |
162 L00AC pshs a | |
163 lda <PD.BAU,y | |
164 anda #$0F | |
165 cmpa #$08 | |
166 bcc L00C4 | |
167 lsla | |
615
9c923ba45566
Added proper baud delay rates for most, but not all baud rates
boisy
parents:
372
diff
changeset
|
168 leax >DelayTbl,pcr |
0 | 169 ldd a,x |
170 std <u0020,u | |
171 clrb | |
172 puls pc,a | |
173 L00C4 ldb #E$BMode | |
174 puls a | |
175 L00C8 orcc #Carry | |
176 rts | |
177 L00CB stb >PIA1Base | |
178 L00CE pshs b,a | |
179 ldd <u0020,u | |
180 bra L00DC | |
181 L00D5 pshs b,a | |
182 ldd <u0020,u | |
183 lsra | |
184 rorb | |
185 L00DC subd #$0001 | |
186 bne L00DC | |
187 puls pc,b,a | |
188 | |
189 * Write | |
190 * | |
191 * Entry: | |
192 * A = character to write | |
193 * Y = address of path descriptor | |
194 * U = address of device memory area | |
195 * | |
196 * Exit: | |
197 * CC = carry set on error | |
198 * B = error code | |
199 * | |
200 Write bsr L00AC | |
201 bcs L00C8 | |
202 ldb #$09 | |
203 pshs b,cc | |
204 orcc #IntMasks | |
205 tst <u001E,u | |
206 beq L00F4 | |
207 dec $01,s | |
208 L00F4 andcc #^Carry | |
209 L00F6 ldb #$02 | |
210 bcs L00FB | |
211 clrb | |
212 L00FB bsr L00CB | |
213 lsra | |
214 dec $01,s | |
215 bne L00F6 | |
216 ldb <u001D,u | |
217 beq L010B | |
218 andb #$FE | |
219 bsr L00CB | |
220 L010B ldb #$02 | |
221 bsr L00CB | |
222 tst <u001F,u | |
223 beq L0118 | |
224 ldb #$02 | |
225 bsr L00CB | |
226 L0118 puls pc,b,cc | |
227 | |
228 * GetStat | |
229 * | |
230 * Entry: | |
231 * A = function code | |
232 * Y = address of path descriptor | |
233 * U = address of device memory area | |
234 * | |
235 * Exit: | |
236 * CC = carry set on error | |
237 * B = error code | |
238 * | |
239 GetStat cmpa #SS.EOF | |
240 bne L0120 | |
241 L011E clrb | |
242 rts | |
243 L0120 ldx PD.RGS,y | |
244 cmpa #SS.ScSiz | |
245 beq L0131 | |
246 cmpa #SS.ComSt | |
247 bne L017E | |
248 ldd <u0022,u | |
249 std R$Y,x | |
250 bra L011E | |
251 L0131 ldx PD.RGS,y | |
252 clra | |
253 ldb <u0024,u | |
254 std R$X,x | |
255 ldb <u0025,u | |
256 std R$Y,x | |
257 bra L011E | |
258 | |
259 * SetStat | |
260 * | |
261 * Entry: | |
262 * A = function code | |
263 * Y = address of path descriptor | |
264 * U = address of device memory area | |
265 * | |
266 * Exit: | |
267 * CC = carry set on error | |
268 * B = error code | |
269 * | |
270 SetStat cmpa #SS.ComSt | |
271 bne L017E | |
272 ldx PD.RGS,y | |
273 ldd R$Y,x | |
274 L0148 std <u0022,u | |
275 clra | |
276 clrb | |
277 std <u001D,u | |
278 sta <u001F,u | |
279 ldd <u0022,u | |
280 tstb | |
281 bpl L015C | |
282 inc <u001F,u | |
283 L015C bitb #$40 | |
284 bne L017A | |
285 bitb #$20 | |
286 beq L0167 | |
287 inc <u001E,u | |
288 L0167 bita #$20 | |
289 beq L0179 | |
290 bita #$80 | |
291 beq L017A | |
292 inc <u001D,u | |
293 bita #$40 | |
294 bne L0179 | |
295 inc <u001D,u | |
296 L0179 rts | |
297 L017A comb | |
298 ldb #E$BMode | |
299 rts | |
300 L017E comb | |
301 ldb #E$UnkSvc | |
302 rts | |
303 | |
304 emod | |
305 eom equ * | |
306 end |