annotate level2/modules/printer.asm @ 731:bd7c8348adec

This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two Note, the previous revision was actually the Disto printer driver.
author boisy
date Sun, 05 Jan 2003 21:48:33 +0000
parents 6641a883d6b0
children d13864ef3317
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
2 * Printer - CoCo 3 Serial Printer Driver
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
6 * Enhanced and re-written by Alan DeKok
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
7 *
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
8 * Problems with original:
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
9 * returns wrong error on Read/SetStt
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
10 * doesn't block output. The printer is a single-user device!
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
11 *
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 * ------------------------------------------------------------------
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
14 * NitrOS-9 2.00 distribution ??/??/??
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
15 * 13 Back-ported to OS-9 Level Two BGP 03/01/05
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
17 nam Printer
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
18 ttl CoCo 3 Serial Printer Driver
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 tylg set Drivr+Objct
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
25 atrv set ReEnt+Rev
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 rev set $01
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
27 edition set 13
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
29 mod eom,name,tylg,atrv,Start,Size
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
30
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
31 fcb READ.+WRITE.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 name fcs /PRINTER/
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
34 fcb edition one more revision level than the stock printer
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
35
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
36 * Device memory area: offset from U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
37 org V.SCF V.SCF: free memory for driver to use
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
38 V.PAR rmb 1 1=space, 2=mark parity
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
39 V.BIT rmb 1 0=7, 1=8 bits
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
40 V.STP rmb 1 0=1 stop bit, 1=2 stop bits
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
41 V.COM rmb 2 Com Status baud/parity (=Y from SS.Comst Set/GetStt
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
42 V.COL rmb 1 columns
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
43 V.ROW rmb 1 rows
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
44 V.WAIT rmb 2 wait count for baud rate?
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
45 V.TRY rmb 2 number of re-tries if printer is busy
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
46 V.RTRY rmb 1 low nibble of parity=high byte of number of retries
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
47 V.BUFF rmb $80 room for 128 blocked processes
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
48 size equ .
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
49
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
50 * Baud Rate Delay Table
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
51 BaudDly equ *
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
52 IFEQ NitrOS9
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
53 * OS-9 Level Two delay values (1.89MHz)
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
54 fdb $090C 110 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
55 fdb $034C 300 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
56 fdb $01A2 600 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
57 fdb $00CE 1200 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
58 fdb $0062 2400 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
59 fdb $002E 4800 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
60 fdb $0012 9600 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
61 fdb $0003 32000 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
62 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
63 * NitrOS-9 Level Two delay values (1.89MHz)
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
64 fdb $090C 110 baud (Unchanged, unknown)
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
65 fdb $03D0 300 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
66 fdb $01A2 600 baud (Unchanged, unknown)
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
67 fdb $00F0 1200 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
68 fdb $0073 2400 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
69 fdb $0036 4800 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
70 fdb $0017 9600 baud
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
71 fdb $0003 32000 baud (Unchanged, unknown)
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
72 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
73
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 start equ *
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
76 lbra Init
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
77 lbra Read
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
78 lbra Write
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
79 lbra GetStt
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
80 lbra SetStt
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
81 Term equ *
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
82 clrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
83 rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
84
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
85 Init orcc #IntMasks
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
86 ldx #$FF20
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
87 clr $01,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
88 ldd <$2C,Y get number of columns/rows
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
89 std <V.COL,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
90 lda #$FE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
91 sta ,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
92 lda #$36
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
93 sta $01,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
94 lda ,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
95 andcc #^IntMasks
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
96 ldd <$26,Y parity and baud rate
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
97 lbsr L0138 setup parity/baud in device memory
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
98 lbsr L0104 get low bit of $FF22 into carry
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
99 lbcs L0100 it's the ready flag
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
100 * clear out buffer
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
101 leax V.BUFF,u room for 128 blocked processes
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
102 ldb #$80
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
103 I010 clr ,x+ we're more concerned with room
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
104 decb than with speed, so we don't use TFM
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
105 bne I010
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
106 rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
107
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
108 L005F ldb <PD.BAU,Y PD.BAU
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
109 andb #$0F keep lower nibble
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
110 cmpb #$07 get baud rate
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
111 lbhs Read
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
112 aslb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
113 leax <BaudDly,PCR table of delay times
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
114 ldx b,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
115 stx <V.WAIT,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
116 clrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
117 rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
118
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
119 Bit_2 ldb #$02
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
120 L007D stb >$FF20
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
121 L0080 pshs d
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
122 ldd <V.WAIT,U get wait count for baud rate
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
123 L0085 equ *
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
124 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
125 decd count down by one
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
126 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
127 subd #$0001
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
128 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
129 bne L0085
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
130 puls pc,d
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
131
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
132 Write equ *
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
133 leax V.BUFF,u point to the buffer
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
134 ldb V.BUSY,u get my process number
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
135 tst ,x get allowed process number
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
136 bne W010 if not zero, else
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
137 stb ,x I'm the only one allowed to use it
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
138
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
139 W010 cmpb ,x am I allowed to use /p?
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
140 beq W030 if yes, go write a character
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
141
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
142 ***************************************************************
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
143 * WARNING: If more than 128 processes try to use the printer,
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
144 * this will CRASH BADLY. Since Level II on the Coco is limited
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
145 * to 32 processes, I don't think it's a problem.
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
146 ***************************************************************
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
147
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
148 W020 tst ,x+ if not, find the first non-zero entry
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
149 bne W020
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
150 stb -1,x and save my process number at the first zero
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
151 pshs a
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
152 lda V.BUFF,u process that's allowed to use /p
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
153 sta V.BUSY,u make it the busy one
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
154 ldb #$01 wake it up
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
155 os9 F$Send send a signal to wake it
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
156 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
157 tfr 0,x
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
158 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
159 ldx #$0000
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
160 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
161 os9 F$Sleep and go to sleep forever
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
162 puls a restore character to be sent, and continue
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
163
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
164 W030 bsr L005F set up baud rate, etc in memory
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
165 bcs L00CA
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
166 pshs a
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
167 bsr L00CB make sure that the device is ready
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
168 puls a
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
169 bcs L00CA if the device is not ready
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
170 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
171 lde #$09 9 bits to send out
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
172 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
173 pshs b,a
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
174 lda #$09
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
175 sta 1,s
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
176 puls a
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
177 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
178 orcc #IntMasks turn off interrupts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
179 tst <V.BIT,U number of bits
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
180 beq L00AC if 7 bits, count down by one
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
181 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
182 dece initially send out start bit
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
183 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
184 dec ,s
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
185 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
186
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
187 L00AC bsr L007D write B to $FF20 and wait
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
188 clrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
189 lsra move A into carry
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
190 rolb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
191 rolb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
192 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
193 dece count down on the number of bits to send
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
194 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
195 dec ,s
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
196 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
197 bne L00AC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
198 IFEQ H6309
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 puls b
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
200 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
201 ldb <V.PAR,U space/mark parity
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
202 beq L00BC 0=no parity
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
203 andb #$FE 1=space, 0=mark parity
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
204 * should be andb #$FD I think...
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
205 bsr L007D dump out a parity byte
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
206 L00BC bsr Bit_2 and a stop bit
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
207 tst <V.STP,U do another one?
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
208 beq L00C9
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
209 bsr Bit_2 yes, dump out another stop byte
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
210 L00C9 andcc #^IntMasks
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
211 L00CA rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
212
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
213 L0104 pshs b
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
214 ldb >$FF22 get a byte
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
215 lsrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
216 puls pc,b
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
217
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
218 L00CB equ *
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
219 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
220 clrd
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
221 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
222 clra
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
223 clrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
224 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
225 std <V.TRY,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
226 L00D0 ldd #$0303
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
227 L00D3 bsr L0104 get device ready status
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
228 bcs L00DE if not ready, wait for a bit
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
229 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
230 bsr L0080 wait
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
231 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
232 lbsr L0080 wait
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
233 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
234 decb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
235 bne L00D3 try again
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 rts
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
238
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
239 L00DE lbsr L0080 wait for a while
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
240 deca try 3 times,
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
241 bne L00D3
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
242 pshs x
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
243 ldx #$0001
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
244 os9 F$Sleep sleep for the rest of this tick
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
245 puls x
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
246 ldd <V.TRY,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
247 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
248 incd we've tried once more and failed...
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
249 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
250 addd #$0001
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
251 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
252 std <V.TRY,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
253 ldb <V.RTRY,U number of retries to do
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
254 beq L00D0 if unspecified, keep retrying
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
255 cmpb <V.TRY,U if exceeded number of retries,
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
256 bhi L00D0 then we crap out
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
257
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
258 L0100 comb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
259 ldb #E$NotRdy
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
260 rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
261
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
262 GetStt cmpa #SS.EOF end of file?
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
263 bne L0112
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
264 clrb if so, exit with no error
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 rts
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
266
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
267 L0112 ldx PD.RGS,Y
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
268 cmpa #SS.ScSiz
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
269 beq L0123
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
270 cmpa #SS.ComSt
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
271 bne L0173
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
272 ldd <V.COM,U get Com status
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
273 std R$Y,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
274 clrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
275 rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
276
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
277 * get screen size GetStt
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
278 L0123 clra
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
279 ldb <V.COL,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
280 std R$X,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
281 ldb <V.ROW,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
282 std R$Y,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
283 clrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
284 rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
285
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
286 SetStt cmpa #SS.ComSt
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
287 bne Close if not, check if it's a close
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
288 ldx PD.RGS,Y
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
289 ldd R$Y,X
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
290 * A = Parity byte
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
291 * B = baud rate
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
292 L0138 std <V.COM,U save parity, baud rate in com status
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
293 IFNE H6309
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
294 clrd
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
295 ELSE
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
296 clra
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
297 clrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
298 ENDC
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
299 std <V.PAR,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
300 sta <V.STP,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
301 ldd <V.COM,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
302 tstb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
303 bpl L014C
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
304 inc <V.STP,U do 2 stop bits
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
305 L014C bitb #$40 make sure the bit is zero
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
306 bne Read
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
307 bitb #$20 0=8, 1=7 bits
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
308 beq L0157
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
309 inc <V.BIT,U
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
310 L0157 bita #$20
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
311 beq L0169 if=0, no parity
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
312 bita #$80
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
313 beq Read if high bit set (only for ACIA devices), error out
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
314 inc <V.PAR,U parity
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
315 bita #$40
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
316 bne L0169 1=space,
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
317 inc <V.PAR,U 2=mark parity
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
318 L0169 anda #$0F
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
319 sta <V.RTRY,U
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
320 rts
731
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
321
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
322 Read comb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
323 ldb #E$BMode
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
324 rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
325
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
326 L0173 comb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
327 ldb #E$UnkSVc
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
328 rts
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
329
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
330 Close cmpa #SS.Close close the device?
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
331 bne L0173
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
332 leax V.BUFF,u point to blocked process buffer
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
333
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
334 C010 lda 1,x get next process number
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
335 sta ,x+
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
336 bne C010 do until we have a zero byte
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
337
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
338 lda V.BUFF,u get the first process in the queue
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
339 beq C020 if none left
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
340 ldb #$01 wake up signal
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
341 os9 F$Send re-start the blocked process
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
342
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
343 C020 clrb
bd7c8348adec This is the serial printer driver from NitrOS-9, backported to OS-9 Level Two
boisy
parents: 0
diff changeset
344 rts
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
345
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
346 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
347 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
348 end