000 1 SELECT if ( strcmp(src[srcp-1][sercol], "32606") == 0 ) // !!! kludge to force in a 24 order even when no buff swap { w = ixtransit(ref); // find transit area number if ( w == -1 ) // check really is transit area fprintf(fout, " I/O not on transit area\n"); w &= 63; // pick out area number even if not swapping buffers codeOut( 24, 1, 2, traninfo+w+w+1, line); // pseudo route used as modifier codeOut(6, disc, mod, item, NULL); // this instruction never actually gets obeyed } else codeOutSM(6, disc, mod, ref, item, lit, line); 001 1 ADD codeOutSM(4, disc, mod, ref, item, lit, line); 002 1 SUBTRACT codeOutSM(5, disc, mod, ref, item, lit, line); 003 1 COPY codeOutSM(3, disc, mod, ref, item, lit, line); 004 1 AUGMENT codeOutSM(7, disc, mod, ref, item, lit, line); 005 1 TRANSFER codeOutSM(2, disc, mod, ref, item, lit, line); 006 1 MULTIPLY codeOut(9, disc, mod, memref(ref, item, lit), line); 007 1 MULTIPLY and ADD 008 1 MULTIPLY and SUBTRACT 009 1 DIVIDE 010 0 SELECT LITERAL checkLitOK(ref, item, disc, mod, line); litInstr(3, 6, lit, line); 011 0 ADD LITERAL checkLitOK(ref, item, disc, mod, line); litInstr(1, 4, lit, line); 012 0 SUBTRACT LITERAL checkLitOK(ref, item, disc, mod, line); litInstr(2, 5, lit, line); 016 1 MULTIPLY LITERAL w = proc0size[curchap]; // address of W/L codeOut(2, 0, 0, w, line); // transfer also clears A act = hexlit(lit); // this is what Leo III means by 'decimal' if ( act < 0 ) notImplemented("Negative multiplication"); else if ( act < 0x100000 ) codeOut(0, 0, 2, cloc21(act), NULL); else codeOut(0, 1, 2, cloc41(act>>20, act&0xFFFFF), NULL); if ( ref <= 0 && item == 0 ) // i.e. N = zero N.B. ref might be absent codeOut(10, disc, 0, w, NULL); else codeOut(10, disc, mod, memref(ref, item, "0"), NULL); 017 1 MULTIPLY LITERAL and ADD w = hexlit(lit); // this is what Leo III means by 'decimal' if ( w < 0 ) notImplemented("Negative multiplication"); else if ( w < 0x100000 ) codeOut(0, 0, 2, cloc21(w), line); else codeOut(0, 1, 2, cloc41(w>>20, w&0xFFFFF), line); codeOut(10, disc, mod, memref(ref, item, "0"), NULL); 019 1 DIVIDE LITERAL codeOut(1, 0, 1, 0, line); // Clear B if ( ref > 0 ) // (if N is non-zero) Is this check too simple codeOut(6, 0, 1, memref(ref, item, "0"), NULL); codeOut(18, 1, 1, 4119, NULL); // Align to Q2 of B litInstr(-1, 13, lit, NULL); // Literal 020 1 SELECT F/Point 021 1 ADD F/Point 022 1 SUBTRACT F/Point 023 1 COPY F/Point 024 1 AUGMENT F/Point 025 1 TRANSFER F/Point 026 1 MULTIPLY F/Point 029 1 DIVIDE F/Point 030 0 SHIFT (A) BY QUARTETS w = declit(lit); if ( w < 0 ) codeOut(18, 0, 1, 4128 + w, line); else codeOut(18, 0, 1, w, line); 032 0 SHIFT (AB) BY QUARTETS w = declit(lit); if ( w < 0 ) codeOut(18, 1, 1, 4128 + w, line); else codeOut(18, 1, 1, w, line); 031 0 SHIFT (A) BY BITS // drop through - only discriminant is different between 31 and 33 033 0 SHIFT (AB) BY BITS disc = (act-31)>>1; // 1 to shift AB, 0 to shift A w = declit(lit); if ( w < 0 ) { int y = (-w)/4; // avoid negative numbers in case of ... int x = (-w)%4; // ... change of programming language if ( x != 0 ) // x from the manual is 4 - x ... { y ++; // ... if y is increased by 1 codeOut(18, disc, 3, 4-x, line); line = NULL; // listing is attached to first instruction } codeOut(18, 1, disc, 4128 - y, line); // notImplemented("right shift of AB"); } else codeOut(18, disc, 3, w, line); 034 2 SET (N) IN B if ( ref == absent ) ref = 0; if ( ref == 0 ) // absolute address { if ( mod == 0 ) w = 0; else if ( mod < 4 ) // real modifier { w = modinfo + mod; // using pointer in procedure 0 ref ++; } else w = swref(1000+mod); codeOut(24, ref, ref+1, w, line); // either 24/1/2 or 24/0/1 codeOut(0, disc, 2, item, NULL); // address is in item } else if ( mod >= 4 ) // simulate a modifier notImplemented("Simulted modifier"); // cannot do this yet, but will be easy for ref = 0 else if ( mod == 0 ) // no modifier, OK for memref to generate extra code codeOut(0, disc, 2, memref(ref, item, lit), line); else if ( ixtransit(ref) >= 0 // transit area || equivchap[ref] != equivchap[curchap] )// or in a different chapter { w = proc0size[curchap]; // address of W/Ls codeOut(0, 1, 0, w, line); // Copy ABC codeOut(0, 0, 3, zero, NULL); // binary radix -- needed to avoid possible corruption of -ve value codeOut(6, disc, mod, memref(ref, item, lit), NULL); // load new value of B into A codeOut(2, 1, 0, w+2, NULL); // .... and copy to working location codeOut(0, 1, 1, w, NULL); // Restore ABC with new value of B } else // simulate a modifier reg when in current chapter { codeOut(24, 0, 0, modinfo + mod, line); // using pointer in procedure 0 codeOut(0, disc, 2, memref(ref, item, lit), NULL);// memref will not generate extra code } 035 0 PREPARE FOR DIGIT COLLATION codeOut(1, 0, 1, binlit(), line); 036 1 COLLATE AND ADD codeOutSM(15, disc, mod, ref, item, lit, line); 037 1 REPLACE SELECTED BITS codeOutSM(14, disc, mod, ref, item, lit, line); 038 0 ROUND OFF w = hexlit(lit); // this is what Leo III means by 'decimal' codeOut(1, 0, 2, w, line); 039 0 ROUND UP w = proc0size[curchap]; // address of W/L codeOut(2, 1, 0, w, line); // transfer to W/L codeOut(27, 1, 0, loc + 2, NULL); // change sequence if (AB) = 0 codeOut(1, 1, 3, 1, NULL); codeOut(4, 1, 0, w, NULL); 040 0 OPEN FILE // temporary implementation !!!!!!!! ????????? codeOut( 0, 1, 0, proc0size[curchap], line); // copy ABC, set binary codeOut( 0, 0, 3, zero, NULL); // binary radix act= atoi(lit); // = 0 for output lit = line[refcol]; // file name in ASCII w = charval[lit[0]] * 256 + charval[lit[1]]; // file identity w = cloc41(w, 0x08099); // official pattern from User Man Vol III (where?) codeOut( 0, 1, 2, w, NULL); // control information to B if ( act = 0 ) // write w = zero; else w = cloc41(act, 0); // official pattern unknown, w = 0 is output codeOut( 6, 1, 0, w, NULL); // type of operation in Q6 w = getRoute(lit); codeOut( 1, 1, 1, w, NULL); // add in route number codeOut(25, 1, 1, 4096, NULL); codeOut(24, 0, 3, zero, NULL); // enter Master codeOut(23, 0, 2, 40, NULL); codeOut( 0, 0, 3, proc0size[curchap]+4, NULL); // restore C 045 0 REWIND // drop through - only Master routine no is different between 31 and 33 041 0 CLOSE FILE // temporary implementation !!!!!!!! ????????? w = getRoute(line[refcol]); codeOut( 0, 1, 0, proc0size[curchap], line); // copy ABC, set binary codeOut( 0, 0, 3, zero, NULL); codeOut( 6, 1, 0, zero, NULL); // type of operation in Q6 don't know what it should be codeOut( 1, 1, 1, w, NULL); // add in route number codeOut(25, 1, 1, 4096, NULL); codeOut(24, 0, 3, zero, NULL); if ( strcmp(line[sercol], "12609") == 0 ) codeOut(23, 0, 2, 1, NULL); // used by mysterious fancy work at line 10230 else codeOut(23, 0, 2, act, NULL); // enter "Master" indicating which action codeOut( 0, 1, 1, proc0size[curchap], NULL); // restore ABC 042 0 INPUT // drop through - only Master routine no is different between 42 and 43 043 0 OUTPUT // temporary implementation !!!!!!!! ????????? if ( item != 0 ) fprintf(fout, " Do not understand NZ item\n"); item = getRoute(line[refcol]); codeOut( 0, 1, 0, proc0size[curchap], line); // copy ABC, set binary codeOut( 0, 0, 3, zero, NULL); if ( *((line = src[srcp++])[actcol]) != 'C' ) // continuation line fprintf(fout, " Do not understand no continuation line\n"); ref = atoi(line[refcol]); if ( atoi(line[itemcol]) != 0 ) fprintf(fout, " Do not understand NZ item\n"); w = ixtransit(ref); // find transit area number if ( w == -1 ) // check really is transit area fprintf(fout, " I/O not on transit area\n"); w &= 63; // pick out area number if not swapping buffers codeOut( 0, 0, 2, traninfo+w+w, line); // pseudo route no to B codeOut( 6, 1, 0, zero, NULL); // type of operation in Q6 0 = write ?? codeOut( 1, 1, 1, item, NULL); // add in route number codeOut(25, 1, 1, 4096, NULL); codeOut(24, 0, 3, zero, NULL); // enter Master codeOut(23, 0, 2, act, NULL); codeOut( 0, 1, 1, proc0size[curchap], NULL); // restore C 044 0 SET/SELECT REEL COUNTER 048 0 STEP BACK // drop through - in our interim versions, the action number on the 23/0/2 order is the difference 049 0 STEP FORWARD item = 0; // ... except that the step operations put 0 in msb // drop through 046 0 RUN BACK // drop through 047 0 RUN ON mod = getRoute(line[refcol]); // note action is not modifiable codeOut( 0, 1, 0, proc0size[curchap], line); // copy ABC codeOut( 0, 0, 3, zero, NULL); // set binary if ( *((line = src[srcp++])[actcol]) != 'C' )// continuation line fprintf(fout, " Do not understand no continuation line\n"); ref = atoi(line[refcol]); if ( ref == 0 ) // if NC = 0 { w = cloc41(item, hexlit(line[litcol])); // some amazement here about radix codeOut( 0, 1, 2, w, line); // control information to B } else { w = memref(ref, atoi(line[itemcol]), "0"); codeOut( 6, 0, 0, w, line); // select (NC) codeOut( 4, 1, 0, cloc41(item, 0), NULL); // first line item (decimal) in Q6-10 codeOut( 18, 1, 1, 4118, NULL); // manual says 4128, but think this is a misprint } codeOut( 6, 1, 0, 0, NULL); // type of operation in Q6 - no idea what codeOut( 1, 1, 1, mod, NULL); // add in route number codeOut( 25, 1, 1, 4096, NULL); codeOut(24, 0, 3, zero, NULL); // enter Master codeOut(23, 0, 2, act, NULL); codeOut( 0, 1, 1, proc0size[curchap], NULL); // restore C 051 2 UNPACK VARIABLE FIELD DATA 050 2 UNPACK FIXED FIELD DATA // drop through - only discriminant is different between 50 and 52 052 2 EDIT if ( atoi(src[srcp][modcol]) != 0 ) notImplemented("EDIT or UNPACK with modification"); else if ( strcmp(src[srcp][actcol], "C") != 0 ) notImplemented("Continuation line missing with EDIT or UNPACK"); else { int desttran = ixtransit(ref); // transit area for destination or -1 char **cline = src[srcp++]; if ( ( equivchap[ref] != equivchap[curchap] // in different chapter || desttran >= 0 ) // or in a transit area && mod != 0 ) // and modified { int wl = proc0size[curchap]; // W/L to hold computed destination address codeOut(0, 1, 0, wl, line); // Copy ABC line = NULL; codeOut(0, 0, 3, 0, NULL); // Set binary to ensure that ADD works OK codeOut(24, 0, 2, memref(ref, item, "0"), NULL); // load destination into A, will generate 24/1/1 if ( mod >= 4 ) codeOut(4, 0, 0, swref(1000+mod), NULL); // add the value of the modifier else { codeOut(24, 0, 3, modinfo, NULL); // accessed via pointer proc 0 codeOut(4, 0, 0, mod + mod, NULL); // add the value of the modifier } mod = wl - modinfo; // cannot possibly be zero and will generate 24/1/2 to wl codeOut(2, 0, 0, wl, NULL); // store address in W/L codeOut(0, 1, 1, wl, NULL); // Restore ABC desttran = -2; // fprintf(fout, " suspect indirect modified bulk copy\n"); } else if ( mod >= 4) // simulated modifier in this chapter mod = swref(1000+mod) - modinfo; // will generate 23/1/2, but mod value will not be negative codeOut(24, 0, 2, memref(atoi(cline[refcol]), atoi(cline[itemcol]), "0"), line); // load table address into A actinfo = ""; if ( mod != 0 ) // destination is modified codeOut(24, 1, 2, mod + modinfo, NULL); if ( desttran == -2 ) // destination is modified and non-local codeOut(28, (act>>2)&1, 2, 0, cline); // address has been placed in W/L and used with 24/1/2 else codeOut(28, (act>>2)&1, 2, memref(ref, item, "0"), cline); // disc = 1 for EDIT, 0 for UNPACK FIXED } 053 1 CONDENSE 054 21 BULK CLEAR w = declit(lit); if ( w == 0 ) notImplemented("Bulk clear with continuation line"); if ( disc != 0 ) disc = 1; // beware disc = 2 on codeOut codeOut( 6, 1, 0, cloc41(0x20000 + w, 0), line); // load 'table entry' into A codeOut( 28, disc, disc, memref(ref, item, "0"), NULL);// note modifier 1 for long - error in manual?? 055 21 BULK COPY wline = line; line = src[srcp++]; // step srcp to C line w = atoi(line[disccol]); // discriminant of C-line if ( disc != 0 ) { disc = 1; // beware disc = 2 on codeOut if ( w == 0 ) // copy alpha to short numeric item++; // add 1 for alpha to short copy } codeOut2402(mod, ref, item, wline); // load source into A actinfo = ""; codeOut(18, 1, 0, 4123, line); // and shift it down into B item = atoi(line[itemcol]); if ( disc == 0 && w != 0 ) // copy short numeric to alpha item++; // add 1 to destination address w = declit(lit); if ( strcmp(line[actcol], "C") != 0 ) notImplemented("Continuation line missing from BULK COPY"); else if ( w >= 8192 ) notImplemented("Bulk copy big count"); // cannot see why the manual hints at this in Appendix A else { int destmod = atoi(line[modcol]); // modifier of destination int desttran = ixtransit(ref = atoi(line[refcol])); // transit area for destination if ( destmod >= 4 ) notImplemented("Bulk copy simulated modifier"); // cannot do sim mod destination if ( atoi(line[disccol]) != 0 ) mod = 1; // copy to alpha if ( ( equivchap[ref] != equivchap[curchap] // in different chapter || desttran >= 0 ) // or in a transit area && destmod != 0 ) // and modified { int wl = proc0size[curchap]; // W/L to hold computed destination address codeOut(0, 1, 0, wl, NULL); // Copy ABC codeOut(0, 0, 3, 0, NULL); // Set binary to ensure that ADD works OK codeOut(24, 0, 2, memref(ref, item, "0"), NULL); // load destination into A, will generate 24/1/1 codeOut(24, 0, 3, modinfo, NULL); // accessed via pointer proc 0 codeOut(4, 0, 0, destmod + destmod, NULL); // add the value of the modifier codeOut(2, 0, 0, wl, NULL); // store address in W/L codeOut(0, 1, 1, wl, NULL); // Restore ABC - only needed to restore C destmod = wl; // cannot possibly be zero and will generate 24/1/2 to wl desttran = -2; // fprintf(fout, " suspect indirect modified bulk copy\n"); } if ( w == 0 ) { line = src[srcp++]; if ( strcmp(line[actcol], "C") != 0 ) notImplemented("Second continuation line missing from BULK COPY"); codeOutSM(6, atoi(line[disccol]), atoi(line[modcol]), atoi(line[refcol]), atoi(line[itemcol]), "0", line); } else codeOut(1, 1, 3, w, NULL); // literal transfer size codeOut(18, 1, 1, 5, NULL); if ( destmod >= 4 ) // destination is modified indirectly codeOut(24, 1, 2, destmod, NULL); else if ( destmod != 0 ) // destination is modified by mod reg codeOut(24, 0, 0, destmod + modinfo, NULL); if ( desttran == -2 ) // destination is modified and non-local codeOut(28, disc, mod, 0, NULL); // address has been placed in W/L else codeOut(28, disc, mod, memref(ref, item, "0"), NULL); } 056 2 TABLE LOOKUP 057 0 MERGE CONSTANT LENGTH ITEMS 058 0 MERGE VARIABLE LENGTH ITEMS 059 0 SET MODIFICATION REGISTER FOR MERGE if ( mod < 4 ) notImplemented("Real modifier"); // cannot do this yet else { int mloc = swref(mod+1000); // location of simulated modifier w = proc0size[curchap]; // address of W/L codeOut(0, 1, 0, w, line); // Copy ABC codeOut(0, 0, 3, 0, NULL); // Set binary codeOut(24, 0, 2, memref(ref, item, "0"), NULL); // Start location codeOut(3, 0, 0, mloc , NULL); // Less significant half of modification register line = src[srcp++]; if ( strcmp(line[actcol], "C") != 0 ) notImplemented("Continuation line missing from SET MOD..."); else { codeOut(4, atoi(line[disccol]), atoi(line[modcol]), // Length memref(atoi(line[refcol]), atoi(line[itemcol]), "0"), line); codeOut(2, 0, 0, mloc+1 , NULL); // More significant half of modification resister } codeOut(0, 1, 1, w, NULL); // Restore ABC } 060 0 SET DECIMAL RADIX codeOut(0, 0, 3, cloc21(0x66666), line); 061 0 SET STERLING RADIX 062 0 SET EXCESS CONSTANTS codeOut(0, 0, 3, hexlit(lit), line); 063 1 CONVERT DECIMAL TO STERLING 064 1 CONVERT STERLING TO DECIMAL 065 1 CONVERT 066 0 SET UP FOR SIGNIFICANT DIGIT FLOATING POINT ARITHMETIC 067 0 SET UP FOR NORMALISED FLOATING POINT ARITHMETIC 070 0 JUMP IF A == 0 codeOut(27, 0, 0, memref(ref, item, lit), line); 071 0 JUMP IF A != 0 codeOut(27, 0, 1, memref(ref, item, lit), line); 072 0 JUMP IF A >= 0 codeOut(27, 0, 2, memref(ref, item, lit), line); 073 0 JUMP IF A < 0 codeOut(27, 0, 3, memref(ref, item, lit), line); 074 0 JUMP IF AB == 0 // 27, 1, 0 codeOut(27, 1, 0, memref(ref, item, lit), line); 075 0 JUMP IF AB != 0 codeOut(27, 1, 1, memref(ref, item, lit), line); 076 0 JUMP unconditional codeOut(24, 1, 0, memref(ref, item, lit), line); 077 0 JUMP IF A* == 0 078 0 JUMP IF A* != 0 079 0 JUMP IF A* >= 0 080 0 ENTER SUBROUTINE codeOut(26, 0, 0, memref(ref, 2, lit), line); // we need to ignore the item and go to the start w = 0; // for counting continuation lines while ( strcmp(src[srcp + (w++)][actcol], "C") == 0 ) ; if ( --w != 0 ) { codeOut(24, 1, 0, loc + w + 1, NULL); conpars(); // deal with continuation lines which are addresses of locations } // notImplemented("Subroutine parameters"); 081 0 START OF SUBROUTINE last81 = loc; // used for accessing parameters codeOut(0, 0, 0, 0, line); // generates zero word for the link address 082 0 END OF SUBROUTINE / LEAVE SUBROUTINE codeOut(26, 0, 1, memref(ref, 2, lit), line); // seems we need to ignore the item and get returj from the start 083 0 SET SWITCH(ES) AT LITERAL VALUE w = hexlit(lit); // assume usual meaning if ( w >= 10 ) // but warn of large values fprintf(fout, " Large switch value at line %s\n", line[sercol]); codeOut(1, 1, 3, w, line); codeOut(2, 0, 0, swref(ref), NULL); // transfer to private location 084 01 SET SWITCH(ES) AT VARIABLE VALUE if ( *(src[srcp][actcol]) == 'C' ) // continuation line { char **conline; // notImplemented("SET SWITCH(ES) AT VARIABLE"); // to flag until we meet one in execution conline = src[srcp++]; w = atoi(conline[refcol]); item = atoi(conline[itemcol]); mod = atoi(conline[modcol]); disc = atoi(conline[disccol]); codeOut(6, disc, mod, memref(w, item, "0"), line); line = conline; // generates correct listing on next line } codeOut(2, 0, 0, swref(ref), line); // transfer to private location 085 0 SWITCH R codeOut(24, 0, 1, swref(ref), line); codeOut(26, 0, 1, (loc + chapaddr[curchap]) & 017777, NULL); // exit via next word - assume switch starts at 1 conpars(); // deal with continuation lines which are addresses of locations 086 0 SELECT SWITCH R codeOut(6, 0, 0, swref(ref), line); 087 2 SWITCH ACCORDING TO N codeOut(24, 0, 1, memref(ref, item, lit), line); // modify addr used for exit codeOut(26, 0, 1, (loc + chapaddr[curchap]) & 017777, NULL); // exit via next word - assume switch starts at 1 conpars(); // deal with continuation lines which are addresses of locations 090 0 SET MODIFICATION REGISTER AT LITERAL w = declit(lit); // pointer value ref = declit(src[srcp][litcol]); // end value if ( strcmp(src[srcp][actcol], "C") != 0 ) notImplemented("Continuation line missing from SET MOD..."); else if ( mod >= 4 ) { codeOut(6, 1, 0, cloc41(ref&32767, w&32767), line); actinfo = "Simulated modifier"; codeOut(2, 1, 0, swref(1000+mod), src[srcp++]); } else { codeOut(26, 1, mod, cloc41(ref&32767, w&32767), line); actinfo = "Limit"; codeOut(-1, 0, 0, 0, src[srcp++]); // generates no code, just lists the continuation line and steps srcp } 091 0 SET MODIFICATION REGISTER AT VARIABLE if ( ref > 0 || item != 0 ) // does this equate to N != 0 ? w = memref(ref, item, "0"); // addressing location else if ( mod >= 4 ) // simulated modifier with value in A w = 0; // indicates value now in A from where we can copy to modifier else { w = proc0size[curchap]; // address of W/L codeOut(3, 1, 0, w, line); // put A into W/L line = NULL; // suppress listing on 2nd instruction } if ( mod < 4 ) // proper modifier codeOut(26, 1, mod, w, line); else if ( w == 0 ) codeOut(2, 1, 0, swref(mod+1000), line); // copy to simulated location else { codeOut(6, 1, 0, w, line); // value from variable location codeOut(2, 1, 0, swref(mod+1000), NULL); // copy to simulated location } 092 0 SET MODIFIER AT VARIABLE if ( ref != absent || item != 0 ) // does this equate to N != 0 ? { codeOut(6, 0, 0, memref(ref, item, "0"), line); // load variable line = NULL; // suppress listing on 2nd instruction } if ( mod >= 4 ) codeOut(2, 0, 0, swref(mod+1000), line); // transfer to location of simulated modifier else { codeOut(24, 0, 3, modinfo, line); // points at modifier group codeOut(2, 0, 0, mod + mod, NULL); // do the deed and leave A clear } 093 0 SET (N) AS MODIFIER 097 0 STEP ON AND TEST MODIFICATION REGISTER (VARIABLE) codeOut(24, 0, 1, memref(ref, item, "0"), line); line = src[srcp++]; if ( *(line[actcol]) != 'C' ) // if no continuation line { line = NULL; // avoid reprint of source srcp --; // remove increment ref = 0; // execute next instruction } else if ( atoi(line[modcol]) != 0 ) notImplemented("Modified destination"); else { ref = atoi(line[refcol]); item = atoi(line[itemcol]); } lit = "0"; // ensures zero address part in next bit // drop through - now that we have tweaked the parameters 094 0 STEP ON AND TEST MODIFICATION REGISTER (LITERAL) w = declit(lit); if ( w < 0 ) w = 0x1000 - w; // 13-bit sign and modulus if ( mod >= 4 ) // simulated modifier { codeOut(23, 0, 0, w, line); codeOut(0, 0, 1, swref(1000+mod), NULL); } else codeOut(25, 0, mod, w, line); icAct = 89; // cause addresses to be calculated from serial no if ( ref > 0 ) // reference is present codeOut(24, 1, 0, memref(ref, item, "0"), NULL); else codeOut(24, 1, 0, (loc+1)&0x1FFF, NULL); // jump to next instruction 095 0 SELECT MODIFICATION REGISTER // drop through - only discriminant is different between 95 and 96 096 0 SELECT MODIFIER if ( mod >= 4 ) codeOut(6, act&1, 0, swref(1000+mod), NULL); // Simulated modifier else { codeOut(24, 0, 3, modinfo, line); codeOut(6, act&1, 0, mod + mod, NULL); // accessed via pointer proc 0 } 098 0 ADD MODIFICATION REGISTER TO A // drop through - only action is different between 95 and 96 099 0 SUBTRACT MODIFICATION REGISTER FROM A if ( mod >= 4 ) codeOut(act-94, disc, 0, swref(1000+mod), line); else { codeOut(24, 0, 3, modinfo, line); codeOut(act-94, disc, 0, mod + mod, NULL); // accessed via pointer proc 0 } ----------------- 100/0/0 HALT Stop machine and light stop lamp. 100/0/3 SET RADIX Copy (N) to C. 100/1/0 COPY REGISTERS Copy (A), (B), (C) to N’, N+2’, N + 4’. 100/1/1 REPLACE REGISTERS Replace (A), (B), (C) by (N’), (N+2’), 100/d/2 REPLACE (B) BY (N). 101/0/1 PREPARE FOR DIGIT COLLATION For each of the least significant 10 bits 101/0/2 ROUND OFF Add 1 to (A) if Q10 of B >= N and clear 101/0/3 INTERCHANGE AREA ADDRESSES Interchange (64 + N1) and (64 + N2). 101/1/1 ADD LITERAL ADDRESS Add N to (A). 101/1/2 SUBTRACT LITERAL ADDRESS Subtract N from (A). 101/1/3 SELECT LITERAL ADDRESS Select N into A. 101/d/0 TABLE LOOK UP Search locations N onwards for a literal 102/d/m TRANSFER (A) TO N Clear A. 103/d/m COPY (A) TO N Leaves (A) unchanged 104/d/m ADD (N) TO (A). 105/d/m SUBTRACT (N) FROM (A). 106/d/m SELECT (N) into A. 107/d/m AUGMENT (N) BY (A). 108/0/m MERGE CONSTANT LENGTH Merge strings of constant length data, 108/1/m MERGE VARIABLE LENGTH Merge strings of variable length data, 109/d/m MULTIPLY UNIFORM RADIX Multiply (A) by (N) and place in AB. 110/d/m MULTIPLY AND ADD Multiply (B) by (N) and add to (A). 111/d/m MULTIPLY AND SUBTRACT Multiply (B) by (N) and subtract from (A). 112/d/m CONVERT Convert (N) to the radix (C) and place 113/d/m DIVIDE UNIFORM RADIX Divide (AB) by (N) leaving quotient in A 114/d/m REPLACE SELECTED BITS Replace bits of (N) specified by (B) with 115/d/m COLLATE AND ADD Collate (N) with (B) and add to (A). 116/1/0 COMPARE Compare strings S1 and S2 of alpha 117/0/0 SPECIAL SELECT Select (N’) into A if N is even, otherwise 117/1/0 SPECIAL COPY Copy (A) to N’ if N is even, otherwise 118/0/0 SHIFT LOGICAL Shift (A) logically. 118/0/1 SHIFT ARITHMETIC Shift (A) arithmetically. 118/0/2 SCALE NUMERATOR Shift (AB) so that the most significant 118/0/3 SHIFT BINARY Binary left shift (A). 118/1/0 SHIFT LOGICAL Shift (AB) logically. 118/1/1 SHIFT ARITHMETIC Shift (AB) arithmetically. 118/1/2 SCALE DENOMINATOR Shift (AB) so that the most significant 118/1/3 SHIFT BINARY Binary left shift (AB). 119/0/0 OUTPUT Output one block to route N1. 119/0/1 INPUT ONE BLOCK/RESET TIMER Input one block from route N1./ 119/0/2 RUN BACK * Run back to last block mark on route N1. 119/0/3 RUN FORWARD * Run forward to next mark on route N1. 119/1/0 STEP BACK * Step back one block on route N1. 119/1/1 REWIND * Rewind route N1 ready to read/write 119/1/2 UNLOAD * Unload route N1 and set route to manual. 119/1/3 INPUT FIRST WORD */SET Input first word of block and run 120/0/m ADD FLOATING POINT Add (N) to (A*). 120/1/m SUBTRACT FLOATING POINT Subtract (N) from (A*). 121/0/m TRANSFER FLOATING POINT Transfer (A*) to N. 121/1/m COPY FLOATING POINT Copy (A*) to N. 122/0/m MULTIPLY FLOATING POINT Multiply (A*) by (N) and place in A*. 122/1/m DIVIDE FLOATING POINT Divide (A*) by (N) and place in A*. 123/0/0 STEP ON AND TEST Step on and test indirect modifier by N. 123/0/2 ENTER MASTER ROUTINE Place SC + 1 in bits 1 to 15 of N and 123/0/3 SELECT TAG Select tag of N into A clearing rest of A. 123/1/m COPY INTO TAG Copy (A) into tag of N. 124/0/0 MODIFY ADDRESS OF NEXT Search locations N, (|N|), (|(|N|)|), etc. 124/0/1 MODIFY ADDRESS OF NEXT Modify address of next instruction by 124/0/2 SELECT LITERAL AND DIVISION Select N and division number from SC 124/0/3 MODIFY ADDRESS OF NEXT Modify address of next instruction by 124/1/0 UNCONDITIONAL SEQUENCE Change sequence to N. 124/1/1 SET MODIFICATION GROUP Set bits 14 and 15 of indicator register 124/1/2 MODIFY ADDRESS OF NEXT Search locations N, (|N|), (|(|N|)|), etc. 125/0/m STEP ON AND TEST Step on and test modification register 125/1/0 SET INDICATORS Where bits of N are ‘1’ set 125/1/1 CLEAR INDICATORS Where bits of N are ‘1’ reset 125/1/2 INTERROGATE INDICATORS Collate indicator register with N and 125/1/3 CONDITIONAL HALT Collate indicator register with N and 126/0/0 ENTER SUBROUTINE Place (SC) in N and change sequence 126/0/1 LEAVE SUBROUTINE Change sequence to (N). 126/0/2 ENTER PRIORITY CONTROL Place (SC) in N bits 1 to 15 and (T) in 126/0/3 LEAVE MASTER ROUTINE Replace (T) by bits 17 to 20 of (N). 126/1/0 TEST ROUTE Test route specified by N literal. 126/1/m SET MODIFICATION REGISTER Copy (N) to modification register. 127/0/0 TEST SHORT ACCUMULATOR Z Test (A) and change sequence to N if 127/0/1 TEST SHORT ACCUMULATOR NZ non 0 Test (A) and change sequence to N if 127/0/2 TEST SHORT ACCUMULATOR GEZ Test (A) and change sequence to N if 127/0/3 TEST SHORT ACCUMULATOR LZ Test (A) and change sequence to N if 127/1/0 TEST LONG ACCUMULATOR Z Test (AB) and change sequence to N if 127/1/1 TEST LONG ACCUMULATOR NZ Test (AB) and change sequence to N if 127/1/2 TEST LONG ACCUMULATOR GEZ Test (AB) and change sequence to N if 127/1/3 TEST LONG ACCUMULATOR LZ Test (AB) and change sequence to N if 128/0/0 BULK CLEAR SHORT If bit 38 of A = 1 clear short 128/0/0 BULK COPY SHORT NUMERIC If bit 38 of A = 0 copy short numeric 128/0/1 BULK COPY SHORT NUMERIC If bit 38 of A = 0 copy short numeric 128/0/2 UNPACK FIXED FIELD DATA Unpack data in alpha octet form in a 128/0/3 UNPACK VARIABLE FIELD DATA Unpack data in alpha octet form in a 128/1/0 BULK COPY ALPHA TO SHORT If bit 38 of A = 0 copy alpha words to 128/1/1 BULK CLEAR LONG If bit 38 of A = 1 clear long 128/1/1 BULK COPY LONG NUMERIC If bit 38 of A = 0 copy long numeric or 128/1/2 EDIT FIXED FIELD FORMATS Edit items into fixed field layout in alpha 128/1/3 CONDENSE Condense items into variable field 129/0/0 EDIT FOR HOLLERITH OUTPUT After action 28/1/2 edit up to 80 129/0/1 EDIT FOR ANELEX OUTPUT After action 28/1/2 edit up to 160 130/0/m TRANSFER DOUBLE LENGTH Transfer (AB) to N + 2 and N and clear 130/1/m COPY DOUBLE LENGTH Copy (AB) to N + 2 and N. 131/0/m ADD DOUBLE LENGTH Add (N + 2) and (N) to (AB). 131/1/m SUBTRACT DOUBLE LENGTH Subtract (N + 2) and (N) from (AB). ----------------- 140 1 CLEAR AB 141 1 DOUBLE LENGTH ADD 142 1 DOUBLE LENGTH SUBTRACT 143 1 DOUBLE LENGTH COPY 145 1 DOUBLE LENGTH TRANSFER 146 1 DOUBLE LENGTH MULTIPLY 147 1 DOUBLE LENGTH MULTIPLY and ADD 148 1 DOUBLE LENGTH MULTIPLY and SUBTRACT 150 0 OFFER OPTIONS w = hexlit(lit); if ( w == 0 ) // zero literal ... codeOut(6, 0, 0, memref(ref, item, lit), line); else codeOut(1, 1, 3, w, line); codeOut(0, 0, 2, cloc21(concount()), NULL); codeOut(25, 1, 1, 4096, NULL); codeOut(24, 0, 3, zero, NULL); codeOut(26, 0, 2, 1, NULL); // see comment on routiner svc in leo3.c conpars(); // deal with continuation lines which are addresses of locations 151 0 UNLOAD PROGRAMME codeOut(25, 1, 1, 4096, line); codeOut(24, 0, 3, zero, NULL); codeOut(26, 0, 2, 2, NULL); // see comment on routine svc in leo3.c 152 0 OVERLAY w = atoi(src[srcp][refcol]); // start chapter of new overlay if ( pass == 1 ) { fprintf(fout, "\n -------------------------\n"); fprintf(fout, " Equivalent PROCRs %d %s\n", ref, src[srcp][refcol]); fprintf(fout, " Equivalent CHAPs %d %d\n", procchap[ref], procchap[w]); curovr ++; // move to next overlay ovrindex[curovr] = w; fprintf(fout, " Overlay %d starts at proc %d\n", curovr, w); } else { int i = -1; while ( ovrindex[++i] >= 0 && ovrindex[i] != w ) ; // find which overlay we are calling if ( i < 0 ) fprintf(fout, " PROCR %d in CHAP %d is not recorded as starting an overlay\n", w, procchap[w]); else fprintf(fout, " PROCR %d in CHAP %d overlay = %d\n", w, procchap[w], i); w = i; } codeOut(24, 0, 3, zero, line); // enter Master codeOut(23, 0, 2, 100+w, src[srcp++]); // overlay indicated by n - 100 153 0 SELECT DATE TO A, TIME TO B codeOut(24, 0, 3, zero, NULL); // division 0 codeOut(6, 1, 0, 138, line); // pick up date -- temp because no storage protection codeOut(24, 0, 3, zero, NULL); // division 0 codeOut(0, 0, 2, 156, NULL); // pick up time -- not yet implemented in emulator 154 0 COMMENT IN LOG w = proc0size[curchap]; // address of W/Ls codeOut( 0, 1, 0, w, line); // Copy ABC codeOut( 0, 0, 3, 0, NULL); // Set binary codeOut(24, 0, 2, memref(ref, item, lit), NULL); // Select annexe start codeOut(24, 0, 3, zero, NULL); // Enter Master codeOut(23, 0, 2, 154, NULL); // codeOut( 0, 1, 1, w, NULL); // Restore ABC 155 0 SELECT PROGRAM SERIAL TO A codeOut(6, 1, 0, cloc41(0x30483, 0x04141), line); 156 0 RELEASE ROUTE(S) ALLOCATED TO FILE B 157 2 EXPAND 158 0 COMPARE