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