From a7a44a828801ba27e7b23dc522984057a053201e Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 4 Nov 2016 13:35:20 -0700 Subject: [PATCH] Cleaned up the PDP-11 updateDisplay(s) code, and removed the update hack inside the WAIT instruction; display updates now occur in sync with the machine's 60Hz clock --- modules/pdp11/lib/computer.js | 42 +-- modules/pdp11/lib/cpu.js | 24 +- modules/pdp11/lib/cpuops.js | 12 +- modules/pdp11/lib/debugger.js | 38 +-- modules/pdp11/lib/defines.js | 2 +- modules/pdp11/lib/device.js | 4 +- modules/pdp11/lib/panel.js | 63 ++-- versions/pdpjs/1.30.3/pdp11-dbg.js | 492 ++++++++++++++--------------- versions/pdpjs/1.30.3/pdp11.js | 268 ++++++++-------- 9 files changed, 485 insertions(+), 460 deletions(-) diff --git a/modules/pdp11/lib/computer.js b/modules/pdp11/lib/computer.js index 4fe1afd01..3d983268f 100644 --- a/modules/pdp11/lib/computer.js +++ b/modules/pdp11/lib/computer.js @@ -744,7 +744,7 @@ ComputerPDP11.prototype.donePowerOn = function(aParms) * TODO: Do we not care about the return value here? (ie, is checking fRestoreError sufficient)? */ this.powerRestore(this.cpu, stateComputer, fRepower, fRestore); - this.updateStatus(); + this.updateDisplays(); this.cpu.autoStart(); } @@ -958,7 +958,7 @@ ComputerPDP11.prototype.powerOff = function(fSave, fShutdown) * * Ditto for the CPU, in part because if the Front Panel resets before the CPU, it will end up * snapping/displaying the PC as of the last instruction executed, before the CPU resets the PC, - * causing the Front Panel to display a stale address when we call updateStatus() at the end. + * causing the Front Panel to display a stale address when we call updateDisplays() at the end. * * @this {ComputerPDP11} */ @@ -980,7 +980,7 @@ ComputerPDP11.prototype.reset = function() component.reset(); } } - this.updateStatus(true); + this.updateDisplays(-1); }; /** @@ -1005,7 +1005,7 @@ ComputerPDP11.prototype.start = function(ms, nCycles) component.start(ms, nCycles); } } - this.updateStatus(true); + this.updateDisplays(-1); }; /** @@ -1030,19 +1030,20 @@ ComputerPDP11.prototype.stop = function(ms, nCycles) component.stop(ms, nCycles); } } - this.updateStatus(true); + this.updateDisplays(-1); }; /** - * updateStatus(fForce) + * updateDisplays(nUpdate) * - * TODO: Notify all (other) components with an updateStatus() method that the computer's state has changed. + * TODO: Notify all components with an updateDisplay() method that the computer's state has changed (not + * just the hard-coded ones below). * - * If any DOM controls were bound to the CPU, then we need to call its updateStatus() handler; if there are no - * such bindings, then cpu.updateStatus() does nothing. + * If any DOM controls were bound to the CPU, then we need to call its updateDisplay() handler; if there are no + * such bindings, then cpu.updateDisplay() does nothing. * - * Similarly, if there's a Panel, then we need to call its updateStatus() handler, in case it created its own canvas - * and implemented its own register display (eg, dumpRegisters()); if not, then panel.updateStatus() also does nothing. + * Similarly, if there's a Panel, then we need to call its updateDisplay() handler, in case it created its own canvas + * and implemented its own register display (eg, dumpRegisters()); if not, then panel.updateDisplay() also does nothing. * * In practice, there will *either* be a Panel with a custom canvas *or* a set of DOM controls bound to the CPU *or* * neither. In theory, there could be BOTH, but that would be unusual. @@ -1054,21 +1055,20 @@ ComputerPDP11.prototype.stop = function(ms, nCycles) * Panel. * * @this {ComputerPDP11} - * @param {boolean} [fForce] (true will display registers even if the CPU is running and "live" registers are not enabled) - */ -ComputerPDP11.prototype.updateStatus = function(fForce) + * @param {number} [nUpdate] (1 for periodic, -1 for forced, 0 or undefined otherwise) + */ +ComputerPDP11.prototype.updateDisplays = function(nUpdate) { /* - * fForce is generally set to true whenever the CPU is transitioning to/from a running state, in which case - * cpu.updateStatus() will definitely want to hide/show register contents; however, at other times, when the + * nUpdate is generally set to -1 whenever the CPU is transitioning to/from a running state, in which case + * cpu.updateDisplay() will definitely want to hide/show register contents; however, at other times, when the * CPU is running, constantly updating the DOM controls too frequently can adversely impact overall performance. * - * So fForce serves as a hint to help cpu.updateStatus() make a more informed decision. panel.updateStatus() - * currently doesn't care, on the theory that canvas updates should be significantly faster than DOM updates, - * but we still pass fForce on. + * nUpdate will also be -1 whenever the Debugger has modified the state of the machine, implying that we're + * not sure what, if anything, actually changed. */ - if (this.cpu) this.cpu.updateStatus(fForce); - if (this.panel) this.panel.updateStatus(fForce); + if (this.cpu) this.cpu.updateDisplay(nUpdate); + if (this.panel) this.panel.updateDisplay(nUpdate); }; /** diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index e5e1dffc8..aa09ba5ab 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -505,26 +505,28 @@ CPUPDP11.prototype.setBinding = function(sType, sBinding, control, sValue) }; /** - * updateComputer(fForce) + * updateDisplays(nUpdate) + * + * Simpler wrapper around the Computer's updateDisplays() method. * * @this {CPUPDP11} - * @param {boolean} [fForce] + * @param {number} [nUpdate] (1 for periodic, -1 for forced, 0 or undefined otherwise) */ -CPUPDP11.prototype.updateComputer = function(fForce) +CPUPDP11.prototype.updateDisplays = function(nUpdate) { - if (this.cmp) this.cmp.updateStatus(fForce); + if (this.cmp) this.cmp.updateDisplays(nUpdate); }; /** - * updateStatus(fForce) + * updateDisplay(nUpdate) * - * Some of the CPU bindings provide feedback and therefore need to be updated periodically. This is called - * via the Computer's updateStatus() handler several times per second; see YIELDS_PER_STATUS. + * Some of the CPU bindings provide feedback and therefore need to be updated periodically. + * However, this should be called via the Computer's updateDisplays() interface, not directly. * * @this {CPUPDP11} - * @param {boolean} [fForce] + * @param {number} [nUpdate] (1 for periodic, -1 for forced, 0 or undefined otherwise) */ -CPUPDP11.prototype.updateStatus = function(fForce) +CPUPDP11.prototype.updateDisplay = function(nUpdate) { var controlSpeed = this.bindings["speed"]; if (controlSpeed) controlSpeed.textContent = this.getSpeedCurrent(); @@ -1101,7 +1103,7 @@ CPUPDP11.prototype.runCPU = function() if (this.nCyclesNextYield <= 0) { this.nCyclesNextYield += this.nCyclesPerYield; if (++this.nYieldsSinceStatusUpdate >= CPUPDP11.YIELDS_PER_STATUS) { - this.updateComputer(); + this.updateDisplays(); this.nYieldsSinceStatusUpdate = 0; } break; @@ -1216,7 +1218,7 @@ CPUPDP11.prototype.yieldCPU = function() * odd for those messages to show CPU state changes if the Control Panel, Video display, etc, does not, * so I've added this call to try to keep things looking synchronized. */ - this.updateComputer(); + this.updateDisplays(); }; if (NODE) module.exports = CPUPDP11; diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 960be5b01..53e732724 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -1754,13 +1754,13 @@ PDP11.opWAIT = function(opCode) * NOTE: It's almost always a bad idea to add more checks to the inner stepCPU() loop, because every additional * check can have a measurable (negative) impact on performance. Which is why it's important to use opFlags bits * whenever possible, since we can test for multiple (up to 32) exceptional conditions with a single check. + * + * Finally, we used to update the machine's displays whenever transitioning to the WAIT state. However, + * it makes more sense to decouple display updates from specific instructions and rely on timers instead; + * the PDP-11 KW11 (60Hz Line Clock) timer is the perfect candidate. See device.js. + * + * if (!(this.opFlags & PDP11.OPFLAG.WAIT) && this.cmp) this.cmp.updateDisplays(); */ - if (!(this.opFlags & PDP11.OPFLAG.WAIT)) { - /* - * Since here we're actually transitioning to WAIT, let's update the Panel's LEDs (well, OK, among other things). - */ - if (this.cmp) this.cmp.updateStatus(); - } this.opFlags |= PDP11.OPFLAG.WAIT; this.advancePC(-2); this.nStepCycles -= 3; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 0def5db5c..c6447a1af 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -464,8 +464,8 @@ if (DEBUGGER) { DebuggerPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) { this.bus = bus; - this.cpu = cpu; this.cmp = cmp; + this.cpu = cpu; this.panel = cmp.panel; /* @@ -677,7 +677,7 @@ if (DEBUGGER) { this.cpu.setByteDirect(addr, b); } if (inc) this.incAddr(dbgAddr, inc); - this.cmp.updateStatus(true); // force a computer status update if, say, video memory was the target + this.cmp.updateDisplays(-1); } }; @@ -699,7 +699,7 @@ if (DEBUGGER) { this.cpu.setWordDirect(addr, w); } if (inc) this.incAddr(dbgAddr, inc); - this.cmp.updateStatus(true); // force a computer status update if, say, video memory was the target + this.cmp.updateDisplays(-1); } }; @@ -1313,15 +1313,15 @@ if (DEBUGGER) { }; /** - * stepCPU(nCycles, fRegs, fUpdateStatus) + * stepCPU(nCycles, fRegs, fUpdateDisplays) * * @this {DebuggerPDP11} * @param {number} nCycles (0 for one instruction without checking breakpoints) * @param {boolean} [fRegs] is true to display registers after step (default is false) - * @param {boolean} [fUpdateStatus] is false to disable Computer status updates (default is true) + * @param {boolean} [fUpdateDisplays] is false to disable Computer display updates (default is true) * @return {boolean} */ - DebuggerPDP11.prototype.stepCPU = function(nCycles, fRegs, fUpdateStatus) + DebuggerPDP11.prototype.stepCPU = function(nCycles, fRegs, fUpdateDisplays) { if (!this.checkCPU()) return false; @@ -1363,15 +1363,11 @@ if (DEBUGGER) { /* * Because we called cpu.stepCPU() and not cpu.startCPU(), we must nudge the Computer's update code, - * and then update our own state. Normally, the only time fUpdateStatus will be false is when doTrace() - * is calling us in a loop, in which case it will perform its own updateStatus() when it's done. + * and then update our own state. Normally, the only time fUpdateDisplays will be false is when doTrace() + * is calling us in a loop, in which case it will perform its own updateDisplays() when it's done. */ - if (fUpdateStatus !== false) { - /* - * Make an effort to keep any Front Panel in sync with us. - */ - if (this.panel && this.panel.stop) this.panel.stop(); - this.cmp.updateStatus(); + if (fUpdateDisplays !== false) { + this.cmp.updateDisplays(-1); } this.updateStatus(fRegs || false); @@ -2729,7 +2725,7 @@ if (DEBUGGER) { if (asArgs[2] === undefined) { this.println("begin assemble at " + this.toStrAddr(dbgAddr)); this.fAssemble = true; - this.cmp.updateStatus(); + this.cmp.updateDisplays(); return; } @@ -3438,7 +3434,7 @@ if (DEBUGGER) { this.println("unknown register: " + sReg); return; } - this.cmp.updateStatus(); + this.cmp.updateDisplays(); this.println("updated registers:"); } @@ -3682,13 +3678,13 @@ if (DEBUGGER) { }, function onCountStepComplete() { /* - * We explicitly called stepCPU() with fUpdateStatus === false, because repeatedly - * calling updateStatus() can be very slow, especially if a Control Panel is present - * with displayLiveRegs enabled, so once the repeat count has been exhausted, we must - * perform a final updateStatus(). + * We explicitly called stepCPU() with fUpdateDisplays set to false, because repeatedly + * calling updateDisplays() can be very slow, especially if a Control Panel is present with + * displayLiveRegs enabled, so once the repeat count has been exhausted, we must perform + * a final updateDisplays(). */ if (dbg.panel && dbg.panel.stop) dbg.panel.stop(); - dbg.cmp.updateStatus(); + dbg.cmp.updateDisplays(); dbg.setBusy(false); } ); diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index ec6e1895e..5822957da 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -569,7 +569,7 @@ var PDP11 = { DATA: 0x00FF // Transmitted Data (W/O) TODO: Determine why pdp11.js effectively defined this as 0x7F } }, - KW11: { // KW11-L Line Time Clock + KW11: { // KW11-L Line Time Clock (60Hz; well, OK, or 50Hz, if you're in the UK, I suppose...) PRI: 6, VEC: 0o100, DELAY: 0, diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 6286eedd6..a54bed8e1 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -60,7 +60,7 @@ function DevicePDP11(parmsDevice) { Component.call(this, "Device", parmsDevice, DevicePDP11, MessagesPDP11.DEVICE); - this.kw11 = { // LW11 registers + this.kw11 = { // KW11 registers csr: 0, timer: -1 // initBus() will initialize this timer ID }; @@ -115,6 +115,7 @@ DevicePDP11.M9312 = [ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg) { this.bus = bus; + this.cmp = cmp; this.cpu = cpu; this.dbg = dbg; @@ -153,6 +154,7 @@ DevicePDP11.prototype.kw11_interrupt = function() this.cpu.setTrigger(this.kw11.trigger); this.cpu.setTimer(this.kw11.timer, 1000/60); } + if (this.cmp) this.cmp.updateDisplays(1); }; /** diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index edf37292a..fafecc456 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -60,6 +60,8 @@ function PanelPDP11(parmsPanel) * TODO: Add some UI for fDisplayLiveRegs (either an XML property, or a UI checkbox, or both). */ this.cLiveRegs = 0; + this.nPeriodicCount = 0; + this.nPeriodicLimit = 60; this.fDisplayLiveRegs = true; /* @@ -672,14 +674,14 @@ PanelPDP11.prototype.processContinue = function(value, index) this.stop(); /* - * Going through the normal channels (ie, the Computer's updateStatus() interface) ensures that ALL - * updateStatus() handlers will be called, including ours. + * Going through the normal channels (ie, the Computer's updateDisplays() interface) ensures that + * ALL updateDisplay() handlers will be called, including ours. * - * NOTE: If we used the Debugger's stepCPU() function, then that includes a call to updateStatus(); + * NOTE: If we used the Debugger's stepCPU() function, then that includes a call to updateDisplay(); * unfortunately, it will have happened BEFORE we called stop() to update the 'ADDRESS' register, so * we still need to call it again. */ - if (this.cmp) this.cmp.updateStatus(); + if (this.cmp) this.cmp.updateDisplays(); } else { this.cpu.startCPU(); @@ -803,13 +805,26 @@ PanelPDP11.prototype.setAddr = function(value) /** * advanceAddr() * + * This should also take care of the following Front Panel behaviors when the accessing the general-purpose + * registers: + * + * 1) ADDRESS display incremented by 1 (instead of 2) + * 2) The STEP after the last register is 177700, such that the addresses are looped + * + * A third behavior is NOT emulated: preventing the ADDRESS from stepping to the first General Register (177700) + * from 177676. + * * @this {PanelPDP11} * @return {number} */ PanelPDP11.prototype.advanceAddr = function() { - var inc = this.getSwitch(PanelPDP11.SWITCH.STEP)? 2 : -2; - this.regAddr = (this.regAddr + inc) & this.bus.nBusMask; + var nRegs = this.cpu.model < PDP11.MODEL_1145? 8 : 16; + var fGenRegs = (this.regAddr >= PDP11.UNIBUS.R0SET0 /*177700*/ && this.regAddr < PDP11.UNIBUS.R0SET0 + nRegs); + var inc = fGenRegs? 1 : 2; + var mask = fGenRegs? 0xf : this.bus.nBusMask; + if (!this.getSwitch(PanelPDP11.SWITCH.STEP)) inc = -inc; + this.regAddr = (this.regAddr & ~mask) | ((this.regAddr + inc) & mask); this.setLEDArray("A", this.regAddr, 22); return this.regAddr; }; @@ -906,26 +921,36 @@ PanelPDP11.prototype.stop = function(ms, nCycles) }; /** - * updateStatus(fForce) + * updateDisplay(nUpdate) * - * Called by the Computer component at appropriate intervals to update any register displays, LEDs, etc. + * Called by the Computer component at intervals to update registers, LEDs, etc. * * @this {PanelPDP11} - * @param {boolean} [fForce] (true will display registers even if the CPU is running and "live" registers are not enabled) + * @param {number} [nUpdate] (< 0 for forced, > 0 for periodic, undefined otherwise) */ -PanelPDP11.prototype.updateStatus = function(fForce) +PanelPDP11.prototype.updateDisplay = function(nUpdate) { if (this.cLiveRegs) { - if (fForce || !this.cpu.isRunning() || this.fDisplayLiveRegs) { - for (var i = 0; i < this.cpu.regsGen.length; i++) { - this.displayValue('R'+i, this.cpu.regsGen[i]); + if (nUpdate < 0 || !this.cpu.isRunning() || this.fDisplayLiveRegs) { + /* + * We arbitrarily separate the display elements into two categories: cheap and expensive. + * + * LEDs are considered cheap, register displays are not. So we'll skip the latter if this + * is a periodic update AND our periodic update counter hasn't reached the periodic update limit. + */ + if (!(nUpdate > 0 && (this.nPeriodicCount += nUpdate) < this.nPeriodicLimit)) { + for (var i = 0; i < this.cpu.regsGen.length; i++) { + this.displayValue('R'+i, this.cpu.regsGen[i]); + } + var regPSW = this.cpu.getPSW(); + this.displayValue("PS", regPSW); + this.displayValue("NF", (regPSW & PDP11.PSW.NF)? 1 : 0, 1); + this.displayValue("ZF", (regPSW & PDP11.PSW.ZF)? 1 : 0, 1); + this.displayValue("VF", (regPSW & PDP11.PSW.VF)? 1 : 0, 1); + this.displayValue("CF", (regPSW & PDP11.PSW.CF)? 1 : 0, 1); + this.nPeriodicCount = 0; } - var regPSW = this.cpu.getPSW(); - this.displayValue("PS", regPSW); - this.displayValue("NF", (regPSW & PDP11.PSW.NF)? 1 : 0, 1); - this.displayValue("ZF", (regPSW & PDP11.PSW.ZF)? 1 : 0, 1); - this.displayValue("VF", (regPSW & PDP11.PSW.VF)? 1 : 0, 1); - this.displayValue("CF", (regPSW & PDP11.PSW.CF)? 1 : 0, 1); + this.setLEDArray("D", this.regData, 16); this.setLEDArray("A", this.regAddr, 22); /* diff --git a/versions/pdpjs/1.30.3/pdp11-dbg.js b/versions/pdpjs/1.30.3/pdp11-dbg.js index 27b43d075..4c459ac95 100644 --- a/versions/pdpjs/1.30.3/pdp11-dbg.js +++ b/versions/pdpjs/1.30.3/pdp11-dbg.js @@ -40,54 +40,53 @@ function xa(a,b){return(a+" ").slice(0,b) function Aa(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 Ea(a,b,c,d){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 l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}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 Fa(a,b){var c,d={ea:null,ia:null,La:null,Ka: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.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ia=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.La=g.load;d.Ka=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.data)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 d.da=g;d.ha=g.symbols;d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.lb=this.id:(this.Qa=this.id.substr(0,b),this.lb=this.id.substr(b+1));this[a]=c;this.B={ready:!1,$a:!1,ac:!1,ja:!1,error:!1};this.Sb=null;this.B.error=!1;this.G={};this.i=null;this.oa=d||0;v.push(this)}var ab=void 0,bb={}; +function u(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.qc=b.comment;this.Sc=b;b=this.id.indexOf(".");0>b?this.lb=this.id:(this.Qa=this.id.substr(0,b),this.lb=this.id.substr(b+1));this[a]=c;this.A={ready:!1,$a:!1,ac:!1,ia:!1,error:!1};this.Sb=null;this.A.error=!1;this.G={};this.i=null;this.na=d||0;v.push(this)}var ab=void 0,bb={}; if(window){ab||(ab=window.location.search.substr(1));for(var cb,db=/\+/g,eb=/([^&=]+)=?([^&]*)/g;cb=eb.exec(ab);)bb[decodeURIComponent(cb[1].replace(db," "))]=decodeURIComponent(cb[2].replace(db," "))}function lb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function z(a,b){b||(b=u);a.prototype=lb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var mb=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else mb={},v=[];function nb(a,b,c){mb[a]&&b&&(mb[a][b]=c)}function ob(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.g["S"+a]=[0,!1,!1,this.dd,a]}z(yb);var zb=7;function Ab(a,b){return a.g[b]&&a.g[b][0]}k=yb.prototype;k.reset=function(){this.stop()}; -k.ta=function(a,b,c,d){if(this.A&&this.A.ta(a,b,c,d)||this.b&&this.b.ta(a,b,c,d)||this.i&&this.i.ta(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.C[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c= -a.g[b];Bb(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);"STEP"!=b&&(a.J="DEP"==b,a.K="EXAM"==b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.g[b];c[1]&&c[2]&&(Bb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.ta.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;Cb(b,this,Db);Eb(b,this.reset.bind(this));Fb(this);Gb(this)};k.Ha=function(a,b){b||(Hb(),this.reset());return!0};k.Ga=function(){return!0}; -function Ib(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Fb(a,b){for(var c in a.C)Ib(a,c,null!=b?b:a.C[c])}function Bb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Gb(a){for(var b in a.g)Bb(a,b,a.g[b][0])}function Xb(a,b,c,d){a.G[b]&&(void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ha()),c=8==(a.i&&a.i.da||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} -k.bd=function(a){a||this.b.B.Z||(this.w.reset(),Yb(this.b),Ab(this,"ENABLE")&&this.b.ib())};k.cd=function(){};k.Yc=function(a){a||this.b.ha()};k.Wc=function(a){if(!a&&!this.b.B.Z)if(Ab(this,"ENABLE"))this.b.ib();else{if((a=this.i)&&!sb(a,!0))rb(a,!0),a.jb(0),rb(a,!1);else try{var b=this.b.jb(1);0c;c++)a.g["S"+c][0]=b&1<>2;this.w=this.ya-1;this.D=this.H/this.ya|0;this.Za=[];this.ma=0;this.f=!1;this.C=[];this.Ic=[lc,mc,nc,oc];a=new I(this);pc(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Za[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.ma);return c} -function mc(a,b,c){var d=!1,e=this.controller,f=e.Za[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Za[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Da(c,16,5),this.i&&F(this.i,f[5])&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!e.ma))} -function nc(a,b){var c=-1,d=this.controller;(a=d.Za[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.ma);return c} -function oc(a,b,c){var d=!1,e=this.controller;if(a=e.Za[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Da(c,16,4),this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.ma))} -function rc(a,b){if(b!=a.A){var c;a.A&&(c=(1<>>a.la;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Mb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Mb){n=l.size-(f-m);n>g&&(n=g);l.Mb=f-l.F+n;f=m+a.ya;g-=n;h++;continue}}return wc(1,f,g)}f=new I(a,f,n,a.ya,d,e);pc(f,a.i,l);a.W[h++]=f;f=m+a.ya;g-=n}if(0>=g){c/=1024;var r;e="";r?10>>=a.la;0>>=a.la;0>>this.la].Wb(a&this.w,a)};k.Ub=function(a){3932160<=a&&(a=yc(this.b,a));this.f=!1;this.ma++;a=this.W[(a&this.Fa)>>>this.la].gc(a&this.w,a);this.ma--;return a}; -k.pa=function(a){3932160<=a&&(a=yc(this.b,a));return this.W[(a&this.Fa)>>>this.la].sa(a&this.w,a)};k.ab=function(a){3932160<=a&&(a=yc(this.b,a));var b=a&this.w,c=(a&this.Fa)>>>this.la;this.f=!1;this.ma++;a=this.W[c].hc(b,a);this.ma--;return a};k.Xb=function(a,b){3932160<=a&&(a=yc(this.b,a));this.W[(a&this.Fa)>>>this.la].Zb(a&this.w,b&255,a)};k.qb=function(a,b){3932160<=a&&(a=yc(this.b,a));this.f=!1;this.ma++;this.W[(a&this.Fa)>>>this.la].$b(a&this.w,b&255,a);this.ma--}; -k.hb=function(a,b){3932160<=a&&(a=yc(this.b,a));this.W[(a&this.Fa)>>>this.la].Nb(a&this.w,b&65535,a)};k.Db=function(a,b){3932160<=a&&(a=yc(this.b,a));var c=a&this.w,d=(a&this.Fa)>>>this.la;this.f=!1;this.ma++;this.W[d].lc(c,b&65535,a);this.ma--}; -function zc(a){for(var b=0,c=[],d=0;da.b.xb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null,r=g[5]||1;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=g[4],w=0;w>5&3;b.Na=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Oc(b))}};k.qd=function(){var a=this.b.eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.rd=function(){return this.b.Kb};k.sd=function(){return this.b.pb};k.je=function(a){var b=this.b;1170>b.xb&&(a&=-49);b.pb!=a&&(b.pb=a,b.Rb=a&16?4194303:262143,Oc(b))};k.Sd=function(a){a=a>>1&63;var b=this.b.Lb[a>>1];return a&1?b>>16:b&65535}; +function yb(a){u.call(this,"Panel",a,yb);this.f=this.v=this.Va=this.J=this.D=0;this.K=this.L=this.H=!1;this.M=zb;this.C={};this.g={START:[1,!0,!1,this.bd],STEP:[1,!1,!1,this.cd],ENABLE:[1,!1,!1,this.Yc],CONT:[1,!0,!1,this.Wc],DEP:[0,!0,!1,this.Xc],EXAM:[1,!0,!1,this.Zc],LOAD:[1,!0,!1,this.ad],TEST:[0,!0,!1,this.$c]};for(a=0;22>a;a++)this.g["S"+a]=[0,!1,!1,this.dd,a]}z(yb);var zb=7;function Ab(a,b){return a.g[b]&&a.g[b][0]}k=yb.prototype;k.reset=function(){this.stop()}; +k.ta=function(a,b,c,d){if(this.B&&this.B.ta(a,b,c,d)||this.b&&this.b.ta(a,b,c,d)||this.i&&this.i.ta(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.C[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c= +a.g[b];Bb(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);"STEP"!=b&&(a.K="DEP"==b,a.L="EXAM"==b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.g[b];c[1]&&c[2]&&(Bb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.ta.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;Cb(b,this,Db);Eb(b,this.reset.bind(this));Fb(this);Gb(this)};k.Ha=function(a,b){b||(Hb(),this.reset());return!0};k.Ga=function(){return!0}; +function Ib(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Fb(a,b){for(var c in a.C)Ib(a,c,null!=b?b:a.C[c])}function Bb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Gb(a){for(var b in a.g)Bb(a,b,a.g[b][0])}function Jb(a,b,c,d){a.G[b]&&(void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ga()),c=8==(a.i&&a.i.ca||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} +k.bd=function(a){a||this.b.A.Z||(this.w.reset(),Yb(this.b),Ab(this,"ENABLE")&&this.b.ib())};k.cd=function(){};k.Yc=function(a){a||this.b.ga()};k.Wc=function(a){if(!a&&!this.b.A.Z)if(Ab(this,"ENABLE"))this.b.ib();else{if((a=this.i)&&!sb(a,!0))rb(a,!0),a.jb(0),rb(a,!1);else try{var b=this.b.jb(1);0a.b.pb?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.w.Fa;Ab(a,"STEP")||(b=-b);a.f=a.f&~c|a.f+b&c;dc(a,"A",a.f,22)}function cc(a,b){a.v=b&65535;dc(a,"D",a.v,16);return a.v}function fc(a,b,c){a.C[b]=c;a.H||Ib(a,b,c)}function dc(a,b,c,d){for(var e=0;ec;c++)a.g["S"+c][0]=b&1<>2;this.w=this.ya-1;this.D=this.H/this.ya|0;this.Za=[];this.la=0;this.f=!1;this.C=[];this.Ic=[kc,lc,mc,nc];a=new I(this);oc(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Za[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} +function lc(a,b,c){var d=!1,e=this.controller,f=e.Za[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Za[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,5),this.i&&F(this.i,f[5])&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} +function mc(a,b){var c=-1,d=this.controller;(a=d.Za[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} +function nc(a,b,c){var d=!1,e=this.controller;if(a=e.Za[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,4),this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} +function qc(a,b){if(b!=a.B){var c;a.B&&(c=(1<>>a.ka;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Mb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Mb){n=l.size-(f-m);n>g&&(n=g);l.Mb=f-l.F+n;f=m+a.ya;g-=n;h++;continue}}return vc(1,f,g)}f=new I(a,f,n,a.ya,d,e);oc(f,a.i,l);a.W[h++]=f;f=m+a.ya;g-=n}if(0>=g){c/=1024;var r;e="";r?10>>=a.ka;0>>=a.ka;0>>this.ka].Wb(a&this.w,a)};k.Ub=function(a){3932160<=a&&(a=xc(this.b,a));this.f=!1;this.la++;a=this.W[(a&this.Fa)>>>this.ka].gc(a&this.w,a);this.la--;return a}; +k.oa=function(a){3932160<=a&&(a=xc(this.b,a));return this.W[(a&this.Fa)>>>this.ka].sa(a&this.w,a)};k.ab=function(a){3932160<=a&&(a=xc(this.b,a));var b=a&this.w,c=(a&this.Fa)>>>this.ka;this.f=!1;this.la++;a=this.W[c].hc(b,a);this.la--;return a};k.Xb=function(a,b){3932160<=a&&(a=xc(this.b,a));this.W[(a&this.Fa)>>>this.ka].Zb(a&this.w,b&255,a)};k.rb=function(a,b){3932160<=a&&(a=xc(this.b,a));this.f=!1;this.la++;this.W[(a&this.Fa)>>>this.ka].$b(a&this.w,b&255,a);this.la--}; +k.hb=function(a,b){3932160<=a&&(a=xc(this.b,a));this.W[(a&this.Fa)>>>this.ka].Nb(a&this.w,b&65535,a)};k.Db=function(a,b){3932160<=a&&(a=xc(this.b,a));var c=a&this.w,d=(a&this.Fa)>>>this.ka;this.f=!1;this.la++;this.W[d].lc(c,b&65535,a);this.la--}; +function yc(a){for(var b=0,c=[],d=0;da.b.pb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null,r=g[5]||1;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=g[4],w=0;w>5&3;b.Na=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Nc(b))}};k.qd=function(){var a=this.b.eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.rd=function(){return this.b.Kb};k.sd=function(){return this.b.qb};k.je=function(a){var b=this.b;1170>b.pb&&(a&=-49);b.qb!=a&&(b.qb=a,b.Rb=a&16?4194303:262143,Nc(b))};k.Sd=function(a){a=a>>1&63;var b=this.b.Lb[a>>1];return a&1?b>>16:b&65535}; k.Je=function(a,b){b=b>>1&63;var c=b>>1;this.b.Lb[c]=b&1?this.b.Lb[c]&65535|(a&63)<<16:this.b.Lb[c]&-65536|a&65534};k.Ld=function(a){return this.b.V[1][a>>1&7]};k.Ce=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Jd=function(a){return this.b.V[1][(a>>1&7)+8]};k.Ae=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Kd=function(a){return this.b.xa[1][a>>1&7]};k.Be=function(a,b){b=b>>1&7;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.Id=function(a){return this.b.xa[1][(a>>1&7)+8]}; k.ze=function(a,b){b=(b>>1&7)+8;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.md=function(a){return this.b.V[0][a>>1&7]};k.fe=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.kd=function(a){return this.b.V[0][(a>>1&7)+8]};k.de=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.ld=function(a){return this.b.xa[0][a>>1&7]};k.ee=function(a,b){b=b>>1&7;this.b.xa[0][b]=a;this.b.V[0][b]&=65295};k.jd=function(a){return this.b.xa[0][(a>>1&7)+8]};k.ce=function(a,b){b=(b>>1&7)+8;this.b.xa[0][b]=a;this.b.V[0][b]&=65295}; -k.Rd=function(a){return this.b.V[3][a>>1&7]};k.Ie=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Pd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ge=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Qd=function(a){return this.b.xa[3][a>>1&7]};k.He=function(a,b){b=b>>1&7;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Od=function(a){return this.b.xa[3][(a>>1&7)+8]};k.Fe=function(a,b){b=(b>>1&7)+8;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Bb=function(a){a&=7;return this.b.M&2048?this.b.Wa[a]:this.b.u[a]}; -k.Eb=function(a,b){b&=7;this.b.M&2048?this.b.Wa[b]=a:this.b.u[b]=a};k.xd=function(){return this.b.M&49152?this.b.Ia[0]:this.b.u[6]};k.oe=function(a){this.b.M&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Ad=function(){return this.b.u[7]};k.re=function(a){this.b.u[7]=a};k.Cb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Wa[a]};k.Fb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Wa[b]=a};k.yd=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ia[1]}; -k.pe=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.zd=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.qe=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.gd=function(a){return this.b.Bc[a-65504>>1]};k.ae=function(a,b){this.b.Bc[b-65504>>1]=a};k.yc=function(a){return 65520==a?61183:0};k.Fc=function(){};k.Nd=function(){return 1};k.Ee=function(){};k.fd=function(){return this.b.ga};k.$d=function(){this.b.ga=0};k.od=function(){return this.b.Ac}; -k.he=function(a,b){b&1||(a&=255);this.b.Ac=a};k.td=function(a){return a?this.b.jc:0};k.ke=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.jc=a;b.I|=2};k.Md=function(a){return a?this.b.fb&65280:0};k.De=function(a){this.b.fb=a|255};k.wd=function(){return hc(this.b)};k.ne=function(a){Pc(this.b,a&-1809|hc(this.b)&1808);this.b.I|=128};k.Ec=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; +k.Rd=function(a){return this.b.V[3][a>>1&7]};k.Ie=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Pd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ge=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Qd=function(a){return this.b.xa[3][a>>1&7]};k.He=function(a,b){b=b>>1&7;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Od=function(a){return this.b.xa[3][(a>>1&7)+8]};k.Fe=function(a,b){b=(b>>1&7)+8;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Bb=function(a){a&=7;return this.b.N&2048?this.b.Wa[a]:this.b.u[a]}; +k.Eb=function(a,b){b&=7;this.b.N&2048?this.b.Wa[b]=a:this.b.u[b]=a};k.xd=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.oe=function(a){this.b.N&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Ad=function(){return this.b.u[7]};k.re=function(a){this.b.u[7]=a};k.Cb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Wa[a]};k.Fb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Wa[b]=a};k.yd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]}; +k.pe=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.zd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.qe=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.gd=function(a){return this.b.Bc[a-65504>>1]};k.ae=function(a,b){this.b.Bc[b-65504>>1]=a};k.yc=function(a){return 65520==a?61183:0};k.Fc=function(){};k.Nd=function(){return 1};k.Ee=function(){};k.fd=function(){return this.b.fa};k.$d=function(){this.b.fa=0};k.od=function(){return this.b.Ac}; +k.he=function(a,b){b&1||(a&=255);this.b.Ac=a};k.td=function(a){return a?this.b.jc:0};k.ke=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.jc=a;b.I|=2};k.Md=function(a){return a?this.b.fb&65280:0};k.De=function(a){this.b.fb=a|255};k.wd=function(){return Oc(this.b)};k.ne=function(a){Pc(this.b,a&-1809|Oc(this.b)&1808);this.b.I|=128};k.Ec=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; var M={},L=(M[61568]=[null,null,K.prototype.Sd,K.prototype.Je,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Ld,K.prototype.Ce,"SIPDR",8,1145],M[62608]=[null,null,K.prototype.Jd,K.prototype.Ae,"SDPDR",8,1145],M[62624]=[null,null,K.prototype.Kd,K.prototype.Be,"SIPAR",8,1145],M[62640]=[null,null,K.prototype.Id,K.prototype.ze,"SDPAR",8,1145],M[62656]=[null,null,K.prototype.md,K.prototype.fe,"KIPDR",8,1145],M[62672]=[null,null,K.prototype.kd,K.prototype.de,"KDPDR",8,1145],M[62688]=[null,null,K.prototype.ld, K.prototype.ee,"KIPAR",8,1145],M[62704]=[null,null,K.prototype.jd,K.prototype.ce,"KDPAR",8,1145],M[62798]=[null,null,K.prototype.sd,K.prototype.je,"MMR3",1,1145],M[65382]=[null,null,K.prototype.nd,K.prototype.ge,"LKS"],M[65402]=[null,null,K.prototype.pd,K.prototype.ie,"MMR0",1,1145],M[65404]=[null,null,K.prototype.qd,K.prototype.Ec,"MMR1",1,1145],M[65406]=[null,null,K.prototype.rd,K.prototype.Ec,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Rd,K.prototype.Ie,"UIPDR",8,1145],M[65424]=[null,null,K.prototype.Pd, K.prototype.Ge,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.Qd,K.prototype.He,"UIPAR",8,1145],M[65456]=[null,null,K.prototype.Od,K.prototype.Fe,"UDPAR",8,1145],M[65472]=[null,null,K.prototype.Bb,K.prototype.Eb,"R0SET0"],M[65473]=[null,null,K.prototype.Bb,K.prototype.Eb,"R1SET0"],M[65474]=[null,null,K.prototype.Bb,K.prototype.Eb,"R2SET0"],M[65475]=[null,null,K.prototype.Bb,K.prototype.Eb,"R3SET0"],M[65476]=[null,null,K.prototype.Bb,K.prototype.Eb,"R4SET0"],M[65477]=[null,null,K.prototype.Bb,K.prototype.Eb, @@ -95,224 +94,225 @@ K.prototype.Ge,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.Qd,K.prototype.He K.prototype.Fb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.yd,K.prototype.pe,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.zd,K.prototype.qe,"R6USER",1,1145],M[65504]=[null,null,K.prototype.gd,K.prototype.ae,"CTRL",1,1170],M[65520]=[null,null,K.prototype.yc,K.prototype.Fc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.yc,K.prototype.Fc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Nd,K.prototype.Ee,"SYSID",1,1170],M[65526]=[null,null,K.prototype.fd,K.prototype.$d,"CPUERR",1,1170],M[65528]= [null,null,K.prototype.od,K.prototype.he,"MB",1,1170],M[65530]=[null,null,K.prototype.td,K.prototype.ke,"PIR"],M[65532]=[null,null,K.prototype.Md,K.prototype.De,"SL"],M[65534]=[null,null,K.prototype.wd,K.prototype.ne,"PSW"],M);L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504]; Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,this.size>>2),Xc(this,Tc?Yc:Zc);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},da:function(a,b){a&1&&this.w.Da(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ -1]&255)<<8},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Sa=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;dd(c,this.F+a,1,c.N)&&c.ha(!0)}return this.gc(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;dd(c,this.F+a,2,c.N)&&c.ha(!0)}return this.hc(a,b)},na:function(a, -b,c){if(this.i&&null!=this.F){var d=this.i;dd(d,this.F+a,1,d.D)&&d.ha(!0)}this.f?this.v(a,b,c):this.$b(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;dd(d,this.F+a,2,d.D)&&d.ha(!0)}this.f?this.v(a,b,c):this.lc(a,b,c)},N:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Qa:function(a,b){a&1&&this.w.Da(b,64,2);return this.D.getUint16(a,!0)},aa:function(a,b){a&1&&this.w.Da(b,64,2); -a=this.J[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ka:function(a,b){this.G[a]=b;this.Sa=!0},ua:function(a,b,c){this.G[a]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},lb:function(a,b,c){a&1&&this.w.Da(c,64,4);this.D.setUint16(a,b,!0);this.Sa=!0},Ja:function(a,b,c){a&1&&this.w.Da(c,64,4);this.J[a>>1]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, -b)+")",!0)}};function pc(a,b,c){a.i=b;a.g=a.A=0;c&&((a.g=c.g)&&cd(a,bd,!1),(a.A=c.A)&&ad(a,bd,!1))}function ed(a,b){b?--a.A||(a.Zb=a.f?a.v:a.$b,a.Nb=a.f?a.H:a.lc):--a.g||(a.Wb=a.gc,a.sa=a.hc)}function ad(a,b,c){c&&a.A||(a.Zb=!a.f&&b[1]||a.v,a.Nb=!a.f&&b[3]||a.H);if(c||void 0===c)a.$b=b[1]||a.v,a.lc=b[3]||a.H}function cd(a,b,c){c&&a.g||(a.Wb=b[0]||a.K,a.sa=b[2]||a.L);if(c||void 0===c)a.gc=b[0]||a.K,a.hc=b[2]||a.L}function Xc(a,b){b||(b=fd);cd(a,b,void 0);ad(a,b,void 0)} -var fd=[],$c=[I.prototype.S,I.prototype.wa,I.prototype.da,I.prototype.Na],bd=[I.prototype.P,I.prototype.na,I.prototype.Y,I.prototype.Aa];if(wb)var Zc=[I.prototype.N,I.prototype.ka,I.prototype.Qa,I.prototype.lb],Yc=[I.prototype.R,I.prototype.ua,I.prototype.aa,I.prototype.Ja]; -function gd(a,b){u.call(this,"CPU",a,gd,1);var c=a.multiplier||1;this.mb=a.cycles||b;this.cb=c;this.ub=Math.round(this.mb/1E4)/100;this.ob=this.ub*this.cb;this.B.Z=!1;this.B.Yb=!1;this.B.tb=a.autoStart;this.B.wb=!1;this.Hb=this.na=0;this.Ib=a.csStart;this.yb=a.csInterval;this.zb=a.csStop;this.K=[];this.vc=this.Wd.bind(this);H(this)}z(gd);var hd=["power","reset"];k=gd.prototype; -k.Ea=function(a,b,c,d){this.A=a;this.w=b;this.i=d;for(b=0;b=a.na&&(a.na+=a.yb,c=!0);0<=a.zb&&a.zb<=md(a)&&(a.yb=a.zb=-1,kd(a),a.ha(),c=!0);c&&a.j(md(a)+" cycles: checksum="+p(a.Hb))}} -k.ta=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.B.ja)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;ca.Y/a.ob?b=1:d=!0;a.cb=b;b=a.ub*a.cb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.A&&a.A.rb()}$b(a,a.S);a.S=0;a.R=Ba();a.aa=0;od(a);return d}function Kc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Mc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.mb*a.cb/1E3*c|0,a.K[b][0]=c+pd(a))} -function qd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Zb(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function pd(a,b){var c=a.da-=a.b;a.b=a.J=0;b&&(a.da=0);return c} -k.Wd=function(){if(this.B.Z){this.vb>=this.mb&&od(this,!0);this.Aa=0;this.Ya=Ba();if(this.aa){var a=this.Ya-this.aa;a>this.Tb&&(this.R+=a,this.R>this.Ya&&(this.R=this.Ya))}try{do{var b=qd(this,this.B.wb?1:this.kb);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=pd(this,!0);this.Aa+=b;this.S+=b;ac(this,b);Zb(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.kb;15<=++this.Vb&&(this.A&&this.A.$(void 0),this.Vb=0);break}}while(this.B.Z)}catch(e){this.ha();this.A&&this.A.stop(Ba(),md(this));vb(this, -e.stack||e.message);return}if(this.B.Z){a=setTimeout;b=this.vc;this.aa=Ba();var c=this.Tb;this.Aa&&(c=Math.round(c*this.Aa/this.kb));var c=c-(this.aa-this.Ya),d=this.aa-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.ka=0,nd(this)));if(0>c||this.Yc&&(this.R-=c),c=0;this.vb+=this.Aa;this.aa+=c;a(b,c)}}}; -k.ib=function(a){if(ub(this))return!1;if(this.B.Z)return this.j(this.toString()+" busy"),!1;nd(this);this.B.Z=!0;this.B.Yb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.rb(!0),this.A.start(this.R,md(this)));setTimeout(this.vc,0);return!0};k.jb=function(){return 0};k.ha=function(a){var b=!1;if(this.B.Z){pd(this);$b(this,this.S);this.S=0;this.B.Z=!1;if(b=this.G.run)b.textContent="Run";this.A&&this.A.stop(Ba(),md(this));b=!0}this.B.complete=a;return b}; -function rd(a){this.xb=+a.model||1170;this.Ob=a.addrReset||0;gd.call(this,a,6666667);this.decode=1120==this.xb?sd.bind(this):td.bind(this);ud(this);this.L=0;this.N=null;this.B.complete=!1}z(rd,gd);k=rd.prototype;k.reset=function(){this.status("model "+this.xb);this.B.Z&&this.ha();ud(this);jd(this);this.B.error=!1;this.parent.reset.call(this)}; -function ud(a){a.T=65536;a.U=32768;a.ba=65535;a.X=32768;a.M=15;a.u=[0,0,0,0,0,0,0,a.Ob];a.Wa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.v=0;a.Na=0;a.Rc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.xa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Lb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0];a.Bc=[0,0,0,0,0,0,0,0];a.Ac=0;a.I=0;a.D=a.H=0;a.g=a.f=a.sb=0;a.wa=-1;Yb(a)}function Yb(a){a.fb=255;a.ga=0;a.jc=0;a.C=0;a.eb=0;a.Kb=0;a.pb=0;a.Ua=0;a.Ja=0;a.Rb=262143;a.N=null;a.w&&Oc(a)}function Oc(a){a.Ua?(a.P=65536,a.ca=a.Qc,a.sa=a.Td,a.Nb=a.Ke,rc(a.w,a.pb&16?22:18)):(a.P=0,a.ca=a.Pc,a.sa=a.zc,a.Nb=a.Gc,rc(a.w,16))}function vd(a,b,c){a.Ob=b;O(a,b);!c&&a.i&&(a.ha()||a.i.$())}k.sc=function(){return 0}; -k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ka,this.cb]);a.set(2,zc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ka=b[1];nd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.M>>14&3;a.v!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.v]);a.M=b;a.I|=2}function R(a,b){a.I&128||(a.X=a.ba=b,a.U=0)}function Bd(a,b,c){a.I&128||(a.X=a.ba=a.T=b,a.U=c||0)}function Cd(a,b,c,d){a.I&128||(a.X=a.ba=a.T=b,a.U=(c^b)&(d^b))} -function Dd(a,b){a.I&128||(a.X=a.ba=a.T=b,a.U=a.X^a.T>>1)}function Ed(a,b,c,d){a.I&128||(a.X=a.ba=a.T=b,a.U=(c^d)&(d^b))}k.qa=function(a,b){if(!this.L){var c=!1;0>this.wa?this.wa=hc(this):this.v||(a=4,c=!0);this.C&57344||(this.eb=63222,this.Kb=a);this.v=0;var d=this.sa(a|this.P),e=this.sa(a+2&65535|this.P);Pc(this,e&-12289|this.wa>>2&12288);c&&(this.ga|=4,this.u[6]=4);Wd(this,this.wa);Wd(this,this.u[7]);O(this,d);this.I&=-113;this.wa=-1;this.I|=8;this.Vc=a;this.Tc=b;if(26!=b)throw a;}}; -function Xd(a){var b=Yd(a),c=Yd(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);O(a,b);Pc(a,c);a.I&=-17}function yc(a,b){var c=b>>13&31;31>c&&a.pb&32&&(b=a.Lb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function Zd(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.pb&a.Rc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.xa[a.v][d]<<6)+(b&8191)&a.Rb;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.v][d]=e;if(4194170!==f||a.v)a.Ja=a.v,a.Na=d;b=!1;g&&(g&57344&&(0<=a.wa&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ja<<5|a.Na<<1), -b=!0),a.C&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.sa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.sa(e)| -g;a.b-=8;break;case 6:return e=a.sa(Ad(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Ad(a,2)),e=e+a.u[c]&65535,e=a.sa(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.eb=a.eb<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.fb||65534<=a.u[6])&&(a.u[6]<=a.fb-32?(a.ga|=4,a.u[6]=4,a.qa(4,24)):(a.ga|=8,a.I|=64));return e}k.Ub=function(a){if(!this.Ua)return this.w.Ub(a);this.L++;a=$d(this,Zd(this,a,3));this.L--;return a}; -k.ab=function(a){if(!this.Ua)return this.w.ab(a);this.L++;a=this.zc(Zd(this,a,2));this.L--;return a};k.qb=function(a,b){this.Ua?(this.L++,ae(this,Zd(this,a,5),b),this.L--):this.w.qb(a,b)};k.Db=function(a,b){this.Ua?(this.L++,this.Gc(Zd(this,a,4),b),this.L--):this.w.Db(a,b)};k.Pc=function(a,b,c){return be(this,a,b,c)};k.Qc=function(a,b,c){return Zd(this,be(this,a,b,c),c)};k.zc=function(a){return this.w.pa(a)};k.Td=function(a){return this.w.pa(Zd(this,a,2))};k.Gc=function(a,b){this.w.hb(a,b&65535)}; -k.Ke=function(a,b){this.w.hb(Zd(this,a,4),b)};function ce(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=be(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.v=a.M>>12&3,c=a.sa(d|c&a.P),a.v=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.u[d]:a.Ia[a.M>>12&3];return c}function de(a,b,c,d){a.C&57344||(a.eb=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=be(a,b,e,4),c&65536||(e&=65535),a.v=a.M>>12&3,e=Zd(a,e|c&65536,4),a.v=a.M>>14&3,a.w.hb(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.u[e]=d:a.Ia[a.M>>12&3]=d} -function ee(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?$d(a,a.ca(b,c,3)):a.u[c]&255}function fe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?a.w.pa(a.ca(b,c,2)):a.u[c]}function ge(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return be(a,b,c,8)}function he(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?$d(a,a.ca(b,c,3)):a.u[c]&255}function ie(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.pa(a.ca(b,c,2)):a.u[c]} -function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.sb=a.ca(b,e,7),ae(a,e,d.call(a,c,$d(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ca(b,e,6),a.w.hb(e,d.call(a,c,a.w.pa(e)))):a.u[e]=d.call(a,c,a.u[e])}function je(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?ae(a,a.ca(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c} -function ke(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.hb(a.ca(b,d,4),c):a.u[d]=c&65535;return c}function U(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.jb=function(a){this.B.complete=!0;var b=this.i&&le(this.i)?1:this.B.Yb?-1:0,c=a?this.B.Yb?0:1:-1;this.B.Yb=!1;this.da=this.b=a;do{if(b){if(this.i&&me(this.i,this.u[7],c)){this.ha();break}c||c++;b++}if(this.I){this.I&112&&(this.I&32?this.qa(168,28):this.I&64?this.qa(4,30):this.I&16&&this.qa(12,32),this.I&=-113);if(a=this.I&7){a=!1;if(this.I&2){this.I&=-3;var d=160,e=(this.jc&224)>>5,f=this.N&&this.N.Ab>e?this.N:null;f&&(d=f.Yd,e=f.Ab);e>(this.M&224)>>5?(this.I&4&&(Ad(this,2),this.I&=-5),this.qa(d, -26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.N,f==a)this.N=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.I&1&&this.I++;a=a&&0>c}if(a)break}this.I=this.I&7|this.M&16;this.decode(zd(this))}while(0>1|b<<16;Dd(this,a);return a&65535}function se(a,b){a=b&2048|b>>1|b<<8;Dd(this,a<<8);return a&255}function te(a,b){a=b&~a;R(this,a);return a}function ue(a,b){a=b&~a;R(this,a<<8);return a}function ve(a,b){a|=b;R(this,a);return a}function we(a,b){a|=b;R(this,a<<8);return a} -function xe(a,b){a=~b|65536;Bd(this,a);return a&65535}function ye(a,b){a=~b|256;Bd(this,a<<8);return a&255}function ze(a,b){a=b-a;this.I&128||(this.X=this.ba=a,this.U=b&(b^a));return a&65535}function Ae(a,b){a=b-a;var c=a<<8;b<<=8;this.I&128||(this.X=this.ba=c,this.U=b&(b^c));return a&255}function Be(a,b){a=b+a;this.I&128||(this.X=this.ba=a,this.U=a&(b^a));return a&65535}function Ce(a,b){a=b+a;var c=a<<8;this.I&128||(this.X=this.ba=c,this.U=c&(b<<8^c));return a&255} -function De(a,b){a=-b;Bd(this,a,a&b&32768);return a&65535}function Ee(a,b){a=-b;Bd(this,a<<8,(a&b&128)<<8);return a&255}function Fe(a,b){a=b<<1|this.T>>16&1;Dd(this,a);return a&65535}function Ge(a,b){a=b<<1|this.T>>16&1;Dd(this,a<<8);return a&255}function He(a,b){a=(this.T&65536|b)>>1|b<<16;Dd(this,a);return a&65535}function Ie(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;Dd(this,a<<8);return a&255}function Je(a,b){var c=b-a;Ed(this,c,a,b);return c&65535} -function Ke(a,b){var c=b-a;Ed(this,c<<8,a<<8,b<<8);return c&255}function Le(a,b){this.I&128||(this.X=this.ba=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Me(a,b){a^=b;R(this,a);return a&65535}function Ne(a){T(this,a,fe(this,a),ne);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function Oe(a){var b=ie(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.X=this.ba=c;this.b-=(this.g?6:7)+b} -function Pe(a){var b=ie(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.ba=d>>16|d;this.b-=(this.g?6:7)+b}function Qe(a){U(this,a,!wd(this))}function Re(a){U(this,a,wd(this))} -function Se(a){T(this,a,fe(this,a),te);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Te(a){S(this,a,ee(this,a),ue);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ue(a){T(this,a,fe(this,a),ve);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ve(a){S(this,a,ee(this,a),we);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function We(a){R(this,fe(this,a)&ie(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Xe(a){R(this,(ee(this,a)&he(this,a))<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Ye(a){U(this,a,yd(this))}function Ze(a){U(this,a,!this.Ta()==!xd(this))}function $e(a){U(this,a,!yd(this)&&!this.Ta()==!xd(this))}function af(a){U(this,a,!wd(this)&&!yd(this))}function bf(a){U(this,a,yd(this)||!this.Ta()!=!xd(this))} -function cf(a){U(this,a,wd(this)||yd(this))}function df(a){U(this,a,!this.Ta()!=!xd(this))}function ef(a){U(this,a,this.Ta())}function ff(a){U(this,a,!yd(this))}function gf(a){U(this,a,!this.Ta())}function hf(){this.qa(12,1);this.b-=5}function jf(a){U(this,a,!0)}function kf(a){U(this,a,!xd(this))}function lf(a){U(this,a,xd(this))}function V(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.ba=1);a&8&&(this.X=0);this.b-=5} -function mf(a){var b=fe(this,a);a=ie(this,a);Ed(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function nf(a){var b=ee(this,a)<<8;a=he(this,a)<<8;Ed(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} -function of(a){var b=ie(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.ba=d>>16|d,this.X=d>>16):(this.U=32768,this.ba=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.ba=this.X=0,this.U=32768,this.T=65536,this.b-=7}function pf(){this.qa(24,2);this.b-=25} -function qf(){this.M&49152?(this.ga|=128,this.qa(4,3)):this.i?rf(this.i):this.ha();this.b-=7}function sf(){this.qa(16,4);this.b-=25}var tf=[0,7,7,10,7,11,9,13];function uf(a){this.J=this.b;O(this,ge(this,a));this.b=this.J-tf[this.g]}var vf=[0,14,14,17,14,18,16,20];function wf(a){this.J=this.b;var b=ge(this,a);a=a>>6&7;Wd(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.J-vf[this.g]}var xf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function yf(a){var b=fe(this,a);this.J=this.b;R(this,ke(this,a,b));this.b=this.J-xf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function zf(a){var b=ee(this,a);R(this,je(this,a,b,1)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Af=[7,13,13,17,14,18,17,21]; -function Bf(a){var b=ie(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.I&128||(this.X=b>>16,this.ba=this.X|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Hf(a){T(this,a,fe(this,a),Je);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function If(a){T(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)}function Jf(){this.qa(28,5);this.b-=5}function Kf(){this.I&4||this.A&&this.A.$();this.I|=4;Ad(this,-2);this.b-=3}function Lf(a){T(this,a,fe(this,a),Me);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=rf(b);b||this.qa(8,6)}function sd(a){Mf[a>>12].call(this,a)}function Nf(a){Of[a>>6&3].call(this,a)}function Pf(a){Qf[a>>6&3].call(this,a)} -function Rf(a){Sf[a>>6&3].call(this,a)}function Tf(a){Uf[a&15].call(this,a)}function Vf(a){Wf[a&15].call(this,a)}function Xf(a){Yf[a>>6&3].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)} -var Mf=[function(a){cg[a>>8&15].call(this,a)},yf,mf,We,Se,Ue,Ne,W,function(a){dg[a>>8&15].call(this,a)},zf,nf,Xe,Te,Ve,Hf,W],cg=[function(a){eg[a>>4&15].call(this,a)},jf,ff,Ye,Ze,df,$e,bf,wf,wf,Nf,Pf,Rf,W,W,W],Of=[function(a){Bd(this,ke(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,ze);this.b-=this.g?9:3+(7==this.f?2:0)}],Qf=[function(a){T(this,a,0, -De);this.b-=this.g?11:6},function(a){T(this,a,wd(this)?1:0,ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,wd(this)?1:0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ie(this,a);Bd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Sf=[function(a){T(this,a,0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)}], -eg=[function(a){fg[a&15].call(this,a)},W,W,W,uf,uf,uf,uf,Ff,W,Tf,Vf,If,If,If,If],fg=[qf,Kf,Ef,hf,sf,Df,W,W,W,W,W,W,W,W,W,W],Uf=[Cf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},V,function(){this.ba=1;this.b-=5},V,V,V,function(){this.X=0;this.b-=5},V,V,V,V,V,V,V],Wf=[Cf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},X,function(){this.ba=0;this.b-=5},X,X,X,function(){this.X=32768;this.b-=5},X,X,X,X,X,X,X],dg=[gf,ef,af,cf,kf,lf,Qe,Re,pf,Jf,Xf,Zf,ag,W,W,W],Yf=[function(a){Bd(this, -je(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ae);this.b-=this.g?9:3+(7==this.f?2:0)}],$f=[function(a){S(this,a,0,Ee);this.b-=this.g?11:6},function(a){S(this,a,wd(this)?1:0,oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,wd(this)?1:0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=he(this,a);Bd(this,a<<8);this.b-=this.g?4:3+(7== -this.f?2:0)}],bg=[function(a){S(this,a,0,Ie);this.b-=this.g?9+(this.sb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,se);this.b-=this.g?9+(this.sb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)}];function td(a){gg[a>>12].call(this,a)} -var gg=[function(a){hg[a>>8&15].call(this,a)},yf,mf,We,Se,Ue,Ne,function(a){ig[a>>8&15].call(this,a)},function(a){jg[a>>8&15].call(this,a)},zf,nf,Xe,Te,Ve,Hf,W],hg=[function(a){kg[a>>4&15].call(this,a)},jf,ff,Ye,Ze,df,$e,bf,wf,wf,Nf,Pf,Rf,function(a){lg[a>>6&3].call(this,a)},W,W],lg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.sa(a|this.P);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ce(this,a,0);Wd(this,a);R(this,a);this.b-=11},function(a){var b=Yd(this);this.J= -this.b;de(this,a,0,b);R(this,b);this.b=this.J-Af[this.g]},function(a){R(this,ke(this,a,this.Ta?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],kg=[function(a){mg[a&15].call(this,a)},W,W,W,uf,uf,uf,uf,Ff,function(a){a&8?(this.M&49152||(this.M=this.M&-2017|(a&7)<<5,this.I|=1),this.b-=5):W.call(this,a)},Tf,Vf,If,If,If,If],mg=[qf,Kf,Ef,hf,sf,Df,function(){Xd(this);this.b-=13},W,W,W,W,W,W,W,W,W],ig=[Bf,Bf,of,of,Oe,Oe,Pe,Pe,Lf,Lf,W,W,W,W,Gf,Gf],jg=[gf,ef,af,cf,kf,lf,Qe,Re,pf,Jf,Xf,Zf,ag,function(a){ng[a>> -6&3].call(this,a)},W,W],ng=[W,function(a){a=ce(this,a,65536);Wd(this,a);R(this,a);this.b-=11},function(a){var b=Yd(this);this.J=this.b;de(this,a,65536,b);R(this,b);this.b=this.J-Af[this.g]},W]; -function og(a){u.call(this,"ROM",a,og);this.ia=this.f=null;this.C=a.addr;this.g=a.size;this.v=a.alias;this.A=a.file;this.D=sa(this.A);if(this.A){a=this.A;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.A=null):(nb(c.Qa,a,b),(a=Fa(a,b))?(c.f=a.ea,c.ia=a.ia):c.A=null);pg(c)})}}z(og);og.prototype.Ea=function(a,b,c,d){this.w=b;this.b=c;this.i=d;pg(this)}; -og.prototype.Ha=function(){this.ia&&(this.i&&qg(this.i,this.id,this.C,this.g,this.ia),delete this.ia);return!0};og.prototype.Ga=function(){return!0}; -function pg(a){if(!tb(a)){if(a.A){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)vb(a,"ROM size ("+p(a.f.length,8,!0)+") does not match specified size ("+p(a.g,8,!0)+")");else{var b;b=a.C;if(uc(a.w,b,a.g,Wc)){var c;for(c=0;c>>a.la;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),r=h,t=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.qb(n++,b[r++]&255);else n&1?a.b.ha():vd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&Lc(e.b,e.ka))});this.na=Nc(52,4);this.aa=Kc(this.b,function(){e.g|=128;e.g&64&&Lc(e.b,e.na)});Cb(b,this,Pg);H(this)}; -k.wc=function(){if(!this.J){var a=id(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.lb)return;b=ya(b[1]);if(this.J=pb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ha=function(a,b){if(!b)if(this.wc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Ga=function(a){return a?this.save():!0};k.reset=function(){Qg(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Qg(this)};function Qg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.ic=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b>1),this.b=new Int32Array(this.C,0,this.size>>2),Xc(this,Tc?Yc:Zc);else{a=this.b=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.w.Da(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ +1]&255)<<8},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Sa=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;dd(c,this.F+a,1,c.M)&&c.ga(!0)}return this.gc(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;dd(c,this.F+a,2,c.M)&&c.ga(!0)}return this.hc(a,b)},ma:function(a, +b,c){if(this.i&&null!=this.F){var d=this.i;dd(d,this.F+a,1,d.D)&&d.ga(!0)}this.f?this.v(a,b,c):this.$b(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;dd(d,this.F+a,2,d.D)&&d.ga(!0)}this.f?this.v(a,b,c):this.lc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Qa:function(a,b){a&1&&this.w.Da(b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&this.w.Da(b,64,2); +a=this.J[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ja:function(a,b){this.G[a]=b;this.Sa=!0},ua:function(a,b,c){this.G[a]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},lb:function(a,b,c){a&1&&this.w.Da(c,64,4);this.D.setUint16(a,b,!0);this.Sa=!0},Ja:function(a,b,c){a&1&&this.w.Da(c,64,4);this.J[a>>1]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, +b)+")",!0)}};function oc(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&cd(a,bd,!1),(a.B=c.B)&&ad(a,bd,!1))}function ed(a,b){b?--a.B||(a.Zb=a.f?a.v:a.$b,a.Nb=a.f?a.H:a.lc):--a.g||(a.Wb=a.gc,a.sa=a.hc)}function ad(a,b,c){c&&a.B||(a.Zb=!a.f&&b[1]||a.v,a.Nb=!a.f&&b[3]||a.H);if(c||void 0===c)a.$b=b[1]||a.v,a.lc=b[3]||a.H}function cd(a,b,c){c&&a.g||(a.Wb=b[0]||a.K,a.sa=b[2]||a.L);if(c||void 0===c)a.gc=b[0]||a.K,a.hc=b[2]||a.L}function Xc(a,b){b||(b=fd);cd(a,b,void 0);ad(a,b,void 0)} +var fd=[],$c=[I.prototype.S,I.prototype.wa,I.prototype.ca,I.prototype.Na],bd=[I.prototype.P,I.prototype.ma,I.prototype.Y,I.prototype.Aa];if(wb)var Zc=[I.prototype.M,I.prototype.ja,I.prototype.Qa,I.prototype.lb],Yc=[I.prototype.R,I.prototype.ua,I.prototype.$,I.prototype.Ja]; +function gd(a,b){u.call(this,"CPU",a,gd,1);var c=a.multiplier||1;this.mb=a.cycles||b;this.cb=c;this.vb=Math.round(this.mb/1E4)/100;this.ob=this.vb*this.cb;this.A.Z=!1;this.A.Yb=!1;this.A.ub=a.autoStart;this.A.xb=!1;this.Hb=this.ma=0;this.Ib=a.csStart;this.yb=a.csInterval;this.zb=a.csStop;this.K=[];this.vc=this.Wd.bind(this);H(this)}z(gd);var hd=["power","reset"];k=gd.prototype; +k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b=a.ma&&(a.ma+=a.yb,c=!0);0<=a.zb&&a.zb<=nd(a)&&(a.yb=a.zb=-1,kd(a),a.ga(),c=!0);c&&a.j(nd(a)+" cycles: checksum="+p(a.Hb))}} +k.ta=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.A.ia)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;ca.Y/a.ob?b=1:d=!0;a.cb=b;b=a.vb*a.cb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.sb()}$b(a,a.S);a.S=0;a.R=Ba();a.$=0;pd(a);return d}function Jc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Lc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.mb*a.cb/1E3*c|0,a.K[b][0]=c+qd(a))} +function rd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Zb(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function qd(a,b){var c=a.ca-=a.b;a.b=a.J=0;b&&(a.ca=0);return c} +k.Wd=function(){if(this.A.Z){this.wb>=this.mb&&pd(this,!0);this.Aa=0;this.Ya=Ba();if(this.$){var a=this.Ya-this.$;a>this.Tb&&(this.R+=a,this.R>this.Ya&&(this.R=this.Ya))}try{do{var b=rd(this,this.A.xb?1:this.kb);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=qd(this,!0);this.Aa+=b;this.S+=b;ac(this,b);Zb(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.kb;15<=++this.Vb&&(this.qa(),this.Vb=0);break}}while(this.A.Z)}catch(e){this.ga();this.B&&this.B.stop(Ba(),nd(this));vb(this,e.stack||e.message); +return}if(this.A.Z){a=setTimeout;b=this.vc;this.$=Ba();var c=this.Tb;this.Aa&&(c=Math.round(c*this.Aa/this.kb));var c=c-(this.$-this.Ya),d=this.$-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.ja=0,od(this)));if(0>c||this.Yc&&(this.R-=c),c=0;this.wb+=this.Aa;this.$+=c;a(b,c)}}}; +k.ib=function(a){if(ub(this))return!1;if(this.A.Z)return this.j(this.toString()+" busy"),!1;od(this);this.A.Z=!0;this.A.Yb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.sb(!0),this.B.start(this.R,nd(this)));setTimeout(this.vc,0);return!0};k.jb=function(){return 0};k.ga=function(a){var b=!1;if(this.A.Z){qd(this);$b(this,this.S);this.S=0;this.A.Z=!1;if(b=this.G.run)b.textContent="Run";this.B&&this.B.stop(Ba(),nd(this));b=!0}this.A.complete=a;return b}; +function sd(a){this.pb=+a.model||1170;this.Ob=a.addrReset||0;gd.call(this,a,6666667);this.decode=1120==this.pb?td.bind(this):ud.bind(this);vd(this);this.L=0;this.M=null;this.A.complete=!1}z(sd,gd);k=sd.prototype;k.reset=function(){this.status("model "+this.pb);this.A.Z&&this.ga();vd(this);jd(this);this.A.error=!1;this.parent.reset.call(this)}; +function vd(a){a.T=65536;a.U=32768;a.aa=65535;a.X=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Ob];a.Wa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.v=0;a.Na=0;a.Rc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.xa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Lb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0];a.Bc=[0,0,0,0,0,0,0,0];a.Ac=0;a.I=0;a.D=a.H=0;a.g=a.f=a.tb=0;a.wa=-1;Yb(a)}function Yb(a){a.fb=255;a.fa=0;a.jc=0;a.C=0;a.eb=0;a.Kb=0;a.qb=0;a.Ua=0;a.Ja=0;a.Rb=262143;a.M=null;a.w&&Nc(a)}function Nc(a){a.Ua?(a.P=65536,a.ba=a.Qc,a.sa=a.Td,a.Nb=a.Ke,qc(a.w,a.qb&16?22:18)):(a.P=0,a.ba=a.Pc,a.sa=a.zc,a.Nb=a.Gc,qc(a.w,16))}function wd(a,b,c){a.Ob=b;O(a,b);!c&&a.i&&(a.ga()||ld(a.i))}k.sc=function(){return 0}; +k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ja,this.cb]);a.set(2,yc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ja=b[1];od(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.N>>14&3;a.v!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.v]);a.N=b;a.I|=2}function R(a,b){a.I&128||(a.X=a.aa=b,a.U=0)}function Cd(a,b,c){a.I&128||(a.X=a.aa=a.T=b,a.U=c||0)}function Dd(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^b)&(d^b))} +function Ed(a,b){a.I&128||(a.X=a.aa=a.T=b,a.U=a.X^a.T>>1)}function Fd(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.pa=function(a,b){if(!this.L){var c=!1;0>this.wa?this.wa=Oc(this):this.v||(a=4,c=!0);this.C&57344||(this.eb=63222,this.Kb=a);this.v=0;var d=this.sa(a|this.P),e=this.sa(a+2&65535|this.P);Pc(this,e&-12289|this.wa>>2&12288);c&&(this.fa|=4,this.u[6]=4);Xd(this,this.wa);Xd(this,this.u[7]);O(this,d);this.I&=-113;this.wa=-1;this.I|=8;this.Vc=a;this.Tc=b;if(26!=b)throw a;}}; +function Yd(a){var b=Zd(a),c=Zd(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Pc(a,c);a.I&=-17}function xc(a,b){var c=b>>13&31;31>c&&a.qb&32&&(b=a.Lb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function $d(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.qb&a.Rc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.xa[a.v][d]<<6)+(b&8191)&a.Rb;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.v][d]=e;if(4194170!==f||a.v)a.Ja=a.v,a.Na=d;b=!1;g&&(g&57344&&(0<=a.wa&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ja<<5|a.Na<<1), +b=!0),a.C&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.sa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.sa(e)| +g;a.b-=8;break;case 6:return e=a.sa(Bd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Bd(a,2)),e=e+a.u[c]&65535,e=a.sa(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.eb=a.eb<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.fb||65534<=a.u[6])&&(a.u[6]<=a.fb-32?(a.fa|=4,a.u[6]=4,a.pa(4,24)):(a.fa|=8,a.I|=64));return e}k.Ub=function(a){if(!this.Ua)return this.w.Ub(a);this.L++;a=ae(this,$d(this,a,3));this.L--;return a}; +k.ab=function(a){if(!this.Ua)return this.w.ab(a);this.L++;a=this.zc($d(this,a,2));this.L--;return a};k.rb=function(a,b){this.Ua?(this.L++,be(this,$d(this,a,5),b),this.L--):this.w.rb(a,b)};k.Db=function(a,b){this.Ua?(this.L++,this.Gc($d(this,a,4),b),this.L--):this.w.Db(a,b)};k.Pc=function(a,b,c){return ce(this,a,b,c)};k.Qc=function(a,b,c){return $d(this,ce(this,a,b,c),c)};k.zc=function(a){return this.w.oa(a)};k.Td=function(a){return this.w.oa($d(this,a,2))};k.Gc=function(a,b){this.w.hb(a,b&65535)}; +k.Ke=function(a,b){this.w.hb($d(this,a,4),b)};function de(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ce(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.v=a.N>>12&3,c=a.sa(d|c&a.P),a.v=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function ee(a,b,c,d){a.C&57344||(a.eb=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ce(a,b,e,4),c&65536||(e&=65535),a.v=a.N>>12&3,e=$d(a,e|c&65536,4),a.v=a.N>>14&3,a.w.hb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d} +function fe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?ae(a,a.ba(b,c,3)):a.u[c]&255}function ge(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]}function he(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ce(a,b,c,8)}function ie(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ae(a,a.ba(b,c,3)):a.u[c]&255}function je(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]} +function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.tb=a.ba(b,e,7),be(a,e,d.call(a,c,ae(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.w.hb(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function ke(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?be(a,a.ba(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c} +function le(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.hb(a.ba(b,d,4),c):a.u[d]=c&65535;return c}function U(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.jb=function(a){this.A.complete=!0;var b=this.i&&me(this.i)?1:this.A.Yb?-1:0,c=a?this.A.Yb?0:1:-1;this.A.Yb=!1;this.ca=this.b=a;do{if(b){if(this.i&&ne(this.i,this.u[7],c)){this.ga();break}c||c++;b++}if(this.I){this.I&112&&(this.I&32?this.pa(168,28):this.I&64?this.pa(4,30):this.I&16&&this.pa(12,32),this.I&=-113);if(a=this.I&7){a=!1;if(this.I&2){this.I&=-3;var d=160,e=(this.jc&224)>>5,f=this.M&&this.M.Ab>e?this.M:null;f&&(d=f.Yd,e=f.Ab);e>(this.N&224)>>5?(this.I&4&&(Bd(this,2),this.I&=-5),this.pa(d, +26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.M,f==a)this.M=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.I&1&&this.I++;a=a&&0>c}if(a)break}this.I=this.I&7|this.N&16;this.decode(Ad(this))}while(0>1|b<<16;Ed(this,a);return a&65535}function te(a,b){a=b&2048|b>>1|b<<8;Ed(this,a<<8);return a&255}function ue(a,b){a=b&~a;R(this,a);return a}function ve(a,b){a=b&~a;R(this,a<<8);return a}function we(a,b){a|=b;R(this,a);return a}function xe(a,b){a|=b;R(this,a<<8);return a} +function ye(a,b){a=~b|65536;Cd(this,a);return a&65535}function ze(a,b){a=~b|256;Cd(this,a<<8);return a&255}function Ae(a,b){a=b-a;this.I&128||(this.X=this.aa=a,this.U=b&(b^a));return a&65535}function Be(a,b){a=b-a;var c=a<<8;b<<=8;this.I&128||(this.X=this.aa=c,this.U=b&(b^c));return a&255}function Ce(a,b){a=b+a;this.I&128||(this.X=this.aa=a,this.U=a&(b^a));return a&65535}function De(a,b){a=b+a;var c=a<<8;this.I&128||(this.X=this.aa=c,this.U=c&(b<<8^c));return a&255} +function Ee(a,b){a=-b;Cd(this,a,a&b&32768);return a&65535}function Fe(a,b){a=-b;Cd(this,a<<8,(a&b&128)<<8);return a&255}function Ge(a,b){a=b<<1|this.T>>16&1;Ed(this,a);return a&65535}function He(a,b){a=b<<1|this.T>>16&1;Ed(this,a<<8);return a&255}function Ie(a,b){a=(this.T&65536|b)>>1|b<<16;Ed(this,a);return a&65535}function Je(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;Ed(this,a<<8);return a&255}function Ke(a,b){var c=b-a;Fd(this,c,a,b);return c&65535} +function Le(a,b){var c=b-a;Fd(this,c<<8,a<<8,b<<8);return c&255}function Me(a,b){this.I&128||(this.X=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ne(a,b){a^=b;R(this,a);return a&65535}function Oe(a){T(this,a,ge(this,a),oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Pe(a){var b=je(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.X=this.aa=c;this.b-=(this.g?6:7)+b} +function Qe(a){var b=je(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Re(a){U(this,a,!xd(this))}function Se(a){U(this,a,xd(this))} +function Te(a){T(this,a,ge(this,a),ue);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ue(a){S(this,a,fe(this,a),ve);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ve(a){T(this,a,ge(this,a),we);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function We(a){S(this,a,fe(this,a),xe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Xe(a){R(this,ge(this,a)&je(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Ye(a){R(this,(fe(this,a)&ie(this,a))<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Ze(a){U(this,a,zd(this))}function $e(a){U(this,a,!this.Ta()==!yd(this))}function af(a){U(this,a,!zd(this)&&!this.Ta()==!yd(this))}function bf(a){U(this,a,!xd(this)&&!zd(this))}function cf(a){U(this,a,zd(this)||!this.Ta()!=!yd(this))} +function df(a){U(this,a,xd(this)||zd(this))}function ef(a){U(this,a,!this.Ta()!=!yd(this))}function ff(a){U(this,a,this.Ta())}function gf(a){U(this,a,!zd(this))}function hf(a){U(this,a,!this.Ta())}function jf(){this.pa(12,1);this.b-=5}function kf(a){U(this,a,!0)}function lf(a){U(this,a,!yd(this))}function mf(a){U(this,a,yd(this))}function V(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.X=0);this.b-=5} +function nf(a){var b=ge(this,a);a=je(this,a);Fd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function of(a){var b=fe(this,a)<<8;a=ie(this,a)<<8;Fd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} +function pf(a){var b=je(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.aa=d>>16|d,this.X=d>>16):(this.U=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.X=0,this.U=32768,this.T=65536,this.b-=7}function qf(){this.pa(24,2);this.b-=25} +function rf(){this.N&49152?(this.fa|=128,this.pa(4,3)):this.i?sf(this.i):this.ga();this.b-=7}function tf(){this.pa(16,4);this.b-=25}var uf=[0,7,7,10,7,11,9,13];function vf(a){this.J=this.b;O(this,he(this,a));this.b=this.J-uf[this.g]}var wf=[0,14,14,17,14,18,16,20];function xf(a){this.J=this.b;var b=he(this,a);a=a>>6&7;Xd(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.J-wf[this.g]}var yf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function zf(a){var b=ge(this,a);this.J=this.b;R(this,le(this,a,b));this.b=this.J-yf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Af(a){var b=fe(this,a);R(this,ke(this,a,b,1)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Bf=[7,13,13,17,14,18,17,21]; +function Cf(a){var b=je(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.I&128||(this.X=b>>16,this.aa=this.X|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function If(a){T(this,a,ge(this,a),Ke);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Jf(a){T(this,a,0,Me);this.b-=this.g?9:3+(7==this.f?2:0)}function Kf(){this.pa(28,5);this.b-=5}function Lf(){this.I|=4;Bd(this,-2);this.b-=3}function Mf(a){T(this,a,ge(this,a),Ne);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=sf(b);b||this.pa(8,6)}function td(a){Nf[a>>12].call(this,a)}function Of(a){Pf[a>>6&3].call(this,a)}function Qf(a){Rf[a>>6&3].call(this,a)}function Sf(a){Tf[a>>6&3].call(this,a)} +function Uf(a){Vf[a&15].call(this,a)}function Wf(a){Xf[a&15].call(this,a)}function Yf(a){Zf[a>>6&3].call(this,a)}function $f(a){ag[a>>6&3].call(this,a)}function bg(a){cg[a>>6&3].call(this,a)} +var Nf=[function(a){dg[a>>8&15].call(this,a)},zf,nf,Xe,Te,Ve,Oe,W,function(a){eg[a>>8&15].call(this,a)},Af,of,Ye,Ue,We,If,W],dg=[function(a){fg[a>>4&15].call(this,a)},kf,gf,Ze,$e,ef,af,cf,xf,xf,Of,Qf,Sf,W,W,W],Pf=[function(a){Cd(this,le(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Ae);this.b-=this.g?9:3+(7==this.f?2:0)}],Rf=[function(a){T(this,a,0, +Ee);this.b-=this.g?11:6},function(a){T(this,a,xd(this)?1:0,oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,xd(this)?1:0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=je(this,a);Cd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Tf=[function(a){T(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)}], +fg=[function(a){gg[a&15].call(this,a)},W,W,W,vf,vf,vf,vf,Gf,W,Uf,Wf,Jf,Jf,Jf,Jf],gg=[rf,Lf,Ff,jf,tf,Ef,W,W,W,W,W,W,W,W,W,W],Vf=[Df,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},V,function(){this.aa=1;this.b-=5},V,V,V,function(){this.X=0;this.b-=5},V,V,V,V,V,V,V],Xf=[Df,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},X,function(){this.aa=0;this.b-=5},X,X,X,function(){this.X=32768;this.b-=5},X,X,X,X,X,X,X],eg=[hf,ff,bf,df,lf,mf,Re,Se,qf,Kf,Yf,$f,bg,W,W,W],Zf=[function(a){Cd(this, +ke(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,De);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Be);this.b-=this.g?9:3+(7==this.f?2:0)}],ag=[function(a){S(this,a,0,Fe);this.b-=this.g?11:6},function(a){S(this,a,xd(this)?1:0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,xd(this)?1:0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ie(this,a);Cd(this,a<<8);this.b-=this.g?4:3+(7== +this.f?2:0)}],cg=[function(a){S(this,a,0,Je);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,te);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)}];function ud(a){hg[a>>12].call(this,a)} +var hg=[function(a){ig[a>>8&15].call(this,a)},zf,nf,Xe,Te,Ve,Oe,function(a){jg[a>>8&15].call(this,a)},function(a){kg[a>>8&15].call(this,a)},Af,of,Ye,Ue,We,If,W],ig=[function(a){lg[a>>4&15].call(this,a)},kf,gf,Ze,$e,ef,af,cf,xf,xf,Of,Qf,Sf,function(a){mg[a>>6&3].call(this,a)},W,W],mg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.sa(a|this.P);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=de(this,a,0);Xd(this,a);R(this,a);this.b-=11},function(a){var b=Zd(this);this.J= +this.b;ee(this,a,0,b);R(this,b);this.b=this.J-Bf[this.g]},function(a){R(this,le(this,a,this.Ta?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],lg=[function(a){ng[a&15].call(this,a)},W,W,W,vf,vf,vf,vf,Gf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.I|=1),this.b-=5):W.call(this,a)},Uf,Wf,Jf,Jf,Jf,Jf],ng=[rf,Lf,Ff,jf,tf,Ef,function(){Yd(this);this.b-=13},W,W,W,W,W,W,W,W,W],jg=[Cf,Cf,pf,pf,Pe,Pe,Qe,Qe,Mf,Mf,W,W,W,W,Hf,Hf],kg=[hf,ff,bf,df,lf,mf,Re,Se,qf,Kf,Yf,$f,bg,function(a){og[a>> +6&3].call(this,a)},W,W],og=[W,function(a){a=de(this,a,65536);Xd(this,a);R(this,a);this.b-=11},function(a){var b=Zd(this);this.J=this.b;ee(this,a,65536,b);R(this,b);this.b=this.J-Bf[this.g]},W]; +function pg(a){u.call(this,"ROM",a,pg);this.ha=this.f=null;this.C=a.addr;this.g=a.size;this.v=a.alias;this.B=a.file;this.D=sa(this.B);if(this.B){a=this.B;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.B=null):(nb(c.Qa,a,b),(a=Fa(a,b))?(c.f=a.da,c.ha=a.ha):c.B=null);qg(c)})}}z(pg);pg.prototype.Ea=function(a,b,c,d){this.w=b;this.b=c;this.i=d;qg(this)}; +pg.prototype.Ha=function(){this.ha&&(this.i&&rg(this.i,this.id,this.C,this.g,this.ha),delete this.ha);return!0};pg.prototype.Ga=function(){return!0}; +function qg(a){if(!tb(a)){if(a.B){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)vb(a,"ROM size ("+p(a.f.length,8,!0)+") does not match specified size ("+p(a.g,8,!0)+")");else{var b;b=a.C;if(tc(a.w,b,a.g,Wc)){var c;for(c=0;c>>a.ka;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),r=h,t=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.rb(n++,b[r++]&255);else n&1?a.b.ga():wd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&Kc(e.b,e.ja))});this.ma=Mc(52,4);this.$=Jc(this.b,function(){e.g|=128;e.g&64&&Kc(e.b,e.ma)});Cb(b,this,Qg);H(this)}; +k.wc=function(){if(!this.J){var a=id(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.lb)return;b=ya(b[1]);if(this.J=pb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ha=function(a,b){if(!b)if(this.wc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.Ga=function(a){return a?this.save():!0};k.reset=function(){Rg(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Rg(this)};function Rg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.ic=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=xa("",c)));this.P&&!this.H&&c&&(b=String.fromCharCode(this.P)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), -this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Mc(this.b,this.aa,1E3/Math.round(this.R/10))}};var Rg={},Pg=(Rg[65392]=[null,null,Y.prototype.Cd,Y.prototype.te,"RCSR"],Rg[65394]=[null,null,Y.prototype.Bd,Y.prototype.se,"RBUF"],Rg[65396]=[null,null,Y.prototype.Vd,Y.prototype.Me,"XCSR"],Rg[65398]=[null,null,Y.prototype.Ud,Y.prototype.Le,"XBUF"],Rg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= -function(){var a=d.G.listTapes;a&&Ug(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ug(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; -k.Ea=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;this.S=Vg(a);var e=this;if((this.g=id(this.A,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.Y=Nc(56,4);this.da=Kc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.A&&!a.A.B.ja;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Qa,e,f),(e=Fa(e,f))&&dh(a,b,c,d,e.ea,e.La, -e.Ka));a.B.$a=!1;a.D&&(a.D--,a.D||H(a));ah(a)})}function Yg(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.va);for(d=0;d'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= +function(){var a=d.G.listTapes;a&&Vg(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Vg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; +k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;this.S=Wg(a);var e=this;if((this.g=id(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.Y=Mc(56,4);this.ca=Jc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.A.ia;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Qa,e,f),(e=Fa(e,f))&&eh(a,b,c,d,e.da,e.La, +e.Ka));a.A.$a=!1;a.D&&(a.D--,a.D||H(a));bh(a)})}function Zg(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.va);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ec?"":e)+"&format=json"));return!!Ea(f, -null,!0,function(b,c,d){kh(a,b,c,d)})} -function kh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.A&&!a.A.B.ja;if(d)a.controller.O('Unable to load disk "'+a.Xa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Qa,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)q(h[0]);else{a.va=h.length;a.za=h[0].length;a.ra=h[0][0].length;var l=h[0][0][0];a.Ma=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var w=m<<2,y=t.length;y>2,e=Array(d),f=0;fd&&a.B&&!a.B.A.ia;if(d)a.controller.O('Unable to load disk "'+a.Xa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Qa,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(h.length)if(1==h.length)q(h[0]);else{a.va=h.length;a.za=h[0].length;a.ra=h[0][0].length;var l=h[0][0][0];a.Ma=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var w=m<<2,y=t.length;y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f=a.Pa+a.Ba&&(a.Ba+=f-(a.Pa+a.Ba)+1):(a.Pa=f,a.Ba=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ +k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Xa+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=mh(this,a++);)oh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function oh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){u.call(this,"RL11",a,N,2097152);this.v=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Pa("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype; -k.ta=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=qa(c.value,10);null!=a&&ph(d,a)},!0;case "loadDrive":return this.G[b]= -c,c.onclick=function(){var a=d.G.listDisks;a&&qh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[qa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=mh(a,c++);)for(var l=0,m=h.length;l'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=qa(c.value,10);null!=a&&qh(d,a)},!0;case "loadDrive":return this.G[b]= +c,c.onclick=function(){var a=d.G.listDisks;a&&rh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[qa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=nh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ph(this,0)}}return!0};k.Ga=function(a){return a?this.save():!0};k.reset=function(){rh(this)};k.save=function(){return(new P(this)).data()}; -k.restore=function(a){return rh(this,a[0])};function uh(a,b){b||(a.H=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}wh(a,e,b,c,!1,d)}else vh(a,e)} -function wh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.gb.toLowerCase()!=d.toLowerCase()&&(g++,vh(a,b,!0),h.dc?a.O("RL11 busy"):(h.dc=!0,e&&(h.cc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Pb=!!f,jh(new fh(a,h,"preload"),c,d,f,a.Mc)&&g++));return g} -k.Mc=function(a,b,c,d,e){var f;a.dc=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.va||f[1]>a.za)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.fc)),b=null);b?(a.Ca=b,a.Xa=c,a.gb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.fc),a.cc||e),this.A&&this.A.rb()):a.Pb=!1;a.cc&&(a.cc=!1,--this.H||H(this));ph(this,a.fc)}; -function th(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.C=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; -k.hd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ca.read(m,n++))||0>(t=a.Ca.read(m,n++))){h=5120;break}this.w.hb(f,r|t<<8);if(Jc(this.w)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.be=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var r=this.w.pa(f);if(Jc(this.w)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,r&255)||!a.Ca.write(m,n++,r>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Fd=function(){return this.fa&65535}; -k.we=function(a){this.fa=this.fa&-1023|a&1022;this.N=this.N&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.C&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.C=this.g&4?this.C+b:this.C-b,this.g=this.C=this.C&65408|c);break;case 8:this.D=this.C;break;case 12:b=this.hd;case 10:b||(b=this.be),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.va||f>=c.ra?this.fa|=37888: -(g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Nc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Lc(this.b,this.P))}};k.Dd=function(){return this.J};k.ue=function(a){this.J=a&65534};k.Gd=function(){return this.g};k.xe=function(a){this.g=a};k.Hd=function(){return this.D};k.ye=function(a){this.D=a};k.Ed=function(){return this.K};k.ve=function(a){this.K=a&63}; -var xh={},sh=(xh[63744]=[null,null,N.prototype.Fd,N.prototype.we,"RLCS"],xh[63746]=[null,null,N.prototype.Dd,N.prototype.ue,"RLBA"],xh[65284]=[null,null,N.prototype.Gd,N.prototype.xe,"RLDA"],xh[65286]=[null,null,N.prototype.Hd,N.prototype.ye,"RLMP"],xh[65288]=[null,null,N.prototype.Ed,N.prototype.ve,"RLBE"],xh);function yh(a){u.call(this,"Debugger",a,yh);this.da=a.base||16;this.Ja=!1;this.K=0;this.R=!1;this.C=-1;this.v=[];this.Y={}}z(yh); -var zh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};yh.prototype.tc=function(){return-1};yh.prototype.uc=function(){}; -function Ah(a,b,c,d){if(c)if(b){0>a.C&&a.v.length&&(a.C=0);if(0>a.C||b!=a.v[a.C])a.v.splice(0,0,b),a.C=0;a.C--}else a.R?b="end":b=a.v[a.C+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 Bh(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; +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;rh(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;if((this.v=id(this.B,"autoMount")||this.v)&&"string"==typeof this.v)try{this.v=eval("("+this.v+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.v+")"),this.v=null}sh(this);this.P=Mc(112,5);Cb(b,this,th,2097152);uh(this,"None","",!0);this.L&&uh(this,"Local Disk","?");uh(this,"Remote Disk","??");vh(this)||H(this)}; +k.Ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.rc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";qh(this,0)}}return!0};k.Ga=function(a){return a?this.save():!0};k.reset=function(){sh(this)};k.save=function(){return(new P(this)).data()}; +k.restore=function(a){return sh(this,a[0])};function vh(a,b){b||(a.H=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}xh(a,e,b,c,!1,d)}else wh(a,e)} +function xh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.gb.toLowerCase()!=d.toLowerCase()&&(g++,wh(a,b,!0),h.dc?a.O("RL11 busy"):(h.dc=!0,e&&(h.cc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Pb=!!f,kh(new gh(a,h,"preload"),c,d,f,a.Mc)&&g++));return g} +k.Mc=function(a,b,c,d,e){var f;a.dc=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.va||f[1]>a.za)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.fc)),b=null);b?(a.Ca=b,a.Xa=c,a.gb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.fc),a.cc||e),this.B&&this.B.sb()):a.Pb=!1;a.cc&&(a.cc=!1,--this.H||H(this));qh(this,a.fc)}; +function uh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.C=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.ea=this.ea|a|32768);return!0}; +k.hd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ca.read(m,n++))||0>(t=a.Ca.read(m,n++))){h=5120;break}this.w.hb(f,r|t<<8);if(Ac(this.w)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.be=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var r=this.w.oa(f);if(Ac(this.w)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,r&255)||!a.Ca.write(m,n++,r>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Fd=function(){return this.ea&65535}; +k.we=function(a){this.ea=this.ea&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.ea&128)){var b;a=!0;var c=this.f[(this.ea&768)>>8],d,e,f,g;this.ea&=-2;switch(this.ea&14){case 4:this.g&8&&(this.ea&=63);this.D=c.status|this.C&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.C=this.g&4?this.C+b:this.C-b,this.g=this.C=this.C&65408|c);break;case 8:this.D=this.C;break;case 12:b=this.hd;case 10:b||(b=this.be),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.va||f>=c.ra?this.ea|=37888: +(g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Nc.bind(this)))}a&&(this.ea|=129,this.ea&64&&Kc(this.b,this.P))}};k.Dd=function(){return this.J};k.ue=function(a){this.J=a&65534};k.Gd=function(){return this.g};k.xe=function(a){this.g=a};k.Hd=function(){return this.D};k.ye=function(a){this.D=a};k.Ed=function(){return this.K};k.ve=function(a){this.K=a&63}; +var yh={},th=(yh[63744]=[null,null,N.prototype.Fd,N.prototype.we,"RLCS"],yh[63746]=[null,null,N.prototype.Dd,N.prototype.ue,"RLBA"],yh[65284]=[null,null,N.prototype.Gd,N.prototype.xe,"RLDA"],yh[65286]=[null,null,N.prototype.Hd,N.prototype.ye,"RLMP"],yh[65288]=[null,null,N.prototype.Ed,N.prototype.ve,"RLBE"],yh);function zh(a){u.call(this,"Debugger",a,zh);this.ca=a.base||16;this.Ja=!1;this.K=0;this.R=!1;this.C=-1;this.v=[];this.Y={}}z(zh); +var Ah={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};zh.prototype.tc=function(){return-1};zh.prototype.uc=function(){}; +function Bh(a,b,c,d){if(c)if(b){0>a.C&&a.v.length&&(a.C=0);if(0>a.C||b!=a.v[a.C])a.v.splice(0,0,b),a.C=0;a.C--}else a.R?b="end":b=a.v[a.C+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 Ch(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 Ch(a,b,c){var d;if(b){b=Dh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Gh(a,b){if(b)return Fh(a,b,a.Y[b]);var c=0;for(b in a.Y)Fh(a,b,a.Y[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Hh(a,b){if(b)return Gh(a,b,a.Y[b]);var c=0;for(b in a.Y)Gh(a,b,a.Y[b]),c++;return 0this.b.xb?Ph:[];Qh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ca(Rh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.la;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=xc[c],n&&d.j(p(n.id,8)+" %"+ -p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.uc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Wa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=hc(this.b):21==a&&this.f&&gc(this.f)&&(b=this.f.Va));return b}; -k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Kb).F));this.oa&1073741824?this.wa.push(a):this.ka&&a==this.ka||(this.ka=a,this.oa&-2147483648&&this.b&&this.b.B.Z&&(this.ha(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,pd(a),a.ua=0,a.A&&a.A.$(void 0)))};function Jh(a){var b;if(!le(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.aa=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;this.j("trapped to "+J(this,b&255,1)+(c?" ("+J(this,c)+")":""))}this.L=Z(this.b.u[7]);a&&1!=this.S?Yh(this):Zh(this)}};function Xh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.B.ja?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.B.Z?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ha=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Ga=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Jh(this);this.Aa=0;this.ka=null;this.K=0;this.L=Z(this.b.u[7]);this.B.Z=!1;$h(this);a||this.$()};k.save=function(){var a=new P(this);a.set(0,Th(this.L));a.set(1,Th(this.P));a.set(2,[this.v,this.R,this.oa]);a.set(3,this.J);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Uh(a[b++]),this.P=Uh(a[b++]),this.v=a[b][0],"string"==typeof this.v&&(this.v=[this.v]),this.R=a[b][1],this.oa|=a[b][2]);a[3]&&(this.J=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.B.Z=!0;this.Rb=a;this.Tb=b}; -k.stop=function(a,b){if(this.B.Z){this.B.Z=!1;this.K=b-this.Tb;if(!this.S){b="stopped";if(this.K){a-=this.Rb;var c=0d&&(d=a.b.ab(b)),65535!=(d&65535)&&(c=a.H[a.aa],c.F=b,c.Oa=!1,++a.aa==a.H.length&&(a.aa=0)));return!1}function rf(a){var b=a.b;if(b.B.Z)throw O(b,a.b.Kb),a.ha(),-1;return!1} -function Ih(a){var b,c;a.g=["bp"];if(a.N)for(b=1;b>>d.la],!1)}a.N=["br"];if(a.D)for(b=1;b>>d.la],!0);a.D=["bw"];a.sb=0}k.nb=function(a,b,c){var d=!0;c||ai(this,a,b,!1,!0);if(a!=this.g){var e=this.ca(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.w;f.W[e>>>f.la].nb(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(bi(this,a,a.length-1,"set"),Jh(this)));return d}; -function ai(a,b,c,d,e){var f=!1;c=a.ca(c);for(var g=1;g>>d.la],b==a.D));h.Oa||Jh(a);break}}return f}function ci(a,b){for(var c=1;c>23)&65535,x=J(w,t);else if(8192==A)t=t.F-((f&63)<<1)&65535,x=J(w,t);else if(12288==A)x=J(w,f&7,1);else if(24576==A)x=J(w,f&63,1);else if(32768==A)x=J(w,f&255,1);else if(A=f&y,y&4032&&(A>>=6,y>>=6), -y&63)switch(y=A&7,A&56){case 0:x=Wh(y);break;case 8:x="@"+Wh(y);break;case 16:7>y?x="("+Wh(y)+")+":(A=w.pa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Wh(y)+")+":(A=w.pa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Wh(y)+")";break;case 40:x="@-("+Wh(y)+")";break;case 48:A=w.pa(t,2);x=J(w,A,0,!0)+"("+Wh(y)+")";7==y&&(x=J(w,A+t.F&65535));break;case 56:A=w.pa(t,2),x="@"+J(w,A)+"("+Wh(y)+")",7==y&&(x="@"+J(w,A+t.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); -0b?(c=Wh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Wa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,hc(d)):21==b&&a.f&&gc(a.f)&&(c="SW="+J(a,a.f.Va,3));c&&(c+=" ");return c}function hi(a){var b,c="";for(b=0;6>b;b++)c+=gi(a,b);c=c+"\n"+(gi(a,6)+gi(a,7));c+=gi(a,20)+gi(a,21);return c+=fi(a,"T")+fi(a,"N")+fi(a,"Z")+fi(a,"V")+fi(a,"C")}k.oc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.oc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Se:b,F:c,Uc:d,ia:e,mc:f})}function ii(a,b,c){var d=[],e=a.ca(b)>>>0;for(b=0;b>>0,h=f.Uc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.A.$();a.j("updated registers:")}a.j(hi(a));c&&(a.L=Z(d.u[7]),Zh(a,J(a,a.L.F)))}}function mi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=ei(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} -function di(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.P.F)),a.L=a.P,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ka=null;if(tb(a)&&0n||"z"na.length&&(a.j("note: only "+na.length+" available"),aa=na.length);fa-=aa;0>fa&&(null==na[na.length-1].F?(aa=fa+aa,fa=0):fa+=na.length);var Hd=[];"call"==yg&&(Jb=1E5,Hd=["CALL"]);for(void 0!==xg&&a.j(aa+" instructions earlier:");0=na.length&&(fa=0);a.ub=aa;Ag++;Jb--}}Ag||(a.j("no "+zg+"history available"),a.ub=void 0)}else{var Lb=Rh(a,ma);if(Lb){var Ac=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||Gi),Ac=Eh(a,La)>>>0,65536>4||1,Nb="";Ii--&&0Dc?String.fromCharCode(Dc):"."}Nb&&(Nb+="\n");Nb+=ma+" "+Id+(0==Ob?" "+Dg:"")}Nb&&a.j(Nb);a.mb=Lb}}}}break;case "e":if("else"==g[0])break;var kb,Jd,Kd,Ld,Md=g[0],Nd=g[1];"eb"==Md?(kb=1,Jd=255,Kd=a.Gb,Ld=a.Xb):"e"==Md||"ew"==Md?(kb=2,Jd=65535,Kd=a.pa,Ld=a.hb):Nd=null;if(null==Nd)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Ec=Rh(a,Nd);if(Ec)for(var Fc= -2;FcQd;){for(var Ma=null,Li=256;65536>Sb.F>>>0;){Rd.F=a.pa(Sb,2);if(null==Sb.F||!Li--)break;if(!(Rd.F&1)){for(var Mi=a,Gc=Rd,Fg=null,Tb=Gc.F,Gg=Tb,Sd=1;6>=Sd&&Tb;Sd++){if(2< -Sd){Gc.F=Tb;var Hc=ei(Mi,Gc);if(0<=Hc.indexOf("JSR")){var Hg=Hc.indexOf(" ");if(Tb+(Hc.indexOf(" ",Hg+1)-Hg-1)/2==Gg){Fg=Hc;break}}}Tb-=2}Gc.F=Gg;if(Ma=Fg)break}}if(!Ma||null==Ma)break;var Ig=null;if("ks"==Ki){var Jg=Ma.match(/[0-9A-F]+$/);Jg&&(Ig=li(a,Jg[0]))}Ma=xa(Ma,50)+" ;"+(Ig||"stack="+J(a,Sb.F));a.j(Ma);Qd++}Qd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){li(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Da=0;if("all"== -G)Da=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in xb)if(G==oa){Da=xb[oa];pa=!!(a.oa&Da);break}if(!Da){a.j("unknown message category: "+G);break a}}if(Da)if("on"==g[2])a.oa|=Da,pa=!0;else if("off"==g[2]&&(a.oa&=~Da,pa=!1,1073741824==Da)){for(var Td=0;Td\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bri){if(ti(d,this.J)){this.C=new P(this,"1.30.3","failsafe");ti(this.C)&&(yi(this,d),a=2,zi(this.C));this.C.set("timestamp",Ca());Ai(this.C);var e=this.g&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=xi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ti(d,g):("error"== -f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.A=null)):this.j(f+": "+g),zi(d),ti(d)?(c=xi(d),e=!0):c=!1))}e&&wi(this,c?d:null)}else 2==a&&d.clear()}else wi(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.B.ja=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Bi(this,this.b,b,c,a),this.$(),this.b.tb());this.P&&(yi(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.v=0}; -function yi(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.A||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.aa;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} -function oi(a,b,c){var d,e="none";if(a.v)return null;a.v--;var f=new P(a,"1.30.3"),g=new P(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ga&&(c&&a.b.ha(),d=a.b.Ga(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.B.ja=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(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(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(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 l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Si(a,b,c)}})}else c(a,null)} -function Ti(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Fi||Za(!0));l=!1}var g,h,l=!0;Fi++;mb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?Qi(c,null,null,!1,e,function(d,l){l?(nb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Fi||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Fi||Za(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Qi(b,a,d,!0,e,m):Ri(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return Ti(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map +63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Ph=[0],Qh= +[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Ih.prototype; +k.Ea=function(a,b,c,d){this.w=b;this.B=a;this.b=c;this.f=a.f;(a=id(a,"messages"))&&Lh(this,a);this.wb=Oh;this.Ob=1145>this.b.pb?Qh:[];Rh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Sh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=wc[c],n&&d.j(p(n.id,8)+" %"+ +p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.uc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Wa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Oc(this.b):21==a&&this.f&&gc(this.f)&&(b=this.f.Va));return b}; +k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Kb).F));this.na&1073741824?this.wa.push(a):this.ja&&a==this.ja||(this.ja=a,this.na&-2147483648&&this.b&&this.b.A.Z&&(this.ga(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,qd(a),a.ua=0,a.qa()))};function Kh(a){var b;if(!me(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.j("trapped to "+J(a,c&255,1)+(d?" ("+J(a,d)+")":""))}a.L=Z(a.b.u[7]);b&&1!=a.S?Zh(a):$h(a)}}function Yh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.Z?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ha=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Ga=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Kh(this);this.Aa=0;this.ja=null;this.K=0;this.L=Z(this.b.u[7]);this.A.Z=!1;ai(this);a||ld(this)};k.save=function(){var a=new P(this);a.set(0,Uh(this.L));a.set(1,Uh(this.P));a.set(2,[this.v,this.R,this.na]);a.set(3,this.J);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Vh(a[b++]),this.P=Vh(a[b++]),this.v=a[b][0],"string"==typeof this.v&&(this.v=[this.v]),this.R=a[b][1],this.na|=a[b][2]);a[3]&&(this.J=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.A.Z=!0;this.Rb=a;this.Tb=b}; +k.stop=function(a,b){if(this.A.Z){this.A.Z=!1;this.K=b-this.Tb;if(!this.S){b="stopped";if(this.K){a-=this.Rb;var c=0d&&(d=a.b.ab(b)),65535!=(d&65535)&&(c=a.H[a.$],c.F=b,c.Oa=!1,++a.$==a.H.length&&(a.$=0)));return!1}function sf(a){var b=a.b;if(b.A.Z)throw O(b,a.b.Kb),a.ga(),-1;return!1} +function Jh(a){var b,c;a.g=["bp"];if(a.M)for(b=1;b>>d.ka],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ka],!0);a.D=["bw"];a.tb=0}k.nb=function(a,b,c){var d=!0;c||bi(this,a,b,!1,!0);if(a!=this.g){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.w;f.W[e>>>f.ka].nb(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(ci(this,a,a.length-1,"set"),Kh(this)));return d}; +function bi(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ka],b==a.D));h.Oa||Kh(a);break}}return f}function di(a,b){for(var c=1;c>23)&65535,x=J(w,t);else if(8192==A)t=t.F-((f&63)<<1)&65535,x=J(w,t);else if(12288==A)x=J(w,f&7,1);else if(24576==A)x=J(w,f&63,1);else if(32768==A)x=J(w,f&255,1);else if(A=f&y,y&4032&&(A>>=6,y>>=6), +y&63)switch(y=A&7,A&56){case 0:x=Xh(y);break;case 8:x="@"+Xh(y);break;case 16:7>y?x="("+Xh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Xh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Xh(y)+")";break;case 40:x="@-("+Xh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Xh(y)+")";7==y&&(x=J(w,A+t.F&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Xh(y)+")",7==y&&(x="@"+J(w,A+t.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); +0b?(c=Xh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Wa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Oc(d)):21==b&&a.f&&gc(a.f)&&(c="SW="+J(a,a.f.Va,3));c&&(c+=" ");return c}function ii(a){var b,c="";for(b=0;6>b;b++)c+=hi(a,b);c=c+"\n"+(hi(a,6)+hi(a,7));c+=hi(a,20)+hi(a,21);return c+=gi(a,"T")+gi(a,"N")+gi(a,"Z")+gi(a,"V")+gi(a,"C")}k.oc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.oc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Se:b,F:c,Uc:d,ha:e,mc:f})}function ji(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b>>0,h=f.Uc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.qa();a.j("updated registers:")}a.j(ii(a));c&&(a.L=Z(d.u[7]),$h(a,J(a,a.L.F)))}}function ni(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=fi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} +function ei(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.P.F)),a.L=a.P,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ja=null;if(tb(a)&&0n||"z"na.length&&(a.j("note: only "+na.length+" available"),aa=na.length);fa-=aa;0>fa&&(null==na[na.length-1].F?(aa=fa+aa,fa=0):fa+=na.length);var Id=[];"call"==zg&&(Kb=1E5,Id=["CALL"]);for(void 0!==yg&&a.j(aa+" instructions earlier:");0=na.length&&(fa=0);a.vb=aa;Bg++;Kb--}}Bg||(a.j("no "+Ag+"history available"),a.vb=void 0)}else{var Mb=Sh(a,ma);if(Mb){var Bc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||Hi),Bc=Fh(a,La)>>>0,65536>4||1,Ob="";Ji--&&0Ec?String.fromCharCode(Ec):"."}Ob&&(Ob+="\n");Ob+=ma+" "+Jd+(0==Pb?" "+Eg:"")}Ob&&a.j(Ob);a.mb=Mb}}}}break;case "e":if("else"==g[0])break;var kb,Kd,Ld,Md,Nd=g[0],Od=g[1];"eb"==Nd?(kb=1,Kd=255,Ld=a.Gb,Md=a.Xb):"e"==Nd||"ew"==Nd?(kb=2,Kd=65535,Ld=a.oa,Md=a.hb):Od=null;if(null==Od)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Fc=Sh(a,Od);if(Fc)for(var Gc= +2;GcRd;){for(var Ma=null,Mi=256;65536>Tb.F>>>0;){Sd.F=a.oa(Tb,2);if(null==Tb.F||!Mi--)break;if(!(Sd.F&1)){for(var Ni=a,Hc=Sd,Gg=null,Ub=Hc.F,Hg=Ub,Td=1;6>=Td&&Ub;Td++){if(2< +Td){Hc.F=Ub;var Ic=fi(Ni,Hc);if(0<=Ic.indexOf("JSR")){var Ig=Ic.indexOf(" ");if(Ub+(Ic.indexOf(" ",Ig+1)-Ig-1)/2==Hg){Gg=Ic;break}}}Ub-=2}Hc.F=Hg;if(Ma=Gg)break}}if(!Ma||null==Ma)break;var Jg=null;if("ks"==Li){var Kg=Ma.match(/[0-9A-F]+$/);Kg&&(Jg=mi(a,Kg[0]))}Ma=xa(Ma,50)+" ;"+(Jg||"stack="+J(a,Tb.F));a.j(Ma);Rd++}Rd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){mi(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Da=0;if("all"== +G)Da=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in xb)if(G==oa){Da=xb[oa];pa=!!(a.na&Da);break}if(!Da){a.j("unknown message category: "+G);break a}}if(Da)if("on"==g[2])a.na|=Da,pa=!0;else if("off"==g[2]&&(a.na&=~Da,pa=!1,1073741824==Da)){for(var Ud=0;Ud\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bsi){if(ui(d,this.J)){this.C=new P(this,"1.30.3","failsafe");ui(this.C)&&(zi(this,d),a=2,Ai(this.C));this.C.set("timestamp",Ca());Bi(this.C);var e=this.g&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=yi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ui(d,g):("error"== +f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.B=null)):this.j(f+": "+g),Ai(d),ui(d)?(c=yi(d),e=!0):c=!1))}e&&xi(this,c?d:null)}else 2==a&&d.clear()}else xi(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;fa[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ci(this,this.b,b,c,a),this.qa(),this.b.ub());this.P&&(zi(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.v=0}; +function zi(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} +function pi(a,b,c){var d,e="none";if(a.v)return null;a.v--;var f=new P(a,"1.30.3"),g=new P(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ga&&(c&&a.b.ga(),d=a.b.Ga(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;l(b.J+=a))){for(a=0;af.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(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(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(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 l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Ti(a,b,c)}})}else c(a,null)} +function Ui(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Gi||Za(!0));l=!1}var g,h,l=!0;Gi++;mb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?Ri(c,null,null,!1,e,function(d,l){l?(nb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Gi||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Gi||Za(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ri(b,a,d,!0,e,m):Si(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return Ui(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.3/pdp11.js b/versions/pdpjs/1.30.3/pdp11.js index 46a8d9ca8..e5c23d23b 100644 --- a/versions/pdpjs/1.30.3/pdp11.js +++ b/versions/pdpjs/1.30.3/pdp11.js @@ -40,48 +40,47 @@ function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} function sa(){function a(a){return(10>a?"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 r(a,b,c,d){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 k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function ta(a,b){var c,d={K:null,X:null,ga:null,fa: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.ga=g.load;d.fa=g.exec;if(e=g.bytes)d.K=e;else if(e=g.words)for(d.K=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.fa=g.load;d.ea=g.exec;if(e=g.bytes)d.K=e;else if(e=g.words)for(d.K=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.X=g.symbols;d.K.length?1==d.K.length&&(u(d.K[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Pa=this.id:(this.oa=this.id.substr(0,b),this.Pa=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Fa:!1,pb:!1,O:!1,error:!1};this.jb=null;this.j.error=!1;this.o={};this.D=null;y.push(this)}var La=void 0,Ma={}; +Ga(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ia(Ca.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Kb=b.comment;this.jc=b;b=this.id.indexOf(".");0>b?this.Pa=this.id:(this.na=this.id.substr(0,b),this.Pa=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Fa:!1,pb:!1,O:!1,error:!1};this.jb=null;this.l.error=!1;this.o={};this.D=null;y.push(this)}var La=void 0,Ma={}; if(window){La||(La=window.location.search.substr(1));for(var Na,Oa=/\+/g,Pa=/([^&=]+)=?([^&]*)/g;Na=Pa.exec(La);)Ma[decodeURIComponent(Na[1].replace(Oa," "))]=decodeURIComponent(Na[2].replace(Oa," "))}function Qa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function z(a,b){b||(b=x);a.prototype=Qa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ra=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Ra={},y=[];function Sa(a,b,c){Ra[a]&&b&&(Ra[a][b]=c)}function A(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.c["S"+a]=[0,!1,!1,this.sc,a]}z(Za);var $a=7;function ab(a,b){return a.c[b]&&a.c[b][0]}h=Za.prototype;h.reset=function(){this.stop()}; -h.$=function(a,b,c,d){if(this.l&&this.l.$(a,b,c,d)||this.a&&this.a.$(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.s++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.m[b]=d?1:0,this.s++,!0):"switch"==a?(void 0===this.c[b]&&(this.c[b]=[d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c=a.c[b];bb(a, -b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);"STEP"!=b&&(a.w="DEP"==b,a.A="EXAM"==b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.c[b];c[1]&&c[2]&&(bb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.la=function(a,b){b||(hb(),this.reset());return!0};h.ka=function(){return!0}; +function Za(a){x.call(this,"Panel",a,Za);this.b=this.i=this.f=this.w=this.s=0;this.A=this.C=this.v=!1;this.F=$a;this.m={};this.c={START:[1,!0,!1,this.qc],STEP:[1,!1,!1,this.rc],ENABLE:[1,!1,!1,this.mc],CONT:[1,!0,!1,this.kc],DEP:[0,!0,!1,this.lc],EXAM:[1,!0,!1,this.nc],LOAD:[1,!0,!1,this.pc],TEST:[0,!0,!1,this.oc]};for(a=0;22>a;a++)this.c["S"+a]=[0,!1,!1,this.sc,a]}z(Za);var $a=7;function ab(a,b){return a.c[b]&&a.c[b][0]}h=Za.prototype;h.reset=function(){this.stop()}; +h.$=function(a,b,c,d){if(this.j&&this.j.$(a,b,c,d)||this.a&&this.a.$(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.s++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.m[b]=d?1:0,this.s++,!0):"switch"==a?(void 0===this.c[b]&&(this.c[b]=[d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c=a.c[b];bb(a, +b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.c[b];c[1]&&c[2]&&(bb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.D=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.ka=function(a,b){b||(hb(),this.reset());return!0};h.ja=function(){return!0}; function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.m)ib(a,c,null!=b?b:a.m[c])}function bb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.c)bb(a,b,a.c[b][0])}function jb(a,b,c,d){a.o[b]&&(void 0===c&&(Xa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.D&&a.D.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))} -h.qc=function(a){a||this.a.j.U||(this.h.reset(),kb(this.a),ab(this,"ENABLE")&&lb(this.a))};h.rc=function(){};h.mc=function(a){a||G(this.a)};h.kc=function(a){if(!a&&!this.a.j.U)if(ab(this,"ENABLE"))lb(this.a);else{a=this.D;var b;if(b=a)a.j.Fa&&(a.j.pb=!0),b=!a.j.Fa;if(b)Va(a,!0),a.mb(0),Va(a,!1);else try{var c=this.a.mb(1);0a;a++)this.c["S"+a][0]=0&1<>2;this.l=this.b-1;this.A=this.C/this.b|0;this.ya=[];this.f=0;this.m=!1;this.w=[];this.ac=[wb,xb,yb,zb];a=new I(this);Ab(a,this.D);this.h=Array(this.A);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ya[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return c;J(d,b,16);return 255}function xb(a,b,c){var d=!1,e=this.controller,f=e.ya[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ya[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||J(e,c,16)} -function yb(a,b){var c=-1,d=this.controller;(a=d.ya[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}function zb(a,b,c){var d=!1,e=this.controller;if(a=e.ya[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ja)return l.nb+=l.Ja-f,l.Ja=f,!0;if(f>=l.Ja+l.nb){p=l.size-(f-n);p>g&&(p=g);l.nb=f-l.Ja+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.D,l);a.h[k++]=f;f=n+a.b;g-=p}if(0>=g){c/=1024;var t;e="";t?10>>=a.c;0>>=a.c;0>>a.c].xb(b&a.l,b)}function Lb(a,b){3932160<=b&&(b=Kb(a.a,b));return a.h[(b&a.ja)>>>a.c].W(b&a.l,b)} -h.kb=function(a){3932160<=a&&(a=Kb(this.a,a));var b=a&this.l,c=(a&this.ja)>>>this.c;this.m=!1;this.f++;a=this.h[c].Sb(b,a);this.f--;return a};h.Xa=function(a,b){3932160<=a&&(a=Kb(this.a,a));this.m=!1;this.f++;this.h[(a&this.ja)>>>this.c].Eb(a&this.l,b&255,a);this.f--};function Mb(a,b,c){3932160<=b&&(b=Kb(a.a,b));a.h[(b&a.ja)>>>a.c].ob(b&a.l,c&65535,b)}h.lb=function(a,b){3932160<=a&&(a=Kb(this.a,a));var c=a&this.l,d=(a&this.ja)>>>this.c;this.m=!1;this.f++;this.h[d].Zb(c,b&65535,a);this.f--}; -function Nb(a){for(var b=0,c=[],d=0;da.a.Za)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null,t=g[5]||1;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var w=g[4],E=0;E>5&3;b.ab=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Vb(b))}};h.Ec=function(){var a=this.a.Ca;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Fc=function(){return this.a.zb};h.Gc=function(){return this.a.Ga}; -h.yd=function(a){var b=this.a;1170>b.Za&&(a&=-49);b.Ga!=a&&(b.Ga=a,b.Mb=a&16?4194303:262143,Vb(b))};h.fd=function(a){a=a>>1&63;var b=this.a.Ya[a>>1];return a&1?b>>16:b&65535};h.Yd=function(a,b){b=b>>1&63;var c=b>>1;this.a.Ya[c]=b&1?this.a.Ya[c]&65535|(a&63)<<16:this.a.Ya[c]&-65536|a&65534};h.Zc=function(a){return this.a.H[1][a>>1&7]};h.Rd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Xc=function(a){return this.a.H[1][(a>>1&7)+8]};h.Pd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; +h.qc=function(a){a||this.a.l.U||(this.h.reset(),kb(this.a),ab(this,"ENABLE")&&lb(this.a))};h.rc=function(){};h.mc=function(a){a||G(this.a)};h.kc=function(a){if(!a&&!this.a.l.U)if(ab(this,"ENABLE"))lb(this.a);else{a=this.D;var b;if(b=a)a.l.Fa&&(a.l.pb=!0),b=!a.l.Fa;if(b)Va(a,!0),a.mb(0),Va(a,!1);else try{var c=this.a.mb(1);0a;a++)this.c["S"+a][0]=0&1<a.a.Wa?8:16,c=65472<=a.b&&a.b<65472+b,b=c?1:2,c=c?15:a.h.ia;ab(a,"STEP")||(b=-b);a.b=a.b&~c|a.b+b&c;rb(a,"A",a.b,22)}function qb(a,b){a.i=b&65535;rb(a,"D",a.i,16);return a.i}function sb(a,b,c){a.m[b]=c;a.v||ib(a,b,c)}function rb(a,b,c,d){for(var e=0;e>2;this.j=this.b-1;this.A=this.C/this.b|0;this.ya=[];this.f=0;this.m=!1;this.w=[];this.ac=[vb,wb,xb,yb];a=new I(this);zb(a,this.D);this.h=Array(this.A);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ya[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return c;J(d,b,16);return 255}function wb(a,b,c){var d=!1,e=this.controller,f=e.ya[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ya[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||J(e,c,16)} +function xb(a,b){var c=-1,d=this.controller;(a=d.ya[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}function yb(a,b,c){var d=!1,e=this.controller;if(a=e.ya[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||J(e,c,16)}function Bb(a,b){if(b!=a.s){var c;a.s&&(c=(1<>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ja)return l.nb+=l.Ja-f,l.Ja=f,!0;if(f>=l.Ja+l.nb){p=l.size-(f-n);p>g&&(p=g);l.nb=f-l.Ja+p;f=n+a.b;g-=p;k++;continue}}return Gb(1,f,g)}f=new I(a,f,p,a.b,d,e);zb(f,a.D,l);a.h[k++]=f;f=n+a.b;g-=p}if(0>=g){c/=1024;var t;e="";t?10>>=a.c;0>>=a.c;0>>a.c].xb(b&a.j,b)}function Kb(a,b){3932160<=b&&(b=Jb(a.a,b));return a.h[(b&a.ia)>>>a.c].W(b&a.j,b)} +h.kb=function(a){3932160<=a&&(a=Jb(this.a,a));var b=a&this.j,c=(a&this.ia)>>>this.c;this.m=!1;this.f++;a=this.h[c].Sb(b,a);this.f--;return a};h.Ya=function(a,b){3932160<=a&&(a=Jb(this.a,a));this.m=!1;this.f++;this.h[(a&this.ia)>>>this.c].Eb(a&this.j,b&255,a);this.f--};function Lb(a,b,c){3932160<=b&&(b=Jb(a.a,b));a.h[(b&a.ia)>>>a.c].ob(b&a.j,c&65535,b)}h.lb=function(a,b){3932160<=a&&(a=Jb(this.a,a));var c=a&this.j,d=(a&this.ia)>>>this.c;this.m=!1;this.f++;this.h[d].Zb(c,b&65535,a);this.f--}; +function Mb(a){for(var b=0,c=[],d=0;da.a.Wa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null,t=g[5]||1;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var w=g[4],E=0;E>5&3;b.bb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Ub(b))}};h.Ec=function(){var a=this.a.Ca;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Fc=function(){return this.a.zb};h.Gc=function(){return this.a.Ga}; +h.yd=function(a){var b=this.a;1170>b.Wa&&(a&=-49);b.Ga!=a&&(b.Ga=a,b.Mb=a&16?4194303:262143,Ub(b))};h.fd=function(a){a=a>>1&63;var b=this.a.Za[a>>1];return a&1?b>>16:b&65535};h.Yd=function(a,b){b=b>>1&63;var c=b>>1;this.a.Za[c]=b&1?this.a.Za[c]&65535|(a&63)<<16:this.a.Za[c]&-65536|a&65534};h.Zc=function(a){return this.a.H[1][a>>1&7]};h.Rd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Xc=function(a){return this.a.H[1][(a>>1&7)+8]};h.Pd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; h.Yc=function(a){return this.a.Y[1][a>>1&7]};h.Qd=function(a,b){b=b>>1&7;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Wc=function(a){return this.a.Y[1][(a>>1&7)+8]};h.Od=function(a,b){b=(b>>1&7)+8;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Ac=function(a){return this.a.H[0][a>>1&7]};h.ud=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.yc=function(a){return this.a.H[0][(a>>1&7)+8]};h.sd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.zc=function(a){return this.a.Y[0][a>>1&7]}; h.td=function(a,b){b=b>>1&7;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.xc=function(a){return this.a.Y[0][(a>>1&7)+8]};h.rd=function(a,b){b=(b>>1&7)+8;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.ed=function(a){return this.a.H[3][a>>1&7]};h.Xd=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.cd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Vd=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.dd=function(a){return this.a.Y[3][a>>1&7]};h.Wd=function(a,b){b=b>>1&7;this.a.Y[3][b]=a;this.a.H[3][b]&=65295}; -h.bd=function(a){return this.a.Y[3][(a>>1&7)+8]};h.Ud=function(a,b){b=(b>>1&7)+8;this.a.Y[3][b]=a;this.a.H[3][b]&=65295};h.La=function(a){a&=7;return this.a.B&2048?this.a.Ha[a]:this.a.g[a]};h.Na=function(a,b){b&=7;this.a.B&2048?this.a.Ha[b]=a:this.a.g[b]=a};h.Lc=function(){return this.a.B&49152?this.a.na[0]:this.a.g[6]};h.Dd=function(a){this.a.B&49152?this.a.na[0]=a:this.a.g[6]=a};h.Oc=function(){return this.a.g[7]};h.Gd=function(a){this.a.g[7]=a}; -h.Ma=function(a){a&=7;return this.a.B&2048?this.a.g[a]:this.a.Ha[a]};h.Oa=function(a,b){b&=7;this.a.B&2048?this.a.g[b]=a:this.a.Ha[b]=a};h.Mc=function(){return 1==(this.a.B&49152)>>14?this.a.g[6]:this.a.na[1]};h.Ed=function(a){1==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.na[1]=a};h.Nc=function(){return 3==(this.a.B&49152)>>14?this.a.g[6]:this.a.na[3]};h.Fd=function(a){3==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.na[3]=a};h.vc=function(a){return this.a.Vb[a-65504>>1]}; +h.bd=function(a){return this.a.Y[3][(a>>1&7)+8]};h.Ud=function(a,b){b=(b>>1&7)+8;this.a.Y[3][b]=a;this.a.H[3][b]&=65295};h.La=function(a){a&=7;return this.a.B&2048?this.a.Ha[a]:this.a.g[a]};h.Na=function(a,b){b&=7;this.a.B&2048?this.a.Ha[b]=a:this.a.g[b]=a};h.Lc=function(){return this.a.B&49152?this.a.ma[0]:this.a.g[6]};h.Dd=function(a){this.a.B&49152?this.a.ma[0]=a:this.a.g[6]=a};h.Oc=function(){return this.a.g[7]};h.Gd=function(a){this.a.g[7]=a}; +h.Ma=function(a){a&=7;return this.a.B&2048?this.a.g[a]:this.a.Ha[a]};h.Oa=function(a,b){b&=7;this.a.B&2048?this.a.g[b]=a:this.a.Ha[b]=a};h.Mc=function(){return 1==(this.a.B&49152)>>14?this.a.g[6]:this.a.ma[1]};h.Ed=function(a){1==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.ma[1]=a};h.Nc=function(){return 3==(this.a.B&49152)>>14?this.a.g[6]:this.a.ma[3]};h.Fd=function(a){3==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.ma[3]=a};h.vc=function(a){return this.a.Vb[a-65504>>1]}; h.pd=function(a,b){this.a.Vb[b-65504>>1]=a};h.Rb=function(a){return 65520==a?61183:0};h.Yb=function(){};h.ad=function(){return 1};h.Td=function(){};h.uc=function(){return this.a.M};h.od=function(){this.a.M=0};h.Cc=function(){return this.a.Ub};h.wd=function(a,b){b&1||(a&=255);this.a.Ub=a};h.Hc=function(a){return a?this.a.Ab:0};h.zd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Ab=a;b.u|=2};h.$c=function(a){return a?this.a.Da&65280:0};h.Sd=function(a){this.a.Da=a|255}; -h.Kc=function(){return tb(this.a)};h.Cd=function(a){Wb(this.a,a&-1809|tb(this.a)&1808);this.a.u|=128};h.Xb=function(){}; +h.Kc=function(){return Vb(this.a)};h.Cd=function(a){Wb(this.a,a&-1809|Vb(this.a)&1808);this.a.u|=128};h.Xb=function(){}; var N={},M=(N[61568]=[null,null,L.prototype.fd,L.prototype.Yd,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Zc,L.prototype.Rd,"SIPDR",8,1145],N[62608]=[null,null,L.prototype.Xc,L.prototype.Pd,"SDPDR",8,1145],N[62624]=[null,null,L.prototype.Yc,L.prototype.Qd,"SIPAR",8,1145],N[62640]=[null,null,L.prototype.Wc,L.prototype.Od,"SDPAR",8,1145],N[62656]=[null,null,L.prototype.Ac,L.prototype.ud,"KIPDR",8,1145],N[62672]=[null,null,L.prototype.yc,L.prototype.sd,"KDPDR",8,1145],N[62688]=[null,null,L.prototype.zc, L.prototype.td,"KIPAR",8,1145],N[62704]=[null,null,L.prototype.xc,L.prototype.rd,"KDPAR",8,1145],N[62798]=[null,null,L.prototype.Gc,L.prototype.yd,"MMR3",1,1145],N[65382]=[null,null,L.prototype.Bc,L.prototype.vd,"LKS"],N[65402]=[null,null,L.prototype.Dc,L.prototype.xd,"MMR0",1,1145],N[65404]=[null,null,L.prototype.Ec,L.prototype.Xb,"MMR1",1,1145],N[65406]=[null,null,L.prototype.Fc,L.prototype.Xb,"MMR2",1,1145],N[65408]=[null,null,L.prototype.ed,L.prototype.Xd,"UIPDR",8,1145],N[65424]=[null,null,L.prototype.cd, L.prototype.Vd,"UDPDR",8,1145],N[65440]=[null,null,L.prototype.dd,L.prototype.Wd,"UIPAR",8,1145],N[65456]=[null,null,L.prototype.bd,L.prototype.Ud,"UDPAR",8,1145],N[65472]=[null,null,L.prototype.La,L.prototype.Na,"R0SET0"],N[65473]=[null,null,L.prototype.La,L.prototype.Na,"R1SET0"],N[65474]=[null,null,L.prototype.La,L.prototype.Na,"R2SET0"],N[65475]=[null,null,L.prototype.La,L.prototype.Na,"R3SET0"],N[65476]=[null,null,L.prototype.La,L.prototype.Na,"R4SET0"],N[65477]=[null,null,L.prototype.La,L.prototype.Na, @@ -89,42 +88,42 @@ L.prototype.Vd,"UDPDR",8,1145],N[65440]=[null,null,L.prototype.dd,L.prototype.Wd L.prototype.Oa,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.Mc,L.prototype.Ed,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.Nc,L.prototype.Fd,"R6USER",1,1145],N[65504]=[null,null,L.prototype.vc,L.prototype.pd,"CTRL",1,1170],N[65520]=[null,null,L.prototype.Rb,L.prototype.Yb,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.Rb,L.prototype.Yb,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.ad,L.prototype.Td,"SYSID",1,1170],N[65526]=[null,null,L.prototype.uc,L.prototype.od,"CPUERR",1,1170],N[65528]= [null,null,L.prototype.Cc,L.prototype.wd,"MB",1,1170],N[65530]=[null,null,L.prototype.Hc,L.prototype.zd,"PIR"],N[65532]=[null,null,L.prototype.$c,L.prototype.Sd,"SL"],N[65534]=[null,null,L.prototype.Kc,L.prototype.Cd,"PSW"],N);M[65506]=M[65504];M[65508]=M[65504];M[65510]=M[65504];M[65512]=M[65504];M[65514]=M[65504];M[65516]=M[65504];M[65518]=M[65504]; Ha(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),dc(this,$b?ec:fc);else{a=this.a=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},oa:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ua=!0},G:function(a,b){return this.I(a,b)},R:function(a,b){return this.Sb(a,b)},pa:function(a,b,c){this.l?this.f(a,b,c):this.Eb(a,b,c)},ta:function(a,b,c){this.l?this.f(a,b,c):this.Zb(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},P:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},ea:function(a,b){this.o[a]=b;this.ua=!0},qa:function(a,b){this.o[a]=b;this.ua=!0},sa:function(a,b,c){a&1&&J(this.h, -c,64);this.c.setUint16(a,b,!0);this.ua=!0},wa:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.ua=!0}};function Ab(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&ic(a,jc,!1),(a.m=c.m)&&kc(a,jc,!1))}function kc(a,b,c){c&&a.m||(a.Db=!a.l&&b[1]||a.f,a.ob=!a.l&&b[3]||a.A);if(c||void 0===c)a.Eb=b[1]||a.f,a.Zb=b[3]||a.A}function ic(a,b,c){c&&a.i||(a.xb=b[0]||a.v,a.W=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Sb=b[2]||a.w}function dc(a,b){b||(b=lc);ic(a,b,void 0);kc(a,b,void 0)} -var lc=[],gc=[I.prototype.N,I.prototype.ra,I.prototype.oa,I.prototype.xa],jc=[I.prototype.G,I.prototype.pa,I.prototype.R,I.prototype.ta];if(Ya)var fc=[I.prototype.C,I.prototype.ea,I.prototype.P,I.prototype.sa],ec=[I.prototype.J,I.prototype.qa,I.prototype.aa,I.prototype.wa]; -function mc(a,b){x.call(this,"CPU",a,mc);var c=a.multiplier||1;this.gb=a.cycles||b;this.ra=c;this.ub=Math.round(this.gb/1E4)/100;this.wa=this.ub*this.ra;this.j.U=!1;this.j.Bb=!1;this.j.Ua=a.autoStart;this.j.fb=!1;this.cb=this.xa=0;this.eb=a.csStart;this.Qa=a.csInterval;this.Ra=a.csStop;this.I=[];this.Qb=this.kd.bind(this);F(this)}z(mc);var nc=["power","reset"];h=mc.prototype; -h.ia=function(a,b,c,d){this.l=a;this.h=b;this.D=d;for(b=0;b=a.xa&&(a.xa+=a.Qa,c=!0);0<=a.Ra&&a.Ra<=rc(a)&&(a.Qa=a.Ra=-1,qc(a),G(a),c=!0);c&&a.T(rc(a)+" cycles: checksum="+m(a.cb))}} -h.$=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.O)a=!0;else{var b=null,c,k=A(a.id);for(c=0;ca.ea/a.wa&&(b=1);a.ra=b;b=a.ub*a.ra;if(a.wa!=b){a.wa=b;b=a.wa.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&uc(a.l)}nb(a,a.aa);a.aa=0;a.R=ra();a.pa=0;tc(a)}function Qb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Sb(a,b,c){0<=b&&ba.I[b][0]&&(c=a.gb*a.ra/1E3*c|0,a.I[b][0]=c+vc(a))} -function mb(a,b){for(var c=a.I.length-1;0<=c;c--){var d=a.I[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function vc(a,b){var c=a.qa-=a.a;a.a=a.G=0;b&&(a.qa=0);return c} -h.kd=function(){if(this.j.U){this.vb>=this.gb&&tc(this,!0);this.Ta=0;this.bb=ra();if(this.pa){var a=this.bb-this.pa;a>this.Nb&&(this.R+=a,this.R>this.bb&&(this.R=this.bb))}try{do{for(var b,c=this.j.fb?1:this.hb,d=this.I.length-1;0<=d;d--){var e=this.I[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.mb(b)}catch(f){if("number"!=typeof f)throw f;}b=vc(this,!0);this.Ta+=b;this.aa+=b;ob(this,b);mb(this,b);this.Sa-=b;if(0>=this.Sa){this.Sa+=this.hb;15<=++this.Ob&&(this.l&&this.l.da(void 0),this.Ob=0);break}}while(this.j.U)}catch(f){G(this); -this.l&&this.l.stop(ra(),rc(this));Xa(this,f.stack||f.message);return}if(this.j.U){a=setTimeout;b=this.Qb;this.pa=ra();c=this.Nb;this.Ta&&(c=Math.round(c*this.Ta/this.hb));c-=this.pa-this.bb;if(d=this.pa-this.R)this.ea=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.ta=0,sc(this));if(0>c||this.eac&&(this.R-=c),c=0;this.vb+=this.Ta;this.pa+=c;a(b,c)}}}; -function lb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.U)a.T(a.toString()+" busy");else{sc(a);a.j.U=!0;a.j.Bb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.R,rc(a));setTimeout(a.Qb,0)}}h.mb=function(){return 0};function G(a){var b=!1;if(a.j.U){vc(a);nb(a,a.aa);a.aa=0;a.j.U=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),rc(a));b=!0}a.j.complete=void 0;return b} -function wc(a){this.Za=+a.model||1170;this.Jb=a.addrReset||0;mc.call(this,a,6666667);this.decode=1120==this.Za?xc.bind(this):yc.bind(this);zc(this);this.sa=0;this.N=null;this.j.complete=!1}z(wc,mc);h=wc.prototype;h.reset=function(){this.status("model "+this.Za);this.j.U&&G(this);zc(this);pc(this);this.j.error=!1;this.parent.reset.call(this)}; -function zc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.B=15;a.g=[0,0,0,0,0,0,0,a.Jb];a.Ha=[0,0,0,0,0,0];a.na=[0,0,0,0];a.v=0;a.ab=0;a.ic=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Y=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Ya=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0];a.Vb=[0,0,0,0,0,0,0,0];a.Ub=0;a.u=0;a.A=a.C=0;a.c=a.b=a.tb=0;a.Ia=-1;kb(a)}function kb(a){a.Da=255;a.M=0;a.Ab=0;a.w=0;a.Ca=0;a.zb=0;a.Ga=0;a.Ba=0;a.$a=0;a.Mb=262143;a.N=null;a.h&&Vb(a)}function Vb(a){a.Ba?(a.P=65536,a.J=a.hc,a.W=a.gd,a.ob=a.Zd,Cb(a.h,a.Ga&16?22:18)):(a.P=0,a.J=a.gc,a.W=a.Tb,a.ob=a.$b,Cb(a.h,16))}function Ac(a,b,c){a.Jb=b;P(a,b);!c&&a.D&&(G(a)||a.D.da())}h.Ib=function(){return 0}; -h.save=function(){var a=new Q(this);a.set(0,[]);a.set(1,[this.ta,this.ra]);a.set(2,Nb(this.h));return a.data()};h.restore=function(a){var b=a[1];this.ta=b[1];sc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.B>>14&3;a.v!=c&&(a.na[c]=a.g[6],a.g[6]=a.na[a.v]);a.B=b;a.u|=2}function S(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function Dc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function Ec(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Fc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Gc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} -function K(a,b,c){if(!a.sa){var d=!1;0>a.Ia?a.Ia=tb(a):a.v||(b=4,d=!0);a.w&57344||(a.Ca=63222,a.zb=b);a.v=0;var e=a.W(b|a.P),f=a.W(b+2&65535|a.P);Wb(a,f&-12289|a.Ia>>2&12288);d&&(a.M|=4,a.g[6]=4);Hc(a,a.Ia);Hc(a,a.g[7]);P(a,e);a.u&=-113;a.Ia=-1;a.u|=8;if(26!=c)throw b;}}function Ic(a){var b=Jc(a),c=Jc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);P(a,b);Wb(a,c);a.u&=-17} -function Kb(a,b){var c=b>>13&31;31>c&&a.Ga&32&&(b=a.Ya[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function Kc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Ga&a.ic[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Y[a.v][d]<<6)+(b&8191)&a.Mb;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(4194170!==f||a.v)a.$a=a.v,a.ab=d;b=!1;g&&(g&57344&&(0<=a.Ia&&(g|=128),a.w&57344||(a.w=a.w|g|a.$a<<5|a.ab<<1), -b=!0),a.w&61440||!(4191360>f||4194239>>a.c].Db(b&a.l,c&255,b)}function Jc(a){var b=a.W(a.g[6]|a.P);a.g[6]=a.g[6]+2&65535;return b}function Hc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.w&57344||(a.Ca=a.Ca<<8|246);!a.v&&c<=a.Da&&4>1),this.a=new Int32Array(this.b,0,this.size>>2),dc(this,$b?ec:fc);else{a=this.a=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},na:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ta=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Sb(a,b)},oa:function(a,b,c){this.j?this.f(a,b,c):this.Eb(a,b,c)},sa:function(a,b,c){this.j?this.f(a,b,c):this.Zb(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},P:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},da:function(a,b){this.o[a]=b;this.ta=!0},pa:function(a,b){this.o[a]=b;this.ta=!0},ra:function(a,b,c){a&1&&J(this.h, +c,64);this.c.setUint16(a,b,!0);this.ta=!0},wa:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.ta=!0}};function zb(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&ic(a,jc,!1),(a.m=c.m)&&kc(a,jc,!1))}function kc(a,b,c){c&&a.m||(a.Db=!a.j&&b[1]||a.f,a.ob=!a.j&&b[3]||a.A);if(c||void 0===c)a.Eb=b[1]||a.f,a.Zb=b[3]||a.A}function ic(a,b,c){c&&a.i||(a.xb=b[0]||a.v,a.W=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Sb=b[2]||a.w}function dc(a,b){b||(b=lc);ic(a,b,void 0);kc(a,b,void 0)} +var lc=[],gc=[I.prototype.N,I.prototype.qa,I.prototype.na,I.prototype.xa],jc=[I.prototype.F,I.prototype.oa,I.prototype.R,I.prototype.sa];if(Ya)var fc=[I.prototype.C,I.prototype.da,I.prototype.P,I.prototype.ra],ec=[I.prototype.J,I.prototype.pa,I.prototype.aa,I.prototype.wa]; +function mc(a,b){x.call(this,"CPU",a,mc);var c=a.multiplier||1;this.fb=a.cycles||b;this.qa=c;this.ub=Math.round(this.fb/1E4)/100;this.wa=this.ub*this.qa;this.l.U=!1;this.l.Bb=!1;this.l.Ua=a.autoStart;this.l.gb=!1;this.cb=this.xa=0;this.eb=a.csStart;this.Qa=a.csInterval;this.Ra=a.csStop;this.I=[];this.Pb=this.kd.bind(this);F(this)}z(mc);var nc=["power","reset"];h=mc.prototype; +h.ha=function(a,b,c,d){this.j=a;this.h=b;this.D=d;for(b=0;b=a.xa&&(a.xa+=a.Qa,c=!0);0<=a.Ra&&a.Ra<=rc(a)&&(a.Qa=a.Ra=-1,qc(a),G(a),c=!0);c&&a.T(rc(a)+" cycles: checksum="+m(a.cb))}} +h.$=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.j)if(a=d.j,a.l.O)a=!0;else{var b=null,c,k=A(a.id);for(c=0;ca.da/a.wa&&(b=1);a.qa=b;b=a.ub*a.qa;if(a.wa!=b){a.wa=b;b=a.wa.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.j&&uc(a.j)}nb(a,a.aa);a.aa=0;a.R=ra();a.oa=0;tc(a)}function Pb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Rb(a,b,c){0<=b&&ba.I[b][0]&&(c=a.fb*a.qa/1E3*c|0,a.I[b][0]=c+vc(a))}function mb(a,b){for(var c=a.I.length-1;0<=c;c--){var d=a.I[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}} +function vc(a,b){var c=a.pa-=a.a;a.a=a.F=0;b&&(a.pa=0);return c} +h.kd=function(){if(this.l.U){this.vb>=this.fb&&tc(this,!0);this.Ta=0;this.$a=ra();if(this.oa){var a=this.$a-this.oa;a>this.Nb&&(this.R+=a,this.R>this.$a&&(this.R=this.$a))}try{do{for(var b,c=this.l.gb?1:this.hb,d=this.I.length-1;0<=d;d--){var e=this.I[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.mb(b)}catch(f){if("number"!=typeof f)throw f;}b=vc(this,!0);this.Ta+=b;this.aa+=b;ob(this,b);mb(this,b);this.Sa-=b;if(0>=this.Sa){this.Sa+=this.hb;15<=++this.Ob&&(this.va(),this.Ob=0);break}}while(this.l.U)}catch(f){G(this); +this.j&&this.j.stop(ra(),rc(this));Xa(this,f.stack||f.message);return}if(this.l.U){a=setTimeout;b=this.Pb;this.oa=ra();c=this.Nb;this.Ta&&(c=Math.round(c*this.Ta/this.hb));c-=this.oa-this.$a;if(d=this.oa-this.R)this.da=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.sa=0,sc(this));if(0>c||this.dac&&(this.R-=c),c=0;this.vb+=this.Ta;this.oa+=c;a(b,c)}}}; +function lb(a){var b;a.l.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.U)a.T(a.toString()+" busy");else{sc(a);a.l.U=!0;a.l.Bb=!0;if(b=a.o.run)b.textContent="Halt";a.j&&a.j.start(a.R,rc(a));setTimeout(a.Pb,0)}}h.mb=function(){return 0};function G(a){var b=!1;if(a.l.U){vc(a);nb(a,a.aa);a.aa=0;a.l.U=!1;if(b=a.o.run)b.textContent="Run";a.j&&a.j.stop(ra(),rc(a));b=!0}a.l.complete=void 0;return b} +function wc(a){this.Wa=+a.model||1170;this.Jb=a.addrReset||0;mc.call(this,a,6666667);this.decode=1120==this.Wa?xc.bind(this):yc.bind(this);zc(this);this.ra=0;this.N=null;this.l.complete=!1}z(wc,mc);h=wc.prototype;h.reset=function(){this.status("model "+this.Wa);this.l.U&&G(this);zc(this);pc(this);this.l.error=!1;this.parent.reset.call(this)}; +function zc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.B=15;a.g=[0,0,0,0,0,0,0,a.Jb];a.Ha=[0,0,0,0,0,0];a.ma=[0,0,0,0];a.v=0;a.bb=0;a.ic=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Y=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Za=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0];a.Vb=[0,0,0,0,0,0,0,0];a.Ub=0;a.u=0;a.A=a.C=0;a.c=a.b=a.qb=0;a.Ia=-1;kb(a)}function kb(a){a.Da=255;a.M=0;a.Ab=0;a.w=0;a.Ca=0;a.zb=0;a.Ga=0;a.Ba=0;a.ab=0;a.Mb=262143;a.N=null;a.h&&Ub(a)}function Ub(a){a.Ba?(a.P=65536,a.J=a.hc,a.W=a.gd,a.ob=a.Zd,Bb(a.h,a.Ga&16?22:18)):(a.P=0,a.J=a.gc,a.W=a.Tb,a.ob=a.$b,Bb(a.h,16))}function Ac(a,b,c){a.Jb=b;P(a,b);!c&&a.D&&(G(a)||a.D.c())}h.Ib=function(){return 0}; +h.save=function(){var a=new Q(this);a.set(0,[]);a.set(1,[this.sa,this.qa]);a.set(2,Mb(this.h));return a.data()};h.restore=function(a){var b=a[1];this.sa=b[1];sc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.B>>14&3;a.v!=c&&(a.ma[c]=a.g[6],a.g[6]=a.ma[a.v]);a.B=b;a.u|=2}function S(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function Dc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function Ec(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Fc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Gc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} +function K(a,b,c){if(!a.ra){var d=!1;0>a.Ia?a.Ia=Vb(a):a.v||(b=4,d=!0);a.w&57344||(a.Ca=63222,a.zb=b);a.v=0;var e=a.W(b|a.P),f=a.W(b+2&65535|a.P);Wb(a,f&-12289|a.Ia>>2&12288);d&&(a.M|=4,a.g[6]=4);Hc(a,a.Ia);Hc(a,a.g[7]);P(a,e);a.u&=-113;a.Ia=-1;a.u|=8;if(26!=c)throw b;}}function Ic(a){var b=Jc(a),c=Jc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);P(a,b);Wb(a,c);a.u&=-17} +function Jb(a,b){var c=b>>13&31;31>c&&a.Ga&32&&(b=a.Za[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function Kc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Ga&a.ic[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Y[a.v][d]<<6)+(b&8191)&a.Mb;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(4194170!==f||a.v)a.ab=a.v,a.bb=d;b=!1;g&&(g&57344&&(0<=a.Ia&&(g|=128),a.w&57344||(a.w=a.w|g|a.ab<<5|a.bb<<1), +b=!0),a.w&61440||!(4191360>f||4194239>>a.c].Db(b&a.j,c&255,b)}function Jc(a){var b=a.W(a.g[6]|a.P);a.g[6]=a.g[6]+2&65535;return b}function Hc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.w&57344||(a.Ca=a.Ca<<8|246);!a.v&&c<=a.Da&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!==c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!==c&&(e|=g);e=a.W(e)|g;a.a-= -8;break;case 6:return e=a.W(Cc(a,2)),e=e+a.g[c]&65535|g,a.a-=6,e;case 7:return e=a.W(Cc(a,2)),e=e+a.g[c]&65535,e=a.W(e|a.P)|g,a.a-=10,e}a.g[c]=a.g[c]+f&65535;!g||a.w&57344||(a.Ca=a.Ca<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.g[6]<=a.Da||65534<=a.g[6])&&(a.g[6]<=a.Da-32?(a.M|=4,a.g[6]=4,K(a,4,24)):(a.M|=8,a.u|=64));return e}h.kb=function(a){if(!this.Ba)return this.h.kb(a);this.sa++;a=this.Tb(Kc(this,a,2));this.sa--;return a}; -h.Xa=function(a,b){this.Ba?(this.sa++,Lc(this,Kc(this,a,5),b),this.sa--):this.h.Xa(a,b)};h.lb=function(a,b){this.Ba?(this.sa++,this.$b(Kc(this,a,4),b),this.sa--):this.h.lb(a,b)};h.gc=function(a,b,c){return Mc(this,a,b,c)};h.hc=function(a,b,c){return Kc(this,Mc(this,a,b,c),c)};h.Tb=function(a){return Lb(this.h,a)};h.gd=function(a){return Lb(this.h,Kc(this,a,2))};h.$b=function(a,b){Mb(this.h,a,b&65535)};h.Zd=function(a,b){Mb(this.h,Kc(this,a,4),b)}; -function Nc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Mc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.W(d|c&a.P),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.g[d]:a.na[a.B>>12&3];return c}function Oc(a,b,c,d){a.w&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Mc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Kc(a,e|c&65536,4),a.v=a.B>>14&3,Mb(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.g[e]=d:a.na[a.B>>12&3]=d} -function Pc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.J(b,c,3),a=Jb(a.h,c)):a=a.g[c]&255;return a}function Qc(a,b){b>>=6;var c=a.C=b&7;return(b=a.A=(b&56)>>3)?Lb(a.h,a.J(b,c,2)):a.g[c]}function Rc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Mc(a,b,c,8)}function Sc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=Jb(a.h,c)):a=a.g[c]&255;return a}function Tc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Lb(a.h,a.J(b,c,2)):a.g[c]} -function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.tb=a.J(b,e,7),Lc(a,e,d.call(a,c,Jb(a.h,e)))):a.g[e]=a.g[e]&65280|d.call(a,c,a.g[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),Mb(a.h,e,d.call(a,c,Lb(a.h,e)))):a.g[e]=d.call(a,c,a.g[e])}function Uc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Lc(a,a.J(b,e,5),c):a.g[e]=c?d&1?c<<24>>24&65535:a.g[e]&-256|c&255:a.g[e]&-256;return c} -function Vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Mb(a.h,a.J(b,d,4),c):a.g[d]=c&65535;return c}function V(a,b,c){c&&(P(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} -h.mb=function(a){this.j.complete=!0;var b=a?this.j.Bb?0:1:-1;this.j.Bb=!1;this.qa=this.a=a;do{if(this.u){this.u&112&&(this.u&32?K(this,168,28):this.u&64?K(this,4,30):this.u&16&&K(this,12,32),this.u&=-113);if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Ab&224)>>5,e=this.N&&this.N.Ka>d?this.N:null;e&&(c=e.md,d=e.Ka);d>(this.B&224)>>5?(this.u&4&&(Cc(this,2),this.u&=-5),K(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.N,e==a)this.N=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e= -d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break}this.u=this.u&7|this.B&16;this.decode(Bc(this))}while(0=f&&(a.g[6]<=a.Da||65534<=a.g[6])&&(a.g[6]<=a.Da-32?(a.M|=4,a.g[6]=4,K(a,4,24)):(a.M|=8,a.u|=64));return e}h.kb=function(a){if(!this.Ba)return this.h.kb(a);this.ra++;a=this.Tb(Kc(this,a,2));this.ra--;return a}; +h.Ya=function(a,b){this.Ba?(this.ra++,Lc(this,Kc(this,a,5),b),this.ra--):this.h.Ya(a,b)};h.lb=function(a,b){this.Ba?(this.ra++,this.$b(Kc(this,a,4),b),this.ra--):this.h.lb(a,b)};h.gc=function(a,b,c){return Mc(this,a,b,c)};h.hc=function(a,b,c){return Kc(this,Mc(this,a,b,c),c)};h.Tb=function(a){return Kb(this.h,a)};h.gd=function(a){return Kb(this.h,Kc(this,a,2))};h.$b=function(a,b){Lb(this.h,a,b&65535)};h.Zd=function(a,b){Lb(this.h,Kc(this,a,4),b)}; +function Nc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Mc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.W(d|c&a.P),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.g[d]:a.ma[a.B>>12&3];return c}function Oc(a,b,c,d){a.w&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Mc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Kc(a,e|c&65536,4),a.v=a.B>>14&3,Lb(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.g[e]=d:a.ma[a.B>>12&3]=d} +function Pc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.J(b,c,3),a=Ib(a.h,c)):a=a.g[c]&255;return a}function Qc(a,b){b>>=6;var c=a.C=b&7;return(b=a.A=(b&56)>>3)?Kb(a.h,a.J(b,c,2)):a.g[c]}function Rc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Mc(a,b,c,8)}function Sc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=Ib(a.h,c)):a=a.g[c]&255;return a}function Tc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Kb(a.h,a.J(b,c,2)):a.g[c]} +function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.qb=a.J(b,e,7),Lc(a,e,d.call(a,c,Ib(a.h,e)))):a.g[e]=a.g[e]&65280|d.call(a,c,a.g[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),Lb(a.h,e,d.call(a,c,Kb(a.h,e)))):a.g[e]=d.call(a,c,a.g[e])}function Uc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Lc(a,a.J(b,e,5),c):a.g[e]=c?d&1?c<<24>>24&65535:a.g[e]&-256|c&255:a.g[e]&-256;return c} +function Vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Lb(a.h,a.J(b,d,4),c):a.g[d]=c&65535;return c}function V(a,b,c){c&&(P(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} +h.mb=function(a){this.l.complete=!0;var b=a?this.l.Bb?0:1:-1;this.l.Bb=!1;this.pa=this.a=a;do{if(this.u){this.u&112&&(this.u&32?K(this,168,28):this.u&64?K(this,4,30):this.u&16&&K(this,12,32),this.u&=-113);if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Ab&224)>>5,e=this.N&&this.N.Ka>d?this.N:null;e&&(c=e.md,d=e.Ka);d>(this.B&224)>>5?(this.u&4&&(Cc(this,2),this.u&=-5),K(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.N,e==a)this.N=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e= +d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break}this.u=this.u&7|this.B&16;this.decode(Bc(this))}while(0>1|b<<16;Fc(this,a);return a&65535}function ad(a,b){a=b&2048|b>>1|b<<8;Fc(this,a<<8);return a&255}function bd(a,b){a=b&~a;S(this,a);return a}function cd(a,b){a=b&~a;S(this,a<<8);return a}function dd(a,b){a|=b;S(this,a);return a}function ed(a,b){a|=b;S(this,a<<8);return a}function fd(a,b){a=~b|65536;Dc(this,a);return a&65535}function gd(a,b){a=~b|256;Dc(this,a<<8);return a&255} function hd(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function id(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.f=b&(b^c));return a&255}function jd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function kd(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function ld(a,b){a=-b;Dc(this,a,a&b&32768);return a&65535}function md(a,b){a=-b;Dc(this,a<<8,(a&b&128)<<8);return a&255} function nd(a,b){a=b<<1|this.m>>16&1;Fc(this,a);return a&65535}function od(a,b){a=b<<1|this.m>>16&1;Fc(this,a<<8);return a&255}function pd(a,b){a=(this.m&65536|b)>>1|b<<16;Fc(this,a);return a&65535}function qd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Fc(this,a<<8);return a&255}function rd(a,b){var c=b-a;Gc(this,c,a,b);return c&65535}function sd(a,b){var c=b-a;Gc(this,c<<8,a<<8,b<<8);return c&255}function td(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535} @@ -135,101 +134,102 @@ function Ed(a){S(this,Qc(this,a)&Tc(this,a));this.a-=this.c?4+(this.C&&6<=this.b function Kd(a){V(this,a,(this.i&65535?0:4)||!this.za()!=!(this.f&32768))}function Ld(a){V(this,a,R(this)||(this.i&65535?0:4))}function Md(a){V(this,a,!this.za()!=!(this.f&32768))}function Nd(a){V(this,a,this.za())}function Od(a){V(this,a,!!(this.i&65535))}function Pd(a){V(this,a,!this.za())}function Qd(){K(this,12,1);this.a-=5}function Rd(a){V(this,a,!0)}function Sd(a){V(this,a,!(this.f&32768))}function Td(a){V(this,a,this.f&32768?2:0)} function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function Ud(a){var b=Qc(this,a);a=Tc(this,a);Gc(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Vd(a){var b=Pc(this,a)<<8;a=Sc(this,a)<<8;Gc(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)} function Wd(a){var b=Tc(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function Xd(){K(this,24,2);this.a-=25} -function Yd(){this.B&49152?(this.M|=128,K(this,4,3)):this.D?this.D.b():G(this);this.a-=7}function Zd(){K(this,16,4);this.a-=25}var $d=[0,7,7,10,7,11,9,13];function ae(a){this.G=this.a;P(this,Rc(this,a));this.a=this.G-$d[this.c]}var be=[0,14,14,17,14,18,16,20];function ce(a){this.G=this.a;var b=Rc(this,a);a=a>>6&7;Hc(this,this.g[a]);this.g[a]=this.g[7];P(this,b);this.a=this.G-be[this.c]}var de=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function ee(a){var b=Qc(this,a);this.G=this.a;S(this,Vc(this,a,b));this.a=this.G-de[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function fe(a){var b=Pc(this,a);S(this,Uc(this,a,b,1)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var ge=[7,13,13,17,14,18,17,21]; +function Yd(){this.B&49152?(this.M|=128,K(this,4,3)):this.D?this.D.b():G(this);this.a-=7}function Zd(){K(this,16,4);this.a-=25}var $d=[0,7,7,10,7,11,9,13];function ae(a){this.F=this.a;P(this,Rc(this,a));this.a=this.F-$d[this.c]}var be=[0,14,14,17,14,18,16,20];function ce(a){this.F=this.a;var b=Rc(this,a);a=a>>6&7;Hc(this,this.g[a]);this.g[a]=this.g[7];P(this,b);this.a=this.F-be[this.c]}var de=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function ee(a){var b=Qc(this,a);this.F=this.a;S(this,Vc(this,a,b));this.a=this.F-de[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function fe(a){var b=Pc(this,a);S(this,Uc(this,a,b,1)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var ge=[7,13,13,17,14,18,17,21]; function he(a){var b=Tc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)P(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ne(a){U(this,a,Qc(this,a),rd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} -function oe(a){U(this,a,0,td);this.a-=this.c?9:3+(7==this.b?2:0)}function pe(){K(this,28,5);this.a-=5}function qe(){this.u&4||this.l&&this.l.da();this.u|=4;Cc(this,-2);this.a-=3}function re(a){U(this,a,Qc(this,a),ud);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,6)}function xc(a){se[a>>12].call(this,a)}function te(a){ue[a>>6&3].call(this,a)}function ve(a){we[a>>6&3].call(this,a)}function xe(a){ye[a>>6&3].call(this,a)}function ze(a){Ae[a&15].call(this,a)} -function Be(a){Ce[a&15].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)} +function oe(a){U(this,a,0,td);this.a-=this.c?9:3+(7==this.b?2:0)}function pe(){K(this,28,5);this.a-=5}function qe(){this.u|=4;Cc(this,-2);this.a-=3}function re(a){U(this,a,Qc(this,a),ud);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,6)}function xc(a){se[a>>12].call(this,a)}function te(a){ue[a>>6&3].call(this,a)}function ve(a){we[a>>6&3].call(this,a)}function xe(a){ye[a>>6&3].call(this,a)}function ze(a){Ae[a&15].call(this,a)}function Be(a){Ce[a&15].call(this,a)} +function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)} var se=[function(a){Je[a>>8&15].call(this,a)},ee,Ud,Ed,Ad,Cd,vd,Y,function(a){Ke[a>>8&15].call(this,a)},fe,Vd,Fd,Bd,Dd,ne,Y],Je=[function(a){Le[a>>4&15].call(this,a)},Rd,Od,Gd,Hd,Md,Id,Kd,ce,ce,te,ve,xe,Y,Y,Y],ue=[function(a){Dc(this,Vc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,hd);this.a-=this.c?9:3+(7==this.b?2:0)}],we=[function(a){U(this,a,0, ld);this.a-=this.c?11:6},function(a){U(this,a,R(this)?1:0,Wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,R(this)?1:0,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Tc(this,a);Dc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],ye=[function(a){U(this,a,0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,$c);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Yc);this.a-=this.c?9:3+(7==this.b?2:0)}], Le=[function(a){Me[a&15].call(this,a)},Y,Y,Y,ae,ae,ae,ae,le,Y,ze,Be,oe,oe,oe,oe],Me=[Yd,qe,ke,Qd,Zd,je,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ae=[ie,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ce=[ie,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Ke=[Pd,Nd,Jd,Ld,Sd,Td,yd,zd,Xd,pe,De,Fe,He,Y,Y,Y],Ee=[function(a){Dc(this, Uc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,kd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,id);this.a-=this.c?9:3+(7==this.b?2:0)}],Ge=[function(a){T(this,a,0,md);this.a-=this.c?11:6},function(a){T(this,a,R(this)?1:0,Xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,R(this)?1:0,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Sc(this,a);Dc(this,a<<8);this.a-=this.c?4:3+(7==this.b? -2:0)}],Ie=[function(a){T(this,a,0,qd);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ad);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Zc);this.a-=this.c?9:3+(7==this.b?2:0)}];function yc(a){Ne[a>>12].call(this,a)} -var Ne=[function(a){Oe[a>>8&15].call(this,a)},ee,Ud,Ed,Ad,Cd,vd,function(a){Pe[a>>8&15].call(this,a)},function(a){Qe[a>>8&15].call(this,a)},fe,Vd,Fd,Bd,Dd,ne,Y],Oe=[function(a){Re[a>>4&15].call(this,a)},Rd,Od,Gd,Hd,Md,Id,Kd,ce,ce,te,ve,xe,function(a){Se[a>>6&3].call(this,a)},Y,Y],Se=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.W(a|this.P);P(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Nc(this,a,0);Hc(this,a);S(this,a);this.a-=11},function(a){var b=Jc(this);this.G= -this.a;Oc(this,a,0,b);S(this,b);this.a=this.G-ge[this.c]},function(a){S(this,Vc(this,a,this.za?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Re=[function(a){Te[a&15].call(this,a)},Y,Y,Y,ae,ae,ae,ae,le,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,6)},ze,Be,oe,oe,oe,oe],Te=[Yd,qe,ke,Qd,Zd,je,function(){Ic(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Pe=[he,he,Wd,Wd,wd,wd,xd,xd,re,re,Y,Y,Y,Y,me,me],Qe=[Pd,Nd,Jd,Ld,Sd,Td,yd,zd,Xd,pe,De,Fe,He,function(a){Ue[a>>6& -3].call(this,a)},Y,Y],Ue=[Y,function(a){a=Nc(this,a,65536);Hc(this,a);S(this,a);this.a-=11},function(a){var b=Jc(this);this.G=this.a;Oc(this,a,65536,b);S(this,b);this.a=this.G-ge[this.c]},Y]; -function Ve(a){x.call(this,"ROM",a,Ve);this.X=this.b=null;this.i=a.addr;this.c=a.size;this.f=a.alias;this.l=a.file;this.m=q(this.l);if(this.l){a=this.l;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.F("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Sa(c.oa,a,b),(a=ta(a,b))?(c.b=a.K,c.X=a.X):c.l=null);We(c)})}}z(Ve);Ve.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;We(this)}; -Ve.prototype.la=function(){this.X&&(this.D&&this.D.a(this.id,this.i,this.c,this.X),delete this.X);return!0};Ve.prototype.ka=function(){return!0}; -function We(a){if(!Wa(a)){if(a.l){if(!a.b||!a.h)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c)Xa(a,"ROM size ("+m(a.b.length,8,!0)+") does not match specified size ("+m(a.c,8,!0)+")");else{var b;b=a.i;if(Fb(a.h,b,a.c,cc)){var c;for(c=0;c>12].call(this,a)} +var Ne=[function(a){Oe[a>>8&15].call(this,a)},ee,Ud,Ed,Ad,Cd,vd,function(a){Pe[a>>8&15].call(this,a)},function(a){Qe[a>>8&15].call(this,a)},fe,Vd,Fd,Bd,Dd,ne,Y],Oe=[function(a){Re[a>>4&15].call(this,a)},Rd,Od,Gd,Hd,Md,Id,Kd,ce,ce,te,ve,xe,function(a){Se[a>>6&3].call(this,a)},Y,Y],Se=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.W(a|this.P);P(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Nc(this,a,0);Hc(this,a);S(this,a);this.a-=11},function(a){var b=Jc(this);this.F= +this.a;Oc(this,a,0,b);S(this,b);this.a=this.F-ge[this.c]},function(a){S(this,Vc(this,a,this.za?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Re=[function(a){Te[a&15].call(this,a)},Y,Y,Y,ae,ae,ae,ae,le,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,6)},ze,Be,oe,oe,oe,oe],Te=[Yd,qe,ke,Qd,Zd,je,function(){Ic(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Pe=[he,he,Wd,Wd,wd,wd,xd,xd,re,re,Y,Y,Y,Y,me,me],Qe=[Pd,Nd,Jd,Ld,Sd,Td,yd,zd,Xd,pe,De,Fe,He,function(a){Ue[a>>6& +3].call(this,a)},Y,Y],Ue=[Y,function(a){a=Nc(this,a,65536);Hc(this,a);S(this,a);this.a-=11},function(a){var b=Jc(this);this.F=this.a;Oc(this,a,65536,b);S(this,b);this.a=this.F-ge[this.c]},Y]; +function Ve(a){x.call(this,"ROM",a,Ve);this.X=this.b=null;this.i=a.addr;this.c=a.size;this.f=a.alias;this.j=a.file;this.m=q(this.j);if(this.j){a=this.j;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(Sa(c.na,a,b),(a=ta(a,b))?(c.b=a.K,c.X=a.X):c.j=null);We(c)})}}z(Ve);Ve.prototype.ha=function(a,b,c,d){this.h=b;this.a=c;this.D=d;We(this)}; +Ve.prototype.ka=function(){this.X&&(this.D&&this.D.a(this.id,this.i,this.c,this.X),delete this.X);return!0};Ve.prototype.ja=function(){return!0}; +function We(a){if(!Wa(a)){if(a.j){if(!a.b||!a.h)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c)Xa(a,"ROM size ("+m(a.b.length,8,!0)+") does not match specified size ("+m(a.c,8,!0)+")");else{var b;b=a.i;if(Eb(a.h,b,a.c,cc)){var c;for(c=0;c>>a.c;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),t=k,w=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Xa(p++,b[t++]&255);else p&1?G(a.a):Ac(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e>>a.c;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),t=k,w=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Ya(p++,b[t++]&255);else p&1?G(a.a):Ac(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.w&&(e.w-=32),e.b|=128,e.b&64&&Rb(e.a,e.aa))});this.ea=Ub(52,4);this.P=Qb(this.a,function(){e.c|=128;e.c&64&&Rb(e.a,e.ea)});cb(b,this,bf);F(this)}; -h.Kb=function(){if(!this.v){var a=oc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Pa)return;b=pa(b[1]);if(this.v=Ta(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.oa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.la=function(a,b){if(!b)if(this.Kb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ka=function(a){return a?this.save():!0};h.reset=function(){cf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return cf(this)};function cf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.yb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.G&&!this.s&&c&&(b=String.fromCharCode(this.G)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.T(this.m), -this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Sb(this.a,this.P,1E3/Math.round(this.I/10))}};var df={},bf=(df[65392]=[null,null,Z.prototype.Qc,Z.prototype.Id,"RCSR"],df[65394]=[null,null,Z.prototype.Pc,Z.prototype.Hd,"RBUF"],df[65396]=[null,null,Z.prototype.jd,Z.prototype.ae,"XCSR"],df[65398]=[null,null,Z.prototype.hd,Z.prototype.$d,"XBUF"],df);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;be.w&&(e.w-=32),e.b|=128,e.b&64&&Qb(e.a,e.aa))});this.da=Sb(52,4);this.P=Pb(this.a,function(){e.c|=128;e.c&64&&Qb(e.a,e.da)});cb(b,this,bf);F(this)}; +h.Lb=function(){if(!this.v){var a=oc(this.j,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Pa)return;b=pa(b[1]);if(this.v=Ta(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Lb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ja=function(a){return a?this.save():!0};h.reset=function(){cf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return cf(this)};function cf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.yb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.F&&!this.s&&c&&(b=String.fromCharCode(this.F)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.T(this.m), +this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Rb(this.a,this.P,1E3/Math.round(this.I/10))}};var df={},bf=(df[65392]=[null,null,Z.prototype.Qc,Z.prototype.Id,"RCSR"],df[65394]=[null,null,Z.prototype.Pc,Z.prototype.Hd,"RBUF"],df[65396]=[null,null,Z.prototype.jd,Z.prototype.ae,"XCSR"],df[65398]=[null,null,Z.prototype.hd,Z.prototype.$d,"XBUF"],df);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a= -d.o.listTapes;a&&gf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.G){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;gf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; -h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;this.J=hf(a);var e=this;if((this.c=oc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){u("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.N=Ub(56,4);this.R=Qb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.O;g?a.F('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Sa(a.oa,e,f),(e=ta(e,f))&&rf(a,b,c,d,e.K,e.ga,e.fa)); -a.j.Fa=!1;a.m&&(a.m--,a.m||F(a));of(a)})}function lf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;dc.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.sb?"":e)+"&format=json"));return!!r(f, +d.o.listTapes;a&&gf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;gf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; +h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.D=d;this.J=hf(a);var e=this;if((this.c=oc(this.j,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){u("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.N=Sb(56,4);this.R=Pb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.j&&!a.j.l.O;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Sa(a.na,e,f),(e=ta(e,f))&&rf(a,b,c,d,e.K,e.fa,e.ea)); +a.l.Fa=!1;a.m&&(a.m--,a.m||F(a));of(a)})}function lf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;dc.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.tb?"":e)+"&format=json"));return!!r(f, null,!0,function(b,c,d){yf(a,b,c,d)})} -function yf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.O;if(d)a.controller.F('Unable to load disk "'+a.va+'" (error '+d+": "+b+")",f);else{Sa(a.controller.oa,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)u(k[0]);else{a.V=k.length;a.Z=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ha=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var E=n<<2,xa=w.length;xa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f=a.ma+a.ba&&(a.ba+=f-(a.ma+a.ba)+1):(a.ma=f,a.ba=1);d[f]=d[f]&~(255<g)break;e|=g<d&&a.j&&!a.j.l.O;if(d)a.controller.G('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{Sa(a.controller.na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)u(k[0]);else{a.V=k.length;a.Z=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ga=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var E=n<<2,xa=w.length;xa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f=a.la+a.ba&&(a.ba+=f-(a.la+a.ba)+1):(a.la=f,a.ba=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.F("Unable to restore disk '"+this.va+": "+c);return b}; +b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.G("Unable to restore disk '"+this.ua+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=Af(this,a++);)Cf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; function Cf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function O(a){x.call(this,"RL11",a,O);this.f=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Ba("Mobi")&&window&&"FileReader"in window}z(O);h=O.prototype; h.$=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Df(d,a)},!0;case "loadDrive":return this.o[b]= c,c.onclick=function(){var a=d.o.listDisks;a&&Ef(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,k;k=Af(a,c++);)for(var l=0,n=k.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Df(this,0)}}return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){Ff(this)};h.save=function(){return(new Q(this)).data()}; -h.restore=function(a){return Ff(this,a[0])};function If(a,b){b||(a.s=0);if(a.f)for(var c in a.f){var d=a.f[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.F("Unable to load the selected drive");else if(c)if("?"==c)a.F('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Kf(a,e,b,c,!1,d)}else Jf(a,e)} -function Kf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ea.toLowerCase()!=d.toLowerCase()&&(g++,Jf(a,b,!0),k.rb?a.F("RL11 busy"):(k.rb=!0,e&&(k.qb=!0,a.s++),k.ib=!!f,xf(new tf(a,k,"preload"),c,d,f,a.dc)&&g++));return g} -h.dc=function(a,b,c,d,e){var f;a.rb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.V||f[1]>a.Z)&&(this.F('Disk "'+c+'" too large for drive '+("RL"+a.wb)),b=null);b?(a.ca=b,a.va=c,a.Ea=d,this.F('Mounted disk "'+c+'" in drive '+("RL"+a.wb),a.qb||e),this.l&&uc(this.l)):a.ib=!1;a.qb&&(a.qb=!1,--this.s||F(this));Df(this,a.wb)}; +h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.D=d;if((this.f=oc(this.j,"autoMount")||this.f)&&"string"==typeof this.f)try{this.f=eval("("+this.f+")")}catch(e){u("RL11 auto-mount error: "+e.message+" ("+this.f+")"),this.f=null}Ff(this);this.F=Sb(112,5);cb(b,this,Gf,2097152);Hf(this,"None","",!0);this.A&&Hf(this,"Local Disk","?");Hf(this,"Remote Disk","??");If(this)||F(this)}; +h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.j.Hb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Df(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Ff(this)};h.save=function(){return(new Q(this)).data()}; +h.restore=function(a){return Ff(this,a[0])};function If(a,b){b||(a.s=0);if(a.f)for(var c in a.f){var d=a.f[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Kf(a,e,b,c,!1,d)}else Jf(a,e)} +function Kf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ea.toLowerCase()!=d.toLowerCase()&&(g++,Jf(a,b,!0),k.sb?a.G("RL11 busy"):(k.sb=!0,e&&(k.rb=!0,a.s++),k.ib=!!f,xf(new tf(a,k,"preload"),c,d,f,a.dc)&&g++));return g} +h.dc=function(a,b,c,d,e){var f;a.sb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.V||f[1]>a.Z)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.wb)),b=null);b?(a.ca=b,a.ua=c,a.Ea=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.wb),a.rb||e),this.j&&uc(this.j)):a.ib=!1;a.rb&&(a.rb=!1,--this.s||F(this));Df(this,a.wb)}; function Hf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; -h.wc=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var t,w;if(0>(t=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Mb(this.h,f,t|w<<8);if(Pb(this.h)){k=8192;break}f+=2;if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)}; -h.qd=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){var t=Lb(this.h,f);if(Pb(this.h)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,t&255)||!a.ca.write(n,p++,t>>8)){k=5120;break}if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Tc=function(){return this.L&65535}; +h.wc=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var t,w;if(0>(t=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Lb(this.h,f,t|w<<8);if(Ob(this.h)){k=8192;break}f+=2;if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)}; +h.qd=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){var t=Kb(this.h,f);if(Ob(this.h)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,t&255)||!a.ca.write(n,p++,t>>8)){k=5120;break}if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Tc=function(){return this.L&65535}; h.Ld=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.wc;case 10:b||(b=this.qd),d=this.c>>7,e=this.c&64?0:1,f=this.c&63,d>=c.V||f>=c.S?this.L|=37888:(g=(this.w& -63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.ec.bind(this)))}a&&(this.L|=129,this.L&64&&Rb(this.a,this.G))}};h.Rc=function(){return this.v};h.Jd=function(a){this.v=a&65534};h.Uc=function(){return this.c};h.Md=function(a){this.c=a};h.Vc=function(){return this.m};h.Nd=function(a){this.m=a};h.Sc=function(){return this.w};h.Kd=function(a){this.w=a&63}; +63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.ec.bind(this)))}a&&(this.L|=129,this.L&64&&Qb(this.a,this.F))}};h.Rc=function(){return this.v};h.Jd=function(a){this.v=a&65534};h.Uc=function(){return this.c};h.Md=function(a){this.c=a};h.Vc=function(){return this.m};h.Nd=function(a){this.m=a};h.Sc=function(){return this.w};h.Kd=function(a){this.w=a&63}; var Lf={},Gf=(Lf[63744]=[null,null,O.prototype.Tc,O.prototype.Ld,"RLCS"],Lf[63746]=[null,null,O.prototype.Rc,O.prototype.Jd,"RLBA"],Lf[65284]=[null,null,O.prototype.Uc,O.prototype.Md,"RLDA"],Lf[65286]=[null,null,O.prototype.Vc,O.prototype.Nd,"RLMP"],Lf[65288]=[null,null,O.prototype.Sc,O.prototype.Kd,"RLBE"],Lf); -function Mf(a,b,c){x.call(this,"Computer",a,Mf);this.j.O=!1;Nf(this,b);this.A=oc(this,"autoPower",a);this.l=0;this.N=a.busWidth||a.buswidth;this.b=Of;this.v=null;this.m=this.I=!1;this.P=oc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Pf(this);if(this.a=Ua("CPU",this.id)){this.D=Ua("Debugger",this.id);this.h=new vb({id:this.oa+".bus",busWidth:this.N},this.a,this.D);var d,e=A(this.id);if((this.f=Ua("Panel",this.id))&&this.f.Va)for(b=0;b\nLicense: GPL version 3 or later ");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bOf){if(Qf(d,this.v)){this.i=new Q(this,"1.30.3","failsafe");Qf(this.i)&&(Vf(this,d),a=2,Wf(this.i));this.i.set("timestamp",sa());Xf(this.i);var e=this.b&&!this.m;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Uf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Qf(d,g):("error"== -f&&"no machine state"!=g?(this.F("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),Wf(d),Qf(d)?(c=Uf(d),e=!0):c=!1))}e&&Tf(this,c?d:null)}else 2==a&&d.clear()}else Tf(this);delete this.v;delete this.w}e=A(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.j.O=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Yf(this,this.a,b,c,a),this.da(),this.a.Ua());this.G&&(Vf(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.l=0}; +function Tf(a,b){var c=new Q(a,"1.30.3","validate");if(Qf(c)&&Uf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Mf.prototype; +h.Xa=function(a){void 0===a&&(a=this.b||(this.v?1:Of));if(!this.j){this.j++;var b=!1,c=!1;this.F=!1;var d=this.w||new Q(this,"1.30.3");if(-1==a)b=!0;else if(a>Of){if(Qf(d,this.v)){this.i=new Q(this,"1.30.3","failsafe");Qf(this.i)&&(Vf(this,d),a=2,Wf(this.i));this.i.set("timestamp",sa());Xf(this.i);var e=this.b&&!this.m;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Uf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Qf(d,g):("error"== +f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),Wf(d),Qf(d)?(c=Uf(d),e=!0):c=!1))}e&&Tf(this,c?d:null)}else 2==a&&d.clear()}else Tf(this);delete this.v;delete this.w}e=A(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.l.O=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Yf(this,this.a,b,c,a),this.va(),this.a.Ua());this.F&&(Vf(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.j=0}; function Vf(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.P;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} -function ag(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new Q(a,"1.30.3"),g=new Q(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ka&&(c&&G(a.a),d=a.a.ka(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.O=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l(b.w+=a))){for(a=0;a