Trailing-Edge
-
PDP-10 Archives
-
BB-H348C-RM_1982
-
swskit-v21/listings/tkb-vnp/wmap.bpt
There are no other files named wmap.bpt in the archive.
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
1 !<SAUTER.TKB20>WMAP.BLI.13, 13-Nov-78 08:17:28, Edit by SROBINSON
2 !<SAUTER.TKB20>WMAP.BLI.10, 7-Nov-78 08:21:43, Edit by SROBINSON
3 !<SAUTER.VNP20>WMAP.BLI.9, 28-Sep-78 17:12:10, Edit by SROBINSON
4 MODULE WMAP ( !WRITE GLOBAL MAP
5 IDENT = 'X0.1-4A'
6 ) =
7 BEGIN
8 !
9 !
10 !
11 ! COPYRIGHT (C) 1978 BY
12 ! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
13 !
14 !
15 ! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
16 ! ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE
17 ! INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
18 ! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
19 ! OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
20 ! TRANSFERRED.
21 !
22 !
23 ! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
24 ! AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
25 ! CORPORATION.
26 !
27 ! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
28 ! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
29 !
30
31 !++
32 ! FACILITY: TKB-20
33 !
34 ! ABSTRACT:
35 !
36 !
37 ! THIS MODULE PRINTS A LIST OF ALL GLOBALS WITH THEIR VALUES AND
38 ! REFERENCES. IT ALSO FLAGS UNDEFINED GLOBALS.
39 !
40 !
41 ! ENVIRONMENT: TOPS-20 USER MODE
42 !
43 ! AUTHOR: J. SAUTER, CREATION DATE: 22-FEB-78
44 !
45 ! MODIFIED BY:
46 !
47 ! Scott G. Robinson, 28-SEP-78 : VERSION X0.1-2A
48 ! - Make map generation more readable
49 !
50 ! Scott G. Robinson, 7-NOV-78 : VERSION X0.1-3A
51 ! - Make map show references to undefined symbols
52 !
53 ! Scott G. Robinson, 13-NOV-78 : VERSION X0.1-4A
54 ! - More cleanup of map generation
55 !
56 ! , : VERSION
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
57 ! 01 -
58 !--
59
60 !<BLF/PAGE>
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
61 !
62 ! TABLE OF CONTENTS:
63 !
64
65 FORWARD ROUTINE
66 GLOB : NOVALUE, !PRODUCE GLOBAL LISTING
67 PRC_GLOBL, !PROCESS EACH GLOBAL
68 SEL_PSECT, !PROCESS EACH PSECT
69 UNBLANK, !SUBSTITUTE "BLANK" FOR BLANKS
70 GBL_VAL; !RETURN THE VALUE OF A GLOBAL
71
72 !
73 ! INCLUDE FILES:
74 !
75
76 LIBRARY 'VNP-LIB.L36';
77
78 !REQUIRE 'BLOCKH.REQ'; !PREPARE TO DEFINE STORAGE BLOCKS
79 !REQUIRE 'GLOBL.REQ'; !GLOBAL SYMBOL BLOCK
80 !REQUIRE 'MODU.REQ'; !MODULE BLOCK
81 !REQUIRE 'PSECT.REQ'; !PSECT BLOCK
82 !REQUIRE 'BLOCKT.REQ'; !END OF DEFINING STORAGE BLOCKS
83
84 !
85 ! MACROS:
86 !
87 ! NONE
88 !
89 ! EQUATED SYMBOLS:
90 !
91
92 LITERAL
93 DEBUG = 0;
94
95 !
96 ! OWN STORAGE:
97 !
98 ! NONE
99 !
100 ! EXTERNAL REFERENCES:
101 !
102
103 EXTERNAL ROUTINE
104 ERRMSG : NOVALUE, !TYPE AN ERROR MESSAGE
105 OUTNUM : NOVALUE, !WRITE A NUMBER ON A FILE
106 OUTPUT : NOVALUE, !WRITE ON A FILE
107 OUTSTR : NOVALUE, !WRITE A STRING ON A FILE
108 PCRLF : NOVALUE, !SEND CRLF TO A FILE
109 FND_CHAIN; !FIND A BLOCK IN A CHAIN
110
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
111 GLOBAL ROUTINE GLOB (GLOB_CHAN, GLOBL_PTR) : NOVALUE = !PRINT A GLOBAL LISTING
112
113 !++
114 ! FUNCTIONAL DESCRIPTION:
115 !
116 ! PRINT A GLOBAL LISTING. FLAG UNDEFINED SYMBOLS AND PRINT A
117 ! CROSS REFERENCE LISTING. PSECT BASE ADDRESSES MUST BE RESOLVED.
118 !
119 ! FORMAL PARAMETERS:
120 !
121 ! GLOB_CHAN - CHANNEL ON WHICH TO WRITE THE CROSS REFERENCE.
122 ! LESS THAN ZERO MEANS NO GLOBAL CROSS REFERENCE.
123 ! GLOBL_PTR - POINTER TO ALPHABETICLY FIRST GLOBAL
124 !
125 ! IMPLICIT INPUTS:
126 !
127 ! THE GLOBAL SYMBOLS
128 !
129 ! IMPLICIT OUTPUTS:
130 !
131 ! NONE
132 !
133 ! ROUTINE VALUE:
134 !
135 ! NONE
136 !
137 ! SIDE EFFECTS
138 !
139 ! MAY PRINT THE GLOBAL CROSSREF AND ERROR MESSAGES
140 !
141 !--
142
143 BEGIN
144
145 MAP
146 GLOBL_PTR : REF GLOBL_BLOCK;
147
148 LOCAL
149 FIRST_TIME,
150 GLOB_INFO : VECTOR [4];
151
152 !
153 ! THE GLOBAL INFORMATION VECTOR IS LAID OUT AS FOLLOWS:
154 !
155 ! 0 - CHANNEL ON WHICH TO WRITE THE CROSS REFERENCE, LESS THAN
156 ! 0 MEANS NO GLOBAL CROSS REFERENCE.
157 ! 1 - CURRENT HORIZONTAL POSITION ON THE PRINT LINE.
158 ! 2 - NUMBER OF PSECT NAMES PRINTED SO FAR.
159 ! 3 - CURRENT VERTICAL POSITION ON THE PAGE.
160 !
161
162 BIND
163 HPOS = GLOB_INFO [1],
164 VPOS = GLOB_INFO [3];
165
166 FIRST_TIME = 1;
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
167 VPOS = 55;
168 HPOS = 0;
169 GLOB_INFO [0] = .GLOB_CHAN;
170
171 WHILE (.GLOBL_PTR NEQ 0) DO
172 BEGIN
173
174 IF ((.GLOB_CHAN GEQ 0) AND ((.VPOS GEQ 55) OR (.FIRST_TIME NEQ 0)))
175 THEN
176 BEGIN
177 FIRST_TIME = 0;
178
179 IF (.VPOS GEQ 55)
180 THEN
181 BEGIN
182 PCRLF (.GLOB_CHAN);
183 OUTPUT (.GLOB_CHAN, %O'14'); !FORM FEED
184 END;
185
186 VPOS = 1;
187 OUTSTR (.GLOB_CHAN, UPLIT (%ASCIZ'Map of Global Symbols'));
188 PCRLF (.GLOB_CHAN);
189 VPOS = .VPOS + 1;
190 HPOS = 0;
191 PCRLF (.GLOB_CHAN);
192 VPOS = .VPOS + 1;
193 OUTSTR (.GLOB_CHAN, UPLIT (%ASCIZ'Name Value PSECT Module ABS Value'));
194 PCRLF (.GLOB_CHAN);
195 VPOS = .VPOS + 1;
196 END;
197
198 PRC_GLOBL (.GLOBL_PTR, GLOB_INFO);
199 GLOBL_PTR = .GLOBL_PTR [GBL_NEXT];
200 END;
201
202 END; !END OF GLOB
203
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
204 ROUTINE PRC_GLOBL (GLOBL_PTR, GLOB_INFO) = !PROCESS A GLOBAL SYMBOL
205
206 !++
207 ! FUNCTIONAL DESCRIPTION:
208 !
209 ! LIST INFORMATION ABOUT A GLOBAL SYMBOL
210 !
211 ! FORMAL PARAMETERS:
212 !
213 ! GLOBL_PTR - POINTER TO A GLOBAL SYMBOL BLOCK
214 ! GLOB_INFO - POINTER TO INFORMATION VECTOR.
215 !
216 ! IMPLICIT INPUTS:
217 !
218 ! NONE
219 !
220 ! IMPLICIT OUTPUTS:
221 !
222 ! NONE
223 !
224 ! ROUTINE VALUE:
225 !
226 ! NONE
227 !
228 ! SIDE EFFECTS
229 !
230 ! MAY PRINT ONE LINE OF GLOBAL CROSSREF, AND AN ERROR MESSAGE
231 !
232 !--
233
234 BEGIN
235
236 MAP
237 GLOB_INFO : REF VECTOR,
238 GLOBL_PTR : REF GLOBL_BLOCK;
239
240 BIND
241 HPOS = GLOB_INFO [1],
242 VPOS = GLOB_INFO [3];
243
244 LOCAL
245 FLAGS,
246 GLOB_CHAN,
247 MODU_PTR : REF MODU_BLOCK,
248 PSECT_PTR : REF PSECT_BLOCK;
249
250 FLAGS = .GLOBL_PTR [GBL_FLAGS];
251
252 IF (.FLAGS<GBL_FLG_DEF, 1> EQL 0) THEN ERRMSG (0, 16, GLOBL_PTR [GBL_NAME], 0, 0, 0, 0);
253
254 GLOB_CHAN = .GLOB_INFO [0];
255
256 IF (.GLOB_CHAN GEQ 0)
257 THEN
258 BEGIN
259
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
260 IF (.HPOS GTR 0)
261 THEN
262 BEGIN
263 PCRLF (.GLOB_CHAN);
264 VPOS = .VPOS + 1;
265 HPOS = 0;
266 END;
267
268 IF (.GLOBL_PTR [GBL_PSECTS] NEQ 0)
269 THEN
270 BEGIN
271 OUTSTR (.GLOB_CHAN, GLOBL_PTR [GBL_NAME]);
272 OUTPUT (.GLOB_CHAN, %C' ');
273 HPOS = .HPOS + 8;
274
275 IF (.FLAGS<GBL_FLG_DEF, 1> EQL 0)
276 THEN
277 BEGIN
278 OUTSTR (.GLOB_CHAN, UPLIT (%ASCIZ'**Undefined** '));
279 HPOS = .HPOS + 14;
280 OUTSTR (.GLOB_CHAN, UPLIT (%ASCIZ' '));
281 HPOS = .HPOS + 14;
282 END
283 ELSE
284 BEGIN
285 OUTNUM (.GLOB_CHAN, .GLOBL_PTR [GBL_VALUE], 8, 6);
286 OUTPUT (.GLOB_CHAN, %C' ');
287 HPOS = .HPOS + 7;
288 PSECT_PTR = .GLOBL_PTR [GBL_DEF_PSECT];
289
290 IF (.FLAGS<GBL_FLG_REL, 1> NEQ 0)
291 THEN
292 BEGIN
293 OUTSTR (.GLOB_CHAN, UNBLANK (PSECT_PTR [PSECT_NAME]));
294 END
295 ELSE
296 OUTSTR (.GLOB_CHAN, UPLIT (%ASCIZ' '));
297
298 OUTPUT (.GLOB_CHAN, %C' ');
299 HPOS = .HPOS + 7;
300 MODU_PTR = .GLOBL_PTR [GBL_DEF_MODU];
301 OUTSTR (.GLOB_CHAN, MODU_PTR [MODU_NAME]);
302 OUTPUT (.GLOB_CHAN, %C' ');
303 HPOS = .HPOS + 7;
304 OUTNUM (.GLOB_CHAN, GBL_VAL (.GLOBL_PTR), 8, 6);
305 OUTPUT (.GLOB_CHAN, %C' ');
306 HPOS = .HPOS + 7;
307 END;
308
309 GLOB_INFO [2] = 0;
310 FND_CHAIN (.GLOBL_PTR [GBL_PSECTS], SEL_PSECT, .GLOB_INFO);
311 END;
312
313 END;
314
315 END; !OF PRC_GLOBL
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
316 ROUTINE SEL_PSECT (PSECT_PTR, GLOB_INFO) = !PROCESS A PSECT REFERENCE TO A GLOBAL
317
318 !++
319 ! FUNCTIONAL DESCRIPTION:
320 !
321 ! PRINT A PSECT REFERENCE TO A GLOBAL
322 !
323 ! FORMAL PARAMETERS:
324 !
325 ! PSECT_PTR - POINTER TO THE PSECT WHICH REFERENCES THIS GLOBAL
326 ! GLOB_INFO - THE GLOBAL XREF INFORMATION VECTOR.
327 !
328 ! IMPLICIT INPUTS:
329 !
330 ! NONE
331 !
332 ! IMPLICIT OUTPUTS:
333 !
334 ! NONE
335 !
336 ! ROUTINE VALUE:
337 !
338 ! NONE
339 !
340 ! SIDE EFFECTS
341 !
342 ! WRITES ONE PSECT REFERENCE TO THE CURRENT GLOBAL
343 !
344 !--
345
346 BEGIN
347
348 MAP
349 GLOB_INFO : REF VECTOR,
350 PSECT_PTR : REF PSECT_BLOCK;
351
352 BIND
353 HPOS = GLOB_INFO [1],
354 VPOS = GLOB_INFO [3];
355
356 LOCAL
357 GLOB_CHAN;
358
359 GLOB_CHAN = .GLOB_INFO [0];
360
361 IF (.GLOB_INFO [2] NEQ 0)
362 THEN
363 BEGIN
364 OUTPUT (.GLOB_CHAN, %C',');
365 HPOS = .HPOS + 1;
366 END;
367
368 IF (.HPOS GTR 100)
369 THEN
370 BEGIN
371 PCRLF (.GLOB_CHAN);
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
372 VPOS = .VPOS + 1;
373 OUTPUT (.GLOB_CHAN, %O'11');
374 OUTPUT (.GLOB_CHAN, %O'11');
375 HPOS = 17;
376 END;
377
378 OUTSTR (.GLOB_CHAN, UNBLANK (PSECT_PTR [PSECT_NAME]));
379 GLOB_INFO [2] = .GLOB_INFO [2] + 1;
380 HPOS = .HPOS + 6;
381 END; !OF SEL_PSECT
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
382 ROUTINE UNBLANK (POINTER) = !RETURN "BLANK" FOR BLANKS
383
384 !++
385 ! FUNCTIONAL DESCRIPTION:
386 !
387 ! IF THE POINTER POINTS TO SIX BLANKS, RETURN A POINTER TO
388 ! SIX CHARACTERS OF "BLANK", OTHERWISE RETURN THE POINTER.
389 !
390 ! FORMAL PARAMETERS:
391 !
392 ! POINTER - POINTER TO THE STRING TO TEST
393 !
394 ! IMPLICIT INPUTS:
395 !
396 ! NONE
397 !
398 ! IMPLICIT OUTPUTS:
399 !
400 ! NONE
401 !
402 ! ROUTINE VALUE:
403 !
404 ! POINTER TO A SUITABLE STRING
405 !
406 ! SIDE EFFECTS
407 !
408 ! NONE
409 !
410 !--
411
412 BEGIN
413
414 IF (CH$EQL (6, CH$PTR (.POINTER), 6, CH$PTR (UPLIT (%ASCIZ' '))))
415 THEN
416 UPLIT (%ASCIZ' blank')
417 ELSE
418 .POINTER
419
420 END; !OF UNBLANK
421
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
422 GLOBAL ROUTINE GBL_VAL (GLOBL_PTR) = !RETURN VALUE OF GLOBAL SYMBOL
423
424 !++
425 ! FUNCTIONAL DESCRIPTION:
426 !
427 ! IF THE GLOBAL SYMBOL IS ABSOLUTE, JUST RETURN ITS VALUE CELL.
428 ! IF IT IS RELOCATABLE, WE MUST ADD TO THIS THE BASE OF THE
429 ! PSECT IT WAS DEFINED IN AND THE OFFSET INTO THAT PSECT AT
430 ! THE TIME OF THE DEFINITION.
431 ! AN UNDEFINED SYMBOL RETURNS ZERO.
432 !
433 ! FORMAL PARAMETERS:
434 !
435 ! GLOBL_PTR - POINTER TO THE GLOBAL WHOSE VALUE IS TO BE RETURNED
436 !
437 ! IMPLICIT INPUTS:
438 !
439 ! NONE
440 !
441 ! IMPLICIT OUTPUTS:
442 !
443 ! NONE
444 !
445 ! ROUTINE VALUE:
446 !
447 ! THE VALUE OF THE GLOBAL SYMBOL
448 !
449 ! SIDE EFFECTS
450 !
451 ! NONE
452 !
453 !--
454
455 BEGIN
456
457 MAP
458 GLOBL_PTR : REF GLOBL_BLOCK;
459
460 LOCAL
461 FLAGS,
462 PSECT_PTR : REF PSECT_BLOCK;
463
464 FLAGS = .GLOBL_PTR [GBL_FLAGS];
465
466 IF (.FLAGS<GBL_FLG_DEF, 1> EQL 0)
467 THEN
468 0
469 ELSE
470 BEGIN
471
472 IF (.FLAGS<GBL_FLG_REL, 1> EQL 0)
473 THEN
474 .GLOBL_PTR [GBL_VALUE]
475 ELSE
476 BEGIN
477 PSECT_PTR = .GLOBL_PTR [GBL_DEF_PSECT];
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
478 .GLOBL_PTR [GBL_VALUE] + .PSECT_PTR [PSECT_BASE] + .GLOBL_PTR [GBL_DEF_OFFSET]
479 END
480
481 END
482
483 END; !OF GBL_VAL
484
485 END
486
487 ELUDOM
488 ! Local Modes:
489 ! Comment Start:!
490 ! Comment Column:36
491 ! Mode:Fundamental
492 ! Auto Save Mode:2
493 ! End:
DSK:WMAP.XRF[4,31] 31-Aug-79 15:05
ERRMSG 104* 252
FIRST_TIME 149 166# 174 177#
FLAGS 245 250# 252 275 290 461 464#
466 472
FND_CHAIN 109 310
GBL_DEF_MODU 300
GBL_DEF_OFFSET 478
GBL_DEF_PSECT 288 477
GBL_FLAGS 250 464
GBL_FLG_DEF 252 275 466
GBL_FLG_REL 290 472
GBL_NAME 252 271
GBL_NEXT 199
GBL_PSECTS 268 310
GBL_VAL 70# 304 422*
GBL_VALUE 285 474 478
GLOB 66 111*
GLOBL_BLOCK 146 238 458
GLOBL_PTR 111 146 171 198 199# 204 238
250 252 268 271 285 288 300
304 310 422 458 464 474 477
478
GLOB_CHAN 111 169 174 182 183 187 188
191 193 194 246 254# 256 263
271 272 278 280 285 286 293
296 298 301 302 304 305 357
359# 364 371 373 374 378
GLOB_INFO 150 163 164 169# 198 204 237
241 242 254 309# 310 316 349
353 354 359 361 379#
HPOS 163# 168# 190# 241# 260 265# 273#
279# 281# 287# 299# 303# 306# 353#
365# 368 375# 380#
MODU_BLOCK 247
MODU_NAME 301
MODU_PTR 247 300# 301
OUTNUM 105 285 304
OUTPUT 106 183 272 286 298 302 305
364 373 374
OUTSTR 107 187 193 271 278 280 293
296 301 378
PCRLF 108 182 188 191 194 263 371
POINTER 382 414 418
PRC_GLOBL 67 198 204*
PSECT_BASE 478
PSECT_BLOCK 248 350 462
PSECT_NAME 293 378
PSECT_PTR 248 288# 293 316 350 378 462
477# 478
SEL_PSECT 68 310 316*
UNBLANK 69 293 378 382*
VPOS 164# 167# 174 179 186# 189# 192#
195# 242# 264# 354# 372#
WMAP 4#