annotate level1/modules/scdwp.asm @ 2308:b5f0c5326e7e

Changes made to move ISR to dw3
author boisy
date Sun, 03 Jan 2010 14:35:04 +0000
parents 07b2433f0c65
children b8c7b7fbf3c9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
1 ********************************************************************
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
2 * scdwp.asm - CoCo DriveWire Printer Driver
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
3 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
4 * $Id$
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
5 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
7 * Comment
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
9 * 1 2009/03/06 Boisy G. Pitre
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
10 * Started.
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
11
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
12 nam scdwp
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
13 ttl CoCo DriveWire Printer Driver
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
14
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
15 ifp1
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
16 use defsfile
2183
d29be35a48bb makefiles updated, opcode for printing updated
boisy
parents: 2180
diff changeset
17 use dwdefs.d
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
18 endc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
19
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
20 tylg set Drivr+Objct
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
21 atrv set ReEnt+Rev
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
22 rev set $00
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
23 edition set 1
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
24
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
25 mod eom,name,tylg,atrv,Start,Size
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
26
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
27 fcb READ.+WRITE.
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
28
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
29 name fcs /scdwp/
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
30 fcb edition one more revision level than the stock printer
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
31
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
32 * Device memory area: offset from U
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
33 org V.SCF V.SCF: free memory for driver to use
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
34 V.PAR rmb 1 1=space, 2=mark parity
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
35 V.BIT rmb 1 0=7, 1=8 bits
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
36 V.STP rmb 1 0=1 stop bit, 1=2 stop bits
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
37 V.COM rmb 2 Com Status baud/parity (=Y from SS.Comst Set/GetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
38 V.COL rmb 1 columns
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
39 V.ROW rmb 1 rows
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
40 V.WAIT rmb 2 wait count for baud rate?
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
41 V.TRY rmb 2 number of re-tries if printer is busy
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
42 V.RTRY rmb 1 low nibble of parity=high byte of number of retries
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
43 V.BUFF rmb $80 room for 128 blocked processes
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
44 size equ .
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
45
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
46 start equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
47 lbra Init
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
48 lbra Read
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
49 lbra Write
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
50 lbra GetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
51 lbra SetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
52
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
53 * Term
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
54 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
55 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
56 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
57 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
58 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
59 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
60 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
61 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
62 Term equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
63 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
64 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
65
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
66 * Init
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
67 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
68 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
69 * Y = address of device descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
70 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
71 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
72 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
73 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
74 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
75 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
76 Init
2270
07b2433f0c65 moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents: 2213
diff changeset
77 * Check if D.DWSubAddr already holds a valid subroutine module pointer
2213
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
78 IFGT Level-1
2270
07b2433f0c65 moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents: 2213
diff changeset
79 ldx <D.DWSubAddr
2213
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
80 ELSE
2270
07b2433f0c65 moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents: 2213
diff changeset
81 ldx >D.DWSubAddr
2213
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
82 ENDC
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
83 bne InitEx
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
84
2270
07b2433f0c65 moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents: 2213
diff changeset
85 * If here, D.DWSubAddr is 0, so we must link to subroutine module
2213
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
86 IFGT Level-1
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
87 ldx <D.Proc
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
88 pshs x
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
89 ldx <D.SysPrc
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
90 stx <D.Proc
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
91 ENDC
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
92 clra
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
93 leax dw3name,pcr
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
94 os9 F$Link
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
95 IFGT Level-1
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
96 puls x
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
97 stx <D.Proc
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
98 ENDC
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
99 bcs InitEx
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
100 IFGT Level-1
2270
07b2433f0c65 moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents: 2213
diff changeset
101 sty <D.DWSubAddr
2213
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
102 ELSE
2270
07b2433f0c65 moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents: 2213
diff changeset
103 sty >D.DWSubAddr
2213
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
104 ENDC
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
105 jsr ,y call init routine
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
106 InitEx rts
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
107
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
108 dw3name fcs /dw3/
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
109
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
110 * Write
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
111 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
112 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
113 * A = character to write
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
114 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
115 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
116 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
117 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
118 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
119 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
120 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
121 Write equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
122 tfr a,b
2183
d29be35a48bb makefiles updated, opcode for printing updated
boisy
parents: 2180
diff changeset
123 lda #OP_PRINT
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
124 pshs d
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
125 leax ,s
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
126 ldy #$0002
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2270
diff changeset
127 IFGT Level-1
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2270
diff changeset
128 ldu <D.DWSubAddr
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2270
diff changeset
129 ELSE
2270
07b2433f0c65 moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents: 2213
diff changeset
130 ldu >D.DWSubAddr
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2270
diff changeset
131 ENDC
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
132 jsr 6,u
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
133 puls d,pc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
134
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
135
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
136 * GetStat
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
137 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
138 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
139 * A = function code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
140 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
141 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
142 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
143 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
144 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
145 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
146 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
147 GetStt cmpa #SS.EOF end of file?
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
148 bne L0112
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
149 clrb if so, exit with no error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
150 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
151
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
152 L0112 ldx PD.RGS,y
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
153 cmpa #SS.ScSiz
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
154 beq L0123
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
155 cmpa #SS.ComSt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
156 bne L0173
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
157 clra
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
158 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
159 std R$Y,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
160 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
161 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
162
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
163 * get screen size GetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
164 L0123 clra
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
165 ldb #80
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
166 std R$X,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
167 ldb #24
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
168 std R$Y,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
169 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
170 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
171
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
172 * SetStat
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
173 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
174 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
175 * A = function code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
176 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
177 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
178 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
179 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
180 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
181 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
182 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
183 SetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
184 Close cmpa #SS.Close close the device?
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
185 bne L0173
2183
d29be35a48bb makefiles updated, opcode for printing updated
boisy
parents: 2180
diff changeset
186 lda #OP_PRINTFLUSH send PrintQueue Flush Packet
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
187 pshs a
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
188 ldy #$0001
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
189 leax ,s
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2270
diff changeset
190 IFGT Level-1
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2270
diff changeset
191 ldu <D.DWSubAddr
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2270
diff changeset
192 ELSE
2270
07b2433f0c65 moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents: 2213
diff changeset
193 ldu >D.DWSubAddr
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2270
diff changeset
194 ENDC
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
195 jsr 6,u
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
196 puls a,pc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
197
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
198 Read comb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
199 ldb #E$BMode
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
200 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
201
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
202 L0173 comb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
203 ldb #E$UnkSVc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
204 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
205
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
206 emod
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
207 eom equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
208 end