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