annotate level1/modules/scdpp.asm @ 2307:2f90c1624ab4

Removed earlier port signal defintions, now S$Peer is used
author boisy
date Sun, 03 Jan 2010 14:29:29 +0000
parents 25b468210b37
children c505ae3120c4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2040
25b468210b37 More changes for new porting structure
boisy
parents: 2037
diff changeset
1 * Parallel Printer device for Dragon 32/64/Alpha.
1839
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
2 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
3 * Disassembled from the Alpha OS-9 2005-06-14, P.Harvey-Smith.
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
4 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
5
2040
25b468210b37 More changes for new porting structure
boisy
parents: 2037
diff changeset
6 nam scdpp
25b468210b37 More changes for new porting structure
boisy
parents: 2037
diff changeset
7 ttl Dragon Parallel Printer Driver
1839
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
8
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
9 * Disassembled 1900/00/00 00:08:11 by Disasm v1.5 (C) 1988 by RML
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
10
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
11 ifp1
2037
2e37b5a0d4b3 set PORT var
boisy
parents: 1839
diff changeset
12 use defsfile
1839
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
13 endc
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
14
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
15 tylg set Drivr+Objct
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
16 atrv set ReEnt+rev
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
17 rev set $01
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
18 edition set 3
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
19 mod eom,name,tylg,atrv,start,size
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
20
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
21 u0000 rmb 29
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
22 size equ .
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
23
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
24 fcb $03
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
25 name equ *
2040
25b468210b37 More changes for new porting structure
boisy
parents: 2037
diff changeset
26 fcs /scdpp/
1839
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
27 fcb edition
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
28
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
29 start equ *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
30 lbra Init
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
31 lbra Read
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
32 lbra Write
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
33 lbra GetStat
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
34 lbra SetStat
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
35 lbra Term
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
36
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
37 * Init
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
38 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
39 * Entry:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
40 * Y = address of device descriptor
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
41 * U = address of device memory area
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
42 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
43 * Exit:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
44 * CC = carry set on error
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
45 * B = error code
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
46 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
47 Init pshs cc
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
48 orcc #$50 ; Disable Inturrupts
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
49 ldx #PIA1DA ; Point to PIA1DA
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
50 ldb 1,x ; Get CRA
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
51 clr 1,x ; Zero CR and select DDRA
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
52 lda #$FE ; Set bit 0 as input (cassette in), all others as input
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
53 sta ,x
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
54 stb 1,x ; Restore CRA
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
55 ldx #PIA1DB ; Point at PIA1DB
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
56 ldb 1,x ; Save CRB
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
57 clr 1,x ; Zero CR and select DDRB
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
58 lda ,x ; get DDRB
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
59 anda #$FE ; Set bit 0 as input (printer busy), all others leave alone
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
60 sta ,x
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
61 stb 1,x ; restore CRB
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
62 puls cc
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
63 clrb ; Flag no error
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
64 rts
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
65
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
66 * Read
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
67 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
68 * Entry:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
69 * B = MSB of the disk's LSN
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
70 * X = LSB of the disk's LSN
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
71 * Y = address of path descriptor
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
72 * U = address of device memory area
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
73 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
74 * Exit:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
75 * CC = carry set on error
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
76 * B = error code
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
77 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
78
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
79 Read ldb #$CB ; Ilegal mode, cannot read from printer !
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
80 orcc #$01
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
81 rts
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
82
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
83 * Write
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
84 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
85 * Entry:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
86 * B = MSB of the disk's LSN
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
87 * X = LSB of the disk's LSN
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
88 * Y = address of path descriptor
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
89 * U = address of device memory area
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
90 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
91 * Exit:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
92 * CC = carry set on error
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
93 * B = error code
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
94 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
95
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
96 Write pshs a
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
97 L0053 ldb #$08 ; retry count
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
98 L0055 lda >PIA1DB ; Get printer busy flag
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
99 lsra ; Get busy bit into carry
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
100 bcc WriteNotBusy ; Not busy : continue
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
101 nop ; wait a little while
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
102 nop
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
103 decb ; decrement retry counter
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
104 bne L0055 ; Non zero : check flag again
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
105
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
106 pshs x ; Still busy: send calling process to sleep
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
107 ldx #$0001
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
108 os9 F$Sleep
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
109 puls x
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
110 bra L0053 ; When we wake, poll busy again
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
111
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
112 WriteNotBusy
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
113 puls a
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
114 pshs cc
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
115 orcc #$50 ; disable inturrupts
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
116 sta >PIA0DB ; Send character to printer
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
117 lda >PIA1DA ; Toggle printer strobe line
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
118 ora #$02 ; high
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
119 sta >PIA1DA
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
120 anda #$FD ; and low again
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
121 sta >PIA1DA
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
122 puls pc,cc ; restore and return
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
123
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
124 * GetStat
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
125 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
126 * Entry:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
127 * A = function code
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
128 * Y = address of path descriptor
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
129 * U = address of device memory area
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
130 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
131 * Exit:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
132 * CC = carry set on error
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
133 * B = error code
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
134 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
135 GetStat
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
136 cmpa #$01
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
137 bne L008A
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
138 L0088 clrb
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
139 rts
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
140
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
141 L008A cmpa #$06
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
142 beq L0088
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
143 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
144 * SetStat
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
145 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
146 * Entry:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
147 * A = function code
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
148 * Y = address of path descriptor
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
149 * U = address of device memory area
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
150 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
151 * Exit:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
152 * CC = carry set on error
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
153 * B = error code
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
154 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
155 SetStat
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
156 comb
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
157 ldb #$D0
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
158 rts
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
159 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
160 * Term
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
161 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
162 * Entry:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
163 * U = address of device memory area
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
164 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
165 * Exit:
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
166 * CC = carry set on error
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
167 * B = error code
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
168 *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
169
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
170 Term rts
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
171
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
172 emod
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
173 eom equ *
613d93786303 Paralell printer driver for Dragon 32/64/Alpha
afra
parents:
diff changeset
174 end