! "W N, R=    @ #D  D ҃TP  B ы e@W 0 ,"& 7   0ߋp@E A Ze      |@7x@ eE "  ɋ -lɋ e-RNHɋ ^?c/c00.c + FU_Nc/getchar.c ' IU/c/c01.c " GU0Vc/c02.c + GUBMc/c03.c ? GUXcc/c04.c & GUcRc/c05.c  GUwt]c/c0h.c  HU^c/c10.c 2 HUDc/c11.c  l@c/c12.c ~ HUK[c/c14.c s! HUEVc/c15.c @ IUec/pr1.c ' IUc/macgho.ASM   IUc/c01.o  1) proflg++; xdflg++; for (ip=kwtab; (np = ip->kwname); ip++) { /* Initialize the symbol table by */ for (sp = symbuf; sphclass = KEYWC; np->htype = ip->kwval; } xdflg = 0; treebase = treespace+10; /* Treebase is a constant pointing to the base of the syntax tree. */ if(siflg == 0) { namep=argv[1]; while (alphanum(*namep)) namep++; *namep= '\0'; printf("%.7s startup\n", argv[1]); } else printf(" startup\n"); while(!eof) { /* This is the main loop of the compiler. It reads all */ extdef(); /* of the input program and calls functions which */ blkend(); /* compile that input. */ } transvec(); /* Produce a transfer vector. */ hgprloc(hglit); printf(" ltorg\n"); printf(" end %s\n", mainfile ? "$main$": " "); cexit(nerror!=0); } error(s, p1, p2, p3, p4, p5, p6) { extern cout; cout = 1; /* Switch output to ft06f001. */ printf("%d: ", line); printf(s, p1, p2, p3, p4, p5, p6); putchar('\n'); nerror++; cout = assemblycode; /* Switch back. */ } tree() /* The expression compiler - returns root node of tree.*/ { #define SEOF 200 #define SSIZE 20 int *op, opst[SSIZE], *pp, prst[SSIZE]; register int andflg, o; register struct hshtab *cs; struct hshtab *p1, *p2; int p, ps, os, *np; osleft = ossiz; space = treebase; op = opst; pp = prst; cp = cmst; *op = SEOF; *pp = 06; andflg = 0; advanc: switch (o=symbol()) { case NAME: cs = csym; if (cs->hclass==0 && cs->htype==0) if(nextchar()=='(') { /* set function */ cs->hclass = GXTERN; cs->htype = FUNC; cs->hflags =| GLOBAL; } else if (initflg) cs->hclass = EXTERN; else { /* set label */ cs->htype = ARRAY; if (cs->hoffset==0) cs->hoffset = isn++; } p1 = block(2,NAME,cs->htype,cs->hdimp, cs->hclass,0); if (cs->hclass==EXTERN || cs->hclass==GXTERN || cs->hclass==FORTRAN) { np = cs->name; for (o=0; o<4; o++) { pblock(*np); if (((*np++)&~0177) == 0) break; } } else pblock(cs->hoffset); if (p1->op == NAME && (p1->class == GXTERN || p1->class == FORTRAN)) { p2 = block(1,STAR,p1->type,p1->dimp,p1); p1->type = incref(p1->type); /* change N to pointer to N. */ p1 = p2; } *cp++ = p1; goto tand; #ifdef unix case LCON: *cp++ = block(1,o,INT,0,block(-1,cval->longint)); goto tand; #endif case SFCON: /* short floating constant - an optimization for the PDP 11. */ case FCON: if (!initflg) prtflo(1,0); case CON: *cp++ = block(1,o,(o==CON?INT:DOUBLE),0,cval); goto tand; /* fake a static char array */ case STRING: if( initflg ) error( "initializer too complicated" ); hgprloc( hgstring ); getstr(); hgprloc( hgcode ); *cp++ = block(3, NAME, ARRAY+CHAR,0,STATIC,0,cval); tand: if(cp>=cmst+cmsiz) { error("Expression overflow"); cexit(1); } if (andflg) goto syntax; andflg = 1; goto advanc; case INCBEF: /* increment before */ case DECBEF: /* decrement before */ if (andflg) o =+ 2; goto oponst; case COMPL: /* complement */ case EXCLA: /* exclaimation point */ case SIZEOF: if (andflg) goto syntax; goto oponst; case MINUS: if (!andflg) o = NEG; andflg = 0; goto oponst; case AND: case TIMES: if (andflg) andflg = 0; else if(o==AND) o = AMPER; else o = STAR; goto oponst; case LPARN: if (andflg) { o = symbol(); if (o==RPARN) o = MCALL; else { peeksym = o; o = CALL; andflg = 0; } } goto oponst; case RBRACK: case RPARN: if (!andflg) goto syntax; goto oponst; case DOT: case ARROW: mosflg++; break; } /* binaries */ if (!andflg) goto syntax; andflg = 0; oponst: p = (opdope[o]>>9) & 077; if ((o==COMMA || o==COLON) && initflg) p = 05; opon1: ps = *pp; if (p>ps || p==ps && (opdope[o]&RASSOC)!=0) { switch (o) { case INCAFT: case DECAFT: p = 37; break; case LPARN: case LBRACK: case CALL: p = 04; } if(op>=opst+SSIZE) { error("expression overflow"); cexit(1); } *++op = o; *++pp = p; goto advanc; } --pp; switch (os = *op--) { case SEOF: /* see bottom of stack */ peeksym = o; build(0); /* flush conversions */ return(*--cp); case CALL: /* ftn call operator eg f(x) */ if (o!=RPARN) goto syntax; build(os); goto advanc; case MCALL: /* empty arguement call eg f() */ *cp++ = block(0,0,0,0); /* 0 arg call */ os = CALL; goto fbuild; case LPARN: if (o!=RPARN) goto syntax; goto advanc; case LBRACK: /* [ - for subscripts */ if (o!=RBRACK) goto syntax; build(LBRACK); goto advanc; } fbuild: build(os); goto opon1; syntax: error("Expression syntax"); errflush(o); return(0); } /* End of the tree function. */ declare(askw, tkw, offset, elsize) /* Parses a list of declarators. */ { register int o; register int skw; int corr; corr = NO; skw = askw; mosflg = skw==MOS; if (endp == YES) ndp = 0; if ((peeksym = symbol() ) == RPARN) corr = YES; do { if (endp == YES) { ndp =+ 1; } /* Count nbr of declared parameters. */ offset =+ decl1(skw, tkw, offset, elsize, YES); if (xdflg && skw!=MOS) return(offset); } while ((o=symbol()) == COMMA); if (endp == YES && corr == YES) ndp = 0; endp = NO; if (o==SEMI || o==RPARN && skw==ARG1) return(offset); decsyn(o); return(offset); } decl1(askw, tkw, offset, elsize, declr) { int t1, chkoff; register int type, skw; register struct hshtab *dsym; int predef; int savetype; skw = askw; chkoff = 0; mosflg = skw==MOS; if ((peeksym=symbol())==SEMI || peeksym==RPARN) return(0); if ((t1=getype()) < 0) goto syntax; type = 0; do type = type<<2 | (t1 & 030); while (((t1=(t1>>2)) & 030)!=0); type =| tkw; dsym = defsym; if (dsym->hclass != 0) predef = YES; else predef = NO; if (!(dsym->hclass==0 || (skw==ARG && dsym->hclass==ARG1) || ((skw==EXTERN || skw==GXTERN || skw==FORTRAN) && (dsym->hclass==EXTERN || dsym->hclass==GXTERN || dsym->hclass==FORTRAN) && dsym->htype==type))) if (skw==MOS && dsym->hclass==MOS && dsym->htype==type) chkoff = 1; else { redec(); goto syntax; } dsym->htype = type; if (skw) { savetype = dsym->hclass; dsym->hclass = skw; } if ((declr==YES) && (skw==EXTERN)) { if (predef == NO) { dsym->hclass = GXTERN; dsym->hflags =| GLOBAL; } else if (dsym->hflags & PERM) dsym->hclass = savetype; } if (skw==ARG1) { if (paraml==0) paraml = dsym; else parame->hoffset = dsym; parame = dsym; } if (elsize) { dsym->lenp = dimp; dimtab[dimp++] = elsize; } elsize = 0; if (skw==MOS) { elsize = length(dsym); if (elsize != 1) { elsize =+ ((offset + 3) & ~3) - offset; offset = ((offset + 3) & ~3); /* round up to multiple of 4 */ } if (chkoff && dsym->hoffset != offset) redec(); dsym->hoffset = offset; } if ((dsym->htype&030)==FUNC) { if (dsym->hclass!=EXTERN && dsym->hclass!=AUTO && dsym->hclass!=GXTERN && dsym->hclass!=FORTRAN) error("Bad function"); dsym->hclass = dsym->hclass==FORTRAN?FORTRAN:GXTERN; dsym->hflags =| GLOBAL; } if (dsym->hclass==AUTO) { dsym->hoffset = autolen; autolen =+ rlength(dsym); } else if (dsym->hclass==STATIC) { dsym->hoffset = isn; hgprloc(hgdata); printf("$%d equ * \n", isn++); printf(" dc %dx'00' \n", rlength(dsym) ); hgprloc(hgcode); } else if (dsym->hclass==REG) { if ((type&07)>CHAR && (type&030)==0 || (type&030)>PTR || regvar>5) error("Bad register %o", type); dsym->hoffset = ++regvar; } syntax: return(elsize); } getype() { register int o, type; register struct hshtab *ds; switch(o=symbol()) { case TIMES: return(getype()<<2 | PTR); case LPARN: type = getype(); if ((o=symbol()) != RPARN) goto syntax; ds = defsym; goto getf; case NAME: defsym = ds = csym; type = 0; ds->ssp = dimp; getf: switch(o=symbol()) { case LPARN: if (xdflg) { xdflg = 0; ds = defsym; declare(ARG1, 0, 0, 0); defsym = ds; xdflg++; } else if ((o=symbol()) != RPARN) goto syntax; type = type<<2 | FUNC; goto getf; case LBRACK: if ((o=symbol()) != RBRACK) { peeksym = o; cval = conexp(); for (o=ds->ssp; oname); } alphanum(c) { switch(c) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'z': case '0': case '1': case '2': case '3': case '4': case 'Z': case '5': case '6': case '7': case '8': case '9': return(1); default: return(0); } } 'k': case 'l': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 's': case 't': case 'u': case int numb 0; char getchar() { static int i; static char c, buffer[150]; while (numb == 0) { i = 0; c = 'a'; while (c != '\n') { if (read(0,&c,1) != 1) return('\0'); buffer[numb++] = c; } buffer[numb] = '\0'; printf("****** %s",buffer); } numb--; return(buffer[i++]); } 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 's': case 't': case 'u': case # /* C compiler (file - c01.c) Copyright 1972 Bell Telephone Laboratories, Inc. */ #include "c0h.c" int mainftn; int mainfile; char pointrel[] { LESSEQP, LESSP, GREATQP, GREATP }; build(op) { register int t1; int t2, t; struct tnode *disarray(); register struct tnode *p1, *p2; int dope, leftc, cvn, pcvn; if (op==LBRACK) { build(PLUS); op = STAR; } if( op==INCAFT||op==DECAFT||op==INCBEF||op==DECBEF) *cp++ = block( 1, CON, INT, 0, 1 ); dope = opdope[op]; if ((dope&BINARY)!=0) { p2 = chkfun(disarray(*--cp)); t2 = p2->type; } p1 = *--cp; if (op == SIZEOF) { t1=length(p1); p1->op=CON; p1->type=INT; p1->dimp=0; p1->value=t1; *cp++ = p1; return; } if (op!=AMPER) { p1 = disarray(p1); if (op!=CALL) p1 = chkfun(p1); } t1 = p1->type; pcvn = 0; switch (op) { /* end of expression */ case 0: *cp++ = p1; return; /* no-conversion operators */ case COMMA: case LOGAND: case LOGOR: *cp++ = block(2, op, 0, 0, p1, p2); return; case QUEST: if (p2->op!=COLON) error("Illegal conditional"); t = t2; goto nocv; case CALL: if ((t1&030) != FUNC) error("Call of non-function"); *cp++ = block(2,CALL,decref(t1),p1->dimp,p1,p2); return; case STAR: if (p1->op==AMPER) { *cp++ = p1->tr1; return; } if ((t1&030) == FUNC) error("Illegal indirection"); *cp++ = block(1,STAR,decref(t1),p1->dimp,p1); return; case AMPER: if (p1->op==STAR) { p1->tr1->dimp = p1->dimp; p1->tr1->type = incref(t1); *cp++ = p1->tr1; return; } if (p1->op==NAME) { *cp++ = block(1,op,incref(t1),p1->dimp,p1); return; } error("Illegal lvalue"); break; case INCBEF: case DECBEF: case INCAFT: case DECAFT: chklval(p1); if( op==INCBEF) op=ASPLUS; if( op==DECBEF ) op=ASMINUS; break; case ARROW: *cp++ = p1; chkw(p1); p1->type = PTR+STRUCT; build(STAR); p1 = *--cp; case DOT: if (p2->op!=NAME || p2->class!=MOS) error("Illegal structure ref"); *cp++ = p1; t = t2; if ((t&030) == ARRAY) { t = decref(t); p2->ssp++; } setype(p1, t, p2->dimp); build(AMPER); *cp++ = block(1,CON,7,0,p2->nloc); build(PLUS); if ((t2&030) != ARRAY) build(STAR); return; } if ((dope&LVALUE)!=0) chklval(p1); if ((dope&LWORD)!=0) chkw(p1); if ((dope&RWORD)!=0) chkw(p2); if ((dope&BINARY)==0) { if (!fold(op, p1, 0)) *cp++ = block(1,op,t1,p1->dimp,p1); return; } if (t2==7) { t = t1; p2->type = 0; /* no int cv for struct */ t2 = 0; goto nocv; } cvn = cvtab[11*lintyp(t1)+lintyp(t2)]; leftc = cvn&0100; cvn = cvn&077; t = leftc? t2:t1; if (op==ASSIGN ) { t = t1; if (cvn!=3) /* i=p and p=i */ goto nocv; } if (cvn ) { if (op==COLON && t1>=PTR && t1==t2) goto nocv; if (cvn==077) { if ((dope&RELAT)==0 || t1float */ leftc = 0; cvn = 4; t = t1; goto rcvt; } else goto illcv; } p1 = convert(p1, t, cvn, plength(p2)); } else { rcvt: p2 = convert(p2, t, cvn, plength(p1)); } nocv:; } if ((dope&RELAT)!=0) { if (op>NEQUAL && (t1>=PTR || t2>=PTR)) op = pointrel[op - LESSEQ]; /* ptr relation */ t = 0; /* relational is integer */ } if (fold(op, p1, p2)) return; *cp++ = block(2,op,t,(p1->dimp==0? p2:p1)->dimp,p1,p2); if (pcvn) { p1 = *--cp; *cp++ = convert(p1, 0, pcvn, plength(p1->tr1)); } } convert(p, t, cvn, len) struct tnode *p; { register int n; switch(cvn) { /* int -> ptr */ case 1: n = TIMES; goto md; /* ptr -> int */ case 2: n = DIVIDE; md: return(block(2, n, t, 0, p, block(1, CON, 0, 0, len))); /* int -> double */ case 3: n = ITOF; goto di; /* double -> int */ case 4: n = FTOI; di: return(block(1, n, t, 0, p)); } error("C error-- convert"); return(p); } setype(ap, at, adimptr) struct tnode *ap; { register struct tnode *p; register t, dimptr; p = ap; t = at; dimptr = adimptr; p->type = t; if (dimptr != -1) p->dimp = dimptr; switch(p->op) { case AMPER: setype(p->tr1, decref(t), dimptr); return; case STAR: setype(p->tr1, incref(t), dimptr); return; case PLUS: case MINUS: setype(p->tr1, t, dimptr); } } chkfun(ap) /* Is current node a ftn? if so, convert it to a pointer. */ struct tnode *ap; { register struct tnode *p; register int t; p = ap; if (((t = p->type)&030)==FUNC) return(block(1,AMPER,incref(t),p->dimp,p)); return(p); } struct tnode *disarray(ap) /* Turns arrays into pointers. */ struct tnode *ap; { register int t; register struct tnode *p; p = ap; /* check array & not MOS */ if (((t = p->type)&030)!=ARRAY || p->op==NAME&&p->class==MOS) return(p); p->ssp++; *cp++ = p; setype(p, decref(t), -1); build(AMPER); return(*--cp); } chkw(p) struct tnode *p; { register int t; if ((t=p->type)>CHAR && top!=NAME && p->op!=STAR) error("Lvalue required"); } fold(op, ap1, ap2) struct tnode *ap1, *ap2; { register struct tnode *p1; register int v1, v2; p1 = ap1; if (p1->op!=CON || (ap2!=0 && ap2->op!=CON)) #ifdef unix return(lfold(op,p1,ap2)); #endif #ifndef unix return(0); #endif v1 = p1->value; v2 = ap2->value; switch (op) { case PLUS: v1 =+ v2; break; case MINUS: v1 =- v2; break; case TIMES: v1 = v1 * v2; break; case DIVIDE: v1 = v1 / v2; break; case MOD: v1 = v1 % v2; break; case AND: v1 =& v2; break; case OR: v1 =| v2; break; case EXOR: v1 =^ v2; break; case NEG: v1 = - v1; break; case COMPL: v1 = ~ v1; break; case LSHIFT: v1 = v1 << v2; break; case RSHIFT: v1 = v1 >> v2; break; default: return(0); } p1->value = v1; *cp++ = p1; return(1); } #ifdef unix lfold(op, ap1, ap2) struct tnode *ap1, *ap2; { register struct tnode *p1, *p2; long v1, v2; register t; p1 = ap1; p2 = ap2; if ((p1->op!=CON && p1->op!=LCON) || (p2!=0 && p2->op!=CON && p2->op!= LCON)) return(0); if(p1->op == LCON) v1 = (t=p1->value)->longint; else v1 = p1->value; if(p2) if(p2->op == LCON) v2 = (t=p2->value)->longint; else v2 = p2->value; switch (op) { case PLUS: v1 =+ v2; break; case MINUS: v1 =- v2; break; case AND: v1 =& v2; break; case OR: v1 =| v2; break; case EXOR: v1.integ =^ v2.integ; v1.integ2 =^ v2.integ2; break; case NEG: v1 = - v1; break; case COMPL: v1 = ~ v1; break; case LSHIFT: v1 = v1 << v2.integ2; /* kludge for 11 compiler bug */ break; case RSHIFT: v1 =>> v2.integ2; /* kludge for missing code table on 11 */ break; default: return(0); } p1->value = t; t->longint = v1; p1->op = LCON; *cp++ = p1; return(1); } #endif conexp() { register struct tnode *t; initflg++; if (t = tree()) if (t->op != CON) error("Constant required"); initflg--; return(t->value); } transvec() { /* Print out the transfer vector. */ register struct hshtab *cs; hgprloc(hgtvec); for (cs = hshtab; cs < hshtab+hshsiz; cs++) { if (((cs->hflags&GLOBAL) == GLOBAL) && (cs -> hclass != KEYWC)) { if ((cs->hflags & DEFINED) == DEFINED) { { if (scomp(cs->name, "main") != '=') printf(" entry %.8s \n", cs->name); } if (function == YES) printf("@%.7s INT%s %.8s\n",cs->name, (cs->htype&030)==FUNC?"FUNC":"ADDR", cs->name ); } else { if (function == YES) printf("@%.7s EXT%s %.8s\n",cs->name, (cs->htype&030)==FUNC?"FUNC":"ADDR", cs->name ); else printf(" extrn %.8s\n", cs->name); } } } hgprloc(hgcode); } mainchk(cs) /* If a ftn is 'main' then print special BAL. */ char *cs; { int i; for (i=0; i<=4; i =+ 1) { if ("main"[i] == *(cs++) ) ; else{mainftn = NO; return;} } hgprloc(hglit); printf(" ltorg\n"); hgprloc(hgmain); printf("$main$ equ *\n"); printf(" subsave\n"); printf(" runmain\n"); printf(" subretrn cc=00\n ltorg\n"); printf(" stackdo\n"); hgprloc(hgcode); mainftn = mainfile = YES; } scomp(s1, s2) char *s1, *s2; { int c,d; while ( (c= *s1++) == (d= *s2++)) if (c==0) return('='); return(c>d ? '>' : '<'); } 'main' then print special BAL. */ char *cs; { int i; for (i=0; i<=4; i =+ 1) { if ("main"[i] == *(cs++) ) ; else{mainftn = NO; return;} } hgprloc(hglit); printf(" ltorg\n"); hgprloc(hgmain); printf("$main$ equ *\n"); printf(" subsave\n"); printf(" runmain\n"); printf(" subretrn cc=00\n ltorg\n"); printf(" stackdo\n"); hgp# /* C compiler ( file - c02.c ) Copyright 1972 Bell Telephone Laboratories, Inc. */ #include "c0h.c" /* */ extdef() { register o, width; int type, elsize, nel; char *cs; register struct hshtab *ds; if(((o=symbol())==EOF) || o==SEMI) return; type = 0; xdflg++; xtern = NO; ftern = NO; xxx: if (o==KEYW) { if (cval==EXTERN) { xtern = YES; o = symbol(); goto xxx; } if (cval==FORTRAN) { ftern = YES; o = symbol(); goto xxx; } if ((type=cval)>STRUCT) goto syntax; /* not type */ elsize = 0; if (type==STRUCT) { elsize = strdec(&type, 0); if ((peeksym=symbol())!=KEYW) { blkhed(); } } } else { if (o!=NAME) goto syntax; peeksym = o; } do { defsym = 0; strflg = 1; endp = YES; decl1(xtern==YES?GXTERN:(ftern==YES?FORTRAN:EXTERN), type&07, 0, elsize, NO); /* (this also sets ndp) */ if ((ds=defsym)==0) return; cs = ds->name; funcsym = ds; ds -> hflags =| GLOBAL; /* flag global */ xdflg = 0; type = ds->type; if ((type&030)==FUNC && ((peeksym=symbol())==LBRACE || peeksym==KEYW)) { mainchk(cs); /* add extra BAL code for main functions. */ ds -> hflags =| DEFINED; /* set defined flag. */ ds->hflags =| PERM; /* nondeletable */ cfunc(cs, ndp); /* This is the only call of cfunc. */ return; } if ((xtern == NO)&&(ftern == NO)) ds->hflags =| DEFINED; ds->hflags =| PERM; /* non-deletable */ nel = 1; while ((ds->type&030)==ARRAY) { nel = dimtab[ds->ssp]; ds->type = decref(ds->type); } width = length(ds); if (ds->type==STRUCT) { nel = nel * width/4; width = 4; } ds->type = type; cinit(cs, type, nel, width); hgprloc(hgcode); } while ((o=symbol())==COMMA); if (o==SEMI) return; syntax: if (o == RBRACE) { error("Too many }'s"); return; } error("External definition syntax"); errflush(o); statement(0); } cfunc(cs, np) /* Compile a function. */ char *cs; int np; { register savdimp; regvar = 1; strflg = 0; function = YES; savdimp = dimp; declist(ARG); retlab = isn++; statement(1, cs); printf("$%d EPILOG %d\n", retlab, autolen); /* autolen contains the total length of the automatics and temps */ printf(" DC C'END %.8s' \n", cs); dimp = savdimp; } cinit(cs, type, nel, awidth) char *cs; { register o, ninit, width; hgprloc(hgdata); width = awidth; if ((peeksym=symbol())==COMMA || peeksym==SEMI) { if (xtern == NO && ftern == NO) { printf("%.8s dc %dx'00' \n", cs, (nel*width+3)&~03); } /* Allocate storage only in multiples of four bytes. */ return; } ninit = 0; if (xtern == YES) error("Can not initialize externals."); if(width==8 || width==4) printf(" cnop 0,%d\n",width); printf("%.8s equ * \n", cs); if ((o=symbol())==LBRACE) { do ninit = cinit1( width, ninit); while ((o=symbol())==COMMA); if (o!=RBRACE) peeksym = o; } else { peeksym = o; ninit = cinit1( width, 0); } if (ninit1 && (type&030)!=ARRAY && (type&07)!=STRUCT) error("Too many initializers"); printf(" cnop 0,4 \n"); } cinit1( width, ninit) { register struct tnode *s; register int sign; sign = 1; if ((peeksym=symbol())==STRING ) { peeksym = -1; if( width == 4 ){ hgprloc( hgistring ); getstr(); hgprloc( hgdata ); printf( " dc a($%d)\n", cval ); return(1); } getstr(); return(nchstr); } if (peeksym==RBRACE) return(ninit); initflg++; s = tree(); hgprloc(hgdata); initflg = 0; switch(width) { case 1: rcexpr0(block(1,INIB,0,0,s), regtab); break; case 4: if (s->op != FCON) { rcexpr0(block(1,INIT,0,0,s), regtab); break; } case 8: if (s->op==FCON) { if(peeksym==MINUS) { peeksym = -1; sign = -sign;} prtflo(sign,width); break; } default: bxdec(); } return(++ninit); } bxdec() { error("Inconsistent external initialization"); } statement(d, cs) char *cs; { register o, o1, o2; int o3; struct tnode *np; stmt: switch(o=symbol()) { case EOF: error("Unexpected EOF"); case SEMI: return; case LBRACE: if(d) { if (proflg) error("The profiler is not supported on IBM C."); hgprloc(hgcode); printf("%.8s PROLOG %d %d args\n", cs, PREPUSH, ndp); blkhed(); } while (!eof) { if ((o=symbol())==RBRACE) return; peeksym = o; statement(0); } error("Missing '}'"); return; case KEYW: switch(cval) { case GOTO: if (o1 = simplegoto()) branch(o1); else dogoto(); goto semi; case ASM: if(doasm()<0) goto syntax; goto semi; case RETURN: doret(); goto semi; case IF: np = pexpr(); o2 = 0; if ((o1=symbol())==KEYW) switch (cval) { case GOTO: if (o2=simplegoto()) goto simpif; cbrnch0(np, o2=isn++, 0); dogoto(); label(o2); goto hardif; case RETURN: if (nextchar()==';') { o2 = retlab; goto simpif; } cbrnch0(np, o1=isn++, 0); doret(); label(o1); o2++; goto hardif; case BREAK: o2 = brklab; goto simpif; case CONTIN: o2 = contlab; simpif: chconbrk(o2); cbrnch0(np, o2, 1); hardif: if ((o=symbol())!=SEMI) goto syntax; if ((o1=symbol())==KEYW && cval==ELSE) goto stmt; peeksym = o1; return; } peeksym = o1; cbrnch0(np, o1=isn++, 0); statement(0); if ((o=symbol())==KEYW && cval==ELSE) { o2 = isn++; branch(o2); label(o1); statement(0); label(o2); return; } peeksym = o; label(o1); return; case WHILE: o1 = contlab; o2 = brklab; label(contlab = isn++); cbrnch0(pexpr(), brklab=isn++, 0); statement(0); branch(contlab); label(brklab); contlab = o1; brklab = o2; return; case BREAK: chconbrk(brklab); branch(brklab); goto semi; case CONTIN: chconbrk(contlab); branch(contlab); goto semi; case DO: o1 = contlab; o2 = brklab; contlab = isn++; brklab = isn++; label(o3 = isn++); statement(0); label(contlab); contlab = o1; if ((o=symbol())==KEYW && cval==WHILE) { cbrnch0(tree(), o3, 1); label(brklab); brklab = o2; goto semi; } goto syntax; case CASE: o1 = conexp(); if ((o=symbol())!=COLON) goto syntax; if (swp==0) { error("Case not in switch"); goto stmt; } if(swp>=swtab+swsiz) { error("Switch table overflow"); } else { swp->swlab = isn; (swp++)->swval = o1; label(isn++); } goto stmt; case SWITCH: o1 = brklab; brklab = isn++; np = pexpr(); chkw(np); rcexpr0(block(1,RFORCE,0,0,np), regtab); pswtch0(); brklab = o1; return; case DEFAULT: if (swp==0) error("Default not in switch"); if ((o=symbol())!=COLON) goto syntax; label(deflab = isn++); goto stmt; case FOR: o1 = contlab; o2 = brklab; contlab = isn++; brklab = isn++; if (o=forstmt()) goto syntax; label(brklab); contlab = o1; brklab = o2; return; } error("Unknown keyword = %o",cval); goto syntax; case NAME: if (nextchar()==':') { peekc = 0; o1 = csym; if (o1->hclass>0) { error("Redefinition"); goto stmt; } o1->hclass = STATIC; o1->htype = ARRAY; if (o1->hoffset==0) o1->hoffset = isn++; label(o1->hoffset); if ((peeksym=symbol())==RBRACE) return; goto stmt; } } peeksym = o; rcexpr0(tree(), efftab); semi: if ((o=symbol())==SEMI) return; syntax: error("Statement syntax"); errflush(o); return; } blkhed() { register pl; register struct hshtab *cs; autolen = hgreglen; /* Save 16 registers */ declist(0); pl = 0; while(paraml) { parame->hoffset = 0; cs = paraml; paraml = paraml->hoffset; if (cs->htype==FLOAT) cs->htype = DOUBLE; cs->hoffset = -1 - pl; /* flag as argument */ cs->hclass = AUTO; if ((cs->htype&030) == ARRAY) { cs->htype =- 020; /* set ptr */ cs->ssp++; /* pop dims */ } if (cs->htype == CHAR) cs->htype = INT; pl =+ rlength(cs); } for (cs=hshtab; csname[0] == '\0') continue; /* check tagged structure */ if (cs->hclass>KEYWC && (cs->htype&07)==RSTRUCT) { cs->lenp = dimtab[cs->lenp]->lenp; cs->htype = cs->htype&~07 | STRUCT; } if (cs->hclass == STRTAG && dimtab[cs->lenp]==0) error("Undefined structure: %.8s", cs->name); if (cs->hclass == ARG) error("Not an argument: %.8s", cs->name); } osleft = ossiz; space = treebase; return(autolen); } blkend() { register struct hshtab *cs; for (cs=hshtab; csname[0]) { if ((cs->hflags & DELETED) == 0) { if (cs->hclass==0) error("%.8s undefined", cs->name); if((cs->hflags&PERM)==0) { cs->hflags =| DELETED; /* delete nonglobal items from the symbol table. */ hshused--; } } } } } errflush(ao) { register o; o = ao; while(o>RBRACE) /* ; { } */ o = symbol(); peeksym = o; } declist(skwd) { int o, elsize, ndec; register offset, tkw, skw; offset = 0; loop: ndec = 0; tkw = -1; skw = skwd; elsize = 0; while ((o=symbol())==KEYW) switch(cval) { case AUTO: case STATIC: case EXTERN: case GXTERN: case FORTRAN: case REG: if (skw) error("Conflict in storage class"); skw = cval; ndec++; if (tkw<0) continue; goto list; case STRUCT: o = cval; elsize = strdec(&o, skw==MOS); cval = o; case INT: case CHAR: case FLOAT: case DOUBLE: ndec++; if (tkw>=0) error("Type clash"); tkw = cval; if (skw==0) continue; goto list; default: goto brk1; } brk1: peeksym = o; if (ndec==0) return(offset); list: if (tkw<0) tkw = INT; if (skw==0) skw = AUTO; offset = declare(skw, tkw, offset, elsize); goto loop; } strdec(tkwp, mosf) int *tkwp; { register elsize, o; register struct hshtab *ssym; struct hshtab *ds; mosflg = 1; ssym = 0; if ((o=symbol())==NAME) { ssym = csym; if (ssym->hclass==0) { ssym->hclass = STRTAG; ssym->lenp = dimp; dimtab[dimp++] = 0; } if (ssym->hclass != STRTAG) redec(); mosflg = mosf; o = symbol(); } mosflg = 0; if (o != LBRACE) { if (ssym==0) { syntax: decsyn(o); return(0); } if (ssym->hclass!=STRTAG) error("Bad structure name"); if ((elsize = dimtab[ssym->lenp])==0) { *tkwp = RSTRUCT; elsize = ssym; } peeksym = o; } else { ds = defsym; mosflg = 0; elsize = declist(MOS); elsize = (elsize+03) & ~03; /* round to multiple of 4. */ defsym = ds; if ((o = symbol()) != RBRACE) goto syntax; if (ssym) { if (dimtab[ssym->lenp]) error("%.8s redeclared", ssym->name); dimtab[ssym->lenp] = elsize; } } return(elsize); } prtflo(sign,init) /*print floating point value */ { /* sign is +1 for +, -1 for - */ /* init is 0 for execution constants, non-zero for initialization: */ /* 4 for single precision, 8 for double precision */ if (!init) hgprloc(hgdata); printf("$%d dc ",cval=isn++); if (init == hgfloatsz) /* double precision */ printf("d'"); else /* single precision */ printf("d'"); if(sign<0) printf("-"); printf(fcval,'e'); printf("'\n"); if (!init) hgprloc(hgcode); } } } return(elsize); } prtflo(sign,init) /*print floating point value */ { /* sign is +1 # /* C compiler (file c03.c) Copyright 1972 Bell Telephone Laboratories, Inc. */ #include "c0h.c" #define forsps 150 forstmt() { int l, savxpr[forsps]; int *st, *ss; register int *sp1, *sp2, o; if ((o=symbol()) != LPARN) return(o); if ((o=symbol()) != SEMI) { /* init part */ peeksym = o; rcexpr0(tree(), efftab); if ((o=symbol()) != SEMI) return(o); } label(contlab); if ((o=symbol()) != SEMI) { /* test part */ peeksym = o; rcexpr0(block(1,CBRANCH,tree(),brklab,0), cctab); if ((o=symbol()) != SEMI) return(o); } if ((peeksym=symbol()) == RPARN) { /* incr part */ peeksym = -1; statement(0); branch(contlab); return(0); } l = contlab; contlab = isn++; st = tree(); if ((o=symbol()) != RPARN) return(o); ss = space; if (space-treebase > forsps) { error("Expression too large"); space = &treebase[forsps]; } sp2 = savxpr; for (sp1=treebase; sp1>2) & ~07 | t&07); } incref(t) /* given type int, returns type pointer to int. */ { return((t<<2)&~034 | (t&07) | PTR); } /* Given a tree labeled true or false, it */ cbrnch0(tree, lbl, cond) /* generates conditional transfers to a tree label */ struct tnode *tree; /* depending on logic value.*/ { rcexpr0(block(1,CBRANCH,tree,lbl,cond),cctab); } rcexpr0(tree, table) /* Call functions that will evaluate an expression. */ struct table *table; struct tnode *tree; { if (tree == 0) return; tree = optim(tree); nstack = 0; rcexpr(tree, table, lowreg); } branch(lab) { /* Put out a branch instruction. */ printf(" B $%d \n", lab); } label(l) { /* Puts out a label. */ printf("$%d equ * \n", l); } plength(ap) /* Arguement is a node containing a pointer. */ struct tname *ap; /* Plength is length of thing pointed to. */ { register t, l; register struct tname *p; p = ap; if (((t=p->ntype)&~07) == 0) /* not a reference */ return(1); p->ntype = decref(t); l = length(p); p->ntype = t; return(l); } length(acs) /* length in bytes of a thing. */ struct tnode *acs; { register t, n; register struct tnode *cs; cs = acs; t = cs->type; n = 1; while ((t&030) == ARRAY) { t = decref(t); n = dimtab[cs->ssp]; } if ((t&~07)==FUNC) return(0); if (t>=PTR) return(4*n); switch(t&07) { case INT: return(4*n); case CHAR: return(n); case FLOAT: return(4*n); case DOUBLE: return(8*n); case STRUCT: return(n * dimtab[cs->lenp]); case RSTRUCT: error("Bad structure"); return(0); } error("Compiler error (length)"); return(0); } rlength(cs) /* same, but does rounding - allignment required. */ struct tnode *cs; { return((length(cs) + 03) & ~03); /* round up to multiple of four. */ } simplegoto() { register struct hshtab *csp; if ((peeksym=symbol())==NAME && nextchar()==';') { csp = csym; if (csp->hclass==0 && csp->htype==0) { csp->htype = ARRAY; if (csp->hoffset==0) csp->hoffset = isn++; } if ((csp->hclass==0||csp->hclass==STATIC) && csp->htype==ARRAY) { peeksym = -1; return(csp->hoffset); } } return(0); } nextchar() /* Peek ahead, but skip over spaces. */ { while (getctab(peekc)==SPACE) peekc = getchar(); return(peekc); } chconbrk(l) /* check continue and break */ { if (l==0) error("Break/continue error"); } dogoto() /* does the jump in general goto case. */ { register struct tnode *np; *cp++ = tree(); build(STAR); chkw(np = *--cp); rcexpr0(block(1,JUMP,0,0,np), regtab); } doret() /* Perform a RETURN statement. */ { if (nextchar() != ';') rcexpr0(block(1, RFORCE, 0, 0, tree()), regtab); branch(retlab); } doasm() /* Process Assembly Language Window (ASM) */ /* asm("....."); is format, where text inside"-s is laid down exactly as is. */ { char a; if(symbol() != LPARN) goto asmerr ; if(getchar() != '"') goto asmerr ; while ((a=getchar()) != '"') {putchar(a); } printf("\n"); if(getchar() != ')') goto asmerr; return(0); asmerr: error("asm delimiter error"); return(-1); } hgprloc(hglocval) int hglocval; { if (hglocval == hgcurloc) return; switch (hglocval) { case hgmain: { printf(" mainloc\n"); break; } case hgcode: { printf(" codeloc\n"); break; } case hgdata: { printf(" dataloc\n"); break; } case hgstring: { printf(" strgloc\n"); break; } case hgtvec: { printf(" tvecloc\n"); break; } case hglit: { printf(" litloc\n"); break; } case hgistring: { printf( " istrloc\n" ); break; } default: error("Illegal loctr value"); } hgcurloc = hglocval; return; } loc) return; switch (hglocval) { case hgmain: { printf(" mainloc\n"); break; } case hgcode: { printf(" codeloc\n"); break; } case hgdata: { printf(" dataloc\n"); br# #include "c0h.c" /* * info on operators: * 01-- is binary operator * 02-- left (or only) operand must be lvalue * 04-- is relational operator * 010-- is assignment-type operator * 020-- non-float req. on left * 040-- non-float req. on right * 0100-- is commutative * 0200-- is right, not left-associative * 0400-- is leaf of tree * *0XX000-- XX is priority of operator */ int opdope[] { 000000, /* EOF */ 000000, /* ; */ 000000, /* { */ 000000, /* } */ 036000, /* [ */ 002000, /* ] */ 036000, /* ( */ 002000, /* ) */ 014201, /* : */ 007201, /* , */ 000000, /* 10 */ 000000, /* 11 */ 000000, /* 12 */ 000000, /* 13 */ 000000, /* 14 */ 000000, /* 15 */ 000000, /* 16 */ 000000, /* 17 */ 000000, /* 18 */ 000000, /* 19 */ 000400, /* name */ 000400, /* short constant */ 000400, /* string */ 000400, /* float */ 000400, /* double */ 000400, /* long integer constant */ 000000, /* 26 */ 000000, /* 27 */ 000000, /* 28 */ 034200, /* sizeof */ 034203, /* ++pre */ 034203, /* --pre */ 034203, /* ++post */ 034203, /* --post */ 034220, /* !un */ 034202, /* &un */ 034220, /* *un */ 034200, /* -un */ 034220, /* ~un */ 036001, /* . (structure reference) */ 030101, /* + */ 030001, /* - */ 032101, /* * */ 032001, /* / */ 032001, /* % */ 026061, /* >> */ 026061, /* << */ 020161, /* & */ 017161, /* | */ 017161, /* ^ */ 036001, /* -> */ 000000, /* int -> double */ 000000, /* double -> int */ 016001, /* && */ 015001, /* || */ 000000, /* 55 */ 000000, /* 56 */ 000000, /* 57 */ 000000, /* 58 */ 000000, /* 59 */ 022005, /* == */ 022005, /* != */ 024005, /* <= */ 024005, /* < */ 024005, /* >= */ 024005, /* > */ 024005, /*

p */ 024005, /* >=p */ 012213, /* =+ */ 012213, /* =- */ 012213, /* =* */ 012213, /* =/ */ 012213, /* =% */ 012253, /* =>> */ 012253, /* =<< */ 012253, /* =& */ 012253, /* =| */ 012253, /* =^ */ 012213, /* = */ 000000, /* 81 */ 000000, /* 82 */ 000000, /* 83 */ 000000, /* 84 */ 000000, /* 85 */ 000000, /* 86 */ 000000, /* 87 */ 000000, /* 88 */ 000000, /* 89 */ 014201, /* ? */ 000000, /* 91 */ 000000, /* 92 */ 000000, /* 93 */ 000000, /* 94 */ 000000, /* 95 */ 000000, /* 96 */ 000000, /* 97 */ 000000, /* 98 */ 000000, /* 99 */ 036001, /* call */ 036001, /* mcall */ 000000, /* goto */ 000000, /* jump cond */ 000000, /* branch cond */ 000000, /* 105 */ 000000, /* 106 */ 000000, /* 107 */ 000000, /* 108 */ 000000, /* 109 */ 000000 /* force r0 */ }; /* * conversion table: * 0100-- convert left operand * 0*0XX-- XX is conversion number, to wit: * 000: none * 001: int -> ptr * 002: ptr -> int * 003: int -> double * 004: double -> int * 077: generally illegal */ char cvtab[] { 0000, /* i : i */ 0000, /* i : c */ 0103, /* i : f */ 0103, /* i : d */ 0077, /* i : s */ 0101, /* i : *i */ 0000, /* i : *c */ 0101, /* i : *f */ 0101, /* i : *d */ 0101, /* i : *s */ 0101, /* i : ** */ 0000, /* c : i */ 0000, /* c : c */ 0103, /* c : f */ 0103, /* c : d */ 0077, /* c : s */ 0101, /* c : *i */ 0000, /* c : *c */ 0101, /* c : *f */ 0101, /* c : *d */ 0101, /* c : *s */ 0101, /* c : ** */ 0003, /* f : i */ 0003, /* f : c */ 0000, /* f : f */ 0000, /* f : d */ 0077, /* f : s */ 0077, /* f : *i */ 0077, /* f : *c */ 0077, /* f : *f */ 0077, /* f : *d */ 0077, /* f : *s */ 0077, /* f : ** */ 0003, /* d : i */ 0003, /* d : c */ 0000, /* d : f */ 0000, /* d : d */ 0077, /* d : s */ 0077, /* d : *i */ 0077, /* d : *c */ 0077, /* d : *f */ 0077, /* d : *d */ 0077, /* d : *s */ 0077, /* d : ** */ 0077, /* s : i */ 0077, /* s : c */ 0077, /* s : f */ 0077, /* s : d */ 0077, /* s : s */ 0077, /* s : *i */ 0077, /* s : *c */ 0077, /* s : *f */ 0077, /* s : *d */ 0077, /* s : *s */ 0077, /* s : ** */ 0001, /* *i : i */ 0001, /* *i : c */ 0077, /* *i : f */ 0077, /* *i : d */ 0077, /* *i : s */ 0002, /* *i : *i */ 0077, /* *i : *c */ 0077, /* *i : *f */ 0077, /* *i : *d */ 0077, /* *i : *s */ 0002, /* *i : ** */ 0000, /* *c : i */ 0000, /* *c : c */ 0077, /* *c : f */ 0077, /* *c : d */ 0077, /* *c : s */ 0077, /* *c : *i */ 0000, /* *c : *c */ 0077, /* *c : *f */ 0077, /* *c : *d */ 0077, /* *c : *s */ 0077, /* *c : ** */ 0001, /* *f : i */ 0001, /* *f : c */ 0077, /* *f : f */ 0077, /* *f : d */ 0077, /* *f : s */ 0077, /* *f : *i */ 0077, /* *f : *c */ 0002, /* *f : *f */ 0077, /* *f : *d */ 0077, /* *f : *s */ 0077, /* *f : ** */ 0001, /* *d : i */ 0001, /* *d : c */ 0077, /* *d : f */ 0077, /* *d : d */ 0077, /* *d : s */ 0077, /* *d : *i */ 0077, /* *d : *c */ 0077, /* *d : *f */ 0002, /* *d : *d */ 0077, /* *d : *s */ 0077, /* *d : ** */ 0001, /* *s : i */ 0001, /* *s : c */ 0077, /* *s : f */ 0077, /* *s : d */ 0077, /* *s : s */ 0077, /* *s : *i */ 0077, /* *s : *c */ 0077, /* *s : *f */ 0077, /* *s : *d */ 0002, /* *s : *s */ 0077, /* *s : ** */ 0001, /* ** : i */ 0001, /* ** : c */ 0077, /* ** : f */ 0077, /* ** : d */ 0077, /* ** : s */ 0002, /* ** : *i */ 0077, /* ** : *c */ 0077, /* ** : *f */ 0077, /* ** : *d */ 0077, /* ** : *s */ 0002 /* ** : ** */ }; /* * character type table */ char ctab[] { EOF, INSERT, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, SPACE, NEWLN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, SPACE, EXCLA, DQUOTE, UNKN, UNKN, MOD, AND, SQUOTE, LPARN, RPARN, TIMES, PLUS, COMMA, MINUS, PERIOD, DIVIDE, DIGIT, DIGIT, DIGIT, DIGIT, DIGIT, DIGIT, DIGIT, DIGIT, DIGIT, DIGIT, COLON, SEMI, LESS, ASSIGN, GREAT, QUEST, UNKN, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LBRACK, UNKN, RBRACK, EXOR, LETTER, UNKN, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LBRACE, OR, RBRACE, COMPL, UNKN }; char atoe[] { 0000,0001,0002,0003,0067,0055,0056,0057, 0026,0005,0045,0013,0014,0015,0016,0017, 0020,0021,0022,0023,0074,0075,0062,0046, 0030,0031,0077,0047,0034,0035,0036,0037, 0100,0132,0177,0173,0133,0154,0120,0175, 0115,0135,0134,0116,0153,0140,0113,0141, 0360,0361,0362,0363,0364,0365,0366,0367, 0370,0371,0172,0136,0114,0176,0156,0157, 0174,0301,0302,0303,0304,0305,0306,0307, 0310,0311,0321,0322,0323,0324,0325,0326, 0327,0330,0331,0342,0343,0344,0345,0346, 0347,0350,0351,0255,0340,0275,0276,0155, 0171,0201,0202,0203,0204,0205,0206,0207, 0210,0211,0221,0222,0223,0224,0225,0226, 0227,0230,0231,0242,0243,0244,0245,0246, 0247,0250,0251,0300,0117,0320,0241,0007, 0004,0006,0010,0011,0012,0024,0025,0027, 0032,0033,0040,0041,0042,0043,0044,0050, 0051,0052,0053,0054,0060,0061,0063,0064, 0065,0066,0070,0071,0072,0073,0076,0101, 0102,0103,0104,0105,0106,0107,0110,0111, 0112,0121,0122,0123,0124,0125,0126,0127, 0130,0131,0137,0142,0143,0144,0145,0146, 0147,0150,0151,0152,0160,0161,0162,0163, 0164,0165,0166,0167,0170,0200,0212,0213, 0215,0216,0217,0220,0232,0233,0234,0235, 0236,0237,0240,0252,0253,0214,0256,0257, 0260,0261,0262,0263,0264,0265,0266,0267, 0270,0271,0272,0273,0274,0254,0277,0312, 0313,0314,0315,0316,0317,0332,0333,0334, 0335,0336,0337,0341,0352,0353,0354,0355, 0356,0357,0372,0373,0374,0375,0376,0377, }; char symbuf[ncps]; int hshused; struct hshtab hshtab[hshsiz]; int *space; int *cp; int cmst[cmsiz]; struct swtab *swp; int contlab; int brklab; int retlab; int deflab; int autolen; int peekc; int eof; int hgcurloc; struct hshtab *defsym; struct hshtab *funcsym; int xdflg; int proflg; struct hshtab *csym; int cval; int nchstr; char *fcval; int fflg; int ftern; int hgcurlo; int nerror; struct hshtab *paraml; struct hshtab *parame; int strflg; int osleft; int mosflg; int initflg; int inhdr; int dimtab[dimsiz]; int dimp; /* Next free slot in dimension table. */ int regvar; /* Number of declared register variables. */ /* Variables added for ibmc. */ int ndp; /* nbr of declared parameters in a ftn. */ int endp; /* enable incrementing of ndp. */ int xtern; /* flag to indicate keyword extern was seen. */ int function; /* flag to indicate if a ftn has yet been seen. */ int hgoffs; struct table efftab[]; int nstack; int nfloat; char etoa[] { 0000,0001,0002,0003,0200,0011,0201,0177, 0202,0203,0204,0013,0014,0015,0016,0017, 0020,0021,0022,0023,0205,0206,0010,0207, 0030,0031,0210,0211,0034,0035,0036,0037, 0212,0213,0214,0215,0216,0012,0027,0033, 0217,0220,0221,0222,0223,0005,0006,0007, 0224,0225,0026,0226,0227,0230,0231,0004, 0232,0233,0234,0235,0024,0025,0236,0032, 0040,0237,0240,0241,0242,0243,0244,0245, 0246,0247,0250,0056,0074,0050,0053,0174, 0046,0251,0252,0253,0254,0255,0256,0257, 0260,0261,0041,0044,0052,0051,0073,0262, 0055,0057,0263,0264,0265,0266,0267,0270, 0271,0272,0273,0054,0045,0137,0076,0077, 0274,0275,0276,0277,0300,0301,0302,0303, 0304,0140,0072,0043,0100,0047,0075,0042, 0305,0141,0142,0143,0144,0145,0146,0147, 0150,0151,0306,0307,0325,0310,0311,0312, 0313,0152,0153,0154,0155,0156,0157,0160, 0161,0162,0314,0315,0316,0317,0320,0321, 0322,0176,0163,0164,0165,0166,0167,0170, 0171,0172,0323,0324,0345,0133,0326,0327, 0330,0331,0332,0333,0334,0335,0336,0337, 0340,0341,0342,0343,0344,0135,0136,0346, 0173,0101,0102,0103,0104,0105,0106,0107, 0110,0111,0347,0350,0351,0352,0353,0354, 0175,0112,0113,0114,0115,0116,0117,0120, 0121,0122,0355,0356,0357,0360,0361,0362, 0134,0363,0123,0124,0125,0126,0127,0130, 0131,0132,0364,0365,0366,0367,0370,0371, 0060,0061,0062,0063,0064,0065,0066,0067, 0070,0071,0372,0373,0374,0375,0376,0377, }; 321, 0322,0176,0163,0164,0165,0166,0167,0170, 0171,0172,0323,0324,0345,0133,0326,0327, 0330,0331,0332,0333,0334,0335,0336,0337, 0340,0341,0342,0343,0344,0135,0136,0346, 0173,0101,0102,0103,0104,0105,0106,0107, 0110,0111,0347,0350,0351,0352,0353,0354, 0175,0112,0113,0114,0115,0116,0117,0120, 0121,0122,0355,0356,0357,0360,0361,0362, 0134,0363,0123,0124,0125,0126,012# /* C compiler ( file - c05.c ) Copyright 1972 Bell Telephone Laboratories, Inc. */ #include "c0h.c" struct swtab swtab[swsiz]; extern char etoa[]; extern char atoe[]; int machine; struct hshtab *lookup() { /* returns a pointer to a hshtab structure member */ int ihash; register struct hshtab *rp; register char *sp, *np; char *delp; int delpen, lpctr; ihash = 0; delpen = YES; lpctr = 0; for (sp=symbuf; spname)) { /* look while items in the table are nonzero. */ if ((delpen == YES) && ((rp->hflags & DELETED) == DELETED) && ((rp->hflags & GLOBAL) == 0)) { delp = rp; delpen = NO; } for (sp=symbuf; sphflags & DELETED) == DELETED) goto insertname; return(rp); no: if (++lpctr >= hshsiz) goto insert; if (++rp >= &hshtab[hshsiz]) rp = hshtab; } insert: if (delpen == NO) rp = delp; insertname: if(++hshused >= hshsiz) { error("Symbol table overflow"); cexit(1); } rp->hclass = 0; rp->htype = 0; rp->hoffset = 0; rp->hdimp = 0; rp->hflags = 0; sp = symbuf; if (xdflg) rp->hflags =| PERM; /* non-deletable */ for (np=rp->name; sp=0) { c = peeksym; peeksym = -1; if (c==NAME) mosflg = 0; return(c); } if (peekc) { c = peekc; peekc = 0; } else if (eof) return(EOF); else c = getchar(); loop: switch(getctab(c)) { /* Ctab is a character set dependant table, initialized in c04.c. */ case INSERT: /* ignore next newline on # inserted files. */ inhdr = 1; c = getchar(); goto loop; case NEWLN: if (!inhdr) line++; inhdr = 0; case SPACE: c = getchar(); goto loop; case EOF: eof++; return(0); case PLUS: return(subseq(c,PLUS,INCBEF)); case MINUS: return(subseq(c,subseq('>',MINUS,ARROW),DECBEF)); case ASSIGN: if (subseq(' ',0,1)) return(ASSIGN); c = symbol(); if (c>=PLUS && c<=EXOR) return(c+30); if (c==ASSIGN) return(EQUAL); peeksym = c; return(ASSIGN); case LESS: if (subseq(c,0,1)) return(LSHIFT); return(subseq('=',LESS,LESSEQ)); case GREAT: if (subseq(c,0,1)) return(RSHIFT); return(subseq('=',GREAT,GREATEQ)); case EXCLA: return(subseq('=',EXCLA,NEQUAL)); case DIVIDE: if (subseq('*',1,0)) return(DIVIDE); com: /* Process a comment. */ c = getchar(); com1: switch(c) { case '\0': eof++; error("Nonterminated comment"); return(0); case '\n': if (!inhdr) line++; inhdr = 0; goto com; case 001: /* SOH, insert marker */ inhdr++; default: goto com; case '*': c = getchar(); if (c!='/') goto com1; } /* End processing a comment. */ c = getchar(); goto loop; case PERIOD: c = getchar(); if(c>='0' && c<='9' ) { dig[0] = '.'; i=1; goto fc; } /* not floating point; structure reference */ peekc = c; return (DOT); case DIGIT: cv2 = 0; i = 0; base = (c=='0') ? 8 : 10; while (c>='0' && c<='9') { cv2 = (cv2*base-'0')+c; dig[i++] = c; c = getchar(); } if( c=='.' || c=='d' || c=='D' || c=='e' || c=='E' ) goto fc; peekc = c; #ifdef unix if(cv2.integ != 0 || cv2.integ2 < 0) { cval = &cv2; return(LCON); } #endif cval = cv2; return (CON); fc: /* convert floating point constant */ state = 0; /* haven't seen d */ for( ;; c=getchar() ) { switch(c) { case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '.': dig[i++] = c; if (state) state=2; continue; case 'd': case 'D': case 'e': case 'E': dig[i++] = '%'; dig[i++] = 'c'; if(state!=0) error("illegal floating point constant"); state = 1; continue; case '+': case '-': if(state==1) { dig[i++] = c; continue; } } /*otherwise, and + and - not preceded by d */ break; } /* we now have collected the digits; output the number */ if(state==0) { dig[i++] = '%'; dig[i++] = 'c'; dig[i++] = '0'; } peekc = c; dig[i++] = '\0'; fcval = dig; return(FCON); case DQUOTE: return(STRING); /* return, but dont get contents */ case SQUOTE: return(getcc()); /* Only call of getcc. */ case LETTER: sp = symbuf; /* Put a word into symbol buffer - then call lookup. */ if (mosflg) { *sp++ = '.'; mosflg = 0; } while(getctab(c)==LETTER || getctab(c)==DIGIT) { if (c == '_') c = '#'; if (sphclass==KEYWC) { if (csym->htype==SIZEOF) return(SIZEOF); cval = csym->htype; return(KEYW); } return(NAME); case AND: return(subseq('&', AND, LOGAND)); case OR: return(subseq('|', OR, LOGOR)); case UNKN: error("Unknown character"); c = getchar(); goto loop; } return(getctab(c)); } /* End of Symbol function. */ subseq(c,a,b) { if (!peekc) peekc = getchar(); if (peekc != c) return(a); peekc = 0; return(b); } getstr() { /* get string - processes something in double quotes. */ register int c; register int slpctr; nchstr = 1; printf("$%d",cval = isn++); printf(" dc x'"); slpctr = 0; while((c=mapch('"')) >= 0) { if (slpctr >= 25) { slpctr = 0; printf("'\n dc x'"); } printf("%02x", c); nchstr++; slpctr++; } if (nchstr<= 1) printf("00"); printf("' \n dc x'00' \n"); } getcc() /* get a character constant (eg 'a'). */ { register int c, cc; cval = 0; cc = 0; while((c=mapch('\'')) >= 0) {cc++; if(cc<=2) cval = (cval<<8) + c; } if(cc>2) /* don't allow char const > 2 char */ error("Long character constant"); return(CON); } mapch(ac) /* map character - implements the escapes (eg \n). */ { register int a, c; c = ac; loop: if((a=getchar())==c) return(-1); switch(a) { case '\n': case '\0': error("Nonterminated string"); peekc = a; return(-1); case '\\': /* Return numerical value of ebcdic character. */ switch (a=getchar()) { case 't': return(011); /* return('\t') */ case 'n': return(012); /* \n line feed */ case 'b': return(010); /* \b, backspace */ case '0': return(0); /* \0, null */ case 'r': return(13); /* \r, carriage return */ case '\n': if (!inhdr) line++; inhdr = 0; goto loop; } } if (machine == UNIX) { return(a); } else /* machine is IBM */ return(etoa[a] & 0377); } getctab(c) char c; { if (machine == IBM) return(ctab[etoa[c]]); else /* machine is UNIX */ return(ctab[c]); } ('\t') */ case 'n': return(012); /* \n line feed */ case 'b': return(010); /* \b, back# /* (file - c0h.c) C compiler-- header file Copyright 1973 Bell Telephone Laboratories, Inc. */ /* parameters */ #define ncps 8 #define hshsiz 400 #define cmsiz 40 #define swsiz 200 #define ncpw 4 /* number of characters per word */ #define ossiz 500 #define dimsiz 100 # define hgintsz 4 /* number of bytes in an integer */ # define hgfloatsz 8 /* number of bytes in a float */ # define hgreglen 64 /* bytes required to store 16 registers */ # define totregs 5 # define lowreg 2 #define PREPUSH 4 /* number of bytes to drop stack below base */ /* the following constants indicate the type of loctr */ # define hgmain 1 # define hgcode 2 # define hgdata 3 # define hgstring 4 # define hgtvec 5 # define hglit 6 # define hgistring 7 struct tnode { /* nodes for expression tree */ int op; int type; int dimp; /* dimention pointer */ struct tnode *tr1, *tr2; }; struct { int fop; int ftype; char ssp; /* subscript list */ char lenp; /* structure length */ }; struct { /* tnode from pass 1. */ int op; int type; int degree; struct tnode *tr1, *tr2; }; struct tname { /* node for a leaf in the expression tree */ int nop; int ntype; int ndimp; int class; int offset; int nloc; }; struct { /* tname from pass 1. */ int nop; int ntype; int elsize; int class; int offset; int nloc; }; struct tconst { /* node for a constant in the expression tree */ int cop; int ctype; int cdimp; int value; }; struct { /* tconst from pass 1. */ int cop; int ctype; int cdeg; int value; }; struct hshtab { /* hash table */ int hclass; int htype; int hdimp; int hoffset; int hflags; char name[ncps]; }; struct swtab { /* switch table */ int swlab; int swval; }; struct bnode { int bop; struct tnode *btree; int lbl; int cond; }; struct optab { int tabdeg1; int tabtyp1; int tabdeg2; int tabtyp2; char *tabstring; }; struct table { int tabop; struct optab *tabp; }; extern struct tconst czero, cone; extern char cvtab[]; /* conversion table in c04.c ; used in type conversions */ extern int opdope[]; /* information on operators */ extern char ctab[]; /* table that maps characters into character types */ extern char symbuf[ncps]; extern int hshused; extern struct hshtab hshtab[hshsiz]; extern int *space; extern int *cp; extern int cmst[cmsiz]; extern int isn; extern int isn1; extern struct swtab swtab[swsiz]; extern struct swtab *swp; extern int contlab; extern int brklab; extern int retlab; extern int deflab; extern int autolen; extern int peeksym; extern int peekc; extern int eof; extern int line; extern int *treebase; extern struct hshtab *defsym; extern struct hshtab *funcsym; extern int xdflg; extern int proflg; extern struct hshtab *csym; extern int cval; extern char *fcval; extern int nchstr; extern int nerror; extern struct hshtab *paraml; extern struct hshtab *parame; extern int strflg; extern int osleft; extern int mosflg; extern int initflg; extern int inhdr; extern int dimtab[dimsiz]; extern int dimp; /* Next free slot in dimension table. */ extern int regvar; /* Number of declared register variables. */ /* Variables added for ibmc. */ extern int ndp; /* nbr of declared parameters in a ftn. */ extern int endp; /* enable incrementing of ndp. */ extern int xtern; /* flag to indicate keyword extern was seen. */ extern int ftern; /* flag to indicate keyword fortran was seen. */ extern int fflg; /* composite fortran flag */ extern int function; /* flag to indicate if a ftn has yet been seen. */ extern int mainftn; /* flag to indicate whether ftn is main */ extern int mainfile; /* flag indicating whether main function is in file */ extern int machine; /* flag to tell which machine this program is executing on. */ extern int hgoffs; /* contents of HGARGP plus hgoffs points to first free space on arg. stack */ extern int hgcurloc; /* current loctr */ extern char maprel[]; extern char notrel[]; extern int nreg; extern struct table cctab[]; extern struct table efftab[]; extern struct table regtab[]; extern int nstack; extern int nfloat; /* operators */ #define EOF 0 #define SEMI 1 #define LBRACE 2 #define RBRACE 3 #define LBRACK 4 #define RBRACK 5 #define LPARN 6 #define RPARN 7 #define COLON 8 #define COMMA 9 #define KEYW 19 #define NAME 20 #define CON 21 #define STRING 22 #define FCON 23 #define SFCON 24 #define LCON 25 #define INCBEF 30 #define DECBEF 31 #define INCAFT 32 #define DECAFT 33 #define EXCLA 34 #define AMPER 35 #define STAR 36 #define NEG 37 #define COMPL 38 #define DOT 39 #define PLUS 40 #define MINUS 41 #define TIMES 42 #define DIVIDE 43 #define MOD 44 #define RSHIFT 45 #define LSHIFT 46 #define AND 47 #define OR 48 #define EXOR 49 #define ARROW 50 #define ITOF 51 #define FTOI 52 #define LOGAND 53 #define LOGOR 54 #define EQUAL 60 #define NEQUAL 61 #define LESSEQ 62 #define LESS 63 #define GREATEQ 64 #define GREAT 65 #define LESSP 66 #define LESSEQP 67 #define GREATP 68 #define GREATQP 69 #define ASPLUS 70 #define ASMINUS 71 #define ASTIMES 72 #define ASDIV 73 #define ASMOD 74 #define ASRSH 75 #define ASLSH 76 #define ASSAND 77 #define ASOR 78 #define ASXOR 79 #define ASSIGN 80 #define QUEST 90 #define CALL 100 #define MCALL 101 #define JUMP 102 #define CBRANCH 103 #define INIT 104 #define SETREG 105 #define LOAD 106 #define INIB 107 #define RFORCE 110 #define BRANCH 111 #define LABEL 112 /* types */ #define INT 0 #define CHAR 1 #define FLOAT 2 #define DOUBLE 3 #define STRUCT 4 #define RSTRUCT 5 #define PTR 010 #define FUNC 020 #define ARRAY 030 /* storage classes */ #define KEYWC 1 #define MOS 4 #define GXTERN 9 #define AUTO 5 #define EXTERN 6 #define STATIC 7 #define REG 8 #define STRTAG 3 #define ARG 10 #define ARG1 11 #define FORTRAN 23 #define BLISS 22 /* keywords */ #define GOTO 10 #define RETURN 11 #define IF 12 #define WHILE 13 #define ELSE 14 #define SWITCH 15 #define CASE 16 #define BREAK 17 #define CONTIN 18 #define DO 19 #define DEFAULT 20 #define FOR 21 #define ASM 24 #define SIZEOF 29 /* characters */ #define INSERT 119 #define PERIOD 120 #define SQUOTE 121 #define DQUOTE 122 #define LETTER 123 #define DIGIT 124 #define NEWLN 125 #define SPACE 126 #define UNKN 127 /* Flag bits */ #define BINARY 01 #define LVALUE 02 #define RELAT 04 #define ASSGOP 010 #define LWORD 020 #define RWORD 040 #define COMMUTE 0100 #define RASSOC 0200 #define LEAF 0400 /* hflags */ #define GLOBAL 01 #define DEFINED 02 #define DELETED 04 #define PERM 010 #define YES 1 #define NO 0 #define IBM 0 #define UNIX 1 #ifndef unix #define long int #endif struct { long longint;}; struct { int integ; int integ2;}; ETTER 12# /* some general table writing rules X specifies that the result may come back in other than the requested register (incl reg. 0 ); R1 should not be used after X is (R) should not be used after X is In particular, FX* and FS* should be used very cautiously, since they tend to imply #1(R), or similar * always skips the constant in a *(e+c) situation #1 or #2 should always be used in this case! */ /* C compiler (file - c10.c) Copyright 1972 Bell Telephone Laboratories, Inc. */ #include "c0h.c" #ifdef DEBUG int hdebug 0; #endif char maprel[] { EQUAL, NEQUAL, GREATEQ, GREAT, LESSEQ, LESS, GREATP, GREATQP, LESSP, LESSEQP }; char notrel[] { NEQUAL, EQUAL, GREAT, GREATEQ, LESS, LESSEQ, GREATQP, GREATP, LESSEQP, LESSP }; int nreg 7; int flreg 0; int *treebase; extern char etoa[]; char *match(atree, table, nrleft) struct tnode *atree; struct table *table; { int op, d1, d2, t1, t2, dope,i; struct tnode *p2; register struct tnode *p1, *tree; register struct optab *opt; if ((tree=atree)==0) return(0); op = tree->op; dope = opdope[op]; if (isfloat(tree)) if (op == MOD || op == ASMOD) return(0); if ((dope&LEAF) == 0) p1 = tree->tr1; else p1 = tree; t1 = p1->type; d1 = dcalc(p1, nrleft); #ifdef DEBUG if (hdebug>100) printf("d1=%d\n",d1); #endif if ((dope&BINARY)!=0) { p2 = tree->tr2; t2 = p2->type; d2 = dcalc(p2, nrleft); #ifdef DEBUG if( hdebug>100) printf( "d2=%d\n", d2 ); #endif } for (; table->op!=op; table++) if (table->op==0) return(0); #ifdef DEBUG if (hdebug>100) printf("table->tabop=%d\n",table->op); #endif for (opt = table->tabp; opt->tabdeg1!=0; opt++) { #ifdef DEBUG if (hdebug>100) printf("opt->tabdeg1=%d\n",opt->tabdeg1); #endif if (opt->tabdeg1 >= 0100) { if (p1->op != STAR) { #ifdef DEBUG if (hdebug > 100) printf("p1->op=%d\n"); #endif continue; } /* else p1->op == STAR */ if ((i=dcalc(p1->tr1,nrleft)) > (opt->tabdeg1&077)) { #ifdef DEBUG if (hdebug > 100) printf("dcalc(p1->tr1)=%d, opt->tabdeg1&077=%d\n", i,(opt->tabdeg1&077)); #endif continue; } } if (d1 > opt->tabdeg1) continue; if (i=notcompat(p1, opt->tabtyp1)) { #ifdef DEBUG if (hdebug>100) printf("notcompat=%d\n",i); #endif continue; } if ((opdope[op]&BINARY)!=0 && p2!=0) { if (d2 > (opt->tabdeg2&077) || (opt->tabdeg2 >= 0100) && (p2->op != STAR) ) { #ifdef DEBUG if (hdebug > 100) printf("opt->tabdeg2=%d,p2->op=%d\n",opt->tabdeg2, p2->op); #endif continue; } if (i=notcompat(p2,opt->tabtyp2)) { #ifdef DEBUG if( hdebug>100 ) printf("notcompat2=%d\n", i); #endif continue; } } while (opt->tabstring == 0) opt++; return(opt); } return(0); } rcexpr(atree, atable, reg) struct tnode *atree; struct table *atable; { register r; register struct tnode *tree; register struct table *table; /* I assert that rcexpr should never be asked to compile anything into registers 0 or 1 */ if( reg < lowreg || reg>7 ){ error( "rcexper register error" ); return(lowreg); } table = atable; if((tree=atree)==0) return(99); switch (tree->op) { case CBRANCH: cbranch(tree->btree, tree->lbl, tree->cond, lowreg); return(99); case INIT: if (tree->tr1->op == AMPER) tree->tr1 = tree->tr1->tr1; if (tree->tr1->op!=NAME && tree->tr1->op!=CON && tree->tr1->op!=LCON) error("Illegal initialization"); else{ cexpr(tree, regtab, nreg); } return(99); case INIB: cexpr(tree, regtab, nreg); return(99); case EXCLA: if ((opdope[tree->tr1->op] & RELAT) != 0) { tree = tree->tr1; tree->op = notrel[tree->op - EQUAL]; } break; case RFORCE: if((r=rcexpr(tree->tr1, table, reg)) != 0) printf(" lr 0,%d\n", r); return(0); case TIMES: case ASTIMES: pow2(tree); } if ((r=cexpr(tree, table, reg))>=0) { return(r); } if (table!=regtab) if((r=cexpr(tree, regtab, reg))>=0) { if (table==cctab) { printf(" ltr %d,%d\n", r, r); } return(99); } error("No match for op %d", tree->op); return(lowreg); } # define SHARP 1 # define STAROP 2 int sdepth 0; cexpr(atree, table, areg) /* Compile an expression. */ struct tnode *atree; struct table *table; { int c, r; int tstat; /* status check for * and # operators */ register struct tnode *p, *p1, *tree; struct tnode *p2; char *string; int reg, reg1, rreg; char *opt; int tempoff; char cr; int sargs; /* amount stack has been moved for a function call * (not necessarily the same as the arg lengths */ /* I assert that reg is always between 2 and 9 */ /* the return value of this function is always -1, which means can7t be done 0, which means result in register 0 value is result register, >= reg >= 2 1 is never a legal return value The registers r satisfying 2<=r= 2 X is used if the result could come back into register 0 Register 1 can be freely used at all times by the code sequences */ if( areg < lowreg || areg > 7 ){ #ifdef DEBUG if (hdebug > 50) printf(2,"lowreg=%d, areg=%d\n", lowreg, areg); #endif error( "cexpr register error" ); return( lowreg ); } tstat = 0; tree = atree; reg = areg; p1 = tree->tr2; if ((c = tree->op)==CALL) { /* beware: comarg doesn't know about reg... */ if (tree->tr1->op == STAR) tree->tr1 = tree->tr1->tr1; else error("Compiler ftn call error"); if(tree->tr1->class == FORTRAN) ftern=YES; else ftern = NO; fflg = (fflg<<1) + ftern; r = 0; if(p1->op) { while (p1->op==COMMA) { r =+ (isfloat(p1->tr1) ? hgfloatsz : hgintsz ); p1 = p1->tr2; } r =+ (isfloat(p1) ? hgfloatsz : hgintsz); } p = hgoffs; hgoffs = 0; p1 = tree->tr2; sargs = r; if(r != 0) { if(sdepth++ == 0 && (sargs =- PREPUSH)<0) sargs = 0; if(sargs != 0) printf(" s SP,=f'%d'\n",sargs); /* now we really compile the arguments */ while(p1->op == COMMA) { comarg(p1->tr1); p1 = p1->tr2; } comarg(p1); } hgoffs = p; tree->op = MCALL; /* MCALL is a CALL with arguements already taken care of. */ tree->degree = r; /* save arg length */ fflg = fflg>>1; } if ((opdope[c]&RELAT||c==LOGAND||c==LOGOR||c==EXCLA) && table!=cctab) { cbranch(tree, c=isn++, 1, reg); rcexpr(&czero, table, reg); branch(isn); label(c); rcexpr(&cone, table, reg); label(isn++); return(reg); } if(c==QUEST) { if (table==cctab) return(-1); cbranch(tree->tr1, c=isn1++, 0, reg); rreg = rcexpr(p1->tr1, table, reg); branch(r=isn1++); label(c); reg = rcexpr(p1->tr2, table, reg); if (rreg!=reg) printf(" lr %d,%d\n", rreg, reg); reg = rreg; label(r); goto retrn; } reg = oddreg(tree, reg); reg1 = reg+1; if (chkleaf(tree, table, reg) >= 0) goto retrn; if ((opt=match(tree, table, nreg-reg))==0) return(-1); string = opt->tabstring; p1 = tree->tr1; p2 = 0; if (opdope[tree->op] & BINARY) p2 = tree->tr2; loop: switch(c = *string++) { case '\0': if (tree->op==MCALL) { if(tree->tr1->class==FORTRAN) ftern = YES; else ftern = NO; if (ftern==YES) { printf(" mvi %d(SP),x'80'\n",hgoffs-hgintsz); printf(" la 1,%d(SP)\n",hgoffs-tree->degree); printf(" la SP,%d(SP)\n",hgoffs); printf(" FCALL\n"); printf(" s SP,=f'%d'\n",hgoffs); } else { if(tree -> degree != 0) printf(" la 1,%d\n",tree->degree); else printf(" sr 1,1\n"); printf(" BCALL\n"); if(tree->degree != 0) { sdepth--; if(sargs != 0) printf(" la SP,%d(SP)\n",sargs); } } /* hgoffs =- tree->degree; */ reg = 0; } retrn: if( tstat != 0 && tstat != (SHARP+STAROP) )error( "compiler error; star without sharp" ); if (!isfloat(tree)) if (tree->op==DIVIDE || tree->op==ASDIV) reg++; if (tree->type == FLOAT || tree->type == DOUBLE) return(0); return(reg); /* A1 and A2 */ case 'A': if (*string++ == '1') p=p1; else p=p2; pname(p); goto loop; /* B1 B2 or BF */ case 'B': switch (*string++) { case 'F': p=tree; if (isfloat(p)) putchar('d'); goto loop; case '1': case '2': if (((opdope[tree->op]&LEAF) != 0 ) || (tree->op == STAR)) p=tree; else if (*(string-1) == '1') p=p1; else p=p2; } if (p->type == CHAR) putchar('c'); if (cr=isfloat(p)) putchar(cr); goto loop; /* C1 or C2 */ case 'C': if (*string++ == '1') p=p1->tr1; else p=p2->tr1; printf("%d",p); goto loop; /* F or FR */ case 'F': if (*string != 'R') { p=p1; goto subtre; } else { string++; goto breg; } case 'S': p=p2; goto subtre; case 'H': p=tree; subtre: c=((*string++)-'0')*8+((*string++)-'0'); if (c&01) { /* star operator */ if (p->op != STAR) error("compiler error; bad star entry"); p=p->tr1; tstat =| STAROP; if (collcon(p)) p = p->tr1; } if( c&02 ){ /* FS or SS or FS* or SS* */ /* compile, then simulate a store to temp */ /* this should appear before any other forms of F or S /* except other FS or SS forms */ /* This is legal only in the forms FS, SS, FS*, and SS* */ rreg = rcexpr( p, regtab, areg ); tempoff = autolen; autolen =+ 4; if( isfloat(p) ){ autolen =+ 4; /* floating point store here */ printf( "\tstd\t%d,%d(R12)\ttemp\n", flreg, tempoff ); } else { printf( "\tst\t%d,%d(R12)\ttemp\n", rreg, tempoff ); } goto loop; } if (c&010){ /* F2 or S2 */ r = reg1 + 1; goto csubtre; } if (c&4) /* F1 or S1 */ r = reg1; else if( c & 020 ) r = areg; /* we don't really care ! */ else r = reg; csubtre: rreg = rcexpr(p, regtab, r); if (c & 010) { if (rreg != r) { printf(" lr %d,%d\n", r, rreg); #ifdef DEBUG if (hdebug > 100) printf("010 matches\n"); #endif } goto loop; } if (c&4) reg1 = rreg; else if (rreg != reg) if (c&020) { /* we assert (through the X mechanism) that we are prepared to live with the result in a place where we did not expect it */ /* warning! don't use with mult, div, etc. */ reg = rreg; /* reg1 should never be used if this is done */ reg1 = 99; } else { if (tree->type != FLOAT && tree->type != DOUBLE) printf(" lr %d,%d\n", reg, rreg); #ifdef DEBUG if (hdebug > 100) printf("020 not recognized\n"); #endif } goto loop; /* Z */ case 'Z': if(isfloat(p)) breg: { r=flreg; if (*string == '2') { r =+ 2; string++; } goto preg; } /* R */ case 'R': switch (*string++) { case '-': r=reg-1; goto preg; case '+': r=reg+1; goto preg; case '1': r=reg1; goto preg; case '2': r=reg+2; string++; goto preg; default: r=reg; string--; preg: if (r>nreg) error("Register overflow: simplify expression"); printf("%d",r); goto loop; } /* end case R */ /* #1 or #2 */ case '#': if ((*string++) == '1') p=p1->tr1; else p=p2->tr1; goto nmbr; case '~': p=p1; nmbr: tstat =| SHARP; if (collcon(p)) printf("%d", p->tr2->value); else printf("0"); goto loop; /* Q */ case 'Q': p = p1->tr1; printf("%x", p); goto loop; /* O */ case 'O': wexpr(tree->op<50?tree->op:tree->op-30,tree); goto loop; /* T */ case 'T': printf("%d(R12) temp", tempoff); goto loop; } putchar(c); goto loop; } wexpr(operator,tree) /* part of cexpr moved to here because cexpr got to big */ struct tnode *tree; int operator; { switch(operator) { case INCAFT: case PLUS: printf("a"); break; case DECAFT: case MINUS: printf("s"); break; case AND: printf("n"); break; case OR: printf("o"); break; case EXOR: printf("x"); break; default: error("No match - binary op %d", tree->op); } } chkleaf(atree, table, reg) struct tnode *atree; { struct tnode lbuf; register struct tnode *tree; tree = atree; if (dcalc(tree, nreg-reg) > 12) return(-1); lbuf.op = LOAD; lbuf.type = tree->type; lbuf.degree = tree->degree; lbuf.tr1 = tree; return(cexpr(&lbuf, table, reg)); } comarg(atree) /* Compile an argument for a function call. */ { register struct tnode *tree; int r,t,l; tree = atree; t = isfloat(tree); if (tree->type==STRUCT) error("Illegal structure"); r = rcexpr(tree, regtab, lowreg); ftern = fflg & 1; if(ftern) { if (t) { printf(" std %d",flreg); l=hgfloatsz; } else { printf(" st %d",r); l=hgintsz; } printf(",%d(R12) conv args to ptrs for fortran\n",autolen); printf(" la %d,%d(R12)\n",r,autolen); autolen =+ l; } if((t) && (!ftern)) { printf(" std %d,%d(SP)\n", flreg, hgoffs); hgoffs =+ hgfloatsz; l=hgfloatsz; } else { printf(" st %d,%d(SP)\n",r, hgoffs); hgoffs =+ hgintsz; l=hgintsz; } return(l); } ure"); r = rcexpr(tree, regtab, lowreg); ftern = fflg & 1; if(ftern) { if (t) { printf(" std %d",flreg); l=hgfloatsz; } else { printf(" st %d",r); l=hgintsz; } printf(",%d(R12) conv args to ptrs for fortran\n",autolen); printf(" la %d,%# /* * C compiler */ #include "c0h.c" char *condop[] { "be", "bne", "bnh", "bl", "bnl", "bh", "bl", "bnh", "bh", "bnl", 0 }; max(a, b) /* returns max of a b. */ { if (a>b) return(a); return(b); } degree(at) struct tnode *at; { register struct tnode *t; if ((t=at)==0 || t->op==0) return(0); if (t->op == CON || t->op == LCON) return(-3); if (t->op == AMPER) return(-2); if ((opdope[t->op] & LEAF) != 0) return(0); return(t->degree); } pname(ap) /* Called by cexpr to print addresses. */ struct tnode *ap; { register i; register struct tnode *p; p = ap; if (p->op == STAR) p = p->tr1; loop: switch(p->op) { case SFCON: case FCON: printf("$%d",p->value); return; case CON: printf("=f'%d'", p->value); return; #ifdef unix case LCON: printf("=x'%04x%04x'",p->value->integ,p->value->integ2); return; #endif case NAME: if (i = p->offset) printf("%d+", i); switch(p->class) { case AUTO: if(p->nloc >= 0) printf("%d(R12)", p->nloc); else /* argument */ printf("ss$&fnum+%d(R12)",-1 - p->nloc); return; case EXTERN: printf("%.8s", &(p->nloc)); return; case FORTRAN: case GXTERN: printf("@%.7s", &(p->nloc)); return; case STRUCT: error("Illegal structure reference"); printf("$0"); return; case REG: if (i) error("Bad reg. reference"); printf("%d", p->nloc); return; } /* presumably, it's static */ printf("$%d", p->nloc); return; } error("pname called illegally"); } dcalc(ap, nrleft) /* Difficulty calculation - returns stuff like e, n, a, or whatever. */ struct tnode *ap; { register struct tnode *p; if ((p=ap)==0) return(0); switch (p->op) { case NAME: return(12); /* 12 => addressible. */ case SFCON: case FCON: return(12); case CON: return(p->value==0? 4:(p->value==1?5:((p->value >=0)&&(p->value <4096))?6:8)); #ifdef unix case LCON: return(8); #endif /* 4=>zero, 5=>one, 6=> 0<=x<4096, 8=>constant. */ } return(p->degree<=nrleft? 20: 24); /* 20 => easy, 24 => anything. */ } notcompat(ap, ast) /* check compatibility of types - eg int, char, or whatever. */ /* if tree is type float and tables say double, pretend tree is type double ... */ /* this is a mess and should be re-written */ struct tnode *ap; /* ftn returns 0 if compatible and 1 if not. */ { register at, st; register struct tnode *p; p = ap; at = p->type; /* actual type - of the object. */ st = ast; /* string type - type demanded by the code table. */ if ((at&07)==STRUCT) /* dmr said this shouldn't happen. */ at =& 077770; /* map to int */ if (st==0) /* word, byte */ return(at>1 & at<=07); /* compatible if at = 0 or 1, or if at > 7. */ if (st==1) /* word */ return(at>0 & at<=07); /* compatible if at is 0 or if at >7. */ st =- 2; if ((at&077740) != 0) at = 020; /* 020 is pointer to int. */ if ((at&077770) != 0) at = at&07 | 020; if (st==DOUBLE && at==FLOAT) at = DOUBLE; return(st != at); } collcon(ap) /* collect constant. */ struct tnode *ap; { register op; register struct tnode *p; p = ap; if(p->op==PLUS) { op = p->tr2->op; if ((op == CON) && (p->tr2->value >= 0) && (p->tr2->value < 4096)) return(1); } return(0); } isfloat(at) /* Is type float or double? */ struct tnode *at; { register struct tnode *t; t = at; if ((opdope[t->op]&RELAT)!=0) t = t->tr1; if (t->type == FLOAT) return('e'); if (t->type == DOUBLE) return('d'); return(0); } oddreg(t, areg) struct tnode *t; { register reg; reg = areg; if (!isfloat(t)) switch(t->op) { case DIVIDE: /* for / and % need even reg. */ case MOD: case ASDIV: case ASMOD: reg++; return(reg & 0776); case TIMES: /* for * need odd reg and empty even below it. */ case ASTIMES: reg++; return(reg|1); } return(reg); } char dirsw[] {" c r0,=f'%d'\n\ bh $%d\n\ lr r1,r0\n\ sll r1,2\n\ b *+4(r1)\n\ "}; pswitch(afp, alp) /* Generate code for a switch statement. */ struct swtab *afp, *alp; { int tlab, ncase, i, j, tabs, worst, best, range; int l1, l2, l3; register struct swtab *swpo, *fp, *lp; int poctab[swsiz]; fp = afp; lp = alp; if (fp==lp) { printf(" b $%d\n", deflab); return; } tlab = isn1++; if (sort(fp, lp)) return; ncase = lp-fp; lp--; range = lp->swval - fp->swval; /* direct switch */ if ((range>0 && range <= 3*ncase)) { if (fp->swval) printf(" s 0,=f'%d'\n", fp->swval); printf(dirsw, range, deflab); for (i=fp->swval; i<=lp->swval; i++) { if (i==fp->swval) { printf(" b $%d\n", fp->swlab); fp++; } else printf(" b $%d\n", deflab); } goto esw; } /* simple switch */ if( 1 || (ncase<8)) { for (; fp <= lp; fp++) { /* should distinguish half and full word literals */ printf (" c 0,=f'%d'\n",fp->swval); printf (" be $%d\n",fp->swlab); } printf (" b $%d\n",deflab); goto esw; } /* hash switch */ /* Hash switch is not currently supported. */ /* best = 077777; /* for (i=ncase/4; i<=ncase/2; i++) { /* for (j=0; jswval, i)]++; /* worst = 0; /* for (j=0; jworst) /* worst = poctab[j]; /* if (i*worst < best) { /* tabs = i; /* best = i*worst; /* } /* } /* printf("jsr pc,hswitch; 0%o; .+4; L%d\n", tabs, deflab); /* for (i=0; iswval, tabs) == i) { /* printf("2f\n.data\n2:\n"); /* for (; swpo<=lp; swpo++) /* if (lrem(0,swpo->swval,tabs)==i) /* printf("L%d;0%o\n", /* swpo->swlab, /* swpo->swval); /* printf("0\n.text\n"); /* goto break1; /* } /* } /* printf("0\n"); /*break1:; /* } */ esw: printf("* End of switch code.\n"); } sort(afp, alp) struct swtab *afp, *alp; { register struct swtab *bp, *fp, *lp; int intch, t; fp = afp; lp = alp; while (fp < --lp) { intch = 0; for (bp=fp; bpswval == bp[1].swval) { error("Duplicate case (%d)", bp->swval); return(1); } if (bp->swval > bp[1].swval) { intch++; t = bp->swval; bp->swval = bp[1].swval; bp[1].swval = t; t = bp->swlab; bp->swlab = bp[1].swlab; bp[1].swlab = t; } } if (intch==0) break; } return(0); } ispow2(atree) { register int d; register struct tnode *tree; tree = atree; if (!isfloat(tree) && tree->tr2->op==CON) { d = tree->tr2->value; if (d>0 && (d&(d-1))==0) return(d); } return(0); } pow2(atree) struct tnode *atree; { register int d, i; register struct tnode *tree; tree = atree; if (d = ispow2(tree)) { for (i=0; (d = d >> 1)!=0; i++); tree->tr2->value = i; d = tree->op; tree->op = ( d==TIMES? LSHIFT: ASLSH ); } } struct tconst czero { CON, INT, 0, 0}; struct tconst cone { CON, INT, 0, 1}; cbranch(atree, albl, cond, areg) struct tnode *atree; { int l1; register lbl, reg; register struct tnode *tree; struct tnode lbuf; lbl = albl; reg = areg; if ((tree=atree)==0) return; switch(tree->op) { case LOGAND: if (cond) { cbranch(tree->tr1, l1=isn1++, 0, reg); cbranch(tree->tr2, lbl, 1, reg); label(l1); } else { cbranch(tree->tr1, lbl, 0, reg); cbranch(tree->tr2, lbl, 0, reg); } return; case LOGOR: if (cond) { cbranch(tree->tr1, lbl, 1, reg); cbranch(tree->tr2, lbl, 1, reg); } else { cbranch(tree->tr1, l1=isn1++, 1, reg); cbranch(tree->tr2, lbl, 0, reg); label(l1); } return; case EXCLA: cbranch(tree->tr1, lbl, !cond, reg); return; } if ((opdope[tree->op]&RELAT)==0) { lbuf.op = NEQUAL; lbuf.type = tree->type; lbuf.degree = tree->degree; lbuf.tr1 = tree; lbuf.tr2 = &czero; tree = &lbuf; } rcexpr(tree, cctab, reg); branch1(lbl, tree->op, !cond); } branch1(lbl, aop, c) /* generate jump instruction for branching. */ { register op; if(op=aop) cbr(op,c); else printf("b"); printf(" $%d\n", lbl); } cbr(op, flag) { if (flag) op = notrel[op - EQUAL]; printf(" %s", condop[op - EQUAL]); } , !cond, reg); return; } if ((opdope[tree->op]&RELAT)==0) { lbuf.op = NEQUAL; lbuf.type = tree->type; lbuf.degree # /* C compiler (file - c12.c) Copyright 1972 Bell Telephone Laboratories, Inc. */ #include "c0h.c" #ifdef DEBUG extern int hdebug; #endif optim(atree) struct tnode *atree; { register op, dope; int d1, d2; struct tnode *t; register struct tnode *tree; if ((tree=atree)==0) return(0); op = tree->op; if (op==0) return(tree); dope = opdope[op]; if ((dope&LEAF) != 0) return(tree); if ((dope&BINARY) == 0) return(unoptim(tree)); /* is known to be binary */ if ((dope&COMMUTE)!=0) { acomm: d1 = tree->type; tree = acommute(tree); tree->type = d1; return(tree); } tree->tr1 = optim(tree->tr1); tree->tr2 = optim(tree->tr2); if ((dope&RELAT) != 0) if (degree(tree->tr1) < degree(tree->tr2)) { t = tree->tr1; tree->tr1 = tree->tr2; tree->tr2 = t; tree->op = maprel[op-EQUAL]; } d1 = max(degree(tree->tr1), 1); d2 = max(degree(tree->tr2), 0); #ifdef DEBUG if( hdebug > 100 ) printf( "optim(%o), op = %d, d1, d2 = %d, %d\n", tree, op, d1, d2 ); #endif switch (op) { case CALL: tree->degree = 10; break; case QUEST: case COLON: tree->degree = max(d1, d2); break; case MINUS: if (tree->tr2->op==CON) { /* const */ tree->op = PLUS; tree->tr2->value = -tree->tr2->value; goto acomm; } #ifdef unix if(tree->tr2->op==LCON) { tree->op = PLUS; tree->tr2->value->longint = -tree->tr2->value->longint; goto acomm; } #endif goto def; /* TIMES is handled in acommute */ case ASTIMES: if (ispow2(tree) == 0) { case DIVIDE: case ASDIV: case MOD: case ASMOD: d1 =+ 2; d2 =+ 2; } case LSHIFT: case RSHIFT: if (tree->tr1->op==CON && tree->tr2->op==CON) { const(op, &tree->tr1->value, tree->tr2->value); return(tree->tr1); } def: default: tree->degree = d1==d2? ++d1: max(d1, d2); break; } #ifdef DEBUG if( hdebug > 100 ) printf( " degree = %d\n", tree->degree ); #endif return(tree); } unoptim(atree) /* Unary optimization. */ struct tnode *atree; { register struct tnode *subtre, *tree; if ((tree=atree)==0) return(0); if (tree->op==CBRANCH) { tree->btree = optim(tree->btree); return(tree); } subtre = tree->tr1 = optim(tree->tr1); /* try to reduce * & */ if (tree->op==STAR && (subtre->op==AMPER)) return(subtre->tr1); if ((tree->op==AMPER) && (subtre->op==STAR)){ return(subtre->tr1); } if (subtre->op == CON) switch(tree->op) { case NEG: subtre->value = -subtre->value; return(subtre); case COMPL: subtre->value = ~subtre->value; return(subtre); } tree->degree = max(1, degree(subtre)); return(tree); } struct acl { int nextl; int nextn; struct tnode *nlist[20]; struct tnode *llist[21]; }; acommute(atree) { struct acl acl; int d, i, op, flt; register struct tnode *t1, **t2, *tree; struct tnode *t; acl.nextl = 0; acl.nextn = 0; tree = atree; op = tree->op; flt = isfloat(tree); insert(op, tree, &acl); acl.nextl--; if (!flt) { /* put constants together */ t2 = &acl.llist[acl.nextl]; for (i=acl.nextl;i>0&&t2[0]->op==CON&&t2[-1]->op==CON;i--) { acl.nextl--; t2--; const(op, &t2[0]->value, t2[1]->value); } } if (op==PLUS && !flt) { /* toss out "+0" */ if (acl.nextl>0 && (*t2)->op==CON && (*t2)->value==0) { acl.nextl--; t2--; } if (acl.nextl <= 0) return(*t2); /* subsume constant in "&x+c" */ if (t2[0]->op==CON && (t2[0]->value >= 0) && (t2[-1]->op==AMPER)) { t2--; t2[0]->tr1->offset =+ t2[1]->value; acl.nextl--; } } else if (op==TIMES) { t1 = acl.llist[acl.nextl]; if (t1->op==CON && t1->value==0) return(t1); } if (op==PLUS && !flt) distrib(&acl); tree = *(t2 = &acl.llist[0]); d = max(degree(tree), 1); if (op==TIMES && !flt) d++; for (i=0; itr2 = t = *++t2; t1->degree = d = degree(t)>=d? d+1:d; t1->tr1 = tree; tree = t1; } if (tree->op==TIMES && ispow2(tree)) tree->degree = max(degree(tree->tr1), 1); return(tree); } distrib(list) struct acl *list; { /* * Find a list member of the form c1c2*x such * that c1c2 divides no other such constant, is divided by * at least one other (say in the form c1*y), and which has * fewest divisors. Reduce this pair to c1*(y+c2*x) * and iterate until no reductions occur. */ register struct tnode **p1, **p2; struct tnode *t; int ndmaj, ndmin; struct tnode **dividend, **divisor; struct tnode **maxnod, **mindiv; loop: maxnod = &list->llist[list->nextl]; ndmaj = 1000; dividend = 0; for (p1 = list->llist; p1 <= maxnod; p1++) { if ((*p1)->op!=TIMES || (*p1)->tr2->op!=CON) continue; ndmin = 0; for (p2 = list->llist; p2 <= maxnod; p2++) { if (p1==p2 || (*p2)->op!=TIMES || (*p2)->tr2->op!=CON) continue; if ((*p1)->tr2->value == (*p2)->tr2->value) { (*p2)->tr2 = (*p1)->tr1; (*p2)->op = PLUS; (*p1)->tr1 = (*p2); *p1 = optim(*p1); squash(p2, maxnod); list->nextl--; goto loop; } if (((*p2)->tr2->value % (*p1)->tr2->value) == 0) goto contmaj; if (((*p1)->tr2->value % (*p2)->tr2->value) == 0) { ndmin++; mindiv = p2; } } if (ndmin > 0 && ndmin < ndmaj) { ndmaj = ndmin; dividend = p1; divisor = mindiv; } contmaj:; } if (dividend==0) return; t = list->nlist[--list->nextn]; p1 = dividend; p2 = divisor; t->op = PLUS; t->type = (*p1)->type; t->tr1 = (*p1); t->tr2 = (*p2)->tr1; (*p1)->tr2->value = (*p1)->tr2->value / (*p2)->tr2->value; (*p2)->tr1 = t; t = optim(*p2); if (p1 < p2) { *p1 = t; squash(p2, maxnod); list->nextl--; goto loop; } *p2 = t; squash(p1, maxnod); list->nextl--; goto loop; } squash(p, maxp) struct tnode **p, **maxp; { register struct tnode **np; for (np = p; np < maxp; np++) *np = *(np+1); } const(op, vp, av) int *vp; { register int v; v = av; switch (op) { case PLUS: *vp =+ v; return; case TIMES: *vp = *vp * v; return; case AND: *vp =& v; return; case OR: *vp =| v; return; case EXOR: *vp =^ v; return; case DIVIDE: case MOD: if (v==0) error("Divide check"); else if (op==DIVIDE) *vp = *vp / v; else *vp = *vp % v; return; case RSHIFT: *vp = *vp >> v; return; case LSHIFT: *vp = *vp << v; return; } error("C error: const"); } insert(op, atree, alist) struct acl *alist; { register d; register struct acl *list; register struct tnode *tree; int d1, i; struct tnode *t; tree = atree; list = alist; if (tree->op == op) { ins: list->nlist[list->nextn++] = tree; insert(op, tree->tr1, list); insert(op, tree->tr2, list); return; } tree = optim(tree); if (tree->op == op) goto ins; if (!isfloat(tree)) { /* c1*(x+c2) -> c1*x+c1*c2 */ if ((tree->op==TIMES||tree->op==LSHIFT) && tree->tr2->op==CON && tree->tr1->op==PLUS && tree->tr1->tr2->op==CON) { d = tree->tr2->value; if (tree->op==TIMES) tree->tr2->value = tree->tr2->value * tree->tr1->tr2->value; else tree->tr2->value = tree->tr1->tr2->value << d; tree->tr1->tr2->value = d; tree->tr1->op = tree->op; tree->op = PLUS; if (op==PLUS) goto ins; } } d = degree(tree); for (i=0; inextl; i++) { if ((d1=degree(list->llist[i]))llist[i]; list->llist[i] = tree; tree = t; d = d1; } } list->llist[list->nextl++] = tree; } ->op==CON) { d = tree->tr2->value; if (tree->op==TIMES) tree->tr2->value = tree->tr2->value * tree->tr1->tr2->value; else tree->tr2->value = tree->tr1->tr2->value << d; tree->tr1->tr2->value = d; tree->tr1->op = tree->op; tree->op = PLUS; if (op==PLUS) goto ins; } } d = degree(tree); for (i=0; inextl; i++) { if ((d1=degree(list->llist[i]# struct optab { int tabdeg1; int tabtyp1; int tabdeg2; int tabtyp2; char *tabstring; }; struct table { int tabop; struct optab *tabp; }; struct optab regtabop[] { # define cr104 ®tabop[0] 8,0, 63,0, "\tdc\tf'C1'\n", 16,0, 63,0, 0, 16,5, 63,0, "\tdc\ta(A1)\n", 0,0,0,0,0, # define cr107 ®tabop[4] 8,0, 63,0, "\tdc\tx'Q'\n", 0,0,0,0,0, # define cr102 ®tabop[6] 16,0, 63,0, "\tb\tA1\n", 127,0, 63,0, "F01\tb\t#1(R)\n", 0,0,0,0,0, # define cr100 ®tabop[9] 16,0, 63,0, 0, 16,0, 63,5, "\tlfunc\t15,A1\n", 63,0, 63,0, 0, 63,0, 63,5, "F20\tlr\t15,R\n", 0,0,0,0,0, # define cr106 ®tabop[14] 4,0, 63,0, "\tsr\tR,R\n", 16,3, 63,0, "\tsr\tR,R\n\tic\tR,A1\n", 16,0, 63,0, "\tl\tR,A1\n", 16,4, 63,0, "\tsdr\tFR,FR\n\tle\tFR,A1\n", 16,5, 63,0, "\tld\tFR,A1\n", 0,0,0,0,0, # define cr32 ®tabop[20] 16,0, 63,0, 0, 16,3, 63,0, "\tlB1\tR,A1\n\tlr\t0,R\n\tO\t0,A2\n\tstB1\t0,A1\n", 84,0, 63,0, 0, 84,3, 63,0, "F01\tlB1\t0,#1(R)\n\tlr\t1,0\n\tO\t1,A2\n\tstB1\t1,#1(R)\n\tlr\tR,0\n", 127,0, 63,0, "F01\tlr\t1,R\n\tlB1\tR,#1(1)\n\tlr\t0,R\n\tO\t0,A2\n\tstB1\t0,#1(1)\n", 0,0,0,0,0, # define cr35 ®tabop[26] 16,0, 63,0, 0, 16,4, 63,0, "\tla\tR,A1\n", 0,0,0,0,0, # define cr36 ®tabop[29] 16,18, 63,0, 0, 16,19, 63,0, "\tl\t1,A1\n\tlB1\tR,0(1)\n", 63,19, 63,0, "H01\tsr\t1,1\n\tic\t1,~(R)\n\tlr\tR,1\n", 63,20, 63,0, "H01\tsdr\tFR,FR\n\tle\tFR,~(R)\n", 63,0, 63,0, 0, 63,21, 63,0, "H01\tlBF\tZ,~(R)\n", 0,0,0,0,0, # define cr37 ®tabop[36] 63,0, 63,0, 0, 63,5, 63,0, "F20\tlcBFr\tZ,Z\n", 0,0,0,0,0, # define cr38 ®tabop[39] 63,0, 63,0, "F20\tx\tR,=x'ffffffff'\n", 0,0,0,0,0, # define cr80 ®tabop[41] 16,0, 63,0, 0, 16,5, 63,5, "S20\tstB1\tZ,A1\n", 80,0, 63,0, "S20\tl\t1,A1\n\tstB1\tR,0(1)\n", 16,0, 63,5, "S20\tmovfi\tFR,R\n\tstB1\tR,A1\n", 84,0, 63,5, "S00F05\tmovfi\tFR,R\n\tstB1\tR,#1(R1)\n", 127,0, 63,5, "F03S00\tmovfi\tFR,R\n\tstB1\tR1,#1(R)\n\tlr\tR,R1\n", 127,0, 20,0, "F01S04\tstB1\tR1,#1(R)\n\tlr\tR,R1\n", 127,0, 63,0, 0, 127,5, 63,5, "F03S20\tl\t1,T\n\tstB1\tZ,#1(1)\n", 0,0,0,0,0, # define cr45 ®tabop[51] 63,0, 4,0, "F20", 63,0, 8,0, "F20\tsrl\tR,C2\n", 63,0, 20,0, "F00S04\tsrl\tR,0(R1)\n", 63,0, 63,0, "S02F20\tl\t1,T\n\tsrl\tR,0(1)\n", 0,0,0,0,0, # define cr46 ®tabop[56] 63,0, 4,0, "F20", 63,0, 8,0, "F20\tsll\tR,C2\n", 63,0, 20,0, "F00S04\tsll\tR,0(R1)\n", 63,0, 63,0, "S02F20\tl\t1,T\n\tsll\tR,0(1)\n", 0,0,0,0,0, # define cr40 ®tabop[61] 63,0, 4,0, "F00", 63,0, 16,1, 0, 63,5, 16,5, "F20\tOB2\tZ,A2\n", 63,0, 84,1, "F00S05\tOB2\tZ,#2(R1)\n", 63,0, 20,0, "F00S04\tOr\tR,R1\n", 63,0, 63,0, 0, 63,5, 63,5, "S02F20\tOBF\tZ,T\n", 0,0,0,0,0, # define cr47 ®tabop[69] 63,0, 4,0, "\tsr\tR,R\n", 63,0, 16,1, "F00\tn\tR,A2\n", 63,0, 84,1, "F00S05\tn\tR,#2(R1)\n", 63,0, 20,0, "F00S04\tnr\tR,R1\n", 63,0, 63,0, "S02F00\tn\tR,T\n", 0,0,0,0,0, # define cr42 ®tabop[75] 63,0, 16,1, "F00\tm\tR-,A2\n", 63,0, 84,1, "F00S05\tm\tR-,#2(R1)\n", 63,0, 20,0, "F00S04\tmr\tR-,R1\n", 63,0, 63,0, "S02F00\tm\tR-,T\n", 63,5, 16,5, "F00\tmB2\tFR,A2\n", 63,5, 63,5, "S02F00\tmd\tFR,T\n", 0,0,0,0,0, # define cr43 ®tabop[82] 63,0, 16,1, "F00\tsrda\tR,32\n\td\tR,A2\n", 63,0, 84,1, "F00S05\tl\t0,#2(R1)\n\tsrda\tR,32\n\tdr\tR,0\n", 63,0, 20,0, "F00S04\tlr\t0,R1\n\tsrda\tR,32\n\tdr\tR,0\n", 63,0, 63,0, "S02F00\tsrda\tR,32\n\td\tR,T\n", 63,5, 16,5, "F00\tdB2\tFR,A2\n", 63,5, 63,5, "S02F00\tdBF\tFR,T\n", 0,0,0,0,0, # define cr72 ®tabop[89] 16,3, 63,0, "S00\tsr\t0,0\n\tic\t0,A1\n\tmr\tR-,0\n\tstc\tR,A1\n", 16,0, 63,0, "S00\tm\tR-,A1\n\tst\tR,A1\n", 84,3, 63,0, "S00F05\tsr\t0,0\n\tic\t0,#1(R1)\n\tmr\tR-,0\n\tstc\tR,#1(R1)\n", 84,0, 63,0, "S00F05\tm\tR-,#1(R1)\n\tst\tR,#1(R1)\n", 127,3, 63,0, "F03S00\tl\t1,T\n\tsr\t0,0\n\tic\t0,#1(1)\n\tmr\tR-,0\n\tstc\tR,#1(1)\n", 127,0, 63,0, "F03S00\tl\t1,T\n\tm\tR-,#1(1)\n\tst\tR,#1(1)\n", 16,5, 16,5, "F00\tmB2\tFR,A2\n\tstB1\tFR,A1\n", 16,5, 63,5, "S02F00\tmd\tFR,T\n\tstB1\tFR,A1\n", 127,5, 16,5, "F01\tlB1\tFR,#1(R)\n\tmB2\tFR,A2\n\tstB1\tFR,#1(R)\n", 127,5, 63,5, "S02F01\tlB1\tFR,#1(R)\n\tmd\tFR,T\n\tstB1\tFR,#1(R)\n", 0,0,0,0,0, # define cr73 ®tabop[100] 16,3, 63,0, 0, 16,0, 63,0, "S00\tlB1\t0,A1\n\tsrda\t0,32\n\tdr\t0,R\n \tstB1\t1,A1\n\tlr\tR+,1\n", 84,3, 63,0, 0, 84,0, 63,0, "S00F05\tlB1\t0,#1(R1)\n\tsrda\t0,32\n\tdr\t0,R\n\tstB1\t1,#1(R1)\n\tlr\tR+,1\n", 127,0, 63,0, "S02F01\tlB1\t0,#1(R)\n\tsrda\t0,32\n\td\t0,T\n\tstB1\t1,#1(R)\n\tlr\tR+,1\n", 16,5, 16,5, "F00\tdB2\tFR,A2\n\tstB1\tFR,A1\n", 16,5, 63,5, "S02F00\tdd\tFR,T\n\tstB1\tFR,A1\n", 127,5, 16,5, "F01\tlB1\tFR,#1(R)\n\tmB2\tFR,A2\n\tstB1\tFR,#1(R)\n", 127,5, 63,5, "S02F01\tlB1\tFR,#1(R)\n\tdd\tFR,T\n\tstB1\tFR,#1(R)\n", 0,0,0,0,0, # define cr74 ®tabop[110] 16,3, 63,0, 0, 16,0, 63,0, "S00\tlB1\t0,A1\n\tsrda\t0,32\n\tdr\t0,R\n\tstB1\t0,A1\n\tlr\tR,0\n", 84,3, 63,0, 0, 84,0, 63,0, "S00F05\tlB1\t0,#1(R1)\n\tsrda\t0,32\n\tdr\t0,R\n\tstB1\t0,#1(R1)\n\tlr\tR,0\n", 127,0, 63,0, "S02F01\tlB1\t0,#1(R)\n\tsrda\t0,32\n\td\t0,T\n\tstB1\t0,#1(R)\n\tlr\tR,0\n", 0,0,0,0,0, # define cr75 ®tabop[116] 16,0, 8,0, "\tlB1\tR,A1\n\tsrl\tR,C2\n\tstB1\tR,A1\n", 16,0, 63,0, "S00\tlB1\t1,A1\n\tsrl\t1,0(R)\n\tstB1\t1,A1\n\tlr\tR,1\n", 127,0, 8,0, "F01\tlB1\t1,#1(R)\n\tsrl\t1,C2\n\tstB1\t1,#1(R)\n\tlr\tR,1\n", 84,0, 63,0, "S00F05\tlB1\t1,#1(R1)\n\tsrl\t1,0(R)\n\tstB1\t1,#1(R1)\n\tlr\tR,1\n", 127,0, 63,0, "S02F01\tlB1\t0,#1(R)\n\tl\t1,T\n\tsrl\t0,0(1)\n\tstB1\t0,#1(R)\n\tlr\tR,0\n", 0,0,0,0,0, # define cr76 ®tabop[122] 16,0, 8,0, "\tlB1\tR,A1\n\tsll\tR,C2\n\tstB1\tR,A1\n", 16,0, 63,0, "S00\tlB1\t1,A1\n\tsll\t1,0(R)\n\tstB1\t1,A1\n\tlr\tR,1\n", 127,0, 8,0, "F01\tlB1\t1,#1(R)\n\tsll\t1,C2\n\tstB1\t1,#1(R)\n\tlr\tR,1\n", 84,0, 63,0, "S00F05\tlB1\t1,#1(R1)\n\tsll\t1,0(R)\n\tstB1\t1,#1(R1)\n\tlr\tR,1\n", 127,0, 63,0, "S02F01\tlB1\t0,#1(R)\n\tl\t1,T\n\tsll\t0,0(1)\n\tstB1\t0,#1(R)\n\tlr\tR,0\n", 0,0,0,0,0, # define cr70 ®tabop[128] 16,3, 63,0, "S20\tsr\t1,1\n\tic\t1,A1\n\tOr\tR,1\n\tstc\tR,A1\n", 16,0, 63,0, 0, 16,5, 63,5, "S20\tOB1\tZ,A1\n\tstB1\tZ,A1\n", 84,3, 16,1, 0, 84,0, 16,1, "F01\tlB1\t0,#1(R)\n\tO\t0,A2\n\tstB1\t0,#1(R)\n\tlr\tR,0\n", 84,3, 63,0, "S00F05\tsr\t0,0\n\tic\t0,#1(R1)\n\tOr\tR,0\n\tstc\tR,#1(R1)\n", 84,0, 63,0, "S00F05\tO\tR,#1(R1)\n\tst\tR,#1(R1)\n", 127,0, 16,1, "F21\tlr\t1,R\n\tlB1\tR,#1(1)\n\tO\tR,A2\n\tstB1\tR,#1(1)\n", 127,3, 63,0, "F03S00\tl\t1,T\n\tsr\t0,0\n\tic\t0,#1(1)\n\tOr\tR,0\n\tstc\tR,#1(1)\n", 127,0, 63,0, "F03S20\tl\t1,T\n\tO\tR,#1(1)\n\tst\tR,#1(1)\n", 127,5, 16,5, "F01\tl\tFR,#1(R)\n\taB2\tFR,A2\n\tstB1\tFR,#1(R)\n", 127,5, 63,5, "S02F01\tl\tFR,#1(R)\n\tad\tFR,T\n\tstB1\tFR,#1(R)\n", 0,0,0,0,0, # define cr71 ®tabop[141] 16,3, 63,0, "S20\tsr\t1,1\n\tic\t1,A1\n\tOr\tR,1\n\tlcr\tR,R\n\tstc\tR,A1\n", 16,0, 16,1, "\tl\tR,A1\n\tO\tR,A2\n\tst\tR,A1\n", 16,0, 63,0, 0, 16,5, 63,5, "S20\tOB1\tZ,A1\n\tlcBFr\tZ,Z\n\tstB1\tZ,A1\n", 84,3, 16,1, "F01\tsr\t0,0\n\tic\t0,#1(R)\n\tO\t0,A2\n\tstc\t0,#1(R)\n\tlr\tR,0\n", 84,3, 63,0, "S00F05\tsr\t0,0\n\tic\t0,#1(R1)\n\tOr\t0,R\n\tstc\t0,#1(R1)\n\tlr\tR,0\n", 84,0, 16,1, "F01\tl\t0,#1(R)\n\tO\t0,A2\n\tst\t0,#1(R)\n\tlr\tR,0\n", 84,0, 63,0, "S00F05\tO\tR,#1(R1)\n\tlcr\tR,R\n\tst\tR,#1(R1)\n", 127,3, 16,1, "F21\tlr\t1,R\n\tsr\tR,R\n\tic\tR,#1(1)\n\tO\tR,A2\n\tstc\tR,#1(1)\n", 127,3, 63,0, "F03S00\tl\t1,T\n\tsr\t0,0\n\tic\t0,#1(1)\n\tOr\t0,R\n\tstc\t0,#1(1)\n\tlr\tR,0\n", 127,0, 16,1, "F21\tlr\t1,R\n\tl\tR,#1(1)\n\tO\tR,A2\n\tst\tR,#1(1)\n", 127,0, 63,0, "F03S20\tl\t1,T\n\tOr\tR,#1(1)\n\tlcr\tR,R\n\tst\tR,#1(1)\n", 127,5, 16,5, "F01\tlB1\tFR,#1(R)\n\tsB2\tFR,A2\n\tstB1\tFR,#1(R)\n", 127,5, 63,5, "S02F01\tlB1\tFR,#1(R)\n\tsd\tFR,T\n\tstB1\tFR,#1(R)\n", 0,0,0,0,0, # define cr51 ®tabop[156] 16,0, 63,0, "\tl\tR,A1\n\tmovif\tFR,R\n", 127,0, 63,0, "F01\tl\tR,#1(R)\n\tmovif\tFR,R\n", 63,0, 63,0, "F20\tmovif\tFR,R\n", 0,0,0,0,0, # define cr52 ®tabop[160] 63,5, 63,0, "F20\tmovfi\tFR,R\n", 0,0,0,0,0}; struct table regtab[] { 106, cr106, 32, cr32, 33, cr32, 35, cr35, 36, cr36, 37, cr37, 38, cr38, 101, cr100, 80, cr80, 40, cr40, 41, cr40, 42, cr42, 43, cr43, 44, cr43, 45, cr45, 46, cr46, 47, cr47, 48, cr40, 49, cr40, 70, cr70, 71, cr71, 72, cr72, 73, cr73, 74, cr74, 75, cr75, 76, cr76, 77, cr70, 78, cr70, 79, cr70, 102, cr102, 51, cr51, 52, cr52, 104, cr104, 107, cr107, 0, 0, }; [160] 63,5, 63,0, "F20\tmovfi\tFR,R\n", 0,0,0,0,0}; struct table regtab[] { 106, cr106, 32, cr32, 33, cr32, 35, cr35, 36, cr3# struct optab { int tabdeg1; int tabtyp1; int tabdeg2; int tabtyp2; char *tabstring; }; struct table { int tabop; struct optab *tabp; }; struct optab cctabop[] { # define cc60 &cctabop[0] 63,0, 4,0, 0, 63,4, 4,0, 0, 63,5, 4,0, 0, 63,4, 4,4, 0, 63,5, 4,5, "F20\tltBFr\tZ,Z\n", 63,0, 16,1, 0, 63,4, 16,5, 0, 63,5, 16,5, "F20\tcBF\tZ,A2\n", 63,0, 84,1, 0, 63,4, 84,4, 0, 63,4, 84,5, "F00S05\tcBF\tZ,#2(R1)\n", 63,0, 20,0, "F00S04\tcr\tR,R1\n", 63,0, 63,0, 0, 63,4, 63,4, 0, 63,4, 20,4, 0, 63,5, 20,5, 0, 63,5, 63,5, "S02F20\tcBF\tZ,T\n", 0,0,0,0,0, # define rest &cctabop[18] 63,0, 63,0, 0, 63,4, 63,4, "H00", 0,0,0,0,0}; struct table cctab[] { 60, cc60, 61, cc60, 62, cc60, 63, cc60, 64, cc60, 65, cc60, 66, cc60, 67, cc60, 68, cc60, 69, cc60, 0, 0, }; ,4, 16,5, 0, 63,5, 16,5, "F20\tcBF\tZ,A2\n", 63,0, 84,1, 0, 63,4, 84,4, 0, 63,4, 84,5, "F00S05\tcBF\tZ,#2(R1)\n", 63,0, 20,0, "F00S04\tcr\tR,R1\n", 63,0, 63,0, 0, 63,4, 63,4, 0,# include "prh.c" /* ibm preprocessor */ /* modified 2/26/76 u370 */ extern int cin, cout; int ppeekc; int inlno; int lno1; int lno2; int instring; int exfail; int infil; int f1; int f2 -1; int depth; char *lp; char *ppline; int lineno; struct symtab *symtab; extern struct symtab stab[]; struct symtab *defloc; struct symtab *incloc; struct symtab *eifloc; struct symtab *ifdloc; struct symtab *ifnloc; struct symtab *locsys; int trulvl; int flslvl; char *stringbuf; char ln [512]; extern char sbf[]; main(argc, argv) char **argv; { if( argc==0 ){ /* we are in bfor situation */ cout = copen( "**2", 'w' ); expand( "*S*" ); } else if( argc >= 3 ){ cout = copen( argv[2], 'w' ); expand( argv[1] ); } else if(argc == 1){ expand(0); } else { perror( "Arg count" ); } if( exfail ) cexit(1); cexit(); } expand(file) char *file; { register int c; register char *rlp; if(file){ if ((infil = f1 = copen(file, 'r')) < 0) { perror("Can't find %s", file); return; } } else infil = f1 = 0; symtab = stab; for (c=0; c='0' && ppeekc<='9' ) ++lno1; ungetc(ppeekc,infil); inlno = lno1; while(getline()) { if ( infil==f2 ) cputc(001, cout); /*SOH: insert */ if (ln[0] != '#' && flslvl ==0) for (rlp = ppline; c = *rlp++;) cputc(c, cout); cputc('\n', cout); } cclose(f1); } getline() { register int c, sc, state; struct symtab *np; char *namep, *filname; if (infil==f1) lineno++; depth=0; lp = ppline; *lp = '\0'; state = 0; c = getch(); if( inlno ){ /* delete line number */ while( c>='0' && c<='9' ) c = getch(); if( c == '#' ) c = getch(); } if (c == '#') state = 1; while (c!='\n' && c!='\0') { if (alpha(c) || c == '_') { namep = lp; sch(c); while (alpha(c=getch()) ||'0'<=c && c<='9' ||c=='_') sch(c); sch('\0'); lp--; if (state>3) { if (flslvl==0 &&(state+!plookup(namep,0)->name[0])==5) trulvl++; else flslvl++; out: while (c!='\n' && c!= '\0') c = getch(); return(c); } if (state!=2 || flslvl==0) { ungetc(c,infil); /* hide possible '(' after name */ np = plookup(namep, state); c = getch(); } if (state==1) { if (np==defloc) state = 2; else if (np==incloc) state = 3; else if (np==ifnloc) state = 4; else if (np==ifdloc) state = 5; else if (np==eifloc) { if (flslvl) --flslvl; else if (trulvl) --trulvl; else perror("If-less endif"); goto out; } else { perror("Undefined control"); while (c!='\n' && c!='\0') c = getch(); return(c); } } else if (state==2) { if (flslvl) goto out; np->value = stringbuf; ungetc(c,infil); while ((c=getch())!='\n' && c!='\0') { if(c == '#') prochex(); else savch(c); } savch('\0'); trimsav(); return(1); } continue; } else if ((sc=c)=='\'' || sc=='"') { sch(sc); filname = lp; instring++; while ((c=getch())!=sc && c!='\n' && c!='\0') { sch(c); if (c=='\\') sch(getch()); } instring = 0; if (flslvl) goto out; if (state==3) { *lp = '\0'; while ((c=getch())!='\n' && c!='\0'); if (infil==f2) perror("Nested 'include'"); if ((f2 = copen(filname, 'r'))<0) perror("Missing file %s", filname); else { infil = f2; lno2 = 0; if( (ppeekc = getch() ) >= '0' && ppeekc<='9' ) ++lno2; ungetc(ppeekc,infil); inlno = lno2; } return(c); } } sch(c); c = getch(); } sch('\0'); if (state>1) perror("Control syntax"); return(c); } insym (sp, namep) struct symtab **sp; char *namep; { register struct symtab *np; *sp = np = plookup(namep, 1); np->value = np->name; } perror(s, x) { printf( 2, "*F* %d: ", lineno); printf( 2, s, x); printf( 2, "\n"); exfail++; } sch(c) { register char *rlp; rlp = lp; if (rlp==ppline+510) perror("Line overflow"); *rlp++ = c; if (rlp>ppline+511) rlp = ppline+511; lp = rlp; } savch(c) { *stringbuf++ = c; if (stringbuf-sbf sbf) *--stringbuf = '\0'; stringbuf++; } getch() { register int c; loop: if ((c=getc1())=='/' && !instring) { if ((c=getc1())!='*') { ungetc(c,infil); return('/'); } for(;;) { c = getc1(); cloop: switch (c) { case '\0': return('\0'); case '*': if ((c=getc1())=='/') goto loop; goto cloop; case '\n': if (infil==f1) { cputc('\n', cout); lineno++; } depth=0; continue; } } } return(c); } getc1() { register c; if ((c = cgetc(infil)) <= 0 && infil==f2) { cclose(f2); infil = f1; inlno = lno1; cputc('\n', cout); c = getc1(); } if (c<0) return(0); return(c); } plookup(namep, enterf) char *namep; { register char *np, *snp; register struct symtab *sp; int i, c, around; np = namep; around = i = 0; while (c = *np++) i =+ c; i = i % symsiz; sp = &symtab[i]; while (sp->name[0]) { snp = sp; np = namep; while (*snp++ == *np) if (*np++ == '\0' || np==namep+8) { if (!enterf) subst(namep, sp); return(sp); } if (++sp >= &symtab[symsiz]) if (around++) { perror("too many defines"); cexit(1); } else sp = symtab; } if (enterf) { snp = namep; for (np = &sp->name[0]; np < &sp->name[8];) if (*np++ = *snp) snp++; } return(sp); } char revbuff[200], *bp; backsch(c) { if (bp-revbuff > 200) perror("Excessive define looping", bp--); *bp++ = c; } subst(np, sp) char *np; struct symtab *sp; { register char *vp; lp = np; bp = revbuff; if (depth++>100) { perror("define recursion loop\n"); return; } if ((vp = sp->value) == 0) return; /* arrange that define unix unix still has no effect, avoiding rescanning */ if (streq(sp->name,sp->value)) { while (*vp) sch(*vp++); return; } backsch(' '); if (*vp == '(') expdef(vp); else while (*vp) backsch(*vp++); backsch(' '); while (bp>revbuff) ungetc(*--bp, infil); } expdef(proto) char *proto; { char buffer[100], *parg[20], *pval[20], name[20], *cspace, *wp; char protcop[100], *pr; int narg, k, i, c; pr = protcop; while (*pr++ = *proto++); proto= protcop; for (narg=0; (parg[narg] = token(&proto)) != 0; narg++) ; /* now scan input */ cspace = buffer; if ((c=getch()) == ' ') while ((c=getch()) == ' '); ungetc(c,infil); for(k=0; pval[k] = coptok(&cspace); k++); if (k!=narg) perror("define argument mismatch"); while (c= *proto++) { if (!letter(c)) sch(c); else { wp = name; *wp++ = c; while (letnum(*proto)) *wp++ = *proto++; *wp = 0; for (k=0; k 0) { if (stc == '\0') { perror ("non terminated macro call"); val=0; break; } if (stc == '"' || stc == '\'') { stop = stc; if (stop == '\'') *(*cpp)++ = '\''; while ( (stc = getch()) != stop) { if (stc == '\n' || stc == '0') { perror ("non-terminated string"); break; } if (stc == '\\') if ((stc= getch()) != stop && stc != '\\') *(*cpp)++ = '\\'; *(*cpp)++ = stc; } if (stop = '\'') *(*cpp)++ = '\''; } else if (stc == '\\') { stc = getch(); if (stc != '"' && stc != '\\') *(*cpp)++ = '\\'; *(*cpp)++ = stc; } else { *(*cpp)++ = stc; if (stc== '(') paren++; if (stc == ')') paren--; } } *(*cpp)++ = 0; ungetc(stc,infil); return(val); } letter(c) { if (alpha(c) || (c == '_')) return (1); else return(0); } letnum(c) { if (letter(c) || (c >= '0' && c <= '9')) return(1); else return(0); } streq(s,t) char *s, *t; { int c; while ( (c= *s++) == *t++) if (c==0) return(1); return(0); } alpha(c) { switch(c) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': return(1); } return(0); } #ifndef unix #define long int #endif prochex() { long ll; register c; ll = 0; while((c = getch()) != '\n' && c != '\0' && ((c >= '0' && c <= '9') || ((c) >= 'a' && c<='f'))) ll = (ll<<4) + (c< 'a' ? c - '0' : c - 'a' + 10); putoct(ll); ungetc(c,infil); } #define OSIGN 034000000000 putoct(lll) long lll; { #ifdef unix register i; long llt; struct {int integ;}; if(lll) { llt = lll>>3; llt.integ =& ~0160000; putoct(llt); i = lll; savch('0' + (i & 07)); #endif #ifndef unix if(lll) { putoct((lll>>3) & ~OSIGN); savch('0' + (lll&07)); #endif } else savch('0'); } while((c = getch()) != '\n' && c != '\0' && ((c >= '0' && c <= '9') || ((c) >= 'a' && c<='f'))) ll = (ll<<4) + (c< 'a' ? c - * macros for C language routines * * macro bcall balr 14,15 mend * macro fcall balr 14,15 mend * macro mainloc $main csect mend * macro codeloc gblc &sec &sec.c csect mend * macro dataloc gblc &sec &sec.p csect mend * macro strgloc gblc &sec &sec.p csect mend * macro istrloc gblc &sec &sec.s csect mend macro litloc gblc &sec &sec.p csect mend * macro tvecloc gblc &sec &sec.p csect mend * macro &loc intaddr &name gblc &sec cnop 0,4 &loc equ * dc a(&name) mend * macro &loc intfunc &name gblc &sec cnop 0,4 &loc equ * dc a(&name) mend * macro &loc extaddr &name cnop 0,4 &loc equ * dc v(&name) mend * macro &loc extfunc &name cnop 0,4 &loc equ * dc v(&name) mend macro &name startup gbla &fnum &fnum seta 1 gblc &sec &sec setc '&name' &sec.c csect &sec.p csect &sec.c csect * Register usage * hgautop equ 12 R12 equ 12 hgargp equ 13 SP equ 13 $base1 equ 10 $base2 equ 11 $base3 equ 9 $base4 equ 8 mend * * macro subsave gblc &sec mainloc stm 14,12,12(13) lr $base1,15 using $main$,$base1 l $base2,72(13) using &sec.p,$base2 la $base3,stack$ st 13,4($base3) la 13,20($base3) mend * * * macro subretrn &cc=0 l 15,b$cexit ltr 15,15 be return$ la 1,0 lfunc 15,b$cexit bcall return$ l 13,stack$+4 lm 14,12,12(13) la 15,0 br 14 b$cexit dc f'0' mend * macro stackdo dc c'stack' stack$ dc 1000f'0' entry stack$ dc c'end stack' mend * * * * macro &name prolog &pp gblc &sec gbla &fnum &fnum seta &fnum+1 codeloc cnop 0,4 dc cl12'&name' dc f'-1' &name equ * using &name,15 lr 0,SP s SP,s&sysndx drop 15 stm 0,15,0(sp) save registers st 0,52(,sp) lr $base1,15 using &name,$base1 first $ addresses this code l $base2,b&sysndx using &sec.p,$base2 lr 12,13 l $base3,c&sysndx l $base4,d&sysndx s sp,=f'&pp' b go&sysndx cnop 0,4 b&sysndx dc a(&sec.p) c&sysndx dc a(&sec.p+4096) d&sysndx dc a(&name+4096) s&sysndx dc a(ss$&fnum) go&sysndx equ * using &sec.p+4096,$base3 using &name+4096,$base4 mend * * macro &name epilog &stk number of declared parameters gbla &fnum &name lm 1,15,4(12) br 14 ss$&fnum equ &stk mend * * * macro runmain la 13,20(13) lr 3,1 lfunc 15,@gtarg@ la 1,0 bcall st 0,0(13) l 2,=v(#argv#) st 2,4(13) lfunc 15,@main@ la 1,8 bcall b go&sysndx @main@ intfunc main @gtarg@ extfunc #gtargs go&sysndx equ * mend * macro movif &fr,&r gbla &fflg aif (&fflg ne 0).ok2 &fflg seta 1 dataloc cnop 0,8 $fltcs dc xl8'4e00000000000000' $fltmp dc d'0.0' codeloc .ok2 anop ld &fr,$fltcs std &fr,$fltmp ltr &r,&r bm flt&sysndx st &r,$fltmp+4 ad &fr,$fltmp b flt&sysndx.a flt&sysndx equ * lpr &r,&r st &r,$fltmp sd &fr,$fltmp flt&sysndx.a equ * mend macro movfi &fr,&r gbla &fflg aif (&fflg ne 0).ok &fflg seta 1 dataloc cnop 0,8 $fltcs dc xl8'4e00000000000000' $fltmp dc d'0.0' codeloc .ok anop aw &fr,$fltcs std &fr,$fltmp l &r,$fltmp bc 10,flb&sysndx lnr &r,&r flb&sysndx equ * mend * macro entname &name dataloc entry &name mend * macro &name defext &name equ * &name.p equ * mend * macro lfunc ®,&add l ®,&add mend * macro lc ®,&add sr ®,® ic ®,&add mend * * * * end of macros * fltmp flt&sysndx.a equ * mend macro movfi &fr,&r gbla &fflg aif (&fflg ne 0).ok &fflg seta 1 dataloc cnop 0,8 $fltcs dc xl8'4e00000000000000' $fltmp dc d'0.0' codeloc .ok anop aw &fr,$fltcs std &fr,$fltmp l &r,$fltmp bc 10,flb&sysndx lnr &r,&r flb&sysndx equ * mend * macro entname &na w %( $%  %!%%& &  e?e@ 55  jf% 3 3 3Be<_%#  %d 5 @_>e_& & f e ?e_%. u_E%B & &d e ?e|_%#lef_E%W & B &$ e?*e$_%$ 1e_%& &f e?e_k _X 6%F%Gse n $ jf%%z LeFu@E%N 5f P%#  &  e?e( @E%$ _  r e A! y$5 65 n5  n5 f V% &f e?HeB_%52 5 _N &&  Wp eAu@E5@E5 @5%P5%_ _%%D-]%?5%% I%5 55 <%)u5 2 !5% 5 5 ff e ff e5%= %%@P 55 f V% 3 &ff e ?~ex lh f&  e?JeDw@w <@2*+N & &  ef& f& e "34N& f& e  x  @ww DCB%  && P% n && P%& P%#  x w:w 6DE%&  &# eww CE%%%e& & P%# ww @%% wlw hD%E%h E!Ee w(w $Dee@   ww e   ww D%%$ ww D%  % N&f  %J@@/`53BpC/ r* rC%@ @!Px @ t t  % x ?eww DC%% %% _ %5 % @dumumu cuu ZA@@ A 5@u@Ou]u]H@5x@@5x@;A@  5u/A@@ A 5u$A@5v5u@ &A@v5u  % x Jr?zetwjw f b ^% Hw>w : % _ E%_%\E%0&e D %=e   %e E%).&e  e%%e E%EJ&e 3 ee O e wFw B 5 %@A p\7 -  a  i w     77ww @5 Au @  = u-><wrCBED     XNDXNXNr,XNr  Z Z Z Z > ( Illegal conditionalCall of non-functionIllegal indirectionIllegal lvalueIllegal structure refIllegal conversionC error-- convertInteger operand requiredExpression overflowLvalue requiredConstant requiredmain entry %.8s @%.7s INT%s %.8s FUNCADDR@%.7s EXT%s %.8s FUNCADDR extrn %.8s main ltorg $main$ equ * subsave runmain subretrn cc=00 ltorg stackdo 8Xiih(     i  i    YY    yy XxxX )XXX9)  _czero _cone _cvtab _opdope _ctab _symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel _notrel _nreg _cctab _efftab _regtab _nstack _nfloat _pointre# _build"~buildopdopepcvntt1t2p1p2leftccvncsv L2L10000>L3`_block"L4_disarra"_chkfun"L5_length L1L6L7L9>L10L11L12L13L14,L15:L16. _error L17L18DL19XL20B _decref L21L22L23L24W L25L26_incref L27BL28k L8XL29NL30NL31NL32N_chklval"6L33bL34pL35r_chkw"nL36L10001L37L38z L39_setype"PL408L10004 L10003PL10009 L10005 L10006 L10007 L10008 L41fL42tL43L44_fold"VL45L46_lintyp"L10010 L10011"L47>L48L10012\L49L10013zL50L51zL52 L53L54L55L56L57L58L59_plength _convert"L60L61DL62@L100144L10015dL10016fL63cret ~convertpntlen cvnL66.L67L68L69L64LL70L71L72L65>L10018 L73 ~setypePapatdimptrptadimptrL75nL77L78rL74L79L80L81L76L10020 ~chkfunapptL83L82~disarraapptL10021.L852L84j~chkwnptL87L88 L86~lintypattL90L89L91L92~blockapopd nptp1 p2p3L94L95_pblock"L93~pblockpL972L98 _cexit L962~chklval6appL100RL101 L99R~foldVopap1ap2p1v1v2L10022rL103_lfold" L102 L105L106L104 L107L108L109L110L111L112L113L114L115L116L117L118L10024 ~lfold opap1ap2tp1p2v1v2L100268 L10025H L120N L119 L121d L122n L123 L124 L125 L127` L128 L126p L129 L130 L131 L132 L133 L134 L135( L136> L137Z L10028 _conexp" ~conexp t_tree L139 L140 L141 L138 _transve" ~transve cs_hgprloc L143 L144 L146 L147^ L148_scomp"D L149$ L150 _printf L151\ L10029F L153)L10030J L154.L152L155 L156 L10031 L158EL10032 L159JL1573L160 L161OL145 L142 _mainchk" ~mainchk csiL163 L164 L166\L167 L168 L162@ L165 L169aL170iL171wL172L173L174~scompD cds1s2L176L L177v L178t L175 L10033 L10034 )L10030J L154.L152L155 L156 L10031 L158EL10032 L159JL1573L160 L161OL145 L142 _mainchk" ~mainchkp w   _4%_45 7 7 %8% % 5%_5 % fe  5 j7f%  %_7L7 HB< f& fE%& % e _4e 5U7 @E% 7%%N UUf 8 c  UUE%  5 2 % ACpWturfff e % _%%     ww 7  .  N    %N/ 7lwhw d B T7P% %D > 8ABpNeEfA %f %S %%q N} %   % %77   C- ABpN %@E% @E%  wFw B :76% *%    e `%@Y  7 @>&& & k e & 4%&& & h e & %%)ld N    xp @w,w ( ww  _p  _    f" e x  %_ 7 : _ _   z_ r _ _ b_ Z5 P%cDX >0 4 .f %  * %;   f %   f % %_ %%__    x ~ x rf %  ^%%PJ F    _ 7& _ 7    7& & %   _   _   _   |5 r  d \ X%% Jf <& %0 (_ _  %_ F _% Y e _ 5N f& & n e & |x_ po b%_ R7N H _<842 .*( $ ^  ]   x  D %:&7   _   7%#_ 7B y 7| t& h%   wLw H@B .  6000 ($7%3E%%3  `% < 6%E% 3EU3% e  % e  eLHFBw<Pd  j v \ \ \ \ \ \ Too many }'sExternal definition syntax$%d EPILOG %d DC C'END %.8s' %.8s dc %dx'00' Can not initialize externals. cnop 0,%d %.8s equ * dc %dx'00' Too many initializers cnop 0,4 dc a($%d) Inconsistent external initializationUnexpected EOFThe profiler is not supported on IBM C.%.8s PROLOG %d %d args Missing '}'Case not in switchSwitch table overflowDefault not in switchUnknown keyword = %oRedefinitionStatement syntaxUndefined structure: %.8sNot an argument: %.8s%.8s undefinedConflict in storage classType clashBad structure name%.8s redeclared$%d dc d'd'-' IIIII(8hI9hhhIIhhhIIhhIIh hh IyI hyy y IIhhiI  9 i    9 I  II I           I   9   y  )     IYIII 9)9)))hxxY9xxiIIi9iixIihhhhhhhh_czero _cone _cvtab _opdope _ctab _symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel _notrel _nreg _cctab _efftab _regtab _nstack _nfloat _extdef"~extdefcsdstypeelsizeonelwidthcsv _symbol L14L20L3L4LL5bL6L7_strdec" L8_blkhed" L9L12L10000L10001L10002L10003_decl1 L13nL10004J_mainchk _cfunc"8L14L15L16_decref _length L17_cinit"_hgprloc L10L11 L18 L19 _error L20_errflus" _stateme"cret ~cfunc8csnpsavdimp_declist". L22 _printf L23/L21~cinitcstypeawidth onelninitwidthL10005L25L26L27AL24L28L29SL10006L30L31qL32}L33RL36._cinit1"L34:L35FL37PL38bL39~L40L41L42L43L44~cinit1signswidthninitL46L47_getstr L48L45L49_tree L51L52:_block _rcexpr0 L50L53^L54L55L56L57_prtflo" L58_bxdec"L10008p ~bxdecL60L59~statemecsnpdoo1o2o3L62L64p L65L66L67L61 L68L69<L70L71L72"L73<L74^L75:L76jL78L79r_simpleg L80_branch L81_dogoto L82 L83_doasm L84 L85_doret L86_pexpr L87~L89nL90L91&_cbrnch0 _label L92<L93_nextcha L94L95L96"_chconbr L10009dL88~L10011 L97L98L99<L100PL101dL102L103_conexp L104L105FL106L107YL108:L109>_chkw _pswtch0 L110L111L112oL113_forstmt L77 L10013 L114L115 L116n L117: L118L119T L63 L10015 L10016 L10017x L120~blkhed csplL122 L123, L124 L125 L126" _rlength L1270 L128 L129 L130p L131 L132L133 L134L121 _blkend" ~blkend csL136 L137 L139 L140 L141 L142L143 L138 L135 ~errflus aooL145 L146& L144* ~declist. ndecskwdelsizeoffsetotkwskwL1488 L149H L150 L152 L153\ L154\ L155\ L156\ L157\ L158\ L159h L160L161 L162v L10018 L10019 L163 L164 L165 L166 L167 L168L169 L170 L151 L10021 L171 L147 L172 L173 _declare ~strdec dstkwpmosfelsizessymoL175T L176> L177H _redec L178 L179l L180b _decsyn L174 L181z L182L183 L184 L185 L186 L187/~prtflo signinitL189 L190?L1912 L192GL193: L194JL195H L196ML197OL198l L188l 21 L171 L147 L172 L173 _declare ~strdec dstkwpmosfelsizessymoL175T L176> L177H _redec L178 L179l L180b _decsyn L174 L181z L182L183 L184 L185 L186 L187/~prtflo | w 2 %_j % &  %_j  %&  &g e &  p%g `7\% P F  T:42 . *5 "%@  % . e,7Ce- wCe- f  N  ww %  ~ x% C  wVw RJ5 @7605 & 7    N &  www D5T  tEE@Pww @tEAE@PUww |fffg `e &  wPw L N 57 6ff %w w Nh w w Nq ww B5  *2 B2ww BE%  * E% 4%t-Et%#tt ACp@}   x ww N BeEww 7%& P%;!     % % ww  %~ |7xrwlw h  wVw R N?JeD$ 62 && & f e &  ww  l%; && & n e &   ww % %" 5%"@  %)  wjw f-b7@( + & !        x wwExpression too largeStatement syntaxIllegal indirection B $%d $%d equ * Bad structureCompiler error (length)Break/continue error asm delimiter error mainloc codeloc dataloc strgloc tvecloc litloc istrloc Illegal loctr valueII )IIXXx))X) )  ))xIIY ) YY ))) ) ) ii_czero _cone _cvtab _opdope _ctab _symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel _notrel _nreg _cctab _efftab _regtab _nstack _nfloat _forstmt"~forstmtstsssavxprsp1sp2locsv _symbol L2L1jL3L_tree _rcexpr0"L4L_label"L5_block L6L7_stateme _branch"L8L9L10._error L11L12(L13>L14Hcret _pexpr"n~pexprnotL16L15L17C_errflus _pswtch0"~pswtch0dlsswpswlabswbL19L20_pswitch L18&_decref"*~decref*attL22DL23TL21X_incref"\~incref\tL24|_cbrnch0"~cbrnch0treecondlblL25~rcexpr0treetableL26_optim _rcexpr ~branchlabL28h_printf L27~labellL30qL29_plength" ~plength aptlpL32$L31>_length"B~lengthBcsacstnL34RL35rL36L33L37L39L40L41L42L43L44L45L46}L38L10001L47_rlength"~rlengthcsL48_simpleg"~simplegcspL50f_nextcha"nL51HL52HL10002RL53fL49j~nextchanL55r_getctab L56_getchar L54_chconbr"~chconbrlL58L59L57_dogoto"~dogotonp_build _chkw L60_doret"~doretL62.L616_doasm":~doasm:aL64L65TL66n_putchar L67L63L68_hgprloc"~hgprlochglocvalL69L71L72L73L70L74L75L76L77L78L79L80L81L82L83L84L85 L86L87L10004 oto"~dogotonp_bui$regtab / init expression :cr104: %c,n dc f'C1' %a,n %ad,n dc a(A1) / inib constant :cr107: %c,n dc x'Q' / goto :cr102: %a,n b A1 %n*,n F* b #1(R) / function call :cr100: %a,n %a,nd lfunc 15,A1 %n,n %n,nd FX lr 15,R / addressible :cr106: %z,n sr R,R %ab,n sr R,R ic R,A1 %a,n l R,A1 %af,n sdr FR,FR le FR,A1 %ad,n ld FR,A1 / ++,-- postfix :cr32: %a,n %ab,n lB1 R,A1 lr 0,R O 0,A2 stB1 0,A1 %e*,n %eb*,n F* lB1 0,#1(R) lr 1,0 O 1,A2 stB1 1,#1(R) lr R,0 %n*,n F* lr 1,R lB1 R,#1(1) lr 0,R O 0,A2 stB1 0,#1(1) / &unary :cr35: %a,n %af,n la R,A1 / *unary indirection :cr36: %aip,n %abp,n l 1,A1 lB1 R,0(1) %nbp,n H* sr 1,1 ic 1,~(R) lr R,1 %nfp,n H* sdr FR,FR le FR,~(R) %n,n %ndp,n H* lBF Z,~(R) / - unary minus :cr37: %n,n %nd,n FX lcBFr Z,Z / ~ ones complement :cr38: %n,n FX x R,=x'ffffffff' / = assignment :cr80: %a,n %ad,nd SX stB1 Z,A1 %a*,n SX l 1,A1 stB1 R,0(1) %a,nd SX movfi FR,R stB1 R,A1 %e*,nd S F1* movfi FR,R stB1 R,#1(R1) %n*,nd F*S S movfi FR,R stB1 R1,#1(R) lr R,R1 %n*,e F* S1 stB1 R1,#1(R) lr R,R1 %n*,n %nd*,nd FS* SX l 1,T stB1 Z,#1(1) / right shift :cr45: %n,z FX %n,c FX srl R,C2 %n,e F S1 srl R,0(R1) %n,n SS FX l 1,T srl R,0(1) / << :cr46: %n,z FX %n,c FX sll R,C2 %n,e F S1 sll R,0(R1) %n,n SS FX l 1,T sll R,0(1) / +, -, |, ^ binary RR or RX instructions except & :cr40: %n,z F %n,aw %nd,ad FX OB2 Z,A2 %n,ew* F S1* OB2 Z,#2(R1) %n,e F S1 Or R,R1 %n,n %nd,nd SS FX OBF Z,T / & -- binary and :cr47: %n,z sr R,R %n,aw F n R,A2 %n,ew* F S1* n R,#2(R1) %n,e F S1 nr R,R1 %n,n SS F n R,T / * -- R must be odd & this will clobber the even register R- multiply :cr42: %n,aw F m R-,A2 %n,ew* F S1* m R-,#2(R1) %n,e F S1 mr R-,R1 %n,n SS F m R-,T %nd,ad F mB2 FR,A2 %nd,nd SS F md FR,T / R must be even. divide and mod :cr43: %n,aw F srda R,32 d R,A2 %n,ew* F S1* l 0,#2(R1) srda R,32 dr R,0 %n,e F S1 lr 0,R1 srda R,32 dr R,0 %n,n SS F srda R,32 d R,T %nd,ad F dB2 FR,A2 %nd,nd SS F dBF FR,T / =* :cr72: %ab,n S sr 0,0 ic 0,A1 mr R-,0 stc R,A1 %a,n S m R-,A1 st R,A1 %eb*,n S F1* sr 0,0 ic 0,#1(R1) mr R-,0 stc R,#1(R1) %e*,n S F1* m R-,#1(R1) st R,#1(R1) %nb*,n FS* S l 1,T sr 0,0 ic 0,#1(1) mr R-,0 stc R,#1(1) %n*,n FS* S l 1,T m R-,#1(1) st R,#1(1) %ad,ad F mB2 FR,A2 stB1 FR,A1 %ad,nd SS F md FR,T stB1 FR,A1 %nd*,ad F* lB1 FR,#1(R) mB2 FR,A2 stB1 FR,#1(R) %nd*,nd SS F* lB1 FR,#1(R) md FR,T stB1 FR,#1(R) / =/; R must be odd on integers :cr73: %ab,n %a,n S lB1 0,A1 srda 0,32 dr 0,R stB1 1,A1 lr R+,1 %eb*,n %e*,n S F1* lB1 0,#1(R1) srda 0,32 dr 0,R stB1 1,#1(R1) lr R+,1 %n*,n SS F* lB1 0,#1(R) srda 0,32 d 0,T stB1 1,#1(R) lr R+,1 %ad,ad F dB2 FR,A2 stB1 FR,A1 %ad,nd SS F dd FR,T stB1 FR,A1 %nd*,ad F* lB1 FR,#1(R) mB2 FR,A2 stB1 FR,#1(R) %nd*,nd SS F* lB1 FR,#1(R) dd FR,T stB1 FR,#1(R) / =mod; R must be odd on integers :cr74: %ab,n %a,n S lB1 0,A1 srda 0,32 dr 0,R stB1 0,A1 lr R,0 %eb*,n %e*,n S F1* lB1 0,#1(R1) srda 0,32 dr 0,R stB1 0,#1(R1) lr R,0 %n*,n SS F* lB1 0,#1(R) srda 0,32 d 0,T stB1 0,#1(R) lr R,0 / =>> :cr75: %a,c lB1 R,A1 srl R,C2 stB1 R,A1 %a,n S lB1 1,A1 srl 1,0(R) stB1 1,A1 lr R,1 %n*,c F* lB1 1,#1(R) srl 1,C2 stB1 1,#1(R) lr R,1 %e*,n S F1* lB1 1,#1(R1) srl 1,0(R) stB1 1,#1(R1) lr R,1 %n*,n SS F* lB1 0,#1(R) l 1,T srl 0,0(1) stB1 0,#1(R) lr R,0 / =<< :cr76: %a,c lB1 R,A1 sll R,C2 stB1 R,A1 %a,n S lB1 1,A1 sll 1,0(R) stB1 1,A1 lr R,1 %n*,c F* lB1 1,#1(R) sll 1,C2 stB1 1,#1(R) lr R,1 %e*,n S F1* lB1 1,#1(R1) sll 1,0(R) stB1 1,#1(R1) lr R,1 %n*,n SS F* lB1 0,#1(R) l 1,T sll 0,0(1) stB1 0,#1(R) lr R,0 / =+ =& =| =^ :cr70: %ab,n SX sr 1,1 ic 1,A1 Or R,1 stc R,A1 %a,n %ad,nd SX OB1 Z,A1 stB1 Z,A1 %eb*,aw %e*,aw F* lB1 0,#1(R) O 0,A2 stB1 0,#1(R) lr R,0 %eb*,n S F1* sr 0,0 ic 0,#1(R1) Or R,0 stc R,#1(R1) %e*,n S F1* O R,#1(R1) st R,#1(R1) %n*,aw FX* lr 1,R lB1 R,#1(1) O R,A2 stB1 R,#1(1) %nb*,n FS* S l 1,T sr 0,0 ic 0,#1(1) Or R,0 stc R,#1(1) %n*,n FS* SX l 1,T O R,#1(1) st R,#1(1) %nd*,ad F* l FR,#1(R) aB2 FR,A2 stB1 FR,#1(R) %nd*,nd SS F* l FR,#1(R) ad FR,T stB1 FR,#1(R) / =- :cr71: %ab,n SX sr 1,1 ic 1,A1 Or R,1 lcr R,R stc R,A1 %a,aw l R,A1 O R,A2 st R,A1 %a,n %ad,nd SX OB1 Z,A1 lcBFr Z,Z stB1 Z,A1 %eb*,aw F* sr 0,0 ic 0,#1(R) O 0,A2 stc 0,#1(R) lr R,0 %eb*,n S F1* sr 0,0 ic 0,#1(R1) Or 0,R stc 0,#1(R1) lr R,0 %e*,aw F* l 0,#1(R) O 0,A2 st 0,#1(R) lr R,0 %e*,n S F1* O R,#1(R1) lcr R,R st R,#1(R1) %nb*,aw FX* lr 1,R sr R,R ic R,#1(1) O R,A2 stc R,#1(1) %nb*,n FS* S l 1,T sr 0,0 ic 0,#1(1) Or 0,R stc 0,#1(1) lr R,0 %n*,aw FX* lr 1,R l R,#1(1) O R,A2 st R,#1(1) %n*,n FS* SX l 1,T Or R,#1(1) lcr R,R st R,#1(1) %nd*,ad F* lB1 FR,#1(R) sB2 FR,A2 stB1 FR,#1(R) %nd*,nd SS F* lB1 FR,#1(R) sd FR,T stB1 FR,#1(R) / int -> float :cr51: %a,n l R,A1 movif FR,R %n*,n F* l R,#1(R) movif FR,R %n,n FX movif FR,R / float, double -> int :cr52: %nd,n FX movfi FR,R 0,0,0,0,0}; struct table regtab[] { / c code tables-- compile to register 106, cr106, / LOAD / 30, cr30, / INCBEF / 31, cr30, / DECBEF 32, cr32, / INCAFT 33, cr32, / DECAFT 35, cr35, / AMPER 36, cr36, / star - indirection 37, cr37, / negation 38, cr38, / complement 101, cr100, / function call 80, cr80, / assign 40, cr40, / binary addition 41, cr40, / binary subtraction 42, cr42, / * times 43, cr43, / / divide 44, cr43, / mod 45, cr45, / right shift 46, cr46, / << left shift 47, cr47, / binary and 48, cr40, / binary or 49, cr40, / binary xor 70, cr70, / =+, 71, cr71, / =-, 72, cr72, / =* 73, cr73, / =/ 74, cr74, / =% 75, cr75, / =>> 76, cr76, / =<< 77, cr70, / =&, 78, cr70, / =|, 79, cr70, / =^, 102, cr102, / goto 51, cr51, 52, cr52, 104, cr104, / init expression 107, cr107, / inib constant 0, 0, }; nary addition 41, cr40, / binary subtraction 42, cr42, / * times 43, cr43, / / divide 44, cr43, / mod 45, cr45, / right shift 46, cr46, / << left shift 47, cr47, / binary and 48, cr40, / binary or 49, .globl lmul lmul: setl setd movif 2(sp),fr0 movif 6(sp),fr1 mulf fr1,fr0 2: cmpf $50000,fr0 cfcc bge 1f subf $50200,fr0 br 2b 1: movfi fr0,-(sp) mov (sp)+,r0 mov (sp)+,r1 rts pc cr102, / goto 51, cr51, 52, cr52, 104, cr104, / init expression 107, cr107, / inib constant 0, 0, }; nary addition 41, cr40, / binary subtraction 42, cr42, / * times 43, cr43, / / divide 44, cr43, / mod 45, cr45, / right shift 46, cr46, / << left shift 47, cr47, / binary and 48, cr40, / binary or 49, $cctab / c code tables-- set condition codes / relationals :cc60: %n,z %nf,z %nd,z %nf,zf %nd,zd FX ltBFr Z,Z %n,aw %nf,ad %nd,ad FX cBF Z,A2 %n,ew* %nf,ef* %nf,ed* F S1* cBF Z,#2(R1) %n,e F S1 cr R,R1 %n,n %nf,nf %nf,ef %nd,ed %nd,nd SS FX cBF Z,T / set codes right :rest: %n,n %nf,nf H 0,0,0,0,0}; struct table cctab[] { /temporarily prohibit use of most of this table / 106, rest, / 28, rest, / 21, rest, / 22, rest, / 30, rest, / 31, rest, / 34, rest, / 35, rest, / 36, rest, / 37, rest, / 40, rest, / 41, rest, / 42, rest, / 43, rest, / 45, rest, / 46, rest, / 47, cc47, / 48, rest, 60, cc60, / == 61, cc60, / |= 62, cc60, / <= 63, cc60, / < 64, cc60, / >= 65, cc60, / > 66, cc60, /

p 69, cc60, / >=p / 70, rest, / 71, rest, / 72, rest, / 73, rest, / 75, rest, / 76, rest, / 77, rest, / 78, rest, / 79, rest, / 80, rest, 0, 0, }; ble / 106, rest, / 28, rest, / 21, rest, / 22, rest, / 30, rest, / 31, rest, / 34, rest, / 35, rest, / 36, rest, /int smode; int peekc; int peekchar; int pcmode; char name[10],*namep; main(argc, argv) int argc; char **argv; { auto c,d,snlflg,nlflg,t,m,ssmode,i,itemnbr; extern cin,cout; int j; j=cout; itemnbr=smode=nlflg=snlflg=ssmode=0; if (argc>1) if ((cin=copen(argv[1],'r'))<0) { putchar('?\n'); cexit(1); } if (argc > 2) if ((cout=copen(argv[2],'w'))<0) { printf(j,"?\n"); cexit(1); } printf("#\n"); printf("struct optab {\n"); printf(" int tabdeg1;\n"); printf(" int tabtyp1;\n"); printf(" int tabdeg2;\n"); printf(" int tabtyp2;\n"); printf(" char *tabstring;\n"); printf("};\n"); printf("struct table {\n"); printf(" int tabop;\n"); printf(" struct optab *tabp;\n"); printf("};\n\n"); namep = &name[0]; if (getchar() != '$') { printf("No table name\n"); cexit(1); } for (i=0; i<8 && (c=getchar()) != '\n'; i++) name[i]=c; printf("struct optab %sop[] {\n", namep); loop: c=getc(); if ((c != '\n') && (c != '\t')) nlflg=0; if (ssmode && c != '%') ssmode=0; switch (c) { case '\0': cexit(0); case ':': if (itemnbr != 0) { printf("\n0,0,0,0,0,"); itemnbr++; } printf("\n# define "); while ((c=getc()) != ':') putchar(c); printf(" &%sop[%d]\n", namep,itemnbr); goto loop; case 'F': case 'S': case 'H': putchar(c); if (c == 'F') if ((c=getc()) == 'R') { putchar(c); goto loop; } else peekc=c; subtre: snlflg=1; t=0; l1: switch (c=getc()) { case '*': t =| 1; goto l1; case 'S': t =| 2; goto l1; case '1': t =| 4; goto l1; case '2': t =| 010; goto l1; case 'X': t =| 020; goto l1; } peekc=c; putchar(t/8+'0'); putchar((t&07)+'0'); goto loop; /* end of cases for F,S,H */ case 'B': putchar(c); if ((c=getc()) == 'F') putchar(c); else peekc=c; goto loop; case '\t': if (nlflg) nlflg=0; else printf("\\t"); goto loop; case '\n': if (!smode) { putchar('\n'); goto loop; } if (nlflg) { /* have just seen \n\n */ nlflg=0; printf("\",\n"); smode=0; pcmode=0; goto loop; } if (!snlflg) printf("\\n"); snlflg=0; nlflg=1; goto loop; case '%': pcmode=1; loop2: itemnbr++; loop1: switch(c=getc()) { case ',': putchar(' '); goto loop1; case 'z': m=4; t=flag(); goto pf; case 'c': t=0; m=8; goto pf; case 'r': m=12; t=flag(); goto pf; case 'a': m=16; t=flag(); goto pf; case 'e': m=20; t=flag(); goto pf; case 'n': m=63; t=flag(); pf: if ((c=getc()) == '*') m =| 0100; else peekc=c; printf(" %d,%d,",m,t); goto loop1; case '\n': if ((c=getc()) == '%') { printf(" 0,\n"); goto loop2; } else { peekc=c; printf(" \""); ssmode=1; nlflg=1; smode=1; snlflg=0; goto loop; } } putchar(c); goto loop1; /* end case '%' */ case '[': if ((c=getc()) == ']') { printf("[]"); while(putchar(getc())); peekc='\0'; } else { peekc=c; putchar('['); } goto loop; } /* end of big switch */ putchar(c); goto loop; } /* end of main function */ getc() { auto t; if (peekc) { t=peekc; peekc=0; } else { if (peekchar) { t=peekchar; peekchar=0; } else t=getchar(); } if (!pcmode) { if (t == '/') /* process a comment */ while ((t=getchar()) != '\n'); if (t == '\n') while ((peekchar=getchar()) == '/') while (getchar() != '\n'); } return(t); } flag() { register c,f; f=0; l1: switch (c=getc()) { case 'w': f=1; goto l1; case 'i': f=2; goto l1; case 'b': f=3; goto l1; case 'f': f=4; goto l1; case 'd': f=5; goto l1; case 's': f=6; goto l1; case 'p': f =+ 16; goto l1; } peekc=c; return(f); } ) { t=peekchar; peekchar=# include "prh.c" struct symtab stab[symsiz]; char sbf[SBSIZE]; process a comment */ while ((t=getchar()) != '\n'); if (t == '\n') while ((peekchar=getchar()) == '/') while (getchar() != '\n'); } return(t); } flag() { register c,f; f=0; l1: switch (c=getc()) { case 'w': f=1; goto l1; case 'i': f=2; goto l1; case 'b': f=3; goto l1; case 'f': f=4; goto l1; case 'd': f=5; goto l1; case 's': f=6; goto l1; case 'p': f =+ 16; goto l1; } peekc=c; return(f); } ) { t=peekchar; peekchar=$ 6vPP&lmul"char()) != '\n'); if (t == '\n') while ((peekchar=getchar()) == '/') while (getchar() != '\n'); } return(t); } flag() { register c,f; f=0; l1: switch (c=getc()) { case 'w': f=1; goto l1; case 'i': f=2; goto l1; case 'b': f=3; goto l1; case 'f': f=4; goto l1; case 'd': f=5; goto l1; case 's': f=6; goto l1; case 'p': f =+ 16; goto l1; } peekc=c; return(f); } ) { t=peekchar; peekchar= h,w %ss7 7 5 @-* @5   N   0  x e@@m%  Zr@& 7B @   e  ew@& %77  %  %Ԕ  e7 @e&7 @5@ x  =@" 0 D > : 4 : KRB   ww  T Nff f fff e  ww `@e5@e5t b_(V "  H%(  U ,     e 5%% %e 5 %N @e5  %-@% @%!N@&@&$ e5@ A1u%FԔ  `*e7 p@e&7` j@5@  =@c VP c VP  n .!  N+c VP cdc VP   [wj]w X]$_d VP Nff f fff VPe  \Y rw]w ]`dާ@e5@e5lƧ ,*_@4 "  V'%(  U   N^ H^  e 5%% %e 5 %N @e5  %-@% @%!N@&@&$ e5@ (A1uecf& e& &  e?TeNF   >% ĩ& %&  e?e& d $ N+ ^- N+t& &  e ?ƥe%#d $ [ __ e? _: % 4  %/#$'  '%e.\d  _ ̨  - xa _  jtE5% % uu- u-3 5j-%  b7f\ y @e@-7d $ [ee}_@548[ B>@%4N _ & & & e?ed%_% _8b7[ y N _Kd $ X# wXw X 5 C% 76%7 &7nZ%% ܧf ff ze5` Ҧ%@$ %% %%7 7 %%% @ ^ @wXw XC5 % 7l B%7Y%%Y _ \5_  tAE@P@t55D] 5 ,% % &%% % %% %2!% %2! _ 2 % %  U5J%  \VRJ  p 5 %' (5 % @eE@5` @eE5 r- PrE%% % % %]d $% U% j )7`^B%W N+W Wjd VP  )vd VP  N+!%E%5 E%%d $ Ф̤@ wvUw dU "_> tU_Z  "%_N  t z"[ 7 zr & &  e\ \ F"%UtU 0"%'7V 72-  Awp@ 1   !%$ʣ ģtU  xPb7VVb7W y ^ w0Tw Td $N X#wTw Tpe d $ wSw S@  0 J xfbwSw S %( $%  %!%%& &  e?VeP@ 5j562  % (3 3 3e_v%#  %d 5 @_e_v& & f e ?e_v%Xe $u_E%le $&  &d e ?2e,_v%#e_vE%e $& j &$ e?ڜeԜ_v%$ (1e_v%& : &f e?xer_ve $_ %F%Gs:e4 ( $ %%e $eu@E%N '5f %#  &  e?e( @E%$ _v  r edA! y$5 5 (5  (5 f % &f e?e_v%52 5 _N N&&  Wp eAku@E5@E5 @5%P5%_ _%%D-]%?5%%e $I%5 55 <%)u5 2 !5% 5 5 (ff ze (ff ze5%= %%@zd55 f % 3 &ff e ?.e(  (f&  ze?ewNw N@2*+N & &  ef& f& e "34N& f& e  xee $@wMw rMDCB%   && %  && %& %#  xewMw LDE%& p &# ewLw LCE%%%vep&  & %# LHwfLw TL@%%e $w@Lw .LD%E%h E!Ee wKw KDee–@   wKw Ke 0 ,e $ [wKw KD%%$ f $w~Kw lKD%  % N&f %J@@/`53BpC/ r* rC%@ @!Px @ t t  % x$e?ewJw JDC%% %% _L%5 % @dumumu cuu ZA@@ A 5@u@Ou]u]H@5x@@5x@;A@  5u/A@@ A 5u$A@5v5u@ &A@v5u  % x>eJr?*e$w>Iw ,I %f $ wIw I N+H%h_hE%_%\E%0.f&e  %=e 3f VP %e E%SfXf&e Af VPe%%Ɨe E%oftf&e ]f VPee yf VP e N+wHw H 5 %@A pf7 H-  N+f VP N+f VPf VPf VPf VPf VP N+77wGw ~G@5 Au @  = u-><wFGw 4G  _|%_|5 7 j7 h%8%tR R%^> <J5%_X5 % fe L$ 5 7rH%  %_X7XH7 Е f& fE% % ze _|e 5U7 @E% b7G%%GN tUU0f  c $ UUE%  5 '2 (% ACpWturfff e N+ % _%%`g $ mg $ X# ,wEw DN7 vP> v#F< FN , *"g VP%Ng VP 7wDw D N+B 7\F% %PF ԓ ГABpNeEfg VP%f %g $%%g VP Ng VP t%   \% %7E7E   C- ABpNg VP %@E% @E%h $h VPwCw zC 7BE% 6E% N+  N+"h VP e `%D@Y  N+7 @>z|&& & k e & h( 4%z|&& & h e & h( %%)xDpD N >%    xf @wrBw `B.h $wbBw PB _!Sh $_!  bh $ N+nfh VPe x b T%_!7C ,h $_!B_@!   ( _!  _!_! _! 8 5 %cX 0 >C 8Cf 8(% :  (* %;  C Cf 8(% X  ( xp L*f 8(% Z%_! J%%R_4B_!   xfB B |Bf 8(% , %%TB PB ( ( , (_!72B (_!B7 B ( B7& A & 8(% ,r (l (b`_!X L*P (_!B L*: (_!.,A$ AA AA5 |A ( , ( %% f j& 8(%ȍ (_!_! $ %_! h $_4%ܭh $@tpef@ @ (_4V@P @ 5N (z|f& & n e & h( _! h $ %_!\@7 R@ (_4ҌЌ>@Ȍ 8@4@ .@ ^ (]   xfh $ D %:&7 z i $_4 ? ? ( : 7?%#_4g7bE y 7? & h(  %i $ X#w=w =@ v# 00 ܋7֋%3E%%3  )`H%h< 6%E% 3EU3% e  i $ % e :i $ e fw:  N+;7 ;i VP %i VPi VP i VPeb VP i VP  N+w9w 92 %_"' %r; & h( %_"'և ( %8;&  L&g Ze & h( %g 7:% : ,l ( T`:X : 5 L%@ƒ< % i $(e,7Ce- ,w|Ce-nچ (f h( N ( wh8w V8 %  < % i $ X# w,8w 8n5 d7Z95 9 (J7 F , <24, (N (& RC  ( ww7w 7D5i $ tEE@Pwz7w h7@tEAE@PUwV7w D7fffg :e & h( w&7w 7 N PG57 rff 4%w6w 6Nj VP w6w 6Nj VP w6w 6B5  '2 (2w6w 6BE%  ' E% 4%t-Et%#tt ACp@#j $   xi1j $ w5w 5N (eEw5w 5 77%& P%;!    X7 R7 % %<7 wh5w V5 <3%~ %7wB5w 05 Ij $w,5w 5 ?e$  (z|&& & f e & h( w4w 4 l%;z| && & n e & h(  (w4w 4 % $%" $5%"@ \Y^j VP $%) `j $w@4w .4-7@(tj VP+~j VP&j VP!j VPj VPj VPj VP j $  xiw(w3w 35 5 >%FE5`A rWpDeHe ʋ6%E%555 >%FE@ E%< %e%hH D a%ao $ [ 4 4 4 4 > 0Ue %FҔw2w 2 f4 `4Z4%7 _1 ڀԀ7 Ѐ  ̀ _1 " <3_1Ѐ ~" Ā 47 h" _1(& 1%_12)> e&& 1%_1&  1% P_1 $%(%1e_1%P<_17l3P_1& & 1% ._1>?= 1%_1& & 1% -_1@A= 1%_1="= 1%_1 * 1% +_1 8! Zo $ _1 j 27 ` Z !%/n7? y _,- %0 %9._/7~'_15 5 5 %0 5%0'%9$&  fff eee@ ee@ 5u@0 D %.%%d"%D%e%E7H~  @e7B~_1@72~_15 2@0 3@% @c o $%@0   r enA! y, d @% @c @0 7V}@0 V}_1_1 _1> D}ӕ.7 :} <3%{ <3%| %_#%F %F7| 7|%||%:|7|2/5/& 1%%60| 1%o $ D_,-  r eoA! y. <3w-w - 8| 7.|w-(|@7 |@w-w -|n/7| d/p VP p VP " 2 % p VP"p VP { %{'p VP*p VPw>-w ,-7 { ' 2  %{ta7z{%9p $w,w ,C  D.Qp $7({9  1 .+ ) & { `.7 {o7< y o7< y%{mEwR,w @, {@m&l@&lw,,w ,C  _4@ 5j B %,%J _455N& dA 55@5Nf dA 5}-   _4e@ S%@%$IN& dA 5E@ :"7& A 5-@ 5j E@-%@%$f A 5 e e  w*w *%%6q $_D6BC c_D6e nEec_D6%#3% % %Mq $;z| H6%ch;z| H6%c] 5j4p N 4% dq VP < 0E~p7: yN H6% $%z|Nz| H6% %&nq VP%c zq $ wF)w 4)%%q $_">5 Bu5%d_7%$2q $% x7 xx mx7x5 %  B 5` B 5`w7 wu %h9 d9  5 Nq VP %  > >7lwerTw 7Nw@ 5j %5%6%"8%4N)5& z) nEeNf>t 4%Z) (N (NfFt 4%8) 4) (@_">%ZQ%_">N& )5& ( nEeNf 4%5(5 ( (N (Nf 4%5u- Nfq VP%uN (_:N C 5@ 5Nf >% _:p7Nf b3%5_">@55  5j@5 _=%eY%lu7 fu%`u%fueq VP Tuq VP Buq VP r VP,u r VP " r VP #r VP,r VP   6 N4r VP 5 %Cr $ B %+%I %% _">@_">@ ȥ1D <@_L9@ " B d \Y_L9 5j%$ @1Dp75 y%c \Y B5@ \Y_L9@ ȥ1@fr VP _L9R  _ _L9Nr VP _L9  r epA! y$N \Y_L9wh!w V!@!s VP$ s VP s VPs VPs VPNs $    xqw!w D1N& dA % j555Nffe H6%w w D B5%*s $z|& 4%5oE7o o+ H1e t VP 5t $t VP, t $ t VP s72 y  t VP   xst $w*w D  8$ 3 0 %  %  xst-ww BCE%E % % A @@0%  % A @@55EU%%! ww C%(%  % ww D 5j%e %d ww rDN B @  E U s70 y w<w *CB zju VP _rD  vD _rDt55 9AWpA-2 u VP jft VP%,, &u VP ei.u VP ! % 6u VP Pu VP eieu VP zu VPww CB 05  '4- u $ 4- 54t5 te  ww C B %   1 w^w LB D  %*.L w w  DC B _F_F & 5&  nEe& nEeN (& & nEe& & nEe_F & nEe& nEe5&  nEe& & nEeN (C & & nEe3Nt7- y 5j=>tBe 4%  & F%ww DN& "G u VPNu VP wlw Z @4p5@ *su VP w>w ,B  _8I _8I j5_8I5 E @ 5- dA r 5u-A 5re0= A 5ruA r 5 = wlw Z 5  @ ȋ@wHw 6 %" ] %N* tT AWp eu@ NH tT @  f Y @9 Gfe@&@p&f he  x@Nc tT @@@ @ A@ w2w 3@& T ww  @v73 y 5  f <^ 5 Nf Y @wf <^ 5f ^N tT w ,AWp eu@Ap@A p N _%xNef ^ %( 63= % $ !Ned \5%.@ p@Aedp@=@p @A ehp@=@%  @t5pw~w l 5 N :[ % N _wTw B ]%YAWp eu@  @   x& f ^%@ff ^%@Ap@0 @ @%@  \@ 0 N ]w@ &f ^w ^D m1" a2  ew.eE !݃%%5 |^%Je \w De!c bb! c33ww zf ^%ȍ ^% ^% wJ70 0  ӕ- ӕ0B~0ӕ.  ӕ0~ B~70 0  ӕ-ӕ.0 B~ӕe ӕ- ӕ+ r e0e0Sf@w fw/w/wf@w/wf fw/w/wFf@w/w/w$f//wm/ wt/wmn/fw^/ wwP/ f@w@/w Be0# @dє     BA   W e B@e0dm>- O` deȐ9 ȕ0 dȕ1 ZO- TO`0ddVV'bcc cccc%c,c5c :c Ac Dc JcOcVc[cacjcmcucycccc^h. .PPPPPPPPPPPP0^PPPPPPPP8PPPPPPP8 !ddelb.@ 4 n *8 T ( N intcharfloatdoublestructautoexternstaticregistergotoreturnifwhileelseswitchcasebreakcontinuedodefaultforblissfortranasmsizeofillegal option - %cArg countCan't find %sCan't create temp%.7s startup startup ltorg end %s $main$ %d: initializer too complicatedExpression overflowexpression overflowExpression syntaxBad function$%d equ * dc %dx'00' Bad register %oDeclaration syntax%.8s redeclaredCBEDddddd     B   ,  T,D|||\\PTX`jt|RdvIllegal conditionalCall of non-functionIllegal indirectionIllegal lvalueIllegal structure refIllegal conversionC error-- convertInteger operand requiredExpression overflowLvalue requiredConstant requiredmain entry %.8s @%.7s INT%s %.8s FUNCADDR@%.7s EXT%s %.8s FUNCADDR extrn %.8s main ltorg $main$ equ * subsave runmain subretrn cc=00 ltorg stackdo 0dj,P! (  !P!P!@HL`!!##########$$$$$$$$$$$$$#Too many }'sExternal definition syntax$%d EPILOG %d DC C'END %.8s' %.8s dc %dx'00' Can not initialize externals. cnop 0,%d %.8s equ * dc %dx'00' Too many initializers cnop 0,4 dc a($%d) Inconsistent external initializationUnexpected EOFThe profiler is not supported on IBM C.%.8s PROLOG %d %d args Missing '}'Case not in switchSwitch table overflowDefault not in switchUnknown keyword = %oRedefinitionStatement syntaxUndefined structure: %.8sNot an argument: %.8s%.8s undefinedConflict in storage classType clashBad structure name%.8s redeclared$%d dc d'd'-' P)X)\)d)l)|)`+j+t+~++++Expression too largeStatement syntaxIllegal indirection B $%d $%d equ * Bad structureCompiler error (length)Break/continue error asm delimiter error mainloc codeloc dataloc strgloc tvecloc litloc istrloc Illegal loctr value<<8888888888ABCDEFGHIJQRSTUVWXY_bcdefghijpqrstuvwx    .<(+|&!$*);-/,%_>?`:#@'="abcdefghijklmnopqr~stuvwxyz[]^{ABCDEFGHI}JKLMNOPQR\STUVWXYZ0123456789 *.....nnnnnn    T0"0///T0////T0//T0"0///T0///(o6o@oHoVo   1Z-d-Z1-. /1x- .0D-1P.0R-1f.F1-6-0n1 0bnrt2222223 \222 3Symbol table overflowNonterminated commentillegal floating point constantUnknown character$%d dc x'' dc x'%02x00' dc x'00' Long character constantNonterminated string<=@A>?DEBC=EDCB"*Hghkn555 5*5t55512F::::=*=<*=*=*===ppppp>\9R;=>b:=>:6;<<=>h= ;=L;0>:>b>b>b>b>b>b>0>:>b>b>b>b>b>D>N>X>rcexper register errorIllegal initialization lr 0,%d ltr %d,%d No match for op %dcexpr register errorCompiler ftn call error s SP,=f'%d' lr %d,%d mvi %d(SP),x'80' la 1,%d(SP) la SP,%d(SP) FCALL s SP,=f'%d' la 1,%d sr 1,1 BCALL la SP,%d(SP) compiler error; star without sharp%dcompiler error; bad star entry std %d,%d(R12) temp st %d,%d(R12) temp lr %d,%d lr %d,%d Register overflow: simplify expression%d%d0%x%d(R12) tempasnoxNo match - binary op %dIllegal structure std %d st %d,%d(R12) conv args to ptrs for fortran la %d,%d(R12) std %d,%d(SP) st %d,%d(SP) ^tatetitltptstvtzt}t @@@A@@6A@f@XAT@T@x@xAAA~A~AA*+,HIJ.C$C$C.C$C$CJC c r0,=f'%d' bh $%d lr r1,r0 sll r1,2 b *+4(r1) "56fFEEFbebnebnhblbnlbhblbnhbhbnl$%d=f'%d'=x'%04x%04x'%d+%d(R12)ss$&fnum+%d(R12)%.8s@%.7sIllegal structure reference$0Bad reg. reference%d$%dpname called illegally b $%d s 0,=f'%d' b $%d b $%d c 0,=f'%d' be $%d b $%d * End of switch code. Duplicate case (%d)b $%d %suuuu! HHHFHHHHH?N?W?Tc?v????T???ƀ?Հ????T ?1??T?m??|??T?ˁT???W}???? T?T?C??ۃ?#??PT?T??Ä?LT?}???T?p???? TT%T?TT??Շ? 1?[???ЈTT?)TcT??+?V??ފ?????jv v!v#*w$Hw%w&wevPw(x)x*y+Zy,Zy-$x.Vx/x0x1xF&{G{HyIzJrzKzLzM&{N&{O&{fbv3>|4f|h&vkNv dc f'C1' dc a(A1) dc x'Q' b A1 F01 b #1(R) lfunc 15,A1 F20 lr 15,R sr R,R sr R,R ic R,A1 l R,A1 sdr FR,FR le FR,A1 ld FR,A1 lB1 R,A1 lr 0,R O 0,A2 stB1 0,A1 F01 lB1 0,#1(R) lr 1,0 O 1,A2 stB1 1,#1(R) lr R,0 F01 lr 1,R lB1 R,#1(1) lr 0,R O 0,A2 stB1 0,#1(1) la R,A1 l 1,A1 lB1 R,0(1) H01 sr 1,1 ic 1,~(R) lr R,1 H01 sdr FR,FR le FR,~(R) H01 lBF Z,~(R) F20 lcBFr Z,Z F20 x R,=x'ffffffff' S20 stB1 Z,A1 S20 l 1,A1 stB1 R,0(1) S20 movfi FR,R stB1 R,A1 S00F05 movfi FR,R stB1 R,#1(R1) F03S00 movfi FR,R stB1 R1,#1(R) lr R,R1 F01S04 stB1 R1,#1(R) lr R,R1 F03S20 l 1,T stB1 Z,#1(1) F20F20 srl R,C2 F00S04 srl R,0(R1) S02F20 l 1,T srl R,0(1) F20F20 sll R,C2 F00S04 sll R,0(R1) S02F20 l 1,T sll R,0(1) F00F20 OB2 Z,A2 F00S05 OB2 Z,#2(R1) F00S04 Or R,R1 S02F20 OBF Z,T sr R,R F00 n R,A2 F00S05 n R,#2(R1) F00S04 nr R,R1 S02F00 n R,T F00 m R-,A2 F00S05 m R-,#2(R1) F00S04 mr R-,R1 S02F00 m R-,T F00 mB2 FR,A2 S02F00 md FR,T F00 srda R,32 d R,A2 F00S05 l 0,#2(R1) srda R,32 dr R,0 F00S04 lr 0,R1 srda R,32 dr R,0 S02F00 srda R,32 d R,T F00 dB2 FR,A2 S02F00 dBF FR,T S00 sr 0,0 ic 0,A1 mr R-,0 stc R,A1 S00 m R-,A1 st R,A1 S00F05 sr 0,0 ic 0,#1(R1) mr R-,0 stc R,#1(R1) S00F05 m R-,#1(R1) st R,#1(R1) F03S00 l 1,T sr 0,0 ic 0,#1(1) mr R-,0 stc R,#1(1) F03S00 l 1,T m R-,#1(1) st R,#1(1) F00 mB2 FR,A2 stB1 FR,A1 S02F00 md FR,T stB1 FR,A1 F01 lB1 FR,#1(R) mB2 FR,A2 stB1 FR,#1(R) S02F01 lB1 FR,#1(R) md FR,T stB1 FR,#1(R) S00 lB1 0,A1 srda 0,32 dr 0,R stB1 1,A1 lr R+,1 S00F05 lB1 0,#1(R1) srda 0,32 dr 0,R stB1 1,#1(R1) lr R+,1 S02F01 lB1 0,#1(R) srda 0,32 d 0,T stB1 1,#1(R) lr R+,1 F00 dB2 FR,A2 stB1 FR,A1 S02F00 dd FR,T stB1 FR,A1 F01 lB1 FR,#1(R) mB2 FR,A2 stB1 FR,#1(R) S02F01 lB1 FR,#1(R) dd FR,T stB1 FR,#1(R) S00 lB1 0,A1 srda 0,32 dr 0,R stB1 0,A1 lr R,0 S00F05 lB1 0,#1(R1) srda 0,32 dr 0,R stB1 0,#1(R1) lr R,0 S02F01 lB1 0,#1(R) srda 0,32 d 0,T stB1 0,#1(R) lr R,0 lB1 R,A1 srl R,C2 stB1 R,A1 S00 lB1 1,A1 srl 1,0(R) stB1 1,A1 lr R,1 F01 lB1 1,#1(R) srl 1,C2 stB1 1,#1(R) lr R,1 S00F05 lB1 1,#1(R1) srl 1,0(R) stB1 1,#1(R1) lr R,1 S02F01 lB1 0,#1(R) l 1,T srl 0,0(1) stB1 0,#1(R) lr R,0 lB1 R,A1 sll R,C2 stB1 R,A1 S00 lB1 1,A1 sll 1,0(R) stB1 1,A1 lr R,1 F01 lB1 1,#1(R) sll 1,C2 stB1 1,#1(R) lr R,1 S00F05 lB1 1,#1(R1) sll 1,0(R) stB1 1,#1(R1) lr R,1 S02F01 lB1 0,#1(R) l 1,T sll 0,0(1) stB1 0,#1(R) lr R,0 S20 sr 1,1 ic 1,A1 Or R,1 stc R,A1 S20 OB1 Z,A1 stB1 Z,A1 F01 lB1 0,#1(R) O 0,A2 stB1 0,#1(R) lr R,0 S00F05 sr 0,0 ic 0,#1(R1) Or R,0 stc R,#1(R1) S00F05 O R,#1(R1) st R,#1(R1) F21 lr 1,R lB1 R,#1(1) O R,A2 stB1 R,#1(1) F03S00 l 1,T sr 0,0 ic 0,#1(1) Or R,0 stc R,#1(1) F03S20 l 1,T O R,#1(1) st R,#1(1) F01 l FR,#1(R) aB2 FR,A2 stB1 FR,#1(R) S02F01 l FR,#1(R) ad FR,T stB1 FR,#1(R) S20 sr 1,1 ic 1,A1 Or R,1 lcr R,R stc R,A1 l R,A1 O R,A2 st R,A1 S20 OB1 Z,A1 lcBFr Z,Z stB1 Z,A1 F01 sr 0,0 ic 0,#1(R) O 0,A2 stc 0,#1(R) lr R,0 S00F05 sr 0,0 ic 0,#1(R1) Or 0,R stc 0,#1(R1) lr R,0 F01 l 0,#1(R) O 0,A2 st 0,#1(R) lr R,0 S00F05 O R,#1(R1) lcr R,R st R,#1(R1) F21 lr 1,R sr R,R ic R,#1(1) O R,A2 stc R,#1(1) F03S00 l 1,T sr 0,0 ic 0,#1(1) Or 0,R stc 0,#1(1) lr R,0 F21 lr 1,R l R,#1(1) O R,A2 st R,#1(1) F03S20 l 1,T Or R,#1(1) lcr R,R st R,#1(1) F01 lB1 FR,#1(R) sB2 FR,A2 stB1 FR,#1(R) S02F01 lB1 FR,#1(R) sd FR,T stB1 FR,#1(R) l R,A1 movif FR,R F01 l R,#1(R) movif FR,R F20 movif FR,R F20 movfi FR,R ?????,???;?T?T?TI?^????????n????~<.=.>.?.@.A.B.C.D.E.F20 ltBFr Z,Z F20 cBF Z,A2 F00S05 cBF Z,#2(R1) F00S04 cr R,R1 S02F20 cBF Z,T H00****** %s!"%(!&!QQQQ~QQQQQ~QQhQQQhQQQERROR cputc cputc: %d not opencputc: writing %dftoa Y,Ycgetc cgetc: %d illegal file numbercgetc: %d not open to readcgetc: error on %darwYYYYYYYcopen: bad file %s\[[: argument count wrong That's all, folks  %ewq/dev> savr5$~_exit" __main"_czero#>t_cone#Ft_cvtab#k_opdope#j_ctab#&l_symbuf$>_hshused$F_hshtab$H_space$h_cp$j_cmst$l_isn#Ra_isn1#Pa_swtab$_swp$ܭ_contlab$ޭ_brklab$_retlab$_deflab$_autolen$_peeksym#Ta_peekc$_eof$_line#Va_treebas$_defsym$_funcsym$_xdflg$_proflg$_csym$_cval$_fcval$_nchstr$_nerror$_paraml$_parame$_strflg$_osleft$_mosflg$_initflg$ _inhdr$ _dimtab$_dimp$֮_regvar$خ_ndp$ڮ_endp$ܮ_xtern$ޮ_ftern$_fflg$_functio$_mainftn$_mainfil$_machine$_hgoffs$_hgcurlo$_maprel#fp_notrel#pp_nreg#zp_cctab#_efftab$_regtab#z|_nstack$_nfloat$_assembl$_siflg$_soflg$_kwtab#Xacsv"__error"$_cexit"[_copen"tY_cin# _cout#_lookup"+_alphanu" _printf"VP_extdef"H_blkend" #_transve"|_hgprloc"N+cret"__putchar"\Y_tree"v_symbol",_nextcha"&*_block"_pblock"_incref"(_prtflo">%_getstr"1_build" _errflus"X#_declare"_decl1"z_decsyn"^ _getype" _redec"v _length"(_rlength")_conexp"P_pointre#d_disarra"_chkfun"_decref"'_chklval"_chkw"(_setype" _fold"_lintyp"N_plength"(_convert"z_lfold"_scomp"_mainchk"t_strdec"L$_blkhed"!_cfunc"_cinit"_stateme",_declist"v#_cinit1"_rcexpr0"h(_bxdec"_simpleg")_branch"(_dogoto"b*_doasm"*_doret"*_pexpr"&'_cbrnch0"8(_label"(_chconbr"L*_pswtch0"b'_forstmt"%_pswitch"RC_optim"PG_rcexpr"4_getctab"<3_getchar"O_atoe#l_etoa#m_subseq"1lmul"2P_getcc"P2_mapch"2_flreg#|p_match"b3_isfloat"B_dcalc"dA_notcomp"A_cbranch"nE_cexpr"H6_pow2"0E_sdepth#p_comarg">_oddreg" C_chkleaf">_pname"<@_collcon"B_wexpr"&>_condop#s_max"?_degree"?_dirsw#t_sort"vD_ispow2"D_branch1"F_cbr""G_unoptim"ABCDEFGHIJQRSTUVWXY_bcdefghijpqrstuvwx    .<(+|&!$*);-/,%_>?`:#@'="abcdefghijklmnopqr~stuvwxyz[]^{ABCDEFGHI}JKLMNOPQR\STUVWXYZ0123456789_czero _cone _cvtab#_opdope#_ctab#X_symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel _notrel _nreg _cctab _efftab _regtab _nstack _nfloat _atoe#_hgcurlo _etoa#e _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern  w 5 5 %E5`A rWpDee ʋ6%E%555 %E@ E%< %e%  D <%6  4 4 4 4  Ue %Ҕww %7 _ 7   _  p_   ~7 z v n _(& %_2)> e&& %_&  % P_ $%(%1e_%P<_7P_& & % ._>?= %_& & % -_@A= %_="= %_ * % +_ F < _ * $7   %/7 y _` %0 %9.._7'_5 5 5 %0 5%0'%9$&  fff zeee@ ee@ 5u@0V R%.%%d"%D%e%E7,  @e7_@7_5 2@0V 3@%V @cV  %@0V   r eA! y, r @%V @cV @0V 7:@0V V (__ _ ӕ.7  p%{ p%| %_#% %7 7%%:72/5/& %%60| % R_`  r eA! y. pw$w  7w- @7 @ww 7    "  %   %  w|w x7 t '   %Xta7N%) w4w 0C ( D.A 7 9  1 .+ ) &  7 t7F y 7J y%Eww @@wj *    V  $   $  V  $  $&08F   >Txz$j 0bnrt  B \TSymbol table overflowNonterminated commentillegal floating point constantUnknown character$%d dc x'' dc x'%02x00' dc x'00' Long character constantNonterminated stringXXxXXxxiiXXIIIiYYYi  y iI iy   Y  Y YXiiX XY Y YYY    Y yIIHH_czero _cone _cvtab _opdope _ctab _symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel _notrel _nreg _cctab _efftab _regtab _nstack _nfloat _etoa _atoe _lookup"~lookuprpspnpdelpdelpenihashlpctrcsv L2L3,L4@L5L6pL7tL8L9L10L1L11L12L13L14L15_error _cexit L16L17L18cret _symbol"~symbolL20V basespcv2cidigV stateL21>L228L19L23NL24`L25Z_getchar L26`_getctab"pL28L29jL30xL31L32L33L34_subseq"L35L36L37L38 L39L40$L41>L42TL43nL44L45L46L47L48L50L51L52L53L54L55L56L57L49L10001L10002L10003L58L592L60L61>L10004VL10005ZL62^L63lmul L10006L64L65L69nL70 L71 L72 L73 L74 L75 L76 L77 L78 L79 L80 L81"L67L82$L83$L84$L85$L86NL87L88VL89VL90lL68L10009L10008L10015L10010L10011L10012L10013L10014L66L91L92L93_getcc"L94L95L96L10016L974L98$L99,L1004L101>L102tL103dL104zL105L106L107L27L10019L10018L10024FL10020L10021&L100220L100238~subseqabcL109L110L108_getstr" ~getstr slpctrcL112_printf L113 L1146_mapch"L115hL116TL117 L118 L119xL120 L121 L111~getcccccL123L124L125L126L127) L122~mapchacacL129L130L128lL132DL133L134L135A L136L1382L139L140 L141L142L143L144 L145*L137BL10026tL10027L10028:L131TL10030L10031L10032LL146bL147l~getctabpcL149L148cccccL123L124L125L126L127) L122~mapchacacL129L130L128lL132DL133L134L135A L136L1382L139L140 L141L142L143L144 L145*L137BL10026tL10027L10028:L131TL10030L10031L10032LL146b_czero _cone _cvtab _opdope _ctab _symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel _notrel _nreg _cctab _efftab _regtab _nstack _nfloat ksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimr <0w C  _h@ 5 %,%J _h55N& 55@5Nf 5}-   _he@ S%@%$IN& 5E@ :"7& 5-@ 5 E@-%@%$f 5 e e  ww %%B _BC c_e ec_%#3% % %Y   %chp  %c] 5@ N l% p <  7  yN % $%N % %&z %c  ww %% _ 5 Bu5%d_2%$2 %7  m75 %  5` 5`D7 @u %   5 N %  |  | 7er 7@ 5 %5%6%"8%4N5&  eNf l%j N Nf l%H D @_ %ZQ%_ N& 5&  eNf l%55 N Nf l%5u- Nf %uN _N 5@ 5Nf $ % _Nf %5_ @55  5@5 _ %eY%7 %%e     " % / 8    N@ 5 %O  %+%I %% _ @_ @ ȥ1D _@ " d _ 5%$ @1D 7< y%c  5@ _@ ȥ1@r _R  _r D@t A@`eP5 5%$u U 5-N& l%5e eN  % Nf %_5@ 55u 5uuN& l%55u- Nf %_5u u-5uc% % Nf %_ 2e #@ 0@ 5@ 5u@e5 u - N _+  x @ ȥ1@U   _ _%2e _N _  r e A! y$N _w :+ H  NP W f %wm  V %ef %e@w<=@A>?DEBC=EDCB"*Hghkn(jjD12FBB*~   V  h $  j  rcexper register errorIllegal initialization lr 0,%d ltr %d,%d No match for op %dcexpr register errorCompiler ftn call error s SP,=f'%d' lr %d,%d mvi %d(SP),x'80' la 1,%d(SP) la SP,%d(SP) FCALL s SP,=f'%d' la 1,%d sr 1,1 BCALL la SP,%d(SP) compiler error; star without sharp%dcompiler error; bad star entry std %d,%d(R12) temp st %d,%d(R12) temp lr %d,%d lr %d,%d Register overflow: simplify expression%d%d0%x%d(R12) tempasnoxNo match - binary op %dIllegal structure std %d st %d,%d(R12) conv args to ptrs for fortran la %d,%d(R12) std %d,%d(SP) st %d,%d(SP) 8Hh8h8   HHYYY  8     8YYYYH(Hx8xHx899H9H8xH 999YYYY_czero _cone _cvtab _opdope _ctab _symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel#r _notrel#| _nreg# _cctab _efftab _regtab _nstack _nfloat _flreg# _etoa _match"~matchnrleftopdopetreeiatreetabled1d2t1t2p2p1optcsv L2L1h_isfloat L3FL10000@L4FL5TL6V_dcalc L7L8L9L11L10L12L13dL15L16L14^L17_notcomp L18L19NL100016L208L21NL22NL23Zcret _rcexpr"l~rcexprlatabletreerregatreetableL10002L25L26B _error L24L27L29rL30_cbranch L31L32L33L34Y L35 _cexpr"L36L37(L38BL28L39DL40fL41p _printf L42jL43j_pow2 L10004 L10005 L10006zL44L45L46L47L48z L49 _sdepth# ~cexprcraregtreestringrregcprregatreetabletstatp1p2reg1opttempoffsargsL10007L51L52 L50 L532L54DL55LL56 L57`L58dL59L60zL61L10008L10009L10010L10011L62L63L64L65 L66L67_comarg"| L10012XL68_branch _label L69rL70L71`L72 L73_oddreg _chkleaf"$ L74L75L76L78 L79L80L81L82L83jL84 L85 L86L87L88L89L90L91%L92L93/L948L95L96L97@L98L99OL100L10013L101L10014L102L103L104L105_pname L106 L108nL109*L110>_putchar L111BL112BL10015TL113XL114lL115hL116lL107~L10017 L10018 L10019vL117L118L119L120L121L122rL123L124L125L126L127r L128L129L130>L131&L132u_collcon L133>L134L135L136L137L138L139L140L141L142L143L144L145 L146 L147L148$ L149d L150d L151B L152d L153d L154L155h L156 L157 L158 L159 L161 L162 L163 L164 L165 L166 L167 L168L169L160 L10021 L170 L171 L172" L173& L174$ L175J L176L177R L178L179V L180L181j L10022v L10023| _wexpr" L182 L183L77 L10026 L10025 L10031 L10027 L10028 L10029 L10030 ~wexpr treeoperatorL186 L187 L188 L189L185 L190 L191 L192L193 L194L195 L196L197 L198L199 L200L10033 L184 ~chkleaf$ lbuftreeregatreetableL202L L201x ~comarg| treelrtatreeL204 L2056L206 L207 L208HL209 L210PL211WL212L213J L214L215h L216L203n L185 L190 L191 L192L193 L194L195 L196|w u-@@ww D   %%%#  5 ww C%$_t[ __ _f %hs ?  w   Ge  >e  5  ,    7D y     x wpw lD  8$ 3 0 %  %  xt-ww BCE%E % % A @@0%  % A @@55EU%%! wBw >C%(%  % ww D 5%e %d ww DN  @  E U 7d y ww ~CB j _X R  _t55 9AWpA-2  f %,,  e ! %  * ev? T w^w ZCB 05  '4- k 4- 54t5 te  ww C  %   1 ww B "  %*.L wfw b DC B __ & 65& , e& eN & & e& & e_ & e& e5&  e& & eN C & & e3(7r y 5=Be %  & %ww DN& N  N ww @5@  w8;?CFJMPTW "4b*+,HIJZPPZPPv c r0,=f'%d' bh $%d lr r1,r0 sll r1,2 b *+4(r1) "56&bebnebnhblbnlbhblbnhbhbnl$%d=f'%d'=x'%04x%04x'%d+%d(R12)ss$&fnum+%d(R12)%.8s@%.7sIllegal structure reference$0Bad reg. reference%d$%dpname called illegally b $%d s 0,=f'%d' b $%d b $%d c 0,=f'%d' be $%d b $%d * End of switch code. Duplicate case (%d)b $%d %s88))))8_czero#_cone# _cvtab _opdope _ctab _symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel _notrel _nreg _cctab _efftab _regtab _nstack _nfloat _condop#|L18L2;L3?L4CL5FL6JL7ML8PL9TL10W_max"~maxabcsv L12L11cret _degree"~degreeattL10000,L140L13dL10001<L15BL16NL17^_pname"h~pnamehapipL19zL20zL22tL23L24L25[_printf L18L26L27_L28L29fL30L31L32sL34RL35L36L37wL38L39L40L41L42L43L44L45"L46_error L47L484L49@L50L51L33bL10003L10004L10005ZL52L21L10007L53_dcalc"~dcalcapnrleftpL55L54L57L58L59L60L61L10008L10009L10010L10011L10012L10013L62L56L10015L10016 L10017_notcomp"~notcompapatstpastL644L65ZL10018BL10019FL10020PL10021TL63L66L10022hL10023lL10024vL10025zL67L68L69L10026L10027_collcon"~collconapoppL71L72L70_isfloat"~isfloatattL74L75 L732L76._oddreg"6~oddreg6aregtregL78vL80fL81PL82PL83PL84PL77zL85ZL86ZL79vL10029L10030L10031n_dirsw#_pswitch"~~pswitch~fptlabtabsbestswpolppoctabTijafpalpncaseworstrangel1l2l3L89L90L88_sort"L91TL92L93L94L95RL97>L98 L99LL100 L96LL101L10032bL102L103bL104L106 L107* L105L108? L109T ~sortbpfplpafptalpintchL111L112L113L114L116L117k L110L118 L115 _ispow2""~ispow2"treedatreeL120TL121TL119X_pow2"\~pow2\treediatreeL123L124pL125zL126vL10033L10034L122_cbranch"~cbranchalblareg condtreelbuflblregatreel1L127L129L130L131_label L132"L133&L134VL135L136L10035L10036L128L10038(L10039.L10040L137_rcexpr L10041 L10042_branch1"~branch1opclblaopL1394_cbr"NL140<L141 L142 L138J~cbrNflagopL144dL145 L143xlblregatreel1L127L129L130nt| w B  _ _ 5_5 _5@  r_ 2 25 & j % r  @ & 5  ( & 5_ _Nf 2m% (A p%(  f&_L" ee%%e& x%#u- @Nf 2  r enA! yww C  M%g 3B 3%$%#2%#%$)% 4@ 4%  x  3wfw b`5 5 B 5Nef % 'C Caeu %% ef x% %(1 . %   _% %# A1l %*@ @a% f%( Ne Ce " & 5%*  5 u-$@ @ae54N @-@ @54 %*  & 2w|w x@ @me,55 De,D-_%*_%f5 Ce,C-N I%*E%@Ap,p( N \ AA 2r #AA 2r  e u-u5ue XA1@ @m5DC(@p@0@pAA 2rA1p 5 LN \ _KN& \ _ww DD- eww D@?=aHADp}B@ =@==Q:=x@4  %+A r=A r}@ t=@t= (  x ww BCJ- `f %f %_j J- E%*%.?%;%(7%1%*AfAVp@1 AADtp0(%( 5 " @ `, 5!@ `5,@ `,BD  `,wv~! t^hth hhN\Divide checkC error: const889x9X9XXX98X99X89X999h h 9889_czero _cone _cvtab _opdope _ctab _symbuf _hshused _hshtab _space _cp _cmst P_isn _isn1 _swtab _swp _contlab _brklab _retlab _deflab _autolen _peeksym _peekc _eof _line _treebas _defsym _funcsym _xdflg _proflg _csym _cval _fcval _nchstr _nerror _paraml _parame _strflg _osleft _mosflg _initflg _inhdr _dimtab _dimp _regvar _ndp _endp _xtern _ftern _fflg _functio _mainftn _mainfil _machine _hgoffs _hgcurlo _maprel _notrel _nreg _cctab _efftab _regtab _nstack _nfloat _optim"~optimopdopetreetatreed1d2csv L2L1L3"L46L5F_unoptim"L6fL7L_acommut"L8_degree L9_max L11L12L10L13L14L15 L16*L17\L18L19^_ispow2 L20tL21hL22hL23hL24hL25tL26tL27_const"xL28L10000L10001L10004nL10003L10008L10005vL10006~L10007cret ~unoptimsubtretreeatreeL30L29L31L322L33DL34|L36lL37NL38\L35|L10010~acommutoptreedaclitatreefltt1t2_isfloat _insert" L40&L41L42&L43 L44L45RL46^L39L47L48L49L50L51_distrib"L52L53L54RL10011:L10012>L55LL56|~distriblistdividendmaxnodmindivtp1p2ndmajndmindivisorL58L59L60L61L62L63~L64xL65<_squash"\L66L67xL68L57XL69@~squash\maxpnppL71dL72tL73nL70t~constxavopvpvL76L77L74L78L79L80L81L82L83L84L85_error L86L87L88L89L90L75L10014L91~insert oplisttreeditatreealistd1L93jL946L92jL95 L10015L96 L97L98L99L100^L102XL101XL76L77L74L78L79L80L81L82L83L84L85_error L86L87????????????"?/?8?J?S?i??tT?T????????'??F????a????q????P??T??& ??E ?a ?e ?s ?? ? ? ? ?? ? ?? ?T ? ???? ?( ?1 ?T= ?P ??` ?n ?T{ ? ?? ? ?? ? ?T ? ??. ?G ??V ?g ? T? T? ? ?1 W ?r  ? ?? T?T? ?]  ?  ? ??*T?T?^??&T?W??T?J????TTT?.T?`?? ?5?`??TT?T=T?h??0_???????j !#$"%h&eZP(b)b*+4,4-.0/0b1bFGHzIJLKLMNOf<34@hk( dc f'C1' dc a(A1) dc x'Q' b A1 F01 b #1(R) lfunc 15,A1 F20 lr 15,R sr R,R sr R,R ic R,A1 l R,A1 sdr FR,FR le FR,A1 ld FR,A1 lB1 R,A1 lr 0,R O 0,A2 stB1 0,A1 F01 lB1 0,#1(R) lr 1,0 O 1,A2 stB1 1,#1(R) lr R,0 F01 lr 1,R lB1 R,#1(1) lr 0,R O 0,A2 stB1 0,#1(1) la R,A1 l 1,A1 lB1 R,0(1) H01 sr 1,1 ic 1,~(R) lr R,1 H01 sdr FR,FR le FR,~(R) H01 lBF Z,~(R) F20 lcBFr Z,Z F20 x R,=x'ffffffff' S20 stB1 Z,A1 S20 l 1,A1 stB1 R,0(1) S20 movfi FR,R stB1 R,A1 S00F05 movfi FR,R stB1 R,#1(R1) F03S00 movfi FR,R stB1 R1,#1(R) lr R,R1 F01S04 stB1 R1,#1(R) lr R,R1 F03S20 l 1,T stB1 Z,#1(1) F20F20 srl R,C2 F00S04 srl R,0(R1) S02F20 l 1,T srl R,0(1) F20F20 sll R,C2 F00S04 sll R,0(R1) S02F20 l 1,T sll R,0(1) F00F20 OB2 Z,A2 F00S05 OB2 Z,#2(R1) F00S04 Or R,R1 S02F20 OBF Z,T sr R,R F00 n R,A2 F00S05 n R,#2(R1) F00S04 nr R,R1 S02F00 n R,T F00 m R-,A2 F00S05 m R-,#2(R1) F00S04 mr R-,R1 S02F00 m R-,T F00 mB2 FR,A2 S02F00 md FR,T F00 srda R,32 d R,A2 F00S05 l 0,#2(R1) srda R,32 dr R,0 F00S04 lr 0,R1 srda R,32 dr R,0 S02F00 srda R,32 d R,T F00 dB2 FR,A2 S02F00 dBF FR,T S00 sr 0,0 ic 0,A1 mr R-,0 stc R,A1 S00 m R-,A1 st R,A1 S00F05 sr 0,0 ic 0,#1(R1) mr R-,0 stc R,#1(R1) S00F05 m R-,#1(R1) st R,#1(R1) F03S00 l 1,T sr 0,0 ic 0,#1(1) mr R-,0 stc R,#1(1) F03S00 l 1,T m R-,#1(1) st R,#1(1) F00 mB2 FR,A2 stB1 FR,A1 S02F00 md FR,T stB1 FR,A1 F01 lB1 FR,#1(R) mB2 FR,A2 stB1 FR,#1(R) S02F01 lB1 FR,#1(R) md FR,T stB1 FR,#1(R) S00 lB1 0,A1 srda 0,32 dr 0,R stB1 1,A1 lr R+,1 S00F05 lB1 0,#1(R1) srda 0,32 dr 0,R stB1 1,#1(R1) lr R+,1 S02F01 lB1 0,#1(R) srda 0,32 d 0,T stB1 1,#1(R) lr R+,1 F00 dB2 FR,A2 stB1 FR,A1 S02F00 dd FR,T stB1 FR,A1 F01 lB1 FR,#1(R) mB2 FR,A2 stB1 FR,#1(R) S02F01 lB1 FR,#1(R) dd FR,T stB1 FR,#1(R) S00 lB1 0,A1 srda 0,32 dr 0,R stB1 0,A1 lr R,0 S00F05 lB1 0,#1(R1) srda 0,32 dr 0,R stB1 0,#1(R1) lr R,0 S02F01 lB1 0,#1(R) srda 0,32 d 0,T stB1 0,#1(R) lr R,0 lB1 R,A1 srl R,C2 stB1 R,A1 S00 lB1 1,A1 srl 1,0(R) stB1 1,A1 lr R,1 F01 lB1 1,#1(R) srl 1,C2 stB1 1,#1(R) lr R,1 S00F05 lB1 1,#1(R1) srl 1,0(R) stB1 1,#1(R1) lr R,1 S02F01 lB1 0,#1(R) l 1,T srl 0,0(1) stB1 0,#1(R) lr R,0 lB1 R,A1 sll R,C2 stB1 R,A1 S00 lB1 1,A1 sll 1,0(R) stB1 1,A1 lr R,1 F01 lB1 1,#1(R) sll 1,C2 stB1 1,#1(R) lr R,1 S00F05 lB1 1,#1(R1) sll 1,0(R) stB1 1,#1(R1) lr R,1 S02F01 lB1 0,#1(R) l 1,T sll 0,0(1) stB1 0,#1(R) lr R,0 S20 sr 1,1 ic 1,A1 Or R,1 stc R,A1 S20 OB1 Z,A1 stB1 Z,A1 F01 lB1 0,#1(R) O 0,A2 stB1 0,#1(R) lr R,0 S00F05 sr 0,0 ic 0,#1(R1) Or R,0 stc R,#1(R1) S00F05 O R,#1(R1) st R,#1(R1) F21 lr 1,R lB1 R,#1(1) O R,A2 stB1 R,#1(1) F03S00 l 1,T sr 0,0 ic 0,#1(1) Or R,0 stc R,#1(1) F03S20 l 1,T O R,#1(1) st R,#1(1) F01 l FR,#1(R) aB2 FR,A2 stB1 FR,#1(R) S02F01 l FR,#1(R) ad FR,T stB1 FR,#1(R) S20 sr 1,1 ic 1,A1 Or R,1 lcr R,R stc R,A1 l R,A1 O R,A2 st R,A1 S20 OB1 Z,A1 lcBFr Z,Z stB1 Z,A1 F01 sr 0,0 ic 0,#1(R) O 0,A2 stc 0,#1(R) lr R,0 S00F05 sr 0,0 ic 0,#1(R1) Or 0,R stc 0,#1(R1) lr R,0 F01 l 0,#1(R) O 0,A2 st 0,#1(R) lr R,0 S00F05 O R,#1(R1) lcr R,R st R,#1(R1) F21 lr 1,R sr R,R ic R,#1(1) O R,A2 stc R,#1(1) F03S00 l 1,T sr 0,0 ic 0,#1(1) Or 0,R stc 0,#1(1) lr R,0 F21 lr 1,R l R,#1(1) O R,A2 st R,#1(1) F03S20 l 1,T Or R,#1(1) lcr R,R st R,#1(1) F01 lB1 FR,#1(R) sB2 FR,A2 stB1 FR,#1(R) S02F01 lB1 FR,#1(R) sd FR,T stB1 FR,#1(R) l R,A1 movif FR,R F01 l R,#1(R) movif FR,R F20 movif FR,R F20 movfi FR,R _regtabo#L1L2L3L4L5L6L7"L8/L98L10JL11SL12iL13tL14L15L16L17L18'L19FL20aL21qL22L23L24L25L26L27L28& L29E L30a L31e L32s L33 L34 L35 L36 L37 L38 L39 L40 L41 L42 L43( L441 L45= L46P L47` L48n L49{ L50 L51 L52 L53 L54 L55 L56 L57. L58G L59V L60g L61 L62 L63 L64 L651 L66W L67r L68 L69 L70 L71 L72] L73 L74 L75 L76 L77*L78^L79L80L81L82&L83WL84L85L86L87L88JL89L90L91L92L93.L94`L95L96L97L98 L995L100`L101L102L103L104L105=L106hL107L108L109L1100L111_L112L113L114L115L116_regtab#T L76 L77*L78^L79L80L81L82T`???????? ?T?T?T?0????????@????P<=>?@ABCDEF20 ltBFr Z,Z F20 cBF Z,A2 F00S05 cBF Z,#2(R1) F00S04 cr R,R1 S02F20 cBF Z,T H00_cctabop#L1L2 L3L40L5@L6P_cctab#Z,Z F20 cBF Z,A2 F00S05 cBF Z,#2(R1) F00S04 cr R,R1 S02F20 cBF Z,T H00t w l*7 ran h& %% :D 0*0v   w****** %s(9_numb#t_getchar"~getcharL2L3L4buffercicsv L5L6^L7L8F_read L96L1pL10v_printf cret Added getchar.c to cause source lines interspersed as comments in output. TGS 06/07/76 Modified newcv.c to produce a 0 entry between each operator table. Also added 0 entries to end of tables in cctab.t and regtab.t. Remade c14.c and c15.c. TGS 06/08/76 Modified switch code in c11.c TGS 06/09/76 rL2L3L4buffercicsv L5L6^L7L8F_read L96L1pL10v_printf cret h 9889_czero _cone _cvtab _opdope