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