a7652e70d8b38b4ce97b11536cfb7aaf4aa82712
[pdp8.git] / sw / rescue / lab8e_goettingen / disk1_im6100 / rka / paroff / x80sp.pa
1 /PRINTER & PLOTTER HANDLER ADCOM X80SP
2 / PLOTTER HANDLER CONVERTS [ INTO DC3 AND ] INTO DC1
3 / X80SP HANDLES HT,VT,CR,LF,FF
4 / HANDLER SUPPORTS DC3 (XOFF) - DC1 (XON) COMMANDS FROM X80SP.
5 / SYSTEM TTY INPUT ETX (^C) CAUSES RETURN FROM THE HANDLER.
6 / ALL CONTROL CHARACTERS SEND TO THE HANDLER ARE DIRECTED TO THE X80SP.
7 / JOHANN J. ANDRES UNIVERSITY GOETTINGEN
8 /
9 / H.A. 10.DEC.1981 REV 0.0
10 / H.A. 4. APR.1982 REV 1.0 INSERTS [ --> DC3 AND ] --> DC1
11 / H.A. 5. OCT.1982 REV 1.1 LITTLE CHANGES SAVE 2 WORDS OF MEMORY
12 / H.A. 10.OCT.82 REV 1.2 REMOVES POSSIBLE LISF/LIRB TIMING PROBLEMS
13 / H.A. 26.OCT.82 REV 1.3 REMOVES FRTS PROBLEM: SOME CHARS WERE LOST
14 /
15 TTYDVC=03 / TTY
16 INDVC=31 / LPT RS-232C INTERFACE
17 OUTDVC=32 / LPT
18 /
19 LSF=10^OUTDVC+6001 / SKIP ON LPT FLAG
20 LLS=10^OUTDVC+6006 / CLEAR FLAG & PRINT CHARACTER
21 LISF=10^INDVC+6001 / SKIP ON LPT FLAG
22 LIRB=10^INDVC+6006 / CLEAR FLAG & READ STATUS
23 KSF=10^TTYDVC+6001 / SKIP ON TTY FLAG
24 KRS=10^TTYDVC+6004 / OR TTY KBD CHARACTER INTO AC
25 / ACL=7701 / PAL8 DOESN'T KNOW HIS COMPUTER!
26 / MQL=7421
27 /
28 /
29 *0 / 8 WORD HANDLER BLOCK
30 -2 / TWO UNITS
31 DEVICE X80S
32 DEVICE LP1
33 1040
34 LPT&177 / STARTING ADR.
35 0;0
36 DEVICE X80S
37 DEVICE PLT
38 1040 / WRITE ONLY LINE PRINTER
39 PLT&177 / STARTING ADR.
40 0;0 / 2 WORDS MUST BE ZERO
41 /
42 /
43 *200 / START OF HANDLER
44 PLT, 0 / ENTRY FOR PLOTTER HANDLER
45 DCA SAC
46 TAD PLT / HERE WE SAVE THE RETURN ADR.
47 DCA LPT / INTO THE LPT RETURN POINT
48 TAD TPLT / INSERT PLOTTER CALL CMD
49 DCA TYPE
50 JMP START
51 LPT, 0
52 DCA SAC / SAVE AC
53 TAD TLPT / INSERT LPT CALL CMD
54 DCA TYPE
55 TAD LP23 / SWITCH OFF THE
56 JMS LPTPCH / PLOTTER MODE
57 START,/
58 TAD SAC / RESTORE AC
59 CLL CML CLA RAR
60 TAD I LPT /LINK GOES ON HERE. IF NOT READ WAS REQUESTED
61 AND LP7700
62 CMA
63 DCA LPTWC
64 LPT214, RDF / FF CONSTANT
65 TAD LPTCIF
66 DCA LPTXIT /SAVE CALLING FIELD IN RETURN SEQUENCE
67 TAD I LPT
68 AND LPT70
69 TAD LPCDF0
70 DCA LPTCDF /GET BUFFER FIELD
71 ISZ LPT
72 TAD I LPT
73 DCA LPTCA /LPTCA GETS BUFFER ADDRESS
74 ISZ LPT
75 TAD I LPT
76 LPTCDF, HLT
77 ISZ LPT
78 SNL /IF LINK NOT SET,GIVE ERROR
79 JMP LPTERR
80 SZA CLA / INSERT FF IN FRONT OF THE FIRST DATA BLOCK TO PRINT
81 JMP LPT177
82 TAD LPT214 / FF --> AC
83 JMP LPTKLG
84
85 \f/NOW PICK UP THE CHARACTERS, UNPACK THEM AND PRINT.
86 /
87 / LOOP TO PICK UP THE CHARACTERS
88 /
89 LPTLP, CLA
90 TAD I LPTCA
91 JMS LPTPCH
92 TAD I LPTCA
93 AND LP7400
94 DCA LPTCDF
95 ISZ LPTCA
96 LP7400, 7400
97 TAD I LPTCA
98 JMS LPTPCH
99 TAD I LPTCA
100 AND LP7400
101 CLL RTR
102 LPTLF, RTR
103 TAD LPTCDF
104 RTR
105 RTR
106 ISZ LPTCA
107 NOP / BUFFER MAY BE AT FIELD BOUNDARY
108 LPTKLG, JMS LPTPCH
109 LPT177, 177
110 ISZ LPTWC
111 JMP LPTLP
112 LPRTRN, ISZ LPT
113 LPTXIT, HLT
114 JMP I LPT
115 LPTWC, 0
116 LPTCA, 0
117 /
118 LPTERR, CLA CLL CML RAR / FATAL ERROR RETURN
119 JMP LPTXIT / HOME TO MAM
120 /
121 /
122 / HERE WE PRINT THE CHARACTERS
123 /
124 LPTPCH, 0
125 /
126 AND LPT177 / WE TRUNCATE TO SEVEN BITS CHARACTER
127 TYPE, 0 / CHANGED AT EXECUTION TIME SEE TPLT & TLPT
128 TAD SAC / RELOAD CHARACTER TO PRINT
129 TAD LPM135 / TEST FOR ]
130 SZA
131 JMP L2 / IF ] THEN
132 TAD LP23 / WE PRINT A DC1
133 JMP L4 / CONVERSION ] INTO DC3 DONE
134 L2, TAD LPT02
135 SZA CLA
136 JMP L3 / TEST [
137 TAD LP21
138 JMP L4
139 L3, TAD SAC / RESTORE AC
140 L4,/
141 LLS / CLEAR FLAG LOAD CHARACTER & PRINT
142 LSF / IF PRINTER DONE FLAG SET, THEN WE CONTINUE
143 JMP .-1 / ELSE WE WAIT FOR DONE FLAG
144 LP7600, 7600 / CLA
145 TAD LP7600 / THIS IS TO GET A NEGATIVE NUMBER
146
147 KRS / OR TTY KBD INTO AC
148 TAD LPT175 / TEST FOR ETX (^C)
149 SNA CLA / IF NO ETX THEN GO AND WAIT FOR LP FLAG
150 KSF / ETX ENTERED, TTY KBD ACTIVE THEN JMP INTO MONITOR
151 JMP LPISF / TEST INPUT FROM PRINTER
152 LPTCIF, CDF CIF 0
153 JMP I LP7600
154 LPISF,
155 TAD LPOLD / LOAD THE LAST STATUS WORD
156 LISF / IS THERE ANY NEW STATUS?
157 SKP
158 LIRB / IF THERE IS A NEW STATUS THEN WE READ ELSE WE TAKE THE OLD ONE
159 DCA LPOLD / SAVE THE ACTUAL STATUS WORD
160 TAD LPOLD / RESTORE STATUS --> AC
161 AND LPT177 / MASK OUT 7 BITS
162 TAD LPM23 / TEST DC3 (^S)
163 SNA CLA
164 JMP LP7600 / DC3 ENTERED WAIT FOR DC1
165 JMP I LPTPCH / DC1 OR MEANINGLESS INPUT, SO WE CONTINUE PRINTING
166 /
167 /
168 TLPT, JMP L4 / LINE PRINTER HANDLER
169 TPLT, DCA SAC / SAVE AC
170 /
171 SAC, 0 / ON ENTRY WE SAVE THE AC
172 /
173 LP7700, 7700
174 LPM06, -06
175 LP21, 21
176 LP23, 23
177 LPOLD, 1
178 LPM23, -23
179 LPT02, 02
180 LPWISZ, ISZ LPLPTR
181 JMP I LPTPCH
182 LPFLSH,
183 LPT70, 70
184 LPM135, -135
185 LPT175, 175
186 LPCDF0, CDF 0
187 LPLPTR, 0
188 /
189 $$
190 \1a