const char *snl; extern int rem(int p, int q); extern void readsymbol(int typeof_P, void *p); extern real float(int n); extern char * tostring(int p); extern char * substring(char *s, int f, int t); extern int freespace(); extern void svc(int n, struct (null) *r); extern int addr(int typeof_P, void *p); extern int *integer(int n); extern short *shortinteger(int n); extern char *byteinteger(int n); extern char * *string(int n); extern struct (null) record ; (/*should not get here any more*/ int n; /*or here*/) extern real *real(int n); extern long real *longreal(int n); extern char *length(char *s); extern char *charno(char *s, int n); extern int int(real x); extern int intpt(real x); extern void iocp(int n); extern int typeof(int typeof_N, void *n); extern int sizeof(int typeof_N, void *n); extern real fracpt(real x); extern void prompt(char *s); extern int nextsymbol(); extern void skipsymbol(); extern void printsymbol(int sym); extern void printstring(char *s); extern void write(int v, int p); extern void selectinput(int n); extern void selectoutput(int n); extern void openinput(int n, char *fd); extern void openoutput(int n, char *fd); extern void closeinput(); extern void closeoutput(); extern void resetinput(); extern void resetoutput(); extern char * time(); extern char * date(); extern int cputime(); extern int *comreg(int n); extern void read(int typeof_X, void *x); extern void print(real val, int before, int after); extern void printfl(real val, int places); extern void space(); extern void spaces(int n); extern void newline(); extern void newlines(int n); typedef struct FILEFM{int unit; int owner; int n1; int n2;} filefm; typedef struct EVENTFM{int event; int sub; int extra; char *message; int pc; int x;} eventfm; extern struct EVENTFM event; int main(int argc, char **argv) { const char *programep; const char *systemprefix; // bounds [0 : 6] // do it now: const char *vsize {NO INIT} // bounds [0 : 6] // do it now: const char *genmap {NO INIT} // bounds [1 : 11] // do it now: const char * *permname {NO INIT} typedef struct VARFM{char type; char form; char level; char scope; char dim; int disp; int format; int size; int pbase; int extra;} varfm; // ON DIM DO: struct VARFM *var struct VARFM *var = ARRAY(struct VARFM , var, 1, 0, 600) DIM 0x0001 0x0001 struct VARFM *decvar; struct VARFM begin; typedef struct STACKFM{char type; char form; char aform; char base; char scope; char dim; int disp; int format; int size; int pbase; int extra; int varno;} stackfm; // ON DIM DO: struct STACKFM *stack struct STACKFM *stack = ARRAY(struct STACKFM , stack, 1, 1, 16) DIM 0x0001 0x0001 struct STACKFM null; struct STACKFM *top; typedef struct LABELFM{int id; int tag;} labelfm; // ON DIM DO: struct LABELFM *labels struct LABELFM *labels = ARRAY(struct LABELFM , labels, 1, 1, 50) DIM 0x0001 0x0001 // bounds [0 : 16] // do it now: static int *activity {NO INIT} static int claimed; // bounds [1 : 8] // do it now: static int *displayhint {NO INIT} static int fpustack; typedef struct GPTAG{int info; int addr; int flags; int link;} gptag; // ON DIM DO: struct GPTAG *gptags struct GPTAG *gptags = ARRAY(struct GPTAG , gptags, 1, 0, 100) DIM 0x0001 0x0001 int gpasl; static int control; static int diagnose; static int nextcad; static int level; int sym; int nextsym; int vlb; int vub; static int currentline; static int stp; int datasize; static int frame; int parms; static int invert; static int compareunsign; static int uncondjump; static int blocktype; static int inparams; int decl; int otype; int owntype; int ownform; int spec; int frozen; int potype; int dim; int i; int j; static int fpresultloc; // ON DIM DO: char *datat char *datat = ARRAY(char , datat, 1, 0, 12000) DIM 0x0001 0x0001 static int datatp; // ON DIM DO: int *swtab int *swtab = ARRAY(int , swtab, 1, 0, 1000) DIM 0x0001 0x0001 static int swtp; static char *externalid; static char *alias; static char *internalid; char *cslen; // ON DIM DO: char *currentstring char *currentstring = ARRAY(char , currentstring, 1, 0, 255) DIM 0x0001 0x0001 int xlen; // ON DIM DO: char *xsymbuff char *xsymbuff = ARRAY(char , xsymbuff, 1, 0, 255) DIM 0x0001 0x0001 // bounds [1 : 16] // do it now: static int *worklist {NO INIT} long real rvalue; static int ownval; goto L_0001; void show(struct STACKFM *v) { write(v->closeoutput, 3); printstring(" : Typ="); write(v->type, 1); printstring(" Frm="); write(v->form, 1); printstring(" Bse="); write(v->base, 1); printstring(" Dsp="); write(v->disp, 4); printstring(" Siz="); write(v->size, 1); printstring(" Xtr="); write(v->extra, 1); printstring(" Fmt="); write(v->format, 1); printstring(" Dim="); write(v->dim, 1); printstring(" Pba="); write(v->pbase, 1); newline(); return(0); } L_0001: goto L_0002; void abort(char *message) { int j; selectoutput(0); printstring("Pass 2 abandoned at line "); write(currentline, 1); printstring(" : "); printstring(message); newline(); if (stp == 0) goto L_0003; printstring("STACK:"); newline(); for (j = 1; j += 1; j != stp) { show(stack[j]); } L_0007: L_0003: exit(0); L_0002: goto L_0008; void warn(int n) { // bounds [1 : 8] /*todo: gcc jump table extension*/ void **w; selectoutput(0); printstring("*WARNING: line"); write(currentline, 1); printstring(": "); goto *w[n]; w_1: printstring("division by zero"); goto U_007b; w_2: printstring("Illegal FOR"); goto U_007b; w_3: printstring("Non-local control variable?"); goto U_007b; w_4: printstring("Invalid parameter for READ SYMBOL"); goto U_007b; w_5: printstring("String constant too long"); goto U_007b; w_6: printstring("No. of shifts outwith 0..31"); goto U_007b; w_7: printstring("Illegal constant exponent"); goto U_007b; w_8: printstring("Numerical constant too big"); goto U_007b; U_007b: newline(); selectoutput(1); L_0008: goto L_0009; void monitor(struct STACKFM *v, char *text) { selectoutput(0); printstring(text); printsymbol(58); spaces((10 - *length(text))); show(*v); selectoutput(1); L_0009: goto L_000a; int getgptag() { int l; if (gpasl != 0) goto L_000b; abort("GP Tags"); L_000b: l = gpasl; gpasl = gptags[l].link; return(l); L_000a: goto L_000c; void retgptag(int index) { gptags[index].link = gpasl; gpasl = index; L_000c: goto L_000d; void writenibble(int n) { n = (n & 15); if (0 > n) goto L_000e; if (n > 9) goto L_000e; printsymbol((n + 48)); goto L_000f; L_000e: printsymbol((n + (65 - 10))); L_000f: L_000d: goto L_0010; void writehex(int n, int places) { int p; int shift; shift = ((places - 1) * 4); for (;;) { L_0011: if (shift <= 0) goto L_0012; p = (n >> shift); writenibble(p); shift = (shift - 4); } L_0012: writenibble(n); L_0010: goto L_0013; void writeifrecord(int type, int length, char * /*12*/ buffer) { int c1; int c2; int i; selectoutput(1); printsymbol((65 + type)); if (length <= 255) goto L_0014; abort("Intermediate file record too long"); L_0014: writenibble((length >> 4)); writenibble((length & 15)); i = 0; for (;;) { L_0015: if (length <= 0) goto L_0016; c1 = (buffer[i] >> 4); c2 = (buffer[i] & 15); writenibble(c1); writenibble(c2); i = (i + 1); length = (length - 1); } L_0016: newline(); L_0013: static int objectptr; // bounds [0 : 7] // do it now: static char *objectbytes; /* uninitialised */ static int listptr; // bounds [0 : 7] // do it now: static char *listbytes; /* uninitialised */ goto L_0017; void listpreamble() { int i; selectoutput(2); space(); writehex(nextcad, 4); space(); for (i = 0; i += 1; i != 7) { if (i >= listptr) goto L_001c; writehex(listbytes[i], 2); space(); goto L_001d; L_001c: spaces(3); L_001d: } L_001b: spaces(8); nextcad = (nextcad + listptr); listptr = 0; L_0017: goto L_001e; void flushcode() { if (objectptr == 0) goto L_001f; writeifrecord(0, objectptr, objectbytes); objectptr = 0; L_001f: L_001e: goto L_0020; void putbyte(int b) { listbytes[listptr] = b; listptr = (listptr + 1); objectbytes[objectptr] = b; objectptr = (objectptr + 1); L_0020: goto L_0021; int issmall(int i) { if (i >= 128) goto L_0022; if (i <= (-128)) goto L_0022; return(1); L_0022: return(0); L_0021: goto L_0023; void modrmreg(int reg1, int reg2) { putbyte(((192 | (reg1 << 3)) | reg2)); L_0023: // bounds [0 : 6] // do it now: const int *reltag {NO INIT} goto L_0024; void relocateoffset(int reloc, int offset) { int tag; if (reloc == 0) goto L_0025; flushcode(); L_0025: putbyte((offset & 255)); putbyte((offset >> 8)); if (reloc == 0) goto L_0026; tag = reltag[reloc]; writeifrecord(tag, 2, objectbytes); objectptr = 0; L_0026: L_0024: goto L_0027; void modrmmem(int reg1, int base, int disp) { int mod; int rm; int reloc; reloc = (base >> 4); base = (base & 15); if (base != 0) goto L_0028; putbyte(((reg1 << 3) | 6)); relocateoffset(reloc, disp); goto L_0029; L_0028: if (disp != 0) goto L_002a; mod = 0; goto L_002b; L_002a: if (issmall(disp) == 0) goto L_002c; mod = 1; goto L_002d; L_002c: mod = 2; L_002d: L_002b: if (reloc == 0) goto L_002e; mod = 2; L_002e: if (base != 6) goto L_002f; rm = 6; goto L_0030; L_002f: if (base != 4) goto L_0031; rm = 7; goto L_0032; L_0031: if (base != 8) goto L_0033; rm = 5; goto L_0034; L_0033: if (base != 7) goto L_0035; rm = 4; goto L_0036; L_0035: abort("Internal address mode error"); L_0036: L_0034: L_0032: L_0030: putbyte((((mod << 6) | (reg1 << 3)) | rm)); if (mod != 1) goto L_0037; putbyte(disp); goto L_0038; L_0037: if (mod != 2) goto L_0039; relocateoffset(reloc, disp); L_0039: L_0038: L_0029: L_0027: // bounds [1 : 8] // do it now: const char * *regname {NO INIT} // bounds [17 : 24] // do it now: const char * *reg8name {NO INIT} // bounds [0 : 6] // do it now: const char * *relocname {NO INIT} goto L_003a; void printmemref(int base, int disp) { int reloc; reloc = (base >> 4); base = (base & 15); selectoutput(2); printsymbol(91); if (base == 0) goto L_003b; printstring(regname[base]); if (reloc == 0) goto L_003c; printsymbol(43); printstring(relocname[reloc]); L_003c: if (disp == 0) goto L_003d; if (disp <= 0) goto L_003e; printsymbol(43); L_003e: write(disp, 1); L_003d: goto L_003f; L_003b: if (reloc == 0) goto L_0040; printstring(relocname[reloc]); printsymbol(43); L_0040: writehex(disp, 4); L_003f: printsymbol(93); L_003a: // bounds [0 : 35] // do it now: const char * *opname {NO INIT} // bounds [0 : 35] // do it now: const char *opvalue {NO INIT} // bounds [0 : 35] // do it now: const char *op8value {NO INIT} goto L_0041; void dumpsimple(int opn) { putbyte(opvalue[opn]); listpreamble(); printstring(opname[opn]); newline(); flushcode(); L_0041: goto L_0042; void dumprepmovsb() { putbyte(243); putbyte(164); listpreamble(); printstring("REP MOVSB"); newline(); flushcode(); L_0042: goto L_0043; void dumprepstosb() { putbyte(243); putbyte(170); listpreamble(); printstring("REP STOSB"); newline(); flushcode(); L_0043: goto L_0044; void dumpur(int opn, int reg) { // bounds [4 : 23] /*todo: gcc jump table extension*/ void **ops; displayhint[reg] = 0; goto *ops[opn]; ops_4: putbyte(((72 + reg) - 1)); goto U_0099; ops_5: putbyte(((64 + reg) - 1)); goto U_0099; ops_6: putbyte(247); modrmreg(3, (reg - 1)); goto U_0099; ops_7: putbyte(247); modrmreg(2, (reg - 1)); goto U_0099; ops_8: putbyte(((88 + reg) - 1)); goto U_0099; ops_9: putbyte(((80 + reg) - 1)); goto U_0099; ops_22: putbyte(247); modrmreg(7, (reg - 1)); goto U_0099; ops_23: putbyte(247); modrmreg(5, (reg - 1)); U_0099: listpreamble(); printstring(opname[opn]); space(); printstring(regname[reg]); newline(); flushcode(); L_0044: goto L_0045; void dumpum(int opn, int base, int disp) { // bounds [4 : 35] /*todo: gcc jump table extension*/ void **ops; goto *ops[opn]; ops_4: putbyte(255); modrmmem(1, base, disp); goto U_009b; ops_5: putbyte(255); modrmmem(0, base, disp); goto U_009b; ops_6: putbyte(247); modrmmem(3, base, disp); goto U_009b; ops_7: putbyte(247); modrmmem(2, base, disp); goto U_009b; ops_8: putbyte(143); modrmmem(0, base, disp); goto U_009b; ops_9: putbyte(255); modrmmem(6, base, disp); goto U_009b; ops_22: putbyte(247); modrmmem(7, base, disp); goto U_009b; ops_23: putbyte(247); modrmmem(5, base, disp); goto U_009b; ops_35: putbyte(255); modrmmem(4, base, disp); ops_24: putbyte(255); modrmmem(2, base, disp); U_009b: listpreamble(); printstring(opname[opn]); printstring(" WORD "); printmemref(base, disp); newline(); flushcode(); L_0045: goto L_0046; void dumpum8(int opn, int base, int disp) { int baseop; int index; if (opn == 4) goto L_0047; if (opn != 5) goto L_0048; L_0047: baseop = 254; if (opn != 4) goto L_0049; index = 1; goto L_004a; L_0049: index = 0; L_004a: goto L_004b; L_0048: if (opn == 7) goto L_004c; if (opn != 6) goto L_004d; L_004c: baseop = 246; if (opn != 7) goto L_004e; index = 2; goto L_004f; L_004e: index = 3; L_004f: goto L_0050; L_004d: abort("Invalid UM8"); L_0050: L_004b: putbyte(baseop); modrmmem(index, base, disp); listpreamble(); printstring(opname[opn]); printstring(" BYTE "); printmemref(base, disp); newline(); flushcode(); L_0046: goto L_0051; void dumpmr(int opn, int base, int disp, int reg) { if (opn != 20) goto L_0052; putbyte(211); modrmmem(4, base, disp); goto L_0053; L_0052: if (opn != 21) goto L_0054; putbyte(211); modrmmem(5, base, disp); goto L_0055; L_0054: putbyte(opvalue[opn]); modrmmem((reg - 1), base, disp); L_0055: L_0053: listpreamble(); printstring(opname[opn]); space(); printmemref(base, disp); printsymbol(44); printstring(regname[reg]); newline(); flushcode(); L_0051: goto L_0056; void dumpmr8(int opn, int base, int disp, int reg) { if (opn != 20) goto L_0057; putbyte(210); modrmmem(4, base, disp); goto L_0058; L_0057: if (opn != 21) goto L_0059; putbyte(210); modrmmem(5, base, disp); goto L_005a; L_0059: putbyte(op8value[opn]); modrmmem((reg - 17), base, disp); L_005a: L_0058: listpreamble(); printstring(opname[opn]); space(); printmemref(base, disp); printsymbol(44); printstring(reg8name[reg]); newline(); flushcode(); L_0056: goto L_005b; void dumprm(int opn, int reg, int base, int disp) { if (reg != 1) goto L_005c; if (opn != 11) goto L_005c; if ((base & 15) != 0) goto L_005c; putbyte(161); relocateoffset((base >> 4), disp); goto L_005d; L_005c: displayhint[reg] = 0; putbyte((opvalue[opn] + 2)); modrmmem((reg - 1), base, disp); L_005d: listpreamble(); printstring(opname[opn]); space(); printstring(regname[reg]); printsymbol(44); printmemref(base, disp); newline(); flushcode(); L_005b: goto L_005e; void dumprm8(int opn, int reg, int base, int disp) { putbyte((op8value[opn] + 2)); modrmmem((reg - 17), base, disp); listpreamble(); printstring(opname[opn]); space(); printstring(reg8name[reg]); printsymbol(44); printmemref(base, disp); newline(); flushcode(); L_005e: goto L_005f; void dumprr(int opn, int reg1, int reg2) { displayhint[reg1] = 0; if (opn != 20) goto L_0060; putbyte(211); modrmreg(4, (reg1 - 1)); goto L_0061; L_0060: if (opn != 21) goto L_0062; putbyte(211); modrmreg(5, (reg1 - 1)); goto L_0063; L_0062: putbyte(opvalue[opn]); modrmreg((reg2 - 1), (reg1 - 1)); L_0063: L_0061: listpreamble(); printstring(opname[opn]); space(); printstring(regname[reg1]); printsymbol(44); printstring(regname[reg2]); newline(); flushcode(); L_005f: goto L_0064; void dumprr8(int opn, int reg1, int reg2) { if (opn != 20) goto L_0065; putbyte(210); modrmreg(4, (reg1 - 17)); goto L_0066; L_0065: if (opn != 21) goto L_0067; putbyte(210); modrmreg(5, (reg1 - 17)); goto L_0068; L_0067: putbyte(op8value[opn]); modrmreg((reg2 - 17), (reg1 - 17)); L_0068: L_0066: listpreamble(); printstring(opname[opn]); space(); printstring(reg8name[reg1]); printsymbol(44); printstring(reg8name[reg2]); newline(); flushcode(); L_0064: // bounds [0 : 19] // do it now: const char *aximmediatevalue {NO INIT} goto L_0069; void dumprioffset(int opn, int reg, int reloc, int immed) { int subop; // bounds [11 : 21] /*todo: gcc jump table extension*/ void **ops; displayhint[reg] = 0; reloc = (reloc >> 4); if (reg != 1) goto L_006a; if (opn > 19) goto L_006a; putbyte(aximmediatevalue[opn]); relocateoffset(reloc, immed); goto U_00a6; L_006a: goto *ops[opn]; ops_11: putbyte(((184 + reg) - 1)); relocateoffset(reloc, immed); goto U_00a6; ops_14: subop = 0; goto U_00a7; ops_13: subop = 2; goto U_00a7; ops_16: subop = 7; goto U_00a7; ops_18: subop = 5; U_00a7: if (issmall(immed) == 0) goto L_006b; if (reloc != 0) goto L_006b; putbyte(131); modrmreg(subop, (reg - 1)); putbyte((immed & 255)); goto L_006c; L_006b: putbyte(129); modrmreg(subop, (reg - 1)); relocateoffset(reloc, immed); L_006c: goto U_00a6; ops_15: subop = 4; goto U_00a8; ops_17: subop = 1; goto U_00a8; ops_19: subop = 6; U_00a8: putbyte(129); modrmreg(subop, (reg - 1)); relocateoffset(reloc, immed); goto U_00a6; ops_20: putbyte(209); modrmreg(4, (reg - 1)); goto U_00a6; ops_21: putbyte(209); modrmreg(5, (reg - 1)); U_00a6: listpreamble(); printstring(opname[opn]); space(); printstring(regname[reg]); printsymbol(44); if (reloc == 0) goto L_006d; printstring(relocname[reloc]); printsymbol(43); L_006d: write(immed, 1); newline(); flushcode(); L_0069: goto L_006e; void dumpri(int opn, int reg, int immed) { dumprioffset(opn, reg, 0, immed); L_006e: goto L_006f; void dumpmi(int opn, int base, int disp, int immed) { int subop; // bounds [11 : 21] /*todo: gcc jump table extension*/ void **ops; goto *ops[opn]; ops_11: putbyte(199); modrmmem(0, base, disp); putbyte((immed & 255)); putbyte((immed >> 8)); goto U_00a8; ops_14: subop = 0; goto U_00a9; ops_13: subop = 2; goto U_00a9; ops_16: subop = 7; goto U_00a9; ops_18: subop = 5; U_00a9: if (issmall(immed) == 0) goto L_0070; putbyte(131); modrmmem(subop, base, disp); putbyte((immed & 255)); goto L_0071; L_0070: putbyte(129); modrmmem(subop, base, disp); putbyte((immed & 255)); putbyte((immed >> 8)); L_0071: goto U_00a8; ops_15: subop = 4; goto U_00aa; ops_17: subop = 1; goto U_00aa; ops_19: subop = 6; U_00aa: putbyte(129); modrmmem(subop, base, disp); putbyte((immed & 255)); putbyte((immed >> 8)); goto U_00a8; ops_20: putbyte(209); modrmmem(4, base, disp); goto U_00a8; ops_21: putbyte(209); modrmmem(5, base, disp); U_00a8: listpreamble(); printstring(opname[opn]); printstring(" WORD "); printmemref(base, disp); printsymbol(44); write(immed, 1); newline(); flushcode(); L_006f: goto L_0072; void dumpmi8(int opn, int base, int disp, int immed) { int subop; // bounds [11 : 21] /*todo: gcc jump table extension*/ void **ops; goto *ops[opn]; ops_11: putbyte(198); modrmmem(0, base, disp); putbyte((immed & 255)); goto U_00a9; ops_14: subop = 0; goto U_00aa; ops_13: subop = 2; goto U_00aa; ops_16: subop = 7; goto U_00aa; ops_18: subop = 5; goto U_00aa; ops_15: subop = 4; goto U_00aa; ops_17: subop = 1; goto U_00aa; ops_19: subop = 6; U_00aa: putbyte(128); modrmmem(subop, base, disp); putbyte((immed & 255)); goto U_00a9; ops_20: putbyte(208); modrmmem(4, base, disp); goto U_00a9; ops_21: putbyte(208); modrmmem(5, base, disp); U_00a9: listpreamble(); printstring(opname[opn]); printstring(" BYTE "); printmemref(base, disp); printsymbol(44); write(immed, 1); newline(); flushcode(); L_0072: goto L_0073; void dumprv(int opn, int reg, struct STACKFM *v) { if (v->form != 1) goto L_0074; dumprr(opn, reg, v->base); goto L_0075; L_0074: if (v->form != 4) goto L_0076; dumprm(opn, reg, (v->base | v->scope), v->disp); goto L_0077; L_0076: if (v->form != 0) goto L_0078; dumprioffset(opn, reg, v->scope, v->disp); goto L_0079; L_0078: abort("Address Mode"); L_0079: L_0077: L_0075: L_0073: goto L_007a; void dumppushi(int reloc, int immed) { reloc = (reloc >> 4); if (reloc != 0) goto L_007b; if (issmall(immed) == 0) goto L_007b; putbyte(106); putbyte((immed & 255)); goto L_007c; L_007b: putbyte(104); relocateoffset(reloc, immed); L_007c: listpreamble(); printstring("PUSH"); space(); if (reloc == 0) goto L_007d; printstring(relocname[reloc]); printsymbol(43); L_007d: write(immed, 1); newline(); flushcode(); L_007a: goto L_007e; void dumpvpush(struct STACKFM *v) { if (v->form != 1) goto L_007f; dumpur(9, v->base); goto L_0080; L_007f: if (v->form != 4) goto L_0081; dumpum(9, (v->base | v->scope), v->disp); goto L_0082; L_0081: if (v->form != 0) goto L_0083; dumppushi(v->scope, v->disp); goto L_0084; L_0083: abort("Push Mode"); L_0084: L_0082: L_0080: L_007e: // bounds [36 : 53] // do it now: const char * *flopname {NO INIT} // bounds [36 : 53] // do it now: const char *flprefix {NO INIT} // bounds [36 : 53] // do it now: const char *flindex {NO INIT} goto L_0085; void dumpfloprm(int opn, int base, int disp) { if (opn > 38) goto L_0086; fpustack = (fpustack + 1); if (fpustack <= 8) goto L_0087; abort("FPU Stack Overflow"); L_0087: goto L_0088; L_0086: fpustack = (fpustack - 1); if (fpustack >= 0) goto L_0089; abort("FPU Stack Underflow"); L_0089: L_0088: putbyte(155); putbyte(flprefix[opn]); modrmmem(flindex[opn], base, disp); listpreamble(); printstring(flopname[opn]); space(); printmemref(base, disp); newline(); flushcode(); L_0085: goto L_008a; void dumpfloprr(int opn, int reg1, int reg2) { int top; top = (fpustack + (9 - 1)); if (reg2 == top) goto L_008b; abort("FPU Stack Address"); L_008b: if (opn >= 49) goto L_008c; fpustack = (fpustack - 1); if (opn != 48) goto L_008d; fpustack = (fpustack - 1); L_008d: if (fpustack >= 0) goto L_008e; abort("FPU Stack Underflow"); L_008e: L_008c: putbyte(155); putbyte(flprefix[opn]); putbyte((flindex[opn] | (top - reg1))); listpreamble(); printstring(flopname[opn]); space(); printstring("ST("); write((top - reg1), 1); printstring("),ST"); newline(); flushcode(); L_008a: goto L_008f; void dumpflopspec(int opn) { if (opn < 52) goto L_0090; fpustack = (fpustack + 1); if (fpustack <= 8) goto L_0091; abort("FPU Stack Overflow"); L_0091: L_0090: putbyte(155); putbyte(flprefix[opn]); putbyte(flindex[opn]); listpreamble(); printstring(flopname[opn]); newline(); flushcode(); L_008f: goto L_0092; void dumpjump(int opn, int labelid) { int jtype; int count; putbyte(opvalue[opn]); putbyte(0); if (opn != 24) goto L_0093; putbyte(0); L_0093: listpreamble(); printstring(opname[opn]); space(); printsymbol(76); write(labelid, 1); newline(); objectptr = 0; count = 0; if (opn != 35) goto L_0094; jtype = 4; goto L_0095; L_0094: if (opn != 24) goto L_0096; jtype = 6; goto L_0097; L_0096: jtype = 5; objectbytes[0] = (opn - 25); count = 1; L_0097: L_0095: objectbytes[count] = (labelid & 255); objectbytes[(count + 1)] = (labelid >> 8); writeifrecord(jtype, (count + 2), objectbytes); if (opn != 24) goto L_0098; displayhint[4] = 0; displayhint[7] = 0; displayhint[8] = 0; L_0098: L_0092: goto L_0099; void dumpextcall(int labelid) { displayhint[4] = 0; displayhint[7] = 0; displayhint[8] = 0; putbyte(opvalue[24]); flushcode(); putbyte((labelid & 255)); putbyte((labelid >> 8)); listpreamble(); printstring("CALL EXTERN"); write(labelid, 1); newline(); writeifrecord(12, 2, objectbytes); objectptr = 0; L_0099: goto L_009a; void dumplabel(int labelid) { selectoutput(2); space(); writehex(nextcad, 4); spaces(22); printsymbol(76); write(labelid, 1); printstring(" EQU $"); newline(); objectbytes[0] = (labelid & 255); objectbytes[1] = (labelid >> 8); writeifrecord(7, 2, objectbytes); displayhint[4] = 0; displayhint[7] = 0; displayhint[8] = 0; L_009a: goto L_009b; void dumpstaticalloc(int which) { putbyte(131); putbyte(236); putbyte(0); listpreamble(); printstring("SUB SP,00"); newline(); objectptr = 0; objectbytes[0] = (which & 255); objectbytes[1] = (which >> 8); writeifrecord(8, 2, objectbytes); L_009b: goto L_009c; void dumpstaticfill(int which, int size) { objectptr = 0; objectbytes[0] = (which & 255); objectbytes[1] = (which >> 8); objectbytes[2] = (size & 255); objectbytes[3] = (size >> 8); writeifrecord(9, 4, objectbytes); L_009c: goto L_009d; void dumpcdword(int word, int which) { int tag; int tmpcad; int hi; int lo; static int cptr; static int dptr; static int sptr; tmpcad = nextcad; if (which != 2) goto L_009e; tag = 16; nextcad = sptr; sptr = (sptr + 2); goto L_009f; L_009e: if (which != 1) goto L_00a0; tag = 14; nextcad = cptr; cptr = (cptr + 2); goto L_00a1; L_00a0: tag = 15; nextcad = dptr; dptr = (dptr + 2); L_00a1: L_009f: hi = (word >> 8); lo = (word & 255); putbyte(lo); putbyte(hi); listpreamble(); printstring("db "); writehex(lo, 2); printsymbol(44); writehex(hi, 2); printstring(" ; "); if (lo <= 32) goto L_00a2; if (lo >= 127) goto L_00a2; printsymbol(lo); goto L_00a3; L_00a2: printsymbol(46); L_00a3: if (hi <= 32) goto L_00a4; if (hi >= 127) goto L_00a4; printsymbol(hi); goto L_00a5; L_00a4: printsymbol(46); L_00a5: newline(); writeifrecord(tag, 2, objectbytes); objectptr = 0; nextcad = tmpcad; L_009d: goto L_00a6; void dumplinenumber(int line) { // ON DIM DO: char *buffer char *buffer = ARRAY(char , buffer, 1, 0, 1) DIM 0x0001 0x0001 static int lastcad; if (nextcad == lastcad) goto L_00a7; buffer[0] = (line & 255); buffer[1] = (line >> 8); writeifrecord(21, 2, buffer); lastcad = nextcad; L_00a7: L_00a6: goto L_00a8; void strtoxsym(char * *s) { int l; l = *length(s); xlen = 0; for (;;) { L_00a9: if (xlen >= l) goto L_00aa; xsymbuff[xlen] = *charno(s, (xlen + 1)); xlen = (xlen + 1); } L_00aa: L_00a8: goto L_00ab; void dumpsourcename(char *filename) { strtoxsym(filename); writeifrecord(17, xlen, xsymbuff); L_00ab: goto L_00ac; void fillexternal(int seg, int offset, char *extname) { strtoxsym(extname); if (seg != 112) goto L_00ad; writeifrecord(18, xlen, xsymbuff); goto L_00ae; L_00ad: writeifrecord(19, xlen, xsymbuff); L_00ae: L_00ac: goto L_00af; int externalref(char *extname) { static int nextextref; strtoxsym(extname); writeifrecord(10, xlen, xsymbuff); nextextref = (nextextref + 1); return((nextextref - 1)); L_00af: // bounds [0 : 2000] // do it now: static char *contable; /* uninitialised */ static int cotp; static int cotoffset; goto L_00b0; void flushcot() { int i; selectoutput(2); printstring(" _TEXT ENDS CONST SEGMENT WORD PUBLIC 'CONST' "); i = 0; for (;;) { L_00b1: if (i >= cotp) goto L_00b2; dumpcdword(((contable[(i + 1)] << 8) | contable[i]), 1); i = (i + 2); } L_00b2: cotp = 0; cotoffset = (cotoffset + i); selectoutput(2); printstring(" CONST ENDS _TEXT SEGMENT WORD PUBLIC 'CODE' "); L_00b0: goto L_00b3; int getcotb(char b) { int i; i = 0; for (;;) { L_00b4: if (i >= cotp) goto L_00b5; if (contable[i] != b) goto L_00b6; return((i + cotoffset)); L_00b6: i = (i + 1); } L_00b5: if (cotp != 2000) goto L_00b7; flushcot(); L_00b7: contable[cotp] = b; cotp = (cotp + 1); return(((cotp - 1) + cotoffset)); L_00b3: goto L_00b8; int getcotw(int w) { int i; int cw; i = 0; for (;;) { L_00b9: if (i >= (cotp - 1)) goto L_00ba; cw = (contable[i] | (contable[(i + 1)] << 8)); if (cw != w) goto L_00bb; return((i + cotoffset)); L_00bb: i = (i + 2); } L_00ba: if (cotp <= (2000 - 2)) goto L_00bc; flushcot(); L_00bc: cotp = ((cotp + 1) & (\1)); contable[cotp] = (w & 255); contable[(cotp + 1)] = (w >> 8); cotp = (cotp + 2); return(((cotp - 2) + cotoffset)); L_00b8: goto L_00bd; int getcot2(int dl, int dh) { int i; int cwl; int cwh; i = 0; cwl = (contable[i] | (contable[(i + 1)] << 8)); for (;;) { L_00be: if (i >= (cotp - 3)) goto L_00bf; cwh = (contable[(i + 2)] | (contable[(i + 3)] << 8)); if (cwl != dl) goto L_00c0; if (cwh != dh) goto L_00c0; return((i + cotoffset)); L_00c0: i = (i + 2); cwl = cwh; } L_00bf: if (cotp <= (2000 - 4)) goto L_00c1; flushcot(); L_00c1: cotp = ((cotp + 1) & (\1)); contable[cotp] = (dl & 255); contable[(cotp + 1)] = (dl >> 8); contable[(cotp + 2)] = (dh & 255); contable[(cotp + 3)] = (dh >> 8); cotp = (cotp + 4); return(((cotp - 4) + cotoffset)); L_00bd: goto L_00c2; int getcot4(int q0, int q1, int q2, int q3) { int i; int cw0; int cw1; int cw2; int cw3; i = 0; cw0 = (contable[i] | (contable[(i + 1)] << 8)); cw1 = (contable[(i + 2)] | (contable[(i + 3)] << 8)); cw2 = (contable[(i + 4)] | (contable[(i + 5)] << 8)); for (;;) { L_00c3: if (i >= (cotp - 3)) goto L_00c4; cw3 = (contable[(i + 6)] | (contable[(i + 7)] << 8)); if (cw0 != q0) goto L_00c5; if (cw1 != q1) goto L_00c5; if (cw2 != q2) goto L_00c5; if (cw3 != q3) goto L_00c5; return((i + cotoffset)); L_00c5: i = (i + 2); cw0 = cw1; cw1 = cw2; cw2 = cw3; } L_00c4: if (cotp <= (2000 - 8)) goto L_00c6; flushcot(); L_00c6: cotp = ((cotp + 1) & (\1)); contable[cotp] = (q0 & 255); contable[(cotp + 1)] = (q0 >> 8); contable[(cotp + 2)] = (q1 & 255); contable[(cotp + 3)] = (q1 >> 8); contable[(cotp + 4)] = (q2 & 255); contable[(cotp + 5)] = (q2 >> 8); contable[(cotp + 6)] = (q3 & 255); contable[(cotp + 7)] = (q3 >> 8); cotp = (cotp + 8); return(((cotp - 8) + cotoffset)); L_00c2: static int nullstring; goto L_00c7; int getcots(char * /*12*/ s) { int i; int first; int len; int match; len = (s[0] + 1); if (len != 0) goto L_00c8; nullstring = getcotb(0); return(nullstring); L_00c8: first = 0; for (;;) { L_00c9: if (((first + len) - 1) >= cotp) goto L_00ca; match = 1; for (i = 0; i += 1; i != (len - 1)) { if (s[i] == contable[(first + i)]) goto L_00cf; match = 0; goto L_00ce; L_00cf: } L_00ce: if (match != 1) goto L_00d0; return((first + cotoffset)); L_00d0: first = (first + 1); } L_00ca: if ((cotp + len) < 2000) goto L_00d1; flushcot(); L_00d1: first = cotp; i = 0; for (;;) { L_00d2: if (len <= 0) goto L_00d3; contable[cotp] = s[i]; cotp = (cotp + 1); i = (i + 1); len = (len - 1); } L_00d3: return((first + cotoffset)); L_00c7: goto L_00d4; void gbyte(int n) { if (datatp <= 12000) goto L_00d5; abort("Data Seg Overflow"); L_00d5: datat[datatp] = (n & 255); datatp = (datatp + 1); L_00d4: goto L_00d6; void gput(int n) { gbyte((n & 255)); gbyte((n >> 8)); L_00d6: goto L_00d7; void gfix(int align) { for (;;) { L_00d8: if ((datatp & align) == 0) goto L_00d9; gbyte(0); } L_00d9: L_00d7: goto L_00da; void flushdata() { int i; selectoutput(2); printstring(" ENDS DATA SEGMENT WORD PUBLIC 'DATA' "); i = 0; for (;;) { L_00db: if (i >= datatp) goto L_00dc; dumpcdword(((datat[(i + 1)] << 8) | datat[i]), 0); i = (i + 2); } L_00dc: selectoutput(2); printstring(" DATA ENDS "); L_00da: goto L_00dd; void flushswitch() { int i; selectoutput(2); printstring(" ENDS _SWTAB SEGMENT WORD PUBLIC '_SWTAB' "); i = 0; for (;;) { L_00de: if (i >= swtp) goto L_00df; dumpcdword(swtab[i], 2); i = (i + 1); } L_00df: selectoutput(2); printstring(" _SWTAB ENDS "); L_00dd: static int echoline; goto L_00e0; void echosourceline() { int ch; static int sourceeof; echoline = (echoline + 1); if (sourceeof == 0) goto L_00e1; return; L_00e1: selectinput(2); selectoutput(2); for (;;) { L_00e2: readsymbol(ch); printsymbol(ch); if (ch == 10) goto L_00e3; if (ch >= 0) goto L_00e4; L_00e3: goto L_00e5; L_00e4: } L_00e5: if (ch >= 0) goto L_00e6; sourceeof = 1; L_00e6: selectinput(1); selectoutput(1); L_00e0: goto L_00e7; int floating(struct STACKFM *v) { if (v->type == 2) goto L_00e8; if (v->type != 6) goto L_00e9; L_00e8: return(1); L_00e9: return(0); L_00e7: goto L_00ea; int zero(struct STACKFM *v) { if (v->disp != 0) goto L_00eb; if (v->base != 0) goto L_00eb; if (v->form == 0) goto L_00ec; if (v->form == 5) goto L_00ec; L_00eb: return(0); L_00ec: return(1); L_00ea: goto L_00ed; int const(struct STACKFM *v) { if (v->form == 0) goto L_00ee; return(0); L_00ee: if (v->type <= 5) goto L_00ef; return(0); L_00ef: return(1); L_00ed: goto L_00f0; int minrecordsize(struct STACKFM *a, struct STACKFM *b) { int n; int m; n = a->format; if (n == 0) goto L_00f1; n = (var[n].size & 32767); L_00f1: m = b->format; if (m == 0) goto L_00f2; m = (var[m].size & 32767); L_00f2: if (n == 0) goto L_00f3; if (m == 0) goto L_00f4; if (m >= n) goto L_00f4; L_00f3: n = m; L_00f4: if (n <= 0) goto L_00f5; return(n); L_00f5: abort("Min Rec Size"); L_00f0: goto L_00f6; int mulshift(int n) { int shift; int ref; ref = 1; for (shift = 1; shift += 1; shift != 14) { ref = (ref << 1); if (ref < n) goto L_00fb; if (ref != n) goto L_00fc; return(shift); L_00fc: return((-1)); L_00fb: } L_00fa: return((-1)); L_00f6: goto L_00fd; int same(struct STACKFM *v, struct STACKFM *w) { if (v->disp != w->disp) goto L_00fe; if (v->base == w->base) goto L_00ff; L_00fe: return(0); L_00ff: if (v->type != w->type) goto L_0100; if (v->form == w->form) goto L_0101; L_0100: return(0); L_0101: if (v->extra != w->extra) goto L_0102; if (v->scope == w->scope) goto L_0103; L_0102: return(0); L_0103: return(1); L_00fd: goto L_0104; int readtag() { int s1; int s2; s1 = nextsym; readsymbol(s2); readsymbol(nextsym); return(((s1 << 8) | s2)); L_0104: goto L_0105; void getd() { int n; long real p; n = readtag(); readsymbol(nextsym); rvalue = 0; for (;;) { L_0106: sym = nextsym; readsymbol(nextsym); if (sym != 46) goto L_0107; goto L_0108; L_0107: n = (n - 1); if (sym != 64) goto L_0109; goto U_00d2; L_0109: rvalue = ((rvalue * 10) + (sym - 48)); if (n != 0) goto L_010a; goto U_00d3; L_010a: } L_0108: p = 1; for (;;) { L_010b: n = (n - 1); if (n != 0) goto L_010c; goto U_00d3; L_010c: sym = nextsym; readsymbol(nextsym); if (sym != 64) goto L_010d; goto U_00d2; L_010d: p = (p / 10); rvalue = (rvalue + ((sym - 48) * p)); } U_00d2: n = readtag(); for (;;) { L_010e: if (n <= 0) goto L_010f; rvalue = (rvalue * 10); n = (n - 1); } L_010f: for (;;) { L_0110: if (n >= 0) goto L_0111; rvalue = (rvalue / 10); n = (n + 1); } L_0111: U_00d3: if (nextsym != 85) goto L_0112; readsymbol(nextsym); rvalue = (-rvalue); L_0112: L_0105: goto L_0113; int getwork(int size) { int cell; cell = worklist[level]; for (;;) { L_0114: if (cell == 0) goto L_0115; if (gptags[cell].info != size) goto L_0116; if (gptags[cell].flags != 0) goto L_0116; gptags[cell].flags = 1; return(gptags[cell].addr); L_0116: cell = gptags[cell].link; } L_0115: cell = getgptag(); frame = ((frame - size) & (\1)); gptags[cell].addr = frame; gptags[cell].info = size; gptags[cell].link = worklist[level]; worklist[level] = cell; gptags[cell].flags = 1; return(gptags[cell].addr); L_0113: goto L_0117; void returnwork(int addr) { int cell; cell = worklist[level]; for (;;) { L_0118: if (cell == 0) goto L_0119; if (gptags[cell].addr != addr) goto L_011a; if (gptags[cell].flags != 0) goto L_011b; abort("Return Work"); L_011b: gptags[cell].flags = 0; return; L_011a: cell = gptags[cell].link; } L_0119: L_0117: goto L_011c; int iswork(struct STACKFM *v) { int cell; if (v->base != 6) goto L_011d; if (v->disp >= 0) goto L_011d; if (v->scope != 0) goto L_011d; if (v->form == 4) goto L_011e; L_011d: return(0); L_011e: cell = worklist[level]; for (;;) { L_011f: if (cell == 0) goto L_0120; if (gptags[cell].addr != v->disp) goto L_0121; if (gptags[cell].flags != 0) goto L_0122; abort("Is Work"); L_0122: return(1); L_0121: cell = gptags[cell].link; } L_0120: return(0); L_011c: goto L_0123; void release(int reg) { if (reg == 0) goto L_0124; if (reg > 16) goto L_0124; if (activity[reg] >= 0) goto L_0125; L_0124: return; L_0125: activity[reg] = (activity[reg] - 1); if (activity[reg] >= 0) goto L_0126; abort("Release inactive"); L_0126: claimed = (claimed - 1); L_0123: goto L_0127; void claim(int reg) { if (reg <= 16) goto L_0128; abort("Claim bad register"); L_0128: if (reg == 0) goto L_0129; if (activity[reg] >= 0) goto L_012a; L_0129: return; L_012a: activity[reg] = (activity[reg] + 1); claimed = (claimed + 1); L_0127: goto L_012b; void hazard(int reg) { int i; int n; int t; int type; goto L_012b; void mod(struct STACKFM *v) { // bounds [0 : 9] /*todo: gcc jump table extension*/ void **sw; v->base = 6; n = (n - 1); goto *sw[v->form]; sw_9: sw_8: sw_7: sw_0: abort("Mod"); sw_4: if (v->disp != 0) goto L_012c; if (v->scope != 0) goto L_012c; v->disp = t; v->form = 6; goto U_00de; L_012c: sw_6: sw_5: v->form = (v->form + 3); v->extra = t; goto U_00de; sw_1: v->form = 4; v->disp = t; v->type = type; U_00de: L_012b: n = activity[reg]; if (n > 0) goto L_012d; return; L_012d: claimed = (claimed - n); activity[reg] = 0; if (reg < 9) goto L_012e; if ((reg - 9) < fpustack) goto L_012f; hazard((reg + 1)); L_012f: type = 6; t = getwork(8); dumpfloprm(41, 6, t); goto L_0130; L_012e: type = 1; t = getwork(2); dumpmr(11, 6, t, reg); L_0130: for (i = 1; i += 1; i != stp) { if (stack[i].base != reg) goto L_0135; mod(stack[i]); L_0135: } L_0134: if (n == 0) goto L_0136; abort("Usage Outstanding"); L_0136: for (;;) { L_0137: goto L_0137; void hazardall() { int j; if (claimed == 0) goto L_0138; for (j = 1; j += 1; j != 16) { hazard(j); } L_013c: L_0138: L_0137: goto L_013d; int gpreg() { int r; for (r = 1; r += 1; r != 4) { if (activity[r] != 0) goto L_0142; return(r); L_0142: } L_0141: for (r = 1; r += 1; r != 4) { if (activity[r] <= 0) goto L_0147; hazard(r); return(r); L_0147: } L_0146: abort("Get Reg"); L_013d: goto L_0148; int ptreg() { // bounds [0 : 2] // do it now: const char *ptpref {NO INIT} static int next; int r; int j; for (j = 1; j += 1; j != 3) { r = ptpref[next]; next = (next + 1); if (next != 3) goto L_014d; next = 0; L_014d: if (activity[r] != 0) goto L_014e; return(r); L_014e: } L_014c: for (j = 1; j += 1; j != 3) { r = ptpref[j]; if (activity[r] <= 0) goto L_0153; hazard(r); return(r); L_0153: } L_0152: abort("Get PT Reg"); L_0148: goto L_0154; int fpureg() { return((9 + fpustack)); L_0154: goto L_0155; int getdisplay(int l) { int r; int lev; lev = (l & 15); if (lev != 0) goto L_0156; return(l); L_0156: if (lev != level) goto L_0157; return(6); L_0157: if (displayhint[4] != lev) goto L_0158; return(4); L_0158: if (displayhint[7] != lev) goto L_0159; return(7); L_0159: if (displayhint[8] != lev) goto L_015a; return(8); L_015a: r = ptreg(); dumprm(11, r, 64, (lev * 2)); displayhint[r] = lev; return(r); L_0155: goto L_015b; int setdopevector() { int t; int dv; t = ((vub - vlb) + 1); dv = getcot4(1, vlb, vub, datasize); vub = (t * datasize); vlb = (vlb * datasize); return(dv); L_015b: goto L_015c; void perm(int n, int space) { hazard(1); hazard(2); hazard(3); hazard(4); dumpextcall(n); if (space == 0) goto L_015d; dumpri(14, 5, space); L_015d: L_015c: goto L_015e; void assemble(int amode, int labs, int names) { // bounds [33 : 127] /*todo: gcc jump table extension*/ void **c; struct VARFM *v; struct VARFM *procvar; struct VARFM *ap; struct VARFM *fp; struct STACKFM *lhs; struct STACKFM *rhs; struct STACKFM temp; int maxframe; int firstname; int staticalloc; int skipproc; int lastskip; int firstlabel; int oldframe; int i; int j; int k; int n; int t; int opr; int val; int dv; void compiletostring(struct STACKFM *v); void load(struct STACKFM *v, int reg); void assign(int assop); void arrayref(int mode); void operate(int n); void compare(struct STACKFM *l, struct STACKFM *r); void testzero(struct STACKFM *v); int newtag(); goto L_015e; void definevar() { int type; int form; int tf; int size; int format; int s; int new; int round; int dimension; int dv; static int primno; strncpy(internalid,"",255+1); new = 0; round = 1; decl = readtag(); if (decl != 0) goto L_015f; parms = (parms - 1); if (parms > names) goto L_0160; abort("Def Var Parms"); L_0160: decvar = &var[parms]; memset(*decvar,0,sizeof struct VARFM); goto L_0161; L_015f: if (decl < parms) goto L_0162; abort("Def Var Names"); L_0162: decvar = &var[decl]; if (decl <= names) goto L_0163; names = decl; new = 1; memset(*decvar,0,sizeof struct VARFM); L_0163: L_0161: for (;;) { L_0164: sym = nextsym; readsymbol(nextsym); if (sym != 44) goto L_0165; goto L_0166; L_0165: if (*length(internalid) == 255) goto L_0167; strncpy(internalid,internalid,255+1); L_0167: } L_0166: tf = readtag(); readsymbol(nextsym); type = (tf >> 4); form = (tf & 15); size = readtag(); readsymbol(nextsym); if (type != 1) goto L_0168; if (size == 1) goto L_0168; if (size != 2) goto L_0169; type = 5; round = 0; L_0169: size = vsize[type]; goto L_016a; L_0168: if (type != 2) goto L_016b; if (size != 4) goto L_016c; type = 6; L_016c: size = vsize[type]; goto L_016d; L_016b: if (type != 4) goto L_016e; format = size; decvar->format = format; if (format > names) goto L_016f; size = var[format].size; L_016f: goto L_0170; L_016e: if (type != 3) goto L_0171; round = 0; decvar->size = size; size = (size + 1); goto L_0172; L_0171: size = vsize[type]; L_0172: L_0170: L_016d: L_016a: if (type == 3) goto L_0173; decvar->size = size; L_0173: decvar->type = type; decvar->form = form; otype = readtag(); spec = ((otype >> 3) & 1); dimension = ((otype >> 8) & 255); otype = (otype & 7); if (otype == 0) goto L_0174; if (otype < 3) goto L_0175; if (*length(alias) == 0) goto L_0176; strncpy(externalid,alias,255+1); goto L_0177; L_0176: if (otype != 4) goto L_0178; strncpy(externalid,systemprefix,255+1); goto L_0179; L_0178: strncpy(externalid,"_",255+1); L_0179: L_0177: if (otype > 5) goto L_017a; otype = 3; L_017a: L_0175: L_0174: strncpy(alias,"",255+1); if (7 > form) goto L_017b; if (form > 10) goto L_017b; blocktype = (1 + spec); if (otype == 0) goto L_017c; if (spec == 0) goto L_017c; if (otype != 6) goto L_017d; primno = (primno + 1); decvar->level = 128; decvar->disp = primno; return; L_017d: decvar->disp = externalref(externalid); decvar->level = 0; decvar->scope = 80; return; L_017c: if (inparams != 0) goto L_017e; potype = otype; if (new == 0) goto L_017f; decvar->disp = newtag(); L_017f: return; L_017e: otype = 0; size = 2; datasize = 2; goto L_0180; L_017b: datasize = size; if (form == 1) goto L_0181; round = 1; if (type != 0) goto L_0182; decvar->extra = inparams; size = 4; goto L_0183; L_0182: if (form == 11) goto L_0184; if (form != 13) goto L_0185; L_0184: size = 0; if (form != 13) goto L_0186; datasize = 2; L_0186: goto L_0187; L_0185: if (form == 12) goto L_0188; if (form != 14) goto L_0189; L_0188: decvar->dim = dimension; size = 4; round = 1; goto L_018a; L_0189: size = 2; L_018a: L_0187: L_0183: L_0181: L_0180: if (otype == 0) goto L_018b; if (otype != 2) goto L_018c; if (type != 3) goto L_018d; if (form != 1) goto L_018d; datasize = 0; L_018d: if (form == 2) goto L_018e; if (form == 12) goto L_018e; if (form != 14) goto L_018f; L_018e: otype = 0; L_018f: goto L_0190; L_018c: gfix(round); L_0190: owntype = type; ownform = form; if (form != 2) goto L_0191; owntype = 1; datasize = 2; L_0191: if (spec != 0) goto L_0192; if (form == 11) goto L_0193; if (form != 13) goto L_0194; L_0193: gfix(1); dv = setdopevector(); gfix(1); decvar->disp = (datatp - vlb); decvar->level = 0; decvar->scope = 16; decvar->pbase = dv; decvar->dim = 1; if (otype != 3) goto L_0195; fillexternal(16, decvar->disp, externalid); L_0195: L_0194: goto L_0196; L_0192: decvar->level = 0; decvar->scope = 80; decvar->disp = externalref(externalid); L_0196: return; L_018b: if (form != 3) goto L_0197; decvar->disp = newtag(); return; L_0197: if (form != 6) goto L_0198; size = (vub - vlb); if ((swtp + size) <= 1000) goto L_0199; abort("Switch Table Full"); L_0199: decvar->scope = 96; decvar->disp = (swtp - vlb); decvar->extra = setdopevector(); for (s = swtp; s += 1; s != (swtp + size)) { swtab[s] = 0; } L_019d: swtp = ((swtp + size) + 1); return; L_0198: if (form != 4) goto L_019e; if (inparams == 0) goto L_019f; if (decvar->size <= frame) goto L_01a0; frame = decvar->size; L_01a0: goto L_01a1; L_019f: blocktype = (-1); spec = (-1); L_01a1: return; L_019e: decvar->level = level; if (inparams != 0) goto L_01a2; frame = ((frame - size) & (\round)); decvar->disp = frame; goto L_01a3; L_01a2: if (blocktype <= 0) goto L_01a4; frame = (((frame + size) + 1) & (\1)); decvar->disp = frame; goto L_01a5; L_01a4: frame = ((frame + round) & (\round)); decvar->disp = frame; frame = (frame + size); decvar->level = 0; L_01a5: L_01a3: L_015e: goto L_01a6; void popstack() { if (stp != 0) goto L_01a7; abort("Pop"); L_01a7: if ((diagnose & 1) == 0) goto L_01a8; monitor(*top, "Pop"); L_01a8: stp = (stp - 1); if (stp == 0) goto L_01a9; top = &stack[stp]; goto L_01aa; L_01a9: top = &null; L_01aa: L_01a6: goto L_01ab; void poprel() { release(top->base); popstack(); L_01ab: goto L_01ac; void pushvar(int varno) { struct VARFM *w; // bounds [0 : 15] // do it now: const char *fmap {NO INIT} if (0 > varno) goto L_01ad; if (varno <= 600) goto L_01ae; L_01ad: abort("Push Var Idx"); L_01ae: w = &var[varno]; stp = (stp + 1); if (stp <= 16) goto L_01af; abort("Push V Stack Overflow"); L_01af: top = &stack[stp]; memset(*top,0,sizeof struct STACKFM); if (w->level == 0) goto L_01b0; if (w->level != level) goto L_01b1; top->base = 6; goto L_01b2; L_01b1: top->base = (w->level + 16); L_01b2: goto L_01b3; L_01b0: top->base = 0; L_01b3: top->scope = w->scope; top->type = w->type; top->aform = w->form; top->form = fmap[w->form]; top->dim = w->dim; top->disp = w->disp; top->scope = w->scope; top->format = w->format; top->size = w->size; top->extra = w->extra; top->pbase = w->pbase; top->closeoutput = varno; if ((diagnose & 1) == 0) goto L_01b4; monitor(*top, "Var stack"); L_01b4: L_01ac: goto L_01b5; void pushcopy(struct STACKFM *v) { stp = (stp + 1); if (stp <= 16) goto L_01b6; abort("Stack Const"); L_01b6: top = &stack[stp]; memcpy(*top,*v,sizeof struct STACKFM); if ((diagnose & 1) == 0) goto L_01b7; monitor(*top, "Stack Copy"); L_01b7: L_01b5: goto L_01b8; void pushconst(int n) { stp = (stp + 1); if (stp <= 16) goto L_01b9; abort("Stack Const"); L_01b9: top = &stack[stp]; memset(*top,0,sizeof struct STACKFM); top->disp = n; top->type = 1; top->form = 0; if ((diagnose & 1) == 0) goto L_01ba; monitor(*top, "push const"); L_01ba: L_01b8: goto L_01bb; int dumpstring(int size) { int j; int p; if (size != 0) goto L_01bc; return(getcots(currentstring)); L_01bc: if ((*cslen + 1) <= size) goto L_01bd; warn(5); currentstring[0] = (size - 1); L_01bd: p = datatp; for (j = 0; j += 1; j != (size - 1)) { gbyte(currentstring[j]); } L_01c1: return(p); L_01bb: goto L_01c2; void getstring() { int l; l = nextsym; *cslen = 0; for (;;) { L_01c3: if (l <= 0) goto L_01c4; l = (l - 1); readsymbol(nextsym); *cslen = ((*cslen + 1) & 255); currentstring[*cslen] = nextsym; } L_01c4: readsymbol(nextsym); if (nextsym == 65) goto L_01c5; if (nextsym == 36) goto L_01c5; otype = 2; pushconst(dumpstring(0)); top->type = 3; top->base = 0; top->scope = 32; top->form = 4; top->format = (*cslen + 1); goto L_01c6; L_01c5: pushconst(0); L_01c6: L_01c2: goto L_01c7; int realconstant() { int w1; int w2; int w3; int w4; w1 = (*byteinteger(addr(rvalue)) | (*byteinteger((addr(rvalue) + 1)) << 8)); w2 = (*byteinteger((addr(rvalue) + 2)) | (*byteinteger((addr(rvalue) + 3)) << 8)); w3 = (*byteinteger((addr(rvalue) + 4)) | (*byteinteger((addr(rvalue) + 5)) << 8)); w4 = (*byteinteger((addr(rvalue) + 6)) | (*byteinteger((addr(rvalue) + 7)) << 8)); return(getcot4(w1, w2, w3, w4)); L_01c7: goto L_01c8; int newtag() { static int freetag; freetag = (freetag + 1); return(freetag); L_01c8: goto L_01c9; int newlabel() { labs = (labs + 1); if (labs <= 50) goto L_01ca; abort("Labels"); L_01ca: return(labs); L_01c9: goto L_01cb; int findlabel(int label) { int lp; lp = labs; for (;;) { L_01cc: if (lp == firstlabel) goto L_01cd; if (labels[lp].id != label) goto L_01ce; return(lp); L_01ce: lp = (lp - 1); } L_01cd: return(0); L_01cb: goto L_01cf; void definelabel(int label) { int lp; struct LABELFM *l; lp = findlabel(label); if (lp != 0) goto L_01d0; lp = newlabel(); l = &labels[lp]; l->id = label; l->tag = newtag(); goto L_01d1; L_01d0: l = &labels[lp]; if ((l->tag & 32768) == 0) goto L_01d2; if (label <= 0) goto L_01d2; l->tag = newtag(); L_01d2: L_01d1: dumplabel(l->tag); l->tag = (l->tag | 32768); uncondjump = 0; L_01cf: goto L_01d3; void jumpto(int label, int op, int flag) { struct LABELFM *l; int lp; lp = findlabel(label); if (lp != 0) goto L_01d4; lp = newlabel(); l = &labels[lp]; l->id = label; l->tag = newtag(); goto L_01d5; L_01d4: l = &labels[lp]; if (flag == 0) goto L_01d6; if ((l->tag & 32768) == 0) goto L_01d6; l->tag = newtag(); L_01d6: L_01d5: dumpjump(op, (l->tag & 32767)); if (op != 35) goto L_01d7; uncondjump = nextcad; L_01d7: L_01d3: goto L_01d8; void reduce(struct STACKFM *v) { int type; int form; int disp; int scope; form = (v->form - 3); type = v->type; disp = v->disp; if (v->base != 6) goto L_01d9; scope = v->scope; v->scope = 0; goto L_01da; L_01d9: scope = 0; L_01da: v->disp = v->extra; v->type = 1; v->form = 4; load(*v, 27); v->type = type; v->form = form; v->disp = disp; v->scope = scope; L_01d8: goto L_01db; void amap(struct STACKFM *v) { int f; // bounds [0 : 15] // do it now: const int *addrmap {NO INIT} f = addrmap[v->form]; if (f >= 0) goto L_01dc; monitor(*v, "AMAP target"); abort("AMAP"); L_01dc: if (v->disp != 0) goto L_01dd; if (v->scope != 0) goto L_01dd; if (f != 5) goto L_01de; if (v->base != 0) goto L_01df; f = 0; goto L_01e0; L_01df: f = 1; L_01e0: goto L_01e1; L_01de: if (f == 7) goto L_01e2; if (f != 8) goto L_01e3; L_01e2: if (f != 7) goto L_01e4; f = 6; goto L_01e5; L_01e4: f = 4; L_01e5: v->disp = v->extra; L_01e3: L_01e1: L_01dd: v->type = 1; v->form = f; L_01db: goto L_01e6; void vmap(struct STACKFM *v) { int f; int t; // bounds [0 : 8] // do it now: const int *varmap {NO INIT} if (v->form == 6) goto L_01e7; if (v->form != 9) goto L_01e8; L_01e7: t = v->type; amap(*v); load(*v, 27); v->type = t; v->form = 4; L_01e8: f = varmap[v->form]; if (f >= 0) goto L_01e9; abort("VMap"); L_01e9: v->form = f; L_01e6: goto L_01ea; void address(struct STACKFM *v) { int type; int form; int r; if ((diagnose & 2) == 0) goto L_01eb; monitor(*v, "ADDRESS"); L_01eb: form = v->form; type = v->type; if (form < 7) goto L_01ec; reduce(*v); form = v->form; L_01ec: if (v->base <= 16) goto L_01ed; v->base = getdisplay((v->base - 16)); claim(v->base); L_01ed: if (form == 1) goto L_01ee; if (form != 0) goto L_01ef; L_01ee: return; L_01ef: if (form != 5) goto L_01f0; if (v->base != 0) goto L_01f1; v->form = 0; goto L_01f2; L_01f1: if (v->disp != 0) goto L_01f3; if (v->scope != 0) goto L_01f3; v->form = 1; goto L_01f4; L_01f3: load(*v, 25); L_01f4: L_01f2: return; L_01f0: if (v->base == 0) goto L_01f5; if (v->base >= 4) goto L_01f5; r = ptreg(); claim(r); dumprr(11, r, v->base); release(v->base); v->base = r; L_01f5: if (form != 4) goto L_01f6; return; L_01f6: if (form != 6) goto L_01f7; v->form = 4; v->type = 1; load(*v, 27); v->type = type; v->form = 4; v->disp = 0; L_01f7: L_01ea: goto L_01f8; void load(struct STACKFM *v, int r) { // bounds [0 : 9] /*todo: gcc jump table extension*/ void **f; int ptr; int op; if ((diagnose & 2) == 0) goto L_01f9; monitor(*v, "LOAD"); L_01f9: if (r != 28) goto L_01fa; goto U_0116; L_01fa: if (v->type != 5) goto L_01fb; if (r != 25) goto L_01fc; r = 26; L_01fc: if (r != 27) goto L_01fd; r = 4; L_01fd: L_01fb: if (v->base <= 16) goto L_01fe; v->base = getdisplay((v->base - 16)); claim(v->base); goto L_01ff; L_01fe: if (v->base == 0) goto L_0200; if (v->base >= 4) goto L_0200; if (v->form < 4) goto L_0200; ptr = ptreg(); dumprr(11, ptr, v->base); claim(ptr); release(v->base); v->base = ptr; L_0200: L_01ff: if (r != 25) goto L_0201; if (v->base == 0) goto L_0202; if (activity[v->base] != 1) goto L_0202; if (displayhint[v->base] != 0) goto L_0202; r = v->base; goto L_0203; L_0202: r = gpreg(); L_0203: goto L_0204; L_0201: if (r != 26) goto L_0205; if (0 >= v->base) goto L_0206; if (v->base > 4) goto L_0206; if (activity[v->base] != 1) goto L_0206; r = v->base; goto L_0207; L_0206: r = gpreg(); L_0207: goto L_0208; L_0205: if (r != 27) goto L_0209; if (activity[v->base] != 1) goto L_020a; if (v->base == 4) goto L_020b; if (v->base == 7) goto L_020b; if (v->base != 8) goto L_020a; L_020b: r = v->base; goto L_020c; L_020a: r = ptreg(); L_020c: goto L_020d; L_0209: if (v->base != r) goto L_020e; if (activity[r] <= 1) goto L_020f; release(r); v->base = 0; hazard(r); claim(r); v->base = r; L_020f: goto L_0210; L_020e: hazard(r); L_0210: L_020d: L_0208: L_0204: goto *f[v->form]; f_0: U_0117: if (v->disp != 0) goto L_0211; if (v->scope != 0) goto L_0211; dumprr(19, r, r); goto L_0212; L_0211: dumprioffset(11, r, v->scope, v->disp); L_0212: U_0118: v->base = r; v->disp = 0; v->scope = 0; v->form = 1; claim(r); return; f_1: if (v->base != r) goto L_0213; return; L_0213: dumprr(11, r, v->base); release(v->base); goto U_0118; f_2: f_3: abort("Unexpected Stack Form"); f_6: if (r == 4) goto L_0214; if (r == 7) goto L_0214; if (r != 8) goto L_0215; L_0214: ptr = r; goto L_0216; L_0215: ptr = ptreg(); L_0216: dumprm(11, ptr, (v->base | v->scope), v->disp); release(v->base); claim(ptr); v->base = ptr; v->disp = 0; v->scope = 0; f_4: if (v->type != 1) goto L_0217; dumprm(11, r, (v->base | v->scope), v->disp); goto L_0218; L_0217: if (v->type != 5) goto L_0219; dumprm8(11, (r + 16), (v->base | v->scope), v->disp); dumprr8(19, (r + 20), (r + 20)); v->type = 1; goto L_021a; L_0219: abort("Load Real"); L_021a: L_0218: release(v->base); goto U_0118; f_5: if (v->base == 0) goto L_021b; dumprm(10, r, (v->base | v->scope), v->disp); release(v->base); v->type = 1; goto U_0118; L_021b: goto U_0117; f_7: f_8: f_9: reduce(*v); goto *f[v->form]; U_0116: address(*v); if (v->type != 5) goto L_021c; load(*v, 25); L_021c: if (v->form != 1) goto L_021d; if (v->base < 9) goto L_021e; return; L_021e: v->disp = getwork(2); dumpmr(11, 6, v->disp, v->base); release(v->base); v->base = 6; v->scope = 0; v->form = 4; L_021d: if (v->form != 0) goto L_021f; if (v->disp != 0) goto L_0220; r = (9 + fpustack); dumpflopspec(52); goto U_0119; L_0220: v->disp = getcotw(v->disp); v->form = 4; v->base = 0; v->scope = 32; L_021f: if (v->type != 1) goto L_0221; op = 36; goto L_0222; L_0221: if (v->type != 2) goto L_0223; op = 37; goto L_0224; L_0223: op = 38; L_0224: L_0222: r = (9 + fpustack); dumpfloprm(op, (v->base | v->scope), v->disp); release(v->base); U_0119: v->base = r; claim(r); v->disp = 0; v->form = 1; v->type = 2; L_01f8: goto L_0225; void operate(int op) { struct STACKFM *lhs; struct STACKFM *rhs; int assignpending; int work; int value; int s; // bounds [1 : 17] /*todo: gcc jump table extension*/ void **oper; // bounds [1 : 17] /*todo: gcc jump table extension*/ void **roper; // bounds [1 : 17] /*todo: gcc jump table extension*/ void **fold; // bounds [1 : 17] // do it now: const int *opmap {NO INIT} // bounds [1 : 17] // do it now: const int *flopmap {NO INIT} // bounds [-1 : 1] // do it now: const int *indec {NO INIT} goto L_0225; void swap() { struct STACKFM temp; memcpy(temp,*lhs,sizeof struct STACKFM); memcpy(*lhs,*rhs,sizeof struct STACKFM); memcpy(*rhs,temp,sizeof struct STACKFM); L_0225: assignpending = 0; rhs = top; if (op >= 15) goto L_0226; lhs = &stack[(stp - 1)]; if (lhs->type == 2) goto L_0227; if (lhs->type != 6) goto L_0228; L_0227: goto U_011f; L_0228: L_0226: if (rhs->type == 2) goto L_0229; if (rhs->type != 6) goto L_022a; L_0229: goto U_011f; L_022a: if (rhs->form != 0) goto L_022b; if (op >= 15) goto L_022c; if (lhs->form != 0) goto L_022b; L_022c: goto *fold[op]; L_022b: if (nextsym == 83) goto L_022d; if (nextsym != 106) goto L_022e; L_022d: if (op < 15) goto L_022f; if (same(*top, stack[(stp - 1)]) == 0) goto L_0230; assignpending = 1; L_0230: goto L_0231; L_022f: if (same(*lhs, stack[(stp - 2)]) == 0) goto L_0232; assignpending = 1; L_0232: L_0231: L_022e: goto *oper[op]; oper_15: oper_16: if (assignpending == 0) goto L_0233; readsymbol(nextsym); address(*rhs); if (rhs->type != 5) goto L_0234; dumpum8(opmap[op], (rhs->base | rhs->scope), rhs->disp); goto L_0235; L_0234: dumpum(opmap[op], (rhs->base | rhs->scope), rhs->disp); L_0235: poprel(); poprel(); return; L_0233: load(*rhs, 25); dumpur(opmap[op], rhs->base); return; oper_17: load(*rhs, 25); dumpri(16, rhs->base, 0); work = newtag(); dumpjump(28, work); dumpur(6, rhs->base); dumplabel(work); return; oper_1: if (lhs->form != 0) goto L_0236; swap(); L_0236: oper_2: if (assignpending == 0) goto L_0237; if (lhs->type == 1) goto L_0238; if ((control & 1) == 0) goto L_0238; if (nextsym != 106) goto L_0237; L_0238: readsymbol(nextsym); address(*lhs); if (rhs->form != 0) goto L_0239; value = rhs->disp; if (value == 0) goto L_023a; if (op != 2) goto L_023b; value = (-value); L_023b: if (value >= 2) goto L_023c; if (value <= (-2)) goto L_023c; if (lhs->type != 5) goto L_023d; dumpum8(indec[value], (lhs->base | lhs->scope), lhs->disp); goto L_023e; L_023d: dumpum(indec[value], (lhs->base | lhs->scope), lhs->disp); L_023e: goto L_023f; L_023c: if (lhs->type != 5) goto L_0240; dumpmi8(opmap[op], (lhs->base | lhs->scope), lhs->disp, rhs->disp); goto L_0241; L_0240: dumpmi(opmap[op], (lhs->base | lhs->scope), lhs->disp, rhs->disp); L_0241: L_023f: L_023a: goto L_0242; L_0239: load(*rhs, 25); if (lhs->type != 5) goto L_0243; dumpmr8(opmap[op], (lhs->base | lhs->scope), lhs->disp, (rhs->base + 16)); goto L_0244; L_0243: dumpmr(opmap[op], (lhs->base | lhs->scope), lhs->disp, rhs->base); L_0244: L_0242: poprel(); poprel(); poprel(); return; L_0237: if (rhs->form != 0) goto L_0245; value = rhs->disp; if (op != 2) goto L_0246; value = (-value); L_0246: if (lhs->form == 5) goto L_0247; if (lhs->form != 8) goto L_0248; L_0247: lhs->disp = (lhs->disp + value); goto L_0249; L_0248: load(*lhs, 25); if (lhs->base != 4) goto L_024a; lhs->form = 5; lhs->disp = value; goto L_024b; L_024a: if (value >= 2) goto L_024c; if (value <= (-2)) goto L_024c; if (value == 0) goto L_024d; dumpur(indec[value], lhs->base); L_024d: goto L_024e; L_024c: dumpri(opmap[op], lhs->base, rhs->disp); L_024e: L_024b: L_0249: goto L_024f; L_0245: if (op != 1) goto L_0250; if (rhs->form != 1) goto L_0250; swap(); L_0250: load(*lhs, 25); if (rhs->type != 5) goto L_0251; load(*rhs, 25); goto L_0252; L_0251: address(*rhs); L_0252: dumprv(opmap[op], lhs->base, *rhs); L_024f: poprel(); return; oper_6: oper_7: oper_8: if (lhs->form != 0) goto L_0253; swap(); L_0253: if (assignpending == 0) goto L_0254; readsymbol(nextsym); address(*lhs); if (rhs->form != 0) goto L_0255; value = rhs->disp; if (lhs->type != 5) goto L_0256; if ((rhs->disp & (\255)) == 0) goto L_0257; warn(8); L_0257: dumpmi8(opmap[op], (lhs->base | lhs->scope), lhs->disp, rhs->disp); goto L_0258; L_0256: dumpmi(opmap[op], (lhs->base | lhs->scope), lhs->disp, rhs->disp); L_0258: goto L_0259; L_0255: load(*rhs, 25); if (lhs->type != 5) goto L_025a; dumpmr8(opmap[op], (lhs->base | lhs->scope), lhs->disp, (rhs->base + 16)); goto L_025b; L_025a: dumpmr(opmap[op], (lhs->base | lhs->scope), lhs->disp, rhs->base); L_025b: L_0259: poprel(); poprel(); poprel(); return; L_0254: if (rhs->form != 0) goto L_025c; value = rhs->disp; load(*lhs, 25); dumpri(opmap[op], lhs->base, value); goto L_025d; L_025c: if (rhs->form != 1) goto L_025e; swap(); L_025e: load(*lhs, 25); if (rhs->type != 5) goto L_025f; if (op != 6) goto L_025f; load(*rhs, 25); goto L_0260; L_025f: address(*rhs); L_0260: if (rhs->type != 5) goto L_0261; dumprm8(opmap[op], (lhs->base + 16), (rhs->scope | rhs->base), rhs->disp); goto L_0262; L_0261: dumprv(opmap[op], lhs->base, *rhs); L_0262: L_025d: poprel(); return; oper_3: if (lhs->form == 0) goto L_0263; if (rhs->base != 1) goto L_0264; L_0263: swap(); L_0264: if (rhs->form != 0) goto L_0265; value = rhs->disp; if (value != 0) goto L_0266; release(lhs->base); memcpy(*lhs,*rhs,sizeof struct STACKFM); popstack(); return; L_0266: if (value != 1) goto L_0267; popstack(); return; L_0267: s = mulshift(value); if (s <= 0) goto L_0268; rhs->disp = s; op = 9; goto U_0120; L_0268: rhs->base = 0; rhs->scope = 32; rhs->disp = getcotw(value); rhs->form = 4; L_0265: U_0121: load(*lhs, 1); address(*rhs); hazard(3); if (rhs->form != 1) goto L_0269; dumpur(23, rhs->base); goto L_026a; L_0269: dumpum(23, (rhs->base | rhs->scope), rhs->disp); L_026a: poprel(); return; oper_4: oper_11: load(*lhs, 1); address(*rhs); hazard(3); dumpsimple(1); if (rhs->form != 0) goto L_026b; if (rhs->disp != 0) goto L_026c; warn(1); L_026c: rhs->base = 0; rhs->scope = 32; rhs->disp = getcotw(rhs->disp); rhs->form = 4; L_026b: if (rhs->form != 1) goto L_026d; dumpur(22, rhs->base); goto L_026e; L_026d: dumpum(22, (rhs->base | rhs->scope), rhs->disp); L_026e: poprel(); if (op != 4) goto L_026f; lhs->base = 1; goto L_0270; L_026f: lhs->base = 3; release(1); claim(3); L_0270: return; oper_9: oper_10: U_0120: if (assignpending == 0) goto L_0271; if (op == 10) goto L_0272; if (lhs->type == 1) goto L_0272; if ((control & 1) == 0) goto L_0272; if (nextsym != 106) goto L_0271; L_0272: readsymbol(nextsym); address(*lhs); if (rhs->form != 0) goto L_0273; if (rhs->disp != 1) goto L_0273; if (lhs->type != 5) goto L_0274; dumpmi8(opmap[op], (lhs->base | lhs->scope), lhs->disp, 1); goto L_0275; L_0274: dumpmi(opmap[op], (lhs->base | lhs->scope), lhs->disp, 1); L_0275: goto L_0276; L_0273: if (rhs->type != 5) goto L_0277; hazard(2); address(*rhs); dumprm8(11, 18, (rhs->scope | rhs->base), rhs->disp); goto L_0278; L_0277: load(*rhs, 2); L_0278: if (lhs->type != 5) goto L_0279; dumpmr8(opmap[op], (lhs->base | lhs->scope), lhs->disp, 18); goto L_027a; L_0279: dumpmr(opmap[op], (lhs->base | lhs->scope), lhs->disp, 2); L_027a: L_0276: poprel(); poprel(); poprel(); return; L_0271: if (rhs->form != 0) goto L_027b; value = rhs->disp; if (value > 4) goto L_027c; load(*lhs, 25); for (;;) { L_027d: if (value <= 0) goto L_027e; dumpri(opmap[op], lhs->base, 1); value = (value - 1); } L_027e: goto L_027f; L_027c: load(*rhs, 2); load(*lhs, 25); dumprr(opmap[op], lhs->base, 2); L_027f: goto L_0280; L_027b: if (rhs->type != 5) goto L_0281; hazard(2); address(*rhs); dumprm8(11, 18, (rhs->scope | rhs->base), rhs->disp); release(rhs->base); rhs->base = 2; claim(2); goto L_0282; L_0281: load(*rhs, 2); L_0282: load(*lhs, 25); dumprr(opmap[op], lhs->base, 2); L_0280: poprel(); return; oper_12: if (rhs->form != 0) goto L_0283; if (rhs->disp != 0) goto L_0284; poprel(); poprel(); pushconst(1); return; L_0284: if (rhs->disp != 1) goto L_0285; poprel(); return; L_0285: if (rhs->disp != 2) goto L_0286; memcpy(*rhs,*lhs,sizeof struct STACKFM); claim(rhs->base); goto U_0121; L_0286: L_0283: load(*rhs, 25); dumpur(9, rhs->base); poprel(); load(*lhs, 25); dumpur(9, lhs->base); release(lhs->base); perm(1, 4); lhs->base = 1; claim(1); lhs->form = 1; return; oper_13: oper_14: abort("Oper unexpected op"); fold_16: value = (-rhs->disp); goto U_0122; fold_15: value = (\rhs->disp); goto U_0122; fold_17: value = rhs->disp; if (value >= 0) goto L_0287; value = (-value); L_0287: goto U_0123; fold_1: value = (lhs->disp + rhs->disp); goto U_0123; fold_2: value = (lhs->disp - rhs->disp); goto U_0123; fold_7: value = (lhs->disp | rhs->disp); goto U_0123; fold_6: value = (lhs->disp & rhs->disp); goto U_0123; fold_8: value = (lhs->disp ^ rhs->disp); goto U_0123; fold_9: value = (lhs->disp << rhs->disp); goto U_0123; fold_3: value = (lhs->disp * rhs->disp); goto U_0123; fold_10: value = (lhs->disp >> rhs->disp); goto U_0123; fold_12: if (rhs->disp >= 0) goto L_0288; abort("Fold -ve Exp"); L_0288: value = 1; for (op = 1; op += 1; op != rhs->disp) { value = (value * lhs->disp); } L_028c: goto U_0123; fold_11: fold_4: value = rhs->disp; if (value != 0) goto L_028d; warn(1); value = 1; L_028d: value = (lhs->disp / value); if (op != 4) goto L_028e; goto U_0123; L_028e: value = (lhs->disp - (rhs->disp * value)); goto U_0123; fold_13: abort("No reals yet"); fold_14: abort("No reals yet"); U_0123: popstack(); U_0122: top->disp = value; return; fold_5: abort("Fold Conc"); oper_5: if (assignpending == 0) goto L_028f; amap(*lhs); load(*lhs, 25); dumpur(9, lhs->base); amap(*rhs); load(*rhs, 25); dumpur(9, rhs->base); poprel(); poprel(); dumppushi(0, lhs->size); if (nextsym != 83) goto L_0290; perm(5, 6); goto L_0291; L_0290: perm(6, 6); L_0291: readsymbol(nextsym); poprel(); return; L_028f: if (iswork(*lhs) != 0) goto L_0292; work = getwork(256); pushconst(work); top->form = 5; top->base = 6; load(*top, 25); dumpur(9, top->base); poprel(); amap(*lhs); load(*lhs, 25); dumpur(9, lhs->base); release(lhs->base); dumppushi(0, 255); perm(3, 6); memset(*lhs,0,sizeof struct STACKFM); lhs->type = 3; lhs->form = 4; lhs->base = 6; lhs->disp = work; lhs->size = 255; L_0292: pushcopy(*lhs); amap(*top); load(*top, 25); dumpur(9, top->base); poprel(); amap(*rhs); load(*rhs, 25); dumpur(9, rhs->base); poprel(); dumppushi(0, lhs->size); perm(5, 6); return; U_011f: if (op >= 15) goto L_0293; load(*lhs, 28); L_0293: if (op == 13) goto L_0294; load(*rhs, 28); L_0294: goto *roper[op]; roper_16: roper_17: dumpfloprr(flopmap[op], rhs->base, rhs->base); return; roper_1: roper_3: if (lhs->base <= rhs->base) goto L_0295; swap(); L_0295: dumpfloprr(flopmap[op], lhs->base, rhs->base); poprel(); return; roper_2: roper_4: roper_14: op = flopmap[op]; if (lhs->base <= rhs->base) goto L_0296; swap(); op = (op + 1); L_0296: dumpfloprr(op, lhs->base, rhs->base); poprel(); return; roper_13: load(*rhs, 25); dumpur(9, rhs->base); poprel(); work = ptreg(); dumpri(18, 5, 8); dumprr(11, work, 5); dumpfloprm(41, work, 0); release(lhs->base); perm(2, 10); lhs->base = 1; claim(1); lhs->form = 4; lhs->disp = 0; lhs->scope = 0; lhs->type = 6; load(*lhs, 28); return; roper_15: roper_6: roper_7: roper_8: roper_11: roper_9: roper_10: roper_12: abort("Unsupported Real Operation"); for (;;) { L_0297: goto L_0297; void assign(int assop) { struct STACKFM *lh; struct STACKFM *rh; struct STACKFM temp; int n; int p; int t; int form; int r; goto L_0297; void store(struct STACKFM *lhs, struct STACKFM *rhs) { int pt; int s; int op; if (lhs->base != 5) goto L_0298; if (lhs->type == 1) goto L_0299; if (lhs->type != 5) goto L_029a; L_0299: if (rhs->type != 5) goto L_029b; load(*rhs, 25); goto L_029c; L_029b: address(*rhs); L_029c: dumpvpush(*rhs); goto L_029d; L_029a: if (lhs->type != 2) goto L_029e; s = 4; op = 40; goto L_029f; L_029e: s = 8; op = 41; L_029f: load(*rhs, 28); pt = ptreg(); dumpri(18, 5, s); dumprr(11, pt, 5); dumpfloprm(op, pt, 0); L_029d: return; L_0298: if (lhs->type != 1) goto L_02a0; if (rhs->form != 0) goto L_02a1; if (rhs->scope != 0) goto L_02a1; dumpmi(11, (lhs->base | lhs->scope), lhs->disp, rhs->disp); goto L_02a2; L_02a1: load(*rhs, 25); dumpmr(11, (lhs->base | lhs->scope), lhs->disp, rhs->base); L_02a2: goto L_02a3; L_02a0: if (lhs->type != 5) goto L_02a4; if (rhs->form != 0) goto L_02a5; if (rhs->scope != 0) goto L_02a5; dumpmi8(11, (lhs->base | lhs->scope), lhs->disp, rhs->disp); goto L_02a6; L_02a5: if (rhs->type != 5) goto L_02a7; address(*rhs); pt = gpreg(); dumprm8(11, (pt + 16), (rhs->base | rhs->scope), rhs->disp); release(rhs->base); rhs->base = pt; rhs->form = 1; rhs->type = 1; claim(pt); goto L_02a8; L_02a7: load(*rhs, 25); L_02a8: dumpmr8(11, (lhs->base | lhs->scope), lhs->disp, (rhs->base + 16)); L_02a6: goto L_02a9; L_02a4: load(*rhs, 28); if (lhs->type != 2) goto L_02aa; op = 40; goto L_02ab; L_02aa: op = 41; L_02ab: dumpfloprm(op, (lhs->base | lhs->scope), lhs->disp); L_02a9: L_02a3: L_0297: if (stp >= 2) goto L_02ac; abort("Assign Stack"); L_02ac: rh = top; lh = &stack[(stp - 1)]; form = lh->form; if ((diagnose & 4) == 0) goto L_02ad; monitor(*lh, "ASS LH"); monitor(*rh, "ASS RH"); L_02ad: if (same(*lh, *rh) == 0) goto L_02ae; poprel(); poprel(); return; L_02ae: if (assop >= 0) goto L_02af; if (lh->base < 128) goto L_02b0; memcpy(temp,*lh,sizeof struct STACKFM); memcpy(*lh,*rh,sizeof struct STACKFM); memcpy(*rh,temp,sizeof struct STACKFM); return; L_02b0: lh->pbase = (lh->pbase - 1); pushvar(lh->pbase); lh = top; lh->base = 5; if (lh->form == 4) goto L_02b1; assop = 0; L_02b1: if (7 > lh->aform) goto L_02b2; if (lh->aform > 10) goto L_02b2; assop = 1; rh->type = 1; lh->type = 1; lh->form = 4; if (rh->base == 0) goto L_02b3; rh->form = 4; goto L_02b4; L_02b3: if (rh->scope != 80) goto L_02b5; rh->form = 5; goto L_02b6; L_02b5: if (swtp < 1000) goto L_02b7; abort("Proc - Switch Table Full"); L_02b7: swtab[swtp] = rh->disp; rh->disp = (swtp * 2); swtp = (swtp + 1); rh->scope = 96; rh->form = 4; L_02b6: L_02b4: L_02b2: L_02af: if (11 > rh->aform) goto L_02b8; if (rh->aform > 14) goto L_02b8; amap(*lh); address(*lh); amap(*rh); address(*rh); if (rh->aform == 11) goto L_02b9; if (rh->aform != 13) goto L_02ba; L_02b9: memset(temp,0,sizeof struct STACKFM); temp.form = 5; temp.type = 1; temp.disp = rh->pbase; temp.scope = 32; goto L_02bb; L_02ba: memcpy(temp,*rh,sizeof struct STACKFM); claim(temp.base); temp.disp = (temp.disp + 2); L_02bb: lh->disp = (lh->disp + 2); store(*lh, temp); release(temp.base); lh->disp = (lh->disp - 2); store(*lh, *rh); poprel(); poprel(); return; L_02b8: if (lh->type != 0) goto L_02bc; if (assop == 0) goto L_02bd; abort("Assign GenName"); L_02bd: amap(*lh); address(*lh); if (rh->type != 0) goto L_02be; memcpy(temp,*rh,sizeof struct STACKFM); claim(temp.base); temp.disp = (temp.disp + 2); amap(temp); goto L_02bf; L_02be: memset(temp,0,sizeof struct STACKFM); temp.type = 1; temp.disp = ((rh->size << 4) + genmap[t]); L_02bf: amap(*rh); store(*lh, *rh); lh->disp = (lh->disp + 2); store(*lh, temp); release(temp.base); poprel(); poprel(); return; L_02bc: if (assop != 0) goto L_02c0; amap(*lh); amap(*rh); L_02c0: if (lh->type != 4) goto L_02c1; if (lh->base != 5) goto L_02c2; n = lh->size; hazard(8); dumpri(18, 5, lh->size); dumprr(11, 8, 5); claim(8); lh->base = 8; goto L_02c3; L_02c2: n = minrecordsize(*lh, *rh); amap(*lh); load(*lh, 8); L_02c3: hazard(2); dumpri(11, 2, n); if (rh->form != 0) goto L_02c4; hazard(1); dumprr(19, 1, 1); dumprepstosb(); goto L_02c5; L_02c4: amap(*rh); load(*rh, 7); dumprepmovsb(); L_02c5: poprel(); poprel(); return; L_02c1: if (lh->type != 3) goto L_02c6; if (assop <= 0) goto L_02c7; if (rh->format != 1) goto L_02c7; lh->type = 5; poprel(); pushconst(0); assign(assop); return; L_02c7: if (lh->base != 5) goto L_02c8; p = (lh->size + 1); p = ((p + 1) & (\1)); dumpri(18, 5, p); r = gpreg(); dumprr(11, r, 5); dumpur(9, r); goto L_02c9; L_02c8: amap(*lh); load(*lh, 25); dumpur(9, lh->base); L_02c9: returnwork(rh->disp); amap(*rh); load(*rh, 25); dumpur(9, rh->base); poprel(); poprel(); dumppushi(0, lh->size); if (assop != 2) goto L_02ca; perm(4, 6); goto L_02cb; L_02ca: perm(3, 6); L_02cb: return; L_02c6: address(*lh); store(*lh, *rh); poprel(); poprel(); for (;;) { L_02cc: goto L_02cc; void arrayref(int mode) { struct STACKFM *av; int type; int form; int size; int format; if (mode == 0) goto L_02cd; if (top->type != 5) goto L_02ce; load(*top, 25); goto L_02cf; L_02ce: address(*top); L_02cf: dumpvpush(*top); poprel(); return; L_02cd: av = &stack[(stp - 1)]; size = av->size; if (av->type != 3) goto L_02d0; size = (size + 1); L_02d0: form = av->aform; if (form == 13) goto L_02d1; if (form != 14) goto L_02d2; L_02d1: size = 2; L_02d2: if ((control & 4) != 0) goto L_02d3; if (av->dim != 1) goto L_02d3; if (size == 1) goto L_02d4; pushconst(size); operate(3); L_02d4: goto L_02d5; L_02d3: if (top->type != 5) goto L_02d6; load(*top, 25); goto L_02d7; L_02d6: address(*top); L_02d7: dumpvpush(*top); poprel(); L_02d5: if (form == 12) goto L_02d8; if (form != 14) goto L_02d9; L_02d8: type = av->type; format = av->format; size = av->size; if (form != 12) goto L_02da; form = 4; goto L_02db; L_02da: form = 6; L_02db: amap(*av); if ((control & 4) != 0) goto L_02dc; if (av->dim <= 1) goto L_02dd; L_02dc: address(*av); pushcopy(*av); claim(top->base); top->disp = (top->disp + 2); dumpvpush(*top); poprel(); perm(9, ((av->dim * 2) + 2)); pushconst(0); top->form = 1; top->base = 1; claim(1); L_02dd: load(*top, 27); operate(1); top->type = type; top->form = form; top->format = format; top->size = size; top->disp = 0; goto L_02de; L_02d9: if ((control & 4) == 0) goto L_02df; dumppushi(32, av->pbase); perm(9, 4); pushconst(0); top->form = 1; top->base = 1; claim(1); L_02df: address(*av); if (av->form == 4) goto L_02e0; abort("Aref Form"); L_02e0: if (top->form != 0) goto L_02e1; av->disp = (av->disp + top->disp); goto L_02e2; L_02e1: load(*top, 27); if (av->base == 0) goto L_02e3; dumprr(14, top->base, av->base); release(av->base); L_02e3: av->base = top->base; L_02e2: if (form != 11) goto L_02e4; av->form = 4; goto L_02e5; L_02e4: av->form = 6; L_02e5: popstack(); L_02de: top->aform = 0; L_02cc: goto L_02e6; void testzero(struct STACKFM *v) { if (v->type == 1) goto L_02e7; if (v->type != 5) goto L_02e8; L_02e7: load(*v, 25); dumpri(16, v->base, 0); goto L_02e9; L_02e8: abort("Test Zero"); L_02e9: L_02e6: goto L_02ea; void comparerecords(struct STACKFM *l, struct STACKFM *r, int n) { abort("Compare Records"); L_02ea: goto L_02eb; void comparereals(struct STACKFM *l, struct STACKFM *r) { load(*l, 28); load(*r, 28); hazard(1); if (l->base <= r->base) goto L_02ec; d