Trailing-Edge
-
PDP-10 Archives
-
BB-H348C-RM_1982
-
swskit-v21/listings/tkb-vnp/bfio.bpt
There are no other files named bfio.bpt in the archive.
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1 !<TKB-VNP>BFIO.BLI.7, 24-Aug-79 11:29:55, Edit by GUNN
2 !<SAUTER.TKB20>BFIO.BLI.45, 18-Feb-79 10:35:56, Edit by SROBINSON
3 !<SAUTER.TKB20>BFIO.BLI.41, 8-Nov-78 08:10:33, Edit by SROBINSON
4 !<SAUTER.VNP20>BFIO.BLI.27, 30-Sep-78 10:10:31, Edit by SROBINSON
5 !<SAUTER.VNP20>BFIO.BLI.25, 30-Sep-78 08:40:54, Edit by SROBINSON
6 !<SAUTER.VNP20>BFIO.BLI.20, 28-Sep-78 07:29:31, Edit by SROBINSON
7 !<SAUTER.VNP20>BFIO.BLI.17, 27-Sep-78 09:28:49, Edit by SROBINSON
8 !<SAUTER.VNP20>BFIO.BLI.10, 27-Sep-78 06:57:42, Edit by SROBINSON
9 !<SAUTER.VNP20>BFIO.BLI.9, 26-Sep-78 17:09:27, Edit by SROBINSON
10 MODULE BFIO ( !BINARY FILE I/O
11 IDENT = 'X0.1-4'
12 ) =
13 BEGIN
14 !
15 !
16 !
17 ! COPYRIGHT (C) 1978, 1979 BY
18 ! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
19 !
20 !
21 ! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
22 ! ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE
23 ! INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
24 ! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
25 ! OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
26 ! TRANSFERRED.
27 !
28 !
29 ! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
30 ! AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
31 ! CORPORATION.
32 !
33 ! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
34 ! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
35 !
36
37 !++
38 ! FACILITY: TKB-20
39 !
40 ! ABSTRACT:
41 !
42 !
43 ! THIS MODULE READS THE BINARY ("OBJECT") FILE, CHECKING CHECKSUMS.
44 !
45 !
46 ! ENVIRONMENT: TOPS-20 USER MODE
47 !
48 ! AUTHOR: J. SAUTER, CREATION DATE: 20-JAN-78
49 !
50 ! MODIFIED BY:
51 !
52 ! Scott G. Robinson, 26-SEP-78 : VERSION X0.1-2A
53 ! - Modify so that a recovery can be done on a module error
54 ! such as reading a DOS formatted module in RSX mode
55 ! - Fixup so that odd length records are aligned correctly
56 ! - Fix problem with complex relocation that caused constant operands
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
57 ! to not be generated correctly
58 ! - Ensure PSECTs are considered in Radix-50 Order
59 !
60 ! Scott G. Robinson, 18-FEB-79 : VERSION X0.1-3
61 ! - Modify TEXT processing to include a pointer to the MODULE block
62 ! so that BCOR can obtain vital statistics about a load module
63 !
64 ! Dale C. Gunn, 24-AUG-79 : VERSION X0.1-4
65 ! - Modify GSD_PSN to not round text offsets within PSECT's
66 !
67 ! , : VERSION
68 ! 01 -
69 !--
70
71 !<BLF/PAGE>
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
72 !
73 ! TABLE OF CONTENTS:
74 !
75
76 FORWARD ROUTINE
77 RD16, !READ A 16-BIT WORD
78 RDOBBL, !READ AN OBJECT BLOCK
79 RDLBBL, !READ A LIBRARY BLOCK
80 RDFILE : NOVALUE, !READ AN OBJECT FILE
81 RDLIBR : NOVALUE, !READ A LIBRARY FILE
82 GET_BYTE, !GET BYTE FROM OBJ RECORD
83 GET_WORD, !GET WORD FROM OBJ RECORD
84 !
85 ! ROUTINES FOR PROCESSING OBJECT RECORDS
86 !
87 OBJ_GSD : NOVALUE, !PROCESS GSD RECORD
88 OBJ_END_GSD : NOVALUE, !PROCESS END GSD RECORD
89 OBJ_TEXT : NOVALUE, !PROCESS TEXT RECORD
90 OBJ_RLD : NOVALUE, !PROCESS RLD RECORD
91 OBJ_ISD : NOVALUE, !PROCESS INTERNAL SYMBOL DICTIONARY RECORD
92 OBJ_EOM : NOVALUE, !PROCESS END OF MODULE
93 !
94 ! ROUTINES FOR PROCESSING GSD ENTRIES
95 !
96 GSD_MNAME : NOVALUE, !PROCESS MODULE NAME
97 GSD_CNAME : NOVALUE, !PROCESS CSECT NAME ENTRY
98 GSD_ISN : NOVALUE, !PROCESS INTERNAL SYMBOL NAME
99 GSD_TRA : NOVALUE, !PROCESS TRANSFER ADDRESS
100 SEL_GLOBAL, !FIND A GLOBAL SYMBOL
101 GSD_GSN : NOVALUE, !PROCESS GLOBAL SYMBOL NAME
102 SEL_PSECT, !FIND A PSECT BY NAME
103 SEL_SECTOR, !FIND A PSECT BY SECTOR
104 GSD_PSN : NOVALUE, !PROCESS PSECT NAME
105 GSD_IDENT : NOVALUE, !PROCESS AN IDENT
106 GSD_MAP : NOVALUE, !PROCESS A MAPPED ARRAY
107 !
108 ! ROUTINES FOR PROCESSING RLD ENTRIES
109 !
110 M_RLDH, !MAKE RLDH BLOCK
111 M_RLDD, !MAKE RLDD BLOCK
112 GBL_REF : NOVALUE, !RECORD A GLOBAL REFERENCE
113 R_ERR : NOVALUE, !ERROR (NOT USED)
114 R_IR : NOVALUE, !INTERNAL RELOCATION
115 R_GR : NOVALUE, !GLOBAL RELOCATION
116 R_IDR : NOVALUE, !INTERNAL DISPLACED RELOCATION
117 R_GDR : NOVALUE, !GLOBAL DISPLACED RELOCATION
118 R_GAR : NOVALUE, !GLOBAL ADDITIVE RELOCATION
119 R_GADR : NOVALUE, !GLOBAL ADDITIVE DISPLACED RELOCATION
120 R_LCD : NOVALUE, !LOCATION COUNTER DEFINITION
121 R_LCM : NOVALUE, !LOCATION COUNTER MODIFICATION
122 R_PL : NOVALUE, !PROGRAM LIMITS
123 R_PR : NOVALUE, !PSECT RELOCATION
124 R_PDR : NOVALUE, !PSECT DISPLACED RELOCATION
125 R_PAR : NOVALUE, !PSECT ADDITIVE RELOCATION
126 R_PADR : NOVALUE, !PSECT ADDITIVE DISPLACED RELOCATION
127 R_CR : NOVALUE, !COMPLEX RELOCATION
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
128 R_LR : NOVALUE; !LIBRARY RELOCATION
129
130 !
131 ! INCLUDE FILES:
132 !
133
134 LIBRARY 'VNP-LIB.L36';
135
136 !REQUIRE 'BLOCKH.REQ'; !PREPARE TO DEFINE STORAGE BLOCKS
137 !REQUIRE 'FILE.REQ'; !DEFINE FILE STORAGE BLOCKS
138 !REQUIRE 'GLOBL.REQ'; !DEFINE GLOBAL STORAGE BLOCK
139 !REQUIRE 'MODU.REQ'; !DEFINE MODULE STORAGE BLOCK
140 !REQUIRE 'PSECT.REQ'; !DEFINE PSECT STORAGE BLOCK
141 !REQUIRE 'RLDD.REQ'; !DEFINE RLD DATA STORAGE BLOCK
142 !REQUIRE 'RLDH.REQ'; !DEFINE RLD HEADER STORAGE BLOCK
143 !REQUIRE 'ROOT.REQ'; !DEFINE ROOT STORAGE BLOCK
144 !REQUIRE 'TEXTD.REQ'; !DEFINE OBJECT TEXT DATA STORAGE BLOCK
145 !REQUIRE 'TEXTH.REQ'; !DEFINE OBJECT TEXT HEADER STORAGE BLOCK
146 !REQUIRE 'BLOCKT.REQ'; !END OF STORAGE BLOCK DEFINITIONS
147 !
148 ! MACROS:
149 !
150 ! NONE
151 !
152 ! EQUATED SYMBOLS:
153 !
154
155 LITERAL
156 DEBUG = 0;
157
158 !
159 ! OWN STORAGE:
160 !
161 ! NONE
162 !
163 ! EXTERNAL REFERENCES:
164 !
165
166 EXTERNAL ROUTINE
167 OPEN : NOVALUE, !OPEN A FILE
168 CLOSE : NOVALUE, !CLOSE A FILE
169 INPUT, !READ FROM A FILE
170 ERRMSG : NOVALUE, !PRINT AN ERROR MESSAGE
171 GETSTG, !GET STORAGE FROM THE FREE LIST
172 GET_SW, !GET A FILE SWITCH
173 FRESTG, !RETURN STORAGE TO THE FREE LIST
174 GETBLK, !GET A STORAGE BLOCK
175 BLD_CHAIN, !BUILD A CHAIN BLOCK
176 FND_CHAIN, !FIND AN ITEM IN A CHAINED BLOCK
177 RX50, !CONVERT CHARACTER TO RADIX 50
178 R50TOA : NOVALUE, !CONVERT RADIX 50 TO ASCII
179 PCRLF : NOVALUE, !PRINT CRLF
180 OUTPUT : NOVALUE, !WRITE ON A FILE
181 OUTNUM : NOVALUE, !PRINT A NUMBER
182 OUTSTR : NOVALUE; !PRINT AN ASCII STRING
183
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
184 EXTERNAL
185 ROOT : REF ROOT_BLOCK; !ROOT OF DATA STRUCTURE
186
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
187 ROUTINE RD16 (CHAN, CHKSUM) = !READ A 16-BIT WORD
188
189 !++
190 ! FUNCTIONAL DESCRIPTION:
191 !
192 ! READ A 16-BIT WORD, ASSEMBLING IT FROM THE 8-BIT
193 ! INPUT STREAM. MAINTAIN THE CHECKSUM.
194 !
195 ! FORMAL PARAMETERS:
196 !
197 ! CHAN - THE CHANNEL OVER WHICH TO READ THE 8-BIT BYTES
198 ! CHKSUM - ADDRESS OF THE CHECKSUM CELL
199 !
200 ! IMPLICIT INPUTS:
201 !
202 ! NONE
203 !
204 ! IMPLICIT OUTPUTS:
205 !
206 ! NONE
207 !
208 ! ROUTINE VALUE:
209 !
210 ! THE VALUE OF THE 16-BIT WORD READ, OR -1 IF WE REACHED
211 ! END OF FILE ON INPUT.
212 !
213 ! SIDE EFFECTS
214 !
215 ! READS FROM THE INPUT FILE. MAY REACH EOF.
216 !
217 !--
218
219 BEGIN
220
221 LOCAL
222 BYTE1,
223 BYTE2,
224 RESULT;
225
226 IF ((BYTE1 = INPUT (.CHAN)) LSS 0)
227 THEN
228 .BYTE1
229 ELSE
230 BEGIN
231 .CHKSUM = ..CHKSUM + .BYTE1;
232
233 IF ((BYTE2 = INPUT (.CHAN)) LSS 0)
234 THEN
235 .BYTE2
236 ELSE
237 BEGIN
238 .CHKSUM = ..CHKSUM + .BYTE2;
239 RESULT = 0;
240 RESULT<8, 8> = .BYTE2; !HIGH-ORDER BYTE
241 RESULT<0, 8> = .BYTE1; !LOW-ORDER BYTE
242 .RESULT
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
243 END
244
245 END
246
247 END;
248 !
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
249 ROUTINE RDOBBL (CHAN, FILE_PTR, BYTES_READ) = !READ AN OBJECT BLOCK
250
251 !++
252 ! FUNCTIONAL DESCRIPTION:
253 !
254 ! READ A BLOCK OF DATA FROM THE OBJECT FILE. THIS BLOCK
255 ! STARTS WITH A HEADER OF 1 AND ENDS WITH A CHECKSUM.
256 ! LEADING ZEROS ARE IGNORED. AFTER THE HEADER IS A COUNT
257 ! WORD WHICH IS FOLLOWED BY TEXT. THIS TEXT MAY CONTAIN
258 ! SEVERAL RECORDS.
259 ! THIS FORMAT IS USED BY ".OBJ" FILES WHICH HAVE BEEN PASSED
260 ! THROUGH THE RSX-11M UTILITY "FLX".
261 !
262 ! FORMAL PARAMETERS:
263 !
264 ! CHAN - THE CHANNEL OVER WHICH TO READ DATA. IT MUST HAVE
265 ! BEEN OPENED IN WORD MODE.
266 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR
267 ! ERROR MESSAGES.
268 ! BYTES_READ - SET TO THE NUMBER OF BYTES READ FROM THE INPUT
269 ! CHANNEL.
270 !
271 ! IMPLICIT INPUTS:
272 !
273 ! NONE
274 !
275 ! IMPLICIT OUTPUTS:
276 !
277 ! NONE
278 !
279 ! ROUTINE VALUE:
280 !
281 ! A POINTER TO A VECTOR. THE FIRST WORD OF THE VECTOR HAS
282 ! ITS LENGTH IN WORDS. THE SECOND HAS THE LENGTH OF DATA IN
283 ! BYTES. SUBSEQUENT WORDS ARE THE DATA READ, SUITABLE
284 ! FOR SCANNING 8 BITS AT A TIME USING CH$A_RCHAR. IT IS
285 ! THE CALLER'S RESPONSIBILITY TO FREE THIS VECTOR BY CALLING
286 ! FRESTG.
287 ! IF WE REACH EOF, -1 IS RETURNED. IF STORAGE IS NOT AVAILABLE,
288 ! 0 IS RETURNED. AN INVALID FORMAT ALSO RETURNS -1.
289 !
290 ! SIDE EFFECTS
291 !
292 ! READS DATA FROM THE INPUT CHANNEL. MAY GET EOF.
293 ! OBTAINS STORAGE FROM THE FREE LIST.
294 ! WILL RETURN IT ON ERROR.
295 !
296 !--
297
298 BEGIN
299
300 BIND
301 ROUTINE_NAME = UPLIT (%ASCIZ'READ_OBJECT_BLOCK');
302
303 MAP
304 FILE_PTR : REF FILE_BLOCK;
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
305
306 LOCAL
307 BLKPTR,
308 BYTE1,
309 CHKSUM,
310 COUNT,
311 OUTLEN,
312 RESULT : REF VECTOR;
313
314 CHKSUM = 0;
315 .BYTES_READ = 0;
316 RESULT = 0;
317 !
318 ! SKIP BLANK LEADER
319 !
320
321 DO
322 BEGIN
323 BYTE1 = INPUT (.CHAN);
324 .BYTES_READ = ..BYTES_READ + 1;
325 END
326 UNTIL (.BYTE1 NEQ 0);
327
328 IF (.BYTE1 NEQ 1)
329 THEN
330 BEGIN
331
332 IF (..BYTES_READ LEQ 2) THEN RETURN -1;
333
334 IF (.BYTE1 GTR 0) THEN ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
335
336 RESULT = -1;
337 END
338 ELSE
339 BEGIN
340 CHKSUM = .CHKSUM + .BYTE1;
341 BYTE1 = INPUT (.CHAN);
342 .BYTES_READ = ..BYTES_READ + 1;
343
344 IF (.BYTE1 NEQ 0)
345 THEN
346 BEGIN
347 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
348 RESULT = -1;
349 END
350 ELSE
351 BEGIN
352 .BYTES_READ = ..BYTES_READ + 2;
353
354 IF ((OUTLEN = RD16 (.CHAN, CHKSUM)) LSS 6)
355 THEN
356 BEGIN
357 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
358 RESULT = -1;
359 END
360 ELSE
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
361 BEGIN
362
363 IF ((RESULT = GETSTG ((((.OUTLEN - 4)/4) + 3))) LEQ 0)
364 THEN
365 BEGIN
366 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0);
367 END
368 ELSE
369 BEGIN
370 RESULT [0] = (((.OUTLEN - 4)/4) + 3); !AMOUNT TO FREE
371 RESULT [1] = .OUTLEN - 4; !NUMBER OF BYTES
372 BLKPTR = CH$PTR (RESULT [2], -1, 8);
373 COUNT = 0;
374
375 WHILE (((COUNT = .COUNT + 1) LEQ .OUTLEN - 4) AND (.BYTE1 GEQ 0)) DO
376 BEGIN
377 BYTE1 = INPUT (.CHAN);
378 .BYTES_READ = ..BYTES_READ + 1;
379 CHKSUM = .CHKSUM + .BYTE1;
380
381 IF (.BYTE1 GEQ 0) THEN CH$A_WCHAR (.BYTE1, BLKPTR);
382
383 END;
384
385 IF (.BYTE1 LSS 0)
386 THEN
387 BEGIN
388 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
389 FRESTG (.RESULT, .RESULT [0]);
390 RESULT = -1;
391 END
392 ELSE
393 BEGIN
394 BYTE1 = INPUT (.CHAN);
395 .BYTES_READ = ..BYTES_READ + 1;
396
397 IF (.BYTE1 LSS 0)
398 THEN
399 BEGIN
400 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
401 FRESTG (.RESULT, .RESULT [0]);
402 RESULT = -1;
403 END
404 ELSE
405 BEGIN
406 CHKSUM = -.CHKSUM;
407 CHKSUM = .CHKSUM<0, 8>;
408
409 IF (.BYTE1 NEQ .CHKSUM)
410 THEN
411 BEGIN
412 ERRMSG (0, 11, ROUTINE_NAME, FILE_PTR [FILE_NAME], .CHKSUM, .BYTE1, 0);
413 FRESTG (.RESULT, .RESULT [0]);
414 RESULT = -1;
415 END;
416
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
417 END;
418
419 END;
420
421 END;
422
423 END;
424
425 END;
426
427 END;
428
429 .RESULT
430 END; !OF RDOBBL
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
431 ROUTINE RDLBBL (CHAN, FILE_PTR, BYTES_READ) = !READ A LIBRARY BLOCK
432
433 !++
434 ! FUNCTIONAL DESCRIPTION:
435 !
436 ! READ A BLOCK OF DATA FROM THE LIBRARY FILE. THIS BLOCK
437 ! STARTS WITH A COUNT WORD FOLLOWED BY "COUNT" DATA WORDS.
438 ! THE DATA WORDS COMPRISE OBJECT TEXT WHICH MAY CONTAIN
439 ! SEVERAL RECORDS.
440 ! THIS FORMAT IS ALSO USED FOR OBJECT FILES WITHOUT THE "DOS"
441 ! SWITCH.
442 !
443 ! FORMAL PARAMETERS:
444 !
445 ! CHAN - THE CHANNEL OVER WHICH TO READ DATA. IT MUST HAVE
446 ! BEEN OPENED IN WORD MODE.
447 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR
448 ! ERROR MESSAGES.
449 ! BYTES_READ - SET TO THE NUMBER OF BYTES READ FROM THE INPUT
450 ! CHANNEL.
451 !
452 ! IMPLICIT INPUTS:
453 !
454 ! NONE
455 !
456 ! IMPLICIT OUTPUTS:
457 !
458 ! NONE
459 !
460 ! ROUTINE VALUE:
461 !
462 ! A POINTER TO A VECTOR. THE FIRST WORD OF THE VECTOR HAS
463 ! ITS LENGTH IN WORDS. THE SECOND HAS THE LENGTH OF DATA IN
464 ! BYTES. SUBSEQUENT WORDS ARE THE DATA READ, SUITABLE
465 ! FOR SCANNING 8 BITS AT A TIME USING CH$A_RCHAR. IT IS
466 ! THE CALLER'S RESPONSIBILITY TO FREE THIS VECTOR BY CALLING
467 ! FRESTG.
468 ! IF WE REACH EOF, -1 IS RETURNED. IF STORAGE IS NOT AVAILABLE,
469 ! 0 IS RETURNED. AN INVALID FORMAT ALSO RETURNS -1.
470 !
471 ! SIDE EFFECTS
472 !
473 ! READS DATA FROM THE INPUT CHANNEL. MAY GET EOF.
474 ! OBTAINS STORAGE FROM THE FREE LIST.
475 ! WILL RETURN IT ON ERROR.
476 !
477 !--
478
479 BEGIN
480
481 BIND
482 ROUTINE_NAME = UPLIT (%ASCIZ'READ_LIBRARY_BLOCK');
483
484 MAP
485 FILE_PTR : REF FILE_BLOCK;
486
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
487 LOCAL
488 BLKPTR,
489 BYTE1,
490 CHKSUM,
491 COUNT,
492 OUTLEN,
493 RESULT : REF VECTOR;
494
495 RESULT = 0;
496 .BYTES_READ = 0;
497 OUTLEN = 0;
498
499 WHILE (.OUTLEN EQL 0) DO
500 BEGIN
501 OUTLEN = RD16 (.CHAN, CHKSUM);
502 .BYTES_READ = ..BYTES_READ + 2;
503 END;
504
505 IF ((.OUTLEN LSS 2) OR (.OUTLEN GTR 128))
506 THEN
507 BEGIN
508
509 IF (.OUTLEN NEQ -1) THEN ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
510
511 RESULT = -1;
512 END
513 ELSE
514 BEGIN
515
516 IF ((RESULT = GETSTG ((((.OUTLEN)/4) + 3))) LEQ 0)
517 THEN
518 BEGIN
519 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0);
520 END
521 ELSE
522 BEGIN
523 RESULT [0] = (((.OUTLEN)/4) + 3); !AMOUNT TO FREE
524 RESULT [1] = .OUTLEN; !NUMBER OF BYTES
525 BLKPTR = CH$PTR (RESULT [2], -1, 8);
526 COUNT = 0;
527
528 WHILE (((COUNT = .COUNT + 1) LEQ .OUTLEN) AND (.BYTE1 GEQ 0)) DO
529 BEGIN
530 BYTE1 = INPUT (.CHAN);
531 .BYTES_READ = ..BYTES_READ + 1;
532
533 IF (.BYTE1 GEQ 0) THEN CH$A_WCHAR (.BYTE1, BLKPTR);
534
535 END;
536
537 IF (.BYTE1 LSS 0)
538 THEN
539 BEGIN
540 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
541 FRESTG (.RESULT, .RESULT [0]);
542 RESULT = -1;
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
543 END;
544
545 END;
546
547 END;
548
549 !
550 ! SKIP TO VIRTUAL WORD BOUNDARY
551 !
552
553 IF ((..BYTES_READ AND 1) EQL 1)
554 THEN
555 BEGIN
556 INPUT (.CHAN);
557 .BYTES_READ = ..BYTES_READ + 1;
558 END;
559
560 .RESULT
561 END; !OF RDLBBL
562
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
563 GLOBAL ROUTINE RDFILE (CHAN, FILE_PTR) : NOVALUE = !READ AN OBJECT FILE
564
565 !++
566 ! FUNCTIONAL DESCRIPTION:
567 !
568 ! READ AN OBJECT FILE AND PROCESS EACH RECORD.
569 !
570 !
571 ! FORMAL PARAMETERS:
572 !
573 ! CHAN - THE CHANNEL OVER WHICH TO READ DATA. IT MUST HAVE
574 ! BEEN OPENED IN WORD MODE.
575 ! FILE_PTR - POINTER TO FILE BLOCK FOR ERROR MESSAGES
576 ! AND TO SERVE AS A ROOT BLOCK FOR THE DATA READ.
577 !
578 ! IMPLICIT INPUTS:
579 !
580 ! NONE
581 !
582 ! IMPLICIT OUTPUTS:
583 !
584 ! NONE
585 !
586 ! ROUTINE VALUE:
587 !
588 ! NONE
589 !
590 ! SIDE EFFECTS
591 !
592 ! READS DATA FROM THE INPUT CHANNEL. MAY GET EOF.
593 ! OBTAINS STORAGE FROM THE FREE LIST.
594 ! ALL SUCH STORAGE IS RETURNED BEFORE THIS ROUTINE EXITS.
595 ! CALLS THE RECORD PROCESSING ROUTINES, SEVERAL OF WHICH
596 ! OBTAIN STORAGE FROM THE FREE LIST.
597 !
598 !--
599
600 BEGIN
601
602 BIND
603 ROUTINE_NAME = UPLIT (%ASCIZ'READ_FILE');
604
605 MAP
606 FILE_PTR : REF FILE_BLOCK;
607
608 LOCAL
609 ASCVAL : VECTOR [CH$ALLOCATION (LEN_PSECT_NAME)],
610 BLKPTR : REF VECTOR,
611 BYTECTR,
612 BYTEPTR,
613 BYTES_READ,
614 CHAR,
615 COUNTER,
616 DOS_SW,
617 POINTER,
618 PREV_CHAR : VECTOR [3],
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
619 R50VAL,
620 RECORD_TYPE,
621 FIRST_TIME;
622
623 ! DOS_SW = GET_SW (.FILE_PTR, UPLIT (%ASCIZ'DOS', 0));
624 FIRST_TIME = 0;
625
626 DO
627 BEGIN
628
629 IF (.FIRST_TIME EQL 0)
630 THEN
631 BEGIN
632 !
633 ! AT FIRST, TRY READING THE OBJECT MODULE AS DOS FORMAT
634 ! IF THAT FAILS THEN READ IT IN RSX FORMAT AND CONTINUE ON
635 !
636 BLKPTR = RDOBBL (.CHAN, .FILE_PTR, BYTES_READ);
637 DOS_SW = 1;
638
639 IF ((.BLKPTR EQL -1) AND (.BYTES_READ LEQ 2))
640 THEN
641 BEGIN
642 CLOSE (.CHAN);
643 OPEN (.CHAN, FILE_PTR [FILE_NAME], 2, 0, UPLIT (%ASCIZ'OBJ'));
644 BLKPTR = RDLBBL (.CHAN, .FILE_PTR, BYTES_READ);
645 DOS_SW = 0;
646 END;
647
648 FIRST_TIME = 1;
649 END
650 ELSE
651 BLKPTR = (IF (.DOS_SW NEQ 0) THEN RDOBBL ELSE RDLBBL) (.CHAN, .FILE_PTR, BYTES_READ);
652
653 IF (.BLKPTR GTR 0)
654 THEN
655 BEGIN
656 BYTEPTR = CH$PTR (BLKPTR [2], -1, 8);
657 BYTECTR = .BLKPTR [1];
658
659 IF (DEBUG GEQ 2)
660 THEN
661 BEGIN
662 PCRLF (1);
663 OUTNUM (1, .BYTECTR, 10, 0);
664 COUNTER = .BYTECTR;
665 POINTER = .BYTEPTR;
666 PREV_CHAR [0] = 0;
667 PREV_CHAR [1] = 0;
668 PREV_CHAR [2] = 0;
669 R50VAL = 0;
670
671 WHILE ((COUNTER = .COUNTER - 1) GEQ 0) DO
672 BEGIN
673 CHAR = CH$A_RCHAR (POINTER);
674 PCRLF (1);
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
675 OUTSTR (1, UPLIT (%ASCIZ' '));
676 OUTNUM (1, .CHAR, 8, 0);
677 OUTPUT (1, %O'11');
678 R50VAL<24, 8> = .PREV_CHAR [1];
679 R50VAL<16, 8> = .PREV_CHAR [0];
680 R50VAL<8, 8> = .CHAR;
681 R50VAL<0, 8> = .PREV_CHAR [2];
682 R50TOA (.R50VAL, ASCVAL [0]);
683 OUTSTR (1, ASCVAL [0]);
684 PREV_CHAR [0] = .PREV_CHAR [1];
685 PREV_CHAR [1] = .PREV_CHAR [2];
686 PREV_CHAR [2] = .CHAR;
687 END;
688
689 END; !DEBUG
690
691 RECORD_TYPE = GET_BYTE (BYTEPTR, BYTECTR, .FILE_PTR);
692
693 CASE .RECORD_TYPE FROM 1 TO 6 OF
694 SET
695
696 [1] :
697 OBJ_GSD (BYTEPTR, BYTECTR, .FILE_PTR); !GSD
698
699 [2] :
700 OBJ_END_GSD (BYTEPTR, BYTECTR, .FILE_PTR); !END OF GSD
701
702 [3] :
703 OBJ_TEXT (BYTEPTR, BYTECTR, .FILE_PTR); !TEXT
704
705 [4] :
706 OBJ_RLD (BYTEPTR, BYTECTR, .FILE_PTR); !RELOCATION DICTIONARY
707
708 [5] :
709 OBJ_ISD (BYTEPTR, BYTECTR, .FILE_PTR); !INTERNAL SYMBOL DIRECTORY
710
711 [6] :
712 OBJ_EOM (BYTEPTR, BYTECTR, .FILE_PTR); !END OF MODULE
713
714 [OUTRANGE] :
715 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
716 TES;
717
718 FRESTG (.BLKPTR, .BLKPTR [0]);
719 END
720
721 END
722 UNTIL (.BLKPTR LEQ 0);
723
724 END; !OF READ_FILE
725
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
726 GLOBAL ROUTINE RDLIBR (CHAN, FILE_PTR) : NOVALUE = !READ A LIBRARY FILE
727
728 !++
729 ! FUNCTIONAL DESCRIPTION:
730 !
731 ! READ A LIBRARY FILE. ACCEPT ONLY THOSE MODULES WHICH
732 ! DEFINE SYMBOLS CURRENTLY UNDEFINED.
733 !
734 !
735 ! FORMAL PARAMETERS:
736 !
737 ! CHAN - THE CHANNEL OVER WHICH TO READ DATA. IT MUST HAVE
738 ! BEEN OPENED IN WORD MODE.
739 ! FILE_PTR - POINTER TO FILE BLOCK FOR ERROR MESSAGES
740 ! AND TO SERVE AS A ROOT BLOCK FOR THE DATA READ.
741 !
742 ! IMPLICIT INPUTS:
743 !
744 ! NONE
745 !
746 ! IMPLICIT OUTPUTS:
747 !
748 ! NONE
749 !
750 ! ROUTINE VALUE:
751 !
752 ! NONE
753 !
754 ! SIDE EFFECTS
755 !
756 ! READS DATA FROM THE INPUT CHANNEL. MAY GET EOF.
757 ! OBTAINS STORAGE FROM THE FREE LIST.
758 ! ALL SUCH STORAGE IS RETURNED BEFORE THIS ROUTINE EXITS.
759 ! CALLS THE RECORD PROCESSING ROUTINES, SEVERAL OF WHICH
760 ! OBTAIN STORAGE FROM THE FREE LIST.
761 !
762 !--
763
764 BEGIN
765
766 BIND
767 ROUTINE_NAME = UPLIT (%ASCIZ'READ_LIBRARY');
768
769 MAP
770 FILE_PTR : REF FILE_BLOCK;
771
772 LOCAL
773 ASCVAL : VECTOR [CH$ALLOCATION (LEN_GBL_NAME)],
774 BLKPTR : REF VECTOR,
775 BYTECTR,
776 BYTEPTR,
777 BYTES_READ,
778 CHAR,
779 CHKSUM,
780 COUNTER,
781 EPT_BLOCK,
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
782 EPT_BYTE,
783 EPT_NUMBER,
784 EPT_POSITION,
785 EPT_SIZE,
786 FILE_POSITION,
787 FLAGS,
788 GLOBL_PTR : REF GLOBL_BLOCK,
789 GLOBL_PTR1 : REF GLOBL_BLOCK,
790 MOD_SIZE,
791 MODU_DONE,
792 POINTER,
793 PREV_CHAR : VECTOR [3],
794 R50VAL,
795 RECORD_TYPE,
796 SCAN_DONE,
797 SEARCH_DONE;
798
799 !
800 ! READ RELAVENT INFORMATION FROM THE LIBRARY HEADER.
801 !
802 ! FIRST SKIP VERSION AND DATES
803 !
804
805 INCR COUNTER FROM 1 TO 9 DO
806 RD16 (.CHAN, CHKSUM);
807
808 FILE_POSITION = 18;
809 !
810 ! READ EPT SIZE, STARTING BLOCK AND NUMBER
811 !
812 EPT_SIZE = RD16 (.CHAN, CHKSUM);
813 FILE_POSITION = .FILE_POSITION + 2;
814 EPT_SIZE = .EPT_SIZE<0, 8>;
815 EPT_BLOCK = RD16 (.CHAN, CHKSUM);
816 FILE_POSITION = .FILE_POSITION + 2;
817 EPT_NUMBER = RD16 (.CHAN, CHKSUM);
818 FILE_POSITION = .FILE_POSITION + 2;
819 !
820 ! NOW SKIP TO THE BEGINNING OF THE ENTRY POINT TABLE
821 !
822
823 INCR COUNTER FROM (.FILE_POSITION/2) TO ((.EPT_BLOCK - 1)*256) - 1 DO
824 RD16 (.CHAN, CHKSUM);
825
826 FILE_POSITION = (.EPT_BLOCK - 1)*512;
827 !
828 ! SCAN THE ENTRY POINT TABLE, NOTING MODULES THAT NEED TO BE READ.
829 !
830
831 INCR COUNTER FROM 1 TO .EPT_NUMBER DO
832 BEGIN
833 R50VAL = 0;
834 R50VAL<16, 16> = RD16 (.CHAN, CHKSUM);
835 R50VAL<0, 16> = RD16 (.CHAN, CHKSUM);
836 R50TOA (.R50VAL, ASCVAL [0]);
837 EPT_BLOCK = RD16 (.CHAN, CHKSUM);
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
838 EPT_BYTE = RD16 (.CHAN, CHKSUM);
839
840 INCR COUNTER1 FROM 5 TO (.EPT_SIZE/2) DO
841 RD16 (.CHAN, CHKSUM);
842
843 FILE_POSITION = .FILE_POSITION + .EPT_SIZE;
844 SEARCH_DONE = 0;
845 GLOBL_PTR = .ROOT [ROOT_GLOBALS];
846
847 IF (.GLOBL_PTR NEQ 0)
848 THEN
849
850 WHILE (.SEARCH_DONE EQL 0) DO
851
852 IF (CH$GTR (LEN_GBL_NAME, CH$PTR (ASCVAL [0]), LEN_GBL_NAME, CH$PTR (GLOBL_PTR [GBL_NAME])))
853 THEN
854 BEGIN
855 GLOBL_PTR = .GLOBL_PTR [GBL_NEXT];
856
857 IF (.GLOBL_PTR EQL 0) THEN SEARCH_DONE = 2;
858
859 END
860 ELSE
861 SEARCH_DONE = 1;
862
863 IF (.SEARCH_DONE EQL 1)
864 THEN
865 BEGIN
866
867 IF (CH$EQL (LEN_GBL_NAME, CH$PTR (ASCVAL [0]), LEN_GBL_NAME, CH$PTR (GLOBL_PTR [GBL_NAME])))
868 THEN
869 SEARCH_DONE = 3
870
871 END;
872
873 IF (.SEARCH_DONE EQL 3)
874 THEN
875 BEGIN
876 FLAGS = .GLOBL_PTR [GBL_FLAGS];
877
878 IF (.FLAGS<GBL_FLG_DEF, 1> EQL 0)
879 THEN
880 BEGIN !THIS IS AN UNDEFINED GLOBAL
881
882 IF (.GLOBL_PTR [GBL_IN_EPT] EQL 0)
883 THEN
884 BEGIN !NOT ALREADY SEEN
885 GLOBL_PTR [GBL_IN_EPT] = 1;
886 GLOBL_PTR [GBL_EPT_POS] = ((.EPT_BLOCK - 1)*512) + (.EPT_BYTE + 2);
887 END;
888
889 END;
890
891 END;
892
893 END; !OF SCANNING EPT
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
894
895 !
896 ! NOW FIND THE EARLIEST UNSATISFIED REQUEST, SKIP TO THERE IN THE
897 ! LIBRARY FILE, AND PROCESS THAT MODULE.
898 !
899 SCAN_DONE = 0;
900
901 WHILE (.SCAN_DONE EQL 0) DO
902 BEGIN
903 SEARCH_DONE = 0;
904 GLOBL_PTR = .ROOT [ROOT_GLOBALS];
905 EPT_POSITION = 0;
906
907 WHILE (.SEARCH_DONE EQL 0) DO
908 BEGIN
909
910 IF (.GLOBL_PTR EQL 0)
911 THEN
912 SEARCH_DONE = 1
913 ELSE
914 BEGIN
915 FLAGS = .GLOBL_PTR [GBL_FLAGS];
916
917 IF ((.GLOBL_PTR [GBL_IN_EPT] NEQ 0) AND .FLAGS<GBL_FLG_DEF, 1> EQL 0)
918 THEN
919 BEGIN
920
921 IF ((.GLOBL_PTR [GBL_EPT_POS] LSS .EPT_POSITION) OR (.EPT_POSITION EQL 0))
922 THEN
923 BEGIN
924 GLOBL_PTR1 = .GLOBL_PTR;
925 EPT_POSITION = .GLOBL_PTR [GBL_EPT_POS];
926 END;
927
928 END;
929
930 GLOBL_PTR = .GLOBL_PTR [GBL_NEXT];
931 END;
932
933 END;
934
935 IF (.EPT_POSITION EQL 0)
936 THEN
937 SCAN_DONE = 1
938 ELSE
939 BEGIN !WE HAVE A MODULE TO LOAD
940
941 IF (.EPT_POSITION LSS .FILE_POSITION)
942 THEN
943 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
944 0, 0)
945 ELSE
946 BEGIN
947
948 INCR COUNTER FROM (.FILE_POSITION/2) TO (.EPT_POSITION/2) - 1 DO
949 RD16 (.CHAN, CHKSUM);
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
950
951 FILE_POSITION = .EPT_POSITION;
952 !
953 ! WE ARE NOW AT THE HEADER FOR THE MODULE. GET ITS LENGTH BUT
954 ! OTHERWISE SKIP OVER IT.
955 !
956 RD16 (.CHAN, CHKSUM);
957 MOD_SIZE = 0;
958 MOD_SIZE<16, 16> = RD16 (.CHAN, CHKSUM);
959 MOD_SIZE<0, 16> = RD16 (.CHAN, CHKSUM);
960
961 INCR COUNTER FROM 1 TO 5 DO
962 RD16 (.CHAN, CHKSUM);
963
964 FILE_POSITION = .FILE_POSITION + 16;
965 MODU_DONE = 0;
966
967 WHILE (.MODU_DONE EQL 0) DO
968 BEGIN
969 BLKPTR = RDLBBL (.CHAN, .FILE_PTR, BYTES_READ);
970 FILE_POSITION = .FILE_POSITION + .BYTES_READ;
971 MOD_SIZE = .MOD_SIZE - .BYTES_READ;
972
973 IF (.BLKPTR GTR 0)
974 THEN
975 BEGIN
976 BYTEPTR = CH$PTR (BLKPTR [2], -1, 8);
977 BYTECTR = .BLKPTR [1];
978
979 IF (DEBUG GEQ 2)
980 THEN
981 BEGIN
982 PCRLF (1);
983 OUTNUM (1, .BYTECTR, 10, 0);
984 COUNTER = .BYTECTR;
985 POINTER = .BYTEPTR;
986 PREV_CHAR [0] = 0;
987 PREV_CHAR [1] = 0;
988 PREV_CHAR [2] = 0;
989 R50VAL = 0;
990
991 WHILE ((COUNTER = .COUNTER - 1) GEQ 0) DO
992 BEGIN
993 CHAR = CH$A_RCHAR (POINTER);
994 PCRLF (1);
995 OUTSTR (1, UPLIT (%ASCIZ' '));
996 OUTNUM (1, .CHAR, 8, 0);
997 OUTPUT (1, %O'11');
998 R50VAL<24, 8> = .PREV_CHAR [1];
999 R50VAL<16, 8> = .PREV_CHAR [0];
1000 R50VAL<8, 8> = .CHAR;
1001 R50VAL<0, 8> = .PREV_CHAR [2];
1002 R50TOA (.R50VAL, ASCVAL [0]);
1003 OUTSTR (1, ASCVAL [0]);
1004 PREV_CHAR [0] = .PREV_CHAR [1];
1005 PREV_CHAR [1] = .PREV_CHAR [2];
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1006 PREV_CHAR [2] = .CHAR;
1007 END;
1008
1009 END; !DEBUG
1010
1011 RECORD_TYPE = GET_BYTE (BYTEPTR, BYTECTR, .FILE_PTR);
1012
1013 CASE .RECORD_TYPE FROM 1 TO 6 OF
1014 SET
1015
1016 [1] :
1017 OBJ_GSD (BYTEPTR, BYTECTR, .FILE_PTR); !GSD
1018
1019 [2] :
1020 OBJ_END_GSD (BYTEPTR, BYTECTR, .FILE_PTR); !END OF GSD
1021
1022 [3] :
1023 OBJ_TEXT (BYTEPTR, BYTECTR, .FILE_PTR); !TEXT
1024
1025 [4] :
1026 OBJ_RLD (BYTEPTR, BYTECTR, .FILE_PTR); !RELOCATION DICTIONARY
1027
1028 [5] :
1029 OBJ_ISD (BYTEPTR, BYTECTR, .FILE_PTR); !INTERNAL SYMBOL DIRECTORY
1030
1031 [6] :
1032 BEGIN
1033 OBJ_EOM (BYTEPTR, BYTECTR, .FILE_PTR); !END OF MODULE
1034 MODU_DONE = 1;
1035 END;
1036
1037 [OUTRANGE] :
1038 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
1039 TES;
1040
1041 FRESTG (.BLKPTR, .BLKPTR [0]);
1042 END
1043
1044 END; !OF WHILE (.MODU_DONE EQL 0)
1045
1046 END; !OF SEARCH THROUGH UNDEFINED GLOBALS
1047
1048 END;
1049
1050 END;
1051
1052 END; !OF READ_LIBRARY
1053
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1054 ROUTINE GET_BYTE (BYTEPTR, BYTECTR, FILE_PTR) = !GET BYTE
1055
1056 !++
1057 ! FUNCTIONAL DESCRIPTION:
1058 !
1059 ! FETCH A BYTE FROM THE OBJECT RECORD. MAINTAIN
1060 ! THE COUNTER AND GIVE AN ERROR MESSAGE IF IT RUNS OUT.
1061 !
1062 ! FORMAL PARAMETERS:
1063 !
1064 ! BYTEPTR - POINTER TO THE BYTE POINTER
1065 ! BYTECTR - POINTER TO THE COUNTER CELL
1066 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE FILE
1067 ! BEING READ, FOR ERROR MESSAGES.
1068 !
1069 ! IMPLICIT INPUTS:
1070 !
1071 ! THE OBJECT RECORD POINTED TO
1072 !
1073 ! IMPLICIT OUTPUTS:
1074 !
1075 ! NONE
1076 !
1077 ! ROUTINE VALUE:
1078 !
1079 ! THE VALUE OF THE BYTE, OR -1 IF WE RAN OFF THE END.
1080 !
1081 ! SIDE EFFECTS
1082 !
1083 ! NONE
1084 !
1085 !--
1086
1087 BEGIN
1088
1089 BIND
1090 ROUTINE_NAME = UPLIT (%ASCIZ'GET_BYTE');
1091
1092 MAP
1093 FILE_PTR : REF FILE_BLOCK;
1094
1095 IF (..BYTECTR GTR 0)
1096 THEN
1097 BEGIN
1098 .BYTECTR = ..BYTECTR - 1;
1099 CH$A_RCHAR (.BYTEPTR)
1100 END
1101 ELSE
1102 BEGIN
1103 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
1104 -1
1105 END
1106
1107 END; !OF GET_BYTE
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1108 ROUTINE GET_WORD (BYTEPTR, BYTECTR, FILE_PTR) = !GET WORD
1109
1110 !++
1111 ! FUNCTIONAL DESCRIPTION:
1112 !
1113 ! FETCH A WORD FROM THE OBJECT RECORD. MAINTAIN
1114 ! THE COUNTER AND GIVE AN ERROR MESSAGE IF IT RUNS OUT.
1115 !
1116 ! FORMAL PARAMETERS:
1117 !
1118 ! BYTEPTR - POINTER TO THE BYTE POINTER
1119 ! BYTECTR - POINTER TO THE COUNTER CELL
1120 ! FILE_PTR - POINTER TO FILE BLOCK FOR ERROR MESSAGES
1121 !
1122 ! IMPLICIT INPUTS:
1123 !
1124 ! THE OBJECT RECORD POINTED TO
1125 !
1126 ! IMPLICIT OUTPUTS:
1127 !
1128 ! NONE
1129 !
1130 ! ROUTINE VALUE:
1131 !
1132 ! THE VALUE OF THE WORD, OR -1 IF WE RAN OFF THE END.
1133 !
1134 ! SIDE EFFECTS
1135 !
1136 ! NONE
1137 !
1138 !--
1139
1140 BEGIN
1141
1142 BIND
1143 ROUTINE_NAME = UPLIT (%ASCIZ'GET_WORD');
1144
1145 MAP
1146 FILE_PTR : REF FILE_BLOCK;
1147
1148 LOCAL
1149 RESULT;
1150
1151 IF (..BYTECTR GTR 1)
1152 THEN
1153 BEGIN
1154 .BYTECTR = ..BYTECTR - 2;
1155 RESULT = CH$A_RCHAR (.BYTEPTR);
1156 RESULT<8, 8> = CH$A_RCHAR (.BYTEPTR);
1157 .RESULT
1158 END
1159 ELSE
1160 BEGIN
1161 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
1162 -1
1163 END
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1164
1165 END; !OF GET_WORD
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1166 ROUTINE OBJ_GSD (BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !PROCESS GSD RECORD
1167
1168 !++
1169 ! FUNCTIONAL DESCRIPTION:
1170 !
1171 ! PROCESS A GLOBAL SYMBOL DIRECTORY ENTRY IN THE OBJECT
1172 ! FILE. THIS IS DONE BY FETCHING THE PARAMETERS AND THEN
1173 ! TO A SUBROUTINE TO HANDLE THE ENTRY TYPE.
1174 !
1175 ! FORMAL PARAMETERS:
1176 !
1177 ! BYTEPTR - POINTER TO THE BYTE POINTER
1178 ! BYTECTR - POINTER TO THE COUNTER CELL
1179 ! FILE_PTR - POINTER TO THE FILE BLOCK OF THE OBJECT
1180 ! FILE BEING READ. THIS IS FOR ERROR MESSAGES AND TO
1181 ! POINT TO THE DATA READ.
1182 !
1183 ! IMPLICIT INPUTS:
1184 !
1185 ! THE OBJECT RECORD POINTED TO
1186 !
1187 ! IMPLICIT OUTPUTS:
1188 !
1189 ! NONE
1190 !
1191 ! ROUTINE VALUE:
1192 !
1193 ! NONE
1194 !
1195 ! SIDE EFFECTS
1196 !
1197 ! IN MANY CASES, THE HANDLERS FOR THE ENTRY TYPES WILL
1198 ! OBTAIN SPACE FROM THE FREE STORAGE LIST
1199 !
1200 !--
1201
1202 BEGIN
1203
1204 BIND
1205 ROUTINE_NAME = UPLIT (%ASCIZ'OBJ_GSD');
1206
1207 MAP
1208 FILE_PTR : REF FILE_BLOCK;
1209
1210 LOCAL
1211 MODU_PTR : REF MODU_BLOCK,
1212 CHAR,
1213 R50VAL,
1214 ASCVAL : VECTOR [CH$ALLOCATION (LEN_PSECT_NAME)],
1215 FLAGS,
1216 ETYPE,
1217 VALUE;
1218
1219 IF (DEBUG GEQ 1)
1220 THEN
1221 BEGIN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1222 PCRLF (1);
1223 OUTPUT (1, %O'11');
1224 OUTSTR (1, UPLIT (%ASCIZ'GSD RECORD, LENGTH = '));
1225 OUTNUM (1, ..BYTECTR, 10, 0);
1226 END; !DEBUG
1227
1228 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) NEQ 0)
1229 THEN
1230 BEGIN
1231
1232 IF (.MODU_PTR [MODU_FLAG_EGSD] NEQ 0) THEN ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0);
1233
1234 END;
1235
1236 CHAR = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR); !UNUSED BYTE
1237
1238 DO
1239 BEGIN
1240 R50VAL = 0;
1241 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
1242 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
1243 R50TOA (.R50VAL, ASCVAL [0]);
1244 FLAGS = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR);
1245 ETYPE = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR);
1246 VALUE = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
1247
1248 CASE .ETYPE FROM 0 TO 7 OF
1249 SET
1250
1251 [0] :
1252 GSD_MNAME (ASCVAL [0], .FLAGS, .VALUE, .FILE_PTR);
1253
1254 [1] :
1255 GSD_CNAME (ASCVAL [0], .FLAGS, .VALUE, .FILE_PTR);
1256
1257 [2] :
1258 GSD_ISN (ASCVAL [0], .FLAGS, .VALUE, .FILE_PTR);
1259
1260 [3] :
1261 GSD_TRA (ASCVAL [0], .FLAGS, .VALUE, .FILE_PTR);
1262
1263 [4] :
1264 GSD_GSN (ASCVAL [0], .FLAGS, .VALUE, .FILE_PTR);
1265
1266 [5] :
1267 GSD_PSN (ASCVAL [0], .FLAGS, .VALUE, .FILE_PTR);
1268
1269 [6] :
1270 GSD_IDENT (ASCVAL [0], .FLAGS, .VALUE, .FILE_PTR);
1271
1272 [7] :
1273 GSD_MAP (ASCVAL [0], .FLAGS, .VALUE, .FILE_PTR);
1274
1275 [OUTRANGE] :
1276 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
1277 TES;
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1278
1279 END
1280 UNTIL (..BYTECTR EQL 0);
1281
1282 END; !OF OBJ_GSD
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1283 ROUTINE OBJ_END_GSD (BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !PROCESS END GSD RECORD
1284
1285 !++
1286 ! FUNCTIONAL DESCRIPTION:
1287 !
1288 ! PROCESS THE END GSD RECORD.
1289 !
1290 ! FORMAL PARAMETERS:
1291 !
1292 ! BYTEPTR - POINTER TO THE BYTE POINTER
1293 ! BYTECTR - POINTER TO THE COUNTER CELL
1294 ! FILE_PTR - POINTER TO FILE BLOCK
1295 !
1296 ! IMPLICIT INPUTS:
1297 !
1298 ! NONE
1299 !
1300 ! IMPLICIT OUTPUTS:
1301 !
1302 ! SETS A FLAG WHICH FORBIDS ANY MORE GSD RECORDS IN
1303 ! THIS MODULE.
1304 !
1305 ! ROUTINE VALUE:
1306 !
1307 ! NONE
1308 !
1309 ! SIDE EFFECTS
1310 !
1311 ! NONE
1312 !
1313 !--
1314
1315 BEGIN
1316
1317 BIND
1318 ROUTINE_NAME = UPLIT (%ASCIZ'OBJ_END_GSD');
1319
1320 MAP
1321 FILE_PTR : REF FILE_BLOCK;
1322
1323 LOCAL
1324 MODU_PTR : REF MODU_BLOCK;
1325
1326 IF (DEBUG GEQ 1)
1327 THEN
1328 BEGIN
1329 PCRLF (1);
1330 OUTPUT (1, %O'11');
1331 OUTSTR (1, UPLIT (%ASCIZ'END GSD RECORD, LENGTH = '));
1332 OUTNUM (1, ..BYTECTR, 10, 0);
1333 END; !DEBUG
1334
1335 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
1336 THEN
1337 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
1338 0, 0)
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1339 ELSE
1340 BEGIN
1341
1342 IF (.MODU_PTR [MODU_FLAG_EGSD] NEQ 0)
1343 THEN
1344 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
1345 ELSE
1346 BEGIN
1347 MODU_PTR [MODU_FLAG_EGSD] = 1;
1348 END;
1349
1350 END;
1351
1352 END; !OF OBJ_END_GSD
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1353 ROUTINE OBJ_TEXT (BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !PROCESS TEXT RECORD
1354
1355 !++
1356 ! FUNCTIONAL DESCRIPTION:
1357 !
1358 ! PROCESS AN OBJECT TEXT RECORD
1359 !
1360 ! FORMAL PARAMETERS:
1361 !
1362 ! BYTEPTR - POINTER TO THE BYTE POINTER
1363 ! BYTECTR - POINTER TO THE COUNTER CELL
1364 ! FILE_PTR - POINTER TO FILE BLOCK
1365 !
1366 ! IMPLICIT INPUTS:
1367 !
1368 ! THE OBJECT RECORD POINTED TO
1369 !
1370 ! IMPLICIT OUTPUTS:
1371 !
1372 ! PUTS THE TEXT IN THE DATA STRUCTURE
1373 !
1374 ! ROUTINE VALUE:
1375 !
1376 ! NONE
1377 !
1378 ! SIDE EFFECTS
1379 !
1380 ! OBTAINS SPACE FROM THE FREE LIST
1381 !
1382 !--
1383
1384 BEGIN
1385
1386 BIND
1387 ROUTINE_NAME = UPLIT (%ASCIZ'OBJ_TEXT');
1388
1389 MAP
1390 FILE_PTR : REF FILE_BLOCK;
1391
1392 LOCAL
1393 CHAR,
1394 LOAD_ADDRESS,
1395 MODU_PTR : REF MODU_BLOCK,
1396 NEXT_TEXTD_PTR : REF TEXTD_BLOCK,
1397 NEXT_TEXTH_PTR : REF TEXTH_BLOCK,
1398 PSECT_PTR : REF PSECT_BLOCK,
1399 TEXTD_ADDR,
1400 TEXTD_PTR : REF TEXTD_BLOCK,
1401 TEXTH_PTR : REF TEXTH_BLOCK;
1402
1403 IF (DEBUG GEQ 1)
1404 THEN
1405 BEGIN
1406 PCRLF (1);
1407 OUTPUT (1, %O'11');
1408 OUTSTR (1, UPLIT (%ASCIZ'TEXT RECORD, LENGTH = '));
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1409 OUTNUM (1, ..BYTECTR, 10, 0);
1410 END; !DEBUG
1411
1412 CHAR = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR); !UNUSED BYTE
1413 LOAD_ADDRESS = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
1414
1415 IF (DEBUG GEQ 1)
1416 THEN
1417 BEGIN
1418 OUTSTR (1, UPLIT (%ASCIZ', LOAD ADDRESS = '));
1419 OUTNUM (1, .LOAD_ADDRESS, 8, 0);
1420 END; !DEBUG
1421
1422 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
1423 THEN
1424 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
1425 ELSE
1426 BEGIN !WE HAVE A CURRENT MODULE
1427
1428 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
1429 THEN
1430 ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0)
1431 ELSE
1432 BEGIN !WE HAVE A CURRENT PSECT
1433 PSECT_PTR [PSECT_LLA] = .LOAD_ADDRESS + .PSECT_PTR [PSECT_OFFSET];
1434 !
1435 ! FIND THE LAST TEXT RECORD FOR THIS PSECT
1436 !
1437 TEXTH_PTR = 0;
1438 NEXT_TEXTH_PTR = .PSECT_PTR [PSECT_TEXT];
1439
1440 WHILE (.NEXT_TEXTH_PTR NEQ 0) DO
1441 BEGIN
1442 TEXTH_PTR = .NEXT_TEXTH_PTR;
1443 NEXT_TEXTH_PTR = .TEXTH_PTR [TEXTH_NEXT];
1444 END;
1445
1446 IF ((NEXT_TEXTH_PTR = GETBLK (TEXTH_TYP, TEXTH_LEN)) EQL 0)
1447 THEN
1448 ERRMSG (0, 1, ROUTINE_NAME, 0,
1449 0, 0, 0)
1450 ELSE
1451 BEGIN !WE HAVE STORAGE FOR TEXT HEADER
1452 NEXT_TEXTH_PTR [TEXTH_PREV] = .TEXTH_PTR;
1453
1454 IF (.TEXTH_PTR NEQ 0)
1455 THEN
1456 TEXTH_PTR [TEXTH_NEXT] = .NEXT_TEXTH_PTR
1457 ELSE
1458 PSECT_PTR [PSECT_TEXT] = .NEXT_TEXTH_PTR;
1459
1460 TEXTH_PTR = .NEXT_TEXTH_PTR;
1461 TEXTH_PTR [TEXTH_PSECT] = .PSECT_PTR;
1462 TEXTH_PTR [TEXTH_OFFSET] = .LOAD_ADDRESS + .PSECT_PTR [PSECT_OFFSET];
1463 TEXTH_PTR [TEXTH_MODU] = .FILE_PTR [FILE_MODU];
1464
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1465 IF ((TEXTD_PTR = GETBLK (TEXTD_TYP, TEXTD_LEN)) EQL 0)
1466 THEN
1467 ERRMSG (0, 1, ROUTINE_NAME, 0, 0,
1468 0, 0)
1469 ELSE
1470 BEGIN !WE HAVE STORAGE FOR THE FIRST TEXT DATA BLOCK
1471 TEXTH_PTR [TEXTH_DATA] = .TEXTD_PTR;
1472 TEXTD_PTR [TEXTD_TH] = .TEXTH_PTR;
1473 TEXTD_ADDR = CH$PTR (TEXTD_PTR [TEXTD_DATA], -1, 8);
1474
1475 WHILE (..BYTECTR GTR 0) DO
1476 BEGIN
1477 CHAR = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR);
1478
1479 IF (DEBUG GEQ 1)
1480 THEN
1481 BEGIN
1482 PCRLF (1);
1483 OUTPUT (1, %O'11');
1484 OUTPUT (1, %O'11');
1485 OUTSTR (1, UPLIT (%ASCIZ'TEXT BYTE = '));
1486 OUTNUM (1, .CHAR, 8, 0);
1487 END; !DEBUG
1488
1489 IF (.TEXTD_PTR [TEXTD_NUM_BYTES] EQL MAX_TEXT_DATA)
1490 THEN
1491 BEGIN
1492
1493 IF ((NEXT_TEXTD_PTR = GETBLK (TEXTD_TYP, TEXTD_LEN)) EQL 0)
1494 THEN
1495 ERRMSG (0, 1,
1496 ROUTINE_NAME, 0, 0, 0, 0)
1497 ELSE
1498 BEGIN
1499 NEXT_TEXTD_PTR [TEXTD_PREV] = .TEXTD_PTR;
1500 TEXTD_PTR [TEXTD_NEXT] = .NEXT_TEXTD_PTR;
1501 TEXTD_PTR = .NEXT_TEXTD_PTR;
1502 TEXTD_PTR [TEXTD_TH] = .TEXTH_PTR;
1503 TEXTD_ADDR = CH$PTR (TEXTD_PTR [TEXTD_DATA], -1, 8);
1504 END;
1505
1506 END;
1507
1508 CH$A_WCHAR (.CHAR, TEXTD_ADDR);
1509 TEXTD_PTR [TEXTD_NUM_BYTES] = .TEXTD_PTR [TEXTD_NUM_BYTES] + 1;
1510 END;
1511
1512 END; !OF PER-CHARACTER ITERATION
1513
1514 END;
1515
1516 END;
1517
1518 END;
1519
1520 END; !OF OBJ_TEXT
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1521 ROUTINE OBJ_RLD (BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !PROCESS RLD RECORD
1522
1523 !++
1524 ! FUNCTIONAL DESCRIPTION:
1525 !
1526 ! PROCESS THE RELOCATION DICTIONARY RECORD
1527 ! BY FETCHING THE COMMAND, BYTE FLAG AND DISPLACEMENT,
1528 ! THEN DISPATCHING.
1529 !
1530 ! FORMAL PARAMETERS:
1531 !
1532 ! BYTEPTR - POINTER TO THE BYTE POINTER
1533 ! BYTECTR - POINTER TO THE COUNTER CELL
1534 ! FILE_PTR - POINTER TO OBJECT FILE BLOCK, FOR ERROR
1535 ! MESSAGES AND TO HOLD DATA READ.
1536 !
1537 ! IMPLICIT INPUTS:
1538 !
1539 ! THE OBJECT RECORD POINTED TO
1540 !
1541 ! IMPLICIT OUTPUTS:
1542 !
1543 ! MODIFIES THE DATA STRUCTURE
1544 !
1545 ! ROUTINE VALUE:
1546 !
1547 ! NONE
1548 !
1549 ! SIDE EFFECTS
1550 !
1551 ! GETS STORAGE FROM THE FREE LIST
1552 !
1553 !--
1554
1555 BEGIN
1556
1557 MAP
1558 FILE_PTR : REF FILE_BLOCK;
1559
1560 LOCAL
1561 CHAR,
1562 CMD,
1563 MODIF,
1564 DISP;
1565
1566 IF (DEBUG GEQ 1)
1567 THEN
1568 BEGIN
1569 PCRLF (1);
1570 OUTPUT (1, %O'11');
1571 OUTSTR (1, UPLIT (%ASCIZ'RELOCATION DIRECTORY RECORD, LENGTH = '));
1572 OUTNUM (1, ..BYTECTR, 10, 0);
1573 END; !DEBUG
1574
1575 CHAR = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR); !UNUSED BYTE
1576
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1577 DO
1578 BEGIN
1579 CMD = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR);
1580
1581 IF (.CMD NEQ 0)
1582 THEN
1583 BEGIN
1584 MODIF = .CMD<7, 1>;
1585 CMD = .CMD<0, 6>;
1586 DISP = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR);
1587
1588 CASE .CMD FROM %O'1' TO %O'20' OF
1589 SET
1590
1591 [%O'1'] :
1592 R_IR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1593
1594 [%O'2'] :
1595 R_GR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1596
1597 [%O'3'] :
1598 R_IDR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1599
1600 [%O'4'] :
1601 R_GDR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1602
1603 [%O'5'] :
1604 R_GAR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1605
1606 [%O'6'] :
1607 R_GADR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1608
1609 [%O'7'] :
1610 R_LCD (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1611
1612 [%O'10'] :
1613 R_LCM (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1614
1615 [%O'11'] :
1616 R_PL (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1617
1618 [%O'12'] :
1619 R_PR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1620
1621 [%O'13'] :
1622 R_ERR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1623
1624 [%O'14'] :
1625 R_PDR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1626
1627 [%O'15'] :
1628 R_PAR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1629
1630 [%O'16'] :
1631 R_PADR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1632
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1633 [%O'17'] :
1634 R_CR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1635
1636 [%O'20'] :
1637 R_LR (.MODIF, .DISP, .BYTEPTR, .BYTECTR, .FILE_PTR);
1638
1639 [OUTRANGE] :
1640 ERRMSG (0, 10, UPLIT (%ASCIZ'OBJ_RLD'), FILE_PTR [FILE_NAME], 0, 0, 0);
1641 TES;
1642
1643 END;
1644
1645 END
1646 UNTIL (..BYTECTR EQL 0);
1647
1648 END; !OF OBJ_RLD
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1649 ROUTINE OBJ_ISD (BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !PROCESS ISD RECORD
1650
1651 !++
1652 ! FUNCTIONAL DESCRIPTION:
1653 !
1654 ! PROCESS INTERNAL SYMBOL DIRECTORY RECORD.
1655 !
1656 ! FORMAL PARAMETERS:
1657 !
1658 ! BYTEPTR - POINTER TO THE BYTE POINTER
1659 ! BYTECTR - POINTER TO THE COUNTER CELL
1660 ! FILE_PTR - POINTER TO OBJECT FILE BLOCK
1661 !
1662 ! IMPLICIT INPUTS:
1663 !
1664 ! THE OBJECT RECORD POINTED TO
1665 !
1666 ! IMPLICIT OUTPUTS:
1667 !
1668 ! ADDS THE INTERNAL SYMBOLS TO THE DATA STRUCTURE
1669 !
1670 ! ROUTINE VALUE:
1671 !
1672 ! NONE
1673 !
1674 ! SIDE EFFECTS
1675 !
1676 ! NONE
1677 !
1678 !--
1679
1680 BEGIN
1681
1682 BIND
1683 ROUTINE_NAME = UPLIT (%ASCIZ'OBJ_ISD');
1684
1685 IF (DEBUG GEQ 1)
1686 THEN
1687 BEGIN
1688 PCRLF (1);
1689 OUTPUT (1, %O'11');
1690 OUTSTR (1, UPLIT (%ASCIZ'INTERNAL SYMBOL DIRECTORY RECORD, LENGTH = '));
1691 OUTNUM (1, ..BYTECTR, 10, 0);
1692 END; !DEBUG
1693
1694 ERRMSG (0, 12, ROUTINE_NAME, 0, 0, 0, 0);
1695 END; !OF OBJ_ISD
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1696 ROUTINE OBJ_EOM (BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !PROCESS END OF MODULE RECORD
1697
1698 !++
1699 ! FUNCTIONAL DESCRIPTION:
1700 !
1701 ! PROCESS THE END MODULE RECORD.
1702 !
1703 ! FORMAL PARAMETERS:
1704 !
1705 ! BYTEPTR - POINTER TO THE BYTE POINTER
1706 ! BYTECTR - POINTER TO THE COUNTER CELL
1707 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
1708 !
1709 ! IMPLICIT INPUTS:
1710 !
1711 ! THE OBJECT RECORD POINTED TO
1712 !
1713 ! IMPLICIT OUTPUTS:
1714 !
1715 ! SETS A FLAG TO INDICATE THAT WE ARE BETWEEN MODULES.
1716 ! AN EOF IS OK IN THIS CONTEXT.
1717 !
1718 ! ROUTINE VALUE:
1719 !
1720 ! NONE
1721 !
1722 ! SIDE EFFECTS
1723 !
1724 ! NONE
1725 !
1726 !--
1727
1728 BEGIN
1729
1730 BIND
1731 ROUTINE_NAME = UPLIT (%ASCIZ'OBJ_EOM');
1732
1733 MAP
1734 FILE_PTR : REF FILE_BLOCK;
1735
1736 LOCAL
1737 MODU_PTR : REF MODU_BLOCK;
1738
1739 IF (DEBUG GEQ 1)
1740 THEN
1741 BEGIN
1742 PCRLF (1);
1743 OUTPUT (1, %O'11');
1744 OUTSTR (1, UPLIT (%ASCIZ'END OF MODULE RECORD, LENGTH = '));
1745 OUTNUM (1, ..BYTECTR, 10, 0);
1746 END; !DEBUG
1747
1748 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
1749 THEN
1750 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
1751 0, 0)
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1752 ELSE
1753 BEGIN
1754
1755 IF (.MODU_PTR [MODU_FLAG_EGSD] EQL 0)
1756 THEN
1757 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
1758 ELSE
1759 BEGIN
1760 FILE_PTR [FILE_MODU] = 0;
1761 END;
1762
1763 END;
1764
1765 END; !OF OBJ_EOM
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1766 ROUTINE GSD_MNAME (ASCPTR, FLAGS, VALUE, FILE_PTR) : NOVALUE = !PROCESS MODULE NAME ENTRY
1767
1768 !++
1769 ! FUNCTIONAL DESCRIPTION:
1770 !
1771 ! PROCESS THE MODULE NAME ENTRY OF THE GSD RECORD
1772 !
1773 ! FORMAL PARAMETERS:
1774 !
1775 ! ASCPTR - POINTER TO NAME, IN ASCII
1776 ! FLAGS - THE FLAGS BYTE
1777 ! VALUE - THE VALUE WORD
1778 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
1779 !
1780 ! IMPLICIT INPUTS:
1781 !
1782 ! NONE
1783 !
1784 ! IMPLICIT OUTPUTS:
1785 !
1786 ! ADDS THE MODULE NAME TO THE DATA STRUCTURE
1787 !
1788 ! ROUTINE VALUE:
1789 !
1790 ! NONE
1791 !
1792 ! SIDE EFFECTS
1793 !
1794 ! OBTAINS SPACE FROM THE FREE LIST
1795 !
1796 !--
1797
1798 BEGIN
1799
1800 BIND
1801 ROUTINE_NAME = UPLIT (%ASCIZ'GSD_MNAME');
1802
1803 MAP
1804 FILE_PTR : REF FILE_BLOCK;
1805
1806 LOCAL
1807 MODU_PTR : REF MODU_BLOCK;
1808
1809 IF (DEBUG GEQ 1)
1810 THEN
1811 BEGIN
1812 PCRLF (1);
1813 OUTPUT (1, %O'11');
1814 OUTPUT (1, %O'11');
1815 OUTSTR (1, UPLIT (%ASCIZ'MODULE NAME, NAME = '));
1816 OUTSTR (1, .ASCPTR);
1817 OUTSTR (1, UPLIT (%ASCIZ', FLAGS = '));
1818 OUTNUM (1, .FLAGS, 8, 0);
1819 OUTSTR (1, UPLIT (%ASCIZ', VALUE = '));
1820 OUTNUM (1, .VALUE, 8, 0);
1821 END; !DEBUG
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1822
1823 !
1824
1825 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) NEQ 0)
1826 THEN
1827 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
1828 0, 0)
1829 ELSE
1830 BEGIN !THERE IS NOT ALREADY A MODULE BEING PROCESSED
1831
1832 IF ((MODU_PTR = GETBLK (MODU_TYP, MODU_LEN)) EQL 0)
1833 THEN
1834 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
1835 ELSE
1836 BEGIN !WE HAVE STORAGE FOR THE MODULE NAME
1837
1838 IF ((FILE_PTR [FILE_DOWN] = BLD_CHAIN (.FILE_PTR, .FILE_PTR [FILE_DOWN], .MODU_PTR)) EQL 0)
1839 THEN
1840 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
1841 ELSE
1842 BEGIN !WE HAVE STORAGE FOR THE CHAIN BLOCK
1843 CH$MOVE (LEN_MODU_NAME, CH$PTR (.ASCPTR), CH$PTR (MODU_PTR [MODU_NAME]));
1844 FILE_PTR [FILE_MODU] = .MODU_PTR;
1845 MODU_PTR [MODU_OBJ_FILE] = .FILE_PTR;
1846 MODU_PTR [MODU_SECTOR] = 0;
1847
1848 IF ((ROOT [ROOT_MODULES] = BLD_CHAIN (.ROOT, .ROOT [ROOT_MODULES], .MODU_PTR)) EQL 0)
1849 THEN
1850 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0);
1851
1852 END;
1853
1854 END;
1855
1856 END;
1857
1858 END; !OF GSD_MNAME
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1859 ROUTINE GSD_CNAME (ASCPTR, FLAGS, VALUE, FILE_PTR) : NOVALUE = !PROCESS CSECT NAME ENTRY
1860
1861 !++
1862 ! FUNCTIONAL DESCRIPTION:
1863 !
1864 ! PROCESS THE CSECT NAME ENTRY OF THE GSD RECORD
1865 ! THIS IS IMPLEMENTED BY CONVERTING THE CSECT INTO
1866 ! AN APPROPRIATE PSECT.
1867 !
1868 ! FORMAL PARAMETERS:
1869 !
1870 ! ASCPTR - POINTER TO NAME, IN ASCII
1871 ! FLAGS - THE FLAGS BYTE
1872 ! VALUE - THE VALUE WORD
1873 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
1874 !
1875 ! IMPLICIT INPUTS:
1876 !
1877 ! NONE
1878 !
1879 ! IMPLICIT OUTPUTS:
1880 !
1881 ! NONE
1882 !
1883 ! ROUTINE VALUE:
1884 !
1885 ! NONE
1886 !
1887 ! SIDE EFFECTS
1888 !
1889 ! CALLS GSD_PSN
1890 !
1891 !--
1892
1893 BEGIN
1894
1895 BIND
1896 ROUTINE_NAME = UPLIT (%ASCIZ'GSD_CNAME');
1897
1898 MAP
1899 FILE_PTR : REF FILE_BLOCK;
1900
1901 LOCAL
1902 MODU_PTR : REF MODU_BLOCK;
1903
1904 IF (DEBUG GEQ 1)
1905 THEN
1906 BEGIN
1907 PCRLF (1);
1908 OUTPUT (1, %O'11');
1909 OUTPUT (1, %O'11');
1910 OUTSTR (1, UPLIT (%ASCIZ'CSECT NAME, NAME = '));
1911 OUTSTR (1, .ASCPTR);
1912 OUTSTR (1, UPLIT (%ASCIZ', FLAGS = '));
1913 OUTNUM (1, .FLAGS, 8, 0);
1914 OUTSTR (1, UPLIT (%ASCIZ', VALUE = '));
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1915 OUTNUM (1, .VALUE, 8, 0);
1916 END; !DEBUG
1917
1918 !
1919 ! TURN THE CSECT NAME ENTRY INTO A PSECT BY CALLING GSD_PSN WITH
1920 ! THE APPROPRIATE ARGUMENTS.
1921 !
1922
1923 IF (CH$EQL (LEN_PSECT_NAME, CH$PTR (.ASCPTR), LEN_PSECT_NAME,
1924 CH$PTR (UPLIT (%ASCIZ' '
1925 ))))
1926 THEN
1927 BEGIN !BLANK CSECT, MAKE LOCAL PSECT
1928 GSD_PSN (.ASCPTR, (1^PSECT_FLG_REL), .VALUE, .FILE_PTR);
1929 END
1930 ELSE
1931
1932 IF (CH$EQL (LEN_PSECT_NAME, CH$PTR (.ASCPTR), LEN_PSECT_NAME,
1933 CH$PTR (UPLIT (%ASCIZ'. ABS.'
1934 ))))
1935 THEN
1936 BEGIN !ASECT, MAKE AN ABSOLUTE PSECT
1937 GSD_PSN (UPLIT (%ASCIZ'. ABS.'), ((1^PSECT_FLG_GBL) + (1^PSECT_FLG_OVR)), .VALUE, .FILE_PTR);
1938 END
1939 ELSE
1940 BEGIN !NAMED CSECT, MAKE A GLOBAL PSECT
1941 GSD_PSN (.ASCPTR, ((1^PSECT_FLG_GBL) + (1^PSECT_FLG_REL) + (1^PSECT_FLG_OVR)), .VALUE, .FILE_PTR);
1942 END;
1943
1944 END; !OF GSD_CNAME
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1945 ROUTINE GSD_ISN (ASCPTR, FLAGS, VALUE, FILE_PTR) : NOVALUE = !PROCESS INTERNAL SYMBOL NAME ENTRY
1946
1947 !++
1948 ! FUNCTIONAL DESCRIPTION:
1949 !
1950 ! PROCESS THE INTERNAL SYMBOL NAME ENTRY OF THE GSD RECORD.
1951 ! THIS IS NOT IMPLEMENTED SINCE MACY11 DOES NOT PRODUCE
1952 ! THESE RECORDS.
1953 !
1954 ! FORMAL PARAMETERS:
1955 !
1956 ! ASCPTR - POINTER TO NAME, IN ASCII
1957 ! FLAGS - THE FLAGS BYTE
1958 ! VALUE - THE VALUE WORD
1959 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
1960 !
1961 ! IMPLICIT INPUTS:
1962 !
1963 ! NONE
1964 !
1965 ! IMPLICIT OUTPUTS:
1966 !
1967 ! NONE
1968 !
1969 ! ROUTINE VALUE:
1970 !
1971 ! NONE
1972 !
1973 ! SIDE EFFECTS
1974 !
1975 ! PRINTS AN ERROR MESSAGE
1976 !
1977 !--
1978
1979 BEGIN
1980
1981 BIND
1982 ROUTINE_NAME = UPLIT (%ASCIZ'GSD_ISN');
1983
1984 IF (DEBUG GEQ 1)
1985 THEN
1986 BEGIN
1987 PCRLF (1);
1988 OUTPUT (1, %O'11');
1989 OUTPUT (1, %O'11');
1990 OUTSTR (1, UPLIT (%ASCIZ'INTERNAL SYMBOL NAME, NAME = '));
1991 OUTSTR (1, .ASCPTR);
1992 OUTSTR (1, UPLIT (%ASCIZ', FLAGS = '));
1993 OUTNUM (1, .FLAGS, 8, 0);
1994 OUTSTR (1, UPLIT (%ASCIZ', VALUE = '));
1995 OUTNUM (1, .VALUE, 8, 0);
1996 END; !DEBUG
1997
1998 ERRMSG (0, 12, ROUTINE_NAME, 0, 0, 0, 0);
1999 END; !OF GSD_ISN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2000 ROUTINE GSD_TRA (ASCPTR, FLAGS, VALUE, FILE_PTR) : NOVALUE = !PROCESS TRANSFER ADDRESS ENTRY
2001
2002 !++
2003 ! FUNCTIONAL DESCRIPTION:
2004 !
2005 ! PROCESS THE TRANSFER ADDRESS ENTRY OF THE GSD RECORD
2006 !
2007 ! FORMAL PARAMETERS:
2008 !
2009 ! ASCPTR - POINTER TO NAME, IN ASCII
2010 ! FLAGS - THE FLAGS BYTE
2011 ! VALUE - THE VALUE WORD
2012 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
2013 !
2014 ! IMPLICIT INPUTS:
2015 !
2016 ! NONE
2017 !
2018 ! IMPLICIT OUTPUTS:
2019 !
2020 ! STORES THE TRANSFER ADDRESS IN THE DATA STRUCTURE
2021 !
2022 ! ROUTINE VALUE:
2023 !
2024 ! NONE
2025 !
2026 ! SIDE EFFECTS
2027 !
2028 ! NONE
2029 !
2030 !--
2031
2032 BEGIN
2033
2034 BIND
2035 ROUTINE_NAME = UPLIT (%ASCIZ'GSD_TRA');
2036
2037 MAP
2038 FILE_PTR : REF FILE_BLOCK;
2039
2040 LOCAL
2041 MODU_PTR : REF MODU_BLOCK,
2042 PSECT_PTR : REF PSECT_BLOCK,
2043 PSECT_INFO : VECTOR [3];
2044
2045 IF (DEBUG GEQ 1)
2046 THEN
2047 BEGIN
2048 PCRLF (1);
2049 OUTPUT (1, %O'11');
2050 OUTPUT (1, %O'11');
2051 OUTSTR (1, UPLIT (%ASCIZ'TRANSFER ADDRESS, NAME = '));
2052 OUTSTR (1, .ASCPTR);
2053 OUTSTR (1, UPLIT (%ASCIZ', FLAGS = '));
2054 OUTNUM (1, .FLAGS, 8, 0);
2055 OUTSTR (1, UPLIT (%ASCIZ', VALUE = '));
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2056 OUTNUM (1, .VALUE, 8, 0);
2057 END; !DEBUG
2058
2059 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
2060 THEN
2061 ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0)
2062 ELSE
2063 BEGIN
2064 PSECT_INFO [0] = .ASCPTR;
2065 PSECT_INFO [1] = 0;
2066 PSECT_INFO [2] = 0;
2067 PSECT_PTR = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_PSECT, PSECT_INFO);
2068
2069 IF (.PSECT_PTR EQL 0)
2070 THEN
2071 MODU_PTR [MODU_XFR_OFFSET] = .VALUE
2072 ELSE
2073 BEGIN
2074 MODU_PTR [MODU_XFR_PSECT] = .PSECT_PTR;
2075 MODU_PTR [MODU_XFR_OFFSET] = .VALUE + .PSECT_PTR [PSECT_OFFSET];
2076 END;
2077
2078 END;
2079
2080 END; !OF GSD_TRA
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2081 ROUTINE SEL_GLOBAL (GLOBAL_PTR, GLOBAL_INFO) = !SELECT PROPER GLOBAL
2082
2083 !++
2084 ! FUNCTIONAL DESCRIPTION:
2085 !
2086 ! SELECT THE GLOBAL DESCRIBED FROM THE LIST OF ALL GLOBALS.
2087 ! USED IN A CALL TO FND_CHAIN.
2088 !
2089 ! FORMAL PARAMETERS:
2090 !
2091 ! GLOBAL_PTR - POINTER TO GLOBAL TO TEST FOR SUITABILITY
2092 ! GLOBAL_INFO - INFORMATION ABOUT THE GLOBAL WE ARE LOOKING FOR
2093 !
2094 ! IMPLICIT INPUTS:
2095 !
2096 ! NONE
2097 !
2098 ! IMPLICIT OUTPUTS:
2099 !
2100 ! NONE
2101 !
2102 ! ROUTINE VALUE:
2103 !
2104 ! POINTER TO THE GLOBAL, OR 0.
2105 !
2106 ! SIDE EFFECTS
2107 !
2108 ! NONE
2109 !
2110 !--
2111
2112 BEGIN
2113
2114 MAP
2115 GLOBAL_PTR : REF GLOBL_BLOCK,
2116 GLOBAL_INFO : REF VECTOR [3];
2117
2118 !
2119 ! THE GLOBAL_INFO VECTOR CONTAINS:
2120 !
2121 ! 0: POINTER TO THE GLOBAL NAME, IN ASCII
2122 ! 1: THE GLOBAL FLAGS
2123 ! 2: THE "VALUE" WORD FROM THE GLOBAL
2124 !
2125
2126 IF (CH$NEQ (LEN_GBL_NAME, CH$PTR (.GLOBAL_INFO [0]), LEN_GBL_NAME, CH$PTR (GLOBAL_PTR [GBL_NAME])))
2127 THEN
2128 0
2129 ELSE
2130 .GLOBAL_PTR
2131
2132 END; !OF SEL_GLOBAL
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2133 ROUTINE GSD_GSN (ASCPTR, FLAGS, VALUE, FILE_PTR) : NOVALUE = !PROCESS GLOBAL SYMBOL NAME
2134
2135 !++
2136 ! FUNCTIONAL DESCRIPTION:
2137 !
2138 ! PROCESS THE GLOBAL SYMBOL NAME ENTRY OF THE GSD RECORD
2139 !
2140 ! FORMAL PARAMETERS:
2141 !
2142 ! ASCPTR - POINTER TO NAME, IN ASCII
2143 ! FLAGS - THE FLAGS BYTE
2144 ! VALUE - THE VALUE WORD
2145 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
2146 !
2147 ! IMPLICIT INPUTS:
2148 !
2149 ! NONE
2150 !
2151 ! IMPLICIT OUTPUTS:
2152 !
2153 ! ADDS THE GLOBAL SYMBOL TO THE DATA STRUCTURE
2154 !
2155 ! ROUTINE VALUE:
2156 !
2157 ! NONE
2158 !
2159 ! SIDE EFFECTS
2160 !
2161 ! OBTAINS SPACE FROM THE FREE LIST
2162 !
2163 !--
2164
2165 BEGIN
2166
2167 BIND
2168 ROUTINE_NAME = UPLIT (%ASCIZ'GSD_GSN');
2169
2170 MAP
2171 FILE_PTR : REF FILE_BLOCK;
2172
2173 LOCAL
2174 GLOBL_PTR : REF GLOBL_BLOCK,
2175 GLOBL_PTR1 : REF GLOBL_BLOCK,
2176 GLOBL_PTR2 : REF GLOBL_BLOCK,
2177 GLOBAL_INFO : VECTOR [3],
2178 MODU_PTR : REF MODU_BLOCK,
2179 MODU_PTR1 : REF MODU_BLOCK,
2180 PSECT_PTR : REF PSECT_BLOCK,
2181 SEARCH_DONE,
2182 TEMP_FLAGS;
2183
2184 IF (DEBUG GEQ 1)
2185 THEN
2186 BEGIN
2187 PCRLF (1);
2188 OUTPUT (1, %O'11');
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2189 OUTPUT (1, %O'11');
2190 OUTSTR (1, UPLIT (%ASCIZ'GLOBAL SYMBOL NAME, NAME = '));
2191 OUTSTR (1, .ASCPTR);
2192 OUTSTR (1, UPLIT (%ASCIZ', FLAGS = '));
2193 OUTNUM (1, .FLAGS, 8, 0);
2194 OUTSTR (1, UPLIT (%ASCIZ', VALUE = '));
2195 OUTNUM (1, .VALUE, 8, 0);
2196 END; !DEBUG
2197
2198 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
2199 THEN
2200 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
2201 0, 0)
2202 ELSE
2203 BEGIN !WE ARE PROCESSING A MODULE
2204 PSECT_PTR = .MODU_PTR [MODU_PSECT];
2205 GLOBAL_INFO [0] = .ASCPTR;
2206 GLOBAL_INFO [1] = .FLAGS;
2207 GLOBAL_INFO [2] = .VALUE;
2208 SEARCH_DONE = 0;
2209 GLOBL_PTR1 = .ROOT [ROOT_GLOBALS];
2210 GLOBL_PTR2 = 0;
2211
2212 IF (.GLOBL_PTR1 NEQ 0)
2213 THEN
2214
2215 WHILE (.SEARCH_DONE EQL 0) DO
2216
2217 IF (CH$GTR (LEN_GBL_NAME, CH$PTR (.ASCPTR), LEN_GBL_NAME, CH$PTR (GLOBL_PTR1 [GBL_NAME])))
2218 THEN
2219 BEGIN
2220 GLOBL_PTR2 = .GLOBL_PTR1;
2221 GLOBL_PTR1 = .GLOBL_PTR1 [GBL_NEXT];
2222
2223 IF (.GLOBL_PTR1 EQL 0) THEN SEARCH_DONE = 2;
2224
2225 END
2226 ELSE
2227 SEARCH_DONE = 1;
2228
2229 IF (.SEARCH_DONE EQL 1)
2230 THEN
2231 BEGIN
2232
2233 IF (CH$EQL (LEN_GBL_NAME, CH$PTR (.ASCPTR), LEN_GBL_NAME, CH$PTR (GLOBL_PTR1 [GBL_NAME])))
2234 THEN
2235 SEARCH_DONE = 3
2236
2237 END;
2238
2239 IF (.SEARCH_DONE NEQ 3)
2240 THEN
2241 BEGIN !THIS IS THE FIRST REFERENCE TO THIS GLOBAL
2242
2243 IF (GET_SW (.FILE_PTR, UPLIT (%ASCII'SS', 0)) EQL 0)
2244 THEN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2245 BEGIN !NOT 'SS' SWITCH
2246
2247 IF ((GLOBL_PTR = GETBLK (GLOBL_TYP, GLOBL_LEN)) EQL 0)
2248 THEN
2249 ERRMSG (0, 1, ROUTINE_NAME, 0, 0,
2250 0, 0)
2251 ELSE
2252 BEGIN !WE HAVE STORAGE FOR THE GLOBAL BLOCK
2253 CH$MOVE (LEN_GBL_NAME, CH$PTR (.ASCPTR), CH$PTR (GLOBL_PTR [GBL_NAME]));
2254 !
2255 ! LINK THIS SYMBOL INTO THE LIST
2256 !
2257 GLOBL_PTR [GBL_NEXT] = .GLOBL_PTR1;
2258 GLOBL_PTR [GBL_PREV] = .GLOBL_PTR2;
2259
2260 IF (.GLOBL_PTR1 NEQ 0) THEN GLOBL_PTR1 [GBL_PREV] = .GLOBL_PTR;
2261
2262 IF (.GLOBL_PTR2 NEQ 0)
2263 THEN
2264 GLOBL_PTR2 [GBL_NEXT] = .GLOBL_PTR
2265 ELSE
2266 ROOT [ROOT_GLOBALS] = .GLOBL_PTR;
2267
2268 END;
2269
2270 END
2271 ELSE
2272 GLOBL_PTR = 0
2273
2274 END !OF SEARCH_DONE NEQ 3
2275 ELSE
2276 BEGIN !PREVIOUS REFERENCE TO THIS GLOBAL
2277 TEMP_FLAGS = .GLOBL_PTR1 [GBL_FLAGS];
2278 GLOBL_PTR = (IF ((GET_SW (.FILE_PTR, UPLIT (%ASCIZ'SS', 0)) NEQ 0) AND (.TEMP_FLAGS<GBL_FLG_DEF,
2279 1> NEQ 0)) THEN 0 ELSE .GLOBL_PTR1);
2280 END;
2281
2282 IF (.GLOBL_PTR NEQ 0)
2283 THEN
2284 BEGIN !WE WISH TO PROCESS THIS GLOBAL
2285 !
2286 ! THE GLOBAL BLOCK IS LINKED TO THE ROOT. NOW BE SURE IT IS
2287 ! CHAINED FROM THE CURRENT MODULE.
2288 !
2289 GLOBL_PTR1 = FND_CHAIN (.MODU_PTR [MODU_GLOBALS], SEL_GLOBAL, GLOBAL_INFO);
2290
2291 IF (.GLOBL_PTR1 EQL 0)
2292 THEN
2293 BEGIN
2294
2295 IF ((MODU_PTR [MODU_GLOBALS] = BLD_CHAIN (.MODU_PTR, .MODU_PTR [MODU_GLOBALS], .GLOBL_PTR))
2296 EQL 0)
2297 THEN
2298 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
2299 ELSE
2300 GLOBL_PTR1 = FND_CHAIN (.MODU_PTR [MODU_GLOBALS], SEL_GLOBAL, GLOBAL_INFO);
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2301
2302 IF (.GLOBL_PTR NEQ .GLOBL_PTR1)
2303 THEN
2304 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0,
2305 0);
2306
2307 IF (.FLAGS<GBL_FLG_DEF, 1> NEQ 0)
2308 THEN
2309 BEGIN !THIS IS A DEFINING REFERENCE
2310 TEMP_FLAGS = .GLOBL_PTR [GBL_FLAGS];
2311
2312 IF (.TEMP_FLAGS<GBL_FLG_DEF, 1> NEQ 0)
2313 THEN
2314 BEGIN !THERE WAS AN EARLIER DEFINITION
2315
2316 IF ((.VALUE NEQ .GLOBL_PTR [GBL_VALUE]) OR (.FLAGS<GBL_FLG_REL, 1> NEQ 0) OR (
2317 .TEMP_FLAGS<GBL_FLG_REL, 1> NEQ 0))
2318 THEN
2319 BEGIN !MULTIPLE DEFINITION
2320 MODU_PTR1 = .GLOBL_PTR [GBL_DEF_MODU];
2321 ERRMSG (0, 13, GLOBL_PTR [GBL_NAME], MODU_PTR1 [MODU_NAME],
2322 .GLOBL_PTR [GBL_VALUE] + (IF (.TEMP_FLAGS<GBL_FLG_REL, 1> EQL 0) THEN 0 ELSE
2323 %O'200000'), MODU_PTR [MODU_NAME],
2324 .VALUE + (IF (.FLAGS<GBL_FLG_REL, 1> EQL 0) THEN 0 ELSE %O'200000'));
2325 END;
2326
2327 END
2328 ELSE
2329 BEGIN !NO EARLIER DEFINITION
2330 GLOBL_PTR [GBL_FLAGS] = .FLAGS;
2331 GLOBL_PTR [GBL_VALUE] = .VALUE;
2332 GLOBL_PTR [GBL_DEF_MODU] = .MODU_PTR;
2333
2334 IF (.FLAGS<GBL_FLG_REL, 1> NEQ 0)
2335 THEN
2336 BEGIN
2337 GLOBL_PTR [GBL_DEF_PSECT] = .PSECT_PTR;
2338 GLOBL_PTR [GBL_DEF_OFFSET] = .PSECT_PTR [PSECT_OFFSET];
2339 END;
2340
2341 END;
2342
2343 END; !OF DEFINING REFERENCE
2344
2345 END;
2346
2347 END;
2348
2349 END;
2350
2351 END; !OF GSD_GSN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2352 ROUTINE SEL_PSECT (PSECT_PTR, PSECT_INFO) = !SELECT PROPER PSECT
2353
2354 !++
2355 ! FUNCTIONAL DESCRIPTION:
2356 !
2357 ! SELECT THE PSECT DESCRIBED FROM THE LIST OF ALL PSECTS.
2358 ! USED IN A CALL TO FND_CHAIN.
2359 !
2360 ! FORMAL PARAMETERS:
2361 !
2362 ! PSECT_PTR - POINTER TO PSECT TO TEST FOR SUITABILITY
2363 ! PSECT_INFO - INFORMATION ABOUT THE PSECT WE ARE LOOKING FOR
2364 !
2365 ! IMPLICIT INPUTS:
2366 !
2367 ! NONE
2368 !
2369 ! IMPLICIT OUTPUTS:
2370 !
2371 ! NONE
2372 !
2373 ! ROUTINE VALUE:
2374 !
2375 ! POINTER TO THE PSECT, OR 0.
2376 !
2377 ! SIDE EFFECTS
2378 !
2379 ! NONE
2380 !
2381 !--
2382
2383 BEGIN
2384
2385 MAP
2386 PSECT_PTR : REF PSECT_BLOCK,
2387 PSECT_INFO : REF VECTOR [3];
2388
2389 !
2390 ! THE PSECT_INFO VECTOR CONTAINS:
2391 !
2392 ! 0: POINTER TO THE PSECT NAME, IN ASCII
2393 ! 1: THE PSECT FLAGS
2394 ! 2: THE MAXIMUM LENGTH OF THE PSECT
2395 !
2396
2397 IF (CH$NEQ (LEN_PSECT_NAME, CH$PTR (.PSECT_INFO [0]), LEN_PSECT_NAME, CH$PTR (PSECT_PTR [PSECT_NAME])))
2398 THEN
2399 0
2400 ELSE
2401 .PSECT_PTR
2402
2403 END; !OF SEL_PSECT
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2404 ROUTINE GSD_PSN (ASCPTR, FLAGS, VALUE, FILE_PTR) : NOVALUE = !PROCESS PSECT NAME
2405
2406 !++
2407 ! FUNCTIONAL DESCRIPTION:
2408 !
2409 ! PROCESS THE PROGRAM SECTION NAME ENTRY OF THE GSD RECORD
2410 !
2411 ! FORMAL PARAMETERS:
2412 !
2413 ! ASCPTR - POINTER TO NAME, IN ASCII
2414 ! FLAGS - THE FLAGS BYTE
2415 ! VALUE - THE VALUE WORD
2416 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
2417 !
2418 ! IMPLICIT INPUTS:
2419 !
2420 ! NONE
2421 !
2422 ! IMPLICIT OUTPUTS:
2423 !
2424 ! ADDS THE PSECT NAME TO THE DATA STRUCTURE
2425 !
2426 ! ROUTINE VALUE:
2427 !
2428 ! NONE
2429 !
2430 ! SIDE EFFECTS
2431 !
2432 ! OBTAINS SPACE FROM THE FREE LIST
2433 !
2434 !--
2435
2436 BEGIN
2437
2438 BIND
2439 ROUTINE_NAME = UPLIT (%ASCIZ'GSD_PSN');
2440
2441 LABEL
2442 OUT;
2443
2444 MAP
2445 FILE_PTR : REF FILE_BLOCK;
2446
2447 LOCAL
2448 TEMP,
2449 CHAR1,
2450 CHAR2,
2451 MODU_PTR : REF MODU_BLOCK,
2452 PSECT_PTR : REF PSECT_BLOCK,
2453 PSECT_PTR1 : REF PSECT_BLOCK,
2454 PSECT_PTR2 : REF PSECT_BLOCK,
2455 PSECT_INFO : VECTOR [3],
2456 SEARCH_DONE;
2457
2458 IF (DEBUG GEQ 1)
2459 THEN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2460 BEGIN
2461 PCRLF (1);
2462 OUTPUT (1, %O'11');
2463 OUTPUT (1, %O'11');
2464 OUTSTR (1, UPLIT (%ASCIZ'PSECT NAME, NAME = '));
2465 OUTSTR (1, .ASCPTR);
2466 OUTSTR (1, UPLIT (%ASCIZ', FLAGS = '));
2467 OUTNUM (1, .FLAGS, 8, 0);
2468 OUTSTR (1, UPLIT (%ASCIZ', VALUE = '));
2469 OUTNUM (1, .VALUE, 8, 0);
2470 END; !DEBUG
2471
2472 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
2473 THEN
2474 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
2475 0, 0)
2476 ELSE
2477 BEGIN !WE ARE PROCESSING A MODULE
2478 PSECT_INFO [0] = .ASCPTR;
2479 PSECT_INFO [1] = .FLAGS;
2480 PSECT_INFO [2] = .VALUE;
2481 SEARCH_DONE = 0;
2482 PSECT_PTR1 = .ROOT [ROOT_PSECTS];
2483 PSECT_PTR2 = 0;
2484
2485 IF (.PSECT_PTR1 NEQ 0)
2486 THEN
2487
2488 WHILE (.SEARCH_DONE EQL 0) DO
2489 BEGIN
2490 !
2491 ! THE RESULT OF THE FOLLOWING CODE IS:
2492 ! 0 IF THE SYMBOLS ARE EQUAL TO EACH OTHER
2493 ! 1 IF THE SYMBOLS ARE LESS THAN EACH OTHER
2494 ! 2 IF THE SYMBOLS ARE GREATER THAN EACH OTHER
2495 !
2496 TEMP = (
2497 OUT :
2498 BEGIN
2499
2500 INCR COUNTER FROM 0 TO LEN_PSECT_NAME - 1 DO
2501 BEGIN
2502 CHAR1 = RX50 (CH$RCHAR (CH$PTR (.ASCPTR, .COUNTER)));
2503 CHAR2 = RX50 (CH$RCHAR (CH$PTR (PSECT_PTR1 [PSECT_NAME], .COUNTER)));
2504
2505 IF (.CHAR1 NEQ .CHAR2)
2506 THEN
2507
2508 IF (.CHAR1 GTR .CHAR2) THEN LEAVE OUT WITH 2 ELSE LEAVE OUT WITH 1;
2509
2510 END;
2511
2512 0
2513 END
2514 );
2515 SEARCH_DONE = (CASE .TEMP FROM 0 TO 2 OF
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2516 SET
2517 [2] :
2518 BEGIN
2519 PSECT_PTR2 = .PSECT_PTR1;
2520 PSECT_PTR1 = .PSECT_PTR1 [PSECT_NEXT];
2521
2522 IF (.PSECT_PTR1 EQL 0) THEN 2 ELSE 0
2523
2524 END;
2525 [1] : 1;
2526 [0] : 3;
2527 TES);
2528 END;
2529
2530 IF (.SEARCH_DONE NEQ 3)
2531 THEN
2532 BEGIN !THIS IS THE FIRST REFERENCE TO THIS PSECT
2533
2534 IF ((PSECT_PTR = GETBLK (PSECT_TYP, PSECT_LEN)) EQL 0)
2535 THEN
2536 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0,
2537 0)
2538 ELSE
2539 BEGIN !WE HAVE STORAGE FOR THE PSECT BLOCK
2540 CH$MOVE (LEN_PSECT_NAME, CH$PTR (.ASCPTR), CH$PTR (PSECT_PTR [PSECT_NAME]));
2541 PSECT_PTR [PSECT_FLAGS] = .FLAGS;
2542 PSECT_PTR [PSECT_SIZE] = 0;
2543 PSECT_PTR [PSECT_OFFSET] = 0;
2544 !
2545 ! LINK THIS PSECT INTO THE LIST
2546 !
2547 PSECT_PTR [PSECT_NEXT] = .PSECT_PTR1;
2548 PSECT_PTR [PSECT_PREV] = .PSECT_PTR2;
2549
2550 IF (.PSECT_PTR1 NEQ 0) THEN PSECT_PTR1 [PSECT_PREV] = .PSECT_PTR;
2551
2552 IF (.PSECT_PTR2 NEQ 0)
2553 THEN
2554 PSECT_PTR2 [PSECT_NEXT] = .PSECT_PTR
2555 ELSE
2556 ROOT [ROOT_PSECTS] = .PSECT_PTR;
2557
2558 END;
2559
2560 END !OF SEARCH_DONE NEQ 3
2561 ELSE
2562 PSECT_PTR = .PSECT_PTR1;
2563
2564 !
2565 ! THE PSECT BLOCK IS LINKED TO THE ROOT. NOW BE SURE IT IS
2566 ! CHAINED FROM THE CURRENT MODULE.
2567 !
2568 PSECT_PTR1 = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_PSECT, PSECT_INFO);
2569
2570 IF (.PSECT_PTR1 EQL 0)
2571 THEN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2572 BEGIN !FIRST REFERENCE TO THIS PSECT BY THIS MODULE
2573
2574 IF ((MODU_PTR [MODU_PSECTS] = BLD_CHAIN (.MODU_PTR, .MODU_PTR [MODU_PSECTS], .PSECT_PTR)) EQL 0)
2575 THEN
2576 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
2577 ELSE
2578 PSECT_PTR1 = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_PSECT, PSECT_INFO);
2579
2580 IF (.PSECT_PTR NEQ .PSECT_PTR1)
2581 THEN
2582 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
2583 ELSE
2584 BEGIN
2585 MODU_PTR [MODU_PSECT] = .PSECT_PTR;
2586 PSECT_PTR [PSECT_OFFSET] = (IF (.FLAGS<PSECT_FLG_OVR, 1> NEQ 0) THEN 0 ELSE .PSECT_PTR [
2587 PSECT_SIZE]);
2588 PSECT_PTR [PSECT_SIZE] = (IF (.FLAGS<PSECT_FLG_OVR, 1> NEQ 0) THEN MAX (.PSECT_PTR [PSECT_SIZE
2589 ], .VALUE) ELSE .PSECT_PTR [PSECT_SIZE] + .VALUE);
2590 PSECT_PTR [PSECT_SECTOR] = .MODU_PTR [MODU_SECTOR];
2591
2592 IF ((MODU_PTR [MODU_SECTOR] = .MODU_PTR [MODU_SECTOR] + 1) GTR 255)
2593 THEN
2594 ERRMSG (0, 10,
2595 ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
2596
2597 END;
2598
2599 END; !OF FIRST REFERENCE TO THIS PSECT BY THIS MODULE
2600
2601 IF (((.PSECT_PTR [PSECT_FLAGS] XOR .FLAGS) AND ((1^PSECT_FLG_HI) OR (1^PSECT_FLG_LIB) OR (1^
2602 PSECT_FLG_OVR) OR (1^PSECT_FLG_RO) OR (1^PSECT_FLG_REL) OR (1^PSECT_FLG_GBL) OR (1^PSECT_FLG_DATA)
2603 )) NEQ 0)
2604 THEN
2605 ERRMSG (0, 15, ROUTINE_NAME, MODU_PTR [MODU_NAME], PSECT_PTR [PSECT_NAME],
2606 .PSECT_PTR [PSECT_FLAGS], .FLAGS);
2607
2608 END; !OF PROCESSING A MODULE
2609
2610 END; !OF GSD_PSN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2611 ROUTINE GSD_IDENT (ASCPTR, FLAGS, VALUE, FILE_PTR) : NOVALUE = !PROCESS VERSION IDENT
2612
2613 !++
2614 ! FUNCTIONAL DESCRIPTION:
2615 !
2616 ! PROCESS THE PROGRAM VERSION IDENTIFICATION ENTRY OF THE
2617 ! GSD RECORD. THIS ENTRY IS PRODUCED BY THE ".IDENT"
2618 ! ASSEMBLER DIRECTIVE.
2619 !
2620 ! FORMAL PARAMETERS:
2621 !
2622 ! ASCPTR - POINTER TO NAME, IN ASCII
2623 ! FLAGS - THE FLAGS BYTE
2624 ! VALUE - THE VALUE WORD
2625 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
2626 !
2627 ! IMPLICIT INPUTS:
2628 !
2629 ! NONE
2630 !
2631 ! IMPLICIT OUTPUTS:
2632 !
2633 ! ADDS THE IDENTIFICATION TO THE DATA STRUCTURE
2634 !
2635 ! ROUTINE VALUE:
2636 !
2637 ! NONE
2638 !
2639 ! SIDE EFFECTS
2640 !
2641 ! NONE
2642 !
2643 !--
2644
2645 BEGIN
2646
2647 BIND
2648 ROUTINE_NAME = UPLIT (%ASCIZ'GSD_IDENT');
2649
2650 MAP
2651 FILE_PTR : REF FILE_BLOCK;
2652
2653 LOCAL
2654 MODU_PTR : REF MODU_BLOCK;
2655
2656 IF (DEBUG GEQ 1)
2657 THEN
2658 BEGIN
2659 PCRLF (1);
2660 OUTPUT (1, %O'11');
2661 OUTPUT (1, %O'11');
2662 OUTSTR (1, UPLIT (%ASCIZ'PROGRAM VERSION IDENTIFICATION, NAME = '));
2663 OUTSTR (1, .ASCPTR);
2664 OUTSTR (1, UPLIT (%ASCIZ', FLAGS = '));
2665 OUTNUM (1, .FLAGS, 8, 0);
2666 OUTSTR (1, UPLIT (%ASCIZ', VALUE = '));
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2667 OUTNUM (1, .VALUE, 8, 0);
2668 END; !DEBUG
2669
2670 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
2671 THEN
2672 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
2673 0, 0)
2674 ELSE
2675 BEGIN !THERE IS A MODULE BEING PROCESSED
2676 CH$MOVE (LEN_MODU_VER, CH$PTR (.ASCPTR), CH$PTR (MODU_PTR [MODU_IDENT]));
2677 MODU_PTR [MODU_FLAG_IDENT] = 1;
2678 END;
2679
2680 END; !OF GSD_IDENT
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2681 ROUTINE GSD_MAP (ASCPTR, FLAGS, VALUE, FILE_PTR) : NOVALUE = !PROCESS MAPPED ARRAY
2682
2683 !++
2684 ! FUNCTIONAL DESCRIPTION:
2685 !
2686 ! PROCESS THE MAPPED ARRAY ENTRY OF THE GSD RECORD.
2687 ! THIS IS NOT IMPLEMENTED SINCE IT IS NOT PRODUCED BY MACY11.
2688 !
2689 ! FORMAL PARAMETERS:
2690 !
2691 ! ASCPTR - POINTER TO NAME, IN ASCII
2692 ! FLAGS - THE FLAGS BYTE
2693 ! VALUE - THE VALUE WORD
2694 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
2695 !
2696 ! IMPLICIT INPUTS:
2697 !
2698 ! NONE
2699 !
2700 ! IMPLICIT OUTPUTS:
2701 !
2702 ! NONE
2703 !
2704 ! ROUTINE VALUE:
2705 !
2706 ! NONE
2707 !
2708 ! SIDE EFFECTS
2709 !
2710 ! PRINTS AN ERROR MESSAGE
2711 !
2712 !--
2713
2714 BEGIN
2715
2716 BIND
2717 ROUTINE_NAME = UPLIT (%ASCIZ'GSD_MAP');
2718
2719 IF (DEBUG GEQ 1)
2720 THEN
2721 BEGIN
2722 PCRLF (1);
2723 OUTPUT (1, %O'11');
2724 OUTPUT (1, %O'11');
2725 OUTSTR (1, UPLIT (%ASCIZ'MAPPED ARRAY DECLARATION, NAME = '));
2726 OUTSTR (1, .ASCPTR);
2727 OUTSTR (1, UPLIT (%ASCIZ', FLAGS = '));
2728 OUTNUM (1, .FLAGS, 8, 0);
2729 OUTSTR (1, UPLIT (%ASCIZ', VALUE = '));
2730 OUTNUM (1, .VALUE, 8, 0);
2731 END; !DEBUG
2732
2733 ERRMSG (0, 12, ROUTINE_NAME, 0, 0, 0, 0);
2734 END; !OF GSD_MAP
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2735 ROUTINE GBL_REF (GLOBL_PTR, PSECT_PTR, MODU_PTR) : NOVALUE = !RECORD A GLOBAL REFERENCE
2736
2737 !++
2738 ! FUNCTIONAL DESCRIPTION:
2739 !
2740 ! RECORD, USING CHAIN BLOCKS, A GLOBAL REFERENCE TO THE SPECIFIED
2741 ! GLOBAL SYMBOL IN THE SPECIFIED PSECT IN THE SPECIFIED MODULE.
2742 !
2743 ! FORMAL PARAMETERS:
2744 !
2745 ! GLOBL_PTR - POINTER TO THE GLOBAL SYMBOL BEING REFERENCED
2746 ! PSECT_PTR - POINTER TO THE PSECT IN WHICH THE REFERENCE OCCURS
2747 ! MODU_PTR - POINTER TO THE MODULE IN WHICH THE REFERENCE OCCURS
2748 !
2749 ! IMPLICIT INPUTS:
2750 !
2751 ! NONE
2752 !
2753 ! IMPLICIT OUTPUTS:
2754 !
2755 ! MODIFIES THE DATA STRUCTURE
2756 !
2757 ! ROUTINE VALUE:
2758 !
2759 ! NONE
2760 !
2761 ! SIDE EFFECTS
2762 !
2763 ! MAY OBTAIN STORAGE FROM THE FREE LIST
2764 !
2765 !--
2766
2767 BEGIN
2768
2769 BIND
2770 ROUTINE_NAME = UPLIT (%ASCIZ'GBL_REF');
2771
2772 MAP
2773 GLOBL_PTR : REF GLOBL_BLOCK,
2774 MODU_PTR : REF MODU_BLOCK,
2775 PSECT_PTR : REF PSECT_BLOCK;
2776
2777 LOCAL
2778 GLOBAL_INFO : VECTOR [3];
2779
2780 GLOBAL_INFO [0] = GLOBL_PTR [GBL_NAME];
2781 GLOBAL_INFO [1] = .GLOBL_PTR [GBL_FLAGS];
2782 GLOBAL_INFO [2] = .GLOBL_PTR [GBL_VALUE];
2783
2784 IF (FND_CHAIN (.PSECT_PTR [PSECT_GLOBALS], SEL_GLOBAL, GLOBAL_INFO) EQL 0)
2785 THEN
2786 BEGIN !FIRST REFERENCE BY THIS GLOBAL TO THIS PSECT
2787
2788 IF ((PSECT_PTR [PSECT_GLOBALS] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_GLOBALS], .GLOBL_PTR)) EQL 0
2789 )
2790 THEN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2791 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0);
2792
2793 IF ((GLOBL_PTR [GBL_PSECTS] = BLD_CHAIN (.GLOBL_PTR, .GLOBL_PTR [GBL_PSECTS], .PSECT_PTR)) EQL 0)
2794 THEN
2795 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0);
2796
2797 END; !OF FIRST REFERENCE BY THIS GLOBAL TO THIS PSECT
2798
2799 END; !OF GBL_REF
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2800 ROUTINE M_RLDH (MODIF, DISP, PSECT_PTR, LOCATION) = !MAKE RLDH BLOCK
2801
2802 !++
2803 ! FUNCTIONAL DESCRIPTION:
2804 !
2805 ! BUILD AN RLDH BLOCK FROM FREE STORAGE, AND FILL IN SOME
2806 ! OF THE FIELDS.
2807 !
2808 ! FORMAL PARAMETERS:
2809 !
2810 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
2811 ! DISP - DISPLACEMENT INTO TEXT RECORD
2812 ! PSECT_PTR - POINTER TO THE PSECT THAT THIS RELOCATION APPLIES TO
2813 ! LOCATION - OFFSET IN PSECT SPECIFIED BY LOCATION COUNTER SETTING
2814 ! OPERATION.
2815 !
2816 ! IMPLICIT INPUTS:
2817 !
2818 ! NONE
2819 !
2820 ! IMPLICIT OUTPUTS:
2821 !
2822 ! NONE
2823 !
2824 ! ROUTINE VALUE:
2825 !
2826 ! POINTER TO THE RLDH, OR 0 IF OUT OF STORAGE
2827 ! THE CALLER IS RESPONSIBLE FOR GIVING THE 'OUT OF STORAGE'
2828 ! ERROR MESSAGE.
2829 !
2830 ! SIDE EFFECTS
2831 !
2832 ! OBTAINS STORAGE FROM THE FREE LIST
2833 !
2834 !--
2835
2836 BEGIN
2837
2838 BIND
2839 ROUTINE_NAME = UPLIT (%ASCIZ'M_RLDH');
2840
2841 MAP
2842 PSECT_PTR : REF PSECT_BLOCK;
2843
2844 LOCAL
2845 RLDH_PTR : REF RLDH_BLOCK;
2846
2847 IF ((RLDH_PTR = GETBLK (RLDH_TYP, RLDH_LEN)) EQL 0)
2848 THEN
2849 0
2850 ELSE
2851 BEGIN !WE HAVE AN RLDH BLOCK
2852 RLDH_PTR [RLDH_PSECT] = .PSECT_PTR;
2853 RLDH_PTR [RLDH_BYTE] = .MODIF;
2854 RLDH_PTR [RLDH_ADDR] = .PSECT_PTR [PSECT_LLA] - 4 + .DISP;
2855 .RLDH_PTR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2856 END
2857
2858 END; !OF M_RLDH
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2859 ROUTINE M_RLDD (OPER, OP1T, OP2T, OPND1, OPND2) = !MAKE RLDD BLOCK
2860
2861 !++
2862 ! FUNCTIONAL DESCRIPTION:
2863 !
2864 ! BUILD AN RLDD BLOCK FROM FREE STORAGE, AND FILL IN
2865 ! ITS FIELDS.
2866 !
2867 ! FORMAL PARAMETERS:
2868 !
2869 ! OPER - THE OPERATION TO BE PERFORMED.
2870 ! OP1T - THE TYPE OF OPERAND 1
2871 ! OP2T - THE TYPE OF OPERAND 2, "OMIT" IF NONE.
2872 ! OPND1 - OPERAND 1, EITHER A CONSTANT OR A POINTER
2873 ! OPND2 - OPERAND 2, A CONSTANT OR A POINTER IF PRESENT, 0 IF
2874 ! OMITTED.
2875 !
2876 ! IMPLICIT INPUTS:
2877 !
2878 ! NONE
2879 !
2880 ! IMPLICIT OUTPUTS:
2881 !
2882 ! NONE
2883 !
2884 ! ROUTINE VALUE:
2885 !
2886 ! POINTER TO THE RLDD, OR 0 IF OUT OF STORAGE.
2887 ! IF EITHER OPERAND IS AN RLDD BLOCK BUT IS 0,
2888 ! 0 IS RETURNED. THE CALLER IS RESPONSIBLE FOR GIVING
2889 ! THE 'OUT OF STORAGE' ERROR MESSAGE IN THIS CASE.
2890 !
2891 ! SIDE EFFECTS
2892 !
2893 ! MAY OBTAIN STORAGE FROM THE FREE LIST
2894 !
2895 !--
2896
2897 BEGIN
2898
2899 BIND
2900 ROUTINE_NAME = UPLIT (%ASCIZ'M_RLDD');
2901
2902 LOCAL
2903 RLDD_PTR : REF RLDD_BLOCK;
2904
2905 IF (((.OP1T EQL RLD_OPND_OPR) AND (.OPND1 EQL 0)) OR ((.OP2T EQL RLD_OPND_OPR) AND (.OPND2 EQL 0)))
2906 THEN
2907 0
2908 ELSE
2909 BEGIN
2910
2911 IF ((RLDD_PTR = GETBLK (RLDD_TYP, RLDD_LEN)) EQL 0)
2912 THEN
2913 0
2914 ELSE
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2915 BEGIN !WE HAVE AN RLDD BLOCK
2916 RLDD_PTR [RLDD_OPER] = .OPER;
2917 RLDD_PTR [RLDD_OP1T] = .OP1T;
2918 RLDD_PTR [RLDD_OP2T] = .OP2T;
2919 RLDD_PTR [RLDD_OPND1] = .OPND1;
2920 RLDD_PTR [RLDD_OPND2] = .OPND2;
2921 .RLDD_PTR
2922 END
2923
2924 END
2925
2926 END; !OF M_RLDD
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2927 ROUTINE R_ERR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD ERROR
2928
2929 !++
2930 ! FUNCTIONAL DESCRIPTION:
2931 !
2932 ! PROCESS THE UNUSED ENTRY OF THE RLD RECORD.
2933 !
2934 ! FORMAL PARAMETERS:
2935 !
2936 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
2937 ! DISP - DISPLACEMENT INTO TEXT RECORD
2938 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
2939 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
2940 ! FILE_PTR - POINTER TO THE OBJECT FILE'S FILE BLOCK
2941 !
2942 ! IMPLICIT INPUTS:
2943 !
2944 ! INFO BYTES FROM THE RLD RECORD
2945 !
2946 ! IMPLICIT OUTPUTS:
2947 !
2948 ! NONE
2949 !
2950 ! ROUTINE VALUE:
2951 !
2952 ! NONE
2953 !
2954 ! SIDE EFFECTS
2955 !
2956 ! PRINTS AN ERROR MESSAGE
2957 !
2958 !--
2959
2960 BEGIN
2961
2962 BIND
2963 ROUTINE_NAME = UPLIT (%ASCIZ'R_ERR');
2964
2965 MAP
2966 FILE_PTR : REF FILE_BLOCK;
2967
2968 IF (DEBUG GEQ 1)
2969 THEN
2970 BEGIN
2971 PCRLF (1);
2972 OUTPUT (1, %O'11');
2973 OUTPUT (1, %O'11');
2974 OUTSTR (1, UPLIT (%ASCIZ'ERROR, MODIF = '));
2975 OUTNUM (1, .MODIF, 2, 0);
2976 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
2977 OUTNUM (1, .DISP, 8, 0);
2978 END; !DEBUG
2979
2980 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
2981 END; !OF R_ERR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2982 ROUTINE R_IR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD INTERNAL RELOCATION
2983
2984 !++
2985 ! FUNCTIONAL DESCRIPTION:
2986 !
2987 ! PROCESS THE INTERNAL RELOCATION ENTRY OF THE RLD RECORD
2988 !
2989 ! FORMAL PARAMETERS:
2990 !
2991 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
2992 ! DISP - DISPLACEMENT INTO TEXT RECORD
2993 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
2994 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
2995 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
2996 !
2997 ! IMPLICIT INPUTS:
2998 !
2999 ! INFO BYTES FROM THE RLD RECORD
3000 !
3001 ! IMPLICIT OUTPUTS:
3002 !
3003 ! MODIFIES THE DATA STRUCTURE
3004 !
3005 ! ROUTINE VALUE:
3006 !
3007 ! NONE
3008 !
3009 ! SIDE EFFECTS
3010 !
3011 ! OBTAINS STORAGE FROM THE FREE LIST
3012 !
3013 !--
3014
3015 BEGIN
3016
3017 BIND
3018 ROUTINE_NAME = UPLIT (%ASCIZ'R_IR');
3019
3020 MAP
3021 FILE_PTR : REF FILE_BLOCK;
3022
3023 LOCAL
3024 CONSTANT,
3025 MODU_PTR : REF MODU_BLOCK,
3026 PSECT_PTR : REF PSECT_BLOCK,
3027 RLDH_PTR : REF RLDH_BLOCK;
3028
3029 IF (DEBUG GEQ 1)
3030 THEN
3031 BEGIN
3032 PCRLF (1);
3033 OUTPUT (1, %O'11');
3034 OUTPUT (1, %O'11');
3035 OUTSTR (1, UPLIT (%ASCIZ'INTERNAL RELOCATION, MODIF = '));
3036 OUTNUM (1, .MODIF, 2, 0);
3037 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3038 OUTNUM (1, .DISP, 8, 0);
3039 END; !DEBUG
3040
3041 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3042
3043 IF (DEBUG GEQ 1)
3044 THEN
3045 BEGIN
3046 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
3047 OUTNUM (1, .CONSTANT, 8, 0);
3048 END; !DEBUG
3049
3050 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3051 THEN
3052 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
3053 0, 0)
3054 ELSE
3055 BEGIN !WE ARE INSIDE A MODULE
3056
3057 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
3058 THEN
3059 ERRMSG (0, 10, ROUTINE_NAME,
3060 FILE_PTR [FILE_NAME], 0, 0, 0)
3061 ELSE
3062 BEGIN !WE ARE INSIDE A PSECT
3063
3064 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
3065 THEN
3066 ERRMSG (0,
3067 1, ROUTINE_NAME, 0, 0, 0, 0)
3068 ELSE
3069 BEGIN !WE HAVE AN RLD HEADER
3070 !
3071 ! FOR INTERNAL RELOCATION, THE VALUE TO BE STORED IS THE CURRENT PSECT
3072 ! BASE PLUS THE GIVEN CONSTANT.
3073 !
3074
3075 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_ADD, RLD_OPND_OPR, RLD_OPND_CON,
3076 M_RLDD (RLD_OP_ADD, RLD_OPND_PSECT, RLD_OPND_CON, .PSECT_PTR,
3077 .PSECT_PTR [PSECT_OFFSET]), .CONSTANT)) EQL 0)
3078 THEN
3079 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3080 ELSE
3081 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
3082
3083 END;
3084
3085 END;
3086
3087 END;
3088
3089 END; !OF R_IR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3090 ROUTINE R_GR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD GLOBAL RELOCATION
3091
3092 !++
3093 ! FUNCTIONAL DESCRIPTION:
3094 !
3095 ! PROCESS THE GLOBAL RELOCATION ENTRY OF THE RLD RECORD
3096 !
3097 ! FORMAL PARAMETERS:
3098 !
3099 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
3100 ! DISP - DISPLACEMENT INTO TEXT RECORD
3101 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
3102 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
3103 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
3104 !
3105 ! IMPLICIT INPUTS:
3106 !
3107 ! INFO BYTES FROM THE RLD RECORD
3108 !
3109 ! IMPLICIT OUTPUTS:
3110 !
3111 ! MODIFIES THE DATA STRUCTURE
3112 !
3113 ! ROUTINE VALUE:
3114 !
3115 ! NONE
3116 !
3117 ! SIDE EFFECTS
3118 !
3119 ! OBTAINS STORAGE FROM THE FREE LIST
3120 !
3121 !--
3122
3123 BEGIN
3124
3125 BIND
3126 ROUTINE_NAME = UPLIT (%ASCIZ'R_GR');
3127
3128 MAP
3129 FILE_PTR : REF FILE_BLOCK;
3130
3131 LOCAL
3132 ASCVAL : VECTOR [CH$ALLOCATION (LEN_GBL_NAME)],
3133 CONSTANT,
3134 GLOBAL_INFO : VECTOR [3],
3135 GLOBL_PTR : REF GLOBL_BLOCK,
3136 MODU_PTR : REF MODU_BLOCK,
3137 PSECT_PTR : REF PSECT_BLOCK,
3138 R50VAL,
3139 RLDH_PTR : REF RLDH_BLOCK;
3140
3141 IF (DEBUG GEQ 1)
3142 THEN
3143 BEGIN
3144 PCRLF (1);
3145 OUTPUT (1, %O'11');
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3146 OUTPUT (1, %O'11');
3147 OUTSTR (1, UPLIT (%ASCIZ'GLOBAL RELOCATION, MODIF = '));
3148 OUTNUM (1, .MODIF, 2, 0);
3149 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
3150 OUTNUM (1, .DISP, 8, 0);
3151 END; !DEBUG
3152
3153 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3154 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3155 R50TOA (.R50VAL, ASCVAL [0]);
3156
3157 IF (DEBUG GEQ 1)
3158 THEN
3159 BEGIN
3160 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
3161 OUTSTR (1, ASCVAL [0]);
3162 END; !DEBUG
3163
3164 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3165 THEN
3166 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
3167 0, 0)
3168 ELSE
3169 BEGIN !WE ARE INSIDE A MODULE
3170 GLOBAL_INFO [0] = ASCVAL [0];
3171 GLOBAL_INFO [1] = 0;
3172 GLOBAL_INFO [2] = 0;
3173
3174 IF ((GLOBL_PTR = FND_CHAIN (.MODU_PTR [MODU_GLOBALS], SEL_GLOBAL, GLOBAL_INFO)) EQL 0)
3175 THEN
3176 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
3177 ELSE
3178 BEGIN !THIS GLOBAL HAS BEEN DECLARED IN THIS MODULE
3179
3180 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
3181 THEN
3182 ERRMSG (0, 10, ROUTINE_NAME,
3183 FILE_PTR [FILE_NAME], 0, 0, 0)
3184 ELSE
3185 BEGIN !WE ARE INSIDE A PSECT
3186 GBL_REF (.GLOBL_PTR, .PSECT_PTR, .MODU_PTR);
3187
3188 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
3189 THEN
3190 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3191 ELSE
3192 BEGIN !WE HAVE AN RLD HEADER
3193 !
3194 ! FOR GLOBAL RELOCATION, THE VALUE TO BE STORED IS SIMPLY THE VALUE OF
3195 ! THE GLOBAL SYMBOL. WE REPRESENT THIS BY ADDING THE GLOBAL VALUE
3196 ! TO 0.
3197 !
3198
3199 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_ADD, RLD_OPND_GLOBAL, RLD_OPND_CON,
3200 .GLOBL_PTR, 0)) EQL 0)
3201 THEN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3202 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3203 ELSE
3204 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
3205
3206 END;
3207
3208 END;
3209
3210 END;
3211
3212 END;
3213
3214 END; !OF R_GR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3215 ROUTINE R_IDR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD INTERNAL DISPLACED RELOCATION
3216
3217 !++
3218 ! FUNCTIONAL DESCRIPTION:
3219 !
3220 ! PROCESS THE INTERNAL DISPLACED RELOCATION ENTRY OF THE RLD RECORD
3221 !
3222 ! FORMAL PARAMETERS:
3223 !
3224 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
3225 ! DISP - DISPLACEMENT INTO TEXT RECORD
3226 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
3227 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
3228 ! FILE_PTR - POINTER TO THE OBJECT FILE BLOCK
3229 !
3230 ! IMPLICIT INPUTS:
3231 !
3232 ! INFO BYTES FROM THE RLD RECORD
3233 !
3234 ! IMPLICIT OUTPUTS:
3235 !
3236 ! MODIFIES THE DATA STRUCTURE
3237 !
3238 ! ROUTINE VALUE:
3239 !
3240 ! NONE
3241 !
3242 ! SIDE EFFECTS
3243 !
3244 ! OBTAINS STORAGE FROM THE FREE LIST
3245 !
3246 !--
3247
3248 BEGIN
3249
3250 BIND
3251 ROUTINE_NAME = UPLIT (%ASCIZ'R_IDR');
3252
3253 MAP
3254 FILE_PTR : REF FILE_BLOCK;
3255
3256 LOCAL
3257 CONSTANT,
3258 MODU_PTR : REF MODU_BLOCK,
3259 PSECT_PTR : REF PSECT_BLOCK,
3260 RLDH_PTR : REF RLDH_BLOCK;
3261
3262 IF (DEBUG GEQ 1)
3263 THEN
3264 BEGIN
3265 PCRLF (1);
3266 OUTPUT (1, %O'11');
3267 OUTPUT (1, %O'11');
3268 OUTSTR (1, UPLIT (%ASCIZ'INTERNAL DISPLACED RELOCATION, MODIF = '));
3269 OUTNUM (1, .MODIF, 2, 0);
3270 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3271 OUTNUM (1, .DISP, 8, 0);
3272 END; !DEBUG
3273
3274 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3275
3276 IF (DEBUG GEQ 1)
3277 THEN
3278 BEGIN
3279 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
3280 OUTNUM (1, .CONSTANT, 8, 0);
3281 END; !DEBUG
3282
3283 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3284 THEN
3285 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
3286 0, 0)
3287 ELSE
3288 BEGIN !WE ARE INSIDE A MODULE
3289
3290 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
3291 THEN
3292 ERRMSG (0, 10, ROUTINE_NAME,
3293 FILE_PTR [FILE_NAME], 0, 0, 0)
3294 ELSE
3295 BEGIN !WE ARE INSIDE A PSECT
3296
3297 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
3298 THEN
3299 ERRMSG (0,
3300 1, ROUTINE_NAME, 0, 0, 0, 0)
3301 ELSE
3302 BEGIN !WE HAVE AN RLD HEADER
3303 !
3304 ! FOR INTERNAL DISPLACED RELOCATION, THE VALUE TO BE STORED IS THE
3305 ! STORE ADDRESS + 2 PLUS THE BASE OF THE CURRENT PSECT, SUBTRACTED
3306 ! FROM THE GIVEN CONSTANT.
3307 !
3308
3309 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_SUB, RLD_OPND_CON, RLD_OPND_OPR, .CONSTANT,
3310 M_RLDD (RLD_OP_ADD, RLD_OPND_CON, RLD_OPND_PSECT, .RLDH_PTR [RLDH_ADDR] + 2,
3311 .PSECT_PTR))) EQL 0)
3312 THEN
3313 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3314 ELSE
3315 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
3316
3317 END;
3318
3319 END;
3320
3321 END;
3322
3323 END; !OF R_IDR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3324 ROUTINE R_GDR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD GLOBAL DISPLACED RELOCATION
3325
3326 !++
3327 ! FUNCTIONAL DESCRIPTION:
3328 !
3329 ! PROCESS THE GLOBAL DISPLACED RELOCATION ENTRY OF THE RLD RECORD
3330 !
3331 ! FORMAL PARAMETERS:
3332 !
3333 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
3334 ! DISP - DISPLACEMENT INTO TEXT RECORD
3335 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
3336 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
3337 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
3338 !
3339 ! IMPLICIT INPUTS:
3340 !
3341 ! INFO BYTES FROM THE RLD RECORD
3342 !
3343 ! IMPLICIT OUTPUTS:
3344 !
3345 ! MODIFIES THE DATA STRUCTURE
3346 !
3347 ! ROUTINE VALUE:
3348 !
3349 ! NONE
3350 !
3351 ! SIDE EFFECTS
3352 !
3353 ! OBTAINS STORAGE FROM THE FREE LIST
3354 !
3355 !--
3356
3357 BEGIN
3358
3359 BIND
3360 ROUTINE_NAME = UPLIT (%ASCIZ'R_GDR');
3361
3362 MAP
3363 FILE_PTR : REF FILE_BLOCK;
3364
3365 LOCAL
3366 ASCVAL : VECTOR [CH$ALLOCATION (LEN_GBL_NAME)],
3367 CONSTANT,
3368 GLOBAL_INFO : VECTOR [3],
3369 GLOBL_PTR : REF GLOBL_BLOCK,
3370 MODU_PTR : REF MODU_BLOCK,
3371 PSECT_PTR : REF PSECT_BLOCK,
3372 R50VAL,
3373 RLDH_PTR : REF RLDH_BLOCK;
3374
3375 IF (DEBUG GEQ 1)
3376 THEN
3377 BEGIN
3378 PCRLF (1);
3379 OUTPUT (1, %O'11');
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3380 OUTPUT (1, %O'11');
3381 OUTSTR (1, UPLIT (%ASCIZ'GLOBAL DISPLACED RELOCATION, MODIF = '));
3382 OUTNUM (1, .MODIF, 2, 0);
3383 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
3384 OUTNUM (1, .DISP, 8, 0);
3385 END; !DEBUG
3386
3387 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3388 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3389 R50TOA (.R50VAL, ASCVAL [0]);
3390
3391 IF (DEBUG GEQ 1)
3392 THEN
3393 BEGIN
3394 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
3395 OUTSTR (1, ASCVAL [0]);
3396 END; !DEBUG
3397
3398 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3399 THEN
3400 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
3401 0, 0)
3402 ELSE
3403 BEGIN !WE ARE INSIDE A MODULE
3404 GLOBAL_INFO [0] = ASCVAL [0];
3405 GLOBAL_INFO [1] = 0;
3406 GLOBAL_INFO [2] = 0;
3407
3408 IF ((GLOBL_PTR = FND_CHAIN (.MODU_PTR [MODU_GLOBALS], SEL_GLOBAL, GLOBAL_INFO)) EQL 0)
3409 THEN
3410 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
3411 ELSE
3412 BEGIN !THIS GLOBAL HAS BEEN DECLARED IN THIS MODULE
3413
3414 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
3415 THEN
3416 ERRMSG (0, 10, ROUTINE_NAME,
3417 FILE_PTR [FILE_NAME], 0, 0, 0)
3418 ELSE
3419 BEGIN !WE ARE INSIDE A PSECT
3420 GBL_REF (.GLOBL_PTR, .PSECT_PTR, .MODU_PTR);
3421
3422 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
3423 THEN
3424 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3425 ELSE
3426 BEGIN !WE HAVE AN RLD HEADER
3427 !
3428 ! FOR GLOBAL DISPLACED RELOCATION, THE VALUE TO BE STORED IS THE SUM
3429 ! OF THE STORE ADDRESS + 2 AND THE BASE OF THE CURRENT PSECT,
3430 ! SUBTRACTED FROM THE VALUE OF THE GLOBAL SYMBOL.
3431 !
3432
3433 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_SUB, RLD_OPND_GLOBAL, RLD_OPND_OPR,
3434 .GLOBL_PTR,
3435 M_RLDD (RLD_OP_ADD, RLD_OPND_CON, RLD_OPND_PSECT,
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3436 .RLDH_PTR [RLDH_ADDR] + 2, .PSECT_PTR))) EQL 0)
3437 THEN
3438 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3439 ELSE
3440 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
3441
3442 END;
3443
3444 END;
3445
3446 END;
3447
3448 END;
3449
3450 END; !OF R_GDR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3451 ROUTINE R_GAR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD GLOBAL ADDITIVE RELOCATION
3452
3453 !++
3454 ! FUNCTIONAL DESCRIPTION:
3455 !
3456 ! PROCESS THE GLOBAL ADDITIVE RELOCATION ENTRY OF THE RLD RECORD
3457 !
3458 ! FORMAL PARAMETERS:
3459 !
3460 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
3461 ! DISP - DISPLACEMENT INTO TEXT RECORD
3462 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
3463 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
3464 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
3465 !
3466 ! IMPLICIT INPUTS:
3467 !
3468 ! INFO BYTES FROM THE RLD RECORD
3469 !
3470 ! IMPLICIT OUTPUTS:
3471 !
3472 ! MODIFIES THE DATA STRUCTURE
3473 !
3474 ! ROUTINE VALUE:
3475 !
3476 ! NONE
3477 !
3478 ! SIDE EFFECTS
3479 !
3480 ! OBTAINS STORAGE FROM THE FREE LIST
3481 !
3482 !--
3483
3484 BEGIN
3485
3486 BIND
3487 ROUTINE_NAME = UPLIT (%ASCIZ'R_GAR');
3488
3489 MAP
3490 FILE_PTR : REF FILE_BLOCK;
3491
3492 LOCAL
3493 ASCVAL : VECTOR [CH$ALLOCATION (LEN_GBL_NAME)],
3494 CONSTANT,
3495 GLOBAL_INFO : VECTOR [3],
3496 GLOBL_PTR : REF GLOBL_BLOCK,
3497 MODU_PTR : REF MODU_BLOCK,
3498 PSECT_PTR : REF PSECT_BLOCK,
3499 R50VAL,
3500 RLDH_PTR : REF RLDH_BLOCK;
3501
3502 IF (DEBUG GEQ 1)
3503 THEN
3504 BEGIN
3505 PCRLF (1);
3506 OUTPUT (1, %O'11');
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3507 OUTPUT (1, %O'11');
3508 OUTSTR (1, UPLIT (%ASCIZ'GLOBAL ADDITIVE RELOCATION, MODIF = '));
3509 OUTNUM (1, .MODIF, 2, 0);
3510 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
3511 OUTNUM (1, .DISP, 8, 0);
3512 END; !DEBUG
3513
3514 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3515 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3516 R50TOA (.R50VAL, ASCVAL [0]);
3517
3518 IF (DEBUG GEQ 1)
3519 THEN
3520 BEGIN
3521 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
3522 OUTSTR (1, ASCVAL [0]);
3523 END; !DEBUG
3524
3525 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3526
3527 IF (DEBUG GEQ 1)
3528 THEN
3529 BEGIN
3530 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
3531 OUTNUM (1, .CONSTANT, 8, 0);
3532 END; !DEBUG
3533
3534 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3535 THEN
3536 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
3537 0, 0)
3538 ELSE
3539 BEGIN !WE ARE INSIDE A MODULE
3540 GLOBAL_INFO [0] = ASCVAL [0];
3541 GLOBAL_INFO [1] = 0;
3542 GLOBAL_INFO [2] = 0;
3543
3544 IF ((GLOBL_PTR = FND_CHAIN (.MODU_PTR [MODU_GLOBALS], SEL_GLOBAL, GLOBAL_INFO)) EQL 0)
3545 THEN
3546 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
3547 ELSE
3548 BEGIN !THIS GLOBAL HAS BEEN DECLARED IN THIS MODULE
3549
3550 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
3551 THEN
3552 ERRMSG (0, 10, ROUTINE_NAME,
3553 FILE_PTR [FILE_NAME], 0, 0, 0)
3554 ELSE
3555 BEGIN !WE ARE INSIDE A PSECT
3556 GBL_REF (.GLOBL_PTR, .PSECT_PTR, .MODU_PTR);
3557
3558 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
3559 THEN
3560 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3561 ELSE
3562 BEGIN !WE HAVE AN RLD HEADER
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3563 !
3564 ! FOR GLOBAL ADDITIVE RELOCATION, THE VALUE TO BE STORED IS THE
3565 ! VALUE OF THE GLOBAL SYMBOL PLUS THE VALUE OF THE CONSTANT.
3566 !
3567
3568 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_ADD, RLD_OPND_GLOBAL, RLD_OPND_CON,
3569 .GLOBL_PTR, .CONSTANT)) EQL 0)
3570 THEN
3571 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3572 ELSE
3573 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
3574
3575 END;
3576
3577 END;
3578
3579 END;
3580
3581 END;
3582
3583 END; !OF R_GAR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3584 ROUTINE R_GADR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE =
3585 !RLD GLOBAL ADDITIVE DISPLACED RELOCATION
3586
3587 !++
3588 ! FUNCTIONAL DESCRIPTION:
3589 !
3590 ! PROCESS THE GLOBAL ADDITIVE DISPLACED RELOCATION ENTRY OF THE RLD RECORD
3591 !
3592 ! FORMAL PARAMETERS:
3593 !
3594 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
3595 ! DISP - DISPLACEMENT INTO TEXT RECORD
3596 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
3597 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
3598 ! FILE_PTR - POINTER TO FILE BLOCK FOR THE OBJECT FILE
3599 !
3600 ! IMPLICIT INPUTS:
3601 !
3602 ! INFO BYTES FROM THE RLD RECORD
3603 !
3604 ! IMPLICIT OUTPUTS:
3605 !
3606 ! MODIFIES THE DATA STRUCTURE
3607 !
3608 ! ROUTINE VALUE:
3609 !
3610 ! NONE
3611 !
3612 ! SIDE EFFECTS
3613 !
3614 ! OBTAINS STORAGE FROM THE FREE LIST
3615 !
3616 !--
3617
3618 BEGIN
3619
3620 BIND
3621 ROUTINE_NAME = UPLIT (%ASCIZ'R_GADR');
3622
3623 MAP
3624 FILE_PTR : REF FILE_BLOCK;
3625
3626 LOCAL
3627 ASCVAL : VECTOR [CH$ALLOCATION (LEN_GBL_NAME)],
3628 CONSTANT,
3629 GLOBAL_INFO : VECTOR [3],
3630 GLOBL_PTR : REF GLOBL_BLOCK,
3631 MODU_PTR : REF MODU_BLOCK,
3632 PSECT_PTR : REF PSECT_BLOCK,
3633 R50VAL,
3634 RLDH_PTR : REF RLDH_BLOCK;
3635
3636 IF (DEBUG GEQ 1)
3637 THEN
3638 BEGIN
3639 PCRLF (1);
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3640 OUTPUT (1, %O'11');
3641 OUTPUT (1, %O'11');
3642 OUTSTR (1, UPLIT (%ASCIZ'GLOBAL ADDITIVE DISPLACED RELOCATION, MODIF = '));
3643 OUTNUM (1, .MODIF, 2, 0);
3644 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
3645 OUTNUM (1, .DISP, 8, 0);
3646 END; !DEBUG
3647
3648 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3649 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3650 R50TOA (.R50VAL, ASCVAL [0]);
3651
3652 IF (DEBUG GEQ 1)
3653 THEN
3654 BEGIN
3655 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
3656 OUTSTR (1, ASCVAL [0]);
3657 END; !DEBUG
3658
3659 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3660
3661 IF (DEBUG GEQ 1)
3662 THEN
3663 BEGIN
3664 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
3665 OUTNUM (1, .CONSTANT, 8, 0);
3666 END; !DEBUG
3667
3668 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3669 THEN
3670 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
3671 0, 0)
3672 ELSE
3673 BEGIN !WE ARE INSIDE A MODULE
3674 GLOBAL_INFO [0] = ASCVAL [0];
3675 GLOBAL_INFO [1] = 0;
3676 GLOBAL_INFO [2] = 0;
3677
3678 IF ((GLOBL_PTR = FND_CHAIN (.MODU_PTR [MODU_GLOBALS], SEL_GLOBAL, GLOBAL_INFO)) EQL 0)
3679 THEN
3680 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
3681 ELSE
3682 BEGIN !THIS GLOBAL HAS BEEN DECLARED IN THIS MODULE
3683
3684 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
3685 THEN
3686 ERRMSG (0, 10, ROUTINE_NAME,
3687 FILE_PTR [FILE_NAME], 0, 0, 0)
3688 ELSE
3689 BEGIN !WE ARE INSIDE A PSECT
3690 GBL_REF (.GLOBL_PTR, .PSECT_PTR, .MODU_PTR);
3691
3692 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
3693 THEN
3694 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3695 ELSE
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3696 BEGIN !WE HAVE AN RLD HEADER
3697 !
3698 ! FOR GLOBAL ADDITIVE DISPLACED RELOCATION, THE VALUE TO BE STORED IS THE SUM
3699 ! OF THE STORE ADDRESS + 2 AND THE BASE OF THE CURRENT PSECT,
3700 ! SUBTRACTED FROM THE VALUE OF THE GLOBAL SYMBOL, PLUS THE GIVEN CONSTANT.
3701 !
3702
3703 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_SUB, RLD_OPND_OPR, RLD_OPND_OPR,
3704 M_RLDD (RLD_OP_ADD, RLD_OPND_GLOBAL, RLD_OPND_CON, .GLOBL_PTR, .CONSTANT),
3705 M_RLDD (RLD_OP_ADD, RLD_OPND_CON, RLD_OPND_PSECT, .RLDH_PTR [RLDH_ADDR] + 2,
3706 .PSECT_PTR))) EQL 0)
3707 THEN
3708 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3709 ELSE
3710 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
3711
3712 END;
3713
3714 END;
3715
3716 END;
3717
3718 END;
3719
3720 END; !OF R_GAR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3721 ROUTINE R_LCD (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD LOCATION COUNTER DEFINITION
3722
3723 !++
3724 ! FUNCTIONAL DESCRIPTION:
3725 !
3726 ! PROCESS THE LOCATION COUNTER DEFINITION ENTRY OF THE RLD RECORD
3727 !
3728 ! FORMAL PARAMETERS:
3729 !
3730 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
3731 ! DISP - DISPLACEMENT INTO TEXT RECORD
3732 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
3733 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
3734 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
3735 !
3736 ! IMPLICIT INPUTS:
3737 !
3738 ! INFO BYTES FROM THE RLD RECORD
3739 !
3740 ! IMPLICIT OUTPUTS:
3741 !
3742 ! MODIFIES THE DATA STRUCTURE
3743 !
3744 ! ROUTINE VALUE:
3745 !
3746 ! NONE
3747 !
3748 ! SIDE EFFECTS
3749 !
3750 ! OBTAINS STORAGE FROM THE FREE LIST
3751 !
3752 !--
3753
3754 BEGIN
3755
3756 BIND
3757 ROUTINE_NAME = UPLIT (%ASCIZ'R_LCD');
3758
3759 MAP
3760 FILE_PTR : REF FILE_BLOCK;
3761
3762 LOCAL
3763 MODU_PTR : REF MODU_BLOCK,
3764 PSECT_PTR : REF PSECT_BLOCK,
3765 PSECT_INFO : VECTOR [3],
3766 R50VAL,
3767 ASCVAL : VECTOR [CH$ALLOCATION (LEN_PSECT_NAME)],
3768 CONSTANT;
3769
3770 IF (DEBUG GEQ 1)
3771 THEN
3772 BEGIN
3773 PCRLF (1);
3774 OUTPUT (1, %O'11');
3775 OUTPUT (1, %O'11');
3776 OUTSTR (1, UPLIT (%ASCIZ'LOCATION COUNTER DEFINITION, MODIF = '));
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3777 OUTNUM (1, .MODIF, 2, 0);
3778 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
3779 OUTNUM (1, .DISP, 8, 0);
3780 END; !DEBUG
3781
3782 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3783 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3784 R50TOA (.R50VAL, ASCVAL [0]);
3785
3786 IF (DEBUG GEQ 1)
3787 THEN
3788 BEGIN
3789 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
3790 OUTSTR (1, ASCVAL [0]);
3791 END; !DEBUG
3792
3793 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3794
3795 IF (DEBUG GEQ 1)
3796 THEN
3797 BEGIN
3798 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
3799 OUTNUM (1, .CONSTANT, 8, 0);
3800 END; !DEBUG
3801
3802 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3803 THEN
3804 ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0)
3805 ELSE
3806 BEGIN
3807 PSECT_INFO [0] = ASCVAL;
3808 PSECT_INFO [1] = 0;
3809 PSECT_INFO [2] = 0;
3810 PSECT_PTR = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_PSECT, PSECT_INFO);
3811
3812 IF (.PSECT_PTR EQL 0)
3813 THEN
3814 ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0)
3815 ELSE
3816 BEGIN
3817 MODU_PTR [MODU_PSECT] = .PSECT_PTR;
3818 MODU_PTR [MODU_LC] = .CONSTANT;
3819 END;
3820
3821 END;
3822
3823 END; !OF R_LCD
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3824 ROUTINE R_LCM (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD LOCATION COUNTER MODIFICATION
3825
3826 !++
3827 ! FUNCTIONAL DESCRIPTION:
3828 !
3829 ! PROCESS THE LOCATION COUNTER MODIFICATION ENTRY OF THE RLD RECORD
3830 !
3831 ! FORMAL PARAMETERS:
3832 !
3833 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
3834 ! DISP - DISPLACEMENT INTO TEXT RECORD
3835 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
3836 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
3837 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
3838 !
3839 ! IMPLICIT INPUTS:
3840 !
3841 ! INFO BYTES FROM THE RLD RECORD
3842 !
3843 ! IMPLICIT OUTPUTS:
3844 !
3845 ! MODIFIES THE DATA STRUCTURE
3846 !
3847 ! ROUTINE VALUE:
3848 !
3849 ! NONE
3850 !
3851 ! SIDE EFFECTS
3852 !
3853 ! OBTAINS STORAGE FROM THE FREE LIST
3854 !
3855 !--
3856
3857 BEGIN
3858
3859 BIND
3860 ROUTINE_NAME = UPLIT (%ASCIZ'R_LCM');
3861
3862 MAP
3863 FILE_PTR : REF FILE_BLOCK;
3864
3865 LOCAL
3866 CONSTANT,
3867 MODU_PTR : REF MODU_BLOCK;
3868
3869 IF (DEBUG GEQ 1)
3870 THEN
3871 BEGIN
3872 PCRLF (1);
3873 OUTPUT (1, %O'11');
3874 OUTPUT (1, %O'11');
3875 OUTSTR (1, UPLIT (%ASCIZ'LOCATION COUNTER MODIFICATION, MODIF = '));
3876 OUTNUM (1, .MODIF, 2, 0);
3877 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
3878 OUTNUM (1, .DISP, 8, 0);
3879 END; !DEBUG
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3880
3881 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
3882
3883 IF (DEBUG GEQ 1)
3884 THEN
3885 BEGIN
3886 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
3887 OUTNUM (1, .CONSTANT, 8, 0);
3888 END; !DEBUG
3889
3890 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3891 THEN
3892 ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0)
3893 ELSE
3894 BEGIN
3895
3896 IF (.MODU_PTR [MODU_PSECT] EQL 0)
3897 THEN
3898 ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0)
3899 ELSE
3900 BEGIN
3901 MODU_PTR [MODU_LC] = .CONSTANT;
3902 END;
3903
3904 END;
3905
3906 END; !OF R_LCM
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3907 ROUTINE R_PL (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD PROGRAM LIMITS
3908
3909 !++
3910 ! FUNCTIONAL DESCRIPTION:
3911 !
3912 ! PROCESS THE PROGRAM LIMITS ENTRY OF THE RLD RECORD
3913 !
3914 ! FORMAL PARAMETERS:
3915 !
3916 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
3917 ! DISP - DISPLACEMENT INTO TEXT RECORD
3918 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
3919 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
3920 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
3921 !
3922 ! IMPLICIT INPUTS:
3923 !
3924 ! INFO BYTES FROM THE RLD RECORD
3925 !
3926 ! IMPLICIT OUTPUTS:
3927 !
3928 ! MODIFIES THE DATA STRUCTURE
3929 !
3930 ! ROUTINE VALUE:
3931 !
3932 ! NONE
3933 !
3934 ! SIDE EFFECTS
3935 !
3936 ! OBTAINS STORAGE FROM THE FREE LIST
3937 !
3938 !--
3939
3940 BEGIN
3941
3942 BIND
3943 ROUTINE_NAME = UPLIT (%ASCIZ'R_PL');
3944
3945 MAP
3946 FILE_PTR : REF FILE_BLOCK;
3947
3948 LOCAL
3949 CONSTANT,
3950 MODU_PTR : REF MODU_BLOCK,
3951 PSECT_PTR : REF PSECT_BLOCK,
3952 RLDH_PTR : REF RLDH_BLOCK;
3953
3954 IF (DEBUG GEQ 1)
3955 THEN
3956 BEGIN
3957 PCRLF (1);
3958 OUTPUT (1, %O'11');
3959 OUTPUT (1, %O'11');
3960 OUTSTR (1, UPLIT (%ASCIZ'PROGRAM LIMITS, MODIF = '));
3961 OUTNUM (1, .MODIF, 2, 0);
3962 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3963 OUTNUM (1, .DISP, 8, 0);
3964 END; !DEBUG
3965
3966 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
3967 THEN
3968 ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0)
3969 ELSE
3970 BEGIN
3971
3972 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
3973 THEN
3974 ERRMSG (0, 10, ROUTINE_NAME, 0, 0, 0, 0)
3975 ELSE
3976 BEGIN
3977
3978 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
3979 THEN
3980 ERRMSG (0,
3981 1, ROUTINE_NAME, 0, 0, 0, 0)
3982 ELSE
3983 BEGIN
3984
3985 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_ADD, RLD_OPND_BSTK, RLD_OPND_CON, 0, 0)) EQL 0)
3986 THEN
3987 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3988 ELSE
3989 BEGIN
3990 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
3991
3992 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP + 2, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
3993 THEN
3994 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
3995 ELSE
3996 BEGIN
3997
3998 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_ADD, RLD_OPND_HLA, RLD_OPND_CON, 0, 0))
3999 EQL 0)
4000 THEN
4001 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
4002 ELSE
4003 BEGIN
4004 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
4005 END;
4006
4007 END;
4008
4009 END;
4010
4011 END;
4012
4013 END;
4014
4015 END;
4016
4017 END; !OF R_PL
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4018 ROUTINE R_PR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD PSECT RELOCATION
4019
4020 !++
4021 ! FUNCTIONAL DESCRIPTION:
4022 !
4023 ! PROCESS THE PSECT RELOCATION ENTRY OF THE RLD RECORD
4024 !
4025 ! FORMAL PARAMETERS:
4026 !
4027 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
4028 ! DISP - DISPLACEMENT INTO TEXT RECORD
4029 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
4030 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
4031 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
4032 !
4033 ! IMPLICIT INPUTS:
4034 !
4035 ! INFO BYTES FROM THE RLD RECORD
4036 !
4037 ! IMPLICIT OUTPUTS:
4038 !
4039 ! MODIFIES THE DATA STRUCTURE
4040 !
4041 ! ROUTINE VALUE:
4042 !
4043 ! NONE
4044 !
4045 ! SIDE EFFECTS
4046 !
4047 ! OBTAINS STORAGE FROM THE FREE LIST
4048 !
4049 !--
4050
4051 BEGIN
4052
4053 BIND
4054 ROUTINE_NAME = UPLIT (%ASCIZ'R_PR');
4055
4056 MAP
4057 FILE_PTR : REF FILE_BLOCK;
4058
4059 LOCAL
4060 ASCVAL : VECTOR [CH$ALLOCATION (LEN_PSECT_NAME)],
4061 CONSTANT,
4062 MODU_PTR : REF MODU_BLOCK,
4063 PSECT_INFO : VECTOR [3],
4064 PSECT_PTR : REF PSECT_BLOCK,
4065 PSECT_PTR1 : REF PSECT_BLOCK,
4066 R50VAL,
4067 RLDH_PTR : REF RLDH_BLOCK;
4068
4069 IF (DEBUG GEQ 1)
4070 THEN
4071 BEGIN
4072 PCRLF (1);
4073 OUTPUT (1, %O'11');
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4074 OUTPUT (1, %O'11');
4075 OUTSTR (1, UPLIT (%ASCIZ'PSECT RELOCATION, MODIF = '));
4076 OUTNUM (1, .MODIF, 2, 0);
4077 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
4078 OUTNUM (1, .DISP, 8, 0);
4079 END; !DEBUG
4080
4081 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4082 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4083 R50TOA (.R50VAL, ASCVAL [0]);
4084
4085 IF (DEBUG GEQ 1)
4086 THEN
4087 BEGIN
4088 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
4089 OUTSTR (1, ASCVAL [0]);
4090 END; !DEBUG
4091
4092 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
4093 THEN
4094 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
4095 0, 0)
4096 ELSE
4097 BEGIN !WE ARE INSIDE A MODULE
4098 PSECT_INFO [0] = ASCVAL [0];
4099 PSECT_INFO [1] = 0;
4100 PSECT_INFO [2] = 0;
4101
4102 IF ((PSECT_PTR1 = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_PSECT, PSECT_INFO)) EQL 0)
4103 THEN
4104 ERRMSG (0,
4105 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
4106 ELSE
4107 BEGIN !THIS PSECT HAS BEEN DECLARED IN THIS MODULE
4108
4109 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
4110 THEN
4111 ERRMSG (0, 10, ROUTINE_NAME,
4112 FILE_PTR [FILE_NAME], 0, 0, 0)
4113 ELSE
4114 BEGIN !WE ARE INSIDE A PSECT
4115
4116 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
4117 THEN
4118 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
4119 ELSE
4120 BEGIN !WE HAVE AN RLD HEADER
4121 !
4122 ! FOR PSECT RELOCATION, THE VALUE TO BE STORED IS SIMPLY THE VALUE OF
4123 ! THE PSECT BASE.
4124 !
4125
4126 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_ADD, RLD_OPND_PSECT, RLD_OPND_CON,
4127 .PSECT_PTR1, .PSECT_PTR1 [PSECT_OFFSET])) EQL 0)
4128 THEN
4129 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4130 ELSE
4131 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
4132
4133 END;
4134
4135 END;
4136
4137 END;
4138
4139 END;
4140
4141 END; !OF R_PR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4142 ROUTINE R_PDR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD PSECT DISPLACED RELOCATION
4143
4144 !++
4145 ! FUNCTIONAL DESCRIPTION:
4146 !
4147 ! PROCESS THE PSECT DISPLACED RELOCATION ENTRY OF THE RLD RECORD
4148 !
4149 ! FORMAL PARAMETERS:
4150 !
4151 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
4152 ! DISP - DISPLACEMENT INTO TEXT RECORD
4153 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
4154 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
4155 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
4156 !
4157 ! IMPLICIT INPUTS:
4158 !
4159 ! INFO BYTES FROM THE RLD RECORD
4160 !
4161 ! IMPLICIT OUTPUTS:
4162 !
4163 ! MODIFIES THE DATA STRUCTURE
4164 !
4165 ! ROUTINE VALUE:
4166 !
4167 ! NONE
4168 !
4169 ! SIDE EFFECTS
4170 !
4171 ! OBTAINS STORAGE FROM THE FREE LIST
4172 !
4173 !--
4174
4175 BEGIN
4176
4177 BIND
4178 ROUTINE_NAME = UPLIT (%ASCIZ'R_PDR');
4179
4180 MAP
4181 FILE_PTR : REF FILE_BLOCK;
4182
4183 LOCAL
4184 ASCVAL : VECTOR [CH$ALLOCATION (LEN_PSECT_NAME)],
4185 CONSTANT,
4186 MODU_PTR : REF MODU_BLOCK,
4187 PSECT_INFO : VECTOR [3],
4188 PSECT_PTR : REF PSECT_BLOCK,
4189 PSECT_PTR1 : REF PSECT_BLOCK,
4190 R50VAL,
4191 RLDH_PTR : REF RLDH_BLOCK;
4192
4193 IF (DEBUG GEQ 1)
4194 THEN
4195 BEGIN
4196 PCRLF (1);
4197 OUTPUT (1, %O'11');
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4198 OUTPUT (1, %O'11');
4199 OUTSTR (1, UPLIT (%ASCIZ'PSECT DISPLACED RELOCATION, MODIF = '));
4200 OUTNUM (1, .MODIF, 2, 0);
4201 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
4202 OUTNUM (1, .DISP, 8, 0);
4203 END; !DEBUG
4204
4205 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4206 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4207 R50TOA (.R50VAL, ASCVAL [0]);
4208
4209 IF (DEBUG GEQ 1)
4210 THEN
4211 BEGIN
4212 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
4213 OUTSTR (1, ASCVAL [0]);
4214 END; !DEBUG
4215
4216 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
4217 THEN
4218 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
4219 0, 0)
4220 ELSE
4221 BEGIN !WE ARE INSIDE A MODULE
4222 PSECT_INFO [0] = ASCVAL [0];
4223 PSECT_INFO [1] = 0;
4224 PSECT_INFO [2] = 0;
4225
4226 IF ((PSECT_PTR1 = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_PSECT, PSECT_INFO)) EQL 0)
4227 THEN
4228 ERRMSG (0,
4229 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
4230 ELSE
4231 BEGIN !THIS PSECT HAS BEEN DECLARED IN THIS MODULE
4232
4233 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
4234 THEN
4235 ERRMSG (0, 10, ROUTINE_NAME,
4236 FILE_PTR [FILE_NAME], 0, 0, 0)
4237 ELSE
4238 BEGIN !WE ARE INSIDE A PSECT
4239
4240 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
4241 THEN
4242 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
4243 ELSE
4244 BEGIN !WE HAVE AN RLD HEADER
4245 !
4246 ! FOR PSECT DISPLACED RELOCATION, THE VALUE TO BE STORED IS THE SUM
4247 ! OF THE STORE ADDRESS + 2 AND THE BASE OF THE CURRENT PSECT,
4248 ! SUBTRACTED FROM THE BASE OF THE SPECIFIED PSECT.
4249 !
4250
4251 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_SUB, RLD_OPND_OPR, RLD_OPND_OPR,
4252 M_RLDD (RLD_OP_ADD, RLD_OPND_PSECT, RLD_OPND_CON, .PSECT_PTR1,
4253 .PSECT_PTR1 [PSECT_OFFSET]),
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4254 M_RLDD (RLD_OP_ADD, RLD_OPND_CON,
4255 RLD_OPND_PSECT, .RLDH_PTR [RLDH_ADDR] + 2, .PSECT_PTR))) EQL 0)
4256 THEN
4257 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
4258 ELSE
4259 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
4260
4261 END;
4262
4263 END;
4264
4265 END;
4266
4267 END;
4268
4269 END; !OF R_PDR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4270 ROUTINE R_PAR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD PSECT ADDITIVE RELOCATION
4271
4272 !++
4273 ! FUNCTIONAL DESCRIPTION:
4274 !
4275 ! PROCESS THE PSECT ADDITIVE RELOCATION ENTRY OF THE RLD RECORD
4276 !
4277 ! FORMAL PARAMETERS:
4278 !
4279 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
4280 ! DISP - DISPLACEMENT INTO TEXT RECORD
4281 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
4282 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
4283 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
4284 !
4285 ! IMPLICIT INPUTS:
4286 !
4287 ! INFO BYTES FROM THE RLD RECORD
4288 !
4289 ! IMPLICIT OUTPUTS:
4290 !
4291 ! MODIFIES THE DATA STRUCTURE
4292 !
4293 ! ROUTINE VALUE:
4294 !
4295 ! NONE
4296 !
4297 ! SIDE EFFECTS
4298 !
4299 ! OBTAINS STORAGE FROM THE FREE LIST
4300 !
4301 !--
4302
4303 BEGIN
4304
4305 BIND
4306 ROUTINE_NAME = UPLIT (%ASCIZ'R_PAR');
4307
4308 MAP
4309 FILE_PTR : REF FILE_BLOCK;
4310
4311 LOCAL
4312 ASCVAL : VECTOR [CH$ALLOCATION (LEN_PSECT_NAME)],
4313 CONSTANT,
4314 MODU_PTR : REF MODU_BLOCK,
4315 PSECT_INFO : VECTOR [3],
4316 PSECT_PTR : REF PSECT_BLOCK,
4317 PSECT_PTR1 : REF PSECT_BLOCK,
4318 R50VAL,
4319 RLDH_PTR : REF RLDH_BLOCK;
4320
4321 IF (DEBUG GEQ 1)
4322 THEN
4323 BEGIN
4324 PCRLF (1);
4325 OUTPUT (1, %O'11');
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4326 OUTPUT (1, %O'11');
4327 OUTSTR (1, UPLIT (%ASCIZ'PSECT ADDITIVE RELOCATION, MODIF = '));
4328 OUTNUM (1, .MODIF, 2, 0);
4329 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
4330 OUTNUM (1, .DISP, 8, 0);
4331 END; !DEBUG
4332
4333 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4334 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4335 R50TOA (.R50VAL, ASCVAL [0]);
4336
4337 IF (DEBUG GEQ 1)
4338 THEN
4339 BEGIN
4340 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
4341 OUTSTR (1, ASCVAL [0]);
4342 END; !DEBUG
4343
4344 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4345
4346 IF (DEBUG GEQ 1)
4347 THEN
4348 BEGIN
4349 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
4350 OUTNUM (1, .CONSTANT, 8, 0);
4351 END; !DEBUG
4352
4353 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
4354 THEN
4355 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
4356 0, 0)
4357 ELSE
4358 BEGIN !WE ARE INSIDE A MODULE
4359 PSECT_INFO [0] = ASCVAL [0];
4360 PSECT_INFO [1] = 0;
4361 PSECT_INFO [2] = 0;
4362
4363 IF ((PSECT_PTR1 = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_PSECT, PSECT_INFO)) EQL 0)
4364 THEN
4365 ERRMSG (0,
4366 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
4367 ELSE
4368 BEGIN !THIS PSECT HAS BEEN DECLARED IN THIS MODULE
4369
4370 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
4371 THEN
4372 ERRMSG (0, 10, ROUTINE_NAME,
4373 FILE_PTR [FILE_NAME], 0, 0, 0)
4374 ELSE
4375 BEGIN !WE ARE INSIDE A PSECT
4376
4377 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
4378 THEN
4379 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
4380 ELSE
4381 BEGIN !WE HAVE AN RLD HEADER
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4382 !
4383 ! FOR PSECT ADDITIVE RELOCATION, THE VALUE TO BE STORED IS THE
4384 ! BASE OF THE SPECIFIED PSECT PLUS THE VALUE OF THE CONSTANT.
4385 !
4386
4387 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_ADD, RLD_OPND_OPR, RLD_OPND_CON,
4388 M_RLDD (RLD_OP_ADD, RLD_OPND_PSECT, RLD_OPND_CON, .PSECT_PTR1,
4389 .PSECT_PTR1 [PSECT_OFFSET]), .CONSTANT)) EQL 0)
4390 THEN
4391 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
4392 ELSE
4393 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
4394
4395 END;
4396
4397 END;
4398
4399 END;
4400
4401 END;
4402
4403 END; !OF R_PAR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4404 ROUTINE R_PADR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE =
4405 !RLD PSECT ADDITIVE DISPLACED RELOCATION
4406
4407 !++
4408 ! FUNCTIONAL DESCRIPTION:
4409 !
4410 ! PROCESS THE PSECT ADDITIVE DISPLACED RELOCATION ENTRY OF THE RLD RECORD
4411 !
4412 ! FORMAL PARAMETERS:
4413 !
4414 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
4415 ! DISP - DISPLACEMENT INTO TEXT RECORD
4416 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
4417 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
4418 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
4419 !
4420 ! IMPLICIT INPUTS:
4421 !
4422 ! INFO BYTES FROM THE RLD RECORD
4423 !
4424 ! IMPLICIT OUTPUTS:
4425 !
4426 ! MODIFIES THE DATA STRUCTURE
4427 !
4428 ! ROUTINE VALUE:
4429 !
4430 ! NONE
4431 !
4432 ! SIDE EFFECTS
4433 !
4434 ! OBTAINS STORAGE FROM THE FREE LIST
4435 !
4436 !--
4437
4438 BEGIN
4439
4440 BIND
4441 ROUTINE_NAME = UPLIT (%ASCIZ'R_PADR');
4442
4443 MAP
4444 FILE_PTR : REF FILE_BLOCK;
4445
4446 LOCAL
4447 ASCVAL : VECTOR [CH$ALLOCATION (LEN_PSECT_NAME)],
4448 CONSTANT,
4449 MODU_PTR : REF MODU_BLOCK,
4450 PSECT_INFO : VECTOR [3],
4451 PSECT_PTR : REF PSECT_BLOCK,
4452 PSECT_PTR1 : REF PSECT_BLOCK,
4453 R50VAL,
4454 RLDH_PTR : REF RLDH_BLOCK;
4455
4456 IF (DEBUG GEQ 1)
4457 THEN
4458 BEGIN
4459 PCRLF (1);
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4460 OUTPUT (1, %O'11');
4461 OUTPUT (1, %O'11');
4462 OUTSTR (1, UPLIT (%ASCIZ'PSECT ADDITIVE DISPLACED RELOCATION, MODIF = '));
4463 OUTNUM (1, .MODIF, 2, 0);
4464 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
4465 OUTNUM (1, .DISP, 8, 0);
4466 END; !DEBUG
4467
4468 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4469 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4470 R50TOA (.R50VAL, ASCVAL [0]);
4471
4472 IF (DEBUG GEQ 1)
4473 THEN
4474 BEGIN
4475 OUTSTR (1, UPLIT (%ASCIZ', NAME = '));
4476 OUTSTR (1, ASCVAL [0]);
4477 END; !DEBUG
4478
4479 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4480
4481 IF (DEBUG GEQ 1)
4482 THEN
4483 BEGIN
4484 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
4485 OUTNUM (1, .CONSTANT, 8, 0);
4486 END; !DEBUG
4487
4488 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
4489 THEN
4490 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
4491 0, 0)
4492 ELSE
4493 BEGIN !WE ARE INSIDE A MODULE
4494 PSECT_INFO [0] = ASCVAL [0];
4495 PSECT_INFO [1] = 0;
4496 PSECT_INFO [2] = 0;
4497
4498 IF ((PSECT_PTR1 = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_PSECT, PSECT_INFO)) EQL 0)
4499 THEN
4500 ERRMSG (0,
4501 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
4502 ELSE
4503 BEGIN !THIS PSECT HAS BEEN DECLARED IN THIS MODULE
4504
4505 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
4506 THEN
4507 ERRMSG (0, 10, ROUTINE_NAME,
4508 FILE_PTR [FILE_NAME], 0, 0, 0)
4509 ELSE
4510 BEGIN !WE ARE INSIDE A PSECT
4511
4512 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
4513 THEN
4514 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
4515 ELSE
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4516 BEGIN !WE HAVE AN RLD HEADER
4517 !
4518 ! FOR PSECT ADDITIVE DISPLACED RELOCATION, THE VALUE TO BE STORED IS THE SUM
4519 ! OF THE STORE ADDRESS + 2 AND THE BASE OF THE CURRENT PSECT,
4520 ! SUBTRACTED FROM THE BASE OF THE SPECIFIED PSECT, PLUS THE GIVEN CONSTANT.
4521 !
4522
4523 IF ((RLDH_PTR [RLDH_VALUE] = M_RLDD (RLD_OP_SUB, RLD_OPND_OPR, RLD_OPND_OPR,
4524 M_RLDD (RLD_OP_ADD, RLD_OPND_OPR, RLD_OPND_CON,
4525 M_RLDD (RLD_OP_ADD,
4526 RLD_OPND_PSECT, RLD_OPND_CON, .PSECT_PTR1, .PSECT_PTR1 [PSECT_OFFSET]),
4527 .CONSTANT),
4528 M_RLDD (RLD_OP_ADD, RLD_OPND_CON, RLD_OPND_PSECT,
4529 .RLDH_PTR [RLDH_ADDR] + 2, .PSECT_PTR))) EQL 0)
4530 THEN
4531 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
4532 ELSE
4533 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
4534
4535 END;
4536
4537 END;
4538
4539 END;
4540
4541 END;
4542
4543 END; !OF R_PADR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4544 ROUTINE SEL_SECTOR (PSECT_PTR, SECTOR) = !SELECT PROPER SECTOR
4545
4546 !++
4547 ! FUNCTIONAL DESCRIPTION:
4548 !
4549 ! SELECT A PSECT GIVEN ITS SECTOR NUMBER.
4550 ! USED IN A CALL TO FND_CHAIN.
4551 !
4552 ! FORMAL PARAMETERS:
4553 !
4554 ! PSECT_PTR - POINTER TO PSECT TO TEST FOR SUITABILITY
4555 ! SECTOR - NUMBER OF THE SECTOR WANTED
4556 !
4557 ! IMPLICIT INPUTS:
4558 !
4559 ! NONE
4560 !
4561 ! IMPLICIT OUTPUTS:
4562 !
4563 ! NONE
4564 !
4565 ! ROUTINE VALUE:
4566 !
4567 ! POINTER TO THE PSECT, OR 0.
4568 !
4569 ! SIDE EFFECTS
4570 !
4571 ! NONE
4572 !
4573 !--
4574
4575 BEGIN
4576
4577 MAP
4578 PSECT_PTR : REF PSECT_BLOCK;
4579
4580 IF (.SECTOR NEQ .PSECT_PTR [PSECT_SECTOR]) THEN 0 ELSE .PSECT_PTR
4581
4582 END; !OF SEL_SECTOR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4583 ROUTINE R_CR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD COMPLEX RELOCATION
4584
4585 !++
4586 ! FUNCTIONAL DESCRIPTION:
4587 !
4588 ! PROCESS THE COMPLEX RELOCATION ENTRY OF THE RLD RECORD.
4589 !
4590 ! FORMAL PARAMETERS:
4591 !
4592 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
4593 ! DISP - DISPLACEMENT INTO TEXT RECORD
4594 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
4595 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
4596 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
4597 !
4598 ! IMPLICIT INPUTS:
4599 !
4600 ! INFO BYTES FROM THE RLD RECORD
4601 !
4602 ! IMPLICIT OUTPUTS:
4603 !
4604 ! MODIFIES THE DATA STRUCTURE
4605 !
4606 ! ROUTINE VALUE:
4607 !
4608 ! NONE
4609 !
4610 ! SIDE EFFECTS
4611 !
4612 ! OBTAINS STORAGE FROM THE FREE LIST
4613 !
4614 !--
4615
4616 BEGIN
4617
4618 BIND
4619 ROUTINE_NAME = UPLIT (%ASCIZ'R_CR');
4620
4621 LITERAL
4622 STACK_LIMIT = 100;
4623
4624 MAP
4625 FILE_PTR : REF FILE_BLOCK;
4626
4627 LOCAL
4628 ASCVAL : VECTOR [CH$ALLOCATION (LEN_PSECT_NAME)],
4629 COMMAND_TERM,
4630 CONSTANT,
4631 GLOBAL_INFO : VECTOR [3],
4632 GLOBL_PTR : REF GLOBL_BLOCK,
4633 MODU_PTR : REF MODU_BLOCK,
4634 OFFSET,
4635 OPCODE,
4636 OPND_TYPE : VECTOR [STACK_LIMIT],
4637 OPND_VAL : VECTOR [STACK_LIMIT],
4638 PSECT_PTR : REF PSECT_BLOCK,
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4639 PSECT_PTR1 : REF PSECT_BLOCK,
4640 R50VAL,
4641 RLDD_PTR : REF RLDD_BLOCK,
4642 RLDH_PTR : REF RLDH_BLOCK,
4643 SECTOR,
4644 STACK_DEPTH,
4645 TEMP_RLDH_VAL;
4646
4647 IF (DEBUG GEQ 1)
4648 THEN
4649 BEGIN
4650 PCRLF (1);
4651 OUTPUT (1, %O'11');
4652 OUTPUT (1, %O'11');
4653 OUTSTR (1, UPLIT (%ASCIZ'COMPLEX RELOCATION, MODIF = '));
4654 OUTNUM (1, .MODIF, 2, 0);
4655 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
4656 OUTNUM (1, .DISP, 8, 0);
4657 END; !DEBUG
4658
4659 IF ((MODU_PTR = .FILE_PTR [FILE_MODU]) EQL 0)
4660 THEN
4661 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0,
4662 0, 0)
4663 ELSE
4664 BEGIN !WE ARE INSIDE A MODULE
4665
4666 IF ((PSECT_PTR = .MODU_PTR [MODU_PSECT]) EQL 0)
4667 THEN
4668 ERRMSG (0, 10, ROUTINE_NAME,
4669 FILE_PTR [FILE_NAME], 0, 0, 0)
4670 ELSE
4671 BEGIN !WE ARE INSIDE A PSECT
4672 STACK_DEPTH = 0;
4673 COMMAND_TERM = 0;
4674
4675 WHILE (.COMMAND_TERM EQL 0) DO
4676 BEGIN
4677 OPCODE = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR);
4678
4679 CASE .OPCODE FROM %O'0' TO %O'21' OF
4680 SET
4681
4682 [%O'0'] :
4683 BEGIN !NO OPERATION
4684
4685 IF (DEBUG GEQ 1)
4686 THEN
4687 BEGIN !DEBUG
4688 PCRLF (1);
4689 OUTPUT (1, %O'11');
4690 OUTPUT (1, %O'11');
4691 OUTPUT (1, %O'11');
4692 OUTSTR (1, UPLIT (%ASCIZ'NOP OPERATOR'));
4693 END; !DEBUG
4694
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4695 END;
4696
4697 [%O'1'] :
4698 BEGIN !ADDITION
4699
4700 IF (DEBUG GEQ 1)
4701 THEN
4702 BEGIN !DEBUG
4703 PCRLF (1);
4704 OUTPUT (1, %O'11');
4705 OUTPUT (1, %O'11');
4706 OUTPUT (1, %O'11');
4707 OUTSTR (1, UPLIT (%ASCIZ'ADD OPERATOR'));
4708 END; !DEBUG
4709
4710 RLDD_PTR = M_RLDD (RLD_OP_ADD, .OPND_TYPE [.STACK_DEPTH - 2],
4711 .OPND_TYPE [.STACK_DEPTH - 1], .OPND_VAL [.STACK_DEPTH - 2],
4712 .OPND_VAL [.STACK_DEPTH - 1]);
4713
4714 IF ((STACK_DEPTH = .STACK_DEPTH - 2) LSS 0)
4715 THEN
4716 ERRMSG (0, 10, ROUTINE_NAME,
4717 FILE_PTR [FILE_NAME], 0, 0, 0)
4718 ELSE
4719 BEGIN
4720 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
4721 OPND_VAL [.STACK_DEPTH] = .RLDD_PTR;
4722 STACK_DEPTH = .STACK_DEPTH + 1;
4723 END;
4724
4725 END;
4726
4727 [%O'2'] :
4728 BEGIN !SUBTRACT
4729
4730 IF (DEBUG GEQ 1)
4731 THEN
4732 BEGIN !DEBUG
4733 PCRLF (1);
4734 OUTPUT (1, %O'11');
4735 OUTPUT (1, %O'11');
4736 OUTPUT (1, %O'11');
4737 OUTSTR (1, UPLIT (%ASCIZ'SUB OPERATOR'));
4738 END; !DEBUG
4739
4740 RLDD_PTR = M_RLDD (RLD_OP_SUB, .OPND_TYPE [.STACK_DEPTH - 2],
4741 .OPND_TYPE [.STACK_DEPTH - 1], .OPND_VAL [.STACK_DEPTH - 2],
4742 .OPND_VAL [.STACK_DEPTH - 1]);
4743
4744 IF ((STACK_DEPTH = .STACK_DEPTH - 2) LSS 0)
4745 THEN
4746 ERRMSG (0, 10, ROUTINE_NAME,
4747 FILE_PTR [FILE_NAME], 0, 0, 0)
4748 ELSE
4749 BEGIN
4750 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4751 OPND_VAL [.STACK_DEPTH] = .RLDD_PTR;
4752 STACK_DEPTH = .STACK_DEPTH + 1;
4753 END;
4754
4755 END;
4756
4757 [%O'3'] :
4758 BEGIN !MULTIPLICATION
4759
4760 IF (DEBUG GEQ 1)
4761 THEN
4762 BEGIN !DEBUG
4763 PCRLF (1);
4764 OUTPUT (1, %O'11');
4765 OUTPUT (1, %O'11');
4766 OUTPUT (1, %O'11');
4767 OUTSTR (1, UPLIT (%ASCIZ'MUL OPERATOR'));
4768 END; !DEBUG
4769
4770 RLDD_PTR = M_RLDD (RLD_OP_MUL, .OPND_TYPE [.STACK_DEPTH - 2],
4771 .OPND_TYPE [.STACK_DEPTH - 1], .OPND_VAL [.STACK_DEPTH - 2],
4772 .OPND_VAL [.STACK_DEPTH - 1]);
4773
4774 IF ((STACK_DEPTH = .STACK_DEPTH - 2) LSS 0)
4775 THEN
4776 ERRMSG (0, 10, ROUTINE_NAME,
4777 FILE_PTR [FILE_NAME], 0, 0, 0)
4778 ELSE
4779 BEGIN
4780 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
4781 OPND_VAL [.STACK_DEPTH] = .RLDD_PTR;
4782 STACK_DEPTH = .STACK_DEPTH + 1;
4783 END;
4784
4785 END;
4786
4787 [%O'4'] :
4788 BEGIN !DIVIDE
4789
4790 IF (DEBUG GEQ 1)
4791 THEN
4792 BEGIN !DEBUG
4793 PCRLF (1);
4794 OUTPUT (1, %O'11');
4795 OUTPUT (1, %O'11');
4796 OUTPUT (1, %O'11');
4797 OUTSTR (1, UPLIT (%ASCIZ'DIV OPERATOR'));
4798 END; !DEBUG
4799
4800 RLDD_PTR = M_RLDD (RLD_OP_DIV, .OPND_TYPE [.STACK_DEPTH - 2],
4801 .OPND_TYPE [.STACK_DEPTH - 1], .OPND_VAL [.STACK_DEPTH - 2],
4802 .OPND_VAL [.STACK_DEPTH - 1]);
4803
4804 IF ((STACK_DEPTH = .STACK_DEPTH - 2) LSS 0)
4805 THEN
4806 ERRMSG (0, 10, ROUTINE_NAME,
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4807 FILE_PTR [FILE_NAME], 0, 0, 0)
4808 ELSE
4809 BEGIN
4810 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
4811 OPND_VAL [.STACK_DEPTH] = .RLDD_PTR;
4812 STACK_DEPTH = .STACK_DEPTH + 1;
4813 END;
4814
4815 END;
4816
4817 [%O'5'] :
4818 BEGIN !LOGICAL AND
4819
4820 IF (DEBUG GEQ 1)
4821 THEN
4822 BEGIN !DEBUG
4823 PCRLF (1);
4824 OUTPUT (1, %O'11');
4825 OUTPUT (1, %O'11');
4826 OUTPUT (1, %O'11');
4827 OUTSTR (1, UPLIT (%ASCIZ'AND OPERATOR'));
4828 END; !DEBUG
4829
4830 RLDD_PTR = M_RLDD (RLD_OP_AND, .OPND_TYPE [.STACK_DEPTH - 2],
4831 .OPND_TYPE [.STACK_DEPTH - 1], .OPND_VAL [.STACK_DEPTH - 2],
4832 .OPND_VAL [.STACK_DEPTH - 1]);
4833
4834 IF ((STACK_DEPTH = .STACK_DEPTH - 2) LSS 0)
4835 THEN
4836 ERRMSG (0, 10, ROUTINE_NAME,
4837 FILE_PTR [FILE_NAME], 0, 0, 0)
4838 ELSE
4839 BEGIN
4840 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
4841 OPND_VAL [.STACK_DEPTH] = .RLDD_PTR;
4842 STACK_DEPTH = .STACK_DEPTH + 1;
4843 END;
4844
4845 END;
4846
4847 [%O'6'] :
4848 BEGIN !LOGICAL OR
4849
4850 IF (DEBUG GEQ 1)
4851 THEN
4852 BEGIN !DEBUG
4853 PCRLF (1);
4854 OUTPUT (1, %O'11');
4855 OUTPUT (1, %O'11');
4856 OUTPUT (1, %O'11');
4857 OUTSTR (1, UPLIT (%ASCIZ'OR OPERATOR'));
4858 END; !DEBUG
4859
4860 RLDD_PTR = M_RLDD (RLD_OP_OR, .OPND_TYPE [.STACK_DEPTH - 2],
4861 .OPND_TYPE [.STACK_DEPTH - 1], .OPND_VAL [.STACK_DEPTH - 2],
4862 .OPND_VAL [.STACK_DEPTH - 1]);
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4863
4864 IF ((STACK_DEPTH = .STACK_DEPTH - 2) LSS 0)
4865 THEN
4866 ERRMSG (0, 10, ROUTINE_NAME,
4867 FILE_PTR [FILE_NAME], 0, 0, 0)
4868 ELSE
4869 BEGIN
4870 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
4871 OPND_VAL [.STACK_DEPTH] = .RLDD_PTR;
4872 STACK_DEPTH = .STACK_DEPTH + 1;
4873 END;
4874
4875 END;
4876
4877 [%O'10'] :
4878 BEGIN !NEGATION, REPRESENTED AS 0-VALUE
4879
4880 IF (DEBUG GEQ 1)
4881 THEN
4882 BEGIN !DEBUG
4883 PCRLF (1);
4884 OUTPUT (1, %O'11');
4885 OUTPUT (1, %O'11');
4886 OUTPUT (1, %O'11');
4887 OUTSTR (1, UPLIT (%ASCIZ'NEG OPERATOR'));
4888 END; !DEBUG
4889
4890 RLDD_PTR = M_RLDD (RLD_OP_SUB, RLD_OPND_CON, .OPND_TYPE [.STACK_DEPTH - 1], 0,
4891 .OPND_VAL [.STACK_DEPTH - 1]);
4892
4893 IF ((STACK_DEPTH = .STACK_DEPTH - 1) LSS 0)
4894 THEN
4895 ERRMSG (0, 10, ROUTINE_NAME,
4896 FILE_PTR [FILE_NAME], 0, 0, 0)
4897 ELSE
4898 BEGIN
4899 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
4900 OPND_VAL [.STACK_DEPTH] = .RLDD_PTR;
4901 STACK_DEPTH = .STACK_DEPTH + 1;
4902 END;
4903
4904 END;
4905
4906 [%O'11'] :
4907 BEGIN !COMPLEMENT
4908
4909 IF (DEBUG GEQ 1)
4910 THEN
4911 BEGIN !DEBUG
4912 PCRLF (1);
4913 OUTPUT (1, %O'11');
4914 OUTPUT (1, %O'11');
4915 OUTPUT (1, %O'11');
4916 OUTSTR (1, UPLIT (%ASCIZ'COM OPERATOR'));
4917 END; !DEBUG
4918
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4919 RLDD_PTR = M_RLDD (RLD_OP_COM, .OPND_TYPE [.STACK_DEPTH - 1], RLD_OPND_OMIT,
4920 .OPND_VAL [.STACK_DEPTH - 1], 0);
4921
4922 IF ((STACK_DEPTH = .STACK_DEPTH - 1) LSS 0)
4923 THEN
4924 ERRMSG (0, 10, ROUTINE_NAME,
4925 FILE_PTR [FILE_NAME], 0, 0, 0)
4926 ELSE
4927 BEGIN
4928 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
4929 OPND_VAL [.STACK_DEPTH] = .RLDD_PTR;
4930 STACK_DEPTH = .STACK_DEPTH + 1;
4931 END;
4932
4933 END;
4934
4935 [%O'12'] :
4936 BEGIN !NORMAL COMMAND TERMINATION
4937
4938 IF (DEBUG GEQ 1)
4939 THEN
4940 BEGIN !DEBUG
4941 PCRLF (1);
4942 OUTPUT (1, %O'11');
4943 OUTPUT (1, %O'11');
4944 OUTPUT (1, %O'11');
4945 OUTSTR (1, UPLIT (%ASCIZ'STORE OPERATOR'));
4946 END; !DEBUG
4947
4948 COMMAND_TERM = 1;
4949 END;
4950
4951 [%O'13'] :
4952 BEGIN !DISPLACED COMMAND TERMINATION
4953
4954 IF (DEBUG GEQ 1)
4955 THEN
4956 BEGIN !DEBUG
4957 PCRLF (1);
4958 OUTPUT (1, %O'11');
4959 OUTPUT (1, %O'11');
4960 OUTPUT (1, %O'11');
4961 OUTSTR (1, UPLIT (%ASCIZ'STORE DISPLACED OPERATOR'));
4962 END; !DEBUG
4963
4964 COMMAND_TERM = 2;
4965 END;
4966
4967 [%O'16'] :
4968 BEGIN !GLOBAL SYMBOL VALUE
4969 R50VAL<16, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4970 R50VAL<0, 16> = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
4971 R50TOA (.R50VAL, ASCVAL [0]);
4972
4973 IF (DEBUG GEQ 1)
4974 THEN
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
4975 BEGIN !DEBUG
4976 PCRLF (1);
4977 OUTPUT (1, %O'11');
4978 OUTPUT (1, %O'11');
4979 OUTPUT (1, %O'11');
4980 OUTSTR (1, UPLIT (%ASCIZ'GLOBAL SYMBOL OPERAND = '));
4981 OUTSTR (1, ASCVAL [0]);
4982 END; !DEBUG
4983
4984 GLOBAL_INFO [0] = ASCVAL [0];
4985 GLOBAL_INFO [1] = 0;
4986 GLOBAL_INFO [2] = 0;
4987
4988 IF ((GLOBL_PTR = FND_CHAIN (.MODU_PTR [MODU_GLOBALS], SEL_GLOBAL, GLOBAL_INFO)) EQL 0)
4989
4990 THEN
4991 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
4992 ELSE
4993 BEGIN !THIS GLOBAL HAS BEEN DECLARED IN THIS MODULE
4994 GBL_REF (.GLOBL_PTR, .PSECT_PTR, .MODU_PTR);
4995 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_GLOBAL;
4996 OPND_VAL [.STACK_DEPTH] = .GLOBL_PTR;
4997
4998 IF ((STACK_DEPTH = .STACK_DEPTH + 1) GTR STACK_LIMIT)
4999 THEN
5000 ERRMSG (0, 14,
5001 ROUTINE_NAME, FILE_PTR [FILE_NAME], STACK_LIMIT, 0, 0);
5002
5003 END;
5004
5005 END;
5006
5007 [%O'17'] :
5008 BEGIN !RELOCATABLE VALUE
5009
5010 IF (DEBUG GEQ 1)
5011 THEN
5012 BEGIN !DEBUG
5013 PCRLF (1);
5014 OUTPUT (1, %O'11');
5015 OUTPUT (1, %O'11');
5016 OUTPUT (1, %O'11');
5017 OUTSTR (1, UPLIT (%ASCIZ'RELOCATABLE VALUE, OPERANDS = '));
5018 END; !DEBUG
5019
5020 SECTOR = GET_BYTE (.BYTEPTR, .BYTECTR, .FILE_PTR);
5021 OFFSET = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
5022
5023 IF (DEBUG GEQ 1)
5024 THEN
5025 BEGIN !DEBUG
5026 OUTNUM (1, .SECTOR, 10, 0);
5027 OUTSTR (1, UPLIT (%ASCIZ', '));
5028 OUTNUM (1, .OFFSET, 8, 0);
5029 END; !DEBUG
5030
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
5031 IF ((PSECT_PTR1 = FND_CHAIN (.MODU_PTR [MODU_PSECTS], SEL_SECTOR, .SECTOR)) EQL 0)
5032 THEN
5033 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0)
5034 ELSE
5035 BEGIN !THIS PSECT HAS BEEN DECLARED IN THIS MODULE
5036 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_OPR;
5037 OPND_VAL [.STACK_DEPTH] = M_RLDD (RLD_OP_ADD, RLD_OPND_PSECT, RLD_OPND_CON,
5038 .PSECT_PTR1, .PSECT_PTR1 [PSECT_OFFSET] + .OFFSET);
5039
5040 IF ((STACK_DEPTH = .STACK_DEPTH + 1) GTR STACK_LIMIT)
5041 THEN
5042 ERRMSG (0, 14,
5043 ROUTINE_NAME, FILE_PTR [FILE_NAME], STACK_LIMIT, 0, 0);
5044
5045 END;
5046
5047 END;
5048
5049 [%O'20'] :
5050 BEGIN !CONSTANT
5051
5052 IF (DEBUG GEQ 1)
5053 THEN
5054 BEGIN !DEBUG
5055 PCRLF (1);
5056 OUTPUT (1, %O'11');
5057 OUTPUT (1, %O'11');
5058 OUTPUT (1, %O'11');
5059 OUTSTR (1, UPLIT (%ASCIZ'CONSTANT OPERAND, VALUE ='));
5060 END; !DEBUG
5061
5062 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
5063
5064 IF (DEBUG GEQ 1)
5065 THEN
5066 BEGIN !DEBUG
5067 OUTNUM (1, .CONSTANT, 8, 0);
5068 END; !DEBUG
5069
5070 OPND_TYPE [.STACK_DEPTH] = RLD_OPND_CON;
5071 OPND_VAL [.STACK_DEPTH] = .CONSTANT;
5072 STACK_DEPTH = .STACK_DEPTH + 1;
5073 END;
5074
5075 [%O'21'] :
5076 BEGIN !RESIDENT LIBRARY BASE
5077
5078 IF (DEBUG GEQ 1)
5079 THEN
5080 BEGIN !DEBUG
5081 PCRLF (1);
5082 OUTPUT (1, %O'11');
5083 OUTPUT (1, %O'11');
5084 OUTPUT (1, %O'11');
5085 OUTSTR (1, UPLIT (%ASCIZ'RESIDENT LIBRARY BASE OPERAND'));
5086 END; !DEBUG
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
5087
5088 ERRMSG (0, 12, ROUTINE_NAME, 0, 0, 0, 0);
5089 END;
5090
5091 [INRANGE] :
5092 BEGIN !UNUSED VALUE
5093 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
5094 END;
5095
5096 [OUTRANGE] :
5097 BEGIN !OUT OF VALID RANGE
5098 ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
5099 END;
5100 TES;
5101
5102 END; !OF ITERATION ON PICKING UP OPERATORS AND OPERANDS
5103
5104 !
5105 ! THERE SHOULD NOW BE ONE ITEM IN THE STACK, THE VALUE TO
5106 ! STORE.
5107 !
5108
5109 IF (.STACK_DEPTH NEQ 1) THEN ERRMSG (0, 10, ROUTINE_NAME, FILE_PTR [FILE_NAME], 0, 0, 0);
5110
5111 IF ((RLDH_PTR = M_RLDH (.MODIF, .DISP, .PSECT_PTR, .MODU_PTR [MODU_LC])) EQL 0)
5112 THEN
5113 ERRMSG (0,
5114 1, ROUTINE_NAME, 0, 0, 0, 0)
5115 ELSE
5116 BEGIN
5117 TEMP_RLDH_VAL = (IF ((.COMMAND_TERM EQL 1) AND (.OPND_TYPE [.STACK_DEPTH - 1] EQL RLD_OPND_OPR
5118 )) THEN
5119 !
5120 ! THIS, THE USUAL CASE, CAN BE HANDLED WITHOUT CREATING ANOTHER
5121 ! RLDD BLOCK.
5122 !
5123 .OPND_VAL [.STACK_DEPTH - 1] ELSE M_RLDD (RLD_OP_SUB, .OPND_TYPE [.STACK_DEPTH - 1],
5124 (IF (.COMMAND_TERM EQL 1) THEN RLD_OPND_CON ELSE RLD_OPND_OPR),
5125 .OPND_VAL [.STACK_DEPTH - 1],
5126 (IF (.COMMAND_TERM EQL 1) THEN 0 ELSE M_RLDD (RLD_OP_ADD, RLD_OPND_CON,
5127 RLD_OPND_PSECT, .RLDH_PTR [RLDH_ADDR] + 2, .PSECT_PTR))));
5128 RLDH_PTR [RLDH_VALUE] = .TEMP_RLDH_VAL;
5129 STACK_DEPTH = .STACK_DEPTH - 1;
5130 PSECT_PTR [PSECT_RLD] = BLD_CHAIN (.PSECT_PTR, .PSECT_PTR [PSECT_RLD], .RLDH_PTR);
5131 END;
5132
5133 END;
5134
5135 END;
5136
5137 END; !OF R_CR
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
5138 ROUTINE R_LR (MODIF, DISP, BYTEPTR, BYTECTR, FILE_PTR) : NOVALUE = !RLD LIBRARY RELOCATION
5139
5140 !++
5141 ! FUNCTIONAL DESCRIPTION:
5142 !
5143 ! PROCESS THE LIBRARY RELOCATION ENTRY OF THE RLD RECORD.
5144 ! THIS IS NOT IMPLEMENTED.
5145 !
5146 ! FORMAL PARAMETERS:
5147 !
5148 ! MODIF - 0 = MODIFIES WORD, 1 = MODIFIES BYTE
5149 ! DISP - DISPLACEMENT INTO TEXT RECORD
5150 ! BYTEPTR - POINTER TO FIRST INFO BYTE (USING CH$A_RCHAR)
5151 ! BYTECTR - COUNT OF BYTES LEFT IN THE RLD RECORD
5152 ! FILE_PTR - POINTER TO THE FILE BLOCK FOR THE OBJECT FILE
5153 !
5154 ! IMPLICIT INPUTS:
5155 !
5156 ! INFO BYTES FROM THE RLD RECORD
5157 !
5158 ! IMPLICIT OUTPUTS:
5159 !
5160 ! NONE
5161 !
5162 ! ROUTINE VALUE:
5163 !
5164 ! NONE
5165 !
5166 ! SIDE EFFECTS
5167 !
5168 ! NONE
5169 !
5170 !--
5171
5172 BEGIN
5173
5174 BIND
5175 ROUTINE_NAME = UPLIT (%ASCIZ'R_LR');
5176
5177 LOCAL
5178 CONSTANT;
5179
5180 IF (DEBUG GEQ 1)
5181 THEN
5182 BEGIN
5183 PCRLF (1);
5184 OUTPUT (1, %O'11');
5185 OUTPUT (1, %O'11');
5186 OUTSTR (1, UPLIT (%ASCIZ'LIBRARY RELOCATION, MODIF = '));
5187 OUTNUM (1, .MODIF, 2, 0);
5188 OUTSTR (1, UPLIT (%ASCIZ', DISP = '));
5189 OUTNUM (1, .DISP, 8, 0);
5190 END; !DEBUG
5191
5192 CONSTANT = GET_WORD (.BYTEPTR, .BYTECTR, .FILE_PTR);
5193
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
5194 IF (DEBUG GEQ 1)
5195 THEN
5196 BEGIN
5197 OUTSTR (1, UPLIT (%ASCIZ', CONSTANT = '));
5198 OUTNUM (1, .CONSTANT, 8, 0);
5199 END; !DEBUG
5200
5201 ERRMSG (0, 12, ROUTINE_NAME, 0, 0, 0, 0);
5202 END; !OF R_LR
5203 !
5204 END
5205
5206 ELUDOM
5207 ! Local Modes:
5208 ! Comment Column:36
5209 ! Comment Start:!
5210 ! Mode:Fundamental
5211 ! Auto Save Mode:2
5212 ! End:
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
ASCPTR 1766 1816 1843 1859 1911 1923 1928
1932 1941 1945 1991 2000 2052 2064
2133 2191 2205 2217 2233 2253 2404
2465 2478 2502 2540 2611 2663 2676
2681 2726
ASCVAL 609 682 683 773 836 852 867
1002 1003 1214 1243 1252 1255 1258
1261 1264 1267 1270 1273 3132 3155
3161 3170 3366 3389 3395 3404 3493
3516 3522 3540 3627 3650 3656 3674
3767 3784 3790 3807 4060 4083 4089
4098 4184 4207 4213 4222 4312 4335
4341 4359 4447 4470 4476 4494 4628
4971 4981 4984
BFIO 10#
BLD_CHAIN 175 1838 1848 2295 2574 2788 2793
3081 3204 3315 3440 3573 3710 3990
4004 4131 4259 4393 4533 5130
BLKPTR 307 372# 381 488 525# 533 610
636# 639 644# 651# 653 656 657
718 722 774 969# 973 976 977
1041
BYTE1 222 226# 228 231 241 308 323#
326 328 334 340 341# 344 375
377# 379 381 385 394# 397 409
412 489 528 530# 533 537
BYTE2 223 233# 235 238 240
BYTECTR 611 657# 663 664 691 697 700
703 706 709 712 775 977# 983
984 1011 1017 1020 1023 1026 1029
1033 1054 1095 1098# 1108 1151 1154#
1166 1225 1236 1241 1242 1244 1245
1246 1280 1283 1332 1353 1409 1412
1413 1475 1477 1521 1572 1575 1579
1586 1592 1595 1598 1601 1604 1607
1610 1613 1616 1619 1622 1625 1628
1631 1634 1637 1646 1649 1691 1696
1745 2927 2982 3041 3090 3153 3154
3215 3274 3324 3387 3388 3451 3514
3515 3525 3584 3648 3649 3659 3721
3782 3783 3793 3824 3881 3907 4018
4081 4082 4142 4205 4206 4270 4333
4334 4344 4404 4468 4469 4479 4583
4677 4969 4970 5020 5021 5062 5138
5192
BYTEPTR 612 656# 665 691 697 700 703
706 709 712 776 976# 985 1011
1017 1020 1023 1026 1029 1033 1054
1099 1108 1155 1156 1166 1236 1241
1242 1244 1245 1246 1283 1353 1412
1413 1477 1521 1575 1579 1586 1592
1595 1598 1601 1604 1607 1610 1613
1616 1619 1622 1625 1628 1631 1634
1637 1649 1696 2927 2982 3041 3090
3153 3154 3215 3274 3324 3387 3388
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
3451 3514 3515 3525 3584 3648 3649
3659 3721 3782 3783 3793 3824 3881
3907 4018 4081 4082 4142 4205 4206
4270 4333 4334 4344 4404 4468 4469
4479 4583 4677 4969 4970 5020 5021
5062 5138 5192
BYTES_READ 249 315# 324# 332 342# 352# 378#
395# 431 496# 502# 531# 553 557#
613 636 639 644 651 777 969
970 971
CHAN 187 226 233 249 323 341 354
377 394 431 501 530 556 563
636 642 643 644 651 726 806
812 815 817 824 834 835 837
838 841 949 956 958 959 962
969
CHAR 614 673# 676 680 686 778 993#
996 1000 1006 1212 1236# 1393 1412#
1477# 1486 1508 1561 1575#
CHAR1 2449 2502# 2505 2508
CHAR2 2450 2503# 2505 2508
CHKSUM 187 231# 238# 309 314# 340# 354
379# 406# 407# 409 412 490 501
779 806 812 815 817 824 834
835 837 838 841 949 956 958
959 962
CLOSE 168 642
CMD 1562 1579# 1581 1584 1585# 1588
COMMAND_TERM 4629 4673# 4675 4948# 4964# 5117 5124
5126
CONSTANT 3024 3041# 3047 3077 3133 3257 3274#
3280 3309 3367 3494 3525# 3531 3569
3628 3659# 3665 3704 3768 3793# 3799
3818 3866 3881# 3887 3901 3949 4061
4185 4313 4344# 4350 4389 4448 4479#
4485 4527 4630 5062# 5067 5071 5178
5192# 5198
COUNTER 615 664# 671# 780 805 823 831
948 961 984# 991# 2500 2502 2503
COUNTER1 840
COUNT 310 373# 375# 491 526# 528#
DISP 1564 1586# 1592 1595 1598 1601 1604
1607 1610 1613 1616 1619 1622 1625
1628 1631 1634 1637 2800 2854 2927
2977 2982 3038 3064 3090 3150 3188
3215 3271 3297 3324 3384 3422 3451
3511 3558 3584 3645 3692 3721 3779
3824 3878 3907 3963 3978 3992 4018
4078 4116 4142 4202 4240 4270 4330
4377 4404 4465 4512 4583 4656 5111
5138 5189
DOS_SW 616 637# 645# 651
EPT_BLOCK 781 815# 823 826 837# 886
EPT_BYTE 782 838# 886
EPT_NUMBER 783 817# 831
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
EPT_POSITION 784 905# 921 925# 935 941 948
951
EPT_SIZE 785 812# 814# 840 843
ERRMSG 170 334 347 357 366 388 400
412 509 519 540 715 943 1038
1103 1161 1232 1276 1337 1344 1424
1430 1448 1467 1495 1640 1694 1750
1757 1827 1834 1840 1850 1998 2061
2200 2249 2298 2304 2321 2474 2536
2576 2582 2594 2605 2672 2733 2791
2795 2980 3052 3059 3066 3079 3166
3176 3182 3190 3202 3285 3292 3299
3313 3400 3410 3416 3424 3438 3536
3546 3552 3560 3571 3670 3680 3686
3694 3708 3804 3814 3892 3898 3968
3974 3980 3987 3994 4001 4094 4104
4111 4118 4129 4218 4228 4235 4242
4257 4355 4365 4372 4379 4391 4490
4500 4507 4514 4531 4661 4668 4716
4746 4776 4806 4836 4866 4895 4924
4991 5000 5033 5042 5088 5093 5098
5109 5113 5201
ETYPE 1216 1245# 1248
FILE_BLOCK 304 485 606 770 1093 1146 1208
1321 1390 1558 1734 1804 1899 2038
2171 2445 2651 2966 3021 3129 3254
3363 3490 3624 3760 3863 3946 4057
4181 4309 4444 4625
FILE_DOWN 1838
FILE_MODU 1228 1335 1422 1463 1748 1760 1825
1844 2059 2198 2472 2670 3050 3164
3283 3398 3534 3668 3802 3890 3966
4092 4216 4353 4488 4659
FILE_NAME 334 347 357 388 400 412 509
540 643 715 943 1038 1103 1161
1276 1337 1344 1640 1750 1757 1827
2200 2304 2474 2595 2672 2980 3052
3060 3166 3176 3183 3285 3293 3400
3410 3417 3536 3546 3553 3670 3680
3687 4094 4105 4112 4218 4229 4236
4355 4366 4373 4490 4501 4508 4661
4669 4717 4747 4777 4807 4837 4867
4896 4925 4991 5001 5033 5043 5093
5098 5109
FILE_POSITION 786 808# 813# 816# 818# 823 826#
843# 941 948 951# 964# 970#
FILE_PTR 249 304 334 347 357 388 400
412 431 485 509 540 563 606
636 643 644 651 691 697 700
703 706 709 712 715 726 770
943 969 1011 1017 1020 1023 1026
1029 1033 1038 1054 1093 1103 1108
1146 1161 1166 1208 1228 1236 1241
1242 1244 1245 1246 1252 1255 1258
1261 1264 1267 1270 1273 1276 1283
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
1321 1335 1337 1344 1353 1390 1412
1413 1422 1463 1477 1521 1558 1575
1579 1586 1592 1595 1598 1601 1604
1607 1610 1613 1616 1619 1622 1625
1628 1631 1634 1637 1640 1649 1696
1734 1748 1750 1757 1760# 1766 1804
1825 1827 1838# 1844# 1845 1859 1899
1928 1937 1941 1945 2000 2038 2059
2133 2171 2198 2200 2243 2278 2304
2404 2445 2472 2474 2595 2611 2651
2670 2672 2681 2927 2966 2980 2982
3021 3041 3050 3052 3060 3090 3129
3153 3154 3164 3166 3176 3183 3215
3254 3274 3283 3285 3293 3324 3363
3387 3388 3398 3400 3410 3417 3451
3490 3514 3515 3525 3534 3536 3546
3553 3584 3624 3648 3649 3659 3668
3670 3680 3687 3721 3760 3782 3783
3793 3802 3824 3863 3881 3890 3907
3946 3966 4018 4057 4081 4082 4092
4094 4105 4112 4142 4181 4205 4206
4216 4218 4229 4236 4270 4309 4333
4334 4344 4353 4355 4366 4373 4404
4444 4468 4469 4479 4488 4490 4501
4508 4583 4625 4659 4661 4669 4677
4717 4747 4777 4807 4837 4867 4896
4925 4969 4970 4991 5001 5020 5021
5033 5043 5062 5093 5098 5109 5138
5192
FIRST_TIME 621 624# 629 648#
FLAGS 787 876# 878 915# 917 1215 1244#
1252 1255 1258 1261 1264 1267 1270
1273 1766 1818 1859 1913 1945 1993
2000 2054 2133 2193 2206 2307 2316
2324 2330 2334 2404 2467 2479 2541
2586 2588 2601 2606 2611 2665 2681
2728
FND_CHAIN 176 2067 2289 2300 2568 2578 2784
3174 3408 3544 3678 3810 4102 4226
4363 4498 4988 5031
FRESTG 173 389 401 413 541 718 1041
GBL_DEF_MODU 2320 2332
GBL_DEF_OFFSET 2338
GBL_DEF_PSECT 2337
GBL_EPT_POS 886 921 925
GBL_FLAGS 876 915 2277 2310 2330 2781
GBL_FLG_DEF 878 917 2278 2307 2312
GBL_FLG_REL 2316 2317 2322 2324 2334
GBL_IN_EPT 882 885 917
GBL_NAME 852 867 2126 2217 2233 2253 2321
2780
GBL_NEXT 855 930 2221 2257 2264
GBL_PREV 2258 2260
GBL_PSECTS 2793
GBL_REF 112 2735* 3186 3420 3556 3690 4994
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
GBL_VALUE 2316 2322 2331 2782
GETBLK 174 1446 1465 1493 1832 2247 2534
2847 2911
GETSTG 171 363 516
GET_BYTE 82 691 1011 1054* 1236 1244 1245
1412 1477 1575 1579 1586 4677 5020
GET_SW 172 2243 2278
GET_WORD 83 1108* 1241 1242 1246 1413 3041
3153 3154 3274 3387 3388 3514 3515
3525 3648 3649 3659 3782 3783 3793
3881 4081 4082 4205 4206 4333 4334
4344 4468 4469 4479 4969 4970 5021
5062 5192
GLOBAL_INFO 2081 2116 2126 2177 2205# 2206# 2207#
2289 2300 2778 2780# 2781# 2782# 2784
3134 3170# 3171# 3172# 3174 3368 3404#
3405# 3406# 3408 3495 3540# 3541# 3542#
3544 3629 3674# 3675# 3676# 3678 4631
4984# 4985# 4986# 4988
GLOBAL_PTR 2081 2115 2126 2130
GLOBL_BLOCK 788 789 2115 2174 2175 2176 2773
3135 3369 3496 3630 4632
GLOBL_LEN 2247
GLOBL_PTR 788 845# 847 852 855# 857 867
876 882 885# 886# 904# 910 915
917 921 924 925 930# 2174 2247#
2253 2257# 2258# 2260 2264 2266 2272#
2278# 2282 2295 2302 2310 2316 2320
2321 2322 2330# 2331# 2332# 2337# 2338#
2735 2773 2780 2781 2782 2788 2793#
3135 3174# 3186 3200 3369 3408# 3420
3434 3496 3544# 3556 3569 3630 3678#
3690 3704 4632 4988# 4994 4996
GLOBL_PTR1 789 924# 2175 2209# 2212 2217 2220
2221# 2223 2233 2257 2260# 2277 2279
2289# 2291 2300# 2302
GLOBL_PTR2 2176 2210# 2220# 2258 2262 2264#
GLOBL_TYP 2247
GSD_CNAME 97 1255 1859*
GSD_GSN 101 1264 2133*
GSD_IDENT 105 1270 2611*
GSD_ISN 98 1258 1945*
GSD_MAP 106 1273 2681*
GSD_MNAME 96 1252 1766*
GSD_PSN 104 1267 1928 1937 1941 2404*
GSD_TRA 99 1261 2000*
INPUT 169 226 233 323 341 377 394
530 556
LEN_GBL_NAME 773 852 867 2126 2217 2233 2253
3132 3366 3493 3627
LEN_MODU_NAME 1843
LEN_MODU_VER 2676
LEN_PSECT_NAME 609 1214 1923 1932 2397 2500 2540
3767 4060 4184 4312 4447 4628
LOAD_ADDRESS 1394 1413# 1419 1433 1462
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
LOCATION 2800
MAX_TEXT_DATA 1489
MODIF 1563 1584# 1592 1595 1598 1601 1604
1607 1610 1613 1616 1619 1622 1625
1628 1631 1634 1637 2800 2853 2927
2975 2982 3036 3064 3090 3148 3188
3215 3269 3297 3324 3382 3422 3451
3509 3558 3584 3643 3692 3721 3777
3824 3876 3907 3961 3978 3992 4018
4076 4116 4142 4200 4240 4270 4328
4377 4404 4463 4512 4583 4654 5111
5138 5187
MODU_BLOCK 1211 1324 1395 1737 1807 1902 2041
2178 2179 2451 2654 2774 3025 3136
3258 3370 3497 3631 3763 3867 3950
4062 4186 4314 4449 4633
MODU_DONE 791 965# 967 1034#
MODU_FLAG_EGSD 1232 1342 1347 1755
MODU_FLAG_IDENT 2677
MODU_GLOBALS 2289 2295 2300 3174 3408 3544 3678
4988
MODU_IDENT 2676
MODU_LC 3064 3188 3297 3422 3558 3692 3818
3901 3978 3992 4116 4240 4377 4512
5111
MODU_LEN 1832
MODU_NAME 1843 2321 2323 2605
MODU_OBJ_FILE 1845
MODU_PSECTS 2067 2568 2574 2578 3810 4102 4226
4363 4498 5031
MODU_PSECT 1428 2204 2585 3057 3180 3290 3414
3550 3684 3817 3896 3972 4109 4233
4370 4505 4666
MODU_PTR 1211 1228# 1232 1324 1335# 1342 1347#
1395 1422# 1428 1737 1748# 1755 1807
1825# 1832# 1838 1843 1844 1845# 1846#
1848 1902 2041 2059# 2067 2071# 2074#
2075# 2178 2198# 2204 2289 2295# 2300
2323 2332 2451 2472# 2568 2574# 2578
2585# 2590 2592# 2605 2654 2670# 2676
2677# 2735 2774 3025 3050# 3057 3064
3136 3164# 3174 3180 3186 3188 3258
3283# 3290 3297 3370 3398# 3408 3414
3420 3422 3497 3534# 3544 3550 3556
3558 3631 3668# 3678 3684 3690 3692
3763 3802# 3810 3817# 3818# 3867 3890#
3896 3901# 3950 3966# 3972 3978 3992
4062 4092# 4102 4109 4116 4186 4216#
4226 4233 4240 4314 4353# 4363 4370
4377 4449 4488# 4498 4505 4512 4633
4659# 4666 4988 4994 5031 5111
MODU_PTR1 2179 2320# 2321
MODU_SECTOR 1846 2590 2592
MODU_TYP 1832
MODU_XFR_OFFSET 2071 2075
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
MODU_XFR_PSECT 2074
MOD_SIZE 790 957# 958# 959# 971#
M_RLDD 111 2859* 3075 3076 3199 3309 3310
3433 3435 3568 3703 3704 3705 3985
3998 4126 4251 4252 4254 4387 4388
4523 4524 4525 4528 4710 4740 4770
4800 4830 4860 4890 4919 5037 5123
5126
M_RLDH 110 2800* 3064 3188 3297 3422 3558
3692 3978 3992 4116 4240 4377 4512
5111
NEXT_TEXTD_PTR 1396 1493# 1499# 1500 1501
NEXT_TEXTH_PTR 1397 1438# 1440 1442 1443# 1446# 1452#
1456 1458 1460
OBJ_END_GSD 88 700 1020 1283*
OBJ_EOM 92 712 1033 1696*
OBJ_GSD 87 697 1017 1166*
OBJ_ISD 91 709 1029 1649*
OBJ_RLD 90 706 1026 1521*
OBJ_TEXT 89 703 1023 1353*
OFFSET 4634 5021# 5028 5038
OP1T 2859 2905 2917
OP2T 2859 2905 2918
OPCODE 4635 4677# 4679
OPEN 167* 643
OPER 2859 2916
OPND1 2859 2905 2919
OPND2 2859 2905 2920
OPND_TYPE 4636 4710 4711 4720# 4740 4741 4750#
4770 4771 4780# 4800 4801 4810# 4830
4831 4840# 4860 4861 4870# 4890 4899#
4919 4928# 4995# 5036# 5070# 5117 5123
OPND_VAL 4637 4711 4712 4721# 4741 4742 4751#
4771 4772 4781# 4801 4802 4811# 4831
4832 4841# 4861 4862 4871# 4891 4900#
4920 4929# 4996# 5037# 5071# 5123 5125
OUT 2442 2497 2508
OUTLEN 311 354# 363 370 371 375 492
497# 499 501# 505 509 516 523
524 528
OUTNUM 181 663 676 983 996 1225 1332
1409 1419 1486 1572 1691 1745 1818
1820 1913 1915 1993 1995 2054 2056
2193 2195 2467 2469 2665 2667 2728
2730 2975 2977 3036 3038 3047 3148
3150 3269 3271 3280 3382 3384 3509
3511 3531 3643 3645 3665 3777 3779
3799 3876 3878 3887 3961 3963 4076
4078 4200 4202 4328 4330 4350 4463
4465 4485 4654 4656 5026 5028 5067
5187 5189 5198
OUTPUT 180 677 997 1223 1330 1407 1483
1484 1570 1689 1743 1813 1814 1908
1909 1988 1989 2049 2050 2188 2189
2462 2463 2660 2661 2723 2724 2972
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2973 3033 3034 3145 3146 3266 3267
3379 3380 3506 3507 3640 3641 3774
3775 3873 3874 3958 3959 4073 4074
4197 4198 4325 4326 4460 4461 4651
4652 4689 4690 4691 4704 4705 4706
4734 4735 4736 4764 4765 4766 4794
4795 4796 4824 4825 4826 4854 4855
4856 4884 4885 4886 4913 4914 4915
4942 4943 4944 4958 4959 4960 4977
4978 4979 5014 5015 5016 5056 5057
5058 5082 5083 5084 5184 5185
OUTSTR 182 675 683 995 1003 1224 1331
1408 1418 1485 1571 1690 1744 1815
1816 1817 1819 1910 1911 1912 1914
1990 1991 1992 1994 2051 2052 2053
2055 2190 2191 2192 2194 2464 2465
2466 2468 2662 2663 2664 2666 2725
2726 2727 2729 2974 2976 3035 3037
3046 3147 3149 3160 3161 3268 3270
3279 3381 3383 3394 3395 3508 3510
3521 3522 3530 3642 3644 3655 3656
3664 3776 3778 3789 3790 3798 3875
3877 3886 3960 3962 4075 4077 4088
4089 4199 4201 4212 4213 4327 4329
4340 4341 4349 4462 4464 4475 4476
4484 4653 4655 4692 4707 4737 4767
4797 4827 4857 4887 4916 4945 4961
4980 4981 5017 5027 5059 5085 5186
5188 5197
PCRLF 179 662 674 982 994 1222 1329
1406 1482 1569 1688 1742 1812 1907
1987 2048 2187 2461 2659 2722 2971
3032 3144 3265 3378 3505 3639 3773
3872 3957 4072 4196 4324 4459 4650
4688 4703 4733 4763 4793 4823 4853
4883 4912 4941 4957 4976 5013 5055
5081 5183
POINTER 617 665# 673 792 985# 993
PREV_CHAR 618 666# 667# 668# 678 679 681
684# 685# 686# 793 986# 987# 988#
998 999 1001 1004# 1005# 1006#
PSECT_BLOCK 1398 2042 2180 2386 2452 2453 2454
2775 2842 3026 3137 3259 3371 3498
3632 3764 3951 4064 4065 4188 4189
4316 4317 4451 4452 4578 4638 4639
PSECT_FLAGS 2541 2601 2606
PSECT_FLG_DATA 2602
PSECT_FLG_GBL 1937 1941 2602
PSECT_FLG_HI 2601
PSECT_FLG_LIB 2601
PSECT_FLG_OVR 1937 1941 2586 2588 2602
PSECT_FLG_REL 1928 1941 2602
PSECT_FLG_RO 2602
PSECT_GLOBALS 2784 2788
PSECT_INFO 2043 2064# 2065# 2066# 2067 2352 2387
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
2397 2455 2478# 2479# 2480# 2568 2578
3765 3807# 3808# 3809# 3810 4063 4098#
4099# 4100# 4102 4187 4222# 4223# 4224#
4226 4315 4359# 4360# 4361# 4363 4450
4494# 4495# 4496# 4498
PSECT_LEN 2534
PSECT_LLA 1433 2854
PSECT_NAME 2397 2503 2540 2605
PSECT_NEXT 2520 2547 2554
PSECT_OFFSET 1433 1462 2075 2338 2543 2586 3077
4127 4253 4389 4526 5038
PSECT_PREV 2548 2550
PSECT_PTR 1398 1428# 1433# 1438 1458# 1461 1462
2042 2067# 2069 2074 2075 2180 2204#
2337 2338 2352 2386 2397 2401 2452
2534# 2540 2541# 2542# 2543# 2547# 2548#
2550 2554 2556 2562# 2574 2580 2585
2586# 2588# 2589 2590# 2601 2605 2606
2735 2775 2784 2788# 2793 2800 2842
2852 2854 3026 3057# 3064 3076 3077
3081# 3137 3180# 3186 3188 3204# 3259
3290# 3297 3311 3315# 3371 3414# 3420
3422 3436 3440# 3498 3550# 3556 3558
3573# 3632 3684# 3690 3692 3706 3710#
3764 3810# 3812 3817 3951 3972# 3978
3990# 3992 4004# 4064 4109# 4116 4131#
4188 4233# 4240 4255 4259# 4316 4370#
4377 4393# 4451 4505# 4512 4529 4533#
4544 4578 4580 4638 4666# 4994 5111
5127 5130#
PSECT_PTR1 2453 2482# 2485 2503 2519 2520# 2522
2547 2550# 2562 2568# 2570 2578# 2580
4065 4102# 4127 4189 4226# 4252 4253
4317 4363# 4388 4389 4452 4498# 4526
4639 5031# 5038
PSECT_PTR2 2454 2483# 2519# 2548 2552 2554#
PSECT_RLD 3081 3204 3315 3440 3573 3710 3990
4004 4131 4259 4393 4533 5130
PSECT_SECTOR 2590 4580
PSECT_SIZE 2542 2587 2588 2589
PSECT_TEXT 1438 1458
PSECT_TYP 2534
R50TOA 178 682 836 1002 1243 3155 3389
3516 3650 3784 4083 4207 4335 4470
4971
R50VAL 619 669# 678# 679# 680# 681# 682
794 833# 834# 835# 836 989# 998#
999# 1000# 1001# 1002 1213 1240# 1241#
1242# 1243 3138 3153# 3154# 3155 3372
3387# 3388# 3389 3499 3514# 3515# 3516
3633 3648# 3649# 3650 3766 3782# 3783#
3784 4066 4081# 4082# 4083 4190 4205#
4206# 4207 4318 4333# 4334# 4335 4453
4468# 4469# 4470 4640 4969# 4970# 4971
RD16 77 187* 354 501 806 812 815
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
817 824 834 835 837 838 841
949 956 958 959 962
RDFILE 80 563*
RDLBBL 79 431* 644 651 969
RDLIBR 81 726*
RDOBBL 78 249* 636 651
RECORD_TYPE 620 691# 693 795 1011# 1013
RESULT 224 239# 240# 241# 242 312 316#
336# 348# 358# 363# 370# 371# 372
389 390# 401 402# 413 414# 429
493 495# 511# 516# 523# 524# 525
541 542# 560 1149 1155# 1156# 1157
RLDD_BLOCK 2903 4641
RLDD_LEN 2911
RLDD_OP1T 2917
RLDD_OP2T 2918
RLDD_OPER 2916
RLDD_OPND1 2919
RLDD_OPND2 2920
RLDD_PTR 2903 2911# 2916# 2917# 2918# 2919# 2920#
2921 4641 4710# 4721 4740# 4751 4770#
4781 4800# 4811 4830# 4841 4860# 4871
4890# 4900 4919# 4929
RLDD_TYP 2911
RLDH_ADDR 2854 3310 3436 3705 4255 4529 5127
RLDH_BLOCK 2845 3027 3139 3260 3373 3500 3634
3952 4067 4191 4319 4454 4642
RLDH_BYTE 2853
RLDH_LEN 2847
RLDH_PSECT 2852
RLDH_PTR 2845 2847# 2852# 2853# 2854# 2855 3027
3064# 3075# 3081 3139 3188# 3199# 3204
3260 3297# 3309# 3310 3315 3373 3422#
3433# 3436 3440 3500 3558# 3568# 3573
3634 3692# 3703# 3705 3710 3952 3978#
3985# 3990 3992# 3998# 4004 4067 4116#
4126# 4131 4191 4240# 4251# 4255 4259
4319 4377# 4387# 4393 4454 4512# 4523#
4529 4533 4642 5111# 5127 5128# 5130
RLDH_TYP 2847
RLDH_VALUE 3075 3199 3309 3433 3568 3703 3985
3998 4126 4251 4387 4523 5128
RLD_OPND_BSTK 3985
RLD_OPND_CON 3075 3076 3199 3309 3310 3435 3568
3704 3705 3985 3998 4126 4252 4254
4387 4388 4524 4526 4528 4890 5037
5070 5124 5126
RLD_OPND_GLOBAL 3199 3433 3568 3704 4995
RLD_OPND_HLA 3998
RLD_OPND_OMIT 4919
RLD_OPND_OPR 2905 3075 3309 3433 3703 4251 4387
4523 4524 4720 4750 4780 4810 4840
4870 4899 4928 5036 5117 5124
RLD_OPND_PSECT 3076 3310 3435 3705 4126 4252 4255
4388 4526 4528 5037 5127
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
RLD_OP_ADD 3075 3076 3199 3310 3435 3568 3704
3705 3985 3998 4126 4252 4254 4387
4388 4524 4525 4528 4710 5037 5126
RLD_OP_AND 4830
RLD_OP_COM 4919
RLD_OP_DIV 4800
RLD_OP_MUL 4770
RLD_OP_OR 4860
RLD_OP_SUB 3309 3433 3703 4251 4523 4740 4890
5123
ROOT 185 845 904 1848# 2209 2266# 2482
2556#
ROOT_BLOCK 185
ROOT_GLOBALS 845 904 2209 2266
ROOT_MODULES 1848
ROOT_PSECTS 2482 2556
ROUTINE_NAME 301# 334 347 357 366 388 400
412 482# 509 519 540 603# 715
767# 943 1038 1090# 1103 1143# 1161
1205# 1232 1276 1318# 1337 1344 1387#
1424 1430 1448 1467 1496 1683# 1694
1731# 1750 1757 1801# 1827 1834 1840
1850 1896# 1982# 1998 2035# 2061 2168#
2200 2249 2298 2304 2439# 2474 2536
2576 2582 2595 2605 2648# 2672 2717#
2733 2770# 2791 2795 2839# 2900# 2963#
2980 3018# 3052 3059 3067 3079 3126#
3166 3176 3182 3190 3202 3251# 3285
3292 3300 3313 3360# 3400 3410 3416
3424 3438 3487# 3536 3546 3552 3560
3571 3621# 3670 3680 3686 3694 3708
3757# 3804 3814 3860# 3892 3898 3943#
3968 3974 3981 3987 3994 4001 4054#
4094 4105 4111 4118 4129 4178# 4218
4229 4235 4242 4257 4306# 4355 4366
4372 4379 4391 4441# 4490 4501 4507
4514 4531 4619# 4661 4668 4716 4746
4776 4806 4836 4866 4895 4924 4991
5001 5033 5043 5088 5093 5098 5109
5114 5175# 5201
RX50 177 2502 2503
R_CR 127 1634 4583*
R_ERR 113 1622 2927*
R_GADR 119 1607 3584*
R_GAR 118 1604 3451*
R_GDR 117 1601 3324*
R_GR 115 1595 3090*
R_IDR 116 1598 3215*
R_IR 114 1592 2982*
R_LCD 120 1610 3721*
R_LCM 121 1613 3824*
R_LR 128# 1637 5138*
R_PADR 126 1631 4404*
R_PAR 125 1628 4270*
R_PDR 124 1625 4142*
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38
R_PL 122 1616 3907*
R_PR 123 1619 4018*
SCAN_DONE 796 899# 901 937#
SEARCH_DONE 797 844# 850 857# 861# 863 869#
873 903# 907 912# 2181 2208# 2215
2223# 2227# 2229 2235# 2239 2456 2481#
2488 2515# 2530
SECTOR 4544 4580 4643 5020# 5026 5031
SEL_GLOBAL 100 2081* 2289 2300 2784 3174 3408
3544 3678 4988
SEL_PSECT 102 2067 2352* 2568 2578 3810 4102
4226 4363 4498
SEL_SECTOR 103 4544* 5031
STACK_DEPTH 4644 4672# 4710 4711 4712 4714# 4720
4721 4722# 4740 4741 4742 4744# 4750
4751 4752# 4770 4771 4772 4774# 4780
4781 4782# 4800 4801 4802 4804# 4810
4811 4812# 4830 4831 4832 4834# 4840
4841 4842# 4860 4861 4862 4864# 4870
4871 4872# 4890 4891 4893# 4899 4900
4901# 4919 4920 4922# 4928 4929 4930#
4995 4996 4998# 5036 5037 5040# 5070
5071 5072# 5109 5117 5123 5125 5129#
STACK_LIMIT 4622# 4636 4637 4998 5001 5040 5043
TEMP 2448 2496# 2515
TEMP_FLAGS 2182 2277# 2278 2310# 2312 2317 2322
TEMP_RLDH_VAL 4645 5117# 5128
TEXTD_ADDR 1399 1473# 1503# 1508
TEXTD_BLOCK 1396 1400
TEXTD_DATA 1473 1503
TEXTD_LEN 1465 1493
TEXTD_NEXT 1500
TEXTD_NUM_BYTES 1489 1509
TEXTD_PREV 1499
TEXTD_PTR 1400 1465# 1471 1472# 1473 1489 1499
1500# 1501# 1502# 1503 1509#
TEXTD_TH 1472 1502
TEXTD_TYP 1465 1493
TEXTH_BLOCK 1397 1401
TEXTH_DATA 1471
TEXTH_LEN 1446
TEXTH_MODU 1463
TEXTH_NEXT 1443 1456
TEXTH_OFFSET 1462
TEXTH_PREV 1452
TEXTH_PSECT 1461
TEXTH_PTR 1401 1437# 1442# 1443 1452 1454 1456#
1460# 1461# 1462# 1463# 1471# 1472 1502
TEXTH_TYP 1446
VALUE 1217 1246# 1252 1255 1258 1261 1264
1267 1270 1273 1766 1820 1859 1915
1928 1937 1941 1945 1995 2000 2056
2071 2075 2133 2195 2207 2316 2324
2331 2404 2469 2480 2589 2611 2667
2681 2730
DSK:BFIO.XRF[4,31] 31-Aug-79 14:38