! bliss.req - common definitions for all source files. ! fundamental constants Literal WRDSZ = 16, ! BITS/WORD FOR COMPILED CODE BYTSZ = 8; ! BITS/BYTE FOR COMPILED CODE ! tunable constants Literal DEFAULTSSTK = 256, ! DEFAULT # OF WORDS IN RUNTIME STACK HTSIZE = 128, ! LENGTH OF HASH TABLE DTSIZE = 128; ! SIZE OF DELIMITER TABLE ! miscellaneous constants Literal TRUE = 1, FALSE = 0; ! names for common types Macro Boolean = Quad %, Integer = Quad %; ! common macros Macro ASSERT(e) = (If Not (e) Then PUNT(999)) %, _POS(P,E,S) = (P) %, _POS2(I,P,E,S) = (P) %, _LEN(P,S,E) = (S) %, AZ[s] = Uplit Byte ( %Asciz s ) %, MOVECORE(SRC,DST,LENTH) = ch$move((LENTH)*8,SRC,DST) %, CLEARCORE(BASE,LENTH) = ch$fill(0,(LENTH)*8,BASE) %, SWAP(A,B) = (Local n; n = .a; a = .b; b = .n) %, ONEOFX(A,LO,HI) = (((1^(HI+1)-1^LO)^(-(A)) And 1) Neq 0) %, ONEOF(NUM)[] = (((0 Or BITMASK(%REMAINING))^(-(NUM)) And 1) Neq 0) %, BITMASK[N] = 1^(N) %, FIELDK(PS,N,O) = Literal N=O, %Name(FLD_Q_,N) = PS; Macro %Name(FLD_K_,N) = N^PS %Quote % %; ! i/o constants ! ! notes: ! these device codes are really bit masks. Literal TTYDEV = 1, ! TTY LSTDEV = 2, ! LISTING DEVICE ERRDEV = LSTDEV+TTYDEV; ! ERROR DEVICE ! lexeme type and structure tag codes ! ! notes: ! these codes are sorted by quote level ! Literal T_DELIMITER = 0, T_NIL = 0, T_LITERAL = 1, ! LITERAL LEXEME T_VARIABLE = 2, T_SYMBOL = 3, T_NODE = 4, ! GRAPH TABLE LEXEME. T_STRING = 5, ! LONG STRING LEXEME T_STRUCT_ARG = 6, ! STRUCTURE ACTUAL (IN STREAMS ONLY) T_NAME = 7, ! UNBOUND VARIABLE T_LEX_FUNC = 8, ! SPECIAL FUNCTIONS T_LEX_COND = 9, ! lexical conditional T_MACRO = 10, ! MACRO T_LEX_QUOTE = 11, ! SPECIAL FUNCTIONS (EXPANSION) T_MACRO_ARG = 12, ! MACRO ACTUAL (IN STREAMS ONLY) T_TEMPNAME = 13, ! TEMP NAME LEXEME T_QUEUE = 14, T_PLIT = 15, LO_TAG_TYPE = 0, HI_TAG_TYPE = 15; ! queue types Literal T_ALPHA = 0, T_OMEGA = 1, T_CHI = 2, T_RHO = 3; ! quote levels for RUND Literal QL_LEXEME = T_VARIABLE, QL_STRING = T_STRING, QL_NAME = T_NAME, QL_MACRO = T_MACRO; ! bits in the macro subtype. Macro MAC_V_RECURSIVE = 0,1 %, ! [] specified MAC_V_ITERATIVE = 1,1 %, ! [X,...] specified MAC_V_FIXED = 2,1 %; ! (X,...) specified ! special bit combinations in the macro subtype Literal MAC_SIMPLE = 0, MAC_PASSED = 1, MAC_ITERATIVE = 2, MAC_FIXED = 4, MAC_RECURSIVE = 4+1; ! panic stop codes ! ! notes: ! the panic stop codes are bit numbers in the LASTEND ! variable. a bit of one means that the delimiter ! associated with that bit will cause the error ! recovery scan to stop. ! ! syntax routines wishing to set a stop bit should ! save the old value of LASTEND, set the bit(s) ! for its delimiter(s), and parse its statement. ! LASTEND should then be restored. Literal PS_END = 1, PS_PAREN = 2, PS_SEMICOLON = 3, PS_COLON = 4, PS_COMMA = 5, PS_THEN = 6, PS_TES = 7, PS_OF = 8, PS_DO = 9, PS_WHILE = 10, PS_UNTIL = 11, PS_RANGLE = 12, PS_RBRACKET = 13, PS_ELBANE = 14, LO_PS_TYPE = 1, HI_PS_TYPE = 14; ! delimiter class codes and delimiter flag bits ! ! notes: ! delimiters have a class field which indicates ! whether the delimiter is an operator, open bracket, ! close bracket, or a declarator. ! ! the delimiter class is used in determining operator precedence. ! ! SE operator/keyword is valid after an operator. ! ! AE operator/keyword is valid at the start of an expression ! (but invalid after a CASE or SELECT statement). ! ! MT binary operator (e.g. wants a LHS operand) ! ! R2L operator precedence is right to left Literal SE = 8, ! HSE MT = 4, ! HMT AE = 2, ! HAE R2L = 1, ! HFORCER2L CL_OPEN = 0, CL_OPER = 1, CL_CLOSE = 2, CL_DECL = 3, LO_CLASS_TYPE = 0, HI_CLASS_TYPE = 3; ! declaration routine indices. ! ! notes: ! these codes are embedded in their associated ! lexemes and are used as an index into a jump ! table. Literal DCLBYTE = 1, DCLOWN = 2, DCLGLO = 3, DCLEXT = 4, DCLROU = 5, DCLSTR = 6, DCLMAP = 7, DCLFOR = 8, DCLBIN = 9, DCLMAC = 10, DCLUND = 11, DCLLAB = 12, DCLWORD = 13, DCLSWI = 14, DCLLOC = 15, DCLREG = 16, DCLENABLE = 17, DCLREQU = 18, DCLSLOCAL = 19, DCLLNKG = 20, DCLPSECT = 21; ! symbol type codes ! ! notes: ! the symbol type is stored in the [st_code] field. ! ! the symbol type codes S_LOCAL through S_BIND are ! ordered and some assumptions are made as to their ! ordering. Literal LOWVARTYPE = 0, ! variable types LOWEXPTYPE = 0, ! expression types LOWADDTYPE = 0, ! address types S_LOCAL = 0, S_REGISTER = 1, S_FORMAL = 2, LOWLTCETYPE = 3, S_OWN = 3, S_EXTERNAL = 4, S_GLOBAL = 5, HIGHVARTYPE = 5, S_ROUTINE = 6, S_GBL_ROUTINE = 7, S_FORWARD = 8, HIGHLTCETYPE = 8, HIGHADDTYPE = 8, ! symbols which have an address S_BIND = 9, HIGHEXPTYPE = 9, ! symbols usable in an expressions S_UNDECLARE = 10, S_LABEL = 11, S_LINKAGE = 12, S_MACRO = 13, S_SPECIAL = 14, S_MACRO_ARG = 15, S_LEX_FUNC = 16, S_LEX_QUOTE = 17, S_LEX_COND = 18, S_STRUCT_ARG = 19, S_STRUCTURE = 20, S_OTHER = 21, S_LITERAL = 22; ! operator codes ! ! notes: ! these codes are embedded within their associated delimiter ! lexemes. ! ! in nodes, these codes are stored in the [gt_code] field. ! ! the order of this table is assumed by many jump tables. ! also, the order of the relational operators is assumed ! in many places. Literal RELOPBASE = 11, MAXDELIMITER = 64, MAXOPERATOR = 32; Literal OP_ADD = 0, OP_SWAB = 1, OP_DIV = 2, OP_DOT = 3, OP_SUB = 4, OP_MOD = 5, OP_MUL = 6, OP_NEG = 7, OP_PLUS = 8, OP_LOAD_NODE = 8, ! same as OP_PLUS OP_SHIFT = 9, OP_BIT = 10, OP_GTR = 11, OP_LEQ = 12, OP_LSS = 13, OP_GEQ = 14, OP_EQL = 15, OP_NEQ = 16, OP_NOT = 17, OP_EQV = 18, OP_AND = 19, OP_OR = 20, OP_XOR = 21, OP_GTRU = 22, OP_LEQU = 23, OP_LSSU = 24, OP_GEQU = 25, OP_EQLU = 26, OP_NEQU = 27, OP_ROT = 28, OP_MAX = 29, OP_MIN = 30, OP_CARRY = 31, OP_OVERFLOW = 32, OP_STORE = MAXOPERATOR+1, OP_ERROR = MAXOPERATOR+2, OP_CASE = MAXOPERATOR+3, OP_FPARM = MAXOPERATOR+4, OP_FSTORE = MAXOPERATOR+5, OP_WHILE = MAXOPERATOR+6, OP_UNTIL = MAXOPERATOR+7, OP_ROUTINE = MAXOPERATOR+8, OP_COMPOUND = MAXOPERATOR+9, OP_INCR = MAXOPERATOR+10, OP_DECR = MAXOPERATOR+11, OP_IF = MAXOPERATOR+12, OP_DO_WHILE = MAXOPERATOR+13, OP_DO_UNTIL = MAXOPERATOR+14, OP_SELECT = MAXOPERATOR+17, OP_EXITLOOP = MAXOPERATOR+18, OP_LABEL = MAXOPERATOR+19, OP_MODULE = MAXOPERATOR+20, OP_PLIT = MAXOPERATOR+21, OP_CALL = MAXOPERATOR+22, OP_POINTER = MAXOPERATOR+23, OP_BRACKET = MAXOPERATOR+24, OP_LEAVE = MAXOPERATOR+25, OP_RETURN = MAXOPERATOR+26, OP_NULL = MAXOPERATOR+27, OP_FAKE_CSE = MAXOPERATOR+27, ! same as OP_NULL OP_INLINE = MAXOPERATOR+28, OP_ENABLE = MAXOPERATOR+29, OP_SIGNAL = MAXOPERATOR+30, OP_MOVP = MAXOPERATOR+31; ! PDP-11 addressing modes. ! ! notes: ! these modes just happen to match the actual ! hardware modes on the PDP-11. Literal DEFERRED = 1, GENREG = 0, AUTOINCR = 2, AUTODECR = 4, INDEXED = 6, IMMEDIATE = 2, ABSOLUTE = 3, RELATIVE = 6; ! special PDP-11 registers. Literal VR = 0, SP = 6, PC = 7; ! instruction opcodes ! ! notes: ! the order of these codes is assumed ! in several tables. ! ! the order relationship of the codes PROR to PASLB ! is assumed. ! ! the order of the branch codes is assumed in places. ! the order relationship of branches and their ! reverse branch is assumed. Literal PINLINE = 0, PMOV = 1, PMOVB = 2, PCMP = 3, PCMPB = 4, PBIT = 5, PBITB = 6, PBIC = 7, PBICB = 8, PBIS = 9, PBISB = 10, PADD = 11, PSUB = 12, PCLR = 13, PCLRB = 14, PCOM = 15, PCOMB = 16, PINC = 17, PINCB = 18, PDEC = 19, PDECB = 20, PNEG = 21, PNEGB = 22, PADC = 23, PADCB = 24, PSBC = 25, PSBCB = 26, PTST = 27, PTSTB = 28, PROR = 29, PRORB = 30, PROL = 31, PROLB = 32, PASR = 33, PASRB = 34, PASL = 35, PASLB = 36, PJMP = 37, PSWAB = 38, PJSR = 39, PRTS = 40, PHALT = 41, PWAIT = 42, PRTI = 43, PIOT = 44, PRESETX = 45, ! reserved word w/o the 'X'! PEMT = 46, PTRAP = 47, PBR = 48, PNBR = PBR Or 1, PBNE = 50, PBEQ = PBNE Or 1, PBGE = 52, PBLT = PBGE Or 1, PBLE = 54, PBGT = PBLE Or 1, PBPL = 56, PBMI = PBPL Or 1, PBHI = 58, PBLOS = PBHI Or 1, PBVC = 60, PBVS = PBVC Or 1, PBHIS = 62, PBLO = PBHIS Or 1, PNOP = 64, PCLC = 65, PCLVC = 66, PWORD = 67, PCASE = 68, PMFPI = 69, PMFPD = 70, PMTPI = 71, PMTPD = 72, INFLOOPOP = 73, SETEQLOP = 74; ! cell field codes. Literal UNUSED = 0, ! cell types CELL_CODE = 1, ! contains an instruction CELL_LABEL = 2, ! contains a label CELL_REF = 3, ! contains a reference to a label LO_CELL_TYPE = 1, HI_CELL_TYPE = 3, ! label cell types LAB_ROUTINE = 0, ! routine entry point LAB_USER = 1, ! user defined label LAB_COMP = 2, ! compiler generated label LO_LAB_TYPE = 0, HI_LAB_TYPE = 2, ! code cell types INST_NORMAL = 0, INST_CASE_PARAM = 1, INST_INLINE = 2, ! INLINE code INST_UNCOND_JUMP = 3, ! unconditional branch INST_ADD_IMMED = 4, ! ADD(SUB) #k,Rn INST_COND_JUMP = 5, ! conditional branch LO_INST_TYPE = 0, HI_INST_TYPE = 5, ! operand name type NAME_NORMAL = 0, NAME_LABEL = 1, NAME_FORMAL = 2, ! address reference types ! ! notes: ! a value of zero (UNUSED) indicates the operand ! is not used (e.g. the second operand field for the INC ! instruction). ! ! the ordering of these types is important because ! of assumptions in MAY_REFER in FINAL. ADDR_IMMED = 1, ADDR_REG = 2, ADDR_INDIRECT = 3, ADDR_MEMORY = 4, LO_ADDR_TYPE = 1, HI_ADDR_TYPE = 4, ! operand types OPND_NORMAL = 1, OPND_NAME = 2, OPND_INLINE = 3, OPND_TRAP = 4, OPND_LABEL = 5, LO_OPND_TYPE = 1, HI_OPND_TYPE = 5, ! CONTENTS OF CELLSIZEF SZ_CELL_CODE = 9, SZ_CELL_LABEL = 5, SZ_CELL_REF = 5, ! operand types OPTYPE_NOP = 0, OPTYPE_ONE = 1, OPTYPE_TWO = 2, OPTYPE_BR = 3, OPTYPE_JSR = 4, OPTYPE_RTS = 5, OPTYPE_TRAP = 6, OPTYPE_WORD = 7, OPTYPE_CASE = 8, LO_OPTYPE = 0, HI_OPTYPE = 8; ! linkage type codes Literal LNK_SPECIAL = 0, ! SPECIAL FUNCTIONS (HALT,WAIT, ETC.) LNK_BLISS = 1, ! BLISS LNK_EMT = 2, ! EMT LNK_FORTRAN = 3, ! FORTRAN LNK_INTERRUPT = 4, ! INTERRUPT LNK_TRAP = 5, ! TRAP LNK_IOT = 6, ! IOT LINKAGE LO_LNK_TYPE = 0, HI_LNK_TYPE = 6; ! linkage parameter types Literal PARM_STACK = 0, ! STACK TYPE PARM PARM_REGISTER = 1, ! REGISTER PARM LO_PARM_TYPE = 0, HI_PARM_TYPE = 1; ! structure definitions. Macro GT = Block %, ST = Block %, ITEM = Block[2] %, ADRVARSTR = Block[2] %, CELL = Block[0] %, PLSTSTK = Block[1] %, LSTHDR = Block[1] %, TNREPR = Block[3] %, TNLSTHDR = Block[1] %, LVL = Block[1] %, FLOLSTPTR = Block[2] %; ! sizes of the various structures. ! ! note: the item sizes depend on the arguments to MAKITEM Literal SZ_TEMPNAME = 6, SZ_STELIST = 2, SZ_TNREP = 3, SZ_FLOLIST = 2, SZ_LSTHDR = 2, SZ_PLSTSTK = 2, SZ_PLIT = 2, SZ_LVL = 1, SZ_QUEUE = 1; Macro SZ_STRING(N) = (((N) + 11) / 8) %, SZ_STREAM(N) = ((n) + 2) %, SZ_NODE(n) = ((n) + 8) %, SZ_NAME(n) = (((n) + 25) / 8) %, SZ_ITEM(n) = ((n) + 1) %, SZ_INT_ITEM(n) = ((n) + 2) %; Macro SZ_RHO_ITEM = SZ_ITEM(2) %, SZ_CHI_ITEM = SZ_ITEM(1) %, SZ_PSI_ITEM = SZ_ITEM(1) %, SZ_FLSTK_ITEM = SZ_ITEM(2) %; ! delimiter lexeme fields ! ! notes: ! SOPERATOR uses a combination of class and priority to determine ! whether one operator has a higher precedence than another. ! this is why HCLASS and HPRIORITY overlap. ! ! lex_delim holds the delimiter index in a window structure. ! ! the fields HSE, HMT, HAE, and HFORCER2L correspond to the ! literal masks SE, MT, AE, and R2L respectively. Macro lex_class = 28, 4,0 %, lex_priority = 24, 8,0 %, ! overlap - AARGH! HSE = 19, 1,0 %, HMT = 18, 1,0 %, HAE = 17, 1,0 %, HFORCER2L = 16, 1,0 %, lex_bits = 16, 4,0 %, ! HSE+HMT+HAE+HFORCER2L lex_unique = 8, 8,0 %, lex_index = 0, 8,0 %; ! ACTUAL INDEX ! symbol lexeme fields Macro lex_addr = 0, 0,32,1 %, ! ADDRESS PORTION OF LEXEME lex_type = 0,32, 8,0 %, ! LEXEME TYPE FIELD lex_delim = 0,40, 8,0 %, ! DELIM TABLE INDEX WITH WINDOW STRUCT lex_attr = 0,48, 8,0 %, lex_v_quote = 0,48, 1,0 %, lex_v_unquote = 0,49, 1,0 %, lex_v_expand = 0,50, 1,0 %; ! delimiter lexeme codes Macro DEFLEX(CLASS,PRIO,FLGS,UN,IND) = (CLASS) ^ _POS(lex_class) Or (PRIO) ^ _POS(lex_priority) Or (FLGS) ^ _POS(lex_bits) Or (UN) ^ _POS(lex_unique) Or (IND) ^ _POS(lex_index) %; ! ! notes: ! MT is a flag which indicates whether SYM is allowed ! to be empty at a given point. it also indicates ! unary or binary in the case of operators. ! ! AE indicates whether AEFOLLOWS() in SYNTAX should be TRUE. ! similarly for SE and SEFOLLOWS(). Literal ! SPECIAL LEXEMES TK_EMPTY = 0, TK_WHILE2 = DEFLEX(CL_CLOSE,0,0, 1,OP_DO_WHILE), TK_UNTIL2 = DEFLEX(CL_CLOSE,0,0, 0,OP_DO_UNTIL), TK_COMPOUND = DEFLEX(CL_OPEN, 1,0, 0,OP_COMPOUND), TK_NULL = DEFLEX(0, 0,0, 0,OP_NULL), TK_FPARM = DEFLEX(CL_OPEN, 0,0, 0,OP_FPARM), TK_FSTORE = DEFLEX(CL_OPEN, 0,0, 0,OP_FSTORE), TK_SWAB = DEFLEX(CL_OPER, 0,0, 0,OP_SWAB), TK_CARRY = DEFLEX(CL_OPER, 0,0, 0,OP_CARRY), TK_OVERFLOW = DEFLEX(CL_OPER, 0,0, 0,OP_OVERFLOW), TK_MOVP = DEFLEX(CL_OPER, 0,0, 0,OP_MOVP), ! OPEN BRACKETS TK_BEGIN = DEFLEX(CL_OPEN, 0,SE+AE, 0,OP_COMPOUND), TK_LPAREN = DEFLEX(CL_OPEN, 0,SE+AE, 1,OP_COMPOUND), TK_CASE = DEFLEX(CL_OPEN, 0, AE, 0,OP_CASE), TK_DECR = DEFLEX(CL_OPEN, 0, AE, 0,OP_DECR), TK_DO = DEFLEX(CL_OPEN, 0, AE, 2,OP_DO_WHILE), TK_EXITLOOP = DEFLEX(CL_OPEN, 0, AE, 1,OP_EXITLOOP), TK_INLINE = DEFLEX(CL_OPEN, 0,SE+AE, 0,OP_INLINE), TK_INLINECOM = DEFLEX(CL_OPEN, 0,SE+AE, 1,OP_INLINE), TK_LABUSE = DEFLEX(CL_OPEN, 0,0, 0,OP_LABEL), TK_LEAVE = DEFLEX(CL_OPEN, 0, AE, 0,OP_LEAVE), TK_IF = DEFLEX(CL_OPEN, 0, AE, 0,OP_IF), TK_INCR = DEFLEX(CL_OPEN, 0, AE, 0,OP_INCR), TK_MODULE = DEFLEX(CL_OPEN, 0,SE+AE, 0,OP_MODULE), TK_CALL = DEFLEX(CL_OPEN, 0,SE+MT+AE, 0,OP_CALL), TK_PLIT = DEFLEX(CL_OPEN, 0,SE+AE, 0,OP_PLIT), TK_LANGLE = DEFLEX(CL_OPEN, 0,SE+MT+AE, 0,OP_POINTER), TK_RETURN = DEFLEX(CL_OPEN, 0, AE, 0,OP_RETURN), TK_SELECT = DEFLEX(CL_OPEN, 0,SE+AE, 0,OP_SELECT), ! why SE? TK_SIGNAL = DEFLEX(CL_OPEN, 0, AE, 0,OP_SIGNAL), TK_LBRACKET = DEFLEX(CL_OPEN, 0,SE+MT+AE, 0,OP_BRACKET), TK_UNTIL = DEFLEX(CL_OPEN, 0, AE, 0,OP_UNTIL), TK_UPLIT = DEFLEX(CL_OPEN, 0,SE+AE, 1,OP_PLIT), TK_WHILE = DEFLEX(CL_OPEN, 0, AE, 1,OP_WHILE), ! STANDARD ARITH OPERATORS TK_ADD = DEFLEX(CL_OPER, 6,SE+MT+AE, 0,OP_ADD), TK_DIV = DEFLEX(CL_OPER, 4,SE+MT+AE, 1,OP_DIV), TK_DOT = DEFLEX(CL_OPER, 0,SE+AE+R2L, 0,OP_DOT), TK_MINUS = DEFLEX(CL_OPER, 6,SE+MT+AE, 1,OP_SUB), TK_MOD = DEFLEX(CL_OPER, 4,SE+MT+AE, 0,OP_MOD), TK_MUL = DEFLEX(CL_OPER, 4,SE+MT+AE, 0,OP_MUL), TK_NEG = DEFLEX(CL_OPER, 2,SE+AE+R2L, 0,OP_NEG), TK_PLUS = DEFLEX(CL_OPER, 2,SE+AE+R2L, 0,OP_PLUS), TK_ROT = DEFLEX(CL_OPER, 3,SE+MT+AE, 0,OP_ROT), TK_SHIFT = DEFLEX(CL_OPER, 3,SE+MT+AE, 0,OP_SHIFT), TK_MAX = DEFLEX(CL_OPER, 7,SE+MT+AE, 0,OP_MAX), TK_MIN = DEFLEX(CL_OPER, 7,SE+MT+AE, 0,OP_MIN), TK_STORE = DEFLEX(CL_OPER,15,SE+MT+AE+R2L,0,OP_STORE), ! BOOLEAN OPERATORS TK_AND = DEFLEX(CL_OPER,10,SE+MT+AE, 0,OP_AND), TK_EQL = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_EQL), TK_EQLU = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_EQLU), TK_EQV = DEFLEX(CL_OPER,14,SE+MT+AE, 0,OP_EQV), TK_GEQ = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_GEQ), TK_GEQU = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_GEQU), TK_GTR = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_GTR), TK_GTRU = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_GTRU), TK_LEQ = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_LEQ), TK_LEQU = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_LEQU), TK_LSS = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_LSS), TK_LSSU = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_LSSU), TK_NEQ = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_NEQ), TK_NEQU = DEFLEX(CL_OPER, 8,SE+MT+AE, 0,OP_NEQU), TK_NOT = DEFLEX(CL_OPER, 9,SE+AE+R2L, 0,OP_NOT), TK_OR = DEFLEX(CL_OPER,12,SE+MT+AE, 0,OP_OR), TK_XOR = DEFLEX(CL_OPER,14,SE+MT+AE, 0,OP_XOR), ! CLOSE BRACKETS ! note: TK_END through TK_RBRACKET must be in order and first! ! HRUND assumes this. TK_END = DEFLEX(CL_CLOSE,0,0,0, 0), TK_RPAREN = DEFLEX(CL_CLOSE,0,0,0, 1), TK_RANGLE = DEFLEX(CL_CLOSE,0,0,0, 2), TK_RBRACKET = DEFLEX(CL_CLOSE,0,0,0, 3), TK_ALWAYS = DEFLEX(CL_CLOSE,0,0,0, 4), TK_BY = DEFLEX(CL_CLOSE,0,0,0, 5), TK_COLON = DEFLEX(CL_CLOSE,0,0,0, 6), TK_COMMA = DEFLEX(CL_CLOSE,0,0,0, 7), TK_DO2 = DEFLEX(CL_CLOSE,0,0,0, 9), TK_ELBANE = DEFLEX(CL_CLOSE,0,0,0,10), TK_ELSE = DEFLEX(CL_CLOSE,0,0,0,11), TK_ELUDOM = DEFLEX(CL_CLOSE,0,0,0,12), TK_FROM = DEFLEX(CL_CLOSE,0,0,0,13), TK_OF = DEFLEX(CL_CLOSE,0,0,0,14), TK_OTHERWISE = DEFLEX(CL_CLOSE,0,0,0,15), TK_SEMICOLON = DEFLEX(CL_CLOSE,0,0,0,16), TK_SET = DEFLEX(CL_CLOSE,0,0,0,17), TK_TES = DEFLEX(CL_CLOSE,0,0,0,18), TK_THEN = DEFLEX(CL_CLOSE,0,0,0,19), TK_TO = DEFLEX(CL_CLOSE,0,0,0,20), TK_WITH = DEFLEX(CL_CLOSE,0,0,0,21), TK_REP = DEFLEX(CL_CLOSE,0,0,0,22), TK_EQUAL = TK_STORE, ! DECLARATORS TK_BIND = DEFLEX(CL_DECL,0,0,0,DCLBIN), TK_ENABLE = DEFLEX(CL_DECL,0,0,0,DCLENABLE), TK_EXTERNAL = DEFLEX(CL_DECL,0,0,0,DCLEXT), TK_FORWARD = DEFLEX(CL_DECL,0,0,0,DCLFOR), TK_GLOBAL = DEFLEX(CL_DECL,0,0,0,DCLGLO), TK_LABEL = DEFLEX(CL_DECL,0,0,0,DCLLAB), TK_LOCAL = DEFLEX(CL_DECL,0,0,0,DCLLOC), TK_MACRO = DEFLEX(CL_DECL,0,0,0,DCLMAC), TK_MAP = DEFLEX(CL_DECL,0,0,0,DCLMAP), TK_OWN = DEFLEX(CL_DECL,0,0,0,DCLOWN), TK_REGISTER = DEFLEX(CL_DECL,0,0,0,DCLREG), TK_ROUTINE = DEFLEX(CL_DECL,0,0,0,DCLROU), TK_STRUCTURE = DEFLEX(CL_DECL,0,0,0,DCLSTR), TK_SWITCHES = DEFLEX(CL_DECL,0,0,0,DCLSWI), TK_UNDECLARE = DEFLEX(CL_DECL,0,0,0,DCLUND), TK_WORD = DEFLEX(CL_DECL,0,0,0,DCLWORD), TK_BYTE = DEFLEX(CL_DECL,0,0,0,DCLBYTE), TK_REQUIRE = DEFLEX(CL_DECL,0,0,0,DCLREQU), TK_STACKLOCAL = DEFLEX(CL_DECL,0,0,0,DCLSLOCAL), TK_LINKAGE = DEFLEX(CL_DECL,0,0,0,DCLLNKG), TK_PSECT = DEFLEX(CL_DECL,0,0,0,DCLPSECT), !SPECIAL ERROR OPERATOR TK_ERROR = DEFLEX(CL_OPER,14,SE+MT+AE,0,OP_ERROR); ! name table entry fields ! ! notes: ! name table entries are variable length structures. ! the length depends on the length of the text of the name. Macro nt_type = 0, 0, 8,0 %, ! T_NAME nt_code = 0, 8, 8,0 %, ! delimiter code nt_hash = 0,16,16,0 %, ! hash table index nt_next = 0,32,32,1 %, ! POINTER TO NEXT NAME ENTRY nt_symb = 1, 0,32,1 %, ! POINTER TO MOST RECENT IN ST nt_debug = 1,32,32,1 %, ! CHAIN OF DEBUG ST ENTRIES nt_data = 2, 0, 8,0 %; ! text of name (.asciz) ! string literal ! ! notes: ! string literals are variable length. Macro tx_type = 0, 0, 8,0 %, tx_code = 0, 8, 8,0 %, tx_size = 0,16,16,0 %, ! string length tx_data = 0,32, 8,0 %; ! text of string ! GT node fields ! ! notes: ! many of the fields overlap. this is because FLOWAN's ! structures are completely different from that of DELAY, ! TNBIND, and CODE and are not shared. ! ! the fields [gt_type], [gt_mode], [gt_reg], [gt_disp], ! [gt_disp_16], [gt_pos], and [gt_len] are common to ! symbols and tempnames also. Macro ! fields common to FLOWAN, DELAY, TNBIND, and CODE gt_type = 0, 0, 8,0 %, gt_code = 0, 8, 8,0 %, gt_argc = 0,16,16,0 %, gt_depth = 0,32, 8,0 %, ! loop depth gt_xdepth = 0,40, 8,0 %, ! cs parent loop depth gt_occ = 0,48,16,0 %, ! occurence count gt_csparent = 1, 0,32,1 %, ! -> CSE parent gt_csthread = 1,32,32,1 %, ! -> next CSE thread ! FLOWAN only fields gt_pcsthread = 2, 0,32,1 %, ! Psi CSE thread gt_end_of_pcs = 2,32,32,1 %, ! -> end of Psi/potential CSE list gt_crlevel = 4,32,16,1 %, ! creation level gt_mklevel = 4,48,16,1 %, ! make level gt_flow = 5, 0,32,1 %, ! -> flow list structure gt_inner_omega = 5,32,32,1 %, ! -> inner omega list entry gt_fsthread = 6, 0,32,1 %, ! -> next formal thread gt_fparent = 6,32,32,1 %, ! -> formal parent gt_gthread = 4, 0,32,1 %, ! -> next GTHASH thread gt_abc = 7, 0,16,0 %, ! atomic block count ! DELAY, TNBIND, CODE only fields gt_label = 2, 0,32,1 %, ! node label gt_fon = 2,32,16,0 %, ! flow order number gt_lon = 2,48,16,0 %, ! linear order number gt_reg = 3, 0,32,1 %, gt_mode = 3,32, 8,0 %, gt_pos = 3,40, 8,0 %, gt_len = 3,48, 8,0 %, gt_disp_16 = 4, 0,16,1 %, gt_disp = 4, 0,32,1 %, gt_state = 5, 0,64,0 %, ! state word gt_lab_f = 6, 0,32,1 %, ! false label gt_lab_t = 6,32,32,1 %, ! true label ! DELAY only fields gt_ru_compl = 4,32,16,0 %, ! register use complexity gt_cs_compl = 4,48,16,0 %, ! code size complexity ! TNBIND, CODE only fields gt_dtdelete = 4,32,16,0 %, ! dynamic temps level ! note: many of these bit fields previously overlapped and so ! one phase would erase its own bits on first use of a node (e.g. ! DELAYBITS and CXBITS). I have given each flag its own bit ! and have assumed that they no longer need to be reset. ! usage: ! mustgencode code must be generated for this node ! enable this is a compound statement with an ENABLE statement ! inlinecom this is an INLINECOM statement ! omega this is the child of an omega list entry ! rho this is the child of a rho list entry ! csp this is a CSE parent ! bogus this node is bogus. it marks the head of a P-CSE list ! fp this is a formal parent ! purge pernamently disabled for CSE recognition ! jm note to turn on RM at next join ! mm note to turn on RM at next sync point ! rm disabled for CSE recognition ! alpha this is the child of an alpha list entry ! chi this is the child of a chi list entry ! flow gt_flow contains a valid pointer ! prolog this is a member of the prolog ! postlog this is a member of the postlog ! dont_unlink ! delayed ! old_rcmt ! add_copied ! copied ! coded ! ctl_or_cse ! tpath 0 if LHS argument is target, 1 if RHS argument is ! chpdfr ! bound gt_v_mustgencode= 7,63, 1,0 %, gt_v_enable = 7,62, 1,0 %, ! syntax, code gt_v_inlinecom = 7,62, 1,0 %, ! syntax, code gt_v_omega = 7,61, 1,0 %, ! flowan gt_v_rho = 7,60, 1,0 %, ! flowan gt_v_csp = 7,59, 1,0 %, ! syntax, flowan gt_v_bogus = 7,58, 1,0 %, ! syntax, flowan, delay gt_v_fp = 7,57, 1,0 %, ! syntax, flowan gt_v_purge = 7,56, 1,0 %, ! syntax, flowan gt_v_jm = 7,55, 1,0 %, ! flowan gt_v_mm = 7,54, 1,0 %, ! flowan gt_v_rm = 7,53, 1,0 %, ! syntax, flowan gt_v_alpha = 7,52, 1,0 %, ! flowan gt_v_chi = 7,51, 1,0 %, ! flowan gt_v_flow = 7,50, 1,0 %, ! flowan, delay, tables gt_v_prolog = 7,49, 1,0 %, ! flowan gt_v_postlog = 7,48, 1,0 %, ! flowan ! delay bits. these bits are clear by delay. gt_v_dont_unlink= 7,47, 1,0 %, ! delay, flowan, syntax gt_v_delayed = 7,46, 1,0 %, ! delay, tnbind, code gt_v_old_rcmt = 7,45, 1,0 %, ! delay, tnbind gt_v_add_copied = 7,44, 1,0 %, ! delay gt_v_copied = 7,43, 1,0 %, ! delay, tnbind gt_v_coded = 7,42, 1,0 %, ! tnbind, code gt_v_ctl_or_cse = 7,41, 1,0 %, ! delay ! start of CXBITS gt_v_tpath = 7,40, 1,0 %, ! delay, tnbind, code gt_v_chpdfr = 7,39, 1,0 %, ! delay gt_v_bound = 7,38, 1,0 %, ! tnbind ! start of RCBITS (real code) rc_mov_offset = 7,37, 1,0 %, ! "MOV OFFSET, TEMP" rc_mov_target = 7,36, 1,0 %, ! "MOV TARGET, TEMP" rc_negate = 7,34, 1,0 %, ! "NEG TEMP" rc_operate = 7,33, 1,0 %, ! "OPERATOR NON-TARGET, TEMP" rc_add_offset = 7,32, 1,0 %, ! "ADD OFFSET,TEMP" rc_sub_offset = 7,31, 1,0 %, ! "SUB OFFSET, TEMP" rc_complement = 7,30, 1,0 %, ! "COMPLEMENT TEMP" rc_otherwise = 7,32, 1,0 %, ! SELECT CONTAINS AN OTHERWISE OR ALWAYS RCBITS = 7,30, 6,0 %, CXBITS = 7,30,10,0 %, ! OTHER CONTROL BITS IN THE GT ENTRY gt_v_lab_req = 7,29, 1,0 %, ! LABEL MUST BE ASSIGNED FOR NODE gt_v_symoff = 7,28, 1,0 %, ! OFFSETF IS A SYMBOL RATHER THAN LIT gt_v_symresult = 7,27, 1,0 %, ! RESULT IS SYMBOL (OFF. AND RES. STATE) DELAYBITS = 7,27,21,0 %, gt_argv(N) = 8+(N),0,64,0 %, gt_arg1 = gt_argv(0) %, gt_arg2 = gt_argv(1) %, gt_arg3 = gt_argv(2) %, gt_arg4 = gt_argv(3) %, gt_arg5 = gt_argv(4) %, gt_arg6 = gt_argv(5) %, gt_arg7 = gt_argv(6) %; ! symbol table fields ! ! notes: ! VUSELSTF is used with the base of a symbol. NAMEXPTR ! is used with symbols linked off the base symbol. Macro ! common fields st_type = gt_type %, st_code = gt_code %, st_scope = 0,16, 8,0 %, st_which = 0,24, 8,1 %, st_next = 0,32,32,1 %, st_name = 1, 0,32,1 %, st_prev = 1,32,32,1 %, st_v_unique = 2, 0, 1,0 %, st_v_gbl_bind = 2, 1, 1,0 %, st_v_nouplevel = 2, 2, 1,0 %, st_v_unlim_acts = 2, 3, 1,0 %, st_v_counted = 2, 4, 1,0 %, st_v_listed_external = 2, 5, 1,0 %, st_v_printed = 2, 6, 1,0 %, st_v_debug = 2, 7, 1,0 %, st_v_namexp = 2, 8, 1,0 %, st_v_init = 2, 9, 1,0 %, st_v_release_init = 2,10, 1,0 %, st_v_release_acts = 2,11, 1,0 %, st_v_plit = 2,12, 1,0 %, st_v_no_acts = 2,13, 1,0 %, ! linkage symbol fields st_lnk_desc = 3, 0,32,1 %, st_lnk_type = 3,32,32,1 %, ! macro symbol fields st_mac_type = st_which %, st_mac_num_fixed = 2,32,16,1 %, st_mac_num_ited = 3,48,16,1 %, st_mac_body = 3, 0,32,1 %, st_mac_depth = 3,32,32,1 %, ! structure symbol fields st_str_argc = st_which %, st_str_body = 3, 0,32,1 %, st_str_alloc = 3,32,32,1 %, ! label symbol fields st_lab_stop_ncse = 0,24, 1,0 %, ! st_which st_lab_used = 0,25, 1,0 %, st_lab_left = 0,26, 1,0 %, st_lab_dead = 0,27, 1,0 %, st_lab_alive = 0,28, 1,0 %, st_lab_level = 2,32,16,1 %, st_lab_inc = 2,48,16,1 %, st_lab_node = 3, 0,32,1 %, st_lab_cell = 3,32,32,1 %, ! bind symbol st_bind_data = 3, 0,64,0 %, ! variable symbol fields st_var_reg_index = st_which %, st_var_size = 2,32,16,1 %, st_unique = 2,48,16,1 %, st_reg = gt_reg %, st_mode = gt_mode %, st_pos = gt_pos %, st_len = gt_len %, st_enable_loc = st_lab_cell %, st_retlab = 4,32,32,1 %, st_var_linkage = 5, 0,32,1 %, st_var_actuals = 5,32,32,1 %, st_var_reg_save = 6,32,32,0 %, st_var_reg_list = 6, 0,32,1 %, st_var_chg_list = 6,32,32,1 %, st_var_use_list = 6, 0,32,1 %, st_var_base = 6, 0,32,1 %, st_var_init = 7, 0,32,1 %, st_var_next = 7,32,32,1 %; ! list of symbols record. used in DECLAR to hold a list of ! symbols which are being declared as a group. Macro ste_next = 0, 0,32,1 %, ste_symb = 0,32,32,1 %, ste_pos = 1, 0,64,1 %; ! formal parameter list descriptor Macro parm_size = 0, 0,64,0 %, parm_data(N) = N, 0,64,0 %, parm_type(N) = N,32,32,0 %, parm_loc(N) = N, 0,32,0 %; ! tempname fields ! ! notes: ! some fields are in common with ST and GT nodes Macro tn_type = gt_type %, tn_code = gt_code %, tn_request = 0,16, 8,0 %, ! TYPE OF TEMP REQUIRED tn_depth = 0,24, 6,0 %, ! LOOPDEPTH FIELD tn_v_lit = 0,31, 1,0 %, ! THIS TN POINTS TO A LITERAL tn_marked = 0,30, 1,0 %, ! marked for debugging tn_pref = 0,32,32,1 %, ! POINTER TO PREFERENCE LIST tn_lon_lu = 1, 0,32,0 %, ! LON OF LAST USE tn_lon_fu = 1,32,32,0 %, ! LON OF FIRST USE tn_fon_lu = 2, 0,32,0 %, ! FON OF LAST USE tn_fon_fu = 2,32,32,0 %, ! FON OF FIRST USE tn_reg = gt_reg %, tn_mode = gt_mode %, tn_pos = gt_pos %, tn_len = gt_len %, tn_bind_list = 4,32,32,1 %, ! POINTER TO LIST OF ALL THINGS BOUND ! TO THE SAME PLACE AS THIS ONE tn_permit = 4, 0,32,1 %, ! IF NONZERO, POINTS TO A TN WHICH THIS ONE ! MAY LIVE WITH REGARDLESS OF LIFETIME ! OVERLAP. tn_literal = 4, 0,64,0 %, ! CONTAINS LITLEXEME IF TNLITBIT IS ON tn_max_complexity=5,32,32,0 %, ! MAX USE COMPLEXITY tn_min_complexity=5, 0,32,0 %; ! (MIN) USE COMPLEXITY ! tn_request codes - indicates what a tempname would like to be bound to ! ! BIND_NONE tempname has no specific binding requirements. ! ! BIND_MEMORY tempname is to be bound to whatever tempname/node ! it is attached to is bound to. ! ! BIND_STATIC tempname is to be allocated to the stack ! because its address has been taken. set by ! CHECKONELOCAL. ! ! BIND_ANY_REGISTER ! tempname is to be bound to a register but ! the compiler is free to choose which register. ! set by PREGISTER in DECLAR when a register ! variable is declared. ! ! BIND_REGISTER tempname is to be bound to a specific register. ! the register index is in the gt_reg field. ! set by PREGISTER when a register variable is ! declared with a specific index. set by TL_CALL ! for register parameters in calls and also to ! bind the result register. also set for the ! result of a routine body, signal argument, ! enable argument, and all the pre-defined registers. ! ! BIND_IGNORE tempname is to be ignored as far as ranking and ! packing is concerned. set by OPENLIST for ! the start and end markers in a list. also ! set for the highly volatile registers PC, SP, and VR. ! ! BIND_DECLARE tempname represents a variable declared as ! LOCAL. set by PLOCAL in DECLAR. ! ! BIND_REG_OR_FORGET ! tempname would be happy to be placed in a ! register but does not want to be placed in ! a stack local. set by LOADNODE for NCSE's ! and by DDOT. Literal BIND_NONE = 0, ! ANY BINDING IS POSSIBLE BIND_MEMORY = 1, ! BINDING REQUIRED TO SPECIFIC MEMORY BIND_STATIC = 2, ! " " " STATIC LOCAL BIND_ANY_REGISTER = 3, ! " " " ANY REGISTER BIND_REGISTER = 4, ! " " " A SPECIFIC REGISTER BIND_IGNORE = 5, ! IGNORE THIS TN (DUMMY ENTRY) BIND_DECLARE = 6, ! DECLARED TN (LOCAL OR REGISTER) BIND_REG_OR_FORGET = 7, ! BIND TO REGISTER OR FORGET IT ! (BINDING IS IN gt_disp) LO_REQD_TYPE = 0, HI_REQD_TYPE = 7; ! tn_code codes - indicates what a tempname is bound to ! ! notes: ! BOUND_NONE tempname is not bound to anything yet. ! ! BOUND_REGISTER tempname is bound to a register ! set by MARKANDCOPY in CODE, TRYSPREG ! in TRY, LOADR0 in TNBIND, TPACK in TNBIND, ! TMARK in TNBIND, INITPDTNS in TNBIND. ! ! BOUND_LOCAL tempname is bound to a static local ! set by TRYCLVTEMPS in CODE, TMARK ! in TNBIND. ! ! BOUND_PUSH tempname is bound to a dynamic local ! set by MAKEPUSHVT in CODE, OPENDYTEMP ! in TRY, TMARK in TNBIND ! ! BOUND_PREFERENCE ! tempname is bound to whatever its ! preference is bound to. set by ! TRYPREF in TNBIND ! ! BOUND_NCSE tempname is bound to a named CSE. ! set by GETLOAD in DELAY Literal BOUND_NONE = 0, BOUND_REGISTER = 1, BOUND_LOCAL = 2, BOUND_PUSH = 3, BOUND_PREFERENCE= 4, BOUND_NCSE = 5; ! alpha/omega/chi/rho queue Macro que_type = 0, 0, 8,0 %, ! = T_QUEUE que_code = 0, 8, 8,0 %, ! queue type que_abc = 0,16,16,0 %, ! atomic block count que_head = 0,32,32,1 %; ! -> head of queue ! TNREP fields ! ! notes: ! this structure shares the [itm_llink] and [itm_rlink] fields. Macro tnr_req = 1,32,32,1 %, tnr_ptr = 1, 0,32,1 %, ! POINTER TO THE TN THIS TNREP REPS tnr_pref = 2, 0,32,1 %; ! backlink to preference ! stack of levels, atomic block counts, etc. Macro stk_data = 0, 0,32,1 %, stk_next = 0,32,32,1 %; ! stack of lists Macro stk_idx = 0, 0,32,1 %, stk_max = 0,32,32,1 %, stk_item(Z) = (Z)+1,0,0,0 %; ! stream fields. ! ! notes: ! a stream is a linked list of vectors which forms a stack of ! words. the first two words in each vector are reserved for ! [strm_size] and [strm_next]. Macro strm_size = 0 %, ! LENGTH IN WORDS, INCLUDING THE 0TH strm_next = 1 %, ! LINK WORD, SET BY PUSH strm_data(I) = (I)+2 %; ! actuals list ! ! an actual list is a list of lexemes. ! Macro act_size = 0 %, ! # of actuals act_symb = 1 %, ! -> symbol act_data(I) = (I)+2 %; ! data for actual 'I' ! ! plit structure fields ! ! note: ! plits are stored in cell structures and the first three ! words of a cell are reserved for linkages and such. Macro pl_type = 0, 0, 8,0 %, pl_code = 0, 8, 8,0 %, pl_count = 0,16,16,0 %, pl_size = 0,32,32,0 %, pl_data = 1, 0,32,1 %, pl_next = 1,32,32,1 %; ! item lists fields ! ! notes: ! other types of item lists include TNREP's and ! the FON/DTD/loop LON/FON stacks in TNBIND. ! ! items are normally created using MAKITEM and the arguments ! to MAKITEM must match the order of the itm_xxx fields ! after itm_llink. Macro itm_rlink = 0, 0,32,1 %, itm_llink = 0,32,32,1 %, itm_size = itm_rdata(1) %, itm_abc = itm_ldata(1) %, itm_fparent = itm_ldata(1) %, itm_data(I) = I, 0,64,0 %, itm_ldata(I) = I, 32,32,1 %, itm_rdata(I) = I, 0,32,1 %, ! intersection list entry itm_int_data(I) = I+1, 0,64,0 %, itm_int_rdata(I)= I+1, 0,32,1 %, itm_int_ldata(I)= I+1,32,32,1 %, ! kill list entry itm_kill_abc = 1,48,16,0 %, itm_kill_type = 1,32,16,0 %, itm_kill_cause = 1, 0,32,1 %, hdr_enter = 1, 0,32,1 %, hdr_remove = 1,32,32,1 %, ! NCSE list entry itm_ncse_data = 1, 0,32,1 %, itm_ncse_csp = 1,32, 1,0 %, itm_ncse_lst1 = 2,32,32,1 %, itm_ncse_lst2 = 2, 0,32,1 %; ! flow list fields ! ! notes: ! if ever FLOW is separated from LEXSYN then there should be ! no need for this structure. Macro flow_prolog = 0, 0,32,1 %, flow_mu = 0,32,32,1 %, flow_postlog = 1, 0,32,1 %, flow_epilog = 1,32,32,1 %; ! item destroy methods: ! ! 0 - simple item ! 1 - simple item + bogus node ! 2 - intersection list ! 3 - Rho list item ! 4 - FLSTK item Literal CHIREMOVE = 0, PRLGREMOVE = 0, MUREMOVE = 0, PSLGREMOVE = 0, EPLGREMOVE = 0, VCHGREMOVE = 0, VUSEREMOVE = 0, KILREMOVE = 0, FREETEMPREMOVE = 0, TEMPREMOVE = 0, PARAMREMOVE = 0, BOGREMOVE = 1, ALPHAREMOVE = 2, OMEGAREMOVE = 2, RHOREMOVE = 3, FLSREMOVE = 4; ! item enter rules. 0 = LIFO, 1 = SORT, 2 = XSORT Literal BOGENTER = 0, FREETEMPENTER = 0, TEMPENTER = 0, PARAMENTER = 0, ALPHAENTER = 1, RHOENTER = 1, CHIENTER = 1, OMEGAENTER = 1, PRLGENTER = 1, MUENTER = 1, PSLGENTER = 1, EPLGENTER = 1, VCHGENTER = 1, VUSEENTER = 1, KILENTER = 1, FLSENTER = 2; ! ! THE FOLLOWING FIELD DEFINITIONS HAVE TO DO WITH SETTING AND TESTING ! THE FIELDS OF THE NODES THEMSELVES. THE FIRST PART HAS TO DO ! WITH THE RESULT WORD FORMAT (AND IS PERHAPS NOT NEEDED OUTSIDE ! OF DELAY). THE SECOND PART CONCERNS CODE PRODUCTION AND MUST BE ! SHARED. ! ! SAME FIELD DEFINITIONS EXCEPT FOR USE WITH GTVEC MAPPING IN ACCESSING ! THE STATE WORD OF THE GT NODE Macro rw_real_flow = 5,51, 2,0 %, ! REAL/FLOW SUBSTATES rw_real = 5,51, 1,0 %, ! REAL RESULT BIT rw_flow = 5,52, 1,0 %, ! FLOW RESULT BIT rw_literal = 5,50, 1,0 %, ! NON-LITERAL(=0)/LITERAL(=1) rw_ptr_state = 5,44, 3,0 %, ! POINTER SUBSTATE CASES rw_negated = 5,43, 1,0 %, ! RESULT NEGATIVE rw_complemented = 5,42, 1,0 %, ! RESULT COMPLEMENTED rw_destroyable = 5,41, 1,0 %, ! INVOLVES DESTROYABLE TEMPORARY rw_immediate = 5,40, 1,0 %, ! IMMEDIATE ADDRESS (ON SYMBOL OR LIT) NRWORDF = 5,40,13,0 %; ! THE "WHOLE THING" !(SAME FIELD DEFINITIONS FOR THE STATE WORD OF THE GT NODE.) ! SRFF VALUES FIELDK(51,RFNONE,0); FIELDK(51,RFREAL,1); FIELDK(51,RFFLOW,2); FIELDK(51,RFBOTH,3); ! SLF VALUES FIELDK(50,LIT,1); ! SSPF VALUES ! ! note: PFNONE and PF016 must be 0 and 1. ! there is code which assumes the order of these codes. FIELDK(44,PFNONE,0); ! NO POINTER SPECIFIED FIELDK(44,PF016,1); ! <0,16> FIELDK(44,PF08,2); ! <0,8> FIELDK(44,PFE1,3); ! FIELDK(44,PFOTHER,4); ! FIELDK(44,PF88,5); ! <8,8> ! KNEGF VALUES FIELDK(43,KPOS,FALSE); FIELDK(43,KNEG,TRUE); ! IMMF VALUES FIELDK(40,IMM,TRUE); ! address descriptor ! ! notes: ! adr_name is the name of the segment this address refers to. ! this is normally the address of a symbol table entry or ! the address of a label reference cell. ! there are two special segments: ! ! 0 - operand references no particular segment and ! may point to any segment ! ! 1 - this is the stack segment ! ! adr_reg is the PDP-11 register. ! ! adr_mode is the PDP-11 addressing mode ! ! adr_type is a classification of the PDP-11 addressing mode. ! it may be: ! ! ADDR_IMMED #n ! ADDR_REG R ! ADDR_INDIRECT @(R)+, @-(R), @n(R) ! ADDR_MEMORY @R, (R)+, -(R), n(R) ! ! adr_delta is the register adjustment to account for ! auto-increment/decrement modes. it amount the register ! will be incremented/decremented by the addressing mode. ! ! adr_name_type tells how to interpret the adr_name field. ! its values are: ! ! NAME_NORMAL adr_name references a memory segment ! NAME_LABEL adr_name references a label cell ! NAME_ERROR nothing seems to *really* generate this ! NAME_FORMAL used in CODE to note a special ! reference to the stack segment. ! changed to NAME_NORMAL in CODE. ! ! adr_disp if the displacement field. Macro adr_name = 0, 0,32,1 %, adr_reg = 0,32, 3,0 %, adr_mode = 0,36, 3,0 %, adr_type = 0,40, 3,0 %, adr_delta = 0,44, 3,1 %, adr_name_type = 0,48, 3,0 %, adr_disp = 1, 0,16,1 %, ! these are the source and destination address fields in a code cell. cel_dst = 7,0,0,0 %, cel_dst_delta = 7+adr_delta %, cel_dst_mode = 7+adr_mode %, cel_dst_name = 7+adr_name %, cel_dst_name_type=7+adr_name_type %, cel_dst_disp = 7+adr_disp %, cel_dst_reg = 7+adr_reg %, cel_dst_type = 7+adr_type %, cel_src = 5,0,0,0 %, cel_src_delta = 5+adr_delta %, cel_src_mode = 5+adr_mode %, cel_src_name = 5+adr_name %, cel_src_name_type=5+adr_name_type %, cel_src_disp = 5+adr_disp %, cel_src_reg = 5+adr_reg %, cel_src_type = 5+adr_type %; ! ! FIELD NAMES FOR THE GMA RESULT WORD ! Macro gma_disp = 0,32,0 %, gma_reg = 32,3,0 %, gma_mode = 36,3,0 %, gma_type = 40,3,0 %, gma_name_type = 48,3,0 %; ! same values as adr_name_type ! ! instruction/label/label reference/plit cells Macro cel_prev = 0,32,32,1 %, ! -> next cell cel_next = 0, 0,32,1 %, ! -> previous cell cel_bot = 1,32,32,1 %, ! -> head of attached list cel_top = 1, 0,32,1 %, ! -> tail of attached list cel_type = 2,32,32,1 %, ! CELL_xxx cel_size = 2, 0,32,1 %, ! length in words of this cell cel_min_loc = 3,32,32,1 %, ! code address cel_min_len = 3, 0,32,1 %, ! instruction length cel_ref_ef = 3,32,32,1 %, ! -> label referenced cel_ref_rf = 3, 0,32,1 %, ! -> referencing instruction cel_sym_name = 4,32,32,1 %, ! -> label name cel_sym_disp = 4, 0,32,1 %, ! label name displacement cel_class = 4,32,32,1 %, ! OPTYPE_xxx cel_code = 4, 0,32,1 %, ! instruction opcode cel_lab_info = 4, 0,64,0 %, cel_lab_name = 4, 0,32,1 %, cel_lab_type = 4,32,31,0 %, cel_lab_seen = 4,63, 1,0 %, cel_inl_comment = 5,40, 1,0 %, ! TRUE if INLINECOM cel_inl_arg = 5, 0,32,0 %; ! INLINE argument lexeme ! VARIOUS PREDICATES Macro HASSOURCE(OP) = ONEOF(.OPERTYPE[OP],OPTYPE_ONE,OPTYPE_TWO,OPTYPE_BR,OPTYPE_WORD,OPTYPE_CASE) %, HASDEST(OP) = ONEOF(.OPERTYPE[OP],OPTYPE_TWO,OPTYPE_JSR,OPTYPE_CASE) %; ! note: ! bliss-64 does not allow for constants of more than 32 bits. ! thus the need for this kludge. Macro ADRPLIT(FORM,REG,TYPE,NAMETYPE,NAME) = UPlit Long ( NAME, FORM ^(_POS(gma_mode)-32) +TYPE ^(_POS(gma_type)-32) +REG ^(_POS(gma_reg)-32) +NAMETYPE^(_POS(gma_name_type)-32), 0,0) %, ADR1PLIT(FORM,REG,TYPE,NAMETYPE,NAME) = UPlit Long ( NAME, FORM ^(_POS(gma_mode)-32) +TYPE ^(_POS(gma_type)-32) +REG ^(_POS(gma_reg)-32) +NAMETYPE^(_POS(gma_name_type)-32), 1,0) %, BUILDOPD(TYP,MD,REG,OPRND) = ((TYP)^_POS(gma_type) Or (MD)^_POS(gma_mode) Or (REG)^_POS(gma_reg) Or (OPRND And %x'7fffffff')) %, ! change this if the size of an address changes COPYADR(X,Y) = MOVECORE(Y,X,2) %; !----------------------------------------- !9. LOOPING CONSTRUCT DEFAULT DEFINITIONS: Macro DFROM = MakeLit(0) %, DTOI = MakeLit((1^15)-1) %, DTOD = MakeLit(((-1)^15)) %, DBY = MakeLit(1) %; !----------------------------------------- !10. PRIMITIVES TO SET AND RESTORE NOTREE Macro NOCODE = (NOTREE = (.NOTREE^1) Or 1) %, RESNOTREE = (NOTREE = .NOTREE^(-1)) %; ! MACRO FOR USING "CREATED" SYMBOLS Macro BASESYM(S) = (If .Block[S,st_v_namexp] Then .Block[S,st_var_base] Else S) %; ! SIZE OF ALLOCATED STACKS ! -------------------------- Literal STKSIZE = 64, DTDONTCARE = %x'ffff'; ! DEPENDS ON SIZE OF gt_dtdelete FIELD Macro SUCCESS = Return TRUE %, FAIL = Return FALSE %; ! note: ! ETERNITY is really an unsigned number Bind GENESIS = 0, ! FIRST LON/FON ETERNITY = -1; ! LAST LON/FON (note: unsigned) Macro NULLLST(A) = Begin Bind Q = A : ITEM; Q[itm_llink] = A; Q[itm_rlink] = A End %, ISOPEN(LST) = Not EMPTY(LST) %, OPENREG(Z) = OPENLIST(REGS[Z]) %; ! Macro PUSHSTK(STK) = Begin STK[stk_idx] = .STK[stk_idx] + 1; If .STK[stk_idx] Gtr .STK[stk_max] Then STK[stk_max] = .STK[stk_idx]; NULLLST(STK[stk_item(.STK[stk_idx])]) End %; Macro POPSTK(STK) = Begin RELTNREPLST(STK[stk_item(.STK[stk_idx])]); STK[stk_idx] = .STK[stk_idx]-1 End %; ! VARIOUS USEFUL PREDICATES ! ! note: these macros assume that LOW{VAR,EXP,ADD}TYPE are all 0. Macro ISSTVAR(QN) = (.QN[st_code] Lequ HIGHVARTYPE) %, ISEXP(QN) = (.QN[st_code] Lequ HIGHEXPTYPE) %, ISADDR(QN) = (.QN[st_code] Lequ HIGHADDTYPE) %, LOADCONST(QN) = ONEOFX(.qn[st_code],LOWLTCETYPE,HIGHLTCETYPE )%; ! ! FUNCTION: ! PREDICATES TO DETERMINE CSE INFORMATION ABOUT ! A NODE. THE PREDICATES GIVE 'TRUE' ON THE FOLLOWING DESCRIBED ! CONDITIONS: ! ISCSE -- IF NODE IS ANY KIND OF CSE (PARENT OR USE) ! ISCSEUSE -- IF NODE IS A CSE USE BUT NOT A CSPARENT ! ISCSECREATION -- IF NODE IS A CSPARENT ! ISLARGECSE -- IF NODE IS A LARGE CSE (3 OR MORE USES) ! Macro ISCSE(NODE) = (.Block[.NODE[gt_csparent],gt_occ] Gtr 1) %, ISCSEUSE(NODE) = (Bind ND=NODE : Ref GT; ISCSE(ND) And Not .ND[gt_v_mustgencode]) %, ISCSECREATION(NODE) = (Bind ND=NODE : Ref GT; ISCSE(ND) And .ND[gt_v_mustgencode]) %, ISLARGECSE(NODE) = (.Block[.NODE[gt_csparent],gt_occ] Gtr 2) %, ! note: FLOWAN uses its own version of UNBOGUS called NONBOGUS UNBOGUS(NODE) = Begin Do NODE = .NODE[gt_csthread] Until .NODE[gt_v_mustgencode] End %; ! clever macro to count the number of bits in a word. works ! for up to 7 bits. Literal ONES = %b'1001001001001001001001', REPLICA3 = %x'10101'; Macro SUMBITS(RCC) = (Local QQ; QQ = ((RCC) * REPLICA3 And ONES) * ONES; .QQ<21,3>) %; !--------------------------------------------------------------------- !17. THE FOLLOWING ARE: A FLAG TO INFORM "RUNC" OF THE PROPER REACTION ! TO CERTAIN OPEN BRACKETS, AND MACROS (CALLED IN "DCLARE" AND ! "EXPRESSION") TO SET AND RESTORE THAT FLAG. ! ! notes: ! the INDECL flag settles the ambiguity when a '(' is found. ! in a declaration it may only appear in a PLIT but in an ! expression it is treated like a compound statement. Macro INDCL = INDECL = .INDECL^1 + 1 %, INEXP = INDECL = .INDECL^1 + 0 %, RESINDECL = INDECL = .INDECL^(-1) %; !------------------------------------------------------------------------- !8. FLAGS: ! ! A. THE FOLLOWING ARE MACRO DEFINITIONS OF FLAGS FOR COMPILATION. ! ! notes: ! can't use BIND on these. Bliss-10 allowed taking the address ! of a bit but Bliss-32/64 doesn't. ! Macro swit_expand = FLAGS<32,1> %, ! LIST MACRO EXPANSIONS swit_optimize = FLAGS<33,1> %, ! NO OPTIMIZATION ACROSS ;'S swit_statistics = FLAGS<34,1> %, ! PRINT COMPILER STATISTICS swit_list = FLAGS<35,1> %, ! PRODUCE LISTING swit_pic = FLAGS<36,1> %, ! PRODUCE POSITION INDEPENDENT CODE swit_errors = FLAGS<37,1> %, ! REPORT ERRORS TO USER'S TERMINAL swit_final = FLAGS<39,1> %, ! ON FOR 'SUPER' OPTIMIZE IN FINAL swit_unames = FLAGS<40,1> %, ! PRINT UNIQUE NAMES swit_mark = FLAGS<41,1> %, ! MARK DOT NODES FOR .X = swit_debug = FLAGS<42,1> %, ! PRODUCE TABLES, ETC., FOR SIX12 swit_zip = FLAGS<43,1> %, ! OPTIMIZE FOR SPEED INSTEAD OF SIZE swit_i_d = FLAGS<44,1> %, ! SEPARATION OF INSTRUCTIONS AND DATA swit_quick = FLAGS<45,1> %, ! SPEED UP COMPILATION swit_peep = FLAGS<46,1> %, swit_dump_flowan= FLAGS<47,1> %, swit_dump_delay = FLAGS<48,1> %, swit_dump_tnbind= FLAGS<49,1> %, swit_dump = FLAGS<47,3> %, swit_page = FLAGS<50,1> %, flg_eof = FLAGS< 1,1> %, ! END OF FILE FLAG flg_tty = FLAGS< 0,1> %; ! TELETYPE LISTING FLAG. ! program sections ! ! note: there are tables which assume the sections are numbered ! in this order. Literal PS_CODE = 0, PS_DEBUG = 1, PS_GLOBAL = 2, PS_OWN = 3, PS_PLIT = 4; Require 'routines.req'; Require 'externals.req'; Require 'room.req'; Require 'errcodes.req';