Trailing-Edge
-
PDP-10 Archives
-
BB-4157D-BM
-
sources/first.bli
There are 12 other files named first.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) 1972,1977 BY DIGITAL EQUIPMENT CORPORATION
GLOBAL BIND FIRSV =5^24+1^18+130; !VERSION DATE: 11-MAY-77
%(
REVISION HISTORY
116 ----- ----- DEFINE "BOUNDS" FLAG IN FLGREG; REMOVE DEFINITION
OF "ISPROT" FLAG FROM SYMBOL TABLE
117 ----- ----- DEFINE "IDLIBFNFLG" IN SYMBOL TABLE ENTRIES
FOR FUNCTION NAMES
121 ----- ----- CHANGE POOLSIZE TO 600
122 ----- ----- ADD THE INEXTSGN BIT TO SYMBOL TABLE
123 ----- ----- CHANGE EQUIVALENCE LIST ENTRY SIZE TO 4, SO
THAT EQLLIST CAN BE A FULL WORD AND NOT LOSE
THE NUMBER OF SUBSCRIPTS IN THE LEFT HALF
124 ----- ----- ADD THE PARAMT BIT TO THE SYMBOL TABLE AND
REMOVE THE INUSE BIT.
REMOVE SFDUMMY AND INGLOBAL BITS.
DEFINE THE IDPARAVAL FIELD TO CONTAIN THE
CONSTANT TABLE POINTER FOR PARAMETER
VARIABLES.
ADD THE EQVISN FIELD TO THE EQUIVALENCE TABLE
ENTRY TO HOLD THE LINE NUMBER SO THAT RELEVENT
ERROR MESSAGES CAN BE PRINTED OUT
ADD THE IDENTLNK FIELD TO THE SYMBOL
TABLE ENTRY - LINKS ENTRY POINTS
125 ----- ----- PUT TOLENTRY BIT IN TO DEFINE .O VARIABLES
THAT MOVE OUT OF THE LOOP
126 ----- ----- EXPAND THE SIZE OF THE EQUIVALENCE TABLE NODE
SO THAT ISN CAN BE INCLUDED AND DISPLACEMENT
CAN STILL BE A FULL WORD SINCE IT GOES NEGATIVE
***** BEGIN VERSION 5A *****
127 544 10290 FIND STATEMENT NEEDS MORE ROOM FOR ERR AND END
130 571 22378 ADD IDUSECNT DEFINITION
)%
!FIRST MUST BE COMPILED IN THE ORDER ...,FIRST,TABLES,...
!TO SAVE SPACE AND INCREASE COMPILATION SPEED, ALL MACRO DEFINITIONS
!OF THE FORM "NAME = NUMBER$" HAVE BEEN CHANGED TO BIND'S.
REQUIRE IOFLG.BLI;
REGISTER C = 3, R2 = 2, R1 = 1;
BIND CHR = C;
!
%(***DEFINE THE FLAGS USED BY PHASE 2 SKEL AND PHASE 3***)%
MACRO BTTMSTFNFLG=FLGREG<BTTMSTFL>$, !SET FOR BOTTOMOST ROUTINES
CKA10FLG=FLGREG<CKA10>$, !SET FOR COMPILING ON KA10
KA10FLG=FLGREG<KA10>$, !SET FOR COMPILING FOR KA10
LIBARITHFLG=FLGREG<LIBARITH>$, !SET IN "COMPLEXITY" IF ROUTINE INCLUDES ANY ARITHOPS
! THAT REQUIRE USE OF LIBRARY FNS(EG COMPLEX MUL AND DIV)
PEEPFLG=FLGREG<PEEPFL>$; !SET FOR PEEPHOLE OPTIMIZER
! SHOULD BE USED
BIND DEGUG = 0; !FOR DEBUG OPTIONS
!
MACRO XTRAC = IF DEGUG THEN IF .DTRACE NEQ 0 THEN XCALL()$;
BIND OPTIMIZER = 0;
MACHOP JRST = #254,LSHC = #246,ADD=#270;
MACHOP TTCALL = #051, CALLI = #047;
MACHOP ASHC = #244, ADDB = #273, TLZE = #623, AOS = #350,MOVEI = #201;
!
MACRO SIGCHAR = (DO CHAR() WHILE .C LEQ " "; .C)$;
MACRO OUTCHR(X) = TTCALL(1,X)$,
INCHWL(X) = TTCALL(4,X)$,
OUTSTR(X) = TTCALL(3,X)$;
!THE MACROS BELOW IMPLEMENT THE FOLLOWING ALGORITHM WITH 2 INSTRUCTIONS
!
! ((VREG_(.C - START OF RANGE) MOD 1^18) MOD 1^36) LEQ (END OF RANGE - START OF RANGE)
!
MACRO
ALPHA(X) = MOVEI(VREG,-"A",X) LEQ ("Z"-"A")$,
DIGIT(X) = MOVEI(VREG,-"0",X) LEQ 9$,
LCALPHA(X) = MOVEI(VREG,-("A"+" "),X) LEQ ("Z"-"A")$;
!
! THE MODULE GLOBL CONTAINS ALL THE ARRAY DECLARATIONS AND TABLE (PLIT)
! DEFINITIONS THAT WILL BE USED BY SUBSEQUENT ROUTINES THAT ARE
! IN SEPARATE FILES. THE PURPOSE OF THAT FILE IS TO PROVIDE ONE
! PLACE WHERE ALL DECLARATIONS THAT ARE GLOBAL TO THE SCOPE OF
! THE ENTIRE COMPILER CAN BE FOUND EASILY.
!
!
! THE FOLLOWING MACROS AND DECLARATIONS PERTAIN TO THE TABLE MANAGEMENT
! ROUTINE TBLSEARCH() AND ALSO THE CORE MANAGEMENT ROUTINE CORMAN().
!
! THE FOLLOWING MACROS ARE USED TO DEFINE THE PARAMETERS FOR THE
! STRUCTURE DECLARATIONS USED TO DEFINE THE ACCESSING ALGOITHMS
! FOR THE DYNAMIC TABLES USED BY THE FORTRAN COMPILER.
! THESE MACROS DEFINE FIELDS AND SUB-FIELDS IN TABLE ENTRIES.
! FIELDS MAY BE A FULL WORD OR HALF WORD OR LESS.
!
MACRO FULL = 0,36$;
MACRO RIGHT = 0,18$;
MACRO LEFT = 18,18$;
MACRO
CLINK = 0,0,RIGHT$, %CURRENT LINK FIELD%
NLINK = 1,0,RIGHT$, %NEW (NEXT) LINK FIELD%
CW0L = 0,0,LEFT$, %LEFT HALF LINK WORD%
CW0R = 0,0,RIGHT$,
CW1L = 0,1,LEFT$, %LEFT HALF WORD 1%
CW1R = 0,1,RIGHT$, %RIGHT HALF WORD1; 1%
CW1 = 0,1,FULL$, %CURRENT FIRST WORD IN ENTRY%
CW2 = 0,2,FULL$, %SECOND WORD%
CW2R = 0,2,RIGHT$, % " SECOND WORD (RIGHT HALF)%
CW2L = 0,2,LEFT$, % " SECOND WORD LEFT HALF%
CW3 = 0,3,FULL$, % THIRD WORD%
CW3L = 0,3,LEFT$,
CW3R = 0,3,RIGHT$,
CW4 = 0,4,FULL$, %FOURTH WORD%
CW4L = 0,4,LEFT$,
CW4R = 0,4,RIGHT$,
CW5 = 0,5,FULL$,
CW5R = 0,5,RIGHT$, !FIFTH WORD
CW5L = 0,5,LEFT$,
CW6L = 0,6,LEFT$,
CW6R = 0,6,RIGHT$,
CW7L = 0,7,LEFT$,
CW7R = 0,7,RIGHT$;
! THE FOLLOWING MACROS DEFINE THE IDATTRIBUTES OF AN IDENTIFIER
! IDATTRIBUT(X). WHERE X IS ONE OF THE FOLLOWING:
!
! IF ANY ARE MOVED OR CHANGED PLEASE CHECK ROUTINES NAMDEF AND REFERENCE
MACRO ALLOFTHEM= 18,18$,
DEFIND = #576400$,! * !101 111 110 100 000 000
!SEE CORRESPONDING DEFINITIONS BELOW
NOTFUNC = #437400$,! @ !100 011 111 100 000 000
NOTVAR = #500000$,! + !101 000 000 000 000 000
NAMNAM = 35,1$, ! * @ + !NAMELIST NAME
COMBL = 34,1$, ! * @ + !COMMON BLOCK NAME
SFN = 33,1$, ! * + !STATEMENT FUNCTION NAME
PARAMT = 32,1$, ! * !THIS VARIABLE IS A PARAMETER
STORD = 31,1$, ! * @ !VARIABLE IS STORED INTO
INASSI = 30,1$, ! * @ !IN ASSIGN STATMENT
INNAM = 29,1$, ! * @ !IN NAMELIST
FENTRYNAME = 28,1$, ! * @ !NAME IS AN ENTRY INTO A FUNCTION OR SUBROUTINE
INEQV = 27,1$, ! @ !IN EQUIVALENCE
INCOM = 26,1$, ! @ !IN COMMON BLOCK
TOLENTRY = 25, 1$, !.O VAR IS ASSIGNED
!OUTSIDE THE LOOP OF ITS
!FIRST USE
INDATA = 24,1$, ! !IN DATA STATEMENT
INEXTERN = 23,1$, ! !IN EXTERNAL STATEMENT
DUMMY = 22,1$, ! !DUMMY PARAMETER
!(THE BIT 21 FROM RIGHT IS USED FOR "RGCANDFLG")
NOALLOC = 20,1$, !DO NOT ALLOCATE THIS VARIABLE
INTYPE = 19,1$, ! !IDENTIFIER DECLARED IN TYPE DECLARATION
INEXTSGN = 18,1$, ! !LIBRARY FUNCTION IN EXTERNAL STATEMENT
ISDEFIND(B)=(.B[IDATTRIBUT(ALLOFTHEM)] AND DEFIND) NEQ 0$,
ISNOTFUNC(B)=(.B[IDATTRIBUT(ALLOFTHEM)] AND NOTFUNC) NEQ 0$,
ISNOTVAR(B)=IF (.B[IDATTRIBUT(ALLOFTHEM)] AND NOTVAR) NEQ 0 THEN
BEGIN
EXTERNAL E4,E6;
IF .B[IDATTRIBUT(SFN)] THEN
FATLEX(B[IDSYMBOL],SFPLIT<0,0>,E4<0,0>)
ELSE FATLEX( B[IDSYMBOL], E6<0,0>)
END$;
!
!
!THE STRUCTURE ACCESS FOR A SYMBOL TABLE ENTRY
!
MACRO IDLINK = CLINK$,
IDOPTIM = CW0L$, !FOR OPTIMIZATION
IDDIM = CW0L$, !PTR TO DIMENSIONS
IDOPER = CW1R$, !OPERATOR FIELD
IDCHOS =0,2,20,5$, !LOOP # USED IN DEF PT CALCULATION
IDUSED = 0,2,19,1$, !FLAG USED IN DEF PT CALCULATION
IDDEF =0,2,18,1$,
IDATTRIBUT(X) = 0,1,X$,
RGCANDFLG=0,1,21,1$, !FLAG INDICATING THAT THIS VAR COULD BE LEFT IN A REG
! THIS IS USED ON 1ST PASS OF BB REG ALLOC
VARINREGFLG=RGCANDFLG$, !FLAG INDICATING THAT THIS VAR WAS LEFT IN A REG
! THIS IS USED ON 2ND PASS OF BB REG ALLOC
IDTARGET = CW2$, !TARGET FOR ADDRESSING IN CODE GEN
IDADDR = CW2R$, !FOR ADDRESSING
!**[571] FIRST INSERT @339 SJW 11-MAY-77
IDUSECNT = CW2$, ![571] USE COUNT FOR SHARED .I DIMENSION OFFSETS
IDSYMBOL = CW3$, !SYMBOL IN SIXBIT
IDCOMMON = CW4L$, !PTR TO COMMON BLOCK NAME IF IN COMMON
!ALSO PTR TO NAMELIST ARG BLK IF NAMELIST
IDDATVAL=CW4R$, !FOR DATASTMNT PROCESSING: THIS WD IS USED TO HOLD THE
! THE CURRENT *VALUE* OF THIS VARIABLE IF IT IS
! A LOOP INDEX FOR A DATA STATEMNT
IDFNATTRIB= CW4$, !ATTRIBUTE-FIELD FOR A FUNCTION NAME (THIS
! WORD IS USED FOR IDDATA,IDCOMMON FOR VARS)
! THIS FIELD CONTINUES THE ATTRIBUTES OF A
! LIBRARY FUNCTION
!THE FOLLOWING ARE SUBFIELDS OF IDFNATTRIB FIELD:
IDPARAVAL= CW4$, !CONTAINS THE CONSTANT LEXEME WHICH IS THE
!VALUE OF THE GIVEN PARAMETER VARIABLE
IDINLINFLG=0,4,35,1$, !FLAG FOR "THIS FN CAN BE EXPANDED IN LINE"
IDLIBFNFLG=0,4,34,1$, !FLAG FOR "THIS IS A LIBRARY FN"
IDINLINOPR=CW4R$, !OPERATOR TO BE USED FOR THE IN-LINE FN
! NODE THAT CAN BE SUBSTITUTED FOR THIS FN (IF
! THERE IS ONE)
IDSFNLAB=CW5L$, !LOCAL LABEL ASSIGNED TO A STATEMENT FUNCTION
IDENTLNK = CW5L$, !LINK TO NEXT ENTRY POINT IF THIS IS AN
!ENTRY POINT - 0 TERMINATES THE LIST
IDCOLINK = CW5R$; !LINK TO NEXT SYMBOL IN COMMON BLOCK THAT
!THIS SYMBOL IS IN
!
!THE STRUCTURE ACCESS FOR CONSTANT TABLE
!
MACRO CONLINK = CLINK$,
CONOPER = CW1R$, !OPERATOR FIELD
CNTOBEALCFLG= 0,1,35,1$, !FLAG FOR "THIS CONSTANT NEEDS TO BE IN CORE"
CONADDR = CW2R$, !HISEG ADDR OF THIS CONSTANT
CONST1 = CW3$, !HIGH ORDER VALUE(CONTAINS REAL PART OR HI ORDER OF DP OR SINGLE REAL )
CONST2 = CW4$; !LOW ORDER VALUE (CONTAINS INTEGER VALUE)
!
!THE STRUCTURE FOR THE LITERAL TABLE
!
MACRO LITSIZ = CW0L$, !SIZ OF LITERAL IN WORDS
LITLINK = CLINK$, !LINK TO NEXT LITERAL
LITOPER = CW1R$, %OPER FIELD OF LITERAL%
LITFLGS = CW1L$, !LITERAL FLAG FIELD
LITEXWDFLG=0,1,34,1$, !FLAG INDICATING THAT THIS LITERAL HAS AN EXTRA
! WD ON THE END CONTAINING ONLY A NULL (THIS
! IS NECESSARY IF THE NUMBER OF CHARS FITTED INTO AN
! EXACT NUMBER OF WDS)
LITADDR = CW2$, !ADDR OF LIT STRING
LIT1=CW3$, !1ST WD OF THE LITERAL STRING (ASCII - LEFT JUSTIF)
LIT2=CW4$, !2ND WD OF THE LITERAL STRING (WILL BE FILLED WITH NULLS IF
! STRING IS ONLY 1 WD
!SUCCESSIVE WDS OF THE LITERAL WILL BE STORED IN WDS FOLLOWING
LITWD(IX)=0,2+IX,FULL$, !TO ACCESS THE NTH WORD OF A LITERAL
! (NOTE THAT THE 1ST WD IS WORD 1)
FIRSTLIT = LITTBL[0]$;
%(***DEFINE A SPECIAL STRUCTURE TO ACCESS THE NTH WORD OF A LITERAL***)%
STRUCTURE LITERALENTRY[CT]=
(@.LITERALENTRY + 3 + .CT-1)<0,36>;
!
!THE STRUCTURE ACCESS FOR THE COMMON BLOCK NAME TABLE
!
MACRO COMSIZE = CW0L$, !SIZ OF THIS COMMON BLOCK IN WORDS
COMLINK = CLINK$, !LINK TO NEXT BLOCK
COMNAME = CW1$, !BLOCK NAME IS SIXBIT
COMFIRST = CW2L$, !FIRST ENTRY IN BLOCK PTR
COMLAST = CW2R$, !LAST ENTRY IN BLOCK PTR
COMADDR = CW3L$, !THE RELATIVE LOCATION OF THIS BLOCK IN COMMON
NEXCOMBLK =CW3R$; !PTR TO NEXT COMMON BLOCK IN SEQUENCE AS DEFINED
!FOR ALLOCATION PURPOSES
!THE STRUCTURE ACCESS FOR THE EQIVALENCE GROUP TABLE ENTRY
!
MACRO EQVINCOM = 0,0,35,1$, !IS GROUP IN COMMON BIT
EQVAVAIL = 0,0,33,2$, !AVAILABLE FOR SEARCHING BIT 0=AVAIL
!1=OK FOR SEARCH, 2=NOT AVAIL
EQVLINK = CLINK$, !LINK TO NEXT GROUP
EQVLIMIT = CW1R$, !LIMIT VALUE OF EQUIV CLASS
EQVLAST = CW2R$, !PTR TO LAST LIST ENTRY IN GROUP
EQVHEAD = CW1L$, !PTR TO ACTUAL HEAD OF GROUP
EQVFIRST = CW2L$, !PTR TO FIRST ITEM IN GROUP
EQVADDR = CW3$, !DISPLACEMEN OF CLASS 'HEAD' FROM 0
EQVISN = CW4$; !EQUIVALENCE STATEMENT NUMBER
!
!THE STRUCTURE ACCES FOR THE EQUIVALENCE LIST ENTRY
!
MACRO EQLINDIC = 0,0,35,1$, !INDICATES SYMBOL NOT DIMENSIONED YET
EQLLINK = CLINK$, !LINK TO NEXT SYMBOL
EQLID = CW1R$, !PTR TO SYMBOLTABLE
EQLDISPL = CW2$, !DISPLACEMENT OF THIS SYMBOL FROM GROUP HEAD
EQLLIST = CW3$; !PTR TO LIST OF SUBSCRIPTS (CONSTANTS)
!
!THE STRUCTURE ACCESS FOR ENCODED SOURCE (EXECUTABLE PROGRAM) TREE
!
MACRO SRCID = 0,1,1,7$, !ID CODE OF STATEMENT
SRCLINK = CLINK$, !LINK PTR TO NEXT STATEMENT HEADER
SRCCMPLX=0,0,30,6$, !NUMBER OF REGS THAT CAN BE USED TO EVAL THIS STMNT
SRCSONNXTUSE=0,0,18,12$, !ISN OF STMNT OR EXPRESSION LATER IN THIS BASIC BLOCK
! WHERE THE VAR UNDER THIS STMNT WILL NEXT BE USED
SRCISN = CW2L$, !INTERNAL SEQUENCE NUMBER OF STAEMENT
SRCFLAGS = CW1L$, !FLAGS FOR LABEL TABLE
INNERDOFLG = 0,1,32,1$, !FLAGS INNERMOST DO STATEMENTS
SRCSAVREGFLG=0,1,34,1$, !FLAG USED BY BASIC BLOCK REG ALLOC,
! INDICATES THAT THE REG CONTAINING THE VAR UNDER THIS
! ASMNT OR DO STMNT SHOULD BE SAVED
SRCOPER = CW1R$, !OPER FIELD- OPERCLS = STATEMENT
!OPERSPC = SRCID
SRCLBL = CW3L$, !LABEL TABLE POINTER (0 IF NO LABEL)
SRCOPT = CW2R$, !PTR TO OPTIMIZATION WORDS USED BY PHAZ 2
SRCCOMNSUB = CW2R$, !COMMON SUBEXPRESSION HERE
P2SDONE = 0,0,35,1$, !USED BY OPT - INDICATES THAT P2SKEL OPTS
! HAVE BEEN PERFORMED ON THIS STMNT (SAME BIT
! AS 1ST BIT OF SRCCMPLX)
%(***DEFINE A MACRO TO USE IN SPECIFYING OPERATOR FIELDS OF STATEMENT NODES-
FOR A STMNT NODE THE OPRCLS FIELD IS IN BITS 23-27, THE SRCID IS
IN BITS 28-34
******)%
STOPERC(OPCLS,OPSRCID)=
(OPCLS^8 OR OPSRCID^1)$,
!
!THE FOLLOWING STRUCTURES ARE AN INTEGRAL PART OF THE STAEMENT HEADER
!FOR EACH KIND OF EXECUTABLE STATEMENT, ONLY THE ABOVE FIELDS
!CONTAIN INFORMATION COMMON FOR EACH STAEMENT NODE
!
!
!GO TO STATEMENT FIELDS
!
GOTOLBL = CW3R$, !PTR TO LABEL TABLE
AGOTOLBL = CW3R$, !ASSIGNED GO TO LABEL PTR
CGOTOLBL = CW3R$, !COMPUTED GO TO PTR TO PSEUDO EXPRESSION NODE
GOTOLIST = CW4R$, !PTR TO LIST OF LABELS (OR 0) IF NO LIST
GOTONUM = CW4L$, !NUMBER OF LABELL INLIST
!
!IF STATEMENT FIELDS
!
LIFEXPR = CW3R$, !PTR TO EXPR NODE FOR LOGICAL IF
LIFSTATE = CW4R$, !PTR TO STATEMENT NODE IF TRUE CONDITON
AIFEXPR = LIFEXPR$, !SAME AS FOR LOGICAL IF
AIFLESS = CW4R$, !LABEL PTR IF LESS
AIFEQL = CW4L$, !LABEL TO GO TO IF EQUAL
AIFGTR = CW5R$, !LABEL TO GO TO IF GTR
AIFREG = 0,5,23,4$, !REG TO HOLD THE VAL TO BE TESTED
!BITS WITHIN THE FLAGS FIELD USED BY ARITHMETIC IF ONLY
! (THESE BITS ARE ALL USED ELSEWHERE AS FLAGS DESCRIBING ARG2 OF AN EXPRESSION)
AIFLBEQV=0,EXOPWD,21,2$, !VAL OF THIS FIELD INDICATES WHCH (IF ANY)
! OF THE 3 LABELS ARE EQUAL TO EACHOTHER
!(THESE BITS ARE USED IN EXPRS AS A2NEGFLG AND A2NOTFLG)
AIFLBNXT=0,EXOPWD,19,2$, !VAL OF THIS FIELD INDICATES WHICH (IF ANY)
! OF THE LABELS INDICATES THE FOLLOWING STATEMENT
AIFFLGS=0,EXOPWD,19,4$, !THE CONCATENATION OF THE AIFLBEQV AND AIFLBNXT FIELDS
!(THESE BITS ARE A2SAMEFLG AND A2IMMEDFLG IN EXPRS)
!
!ASSIGN STATEMENT FIELDS
!
ASILBL = CW3R$, !PTR TO LABEL IN ASSIGN
ASISYM = CW4L$, !PTR TO SYMBOL TABLE
ASILINK = CW4R$, !LINKS ASSIGN STATEMENTS
!
!DO STATEMENT FIELDS
!
DOPRED = CW6L$, !PTR TO DO STATEMENT PREDECESSOR
DOLBL = CW3R$, !PTR TO DO LABEL TERMINUS ENTRY
DOSYM = CW4R$, !POINTER TO DO INDEX VARIABLE
DOM1 = CW4L$, !POINTER TO INITIAL VALUE
DOM2 = CW5L$, !POINTER TO UPPER LIMIT
DOM3 = CW5R$, !POINTER TO STEP SIZE
DOSSIZE = DOM3$, !ANOTHER NAME FOR STEP SIZE
DOLPCTL = CW7R$, !POINTER TO CONTROL EXPRESSION
DOCTLVAR = CW7L$, !POINTER TO CONTROL VARIABLE
DOCREG=0,6,0,4$, !DO LOOP CONTROL REG
DOIREG=0,6,4,4$, !DO LOOP INDUCTION VARIABLE REGISTER; 0 IS NONE
DOFLGS=CW1L$, !FLAGS ON THIS STMNT (SEE "TABLES" FOR SPECIFIC FLAGS)
DOFLGAUX=0,6,8,10$, !MORE FLAGS ON THIS STMN
!
!THE STRUCTURE OF DO LOOP TREE NODES
!
PARLVL = CW0L$, !PTR TO PARALLEL LEVEL DO LOOP
NEXTDO = CW0R$, !PTR TO NEXT DEEPER NESTED DO
PREVDO = CW1L$, !PTR TO ENCLOSING DO LOOP
LEVL = CW1R$, !NEST LEVEL OF LOOP
DOSRC = CW2R$, !PTR TO SOURCE TREE OF THE DO
DONODESIZ = 3$,
!
!I/O STATEMENT FIELDS
!
IOLINK = CW4R$, !LINK I/O STMTS FOR GENERATION OF ARG BLOCKS
IOARGLBL = CW4L$, !POINTER TO LABEL FOR STMT ARG BLOCK
IOUNIT = CW5L$, !POINTER TO UNIT OR CODE FOR UNIT
IORECORD = CW5R$, !POINTER TO RECONRD FOR RANDOM ACCESS
IOCNT = CW5R$, !FOR ENCODE AND ECODE
IOLIST = CW6L$, !POINTER TO I/O LIST
IOFORM = CW6R$, !POINTER TO FORMAT OR 0 IF UNFORMATTED
IONAME = CW6R$, !POINTER TO NAME LIST FOR NAMELIST
IOERR = CW7L$, !ERR LABEL POINTER
IOEND = CW7R$, !END LABEL POINTER
IOVAR = CW5L$, !FOR ENCODE/ DECODE
IOREPT = CW5R$, !FOR REPEAT FACTOR ON BACKSPACE ETC.
!
!FORMAT STATEMENT FIELDS
!
FORSIZ = CW4L$, !SIZE OF STRING IN WORDS
FORLINK = CLINK$,
FOROPER = CW1R$,
FORADDR = CW4R$, !ADDR OF STRING (IN LOW SEG)
FMTLINK = CW5L$, !LINK TO NEXT FORMAT STATEMENT
FORSTRING = CW5R$, !PTR TO CHARACTER STRING
!
!DATA STATEMENT NODE
!
DATALNK = CLINK$, !LINKS NODES TOGETHER
DATISN = SRCISN$, !CW2L
DATCOUNT = CW1$, !NUMBER OF WORDS SPECIFIED FOR INITIALIZATION
DATITEMS = CW0L$, !PTR LINKED LIST OF DATAITEM NODES
DATCONS = CW2R$, !PTR TO LINKED LIST OF CONSTANT NODE PTRS
%(***DEFINE THE FIELDS IN THE LINKED LIST OF CONSTANTS UNDER A DATA STMNT***)%
DCONST=CW1R$, !PTR TO CONSTANT TABLE ENTRY
DATARPT=CW1L$, !CT OF NUMBER OF TIMES THIS CONSTANT IS TO BE STORED
!
!
!NAMELIST NODE
!
NAMLINK =CLINK$, !LINK TO NEXT NODE
NAMLID =CW2L$, !PTR TO NAMELIST NAME
NAMADDR =CW2R$, !ALLOCATED ADDRESS OF NAMELIST ARGLIST
NAMCNT =CW1L$, !NUMBER OF ITEMS IN NAMLIST
NAMLIST =CW1R$, !PTR TO LIST OF NAMELIST NAMES
!
!OPEN STATEMENT
!
OPSIZ= IOCNT$, !NUMBER OF OPEN PARAMETERS
OPLST= IOLIST$, !LOCATION OF PARAMETER LIST
!
!ASSIGNMENT STATEMENT
!
LHEXP = CW4R$, !PTR TO LEFT SIDE EXPRESSION
RHEXP = CW3R$, !PTR TO RIGHT SIDE EXPR
ASMNTREG = 0,4,23,4$,
!
!STATEMENT FUNCTION FIELDS
!
SFNNAME = CW3R$,
SFNLIST = CW4R$,
SFNEXPR = CW4L$,
SFNCLBREG=CW5R$, !TO SAVE CLOBBREGS FIELD
!
!CALL STATEMENT FIELDS
!
CALSYM = CW3R$, !PTR TO SUBROUTINE NAME SYMBOL
CALLIST = CW4R$, !PTR TO LIST OF ARGS OR 0
CALNUM = CW4L$, !NUMBER OF ARGS IN CALL
!
!RETURN STATEMENT
!
RETEXPR = CW3R$, !PARAMETER NUMBER TO RETURN THRU
!
!STOP STATEMENT
!
STOPIDENT = CW3R$, !STOP LOCATION IDENTIFIER
STOPLBL=CW4L$, !LABEL ASSOCIATED WITH THE ARGLIST TO
! FOROTS USED FOR THIS STMNT
!
!PAUSE STATEMENT
!
PAUSIDENT = CW3R$, !PAUSE LOCATION IDENTIFIER
PAUSLBL=CW4L$, !LABEL ASSOCIATED WITH THE ARGLIST FOR FOROTS USED
! FOR THIS STMNT
!
!REGMASK NODE (FOR GLOBAL ALLOCATION)
!
NEWREGSET=CW3R$,
!
!ENTRY STATEMENT FIELDS (ALSO GOOD FOR SUBROUTINE AND FUNCTION)
!
ENTSYM = CW3R$, !PTR TO ENTRY NAME
ENTLIST = CW4R$, !PTR TO LIST OF ARGS OR 0
ENTNUM = CW4L$, !0 FOR PRINCIPLE ENTRY, ELSE NON-ZERO
ENTID = CW5R$; !ACTUAL NAME FOR A FUNCTION .
!
!THE STRUCTURE ACCESS FOR STATEMENT NUMBER TABLE ENTRY
!
MACRO
SNLINK = CLINK$, !LINK TO NEXT TABLE ENTRY
SNNXTLAB = CW0L$, !PTR TO INTERNAL LABEL WITH SAME ADDR FIELD
SNOPER = CW1R$, !OPER FIELD FOR STATEMENT NUMBER
SNMADELABL =0,1,35,1$, !FLAG FOR MADE LABEL
SNIO = 0,1,18,1$, ! LABEL HAS BEEN REFERENCED IN AN IO STATEMENT
! OR IS A FORMAT STATEMENT LABEL
SNEXECU = 0,1,19,1$, ! LABEL HAS BEEN REFERENCED IN AN EXECUTABLE
! STATEMENT OR IS AN EXECUTABLE STATEMENT LABEL
SNFLAGS = CW1L$, !
SNEXTND = CW2L$, !FOR EXTENDED DO CONSTRUCTION
SNREF = CW2$, !WHOLE WORD USED FOR ADDING 0NE IN TESTENTRY
SNREFNO = CW2R$, !NUMBER OF TIMES LABEL REFERENCED
SNDEFINED = CW2L$, !-1 IF DEFINED
SNADDR = CW2R$, !THE ABSOLUTE ADDRESS OF THIS LABEL
SNHDR = CW3L$, !PTR TO SOURCE STATEMENT TREE OF DEFINING STATEMENT
SNUMBER = CW3R$, !ACTUAL STATEMENT LABEL
SNDOLVL = CW4R$, !COUNT OF NESTED DO'S REFERENCING THIS LABEL
SNDOLNK = CW4L$, !PTR TO LIST OF 1 WORD POINTERS TO DO LOOPS
SNCADDRWD = CW5$, !WD OF ENTRY USED BY PEEPHOLER
SN1STLAB = CW5R$, !PTR TO 1ST LABEL THAT HAS SAME ADDR
SNSTATUS = CW5L$; !STATUS OF THIS LABEL:
! 0 - UNRESOLVED
! 1 - IN PEEPHOLE BUFFER
! 2 - OUT OF PEEPHOLE BUFFER
!REFERENCING THIS LABEL
!
!
!
MACRO DOUBLE = .SYMTYPE GTR REAL$; %FOR TESTING DOUBLE OR COMPLEX MODE%
!
! THE FOLLOWING DEFINES THE TABLE NUMBERS AND ENTRY SIZES
! FOR THE VARIOUS TABLES BUILT BY THE COMPILER
! LEFT HALF IS ENTRY SIZE AND RIGHT HALF IS TABLE NUMBER THAT
! IS USED TO IDENTIFY A SPECIFIC TABLE TO THE TABLE SEARCH ROUTINE
!
BIND IDSIZ = 6, %SYMBOL TABLE ENTRY LENGTH%
POOLSIZ=600, %20 X 72 CHARACTERS SIZE OF BUFFER FOR CARD INPUT%
%SAME DECLARATION AS IN GLOBAL.BLI%
EXSIZ = 4, %EXPRESSION TABLE ENTRY%
SNSIZ = 6, %STATEMENT NUMBER TABLE ENTRY%
CONSIZ = 5, !CONSTANT SIZ
LTLSIZ = 3, !LITERAL SIZ
COMSIZ = 4, !COMMON BLOCK NAME TABLE SIZ
EQVSIZ = 5, !EQUIV GROUP SIZ
EQLSIZ = 4, !EQUIV LIST SIZ
DATSIZ = 3, !DATANODE SIZE
NAMSIZ = 3, !NAMELIST NODE SIZE
SRCSIZ = 4, !SOURCE TREE HDR SIZ
GOSIZ = 1, !GO TO PART SIZ
IFSIZ = 3, !IF PART
ASISIZ = 1, !ASSIGN PART
DOSIZ = 4, !DO PART
FORMSIZ = 2, !FORMAT STATEMENT PART
IOSIZ = 4, !IO LIST PART
ASGNSIZ = 1, !ASSIGNMENT PART
SFSIZ = 2, !STATEMENT FUNCTION SIZ
CALLSIZ = 1, !CALL PART
ENTSIZ = 2, !ENTRY PART
DIMSIZ = 3, !DIMENSION TABLE SIZ
! (PLUS 2 WDS FOR EACH DIMENSION)
ASSISIZ = 1,
BACKSIZ = 4,
CONTSIZ = 0,
DECOSIZ = 4,
OPENSIZ = 4,
CLOSSIZ = 4,
ENCOSIZ = 4,
ENDFSIZ = 4,
!**;[544], FIRST @538 LINES,DCE, 10-MAR-77
!**;[544], THE FIND STATEMENT NEEDS MORE ROOM FOR IOERR AND IOEND
%[544]% FINDSIZ = 4,
READSIZ = 4,
WRITSIZ = 4,
GOTOSIZ = 1,
AGOSIZ = 1,
CGOSIZ = 1,
IFASIZ = 2,
IFLSIZ = 2,
INPUSIZ = 4,
OUTPSIZ = 4,
RETUSIZ = 1,
STOPSIZ = 2,
PAUSSIZ = 2;
!
BIND IDTAB = IDSIZ^18 + 0,
CONTAB = CONSIZ^18 + 1,
CXPTAB = EXSIZ^18 + 2,
LABTAB = SNSIZ^18 +3,
COMTAB = COMSIZ^18 + 4,
SORTAB = SRCSIZ^18 + 5,
DIMTAB = DIMSIZ^18 +6,
EXPTAB = EXSIZ^18 + 7,
IOLTAB = 2^18 + 8,
LITTAB = 9, !# OF WDS PER ENTRY VARIES DEPENDING ON THE SIZE OF STRING
!
!THE FOLLOWING TABLES ARE STATIC AND ALLOCATED TO THE HISEG
!
LFUTAB = 10, %LIBRARY FUNCTION ID TABLE%
EQVTAB = EQVSIZ^18 + 11, %EQUIVALENCE GROUP TABLE%
EQLTAB = EQLSIZ^18 +12, %EQUIVALENCE LIST TABLE%
DATATAB = DATSIZ^18 +13, %DATA GROUP NODE%
NAMTAB = NAMSIZ^18+14; %NAMELIST GROUP TABLE%
!
!
!DEFINE THE ID OF DIFFERENT FORTRAN STATEMENTS
!
!START OF FIRST GROUP (REGULAR)
BIND ASGNID = 000, !ASSIGNMENT
ASSIID = 001, !
CALLID = 002, !
CONTID = 003, !
DOID = 004, !
ENTRID = 005, !
COMNSUB = 006, !
!END OF FIRST GROUP
!START OF REGULAR BRANCHING
GOTOID = 007, !
AGOID = 008, !
CGOID = 009, !
IFAID = 010, !
IFLID = 011, !
RETUID = 012, !
STOPID = 013, !
!END OF SECOND GROUP
!START OF I/O BRANCHING
READID = 014, !
WRITID = 015, !
DECOID = 016, !
ENCOID = 017, !
REREDID = 018, !
FINDID = 019, !
CLOSID = 020,
INPUID = 021, !
OUTPID = 022, !
!END OF THIRD GROUP
!START OF I/O NON-BRANCHING
BACKID = 023,
BKFILID = 024,
REWDID = 025,
SKFILID = 026,
SKRECID = 027,
UNLODID = 028,
RELSID = 029,
ENDFID = 030,
!END OF FOURTH GROUP
!START OF MISC.
ENDID = 031,
PAUSID = 032,
OPENID = 033,
SFNID = 034,
FORMID = 035, !
BLTID = 036, !
REGMASK = 037; !
!
!DEFINE DATA FOR BUILDING SOURCE TREE ENTRIES FOR STATEMENTS
! LEFT HALF IS NUMBER OF WORDS FOR EACH TYPE OF STATEMENT
! RIGHT HALF IS ID OF STATEMENT
!
BIND ASGNDATA = (ASGNSIZ+SRCSIZ)^18 + ASGNID,
SFNDATA = (SFSIZ+SRCSIZ)^18 + SFNID,
ASSIDATA = (ASSISIZ+SRCSIZ)^18 + ASSIID,
BACKDATA = (BACKSIZ+SRCSIZ)^18 + BACKID,
BKFILDATA = (IOSIZ+SRCSIZ)^18 + BKFILID,
SKIPDATA = ( IOSIZ+SRCSIZ)^18 + SKRECID,
SKIPFDATA = (IOSIZ+SRCSIZ)^18 + SKFILID,
REWIDATA = (IOSIZ + SRCSIZ)^18 + REWDID,
UNLODATA = (IOSIZ +SRCSIZ)^18 + UNLODID,
REREDATA = (IOSIZ + SRCSIZ)^18 + REREDID,
CALLDATA = (CALLSIZ+SRCSIZ)^18 + CALLID,
CONTDATA = (CONTSIZ+SRCSIZ)^18 + CONTID,
DECODATA = (DECOSIZ+SRCSIZ)^18 + DECOID,
OPENDATA = (OPENSIZ+SRCSIZ)^18 + OPENID,
CLOSDATA = (CLOSSIZ+SRCSIZ)^18 + CLOSID,
DODATA = (DOSIZ+SRCSIZ)^18 + DOID,
ENCODATA = (ENCOSIZ+SRCSIZ)^18 + ENCOID,
ENDFDATA = (ENDFSIZ+SRCSIZ)^18 + ENDFID,
ENTRDATA = (ENTSIZ+SRCSIZ)^18 + ENTRID,
FINDDATA = (FINDSIZ+SRCSIZ)^18 + FINDID,
READDATA = (READSIZ+SRCSIZ)^18 + READID,
WRITDATA = (WRITSIZ+SRCSIZ)^18 + WRITID,
GOTODATA = (GOTOSIZ+SRCSIZ)^18 + GOTOID,
AGODATA = (AGOSIZ+SRCSIZ)^18 + AGOID,
CGODATA = (CGOSIZ+SRCSIZ)^18 + CGOID,
IFADATA = (IFASIZ+SRCSIZ)^18 + IFAID,
IFLDATA = (IFLSIZ+SRCSIZ)^18 + IFLID,
INPUDATA = (INPUSIZ+SRCSIZ)^18 + INPUID,
OUTPDATA = (OUTPSIZ+SRCSIZ)^18 + OUTPID,
ENDDATA = SRCSIZ^18+ENDID,
RETUDATA = (RETUSIZ+SRCSIZ)^18 + RETUID,
STOPDATA = (STOPSIZ+SRCSIZ)^18 + STOPID,
FORMDATA = (FORMSIZ+SRCSIZ)^18 + FORMID,
PAUSDATA = (PAUSSIZ+SRCSIZ)^18 + PAUSID;
!
! BIND ENTRSIZ = PLIT(IDTAB,CONTAB,EXPTAB,LABTAB,COMTAB,
! SORTAB,DIMTAB,IOLTAB,LITTAB);
!
! THE FOLLOWING MACROS MAY BE NEEDED FOR INDEFINITE SIZE ENTRIES
! AND FOR INDEFINITE LEVEL OF INDIRECT REFERENCE
!
MACRO CWD(L,N) = L,N,FULL$;
!
! L - MEANS LEVEL OF INDIRECTION
! N - MEANS THE N-TH WORD IN THE ENTRY
!
!
!! THE FOLLOWING STRUCTURE DECLARATION DEFINES THE HASH TABLES
! FOR THE SYMBOL TABLE THE CONSTANT TABLE,EXPRESSION TABLE AND
!
!
STRUCTURE HTABLE[I] = (.HTABLE +.I)<RIGHT>;
! DEFINE THE TABLE SIZES
BIND SSIZ = 79, %SYMBOL HASH TABLE%
CSIZ = 37, %CONSTANTS HASH TBLE%
ESIZ = 79, %EXPRESSION HASH%
LASIZ = 37, %STATMENT NUMBER 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%
!
EXTERNAL SYMTBL[SSIZ],CONTBL[CSIZ],EXPTBL[1],LABTBL[LASIZ],
LITTBL[LISIZ],NAMTBL[NSIZ],SRCTBL[SOSIZ],
DIMTBL[DISIZ],DATTBL[DASIZ];
!
! BIND LISTX = PLIT(SYMTBL,CONTBL,EXPTBL,LABTBL,SRCTBL,
! DIMTBL,DATTBL,NAMTBL,LITTBL);
MAP HTABLE SYMTBL: CONTBL: LABTBL: NAMTBL;
!
!
! THE NEXT STRUCTURE DEFINES THE ACCESSING ALGORITHM FOR THE
! LINKED LIST STRUCTURES THAT ARE THE ACTUAL TABLES CONTAINING
! SYMBOL ENTRIES,CONSTANT ENTRIES,EXPRESSION ENTRIES ETC.
!
STRUCTURE BASE[I,J,K,L] =
CASE .I OF SET
%0% (@.BASE +.J)<.K,.L>; %LEVEL 1 ENTRY POINTED TO BY BASE%
%1% (@@.BASE +.J)<.K,.L> %LEVEL 2 ENTRY%
TES;
!
!! THE PARAMETERS ARE DEFINED AS FOLLOWS
! I - THE LEVEL OF INDIRCTION
! 0 - MEANS CONTENTS OF BASE
! 1 - MEANS CONTENTS OF ENTRY POINTED TO BY BASE
! 2 - CONTENTS OF ENTRY POINTED TO BY RIGHT HALF OF
! ADDRESS POINTED TO BY BASE
!
! J - THE J-TH WORD IN THE TABLE ENTRY POINTED TO
!