diff --git a/modules/pdp10/lib/debugger.js b/modules/pdp10/lib/debugger.js index c7616e747..c4d2ba277 100644 --- a/modules/pdp10/lib/debugger.js +++ b/modules/pdp10/lib/debugger.js @@ -1326,7 +1326,7 @@ class DebuggerPDP10 extends Debugger { */ if (!nState) { opCode = this.cpu.readWord(addr); - if ((opCode / PDP10.OPCODE.FNSHIFT)|0 == PDP10.OPCODE.FNHALT && this.cpu.getLastPC() == addr) { + if ((opCode >> PDP10.OPCODE.FNSHIFT) == PDP10.OPCODE.HALT && this.cpu.getLastPC() == addr) { addr = this.cpu.advancePC(1); } } @@ -1354,7 +1354,7 @@ class DebuggerPDP10 extends Debugger { if (opCode < 0) { opCode = this.cpu.readWord(addr); } - if ((opCode & 0xffff) != PDP10.OPCODE.INVALID) { + if (opCode >= 0) { var dbgAddr = this.aInstructionHistory[this.iInstructionHistory]; this.setAddr(dbgAddr, addr); // if (DEBUG) dbgAddr.cycleCount = cpu.getCycles(); @@ -1389,6 +1389,12 @@ class DebuggerPDP10 extends Debugger { opNum = opMasks[op & mask]; if (opNum) { opMask = +mask; + /* + * When we extracted op from opCode using OPSHIFT, we included 6 additional bits + * to help distinguish OPIO instructions from non-OPIO instructions. But for the + * following tests, we don't need those bits, so we get rid of them now. + */ + op >>= 6; switch(opMask) { case PDP10.OPCODE.OPMODE: aModes = DebuggerPDP10.OPMODES; @@ -1412,7 +1418,20 @@ class DebuggerPDP10 extends Debugger { if (sMode == "S" && opNum > DebuggerPDP10.OPS.MOVM) sMode = "B"; var sOpName = opNames[opNum] + sMode; - if (!opNum) sOperands = this.toStrWord(opCode); + if (!opNum) { + sOperands = this.toStrWord(opCode); + } else { + if (opMask == PDP10.OPCODE.OPIO) { + sOperands = this.toStrBase((opCode / PDP10.OPCODE.IOSHIFT) & PDP10.OPCODE.IOMASK, -1); + } else { + sOperands = this.toStrBase((opCode >> PDP10.OPCODE.FNSHIFT) & PDP10.OPCODE.FNMASK, -1); + } + if (sOperands) sOperands += ','; + if (opCode & PDP10.OPCODE.I_BIT) sOperands += '@'; + sOperands += this.toStrBase(opCode & PDP10.OPCODE.Y_MASK, -1); + var i = (opCode >> PDP10.OPCODE.X_SHIFT) & PDP10.OPCODE.X_MASK; + if (i) sOperands += '(' + this.toStrBase(i, -1) + ')'; + } var sOpCodes = ""; var sLine = this.toStrAddr(dbgAddrOp) + ":"; @@ -3501,7 +3520,9 @@ if (DEBUGGER) { TD: 81, TS: 82, XCT: 83, JFFO: 84, JFCL: 85, JSR: 86, JSP: 87, JRST: 88, JSA: 89, JRA: 90, PUSHJ: 91, POPJ: 92, - UUO: 93 + BLKI: 93, DATAI: 94, BLKO: 95, DATAO: 96, + CONO: 97, CONI: 98, CONSZ: 99, CONSO: 100, + UUO: 101 }; /* @@ -3532,6 +3553,8 @@ if (DEBUGGER) { "TD", "TS", "XCT", "JFFO", "JFCL", "JSR", "JSP", "JRST", "JSA", "JRA", "PUSHJ", "POPJ", + "BLKI", "DATAI", "BLKO", "DATAO", + "CONO", "CONI", "CONSZ", "CONSO", "UUO" ]; @@ -3544,7 +3567,7 @@ if (DEBUGGER) { ]; /* - * PDP-10 opcodes are 36-bit values: + * PDP-10 opcodes are 36-bit values, many of which use the following layout: * * 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 @@ -3565,114 +3588,130 @@ if (DEBUGGER) { * 2: MEMORY M AC E * 3: SELF S E E (and AC if A is non-zero) * - * Bits 0-21 (I,X,Y) contain what we call a "reference address" (R), which is used to + * Input-output instructions look like: + * + * 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 + * 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * 1 1 1 D D D D D D D O O O I X X X X Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y + * + * Bits 0-22 (I,X,Y) contain what we call a "reference address" (R), which is used to * calculate the "effective address" (E). To determine E from R, we must extract I, X, * and Y from R, set E to Y, then add [X] to E if X is non-zero. If I is zero, then * we're done; otherwise, we must set set R to [E] and repeat the process. */ DebuggerPDP10.OPTABLE = { [PDP10.OPCODE.OPMASK]: { - 0o130: DebuggerPDP10.OPS.UFA, - 0o131: DebuggerPDP10.OPS.DFN, - 0o132: DebuggerPDP10.OPS.FSC, - 0o133: DebuggerPDP10.OPS.IBP, - 0o134: DebuggerPDP10.OPS.ILDB, - 0o135: DebuggerPDP10.OPS.LDB, - 0o136: DebuggerPDP10.OPS.IDPB, - 0o137: DebuggerPDP10.OPS.DPB, - 0o240: DebuggerPDP10.OPS.ASH, - 0o241: DebuggerPDP10.OPS.ROT, - 0o242: DebuggerPDP10.OPS.LSH, - 0o243: DebuggerPDP10.OPS.JFFO, - 0o244: DebuggerPDP10.OPS.ASHC, - 0o245: DebuggerPDP10.OPS.ROTC, - 0o246: DebuggerPDP10.OPS.LSHC, - 0o250: DebuggerPDP10.OPS.EXCH, - 0o251: DebuggerPDP10.OPS.BLT, - 0o252: DebuggerPDP10.OPS.AOBJP, - 0o253: DebuggerPDP10.OPS.AOBJN, - 0o254: DebuggerPDP10.OPS.JRST, // includes HALT, JRSTF, and JEN - 0o255: DebuggerPDP10.OPS.JFCL, // includes JOV, JCRY0, JCRY1, JCRY, and JFOV - 0o256: DebuggerPDP10.OPS.XCT, - 0o260: DebuggerPDP10.OPS.PUSHJ, - 0o261: DebuggerPDP10.OPS.PUSH, - 0o262: DebuggerPDP10.OPS.POP, - 0o263: DebuggerPDP10.OPS.POPJ, - 0o264: DebuggerPDP10.OPS.JSR, - 0o265: DebuggerPDP10.OPS.JSP, - 0o266: DebuggerPDP10.OPS.JSA, - 0o267: DebuggerPDP10.OPS.JRA, + 0o13000: DebuggerPDP10.OPS.UFA, + 0o13100: DebuggerPDP10.OPS.DFN, + 0o13200: DebuggerPDP10.OPS.FSC, + 0o13300: DebuggerPDP10.OPS.IBP, + 0o13400: DebuggerPDP10.OPS.ILDB, + 0o13500: DebuggerPDP10.OPS.LDB, + 0o13600: DebuggerPDP10.OPS.IDPB, + 0o13700: DebuggerPDP10.OPS.DPB, + 0o24000: DebuggerPDP10.OPS.ASH, + 0o24100: DebuggerPDP10.OPS.ROT, + 0o24200: DebuggerPDP10.OPS.LSH, + 0o24300: DebuggerPDP10.OPS.JFFO, + 0o24400: DebuggerPDP10.OPS.ASHC, + 0o24500: DebuggerPDP10.OPS.ROTC, + 0o24600: DebuggerPDP10.OPS.LSHC, + 0o25000: DebuggerPDP10.OPS.EXCH, + 0o25100: DebuggerPDP10.OPS.BLT, + 0o25200: DebuggerPDP10.OPS.AOBJP, + 0o25300: DebuggerPDP10.OPS.AOBJN, + 0o25400: DebuggerPDP10.OPS.JRST, // includes HALT, JRSTF, and JEN + 0o25500: DebuggerPDP10.OPS.JFCL, // includes JOV, JCRY0, JCRY1, JCRY, and JFOV + 0o25600: DebuggerPDP10.OPS.XCT, + 0o26000: DebuggerPDP10.OPS.PUSHJ, + 0o26100: DebuggerPDP10.OPS.PUSH, + 0o26200: DebuggerPDP10.OPS.POP, + 0o26300: DebuggerPDP10.OPS.POPJ, + 0o26400: DebuggerPDP10.OPS.JSR, + 0o26500: DebuggerPDP10.OPS.JSP, + 0o26600: DebuggerPDP10.OPS.JSA, + 0o26700: DebuggerPDP10.OPS.JRA, }, [PDP10.OPCODE.OPMODE]: { - 0o140: DebuggerPDP10.OPS.FAD, - 0o144: DebuggerPDP10.OPS.FADR, - 0o150: DebuggerPDP10.OPS.FSB, - 0o154: DebuggerPDP10.OPS.FSBR, - 0o160: DebuggerPDP10.OPS.FMP, - 0o164: DebuggerPDP10.OPS.FMPR, - 0o170: DebuggerPDP10.OPS.FDV, - 0o174: DebuggerPDP10.OPS.FDVR, - 0o200: DebuggerPDP10.OPS.MOV, - 0o204: DebuggerPDP10.OPS.MOVS, - 0o210: DebuggerPDP10.OPS.MOVN, - 0o214: DebuggerPDP10.OPS.MOVM, - 0o220: DebuggerPDP10.OPS.IMUL, - 0o224: DebuggerPDP10.OPS.MUL, - 0o230: DebuggerPDP10.OPS.IDIV, - 0o234: DebuggerPDP10.OPS.DIV, - 0o270: DebuggerPDP10.OPS.ADD, - 0o274: DebuggerPDP10.OPS.SUB, - 0o400: DebuggerPDP10.OPS.SETZ, - 0o404: DebuggerPDP10.OPS.AND, - 0o410: DebuggerPDP10.OPS.ANDCA, - 0o414: DebuggerPDP10.OPS.SETM, - 0o420: DebuggerPDP10.OPS.ANDCM, - 0o424: DebuggerPDP10.OPS.SETA, - 0o430: DebuggerPDP10.OPS.XOR, - 0o434: DebuggerPDP10.OPS.IOR, - 0o440: DebuggerPDP10.OPS.ANDCB, - 0o444: DebuggerPDP10.OPS.EQV, - 0o450: DebuggerPDP10.OPS.SETCA, - 0o454: DebuggerPDP10.OPS.ORCA, - 0o460: DebuggerPDP10.OPS.SETCM, - 0o464: DebuggerPDP10.OPS.ORCM, - 0o470: DebuggerPDP10.OPS.ORCB, - 0o474: DebuggerPDP10.OPS.SETO, - 0o500: DebuggerPDP10.OPS.HLL, - 0o504: DebuggerPDP10.OPS.HRL, - 0o510: DebuggerPDP10.OPS.HLLZ, - 0o514: DebuggerPDP10.OPS.HRLZ, - 0o520: DebuggerPDP10.OPS.HLLO, - 0o524: DebuggerPDP10.OPS.HRLO, - 0o530: DebuggerPDP10.OPS.HLLE, - 0o534: DebuggerPDP10.OPS.HRLE, - 0o540: DebuggerPDP10.OPS.HRR, - 0o544: DebuggerPDP10.OPS.HLR, - 0o550: DebuggerPDP10.OPS.HRRZ, - 0o554: DebuggerPDP10.OPS.HLRZ, - 0o560: DebuggerPDP10.OPS.HRRO, - 0o564: DebuggerPDP10.OPS.HLRO, - 0o570: DebuggerPDP10.OPS.HRRE, - 0o574: DebuggerPDP10.OPS.HLRE + 0o14000: DebuggerPDP10.OPS.FAD, + 0o14400: DebuggerPDP10.OPS.FADR, + 0o15000: DebuggerPDP10.OPS.FSB, + 0o15400: DebuggerPDP10.OPS.FSBR, + 0o16000: DebuggerPDP10.OPS.FMP, + 0o16400: DebuggerPDP10.OPS.FMPR, + 0o17000: DebuggerPDP10.OPS.FDV, + 0o17400: DebuggerPDP10.OPS.FDVR, + 0o20000: DebuggerPDP10.OPS.MOV, + 0o20400: DebuggerPDP10.OPS.MOVS, + 0o21000: DebuggerPDP10.OPS.MOVN, + 0o21400: DebuggerPDP10.OPS.MOVM, + 0o22000: DebuggerPDP10.OPS.IMUL, + 0o22400: DebuggerPDP10.OPS.MUL, + 0o23000: DebuggerPDP10.OPS.IDIV, + 0o23400: DebuggerPDP10.OPS.DIV, + 0o27000: DebuggerPDP10.OPS.ADD, + 0o27400: DebuggerPDP10.OPS.SUB, + 0o40000: DebuggerPDP10.OPS.SETZ, + 0o40400: DebuggerPDP10.OPS.AND, + 0o41000: DebuggerPDP10.OPS.ANDCA, + 0o41400: DebuggerPDP10.OPS.SETM, + 0o42000: DebuggerPDP10.OPS.ANDCM, + 0o42400: DebuggerPDP10.OPS.SETA, + 0o43000: DebuggerPDP10.OPS.XOR, + 0o43400: DebuggerPDP10.OPS.IOR, + 0o44000: DebuggerPDP10.OPS.ANDCB, + 0o44400: DebuggerPDP10.OPS.EQV, + 0o45000: DebuggerPDP10.OPS.SETCA, + 0o45400: DebuggerPDP10.OPS.ORCA, + 0o46000: DebuggerPDP10.OPS.SETCM, + 0o46400: DebuggerPDP10.OPS.ORCM, + 0o47000: DebuggerPDP10.OPS.ORCB, + 0o47400: DebuggerPDP10.OPS.SETO, + 0o50000: DebuggerPDP10.OPS.HLL, + 0o50400: DebuggerPDP10.OPS.HRL, + 0o51000: DebuggerPDP10.OPS.HLLZ, + 0o51400: DebuggerPDP10.OPS.HRLZ, + 0o52000: DebuggerPDP10.OPS.HLLO, + 0o52400: DebuggerPDP10.OPS.HRLO, + 0o53000: DebuggerPDP10.OPS.HLLE, + 0o53400: DebuggerPDP10.OPS.HRLE, + 0o54000: DebuggerPDP10.OPS.HRR, + 0o54400: DebuggerPDP10.OPS.HLR, + 0o55000: DebuggerPDP10.OPS.HRRZ, + 0o55400: DebuggerPDP10.OPS.HLRZ, + 0o56000: DebuggerPDP10.OPS.HRRO, + 0o56400: DebuggerPDP10.OPS.HLRO, + 0o57000: DebuggerPDP10.OPS.HRRE, + 0o57400: DebuggerPDP10.OPS.HLRE }, [PDP10.OPCODE.OPCOMP]: { - 0o300: DebuggerPDP10.OPS.CAI, - 0o310: DebuggerPDP10.OPS.CA, - 0o320: DebuggerPDP10.OPS.JUMP, - 0o330: DebuggerPDP10.OPS.SKIP, - 0o340: DebuggerPDP10.OPS.AOJ, - 0o350: DebuggerPDP10.OPS.AOS, - 0o360: DebuggerPDP10.OPS.SOJ, - 0o370: DebuggerPDP10.OPS.SOS, + 0o30000: DebuggerPDP10.OPS.CAI, + 0o31000: DebuggerPDP10.OPS.CA, + 0o32000: DebuggerPDP10.OPS.JUMP, + 0o33000: DebuggerPDP10.OPS.SKIP, + 0o34000: DebuggerPDP10.OPS.AOJ, + 0o35000: DebuggerPDP10.OPS.AOS, + 0o36000: DebuggerPDP10.OPS.SOJ, + 0o37000: DebuggerPDP10.OPS.SOS, }, [PDP10.OPCODE.OPTEST]: { - 0o600: DebuggerPDP10.OPS.TR, - 0o601: DebuggerPDP10.OPS.TL, - 0o610: DebuggerPDP10.OPS.TD, - 0o611: DebuggerPDP10.OPS.TS, + 0o60000: DebuggerPDP10.OPS.TR, + 0o60100: DebuggerPDP10.OPS.TL, + 0o61000: DebuggerPDP10.OPS.TD, + 0o61100: DebuggerPDP10.OPS.TS, + }, + [PDP10.OPCODE.OPIO]: { + 0o70000: DebuggerPDP10.OPS.BLKI, + 0o70004: DebuggerPDP10.OPS.DATAI, + 0o70010: DebuggerPDP10.OPS.BLKO, + 0o70014: DebuggerPDP10.OPS.DATAO, + 0o70020: DebuggerPDP10.OPS.CONO, + 0o70024: DebuggerPDP10.OPS.CONI, + 0o70030: DebuggerPDP10.OPS.CONSZ, + 0o70034: DebuggerPDP10.OPS.CONSO }, [PDP10.OPCODE.OPUUO]: { - 0o000: DebuggerPDP10.OPS.UUO + 0o00000: DebuggerPDP10.OPS.UUO } }; diff --git a/modules/pdp10/lib/defines.js b/modules/pdp10/lib/defines.js index 2b22e54ed..dfa55c8e0 100644 --- a/modules/pdp10/lib/defines.js +++ b/modules/pdp10/lib/defines.js @@ -104,15 +104,22 @@ var PDP10 = { * Opcode definitions */ OPCODE: { - OPMASK: 0o777, // operation mask - OPMODE: 0o774, // operation with mode - OPCOMP: 0o770, // operation with compare - OPTEST: 0o611, // operation with test - OPUUO: 0o700, // unimplemented user operation (UUO) mask - OPSHIFT: Math.pow(2, 27), // operation shift - FNSHIFT: Math.pow(2, 23), // function shift - FNHALT: 0o5304, // function code for HALT - INVALID: 0o777777777777 // TODO: Resolve + OPMASK: 0o77700, // operation mask + OPMODE: 0o77400, // operation with mode + OPCOMP: 0o77000, // operation with compare + OPTEST: 0o71100, // operation with test + OPIO: 0o70034, // input-output instructions + OPUUO: 0o70000, // unimplemented user operation (UUO) mask + OPSHIFT: Math.pow(2, 21), // operation shift + FNSHIFT: 23, // accumulator/function shift + FNMASK: 0o17, // accumulator/function mask (after shift) + IOSHIFT: Math.pow(2, 26), // input-output device code shift + IOMASK: 0o177, // input-output device code mask (after shift) + Y_MASK: 0o777777, + X_SHIFT: 18, + X_MASK: 0o17, + I_BIT: 0o20000000, + HALT: 0o5304 // operation code for HALT }, /* diff --git a/versions/pdpjs/1.34.0/pdp10-dbg.js b/versions/pdpjs/1.34.0/pdp10-dbg.js index 126adaeb9..ef0b7bab3 100644 --- a/versions/pdpjs/1.34.0/pdp10-dbg.js +++ b/versions/pdpjs/1.34.0/pdp10-dbg.js @@ -36,32 +36,32 @@ Ec:82,Fc:83,Gc:84,Hc:85,Ic:86,Jc:87,Kc:88,Lc:89,ob:90,"[":91,"\\":92,"]":93,"^": function u(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ya=b.comment;this.nb=b;this.exports={};this.F=this.bindings={};a=this.id.indexOf(".");0>a?this.Ja=this.id:(this.Ka=this.id.substr(0,a),this.Ja=this.id.substr(a+1));this.i={ready:!1,Da:!1,Qa:!1,T:!1,error:!1};this.Ma=null;this.i.error=!1;this.V=c||0;this.A=this.b=this.C=this.D=this.ja=null;v.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)}function va(){return Date.now()||+new Date} function x(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba&&-1>=3;return(c?"0o":"")+d} +function Pa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1>=3;return(c?"0o":"")+d} function H(a,b,c){var d="";b?8a&&-1=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function I(a){return H(a,4,!0)}function Ra(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0"']/g,function(a){return Wa[a]})}function Xa(a,b){return(a+" ").slice(0,b)}function Ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Wa={"&":"&","<":"<",">":">",'"':""","'":"'"}; -function gb(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function J(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a, -f,e))});if(b&&"object"==typeof b){var k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}else h.open("GET",a,c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function ib(a,b){var c,d={W:null,S:null,ia:null,ha:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ia=g.load;d.ha=g.exec;if(e=g.bytes)d.W=e;else if(e=g.words)for(d.W=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.W=Array(4*e.length),f=c=0;c>8&255,d.W[f++]=e[c]>>16&255,d.W[f++]=e[c]>>24&255;else d.W=g;d.S=g.symbols;d.W.length?1==d.W.length&&(x(d.W[0]),d=null):(x("Empty resource: "+a),d=null)}catch(h){x("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?1:a>1,h;h=c(b,a[f]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function J(a,b,c,d){c=void 0===c?!1:c;var e=0,g=null,f=null;if("object"==typeof resources&&(g=resources[a]))return d&&d(a,g,e),[g,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),f;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(g=h.responseText,200==h.status||!h.status&&g.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a, +g,e))});if(b&&"object"==typeof b){var k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}else h.open("GET",a,c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(g=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,g,e),f=[g,e]);return f} +function ib(a,b){var c,d={W:null,S:null,ia:null,ha:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,g,f;if("<"==b.substr(0,1))throw Error(b);f=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ia=f.load;d.ha=f.exec;if(e=f.bytes)d.W=e;else if(e=f.words)for(d.W=Array(2*e.length),g=c=0;c>8&255;else if(e=f.data)for(d.W=Array(4*e.length),g=c=0;c>8&255,d.W[g++]=e[c]>>16&255,d.W[g++]=e[c]>>24&255;else d.W=f;d.S=f.symbols;d.W.length?1==d.W.length&&(x(d.W[0]),d=null):(x("Empty resource: "+a),d=null)}catch(h){x("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.g["S"+a]=[0,0,!1,!1,this.Ab,a];this.A=this.b=this.C=this.D=null;this.exports={hold:this.sb,toggle:this.Nb,reset:this.Jb, set:this.Mb};E(this)}r(Kb,u);l=Kb.prototype;l.reset=function(a){this.stop();a&&Mb(this,this.w=0)}; l.da=function(a,b,c,d){if(this.D&&this.D.da(a,b,c,d)||this.b&&this.b.da(a,b,c,d)||this.A&&this.A.da(a,b,c,d))return!0;switch(b){case "PC":return this.F[b]=c,this.K++,!0;default:return"led"==a||"rled"==a?(this.F[b]=c,this.B[b]=d?1:0,this.K++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.F[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){Nb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ob(a,b)}}(this,b),a.ontouchstart= @@ -71,17 +71,17 @@ l.sb=function(a,b,c){if(Nb(this,b)){if(c){var d=this;setTimeout(function(){Ob(d, function Ob(a,b){var c=a.g[b];c&&(c[2]&&c[3]&&(Vb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5])),c[3]=!1)}l.Bb=function(a){a||this.b.i.J||(this.b.g=this.j%Gb,this.g[Zb]&&this.g[Zb][1]&&$b(this.b))};l.Cb=function(){};l.wb=function(a){a||this.b.R()}; l.ub=function(a){if(!a&&!this.b.i.J)if(this.g[Zb]&&this.g[Zb][1])$b(this.b);else{if((a=this.A)&&!Ma(a,!0))Na(a,!0),ac(a,0,null),Na(a,!1);else try{var b=this.b.Ia(1);0c;c++){var d=a,e="A"+c,f=b&1<c;c++){var d=a,e="D"+c,f=b&1<b;b++)a.g["S"+b][1]=a.u&1<c;c++){var d=a,e="A"+c,g=b&1<c;c++){var d=a,e="D"+c,g=b&1<b;b++)a.g["S"+b][1]=a.u&1<d.length){for(var e=0,f=Array(4096),g=0;g>>a.j;0f&&(m=f);if(h&&h.size){if(h.type==d){if(e+f<=h.v)return h.Ga+=h.v-e,h.v=e,!0;if(e>=h.v+h.Ga){m=h.size-(e-k);m>f&&(m=f);h.Ga=e-h.v+m;e=k+16384;f-=m;g++;continue}}return lc(mc,e,f)}e=new V(a,e,m,16384,d);ic(e,a.A,h);a.g[g++]=e;e=k+16384;f-=m}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+nc[d]+" at "+Qa(b)),!0):lc(oc,b,c)} -function gc(a,b){var c=a.g[(b&a.u)>>>a.j];a.w++;b=c.j(b&16383,b);a.w--;return b}function fc(a,b,c){var d=a.g[(b&a.u)>>>a.j];a.w++;d.F(c,b&16383,b);a.w--}function jc(a){for(var b=0,c=[],d=0;dd.length){for(var e=0,g=Array(4096),f=0;f>>a.j;0g&&(m=g);if(h&&h.size){if(h.type==d){if(e+g<=h.v)return h.Ga+=h.v-e,h.v=e,!0;if(e>=h.v+h.Ga){m=h.size-(e-k);m>g&&(m=g);h.Ga=e-h.v+m;e=k+16384;g-=m;f++;continue}}return lc(mc,e,g)}e=new V(a,e,m,16384,d);ic(e,a.A,h);a.g[f++]=e;e=k+16384;g-=m}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+nc[d]+" at "+Qa(b)),!0):lc(oc,b,c)} +function gc(a,b){var c=a.g[(b&a.u)>>>a.j];a.w++;b=c.j(b&16383,b);a.w--;return b}function fc(a,b,c){var d=a.g[(b&a.u)>>>a.j];a.w++;d.F(c,b&16383,b);a.w--}function jc(a){for(var b=0,c=[],d=0;d=c+d?a>>c&(1<>>b.j].ta(a&16383,a)};l.Tb=function(a,b){var c=this.C;a=this.ea=a;c.g[(a&c.u)>>>c.j].Ha(b,a&16383,a)}; l.Ia=function(a){this.i.complete=!0;var b=this.A?jd(this.A)?1:this.i.Pa?-1:0:0,c=a?this.i.Pa?0:1:-1;this.i.Pa=!1;this.H=this.I=a;this.j=this.j&-5|(b?4:0);do{if(this.j){if(this.j&4){if(kd(this.A,this.g,c)){this.R();break}++b||(this.j&=-5);c||c++}if(a=this.j&11)this.j&2?this.fa||(this.j&=-3):this.j&1&&this.j++,a=!1;if(a){if(this.j&4&&kd(this.A,this.g,c)){this.R();break}if(0>c)break}}this.j&=15;a=this.pa=this.g;this.ta(a);this.g=(a+1)%Gb}while(0>>f.j;0>>= -f.j;0>>g.j;0>>= +g.j;0>>a.j;0g&&g>=sa&&(g+=ra);g=Math.trunc(Math.abs(g))%ra;void 0===f&&(f=e.size);for(h=d;f--&&h=b.length){G(a,"invalid block at offset "+I(n),4096);break}for(var k=k+2,p=b[k++]&255|(b[k++]&255)<<8,q=b[k++]&255|(b[k++]&255)<<8,m=m+((p&255)+(p>>8)+(q&255)+(q>>8)),K=k,za=p-=6;0=b.length){G(a,"insufficient data for block at offset "+I(n),4096);break}m+= -b[k++]&255;if(m&255){G(a,"invalid checksum ("+H(m,2,!0)+") for block at offset "+I(n),4096);break}if(za)for(G(a,"loading "+I(za)+" bytes at "+I(q)+"-"+I(q+za),4096);za--;)fc(a.C,q++,b[K++]);else q&1?g=!0:null==d&&(d=q),null!=d&&G(a,"starting address: "+I(d),4096);h=!0}else k++;else k+=2}if(!h&&(null==c&&(c=e),null!=c)){for(h=0;h>>a.j;0f&&f>=sa&&(f+=ra);f=Math.trunc(Math.abs(f))%ra;void 0===g&&(g=e.size);for(h=d;g--&&h=b.length){G(a,"invalid block at offset "+I(n),4096);break}for(var k=k+2,p=b[k++]&255|(b[k++]&255)<<8,q=b[k++]&255|(b[k++]&255)<<8,m=m+((p&255)+(p>>8)+(q&255)+(q>>8)),K=k,Aa=p-=6;0=b.length){G(a,"insufficient data for block at offset "+I(n),4096);break}m+= +b[k++]&255;if(m&255){G(a,"invalid checksum ("+H(m,2,!0)+") for block at offset "+I(n),4096);break}if(Aa)for(G(a,"loading "+I(Aa)+" bytes at "+I(q)+"-"+I(q+Aa),4096);Aa--;)fc(a.C,q++,b[K++]);else q&1?f=!0:null==d&&(d=q),null!=d&&G(a,"starting address: "+I(d),4096);h=!0}else k++;else k+=2}if(!h&&(null==c&&(c=e),null!=c)){for(h=0;h=t.Ta&&c<=t.ob&&(b=c-(t.Ta-t.jb));b&&(a.preventDefault&&a.preventDefault(),d.Na(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==t.lb&&(b=t.kb);d.Na(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Na(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};l.sa=function(a,b,c,d){this.D=a;this.C=b;this.b=c;this.A=d;E(this)}; -l.ib=function(a){if(!this.g){var b=Tc(this.D,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ya(c[0]);if(d!=this.Ja)return;c=Ya(c[1]);if(this.g=xa(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.B=e.receiveData){this.u=a;this.status("Connected "+this.Ka+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};l.la=function(a,b){if(!b)if(this.ib(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +l.ib=function(a){if(!this.g){var b=Tc(this.D,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ya(c[0]);if(d!=this.Ja)return;c=Ya(c[1]);if(this.g=xa(c)){var e=this.g.exports;if(e){var g=e.connect;g&&g.call(this.g,this.u);if(this.B=e.receiveData){this.u=a;this.status("Connected "+this.Ka+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};l.la=function(a,b){if(!b)if(this.ib(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; l.ca=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){var a=new O(this);a.set(0,[]);return a.data()};l.restore=function(){return!0};l.Na=function(a){if("number"==typeof a)this.j.push(a);else if("string"==typeof a)for(var b=0,c,d=0;da.w&&a.u.length&&(a.w=0);if(0>a.w||b!=a.u[a.w])a.u.splice(0,0,b),a.w=0;a.w--}else a.O?b="end":b=a.u[a.w+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Ya(b.substring(c,f))),c=f+1}}return a} -function vd(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; -case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function wd(a,b,c){var d;if(b){b=xd(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);ea.w&&a.u.length&&(a.w=0);if(0>a.w||b!=a.u[a.w])a.u.splice(0,0,b),a.w=0;a.w--}else a.O?b="end":b=a.u[a.w+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var g=0;g<=b.length;g++){var f=b.charAt(g);if('"'==f||"'"==f)e?f==e&&(e=null):e=f;else if(f==d&&!e||!f)a.push(Ya(b.substring(c,g))),c=g+1}}return a} +function vd(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),g=a.pop();switch(d){case "*":d=g*e;break;case "/":if(!e)return!1;d=g/e;break;case "%":if(!e)return!1;d=g%e;break;case "+":d=g+e;break;case "-":d=g-e;break;case "<<":d=g<>":d=g>>e;break;case ">>>":d=g>>>e;break;case "<":d=g":d=g>e?1:0;break;case ">=":d=g>=e?1:0;break;case "==":d=g==e?1:0;break;case "!=":d=g!=e?1:0;break;case "&":d=g&e;break; +case "^":d=g^e;break;case "|":d=g|e;break;case "&&":d=g&&e?1:0;break;case "||":d=g||e?1:0;break;default:return!1}a.push(d|0)}return!0} +function wd(a,b,c){var d;if(b){b=xd(a,b);for(var e=0,g=!1,f=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1,K--;g=p+g;d>>=8}d=H(c,0,!0)+" "+c+". "+Qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.f((null!=b?b+": ":"")+d);return e} -function Bd(a,b){if(b)return Ad(a,b,a.Z[b]);var c=0;for(b in a.Z)Ad(a,b,a.Z[b]),c++;return 0a&&-1>2:0)}0>c?c=a.replace(/^0+([0-9A-F]+)$/i,"$1"):c=a;return c} +function Ad(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var g=4,f="";if(!g||4>=1,K--;f=p+f;d>>=8}d=H(c,0,!0)+" "+c+". "+Qa(c,0,!0)+" "+("0b"+f);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.f((null!=b?b+": ":"")+d);return e} +function Bd(a,b){if(b)return Ad(a,b,a.Z[b]);var c=0;for(b in a.Z)Ad(a,b,a.Z[b]),c++;return 0a&&-1>2:0)}0>c?c=a.replace(/^0+([0-9A-F]+)$/i,"$1"):c=a;return c} var zd={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; function Cd(a){td.call(this,a);this.ya=!1;this.ma=!0;this.I=X();this.xa=X();this.N=X();this.H=[];this.g=this.K=this.G=[];Dd(this);this.P=this.ga=0;this.j=[];this.pa=void 0;Ed(this);this.A=this;this.na={};this.V=this.cb=0;this.U=null;this.M=[];Fd(this,a.messages);this.ra=a.commands;this.L=0;this.Ba=this.qa=null;this.B=this.Aa=this.za=this.fa=this.oa=0;this.ea=this.aa=null;var b=this;window?void 0===window[C]&&(window[C]=function(a){return Yc(b,a)}):void 0===global[C]&&(global[C]=function(a){return Yc(b, a)})}r(Cd,td);function Y(a){a=a&&a.v;null==a&&(a=-1);return a}function X(a,b,c){return{v:void 0===a?null:a,qb:void 0===b?!1:b,ka:!1,ba:c}}function Gd(a){return[a.v,a.qb,a.ba,a.ka,a.Oa]}function Hd(a,b){var c=X(b[0],b[1],b[2]);c.ka=b[3];b[4]&&(c.ab=ud(a,c.Oa=b[4]));return c}l=Cd.prototype; @@ -131,75 +131,76 @@ l.sa=function(a,b,c,d){this.C=b;this.D=a;this.b=c;this.ea=a.u;(a=Tc(a,"messages" I(n.size)+" "+m),c!=Hc&&(c=-1),m=0);a+=16384;e++}}});E(this)}; l.da=function(a,b,c){var d=this;switch(b){case "debugInput":return this.aa=this.F[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Yc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.wd&&(d+=b.length);0>d&&(d=0);for(var e=b.length;dd&&(d=a.b.ta(b)),68719476735!=(d&65535)&&(c=a.j[a.P],c.v=b,c.ka=!1,c.ba=void 0,++a.P==a.j.length&&(a.P=0)));return!1} -function ve(a,b,c,d){var e=X(b.v),f,g,h,k=0,m=a.wa(b,1),n=m/Ib|0;for(g in we)if(f=we[g][n&g]){g=+g;switch(g){case 508:h=xe;k=n&3;break;case 504:h=ye;k=n&7;break;case 393:h=ze,k=(n&48)>>2|(n&6)>>1}break}n="";h=h&&h[k]||"";"S"==h&&f>Ae&&(h="B");h=Be[f]+h;f||(n=Kd(m));f="";m=W(a,e.v)+":";if(-1!==e.v&&-1!==b.v){do if(k=a.wa(e,1),f+=" "+Kd(k),null==e.v)break;while(e.v!=b.v)}m+=Xa(f,16);m+=Xa(h,5);n&&(m+=" "+n);c&&(m=Xa(m,60)+";"+(c||""),m=a.b.i.Ca?m+("cycles="+Zc(a.b).toString()+" cs="+H(a.b.ma)):m+(null!= -d?"="+d.toString():""));return m}function Dd(a){var b,c;a.g=["bp"];if(a.K)for(b=1;b>>d.j],!1)}a.K=["br"];if(a.G)for(b=1;b>>d.j],!0);a.G=["bw"];a.oa=0;a.ga=0} -l.va=function(a,b,c){var d=!0;c||Ce(this,a,b,!1,!0);if(a!=this.g){var e=Y(b);if(-1===e)this.f("invalid address: "+W(this,b.v)),d=!1;else{var f=this.C;f.g[e>>>f.j].va(e&16383,a==this.G)}}d&&(a.push(b),c?b.ka=!0:(De(this,a,a.length-1,"set"),Ed(this)));return d};function Ce(a,b,c,d,e){var f=!1;c=Y(c);for(var g=1;g>>d.j],b==a.G));h.ka||Ed(a);break}}return f} +function kd(a,b,c){var d=-1;if(!c&&(d=a.b.ta(b),2756==d>>23&&a.b.pa==b)){b=a.b;var e=b.g;b.g=(e+1)%Gb;b=e}if(0d&&(d=a.b.ta(b)),0<=d&&(c=a.j[a.P],c.v=b,c.ka=!1,c.ba=void 0,++a.P==a.j.length&&(a.P=0)));return!1} +function ve(a,b,c,d){var e=X(b.v),g,f,h,k=0,m=a.wa(b,1),n=m/Ib|0,p;for(p in we)if(g=we[p][n&p]){f=+p;n>>=6;switch(f){case 32512:h=xe;k=n&3;break;case 32256:h=ye;k=n&7;break;case 29248:h=ze,k=(n&48)>>2|(n&6)>>1}break}h=h&&h[k]||"";"S"==h&&g>Ae&&(h="B");h=Be[g]+h;g?((g=28700==f?W(a,m/Jb&127,-1):W(a,m>>23&15,-1))&&(g+=","),m&4194304&&(g+="@"),g+=W(a,m&262143,-1),(m=m>>18&15)&&(g+="("+W(a,m,-1)+")")):g=Kd(m);m="";f=W(a,e.v)+":";if(-1!==e.v&&-1!==b.v){do if(k=a.wa(e,1),m+=" "+Kd(k),null==e.v)break;while(e.v!= +b.v)}f+=Xa(m,16);f+=Xa(h,5);g&&(f+=" "+g);c&&(f=Xa(f,60)+";"+(c||""),f=a.b.i.Ca?f+("cycles="+Zc(a.b).toString()+" cs="+H(a.b.ma)):f+(null!=d?"="+d.toString():""));return f}function Dd(a){var b,c;a.g=["bp"];if(a.K)for(b=1;b>>d.j],!1)}a.K=["br"];if(a.G)for(b=1;b>>d.j],!0);a.G=["bw"];a.oa=0;a.ga=0} +l.va=function(a,b,c){var d=!0;c||Ce(this,a,b,!1,!0);if(a!=this.g){var e=Y(b);if(-1===e)this.f("invalid address: "+W(this,b.v)),d=!1;else{var g=this.C;g.g[e>>>g.j].va(e&16383,a==this.G)}}d&&(a.push(b),c?b.ka=!0:(De(this,a,a.length-1,"set"),Ed(this)));return d};function Ce(a,b,c,d,e){var g=!1;c=Y(c);for(var f=1;f>>d.j],b==a.G));h.ka||Ed(a);break}}return g} function Ee(a,b){for(var c=1;cb[0]?1:a[0]>>0,g],p=gb(n,k,a.eb);0>p&&n.splice(-(p+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({Yc:b,v:c,tb:d,S:e,bb:f})}function Ge(a,b,c){var d=[],e=Y(b)>>>0;for(b=0;b>>0,h=f.tb;if(e>=g&&eb[0]?1:a[0]>>0,f],p=gb(n,k,a.eb);0>p&&n.splice(-(p+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({Yc:b,v:c,tb:d,S:e,bb:g})}function Ge(a,b,c){var d=[],e=Y(b)>>>0;for(b=0;b>>0,h=g.tb;if(e>=f&&eh[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.f(m)}h[3]&&(g=h[3],f=null);f=ve(a,b,g,f);a.f(f);a.I=b;e-=b.v-k;c++}}} -function Fe(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.f(Qd+b):(a.O&&(a.f("ended assemble at "+W(a,a.N.v)),a.I=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.U=null;if(La(a)&&0n||"z"h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.f(m)}h[3]&&(f=h[3],g=null);g=ve(a,b,f,g);a.f(g);a.I=b;e-=b.v-k;c++}}} +function Fe(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.f(Qd+b):(a.O&&(a.f("ended assemble at "+W(a,a.N.v)),a.I=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.U=null;if(La(a)&&0n||"z"S.length&&(a.f("note: only "+S.length+" available"),L=S.length);P-=L;0>P&&(null==S[S.length-1].v?(L=P+L,P=0):P+=S.length);var tc=[];"call"==Yd&&(Za=1E5,tc=["CALL"]);for(void 0!==Xd&&a.f(L+" instructions earlier:");0=S.length&&(P=0);a.pa=L;$d++;Za--}}$d||(a.f("no "+Zd+"history available"), -a.pa=void 0)}else{var ka=Z(a,R);if(ka){var la=0,ce="ds"==Da;if(ca){if("l"==ca.charAt(0))ca=ca.substr(1)||of,la=yd(a,ca);else{var de=Z(a,ca);de&&(la=de.v-ka.v)}0>la&&(la=0);65536he;he++)fe+=String.fromCharCode((Bb%64|0)+32), -Bb/=64}ma&&(ma+="\n");ma=ce?ma+(na+","):ma+(R+": "+na+(0>ge?" "+fe:""))}ma&&a.f(ma);a.xa=ka;a.ba=qf}}}}break;case "e":if("else"==g[0])break;var ie,je,ke=g[0],wc=g[1];"e"==ke||"ew"==ke?(ie=a.wa,je=a.Va):wc=null;if(null==wc)a.f("edit memory commands:"),a.f("\tew [a] [...] edit words at address a");else{var Cb=Z(a,wc);if(Cb)for(var Db=2;Dbla&&(la=0);65536he;he++)fe+=String.fromCharCode((Bb%64|0)+32), +Bb/=64}ma&&(ma+="\n");ma=ce?ma+(na+","):ma+(R+": "+na+(0>ge?" "+fe:""))}ma&&a.f(ma);a.xa=ka;a.ba=qf}}}}break;case "e":if("else"==f[0])break;var ie,je,ke=f[0],wc=f[1];"e"==ke||"ew"==ke?(ie=a.wa,je=a.Va):wc=null;if(null==wc)a.f("edit memory commands:"),a.f("\tew [a] [...] edit words at address a");else{var Cb=Z(a,wc);if(Cb)for(var Db=2;DbAc;){for(var oa=null,uf=256;65536>bb.v>>>0;){Bc.v=a.wa(bb,2);if(null==bb.v||!uf--)break;if(!(Bc.v&1)){for(var vf=a,Eb=Bc,me=null,cb=Eb.v,ne=cb,Cc=1;6>=Cc&&cb;Cc++){if(2> ";M(function(){for(var a=D(document,C,"debugger"),b=0;b> ";M(function(){for(var a=D(document,C,"debugger"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;b\nLicense: GPL version 3 or later ");for(b=0;bSe){if(Te(d,this.K)){this.B=new O(this,"1.34.0",bf);Te(this.B)&&(cf(this,d),a=df,ef(this.B));this.B.set(Ze,hb());ff(this.B);var e=this.g&&!this.I;if(a==$e||wa("Click OK to restore the previous "+Ab+" machine state, or CANCEL to reset the machine.")){if(c=Ye(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Te(d,g):("error"==f&&"no machine state"!= -g?(this.Y("Error: "+g),"unable to verify user"==g&&(mb(gf,""),this.j=null)):this.f(f+": "+g),ef(d),Te(d)?(c=Ye(d),e=!0):c=!1))}e&&We(this,c?d:null)}else a==df&&d.clear()}else We(this);delete this.K;delete this.H}e=y(this.id);for(f=0;fSe){if(Te(d,this.K)){this.B=new O(this,"1.34.0",bf);Te(this.B)&&(cf(this,d),a=df,ef(this.B));this.B.set(Ze,hb());ff(this.B);var e=this.g&&!this.I;if(a==$e||wa("Click OK to restore the previous "+Ab+" machine state, or CANCEL to reset the machine.")){if(c=Ye(d)){var g=d.get("code"),f=d.get("data");g&&("ok"==g?Te(d,f):("error"==g&&"no machine state"!= +f?(this.Y("Error: "+f),"unable to verify user"==f&&(mb(gf,""),this.j=null)):this.f(g+": "+f),ef(d),Te(d)?(c=Ye(d),e=!0):c=!1))}e&&We(this,c?d:null)}else a==df&&d.clear()}else We(this);delete this.K;delete this.H}e=y(this.id);for(g=0;ga[1];a=a[2];this.P=!0;this.i.T=!0;var d=this.F.power;d&&(d.textContent="Shutdown");this.b&&(hf(this,this.b,b,c,a),Q(this,-2),this.b.X());this.N&&(cf(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.w=0}; function cf(a,b){if(wa("There may be a problem with your "+Ab+" machine.\n\nTo help us diagnose it, click OK to send this "+Ab+" machine state to http://www.pcjs.org.")){var c=a.aa;a=a.j||"";b=b.toString();var d={};d.app=Ab;d.ver="1.34.0";d.url=c;d.user=a;d.type="bug";d.data=b;J("http://www.pcjs.org/api/v1/report",d,!0)}} -function Me(a,b,c){var d,e="none";if(a.w)return null;a.w--;var f=new O(a,"1.34.0"),g=new O(a,"1.34.0",Xe),h=hb();g.set(Ze,h);f.set(Ze,h);f.set(jf,"1.34.0");f.set(kf,window?window.location.href:null);f.set(lf,window?window.navigator.userAgent:"");a.b&&a.b.ca&&(c&&(b&&(a.b.i.X=a.b.i.J),a.b.R()),d=a.b.ca(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.i.T=!1,!1===d&&(e=null)));for(var h=y(a.id),k=0;k=d||30<=(c.xa+=d))&&(e.textContent=c.i.J?c.L.toFixed(2)+"Mhz":"Stopped",c.xa=0)}if(a.u&&(a=a.u,b=b||0,a.K)){c=a.b.i.J;d=!!(a.b.j&8);if(0>=b||60<=(a.I+=b)){e=a.b.g;if(a.F.PC){var f=a.A&&a.A.ba||8,e=e||0,e=8==f?Qa(e,void 0):H(e,void 0);a.F.PC.textContent!=e&&(a.F.PC.textContent=e)}a.I=0}-1>b?a.j=a.b.g:0=d||30<=(c.xa+=d))&&(e.textContent=c.i.J?c.L.toFixed(2)+"Mhz":"Stopped",c.xa=0)}if(a.u&&(a=a.u,b=b||0,a.K)){c=a.b.i.J;d=!!(a.b.j&8);if(0>=b||60<=(a.I+=b)){e=a.b.g;if(a.F.PC){var g=a.A&&a.A.ba||8,e=e||0,e=8==g?Qa(e,void 0):H(e,void 0);a.F.PC.textContent!=e&&(a.F.PC.textContent=e)}a.I=0}-1>b?a.j=a.b.g:0g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(g?' url="'+g+'"':"")));f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1"+d+"$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){g=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");J(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Gf(a,b,c)}})}else c(a,null)} -function Hf(a,b,c,d,e){function f(a){if(void 0===k){var b=h&&D(h,"machine-warning");k=b&&b[0]||h}k&&(k.innerHTML=Va(a))}function g(a){f("Error: "+a);m&&(--Df||wb(!0));m=!1}var h,k,m=!0;Df++;ua[b]={};try{if(h=document.getElementById(b)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=n:q.appendChild(document.createTextNode(n));p.appendChild(q)}d|| -(n=a,"pdp"==a.substr(0,3)&&(n="pdpjs"),d="/versions/"+n+"/1.34.0/components.xsl");n=function(e,k){k?Ef(d,null,a,null,!1,f,function(a,e){e?(ta(b,d,a),f("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=k.transformNode(e))?(h.outerHTML=e,--Df||wb(!0)):g("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(a=new XSLTProcessor,a.importStylesheet(e),(e=a.transformToFragment(k,document))?h.parentNode?(h.parentNode.replaceChild(e,h),--Df|| -wb(!0)):g("invalid machine element: "+b):g("transformToFragment failed")):g("unable to transform XML: unsupported browser")):g(a)}):g(e)};"<"!=c.charAt(0)?Ef(c,b,a,e,!0,f,n):Ff(c,null,b,a,e,!1,f,n)}else g("missing machine element: "+b)}catch(K){g(K.message)}return m}window.embedPDP10=function(a,b,c,d){wb(!1);return Hf("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){wb(!1);return Hf("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return z(b,a+".machine")}; -window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!Aa[a]){for(var c=!0,d=Aa,e=a,f=b.length,g=[],h=[],k="",m=null,n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(f?' url="'+f+'"':"")));g||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1"+d+"$2"));f=null;if("<"==a.charAt(0))try{g||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");J(e,null,!0,function(g,f,h){if(h||!f)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(g=d[3])if(h=f.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(g);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=k&&(f=f.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}f=f.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],f);Gf(a,b,c)}})}else c(a,null)} +function Hf(a,b,c,d,e){function g(a){if(void 0===k){var b=h&&D(h,"machine-warning");k=b&&b[0]||h}k&&(k.innerHTML=Va(a))}function f(a){g("Error: "+a);m&&(--Df||wb(!0));m=!1}var h,k,m=!0;Df++;ua[b]={};try{if(h=document.getElementById(b)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=n:q.appendChild(document.createTextNode(n));p.appendChild(q)}d|| +(n=a,"pdp"==a.substr(0,3)&&(n="pdpjs"),d="/versions/"+n+"/1.34.0/components.xsl");n=function(e,k){k?Ef(d,null,a,null,!1,g,function(a,e){e?(ta(b,d,a),g("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=k.transformNode(e))?(h.outerHTML=e,--Df||wb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(a=new XSLTProcessor,a.importStylesheet(e),(e=a.transformToFragment(k,document))?h.parentNode?(h.parentNode.replaceChild(e,h),--Df|| +wb(!0)):f("invalid machine element: "+b):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(a)}):f(e)};"<"!=c.charAt(0)?Ef(c,b,a,e,!0,g,n):Ff(c,null,b,a,e,!1,g,n)}else f("missing machine element: "+b)}catch(K){f(K.message)}return m}window.embedPDP10=function(a,b,c,d){wb(!1);return Hf("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){wb(!1);return Hf("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return z(b,a+".machine")}; +window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!za[a]){for(var c=!0,d=za,e=a,g=b.length,f=[],h=[],k="",m=null,n=0;n