Google
 

Trailing-Edge - PDP-10 Archives - BB-4157D-BM - sources/global.bli
There are 12 other files named global.bli in the archive. Click here to see a list.


!THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
!  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.

!COPYRIGHT (C) 1973,1977 BY DIGITAL EQUIPMENT CORPORATION
MODULE GLOB(RESERVE(0,1,2,3),SREG=#17,FREG=#16,VREG=#15,DREGS=4,STACK=GLOBAL(STACK,500),GLOROUTINES)=
BEGIN

GLOBAL BIND GLOBV = 5^24 + 1^18 + 100;	!VERSION DATE: 14-AUG-77

%(
REVISION HISTORY

53	-----	-----	ADD IMPLDO FOR I/O LIST OPTIMIZATIONS
54	-----	-----	CORRECT SIZE OF "RELBLOCK" TO 20 RATHER THAN 18
55	-----	-----	ADD LPRDCCT
56	-----	-----	ADD RDCLNK
57	-----	-----	DELETE M1 AND M3
			ADD LOWLIM AND CELMNT
58	-----	-----	CHANGE IMPLDO TO IOPTFLG
59	-----	-----	ADD UNIQVAL FOR OPTIMIZER
60	-----	-----	GUESS
61	-----	-----	REMOVE FGP,ETC FOR NEW GRAPH SRUCTURE
62	-----	-----	CLEANUP P2 GLOBALS AND CHANGE POOLSIZ
63	-----	-----	PERFORM DABS IN LINE
64	-----	-----	DEFINE THE REL FILE BUFFERS:
			MAINRLBF,SYMRLBF,LOCRLBF
			DELETE THE DEFINTIONS OF:
			 RELBLOCK,RELDATA,RELOCPTR
65	-----	-----	DELETE A SERIES OF ENTRIES NO LONGER USED IN FORTB
66	-----	-----	GENERATE CMPLX IN LINE

67	-----	-----	REMOVE PROEPITYP

68	-----	-----	INCREASE THE CHANNEL TABLE SIZE TO INCLUDE "INCLUDE"

				ADD THE GLOBAL NXXFIL WHICH HOLDS THE
				ADDRESS OF NXTFIL IN COMMAN SO THAT IT
				CAN BE CALLED BY PHAZ1 TO ALLOW THE
				COMPILE "+" FILE CONCATINATION COMMAND TO 
				WORK

69	-----	-----	ADD GLOBAL DEBGSW TO HOLD DEBUG SWITCH SETTING

			REMOVE NXXFIL

			MOVE SAVREG FROM STA2 TO HERE SO THAT ITS DEFINED
			FOR PHASE1

70	-----	-----	ADD GLOBAL BGSTBF - TO HOLD CORE REQUIREMENTS FOR
			THE LARGEST INPUT FILE.  CALCULATED IN COMMAN

71	-----	-----	ADD THE GLOBAL "ENDSCAA" - FOR ADDR OF
			END OF SCALARS/ARRAYS
72	-----	-----	CHANGE THE NAME OF DOINDEX TO CURDOINDEX SO
			THAT ALL REFERENCES GET CAUGHT

73	-----	-----	FIX PROBLEM OF DEFINITION OF VARIBLE DIMENSION
			ARRAYS BEFORE THEIR DEFINITION IN AN ENTRY
			BY DELAYING THE CHECK FOR THOSE DIMENSION
			VARIABLES THAT FAIL THE TEST

			SAVED IN STACK POINTED TO BY DIMSTK
74	351		MAKE NEW GLOBAL ARINGLEFT FOR FORTB
75	362	18245	INSERT OCTAL AND DOUBLE OCTAL IN EVALU TABLE

*** BEGIN VERSION 5
76	410	-----	MAKE NEW GLOBAL DTABPTR FOR FORTB
77	464	QA754	MAKE NEW GLOBALS LMLINO, LMRONO, LMCONO FOR
		  780	  LINEMAP IN FORTG
100	607	22685	MAKE NEW GLOBAL NEDZER TO INDICATE IF
			  ZERO-ARG-BLOCK IS NEEDED

)%

SWITCHES NOLIST;
REQUIRE FIRST.BLI;
REQUIRE TABLES.BLI;
SWITCHES LIST;

BEGIN

	MACRO	TBLMAX=4$,	!NUMBER OF CHANNELS USED
		TBLSIZ=10$;	!IMFORMATION PER CHANNEL
	STRUCTURE	MATRIX[I,J]=
		(.MATRIX+(.I-1)*TBLSIZ+.J);
	MACRO	POOLSIZE=600$,	!SIZE OF THE MAJOR CHARACTER QUEUE
		STKSIZE=250$;		!SIZE OF SYNTAX STACK
	GLOBAL
		POOL[POOLSIZE],	!MAJOR CHARACTER QUEUE
		STK[STKSIZE],	!STACK FOR SYNTAX PROCESSING
		MATRIX	CHNLTBL[TBLMAX,TBLSIZ],	!OPEN, LOOKUP/ENTER, & BUFER HEADER INFO
					!FOR TBLMAX CHANNELS
		IBLOCK[3],	!PARAMETERS FOR ISCAN
		TBLOCK[8],	!PARAMETERS FOR TSCAN
		LBLOCK[4],	!PARAMETERS FOR LKWLD
		GETSBLOK[6],	!ARG BLOCK FOR GETSEG
		FLGWRD,		!TEMPORARY STORAGE FOR FLGREG WHILE IN COMMAND SCANNER
		ISPEC,		!POINTER TO INITIAL FILE SPEC
		FSPEC,		!POINTER TO FINAL FILE SPEC
		CCLSW,		!VALUE OF CCL ENTRY, 1=YES, 0=NO
		INDEX,		!CURRENT FILE SPEC
		PAGE,		!COUNT OF NUMBER OF PAGES OUTPUT
		JOBFFSAVE;	!STATE OF JOBFF PRIOR TO OPENING SRC


	MACRO	SSIZ =	79$,	%SYMBOL HASH SIZE%
		CSIZ =	37$,	%CONSTANT HASH SIZE%
		ESIZ =	79$,	%EXPRESSION HASH SIZE%
		LASIZ = 37$,	%STATMENT NUMBER HASH SIZE%
		COSIZ = 37$,	%COMMON EQUIVALENCE HASH SIZE%
		NSIZ =	17$,	%NAMELIST HASH SIZE%
		SOSIZ = 1$,	%NO HASH TABLE FOR ENCODED SOURCE%
		DISIZ = 1$,	%NO HASH TABLE FOR DIMENSIONS%
		DASIZ = 1$,	%NO HASH TABLE FOR DATA STATEMENT%
		LISIZ = 1$,	%LITERAL TABLE IS NOT HASHED%
		EHSIZ = 29$;	%EXPRESSION HASH FOR CMN SUB ELIM%
!***************************************************************
!NOTE:	ALL GLOBALS FROM SYMTBL TO GLOBEND INCLUSIVE WILL BE INITIALIZED
!TO ZERO IN MODULE CLASSIFIER BEFORE EACH COMPILATION.
	GLOBAL SYMTBL[SSIZ],CONTBL[CSIZ],EXPTBL[ESIZ],LABTBL[LASIZ],
		LITTBL[LISIZ],NAMTBL[NSIZ],SRCTBL[SOSIZ],
		DIMTBL[DISIZ],DATTBL[DASIZ];

	GLOBAL BASEPTR;	!THIS CONTAINS THE POINTER TO THE MOST CURRENT ENTRY
			!MADE BY THE TABLE HANDLERS
	GLOBAL COMBLKPTR,	!POINTERS FOR LAST AND FIRST COMMMON BLOCKS
		LITPOINTER,	!LAST AND FIRST LITERALS
		SYMPTR,	!LAST AND FIRST SYMBOLS
		SORCPTR,	!LAST AND FIRST SOURCE ENTRIES
		LASTEXP,	!LAST EXPRESSION ENTRY
		LASTDIM,	!LAST DIMENSION ENTRY
!**[410] @3266 SJW 1-JUL-76
%[410]%		DTABPTR,	! HEAD OF DIM ENTRY LIST FOR BLDDIM
		CONSPTR,	!LAST AND FIRST CONSTANTS
		LABLPTR,	!FIRSTAND LAST STATEMENT LABELS
		EQVPTR,		!PTR TO FIRST AND LAST EQUIVALENCE CLASSES
		FORMPTR,	!PTR TO LINKED LIST OF FORMAT STRINGS 
				!0 IF NONE IN SUBPROGRAM
		NAMLPTR,	!PTR TO LINKED LIST OF NAMELIST LISTS STATEMENT NODES
				!RIGHT HALF POINTS TO LAST, LEFT HALF POINTS TO FIRST
		ASIPTR,		!PTR TO FIRST AND LAST ASSIGN STATEMENTS
		TTOTAL,	!TOTAL UNUSED FREESPACE FOR DEBUGGING
		FREELIST[10],	!VECTOR OF POINTERS TO LINKED LISTS OF
				!FREE STORAGE BLOCKS OF SIZE 0 TO 9 WORDS
		SPACEFREE;	!AMOUNT OF FREE LOWSEG SPACE
	GLOBAL SRCHONLY,	!FLAG FOR TBLSEARCH FOR SEARCH ONLY MODE
		ISN,		!INTERNAL SOURCE SEQUENCE NUMBER
		IDOFSTATEMENT,	!IDENTIFICATION OF EXECUTABLE STEMENT IN TREE
		LABLOFSTATEMENT;!SOURCE STATEMENT NUMBER POINTER
				!IF CURRENT STATEMENT HAS ONE - OR 0
	GLOBAL	DLOOPTREE,	!PTR TO DO LOOP NEST TREE
		DONESTLEVEL,	!CURRENT LEVEL OF DO NESTING
		CURDOINDEX,	!PTR TO CURRENT DO INDEX VARIABLE
		LASDOLABEL,	!LAST LABEL PTR FOR LABEL IN A DO STATEMENT
		LASLVL0,	!PTR TO LAST LEVEL 0 NEST SEEN
		DELETPTR;	!PTR TO DELETED TABLE ENTRY FOR DELETE ROUTINE
	GLOBAL	SYMTYPE,	!TYPE OF CURRENT SYMBOL
		NAME,		!NAME OF THE TABLE FOR TBLSEARCH
				!AND SIZ OF ENTRY IN LEFT HALF
		TYPE,		!THE TYPE OF THE CURRENT SYMBOL
				!HAS VARIOUS MEANINGS DEPENDING UPON CONTEXT
		INCREM,		!INCREMENT USED FOR BUILDING FLOATING CONSTANT
		DECEXP,		!EXPONENT VALUE USED BY GETCONST FOR
				!FLOATING POINT NUMBER GENERATION
		ENTRY[5];	!THE GLOBAL PARAMETER PASSSING VECTOR
!
	GLOBAL REGSAV[16],	!SAV AREA FOR REGISTERS FOR GETSEG
		SEGINCORE;	!INDICATES WHICH SEGMENT IS CURRENTLY ACTIVE

GLOBAL	LOWLOC,		!CURRENT LOWSEG AVAILABLE ADDRESS
		HILOC,	!CURRENT HISEG AVAILABLE ADDRESS
		RELOCWD,	!RELOCATION BITS FOR DATA IN REL BLOCK
		MAINRLBF[20],	!MAIN REL FILE BUFFER - 20 WDS
		LOCRLBF[20],	!BUFFER FOR LOCAL REQUESTS
		SYMRLBF[20],	!BUFFER FOR GLOBAL REQUESTS AND SYMBOL DEFS
		RDATWD,		!PARAMETER WORD FOR PASSING DATA TO REL
				!
		BLANKCOM,	!BLANK COMMON BLOCK PTR

		ENDSCAA,	!ADDRESS OF LOC AFTER THE END OF THE
				! SCALARS AND ARRAYS (BEFORE THE FORMAT STRINGS)
		MULENTRY,	!PTR TO LINKED LIST OF ENTRY STATEMENTS
		FORMAREA,	!TOTAL NUMBER OF WORDS OCCUPIEDBY FORMAT STRINGS
		COMSIZ;		!TOTAL SIZE OF COMMON
!
	GLOBAL
		ONEPLIT,	!POINTER TO CONSTANT INTEGER 1
				!SET IN GLOBINIT
		SP,		!CURRENT TOP OF SYNTAX STACK
		LEXL,		!RESULT OF LAST CALL TO LEXEMEGEN
		LSAVE,		!FLAG INDICATING LEXEME ALREADY SCANNED
		FARRY,		!FIRST ARRAY NAME IN A ONE ARRAY
		CODELINES,	!THE NUMBER OF HISEG CODE LOCATION GENERATED
		STALABL,	!CURRENT LABLOFSTATEMENT
		PROGNAME,	!SIXBIT 'MAIN' OR FROM PROGRAM STATEMENT
		IDTYPE,		!VARIABLE TYPE DEFINED BY TYPE STATEMENT
		ASTATFUN,	!PTR TO CURRENT STATEMENT FUNCTION NAME IF CURRENTLY BEING PARSED
		ERRLINK,	!POINTER TO A LINKED LIST OF ERROR MESSAGES
		TMPCNT[4],	!COUNT OF VARIOUS TYPES OF TEMP USED.
				![0]=TEMPORARY,[1]=MULTIPLYCATION FACTOR
				![2]=OFFSET,[3]=SIZE
		BSAVE,		!BREG SAVE AREA
		FSAVE,		!FREG SAVE WORD
		VSAVE;		!VREG SAVE WORD
!
!THE FOLLOWING TABLE CONTAINS THE DEFAULT TYPES FOR IDENTIFIERS
	MACRO IN=16$,RL=20$,DB=24$,CX=28$,LG=0$;
	GLOBAL TYPTAB[26];
!
!	THE FOLLOWING DEFINES THE LIBRARY FUNCTION ID TABLE
!	EACH ENTRY IS CONPOSED OF TWO PARTS THE FIRST WORD IS THE
!	SIXBIT IDENTIFICATION OF THE LIBRARY FUNCTION AND WORD 2
!	IS THE ATTRIBUTES OF THE FUNCTION
!	THE  ACTUAL FUNCTION TABLEIS TWO TABLES, ON CONTAINING THE
!	NAME AND THE OTHER CONTAINING THE CORRESPONDING ATTRIBUTES
!	THE FIRST TABLE IS CALLED LIBFUNTAB AND THE SECOND IS CALLED
!	LIBATTRIBUTES
!
	MACRO FN(A)= SIXBIT 'A'$;
!
!	MACRO FOR ATTRIBUTES

	MACRO ATT(ARGTYP,RESTYP,ARGCT,INLINFLG,GENERFLG,NEWOPR,GENTBPTR)=
		((INLINFLG^35)		!BIT 0 IS FLAG FOR INLINE FN
	  OR	(1^34)			!BIT 1 IS ALWAYS SET (IN SYMTAB IS FLAG FOR LIB FN)
	  OR	(GENERFLG^33)		!BIT 2 IS GENERIC FN FLAG
	  OR	(ARGTYP^28)		!BITS 3-7 GIVE VALTYPE FOR ARG
	  OR	(RESTYP^23)		!BITS 8-12 GIVE VALTYPE FOR RESULT
	  OR	(ARGCT^18)		!BITS 13-17 GIVE NUMBER OF ARGS
	  OR	NEWOPR),		!RIGHT-HALF-WD GIVES THE OPERATOR TO
					! BE SUBSTITUTED IF INLINFLG IS SET
	GENTBPTR$;			!FOR GENERIC FNS - THE 2ND WD POINTS TO
					! A 4 WD SUB-TABLE THAT INDICATES WHICH
					! ACTUAL FN TO USE FOR EACH ARG TYPE

!
!	B - THE TYPE OF THE ARGUMENT OF THE FUNCTION
!	C - THE TYPE OF THE RESULT OF THE FUNCTION
!	D - THE NUMBER OF ARGUMENTS
!	E - BIT IF FUNCTION IS IN LINE ELIGIBLE
!	F - BIT IF GENERIC FUNCTION NAME


	 BIND FUNTAB = PLIT(LIBFUNTAB GLOBALLY NAMES
ABSENT NAMES	FN(ABS),
ACOSENT NAMES	FN(ACOS),
AIMAGENT NAMES	FN(AIMAG),
AINTENT NAMES	FN(AINT),
ALOGENT NAMES	FN(ALOG),
ALOG10ENT NAMES	FN(ALOG10),
AMAX0ENT NAMES	FN(AMAX0),
AMAX1ENT NAMES	FN(AMAX1),
AMIN0ENT NAMES	FN(AMIN0),
AMIN1ENT NAMES	FN(AMIN1),
AMODENT NAMES	FN(AMOD),
ASINENT NAMES	FN(ASIN),
ATANENT NAMES	FN(ATAN),
ATAN2ENT NAMES	FN(ATAN2),
CABSENT NAMES	FN(CABS),
CCOSENT NAMES	FN(CCOS),
CEXPENT NAMES	FN(CEXP),
CLOGENT NAMES	FN(CLOG),
CMPLXENT NAMES	FN(CMPLX),
CONJGENT NAMES	FN(CONJG),
COSENT NAMES	FN(COS),
COSDENT NAMES	FN(COSD),
COSHENT NAMES	FN(COSH),
CSINENT NAMES	FN(CSIN),
CSQRTENT NAMES	FN(CSQRT),
DABSENT NAMES	FN(DABS),
DATANENT NAMES	FN(DATAN),
DATAN2ENT NAMES	FN(DATAN2),
DBLEENT NAMES	FN(DBLE),
DCOSENT NAMES	FN(DCOS),
DEXPENT NAMES	FN(DEXP),
DFLOATENT NAMES	FN(DFLOAT),
DIMENT NAMES	FN(DIM),
DLOGENT NAMES	FN(DLOG),
DLOG10ENT NAMES	FN(DLOG10),
DMAX1ENT NAMES	FN(DMAX1),
DMIN1ENT NAMES	FN(DMIN1),
DMODENT NAMES	FN(DMOD),
DSIGNENT NAMES	FN(DSIGN),
DSINENT NAMES	FN(DSIN),
DSQRTENT NAMES	FN(DSQRT),
EXPENT NAMES	FN(EXP),
FLOATENT NAMES	FN(FLOAT),
IABSENT NAMES	FN(IABS),
IDIMENT NAMES	FN(IDIM),
IDINTENT NAMES	FN(IDINT),
IFIXENT NAMES	FN(IFIX),
INTENT NAMES	FN(INT),
ISIGNENT NAMES	FN(ISIGN),
MAX0ENT NAMES	FN(MAX0),
MAX1ENT NAMES	FN(MAX1),
MIN0ENT NAMES	FN(MIN0),
MIN1ENT NAMES	FN(MIN1),
MODENT NAMES	FN(MOD),
REALENT NAMES	FN(