|
|
Power 6/32 Unix version 1.21
1 00000000 LL0:
2 00000000 .data
3 000001c8 * .set CPMDCB,21
4 000001c8 * .set DC_OFF,2
5 000001c8 * .set DC_ON,1
6 000001c8 * .set MME,9
7 000001c8 * .set DCR,27
8 000001c8 * .set PDCS,28
9 000001c8 * .set CTL_SW,0x41b
10 000001c8 * .comm _tmp_lw,4
11 000001c8 * .align 2
12 000001c8 * .globl _cpbuf_sz
13 000001c8 * _cpbuf_sz:
14 000001c8 * 00000001 .long 1
15 000001cc * .align 2
16 000001cc * .globl _charcnt
17 000001cc * _charcnt:
18 000001cc * 00000000 .long 0
19 000001d0 * .comm _cpout,204
20 000001d0 * .comm _cpin,8
21 000001d0 * .set HISR,0x410
22 000001d0 * .text
23 00000000 .align 1
24 00000000 .globl _putstr
25 00000000 _putstr:
26 0000B88C 0000 .word L17
27 0000B88E #
28 0000B88E # /* Console Processor Interface */
29 0000B88E # /* Tahoe version, Nov. 1982 */
30 0000B88E #
31 0000B88E # /****************************************/
32 0000B88E # /* */
33 0000B88E # /* Reduced DCB layout for byte */
34 0000B88E # /* communication. */
35 0000B88E # /* */
36 0000B88E # /****************************************/
37 0000B88E #
38 0000B88E # asm(".set CPMDCB,21");
39 0000B88E # asm(".set DC_OFF,2");
40 0000B88E # asm(".set DC_ON,1");
41 0000B88E # asm(".set MME,9");
42 0000B88E # asm(".set DCR,27");
43 0000B88E # asm(".set PDCS,28");
44 0000B88E # asm(".set CTL_SW,0x41b"); /* Addr of switches to turn on Cache, MME, Fault */
45 0000B88E # long tmp_lw;
46 0000B88E #
47 0000B88E #
48 0000B88E # #define CPBUFLEN 200 /* Output buffer length */
49 0000B88E # struct cphdr
50 0000B88E # {
51 0000B88E # char cp_unit; /* Done bit & unit # */
52 0000B88E # char cp_comm; /* Command */
53 0000B88E # short cp_count; /* Counter (when relevant) */
54 0000B88E # };
55 0000B88E #
56 0000B88E # struct cpdcb_o /* Output structure */
57 0000B88E # {
58 0000B88E # struct cphdr cp_hdr;
59 0000B88E # char cp_buf[CPBUFLEN]; /* Buffer for output or 'stty' */
60 0000B88E # };
61 0000B88E #
62 0000B88E # struct cpdcb_i /* Structure for input */
63 0000B88E # {
64 0000B88E # struct cphdr cp_hdr;
65 0000B88E # char cpi_buf[4]; /* Buffer for input */
66 0000B88E # };
67 0000B88E #
68 0000B88E # #define CPDONE 0x80 /* 'Done' bit in cp_unit */
69 0000B88E # #define CPTAKE 0x40 /* CP 'ack' to this cpdcb */
70 0000B88E #
71 0000B88E # /* Values for 'unit' */
72 0000B88E # #define CPUNIT 0 /* The CP itself */
73 0000B88E # #define CPCONS 1 /* Console line */
74 0000B88E # #define CPREMOT 2 /* Remote line */
75 0000B88E #
76 0000B88E # /* Values for 'command' */
77 0000B88E # #define CPRESET 0
78 0000B88E # #define CPWRITE 1
79 0000B88E # #define CPREAD 2
80 0000B88E # #define CPSTTY 3
81 0000B88E # #define CPBOOT 4
82 0000B88E #
83 0000B88E #
84 0000B88E # /* Put a char to CPU2 console */
85 0000B88E #
86 0000B88E # #define NCHAR 1
87 0000B88E #
88 0000B88E # long cpbuf_sz = 1; /* Buffer size */
89 0000B88E # long charcnt = 0;
90 0000B88E # struct cpdcb_o cpout; /* DCB for output */
91 0000B88E # struct cpdcb_i cpin; /* DCB for input */
92 0000B88E #
93 0000B88E # asm(".set HISR,0x410");
94 0000B88E #
95 0000B88E # putstr(str)
96 0000B88E # char *str;
97 0000B88E # { long c_cnt;
98 0000B88E 11 75 jbr L19
99 0000B890 L20:
100 0000B890 #
101 0000B890 # cpout.cp_hdr.cp_unit = CPCONS; /* Reset done bit */
102 0000B890 6f 01 effffffff5 cvtlb $1,_cpout
103 0000B897 # cpout.cp_hdr.cp_comm = CPWRITE; /* Set command */
104 0000B897 6f 01 efffffffef cvtlb $1,_cpout+1
105 0000B89E # for(c_cnt=0;;c_cnt++) {
106 0000B89E 4d adc8 clrl -56(fp)
107 0000B8A1 L23:
108 0000B8A1 # cpout.cp_buf[c_cnt] = *str++;
109 0000B8A1 0d 8f00000004 50 movl $_cpout+4,r0
110 0000B8A8 0d adc8 51 movl -56(fp),r1
111 0000B8AC 09 bd04 4160 movb *4(fp),(r0)[r1]
112 0000B8B1 6d ad04 incl 4(fp)
113 0000B8B4 # if (cpout.cp_buf[c_cnt]=='\n') {
114 0000B8B4 0d 8f00000004 50 movl $_cpout+4,r0
115 0000B8BB 0d adc8 51 movl -56(fp),r1
116 0000B8BF 19 4160 0a cmpb (r0)[r1],$10
117 0000B8C3 21 12 jneq L24
118 0000B8C5 # c_cnt++;
119 0000B8C5 6d adc8 incl -56(fp)
120 0000B8C8 # cpout.cp_buf[c_cnt]='\r';
121 0000B8C8 0d 8f00000004 50 movl $_cpout+4,r0
122 0000B8CF 0d adc8 51 movl -56(fp),r1
123 0000B8D3 6f 0d 4160 cvtlb $13,(r0)[r1]
124 0000B8D7 # }
125 0000B8D7 # if (cpout.cp_buf[c_cnt]=='\0') break;
126 0000B8D7 L24:
127 0000B8D7 0d 8f00000004 50 movl $_cpout+4,r0
128 0000B8DE 0d adc8 51 movl -56(fp),r1
129 0000B8E2 59 4160 tstb (r0)[r1]
130 0000B8E5 21 02 jneq L25
131 0000B8E7 11 05 jbr L22
132 0000B8E9 # }
133 0000B8E9 L25:
134 0000B8E9 L21:
135 0000B8E9 6d adc8 incl -56(fp)
136 0000B8EC 11 b3 jbr L23
137 0000B8EE L22:
138 0000B8EE # if (c_cnt) {
139 0000B8EE 5d adc8 tstl -56(fp)
140 0000B8F1 31 11 jeql L26
141 0000B8F3 # cpout.cp_hdr.cp_count = c_cnt;
142 0000B8F3 7f adc8 efffffff93 cvtlw -56(fp),_cpout+2
143 0000B8FB # cp_poll('\0'); }
144 0000B8FB dd 00 pushl $0
145 0000B8FD fe 08 ef000000c6 callf $8,_cp_poll
146 0000B904 # }
147 0000B904 L26:
148 0000B904 40 ret#2
149 0000B905 .set L17,0x0
150 0000B905 L19:
151 0000B905 3c 38 5d 5e subl3 $56,fp,sp
152 0000B909 11 85 jbr L20
153 0000B90B .data
154 000001d0 * .text
155 0000B90B 00 .align 1
156 0000B90C .globl _putchar
157 0000B90C _putchar:
158 0000B90C 0000 .word L29
159 0000B90E #
160 0000B90E # putchar(c)
161 0000B90E # {
162 0000B90E 11 33 jbr L31
163 0000B910 L32:
164 0000B910 # cpout.cp_hdr.cp_unit = CPCONS; /* Reset done bit */
165 0000B910 6f 01 efffffff75 cvtlb $1,_cpout
166 0000B917 # cpout.cp_hdr.cp_comm = CPWRITE; /* Set command */
167 0000B917 6f 01 efffffff6f cvtlb $1,_cpout+1
168 0000B91E # cpout.cp_buf[charcnt] = c;
169 0000B91E 0d 8f00000004 50 movl $_cpout+4,r0
170 0000B925 0d ef0000012d 51 movl _charcnt,r1
171 0000B92C 6f ad04 4160 cvtlb 4(fp),(r0)[r1]
172 0000B931 # cpout.cp_hdr.cp_count = 1;
173 0000B931 7f 01 efffffff56 cvtlw $1,_cpout+2
174 0000B938 # cp_poll(c);
175 0000B938 dd ad04 pushl 4(fp)
176 0000B93B fe 08 ef00000088 callf $8,_cp_poll
177 0000B942 # }
178 0000B942 40 ret#2
179 0000B943 .set L29,0x0
180 0000B943 L31:
181 0000B943 11 cb jbr L32
182 0000B945 .data
183 000001d0 * .text
184 0000B945 00 .align 1
185 0000B946 .globl _rdchar
186 0000B946 _rdchar:
187 0000B946 1000 .word L34
188 0000B948 #
189 0000B948 #
190 0000B948 # char rdchar()
191 0000B948 # {
192 0000B948 11 36 jbr L36
193 0000B94A L37:
194 0000B94A # register long r12;
195 0000B94A # cpin.cp_hdr.cp_unit = CPCONS; /* Reset done bit */
196 0000B94A 6f 01 efffffff3b cvtlb $1,_cpin
197 0000B951 # cpin.cp_hdr.cp_comm = CPREAD; /* Set command */
198 0000B951 6f 02 efffffff35 cvtlb $2,_cpin+1
199 0000B958 # cpin.cp_hdr.cp_count = 1;
200 0000B958 7f 01 efffffff2f cvtlw $1,_cpin+2
201 0000B95F # cp_pollr();
202 0000B95F fe 04 ef0000001c callf $4,_cp_pollr
203 0000B966 # r12 = (long)(&cpin.cpi_buf[0]);
204 0000B966 0d 8f00000004 5c movl $_cpin+4,r12
205 0000B96D # asm("mtpr r12,$0x1c"); /* mtpr r11,$PDCS */
206 0000B96D ad 5c 1c mtpr r12,$0x1c
207 0000B970 # return(cpin.cpi_buf[0] & 0x7f);
208 0000B970 89 efffffff1a 50 cvtbl _cpin+4,r0
209 0000B977 ac 887f 50 andl2 $127,r0
210 0000B97B 89 50 50 cvtbl r0,r0
211 0000B97E 40 ret#1
212 0000B97F # }
213 0000B97F 40 ret#1
214 0000B980 .set L34,0x1000
215 0000B980 L36:
216 0000B980 11 c8 jbr L37
217 0000B982 .data
218 000001d0 * .text
219 0000B982 .align 1
220 0000B982 .globl _cp_pollr
221 0000B982 _cp_pollr:
222 0000B982 1800 .word L39
223 0000B984 #
224 0000B984 #
225 0000B984 # /* Poll CP on read
226 0000B984 # */
227 0000B984 # cp_pollr()
228 0000B984 # { register long r12, r11, time;
229 0000B984 11 42 jbr L41
230 0000B986 L42:
231 0000B986 #
232 0000B986 # r12 = ((long)&cpin) & 0xffffff;
233 0000B986 bc 8f00ffffff 8f00000000 andl3 $16777215,$_cpin,r0
50
234 0000B992 0d 50 5c movl r0,r12
235 0000B995 # asm("mtpr r12,$CPMDCB");
236 0000B995 ad 5c 15 mtpr r12,$CPMDCB
237 0000B998 #
238 0000B998 # r11 = (long)(&cpin.cp_hdr.cp_unit);
239 0000B998 0d 8f00000000 5b movl $_cpin,r11
240 0000B99F # while (!(cpin.cp_hdr.cp_unit & CPDONE)) {
241 0000B99F L43:
242 0000B99F 89 effffffee7 50 cvtbl _cpin,r0
243 0000B9A6 3d 890080 50 bitl $128,r0
244 0000B9AB 21 05 jneq L44
245 0000B9AD # asm("mtpr r11,$0x1c"); /* mtpr r11,$PDCS */
246 0000B9AD ad 5b 1c mtpr r11,$0x1c
247 0000B9B0 # }
248 0000B9B0 11 ed jbr L43
249 0000B9B2 L44:
250 0000B9B2 # if (!(cpin.cp_hdr.cp_unit & CPDONE)) cp_hlt(); /* Time out */
251 0000B9B2 89 effffffed4 50 cvtbl _cpin,r0
252 0000B9B9 3d 890080 50 bitl $128,r0
253 0000B9BE 21 07 jneq L45
254 0000B9C0 fe 04 ef0000006d callf $4,_cp_hlt
255 0000B9C7 # }
256 0000B9C7 L45:
257 0000B9C7 40 ret#2
258 0000B9C8 .set L39,0x1800
259 0000B9C8 L41:
260 0000B9C8 11 bc jbr L42
261 0000B9CA .data
262 000001d0 * .text
263 0000B9CA .align 1
264 0000B9CA .globl _cp_poll
265 0000B9CA _cp_poll:
266 0000B9CA 1c00 .word L47
267 0000B9CC #
268 0000B9CC #
269 0000B9CC # /* Poll CP on write
270 0000B9CC # */
271 0000B9CC # cp_poll(c)
272 0000B9CC # char c;
273 0000B9CC # { register long r12, r11, time;
274 0000B9CC 11 64 jbr L49
275 0000B9CE L50:
276 0000B9CE #
277 0000B9CE # time = 200000;
278 0000B9CE 0d 8f00030d40 5a movl $200000,r10
279 0000B9D5 # r12 = ((long)&cpout) & 0xffffff;
280 0000B9D5 bc 8f00ffffff 8f00000000 andl3 $16777215,$_cpout,r0
50
281 0000B9E1 0d 50 5c movl r0,r12
282 0000B9E4 # asm("mtpr r12,$CPMDCB");
283 0000B9E4 ad 5c 15 mtpr r12,$CPMDCB
284 0000B9E7 # asm("mtpr r12,$CPMDCB");
285 0000B9E7 ad 5c 15 mtpr r12,$CPMDCB
286 0000B9EA #
287 0000B9EA # r11 = (long)(&cpout.cp_hdr.cp_unit);
288 0000B9EA 0d 8f00000000 5b movl $_cpout,r11
289 0000B9F1 # while (time-- && !(cpout.cp_hdr.cp_unit & CPDONE)) {
290 0000B9F1 L51:
291 0000B9F1 0d 5a 50 movl r10,r0
292 0000B9F4 7d 5a decl r10
293 0000B9F6 5d 50 tstl r0
294 0000B9F8 31 13 jeql L52
295 0000B9FA 89 effffffe8c 50 cvtbl _cpout,r0
296 0000BA01 3d 890080 50 bitl $128,r0
297 0000BA06 21 05 jneq L52
298 0000BA08 # asm("mtpr r11,$0x1c"); /* mtpr r11,$PDCS */
299 0000BA08 ad 5b 1c mtpr r11,$0x1c
300 0000BA0B # }
301 0000BA0B 11 e4 jbr L51
302 0000BA0D L52:
303 0000BA0D # if (!(cpout.cp_hdr.cp_unit & CPDONE)) cp_hlt(); /* Time out */
304 0000BA0D 89 effffffe79 50 cvtbl _cpout,r0
305 0000BA14 3d 890080 50 bitl $128,r0
306 0000BA19 21 07 jneq L53
307 0000BA1B fe 04 ef00000012 callf $4,_cp_hlt
308 0000BA22 # if (c== '\n') putchar('\r');
309 0000BA22 L53:
310 0000BA22 19 ad07 0a cmpb 7(fp),$10
311 0000BA26 21 09 jneq L54
312 0000BA28 dd 0d pushl $13
313 0000BA2A fe 08 effffffedb callf $8,_putchar
314 0000BA31 # }
315 0000BA31 L54:
316 0000BA31 40 ret#2
317 0000BA32 .set L47,0x1C00
318 0000BA32 L49:
319 0000BA32 11 9a jbr L50
320 0000BA34 .data
321 000001d0 * .text
322 0000BA34 .align 1
323 0000BA34 .globl _cp_hlt
324 0000BA34 _cp_hlt:
325 0000BA34 0000 .word L55
326 0000BA36 #
327 0000BA36 # cp_hlt()
328 0000BA36 # {
329 0000BA36 11 17 jbr L57
330 0000BA38 L58:
331 0000BA38 # asm("movl $0xeeeeeeee,r0");
332 0000BA38 0d 8feeeeeeee 50 movl $0xeeeeeeee,r0
333 0000BA3F # asm("movl $0xeeeeeeee,r1");
334 0000BA3F 0d 8feeeeeeee 51 movl $0xeeeeeeee,r1
335 0000BA46 # asm("movl $0xeeeeeeee,r2");
336 0000BA46 0d 8feeeeeeee 52 movl $0xeeeeeeee,r2
337 0000BA4D # asm("halt");
338 0000BA4D 00 halt
339 0000BA4E # }
340 0000BA4E 40 ret#2
341 0000BA4F .set L55,0x0
342 0000BA4F L57:
343 0000BA4F 11 e7 jbr L58
344 0000BA51 .data
345 000001d0 * #
345 000001d0 * #
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.