1: static char Sccsid[] = "aw.c @(#)aw.c 1.1 10/1/82 Berkeley "; 2: #include "apl.h" 3: 4: char *opname[] = { 5: 6: "eol", /* 0 */ 7: "add", /* 1 */ 8: "plus", /* 2 */ 9: "sub", /* 3 */ 10: "minus", /* 4 */ 11: "mul", /* 5 */ 12: "sgn", /* 6 */ 13: "div", /* 7 */ 14: "recip", /* 8 */ 15: "mod", /* 9 */ 16: "abs", /* 10 */ 17: "min", /* 11 */ 18: "floor", /* 12 */ 19: "max", /* 13 */ 20: "ceil", /* 14 */ 21: "pwr", /* 15 */ 22: "exp", /* 16 */ 23: "log", /* 17 */ 24: "loge", /* 18 */ 25: "cir", /* 19 */ 26: "pi", /* 20 */ 27: "comb", /* 21 */ 28: "fac", /* 22 */ 29: "deal", /* 23 */ 30: "rand", /* 24 */ 31: "drho", /* 25 */ 32: "mrho", /* 26 */ 33: "diot", /* 27 */ 34: "miot", /* 28 */ 35: "rot0", /* 29 */ 36: "rev0", /* 30 */ 37: "dtrn", /* 31 */ 38: "mtrn", /* 32 */ 39: "dibm", /* 33 */ 40: "mibm", /* 34 */ 41: "gdu", /* 35 */ 42: "gduk", /* 36 */ 43: "gdd", /* 37 */ 44: "gddk", /* 38 */ 45: "exd", /* 39 */ 46: "scan", /* 40 */ 47: "exdk", /* 41 */ 48: "scank", /* 42 */ 49: "iprod", /* 43 */ 50: "oprod", /* 44 */ 51: "quad", /* 45 */ 52: "qquad", /* 46 */ 53: "br0", /* 47 */ 54: "br", /* 48 */ 55: "ddom", /* 49 */ 56: "mdom", /* 50 */ 57: "com", /* 51 */ 58: "red", /* 52 */ 59: "comk", /* 53 */ 60: "redk", /* 54 */ 61: "rot", /* 55 */ 62: "rev", /* 56 */ 63: "rotk", /* 57 */ 64: "revk", /* 58 */ 65: "cat", /* 59 */ 66: "rav", /* 60 */ 67: "catk", /* 61 */ 68: "ravk", /* 62 */ 69: "print", /* 63 */ 70: "quot", /* 64 */ 71: "elid", /* 65 */ 72: "cquad", /* 66 */ 73: "comnt", /* 67 */ 74: "index", /* 68 */ 75: "hprint", /* 69 */ 76: 0, /* 70 */ 77: "lt", /* 71 */ 78: "le", /* 72 */ 79: "gt", /* 73 */ 80: "ge", /* 74 */ 81: "eq", /* 75 */ 82: "ne", /* 76 */ 83: "and", /* 77 */ 84: "or", /* 78 */ 85: "nand", /* 79 */ 86: "nor", /* 80 */ 87: "not", /* 81 */ 88: "eps", /* 82 */ 89: "meps", /* 83 */ 90: "rep", /* 84 */ 91: "take", /* 85 */ 92: "drop", /* 86 */ 93: "exd0", /* 87 */ 94: "asgn", /* 88 */ 95: "immed", /* 89 */ 96: "name", /* 90 */ 97: "const", /* 91 */ 98: "fun", /* 92 */ 99: "arg1", /* 93 */ 100: "arg2", /* 94 */ 101: "auto", /* 95 */ 102: "rest", /* 96 */ 103: "com0", /* 97 */ 104: "red0", /* 98 */ 105: "exd0", /* 99 */ 106: "scan0", /*100 */ 107: "base", /*101 */ 108: "format", /*102 */ /* format */ 109: "label", /*103 */ 110: "psi", /*104 */ 111: "psi1", /*105 */ 112: "psi2", /*106 */ 113: "isp", /*107 */ 114: "isp1", /*108 */ 115: "isp2", /*109 */ 116: "Lwidth", /*110 */ 117: "Lfuzz", /*111 */ 118: "Lrun", /*112 */ 119: "Lfork", /*113 */ 120: "Lwait", /*114 */ 121: "Lexec", /*115 */ 122: "Lfx", /*116 */ 123: "Lexit", /*117 */ 124: "Lpipe", /*118 */ 125: "Lchdir", /*119 */ 126: "Lopen", /*120 */ 127: "Lclose", /*121 */ 128: "Lread", /*122 */ 129: "Lwrite", /*123 */ 130: "Lcreat", /*124 */ 131: "Lseek", /*125 */ 132: "Lrm", /*126 */ 133: "Lrd", /*127 */ 134: "Ldup", /*128 */ 135: "Lap", /*129 */ 136: "Lkill", /*130 */ 137: "Lcr", /*131 */ 138: "dfmt", /*132 */ 139: "mfmt", /*133 */ 140: "Lnc", /*134 */ 141: "nilret", /*135 */ 142: "Llx", /*136 */ 143: "ibr", /*137 */ 144: "ibr0", /*138 */ 145: "rval", /*139 */ 146: "Lsig", /*140 */ 147: "Lfloat", /*141 */ 148: "Lnl", /*142 */ 149: }; 150: 151: dump(cp, flag) 152: char *cp; 153: { 154: register char *s, *t; 155: register i; 156: 157: s = cp; 158: if(flag) 159: printf("[ "); 160: 161: loop: 162: putchar(' '); 163: if(column > 50) 164: if(flag) 165: printf(" ]\n[ "); 166: else 167: putchar('\n'); 168: i = *s++; 169: if(i != EOF) 170: i &= 0377; 171: if(i >= 0 && i <= 140 && opname[i]) { 172: t = opname[i]; 173: while(*t) 174: putchar(*t++); 175: } else if(i != EOF) 176: printf("%d ", i); 177: switch(i) { 178: 179: case EOL: 180: if(*s != EOL) 181: break; 182: case EOF: 183: printf("."); 184: if(flag) 185: printf(" ]."); 186: putchar('\n'); 187: return; 188: 189: case QUOT: 190: i = *s++; 191: s += i; 192: break; 193: 194: case CONST: 195: i = *s++; 196: s += i*SDAT; 197: break; 198: 199: case NAME: 200: case FUN: 201: case ARG1: 202: case ARG2: 203: case AUTO: 204: case REST: 205: case RVAL: 206: s += copy(IN, s, &cp, 1); 207: putchar('-'); 208: t = ((struct nlist *)cp)->namep; 209: while(*t) 210: putchar(*t++); 211: break; 212: 213: case INDEX: 214: case IMMED: 215: s++; 216: break; 217: } 218: goto loop; 219: }