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