Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/tuneport.asm @ 860:35aca42e87ce
Added better comments
author | boisy |
---|---|
date | Thu, 16 Jan 2003 03:06:50 +0000 |
parents | e9ce43cc215e |
children | c155aac72190 |
rev | line source |
---|---|
97 | 1 ******************************************************************** |
2 * TunePort - Tune Printer Port | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
163
diff
changeset
|
8 * 3 From Tandy OS-9 Level One VR 02.00.00 |
97 | 9 |
10 nam TunePort | |
11 ttl Tune Printer Port | |
12 | |
13 * Disassembled 02/07/05 21:58:02 by Disasm v1.6 (C) 1988 by RML | |
14 | |
15 ifp1 | |
16 use os9defs | |
17 use scfdefs | |
18 endc | |
19 | |
20 tylg set Prgrm+Objct | |
21 atrv set ReEnt+rev | |
22 rev set $01 | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
163
diff
changeset
|
23 edition set 3 |
97 | 24 |
25 mod eom,name,tylg,atrv,start,size | |
26 u0000 rmb 1 | |
27 u0001 rmb 1 | |
28 u0002 rmb 1 | |
29 u0003 rmb 2 | |
30 u0005 rmb 2 | |
31 u0007 rmb 2 | |
32 u0009 rmb 1 | |
33 u000A rmb 1 | |
34 u000B rmb 2 | |
35 u000D rmb 2 | |
36 u000F rmb 2 | |
37 u0011 rmb 1 | |
38 u0012 rmb 1 | |
39 u0013 rmb 3 | |
40 size equ . | |
41 | |
42 name fcs /TunePort/ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
163
diff
changeset
|
43 fcb edition |
97 | 44 |
45 AdjPmpt fcb C$CR | |
46 fcb C$LF | |
47 fcc " TO ADJUST YOUR PORT ENTER A" | |
48 fcb C$CR | |
49 fcb C$LF | |
50 fcc "NEW VALUE FOR THE LOOP DELAY" | |
51 fcb C$CR | |
52 fcb C$LF | |
53 fcc "AFTER THE PROMPT AND CURRENT" | |
54 fcb C$CR | |
55 fcb C$LF | |
56 fcc "VALUE ARE GIVEN. HIT [ENTER]" | |
57 fcb C$CR | |
58 fcb C$LF | |
59 fcc "TO END." | |
60 fcb C$CR | |
61 fcb C$LF | |
62 PmptLen equ *-AdjPmpt | |
63 | |
64 DoneMsg fcb C$LF | |
65 fcb C$CR | |
66 fcb $20 | |
67 fcc "YOUR PORT IS NOW ADJUSTED FOR" | |
68 fcb C$CR | |
69 fcb C$LF | |
70 fcc "THE CURRENT BAUD RATE AND THE" | |
71 fcb C$CR | |
72 fcb C$LF | |
73 fcc "CRC OF THE MODULE HAS BEEN UP-" | |
74 fcb C$CR | |
75 fcb C$LF | |
76 fcc "DATED. TO MAKE THE CHANGE" | |
77 fcb C$CR | |
78 fcb C$LF | |
79 fcc "PERMANENT IN THE BOOT USE THE" | |
80 fcb C$CR | |
81 fcb C$LF | |
82 fcc "COBBLER OR OS9GEN UTILITIES" | |
83 fcb C$CR | |
84 fcb C$LF | |
85 fcc "OR THE -S OPTION OF TUNEPORT" | |
86 fcb C$CR | |
87 fcc "AT SYSTEM STARTUP" | |
88 fcb C$CR | |
89 DoneLen equ *-DoneMsg | |
90 | |
91 HelpMsg fcc "USE:TUNEPORT </P OR /T1> [-OPT]" | |
92 fcb C$CR | |
93 fcb C$LF | |
94 fcc " ADJUST BAUD RATE DELAY ON" | |
95 fcb C$CR | |
96 fcb C$LF | |
97 fcc " SERIAL PORTS." | |
98 fcb C$CR | |
99 fcb C$LF | |
100 fcc "Opt: -S=VALUE TO SET LOOP DELAY" | |
101 fcb C$CR | |
102 fcb C$LF | |
103 fcc " FOR CURRENT BAUD VALUE" | |
104 fcb C$CR | |
105 HelpLen equ *-HelpMsg | |
106 | |
107 ErrMsg fcc "TUNEPORT: CURRENT BAUD RATE" | |
108 fcb C$CR | |
109 fcb C$LF | |
110 fcc "IS OUT OF RANGE" | |
111 fcb C$CR | |
112 ErrLen equ *-ErrMsg | |
113 L0241 fcb C$BELL | |
114 | |
115 TestNow fcb C$CR | |
116 fcc "NOW TESTING ....." | |
117 TestLen equ *-TestNow | |
118 | |
119 NewVMsg fcb C$CR | |
120 fcc "NEW VALUE = " | |
121 NewVLen equ *-NewVMsg | |
122 | |
123 CurVMsg fcb C$LF | |
124 fcb C$CR | |
125 fcb C$LF | |
126 fcc "CURRENT VALUE = " | |
127 CurVLen equ *-CurVMsg | |
128 | |
129 TestMsg fcc " This is a test line for the TunePort utility" | |
130 fcb C$CR | |
131 TMsgLen equ *-TestMsg | |
132 | |
133 start stu <u0003 | |
134 clr <u0002 | |
135 lbsr L0455 | |
136 stx <u0009 | |
137 cmpb #C$CR | |
138 lbeq L03FB | |
139 cmpb #'/ | |
140 lbne L03FB | |
141 lda #Devic+Objct | |
142 leax $01,x | |
143 os9 F$Link | |
144 lbcs L03E6 | |
145 stu <u000B | |
146 lda <u0012,u | |
147 ldu <u0003 | |
148 cmpa #$00 | |
149 lbne L03FB | |
150 ldy <u000B | |
151 leax <IT.BAU,y | |
152 lda ,x | |
153 anda #$0F | |
154 cmpa #$06 | |
155 lbgt L03E9 | |
156 sta <u0000 | |
157 leax M$PDev,y | |
158 ldd ,x | |
159 leax d,y | |
160 leay <$19,u | |
161 L02EA lda ,x+ | |
162 bmi L02F2 | |
163 sta ,y+ | |
164 bra L02EA | |
165 L02F2 anda #$7F | |
166 sta ,y+ | |
167 lda #C$CR | |
168 sta ,y+ | |
169 ldu <u000B | |
170 os9 F$UnLink | |
171 lbcs L03E6 | |
172 ldu <u0003 | |
173 ldx <u0009 | |
174 lda #WRITE. | |
175 os9 I$Open | |
176 lbcs L03E6 | |
177 sta <u0001 | |
178 lbsr L0455 | |
179 cmpb #C$CR | |
180 beq L031D | |
181 inc <u0002 | |
182 stx <u0009 | |
183 L031D lda #Drivr+Objct | |
184 leax <$19,u | |
185 os9 F$Link | |
186 lbcs L03DE | |
187 stu <u000B | |
188 sty <u000D | |
189 ldu <u0003 | |
190 tst <u0002 | |
191 bne L0345 | |
192 lda #$01 | |
193 leax >AdjPmpt,pcr | |
194 ldy #PmptLen | |
195 os9 I$Write | |
196 lbcs L03D7 | |
197 L0345 ldd <u000D | |
198 subd #$000E | |
199 tfr d,x | |
200 lda <u0000 | |
201 lsla | |
202 leax a,x | |
203 stx <u000F | |
204 tst <u0002 | |
205 bne L035D | |
206 lbsr L045E | |
207 lbsr L040D | |
208 L035D tst <u0002 | |
209 beq L038E | |
210 ldx <u0009 | |
211 ldb ,x | |
212 cmpb #'- | |
213 lbne L03FB | |
214 leax $01,x | |
215 ldb ,x+ | |
216 cmpb #'S | |
217 beq L037A | |
163 | 218 cmpb #'s |
97 | 219 beq L037A |
220 lbra L03FB | |
221 L037A ldb ,x+ | |
163 | 222 cmpb #'= |
97 | 223 bne L03FB |
224 stx <u0009 | |
225 lbsr L04F1 | |
226 ldd <u0005 | |
227 ldx <u000F | |
228 std ,x | |
229 clrb | |
230 bra L03D7 | |
231 L038E lbsr L0432 | |
232 lbsr L04DC | |
233 bcc L039D | |
234 lbsr L0444 | |
235 andcc #^Carry | |
236 bra L038E | |
237 L039D ldd <u0005 | |
238 beq L03A9 | |
239 ldx <u000F | |
240 std ,x | |
241 bsr L040D | |
242 bra L038E | |
243 L03A9 ldx <u000B | |
244 ldd $02,x | |
245 subd #$0003 | |
246 tfr d,y | |
247 leau d,x | |
248 ldd #$FFFF | |
249 std u0001,u | |
250 sta ,u | |
251 os9 F$CRC | |
252 com ,u | |
253 com u0001,u | |
254 com u0002,u | |
255 ldu <u0003 | |
256 clra | |
257 leax >DoneMsg,pcr | |
258 ldy #DoneLen | |
259 os9 I$Write | |
260 bcs L03E6 | |
261 lbsr L045E | |
262 L03D7 ldu <u000B | |
263 os9 F$UnLink | |
264 bcs L03E6 | |
265 L03DE lda <u0001 | |
266 os9 I$Close | |
267 bcs L03E6 | |
268 clrb | |
269 L03E6 os9 F$Exit | |
270 L03E9 lda #$02 | |
271 leax >ErrMsg,pcr | |
272 ldy #ErrLen | |
273 os9 I$Write | |
274 bcs L03E6 | |
275 clrb | |
276 bra L03E6 | |
277 L03FB lda #$02 | |
278 leax >HelpMsg,pcr | |
279 ldy #HelpLen | |
280 os9 I$Write | |
281 bcs L03E6 | |
282 clrb | |
283 bra L03E6 | |
284 L040D lda #$01 | |
285 leax >TestNow,pcr | |
286 ldy #TestLen | |
287 os9 I$Write | |
288 bcs L03E6 | |
289 lda <u0001 | |
290 leax >TestMsg,pcr | |
291 ldy #TMsgLen | |
292 os9 I$WritLn | |
293 bcs L03E6 | |
294 ldx #$000A | |
295 os9 F$Sleep | |
296 rts | |
297 L0432 bsr L045E | |
298 lda #$01 | |
299 leax >NewVMsg,pcr | |
300 ldy #NewVLen | |
301 os9 I$Write | |
302 bcs L03E6 | |
303 rts | |
304 L0444 pshs y,x,b,a | |
305 lda #$02 | |
306 leax >L0241,pcr | |
307 ldy #$0001 | |
308 os9 I$Write | |
309 puls pc,y,x,b,a | |
310 L0455 ldb ,x+ | |
311 cmpb #C$SPAC | |
312 beq L0455 | |
313 leax -$01,x | |
314 rts | |
315 L045E pshs y,x,b,a | |
316 lda #$01 | |
317 leax >CurVMsg,pcr | |
318 ldy #CurVLen | |
319 os9 I$Write | |
320 lbcs L03E6 | |
321 ldx <u000F | |
322 ldd ,x | |
323 std <u0005 | |
324 leay >L04D0,pcr | |
325 leax <u0013,u | |
326 stx <u0011 | |
327 L0480 ldd ,y | |
328 beq L04BC | |
329 ldd <u0005 | |
330 pshs b,a | |
331 ldd ,y++ | |
332 lbsr L053F | |
333 cmpb #$00 | |
334 bne L0498 | |
335 leax <u0013,u | |
336 cmpx <u0011 | |
337 beq L0480 | |
338 L0498 std <u0007 | |
339 addb #$30 | |
340 ldx <u0011 | |
341 stb ,x+ | |
342 stx <u0011 | |
343 ldx <u0007 | |
344 leax -$01,x | |
345 leay -$02,y | |
346 ldd ,y++ | |
347 std <u0007 | |
348 L04AC addd <u0007 | |
349 leax -$01,x | |
350 bne L04AC | |
351 std <u0007 | |
352 ldd <u0005 | |
353 subd <u0007 | |
354 std <u0005 | |
355 bra L0480 | |
356 L04BC ldx <u0011 | |
357 lda #$0D | |
358 sta ,x | |
359 leax <u0013,u | |
360 lda #$01 | |
361 ldy #$0006 | |
362 os9 I$WritLn | |
363 puls pc,y,x,b,a | |
364 L04D0 fcb $27,$10,$03,$e8,$00,$64,$00,$0a,$00,$01,$00,$00 | |
365 L04DC pshs y,x,b,a | |
366 clra | |
367 leax <u0013,u | |
368 L04E2 ldy #$0006 | |
369 os9 I$ReadLn | |
370 lbcs L03E6 | |
371 bsr L0504 | |
372 puls pc,y,x,b,a | |
373 L04F1 pshs y,x,b,a | |
374 ldx <u0009 | |
375 leay <u0013,u | |
376 L04F8 lda ,x+ | |
377 sta ,y+ | |
378 cmpa #C$CR | |
379 bne L04F8 | |
380 bsr L0504 | |
381 puls pc,y,x,b,a | |
382 L0504 pshs y,x,b,a | |
383 clra | |
384 clrb | |
385 std <u0005 | |
386 leay <u0013,u | |
387 L050D ldb ,y+ | |
388 cmpb #'0 | |
389 blt L0537 | |
390 cmpb #'9 | |
391 bgt L0537 | |
392 pshs b | |
393 ldx #$0009 | |
394 ldd <u0005 | |
395 std <u0007 | |
396 L0520 addd <u0007 | |
397 leax -$01,x | |
398 bne L0520 | |
399 std <u0005 | |
400 puls b | |
401 subb #'0 | |
402 clra | |
403 std <u0007 | |
404 ldd <u0005 | |
405 addd <u0007 | |
406 std <u0005 | |
407 bra L050D | |
408 L0537 cmpb #C$CR | |
409 beq L053D | |
410 orcc #Carry | |
411 L053D puls pc,y,x,b,a | |
412 L053F pshs b,a | |
413 leas -$02,s | |
414 clr ,s | |
415 clr $01,s | |
416 lda #$01 | |
417 L0549 inca | |
418 lsl $03,s | |
419 rol $02,s | |
420 bpl L0549 | |
421 sta ,s | |
422 ldd $06,s | |
423 clr $06,s | |
424 clr $07,s | |
425 L0558 subd $02,s | |
426 bcc L0562 | |
427 addd $02,s | |
428 andcc #^Carry | |
429 bra L0564 | |
430 L0562 orcc #Carry | |
431 L0564 rol $07,s | |
432 rol $06,s | |
433 lsr $02,s | |
434 ror $03,s | |
435 dec ,s | |
436 bne L0558 | |
437 std $02,s | |
438 tst $01,s | |
439 beq L057E | |
440 ldd $06,s | |
441 nega | |
442 negb | |
443 sbca #$00 | |
444 std $06,s | |
445 L057E ldx $04,s | |
446 ldd $06,s | |
447 std $04,s | |
448 stx $06,s | |
449 ldx $02,s | |
450 ldd $04,s | |
451 leas $06,s | |
452 rts | |
453 | |
454 emod | |
455 eom equ * | |
456 end | |
457 |