From 642e43937e5210a3207b9d0476557bc92975bea1 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 29 Mar 2017 08:14:07 -0700 Subject: [PATCH] Assemble commands can now be batched up; even if they refer to external files that must be loaded asynchronously, command processing will be suspended until assembly is complete --- modules/pdp10/lib/cpuops.js | 42 +++++----- modules/pdp10/lib/cpustate.js | 10 +-- modules/pdp10/lib/debugger.js | 45 ++++++----- versions/pdpjs/1.34.3/pdp10-dbg.js | 126 ++++++++++++++--------------- versions/pdpjs/1.34.3/pdp10.js | 6 +- 5 files changed, 118 insertions(+), 111 deletions(-) diff --git a/modules/pdp10/lib/cpuops.js b/modules/pdp10/lib/cpuops.js index 062e57d31..46dacd569 100644 --- a/modules/pdp10/lib/cpuops.js +++ b/modules/pdp10/lib/cpuops.js @@ -1343,7 +1343,7 @@ PDP10.opIMULB = function(op, ac) PDP10.opMUL = function(op, ac) { this.writeWord(ac, PDP10.doMUL.call(this, this.readWord(ac), this.readWord(this.regEA))); - this.writeWord((ac + 1) & 0o17, this.regExt); + this.writeWord((ac + 1) & 0o17, this.regEX); }; /** @@ -1364,7 +1364,7 @@ PDP10.opMUL = function(op, ac) PDP10.opMULI = function(op, ac) { this.writeWord(ac, PDP10.doMUL.call(this, this.readWord(ac), this.regEA)); - this.writeWord((ac + 1) & 0o17, this.regExt); + this.writeWord((ac + 1) & 0o17, this.regEX); }; /** @@ -1405,7 +1405,7 @@ PDP10.opMULM = function(op, ac) PDP10.opMULB = function(op, ac) { this.writeWord(this.regEA, this.writeWord(ac, PDP10.doMUL.call(this, this.readWord(ac), this.readWord(this.regEA)))); - this.writeWord((ac + 1) & 0o17, this.regExt); + this.writeWord((ac + 1) & 0o17, this.regEX); }; /** @@ -1430,7 +1430,7 @@ PDP10.opIDIV = function(op, ac) var dst = PDP10.doDIV.call(this, this.readWord(ac), 0, this.readWord(this.regEA)); if (dst < 0) return; this.writeWord(ac, dst); - this.writeWord((ac + 1) & 0o17, this.regExt); + this.writeWord((ac + 1) & 0o17, this.regEX); }; /** @@ -1455,7 +1455,7 @@ PDP10.opIDIVI = function(op, ac) var dst = PDP10.doDIV.call(this, this.readWord(ac), 0, this.regEA); if (dst < 0) return; this.writeWord(ac, dst); - this.writeWord((ac + 1) & 0o17, this.regExt); + this.writeWord((ac + 1) & 0o17, this.regEX); }; /** @@ -1531,7 +1531,7 @@ PDP10.opDIV = function(op, ac) dst = PDP10.doDIV.call(this, dst, ext, this.readWord(this.regEA)); if (dst < 0) return; this.writeWord(ac, dst); - this.writeWord((ac + 1) & 0o17, this.regExt); + this.writeWord((ac + 1) & 0o17, this.regEX); }; /** @@ -1559,7 +1559,7 @@ PDP10.opDIVI = function(op, ac) dst = PDP10.doDIV.call(this, dst, ext, this.regEA); if (dst < 0) return; this.writeWord(ac, dst); - this.writeWord((ac + 1) & 0o17, this.regExt); + this.writeWord((ac + 1) & 0o17, this.regEX); }; /** @@ -1614,7 +1614,7 @@ PDP10.opDIVB = function(op, ac) dst = PDP10.doDIV.call(this, dst, ext, this.readWord(this.regEA)); if (dst < 0) return; this.writeWord(ac, this.writeWord(this.regEA, dst)); - this.writeWord((ac + 1) & 0o17, this.regExt); + this.writeWord((ac + 1) & 0o17, this.regEX); }; /** @@ -2242,7 +2242,7 @@ PDP10.opJRST = function(op, ac) /* * Restore the flags. */ - this.setPS(this.regLA); + this.setPS((this.regLA / PDP10.HALF_SHIFT)|0); } if (ac & 0b0100) { /* @@ -2447,7 +2447,7 @@ PDP10.opPOPJ = function(op, ac) */ PDP10.opJSR = function(op, ac) { - this.writeWord(this.regEA, this.getPS() + this.getPC()); + this.writeWord(this.regEA, this.getPS() * PDP10.HALF_SHIFT + this.getPC()); this.regPS &= ~PDP10.PSFLAG.BIS; // TODO: Verify that BIS is cleared AFTER writing this.setPC(this.regEA + 1); }; @@ -2471,7 +2471,7 @@ PDP10.opJSR = function(op, ac) */ PDP10.opJSP = function(op, ac) { - this.writeWord(ac, this.getPS() + this.getPC()); + this.writeWord(ac, this.getPS() * PDP10.HALF_SHIFT + this.getPC()); this.regPS &= ~PDP10.PSFLAG.BIS; // TODO: Verify that BIS is cleared AFTER writing this.setPC(this.regEA); }; @@ -6157,14 +6157,14 @@ PDP10.doADD = function(dst, src) * @param {number} dst (36-bit value) * @param {number} ext (36-bit value extension) * @param {number} src (36-bit divisor) - * @return {number} (dst / src) (the remainder is stored in regExt); -1 if error (no division performed) + * @return {number} (dst / src) (the remainder is stored in regEX); -1 if error (no division performed) */ PDP10.doDIV = function(dst, ext, src) { var fNegQ = false, fNegR = false; dst = PDP10.merge72.call(this, dst, ext); - ext = this.regExt; + ext = this.regEX; if (src > PDP10.INT_MASK) { src = PDP10.WORD_LIMIT - src; @@ -6223,14 +6223,14 @@ PDP10.doDIV = function(dst, ext, src) this.assert(!this.regRem[1], "extended remainder"); dst = this.regRes[0]; - this.regExt = this.regRem[0]; + this.regEX = this.regRem[0]; if (fNegQ && dst) { dst = PDP10.WORD_LIMIT - dst; } - if (fNegR && this.regExt) { - this.regExt = PDP10.WORD_LIMIT - this.regExt; + if (fNegR && this.regEX) { + this.regEX = PDP10.WORD_LIMIT - this.regEX; } return dst; @@ -6250,7 +6250,7 @@ PDP10.doDIV = function(dst, ext, src) * @param {number} dst (36-bit value) * @param {number} src (36-bit value) * @param {boolean} [fTruncate] (true to truncate the result to 36 bits) - * @return {number} (dst * src) (the high 36 bits of the result; the low 36 bits are stored in regExt) + * @return {number} (dst * src) (the high 36 bits of the result; the low 36 bits are stored in regEX) */ PDP10.doMUL = function(dst, src, fTruncate) { @@ -6380,7 +6380,7 @@ PDP10.doSUB = function(dst, src) * @this {CPUStatePDP10} * @param {number} dst (36-bit value) * @param {number} ext (36-bit value) - * @return {number} (returns the lower 36 bits; the upper 36 bits are stored in regExt) + * @return {number} (returns the lower 36 bits; the upper 36 bits are stored in regEX) */ PDP10.merge72 = function(dst, ext) { @@ -6395,7 +6395,7 @@ PDP10.merge72 = function(dst, ext) * Compute value without the sign bit and add the low bit of extended in its place. */ dst = (dst % PDP10.INT_LIMIT) + ((ext * PDP10.INT_LIMIT) % PDP10.WORD_LIMIT); - this.regExt = sign + Math.trunc(ext / 2); + this.regEX = sign + Math.trunc(ext / 2); return dst; }; @@ -6407,7 +6407,7 @@ PDP10.merge72 = function(dst, ext) * @this {CPUStatePDP10} * @param {number} res (36-bit value) * @param {number} ext (36-bit value) - * @return {number} (returns the upper 36 bits; the lower 36 bits are stored in regExt) + * @return {number} (returns the upper 36 bits; the lower 36 bits are stored in regEX) */ PDP10.split72 = function(res, ext) { @@ -6427,7 +6427,7 @@ PDP10.split72 = function(res, ext) ext = sign + (ext - signNew); this.regPS |= PDP10.PSFLAG.AROV; } - this.regExt = res; + this.regEX = res; return ext; }; diff --git a/modules/pdp10/lib/cpustate.js b/modules/pdp10/lib/cpustate.js index d4a75c7cb..76cd8e6cb 100644 --- a/modules/pdp10/lib/cpustate.js +++ b/modules/pdp10/lib/cpustate.js @@ -184,7 +184,7 @@ class CPUStatePDP10 extends CPUPDP10 { this.regXC = -1; // if >= 0 this supersedes regPC (refers to an opcode from XCT) this.regBP = -1; // active byte pointer (-1 if none) this.regPS = 0; // assorted processor flags (see PSFLAG bit definitions) - this.regExt = 0; // internal "extension" register used for 72-bit MUL and DIV calculations + this.regEX = 0; // internal "extension" register used for 72-bit MUL and DIV calculations this.regRes = [0, 0]; // four internal "double-length" registers used for 72-bit DIV calculations this.regPow = [0, 0]; @@ -351,28 +351,26 @@ class CPUStatePDP10 extends CPUPDP10 { /** * getPS() * - * Gets the processor state flags in the format required by various program control operations (eg, JSP), - * pre-masked and pre-shifted for convenient loading into the left half of an accumulator. + * Gets the processor state flags in the format required by various program control operations (eg, JSP). * * @this {CPUStatePDP10} * @return {number} */ getPS() { - return (this.regPS & PDP10.HALF_MASK) * PDP10.HALF_SHIFT; + return (this.regPS & PDP10.HALF_MASK); } /** * setPS(w) * - * Sets the processor state flags in the format used by various program control operations (eg, JRST). + * Sets the processor state flags in the format required by various program control operations (eg, JRST). * * @this {CPUStatePDP10} * @param {number} w */ setPS(w) { - w = (w / PDP10.HALF_SHIFT)|0; this.regPS = (this.regPS & ~PDP10.PSFLAG.SET_MASK) | (w & PDP10.PSFLAG.SET_MASK); this.regPS |= (w & PDP10.PSFLAG.USERF); if (!(w & PDP10.PSFLAG.EXIOT)) { diff --git a/modules/pdp10/lib/debugger.js b/modules/pdp10/lib/debugger.js index 4a498140b..e2649a12a 100644 --- a/modules/pdp10/lib/debugger.js +++ b/modules/pdp10/lib/debugger.js @@ -164,6 +164,7 @@ class DebuggerPDP10 extends Debugger { this.aMessageBuffer = []; this.messageInit(parmsDbg['messages']); this.sInitCommands = parmsDbg['commands']; + this.aCommands = []; /* * Define remaining miscellaneous DebuggerPDP10 properties. @@ -920,7 +921,7 @@ class DebuggerPDP10 extends Debugger { value = cpu.regEA; break; case DebuggerPDP10.REGS.PS: - value = (cpu.getPS() / PDP10.HALF_SHIFT)|0; + value = cpu.getPS(); break; case DebuggerPDP10.REGS.OV: value = (cpu.regPS & PDP10.PSFLAG.AROV)? 1 : 0; @@ -959,7 +960,7 @@ class DebuggerPDP10 extends Debugger { this.setAddr(this.dbgAddrCode, cpu.getPC()); break; case DebuggerPDP10.REGS.PS: - cpu.setPS(value * PDP10.HALF_SHIFT); + cpu.setPS(value); break; case DebuggerPDP10.REGS.OV: flag = PDP10.PSFLAG.AROV; @@ -2591,8 +2592,8 @@ class DebuggerPDP10 extends Debugger { * * [0]: the assemble command (assumed to be "a") * [1]: the target address (eg, "200") - * [2]: the operation code, aka instruction name (eg, "adc") - * [3]: the operation mode operand, if any (eg, "14", "[1234]", etc) + * [2]: the opcode mnemonic (eg, "hrli") + * [3]: the operands, if any * * The Debugger enters "assemble mode" whenever only the first (or first and second) arguments are present. * As long as "assemble mode is active, the user can omit the first two arguments on all later assemble commands @@ -2601,16 +2602,13 @@ class DebuggerPDP10 extends Debugger { * * Entering "assemble mode" is optional; one could enter a series of fully-qualified assemble commands; eg: * - * a ff00 cld - * a ff01 ldx 28 + * a 100 hrli 1,111111 + * a 101 hrri 1,444444 * ... * * without ever entering "assemble mode", but of course, that requires more typing and doesn't take advantage * of automatic target address advancement (see dbgAddrAssemble). * - * NOTE: As the previous example implies, you can even assemble new instructions into ROM address space; - * as our setByte() function explains, the ROM write-notification handlers only refuse writes from the CPU. - * * When filename(s) or URL(s) are provided in lieu of an opcode, we pass those on to the Macro10 component * for assembling, along with any option letters that were included with the "a" command; for example, if "ap" * was specified, then "p" will be passed to Macro10 as an option. @@ -2618,15 +2616,16 @@ class DebuggerPDP10 extends Debugger { * Macro10 options include: * * p: preprocess the specified resource(s) without assembling them - * l: generate listing information + * l: generate listing information (TODO) * * @this {DebuggerPDP10} * @param {Array.} asArgs is the complete argument array, beginning with the "a" command in asArgs[0] + * @return {boolean} */ doAssemble(asArgs) { var dbgAddr = this.parseAddr(asArgs[1], this.dbgAddrAssemble); - if (!dbgAddr) return; + if (!dbgAddr) return false; var sOpcode = asArgs[2]; @@ -2634,7 +2633,7 @@ class DebuggerPDP10 extends Debugger { this.println("begin assemble at " + this.toStrAddr(dbgAddr)); this.fAssemble = true; this.cmp.updateDisplays(); - return; + return true; } var sOptions = asArgs[0].substr(1); @@ -2658,14 +2657,16 @@ class DebuggerPDP10 extends Debugger { dbg.loadBin(dbg.macro10.getBin(), addrLoad); } catch(e) { dbg.println(e.message); + nErrorCode = -1; // fake error so that command processing stops } } else { dbg.println("error (" + nErrorCode + ") processing " + (sURL || sFile)); } dbg.macro10 = null; + if (!nErrorCode) dbg.doCommands(); }); } - return; + return false; } asArgs.shift(); @@ -2678,6 +2679,7 @@ class DebuggerPDP10 extends Debugger { this.setWord(dbgAddr, opCode); this.println(this.getInstruction(dbgAddr)); } + return true; } /** @@ -3749,7 +3751,7 @@ class DebuggerPDP10 extends Debugger { switch (asArgs[0].charAt(0)) { case 'a': - this.doAssemble(asArgs); + result = this.doAssemble(asArgs); break; case 'b': this.doBreak(asArgs[0], asArgs[1], sCmd); @@ -3868,16 +3870,23 @@ class DebuggerPDP10 extends Debugger { /** * doCommands(sCmds, fSave) * + * This function is now written so that if any async command, such as assemble ('a'), stopped the + * flow of commands by returning false, it can call us from its callback handler with no arguments, + * and command processing should continue where it left off. + * * @this {DebuggerPDP10} - * @param {string} sCmds + * @param {string} [sCmds] * @param {boolean} [fSave] * @return {boolean} true if all commands processed, false if not */ doCommands(sCmds, fSave) { - var a = this.parseCommand(sCmds, fSave); - for (var s in a) { - if (!this.doCommand(a[+s])) return false; + if (sCmds) { + this.aCommands = this.parseCommand(sCmds, fSave); + } + var sCmd; + while (sCmd = this.aCommands.shift()) { + if (!this.doCommand(sCmd)) return false; } return true; } diff --git a/versions/pdpjs/1.34.3/pdp10-dbg.js b/versions/pdpjs/1.34.3/pdp10-dbg.js index effde3d36..2e8fc8e6a 100644 --- a/versions/pdpjs/1.34.3/pdp10-dbg.js +++ b/versions/pdpjs/1.34.3/pdp10-dbg.js @@ -42,13 +42,13 @@ function Ga(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFul function Ha(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="",l;for(l in b)b.hasOwnProperty(l)&&(k&&(k+="&"),k+=l+"="+encodeURIComponent(b[l]));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 Ia(a,b){var c,d={da:null,X:null,wa:null,va: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")&&0>b.indexOf("0o")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.wa=g.load;d.va=g.exec;if(e=g.bytes)d.da=e;else if(e=g.words)for(d.da=Array(2*e.length),f=c=0;c>8&255;else if(e=g.longs)for(d.da=Array(4*e.length),f=c=0;c>8&255,d.da[f++]=e[c]>>16&255,d.da[f++]=e[c]>>24&255;else(e=g.data)?d.Oa=e:d.da=g;d.da&&(d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null));d.X=g.symbols}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c>8&255,d.da[f++]=e[c]>>16&255,d.da[f++]=e[c]>>24&255;else(e=g.data)?d.Pa=e:d.da=g;d.da&&(d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null));d.X=g.symbols}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca?this.$a=this.id:(this.ab=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.A={ready:!1,Ua:!1,pb:!1,Y:!1,error:!1};this.eb=null;this.A.error=!1;this.ba=c||0;this.D=this.v=this.G=this.H=this.xa=null;lb.push(this)}function mb(a,b,c){nb[a]&&b&&(nb[a][b]=c)}function ob(){return Date.now()||+new Date} +function Za(a){if($a)try{for(var b=0;ba?this.$a=this.id:(this.ab=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.A={ready:!1,Va:!1,pb:!1,Y:!1,error:!1};this.eb=null;this.A.error=!1;this.ba=c||0;this.D=this.v=this.G=this.H=this.xa=null;lb.push(this)}function mb(a,b,c){nb[a]&&b&&(nb[a][b]=c)}function ob(){return Date.now()||+new Date} function q(a){window&&window.alert(a)}function pb(a){var b=!1;window&&(b=window.confirm(a));return b}function qb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bc;c++){var d=a,e="A"+c,f=b&1<c;c++){var d=a,e="D"+c,f=b&1<b;b++)a.b["S"+b][1]=a.j&1<d.length){for(var e=0,f=Array(4096),g=0;g>>a.i;0f&&(l=f);if(h&&h.size){if(h.type==d){if(e+f<=h.B)return h.Wa+=h.B-e,h.B=e,!0;if(e>=h.B+h.Wa){l=h.size-(e-k);l>f&&(l=f);h.Wa=e-h.B+l;e=k+16384;f-=l;g++;continue}}return Ec(Fc,e,f)}e=new Ac(a,e,l,16384,d);Bc(e,a.D,h);a.b[g++]=e;e=k+16384;f-=l}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+Kc[d]+" at "+ua(b)),!0):Ec(Lc,b,c)} +function Dc(a,b,c,d){for(var e=b,f=c,g=e>>>a.i;0f&&(l=f);if(h&&h.size){if(h.type==d){if(e+f<=h.B)return h.Xa+=h.B-e,h.B=e,!0;if(e>=h.B+h.Xa){l=h.size-(e-k);l>f&&(l=f);h.Xa=e-h.B+l;e=k+16384;f-=l;g++;continue}}return Ec(Fc,e,f)}e=new Ac(a,e,l,16384,d);Bc(e,a.D,h);a.b[g++]=e;e=k+16384;f-=l}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+Kc[d]+" at "+ua(b)),!0):Ec(Lc,b,c)} function yc(a,b){var c=a.b[(b&a.j)>>>a.i];a.w++;b=c.w(b&16383,b);a.w--;return b}function xc(a,b,c){var d=a.b[(b&a.j)>>>a.i];a.w++;d.D(c,b&16383,b);a.w--}function Cc(a){for(var b=0,c=[],d=0;d=a.ka&&(a.ka+=a.ra,c=!0);0<=a.la&&a.la<=fd(a)&&(a.ra=a.la=-1,bd(a),a.W(),c=!0);c&&a.u(fd(a)+" cycles: checksum="+n(a.Fa))}} +m.za=function(a,b){var c=$c(this.H,"autoStart");null!=c?this.A.ea="true"==c?!0:"false"==c?!1:!!c:null==this.A.ea&&(this.A.ea=!this.D&&void 0===this.J.run);if(!b){if(a){ad(this);if(!this.restore(a))return!1;bd(this)}else this.reset();this.D?(a=this.D,b=this.A.ea,a.Ia=!0,a.u("Type ? for help with PDPjs Debugger commands"),cd(a),b||dd(a),a.ua&&(b=a.ua,a.ua=null,ed(a,b,!0))):this.status("No debugger detected");this.A.ea||this.u("CPU will not be auto-started "+(this.Na?"(click Run to start)":"(type 'go' to start)"))}return!0}; +m.pa=function(a){return a?this.save():!0};m.ea=function(){return this.A.O?!0:this.A.ea?(rc(this),!0):!1};m.Ib=function(){return 0};function bd(a){void 0===a.Ga&&(a.Ga=0);void 0===a.ra&&(a.ra=-1);void 0===a.la&&(a.la=-1);a.A.Ua=0<=a.Ga&&0=a.ka&&(a.ka+=a.ra,c=!0);0<=a.la&&a.la<=fd(a)&&(a.ra=a.la=-1,bd(a),a.W(),c=!0);c&&a.u(fd(a)+" cycles: checksum="+n(a.Fa))}} m.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.H)if(a=d.H,a.A.Y)a=!0;else{var b=null,c,h=qb(a.id);for(c=0;ca.Z/a.aa?b=1:d=!0;a.ga=b;b=a.kb*a.ga;if(a.aa!=b){a.aa=b;b=a.aa.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.H&&jd(a.H)}uc(a,a.M);a.M=0;a.L=ob();a.R=0;hd(a);return d}function kd(a,b){for(var c=a.P.length-1;0<=c;c--){var d=a.P[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function ld(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function md(a,b){var c=a.T-=a.N;a.N=0;b&&(a.T=0);return c} -m.jc=function(){if(this.A.O){this.bb>=this.mb&&hd(this,!0);this.ma=0;this.Ea=ob();if(this.R){var a=this.Ea-this.R;a>this.lb&&(this.L+=a,this.L>this.Ea&&(this.L=this.Ea))}try{do{var b=kd(this,this.A.Ta?1:this.Ha);try{this.Ya(b)}catch(e){if("number"!=typeof e)throw e;}b=md(this,!0);this.ma+=b;this.M+=b;vc(this,b);tc(this,b);this.ia-=b;if(0>=this.ia){this.ia+=this.Ha;++this.nb>=nd&&(this.H&&J(this.H,void 0),this.nb=0);break}}while(this.A.O)}catch(e){this.W();this.H&&this.H.stop(ob(),fd(this));zb(this, +m.jc=function(){if(this.A.O){this.bb>=this.mb&&hd(this,!0);this.ma=0;this.Ea=ob();if(this.R){var a=this.Ea-this.R;a>this.lb&&(this.L+=a,this.L>this.Ea&&(this.L=this.Ea))}try{do{var b=kd(this,this.A.Ua?1:this.Ha);try{this.Za(b)}catch(e){if("number"!=typeof e)throw e;}b=md(this,!0);this.ma+=b;this.M+=b;vc(this,b);tc(this,b);this.ia-=b;if(0>=this.ia){this.ia+=this.Ha;++this.nb>=nd&&(this.H&&J(this.H,void 0),this.nb=0);break}}while(this.A.O)}catch(e){this.W();this.H&&this.H.stop(ob(),fd(this));zb(this, e.stack||e.message);return}if(this.A.O){a=setTimeout;b=this.Fb;this.R=ob();var c=this.lb;this.ma&&(c=Math.round(c*this.ma/this.Ha));var c=c-(this.R-this.Ea),d=this.R-this.L;d&&(this.Z=Math.round(this.M/(10*d))/100,864E5<=d&&(this.U=0,gd(this)));if(0>c||this.Zc&&(this.L-=c),c=0;this.bb+=this.ma;this.R+=c;a(b,c)}}}; -function rc(a,b){if(!Bb(a))if(a.A.O)a.u(a.toString()+" busy");else{gd(a);a.A.O=!0;a.A.ib=!0;var c=a.J.run;c&&(c.textContent="Halt");a.H&&(b&&jd(a.H,!0),a.H.start(a.L,fd(a)));a.D||a.status("Started");setTimeout(a.Fb,0)}}m.Ya=function(){return 0};m.W=function(a){var b=!1;if(this.A.O){md(this);uc(this,this.M);this.M=0;this.A.O=!1;if(b=this.J.run)b.textContent="Run";this.H&&this.H.stop(ob(),fd(this));b=!0;this.D||this.status("Stopped")}this.A.complete=a;return b};var id=30,nd=15,Zc=["power","reset"]; -function od(a){var b=+a.model||1001;Yc.call(this,a,1E6);this.Db=b;this.Za=+a.addrReset||0;this.Pb=pd.bind(this);this.w=L.bind(this);this.Ca=null;this.vb=[];this.A.complete=!1}ka(od,Yc);m=od.prototype; -m.reset=function(){this.status("Model "+this.Db);this.A.O&&this.W();this.Ia=this.Ja=this.b=this.K=0;this.i=this.Da=this.Za;this.I=this.ua=-1;this.F=this.j=0;this.ob=[0,0];this.sa=[0,0];this.ja=[0,0];this.ta=[0,0];this.Ba=this.i;this.C=0;this.f=this.fc;this.g=this.qc;this.Ca=null;ad(this);this.A.error=!1;Yc.prototype.reset.call(this)};m.Ib=function(){return 0}; -m.save=function(){var a=new F(this);a.set(0,[this.b,this.K,this.Ia,this.Ja,this.i,this.ua,this.I,this.j,this.C,this.Da,this.Ba,this.Za]);a.set(1,[]);a.set(2,[this.U,this.ga,this.A.ea]);a.set(3,qd(this));a.set(4,ld(this));return a.data()}; -m.restore=function(a){var b;b=a[0];ga();ca();ga();var c=b[Symbol.iterator];b=c?c.call(b):ha(b);this.b=b.next().value;this.K=b.next().value;this.Ia=b.next().value;this.Ja=b.next().value;this.i=b.next().value;this.ua=b.next().value;this.I=b.next().value;this.j=b.next().value;this.C=b.next().value;this.Da=b.next().value;this.Ba=b.next().value;this.Za=b.next().value;b=a[2];this.U=b[0];gd(this,b[1]);this.A.ea=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>>b.i].f(a&16383,a)}; +function rc(a,b){if(!Bb(a))if(a.A.O)a.u(a.toString()+" busy");else{gd(a);a.A.O=!0;a.A.ib=!0;var c=a.J.run;c&&(c.textContent="Halt");a.H&&(b&&jd(a.H,!0),a.H.start(a.L,fd(a)));a.D||a.status("Started");setTimeout(a.Fb,0)}}m.Za=function(){return 0};m.W=function(a){var b=!1;if(this.A.O){md(this);uc(this,this.M);this.M=0;this.A.O=!1;if(b=this.J.run)b.textContent="Run";this.H&&this.H.stop(ob(),fd(this));b=!0;this.D||this.status("Stopped")}this.A.complete=a;return b};var id=30,nd=15,Zc=["power","reset"]; +function od(a){var b=+a.model||1001;Yc.call(this,a,1E6);this.Db=b;this.Oa=+a.addrReset||0;this.Pb=pd.bind(this);this.w=L.bind(this);this.Ca=null;this.vb=[];this.A.complete=!1}ka(od,Yc);m=od.prototype; +m.reset=function(){this.status("Model "+this.Db);this.A.O&&this.W();this.Ia=this.Ja=this.b=this.K=0;this.i=this.Da=this.Oa;this.I=this.ua=-1;this.F=this.j=0;this.ob=[0,0];this.sa=[0,0];this.ja=[0,0];this.ta=[0,0];this.Ba=this.i;this.C=0;this.f=this.fc;this.g=this.qc;this.Ca=null;ad(this);this.A.error=!1;Yc.prototype.reset.call(this)};m.Ib=function(){return 0}; +m.save=function(){var a=new F(this);a.set(0,[this.b,this.K,this.Ia,this.Ja,this.i,this.ua,this.I,this.j,this.C,this.Da,this.Ba,this.Oa]);a.set(1,[]);a.set(2,[this.U,this.ga,this.A.ea]);a.set(3,qd(this));a.set(4,ld(this));return a.data()}; +m.restore=function(a){var b;b=a[0];ga();ca();ga();var c=b[Symbol.iterator];b=c?c.call(b):ha(b);this.b=b.next().value;this.K=b.next().value;this.Ia=b.next().value;this.Ja=b.next().value;this.i=b.next().value;this.ua=b.next().value;this.I=b.next().value;this.j=b.next().value;this.C=b.next().value;this.Da=b.next().value;this.Ba=b.next().value;this.Oa=b.next().value;b=a[2];this.U=b[0];gd(this,b[1]);this.A.ea=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>>b.i].f(a&16383,a)}; m.qc=function(a,b){var c=this.G;a=this.Ba=a;c.b[(a&c.j)>>>c.i].g(b,a&16383,a);return b}; -m.Ya=function(a){this.A.complete=!0;var b=this.D?td(this.D)?1:this.A.ib?-1:0:0,c=a?this.A.ib?0:1:-1;this.A.ib=!1;this.T=this.N=a;this.C=this.C&-5|(b?4:0);do{if(this.C){if(this.C&4){if(ud(this.D,this.i,c)){this.W();break}++b||(this.C&=-5);c||c++}if(a=this.C&11)this.C&2?this.Ca||(this.C&=-3):this.C&1&&this.C++,a=!1;if(a){if(this.C&4&&ud(this.D,this.i,c)){this.W();break}if(0>c)break}}this.C&=15;this.K&4194304?this.K=this.Ia=this.f(this.b):0<=this.ua?(this.K=this.Ja=this.f(this.ua),this.ua=-1):(this.K= +m.Za=function(a){this.A.complete=!0;var b=this.D?td(this.D)?1:this.A.ib?-1:0:0,c=a?this.A.ib?0:1:-1;this.A.ib=!1;this.T=this.N=a;this.C=this.C&-5|(b?4:0);do{if(this.C){if(this.C&4){if(ud(this.D,this.i,c)){this.W();break}++b||(this.C&=-5);c||c++}if(a=this.C&11)this.C&2?this.Ca||(this.C&=-3):this.C&1&&this.C++,a=!1;if(a){if(this.C&4&&ud(this.D,this.i,c)){this.W();break}if(0>c)break}}this.C&=15;this.K&4194304?this.K=this.Ia=this.f(this.b):0<=this.ua?(this.K=this.Ja=this.f(this.ua),this.ua=-1):(this.K= this.Ja=this.f(this.Da=this.i),this.i=(this.i+1)%Tb);this.K&=8388607;this.b=this.K&262143;if(a=this.K>>18&15)this.b=this.b+(this.Ia=this.f(a))&Sb;a=this.K&4194304?-1:this.Ja/Zb|0;0<=a&&this.Pb(a);this.N--}while(0>4].call(this,a,a&15)}function N(a){this.w(a)} function wd(){var a=0,b=this.f(this.b),c=b/$b&63,d=b>>24&63,c=c-d;0>c&&(a++,c=36-d,0>c&&(c=64-d));b=c*$b+(d<<24)+(b&16777215);a&&(b=(b+a)%C);this.g(this.b,b)}function xd(a,b){a=this.f(this.b);if(0>this.I)this.I=a,this.K=this.b|4194304;else{var c=this.I/$b&63,d=this.I>>24&63;a=32>=c+d?(a>>c&(1<>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.g(b,a);this.I=-1}} function yd(a,b){a=this.f(this.b);if(0>this.I)this.I=a,this.K=this.b|4194304;else{var c=this.I/$b&63,d=this.I>>24&63;b=this.f(b)%Math.pow(2,d)*Math.pow(2,c)%C;a=a-a%Math.pow(2,c+d)+b+a%Math.pow(2,c);this.g(this.b,a);this.I=-1}}function zd(a,b){this.g(b,this.f(this.b))}function Ad(a,b){this.g(b,this.b)}function Bd(a,b){this.g(this.b,this.f(b))}function Cd(a,b){this.g(b,0)}function Dd(a,b){this.g(b,B-this.f(b))}function Ed(a,b){this.g(b,B)} @@ -125,7 +125,7 @@ this.g(b,a)}},function(a,b){if(a=(this.b<<14>>14)%36){var c=this.f(b);0>a&&(a=36 dz&&ez&&(this.j|=131072):e-c<=z&&(this.j|=131072);e=0;f>z&&(d+=A,e+=A)}else d=d*Math.pow(2,a)%A+Math.trunc(e%A/Math.pow(2,35-a)),e=e*Math.pow(2,a)%A,c=A-Math.pow(2,35-a),f<=z?f+c>z&&(this.j|=131072):(f-c<=z&&(this.j|=131072),d+=A,e+=A)}else-36>=a?(e=-72>=a?d>z?B:0:Math.trunc(d%A/Math.pow(2,-a-35)),d<=z?d=0:(d=B,e+=A)):(c=d>z?C-Math.pow(2,36+a):0,e=Math.trunc(e%A/Math.pow(2,-a))+ d%A*Math.pow(2,35+a)%A,d=Math.trunc(d/Math.pow(2,-a))+c,d>z&&(e+=A));this.g(b,d);this.g(b+1&15,e)}},function(a,b){if(a=(this.b<<14>>14)%72){var c=this.f(b),d=this.f(b+1&15),e=c;0>a&&(a=72+a);36>a?(c=c*Math.pow(2,a)%C+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%C+Math.trunc(e/Math.pow(2,36-a))):(c=d*Math.pow(2,a-36)%C+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%C+Math.trunc(d/Math.pow(2,72-a)));this.g(b,c);this.g(b+1&15,d)}},function(a,b){if(a=(this.b<<14>>14)%256){var c=this.f(b),d=this.f(b+ 1&15);0=a?(d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36)),c=0):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%C,c=Math.trunc(c/Math.pow(2,-a)));this.g(b,c);this.g(b+1&15,d)}},L,function(a,b){a=this.f(b);this.g(b,this.f(this.b));this.g(this.b,a)},function(a,b){a=!1;for(var c=this.f(b),d=c/y|0,c=c&x;!a;)this.g(c,this.f(d)),c==this.b&&(a=!0),d=d+1&x,c=c+1&x,this.A.O||(this.g(b,d* -y+c),a||sd(this,-1),a=!0)},function(a,b){a=(this.f(b)+262145)%C;this.g(b,a);a=A&&G(this,this.b)},function(a,b){b&1&&(this.j|=4096);b&2&&rd(this,this.Ia);b&4&&this.W();b&8&&this.w(a);G(this,this.b)},function(a,b){a=b<<14;this.j&a&&(this.j&=~a,G(this,this.b))},function(){this.ua=this.b},L,function(a){this.w(a)},function(a,b){a=this.f(b);a+=262145;this.g(a&x,this.f(this.b));a>=C&&(a-=C);a/y|0||(this.j|=262144);this.g(b,a)},function(a, +y+c),a||sd(this,-1),a=!0)},function(a,b){a=(this.f(b)+262145)%C;this.g(b,a);a=A&&G(this,this.b)},function(a,b){b&1&&(this.j|=4096);b&2&&rd(this,this.Ia/y|0);b&4&&this.W();b&8&&this.w(a);G(this,this.b)},function(a,b){a=b<<14;this.j&a&&(this.j&=~a,G(this,this.b))},function(){this.ua=this.b},L,function(a){this.w(a)},function(a,b){a=this.f(b);a+=262145;this.g(a&x,this.f(this.b));a>=C&&(a-=C);a/y|0||(this.j|=262144);this.g(b,a)},function(a, b){a=this.f(b);var c=this.f(a&x);this.g(this.b,c);this.b==b&&(a=c);a-=262145;0>a&&(a+=C);(a/y|0)==x&&(this.j|=262144);this.g(b,a)},function(a){this.w(a)},function(){this.g(this.b,(this.j&x)*y+this.i);this.j&=-8193;G(this,this.b+1)},function(a,b){this.g(b,(this.j&x)*y+this.i);this.j&=-8193;G(this,this.b)},function(a,b){this.g(this.b,this.f(b));this.g(b,this.b*y+this.i);G(this,this.b+1)},function(a,b){a=this.f(b);this.g(b,this.f(a/y|0));G(this,this.b)},function(a,b){this.g(b,Q.call(this,this.f(b),this.f(this.b)))}, function(a,b){this.g(b,Q.call(this,this.f(b),this.b))},function(a,b){this.g(this.b,Q.call(this,this.f(b),this.f(this.b)))},function(a,b){this.g(this.b,this.g(b,Q.call(this,this.f(b),this.f(this.b))))},function(a,b){this.g(b,ze.call(this,this.f(b),this.f(this.b)))},function(a,b){this.g(b,ze.call(this,this.f(b),this.b))},function(a,b){this.g(this.b,ze.call(this,this.f(b),this.f(this.b)))},function(a,b){this.g(this.b,this.g(b,ze.call(this,this.f(b),this.f(this.b))))},oe,function(a,b){0>T(this.f(b),this.b)&& G(this,this.i+1)},function(a,b){T(this.f(b),this.b)||G(this,this.i+1)},function(a,b){0>=T(this.f(b),this.b)&&G(this,this.i+1)},function(){G(this,this.i+1)},function(a,b){0<=T(this.f(b),this.b)&&G(this,this.i+1)},function(a,b){T(this.f(b),this.b)&&G(this,this.i+1)},function(a,b){0T(this.f(b),this.f(this.b))&&G(this,this.i+1)},function(a,b){T(this.f(b),this.f(this.b))||G(this,this.i+1)},function(a,b){0>=T(this.f(b),this.f(this.b))&&G(this,this.i+ @@ -156,11 +156,11 @@ function Be(a){r.call(this,"ROM",a,128);this.X=this.b=null;this.C=+a.addr;this.j Be.prototype.Ka=function(a,b,c,d){this.G=b;this.v=c;this.D=d;Ce(this)};Be.prototype.za=function(){this.X&&(this.D&&De(this.D,this.id,this.C,this.j,this.X),delete this.X);return!0};Be.prototype.pa=function(){return!0}; function Ce(a){if(!Lb(a)){if(a.w){if(!a.b||!a.G)return;a.j||(a.j=a.b.length);if(a.b.length!=a.j)zb(a,"ROM size ("+n(a.b.length,8,!0)+") does not match specified size ("+n(a.j,8,!0)+")");else{var b;b=a.C;if(Dc(a.G,b,a.j,Pc)){var c;for(c=0;c>>f.i;0>>= f.i;0>>a.i;0g&&g>=-A&&(g+=C);for(var g=Math.trunc(Math.abs(g))%C,h=d;f--&&h>>a.i;0g&&g>=-A&&(g+=C);for(var g=Math.trunc(Math.abs(g))%C,h=d;f--&&h=ra.wb&&c<=ra.Ob&&(b=c-(ra.wb-ra.Kb));b&&(a.preventDefault&&a.preventDefault(),d.gb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ra.Mb&&(b=ra.Lb);d.gb(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.gb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};m.Ka=function(a,b,c,d){this.H=a;this.G=b;this.v=c;this.D=d;Mb(this)}; @@ -179,58 +179,58 @@ function Qe(a,b,c,d,e){e=void 0===e?0:e;var f;if(null!=b)if(f=a.sb(b),0<=f?f=a.t function Ue(a,b,c){var d,e=!1;void 0!==c&&(e=!0,d=8==a.S?K(a,c,a.L,8,1)+" "+c+".":K(a,c,a.L,16,1)+" "+K(a,c,a.L,8,1)+" "+K(a,c,a.L,2,32>=a.L?8:6)+" "+c+".",32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'"));a.u((null!=b?b+": ":"")+d);return e}function Ve(a){var b=a.I;a.I={};return b}function We(a,b){if(b)return Ue(a,b,a.I[b]);var c=0;for(b in a.I)Ue(a,b,a.I[b]),c++;return 0=a?8:262143>=a?18:36);b=ta(b,2,a,"",e);break;case 8:b=ua(b,0>2:0,!!e)}0>c?c=b.replace(/^0+([0-9A-F]+)$/i,"$1"):c=b;return c} var Re={"||":0,"&&":1,"!":2,"|":2,"^!":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9,_:10,"^_":10,"{":11,"}":11},Me=Math.pow(2,32); -function Xe(a){Je.call(this,a);this.Ha=!1;this.Fa=18;this.L=36;this.aa=["<",">"];this.sa=[];this.Ga=Z();this.M=Z(0);this.la=Z(0);this.ia=Z(0);this.F=[];this.b=this.N=this.K=[];Ye(this);this.U=this.ma=0;this.i=[];this.Da=void 0;Ze(this);this.D=this;this.Ba={};this.ba=this.Eb=0;this.Z=null;this.R=[];$e(this,a.messages);this.ua=a.commands;this.P=0;this.Na=this.Ea=null;this.C=this.Ja=this.Ia=this.ka=this.Ca=0;this.ta=this.ra=this.ga=null;var b=this;window?void 0===window[v]&&(window[v]=function(a){return ed(b, +function Xe(a){Je.call(this,a);this.Ia=!1;this.Fa=18;this.L=36;this.aa=["<",">"];this.sa=[];this.Ha=Z();this.M=Z(0);this.la=Z(0);this.ia=Z(0);this.F=[];this.b=this.N=this.K=[];Ye(this);this.U=this.ma=0;this.i=[];this.Da=void 0;Ze(this);this.D=this;this.Ba={};this.ba=this.Eb=0;this.Z=null;this.R=[];$e(this,a.messages);this.ua=a.commands;this.Ga=[];this.P=0;this.Oa=this.Ea=null;this.C=this.Na=this.Ja=this.ka=this.Ca=0;this.ta=this.ra=this.ga=null;var b=this;window?void 0===window[v]&&(window[v]=function(a){return ed(b, a)}):void 0===global[v]&&(global[v]=function(a){return ed(b,a)})}ka(Xe,Je);function af(a){a=a&&a.B;null==a&&(a=-1);return a}function Z(a,b,c){return{B:void 0===a?null:a,cb:void 0===b?!1:b,oa:!1,S:c}}function bf(a,b,c,d){a.B=b;a.cb=c||!1;a.oa=!1;a.S=d}function cf(a){return[a.B,a.cb,a.oa,a.S,a.hb]}function df(a,b){var c=Z(b[0],b[1],b[2]);c.oa=b[3];b[4]&&(c.zb=Ke(a,c.hb=b[4]));return c}m=Xe.prototype; m.Ka=function(a,b,c,d){this.G=b;this.H=a;this.v=c;this.ra=a.j;this.Fa=b.F;(b=$c(a,"messages"))&&$e(this,b);if(a=$c(a,"commands"))this.ua=a;ef(this,function(a){a:{var b=d.G.b,c=a[0],e=a=0,k=b.length;if(c){a=af(ff(d,c,d.la));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.G.i;k=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,l=0;k--;){var p=b[e];p.type==c?l++||d.u("..."):(c=p.type,l=Kc[c],p&&d.u(n(p.id,8)+" %"+ -n(e<a&&a>=-A&&(a+=C);return Math.trunc(Math.abs(a))%Math.pow(2,void 0===b?36:b)}function jf(a,b){return K(a,b/Tb,18)+" "+K(a,b%Tb,18)} function $e(a,b){a.D=a;a.ba=a.Eb=536870916;a.Z=null;a.R=[];b=Ke(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in ac){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d>23&&a.v.Da==b&&(b=sd(a.v,1)));if(0d&&(d=a.v.f(b)),0<=d&&(bf(a.i[a.U],b),++a.U==a.i.length&&(a.U=0)));return!1} function Bf(a,b,c,d){var e=Z(b.B),f=a.Ma(b,1),g,h,k,l=0,p=f/Xb|0,u;for(u in Cf)if(g=Cf[u][p&u]){h=+u;p>>=6;switch(h){case 32512:k=Df;l=p&3;break;case 32256:k=Ef;l=p&7;break;case 29248:k=Ff,l=(p&48)>>2|(p&6)>>1}break}k=k&&k[l]||"";"S"==k&&g>Gf&&(k="B");k=Hf[g||0]+k;if(g){if(28700==h)h=f/Yb&127,l=K(a,h,-1);else for(h=f>>23&15,l=K(a,h,-1),p=0;l&&p>18&15)&&(k+="("+K(a,f, --1)+")")}else k=Da(k,8)+jf(a,f);f=k;g="";h=K(a,e.B,18)+":";if(-1!==e.B&&-1!==b.B){do if(k=a.Ma(e,1),g+=" "+jf(a,k),null==e.B)break;while(e.B!=b.B)}h+=Da(g,16)+f;c&&(h=Da(h,48)+";"+(c||""),h=a.v.A.Ta?h+("cycles="+fd(a.v).toString()+" cs="+n(a.v.Fa)):h+(null!=d?"="+d.toString():""));return h} +-1)+")")}else k=Da(k,8)+jf(a,f);f=k;g="";h=K(a,e.B,18)+":";if(-1!==e.B&&-1!==b.B){do if(k=a.Ma(e,1),g+=" "+jf(a,k),null==e.B)break;while(e.B!=b.B)}h+=Da(g,16)+f;c&&(h=Da(h,48)+";"+(c||""),h=a.v.A.Ua?h+("cycles="+fd(a.v).toString()+" cs="+n(a.v.Fa)):h+(null!=d?"="+d.toString():""));return h} function Jf(a,b,c,d,e){var f=-1,g,h;a.ja=null;if(b){for(var k=b.toUpperCase(),l=0;lGf&&(P="B");if(k==Hf[h]+P){f=29248!=g?I:(I&3)<<1|(I&12)<<2;f=(D|f<<6)*Xb;break}}if(0<=f)break}if(0<=f)break}0>f&&c&&!c.match(/^[0-9A-Z$%.?]/i)&& (c=b+c,b="",f=0)}else c&&(f=g=0);if(0<=f&&c)for(k=c.split(","),u=0;uh||15h||127 h||15h||262143f&&!e&&a.u("unknown instruction: "+b+" "+c);return f}function Ye(a){var b,c;a.b=["bp"];if(a.N)for(b=1;b>>d.i],!1)}a.N=["br"];if(a.K)for(b=1;b>>d.i],!0);a.K=["bw"];a.Ca=0;a.ma=0} -m.Qa=function(a,b,c){var d=!0;c||Kf(this,a,b,!1,!0);if(a!=this.b){var e=af(b);if(-1===e)this.u("invalid address: "+K(this,b.B,18)),d=!1;else{var f=this.G;f.b[e>>>f.i].Qa(e&16383,a==this.K)}}d&&(a.push(b),c?b.oa=!0:(Lf(this,a,a.length-1,"set"),Ze(this)));return d};function Kf(a,b,c,d,e){var f=!1;c=af(c);for(var g=1;g>>d.i],b==a.K));h.oa||Ze(a);break}}return f} +m.Ra=function(a,b,c){var d=!0;c||Kf(this,a,b,!1,!0);if(a!=this.b){var e=af(b);if(-1===e)this.u("invalid address: "+K(this,b.B,18)),d=!1;else{var f=this.G;f.b[e>>>f.i].Ra(e&16383,a==this.K)}}d&&(a.push(b),c?b.oa=!0:(Lf(this,a,a.length-1,"set"),Ze(this)));return d};function Kf(a,b,c,d,e){var f=!1;c=af(c);for(var g=1;g>>d.i],b==a.K));h.oa||Ze(a);break}}return f} function Mf(a,b){for(var c=1;cd;d++){!d||d&3||(c+="\n");var e=a,f=ua(d,2);bf(e.Ga,d);f+="="+K(e,e.Ma(e.Ga),36)+" ";c+=f}if(b){b="";for(d=0;d=pf?1:d==mf?23:18)+" "),b+=e;c+="\n"+b}return c}m.Gb=function(a,b){return a[0]>b[0]?1:a[0]d;d++){!d||d&3||(c+="\n");var e=a,f=ua(d,2);bf(e.Ha,d);f+="="+K(e,e.Ma(e.Ha),36)+" ";c+=f}if(b){b="";for(d=0;d=pf?1:d==mf?23:18)+" "),b+=e;c+="\n"+b}return c}m.Gb=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],u=Fa(p,k,a.Gb);0>u&&p.splice(-(u+1),0,k)}l&&(h.a=l.replace(/''/g,'"'))}a.F.push({wd:b,B:c,Ub:d,X:e,Bb:f})}function pg(a,b,c){var d=[],e=af(b)>>>0;for(b=0;b>>0,h=f.Ub;if(e>=g&&eb){a.u("unknown register: "+f);return}var f=0,h=a.v;switch(b){case lf:G(h, -g);bf(a.M,h.i);break;case of:rd(h,g*y);break;case pf:f=131072;break;case qf:f=65536;break;case rf:f=32768;break;case sf:f=32;break;case tf:f=262144}f&&(h.j=g?h.j|f:h.j&~f);J(a.H);a.u("updated registers:")}}a.u(ng(a,e));c&&(bf(a.M,d.i),zf(a,K(a,a.M.B,18)))}}function wg(a,b){b=Ea(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var l=h[0]+":";h[2]&&(l+=" "+h[2]);a.u(l)}h[3]&&(g=h[3],f=null);h=a.ia;l=b;h.B=l.B;h.cb=l.cb;h.oa=l.oa;h.S=l.S;a.u(Bf(a,b,g,f));e-=b.B-k;c++}}} -function Nf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(xf+b):(a.T&&(a.u("ended assemble at "+K(a,a.ia.B,18)),a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Z=null;if(Lb(a)&&0p||"z"na.length&&(a.u("note: only "+na.length+" available"),da=na.length);ia-=da;0>ia&&(null==na[na.length-1].B?(da=ia+da,ia=0):ia+=na.length);var Nd= -[];"call"==Sf&&(Cb=1E5,Nd=["CALL"]);for(void 0!==Rf&&a.u(da+" instructions earlier:");0=na.length&&(ia=0);a.Da=da;Uf++;Cb--}}Uf||(a.u("no "+Tf+"history available"),a.Da=void 0)}else{var hb=ff(a,ma,a.la);if(hb){var Ka=0,Xf="ds"==eb;if(Ba){if("l"==Ba.charAt(0))Ba=Ba.substr(1)||yh,Ka=Qe(a,Ba);else{var Yf=ff(a,Ba);Yf&& -(Ka=Yf.B-hb.B)}0>Ka&&(Ka=0);65536Eb?".":String.fromCharCode(Eb)),Gc=Gc-7}La&&(La+="\n");La=Xf?La+(oa+","):La+(ma+": "+oa+(0>$f? +function Nf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(xf+b):(a.T&&(a.u("ended assemble at "+K(a,a.ia.B,18)),a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Z=null;if(Lb(a)&&0p||"z"na.length&&(a.u("note: only "+na.length+" available"),da=na.length);ia-=da;0>ia&&(null==na[na.length-1].B?(da=ia+da,ia=0):ia+=na.length);var Nd= +[];"call"==Sf&&(Cb=1E5,Nd=["CALL"]);for(void 0!==Rf&&a.u(da+" instructions earlier:");0=na.length&&(ia=0);a.Da=da;Uf++;Cb--}}Uf||(a.u("no "+Tf+"history available"),a.Da=void 0)}else{var ib=ff(a,ma,a.la);if(ib){var Ka=0,Xf="ds"==fb;if(Ba){if("l"==Ba.charAt(0))Ba=Ba.substr(1)||yh,Ka=Qe(a,Ba);else{var Yf=ff(a,Ba);Yf&& +(Ka=Yf.B-ib.B)}0>Ka&&(Ka=0);65536Eb?".":String.fromCharCode(Eb)),Gc=Gc-7}La&&(La+="\n");La=Xf?La+(oa+","):La+(ma+": "+oa+(0>$f? " "+Qd:""))}La&&a.u(La);a.S=Ah}}}}break;case "e":if("else"==g[0])break;var ag,bg,cg=g[0],Sd=g[1];"e"==cg||"ew"==cg?(ag=a.Ma,bg=a.yb):Sd=null;if(null==Sd)a.u("edit memory commands:"),a.u("\tew [a] [...] edit words at address a");else{var Hc=ff(a,Sd,a.la);if(Hc)for(var Td=2;Td +if(!Ud)break a;hf(a,Ud,Dh);a.Ra(a.b,Ud,!0)}vf(a,!0,c)}break;case "h":a.A.O?(c||a.u("halting"),a.W()):Nb(a,!0)||c||a.u("already halted");break;case "i":if("if"==g[0]){var Vd;var Gb=b.substr(2),Gb=Ea(Gb);Te(a,Gb)?(c||a.u("true: "+Gb),Vd=!0):(c||a.u("false: "+Gb),Vd=!1);Vd||(d=!1);break}f=!0;break;case "k":var Eh=g[0];if("?"==g[1])a.u("stack trace commands:"),a.u("\tk\tshow frame addresses"),a.u("\tks\tshow symbol information");else{var Wd=0,Xd=Z(),Hb=Z();for(a.u("stack trace for "+K(a,Hb.B,18));10> Wd;){for(var Ma=null,Fh=256;65536>Hb.B>>>0;){Xd.B=a.Ma(Hb,2);if(null==Hb.B||!Fh--)break;if(!(Xd.B&1)){for(var Gh=a,Ic=Xd,eg=null,Ib=Ic.B,fg=Ib,Yd=1;6>=Yd&&Ib;Yd++){if(2lg)a.u("step commands:"), -a.u("\tp\tstep over instruction"),a.u("\tpr\tstep over instruction with register update");else if(a.P)a.u("step in progress");else{var mg=Z(a.v.i);a.Ma(mg);a.P?(a.Qa(a.b,mg,!0),vf(a)||(a.H&&jd(a.H),a.P=0)):xg(a,lg?"tr":"t")}break;case "r":if("reset"==b){a.H&&a.H.reset();break}yf(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var ib=+g[2];if(2==ib||8==ib||10==ib||16==ib)a.S=ib;else{a.u("invalid base: "+ib);break}}a.u("default base: "+a.S);break;case "cs":var Kb;void 0!==g[3]&&(Kb=+g[3]);switch(g[2]){case "int":a.v.ra= -Kb;break;case "start":a.v.Ga=Kb;break;case "stop":a.v.la=Kb;break;default:a.u("unknown cs option");break a}void 0!==Kb&&bd(a.v);a.u("checksums "+(a.v.A.Ta?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(gd(a.v,+g[2])||a.u("warning: using 1x multiplier, previous target not reached"));a.u("target speed: "+(a.v.aa.toFixed(2)+"Mhz")+" ("+a.v.ga+"x)");break;default:if(g[1]){a.u("unknown option: "+g[1]);break}case "?":a.u("debugger options:"),a.u("\tbase #\t\tset default base to #"),a.u("\tcs int #\tset checksum cycle interval to #"), +a.u("\tp\tstep over instruction"),a.u("\tpr\tstep over instruction with register update");else if(a.P)a.u("step in progress");else{var mg=Z(a.v.i);a.Ma(mg);a.P?(a.Ra(a.b,mg,!0),vf(a)||(a.H&&jd(a.H),a.P=0)):xg(a,lg?"tr":"t")}break;case "r":if("reset"==b){a.H&&a.H.reset();break}yf(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var jb=+g[2];if(2==jb||8==jb||10==jb||16==jb)a.S=jb;else{a.u("invalid base: "+jb);break}}a.u("default base: "+a.S);break;case "cs":var Kb;void 0!==g[3]&&(Kb=+g[3]);switch(g[2]){case "int":a.v.ra= +Kb;break;case "start":a.v.Ga=Kb;break;case "stop":a.v.la=Kb;break;default:a.u("unknown cs option");break a}void 0!==Kb&&bd(a.v);a.u("checksums "+(a.v.A.Ua?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(gd(a.v,+g[2])||a.u("warning: using 1x multiplier, previous target not reached"));a.u("target speed: "+(a.v.aa.toFixed(2)+"Mhz")+" ("+a.v.ga+"x)");break;default:if(g[1]){a.u("unknown option: "+g[1]);break}case "?":a.u("debugger options:"),a.u("\tbase #\t\tset default base to #"),a.u("\tcs int #\tset checksum cycle interval to #"), a.u("\tcs start #\tset checksum cycle start count to #"),a.u("\tcs stop #\tset checksum cycle stop count to #"),a.u("\tsp #\t\tset speed multiplier to #")}break;case "t":xg(a,g[0],g[1]);break;case "u":zf(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ug(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.u((Rb||"PDP10")+" version 1.34.3 ("+a.v.Db+",RELEASE)");a.u(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){wg(a,b.substr(1));break}var Zd="commands:",$d;for($d in zg)Zd+="\n"+ -Da($d,9)+zg[$d];td(a)||(Zd+="\nnote: history disabled if no exec breakpoints");a.u(Zd);break;default:f=!0}f&&(a.u("unknown command: "+b),d=!1)}}catch(og){a.u("Debugger "+(og.stack||og.message)),d=!1}return d}function ed(a,b,c){b=Ke(a,b,c);for(var d in b)if(!Nf(a,b[+d]))return!1;return!0} +Da($d,9)+zg[$d];td(a)||(Zd+="\nnote: history disabled if no exec breakpoints");a.u(Zd);break;default:f=!0}f&&(a.u("unknown command: "+b),d=!1)}}catch(og){a.u("Debugger "+(og.stack||og.message)),d=!1}return d}function ed(a,b,c){b&&(a.Ga=Ke(a,b,c));for(;b=a.Ga.shift();)if(!Nf(a,b))return!1;return!0} var zg={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Gf=20,Hf=".WORD HLL HLLZ HLLO HLLE HRL HRLZ HRLO HRLE HRR HRRZ HRRO HRRE HLR HLRZ HLRO HLRE MOVE MOVS MOVN MOVM EXCH BLT PUSH POP LDB DPB IBP ILDB IDPB SETZ SETO SETA SETCA SETM SETCM AND ANDCA ANDCM ANDCB IOR ORCA ORCM ORCB XOR EQV LSH LSHC ROT ROTC ADD SUB MUL IMUL DIV IDIV ASH ASHC FSC FADR FSBR FMPR FDVR DFN UFA FAD FSB FMP FDV AOBJP AOBJN CAI CAM JUMP SKIP AOJ AOS SOJ SOS TR TL TD TS XCT JFFO JFCL JSR JSP JRST JSA JRA PUSHJ POPJ BLKI DATAI BLKO DATAO CONO CONI CONSZ CONSO UUO JOV JCRY0 JCRY1 JCRY JFOV HALT JRSTF JEN".split(" "), lf=0,mf=1,nf=2,of=3,pf=4,qf=5,rf=6,sf=7,tf=8,kf="PC RA EA PS OV C0 C1 ND PD".split(" "),Ag={},Cf=(Ag[28672]={0:101},Ag[32704]={5632:64,5696:63,5760:58,5824:27,5888:28,5952:25,6016:29,6080:26,10240:56,10304:48,10368:46,10432:84,10496:57,10560:49,10624:47,10752:21,10816:22,10880:69,10944:70,11008:88,11072:85,11136:83,11264:91,11328:23,11392:24,11456:92,11520:86,11584:87,11648:89,11712:90},Ag[32512]={6144:65,6400:59,6656:66,6912:60,7168:67,7424:61,7680:68,7936:62,8192:17,8448:18,8704:19,8960:Gf,9216:53, 9472:52,9728:55,9984:54,11776:50,12032:51,16384:30,16640:36,16896:37,17152:34,17408:38,17664:32,17920:44,18176:40,18432:39,18688:45,18944:33,19200:41,19456:35,19712:42,19968:43,20224:31,20480:1,20736:5,20992:2,21248:6,21504:3,21760:7,22016:4,22272:8,22528:9,22784:13,23040:10,23296:14,23552:11,23808:15,24064:12,24320:16},Ag[32256]={12288:71,12800:72,13312:73,13824:74,14336:75,14848:76,15360:77,15872:78},Ag[29248]={24576:79,24640:80,25088:81,25152:82},Ag[28700]={28672:93,28676:94,28680:95,28684:96, @@ -238,29 +238,29 @@ lf=0,mf=1,nf=2,of=3,pf=4,qf=5,rf=6,sf=7,tf=8,kf="PC RA EA PS OV C0 C1 ND PD".spl function tg(a,b,c,d,e){this.T=b||0;this.ga=c||"";this.b=d;this.done=e;this.C=null;this.u("starting PCjs MACRO-10 Mini-Assembler...");this.j={};this.N={};this.L=[];this.K=[];this.V=[];this.na=[];this.Z=this.U=this.ca=0;this.fa=this.T;this.La=-1;this.w=[];this.I=null;this.i=0;this.F=null;this.J=this.M="";this.aa=/^[ \t]*([A-Z$%.?][0-9A-Z$%.]*:|)[ \t]*([A-Z$%.][0-9A-Z$%.]*|)([ \t]*)([^;]+|)(;?[\s\S]*)/i;this.D=this.v=null;this.H="";this.G=[];this.R=0;this.P=a.split(";");Bg(this)} function Bg(a){if(a.R==a.P.length)a.done(Cg(a));else{var b=a.P[a.R++];a.u("loading "+wa(b));".MAC"==b.slice(-4).toUpperCase()&&(b+=".txt");Ha(b,null,!0,function(b,d,e){if(e)a.done(e,b);else{e=d;if(ya(b,".html")){e="";var c;for(b=/
([\s\S]*?)<\/pre>/gi;c=b.exec(d);)c=c[1],0<=c.indexOf("&")&&(c=c.replace(/</gi,"<").replace(/>/gi,">").replace(/&/gi,"&")),e+=c;(c=e.match(/&[a-z]+;/i))&&Dg(a,"unrecognized HTML entity: "+c[0])}a.G=a.G.concat(e.split(/(\r?\n)/));setTimeout(function(){Bg(a)},
 0)}})}}
-function Cg(a){if(0<=a.ga.indexOf("p"))return a.u(a.G.join("")),0;var b=Ve(a.b);try{for(var c=0;cI)break;var u=
-I+1,P=I+l.length,cb="",Ab="";I&&(cb=b[I-1]).match(/[0-9A-Z$%.]/i)||!(P>=b.length)&&(Ab=b[P]).match(/[0-9A-Z$%.]/i)||("'"==cb&&I--,"'"==Ab&&P++,b=b.substr(0,I)+p+b.substr(P),u=I+p.length,g=!0)}c=null}}d=h[1];c=h[3];b=h[4].trim();h=h[4]+h[5];d&&(d=d.slice(0,-1),Fg(a,d,a.fa,Gg));var H;f&&(H=b.match(/^([=:]+)(.*)/))&&(e=0,d=f,f=H[1],b=H[2],"=="==f?e|=Pg:"=:"==f&&(e|=Qg),Fg(a,d,b,e),f=b="");if(!f&&!b)return!0;a.I=f;for((H=Rg(a,b))&&(b=b.replace(H,Sg(a,Tg,Rg(a,h))));H=Ug(a,b);)b=b.replace(H,H.slice(0,-1));
+I+1,P=I+l.length,db="",Ab="";I&&(db=b[I-1]).match(/[0-9A-Z$%.]/i)||!(P>=b.length)&&(Ab=b[P]).match(/[0-9A-Z$%.]/i)||("'"==db&&I--,"'"==Ab&&P++,b=b.substr(0,I)+p+b.substr(P),u=I+p.length,g=!0)}c=null}}d=h[1];c=h[3];b=h[4].trim();h=h[4]+h[5];d&&(d=d.slice(0,-1),Fg(a,d,a.fa,Gg));var H;f&&(H=b.match(/^([=:]+)(.*)/))&&(e=0,d=f,f=H[1],b=H[2],"=="==f?e|=Pg:"=:"==f&&(e|=Qg),Fg(a,d,b,e),f=b="");if(!f&&!b)return!0;a.I=f;for((H=Rg(a,b))&&(b=b.replace(H,Sg(a,Tg,Rg(a,h))));H=Ug(a,b);)b=b.replace(H,H.slice(0,-1));
 if(!Vg(a,f,b))switch(f){case Wg:case Xg:case Yg:Mg(a,h);break;case Zg:(f=b)?(a.C=Jg(a,f,!0),void 0===a.C&&a.error("unrecognized expression: "+f)):a.C=a.T;break;case $g:ah(a,b);break;case bh:ah(a,b.replace(",",",,"));break;case ch:case dh:case eh:case Ng:case Og:case fh:Sg(a,f,h);break;case gh:case hh:case ih:case jh:break;default:H=-1,h=(f+c+b).trim(),0>b.indexOf(",,")&&(H=Jf(a.b,f,b,a.fa,!0)),0>H&&(H=Jg(a,h,!0)),void 0!==H?Hg(a,H,a.b.ja):a.error("unrecognized expression: "+h)}return!0}
-function Vg(a,b,c){var d=a.j[b];if(!d)return!1;if(null!=c)return b=a.v,a.v=d,d.Pa=kh(a,c,!0),Ig(a,d.Aa,d.Sa,d.Pa,d.Ab),a.v=b,!0;if("?"!=b[0])return!1;switch(b.substr(1)){case dh:d.fb||Ig(a,d.Aa);break;case eh:d.fb&&Ig(a,d.Aa);break;case Ng:case Og:for(b=0;b"==h&&0>--g){a.error("missing bracket(s): "+b);break}}}g?0=--c){g=e;break}}0>c&&a.error("missing bracket(s): "+b);0<=f&&(d=b.substr(f,g-f));return d}function Ug(a,b){var c=null;if(b=b.match(/([A-Z$%.][0-9A-Z$%.]*)#/i)){c=b[0];b=b[1];var d="?"+b;a.j[d]&&a.error("reserved symbol redefined: "+c);var e,f,g;e=f=g=[];a.j[d]={name:d,fb:mh,Sa:e,Ab:f,Pa:g,Aa:b+": 0",ca:a.ca};a.K.push(d)}return c}
+function Rg(a,b){for(var c=0,d="",e=0,f=-1,g=b.length;e=--c){g=e;break}}0>c&&a.error("missing bracket(s): "+b);0<=f&&(d=b.substr(f,g-f));return d}function Ug(a,b){var c=null;if(b=b.match(/([A-Z$%.][0-9A-Z$%.]*)#/i)){c=b[0];b=b[1];var d="?"+b;a.j[d]&&a.error("reserved symbol redefined: "+c);var e,f,g;e=f=g=[];a.j[d]={name:d,fb:mh,Ta:e,Ab:f,Qa:g,Aa:b+": 0",ca:a.ca};a.K.push(d)}return c}
 function kh(a,b,c){var d=[];for(c&&(b=b.replace(/^\(?(.*?)\)?$/,"$1"));b;){b=b.trim();c=lh(a,b);if(!c)break;d.push(c);b=b.substr(c.length+1)}return d}
 function Mg(a,b){var c=b;null==a.D&&(a.D=a.H="",b&&(a.D=b[0],c=b=b.substr(1)));if(a.D){var d=b.indexOf(a.D);0>d?c="":(c=b.substr(d+1),b=b.substr(0,d),a.D=null);a.H+=b}if(null==a.D){var d=b=0,e,f,g=a.H.length;a.I==Xg&&g++;for(var h=0;h=k&&(k-=32),k=k+32&63);d+=k*Math.pow(2,f);f-=e;b++;0>f&&(Hg(a,d),b=0)}b&&Hg(a,d)}return c}
 function Sg(a,b,c){var d,e,f,g,h,k;a.J="<";a.M=">";g=h=k=[];if(b==ch){e=c.match(/([A-Z$%.][0-9A-Z$%.]*)\s*(\([^)]*\)|)\s*(<|)([\s\S]*)/i);if(!e)return a.error("unrecognized "+b+": "+c),c;f=e[1];if(e[2]){h=g=kh(a,e[2],!0);b=[];for(c=0;c");0>l&&(l=h[c].length);b[c]=h[c].substr(d,l-d);h[c]=h[c].substr(0,d)}h=b}b=nh;c=3}else if(b==Tg)a.J="[",a.M="]",f="?"+va(++a.Z,5),a.j[f]&&a.error("literal symbol redefined: "+f),e=[c[0],c.substr(1)],
-b=oh,c=0;else if(b==Ng||b==Og){a.v||a.error(b+" outside of macro");e=c.match(/([A-Z$%.][0-9A-Z$%.]*)\s*,\s*(<|)([\s\S]*)/i);if(!e)return a.error("unrecognized "+b+": "+c),c;for(d=0;d=C)&&Dg(a,"truncated value "+ua(b)+" at location "+ua(c)+" to "+ua(d));return d}tg.prototype.u=function(a){this.b?this.b.u(a):console.log(a)};var Gg=1,Pg=2,Qg=4,Wg="ASCII",Xg="ASCIZ",ch="DEFINE",Zg="END",$g="EXP",dh="IFE",eh="IFN",Ng="IRP",Og="IRPC",gh="LALL",Tg="LITERAL",hh="PAGE",fh="REPEAT",Yg="SIXBIT",ih="SUBTTL",jh="TITLE",bh="XWD",nh=-1,oh=-2,mh=-3;
 function ph(a,b,c){r.call(this,"Computer",a,33554432);this.A.Y=!1;this.R=null;qh(this,b);this.N=$c(this,"autoPower",a,6);this.w=0;this.Z=+a.busWidth||+a.buswidth;this.L=this.F=this.M=null;this.K=this.U=!1;this.I=this.C=null;this.T=this.P=!1;this.aa=$c(this,"url")||"";(Math.random()+.1).toString(36);this.i=rh(this);if(this.v=sb("CPU",this.id)){this.D=sb("Debugger",this.id);this.G=new zc({id:this.ab+".bus",busWidth:this.Z},this.v,this.D);var d,e=qb(this.id);if((this.j=sb("Panel",this.id))&&this.j.xa)for(b=
 0;b\nLicense: GPL version 3 or later ");for(b=0;bsh){if(th(d,this.L)){this.C=new F(this,"1.34.3",Nh);th(this.C)&&(Oh(this,d),a=Ph,Qh(this.C));this.C.set(Kh,Ga());Rh(this.C);var e=this.b&&!this.K;if(a==Lh||pb("Click OK to restore the previous "+Rb+" machine state, or CANCEL to reset the machine.")){if(c=Jh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?th(d,g):("error"==f&&"no machine state"!=
+m.Wa=function(a){void 0===a&&(a=this.b||(this.L?Lh:sh));if(!this.w){this.w++;var b=!1,c=!1;this.P=!1;var d=this.I||new F(this,"1.34.3");if(a==Mh)b=!0;else if(a>sh){if(th(d,this.L)){this.C=new F(this,"1.34.3",Nh);th(this.C)&&(Oh(this,d),a=Ph,Qh(this.C));this.C.set(Kh,Ga());Rh(this.C);var e=this.b&&!this.K;if(a==Lh||pb("Click OK to restore the previous "+Rb+" machine state, or CANCEL to reset the machine.")){if(c=Jh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?th(d,g):("error"==f&&"no machine state"!=
 g?(this.ha("Error: "+g),"unable to verify user"==g&&(Qa(Sh,""),this.i=null)):this.u(f+": "+g),Qh(d),th(d)?(c=Jh(d),e=!0):c=!1))}e&&wh(this,c?d:null)}else a==Ph&&d.clear()}else wh(this);delete this.L;delete this.I}e=qb(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.A.Y=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.v&&(Th(this,this.v,b,c,a),J(this,-2),this.v.ea());this.P&&(Oh(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.w=0};
@@ -270,13 +270,13 @@ function yg(a,b,c){var d,e="none";if(a.w)return null;a.w--;var f=new F(a,"1.34.3
 m.reset=function(){this.A.reset=!0;this.G&&this.G.reset&&(Qb(this,"Resetting "+this.G.type),this.G.reset());this.v&&this.v.reset&&(Qb(this,"Resetting "+this.v.type),this.v.reset());for(var a=qb(this.id),b=0;b=d||30<=(c.jb+=d))&&(e.textContent=c.A.O?c.Z.toFixed(2)+"Mhz":"Stopped",c.jb=0)}if(a.j&&(a=a.j,b=b||0,a.L)){c=a.v.A.O;d=!!(a.v.C&8);if(0>=b||60<=(a.K+=b)){e=a.v.i;if(a.J.PC){var f=a.D&&a.D.S||8,e=e||0,e=8==f?ua(e,void 0):n(e,void 0);a.J.PC.textContent!=e&&(a.J.PC.textContent=e)}a.K=0}-1>b?a.i=a.v.i:0/g.exec(a)){var e=
 function ei(a,b,c,d,e){function f(a){if(void 0===k){var b=h&&w(h,"machine-warning");k=b&&b[0]||h}k&&(k.innerHTML=za(a))}function g(a){f("Error: "+a);l&&(--ai||ab(!0));l=!1}var h,k,l=!0;ai++;nb[b]={};try{if(h=document.getElementById(b)){var p;if("object"==typeof resources&&(p=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css";D.styleSheet?D.styleSheet.cssText=p:D.appendChild(document.createTextNode(p));u.appendChild(D)}d||
 (p=a,"pdp"==a.substr(0,3)&&(p="pdpjs"),d="/versions/"+p+"/1.34.3/components.xsl");p=function(e,k){k?bi(d,null,a,null,!1,f,function(a,e){e?(mb(b,d,a),f("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=k.transformNode(e))?(h.outerHTML=e,--ai||ab(!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),--ai||
 ab(!0)):g("invalid machine element: "+b):g("transformToFragment failed")):g("unable to transform XML: unsupported browser")):g(a)}):g(e)};"<"!=c.charAt(0)?bi(c,b,a,e,!0,f,p):ci(c,null,b,a,e,!1,f,p)}else g("missing machine element: "+b)}catch(I){g(I.message)}return l}window.embedPDP10=function(a,b,c,d){ab(!1);return ei("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){ab(!1);return ei("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return sb(b,a+".machine")};
-window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!vb[a]){for(var c=!0,d=vb,e=a,f=b.length,g=[],h=[],k="",l=null,p=0;p>14)%36){var c=this.b(b);0>a&&(a=36+a);c=c*M
 131072;if(71<=a){if(0F&&eF&&(this.g|=131072):e-c<=F&&(this.g|=131072);e=0;f>F&&(d+=G,e+=G)}else d=d*Math.pow(2,a)%G+Math.trunc(e%G/Math.pow(2,35-a)),e=e*Math.pow(2,a)%G,c=G-Math.pow(2,35-a),f<=F?f+c>F&&(this.g|=131072):(f-c<=F&&(this.g|=131072),d+=G,e+=G)}else-36>=a?(e=-72>=a?d>F?I:0:Math.trunc(d%G/Math.pow(2,-a-35)),d<=F?d=0:(d=I,e+=G)):(c=d>F?J-Math.pow(2,36+a):0,e=Math.trunc(e%G/Math.pow(2,-a))+d%G*Math.pow(2,
 35+a)%G,d=Math.trunc(d/Math.pow(2,-a))+c,d>F&&(e+=G));this.c(b,d);this.c(b+1&15,e)}},function(a,b){if(a=(this.a<<14>>14)%72){var c=this.b(b),d=this.b(b+1&15),e=c;0>a&&(a=72+a);36>a?(c=c*Math.pow(2,a)%J+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%J+Math.trunc(e/Math.pow(2,36-a))):(c=d*Math.pow(2,a-36)%J+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%J+Math.trunc(d/Math.pow(2,72-a)));this.c(b,c);this.c(b+1&15,d)}},function(a,b){if(a=(this.a<<14>>14)%256){var c=this.b(b),d=this.b(b+1&15);0<
 a?36<=a?(c=72<=a?0:d*Math.pow(2,a-36)%J,d=0):(c=c*Math.pow(2,a)%J+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%J):-36>=a?(d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36)),c=0):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%J,c=Math.trunc(c/Math.pow(2,-a)));this.c(b,c);this.c(b+1&15,d)}},O,function(a,b){a=this.b(b);this.c(b,this.b(this.a));this.c(this.a,a)},function(a,b){a=!1;for(var c=this.b(b),d=c/E|0,c=c&C;!a;)this.c(c,this.b(d)),c==this.a&&(a=!0),d=d+1&C,c=c+1&C,this.i.B||(this.c(b,d*E+c),a||
-(this.f=(this.f+-1)%$a),a=!0)},function(a,b){a=(this.b(b)+262145)%J;this.c(b,a);a=G&&M(this,this.a)},function(a,b){b&1&&(this.g|=4096);if(b&2){var c=this.qa,c=c/E|0;this.g=this.g&-254049|c&254048;this.g|=c&4096;c&2048?this.g&4096||(this.g|=2048):this.g&=-2049}b&4&&N(this);b&8&&this.h(a);M(this,this.a)},function(a,b){a=b<<14;this.g&a&&(this.g&=~a,M(this,this.a))},function(){this.da=this.a},O,function(a){this.h(a)},function(a,b){a=
-this.b(b);a+=262145;this.c(a&C,this.b(this.a));a>=J&&(a-=J);a/E|0||(this.g|=262144);this.c(b,a)},function(a,b){a=this.b(b);var c=this.b(a&C);this.c(this.a,c);this.a==b&&(a=c);a-=262145;0>a&&(a+=J);(a/E|0)==C&&(this.g|=262144);this.c(b,a)},function(a){this.h(a)},function(){this.c(this.a,(this.g&C)*E+this.f);this.g&=-8193;M(this,this.a+1)},function(a,b){this.c(b,(this.g&C)*E+this.f);this.g&=-8193;M(this,this.a)},function(a,b){this.c(this.a,this.b(b));this.c(b,this.a*E+this.f);M(this,this.a+1)},function(a,
-b){a=this.b(b);this.c(b,this.b(a/E|0));M(this,this.a)},function(a,b){this.c(b,R.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(b,R.call(this,this.b(b),this.a))},function(a,b){this.c(this.a,R.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(this.a,this.c(b,R.call(this,this.b(b),this.b(this.a))))},function(a,b){this.c(b,Wc.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(b,Wc.call(this,this.b(b),this.a))},function(a,b){this.c(this.a,Wc.call(this,this.b(b),this.b(this.a)))},
+(this.f=(this.f+-1)%$a),a=!0)},function(a,b){a=(this.b(b)+262145)%J;this.c(b,a);a=G&&M(this,this.a)},function(a,b){b&1&&(this.g|=4096);if(b&2){var c=this.qa/E|0;this.g=this.g&-254049|c&254048;this.g|=c&4096;c&2048?this.g&4096||(this.g|=2048):this.g&=-2049}b&4&&N(this);b&8&&this.h(a);M(this,this.a)},function(a,b){a=b<<14;this.g&a&&(this.g&=~a,M(this,this.a))},function(){this.da=this.a},O,function(a){this.h(a)},function(a,b){a=this.b(b);
+a+=262145;this.c(a&C,this.b(this.a));a>=J&&(a-=J);a/E|0||(this.g|=262144);this.c(b,a)},function(a,b){a=this.b(b);var c=this.b(a&C);this.c(this.a,c);this.a==b&&(a=c);a-=262145;0>a&&(a+=J);(a/E|0)==C&&(this.g|=262144);this.c(b,a)},function(a){this.h(a)},function(){this.c(this.a,(this.g&C)*E+this.f);this.g&=-8193;M(this,this.a+1)},function(a,b){this.c(b,(this.g&C)*E+this.f);this.g&=-8193;M(this,this.a)},function(a,b){this.c(this.a,this.b(b));this.c(b,this.a*E+this.f);M(this,this.a+1)},function(a,b){a=
+this.b(b);this.c(b,this.b(a/E|0));M(this,this.a)},function(a,b){this.c(b,R.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(b,R.call(this,this.b(b),this.a))},function(a,b){this.c(this.a,R.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(this.a,this.c(b,R.call(this,this.b(b),this.b(this.a))))},function(a,b){this.c(b,Wc.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(b,Wc.call(this,this.b(b),this.a))},function(a,b){this.c(this.a,Wc.call(this,this.b(b),this.b(this.a)))},
 function(a,b){this.c(this.a,this.c(b,Wc.call(this,this.b(b),this.b(this.a))))},Mc,function(a,b){0>V(this.b(b),this.a)&&M(this,this.f+1)},function(a,b){V(this.b(b),this.a)||M(this,this.f+1)},function(a,b){0>=V(this.b(b),this.a)&&M(this,this.f+1)},function(){M(this,this.f+1)},function(a,b){0<=V(this.b(b),this.a)&&M(this,this.f+1)},function(a,b){V(this.b(b),this.a)&&M(this,this.f+1)},function(a,b){0V(this.b(b),this.b(this.a))&&M(this,this.f+
 1)},function(a,b){V(this.b(b),this.b(this.a))||M(this,this.f+1)},function(a,b){0>=V(this.b(b),this.b(this.a))&&M(this,this.f+1)},function(){M(this,this.f+1)},function(a,b){0<=V(this.b(b),this.b(this.a))&&M(this,this.f+1)},function(a,b){V(this.b(b),this.b(this.a))&&M(this,this.f+1)},function(a,b){0X(this.b(b))&&M(this,this.a)},function(a,b){X(this.b(b))||M(this,this.a)},function(a,b){0>=X(this.b(b))&&M(this,this.a)},function(){M(this,
 this.a)},function(a,b){0<=X(this.b(b))&&M(this,this.a)},function(a,b){X(this.b(b))&&M(this,this.a)},function(a,b){0X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.b(this.a);X(a)||M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.b(this.a);0>=X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){M(this,this.f+1);b&&this.c(b,this.b(this.a))},function(a,b){a=this.b(this.a);0<=X(a)&&