Fixed the LED (lamp) test, fixed Front Panel update on a machine RESET, and cleaned up the status update code a bit

This commit is contained in:
Jeff 2016-11-03 10:28:54 -07:00 committed by Jeff Parsons
commit 57bceb4da9
7 changed files with 554 additions and 512 deletions

View file

@ -13,12 +13,10 @@ machines:
Toggle-Ins Toggle-Ins
---------- ----------
From the [PDP-11/70 Maintenance Service Guide](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Maintenance_Service_Guide_Apr88.pdf), As DEC explains in its [PDP-11/70 Maintenance Service Guide](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Maintenance_Service_Guide_Apr88.pdf),
Chapter 4: Chapter 4: "There are several useful toggle-ins that are probably not very well known." Excerpts are listed below.
There are several useful toggle-ins that are probably not very well known. They are as follows: ### Memory Management
Memory Management
Use the following toggle-in to verify the correct operation of Memory Management Relocation. Use the following toggle-in to verify the correct operation of Memory Management Relocation.
@ -79,9 +77,7 @@ which should produce these results:
>> dw 300 l1 >> dw 300 l1
000300 70707 000300 70707
--- ### Unibus Map Checkout
Unibus Map Checkout
Use the following console operating procedure to verify the correct operation of the Unibus Map. Use the following console operating procedure to verify the correct operation of the Unibus Map.

View file

@ -744,6 +744,7 @@ ComputerPDP11.prototype.donePowerOn = function(aParms)
* TODO: Do we not care about the return value here? (ie, is checking fRestoreError sufficient)? * TODO: Do we not care about the return value here? (ie, is checking fRestoreError sufficient)?
*/ */
this.powerRestore(this.cpu, stateComputer, fRepower, fRestore); this.powerRestore(this.cpu, stateComputer, fRepower, fRestore);
this.updateStatus();
this.cpu.autoStart(); this.cpu.autoStart();
} }
@ -955,26 +956,31 @@ ComputerPDP11.prototype.powerOff = function(fSave, fShutdown)
* allocated the Bus object ourselves, after all the other components were allocated, it ends * allocated the Bus object ourselves, after all the other components were allocated, it ends
* up near the end of Component's list of components. Hence the special case for this.bus below. * up near the end of Component's list of components. Hence the special case for this.bus below.
* *
* 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.
*
* @this {ComputerPDP11} * @this {ComputerPDP11}
*/ */
ComputerPDP11.prototype.reset = function() ComputerPDP11.prototype.reset = function()
{ {
if (this.bus && this.bus.reset) { if (this.bus && this.bus.reset) {
/*
* TODO: Why does WebStorm think that this.bus.type is undefined? The base class (Component)
* constructor defines it.
*/
this.printMessage("Resetting " + this.bus.type); this.printMessage("Resetting " + this.bus.type);
this.bus.reset(); this.bus.reset();
} }
if (this.cpu && this.cpu.reset) {
this.printMessage("Resetting " + this.cpu.type);
this.cpu.reset();
}
var aComponents = Component.getComponents(this.id); var aComponents = Component.getComponents(this.id);
for (var iComponent = 0; iComponent < aComponents.length; iComponent++) { for (var iComponent = 0; iComponent < aComponents.length; iComponent++) {
var component = aComponents[iComponent]; var component = aComponents[iComponent];
if (component !== this && component !== this.bus && component.reset) { if (component !== this && component !== this.bus && component !== this.cpu && component.reset) {
this.printMessage("Resetting " + component.type); this.printMessage("Resetting " + component.type);
component.reset(); component.reset();
} }
} }
this.updateStatus(true);
}; };
/** /**
@ -1027,6 +1033,44 @@ ComputerPDP11.prototype.stop = function(ms, nCycles)
this.updateStatus(true); this.updateStatus(true);
}; };
/**
* updateStatus(fForce)
*
* TODO: Notify all (other) components with an updateStatus() method that the computer's state has changed.
*
* 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.
*
* 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.
*
* 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.
*
* TODO: Consider alternate approaches to these largely register-oriented display updates. Ordinarily, we like to
* separate logic from presentation, and currently the CPUState contains both, since it's the component that intimately
* knows the names, number, sizes, etc, of all the active registers. The Panel component is the logical candidate,
* but Panel is an optional component; it's often the case that only machines that include the Debugger also include
* 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)
{
/*
* 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
* 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.
*/
if (this.cpu) this.cpu.updateStatus(fForce);
if (this.panel) this.panel.updateStatus(fForce);
};
/** /**
* setBinding(sType, sBinding, control, sValue) * setBinding(sType, sBinding, control, sValue)
* *
@ -1429,41 +1473,6 @@ ComputerPDP11.prototype.setFocus = function(fScroll)
} }
}; };
/**
* updateStatus(fForce)
*
* 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.
*
* 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.
*
* 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.
*
* TODO: Consider alternate approaches to these largely register-oriented display updates. Ordinarily, we like to
* separate logic from presentation, and currently the CPUState contains both, since it's the component that intimately
* knows the names, number, sizes, etc, of all the active registers. The Panel component is the logical candidate,
* but Panel is an optional component; generally, only machines that include Debugger also include 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)
{
/*
* 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
* 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.
*/
if (this.cpu) this.cpu.updateStatus(fForce);
if (this.panel) this.panel.updateStatus(fForce);
};
/** /**
* ComputerPDP11.init() * ComputerPDP11.init()
* *

View file

@ -282,11 +282,7 @@ CPUPDP11.prototype.powerUp = function(data, fRepower)
* is now responsible for managing a component's fPowered flag, not us. * is now responsible for managing a component's fPowered flag, not us.
* *
* this.flags.powered = true; * this.flags.powered = true;
*
* And we don't have to worry whether this.cmp is set, because powerUp() handlers are never called
* before initBus() handlers.
*/ */
this.cmp.updateStatus();
return true; return true;
}; };
@ -508,6 +504,17 @@ CPUPDP11.prototype.setBinding = function(sType, sBinding, control, sValue)
return false; return false;
}; };
/**
* updateComputer(fForce)
*
* @this {CPUPDP11}
* @param {boolean} [fForce]
*/
CPUPDP11.prototype.updateComputer = function(fForce)
{
if (this.cmp) this.cmp.updateStatus(fForce);
};
/** /**
* updateStatus(fForce) * updateStatus(fForce)
* *
@ -1094,7 +1101,7 @@ CPUPDP11.prototype.runCPU = function()
if (this.nCyclesNextYield <= 0) { if (this.nCyclesNextYield <= 0) {
this.nCyclesNextYield += this.nCyclesPerYield; this.nCyclesNextYield += this.nCyclesPerYield;
if (++this.nYieldsSinceStatusUpdate >= CPUPDP11.YIELDS_PER_STATUS) { if (++this.nYieldsSinceStatusUpdate >= CPUPDP11.YIELDS_PER_STATUS) {
if (this.cmp) this.cmp.updateStatus(); this.updateComputer();
this.nYieldsSinceStatusUpdate = 0; this.nYieldsSinceStatusUpdate = 0;
} }
break; break;
@ -1209,7 +1216,7 @@ CPUPDP11.prototype.yieldCPU = function()
* odd for those messages to show CPU state changes if the Control Panel, Video display, etc, does not, * 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. * so I've added this call to try to keep things looking synchronized.
*/ */
if (this.cmp) this.cmp.updateStatus(); this.updateComputer();
}; };
if (NODE) module.exports = CPUPDP11; if (NODE) module.exports = CPUPDP11;

View file

@ -1413,9 +1413,8 @@ PDP11.opRESET = function(opCode)
if (!(this.regPSW & PDP11.PSW.CMODE)) { if (!(this.regPSW & PDP11.PSW.CMODE)) {
this.bus.reset(); this.bus.reset();
this.resetRegs(); this.resetRegs();
// display.data = this.regsGen[0]; // TODO: Review
} }
this.nStepCycles -= 667; // TODO: Review (but it's definitely a big number) this.nStepCycles -= 667; // TODO: Review (but it's definitely a big number)
}; };
/** /**

View file

@ -63,12 +63,16 @@ function PanelPDP11(parmsPanel)
this.fDisplayLiveRegs = true; this.fDisplayLiveRegs = true;
/* /*
* regSwitches contains the Console (Front Panel) Switch Register, which is also available as a * regSwitches contains the Front Panel (aka Console) 'SWITCH' register, which is also available
* read-only register at 177570 (but only the low 16 bits). * as a read-only register at 177570 (but only the low 16 bits).
* *
* regAddr is an internal register containing the contents of the Front Panel's ADDRESS display, * regAddr is an internal register containing the contents of the Front Panel's 'ADDRESS' display,
* and regData corresponds to the DATA display. They are updated by setAddr() and setData(), * and regData corresponds to the 'DATA' display. They are updated by setAddr() and setData(),
* which in turn take care of calling setLEDArray(). * which in turn take care of calling setLEDArray().
*
* The state of ALL switches is maintained in this.switches, and likewise all LED states are
* maintained in this.leds, but for convenience, we also mirror some of those states in dedicated
* variables (eg, regSwitches for the 'SWITCH' register, fLEDTest for the 'TEST' switch, etc).
*/ */
this.regSwitches = 0; this.regSwitches = 0;
this.regAddr = this.regData = 0; this.regAddr = this.regData = 0;
@ -82,7 +86,7 @@ function PanelPDP11(parmsPanel)
* register (regData) [the equivalent of selecting 'DISPLAY REGISTER'] except when data is being * register (regData) [the equivalent of selecting 'DISPLAY REGISTER'] except when data is being
* examined or deposited [the equivalent of selecting 'DATA PATHS']. * examined or deposited [the equivalent of selecting 'DATA PATHS'].
*/ */
this.fLampTest = false; // lamp (LED) test in progress this.fLEDTest = false; // LED (lamp) test in progress
this.fExamine = false; // true if the previously pressed switch was the 'EXAM' switch this.fExamine = false; // true if the previously pressed switch was the 'EXAM' switch
this.fDeposit = false; // true if the previously pressed switch was the 'DEP' switch this.fDeposit = false; // true if the previously pressed switch was the 'DEP' switch
this.nAddrSel = PanelPDP11.ADDRSEL.CONS_PHY; this.nAddrSel = PanelPDP11.ADDRSEL.CONS_PHY;
@ -107,11 +111,11 @@ function PanelPDP11(parmsPanel)
* *
* initBus() will call displaySwitches() to ensure that every switch is the position represented below. * initBus() will call displaySwitches() to ensure that every switch is the position represented below.
* *
* NOTE: Not all switches have the same "process" criteria. For example, 'TEST' will perform a lamp test * NOTE: Not all switches have the same "process" criteria. For example, 'TEST' will perform a LED test
* when it is momentarily pressed "up", whereas 'LOAD [ADRS]' will load the ADDRESS register from the SWITCH * when it is momentarily pressed "up", whereas 'LOAD [ADRS]' will load the 'ADDRESS' register from the
* register when it is momentarily pressed "down". * 'SWITCH' register when it is momentarily pressed "down".
* *
* This means that processLampTest(value) must act when value == 1 ("up"), whereas processLoadAddr(value) * This means that processLEDTest(value) must act when value == 1 ("up"), whereas processLoadAddr(value)
* must act when value == 0 ("down"). You can infer all this from the table below, because the initial value * must act when value == 0 ("down"). You can infer all this from the table below, because the initial value
* of any momentary switch is its "inactive" value, so the opposite is its "active" value. * of any momentary switch is its "inactive" value, so the opposite is its "active" value.
*/ */
@ -123,7 +127,7 @@ function PanelPDP11(parmsPanel)
'DEP': [0, true, false, this.processDeposit], 'DEP': [0, true, false, this.processDeposit],
'EXAM': [1, true, false, this.processExamine], 'EXAM': [1, true, false, this.processExamine],
'LOAD': [1, true, false, this.processLoadAddr], 'LOAD': [1, true, false, this.processLoadAddr],
'TEST': [0, true, false, this.processLampTest] 'TEST': [0, true, false, this.processLEDTest]
}; };
for (var i = 0; i < 22; i++) { for (var i = 0; i < 22; i++) {
this.switches['S'+i] = [0, false, false, this.processSwitchReg, i]; this.switches['S'+i] = [0, false, false, this.processSwitchReg, i];
@ -203,10 +207,18 @@ PanelPDP11.prototype.getSwitch = function(name)
/** /**
* reset() * reset()
* *
* NOTE: Since we've registered our handler with the Bus component, we will be called twice whenever
* the entire machine is reset: once when the Computer's reset() handler calls the Bus's reset() handler,
* and again when the Computer's reset() handler calls us directly. Multiple resets should be harmless.
*
* @this {PanelPDP11} * @this {PanelPDP11}
*/ */
PanelPDP11.prototype.reset = function() PanelPDP11.prototype.reset = function()
{ {
/*
* Simulate a call to our stop() handler, to update the panel's 'ADDRESS' register with the current PC.
*/
this.stop();
}; };
/** /**
@ -346,15 +358,9 @@ PanelPDP11.prototype.powerUp = function(data, fRepower)
*/ */
PanelPDP11.init(); PanelPDP11.init();
/* /*
* TODO: Until we implement a restore() function, all we can do is reset(); however, that's * TODO: Until we implement a restore() function, all we can do is reset()
* currently unnecessary, since we've added reset() to the addResetHandler() list.
*
* this.reset();
*
* In the meantime, simulate a call to our stop() handler, to update the panel's ADDRESS register
* with the new PC.
*/ */
this.stop(); this.reset();
} }
return true; return true;
}; };
@ -491,8 +497,14 @@ PanelPDP11.prototype.pressSwitch = function(sBinding)
*/ */
if (sw[3]) sw[3].call(this, sw[0], sw[4]); if (sw[3]) sw[3].call(this, sw[0], sw[4]);
this.fDeposit = (sBinding == PanelPDP11.SWITCH.DEP); /*
this.fExamine = (sBinding == PanelPDP11.SWITCH.EXAM); * This helps the next 'DEP' or 'EXAM' press determine if the previous press was the same,
* while also ignoring any intervening 'STEP' presses (see processStep() for why we do that).
*/
if (sBinding != PanelPDP11.SWITCH.STEP) {
this.fDeposit = (sBinding == PanelPDP11.SWITCH.DEP);
this.fExamine = (sBinding == PanelPDP11.SWITCH.EXAM);
}
}; };
/** /**
@ -562,8 +574,11 @@ PanelPDP11.prototype.processStart = function(value, index)
* processStep(value, index) * processStep(value, index)
* *
* If value == 1 (our initial value), then the 'STEP' switch is set to "S INST" (step one instruction); * If value == 1 (our initial value), then the 'STEP' switch is set to "S INST" (step one instruction);
* otherwise, it's set to "S BUS CYCLE" (step one bus cycle). Note that we don't actually support the * otherwise, it's set to "S BUS CYCLE" (step one bus cycle).
* latter. *
* However, since we can't currently support cycle-stepping, I've decided to change the meaning of this
* switch: the normal ("up") position means that successive 'EXAM' and 'DEP' operations will first add 2
* to the 'ADDRESS' register, while the opposite ("down") position means they will first subtract 2.
* *
* @this {PanelPDP11} * @this {PanelPDP11}
* @param {number} value * @param {number} value
@ -649,7 +664,7 @@ PanelPDP11.prototype.processContinue = function(value, index)
} }
/* /*
* Simulate a call to our stop() handler, to update the panel's ADDRESS register with the new PC. * Simulate a call to our stop() handler, to update the panel's 'ADDRESS' register with the new PC.
*/ */
this.stop(); this.stop();
@ -658,8 +673,8 @@ PanelPDP11.prototype.processContinue = function(value, index)
* updateStatus() handlers will be called, including ours. * updateStatus() 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 updateStatus();
* unfortunately, it will have happened BEFORE we called stop() to update the ADDRESS register, so we * unfortunately, it will have happened BEFORE we called stop() to update the 'ADDRESS' register, so
* still need to call it again. * we still need to call it again.
*/ */
if (this.cmp) this.cmp.updateStatus(); if (this.cmp) this.cmp.updateStatus();
} }
@ -679,9 +694,7 @@ PanelPDP11.prototype.processContinue = function(value, index)
PanelPDP11.prototype.processDeposit = function(value, index) PanelPDP11.prototype.processDeposit = function(value, index)
{ {
if (value && !this.cpu.isRunning()) { if (value && !this.cpu.isRunning()) {
if (this.fDeposit) { if (this.fDeposit) this.advanceAddr();
this.setAddr(this.regAddr + 2);
}
var w = this.setData(this.regSwitches); var w = this.setData(this.regSwitches);
if (this.nAddrSel == PanelPDP11.ADDRSEL.CONS_PHY) { if (this.nAddrSel == PanelPDP11.ADDRSEL.CONS_PHY) {
this.bus.setWordDirect(this.regAddr, w); this.bus.setWordDirect(this.regAddr, w);
@ -704,10 +717,8 @@ PanelPDP11.prototype.processDeposit = function(value, index)
PanelPDP11.prototype.processExamine = function(value, index) PanelPDP11.prototype.processExamine = function(value, index)
{ {
if (!value && !this.cpu.isRunning()) { if (!value && !this.cpu.isRunning()) {
if (this.fExamine) {
this.setAddr(this.regAddr + 2);
}
var w; var w;
if (this.fExamine) this.advanceAddr();
if (this.nAddrSel == PanelPDP11.ADDRSEL.CONS_PHY) { if (this.nAddrSel == PanelPDP11.ADDRSEL.CONS_PHY) {
w = this.bus.getWordDirect(this.regAddr); w = this.bus.getWordDirect(this.regAddr);
} else { } else {
@ -735,15 +746,21 @@ PanelPDP11.prototype.processLoadAddr = function(value, index)
}; };
/** /**
* processLampTest(value, index) * processLEDTest(value, index)
* *
* @this {PanelPDP11} * @this {PanelPDP11}
* @param {number} value * @param {number} value
* @param {number} [index] * @param {number} [index]
*/ */
PanelPDP11.prototype.processLampTest = function(value, index) PanelPDP11.prototype.processLEDTest = function(value, index)
{ {
this.displayLEDs(value || null); if (value) {
this.fLEDTest = true;
this.displayLEDs(true);
} else {
this.fLEDTest = false;
this.displayLEDs();
}
}; };
/** /**
@ -776,6 +793,20 @@ PanelPDP11.prototype.setAddr = function(value)
return this.regAddr; return this.regAddr;
}; };
/**
* advanceAddr()
*
* @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;
this.setLEDArray("A", this.regAddr, 22);
return this.regAddr;
};
/** /**
* setData(value) * setData(value)
* *
@ -801,7 +832,7 @@ PanelPDP11.prototype.setData = function(value)
PanelPDP11.prototype.setLED = function(sBinding, value) PanelPDP11.prototype.setLED = function(sBinding, value)
{ {
this.leds[sBinding] = value; this.leds[sBinding] = value;
if (!this.fLampTest) this.displayLED(sBinding, value); if (!this.fLEDTest) this.displayLED(sBinding, value);
return value; return value;
}; };

View file

@ -40,279 +40,279 @@ 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<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Ba=Date.now||function(){return+new Date};function Da(){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 Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Ba=Date.now||function(){return+new Date};function Da(){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 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"== 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} 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,Ja:null,Ia: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.Ja=g.load;d.Ia=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<e.length;c++)d.ea[f++]=e[c]&255,d.ea[f++]=e[c]>>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c<e.length;c++)d.ea[f++]= function Fa(a,b){var c,d={ea:null,ia:null,Ka:null,Ja: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.Ka=g.load;d.Ja=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<e.length;c++)d.ea[f++]=e[c]&255,d.ea[f++]=e[c]>>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c<e.length;c++)d.ea[f++]=
e[c]&255,d.ea[f++]=e[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;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ea=e)}return d} e[c]&255,d.ea[f++]=e[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;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ea=e)}return d}
function Ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ja=null;function Ma(){if(null==Ja){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ja=a}return Ja} function Ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ja=null;function Ma(){if(null==Ja){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ja=a}return Ja}
function Na(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Oa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Pa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Qa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()} function Na(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Oa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Pa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Qa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Ra(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Sa={init:[],show:[],exit:[]},Ta=!1,Ua=!1,Va=!0;function Wa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Xa(a){Sa.init.push(a)} function Ra(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Sa={init:[],show:[],exit:[]},Ta=!1,Ua=!1,Va=!0;function Wa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Xa(a){Sa.init.push(a)}
function Ya(a){if(Va)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Za(a){!Va&&a?(Va=!0,Ta&&$a("init"),Ua&&$a("show")):Va=a}function $a(a){Sa[a]&&Ya(Sa[a])}Wa("onload",function(){Ta=!0;Ya(Sa.init)});Wa("onpageshow",function(){Ua=!0;Ya(Sa.show)});Wa(Pa("Opera")||Pa("iOS")?"onunload":"onbeforeunload",function(){Ya(Sa.exit)}); function Ya(a){if(Va)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Za(a){!Va&&a?(Va=!0,Ta&&$a("init"),Ua&&$a("show")):Va=a}function $a(a){Sa[a]&&Ya(Sa[a])}Wa("onload",function(){Ta=!0;Ya(Sa.init)});Wa("onpageshow",function(){Ua=!0;Ya(Sa.show)});Wa(Pa("Opera")||Pa("iOS")?"onunload":"onbeforeunload",function(){Ya(Sa.exit)});
function u(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pc=b.comment;this.Rc=b;b=this.id.indexOf(".");0>b?this.kb=this.id:(this.Pa=this.id.substr(0,b),this.kb=this.id.substr(b+1));this[a]=c;this.B={ready:!1,Za:!1,$b:!1,ja:!1,error:!1};this.Rb=null;this.B.error=!1;this.G={};this.i=null;this.na=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.pc=b.comment;this.Rc=b;b=this.id.indexOf(".");0>b?this.kb=this.id:(this.Pa=this.id.substr(0,b),this.kb=this.id.substr(b+1));this[a]=c;this.B={ready:!1,Za:!1,$b:!1,ja:!1,error:!1};this.Rb=null;this.B.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,jb=/\+/g,kb=/([^&=]+)=?([^&]*)/g;cb=kb.exec(ab);)bb[decodeURIComponent(cb[1].replace(jb," "))]=decodeURIComponent(cb[2].replace(jb," "))}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} if(window){ab||(ab=window.location.search.substr(1));for(var cb,db=/\+/g,kb=/([^&=]+)=?([^&]*)/g;cb=kb.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;b<v.length;b++){var d=v[b];a&&d.id.indexOf(a)||c.push(d)}return c} 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;b<v.length;b++){var d=v[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function pb(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}function qb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<v.length;d++)if(c)c==v[d]&&(c=null);else if(!(a!=v[d].type||b&&v[d].id.indexOf(b)))return v[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b} function pb(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}function qb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<v.length;d++)if(c)c==v[d]&&(c=null);else if(!(a!=v[d].type||b&&v[d].id.indexOf(b)))return v[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
function C(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.sa(g.type,g.binding,f,g.value),l=h.length}}}} function C(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.sa(g.type,g.binding,f,g.value),l=h.length}}}}
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c} function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},sa:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Qa=this.G[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c), u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},sa:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Qa=this.G[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.O=function(a){this.j(a,this.kb)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.kb+": "+a)},O:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Fa:function(){return this.B.ja=!0},Ea:function(a,b){b&&(this.B.ja=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.na;var c=a.i.na&b;return!!b&&c===b||!!(c&a.i.Kc)}return!1} this.O=function(a){this.j(a,this.kb)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.kb+": "+a)},O:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ga:function(){return this.B.ja=!0},Fa:function(a,b){b&&(this.B.ja=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.na;var c=a.i.na&b;return!!b&&c===b||!!(c&a.i.Kc)}return!1}
function rb(a,b){if(a.B.$b)return a.B.Za=!1,a.B.$b=!1;if(a.B.error)return a.j(a.toString()+" error"),!1;a.B.Za=b;return a.B.Za}function sb(a,b){a.B.Za&&(b?a.B.$b=!0:void 0===b&&a.j(a.toString()+" busy"));return a.B.Za}function H(a,b){a.B.error||(a.B.ready=!1!==b,a.B.ready&&(b=a.Rb,a.Rb=null,b&&b()))}function tb(a,b){b&&(a.B.ready?b():a.Rb=b);return a.B.ready}function ub(a){return a.B.error?(a.j(a.toString()+" error"),!0):!1}function vb(a,b){a.B.error=!0;a.O(b)} function rb(a,b){if(a.B.$b)return a.B.Za=!1,a.B.$b=!1;if(a.B.error)return a.j(a.toString()+" error"),!1;a.B.Za=b;return a.B.Za}function sb(a,b){a.B.Za&&(b?a.B.$b=!0:void 0===b&&a.j(a.toString()+" busy"));return a.B.Za}function H(a,b){a.B.error||(a.B.ready=!1!==b,a.B.ready&&(b=a.Rb,a.Rb=null,b&&b()))}function tb(a,b){b&&(a.B.ready?b():a.Rb=b);return a.B.ready}function ub(a){return a.B.error?(a.j(a.toString()+" error"),!0):!1}function vb(a,b){a.B.error=!0;a.O(b)}
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b}); Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
var wb="undefined"!==typeof ArrayBuffer,xb={cpu:1,trap:16,fault:32,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648}; var wb="undefined"!==typeof ArrayBuffer,xb={cpu:1,trap:16,fault:32,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
function yb(a){u.call(this,"Panel",a,yb);this.g=this.v=this.Ua=this.D=0;this.H=this.J=!1;this.K=zb;this.C={};this.f={START:[1,!0,!1,this.ad],STEP:[1,!1,!1,this.bd],ENABLE:[1,!1,!1,this.Xc],CONT:[1,!0,!1,this.Vc],DEP:[0,!0,!1,this.Wc],EXAM:[1,!0,!1,this.Yc],LOAD:[1,!0,!1,this.$c],TEST:[0,!0,!1,this.Zc]};for(a=0;22>a;a++)this.f["S"+a]=[0,!1,!1,this.cd,a]}z(yb);var zb=7;k=yb.prototype;k.reset=function(){}; function yb(a){u.call(this,"Panel",a,yb);this.f=this.v=this.Ua=this.D=0;this.J=this.K=this.H=!1;this.L=zb;this.C={};this.g={START:[1,!0,!1,this.ad],STEP:[1,!1,!1,this.bd],ENABLE:[1,!1,!1,this.Xc],CONT:[1,!0,!1,this.Vc],DEP:[0,!0,!1,this.Wc],EXAM:[1,!0,!1,this.Yc],LOAD:[1,!0,!1,this.$c],TEST:[0,!0,!1,this.Zc]};for(a=0;22>a;a++)this.g["S"+a]=[0,!1,!1,this.cd,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.sa=function(a,b,c,d){if(this.A&&this.A.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(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.f[b]&&(this.f[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= k.sa=function(a,b,c,d){if(this.A&&this.A.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(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.f[b];Ab(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);a.H="DEP"==b;a.J="EXAM"==b}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.f[b];c[1]&&c[2]&&(Ab(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.sa.call(this,a,b,c,d)}};k.Da=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;Bb(b,this,Cb);Db(b,this.reset.bind(this));Eb(this);Fb(this)};k.Fa=function(a,b){b||(Gb(),this.stop());return!0};k.Ea=function(){return!0}; 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.sa.call(this,a,b,c,d)}};k.Da=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.Ga=function(a,b){b||(Hb(),this.reset());return!0};k.Fa=function(){return!0};
function Ub(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Eb(a,b){for(var c in a.C)Ub(a,c,null!=b?b:a.C[c])}function Ab(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Fb(a){for(var b in a.f)Ab(a,b,a.f[b][0])}function Vb(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))} function Vb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Fb(a,b){for(var c in a.C)Vb(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 Wb(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.ad=function(a){a||this.b.B.Z||(this.w.reset(),Wb(this.b),this.f.ENABLE&&this.f.ENABLE[0]&&this.b.hb())};k.bd=function(){};k.Xc=function(a){a||this.b.ha()};k.Vc=function(a){if(!a&&!this.b.B.Z)if(this.f.ENABLE&&this.f.ENABLE[0])this.b.hb();else{if((a=this.i)&&!sb(a,!0))rb(a,!0),a.ib(0),rb(a,!1);else try{var b=this.b.ib(1);0<b&&(Xb(this.b,b),Yb(this.b,b,!0),Zb(this.b,b))}catch(c){"number"!=typeof c&&vb(this.b,c.stack||c.message)}this.stop();this.A&&this.A.ca()}}; k.ad=function(a){a||this.b.B.Z||(this.w.reset(),Xb(this.b),Ab(this,"ENABLE")&&this.b.hb())};k.bd=function(){};k.Xc=function(a){a||this.b.ha()};k.Vc=function(a){if(!a&&!this.b.B.Z)if(Ab(this,"ENABLE"))this.b.hb();else{if((a=this.i)&&!sb(a,!0))rb(a,!0),a.ib(0),rb(a,!1);else try{var b=this.b.ib(1);0<b&&(Yb(this.b,b),Zb(this.b,b,!0),$b(this.b,b))}catch(c){"number"!=typeof c&&vb(this.b,c.stack||c.message)}this.stop();this.A&&this.A.$()}};
k.Wc=function(a){a&&!this.b.B.Z&&(this.H&&$b(this,this.g+2),a=ac(this,this.Ua),this.K==zb?this.w.Cb(this.g,a):this.b.Cb(this.g,a))};k.Yc=function(a){a||this.b.B.Z||(this.J&&$b(this,this.g+2),a=this.K==zb?this.w.$a(this.g):this.b.$a(this.g),ac(this,a))};k.$c=function(a){a||this.b.B.Z||$b(this,this.Ua)};k.Zc=function(a){Eb(this,a||null)};k.cd=function(a,b){this.Ua=a?this.Ua|1<<b:this.Ua&~(1<<b)};function $b(a,b){a.g=b&a.w.Oa;bc(a,"A",a.g,22)} k.Wc=function(a){a&&!this.b.B.Z&&(this.J&&ac(this),a=bc(this,this.Ua),this.L==zb?this.w.Cb(this.f,a):this.b.Cb(this.f,a))};k.Yc=function(a){a||this.b.B.Z||(this.K&&ac(this),a=this.L==zb?this.w.$a(this.f):this.b.$a(this.f),bc(this,a))};k.$c=function(a){a||this.b.B.Z||(this.f=this.Ua&this.w.Ea,cc(this,"A",this.f,22))};k.Zc=function(a){a?(this.H=!0,Fb(this,!0)):(this.H=!1,Fb(this))};k.cd=function(a,b){this.Ua=a?this.Ua|1<<b:this.Ua&~(1<<b)};
function ac(a,b){a.v=b&65535;bc(a,"D",a.v,16);return a.v}function cc(a,b,c){a.C[b]=c;Ub(a,b,c)}function bc(a,b,c,d){for(var e=0;e<d;e++)cc(a,b+e,c&1<<e)}function dc(a){return void 0!==a.G.S0}k.stop=function(){$b(this,this.b.u[7])}; function ac(a){a.f=a.f+(Ab(a,"STEP")?2:-2)&a.w.Ea;cc(a,"A",a.f,22)}function bc(a,b){a.v=b&65535;cc(a,"D",a.v,16);return a.v}function dc(a,b,c){a.C[b]=c;a.H||Vb(a,b,c)}function cc(a,b,c,d){for(var e=0;e<d;e++)dc(a,b+e,c&1<<e)}function ec(a){return void 0!==a.G.S0}k.stop=function(){this.f=this.b.u[7]&this.w.Ea;cc(this,"A",this.f,22)};
k.ca=function(){if(this.D){for(var a=0;a<this.b.u.length;a++)Vb(this,"R"+a,this.b.u[a]);a=ec(this.b);Vb(this,"PS",a);Vb(this,"NF",a&8?1:0,1);Vb(this,"ZF",a&4?1:0,1);Vb(this,"VF",a&2?1:0,1);Vb(this,"CF",a&1?1:0,1);bc(this,"D",this.v,16);bc(this,"A",this.g,22);a=this.b.Ta?this.b.ob&16?1:2:4;cc(this,"B22",a&1);cc(this,"B18",a&2);cc(this,"B16",a&4)}};k.dd=function(a){return(a?this.Ua:this.v)&65535};k.Yd=function(a){this.v=a};var fc={},Cb=(fc[65400]=[null,null,yb.prototype.dd,yb.prototype.Yd,"CNSW"],fc); k.$=function(){if(this.D){for(var a=0;a<this.b.u.length;a++)Wb(this,"R"+a,this.b.u[a]);a=fc(this.b);Wb(this,"PS",a);Wb(this,"NF",a&8?1:0,1);Wb(this,"ZF",a&4?1:0,1);Wb(this,"VF",a&2?1:0,1);Wb(this,"CF",a&1?1:0,1);cc(this,"D",this.v,16);cc(this,"A",this.f,22);a=this.b.Ta?this.b.ob&16?1:2:4;dc(this,"B22",a&1);dc(this,"B18",a&2);dc(this,"B16",a&4)}};k.dd=function(a){return(a?this.Ua:this.v)&65535};k.Yd=function(a){this.v=a};var gc={},Db=(gc[65400]=[null,null,yb.prototype.dd,yb.prototype.Yd,"CNSW"],gc);
function Gb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=pb(e.id);f||(a=!0,f=new yb(e));C(f,d);a&&H(f)}}Xa(Gb); function Hb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=pb(e.id);f||(a=!0,f=new yb(e));C(f,d);a&&H(f)}}Xa(Hb);
function gc(a,b,c){u.call(this,"Bus",a,gc,64);this.b=b;this.i=c;this.L=a.busWidth||16;this.A=0;this.K=[];this.D=null;this.H=1<<this.L;this.Oa=this.H-1;this.xa=hc;this.la=Math.log2(this.xa);this.J=this.xa>>2;this.w=this.xa-1;this.C=this.H/this.xa|0;this.Ya=[];this.f=0;this.g=!1;this.v=[];this.Hc=[ic,jc,kc,lc];a=new I(this);mc(a,this.i);this.W=Array(this.C);for(b=0;b<this.C;b++)this.W[b]=a;H(this)}z(gc);var hc=8192,nc=hc-1; function hc(a,b,c){u.call(this,"Bus",a,hc,64);this.b=b;this.i=c;this.L=a.busWidth||16;this.A=0;this.K=[];this.D=null;this.H=1<<this.L;this.Ea=this.H-1;this.xa=ic;this.la=Math.log2(this.xa);this.J=this.xa>>2;this.w=this.xa-1;this.C=this.H/this.xa|0;this.Ya=[];this.f=0;this.g=!1;this.v=[];this.Hc=[jc,kc,lc,mc];a=new I(this);nc(a,this.i);this.W=Array(this.C);for(b=0;b<this.C;b++)this.W[b]=a;H(this)}z(hc);var ic=8192,oc=ic-1;
function ic(a,b){var c=-1,d=this.controller,e=d.Ya[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.Ya[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,!0),c;d.Ca(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,!0);return c} function jc(a,b){var c=-1,d=this.controller,e=d.Ya[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.Ya[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,!0),c;d.Ca(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,!0);return c}
function jc(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?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(e.Ca(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,!0))} function kc(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?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(e.Ca(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,!0))}
function kc(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 this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;d.Ca(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,!0);return c} function lc(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 this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;d.Ca(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,!0);return c}
function lc(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?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(e.Ca(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,!0))} function mc(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?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(e.Ca(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,!0))}
function oc(a,b){if(b!=a.A){var c;a.A&&(c=(1<<a.A)-hc,pc(a,c,hc,a.K),a.A=0);b&&(a.A=b,c=1<<b,a.Oa=c-1,c-=hc,a.K=qc(a,c,hc),a.D?pc(a,c,hc,a.D):(rc(a,c,hc,sc,a),a.D=qc(a,c,hc)))}}k=gc.prototype;k.reset=function(){for(var a=0;a<this.v.length;a++)this.v[a]();oc(this,16)};k.Fa=function(a,b){b||this.reset();return!0}; function pc(a,b){if(b!=a.A){var c;a.A&&(c=(1<<a.A)-ic,qc(a,c,ic,a.K),a.A=0);b&&(a.A=b,c=1<<b,a.Ea=c-1,c-=ic,a.K=rc(a,c,ic),a.D?qc(a,c,ic,a.D):(sc(a,c,ic,tc,a),a.D=rc(a,c,ic)))}}k=hc.prototype;k.reset=function(){for(var a=0;a<this.v.length;a++)this.v[a]();pc(this,16)};k.Ga=function(a,b){b||this.reset();return!0};
function rc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.la;0<g&&h<a.W.length;){var l=a.W[h],m=h*a.xa,n=a.xa-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Lb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Lb){n=l.size-(f-m);n>g&&(n=g);l.Lb=f-l.F+n;f=m+a.xa;g-=n;h++;continue}}return tc(1,f,g)}f=new I(a,f,n,a.xa,d,e);mc(f,a.i,l);a.W[h++]=f;f=m+a.xa;g-=n}if(0>=g){c/=1024;var r;e="";r?10<r&&(r=10):r=c&-65536?10:5;if(null==c||isNaN(c))for(;0<r--;)e="?"+e;else for(;0<r--;)e=String.fromCharCode(c%10+48)+e,c/= function sc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.la;0<g&&h<a.W.length;){var l=a.W[h],m=h*a.xa,n=a.xa-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Lb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Lb){n=l.size-(f-m);n>g&&(n=g);l.Lb=f-l.F+n;f=m+a.xa;g-=n;h++;continue}}return uc(1,f,g)}f=new I(a,f,n,a.xa,d,e);nc(f,a.i,l);a.W[h++]=f;f=m+a.xa;g-=n}if(0>=g){c/=1024;var r;e="";r?10<r&&(r=10):r=c&-65536?10:5;if(null==c||isNaN(c))for(;0<r--;)e="?"+e;else for(;0<r--;)e=String.fromCharCode(c%10+48)+e,c/=
10;a.status(e+"Kb "+uc[d]+" at "+ra(b));return!0}return tc(2,b,c)}function qc(a,b,c){var d=[];for(b>>>=a.la;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.xa;return d}function pc(a,b,c,d){var e=0;for(b>>>=a.la;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.xa}}k.Fb=function(a){3932160<=a&&(a=vc(this.b,a));return this.W[(a&this.Oa)>>>this.la].Vb(a&this.w,a)};k.Tb=function(a){this.g=!1;this.f++;a=this.W[(a&this.Oa)>>>this.la].fc(a&this.w,a);this.f--;return a}; 10;a.status(e+"Kb "+vc[d]+" at "+ra(b));return!0}return uc(2,b,c)}function rc(a,b,c){var d=[];for(b>>>=a.la;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.xa;return d}function qc(a,b,c,d){var e=0;for(b>>>=a.la;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.xa}}k.Fb=function(a){3932160<=a&&(a=wc(this.b,a));return this.W[(a&this.Ea)>>>this.la].Vb(a&this.w,a)};k.Tb=function(a){this.g=!1;this.f++;a=this.W[(a&this.Ea)>>>this.la].fc(a&this.w,a);this.f--;return a};
k.oa=function(a){3932160<=a&&(a=vc(this.b,a));return this.W[(a&this.Oa)>>>this.la].ra(a&this.w,a)};k.$a=function(a){var b=a&this.w,c=(a&this.Oa)>>>this.la;this.g=!1;this.f++;a=this.W[c].gc(b,a);this.f--;return a};k.Wb=function(a,b){3932160<=a&&(a=vc(this.b,a));this.W[(a&this.Oa)>>>this.la].Yb(a&this.w,b&255,a)};k.pb=function(a,b){this.g=!1;this.f++;this.W[(a&this.Oa)>>>this.la].Zb(a&this.w,b&255,a);this.f--}; k.oa=function(a){3932160<=a&&(a=wc(this.b,a));return this.W[(a&this.Ea)>>>this.la].ra(a&this.w,a)};k.$a=function(a){var b=a&this.w,c=(a&this.Ea)>>>this.la;this.g=!1;this.f++;a=this.W[c].gc(b,a);this.f--;return a};k.Wb=function(a,b){3932160<=a&&(a=wc(this.b,a));this.W[(a&this.Ea)>>>this.la].Yb(a&this.w,b&255,a)};k.pb=function(a,b){this.g=!1;this.f++;this.W[(a&this.Ea)>>>this.la].Zb(a&this.w,b&255,a);this.f--};
k.gb=function(a,b){3932160<=a&&(a=vc(this.b,a));this.W[(a&this.Oa)>>>this.la].Mb(a&this.w,b&65535,a)};k.Cb=function(a,b){var c=a&this.w,d=(a&this.Oa)>>>this.la;this.g=!1;this.f++;this.W[d].kc(c,b&65535,a);this.f--};function wc(a){for(var b=0,c=[],d=0;d<a.C;d++){var e=a.W[d];if(e.Ra||e.Nc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c} k.gb=function(a,b){3932160<=a&&(a=wc(this.b,a));this.W[(a&this.Ea)>>>this.la].Mb(a&this.w,b&65535,a)};k.Cb=function(a,b){var c=a&this.w,d=(a&this.Ea)>>>this.la;this.g=!1;this.f++;this.W[d].kc(c,b&65535,a);this.f--};function xc(a){for(var b=0,c=[],d=0;d<a.C;d++){var e=a.W[d];if(e.Ra||e.Nc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}
function xc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&nc;void 0!==a.Ya[m]?q("I/O address already registered: "+p(b,8,!0)):a.Ya[m]=[d,e,f,g,h||"unknown",l,!1]}} function yc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&oc;void 0!==a.Ya[m]?q("I/O address already registered: "+p(b,8,!0)):a.Ya[m]=[d,e,f,g,h||"unknown",l,!1]}}
function Bb(a,b,c,d){for(var e in c){var f=+e,g=c[e];if(!(g[6]&&g[6]>a.b.wb)){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<r;w++,f+=2)t&&1<r&&(t=g[4]+w),xc(a,f,f,h,l,m,n,t,d||64)}}}function Db(a,b){a.v.push(b)} function Cb(a,b,c,d){for(var e in c){var f=+e,g=c[e];if(!(g[6]&&g[6]>a.b.wb)){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<r;w++,f+=2)t&&1<r&&(t=g[4]+w),yc(a,f,f,h,l,m,n,t,d||64)}}}function Eb(a,b){a.v.push(b)}
k.Ca=function(a,b,c){this.g=!0;this.f||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on address "+J(this.i,a),!0,!0),b&&(this.b.ga|=b),this.b.pa(4,a))};function yc(a){var b=a.g;a.g=!1;return b}function tc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){u.call(this,"Device",a,K,256);this.f={fa:0,jc:-1}}z(K);k=K.prototype; k.Ca=function(a,b,c){this.g=!0;this.f||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on address "+J(this.i,a),!0,!0),b&&(this.b.ga|=b),this.b.pa(4,a))};function Ic(a){var b=a.g;a.g=!1;return b}function uc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){u.call(this,"Device",a,K,256);this.f={fa:0,jc:-1}}z(K);k=K.prototype;
k.Da=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.jc=zc(c,function(){e.f.ab|=128;e.f.ab&64&&(Jc(e.b,e.f.Wd),Kc(e.b,e.f.jc,1E3/60))});this.f.Wd=Lc(64,6);Bb(b,this,L);Db(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.ab=0};k.md=function(){var a=this.f.ab;this.f.ab&=-129;return a};k.fe=function(a){this.f.ab=a;a&64&&Kc(this.b,this.f.jc,1E3/60);this.f.ab=a&-129};k.od=function(){var a=this.b;return a.C&62337|a.Ha<<5|a.La<<1}; k.Da=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.jc=Jc(c,function(){e.f.ab|=128;e.f.ab&64&&(Kc(e.b,e.f.Wd),Lc(e.b,e.f.jc,1E3/60))});this.f.Wd=Mc(64,6);Cb(b,this,L);Eb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.ab=0};k.md=function(){var a=this.f.ab;this.f.ab&=-129;return a};k.fe=function(a){this.f.ab=a;a&64&&Lc(this.b,this.f.jc,1E3/60);this.f.ab=a&-129};k.od=function(){var a=this.b;return a.C&62337|a.Ia<<5|a.Ma<<1};
k.he=function(a){var b=this.b;a&=62337;if(b.C!=a){b.C=a;b.Ha=a>>5&3;b.La=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ta!=c&&(b.Ta=c,Mc(b))}};k.pd=function(){var a=this.b.cb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.qd=function(){return this.b.Jb};k.rd=function(){return this.b.ob};k.ie=function(a){var b=this.b;1170>b.wb&&(a&=-49);b.ob!=a&&(b.ob=a,b.Qb=a&16?4194303:262143,Mc(b))};k.Rd=function(a){a=a>>1&63;var b=this.b.Kb[a>>1];return a&1?b>>16:b&65535}; k.he=function(a){var b=this.b;a&=62337;if(b.C!=a){b.C=a;b.Ia=a>>5&3;b.Ma=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ta!=c&&(b.Ta=c,Nc(b))}};k.pd=function(){var a=this.b.cb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.qd=function(){return this.b.Jb};k.rd=function(){return this.b.ob};k.ie=function(a){var b=this.b;1170>b.wb&&(a&=-49);b.ob!=a&&(b.ob=a,b.Qb=a&16?4194303:262143,Nc(b))};k.Rd=function(a){a=a>>1&63;var b=this.b.Kb[a>>1];return a&1?b>>16:b&65535};
k.Ie=function(a,b){b=b>>1&63;var c=b>>1;this.b.Kb[c]=b&1?this.b.Kb[c]&65535|(a&63)<<16:this.b.Kb[c]&-65536|a&65534};k.Kd=function(a){return this.b.V[1][a>>1&7]};k.Be=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Id=function(a){return this.b.V[1][(a>>1&7)+8]};k.ze=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Jd=function(a){return this.b.wa[1][a>>1&7]};k.Ae=function(a,b){b=b>>1&7;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.Hd=function(a){return this.b.wa[1][(a>>1&7)+8]}; k.Ie=function(a,b){b=b>>1&63;var c=b>>1;this.b.Kb[c]=b&1?this.b.Kb[c]&65535|(a&63)<<16:this.b.Kb[c]&-65536|a&65534};k.Kd=function(a){return this.b.V[1][a>>1&7]};k.Be=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Id=function(a){return this.b.V[1][(a>>1&7)+8]};k.ze=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Jd=function(a){return this.b.wa[1][a>>1&7]};k.Ae=function(a,b){b=b>>1&7;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.Hd=function(a){return this.b.wa[1][(a>>1&7)+8]};
k.ye=function(a,b){b=(b>>1&7)+8;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.ld=function(a){return this.b.V[0][a>>1&7]};k.ee=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.jd=function(a){return this.b.V[0][(a>>1&7)+8]};k.ce=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.kd=function(a){return this.b.wa[0][a>>1&7]};k.de=function(a,b){b=b>>1&7;this.b.wa[0][b]=a;this.b.V[0][b]&=65295};k.hd=function(a){return this.b.wa[0][(a>>1&7)+8]};k.be=function(a,b){b=(b>>1&7)+8;this.b.wa[0][b]=a;this.b.V[0][b]&=65295}; k.ye=function(a,b){b=(b>>1&7)+8;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.ld=function(a){return this.b.V[0][a>>1&7]};k.ee=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.jd=function(a){return this.b.V[0][(a>>1&7)+8]};k.ce=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.kd=function(a){return this.b.wa[0][a>>1&7]};k.de=function(a,b){b=b>>1&7;this.b.wa[0][b]=a;this.b.V[0][b]&=65295};k.hd=function(a){return this.b.wa[0][(a>>1&7)+8]};k.be=function(a,b){b=(b>>1&7)+8;this.b.wa[0][b]=a;this.b.V[0][b]&=65295};
k.Qd=function(a){return this.b.V[3][a>>1&7]};k.He=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Od=function(a){return this.b.V[3][(a>>1&7)+8]};k.Fe=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Pd=function(a){return this.b.wa[3][a>>1&7]};k.Ge=function(a,b){b=b>>1&7;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.Nd=function(a){return this.b.wa[3][(a>>1&7)+8]};k.Ee=function(a,b){b=(b>>1&7)+8;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.Ab=function(a){a&=7;return this.b.M&2048?this.b.Va[a]:this.b.u[a]}; k.Qd=function(a){return this.b.V[3][a>>1&7]};k.He=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Od=function(a){return this.b.V[3][(a>>1&7)+8]};k.Fe=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Pd=function(a){return this.b.wa[3][a>>1&7]};k.Ge=function(a,b){b=b>>1&7;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.Nd=function(a){return this.b.wa[3][(a>>1&7)+8]};k.Ee=function(a,b){b=(b>>1&7)+8;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.Ab=function(a){a&=7;return this.b.M&2048?this.b.Va[a]:this.b.u[a]};
k.Db=function(a,b){b&=7;this.b.M&2048?this.b.Va[b]=a:this.b.u[b]=a};k.wd=function(){return this.b.M&49152?this.b.Ga[0]:this.b.u[6]};k.ne=function(a){this.b.M&49152?this.b.Ga[0]=a:this.b.u[6]=a};k.zd=function(){return this.b.u[7]};k.qe=function(a){this.b.u[7]=a};k.Bb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Va[a]};k.Eb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Va[b]=a};k.xd=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ga[1]}; k.Db=function(a,b){b&=7;this.b.M&2048?this.b.Va[b]=a:this.b.u[b]=a};k.wd=function(){return this.b.M&49152?this.b.Ha[0]:this.b.u[6]};k.ne=function(a){this.b.M&49152?this.b.Ha[0]=a:this.b.u[6]=a};k.zd=function(){return this.b.u[7]};k.qe=function(a){this.b.u[7]=a};k.Bb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Va[a]};k.Eb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Va[b]=a};k.xd=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ha[1]};
k.oe=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ga[1]=a};k.yd=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ga[3]};k.pe=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ga[3]=a};k.fd=function(a){return this.b.Ac[a-65504>>1]};k.$d=function(a,b){this.b.Ac[b-65504>>1]=a};k.xc=function(a){return 65520==a?61183:0};k.Ec=function(){};k.Md=function(){return 1};k.De=function(){};k.ed=function(){return this.b.ga};k.Zd=function(){this.b.ga=0};k.nd=function(){return this.b.zc}; k.oe=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ha[1]=a};k.yd=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ha[3]};k.pe=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ha[3]=a};k.fd=function(a){return this.b.Ac[a-65504>>1]};k.$d=function(a,b){this.b.Ac[b-65504>>1]=a};k.xc=function(a){return 65520==a?61183:0};k.Ec=function(){};k.Md=function(){return 1};k.De=function(){};k.ed=function(){return this.b.ga};k.Zd=function(){this.b.ga=0};k.nd=function(){return this.b.zc};
k.ge=function(a,b){b&1||(a&=255);this.b.zc=a};k.sd=function(a){return a?this.b.ic:0};k.je=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ic=a;b.I|=2};k.Ld=function(a){return a?this.b.eb&65280:0};k.Ce=function(a){this.b.eb=a|255};k.vd=function(){return ec(this.b)};k.me=function(a){Nc(this.b,a&-1809|ec(this.b)&1808);this.b.I|=128};k.Dc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; k.ge=function(a,b){b&1||(a&=255);this.b.zc=a};k.sd=function(a){return a?this.b.ic:0};k.je=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ic=a;b.I|=2};k.Ld=function(a){return a?this.b.eb&65280:0};k.Ce=function(a){this.b.eb=a|255};k.vd=function(){return fc(this.b)};k.me=function(a){Oc(this.b,a&-1809|fc(this.b)&1808);this.b.I|=128};k.Dc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)};
var M={},L=(M[61568]=[null,null,K.prototype.Rd,K.prototype.Ie,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Kd,K.prototype.Be,"SISDR",8,1145],M[62608]=[null,null,K.prototype.Id,K.prototype.ze,"SDSDR",8,1145],M[62624]=[null,null,K.prototype.Jd,K.prototype.Ae,"SISAR",8,1145],M[62640]=[null,null,K.prototype.Hd,K.prototype.ye,"SDSAR",8,1145],M[62656]=[null,null,K.prototype.ld,K.prototype.ee,"KISDR",8,1145],M[62672]=[null,null,K.prototype.jd,K.prototype.ce,"KDSDR",8,1145],M[62688]=[null,null,K.prototype.kd, var M={},L=(M[61568]=[null,null,K.prototype.Rd,K.prototype.Ie,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Kd,K.prototype.Be,"SISDR",8,1145],M[62608]=[null,null,K.prototype.Id,K.prototype.ze,"SDSDR",8,1145],M[62624]=[null,null,K.prototype.Jd,K.prototype.Ae,"SISAR",8,1145],M[62640]=[null,null,K.prototype.Hd,K.prototype.ye,"SDSAR",8,1145],M[62656]=[null,null,K.prototype.ld,K.prototype.ee,"KISDR",8,1145],M[62672]=[null,null,K.prototype.jd,K.prototype.ce,"KDSDR",8,1145],M[62688]=[null,null,K.prototype.kd,
K.prototype.de,"KISAR",8,1145],M[62704]=[null,null,K.prototype.hd,K.prototype.be,"KDSAR",8,1145],M[62798]=[null,null,K.prototype.rd,K.prototype.ie,"MMR3",1,1145],M[65382]=[null,null,K.prototype.md,K.prototype.fe,"LKS"],M[65402]=[null,null,K.prototype.od,K.prototype.he,"MMR0",1,1145],M[65404]=[null,null,K.prototype.pd,K.prototype.Dc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.qd,K.prototype.Dc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Qd,K.prototype.He,"UISDR",8,1145],M[65424]=[null,null,K.prototype.Od, K.prototype.de,"KISAR",8,1145],M[62704]=[null,null,K.prototype.hd,K.prototype.be,"KDSAR",8,1145],M[62798]=[null,null,K.prototype.rd,K.prototype.ie,"MMR3",1,1145],M[65382]=[null,null,K.prototype.md,K.prototype.fe,"LKS"],M[65402]=[null,null,K.prototype.od,K.prototype.he,"MMR0",1,1145],M[65404]=[null,null,K.prototype.pd,K.prototype.Dc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.qd,K.prototype.Dc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Qd,K.prototype.He,"UISDR",8,1145],M[65424]=[null,null,K.prototype.Od,
K.prototype.Fe,"UDSDR",8,1145],M[65440]=[null,null,K.prototype.Pd,K.prototype.Ge,"UISAR",8,1145],M[65456]=[null,null,K.prototype.Nd,K.prototype.Ee,"UDSAR",8,1145],M[65472]=[null,null,K.prototype.Ab,K.prototype.Db,"R0SET0"],M[65473]=[null,null,K.prototype.Ab,K.prototype.Db,"R1SET0"],M[65474]=[null,null,K.prototype.Ab,K.prototype.Db,"R2SET0"],M[65475]=[null,null,K.prototype.Ab,K.prototype.Db,"R3SET0"],M[65476]=[null,null,K.prototype.Ab,K.prototype.Db,"R4SET0"],M[65477]=[null,null,K.prototype.Ab,K.prototype.Db, K.prototype.Fe,"UDSDR",8,1145],M[65440]=[null,null,K.prototype.Pd,K.prototype.Ge,"UISAR",8,1145],M[65456]=[null,null,K.prototype.Nd,K.prototype.Ee,"UDSAR",8,1145],M[65472]=[null,null,K.prototype.Ab,K.prototype.Db,"R0SET0"],M[65473]=[null,null,K.prototype.Ab,K.prototype.Db,"R1SET0"],M[65474]=[null,null,K.prototype.Ab,K.prototype.Db,"R2SET0"],M[65475]=[null,null,K.prototype.Ab,K.prototype.Db,"R3SET0"],M[65476]=[null,null,K.prototype.Ab,K.prototype.Db,"R4SET0"],M[65477]=[null,null,K.prototype.Ab,K.prototype.Db,
"R5SET0"],M[65478]=[null,null,K.prototype.wd,K.prototype.ne,"R6KERNEL"],M[65479]=[null,null,K.prototype.zd,K.prototype.qe,"R7KERNEL"],M[65480]=[null,null,K.prototype.Bb,K.prototype.Eb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Bb,K.prototype.Eb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Bb,K.prototype.Eb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Bb,K.prototype.Eb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Bb,K.prototype.Eb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Bb, "R5SET0"],M[65478]=[null,null,K.prototype.wd,K.prototype.ne,"R6KERNEL"],M[65479]=[null,null,K.prototype.zd,K.prototype.qe,"R7KERNEL"],M[65480]=[null,null,K.prototype.Bb,K.prototype.Eb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Bb,K.prototype.Eb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Bb,K.prototype.Eb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Bb,K.prototype.Eb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Bb,K.prototype.Eb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Bb,
K.prototype.Eb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.xd,K.prototype.oe,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.yd,K.prototype.pe,"R6USER",1,1145],M[65504]=[null,null,K.prototype.fd,K.prototype.$d,"CTRL",1,1170],M[65520]=[null,null,K.prototype.xc,K.prototype.Ec,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.xc,K.prototype.Ec,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Md,K.prototype.De,"SYSID",1,1170],M[65526]=[null,null,K.prototype.ed,K.prototype.Zd,"CPUERR",1,1170],M[65528]= K.prototype.Eb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.xd,K.prototype.oe,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.yd,K.prototype.pe,"R6USER",1,1145],M[65504]=[null,null,K.prototype.fd,K.prototype.$d,"CTRL",1,1170],M[65520]=[null,null,K.prototype.xc,K.prototype.Ec,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.xc,K.prototype.Ec,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Md,K.prototype.De,"SYSID",1,1170],M[65526]=[null,null,K.prototype.ed,K.prototype.Zd,"CPUERR",1,1170],M[65528]=
[null,null,K.prototype.nd,K.prototype.ge,"MB",1,1170],M[65530]=[null,null,K.prototype.sd,K.prototype.je,"PIR"],M[65532]=[null,null,K.prototype.Ld,K.prototype.Ce,"SL"],M[65534]=[null,null,K.prototype.vd,K.prototype.me,"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]; [null,null,K.prototype.nd,K.prototype.ge,"MB",1,1170],M[65530]=[null,null,K.prototype.sd,K.prototype.je,"PIR"],M[65532]=[null,null,K.prototype.Ld,K.prototype.Ce,"SL"],M[65534]=[null,null,K.prototype.vd,K.prototype.me,"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<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new K(c);C(c,d);break;case "pc11":c=new Oc(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var Pc;if(wb){var Qc=new ArrayBuffer(2);(new DataView(Qc)).setUint16(0,256,!0);Pc=256===(new Uint16Array(Qc))[0]}else Pc=!1;var Rc=Pc; Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new K(c);C(c,d);break;case "pc11":c=new Pc(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var Qc;if(wb){var Rc=new ArrayBuffer(2);(new DataView(Rc)).setUint16(0,256,!0);Qc=256===(new Uint16Array(Rc))[0]}else Qc=!1;var Sc=Qc;
function I(a,b,c,d,e,f){this.w=a;this.id=Sc+=2;this.b=null;this.F=b;this.Lb=c;this.size=d||0;this.type=e||Tc;this.f=e==Uc;this.controller=null;mc(this);this.Ra=this.Nc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],Vc(this,f.Hc);else if(wb)this.C=new ArrayBuffer(this.size),this.D=new DataView(this.C,0,this.size),this.G=new Uint8Array(this.C,0,this.size),this.J=new Uint16Array(this.C,0,this.size>>1),this.b=new Int32Array(this.C,0,this.size>>2),Vc(this,Rc?Wc:Xc);else{a=this.b=Array(this.size>> function I(a,b,c,d,e,f){this.w=a;this.id=Tc+=2;this.b=null;this.F=b;this.Lb=c;this.size=d||0;this.type=e||Uc;this.f=e==Vc;this.controller=null;nc(this);this.Ra=this.Nc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],Wc(this,f.Hc);else if(wb)this.C=new ArrayBuffer(this.size),this.D=new DataView(this.C,0,this.size),this.G=new Uint8Array(this.C,0,this.size),this.J=new Uint16Array(this.C,0,this.size>>1),this.b=new Int32Array(this.C,0,this.size>>2),Wc(this,Sc?Xc:Yc);else{a=this.b=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;Vc(this,Yc)}else Vc(this)}var Tc=0,Uc=2,sc=4,uc=["NONE","RAM","ROM","VID","H/W"],Sc=0; 2);for(f=0;f<a.length;f++)a[f]=0;Wc(this,Zc)}else Wc(this)}var Uc=0,Vc=2,tc=4,vc=["NONE","RAM","ROM","VID","H/W"],Tc=0;
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(wb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(wb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ra=!0}return!1},mb:function(a,b){b?this.A++||Zc(this,$c,!1):this.g++||ad(this,$c,!1)},K:function(a,b){this.i&&F(this.i,128)&&E(this.i, I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(wb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(wb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ra=!0}return!1},mb:function(a,b){b?this.A++||$c(this,ad,!1):this.g++||bd(this,ad,!1)},K:function(a,b){this.i&&F(this.i,128)&&E(this.i,
"attempt to read invalid address "+J(this.i,b),!0);this.w.Ca(b,32,2);return 255},v:function(a,b,c){this.i&&F(this.i,128)&&E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0);this.w.Ca(c,32,4)},L:function(a,b){return this.Vb(a++,b++)|this.Vb(a,b)<<8},H:function(a,b,c){this.Yb(a++,b&255,c++);this.Yb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},da:function(a,b){a&1&&this.w.Ca(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+ "attempt to read invalid address "+J(this.i,b),!0);this.w.Ca(b,32,2);return 255},v:function(a,b,c){this.i&&F(this.i,128)&&E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0);this.w.Ca(c,32,4)},L:function(a,b){return this.Vb(a++,b++)|this.Vb(a,b)<<8},H:function(a,b,c){this.Yb(a++,b&255,c++);this.Yb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},da:function(a,b){a&1&&this.w.Ca(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},va:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ra=!0},La:function(a,b,c){a&1&&this.w.Ca(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Ra=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;bd(c,this.F+a,1,c.N)&&c.ha(!0)}return this.fc(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;bd(c,this.F+a,2,c.N)&&c.ha(!0)}return this.gc(a,b)},ma:function(a, 1]&255)<<8},va:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ra=!0},Ma:function(a,b,c){a&1&&this.w.Ca(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Ra=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;cd(c,this.F+a,1,c.N)&&c.ha(!0)}return this.fc(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;cd(c,this.F+a,2,c.N)&&c.ha(!0)}return this.gc(a,b)},ma:function(a,
b,c){if(this.i&&null!=this.F){var d=this.i;bd(d,this.F+a,1,d.D)&&d.ha(!0)}this.f?this.v(a,b,c):this.Zb(a,b,c)},za:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;bd(d,this.F+a,2,d.D)&&d.ha(!0)}this.f?this.v(a,b,c):this.kc(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},Pa:function(a,b){a&1&&this.w.Ca(b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&this.w.Ca(b,64,2); b,c){if(this.i&&null!=this.F){var d=this.i;cd(d,this.F+a,1,d.D)&&d.ha(!0)}this.f?this.v(a,b,c):this.Zb(a,b,c)},za:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;cd(d,this.F+a,2,d.D)&&d.ha(!0)}this.f?this.v(a,b,c):this.kc(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},Pa:function(a,b){a&1&&this.w.Ca(b,64,2);return this.D.getUint16(a,!0)},aa:function(a,b){a&1&&this.w.Ca(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.Ra=!0},ta:function(a,b,c){this.G[a]=b;this.Ra=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},kb:function(a,b,c){a&1&&this.w.Ca(c,64,4);this.D.setUint16(a,b,!0);this.Ra=!0},Ha:function(a,b,c){a&1&&this.w.Ca(c,64,4);this.J[a>>1]=b;this.Ra=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, 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.Ra=!0},ta:function(a,b,c){this.G[a]=b;this.Ra=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},kb:function(a,b,c){a&1&&this.w.Ca(c,64,4);this.D.setUint16(a,b,!0);this.Ra=!0},Ia:function(a,b,c){a&1&&this.w.Ca(c,64,4);this.J[a>>1]=b;this.Ra=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,
b)+")",!0)}};function mc(a,b,c){a.i=b;a.g=a.A=0;c&&((a.g=c.g)&&ad(a,$c,!1),(a.A=c.A)&&Zc(a,$c,!1))}function cd(a,b){b?--a.A||(a.Yb=a.f?a.v:a.Zb,a.Mb=a.f?a.H:a.kc):--a.g||(a.Vb=a.fc,a.ra=a.gc)}function Zc(a,b,c){c&&a.A||(a.Yb=!a.f&&b[1]||a.v,a.Mb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Zb=b[1]||a.v,a.kc=b[3]||a.H}function ad(a,b,c){c&&a.g||(a.Vb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.fc=b[0]||a.K,a.gc=b[2]||a.L}function Vc(a,b){b||(b=dd);ad(a,b,void 0);Zc(a,b,void 0)} b)+")",!0)}};function nc(a,b,c){a.i=b;a.g=a.A=0;c&&((a.g=c.g)&&bd(a,ad,!1),(a.A=c.A)&&$c(a,ad,!1))}function dd(a,b){b?--a.A||(a.Yb=a.f?a.v:a.Zb,a.Mb=a.f?a.H:a.kc):--a.g||(a.Vb=a.fc,a.ra=a.gc)}function $c(a,b,c){c&&a.A||(a.Yb=!a.f&&b[1]||a.v,a.Mb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Zb=b[1]||a.v,a.kc=b[3]||a.H}function bd(a,b,c){c&&a.g||(a.Vb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.fc=b[0]||a.K,a.gc=b[2]||a.L}function Wc(a,b){b||(b=ed);bd(a,b,void 0);$c(a,b,void 0)}
var dd=[],Yc=[I.prototype.S,I.prototype.va,I.prototype.da,I.prototype.La],$c=[I.prototype.P,I.prototype.ma,I.prototype.Y,I.prototype.za];if(wb)var Xc=[I.prototype.N,I.prototype.ka,I.prototype.Pa,I.prototype.kb],Wc=[I.prototype.R,I.prototype.ta,I.prototype.$,I.prototype.Ha]; var ed=[],Zc=[I.prototype.S,I.prototype.va,I.prototype.da,I.prototype.Ma],ad=[I.prototype.P,I.prototype.ma,I.prototype.Y,I.prototype.za];if(wb)var Yc=[I.prototype.N,I.prototype.ka,I.prototype.Pa,I.prototype.kb],Xc=[I.prototype.R,I.prototype.ta,I.prototype.aa,I.prototype.Ia];
function ed(a,b){u.call(this,"CPU",a,ed,1);var c=a.multiplier||1;this.lb=a.cycles||b;this.bb=c;this.tb=Math.round(this.lb/1E4)/100;this.nb=this.tb*this.bb;this.B.Z=!1;this.B.Xb=!1;this.B.sb=a.autoStart;this.B.vb=!1;this.Gb=this.ma=0;this.Hb=a.csStart;this.xb=a.csInterval;this.yb=a.csStop;this.K=[];this.uc=this.Vd.bind(this);H(this)}z(ed);var fd=["power","reset"];k=ed.prototype; function fd(a,b){u.call(this,"CPU",a,fd,1);var c=a.multiplier||1;this.lb=a.cycles||b;this.bb=c;this.tb=Math.round(this.lb/1E4)/100;this.nb=this.tb*this.bb;this.B.Z=!1;this.B.Xb=!1;this.B.sb=a.autoStart;this.B.vb=!1;this.Gb=this.ma=0;this.Hb=a.csStart;this.xb=a.csInterval;this.yb=a.csStop;this.K=[];this.uc=this.Vd.bind(this);H(this)}z(fd);var gd=["power","reset"];k=fd.prototype;
k.Da=function(a,b,c,d){this.A=a;this.w=b;this.i=d;for(b=0;b<fd.length;b++)(c=this.G[fd[b]])&&this.A.sa(null,fd[b],c);a=gd(a,"autoStart");null!=a&&(this.B.sb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1}; k.Da=function(a,b,c,d){this.A=a;this.w=b;this.i=d;for(b=0;b<gd.length;b++)(c=this.G[gd[b]])&&this.A.sa(null,gd[b],c);a=hd(a,"autoStart");null!=a&&(this.B.sb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
k.Fa=function(a,b){if(!b){if(a&&this.restore){hd(this);if(!this.restore(a))return!1;id(this)}else this.reset();this.i?(a=this.i,b=this.B.sb,a.jb=!0,a.j("Type ? for help with PDPjs Debugger commands"),a.ca(),b||a.qb(),a.Xa&&(b=a.Xa,a.Xa=null,jd(a,b))):this.j("No debugger detected")}this.A.ca();return!0};k.Ea=function(a){return a?this.save():!0};k.sb=function(){return this.B.sb||!this.i&&void 0===this.G.run?(this.hb(),!0):!1};k.rc=function(){return 0}; k.Ga=function(a,b){if(!b){if(a&&this.restore){id(this);if(!this.restore(a))return!1;jd(this)}else this.reset();this.i?(a=this.i,b=this.B.sb,a.jb=!0,a.j("Type ? for help with PDPjs Debugger commands"),a.$(),b||a.qb(),a.Xa&&(b=a.Xa,a.Xa=null,kd(a,b))):this.j("No debugger detected")}return!0};k.Fa=function(a){return a?this.save():!0};k.sb=function(){return this.B.sb||!this.i&&void 0===this.G.run?(this.hb(),!0):!1};k.rc=function(){return 0};
function id(a){void 0===a.Hb&&(a.Hb=0);void 0===a.xb&&(a.xb=-1);void 0===a.yb&&(a.yb=-1);a.B.vb=0<=a.Hb&&0<a.xb;a.B.vb&&(a.Gb=0,a.ma=a.Hb-a.ka)}function Zb(a,b){if(a.B.vb){var c=!1;a.Gb=a.Gb+a.rc()|0;a.ma-=b;0>=a.ma&&(a.ma+=a.xb,c=!0);0<=a.yb&&a.yb<=kd(a)&&(a.xb=a.yb=-1,id(a),a.ha(),c=!0);c&&a.j(kd(a)+" cycles: checksum="+p(a.Gb))}} function jd(a){void 0===a.Hb&&(a.Hb=0);void 0===a.xb&&(a.xb=-1);void 0===a.yb&&(a.yb=-1);a.B.vb=0<=a.Hb&&0<a.xb;a.B.vb&&(a.Gb=0,a.ma=a.Hb-a.ka)}function $b(a,b){if(a.B.vb){var c=!1;a.Gb=a.Gb+a.rc()|0;a.ma-=b;0>=a.ma&&(a.ma+=a.xb,c=!0);0<=a.yb&&a.yb<=ld(a)&&(a.xb=a.yb=-1,jd(a),a.ha(),c=!0);c&&a.j(ld(a)+" cycles: checksum="+p(a.Gb))}}
k.sa=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;c<h.length&&(b=h[c],b===a||b.B.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.B.ja);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.B.ready?"powered yet":"ready yet"+(b.Rb?" (waiting for notification)":""))+".");a=!1}a&&(d.B.Z?d.ha():d.hb())}, k.sa=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;c<h.length&&(b=h[c],b===a||b.B.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.B.ja);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.B.ready?"powered yet":"ready yet"+(b.Rb?" (waiting for notification)":""))+".");a=!1}a&&(d.B.Z?d.ha():d.hb())},
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){ld(d,d.bb<<1,!0)},c.textContent=this.nb.toFixed(2)+"Mhz",!0}return!1};k.ca=function(){var a=this.G.speed;a&&(a.textContent=this.B.Z&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped")};function Yb(a,b,c){a.ka+=b;c&&(a.da=a.b=a.J=0)}function md(a,b){var c=1;b&&1<a.bb&&a.Y&&(c=a.Y/a.tb);a.Sb=Math.round(1E3/30);a.jb=Math.floor(a.lb/30*c);b||(a.ta=a.jb);a.ub=0}function kd(a){return a.ka+a.S+a.da-a.b} !0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){md(d,d.bb<<1,!0)},c.textContent=this.nb.toFixed(2)+"Mhz",!0}return!1};k.$=function(){var a=this.G.speed;a&&(a.textContent=this.B.Z&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped")};function Zb(a,b,c){a.ka+=b;c&&(a.da=a.b=a.J=0)}function nd(a,b){var c=1;b&&1<a.bb&&a.Y&&(c=a.Y/a.tb);a.Sb=Math.round(1E3/30);a.jb=Math.floor(a.lb/30*c);b||(a.ta=a.jb);a.ub=0}function ld(a){return a.ka+a.S+a.da-a.b}
function hd(a){a.Y=0;a.Ub=0;a.ka=a.S=a.da=a.b=a.J=0;id(a);ld(a,1)}function ld(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.nb?b=1:d=!0;a.bb=b;b=a.tb*a.bb;if(a.nb!=b){a.nb=b;b=a.nb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.A&&a.A.qb()}Yb(a,a.S);a.S=0;a.R=Ba();a.$=0;md(a);return d}function zc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Kc(a,b,c){0<=b&&b<a.K.length&&0>a.K[b][0]&&(c=a.lb*a.bb/1E3*c|0,a.K[b][0]=c+nd(a))} function id(a){a.Y=0;a.Ub=0;a.ka=a.S=a.da=a.b=a.J=0;jd(a);md(a,1)}function md(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.nb?b=1:d=!0;a.bb=b;b=a.tb*a.bb;if(a.nb!=b){a.nb=b;b=a.nb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.A&&a.A.qb()}Zb(a,a.S);a.S=0;a.R=Ba();a.aa=0;nd(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&&b<a.K.length&&0>a.K[b][0]&&(c=a.lb*a.bb/1E3*c|0,a.K[b][0]=c+od(a))}
function od(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 Xb(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 nd(a,b){var c=a.da-=a.b;a.b=a.J=0;b&&(a.da=0);return c} function pd(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 Yb(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 od(a,b){var c=a.da-=a.b;a.b=a.J=0;b&&(a.da=0);return c}
k.Vd=function(){if(this.B.Z){this.ub>=this.lb&&md(this,!0);this.za=0;this.Xa=Ba();if(this.$){var a=this.Xa-this.$;a>this.Sb&&(this.R+=a,this.R>this.Xa&&(this.R=this.Xa))}try{do{var b=od(this,this.B.vb?1:this.jb);try{this.ib(b)}catch(e){if("number"!=typeof e)throw e;}b=nd(this,!0);this.za+=b;this.S+=b;Zb(this,b);Xb(this,b);this.ta-=b;if(0>=this.ta){this.ta+=this.jb;15<=++this.Ub&&(this.A&&this.A.ca(),this.Ub=0);break}}while(this.B.Z)}catch(e){this.ha();this.A&&this.A.stop(Ba(),kd(this));vb(this,e.stack|| k.Vd=function(){if(this.B.Z){this.ub>=this.lb&&nd(this,!0);this.za=0;this.Xa=Ba();if(this.aa){var a=this.Xa-this.aa;a>this.Sb&&(this.R+=a,this.R>this.Xa&&(this.R=this.Xa))}try{do{var b=pd(this,this.B.vb?1:this.jb);try{this.ib(b)}catch(e){if("number"!=typeof e)throw e;}b=od(this,!0);this.za+=b;this.S+=b;$b(this,b);Yb(this,b);this.ta-=b;if(0>=this.ta){this.ta+=this.jb;15<=++this.Ub&&(this.A&&this.A.$(void 0),this.Ub=0);break}}while(this.B.Z)}catch(e){this.ha();this.A&&this.A.stop(Ba(),ld(this));vb(this,
e.message);return}if(this.B.Z){a=setTimeout;b=this.uc;this.$=Ba();var c=this.Sb;this.za&&(c=Math.round(c*this.za/this.jb));var c=c-(this.$-this.Xa),d=this.$-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.ka=0,ld(this)));if(0>c||this.Y<this.nb)-1E3>c&&(this.R-=c),c=0;this.ub+=this.za;this.$+=c;a(b,c)}}}; e.stack||e.message);return}if(this.B.Z){a=setTimeout;b=this.uc;this.aa=Ba();var c=this.Sb;this.za&&(c=Math.round(c*this.za/this.jb));var c=c-(this.aa-this.Xa),d=this.aa-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.ka=0,md(this)));if(0>c||this.Y<this.nb)-1E3>c&&(this.R-=c),c=0;this.ub+=this.za;this.aa+=c;a(b,c)}}};
k.hb=function(a){if(ub(this))return!1;if(this.B.Z)return this.j(this.toString()+" busy"),!1;ld(this);this.B.Z=!0;this.B.Xb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.qb(!0),this.A.start(this.R,kd(this)));setTimeout(this.uc,0);return!0};k.ib=function(){return 0};k.ha=function(a){var b=!1;if(this.B.Z){nd(this);Yb(this,this.S);this.S=0;this.B.Z=!1;if(b=this.G.run)b.textContent="Run";this.A&&this.A.stop(Ba(),kd(this));b=!0}this.B.complete=a;return b}; k.hb=function(a){if(ub(this))return!1;if(this.B.Z)return this.j(this.toString()+" busy"),!1;md(this);this.B.Z=!0;this.B.Xb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.qb(!0),this.A.start(this.R,ld(this)));setTimeout(this.uc,0);return!0};k.ib=function(){return 0};k.ha=function(a){var b=!1;if(this.B.Z){od(this);Zb(this,this.S);this.S=0;this.B.Z=!1;if(b=this.G.run)b.textContent="Run";this.A&&this.A.stop(Ba(),ld(this));b=!0}this.B.complete=a;return b};
function pd(a){this.wb=+a.model||1170;this.Nb=a.addrReset||0;ed.call(this,a,6666667);this.decode=1120==this.wb?qd.bind(this):rd.bind(this);sd(this);this.L=0;this.N=null;this.B.complete=!1}z(pd,ed);k=pd.prototype;k.reset=function(){this.status("model "+this.wb);this.B.Z&&this.ha();sd(this);hd(this);this.B.error=!1;this.parent.reset.call(this)}; function qd(a){this.wb=+a.model||1170;this.Nb=a.addrReset||0;fd.call(this,a,6666667);this.decode=1120==this.wb?rd.bind(this):sd.bind(this);td(this);this.L=0;this.N=null;this.B.complete=!1}z(qd,fd);k=qd.prototype;k.reset=function(){this.status("model "+this.wb);this.B.Z&&this.ha();td(this);id(this);this.B.error=!1;this.parent.reset.call(this)};
function sd(a){a.T=65536;a.U=32768;a.aa=65535;a.X=32768;a.M=15;a.u=[0,0,0,0,0,0,0,a.Nb];a.Va=[0,0,0,0,0,0];a.Ga=[0,0,0,0];a.v=0;a.La=0;a.Qc=[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.wa=[[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.Kb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, function td(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.Nb];a.Va=[0,0,0,0,0,0];a.Ha=[0,0,0,0];a.v=0;a.Ma=0;a.Qc=[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.wa=[[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.Kb=[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.Ac=[0,0,0,0,0,0,0,0];a.zc=0;a.I=0;a.D=a.H=0;a.g=a.f=a.rb=0;a.va=-1;Wb(a)}function Wb(a){a.eb=255;a.ga=0;a.ic=0;a.C=0;a.cb=0;a.Jb=0;a.ob=0;a.Ta=0;a.Ha=0;a.Qb=262143;a.N=null;a.w&&Mc(a)}function Mc(a){a.Ta?(a.P=65536,a.ba=a.Pc,a.ra=a.Sd,a.Mb=a.Je,oc(a.w,a.ob&16?22:18)):(a.P=0,a.ba=a.Oc,a.ra=a.yc,a.Mb=a.Fc,oc(a.w,16))}function td(a,b,c){a.Nb=b;O(a,b);!c&&a.i&&(a.ha()||a.i.ca())}k.rc=function(){return 0}; 0,0,0,0,0,0,0,0,0,0];a.Ac=[0,0,0,0,0,0,0,0];a.zc=0;a.I=0;a.D=a.H=0;a.g=a.f=a.rb=0;a.va=-1;Xb(a)}function Xb(a){a.eb=255;a.ga=0;a.ic=0;a.C=0;a.cb=0;a.Jb=0;a.ob=0;a.Ta=0;a.Ia=0;a.Qb=262143;a.N=null;a.w&&Nc(a)}function Nc(a){a.Ta?(a.P=65536,a.ca=a.Pc,a.ra=a.Sd,a.Mb=a.Je,pc(a.w,a.ob&16?22:18)):(a.P=0,a.ca=a.Oc,a.ra=a.yc,a.Mb=a.Fc,pc(a.w,16))}function ud(a,b,c){a.Nb=b;O(a,b);!c&&a.i&&(a.ha()||a.i.$())}k.rc=function(){return 0};
k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ka,this.bb]);a.set(2,wc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ka=b[1];ld(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.J){for(var f=0,g=Array(b.J),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.W[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function ud(a){return a.T&65536?1:0} k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ka,this.bb]);a.set(2,xc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ka=b[1];md(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.J){for(var f=0,g=Array(b.J),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.W[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function vd(a){return a.T&65536?1:0}
function vd(a){return a.U&32768?2:0}function wd(a){return a.aa&65535?0:4}k.Sa=function(){return this.X&32768?8:0};function xd(a){var b=a.u[7];a.C&57344||(a.cb=0,a.Jb=b);a.u[7]=b+2&65535;return a.ra(b)}function yd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Lc(a,b){return{Xd:a,zb:b,next:null}}function Jc(a,b){if(b!=a.N){var c=a.N;if(!c||c.zb<=b.zb)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.zb<=b.zb){b.next=d;c.next=b;break}c=d}while(c)}}a.I|=2} function wd(a){return a.U&32768?2:0}function xd(a){return a.ba&65535?0:4}k.Sa=function(){return this.X&32768?8:0};function yd(a){var b=a.u[7];a.C&57344||(a.cb=0,a.Jb=b);a.u[7]=b+2&65535;return a.ra(b)}function zd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Mc(a,b){return{Xd:a,zb:b,next:null}}function Kc(a,b){if(b!=a.N){var c=a.N;if(!c||c.zb<=b.zb)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.zb<=b.zb){b.next=d;c.next=b;break}c=d}while(c)}}a.I|=2}
function ec(a){return a.M=a.M&63728|a.Sa()|wd(a)|vd(a)|ud(a)}function Nc(a,b){a.X=b<<12;a.aa=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.M)&2048)for(var c=a.Va.length;0<=--c;){var d=a.u[c];a.u[c]=a.Va[c];a.Va[c]=d}a.v=b>>14&3;c=a.M>>14&3;a.v!=c&&(a.Ga[c]=a.u[6],a.u[6]=a.Ga[a.v]);a.M=b;a.I|=2}function R(a,b){a.I&128||(a.X=a.aa=b,a.U=0)}function zd(a,b,c){a.I&128||(a.X=a.aa=a.T=b,a.U=c||0)}function Ad(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^b)&(d^b))} function fc(a){return a.M=a.M&63728|a.Sa()|xd(a)|wd(a)|vd(a)}function Oc(a,b){a.X=b<<12;a.ba=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.M)&2048)for(var c=a.Va.length;0<=--c;){var d=a.u[c];a.u[c]=a.Va[c];a.Va[c]=d}a.v=b>>14&3;c=a.M>>14&3;a.v!=c&&(a.Ha[c]=a.u[6],a.u[6]=a.Ha[a.v]);a.M=b;a.I|=2}function R(a,b){a.I&128||(a.X=a.ba=b,a.U=0)}function Ad(a,b,c){a.I&128||(a.X=a.ba=a.T=b,a.U=c||0)}function Bd(a,b,c,d){a.I&128||(a.X=a.ba=a.T=b,a.U=(c^b)&(d^b))}
function Bd(a,b){a.I&128||(a.X=a.aa=a.T=b,a.U=a.X^a.T>>1)}function Cd(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.va?this.va=ec(this):this.v||(a=4,c=!0);this.C&57344||(this.cb=63222,this.Jb=a);this.v=0;var d=this.ra(a|this.P),e=this.ra(a+2&65535|this.P);Nc(this,e&-12289|this.va>>2&12288);c&&(this.ga|=4,this.u[6]=4);Dd(this,this.va);Dd(this,this.u[7]);O(this,d);this.I&=-113;this.va=-1;this.I|=8;this.Uc=a;this.Sc=b;if(26!=b)throw a;}}; function Cd(a,b){a.I&128||(a.X=a.ba=a.T=b,a.U=a.X^a.T>>1)}function Dd(a,b,c,d){a.I&128||(a.X=a.ba=a.T=b,a.U=(c^d)&(d^b))}k.pa=function(a,b){if(!this.L){var c=!1;0>this.va?this.va=fc(this):this.v||(a=4,c=!0);this.C&57344||(this.cb=63222,this.Jb=a);this.v=0;var d=this.ra(a|this.P),e=this.ra(a+2&65535|this.P);Oc(this,e&-12289|this.va>>2&12288);c&&(this.ga|=4,this.u[6]=4);Ed(this,this.va);Ed(this,this.u[7]);O(this,d);this.I&=-113;this.va=-1;this.I|=8;this.Uc=a;this.Sc=b;if(26!=b)throw a;}};
function Vd(a){var b=Wd(a),c=Wd(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);O(a,b);Nc(a,c);a.I&=-17}function vc(a,b){var c=b>>13&31;31>c&&a.ob&32&&(b=a.Kb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} function Wd(a){var b=Xd(a),c=Xd(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);O(a,b);Oc(a,c);a.I&=-17}function wc(a,b){var c=b>>13&31;31>c&&a.ob&32&&(b=a.Kb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
function Xd(a,b,c){var d,e,f;if(!(c&a.Ta))return b;d=b>>13;a.ob&a.Qc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.wa[a.v][d]<<6)+(b&8191)&a.Qb;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.Ha=a.v,a.La=d;b=!1;g&&(g&57344&&(0<=a.va&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ha<<5|a.La<<1), function Yd(a,b,c){var d,e,f;if(!(c&a.Ta))return b;d=b>>13;a.ob&a.Qc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.wa[a.v][d]<<6)+(b&8191)&a.Qb;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.Ia=a.v,a.Ma=d;b=!1;g&&(g&57344&&(0<=a.va&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ia<<5|a.Ma<<1),
b=!0),a.C&61440||!(4191360>f||4194239<f)||(a.C|=4096,a.C&512&&(a.I|=32)),b&&a.pa(168,16));return f}function Yd(a,b){return a.w.Fb(b)}function Zd(a,b,c){b&1&&a.b--;a.w.Wb(b,c&255)}function Wd(a){var b=a.ra(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b}function Dd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.C&57344||(a.cb=a.cb<<8|246);!a.v&&c<=a.eb&&4<c&&(c<=a.eb-32?(a.ga|=4,a.u[6]=4,a.pa(4,18)):(a.ga|=8,a.I|=4));a.Mb(c,b)} b=!0),a.C&61440||!(4191360>f||4194239<f)||(a.C|=4096,a.C&512&&(a.I|=32)),b&&a.pa(168,16));return f}function Zd(a,b){return a.w.Fb(b)}function $d(a,b,c){b&1&&a.b--;a.w.Wb(b,c&255)}function Xd(a){var b=a.ra(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b}function Ed(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.C&57344||(a.cb=a.cb<<8|246);!a.v&&c<=a.eb&&4<c&&(c<=a.eb-32?(a.ga|=4,a.u[6]=4,a.pa(4,18)):(a.ga|=8,a.I|=4));a.Mb(c,b)}
function $d(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.pa(4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.u[6]<=a.eb||65534<=a.u[6])&&(a.u[6]<=a.eb-32||65534<=a.u[6]?(a.ga|=4,a.u[6]=4,a.pa(4,22)):(a.ga|=8,a.I|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ra(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.ra(e)| function ae(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.pa(4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.u[6]<=a.eb||65534<=a.u[6])&&(a.u[6]<=a.eb-32||65534<=a.u[6]?(a.ga|=4,a.u[6]=4,a.pa(4,22)):(a.ga|=8,a.I|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ra(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.ra(e)|
g;a.b-=8;break;case 6:return e=a.ra(yd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(yd(a,2)),e=e+a.u[c]&65535,e=a.ra(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.cb=a.cb<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.eb||65534<=a.u[6])&&(a.u[6]<=a.eb-32?(a.ga|=4,a.u[6]=4,a.pa(4,24)):(a.ga|=8,a.I|=64));return e}k.Tb=function(a){if(!this.Ta)return this.w.Tb(a);this.L++;a=Yd(this,Xd(this,a,3));this.L--;return a}; g;a.b-=8;break;case 6:return e=a.ra(zd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(zd(a,2)),e=e+a.u[c]&65535,e=a.ra(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.cb=a.cb<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.eb||65534<=a.u[6])&&(a.u[6]<=a.eb-32?(a.ga|=4,a.u[6]=4,a.pa(4,24)):(a.ga|=8,a.I|=64));return e}k.Tb=function(a){if(!this.Ta)return this.w.Tb(a);this.L++;a=Zd(this,Yd(this,a,3));this.L--;return a};
k.$a=function(a){if(!this.Ta)return this.w.$a(a);this.L++;a=this.yc(Xd(this,a,2));this.L--;return a};k.pb=function(a,b){this.Ta?(this.L++,Zd(this,Xd(this,a,5),b),this.L--):this.w.pb(a,b)};k.Cb=function(a,b){this.Ta?(this.L++,this.Fc(Xd(this,a,4),b),this.L--):this.w.Cb(a,b)};k.Oc=function(a,b,c){return $d(this,a,b,c)};k.Pc=function(a,b,c){return Xd(this,$d(this,a,b,c),c)};k.yc=function(a){return this.w.oa(a)};k.Sd=function(a){return this.w.oa(Xd(this,a,2))};k.Fc=function(a,b){this.w.gb(a,b&65535)}; k.$a=function(a){if(!this.Ta)return this.w.$a(a);this.L++;a=this.yc(Yd(this,a,2));this.L--;return a};k.pb=function(a,b){this.Ta?(this.L++,$d(this,Yd(this,a,5),b),this.L--):this.w.pb(a,b)};k.Cb=function(a,b){this.Ta?(this.L++,this.Fc(Yd(this,a,4),b),this.L--):this.w.Cb(a,b)};k.Oc=function(a,b,c){return ae(this,a,b,c)};k.Pc=function(a,b,c){return Yd(this,ae(this,a,b,c),c)};k.yc=function(a){return this.w.oa(a)};k.Sd=function(a){return this.w.oa(Yd(this,a,2))};k.Fc=function(a,b){this.w.gb(a,b&65535)};
k.Je=function(a,b){this.w.gb(Xd(this,a,4),b)};function ae(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=$d(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.v=a.M>>12&3,c=a.ra(d|c&a.P),a.v=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.u[d]:a.Ga[a.M>>12&3];return c}function be(a,b,c,d){a.C&57344||(a.cb=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=$d(a,b,e,4),c&65536||(e&=65535),a.v=a.M>>12&3,e=Xd(a,e|c&65536,4),a.v=a.M>>14&3,a.w.gb(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.u[e]=d:a.Ga[a.M>>12&3]=d} k.Je=function(a,b){this.w.gb(Yd(this,a,4),b)};function be(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ae(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.v=a.M>>12&3,c=a.ra(d|c&a.P),a.v=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.u[d]:a.Ha[a.M>>12&3];return c}function ce(a,b,c,d){a.C&57344||(a.cb=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ae(a,b,e,4),c&65536||(e&=65535),a.v=a.M>>12&3,e=Yd(a,e|c&65536,4),a.v=a.M>>14&3,a.w.gb(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.u[e]=d:a.Ha[a.M>>12&3]=d}
function ce(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?Yd(a,a.ba(b,c,3)):a.u[c]&255}function de(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 ee(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return $d(a,b,c,8)}function fe(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Yd(a,a.ba(b,c,3)):a.u[c]&255}function ge(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 de(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?Zd(a,a.ca(b,c,3)):a.u[c]&255}function ee(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?a.w.oa(a.ca(b,c,2)):a.u[c]}function fe(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ae(a,b,c,8)}function ge(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Zd(a,a.ca(b,c,3)):a.u[c]&255}function he(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(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.rb=a.ba(b,e,7),Zd(a,e,d.call(a,c,Yd(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.gb(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function he(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Zd(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 S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.rb=a.ca(b,e,7),$d(a,e,d.call(a,c,Zd(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.gb(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function ie(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?$d(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 ie(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.gb(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} function je(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.gb(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.ib=function(a){this.B.complete=!0;var b=this.i&&je(this.i)?1:this.B.Xb?-1:0,c=a?this.B.Xb?0:1:-1;this.B.Xb=!1;this.da=this.b=a;do{if(b){if(this.i&&ke(this.i,this.u[7],c)){this.ha();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.ic&224)>>5,f=this.N&&this.N.zb>e?this.N:null;f&&(d=f.Xd,e=f.zb);e>(this.M&224)>>5?(this.I&4&&(yd(this,2),this.I&=-5),this.pa(d, k.ib=function(a){this.B.complete=!0;var b=this.i&&ke(this.i)?1:this.B.Xb?-1:0,c=a?this.B.Xb?0:1:-1;this.B.Xb=!1;this.da=this.b=a;do{if(b){if(this.i&&le(this.i,this.u[7],c)){this.ha();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.ic&224)>>5,f=this.N&&this.N.zb>e?this.N:null;f&&(d=f.Xd,e=f.zb);e>(this.M&224)>>5?(this.I&4&&(zd(this,2),this.I&=-5),this.pa(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(xd(this))}while(0<this.b);return this.B.complete?this.da-this.b:void 0===this.B.complete?0:-1};Xa(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new pd(d);C(d,c)}});function le(a,b){var c=b+a;Ad(this,c,a,b);return c&65535} 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(yd(this))}while(0<this.b);return this.B.complete?this.da-this.b:void 0===this.B.complete?0:-1};Xa(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new qd(d);C(d,c)}});function me(a,b){var c=b+a;Bd(this,c,a,b);return c&65535}
function me(a,b){var c=b+a;Ad(this,c<<8,a<<8,b<<8);return c&255}function ne(a,b){a=b<<1;Bd(this,a);return a&65535}function oe(a,b){a=b<<1;Bd(this,a<<8);return a&255}function pe(a,b){a=b&32768|b>>1|b<<16;Bd(this,a);return a&65535}function qe(a,b){a=b&2048|b>>1|b<<8;Bd(this,a<<8);return a&255}function re(a,b){a=b&~a;R(this,a);return a}function se(a,b){a=b&~a;R(this,a<<8);return a}function te(a,b){a|=b;R(this,a);return a}function ue(a,b){a|=b;R(this,a<<8);return a} function ne(a,b){var c=b+a;Bd(this,c<<8,a<<8,b<<8);return c&255}function oe(a,b){a=b<<1;Cd(this,a);return a&65535}function pe(a,b){a=b<<1;Cd(this,a<<8);return a&255}function qe(a,b){a=b&32768|b>>1|b<<16;Cd(this,a);return a&65535}function re(a,b){a=b&2048|b>>1|b<<8;Cd(this,a<<8);return a&255}function se(a,b){a=b&~a;R(this,a);return a}function te(a,b){a=b&~a;R(this,a<<8);return a}function ue(a,b){a|=b;R(this,a);return a}function ve(a,b){a|=b;R(this,a<<8);return a}
function ve(a,b){a=~b|65536;zd(this,a);return a&65535}function we(a,b){a=~b|256;zd(this,a<<8);return a&255}function xe(a,b){a=b-a;this.I&128||(this.X=this.aa=a,this.U=b&(b^a));return a&65535}function ye(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 ze(a,b){a=b+a;this.I&128||(this.X=this.aa=a,this.U=a&(b^a));return a&65535}function Ae(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 we(a,b){a=~b|65536;Ad(this,a);return a&65535}function xe(a,b){a=~b|256;Ad(this,a<<8);return a&255}function ye(a,b){a=b-a;this.I&128||(this.X=this.ba=a,this.U=b&(b^a));return a&65535}function ze(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 Ae(a,b){a=b+a;this.I&128||(this.X=this.ba=a,this.U=a&(b^a));return a&65535}function Be(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 Be(a,b){a=-b;zd(this,a,a&b&32768);return a&65535}function Ce(a,b){a=-b;zd(this,a<<8,(a&b&128)<<8);return a&255}function De(a,b){a=b<<1|this.T>>16&1;Bd(this,a);return a&65535}function Ee(a,b){a=b<<1|this.T>>16&1;Bd(this,a<<8);return a&255}function Fe(a,b){a=(this.T&65536|b)>>1|b<<16;Bd(this,a);return a&65535}function Ge(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;Bd(this,a<<8);return a&255}function He(a,b){var c=b-a;Cd(this,c,a,b);return c&65535} function Ce(a,b){a=-b;Ad(this,a,a&b&32768);return a&65535}function De(a,b){a=-b;Ad(this,a<<8,(a&b&128)<<8);return a&255}function Ee(a,b){a=b<<1|this.T>>16&1;Cd(this,a);return a&65535}function Fe(a,b){a=b<<1|this.T>>16&1;Cd(this,a<<8);return a&255}function Ge(a,b){a=(this.T&65536|b)>>1|b<<16;Cd(this,a);return a&65535}function He(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;Cd(this,a<<8);return a&255}function Ie(a,b){var c=b-a;Dd(this,c,a,b);return c&65535}
function Ie(a,b){var c=b-a;Cd(this,c<<8,a<<8,b<<8);return c&255}function Je(a,b){this.I&128||(this.X=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ke(a,b){a^=b;R(this,a);return a&65535}function Le(a){T(this,a,de(this,a),le);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Je(a,b){var c=b-a;Dd(this,c<<8,a<<8,b<<8);return c&255}function Ke(a,b){this.I&128||(this.X=this.ba=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Le(a,b){a^=b;R(this,a);return a&65535}function Me(a){T(this,a,ee(this,a),me);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function Me(a){var b=ge(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&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>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 Ne(a){var b=he(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&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>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 Ne(a){var b=ge(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&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>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 Oe(a){U(this,a,!ud(this))}function Pe(a){U(this,a,ud(this))} function Oe(a){var b=he(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&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>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 Pe(a){U(this,a,!vd(this))}function Qe(a){U(this,a,vd(this))}
function Qe(a){T(this,a,de(this,a),re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Re(a){S(this,a,ce(this,a),se);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Se(a){T(this,a,de(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,ce(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 Re(a){T(this,a,ee(this,a),se);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Se(a){S(this,a,de(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){T(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){S(this,a,de(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 Ue(a){R(this,de(this,a)&ge(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Ve(a){R(this,(ce(this,a)&fe(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 We(a){U(this,a,wd(this))}function Xe(a){U(this,a,!this.Sa()==!vd(this))}function Ye(a){U(this,a,!wd(this)&&!this.Sa()==!vd(this))}function Ze(a){U(this,a,!ud(this)&&!wd(this))}function $e(a){U(this,a,wd(this)||!this.Sa()!=!vd(this))} function Ve(a){R(this,ee(this,a)&he(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function We(a){R(this,(de(this,a)&ge(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 Xe(a){U(this,a,xd(this))}function Ye(a){U(this,a,!this.Sa()==!wd(this))}function Ze(a){U(this,a,!xd(this)&&!this.Sa()==!wd(this))}function $e(a){U(this,a,!vd(this)&&!xd(this))}function af(a){U(this,a,xd(this)||!this.Sa()!=!wd(this))}
function af(a){U(this,a,ud(this)||wd(this))}function bf(a){U(this,a,!this.Sa()!=!vd(this))}function cf(a){U(this,a,this.Sa())}function df(a){U(this,a,!wd(this))}function ef(a){U(this,a,!this.Sa())}function ff(){this.pa(12,1);this.b-=5}function gf(a){U(this,a,!0)}function hf(a){U(this,a,!vd(this))}function jf(a){U(this,a,vd(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 bf(a){U(this,a,vd(this)||xd(this))}function cf(a){U(this,a,!this.Sa()!=!wd(this))}function df(a){U(this,a,this.Sa())}function ef(a){U(this,a,!xd(this))}function ff(a){U(this,a,!this.Sa())}function gf(){this.pa(12,1);this.b-=5}function hf(a){U(this,a,!0)}function jf(a){U(this,a,!wd(this))}function kf(a){U(this,a,wd(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 kf(a){var b=de(this,a);a=ge(this,a);Cd(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 lf(a){var b=ce(this,a)<<8;a=fe(this,a)<<8;Cd(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 lf(a){var b=ee(this,a);a=he(this,a);Dd(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 mf(a){var b=de(this,a)<<8;a=ge(this,a)<<8;Dd(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 mf(a){var b=ge(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 nf(){this.pa(24,2);this.b-=25} function nf(a){var b=he(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 of(){this.pa(24,2);this.b-=25}
function of(){this.M&49152?(this.ga|=128,this.pa(4,3)):this.i?pf(this.i):this.ha();this.b-=7}function qf(){this.pa(16,4);this.b-=25}var rf=[0,7,7,10,7,11,9,13];function sf(a){this.J=this.b;O(this,ee(this,a));this.b=this.J-rf[this.g]}var tf=[0,14,14,17,14,18,16,20];function uf(a){this.J=this.b;var b=ee(this,a);a=a>>6&7;Dd(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.J-tf[this.g]}var vf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function pf(){this.M&49152?(this.ga|=128,this.pa(4,3)):this.i?qf(this.i):this.ha();this.b-=7}function rf(){this.pa(16,4);this.b-=25}var sf=[0,7,7,10,7,11,9,13];function tf(a){this.J=this.b;O(this,fe(this,a));this.b=this.J-sf[this.g]}var uf=[0,14,14,17,14,18,16,20];function vf(a){this.J=this.b;var b=fe(this,a);a=a>>6&7;Ed(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.J-uf[this.g]}var wf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function wf(a){var b=de(this,a);this.J=this.b;R(this,ie(this,a,b));this.b=this.J-vf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function xf(a){var b=ce(this,a);R(this,he(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 yf=[7,13,13,17,14,18,17,21]; function xf(a){var b=ee(this,a);this.J=this.b;R(this,je(this,a,b));this.b=this.J-wf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function yf(a){var b=de(this,a);R(this,ie(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 zf=[7,13,13,17,14,18,17,21];
function zf(a){var b=ge(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<b?65536:0);this.b-=23}function Af(){this.b-=5}function Bf(){this.M&49152||(this.w.reset(),Wb(this));this.b-=667}function Cf(){Vd(this);this.I|=this.M&16;this.b-=13} function Af(a){var b=he(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<b?65536:0);this.b-=23}function Bf(){this.b-=5}function Cf(){this.M&49152||(this.w.reset(),Xb(this));this.b-=667}function Df(){Wd(this);this.I|=this.M&16;this.b-=13}
function Df(a){if(a&8)W.call(this,a);else{var b=Wd(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}function X(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.aa=0);a&8&&(this.X=32768);this.b-=5}function Ef(a){var b=(a&448)>>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 Ff(a){T(this,a,de(this,a),He);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Ef(a){if(a&8)W.call(this,a);else{var b=Xd(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}function X(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.ba=0);a&8&&(this.X=32768);this.b-=5}function Ff(a){var b=(a&448)>>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 Gf(a){T(this,a,ee(this,a),Ie);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function Gf(a){T(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)}function Hf(){this.pa(28,5);this.b-=5}function If(){this.I&4||this.A&&this.A.ca();this.I|=4;yd(this,-2);this.b-=3}function Jf(a){T(this,a,de(this,a),Ke);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=pf(b);b||this.pa(8,6)}function qd(a){Kf[a>>12].call(this,a)}function Lf(a){Mf[a>>6&3].call(this,a)}function Nf(a){Of[a>>6&3].call(this,a)} function Hf(a){T(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)}function If(){this.pa(28,5);this.b-=5}function Jf(){this.I&4||this.A&&this.A.$();this.I|=4;zd(this,-2);this.b-=3}function Kf(a){T(this,a,ee(this,a),Le);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=qf(b);b||this.pa(8,6)}function rd(a){Lf[a>>12].call(this,a)}function Mf(a){Nf[a>>6&3].call(this,a)}function Of(a){Pf[a>>6&3].call(this,a)}
function Pf(a){Qf[a>>6&3].call(this,a)}function Rf(a){Sf[a&15].call(this,a)}function Tf(a){Uf[a&15].call(this,a)}function Vf(a){Wf[a>>6&3].call(this,a)}function Xf(a){Yf[a>>6&3].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)} function Qf(a){Rf[a>>6&3].call(this,a)}function Sf(a){Tf[a&15].call(this,a)}function Uf(a){Vf[a&15].call(this,a)}function Wf(a){Xf[a>>6&3].call(this,a)}function Yf(a){Zf[a>>6&3].call(this,a)}function $f(a){ag[a>>6&3].call(this,a)}
var Kf=[function(a){ag[a>>8&15].call(this,a)},wf,kf,Ue,Qe,Se,Le,W,function(a){bg[a>>8&15].call(this,a)},xf,lf,Ve,Re,Te,Ff,W],ag=[function(a){cg[a>>4&15].call(this,a)},gf,df,We,Xe,bf,Ye,$e,uf,uf,Lf,Nf,Pf,W,W,W],Mf=[function(a){zd(this,ie(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ve);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)},function(a){T(this,a,1,xe);this.b-=this.g?9:3+(7==this.f?2:0)}],Of=[function(a){T(this,a,0, var Lf=[function(a){bg[a>>8&15].call(this,a)},xf,lf,Ve,Re,Te,Me,W,function(a){cg[a>>8&15].call(this,a)},yf,mf,We,Se,Ue,Gf,W],bg=[function(a){dg[a>>4&15].call(this,a)},hf,ef,Xe,Ye,cf,Ze,af,vf,vf,Mf,Of,Qf,W,W,W],Nf=[function(a){Ad(this,je(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,we);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)},function(a){T(this,a,1,ye);this.b-=this.g?9:3+(7==this.f?2:0)}],Pf=[function(a){T(this,a,0,
Be);this.b-=this.g?11:6},function(a){T(this,a,ud(this)?1:0,le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,ud(this)?1:0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ge(this,a);zd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Qf=[function(a){T(this,a,0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,De);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)},function(a){T(this,a,0,ne);this.b-=this.g?9:3+(7==this.f?2:0)}], Ce);this.b-=this.g?11:6},function(a){T(this,a,vd(this)?1:0,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,vd(this)?1:0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=he(this,a);Ad(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Rf=[function(a){T(this,a,0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ee);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)},function(a){T(this,a,0,oe);this.b-=this.g?9:3+(7==this.f?2:0)}],
cg=[function(a){dg[a&15].call(this,a)},W,W,W,sf,sf,sf,sf,Df,W,Rf,Tf,Gf,Gf,Gf,Gf],dg=[of,If,Cf,ff,qf,Bf,W,W,W,W,W,W,W,W,W,W],Sf=[Af,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],Uf=[Af,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],bg=[ef,cf,Ze,af,hf,jf,Oe,Pe,nf,Hf,Vf,Xf,Zf,W,W,W],Wf=[function(a){zd(this, dg=[function(a){eg[a&15].call(this,a)},W,W,W,tf,tf,tf,tf,Ef,W,Sf,Uf,Hf,Hf,Hf,Hf],eg=[pf,Jf,Df,gf,rf,Cf,W,W,W,W,W,W,W,W,W,W],Tf=[Bf,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],Vf=[Bf,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],cg=[ff,df,$e,bf,jf,kf,Pe,Qe,of,If,Wf,Yf,$f,W,W,W],Xf=[function(a){Ad(this,
he(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,we);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)},function(a){S(this,a,1,ye);this.b-=this.g?9:3+(7==this.f?2:0)}],Yf=[function(a){S(this,a,0,Ce);this.b-=this.g?11:6},function(a){S(this,a,ud(this)?1:0,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,ud(this)?1:0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=fe(this,a);zd(this,a<<8);this.b-=this.g?4:3+(7== ie(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,xe);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)},function(a){S(this,a,1,ze);this.b-=this.g?9:3+(7==this.f?2:0)}],Zf=[function(a){S(this,a,0,De);this.b-=this.g?11:6},function(a){S(this,a,vd(this)?1:0,ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,vd(this)?1:0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ge(this,a);Ad(this,a<<8);this.b-=this.g?4:3+(7==
this.f?2:0)}],$f=[function(a){S(this,a,0,Ge);this.b-=this.g?9+(this.rb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,qe);this.b-=this.g?9+(this.rb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,oe);this.b-=this.g?9:3+(7==this.f?2:0)}];function rd(a){eg[a>>12].call(this,a)} this.f?2:0)}],ag=[function(a){S(this,a,0,He);this.b-=this.g?9+(this.rb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,re);this.b-=this.g?9+(this.rb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)}];function sd(a){fg[a>>12].call(this,a)}
var eg=[function(a){fg[a>>8&15].call(this,a)},wf,kf,Ue,Qe,Se,Le,function(a){gg[a>>8&15].call(this,a)},function(a){hg[a>>8&15].call(this,a)},xf,lf,Ve,Re,Te,Ff,W],fg=[function(a){ig[a>>4&15].call(this,a)},gf,df,We,Xe,bf,Ye,$e,uf,uf,Lf,Nf,Pf,function(a){jg[a>>6&3].call(this,a)},W,W],jg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.P);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ae(this,a,0);Dd(this,a);R(this,a);this.b-=11},function(a){var b=Wd(this);this.J= var fg=[function(a){gg[a>>8&15].call(this,a)},xf,lf,Ve,Re,Te,Me,function(a){hg[a>>8&15].call(this,a)},function(a){ig[a>>8&15].call(this,a)},yf,mf,We,Se,Ue,Gf,W],gg=[function(a){jg[a>>4&15].call(this,a)},hf,ef,Xe,Ye,cf,Ze,af,vf,vf,Mf,Of,Qf,function(a){kg[a>>6&3].call(this,a)},W,W],kg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.P);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=be(this,a,0);Ed(this,a);R(this,a);this.b-=11},function(a){var b=Xd(this);this.J=
this.b;be(this,a,0,b);R(this,b);this.b=this.J-yf[this.g]},function(a){R(this,ie(this,a,this.Sa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],ig=[function(a){kg[a&15].call(this,a)},W,W,W,sf,sf,sf,sf,Df,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)},Rf,Tf,Gf,Gf,Gf,Gf],kg=[of,If,Cf,ff,qf,Bf,function(){Vd(this);this.b-=13},W,W,W,W,W,W,W,W,W],gg=[zf,zf,mf,mf,Me,Me,Ne,Ne,Jf,Jf,W,W,W,W,Ef,Ef],hg=[ef,cf,Ze,af,hf,jf,Oe,Pe,nf,Hf,Vf,Xf,Zf,function(a){lg[a>> this.b;ce(this,a,0,b);R(this,b);this.b=this.J-zf[this.g]},function(a){R(this,je(this,a,this.Sa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],jg=[function(a){lg[a&15].call(this,a)},W,W,W,tf,tf,tf,tf,Ef,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)},Sf,Uf,Hf,Hf,Hf,Hf],lg=[pf,Jf,Df,gf,rf,Cf,function(){Wd(this);this.b-=13},W,W,W,W,W,W,W,W,W],hg=[Af,Af,nf,nf,Ne,Ne,Oe,Oe,Kf,Kf,W,W,W,W,Ff,Ff],ig=[ff,df,$e,bf,jf,kf,Pe,Qe,of,If,Wf,Yf,$f,function(a){mg[a>>
6&3].call(this,a)},W,W],lg=[W,function(a){a=ae(this,a,65536);Dd(this,a);R(this,a);this.b-=11},function(a){var b=Wd(this);this.J=this.b;be(this,a,65536,b);R(this,b);this.b=this.J-yf[this.g]},W]; 6&3].call(this,a)},W,W],mg=[W,function(a){a=be(this,a,65536);Ed(this,a);R(this,a);this.b-=11},function(a){var b=Xd(this);this.J=this.b;ce(this,a,65536,b);R(this,b);this.b=this.J-zf[this.g]},W];
function mg(a){u.call(this,"ROM",a,mg);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.Pa,a,b),(a=Fa(a,b))?(c.f=a.ea,c.ia=a.ia):c.A=null);ng(c)})}}z(mg);mg.prototype.Da=function(a,b,c,d){this.w=b;this.b=c;this.i=d;ng(this)}; function ng(a){u.call(this,"ROM",a,ng);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.Pa,a,b),(a=Fa(a,b))?(c.f=a.ea,c.ia=a.ia):c.A=null);og(c)})}}z(ng);ng.prototype.Da=function(a,b,c,d){this.w=b;this.b=c;this.i=d;og(this)};
mg.prototype.Fa=function(){this.ia&&(this.i&&og(this.i,this.id,this.C,this.g,this.ia),delete this.ia);return!0};mg.prototype.Ea=function(){return!0}; ng.prototype.Ga=function(){this.ia&&(this.i&&pg(this.i,this.id,this.C,this.g,this.ia),delete this.ia);return!0};ng.prototype.Fa=function(){return!0};
function ng(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(rc(a.w,b,a.g,Uc)){var c;for(c=0;c<a.f.length;c++)a.w.pb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.v?b.push(a.v):null!=a.v&&a.v.length&&(b=a.v);for(c=0;c<b.length;c++){var d=a,e=b[c],f=qc(d.w,d.C,d.g);pc(d.w,e,d.g,f)}delete a.f}}}H(a)}} function og(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(sc(a.w,b,a.g,Vc)){var c;for(c=0;c<a.f.length;c++)a.w.pb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.v?b.push(a.v):null!=a.v&&a.v.length&&(b=a.v);for(c=0;c<b.length;c++){var d=a,e=b[c],f=rc(d.w,d.C,d.g);qc(d.w,e,d.g,f)}delete a.f}}}H(a)}}
Xa(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new mg(d);C(d,c)}}); Xa(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new ng(d);C(d,c)}});
function pg(a){u.call(this,"RAM",a,pg);this.ia=this.g=null;this.A=a.addr;this.C=a.size;this.Ja=a.load;this.Ia=a.exec;this.v=!1;this.f=a.file;this.D=sa(this.f);if(this.f){a=this.f;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.O("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(nb(c.Pa,a,b),(a=Fa(a,b))?(c.g=a.ea,c.ia=a.ia,null==c.Ja&&(c.Ja=a.Ja),null==c.Ia&&(c.Ia=a.Ia)):c.f=null);qg(c)})}} function qg(a){u.call(this,"RAM",a,qg);this.ia=this.g=null;this.A=a.addr;this.C=a.size;this.Ka=a.load;this.Ja=a.exec;this.v=!1;this.f=a.file;this.D=sa(this.f);if(this.f){a=this.f;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.O("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(nb(c.Pa,a,b),(a=Fa(a,b))?(c.g=a.ea,c.ia=a.ia,null==c.Ka&&(c.Ka=a.Ka),null==c.Ja&&(c.Ja=a.Ja)):c.f=null);rg(c)})}}
z(pg);pg.prototype.Da=function(a,b,c,d){this.w=b;this.b=c;this.i=d;qg(this)};pg.prototype.Fa=function(){this.ia&&(this.i&&og(this.i,this.id,this.A,this.C,this.ia),delete this.ia);return!0};pg.prototype.Ea=function(){return!0};function qg(a){if(a.w&&(!a.v&&a.C&&rc(a.w,a.A,a.C,1)&&(a.v=!0),!tb(a))){if(!a.v)q("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;Kg(a,a.g,a.Ja,a.Ia,a.A)}H(a)}} z(qg);qg.prototype.Da=function(a,b,c,d){this.w=b;this.b=c;this.i=d;rg(this)};qg.prototype.Ga=function(){this.ia&&(this.i&&pg(this.i,this.id,this.A,this.C,this.ia),delete this.ia);return!0};qg.prototype.Fa=function(){return!0};function rg(a){if(a.w&&(!a.v&&a.C&&sc(a.w,a.A,a.C,1)&&(a.v=!0),!tb(a))){if(!a.v)q("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;Lg(a,a.g,a.Ka,a.Ja,a.A)}H(a)}}
pg.prototype.reset=function(){if(this.v){for(var a=this.w,b=this.A,c=this.C,d=b&a.w,b=b>>>a.la;0<c&&b<a.W.length;){var e=a.W[b],f=c,g,d=d||0;void 0===f&&(f=e.size);if(wb)for(g=d;f--&&g<e.G.length;g++)e.G[g]=0;else for(g=d;f--&&g<e.size;g++)e.Zb(d,0,e.F+d);c-=a.xa;b++;d=0}this.g&&Kg(this,this.g,this.Ja,this.Ia,this.A,!0)}}; qg.prototype.reset=function(){if(this.v){for(var a=this.w,b=this.A,c=this.C,d=b&a.w,b=b>>>a.la;0<c&&b<a.W.length;){var e=a.W[b],f=c,g,d=d||0;void 0===f&&(f=e.size);if(wb)for(g=d;f--&&g<e.G.length;g++)e.G[g]=0;else for(g=d;f--&&g<e.size;g++)e.Zb(d,0,e.F+d);c-=a.xa;b++;d=0}this.g&&Lg(this,this.g,this.Ka,this.Ja,this.A,!0)}};
function Kg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=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<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.pb(n++,b[r++]&255);else n&1?a.b.ha():td(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.b.pb(c+ function Lg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=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<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.pb(n++,b[r++]&255);else n&1?a.b.ha():ud(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.b.pb(c+
e,b[e]);null!=d&&td(a.b,d,f);g=!0}return g}Xa(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new pg(d);C(d,c)}});function Lg(a){u.call(this,"Keyboard",a,Lg,65536);H(this)}z(Lg);Lg.prototype.sa=function(){return!1};Lg.prototype.Da=function(a,b,c,d){this.A=a;this.b=c;this.i=d};Xa(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Lg(d);C(d,c)}}); e,b[e]);null!=d&&ud(a.b,d,f);g=!0}return g}Xa(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new qg(d);C(d,c)}});function Mg(a){u.call(this,"Keyboard",a,Mg,65536);H(this)}z(Mg);Mg.prototype.sa=function(){return!1};Mg.prototype.Da=function(a,b,c,d){this.A=a;this.b=c;this.i=d};Xa(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Mg(d);C(d,c)}});
function Y(a){this.N=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.da=a.upperCase;this.v=this.D=null;this.S=a.tabSize;this.P=a.charBOL;this.H=0;u.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.D="";else{var c;a=Mg;b&&(void 0===c&&(c="Panel"),(c=qb(c,this.id))&&(b=c.G[b])&&this.sa(null,a,b))}this.J=this.L=null;this.exports={connect:this.vc,receiveData:this.hc}}z(Y);var Mg="buffer";k=Y.prototype; function Y(a){this.N=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.da=a.upperCase;this.v=this.D=null;this.S=a.tabSize;this.P=a.charBOL;this.H=0;u.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.D="";else{var c;a=Ng;b&&(void 0===c&&(c="Panel"),(c=qb(c,this.id))&&(b=c.G[b])&&this.sa(null,a,b))}this.J=this.L=null;this.exports={connect:this.vc,receiveData:this.hc}}z(Y);var Ng="buffer";k=Y.prototype;
k.sa=function(a,b,c){var d=this;switch(b){case Mg:return this.G[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.hc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.hc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1}; k.sa=function(a,b,c){var d=this;switch(b){case Ng:return this.G[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.hc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.hc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
k.Da=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;var e=this;this.ka=Lc(48,4);this.Y=zc(this.b,function(){e.f&128||!e.C.length||(e.K=e.C.shift()&255,e.da&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&Jc(e.b,e.ka))});this.ma=Lc(52,4);this.$=zc(this.b,function(){e.g|=128;e.g&64&&Jc(e.b,e.ma)});Bb(b,this,Ng);H(this)}; k.Da=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;var e=this;this.ka=Mc(48,4);this.Y=Jc(this.b,function(){e.f&128||!e.C.length||(e.K=e.C.shift()&255,e.da&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&Kc(e.b,e.ka))});this.ma=Mc(52,4);this.aa=Jc(this.b,function(){e.g|=128;e.g&64&&Kc(e.b,e.ma)});Cb(b,this,Og);H(this)};
k.vc=function(){if(!this.J){var a=gd(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.kb)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.Pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Fa=function(a,b){if(!b)if(this.vc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; k.vc=function(){if(!this.J){var a=hd(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.kb)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.Pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.vc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
k.Ea=function(a){return a?this.save():!0};k.reset=function(){Og(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Og(this)};function Og(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.hc=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.C.push(a.charCodeAt(b));else this.C=this.C.concat(a);Kc(this.b,this.Y,1E3/Math.round(this.N/10));return!0};k.Bd=function(){return this.f&65534}; k.Fa=function(a){return a?this.save():!0};k.reset=function(){Pg(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Pg(this)};function Pg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.hc=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.C.push(a.charCodeAt(b));else this.C=this.C.concat(a);Lc(this.b,this.Y,1E3/Math.round(this.N/10));return!0};k.Bd=function(){return this.f&65534};
k.se=function(a){this.f=this.f&-112|a&111};k.Ad=function(){this.f&=-129;0<this.C.length&&Kc(this.b,this.Y,1E3/Math.round(this.N/10));return this.K};k.re=function(){};k.Ud=function(){return this.g};k.Le=function(a){128==(this.g&192)&&a&64&&Kc(this.b,this.$,1E3/Math.round(this.R/10));this.g=this.g&-70|a&69};k.Td=function(){return 0}; k.se=function(a){this.f=this.f&-112|a&111};k.Ad=function(){this.f&=-129;0<this.C.length&&Lc(this.b,this.Y,1E3/Math.round(this.N/10));return this.K};k.re=function(){};k.Ud=function(){return this.g};k.Le=function(a){128==(this.g&192)&&a&64&&Lc(this.b,this.aa,1E3/Math.round(this.R/10));this.g=this.g&-70|a&69};k.Td=function(){return 0};
k.Ke=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.J,a);if(this.v)if(13==a)this.H=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=za[a])?"<"+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), k.Ke=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.J,a);if(this.v)if(13==a)this.H=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=za[a])?"<"+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;Kc(this.b,this.$,1E3/Math.round(this.R/10))}};var Pg={},Ng=(Pg[65392]=[null,null,Y.prototype.Bd,Y.prototype.se,"RCSR"],Pg[65394]=[null,null,Y.prototype.Ad,Y.prototype.re,"RBUF"],Pg[65396]=[null,null,Y.prototype.Ud,Y.prototype.Le,"XCSR"],Pg[65398]=[null,null,Y.prototype.Td,Y.prototype.Ke,"XBUF"],Pg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Y(d);C(d,c)}}); this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Lc(this.b,this.aa,1E3/Math.round(this.R/10))}};var Qg={},Og=(Qg[65392]=[null,null,Y.prototype.Bd,Y.prototype.se,"RCSR"],Qg[65394]=[null,null,Y.prototype.Ad,Y.prototype.re,"RBUF"],Qg[65396]=[null,null,Y.prototype.Ud,Y.prototype.Le,"XCSR"],Qg[65398]=[null,null,Y.prototype.Td,Y.prototype.Ke,"XBUF"],Qg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Y(d);C(d,c)}});
function Oc(a){u.call(this,"PC11",a,Oc);this.g=a.autoMount||null;this.D=0;this.$=a.baudReceive||3600;this.K=this.L=this.f=0;this.J=[];this.H=Qg;this.v=Rg;this.N=this.C="";this.ea=this.Ja=this.Ia=null;this.R=-1;this.P=!Pa("Mobi")&&window&&"FileReader"in window}z(Oc);var Qg="",Rg=0;k=Oc.prototype; function Pc(a){u.call(this,"PC11",a,Pc);this.g=a.autoMount||null;this.D=0;this.aa=a.baudReceive||3600;this.K=this.L=this.f=0;this.J=[];this.H=Rg;this.v=Sg;this.N=this.C="";this.ea=this.Ka=this.Ja=null;this.R=-1;this.P=!Pa("Mobi")&&window&&"FileReader"in window}z(Pc);var Rg="",Sg=0;k=Pc.prototype;
k.sa=function(a,b,c){var d=this,e=Rg;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");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= k.sa=function(a,b,c){var d=this,e=Sg;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");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&&Sg(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;Sg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; function(){var a=d.G.listTapes;a&&Tg(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;Tg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
k.Da=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;this.S=Tg(a);var e=this;if((this.g=gd(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=Lc(56,4);this.da=zc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.J.length&&(e.L=e.J[e.K++]&255,Ug(e,e.K/e.J.length*100),e.f|=128,e.f&=-2049,e.f&64&&Jc(e.b,e.Y))});Bb(b,this,Vg);Wg(this,"None",Qg,!0);this.P&&Wg(this,"Local Tape", k.Da=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;this.S=Ug(a);var e=this;if((this.g=hd(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=Mc(56,4);this.da=Jc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.J.length&&(e.L=e.J[e.K++]&255,Vg(e,e.K/e.J.length*100),e.f|=128,e.f&=-2049,e.f&64&&Kc(e.b,e.Y))});Cb(b,this,Wg);Xg(this,"None",Rg,!0);this.P&&Xg(this,"Local Tape",
"?");Wg(this,"Remote Tape","??");Xg(this)||H(this)};k.Fa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ea=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function Xg(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=sa(b,!0)}b&&c?Yg(a,c,b,1,!0):Zg(a)}return!!a.D} "?");Xg(this,"Remote Tape","??");Yg(this)||H(this)};k.Ga=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function Yg(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=sa(b,!0)}b&&c?Zg(a,c,b,1,!0):$g(a)}return!!a.D}
function Sg(a,b,c,d,e){if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;Yg(a,b,c,d,!1,e)}else $g(a,!1)} function Tg(a,b,c,d,e){if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;Zg(a,b,c,d,!1,e)}else ah(a,!1)}
function Yg(a,b,c,d,e,f){var g=-1;if(a.C.toLowerCase()!=c.toLowerCase()||a.v!=d)g++,$g(a,!0),a.B.Za?a.O("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),ah(a,b,c,d,f)?g++:a.B.Za=!0);g&&bh(a,a.N,a.C,a.v,a.ea,a.Ja,a.Ia)} function Zg(a,b,c,d,e,f){var g=-1;if(a.C.toLowerCase()!=c.toLowerCase()||a.v!=d)g++,ah(a,!0),a.B.Za?a.O("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),bh(a,b,c,d,f)?g++:a.B.Za=!0);g&&ch(a,a.N,a.C,a.v,a.ea,a.Ka,a.Ja)}
function ah(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),bh(a,b,c,d,e),a.H="?");Zg(a)};g.readAsArrayBuffer(e);return!0}0>c.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.Pa,e,f),(e=Fa(e,f))&&bh(a,b,c,d,e.ea,e.Ja, function bh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),ch(a,b,c,d,e),a.H="?");$g(a)};g.readAsArrayBuffer(e);return!0}0>c.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.Pa,e,f),(e=Fa(e,f))&&ch(a,b,c,d,e.ea,e.Ka,
e.Ia));a.B.Za=!1;a.D&&(a.D--,a.D||H(a));Zg(a)})}function Wg(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} e.Ja));a.B.Za=!1;a.D&&(a.D--,a.D||H(a));$g(a)})}function Xg(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Zg(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.C;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Ug(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}} function $g(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.C;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Vg(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}}
function bh(a,b,c,d,e,f,g){a.N=b;a.C=c;a.v=d;a.ea=e;a.Ja=f;a.Ia=g;2==d?a.S&&Kg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.N="",a.C="",a.H=Qg,a.v=Rg,a.O("No load address available for tape: "+b)):(a.K=0,a.J=e,a.status("tape attached: "+b),Ug(a,0))}function $g(a,b){if(a.C||!1===b)a.N="",a.C="",b||(a.v&&a.status(1==a.v?"tape detached":"tape unloaded"),a.H=Qg,a.v=Rg,Zg(a))}k.save=function(){return(new P(this)).data()};k.restore=function(){return!0};k.ud=function(){return this.f&65534}; function ch(a,b,c,d,e,f,g){a.N=b;a.C=c;a.v=d;a.ea=e;a.Ka=f;a.Ja=g;2==d?a.S&&Lg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.N="",a.C="",a.H=Rg,a.v=Sg,a.O("No load address available for tape: "+b)):(a.K=0,a.J=e,a.status("tape attached: "+b),Vg(a,0))}function ah(a,b){if(a.C||!1===b)a.N="",a.C="",b||(a.v&&a.status(1==a.v?"tape detached":"tape unloaded"),a.H=Rg,a.v=Sg,$g(a))}k.save=function(){return(new P(this)).data()};k.restore=function(){return!0};k.ud=function(){return this.f&65534};
k.le=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Jc(this.b,this.Y)):(this.f&=-129,this.f|=2048,this.L=0,Kc(this.b,this.da,1E3/Math.round(this.$/10))));this.f=this.f&-66|a&65};k.td=function(){this.f&=-129;this.f|=2048;return this.L};k.ke=function(){};var ch={},Vg=(ch[65384]=[null,null,Oc.prototype.ud,Oc.prototype.le,"PRS"],ch[65386]=[null,null,Oc.prototype.td,Oc.prototype.ke,"PRB"],ch); k.le=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Kc(this.b,this.Y)):(this.f&=-129,this.f|=2048,this.L=0,Lc(this.b,this.da,1E3/Math.round(this.aa/10))));this.f=this.f&-66|a&65};k.td=function(){this.f&=-129;this.f|=2048;return this.L};k.ke=function(){};var dh={},Wg=(dh[65384]=[null,null,Pc.prototype.ud,Pc.prototype.le,"PRS"],dh[65386]=[null,null,Pc.prototype.td,Pc.prototype.ke,"PRB"],dh);
function dh(a,b,c){u.call(this,"Disk",{id:a.Pa+".disk"+p(++eh,4)},dh,2097152);this.controller=a;this.A=a.A;this.i=a.i;this.v=b;this.Wa=b.name;this.dc=b.dc;fh(this,c,b.ua,b.ya,b.qa,b.Ka);H(this)}var eh=0;z(dh);k=dh.prototype;k.Da=function(a,b,c,d){this.i=d}; function eh(a,b,c){u.call(this,"Disk",{id:a.Pa+".disk"+p(++fh,4)},eh,2097152);this.controller=a;this.A=a.A;this.i=a.i;this.v=b;this.Wa=b.name;this.dc=b.dc;gh(this,c,b.ua,b.ya,b.qa,b.La);H(this)}var fh=0;z(eh);k=eh.prototype;k.Da=function(a,b,c,d){this.i=d};
function fh(a,b,c,d,e,f){a.mode=b;a.ua=c;a.ya=d;a.qa=e;a.Ka=f;a.b=[];if("preload"!=a.mode){b=Array(a.ua);for(c=0;c<b.length;c++){d=Array(a.ya);for(e=0;e<d.length;e++){f=Array(a.qa);for(var g=1;g<=f.length;g++)f[g-1]=gh(null,c,e,g,a.Ka,0);d[e]=f}b[c]=d}a.b=b}a.f=null} function gh(a,b,c,d,e,f){a.mode=b;a.ua=c;a.ya=d;a.qa=e;a.La=f;a.b=[];if("preload"!=a.mode){b=Array(a.ua);for(c=0;c<b.length;c++){d=Array(a.ya);for(e=0;e<d.length;e++){f=Array(a.qa);for(var g=1;g<=f.length;g++)f[g-1]=hh(null,c,e,g,a.La,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
function hh(a,b,c,d,e){var f=c;if(a.w)return!0;a.Wa=b;a.fb=c;a.Cc=sa(c);a.w=e;a.C=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=la[d];if(e){a.ua=e[0];a.ya=e[1];a.qa=e[2];a.Ka=e[3]||512;c=a.Ka>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ua);for(d=0;d<a.b.length;d++)for(var t=a.b[d]=Array(a.ya),w=0;w<t.length;w++)for(var y=t[w]=Array(a.qa),x=0;x<y.length;x++){for(var A=gh(null,d,w,x+1,a.Ka,0),ja=A.data,Ia=0;Ia<c;Ia++,f+=4)var Q=ja[Ia]=b.getInt32(f, function ih(a,b,c,d,e){var f=c;if(a.w)return!0;a.Wa=b;a.fb=c;a.Cc=sa(c);a.w=e;a.C=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=la[d];if(e){a.ua=e[0];a.ya=e[1];a.qa=e[2];a.La=e[3]||512;c=a.La>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ua);for(d=0;d<a.b.length;d++)for(var t=a.b[d]=Array(a.ya),w=0;w<t.length;w++)for(var y=t[w]=Array(a.qa),x=0;x<y.length;x++){for(var A=hh(null,d,w,x+1,a.La,0),ja=A.data,Ia=0;Ia<c;Ia++,f+=4)var Q=ja[Ia]=b.getInt32(f,
!0),e=e+Q&-1;A.Aa=c;y[x]=A}a.f=e;c=a}else a.O("Unrecognized disk format ("+d+" bytes)");a.w&&(a.w.call(a.controller,a.v,c,a.Wa,a.fb),a.w=null)};g.readAsArrayBuffer(d);return!0}0>c.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.dc?"":e)+"&format=json"));return!!Ea(f, !0),e=e+Q&-1;A.Aa=c;y[x]=A}a.f=e;c=a}else a.O("Unrecognized disk format ("+d+" bytes)");a.w&&(a.w.call(a.controller,a.v,c,a.Wa,a.fb),a.w=null)};g.readAsArrayBuffer(d);return!0}0>c.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.dc?"":e)+"&format=json"));return!!Ea(f,
null,!0,function(b,c,d){ih(a,b,c,d)})} null,!0,function(b,c,d){jh(a,b,c,d)})}
function ih(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.Wa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Pa,b,c);try{if(0<sa(a.Cc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Wa]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ function jh(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.Wa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Pa,b,c);try{if(0<sa(a.Cc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Wa]:h=0>c.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.ua=h.length;a.ya=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Ka=l&&l.length||512;for(d=c=0;d<a.ua;d++)for(f=0;f<a.ya;f++)for(g=0;g<a.qa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>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<w;y++)t[y]=n;jh(l,t)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}gh(l,d,f);for(w= c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.ya=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.La=l&&l.length||512;for(d=c=0;d<a.ua;d++)for(f=0;f<a.ya;f++)for(g=0;g<a.qa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>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<w;y++)t[y]=n;kh(l,t)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}hh(l,d,f);for(w=
0;w<r.length;w++)c=c+r[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Wa)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.w&&(a.w.call(a.C,a.v,e,a.Wa,a.fb),a.w=null)}function gh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Oe=b;a.Pe=c;a.Na=a.Aa=0;a.Ra=!1;return a} 0;w<r.length;w++)c=c+r[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Wa)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.w&&(a.w.call(a.C,a.v,e,a.Wa,a.fb),a.w=null)}function hh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Oe=b;a.Pe=c;a.Oa=a.Aa=0;a.Ra=!1;return a}
k.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var h=g[b];if(!h&&f.Ic&&b<f.ya)for(h=g[b]=Array(f.Jc),g=0;g<h.length;g++)h[g]=gh(null,a,b,g+1,f.wc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Ic&&9==f.mc&&(d=h[g]=gh(null,a,b,f.mc,f.wc,0))}}e&&e(d,!1);return d};function jh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e} k.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var h=g[b];if(!h&&f.Ic&&b<f.ya)for(h=g[b]=Array(f.Jc),g=0;g<h.length;g++)h[g]=hh(null,a,b,g+1,f.wc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Ic&&9==f.mc&&(d=h[g]=hh(null,a,b,f.mc,f.wc,0))}}e&&e(d,!1);return d};function kh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Aa?f<a.Na?(a.Aa+=a.Na-f,a.Na=f):f>=a.Na+a.Aa&&(a.Aa+=f-(a.Na+a.Aa)+1):(a.Na=f,a.Aa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null}; k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Aa?f<a.Oa?(a.Aa+=a.Oa-f,a.Oa=f):f>=a.Oa+a.Aa&&(a.Aa+=f-(a.Oa+a.Aa)+1):(a.Oa=f,a.Aa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function kh(a,b){var c=a.ya*a.qa,d=b/c|0;return d<a.ua?(b%=c,a.seek(d,b/a.qa|0,b%a.qa+1)):null}function lh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e} function lh(a,b){var c=a.ya*a.qa,d=b/c|0;return d<a.ua?(b%=c,a.seek(d,b/a.qa|0,b%a.qa+1)):null}function mh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
k.save=function(){var a=0,b=[];b[a++]=[this.fb,this.f,this.ua,this.ya,this.qa,this.Ka];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Aa){for(var h=[],l=0,m=g.Na,n=g.Na+g.Aa;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Na,h]}}return b}; k.save=function(){var a=0,b=[];b[a++]=[this.fb,this.f,this.ua,this.ya,this.qa,this.La];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Aa){for(var h=[],l=0,m=g.Oa,n=g.Oa+g.Aa;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Oa,h]}}return b};
k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?fh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=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<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?gh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=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;l<e;)h.data[l++]=h.pattern;l=0;h.Na=e;for(h.Aa=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Wa+": "+c);return b}; 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;l<e;)h.data[l++]=h.pattern;l=0;h.Oa=e;for(h.Aa=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Wa+": "+c);return b};
k.toJSON=function(){var a;a=0;for(var b;b=kh(this,a++);)mh(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")}; k.toJSON=function(){var a;a=0;for(var b;b=lh(this,a++);)nh(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 mh(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; function nh(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.sa=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='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=qa(c.value,10);null!=a&&nh(d,a)},!0;case "loadDrive":return this.G[b]= k.sa=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='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=qa(c.value,10);null!=a&&oh(d,a)},!0;case "loadDrive":return this.G[b]=
c,c.onclick=function(){var a=d.G.listDisks;a&&oh(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.Ba){var b;b="";for(var c=0,h;h=kh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(lh(a,h,l));b=btoa(b);a=a.Cc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"), c,c.onclick=function(){var a=d.G.listDisks;a&&ph(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.Ba){var b;b="";for(var c=0,h;h=lh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(mh(a,h,l));b=btoa(b);a=a.Cc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.O("No disk loaded in drive.");else d.O("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= "string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.O("No disk loaded in drive.");else d.O("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return 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;oh(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;ph(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
k.Da=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;if((this.v=gd(this.A,"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}ph(this);this.P=Lc(112,5);Bb(b,this,qh,2097152);rh(this,"None","",!0);this.L&&rh(this,"Local Disk","?");rh(this,"Remote Disk","??");sh(this)||H(this)}; k.Da=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.i=d;if((this.v=hd(this.A,"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}qh(this);this.P=Mc(112,5);Cb(b,this,rh,2097152);sh(this,"None","",!0);this.L&&sh(this,"Local Disk","?");sh(this,"Remote Disk","??");th(this)||H(this)};
k.Fa=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.qc){for(a=0;a<this.f.length;a++)th(this,a,!0);sh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";nh(this,0)}}return!0};k.Ea=function(a){return a?this.save():!0};k.reset=function(){ph(this)};k.save=function(){return(new P(this)).data()}; k.Ga=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.qc){for(a=0;a<this.f.length;a++)uh(this,a,!0);th(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";oh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){qh(this)};k.save=function(){return(new P(this)).data()};
k.restore=function(a){return ph(this,a[0])};function sh(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;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=sa(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!uh(a,g,f,e,!0)&&b&&H(a,!1);continue}a.O("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H} k.restore=function(a){return qh(this,a[0])};function th(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;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=sa(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!vh(a,g,f,e,!0)&&b&&H(a,!1);continue}a.O("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
function oh(a,b,c,d){var e=a.G.listDrives,e=e&&qa(e.value,10);if(void 0===e||0>e||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+'"')}uh(a,e,b,c,!1,d)}else th(a,e)} function ph(a,b,c,d){var e=a.G.listDrives,e=e&&qa(e.value,10);if(void 0===e||0>e||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+'"')}vh(a,e,b,c,!1,d)}else uh(a,e)}
function uh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.fb.toLowerCase()!=d.toLowerCase()&&(g++,th(a,b,!0),h.cc?a.O("RL11 busy"):(h.cc=!0,e&&(h.bc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Ob=!!f,hh(new dh(a,h,"preload"),c,d,f,a.Lc)&&g++));return g} function vh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.fb.toLowerCase()!=d.toLowerCase()&&(g++,uh(a,b,!0),h.cc?a.O("RL11 busy"):(h.cc=!0,e&&(h.bc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Ob=!!f,ih(new eh(a,h,"preload"),c,d,f,a.Lc)&&g++));return g}
k.Lc=function(a,b,c,d,e){var f;a.cc=!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.ua||f[1]>a.ya)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.ec)),b=null);b?(a.Ba=b,a.Wa=c,a.fb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.ec),a.bc||e),this.A&&this.A.qb()):a.Ob=!1;a.bc&&(a.bc=!1,--this.H||H(this));nh(this,a.ec)}; k.Lc=function(a,b,c,d,e){var f;a.cc=!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.ua||f[1]>a.ya)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.ec)),b=null);b?(a.Ba=b,a.Wa=c,a.fb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.ec),a.bc||e),this.A&&this.A.qb()):a.Ob=!1;a.bc&&(a.bc=!1,--this.H||H(this));oh(this,a.ec)};
function rh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} function sh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function nh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=qa(a.value,10),c=c.Ob?"?":c.fb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function th(a,b,c){var d=a.f[b];if(d.Ba||!1===c)d.Wa="",d.fb="",d.Ba=null,d.Ob=!1,c||(a.O("Drive RL"+b+" unloaded",c),nh(a,b))} function oh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=qa(a.value,10),c=c.Ob?"?":c.fb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function uh(a,b,c){var d=a.f[b];if(d.Ba||!1===c)d.Wa="",d.fb="",d.Ba=null,d.Ob=!1,c||(a.O("Drive RL"+b+" unloaded",c),oh(a,b))}
function ph(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.J=b[c++]||0;a.g=b[c++]||0;a.C=b[c++]||0;a.D=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.ec=b;d.cc=d.Ob=!1;d.name=c.kb;d.ua=512;d.ya=2;d.qa=40;d.Ka=256;d.dc=!0;d.Ne=0;d.Me=0;d.mc=1;d.Jc=d.qa;d.wc=d.Ka;d.Qe=0;d.Se=null;d.Ba||(d.fb="");d.status=29|(512==d.ua?128:0)}return!0} function qh(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.J=b[c++]||0;a.g=b[c++]||0;a.C=b[c++]||0;a.D=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.ec=b;d.cc=d.Ob=!1;d.name=c.kb;d.ua=512;d.ya=2;d.qa=40;d.La=256;d.dc=!0;d.Ne=0;d.Me=0;d.mc=1;d.Jc=d.qa;d.wc=d.La;d.Qe=0;d.Se=null;d.Ba||(d.fb="");d.status=29|(512==d.ua?128:0)}return!0}
k.Mc=function(a,b,c,d,e,f){this.J=f&65535;this.fa=this.fa&-49|f>>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.Mc=function(a,b,c,d,e,f){this.J=f&65535;this.fa=this.fa&-49|f>>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.gd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ba,m=null,n;e--;){if(!m){m=a.Ba.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ba.read(m,n++))||0>(t=a.Ba.read(m,n++))){h=5120;break}this.w.gb(f,r|t<<8);if(yc(this.w)){h=8192;break}f+=2;if(n>=l.Ka&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.gd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ba,m=null,n;e--;){if(!m){m=a.Ba.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ba.read(m,n++))||0>(t=a.Ba.read(m,n++))){h=5120;break}this.w.gb(f,r|t<<8);if(Ic(this.w)){h=8192;break}f+=2;if(n>=l.La&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};
k.ae=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ba,m=null,n;e--;){var r=this.w.oa(f);if(yc(this.w)){h=8192;break}f+=2;if(!m){m=a.Ba.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ba.write(m,n++,r&255)||!a.Ba.write(m,n++,r>>8)){h=5120;break}if(n>=l.Ka&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Ed=function(){return this.fa&65535}; k.ae=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ba,m=null,n;e--;){var r=this.w.oa(f);if(Ic(this.w)){h=8192;break}f+=2;if(!m){m=a.Ba.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ba.write(m,n++,r&255)||!a.Ba.write(m,n++,r>>8)){h=5120;break}if(n>=l.La&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Ed=function(){return this.fa&65535};
k.ve=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.gd;case 10:b||(b=this.ae),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.ua||f>=c.qa?this.fa|=37888: k.ve=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.gd;case 10:b||(b=this.ae),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.ua||f>=c.qa?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.Mc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Jc(this.b,this.P))}};k.Cd=function(){return this.J};k.te=function(a){this.J=a&65534};k.Fd=function(){return this.g};k.we=function(a){this.g=a};k.Gd=function(){return this.D};k.xe=function(a){this.D=a};k.Dd=function(){return this.K};k.ue=function(a){this.K=a&63}; (g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Mc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Kc(this.b,this.P))}};k.Cd=function(){return this.J};k.te=function(a){this.J=a&65534};k.Fd=function(){return this.g};k.we=function(a){this.g=a};k.Gd=function(){return this.D};k.xe=function(a){this.D=a};k.Dd=function(){return this.K};k.ue=function(a){this.K=a&63};
var vh={},qh=(vh[63744]=[null,null,N.prototype.Ed,N.prototype.ve,"RLCS"],vh[63746]=[null,null,N.prototype.Cd,N.prototype.te,"RLBA"],vh[65284]=[null,null,N.prototype.Fd,N.prototype.we,"RLDA"],vh[65286]=[null,null,N.prototype.Gd,N.prototype.xe,"RLMP"],vh[65288]=[null,null,N.prototype.Dd,N.prototype.ue,"RLBE"],vh);function wh(a){u.call(this,"Debugger",a,wh);this.da=a.base||16;this.Ha=!1;this.K=0;this.R=!1;this.C=-1;this.v=[];this.Y={}}z(wh); var wh={},rh=(wh[63744]=[null,null,N.prototype.Ed,N.prototype.ve,"RLCS"],wh[63746]=[null,null,N.prototype.Cd,N.prototype.te,"RLBA"],wh[65284]=[null,null,N.prototype.Fd,N.prototype.we,"RLDA"],wh[65286]=[null,null,N.prototype.Gd,N.prototype.xe,"RLMP"],wh[65288]=[null,null,N.prototype.Dd,N.prototype.ue,"RLBE"],wh);function xh(a){u.call(this,"Debugger",a,xh);this.da=a.base||16;this.Ia=!1;this.K=0;this.R=!1;this.C=-1;this.v=[];this.Y={}}z(xh);
var xh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};wh.prototype.sc=function(){return-1};wh.prototype.tc=function(){}; var yh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};xh.prototype.sc=function(){return-1};xh.prototype.tc=function(){};
function yh(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 zh(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 zh(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<<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;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?1:0;break;case "&":d=f&e;break; function Ah(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<<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;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?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} 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 Ah(a,b,c){var d;if(b){b=Bh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=ya(n);if(!n){f=!0;break}n=Ch(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],t=n.length;l.length&&xh[n]<xh[l[l.length-1]]&&zh(h,l,1);l.push(n);b=b.substr(r+t)}zh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Dh(a,null, function Bh(a,b,c){var d;if(b){b=Ch(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=ya(n);if(!n){f=!0;break}n=Dh(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],t=n.length;l.length&&yh[n]<yh[l[l.length-1]]&&Ah(h,l,1);l.push(n);b=b.substr(r+t)}Ah(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Eh(a,null,
d))}return d}function Bh(a,b){for(var c,d=a.Ha?"(":"{",e=a.Ha?")":"}",f=new RegExp(a.Ha?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Ah(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a} d))}return d}function Ch(a,b){for(var c,d=a.Ia?"(":"{",e=a.Ia?")":"}",f=new RegExp(a.Ia?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Bh(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
function Ch(a,b,c,d){var e;null!=b?(e=a.sc(b),0<=e?e=a.tc(e):(e=a.Y[b],null==e&&(e=qa(b,a.da))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e} function Dh(a,b,c,d){var e;null!=b?(e=a.sc(b),0<=e?e=a.tc(e):(e=a.Y[b],null==e&&(e=qa(b,a.da))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
function Dh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=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 Eh(a,b){if(b)return Dh(a,b,a.Y[b]);var c=0;for(b in a.Y)Dh(a,b,a.Y[b]),c++;return 0<c} function Eh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=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 Fh(a,b){if(b)return Eh(a,b,a.Y[b]);var c=0;for(b in a.Y)Eh(a,b,a.Y[b]),c++;return 0<c}
function J(a,b,c,d){switch(a.da){case 8:a=ra(b,Math.round(8/3*c));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d} function J(a,b,c,d){switch(a.da){case 8:a=ra(b,Math.round(8/3*c));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
function Fh(a){wh.call(this,a);this.jb=!1;this.Ha=!0;this.L=Z(0);this.lb=Z(0);this.P=Z(0);this.J=[];this.g=this.N=this.D=[];Gh(this);this.ta=0;Hh(this);this.La={};Ih(this,a.messages);this.Xa=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return jd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return jd(b,a)})}z(Fh,wh); function Gh(a){xh.call(this,a);this.jb=!1;this.Ia=!0;this.L=Z(0);this.lb=Z(0);this.P=Z(0);this.J=[];this.g=this.N=this.D=[];Hh(this);this.ta=0;Ih(this);this.Ma={};Jh(this,a.messages);this.Xa=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return kd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return kd(b,a)})}z(Gh,xh);
var Jh={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Kh=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "), var Kh={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Lh=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),
Lh={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096], Mh={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],
33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74, 33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,
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]}},Mh=[0],Nh= 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]}},Nh=[0],Oh=
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Fh.prototype; [58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Gh.prototype;
k.Da=function(a,b,c,d){this.w=b;this.b=c;this.A=a;this.f=a.f;(a=gd(a,"messages"))&&Ih(this,a);this.ub=Lh;this.Nb=1145>this.b.wb?Nh:[];Oh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Ph(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=uc[c],n&&d.j(p(n.id,8)+" %"+ k.Da=function(a,b,c,d){this.w=b;this.b=c;this.A=a;this.f=a.f;(a=hd(a,"messages"))&&Jh(this,a);this.ub=Mh;this.Nb=1145>this.b.wb?Oh:[];Ph(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ca(Qh(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=vc[c],n&&d.j(p(n.id,8)+" %"+
p(e<<d.w.la,8)+" %%"+p(n.F,8)+" "+p(n.Lb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=Tc&&(c=-1),m=0);a+=d.w.xa;e++}}});H(this)}; p(e<<d.w.la,8)+" %%"+p(n.F,8)+" "+p(n.Lb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=Uc&&(c=-1),m=0);a+=d.w.xa;e++}}});H(this)};
k.sa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ma=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",jd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.v.length-1&&(b=d.v[++d.C])):40==a.keyCode&&(0<d.C?b=d.v[--d.C]:(b="",d.C=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Ra(c,function(){if(d.ma){var a=d.ma.value; k.sa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ma=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",kd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.v.length-1&&(b=d.v[++d.C])):40==a.keyCode&&(0<d.C?b=d.v[--d.C]:(b="",d.C=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Ra(c,function(){if(d.ma){var a=d.ma.value;
d.ma.value="";jd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ra(c,function(a){var b=!1;sb(d,!0)||(rb(d,!0),b=d.ib(a?1:0),rb(d,!1));return b}),!0}return!1};k.qb=function(a){if(this.ma){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ma.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Fb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Pb?this.w.Tb(d):this.b.Tb(d),b&&Qh(a,b));return c}; d.ma.value="";kd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ra(c,function(a){var b=!1;sb(d,!0)||(rb(d,!0),b=d.ib(a?1:0),rb(d,!1));return b}),!0}return!1};k.qb=function(a){if(this.ma){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ma.focus();!a&&window&&window.scrollTo(b,c)}};k.ca=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Fb=function(a,b){var c=255,d=this.ca(a,!1,1);-1!==d&&(c=a.Pb?this.w.Tb(d):this.b.Tb(d),b&&Rh(a,b));return c};
k.oa=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Pb?this.w.$a(d):this.b.$a(d),b&&Qh(a,b));return c};k.Wb=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Pb?this.w.pb(d,b):this.b.pb(d,b),c&&Qh(a,c),this.A.ca(!0))};k.gb=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Pb?this.w.Cb(d,b):this.b.Cb(d,b),c&&Qh(a,c),this.A.ca(!0))};function Z(a,b){return{F:a,Pb:b,Ma:!1}}function Rh(a){return[a.F,a.Ma]}function Sh(a){return{F:a[0],Ma:a[1]}} k.oa=function(a,b){var c=65535,d=this.ca(a,!1,2);-1!==d&&(c=a.Pb?this.w.$a(d):this.b.$a(d),b&&Rh(a,b));return c};k.Wb=function(a,b,c){var d=this.ca(a,!0,1);-1!==d&&(a.Pb?this.w.pb(d,b):this.b.pb(d,b),c&&Rh(a,c),this.A.$(!0))};k.gb=function(a,b,c){var d=this.ca(a,!0,2);-1!==d&&(a.Pb?this.w.Cb(d,b):this.b.Cb(d,b),c&&Rh(a,c),this.A.$(!0))};function Z(a,b){return{F:a,Pb:b,Na:!1}}function Sh(a){return[a.F,a.Na]}function Th(a){return{F:a[0],Na:a[1]}}
function Ph(a,b,c){var d,e=(c?a.L:a.lb).F;c=!1;if(void 0!==b){b=Bh(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.J.length;e++){var g=a.J[e].ia[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=Ah(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Th(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Gc=yh(a,b.Bc=c[2]))}function Qh(a,b){null!=a.F&&(a.F+=b||1)} function Qh(a,b,c){var d,e=(c?a.L:a.lb).F;c=!1;if(void 0!==b){b=Ch(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.J.length;e++){var g=a.J[e].ia[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=Bh(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Uh(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Gc=zh(a,b.Bc=c[2]))}function Rh(a,b){null!=a.F&&(a.F+=b||1)}
function Ih(a,b){a.i=a;a.na=a.Kc=536870912;a.ka=null;a.va=[];b=yh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in xb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.na|=xb[c],a.j(c+" messages enabled"))}}function Oh(a,b){for(var c in xb)if(64==xb[c]){a.La[c]=b;break}} function Jh(a,b){a.i=a;a.na=a.Kc=536870912;a.ka=null;a.va=[];b=zh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in xb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.na|=xb[c],a.j(c+" messages enabled"))}}function Ph(a,b){for(var c in xb)if(64==xb[c]){a.Ma[c]=b;break}}
k.sc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SW":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Uh(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.tc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Va[a-8]:20>a?b=this.b.Ga[a-16]:20==a?b=ec(this.b):21==a&&this.f&&dc(this.f)&&(b=this.f.Ua));return b}; k.sc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SW":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Vh(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.tc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Va[a-8]:20>a?b=this.b.Ha[a-16]:20==a?b=fc(this.b):21==a&&this.f&&ec(this.f)&&(b=this.f.Ua));return b};
k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Jb).F));this.na&1073741824?this.va.push(a):this.ka&&a==this.ka||(this.ka=a,this.na&-2147483648&&this.b&&this.b.B.Z&&(this.ha(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,nd(a),a.ta=0,a.A&&a.A.ca()))};function Hh(a){var b;if(!je(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<a.H.length;b++)a.H[b]=Z();a.$=0;a.j("instruction history buffer allocated")}} k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Jb).F));this.na&1073741824?this.va.push(a):this.ka&&a==this.ka||(this.ka=a,this.na&-2147483648&&this.b&&this.b.B.Z&&(this.ha(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,od(a),a.ta=0,a.A&&a.A.$(void 0)))};function Ih(a){var b;if(!ke(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<a.H.length;b++)a.H[b]=Z();a.aa=0;a.j("instruction history buffer allocated")}}
k.hb=function(a,b){if(!Vh(this,b))return!1;this.b.hb(a);return!0};k.ib=function(a,b,c){if(!Vh(this))return!1;this.K=0;a||je(this)&&ke(this,this.b.u[7],0);try{a=od(this.b,a);var d=this.b.ib(a);0<d&&(Xb(this.b,d),this.K+=d,Yb(this.b,d,!0),Zb(this.b,d),this.za++)}catch(e){"number"!=typeof e&&(this.K=0,vb(this.b,e.stack||e.message))}!1!==c&&(this.f&&this.f.stop&&this.f.stop(),this.A.ca());this.ca(b||!1);return 0<this.K};k.ha=function(a){this.b&&this.b.ha(a)}; k.hb=function(a,b){if(!Wh(this,b))return!1;this.b.hb(a);return!0};k.ib=function(a,b,c){if(!Wh(this))return!1;this.K=0;a||ke(this)&&le(this,this.b.u[7],0);try{a=pd(this.b,a);var d=this.b.ib(a);0<d&&(Yb(this.b,d),this.K+=d,Zb(this.b,d,!0),$b(this.b,d),this.za++)}catch(e){"number"!=typeof e&&(this.K=0,vb(this.b,e.stack||e.message))}!1!==c&&(this.f&&this.f.stop&&this.f.stop(),this.A.$());this.$(b||!1);return 0<this.K};k.ha=function(a){this.b&&this.b.ha(a)};
k.ca=function(a){if(this.jb){void 0===a&&(a=!0);var b;b=this.b;if(b=b.I&8?b.Uc|b.Sc<<8:0){var c=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?Wh(this):Xh(this)}};function Vh(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.Fa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; k.$=function(a){if(this.jb){void 0===a&&(a=!0);var b;b=this.b;if(b=b.I&8?b.Uc|b.Sc<<8:0){var c=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?Xh(this):Yh(this)}};function Wh(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.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
k.Ea=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Hh(this);this.za=0;this.ka=null;this.K=0;this.L=Z(this.b.u[7]);this.B.Z=!1;Yh(this);a||this.ca()};k.save=function(){var a=new P(this);a.set(0,Rh(this.L));a.set(1,Rh(this.P));a.set(2,[this.v,this.R,this.na]);a.set(3,this.J);return a.data()}; k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Ih(this);this.za=0;this.ka=null;this.K=0;this.L=Z(this.b.u[7]);this.B.Z=!1;Zh(this);a||this.$()};k.save=function(){var a=new P(this);a.set(0,Sh(this.L));a.set(1,Sh(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=Sh(a[b++]),this.P=Sh(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.B.Z=!0;this.Qb=a;this.Sb=b}; k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Th(a[b++]),this.P=Th(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.B.Z=!0;this.Qb=a;this.Sb=b};
k.stop=function(a,b){if(this.B.Z){this.B.Z=!1;this.K=b-this.Sb;if(!this.S){b="stopped";if(this.K){a-=this.Qb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";je(this)&&(b+=this.za+" instructions, ",this.za=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}this.ca(!0);this.qb();Yh(this,this.b.u[7]);this.ka=null}};function je(a){return 1<a.g.length||!!a.ta} k.stop=function(a,b){if(this.B.Z){this.B.Z=!1;this.K=b-this.Sb;if(!this.S){b="stopped";if(this.K){a-=this.Qb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";ke(this)&&(b+=this.za+" instructions, ",this.za=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}this.$(!0);this.qb();Zh(this,this.b.u[7]);this.ka=null}};function ke(a){return 1<a.g.length||!!a.ta}
function ke(a,b,c){var d=-1;c||(d=a.b.$a(b),0==d&&(b=yd(a.b,2)));if(0<c&&(a.ta&&!--a.ta||bd(a,b,1,a.g)))return!0;0<=c&&a.H.length&&(a.za++,0>d&&(d=a.b.$a(b)),65535!=(d&65535)&&(c=a.H[a.$],c.F=b,c.Ma=!1,++a.$==a.H.length&&(a.$=0)));return!1}function pf(a){var b=a.b;if(b.B.Z)throw O(b,a.b.Jb),a.ha(),-1;return!1} function le(a,b,c){var d=-1;c||(d=a.b.$a(b),0==d&&(b=zd(a.b,2)));if(0<c&&(a.ta&&!--a.ta||cd(a,b,1,a.g)))return!0;0<=c&&a.H.length&&(a.za++,0>d&&(d=a.b.$a(b)),65535!=(d&65535)&&(c=a.H[a.aa],c.F=b,c.Na=!1,++a.aa==a.H.length&&(a.aa=0)));return!1}function qf(a){var b=a.b;if(b.B.Z)throw O(b,a.b.Jb),a.ha(),-1;return!1}
function Gh(a){var b,c;a.g=["bp"];if(a.N)for(b=1;b<a.N.length;b++){c=a.N[b];var d=a.w;c=a.ba(c);cd(d.W[c>>>d.la],!1)}a.N=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.w,c=a.ba(c),cd(d.W[c>>>d.la],!0);a.D=["bw"];a.rb=0}k.mb=function(a,b,c){var d=!0;c||Zh(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.la].mb(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Ma=!0:($h(this,a,a.length-1,"set"),Hh(this)));return d}; function Hh(a){var b,c;a.g=["bp"];if(a.N)for(b=1;b<a.N.length;b++){c=a.N[b];var d=a.w;c=a.ca(c);dd(d.W[c>>>d.la],!1)}a.N=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.w,c=a.ca(c),dd(d.W[c>>>d.la],!0);a.D=["bw"];a.rb=0}k.mb=function(a,b,c){var d=!0;c||$h(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].mb(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Na=!0:(ai(this,a,a.length-1,"set"),Ih(this)));return d};
function Zh(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Ma)){f=!0;h.Ma||e||$h(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(d=a.w,cd(d.W[c>>>d.la],b==a.D));h.Ma||Hh(a);break}}return f}function ai(a,b){for(var c=1;c<b.length;c++)$h(a,b,c);return b.length-1}function $h(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Bc?' "'+c.Bc+'"':""))} function $h(a,b,c,d,e){var f=!1;c=a.ca(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ca(h)&&(!d||h.Na)){f=!0;h.Na||e||ai(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(d=a.w,dd(d.W[c>>>d.la],b==a.D));h.Na||Ih(a);break}}return f}function bi(a,b){for(var c=1;c<b.length;c++)ai(a,b,c);return b.length-1}function ai(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Bc?' "'+c.Bc+'"':""))}
function Yh(a,b){if(void 0!==b)bd(a,b,1,a.g,!0),a.S=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Ma){if(!Zh(a,a.g,c,!0))break;b=0}}} function Zh(a,b){if(void 0!==b)cd(a,b,1,a.g,!0),a.S=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Na){if(!$h(a,a.g,c,!0))break;b=0}}}
function bd(a,b,c,d,e){var f=!1;if(!a.rb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Ma)for(var l=a.ba(h),m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Ma&&(Zh(a,d,h,!0),e=!0);if(n=h.Gc){for(var f=!1,r=0;r<n.length;r++)if(!bi(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var t=r+1;t<n.length&&n[t].indexOf("else");t++)r++;if(t==n.length){f=!0;break}}a.b.B.Z||(f=!0)}if(f){e||$h(a,d,g,"hit");break}}}a.rb--;return f} function cd(a,b,c,d,e){var f=!1;if(!a.rb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Na)for(var l=a.ca(h),m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Na&&($h(a,d,h,!0),e=!0);if(n=h.Gc){for(var f=!1,r=0;r<n.length;r++)if(!ci(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var t=r+1;t<n.length&&n[t].indexOf("else");t++)r++;if(t==n.length){f=!0;break}}a.b.B.Z||(f=!0)}if(f){e||ai(a,d,g,"hit");break}}}a.rb--;return f}
function ci(a,b,c,d){var e=Z(b.F),f=a.oa(b,2),g,h;for(h in a.ub)if(g=a.ub[h][f&h])break;g||(g=Mh);var l=g[0];0<=a.Nb.indexOf(l)&&(g=Mh,l=g[0]);var m=h="",n=Kh[l],r=g.length-1;l||r||(h=J(a,f));for(l=1;l<=r;l++){var t=g[l];if(void 0!==t){var w;w=a;var y=t,t=b,x="",A=y&61440;if(4096==A)t=t.F+((f&255)<<24>>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), function di(a,b,c,d){var e=Z(b.F),f=a.oa(b,2),g,h;for(h in a.ub)if(g=a.ub[h][f&h])break;g||(g=Nh);var l=g[0];0<=a.Nb.indexOf(l)&&(g=Nh,l=g[0]);var m=h="",n=Lh[l],r=g.length-1;l||r||(h=J(a,f));for(l=1;l<=r;l++){var t=g[l];if(void 0!==t){var w;w=a;var y=t,t=b,x="",A=y&61440;if(4096==A)t=t.F+((f&255)<<24>>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=Uh(y);break;case 8:x="@"+Uh(y);break;case 16:7>y?x="("+Uh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Uh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Uh(y)+")";break;case 40:x="@-("+Uh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Uh(y)+")";7==y&&(x=J(w,A+t.F&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Uh(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]); y&63)switch(y=A&7,A&56){case 0:x=Vh(y);break;case 8:x="@"+Vh(y);break;case 16:7>y?x="("+Vh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Vh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Vh(y)+")";break;case 40:x="@-("+Vh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Vh(y)+")";7==y&&(x=J(w,A+t.F&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Vh(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]);
0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.oa(e,2)),null==e.F)break;while(e.F!=b.F)}g+=xa(f,24);g+=xa(n,5);h&&(g+=" "+h);if(c||m)g=xa(g,60)+";"+(c||""),g=a.b.B.vb?g+("cycles="+kd(a.b).toString()+" cs="+p(a.b.Gb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function di(a,b){switch(b){case "N":a=a.b.Sa();break;case "Z":a=wd(a.b);break;case "V":a=vd(a.b);break;case "C":a=ud(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} 0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.oa(e,2)),null==e.F)break;while(e.F!=b.F)}g+=xa(f,24);g+=xa(n,5);h&&(g+=" "+h);if(c||m)g=xa(g,60)+";"+(c||""),g=a.b.B.vb?g+("cycles="+ld(a.b).toString()+" cs="+p(a.b.Gb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function ei(a,b){switch(b){case "N":a=a.b.Sa();break;case "Z":a=xd(a.b);break;case "V":a=wd(a.b);break;case "C":a=vd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
function ei(a,b){var c="",d=a.b;8>b?(c=Uh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Va[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ga[b-16]):20==b?c="PS="+J(a,ec(d)):21==b&&a.f&&dc(a.f)&&(c="SW="+J(a,a.f.Ua,3));c&&(c+=" ");return c}function fi(a){var b,c="";for(b=0;6>b;b++)c+=ei(a,b);c=c+"\n"+(ei(a,6)+ei(a,7));c+=ei(a,20)+ei(a,21);return c+=di(a,"T")+di(a,"N")+di(a,"Z")+di(a,"V")+di(a,"C")}k.nc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0}; function fi(a,b){var c="",d=a.b;8>b?(c=Vh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Va[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ha[b-16]):20==b?c="PS="+J(a,fc(d)):21==b&&a.f&&ec(a.f)&&(c="SW="+J(a,a.f.Ua,3));c&&(c+=" ");return c}function gi(a){var b,c="";for(b=0;6>b;b++)c+=fi(a,b);c=c+"\n"+(fi(a,6)+fi(a,7));c+=fi(a,20)+fi(a,21);return c+=ei(a,"T")+ei(a,"N")+ei(a,"Z")+ei(a,"V")+ei(a,"C")}k.nc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function og(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=Aa(n,l,a.nc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Re:b,F:c,Tc:d,ia:e,lc:f})}function gi(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.J.length;b++){var f=a.J[b],g=f.F>>>0,h=f.Tc;if(e>=g&&e<g+h){e=Aa(f.lc,[e-g],a.nc);0<=e?hi(a,b,e,d):c&&(e=~e,hi(a,b,e-1,d),hi(a,b,e,d));break}}return d} function pg(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=Aa(n,l,a.nc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Re:b,F:c,Tc:d,ia:e,lc:f})}function hi(a,b,c){var d=[],e=a.ca(b)>>>0;for(b=0;b<a.J.length;b++){var f=a.J[b],g=f.F>>>0,h=f.Tc;if(e>=g&&e<g+h){e=Aa(f.lc,[e-g],a.nc);0<=e?ii(a,b,e,d):c&&(e=~e,ii(a,b,e-1,d),ii(a,b,e,d));break}}return d}
function hi(a,b,c,d){var e={},f=a.J[b].lc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.J[b].ia[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function ii(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Eh(a)||a.j("no variables"),!0;if(!c[2])return Eh(a,c[1]);if(!c[3])return delete a.Y[c[1]],!0;b=Ah(a,c[3]);return void 0!==b?(a.Y[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1} function ii(a,b,c,d){var e={},f=a.J[b].lc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.J[b].ia[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function ji(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Fh(a)||a.j("no variables"),!0;if(!c[2])return Fh(a,c[1]);if(!c[3])return delete a.Y[c[1]],!0;b=Bh(a,c[3]);return void 0!==b?(a.Y[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
function ji(a,b,c){var d=null;if(b=Ph(a,b,!0)){a.ba(b);var e=gi(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d} function ki(a,b,c){var d=null;if(b=Qh(a,b,!0)){a.ca(b);var e=hi(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
function Wh(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Ah(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.L=Z(d.u[7]);break;case "N":d.X=f?32768:0;break;case "Z":d.aa= function Xh(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Bh(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.L=Z(d.u[7]);break;case "N":d.X=f?32768:0;break;case "Z":d.ba=
f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SW":if(a.f&&dc(a.f)){e=a.f;if(dc(e)){e.Ua=f;for(b=0;22>b;b++)e.f["S"+b][0]=f&1<<b?1:0;Fb(e)}break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.A.ca();a.j("updated registers:")}a.j(fi(a));c&&(a.L=Z(d.u[7]),Xh(a,J(a,a.L.F)))}}function ki(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Dh(a,null,c[2].charCodeAt(0)):Ah(a,b,!0)} f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SW":if(a.f&&ec(a.f)){e=a.f;if(ec(e)){e.Ua=f;for(b=0;22>b;b++)e.g["S"+b][0]=f&1<<b?1:0;Gb(e)}break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.A.$();a.j("updated registers:")}a.j(gi(a));c&&(a.L=Z(d.u[7]),Yh(a,J(a,a.L.F)))}}function li(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Eh(a,null,c[2].charCodeAt(0)):Bh(a,b,!0)}
function li(a,b,c){var d="t"!=b;c=Ch(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Qa(c,function(){return rb(a,!0)&&a.ib(e,d,!1)},function(){a.f&&a.f.stop&&a.f.stop();a.A.ca();rb(a,!1)})} function mi(a,b,c){var d="t"!=b;c=Dh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Qa(c,function(){return rb(a,!0)&&a.ib(e,d,!1)},function(){a.f&&a.f.stop&&a.f.stop();a.A.$();rb(a,!1)})}
function Xh(a,b,c,d){if(b=Ph(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Ch(a,c.substr(1)),null!=c&&(d=c);else{d=Ph(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=sb(a,!1)||a.S?a.K:null;var g=null!=f?"cycles":null,h=gi(a,b),l=b.F;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=ci(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} function Yh(a,b,c,d){if(b=Qh(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Dh(a,c.substr(1)),null!=c&&(d=c);else{d=Qh(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=sb(a,!1)||a.S?a.K:null;var g=null!=f?"cycles":null,h=hi(a,b),l=b.F;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=di(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
function bi(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)&&0<b.length){a.R&&(b="a "+J(a,a.P.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var r= function ci(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)&&0<b.length){a.R&&(b="a "+J(a,a.P.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var r=
Ph(a,g[1],!0);if(r)if(a.P=r,void 0===g[2])a.j("begin assemble at "+J(a,r.F)),a.R=!0,a.A.ca();else{var t;a.j("not supported yet");t=[];if(t.length){for(var w=0;w<t.length;w++)a.Wb(r,t[w],1);a.j(ci(a,a.P))}}break;case "b":a:{var y=g[0],x=g[1],A=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"), Qh(a,g[1],!0);if(r)if(a.P=r,void 0===g[2])a.j("begin assemble at "+J(a,r.F)),a.R=!0,a.A.$();else{var t;a.j("not supported yet");t=[];if(t.length){for(var w=0;w<t.length;w++)a.Wb(r,t[w],1);a.j(di(a,a.P))}}break;case "b":a:{var y=g[0],x=g[1],A=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"),
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ja=y.charAt(1);if("l"==ja){var Ia;Ia=0+ai(a,a.g);Ia+=ai(a,a.N);(Ia+=ai(a,a.D))||a.j("no breakpoints")}else if("n"==ja)a.ta=Ch(a,x),a.j("break after "+a.ta+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var Q=Z();if("*"!=x&&(Q=Ph(a,x,!0),!Q))break a;"c"==ja?null==Q.F?(Gh(a),a.j("all breakpoints cleared")):Zh(a,a.g,Q)||Zh(a,a.N,Q)||Zh(a,a.D,Q)||a.j("breakpoint missing: "+J(a,Q.F)):null!=Q.F&&(Th(a,Q,A),"p"==ja?a.mb(a.g, a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ja=y.charAt(1);if("l"==ja){var Ia;Ia=0+bi(a,a.g);Ia+=bi(a,a.N);(Ia+=bi(a,a.D))||a.j("no breakpoints")}else if("n"==ja)a.ta=Dh(a,x),a.j("break after "+a.ta+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var Q=Z();if("*"!=x&&(Q=Qh(a,x,!0),!Q))break a;"c"==ja?null==Q.F?(Hh(a),a.j("all breakpoints cleared")):$h(a,a.g,Q)||$h(a,a.N,Q)||$h(a,a.D,Q)||a.j("breakpoint missing: "+J(a,Q.F)):null!=Q.F&&(Uh(a,Q,A),"p"==ja?a.mb(a.g,
Q):"r"==ja?a.mb(a.N,Q):"w"==ja?a.mb(a.D,Q):a.j("unknown breakpoint command: "+ja))}}}break;case "c":a.Qa&&(a.Qa.value="");break;case "d":a:{var db,eb=g[0],ma=g[1],Ka=g[2],Ei=g[3];if("?"==ma){var fb="";for(db in xb)a.La[db]&&(fb&&(fb+=","),fb+=db);fb+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history"); Q):"r"==ja?a.mb(a.N,Q):"w"==ja?a.mb(a.D,Q):a.j("unknown breakpoint command: "+ja))}}}break;case "c":a.Qa&&(a.Qa.value="");break;case "d":a:{var eb,fb=g[0],ma=g[1],Ka=g[2],Fi=g[3];if("?"==ma){var gb="";for(eb in xb)a.Ma[eb]&&(gb&&(gb+=","),gb+=eb);gb+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
fb.length&&a.j("dump extension commands:\n\t"+fb)}else if("state"==ma){var rg=mi(a.A,!0);"console"==Ka?console.log(rg):(a.Qa&&(a.Qa.value=""),a.j(rg))}else if("symbols"==ma)for(var Ed=0;Ed<a.J.length;Ed++){var Fd=a.J[Ed],gb;for(gb in Fd.ia)if("."!=gb.charAt(0)){var sg=Fd.ia[gb].o;if(void 0!==sg){var tg=Fd.ia[gb].l;tg&&(gb=tg);a.j(J(a,sg)+" "+gb)}}}else{if("d"==eb){for(db in xb)if(g[1]==db){var ug=a.La[db];ug?(g.shift(),g.shift(),ug(g)):a.j("no dump registered for "+ma);break a}ma||(eb=a.Ub||"db")}else a.Ub= gb.length&&a.j("dump extension commands:\n\t"+gb)}else if("state"==ma){var sg=ni(a.A,!0);"console"==Ka?console.log(sg):(a.Qa&&(a.Qa.value=""),a.j(sg))}else if("symbols"==ma)for(var Fd=0;Fd<a.J.length;Fd++){var Gd=a.J[Fd],hb;for(hb in Gd.ia)if("."!=hb.charAt(0)){var tg=Gd.ia[hb].o;if(void 0!==tg){var ug=Gd.ia[hb].l;ug&&(hb=ug);a.j(J(a,tg)+" "+hb)}}}else{if("d"==fb){for(eb in xb)if(g[1]==eb){var vg=a.Ma[eb];vg?(g.shift(),g.shift(),vg(g)):a.j("no dump registered for "+ma);break a}ma||(fb=a.Ub||"db")}else a.Ub=
eb;if("dh"==eb){var vg=ma,wg=Ka,xg="",yg=0,fa=a.$,na=a.H;if(na.length){var aa=+vg||a.tb,Hb=+wg||10;isNaN(aa)?aa=Hb:xg="more ";aa>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 Gd=[];"call"==wg&&(Hb=1E5,Gd=["CALL"]);for(void 0!==vg&&a.j(aa+" instructions earlier:");0<Hb&&fa!=a.$;){var zg=na[fa++];if(null==zg.F)break;var Ib=Z(zg.F),Fi=aa--,Ag=ci(a,Ib,"history",Fi);(!Gd.length||0<=Ag.indexOf(Gd[0]))&&a.j(Ag); fb;if("dh"==fb){var wg=ma,xg=Ka,yg="",zg=0,fa=a.aa,na=a.H;if(na.length){var aa=+wg||a.tb,Ib=+xg||10;isNaN(aa)?aa=Ib:yg="more ";aa>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"==xg&&(Ib=1E5,Hd=["CALL"]);for(void 0!==wg&&a.j(aa+" instructions earlier:");0<Ib&&fa!=a.aa;){var Ag=na[fa++];if(null==Ag.F)break;var Jb=Z(Ag.F),Gi=aa--,Bg=di(a,Jb,"history",Gi);(!Hd.length||0<=Bg.indexOf(Hd[0]))&&a.j(Bg);
Ib.ac&&(fa+=Ib.ac,Hb-=Ib.ac,aa-=Ib.ac);fa>=na.length&&(fa=0);a.tb=aa;yg++;Hb--}}yg||(a.j("no "+xg+"history available"),a.tb=void 0)}else{var Jb=Ph(a,ma);if(Jb){var Ac=0;Ka&&("l"==Ka.charAt(0)&&(Ka=Ka.substr(1)||Ei),Ac=Ch(a,Ka)>>>0,65536<Ac&&(Ac=65536));for(var Kb="",hb="dd"==eb?4:"dw"==eb?2:1,Bc=hb*Ac||128,Gi=Bc+15>>4||1;Gi--&&0<Bc;){var Cc=0,Lb=0,Mb,Hd="",Bg="",ma=J(a,Jb.F);for(Mb=4==hb?16:a.da;0<Mb&&0<Bc;Mb--){var Dc=1,Ec=1==hb?a.Fb(Jb,Dc):a.oa(Jb,Dc=2),Cc=Cc|Ec<<(Lb<<3),Lb=Lb+Dc;Lb==hb&&(Hd+=J(a, Jb.ac&&(fa+=Jb.ac,Ib-=Jb.ac,aa-=Jb.ac);fa>=na.length&&(fa=0);a.tb=aa;zg++;Ib--}}zg||(a.j("no "+yg+"history available"),a.tb=void 0)}else{var Kb=Qh(a,ma);if(Kb){var zc=0;Ka&&("l"==Ka.charAt(0)&&(Ka=Ka.substr(1)||Fi),zc=Dh(a,Ka)>>>0,65536<zc&&(zc=65536));for(var Lb="",ib="dd"==fb?4:"dw"==fb?2:1,Ac=ib*zc||128,Hi=Ac+15>>4||1;Hi--&&0<Ac;){var Bc=0,Mb=0,Nb,Id="",Cg="",ma=J(a,Kb.F);for(Nb=4==ib?16:a.da;0<Nb&&0<Ac;Nb--){var Cc=1,Dc=1==ib?a.Fb(Kb,Cc):a.oa(Kb,Cc=2),Bc=Bc|Dc<<(Mb<<3),Mb=Mb+Cc;Mb==ib&&(Id+=J(a,
Cc,hb),Hd+=1==hb?9==Mb?"-":" ":" ",Cc=Lb=0);Bg+=32<=Ec&&128>Ec?String.fromCharCode(Ec):".";Bc-=Dc}Kb&&(Kb+="\n");Kb+=ma+" "+Hd+(0==Mb?" "+Bg:"")}Kb&&a.j(Kb);a.lb=Jb}}}}break;case "e":if("else"==g[0])break;var ib,Id,Jd,Kd,Ld=g[0],Md=g[1];"eb"==Ld?(ib=1,Id=255,Jd=a.Fb,Kd=a.Wb):"e"==Ld||"ew"==Ld?(ib=2,Id=65535,Jd=a.oa,Kd=a.gb):Md=null;if(null==Md)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=Ph(a,Md);if(Fc)for(var Gc= Bc,ib),Id+=1==ib?9==Nb?"-":" ":" ",Bc=Mb=0);Cg+=32<=Dc&&128>Dc?String.fromCharCode(Dc):".";Ac-=Cc}Lb&&(Lb+="\n");Lb+=ma+" "+Id+(0==Nb?" "+Cg:"")}Lb&&a.j(Lb);a.lb=Kb}}}}break;case "e":if("else"==g[0])break;var jb,Jd,Kd,Ld,Md=g[0],Nd=g[1];"eb"==Md?(jb=1,Jd=255,Kd=a.Fb,Ld=a.Wb):"e"==Md||"ew"==Md?(jb=2,Jd=65535,Kd=a.oa,Ld=a.gb):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=Qh(a,Nd);if(Ec)for(var Fc=
2;Gc<g.length;Gc++){var Nb=Ah(a,g[Gc]);if(void 0===Nb){a.j("unrecognized value: "+g[Gc]);break}Nb&~Id&&a.j("warning: "+p(Nb)+" exceeds "+ib+"-byte value");var Hi=Jd.call(a,Fc);a.j("changing "+J(a,Fc.F)+" from "+J(a,Hi,ib)+" to "+J(a,Nb,ib));Kd.call(a,Fc,Nb,ib)}}break;case "g":a:{var Cg=g[1],Ii=b;if(void 0!==Cg){var Nd=Ph(a,Cg,!0);if(!Nd)break a;Th(a,Nd,Ii);a.mb(a.g,Nd,!0)}a.hb(!0,c)}break;case "h":a.B.Z?(c||a.j("halting"),a.ha()):sb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Od; 2;Fc<g.length;Fc++){var Ob=Bh(a,g[Fc]);if(void 0===Ob){a.j("unrecognized value: "+g[Fc]);break}Ob&~Jd&&a.j("warning: "+p(Ob)+" exceeds "+jb+"-byte value");var Ii=Kd.call(a,Ec);a.j("changing "+J(a,Ec.F)+" from "+J(a,Ii,jb)+" to "+J(a,Ob,jb));Ld.call(a,Ec,Ob,jb)}}break;case "g":a:{var Dg=g[1],Ji=b;if(void 0!==Dg){var Od=Qh(a,Dg,!0);if(!Od)break a;Uh(a,Od,Ji);a.mb(a.g,Od,!0)}a.hb(!0,c)}break;case "h":a.B.Z?(c||a.j("halting"),a.ha()):sb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Pd;
var Ob=b.substr(2),Ob=ya(Ob);Ah(a,Ob)?(c||a.j("true: "+Ob),Od=!0):(c||a.j("false: "+Ob),Od=!1);Od||(d=!1);break}f=!0;break;case "k":var Ji=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Pd=0,Qd=Z(),Pb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Pb.F));10>Pd;){for(var La=null,Ki=256;65536>Pb.F>>>0;){Qd.F=a.oa(Pb,2);if(null==Pb.F||!Ki--)break;if(!(Qd.F&1)){for(var Li=a,Hc=Qd,Dg=null,Qb=Hc.F,Eg=Qb,Rd=1;6>=Rd&&Qb;Rd++){if(2< var Pb=b.substr(2),Pb=ya(Pb);Bh(a,Pb)?(c||a.j("true: "+Pb),Pd=!0):(c||a.j("false: "+Pb),Pd=!1);Pd||(d=!1);break}f=!0;break;case "k":var Ki=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Qd=0,Rd=Z(),Qb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Qb.F));10>Qd;){for(var La=null,Li=256;65536>Qb.F>>>0;){Rd.F=a.oa(Qb,2);if(null==Qb.F||!Li--)break;if(!(Rd.F&1)){for(var Mi=a,Gc=Rd,Eg=null,Rb=Gc.F,Fg=Rb,Sd=1;6>=Sd&&Rb;Sd++){if(2<
Rd){Hc.F=Qb;var Ic=ci(Li,Hc);if(0<=Ic.indexOf("JSR")){var Fg=Ic.indexOf(" ");if(Qb+(Ic.indexOf(" ",Fg+1)-Fg-1)/2==Eg){Dg=Ic;break}}}Qb-=2}Hc.F=Eg;if(La=Dg)break}}if(!La||null==La)break;var Gg=null;if("ks"==Ji){var Hg=La.match(/[0-9A-F]+$/);Hg&&(Gg=ji(a,Hg[0]))}La=xa(La,50)+" ;"+(Gg||"stack="+J(a,Pb.F));a.j(La);Pd++}Pd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){ji(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 Ca=0;if("all"== Sd){Gc.F=Rb;var Hc=di(Mi,Gc);if(0<=Hc.indexOf("JSR")){var Gg=Hc.indexOf(" ");if(Rb+(Hc.indexOf(" ",Gg+1)-Gg-1)/2==Fg){Eg=Hc;break}}}Rb-=2}Gc.F=Fg;if(La=Eg)break}}if(!La||null==La)break;var Hg=null;if("ks"==Ki){var Ig=La.match(/[0-9A-F]+$/);Ig&&(Hg=ki(a,Ig[0]))}La=xa(La,50)+" ;"+(Hg||"stack="+J(a,Qb.F));a.j(La);Qd++}Qd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){ki(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 Ca=0;if("all"==
G)Ca=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){Ca=xb[oa];pa=!!(a.na&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.na|=Ca,pa=!0;else if("off"==g[2]&&(a.na&=~Ca,pa=!1,1073741824==Ca)){for(var Sd=0;Sd<a.va.length;Sd++)a.j(a.va[Sd]);a.va=[]}}var Mi=0,Rb="";for(oa in xb)if(!G||G==oa){var Ni=!!(a.na&xb[oa]);if(null===pa||pa==Ni)Rb&&(Rb+=","),++Mi%10||(Rb+="\n\t"), G)Ca=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){Ca=xb[oa];pa=!!(a.na&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.na|=Ca,pa=!0;else if("off"==g[2]&&(a.na&=~Ca,pa=!1,1073741824==Ca)){for(var Td=0;Td<a.va.length;Td++)a.j(a.va[Td]);a.va=[]}}var Ni=0,Sb="";for(oa in xb)if(!G||G==oa){var Oi=!!(a.na&xb[oa]);if(null===pa||pa==Oi)Sb&&(Sb+=","),++Ni%10||(Sb+="\n\t"),
"key"==oa&&(oa="keys"),Rb+=oa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==pa?pa?"messages on: ":"messages off: ":"message categories:\n\t")+(Rb||"none"));Hh(a)}break;case "p":if("print"==g[0]){ki(a,b.substr(5));break}var Oi="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Ig=Z(a.b.u[7]);a.Fb(Ig);a.S?(a.mb(a.g,Ig,!0),a.hb()||(a.A&&a.A.qb(),a.S=0)):li(a,Oi?"tr":"t")}break;case "r":if("reset"==b){a.A&&a.A.reset();break}Wh(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Sb= "key"==oa&&(oa="keys"),Sb+=oa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==pa?pa?"messages on: ":"messages off: ":"message categories:\n\t")+(Sb||"none"));Ih(a)}break;case "p":if("print"==g[0]){li(a,b.substr(5));break}var Pi="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Jg=Z(a.b.u[7]);a.Fb(Jg);a.S?(a.mb(a.g,Jg,!0),a.hb()||(a.A&&a.A.qb(),a.S=0)):mi(a,Pi?"tr":"t")}break;case "r":if("reset"==b){a.A&&a.A.reset();break}Xh(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Tb=
+g[2];if(8==Sb||10==Sb||16==Sb)a.da=Sb;else{a.j("invalid base: "+Sb);break}}a.j("default base: "+a.da);break;case "cs":var Tb;void 0!==g[3]&&(Tb=+g[3]);switch(g[2]){case "int":a.b.xb=Tb;break;case "start":a.b.Hb=Tb;break;case "stop":a.b.yb=Tb;break;default:a.j("unknown cs option");break a}void 0!==Tb&&id(a.b);a.j("checksums "+(a.b.B.vb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(ld(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.nb.toFixed(2)+ +g[2];if(8==Tb||10==Tb||16==Tb)a.da=Tb;else{a.j("invalid base: "+Tb);break}}a.j("default base: "+a.da);break;case "cs":var Ub;void 0!==g[3]&&(Ub=+g[3]);switch(g[2]){case "int":a.b.xb=Ub;break;case "start":a.b.Hb=Ub;break;case "stop":a.b.yb=Ub;break;default:a.j("unknown cs option");break a}void 0!==Ub&&jd(a.b);a.j("checksums "+(a.b.B.vb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(md(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.nb.toFixed(2)+
"Mhz")+" ("+a.b.bb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":li(a,g[0],g[1]);break;case "u":Xh(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ii(a,b.substr(3))||(d=!1);break}if("ver"== "Mhz")+" ("+a.b.bb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":mi(a,g[0],g[1]);break;case "u":Yh(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ji(a,b.substr(3))||(d=!1);break}if("ver"==
g[0]){a.j("PDPjs version 1.30.2 ("+a.b.wb+",RELEASE"+(wb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){ki(a,b.substr(1));break}var Td="commands:",Ud;for(Ud in Jh)Td+="\n"+xa(Ud,9)+Jh[Ud];je(a)||(Td+="\nnote: history disabled if no exec breakpoints");a.j(Td);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Jg){a.j("debugger error: "+(Jg.stack||Jg.message)),d=!1}return d} g[0]){a.j("PDPjs version 1.30.2 ("+a.b.wb+",RELEASE"+(wb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){li(a,b.substr(1));break}var Ud="commands:",Vd;for(Vd in Kh)Ud+="\n"+xa(Vd,9)+Kh[Vd];ke(a)||(Ud+="\nnote: history disabled if no exec breakpoints");a.j(Ud);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Kg){a.j("debugger error: "+(Kg.stack||Kg.message)),d=!1}return d}
function jd(a,b,c){b=yh(a,b,c);for(var d in b)if(!bi(a,b[+d]))return!1;return!0}Xa(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Fh(d);C(d,c)}}); function kd(a,b,c){b=zh(a,b,c);for(var d in b)if(!ci(a,b[+d]))return!1;return!0}Xa(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Gh(d);C(d,c)}});
function ni(a,b,c){u.call(this,"Computer",a,ni,67108864);this.B.ja=!1;oi(this,b);this.L=gd(this,"autoPower",a);this.v=0;this.Y=a.busWidth||a.buswidth;this.g=pi;this.J=null;this.D=this.R=!1;this.$=gd(this,"url")||"";(Math.random()+.1).toString(36);this.A=qi(this);if(this.b=qb("CPU",this.id)){this.i=qb("Debugger",this.id);this.w=new gc({id:this.Pa+".bus",busWidth:this.Y},this.b,this.i);var d,e=ob(this.id);if((this.f=qb("Panel",this.id))&&this.f.Qa)for(b=0;b<e.length;b++)d=e[b],d.O=this.f.O,d.j=this.f.j, function oi(a,b,c){u.call(this,"Computer",a,oi,67108864);this.B.ja=!1;pi(this,b);this.L=hd(this,"autoPower",a);this.v=0;this.Y=a.busWidth||a.buswidth;this.g=qi;this.J=null;this.D=this.R=!1;this.aa=hd(this,"url")||"";(Math.random()+.1).toString(36);this.A=ri(this);if(this.b=qb("CPU",this.id)){this.i=qb("Debugger",this.id);this.w=new hc({id:this.Pa+".bus",busWidth:this.Y},this.b,this.i);var d,e=ob(this.id);if((this.f=qb("Panel",this.id))&&this.f.Qa)for(b=0;b<e.length;b++)d=e[b],d.O=this.f.O,d.j=this.f.j,
d.Qa=this.f.Qa;this.j("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Da&&d.Da(this,this.w,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.g=parseInt(d,10));var f;if(a=gd(this,"state")||(f=!0,a.state))b=this.N=a,f||(this.D=!0,this.g=pi),this.g&&(this.K= d.Qa=this.f.Qa;this.j("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Da&&d.Da(this,this.w,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.g=parseInt(d,10));var f;if(a=hd(this,"state")||(f=!0,a.state))b=this.N=a,f||(this.D=!0,this.g=qi),this.g&&(this.K=
new P(this,"1.30.2"),ri(this.K)?b=null:delete this.K);!b&&this.g&&(b=si(this))&&(this.D=!0);if(b){var g=this;Ea(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.O("Unable to load machine state from server (error "+c+(b?": "+ya(b):"")+")")):(g.J=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&ti(this,this.Ib)}else q("Unable to find CPU component")}z(ni);var pi=0; new P(this,"1.30.2"),si(this.K)?b=null:delete this.K);!b&&this.g&&(b=ti(this))&&(this.D=!0);if(b){var g=this;Ea(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.O("Unable to load machine state from server (error "+c+(b?": "+ya(b):"")+")")):(g.J=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&ui(this,this.Ib)}else q("Unable to find CPU component")}z(oi);var qi=0;
function oi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function gd(a,b,c){var d=b.toLowerCase(),d=bb[b]||bb[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function ti(a,b,c){for(var d=ob(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!tb(f)){tb(f,function(){ti(a,b,c)});return}}b.call(a,c)} function pi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function hd(a,b,c){var d=b.toLowerCase(),d=bb[b]||bb[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function ui(a,b,c){for(var d=ob(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!tb(f)){tb(f,function(){ui(a,b,c)});return}}b.call(a,c)}
function ui(a,b){var c=new P(a,"1.30.2","validate");if(ri(c)&&vi(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.O("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=ni.prototype; function vi(a,b){var c=new P(a,"1.30.2","validate");if(si(c)&&wi(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.O("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=oi.prototype;
k.Ib=function(a){void 0===a&&(a=this.g||(this.J?1:pi));if(!this.v){this.v++;var b=!1,c=!1;this.P=!1;var d=this.K||new P(this,"1.30.2");if(-1==a)b=!0;else if(a>pi){if(ri(d,this.J)){this.C=new P(this,"1.30.2","failsafe");ri(this.C)&&(wi(this,d),a=2,xi(this.C));this.C.set("timestamp",Da());yi(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=vi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ri(d,g):("error"== k.Ib=function(a){void 0===a&&(a=this.g||(this.J?1:qi));if(!this.v){this.v++;var b=!1,c=!1;this.P=!1;var d=this.K||new P(this,"1.30.2");if(-1==a)b=!0;else if(a>qi){if(si(d,this.J)){this.C=new P(this,"1.30.2","failsafe");si(this.C)&&(xi(this,d),a=2,yi(this.C));this.C.set("timestamp",Da());zi(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=wi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?si(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),xi(d),ri(d)?(c=vi(d),e=!0):c=!1))}e&&ui(this,c?d:null)}else 2==a&&d.clear()}else ui(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=zi(this,g,d,b,c));b=[d,a,c];-1!=a?ti(this,this.oc,b):this.oc(b)}}; f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.A=null)):this.j(f+": "+g),yi(d),si(d)?(c=wi(d),e=!0):c=!1))}e&&vi(this,c?d:null)}else 2==a&&d.clear()}else vi(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Ai(this,g,d,b,c));b=[d,a,c];-1!=a?ui(this,this.oc,b):this.oc(b)}};
function zi(a,b,c,d,e){if(!b.B.ja){b.B.ja=!0;if(b.Fa){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Fa(f,d)&&f&&(q("Unable to restore state for "+b.type),a.N&&!a.R?(c.clear(),a.g=pi,window&&window.location.reload()):a.P=!0,b.Fa(null),e=!1)}if(!d&&b.pc)for(a=b.pc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} function Ai(a,b,c,d,e){if(!b.B.ja){b.B.ja=!0;if(b.Ga){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ga(f,d)&&f&&(q("Unable to restore state for "+b.type),a.N&&!a.R?(c.clear(),a.g=qi,window&&window.location.reload()):a.P=!0,b.Ga(null),e=!1)}if(!d&&b.pc)for(a=b.pc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
k.oc=function(a){var b=a[0],c=0>a[1];a=a[2];this.da=!0;this.B.ja=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(zi(this,this.b,b,c,a),this.b.sb());this.P&&(wi(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.v=0}; k.oc=function(a){var b=a[0],c=0>a[1];a=a[2];this.da=!0;this.B.ja=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ai(this,this.b,b,c,a),this.$(),this.b.sb());this.P&&(xi(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.v=0};
function wi(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.2"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} function xi(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.2"};d.url=a.aa;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}}
function mi(a,b,c){var d,e="none";if(a.v)return null;a.v--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),h=Da();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ea&&(c&&a.b.ha(),d=a.b.Ea(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;l<h.length;l++){var m=h[l];m.B.ja&&(m.Ea&&(d=m.Ea(b,c),"object"===typeof d&&f.set(m.id, function ni(a,b,c){var d,e="none";if(a.v)return null;a.v--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),h=Da();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Fa&&(c&&a.b.ha(),d=a.b.Fa(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;l<h.length;l++){var m=h[l];m.B.ja&&(m.Fa&&(d=m.Fa(b,c),"object"===typeof d&&f.set(m.id,
d)),c&&(m.B.ja=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.A&&Ai(a,a.A,f.toString()),yi(g)&&yi(f)||(e=null,d=h=!0)):a.g&&(d=!0,h=3==a.g),d&&f.clear(h)):e=f.toString());c&&(a.B.ja=!1,b=a.G.power)&&(b.textContent="Power");a.v=0;return e}k.reset=function(){this.w&&this.w.reset&&(E(this,"Resetting "+this.w.type),this.w.reset());for(var a=ob(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}}; d)),c&&(m.B.ja=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.A&&Bi(a,a.A,f.toString()),zi(g)&&zi(f)||(e=null,d=h=!0)):a.g&&(d=!0,h=3==a.g),d&&f.clear(h)):e=f.toString());c&&(a.B.ja=!1,b=a.G.power)&&(b.textContent="Power");a.v=0;return e}
k.start=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ca(!0)};k.stop=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ca(!0)}; k.reset=function(){this.w&&this.w.reset&&(E(this,"Resetting "+this.w.type),this.w.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=ob(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.$(!0)};k.start=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.$(!0)};
k.sa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.v||(d.B.ja?mi(d,!1,!0):ti(d,d.Ib))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.B.ja&&!d.v)if(d.g&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");mi(d,a,!0);!a&&d.N?window&&window.location.reload():(a||(d.qc=!0),d.Ib(pi),d.qc=!1)}else d.reset(),d.b&&d.b.sb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c); k.stop=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.$(!0)};k.$=function(a){this.b&&this.b.$(a);this.f&&this.f.$(a)};
else return this.G[b]=c,c.onclick=function(){var a=qi(d,!0);if(a){var b=!!(d.g&&!d.H||d.N),c=mi(d,b);b?Ai(d,a,c):d.O("Resume disabled, machine state not saved")}},!0}return!1}; k.sa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.v||(d.B.ja?ni(d,!1,!0):ui(d,d.Ib))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.B.ja&&!d.v)if(d.g&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");ni(d,a,!0);!a&&d.N?window&&window.location.reload():(a||(d.qc=!0),d.Ib(qi),d.qc=!1)}else d.reset(),d.b&&d.b.sb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c);
function qi(a,b){var c=a.A;c||((c=Na("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Bi(a,c))||a.O("The user ID is invalid.")):b&&a.O("Browser local storage is not available"));return c} else return this.G[b]=c,c.onclick=function(){var a=ri(d,!0);if(a){var b=!!(d.g&&!d.H||d.N),c=ni(d,b);b?Bi(d,a,c):d.O("Resume disabled, machine state not saved")}},!0}return!1};
function Bi(a,b){a.A=null;b=Ea(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Oa("user",b.data),a.A=b.data)}catch(d){q(d.message+" ("+c+")")}return a.A}function si(a){var b=null;a.A&&(b=Ga()+"/api/v1/user?req=load&user="+a.A+"&state="+Ci(a,"1.30.2"));return b} function ri(a,b){var c=a.A;c||((c=Na("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Ci(a,c))||a.O("The user ID is invalid.")):b&&a.O("Browser local storage is not available"));return c}
function Ai(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Ci(a,"1.30.2");d.data=c;b=Ea(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.O("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.O(c),Oa("user",""),a.A=null)}} function Ci(a,b){a.A=null;b=Ea(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Oa("user",b.data),a.A=b.data)}catch(d){q(d.message+" ("+c+")")}return a.A}function ti(a){var b=null;a.A&&(b=Ga()+"/api/v1/user?req=load&user="+a.A+"&state="+Di(a,"1.30.2"));return b}
function Tg(a){var b;a=ob(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.qb=function(a){if(this.Qa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Qa.focus();!a&&window&&window.scrollTo(b,c)}};k.ca=function(a){this.b&&this.b.ca(a);this.f&&this.f.ca(a)}; function Bi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Di(a,"1.30.2");d.data=c;b=Ea(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.O("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.O(c),Oa("user",""),a.A=null)}}
Xa(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new ni(g,d,!0);C(g,f);g.L&&ti(g,g.Ib)}});Sa.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=qb("Computer",c.id))&&c.da&&!c.B.ja&&c.Ib(-1)}}); function Ug(a){var b;a=ob(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.qb=function(a){if(this.Qa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Qa.focus();!a&&window&&window.scrollTo(b,c)}};Xa(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new oi(g,d,!0);C(g,f);g.L&&ui(g,g.Ib)}});
Sa.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=qb("Computer",c.id))&&c.B.ja&&mi(c,!(!c.g||c.H),!0)}});function P(a,b,c){this.id=a.id;this.key=Ci(a,b,c);this.i=a.i;xi(this,a.Rc)}function Ci(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a} Sa.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=qb("Computer",c.id))&&c.da&&!c.B.ja&&c.Ib(-1)}});Sa.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=qb("Computer",c.id))&&c.B.ja&&ni(c,!(!c.g||c.H),!0)}});function P(a,b,c){this.id=a.id;this.key=Di(a,b,c);this.i=a.i;yi(this,a.Rc)}function Di(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
P.prototype={constructor:P,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){xi(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c, P.prototype={constructor:P,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){yi(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
1);c=0}}};function xi(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function yi(a){var b=!0;if(Ma()){var c=JSON.stringify(a[a.id]);Oa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function vi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function ri(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ma()&&(b=Na(a.key))?(a[a.id]=b,a.b=!0):!1}var Di=0; 1);c=0}}};function yi(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function zi(a){var b=!0;if(Ma()){var c=JSON.stringify(a[a.id]);Oa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function wi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function si(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ma()&&(b=Na(a.key))?(a[a.id]=b,a.b=!0):!1}var Ei=0;
function Pi(a,b,c,d,e,f){e("Loading "+a+"...");Ea(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Qi(h,a,b,c,d,e,f)})} function Qi(a,b,c,d,e,f){e("Loading "+a+"...");Ea(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Ri(h,a,b,c,d,e,f)})}
function Qi(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(nb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"), function Ri(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(nb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Ri(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)} a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Si(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
function Ri(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/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]*/, function Si(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/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);Ri(a,b,c)}})}else c(a,null)} "");a=a.replace(d[0],g);Si(a,b,c)}})}else c(a,null)}
function Si(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&&(--Di||Za(!0));l=!1}var g,h,l=!0;Di++;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|| 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&&(--Ei||Za(!0));l=!1}var g,h,l=!0;Ei++;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.2/components.xsl");m=function(d,h){h?Pi(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,--Di||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),--Di||Za(!0)):f("invalid machine element: "+ (c="/versions/pdpjs/1.30.2/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,--Ei||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),--Ei||Za(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Pi(b,a,d,!0,e,m):Qi(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 Si(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map 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.2/pdp11-dbg.map

View file

@ -40,203 +40,203 @@ 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 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"== 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} 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,fa:null,ea: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.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<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255, 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<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,
d.K[f++]=e[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;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){u("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.K=e)}return d} d.K[f++]=e[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;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){u("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.K=e)}return d}
function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function u(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var xa=null;function ya(){if(null==xa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}xa=a}return xa} function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function u(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function ya(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va}
function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var Ca={init:[],show:[],exit:[]},Da=!1,Ea=!1,Fa=!0; function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var Ca={init:[],show:[],exit:[]},Da=!1,Ea=!1,Fa=!0;
function Ga(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ha(a){Ca.init.push(a)}function Ia(a){if(Fa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ja(a){!Fa&&a?(Fa=!0,Da&&Ka("init"),Ea&&Ka("show")):Fa=a}function Ka(a){Ca[a]&&Ia(Ca[a])}Ga("onload",function(){Da=!0;Ia(Ca.init)});Ga("onpageshow",function(){Ea=!0;Ia(Ca.show)}); function Ga(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ha(a){Ca.init.push(a)}function Ia(a){if(Fa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ja(a){!Fa&&a?(Fa=!0,Da&&Ka("init"),Ea&&Ka("show")):Fa=a}function Ka(a){Ca[a]&&Ia(Ca[a])}Ga("onload",function(){Da=!0;Ia(Ca.init)});Ga("onpageshow",function(){Ea=!0;Ia(Ca.show)});
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.Lb=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.C=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.Lb=b.comment;this.jc=b;b=this.id.indexOf(".");0>b?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={};
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} 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;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c} 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;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function Ta(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function Ua(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){u(c.message+" ("+a+")")}return b} function Ta(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function Ua(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){u(c.message+" ("+a+")")}return b}
function C(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.$(g.type,g.binding,f,g.value),l=k.length}}}} function C(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.$(g.type,g.binding,f,g.value),l=k.length}}}}
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c} function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},$:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Va=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c), x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},$:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Va=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.F=function(a){this.T(a,this.Pa)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.Pa+": "+a)},F:function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)},ja:function(){return this.l.O=!0},ia:function(a,b){b&&(this.l.O=!1);return!0}};function Va(a,b){a.l.pb?(a.l.Fa=!1,a.l.pb=!1):a.l.error?a.T(a.toString()+" error"):a.l.Fa=b}function F(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.jb,a.jb=null,b&&b()))} this.F=function(a){this.T(a,this.Pa)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.Pa+": "+a)},F:function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)},la:function(){return this.j.O=!0},ka:function(a,b){b&&(this.j.O=!1);return!0}};function Va(a,b){a.j.pb?(a.j.Fa=!1,a.j.pb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Fa=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.jb,a.jb=null,b&&b()))}
function Wa(a,b){b&&(a.l.ready?b():a.jb=b);return a.l.ready}function Xa(a,b){a.l.error=!0;a.F(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); function Wa(a,b){b&&(a.j.ready?b():a.jb=b);return a.j.ready}function Xa(a,b){a.j.error=!0;a.F(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ya="undefined"!==typeof ArrayBuffer; Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ya="undefined"!==typeof ArrayBuffer;
function Za(a){x.call(this,"Panel",a,Za);this.c=this.f=this.i=this.s=0;this.v=this.w=!1;this.A=$a;this.m={};this.b={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.b["S"+a]=[0,!1,!1,this.sc,a]}z(Za);var $a=7;h=Za.prototype;h.reset=function(){}; function Za(a){x.call(this,"Panel",a,Za);this.b=this.f=this.i=this.s=0;this.w=this.A=this.v=!1;this.C=$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.b[b]&&(this.b[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.b[b];ab(a, 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]);a.v="DEP"==b;a.w="EXAM"==b}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.b[b];c[1]&&c[2]&&(ab(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.C=d;bb(b,this,cb);db(b,this.reset.bind(this));eb(this);for(var e in this.b)ab(this,e,this.b[e][0])};h.ja=function(a,b){b||(fb(),this.stop());return!0};h.ia=function(){return!0}; 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);for(var e in this.c)bb(this,e,this.c[e][0])};h.la=function(a,b){b||(gb(),this.reset());return!0};
function gb(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function eb(a,b){for(var c in a.m)gb(a,c,null!=b?b:a.m[c])}function ab(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function hb(a,b,c,d){a.o[b]&&(void 0===c&&(Xa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.C&&a.C.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))} h.ka=function(){return!0};function hb(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.m)hb(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 ib(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.l.U||(this.h.reset(),ib(this.a),this.b.ENABLE&&this.b.ENABLE[0]&&jb(this.a))};h.rc=function(){};h.mc=function(a){a||G(this.a)};h.kc=function(a){if(!a&&!this.a.l.U)if(this.b.ENABLE&&this.b.ENABLE[0])jb(this.a);else{a=this.C;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);0<c&&(kb(this.a,c),lb(this.a,c,!0),mb(this.a,c))}catch(d){"number"!=typeof d&&Xa(this.a,d.stack||d.message)}this.stop();this.j&&this.j.ka()}}; h.qc=function(a){a||this.a.j.U||(this.h.reset(),jb(this.a),ab(this,"ENABLE")&&kb(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"))kb(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);0<c&&(lb(this.a,c),mb(this.a,c,!0),nb(this.a,c))}catch(d){"number"!=typeof d&&Xa(this.a,d.stack||d.message)}this.stop();this.l&&this.l.da()}};
h.lc=function(a){a&&!this.a.l.U&&(this.v&&nb(this,this.c+2),a=ob(this,this.i),this.A==$a?this.h.lb(this.c,a):this.a.lb(this.c,a))};h.nc=function(a){a||this.a.l.U||(this.w&&nb(this,this.c+2),a=this.A==$a?this.h.kb(this.c):this.a.kb(this.c),ob(this,a))};h.pc=function(a){a||this.a.l.U||nb(this,this.i)};h.oc=function(a){eb(this,a||null)};h.sc=function(a,b){this.i=a?this.i|1<<b:this.i&~(1<<b)};function nb(a,b){a.c=b&a.h.ua;pb(a,"A",a.c,22)}function ob(a,b){a.f=b&65535;pb(a,"D",a.f,16);return a.f} h.lc=function(a){a&&!this.a.j.U&&(this.w&&ob(this),a=pb(this,this.i),this.C==$a?this.h.lb(this.b,a):this.a.lb(this.b,a))};h.nc=function(a){a||this.a.j.U||(this.A&&ob(this),a=this.C==$a?this.h.kb(this.b):this.a.kb(this.b),pb(this,a))};h.pc=function(a){a||this.a.j.U||(this.b=this.i&this.h.ja,qb(this,"A",this.b,22))};h.oc=function(a){a?(this.v=!0,fb(this,!0)):(this.v=!1,fb(this))};h.sc=function(a,b){this.i=a?this.i|1<<b:this.i&~(1<<b)};
function qb(a,b,c){a.m[b]=c;gb(a,b,c)}function pb(a,b,c,d){for(var e=0;e<d;e++)qb(a,b+e,c&1<<e)}h.stop=function(){nb(this,this.a.g[7])};h.ka=function(){if(this.s){for(var a=0;a<this.a.g.length;a++)hb(this,"R"+a,this.a.g[a]);a=rb(this.a);hb(this,"PS",a);hb(this,"NF",a&8?1:0,1);hb(this,"ZF",a&4?1:0,1);hb(this,"VF",a&2?1:0,1);hb(this,"CF",a&1?1:0,1);pb(this,"D",this.f,16);pb(this,"A",this.c,22);a=this.a.Ba?this.a.Ga&16?1:2:4;qb(this,"B22",a&1);qb(this,"B18",a&2);qb(this,"B16",a&4)}}; function ob(a){a.b=a.b+(ab(a,"STEP")?2:-2)&a.h.ja;qb(a,"A",a.b,22)}function pb(a,b){a.f=b&65535;qb(a,"D",a.f,16);return a.f}function rb(a,b,c){a.m[b]=c;a.v||hb(a,b,c)}function qb(a,b,c,d){for(var e=0;e<d;e++)rb(a,b+e,c&1<<e)}h.stop=function(){this.b=this.a.g[7]&this.h.ja;qb(this,"A",this.b,22)};
h.tc=function(a){return(a?this.i:this.f)&65535};h.nd=function(a){this.f=a};var sb={},cb=(sb[65400]=[null,null,Za.prototype.tc,Za.prototype.nd,"CNSW"],sb);function fb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=Ta(e.id);f||(a=!0,f=new Za(e));C(f,d);a&&F(f)}}Ha(fb); h.da=function(){if(this.s){for(var a=0;a<this.a.g.length;a++)ib(this,"R"+a,this.a.g[a]);a=sb(this.a);ib(this,"PS",a);ib(this,"NF",a&8?1:0,1);ib(this,"ZF",a&4?1:0,1);ib(this,"VF",a&2?1:0,1);ib(this,"CF",a&1?1:0,1);qb(this,"D",this.f,16);qb(this,"A",this.b,22);a=this.a.Ba?this.a.Ga&16?1:2:4;rb(this,"B22",a&1);rb(this,"B18",a&2);rb(this,"B16",a&4)}};h.tc=function(a){return(a?this.i:this.f)&65535};h.nd=function(a){this.f=a};var tb={},db=(tb[65400]=[null,null,Za.prototype.tc,Za.prototype.nd,"CNSW"],tb);
function tb(a,b,c){x.call(this,"Bus",a,tb);this.a=b;this.C=c;this.I=a.busWidth||16;this.m=0;this.G=[];this.w=null;this.A=1<<this.I;this.ua=this.A-1;this.b=H;this.c=Math.log2(this.b);this.D=this.b>>2;this.j=this.b-1;this.v=this.A/this.b|0;this.ya=[];this.f=0;this.i=!1;this.s=[];this.ac=[ub,vb,wb,xb];a=new I(this);yb(a,this.C);this.h=Array(this.v);for(b=0;b<this.v;b++)this.h[b]=a;F(this)}z(tb);var H=8192,zb=H-1; function gb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=Ta(e.id);f||(a=!0,f=new Za(e));C(f,d);a&&F(f)}}Ha(gb);
function ub(a,b){var c=-1,d=this.controller,e=d.ya[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>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 vb(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 ub(a,b,c){x.call(this,"Bus",a,ub);this.a=b;this.D=c;this.I=a.busWidth||16;this.m=0;this.G=[];this.w=null;this.A=1<<this.I;this.ja=this.A-1;this.b=H;this.c=Math.log2(this.b);this.C=this.b>>2;this.l=this.b-1;this.v=this.A/this.b|0;this.ya=[];this.f=0;this.i=!1;this.s=[];this.ac=[vb,wb,xb,yb];a=new I(this);zb(a,this.D);this.h=Array(this.v);for(b=0;b<this.v;b++)this.h[b]=a;F(this)}z(ub);var H=8192,Ab=H-1;
function wb(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 xb(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 Ab(a,b){if(b!=a.m){var c;a.m&&(c=(1<<a.m)-H,Bb(a,c,H,a.G),a.m=0);b&&(a.m=b,c=1<<b,a.ua=c-1,c-=H,a.G=Cb(a,c,H),a.w?Bb(a,c,H,a.w):(Db(a,c,H,Eb,a),a.w=Cb(a,c,H)))}}h=tb.prototype; function vb(a,b){var c=-1,d=this.controller,e=d.ya[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>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)}
h.reset=function(){for(var a=0;a<this.s.length;a++)this.s[a]();Ab(this,16)};h.ja=function(a,b){b||this.reset();return!0}; 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.m){var c;a.m&&(c=(1<<a.m)-H,Cb(a,c,H,a.G),a.m=0);b&&(a.m=b,c=1<<b,a.ja=c-1,c-=H,a.G=Db(a,c,H),a.w?Cb(a,c,H,a.w):(Eb(a,c,H,Fb,a),a.w=Db(a,c,H)))}}h=ub.prototype;
function Db(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.h.length;){var l=a.h[k],n=k*a.b,p=a.b-(f-n);p>g&&(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 Fb(1,f,g)}f=new I(a,f,p,a.b,d,e);yb(f,a.C,l);a.h[k++]=f;f=n+a.b;g-=p}if(0>=g){c/=1024;var t;e="";t?10<t&&(t=10):t=c&-65536?10:5;if(null==c||isNaN(c))for(;0<t--;)e="?"+e;else for(;0<t--;)e=String.fromCharCode(c%10+48)+e,c/= h.reset=function(){for(var a=0;a<this.s.length;a++)this.s[a]();Bb(this,16)};h.la=function(a,b){b||this.reset();return!0};
10;a.status(e+"Kb "+Gb[d]+" at "+ka(b));return!0}return Fb(2,b,c)}function Cb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.h.length;)d.push(a.h[b++]),c-=a.b;return d}function Bb(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.h.length;){var f=d[e++];if(!f)break;a.h[b++]=f;c-=a.b}}function Hb(a,b){3932160<=b&&(b=Ib(a.a,b));return a.h[(b&a.ua)>>>a.c].xb(b&a.j,b)}function Jb(a,b){3932160<=b&&(b=Ib(a.a,b));return a.h[(b&a.ua)>>>a.c].W(b&a.j,b)} function Eb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.h.length;){var l=a.h[k],n=k*a.b,p=a.b-(f-n);p>g&&(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<t&&(t=10):t=c&-65536?10:5;if(null==c||isNaN(c))for(;0<t--;)e="?"+e;else for(;0<t--;)e=String.fromCharCode(c%10+48)+e,c/=
h.kb=function(a){var b=a&this.j,c=(a&this.ua)>>>this.c;this.i=!1;this.f++;a=this.h[c].Sb(b,a);this.f--;return a};h.Xa=function(a,b){this.i=!1;this.f++;this.h[(a&this.ua)>>>this.c].Eb(a&this.j,b&255,a);this.f--};function Kb(a,b,c){3932160<=b&&(b=Ib(a.a,b));a.h[(b&a.ua)>>>a.c].ob(b&a.j,c&65535,b)}h.lb=function(a,b){var c=a&this.j,d=(a&this.ua)>>>this.c;this.i=!1;this.f++;this.h[d].Zb(c,b&65535,a);this.f--}; 10;a.status(e+"Kb "+Hb[d]+" at "+ka(b));return!0}return Gb(2,b,c)}function Db(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.h.length;)d.push(a.h[b++]),c-=a.b;return d}function Cb(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.h.length;){var f=d[e++];if(!f)break;a.h[b++]=f;c-=a.b}}function Ib(a,b){3932160<=b&&(b=Jb(a.a,b));return a.h[(b&a.ja)>>>a.c].xb(b&a.l,b)}function Kb(a,b){3932160<=b&&(b=Jb(a.a,b));return a.h[(b&a.ja)>>>a.c].W(b&a.l,b)}
function Lb(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.h[d];if(e.ta||e.fc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Mb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&zb;void 0!==a.ya[n]?u("I/O address already registered: "+m(b,8,!0)):a.ya[n]=[d,e,f,g,k||"unknown",l,!1]}} h.kb=function(a){var b=a&this.l,c=(a&this.ja)>>>this.c;this.i=!1;this.f++;a=this.h[c].Sb(b,a);this.f--;return a};h.Xa=function(a,b){this.i=!1;this.f++;this.h[(a&this.ja)>>>this.c].Eb(a&this.l,b&255,a);this.f--};function Lb(a,b,c){3932160<=b&&(b=Jb(a.a,b));a.h[(b&a.ja)>>>a.c].ob(b&a.l,c&65535,b)}h.lb=function(a,b){var c=a&this.l,d=(a&this.ja)>>>this.c;this.i=!1;this.f++;this.h[d].Zb(c,b&65535,a);this.f--};
function bb(a,b,c,d){for(var e in c){var f=+e,g=c[e];if(!(g[6]&&g[6]>a.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<t;E++,f+=2)w&&1<t&&(w=g[4]+E),Mb(a,f,f,k,l,n,p,w,d||64)}}}function db(a,b){a.s.push(b)} function Mb(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.h[d];if(e.ua||e.fc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Nb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Ab;void 0!==a.ya[n]?u("I/O address already registered: "+m(b,8,!0)):a.ya[n]=[d,e,f,g,k||"unknown",l,!1]}}
function J(a,b,c){a.i=!0;a.f||(c&&(a.a.M|=c),K(a.a,4,b))}function Nb(a){var b=a.i;a.i=!1;return b}function Fb(a,b,c){u("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){x.call(this,"Device",a,L);this.b={L:0,Cb:-1}}z(L);h=L.prototype;h.ha=function(a,b,c,d){this.h=b;this.a=c;this.C=d;var e=this;this.b.Cb=Ob(c,function(){e.b.Aa|=128;e.b.Aa&64&&(Pb(e.a,e.b.ld),Qb(e.a,e.b.Cb,1E3/60))});this.b.ld=Rb(64,6);bb(b,this,M);db(b,this.reset.bind(this));F(this)}; function cb(a,b,c,d){for(var e in c){var f=+e,g=c[e];if(!(g[6]&&g[6]>a.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<t;E++,f+=2)w&&1<t&&(w=g[4]+E),Nb(a,f,f,k,l,n,p,w,d||64)}}}function eb(a,b){a.s.push(b)}
h.reset=function(){this.b.Aa=0};h.Bc=function(){var a=this.b.Aa;this.b.Aa&=-129;return a};h.vd=function(a){this.b.Aa=a;a&64&&Qb(this.a,this.b.Cb,1E3/60);this.b.Aa=a&-129};h.Dc=function(){var a=this.a;return a.w&62337|a.$a<<5|a.ab<<1};h.xd=function(a){var b=this.a;a&=62337;if(b.w!=a){b.w=a;b.$a=a>>5&3;b.ab=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Tb(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}; function J(a,b,c){a.i=!0;a.f||(c&&(a.a.M|=c),K(a.a,4,b))}function Ob(a){var b=a.i;a.i=!1;return b}function Gb(a,b,c){u("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){x.call(this,"Device",a,L);this.b={L:0,Cb:-1}}z(L);h=L.prototype;h.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;var e=this;this.b.Cb=Pb(c,function(){e.b.Aa|=128;e.b.Aa&64&&(Qb(e.a,e.b.ld),Rb(e.a,e.b.Cb,1E3/60))});this.b.ld=Sb(64,6);cb(b,this,M);eb(b,this.reset.bind(this));F(this)};
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,Tb(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.reset=function(){this.b.Aa=0};h.Bc=function(){var a=this.b.Aa;this.b.Aa&=-129;return a};h.vd=function(a){this.b.Aa=a;a&64&&Rb(this.a,this.b.Cb,1E3/60);this.b.Aa=a&-129};h.Dc=function(){var a=this.a;return a.w&62337|a.$a<<5|a.ab<<1};h.xd=function(a){var b=this.a;a&=62337;if(b.w!=a){b.w=a;b.$a=a>>5&3;b.ab=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.Za&&(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.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.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.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.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.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.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.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.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.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.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 rb(this.a)};h.Cd=function(a){Ub(this.a,a&-1809|rb(this.a)&1808);this.a.u|=128};h.Xb=function(){}; h.Kc=function(){return sb(this.a)};h.Cd=function(a){Vb(this.a,a&-1809|sb(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,"SISDR",8,1145],N[62608]=[null,null,L.prototype.Xc,L.prototype.Pd,"SDSDR",8,1145],N[62624]=[null,null,L.prototype.Yc,L.prototype.Qd,"SISAR",8,1145],N[62640]=[null,null,L.prototype.Wc,L.prototype.Od,"SDSAR",8,1145],N[62656]=[null,null,L.prototype.Ac,L.prototype.ud,"KISDR",8,1145],N[62672]=[null,null,L.prototype.yc,L.prototype.sd,"KDSDR",8,1145],N[62688]=[null,null,L.prototype.zc, 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,"SISDR",8,1145],N[62608]=[null,null,L.prototype.Xc,L.prototype.Pd,"SDSDR",8,1145],N[62624]=[null,null,L.prototype.Yc,L.prototype.Qd,"SISAR",8,1145],N[62640]=[null,null,L.prototype.Wc,L.prototype.Od,"SDSAR",8,1145],N[62656]=[null,null,L.prototype.Ac,L.prototype.ud,"KISDR",8,1145],N[62672]=[null,null,L.prototype.yc,L.prototype.sd,"KDSDR",8,1145],N[62688]=[null,null,L.prototype.zc,
L.prototype.td,"KISAR",8,1145],N[62704]=[null,null,L.prototype.xc,L.prototype.rd,"KDSAR",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,"UISDR",8,1145],N[65424]=[null,null,L.prototype.cd, L.prototype.td,"KISAR",8,1145],N[62704]=[null,null,L.prototype.xc,L.prototype.rd,"KDSAR",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,"UISDR",8,1145],N[65424]=[null,null,L.prototype.cd,
L.prototype.Vd,"UDSDR",8,1145],N[65440]=[null,null,L.prototype.dd,L.prototype.Wd,"UISAR",8,1145],N[65456]=[null,null,L.prototype.bd,L.prototype.Ud,"UDSAR",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, L.prototype.Vd,"UDSDR",8,1145],N[65440]=[null,null,L.prototype.dd,L.prototype.Wd,"UISAR",8,1145],N[65456]=[null,null,L.prototype.bd,L.prototype.Ud,"UDSAR",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,
"R5SET0"],N[65478]=[null,null,L.prototype.Lc,L.prototype.Dd,"R6KERNEL"],N[65479]=[null,null,L.prototype.Oc,L.prototype.Gd,"R7KERNEL"],N[65480]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Ma, "R5SET0"],N[65478]=[null,null,L.prototype.Lc,L.prototype.Dd,"R6KERNEL"],N[65479]=[null,null,L.prototype.Oc,L.prototype.Gd,"R7KERNEL"],N[65480]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Ma,
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]= 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]; [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<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new L(c);C(c,d);break;case "pc11":c=new Vb(c);C(c,d);break;case "rl11":c=new O(c),C(c,d)}}});var Wb;if(Ya){var Xb=new ArrayBuffer(2);(new DataView(Xb)).setUint16(0,256,!0);Wb=256===(new Uint16Array(Xb))[0]}else Wb=!1;var Yb=Wb; Ha(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new L(c);C(c,d);break;case "pc11":c=new Wb(c);C(c,d);break;case "rl11":c=new O(c),C(c,d)}}});var Xb;if(Ya){var Yb=new ArrayBuffer(2);(new DataView(Yb)).setUint16(0,256,!0);Xb=256===(new Uint16Array(Yb))[0]}else Xb=!1;var Zb=Xb;
function I(a,b,c,d,e,f){this.h=a;this.id=Zb+=2;this.a=null;this.Ja=b;this.nb=c;this.size=d||0;this.type=e||$b;this.j=e==ac;this.controller=null;yb(this);this.ta=this.fc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],bc(this,f.ac);else if(Ya)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),bc(this,Yb?cc:dc);else{a=this.a=Array(this.size>> function I(a,b,c,d,e,f){this.h=a;this.id=$b+=2;this.a=null;this.Ja=b;this.nb=c;this.size=d||0;this.type=e||ac;this.l=e==bc;this.controller=null;zb(this);this.ua=this.fc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],cc(this,f.ac);else if(Ya)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),cc(this,Zb?dc:ec);else{a=this.a=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;bc(this,ec)}else bc(this)}var $b=0,ac=2,Eb=4,Gb=["NONE","RAM","ROM","VID","H/W"],Zb=0; 2);for(f=0;f<a.length;f++)a[f]=0;cc(this,fc)}else cc(this)}var ac=0,bc=2,Fb=4,Hb=["NONE","RAM","ROM","VID","H/W"],$b=0;
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ya)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ya)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.ta=!0}return!1},v:function(a,b){J(this.h,b,32);return 255},f:function(a,b,c){J(this.h,c,32)},w:function(a,b){return this.xb(a++,b++)| I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ya)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ya)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.ua=!0}return!1},v:function(a,b){J(this.h,b,32);return 255},f:function(a,b,c){J(this.h,c,32)},w:function(a,b){return this.xb(a++,b++)|
this.xb(a,b)<<8},A:function(a,b,c){this.Db(a++,b&255,c++);this.Db(a,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<<a)|b<<a;this.ta=!0},xa:function(a,b,c){a&1&&J(this.h,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256| this.xb(a,b)<<8},A:function(a,b,c){this.Db(a++,b&255,c++);this.Db(a,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<<a)|b<<a;this.ua=!0},xa:function(a,b,c){a&1&&J(this.h,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
b>>8);this.ta=!0},G: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)},D: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, b>>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.ta=!0},wa:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.ta=!0}};function yb(a,b,c){a.C=b;a.i=a.m=0;c&&((a.i=c.i)&&fc(a,hc,!1),(a.m=c.m)&&ic(a,hc,!1))}function ic(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 fc(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 bc(a,b){b||(b=jc);fc(a,b,void 0);ic(a,b,void 0)} 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 zb(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&gc(a,ic,!1),(a.m=c.m)&&jc(a,ic,!1))}function jc(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 gc(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 cc(a,b){b||(b=kc);gc(a,b,void 0);jc(a,b,void 0)}
var jc=[],ec=[I.prototype.N,I.prototype.qa,I.prototype.na,I.prototype.xa],hc=[I.prototype.G,I.prototype.oa,I.prototype.R,I.prototype.sa];if(Ya)var dc=[I.prototype.D,I.prototype.da,I.prototype.P,I.prototype.ra],cc=[I.prototype.J,I.prototype.pa,I.prototype.aa,I.prototype.wa]; var kc=[],fc=[I.prototype.N,I.prototype.ra,I.prototype.oa,I.prototype.xa],ic=[I.prototype.G,I.prototype.pa,I.prototype.R,I.prototype.ta];if(Ya)var ec=[I.prototype.C,I.prototype.ea,I.prototype.P,I.prototype.sa],dc=[I.prototype.J,I.prototype.qa,I.prototype.aa,I.prototype.wa];
function kc(a,b){x.call(this,"CPU",a,kc);var c=a.multiplier||1;this.gb=a.cycles||b;this.qa=c;this.ub=Math.round(this.gb/1E4)/100;this.wa=this.ub*this.qa;this.l.U=!1;this.l.Bb=!1;this.l.Ua=a.autoStart;this.l.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(kc);var lc=["power","reset"];h=kc.prototype; function lc(a,b){x.call(this,"CPU",a,lc);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(lc);var mc=["power","reset"];h=lc.prototype;
h.ha=function(a,b,c,d){this.j=a;this.h=b;this.C=d;for(b=0;b<lc.length;b++)(c=this.o[lc[b]])&&this.j.$(null,lc[b],c);a=mc(a,"autoStart");null!=a&&(this.l.Ua="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ja=function(a,b){if(!b){if(a&&this.restore){nc(this);if(!this.restore(a))return!1;oc(this)}else this.reset();this.T("No debugger detected")}this.j.ka();return!0};h.ia=function(a){return a?this.save():!0}; h.ia=function(a,b,c,d){this.l=a;this.h=b;this.D=d;for(b=0;b<mc.length;b++)(c=this.o[mc[b]])&&this.l.$(null,mc[b],c);a=nc(a,"autoStart");null!=a&&(this.j.Ua="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.la=function(a,b){if(!b){if(a&&this.restore){oc(this);if(!this.restore(a))return!1;pc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ka=function(a){return a?this.save():!0};
h.Ua=function(){return this.l.Ua||void 0===this.o.run?(jb(this),!0):!1};h.Ib=function(){return 0};function oc(a){void 0===a.eb&&(a.eb=0);void 0===a.Qa&&(a.Qa=-1);void 0===a.Ra&&(a.Ra=-1);a.l.fb=0<=a.eb&&0<a.Qa;a.l.fb&&(a.cb=0,a.xa=a.eb-a.sa)}function mb(a,b){if(a.l.fb){var c=!1;a.cb=a.cb+a.Ib()|0;a.xa-=b;0>=a.xa&&(a.xa+=a.Qa,c=!0);0<=a.Ra&&a.Ra<=pc(a)&&(a.Qa=a.Ra=-1,oc(a),G(a),c=!0);c&&a.T(pc(a)+" cycles: checksum="+m(a.cb))}} h.Ua=function(){return this.j.Ua||void 0===this.o.run?(kb(this),!0):!1};h.Ib=function(){return 0};function pc(a){void 0===a.eb&&(a.eb=0);void 0===a.Qa&&(a.Qa=-1);void 0===a.Ra&&(a.Ra=-1);a.j.fb=0<=a.eb&&0<a.Qa;a.j.fb&&(a.cb=0,a.xa=a.eb-a.ta)}function nb(a,b){if(a.j.fb){var c=!1;a.cb=a.cb+a.Ib()|0;a.xa-=b;0>=a.xa&&(a.xa+=a.Qa,c=!0);0<=a.Ra&&a.Ra<=qc(a)&&(a.Qa=a.Ra=-1,pc(a),G(a),c=!0);c&&a.T(qc(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;c<k.length&&(b=k[c],b===a||b.l.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.l.O);c++);c==k.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.jb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.U?G(d):jb(d))},!0;case "speed":return this.o[b]= 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;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.O);c++);c==k.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.jb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.U?G(d):kb(d))},!0;case "speed":return this.o[b]=
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){qc(d,d.qa<<1,!0)},c.textContent=this.wa.toFixed(2)+"Mhz",!0}return!1};h.ka=function(){var a=this.o.speed;a&&(a.textContent=this.l.U&&this.da?this.da.toFixed(2)+"Mhz":"Stopped")};function lb(a,b,c){a.sa+=b;c&&(a.pa=a.a=a.G=0)}function rc(a,b){var c=1;b&&1<a.qa&&a.da&&(c=a.da/a.ub);a.Nb=Math.round(1E3/30);a.hb=Math.floor(a.gb/30*c);b||(a.Sa=a.hb);a.vb=0}function pc(a){return a.sa+a.aa+a.pa-a.a} c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){rc(d,d.ra<<1,!0)},c.textContent=this.wa.toFixed(2)+"Mhz",!0}return!1};h.da=function(){var a=this.o.speed;a&&(a.textContent=this.j.U&&this.ea?this.ea.toFixed(2)+"Mhz":"Stopped")};function mb(a,b,c){a.ta+=b;c&&(a.qa=a.a=a.G=0)}function sc(a,b){var c=1;b&&1<a.ra&&a.ea&&(c=a.ea/a.ub);a.Nb=Math.round(1E3/30);a.hb=Math.floor(a.gb/30*c);b||(a.Sa=a.hb);a.vb=0}function qc(a){return a.ta+a.aa+a.qa-a.a}
function nc(a){a.da=0;a.Ob=0;a.sa=a.aa=a.pa=a.a=a.G=0;oc(a);qc(a,1)}function qc(a,b,c){if(void 0!==b){.8>a.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&&sc(a.j)}lb(a,a.aa);a.aa=0;a.R=ra();a.oa=0;rc(a)}function Ob(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Qb(a,b,c){0<=b&&b<a.I.length&&0>a.I[b][0]&&(c=a.gb*a.qa/1E3*c|0,a.I[b][0]=c+tc(a))} function oc(a){a.ea=0;a.Ob=0;a.ta=a.aa=a.qa=a.a=a.G=0;pc(a);rc(a,1)}function rc(a,b,c){if(void 0!==b){.8>a.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&&tc(a.l)}mb(a,a.aa);a.aa=0;a.R=ra();a.pa=0;sc(a)}function Pb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Rb(a,b,c){0<=b&&b<a.I.length&&0>a.I[b][0]&&(c=a.gb*a.ra/1E3*c|0,a.I[b][0]=c+uc(a))}
function kb(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 tc(a,b){var c=a.pa-=a.a;a.a=a.G=0;b&&(a.pa=0);return c} function lb(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 uc(a,b){var c=a.qa-=a.a;a.a=a.G=0;b&&(a.qa=0);return c}
h.kd=function(){if(this.l.U){this.vb>=this.gb&&rc(this,!0);this.Ta=0;this.bb=ra();if(this.oa){var a=this.bb-this.oa;a>this.Nb&&(this.R+=a,this.R>this.bb&&(this.R=this.bb))}try{do{for(var b,c=this.l.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=tc(this,!0);this.Ta+=b;this.aa+=b;mb(this,b);kb(this,b);this.Sa-=b;if(0>=this.Sa){this.Sa+=this.hb;15<=++this.Ob&&(this.j&&this.j.ka(),this.Ob=0);break}}while(this.l.U)}catch(f){G(this); h.kd=function(){if(this.j.U){this.vb>=this.gb&&sc(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=uc(this,!0);this.Ta+=b;this.aa+=b;nb(this,b);lb(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.j&&this.j.stop(ra(),pc(this));Xa(this,f.stack||f.message);return}if(this.l.U){a=setTimeout;b=this.Qb;this.oa=ra();c=this.Nb;this.Ta&&(c=Math.round(c*this.Ta/this.hb));c-=this.oa-this.bb;if(d=this.oa-this.R)this.da=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.sa=0,qc(this));if(0>c||this.da<this.wa)-1E3>c&&(this.R-=c),c=0;this.vb+=this.Ta;this.oa+=c;a(b,c)}}}; this.l&&this.l.stop(ra(),qc(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,rc(this));if(0>c||this.ea<this.wa)-1E3>c&&(this.R-=c),c=0;this.vb+=this.Ta;this.pa+=c;a(b,c)}}};
function jb(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{qc(a);a.l.U=!0;a.l.Bb=!0;if(b=a.o.run)b.textContent="Halt";a.j&&a.j.start(a.R,pc(a));setTimeout(a.Qb,0)}}h.mb=function(){return 0};function G(a){var b=!1;if(a.l.U){tc(a);lb(a,a.aa);a.aa=0;a.l.U=!1;if(b=a.o.run)b.textContent="Run";a.j&&a.j.stop(ra(),pc(a));b=!0}a.l.complete=void 0;return b} function kb(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{rc(a);a.j.U=!0;a.j.Bb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.R,qc(a));setTimeout(a.Qb,0)}}h.mb=function(){return 0};function G(a){var b=!1;if(a.j.U){uc(a);mb(a,a.aa);a.aa=0;a.j.U=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),qc(a));b=!0}a.j.complete=void 0;return b}
function uc(a){this.Za=+a.model||1170;this.Jb=a.addrReset||0;kc.call(this,a,6666667);this.decode=1120==this.Za?vc.bind(this):wc.bind(this);xc(this);this.ra=0;this.N=null;this.l.complete=!1}z(uc,kc);h=uc.prototype;h.reset=function(){this.status("model "+this.Za);this.l.U&&G(this);xc(this);nc(this);this.l.error=!1;this.parent.reset.call(this)}; function vc(a){this.Za=+a.model||1170;this.Jb=a.addrReset||0;lc.call(this,a,6666667);this.decode=1120==this.Za?wc.bind(this):xc.bind(this);yc(this);this.sa=0;this.N=null;this.j.complete=!1}z(vc,lc);h=vc.prototype;h.reset=function(){this.status("model "+this.Za);this.j.U&&G(this);yc(this);oc(this);this.j.error=!1;this.parent.reset.call(this)};
function xc(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.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, function yc(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.D=0;a.c=a.b=a.tb=0;a.Ia=-1;ib(a)}function ib(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&&Tb(a)}function Tb(a){a.Ba?(a.P=65536,a.J=a.hc,a.W=a.gd,a.ob=a.Zd,Ab(a.h,a.Ga&16?22:18)):(a.P=0,a.J=a.gc,a.W=a.Tb,a.ob=a.$b,Ab(a.h,16))}function yc(a,b,c){a.Jb=b;P(a,b);!c&&a.C&&(G(a)||a.C.ka())}h.Ib=function(){return 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;jb(a)}function jb(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&&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 zc(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.sa,this.qa]);a.set(2,Lb(this.h));return a.data()};h.restore=function(a){var b=a[1];this.sa=b[1];qc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.D){for(var f=0,g=Array(b.D),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.h[d];if(!f||!f.restore(e)){u("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function R(a){return a.m&65536?1:0} h.save=function(){var a=new Q(this);a.set(0,[]);a.set(1,[this.ta,this.ra]);a.set(2,Mb(this.h));return a.data()};h.restore=function(a){var b=a[1];this.ta=b[1];rc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.C){for(var f=0,g=Array(b.C),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.h[d];if(!f||!f.restore(e)){u("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function R(a){return a.m&65536?1:0}
h.za=function(){return this.s&32768?8:0};function zc(a){var b=a.g[7];a.w&57344||(a.Ca=0,a.zb=b);a.g[7]=b+2&65535;return a.W(b)}function Ac(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function P(a,b){a.g[7]=b&65535}function Rb(a,b){return{md:a,Ka:b,next:null}}function Pb(a,b){if(b!=a.N){var c=a.N;if(!c||c.Ka<=b.Ka)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.Ka<=b.Ka){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=2}function rb(a){return a.B=a.B&63728|a.za()|(a.i&65535?0:4)|(a.f&32768?2:0)|R(a)} h.za=function(){return this.s&32768?8:0};function Ac(a){var b=a.g[7];a.w&57344||(a.Ca=0,a.zb=b);a.g[7]=b+2&65535;return a.W(b)}function Bc(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function P(a,b){a.g[7]=b&65535}function Sb(a,b){return{md:a,Ka:b,next:null}}function Qb(a,b){if(b!=a.N){var c=a.N;if(!c||c.Ka<=b.Ka)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.Ka<=b.Ka){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=2}function sb(a){return a.B=a.B&63728|a.za()|(a.i&65535?0:4)|(a.f&32768?2:0)|R(a)}
function Ub(a,b){a.s=b<<12;a.i=~b&4;a.f=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Ha.length;0<=--c;){var d=a.g[c];a.g[c]=a.Ha[c];a.Ha[c]=d}a.v=b>>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 Bc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function Cc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Dc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Ec(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} function Vb(a,b){a.s=b<<12;a.i=~b&4;a.f=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Ha.length;0<=--c;){var d=a.g[c];a.g[c]=a.Ha[c];a.Ha[c]=d}a.v=b>>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 Cc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function Dc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Ec(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Fc(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=rb(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);Ub(a,f&-12289|a.Ia>>2&12288);d&&(a.M|=4,a.g[6]=4);Fc(a,a.Ia);Fc(a,a.g[7]);P(a,e);a.u&=-113;a.Ia=-1;a.u|=8;if(26!=c)throw b;}}function Gc(a){var b=Hc(a),c=Hc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);P(a,b);Ub(a,c);a.u&=-17} function K(a,b,c){if(!a.sa){var d=!1;0>a.Ia?a.Ia=sb(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);Vb(a,f&-12289|a.Ia>>2&12288);d&&(a.M|=4,a.g[6]=4);Gc(a,a.Ia);Gc(a,a.g[7]);P(a,e);a.u&=-113;a.Ia=-1;a.u|=8;if(26!=c)throw b;}}function Hc(a){var b=Ic(a),c=Ic(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);P(a,b);Vb(a,c);a.u&=-17}
function Ib(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 Jb(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 Ic(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), function Jc(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<f)||(a.w|=4096,a.w&512&&(a.u|=32)),b&&K(a,168,16));return f}function Jc(a,b,c){b&1&&a.a--;a=a.h;c&=255;3932160<=b&&(b=Ib(a.a,b));a.h[(b&a.ua)>>>a.c].Db(b&a.j,c&255,b)}function Hc(a){var b=a.W(a.g[6]|a.P);a.g[6]=a.g[6]+2&65535;return b}function Fc(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<c&&(c<=a.Da-32?(a.M|=4,a.g[6]=4,K(a,4,18)):(a.M|=8,a.u|=4));a.ob(c,b)} b=!0),a.w&61440||!(4191360>f||4194239<f)||(a.w|=4096,a.w&512&&(a.u|=32)),b&&K(a,168,16));return f}function Kc(a,b,c){b&1&&a.a--;a=a.h;c&=255;3932160<=b&&(b=Jb(a.a,b));a.h[(b&a.ja)>>>a.c].Db(b&a.l,c&255,b)}function Ic(a){var b=a.W(a.g[6]|a.P);a.g[6]=a.g[6]+2&65535;return b}function Gc(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<c&&(c<=a.Da-32?(a.M|=4,a.g[6]=4,K(a,4,18)):(a.M|=8,a.u|=4));a.ob(c,b)}
function Kc(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return K(a,4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.g[6]<=a.Da||65534<=a.g[6])&&(a.g[6]<=a.Da-32||65534<=a.g[6]?(a.M|=4,a.g[6]=4,K(a,4,22)):(a.M|=8,a.u|=64)),a.a-=3,7===c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];7!==c&&(e|=g,6>c&&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-= function Lc(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return K(a,4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.g[6]<=a.Da||65534<=a.g[6])&&(a.g[6]<=a.Da-32||65534<=a.g[6]?(a.M|=4,a.g[6]=4,K(a,4,22)):(a.M|=8,a.u|=64)),a.a-=3,7===c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];7!==c&&(e|=g,6>c&&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(Ac(a,2)),e=e+a.g[c]&65535|g,a.a-=6,e;case 7:return e=a.W(Ac(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.ra++;a=this.Tb(Ic(this,a,2));this.ra--;return a}; 8;break;case 6:return e=a.W(Bc(a,2)),e=e+a.g[c]&65535|g,a.a-=6,e;case 7:return e=a.W(Bc(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(Jc(this,a,2));this.sa--;return a};
h.Xa=function(a,b){this.Ba?(this.ra++,Jc(this,Ic(this,a,5),b),this.ra--):this.h.Xa(a,b)};h.lb=function(a,b){this.Ba?(this.ra++,this.$b(Ic(this,a,4),b),this.ra--):this.h.lb(a,b)};h.gc=function(a,b,c){return Kc(this,a,b,c)};h.hc=function(a,b,c){return Ic(this,Kc(this,a,b,c),c)};h.Tb=function(a){return Jb(this.h,a)};h.gd=function(a){return Jb(this.h,Ic(this,a,2))};h.$b=function(a,b){Kb(this.h,a,b&65535)};h.Zd=function(a,b){Kb(this.h,Ic(this,a,4),b)}; h.Xa=function(a,b){this.Ba?(this.sa++,Kc(this,Jc(this,a,5),b),this.sa--):this.h.Xa(a,b)};h.lb=function(a,b){this.Ba?(this.sa++,this.$b(Jc(this,a,4),b),this.sa--):this.h.lb(a,b)};h.gc=function(a,b,c){return Lc(this,a,b,c)};h.hc=function(a,b,c){return Jc(this,Lc(this,a,b,c),c)};h.Tb=function(a){return Kb(this.h,a)};h.gd=function(a){return Kb(this.h,Jc(this,a,2))};h.$b=function(a,b){Lb(this.h,a,b&65535)};h.Zd=function(a,b){Lb(this.h,Jc(this,a,4),b)};
function Lc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Kc(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 Mc(a,b,c,d){a.w&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Kc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Ic(a,e|c&65536,4),a.v=a.B>>14&3,Kb(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 Mc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Lc(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 Nc(a,b,c,d){a.w&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Lc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Jc(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.na[a.B>>12&3]=d}
function Nc(a,b){b>>=6;var c=a.D=b&7;(b=a.A=(b&56)>>3)?(c=a.J(b,c,3),a=Hb(a.h,c)):a=a.g[c]&255;return a}function Oc(a,b){b>>=6;var c=a.D=b&7;return(b=a.A=(b&56)>>3)?Jb(a.h,a.J(b,c,2)):a.g[c]}function Pc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Kc(a,b,c,8)}function Qc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=Hb(a.h,c)):a=a.g[c]&255;return a}function Rc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Jb(a.h,a.J(b,c,2)):a.g[c]} function Oc(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 Pc(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 Qc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Lc(a,b,c,8)}function Rc(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 Sc(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.tb=a.J(b,e,7),Jc(a,e,d.call(a,c,Hb(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),Kb(a.h,e,d.call(a,c,Jb(a.h,e)))):a.g[e]=d.call(a,c,a.g[e])}function Sc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Jc(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 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),Kc(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 Tc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Kc(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 Tc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Kb(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} function Uc(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&&(Ac(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= 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&&(Bc(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(zc(this))}while(0<this.a);return this.l.complete?this.pa-this.a:void 0===this.l.complete?0:-1};Ha(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new uc(d);C(d,c)}});function Uc(a,b){var c=b+a;Cc(this,c,a,b);return c&65535}function Vc(a,b){var c=b+a;Cc(this,c<<8,a<<8,b<<8);return c&255}function Wc(a,b){a=b<<1;Dc(this,a);return a&65535} 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(Ac(this))}while(0<this.a);return this.j.complete?this.qa-this.a:void 0===this.j.complete?0:-1};Ha(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new vc(d);C(d,c)}});function Vc(a,b){var c=b+a;Dc(this,c,a,b);return c&65535}function Wc(a,b){var c=b+a;Dc(this,c<<8,a<<8,b<<8);return c&255}function Xc(a,b){a=b<<1;Ec(this,a);return a&65535}
function Xc(a,b){a=b<<1;Dc(this,a<<8);return a&255}function Yc(a,b){a=b&32768|b>>1|b<<16;Dc(this,a);return a&65535}function Zc(a,b){a=b&2048|b>>1|b<<8;Dc(this,a<<8);return a&255}function $c(a,b){a=b&~a;S(this,a);return a}function ad(a,b){a=b&~a;S(this,a<<8);return a}function bd(a,b){a|=b;S(this,a);return a}function cd(a,b){a|=b;S(this,a<<8);return a}function dd(a,b){a=~b|65536;Bc(this,a);return a&65535}function ed(a,b){a=~b|256;Bc(this,a<<8);return a&255} function Yc(a,b){a=b<<1;Ec(this,a<<8);return a&255}function Zc(a,b){a=b&32768|b>>1|b<<16;Ec(this,a);return a&65535}function $c(a,b){a=b&2048|b>>1|b<<8;Ec(this,a<<8);return a&255}function ad(a,b){a=b&~a;S(this,a);return a}function bd(a,b){a=b&~a;S(this,a<<8);return a}function cd(a,b){a|=b;S(this,a);return a}function dd(a,b){a|=b;S(this,a<<8);return a}function ed(a,b){a=~b|65536;Cc(this,a);return a&65535}function fd(a,b){a=~b|256;Cc(this,a<<8);return a&255}
function fd(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function gd(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 hd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function id(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 jd(a,b){a=-b;Bc(this,a,a&b&32768);return a&65535}function kd(a,b){a=-b;Bc(this,a<<8,(a&b&128)<<8);return a&255} function gd(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function hd(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 id(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function jd(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 kd(a,b){a=-b;Cc(this,a,a&b&32768);return a&65535}function ld(a,b){a=-b;Cc(this,a<<8,(a&b&128)<<8);return a&255}
function ld(a,b){a=b<<1|this.m>>16&1;Dc(this,a);return a&65535}function md(a,b){a=b<<1|this.m>>16&1;Dc(this,a<<8);return a&255}function nd(a,b){a=(this.m&65536|b)>>1|b<<16;Dc(this,a);return a&65535}function od(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Dc(this,a<<8);return a&255}function pd(a,b){var c=b-a;Ec(this,c,a,b);return c&65535}function qd(a,b){var c=b-a;Ec(this,c<<8,a<<8,b<<8);return c&255}function rd(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535} function md(a,b){a=b<<1|this.m>>16&1;Ec(this,a);return a&65535}function nd(a,b){a=b<<1|this.m>>16&1;Ec(this,a<<8);return a&255}function od(a,b){a=(this.m&65536|b)>>1|b<<16;Ec(this,a);return a&65535}function pd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Ec(this,a<<8);return a&255}function qd(a,b){var c=b-a;Fc(this,c,a,b);return c&65535}function rd(a,b){var c=b-a;Fc(this,c<<8,a<<8,b<<8);return c&255}function sd(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535}
function sd(a,b){a^=b;S(this,a);return a&65535}function td(a){U(this,a,Oc(this,a),Uc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function ud(a){var b=Rc(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.f=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} function td(a,b){a^=b;S(this,a);return a&65535}function ud(a){U(this,a,Pc(this,a),Vc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function vd(a){var b=Sc(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.f=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
function vd(a){var b=Rc(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.f=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function wd(a){V(this,a,!R(this))}function xd(a){V(this,a,R(this))} function wd(a){var b=Sc(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.f=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function xd(a){V(this,a,!R(this))}function yd(a){V(this,a,R(this))}
function yd(a){U(this,a,Oc(this,a),$c);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function zd(a){T(this,a,Nc(this,a),ad);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Ad(a){U(this,a,Oc(this,a),bd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Bd(a){T(this,a,Nc(this,a),cd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} function zd(a){U(this,a,Pc(this,a),ad);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Ad(a){T(this,a,Oc(this,a),bd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Bd(a){U(this,a,Pc(this,a),cd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Cd(a){T(this,a,Oc(this,a),dd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
function Cd(a){S(this,Oc(this,a)&Rc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Dd(a){S(this,(Nc(this,a)&Qc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Ed(a){V(this,a,this.i&65535?0:4)}function Fd(a){V(this,a,!this.za()==!(this.f&32768))}function Gd(a){V(this,a,!!(this.i&65535)&&!this.za()==!(this.f&32768))}function Hd(a){V(this,a,!R(this)&&!!(this.i&65535))} function Dd(a){S(this,Pc(this,a)&Sc(this,a));this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Ed(a){S(this,(Oc(this,a)&Rc(this,a))<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Fd(a){V(this,a,this.i&65535?0:4)}function Gd(a){V(this,a,!this.za()==!(this.f&32768))}function Hd(a){V(this,a,!!(this.i&65535)&&!this.za()==!(this.f&32768))}function Id(a){V(this,a,!R(this)&&!!(this.i&65535))}
function Id(a){V(this,a,(this.i&65535?0:4)||!this.za()!=!(this.f&32768))}function Jd(a){V(this,a,R(this)||(this.i&65535?0:4))}function Kd(a){V(this,a,!this.za()!=!(this.f&32768))}function Ld(a){V(this,a,this.za())}function Md(a){V(this,a,!!(this.i&65535))}function Nd(a){V(this,a,!this.za())}function Od(){K(this,12,1);this.a-=5}function Pd(a){V(this,a,!0)}function Qd(a){V(this,a,!(this.f&32768))}function Rd(a){V(this,a,this.f&32768?2:0)} function Jd(a){V(this,a,(this.i&65535?0:4)||!this.za()!=!(this.f&32768))}function Kd(a){V(this,a,R(this)||(this.i&65535?0:4))}function Ld(a){V(this,a,!this.za()!=!(this.f&32768))}function Md(a){V(this,a,this.za())}function Nd(a){V(this,a,!!(this.i&65535))}function Od(a){V(this,a,!this.za())}function Pd(){K(this,12,1);this.a-=5}function Qd(a){V(this,a,!0)}function Rd(a){V(this,a,!(this.f&32768))}function Sd(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 Sd(a){var b=Oc(this,a);a=Rc(this,a);Ec(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Td(a){var b=Nc(this,a)<<8;a=Qc(this,a)<<8;Ec(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?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 Td(a){var b=Pc(this,a);a=Sc(this,a);Fc(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 Ud(a){var b=Oc(this,a)<<8;a=Rc(this,a)<<8;Fc(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 Ud(a){var b=Rc(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 Vd(){K(this,24,2);this.a-=25} function Vd(a){var b=Sc(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 Wd(){K(this,24,2);this.a-=25}
function Wd(){this.B&49152?(this.M|=128,K(this,4,3)):this.C?this.C.b():G(this);this.a-=7}function Xd(){K(this,16,4);this.a-=25}var Yd=[0,7,7,10,7,11,9,13];function Zd(a){this.G=this.a;P(this,Pc(this,a));this.a=this.G-Yd[this.c]}var $d=[0,14,14,17,14,18,16,20];function ae(a){this.G=this.a;var b=Pc(this,a);a=a>>6&7;Fc(this,this.g[a]);this.g[a]=this.g[7];P(this,b);this.a=this.G-$d[this.c]}var be=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function Xd(){this.B&49152?(this.M|=128,K(this,4,3)):this.D?this.D.b():G(this);this.a-=7}function Yd(){K(this,16,4);this.a-=25}var Zd=[0,7,7,10,7,11,9,13];function $d(a){this.G=this.a;P(this,Qc(this,a));this.a=this.G-Zd[this.c]}var ae=[0,14,14,17,14,18,16,20];function be(a){this.G=this.a;var b=Qc(this,a);a=a>>6&7;Gc(this,this.g[a]);this.g[a]=this.g[7];P(this,b);this.a=this.G-ae[this.c]}var ce=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function ce(a){var b=Oc(this,a);this.G=this.a;S(this,Tc(this,a,b));this.a=this.G-be[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function de(a){var b=Nc(this,a);S(this,Sc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var ee=[7,13,13,17,14,18,17,21]; function de(a){var b=Pc(this,a);this.G=this.a;S(this,Uc(this,a,b));this.a=this.G-ce[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ee(a){var b=Oc(this,a);S(this,Tc(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 fe=[7,13,13,17,14,18,17,21];
function fe(a){var b=Rc(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<b?65536:0);this.a-=23}function ge(){this.a-=5}function he(){this.B&49152||(this.h.reset(),ib(this));this.a-=667}function ie(){Gc(this);this.u|=this.B&16;this.a-=13} function ge(a){var b=Sc(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<b?65536:0);this.a-=23}function he(){this.a-=5}function ie(){this.B&49152||(this.h.reset(),jb(this));this.a-=667}function je(){Hc(this);this.u|=this.B&16;this.a-=13}
function je(a){if(a&8)K(this,8,6);else{var b=Hc(this);a&=7;7==a?P(this,b):(P(this,this.g[a]),this.g[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.f=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function ke(a){var b=(a&448)>>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 le(a){U(this,a,Oc(this,a),pd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} function ke(a){if(a&8)K(this,8,6);else{var b=Ic(this);a&=7;7==a?P(this,b):(P(this,this.g[a]),this.g[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.f=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function le(a){var b=(a&448)>>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 me(a){U(this,a,Pc(this,a),qd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
function me(a){U(this,a,0,rd);this.a-=this.c?9:3+(7==this.b?2:0)}function ne(){K(this,28,5);this.a-=5}function oe(){this.u&4||this.j&&this.j.ka();this.u|=4;Ac(this,-2);this.a-=3}function pe(a){U(this,a,Oc(this,a),sd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,6)}function vc(a){qe[a>>12].call(this,a)}function re(a){se[a>>6&3].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&15].call(this,a)} function ne(a){U(this,a,0,sd);this.a-=this.c?9:3+(7==this.b?2:0)}function oe(){K(this,28,5);this.a-=5}function pe(){this.u&4||this.l&&this.l.da();this.u|=4;Bc(this,-2);this.a-=3}function qe(a){U(this,a,Pc(this,a),td);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,6)}function wc(a){re[a>>12].call(this,a)}function se(a){te[a>>6&3].call(this,a)}function ue(a){ve[a>>6&3].call(this,a)}function we(a){xe[a>>6&3].call(this,a)}function ye(a){ze[a&15].call(this,a)}
function ze(a){Ae[a&15].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)} function Ae(a){Be[a&15].call(this,a)}function Ce(a){De[a>>6&3].call(this,a)}function Ee(a){Fe[a>>6&3].call(this,a)}function Ge(a){He[a>>6&3].call(this,a)}
var qe=[function(a){He[a>>8&15].call(this,a)},ce,Sd,Cd,yd,Ad,td,Y,function(a){Ie[a>>8&15].call(this,a)},de,Td,Dd,zd,Bd,le,Y],He=[function(a){Je[a>>4&15].call(this,a)},Pd,Md,Ed,Fd,Kd,Gd,Id,ae,ae,re,te,ve,Y,Y,Y],se=[function(a){Bc(this,Tc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,dd);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)},function(a){U(this,a,1,fd);this.a-=this.c?9:3+(7==this.b?2:0)}],ue=[function(a){U(this,a,0, var re=[function(a){Ie[a>>8&15].call(this,a)},de,Td,Dd,zd,Bd,ud,Y,function(a){Je[a>>8&15].call(this,a)},ee,Ud,Ed,Ad,Cd,me,Y],Ie=[function(a){Ke[a>>4&15].call(this,a)},Qd,Nd,Fd,Gd,Ld,Hd,Jd,be,be,se,ue,we,Y,Y,Y],te=[function(a){Cc(this,Uc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,id);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,gd);this.a-=this.c?9:3+(7==this.b?2:0)}],ve=[function(a){U(this,a,0,
jd);this.a-=this.c?11:6},function(a){U(this,a,R(this)?1:0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,R(this)?1:0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Rc(this,a);Bc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],we=[function(a){U(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ld);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)},function(a){U(this,a,0,Wc);this.a-=this.c?9:3+(7==this.b?2:0)}], kd);this.a-=this.c?11:6},function(a){U(this,a,R(this)?1:0,Vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,R(this)?1:0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Sc(this,a);Cc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],xe=[function(a){U(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,md);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Xc);this.a-=this.c?9:3+(7==this.b?2:0)}],
Je=[function(a){Ke[a&15].call(this,a)},Y,Y,Y,Zd,Zd,Zd,Zd,je,Y,xe,ze,me,me,me,me],Ke=[Wd,oe,ie,Od,Xd,he,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],ye=[ge,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],Ae=[ge,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],Ie=[Nd,Ld,Hd,Jd,Qd,Rd,wd,xd,Vd,ne,Be,De,Fe,Y,Y,Y],Ce=[function(a){Bc(this, Ke=[function(a){Le[a&15].call(this,a)},Y,Y,Y,$d,$d,$d,$d,ke,Y,ye,Ae,ne,ne,ne,ne],Le=[Xd,pe,je,Pd,Yd,ie,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],ze=[he,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],Be=[he,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],Je=[Od,Md,Id,Kd,Rd,Sd,xd,yd,Wd,oe,Ce,Ee,Ge,Y,Y,Y],De=[function(a){Cc(this,
Sc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ed);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)},function(a){T(this,a,1,gd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ee=[function(a){T(this,a,0,kd);this.a-=this.c?11:6},function(a){T(this,a,R(this)?1:0,Vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,R(this)?1:0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Qc(this,a);Bc(this,a<<8);this.a-=this.c?4:3+(7==this.b? Tc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,hd);this.a-=this.c?9:3+(7==this.b?2:0)}],Fe=[function(a){T(this,a,0,ld);this.a-=this.c?11:6},function(a){T(this,a,R(this)?1:0,Wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,R(this)?1:0,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Rc(this,a);Cc(this,a<<8);this.a-=this.c?4:3+(7==this.b?
2:0)}],Ge=[function(a){T(this,a,0,od);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,md);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Zc);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Xc);this.a-=this.c?9:3+(7==this.b?2:0)}];function wc(a){Le[a>>12].call(this,a)} 2:0)}],He=[function(a){T(this,a,0,pd);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,$c);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Yc);this.a-=this.c?9:3+(7==this.b?2:0)}];function xc(a){Me[a>>12].call(this,a)}
var Le=[function(a){Me[a>>8&15].call(this,a)},ce,Sd,Cd,yd,Ad,td,function(a){Ne[a>>8&15].call(this,a)},function(a){Oe[a>>8&15].call(this,a)},de,Td,Dd,zd,Bd,le,Y],Me=[function(a){Pe[a>>4&15].call(this,a)},Pd,Md,Ed,Fd,Kd,Gd,Id,ae,ae,re,te,ve,function(a){Qe[a>>6&3].call(this,a)},Y,Y],Qe=[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=Lc(this,a,0);Fc(this,a);S(this,a);this.a-=11},function(a){var b=Hc(this);this.G= var Me=[function(a){Ne[a>>8&15].call(this,a)},de,Td,Dd,zd,Bd,ud,function(a){Oe[a>>8&15].call(this,a)},function(a){Pe[a>>8&15].call(this,a)},ee,Ud,Ed,Ad,Cd,me,Y],Ne=[function(a){Qe[a>>4&15].call(this,a)},Qd,Nd,Fd,Gd,Ld,Hd,Jd,be,be,se,ue,we,function(a){Re[a>>6&3].call(this,a)},Y,Y],Re=[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=Mc(this,a,0);Gc(this,a);S(this,a);this.a-=11},function(a){var b=Ic(this);this.G=
this.a;Mc(this,a,0,b);S(this,b);this.a=this.G-ee[this.c]},function(a){S(this,Tc(this,a,this.za?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Pe=[function(a){Re[a&15].call(this,a)},Y,Y,Y,Zd,Zd,Zd,Zd,je,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)},xe,ze,me,me,me,me],Re=[Wd,oe,ie,Od,Xd,he,function(){Gc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Ne=[fe,fe,Ud,Ud,ud,ud,vd,vd,pe,pe,Y,Y,Y,Y,ke,ke],Oe=[Nd,Ld,Hd,Jd,Qd,Rd,wd,xd,Vd,ne,Be,De,Fe,function(a){Se[a>>6& this.a;Nc(this,a,0,b);S(this,b);this.a=this.G-fe[this.c]},function(a){S(this,Uc(this,a,this.za?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Qe=[function(a){Se[a&15].call(this,a)},Y,Y,Y,$d,$d,$d,$d,ke,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)},ye,Ae,ne,ne,ne,ne],Se=[Xd,pe,je,Pd,Yd,ie,function(){Hc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Oe=[ge,ge,Vd,Vd,vd,vd,wd,wd,qe,qe,Y,Y,Y,Y,le,le],Pe=[Od,Md,Id,Kd,Rd,Sd,xd,yd,Wd,oe,Ce,Ee,Ge,function(a){Te[a>>6&
3].call(this,a)},Y,Y],Se=[Y,function(a){a=Lc(this,a,65536);Fc(this,a);S(this,a);this.a-=11},function(a){var b=Hc(this);this.G=this.a;Mc(this,a,65536,b);S(this,b);this.a=this.G-ee[this.c]},Y]; 3].call(this,a)},Y,Y],Te=[Y,function(a){a=Mc(this,a,65536);Gc(this,a);S(this,a);this.a-=11},function(a){var b=Ic(this);this.G=this.a;Nc(this,a,65536,b);S(this,b);this.a=this.G-fe[this.c]},Y];
function Te(a){x.call(this,"ROM",a,Te);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.F("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);Ue(c)})}}z(Te);Te.prototype.ha=function(a,b,c,d){this.h=b;this.a=c;this.C=d;Ue(this)}; function Ue(a){x.call(this,"ROM",a,Ue);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);Ve(c)})}}z(Ue);Ue.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;Ve(this)};
Te.prototype.ja=function(){this.X&&(this.C&&this.C.a(this.id,this.i,this.c,this.X),delete this.X);return!0};Te.prototype.ia=function(){return!0}; Ue.prototype.la=function(){this.X&&(this.D&&this.D.a(this.id,this.i,this.c,this.X),delete this.X);return!0};Ue.prototype.ka=function(){return!0};
function Ue(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(Db(a.h,b,a.c,ac)){var c;for(c=0;c<a.b.length;c++)a.h.Xa(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Cb(d.h,d.i,d.c);Bb(d.h,e,d.c,f)}delete a.b}}}F(a)}} function Ve(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(Eb(a.h,b,a.c,bc)){var c;for(c=0;c<a.b.length;c++)a.h.Xa(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Db(d.h,d.i,d.c);Cb(d.h,e,d.c,f)}delete a.b}}}F(a)}}
Ha(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Te(d);C(d,c)}}); Ha(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ue(d);C(d,c)}});
function Ve(a){x.call(this,"RAM",a,Ve);this.X=this.c=null;this.j=a.addr;this.i=a.size;this.fa=a.load;this.ea=a.exec;this.f=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.F("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Sa(c.na,a,b),(a=ta(a,b))?(c.c=a.K,c.X=a.X,null==c.fa&&(c.fa=a.fa),null==c.ea&&(c.ea=a.ea)):c.b=null);We(c)})}}z(Ve); function We(a){x.call(this,"RAM",a,We);this.X=this.c=null;this.l=a.addr;this.i=a.size;this.ga=a.load;this.fa=a.exec;this.f=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.F("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Sa(c.oa,a,b),(a=ta(a,b))?(c.c=a.K,c.X=a.X,null==c.ga&&(c.ga=a.ga),null==c.fa&&(c.fa=a.fa)):c.b=null);Xe(c)})}}z(We);
Ve.prototype.ha=function(a,b,c,d){this.h=b;this.a=c;this.C=d;We(this)};Ve.prototype.ja=function(){this.X&&(this.C&&this.C.a(this.id,this.j,this.i,this.X),delete this.X);return!0};Ve.prototype.ia=function(){return!0};function We(a){if(a.h&&(!a.f&&a.i&&Db(a.h,a.j,a.i,1)&&(a.f=!0),!Wa(a))){if(!a.f)u("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;Xe(a,a.c,a.fa,a.ea,a.j)}F(a)}} We.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;Xe(this)};We.prototype.la=function(){this.X&&(this.D&&this.D.a(this.id,this.l,this.i,this.X),delete this.X);return!0};We.prototype.ka=function(){return!0};function Xe(a){if(a.h&&(!a.f&&a.i&&Eb(a.h,a.l,a.i,1)&&(a.f=!0),!Wa(a))){if(!a.f)u("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;Ye(a,a.c,a.ga,a.fa,a.l)}F(a)}}
Ve.prototype.reset=function(){if(this.f){for(var a=this.h,b=this.j,c=this.i,d=b&a.j,b=b>>>a.c;0<c&&b<a.h.length;){var e=a.h[b],f=c,g,d=d||0;void 0===f&&(f=e.size);if(Ya)for(g=d;f--&&g<e.o.length;g++)e.o[g]=0;else for(g=d;f--&&g<e.size;g++)e.Eb(d,0,e.Ja+d);c-=a.b;b++;d=0}this.c&&Xe(this,this.c,this.fa,this.ea,this.j,!0)}}; We.prototype.reset=function(){if(this.f){for(var a=this.h,b=this.l,c=this.i,d=b&a.l,b=b>>>a.c;0<c&&b<a.h.length;){var e=a.h[b],f=c,g,d=d||0;void 0===f&&(f=e.size);if(Ya)for(g=d;f--&&g<e.o.length;g++)e.o[g]=0;else for(g=d;f--&&g<e.size;g++)e.Eb(d,0,e.Ja+d);c-=a.b;b++;d=0}this.c&&Ye(this,this.c,this.ga,this.fa,this.l,!0)}};
function Xe(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=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<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=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):yc(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.a.Xa(c+ function Ye(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=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<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=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):zc(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.a.Xa(c+
e,b[e]);null!=d&&yc(a.a,d,f);g=!0}return g}Ha(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ve(d);C(d,c)}});function Ye(a){x.call(this,"Keyboard",a,Ye);F(this)}z(Ye);Ye.prototype.$=function(){return!1};Ye.prototype.ha=function(a,b,c,d){this.j=a;this.a=c;this.C=d};Ha(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ye(d);C(d,c)}}); e,b[e]);null!=d&&zc(a.a,d,f);g=!0}return g}Ha(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new We(d);C(d,c)}});function Ze(a){x.call(this,"Keyboard",a,Ze);F(this)}z(Ze);Ze.prototype.$=function(){return!1};Ze.prototype.ia=function(a,b,c,d){this.l=a;this.a=c;this.D=d};Ha(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ze(d);C(d,c)}});
function Z(a){this.D=a.baudReceive||9600;this.I=a.baudTransmit||9600;this.R=a.upperCase;this.f=this.m=null;this.J=a.tabSize;this.G=a.charBOL;this.s=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=Ze;b&&(void 0===c&&(c="Panel"),(c=Ua(c,this.id))&&(b=c.o[b])&&this.$(null,a,b))}this.v=this.A=null;this.exports={connect:this.Kb,receiveData:this.yb}}z(Z);var Ze="buffer";h=Z.prototype; function Z(a){this.C=a.baudReceive||9600;this.I=a.baudTransmit||9600;this.R=a.upperCase;this.f=this.m=null;this.J=a.tabSize;this.G=a.charBOL;this.s=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=$e;b&&(void 0===c&&(c="Panel"),(c=Ua(c,this.id))&&(b=c.o[b])&&this.$(null,a,b))}this.v=this.A=null;this.exports={connect:this.Kb,receiveData:this.yb}}z(Z);var $e="buffer";h=Z.prototype;
h.$=function(a,b,c){var d=this;switch(b){case Ze:return this.o[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.yb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.yb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1}; h.$=function(a,b,c){var d=this;switch(b){case $e:return this.o[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.yb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.yb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.C=d;var e=this;this.aa=Rb(48,4);this.N=Ob(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.R&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Pb(e.a,e.aa))});this.da=Rb(52,4);this.P=Ob(this.a,function(){e.c|=128;e.c&64&&Pb(e.a,e.da)});bb(b,this,$e);F(this)}; h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;var e=this;this.aa=Sb(48,4);this.N=Pb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.R&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Qb(e.a,e.aa))});this.ea=Sb(52,4);this.P=Pb(this.a,function(){e.c|=128;e.c&64&&Qb(e.a,e.ea)});cb(b,this,af);F(this)};
h.Kb=function(){if(!this.v){var a=mc(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.ja=function(a,b){if(!b)if(this.Kb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; h.Kb=function(){if(!this.v){var a=nc(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.ia=function(a){return a?this.save():!0};h.reset=function(){af(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return af(this)};function af(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<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Qb(this.a,this.N,1E3/Math.round(this.D/10));return!0};h.Qc=function(){return this.b&65534}; h.ka=function(a){return a?this.save():!0};h.reset=function(){bf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return bf(this)};function bf(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<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Rb(this.a,this.N,1E3/Math.round(this.C/10));return!0};h.Qc=function(){return this.b&65534};
h.Id=function(a){this.b=this.b&-112|a&111};h.Pc=function(){this.b&=-129;0<this.i.length&&Qb(this.a,this.N,1E3/Math.round(this.D/10));return this.w};h.Hd=function(){};h.jd=function(){return this.c};h.ae=function(a){128==(this.c&192)&&a&64&&Qb(this.a,this.P,1E3/Math.round(this.I/10));this.c=this.c&-70|a&69};h.hd=function(){return 0}; h.Id=function(a){this.b=this.b&-112|a&111};h.Pc=function(){this.b&=-129;0<this.i.length&&Rb(this.a,this.N,1E3/Math.round(this.C/10));return this.w};h.Hd=function(){};h.jd=function(){return this.c};h.ae=function(a){128==(this.c&192)&&a&64&&Rb(this.a,this.P,1E3/Math.round(this.I/10));this.c=this.c&-70|a&69};h.hd=function(){return 0};
h.$d=function(a){if(a&=255){this.A&&this.A.call(this.v,a);if(this.f)if(13==a)this.s=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+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), h.$d=function(a){if(a&=255){this.A&&this.A.call(this.v,a);if(this.f)if(13==a)this.s=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+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;Qb(this.a,this.P,1E3/Math.round(this.I/10))}};var bf={},$e=(bf[65392]=[null,null,Z.prototype.Qc,Z.prototype.Id,"RCSR"],bf[65394]=[null,null,Z.prototype.Pc,Z.prototype.Hd,"RBUF"],bf[65396]=[null,null,Z.prototype.jd,Z.prototype.ae,"XCSR"],bf[65398]=[null,null,Z.prototype.hd,Z.prototype.$d,"XBUF"],bf);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Z(d);C(d,c)}}); this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Rb(this.a,this.P,1E3/Math.round(this.I/10))}};var cf={},af=(cf[65392]=[null,null,Z.prototype.Qc,Z.prototype.Id,"RCSR"],cf[65394]=[null,null,Z.prototype.Pc,Z.prototype.Hd,"RBUF"],cf[65396]=[null,null,Z.prototype.jd,Z.prototype.ae,"XCSR"],cf[65398]=[null,null,Z.prototype.hd,Z.prototype.$d,"XBUF"],cf);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Z(d);C(d,c)}});
function Vb(a){x.call(this,"PC11",a,Vb);this.c=a.autoMount||null;this.m=0;this.P=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=cf;this.f=df;this.D=this.i="";this.K=this.fa=this.ea=null;this.I=-1;this.G=!Ba("Mobi")&&window&&"FileReader"in window}z(Vb);var cf="",df=0;h=Vb.prototype; function Wb(a){x.call(this,"PC11",a,Wb);this.c=a.autoMount||null;this.m=0;this.P=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=df;this.f=ef;this.C=this.i="";this.K=this.ga=this.fa=null;this.I=-1;this.G=!Ba("Mobi")&&window&&"FileReader"in window}z(Wb);var df="",ef=0;h=Wb.prototype;
h.$=function(a,b,c){var d=this,e=df;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){u("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");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= h.$=function(a,b,c){var d=this,e=ef;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){u("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");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&&ef(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;ef(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; d.o.listTapes;a&&ff(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;ff(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.C=d;this.J=ff(a);var e=this;if((this.c=mc(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=Rb(56,4);this.R=Ob(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,gf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Pb(e.a,e.N))});bb(b,this,hf);jf(this,"None",cf,!0);this.G&&jf(this,"Local Tape","?"); h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;this.J=gf(a);var e=this;if((this.c=nc(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=Sb(56,4);this.R=Pb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,hf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Qb(e.a,e.N))});cb(b,this,jf);kf(this,"None",df,!0);this.G&&kf(this,"Local Tape","?");
jf(this,"Remote Tape","??");kf(this)||F(this)};h.ja=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function kf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?lf(a,c,b,1,!0):mf(a)}return!!a.m} kf(this,"Remote Tape","??");lf(this)||F(this)};h.la=function(a,b){if(!b)if(!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(){this.b&=-2241;this.A=0};function lf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?mf(a,c,b,1,!0):nf(a)}return!!a.m}
function ef(a,b,c,d,e){if(c)if("?"==c)a.F('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;lf(a,b,c,d,!1,e)}else nf(a,!1)}function lf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,nf(a,!0),a.l.Fa?a.F("PC11 busy"):(e&&a.m++,of(a,b,c,d,f)?g++:a.l.Fa=!0);g&&pf(a,a.D,a.i,a.f,a.K,a.fa,a.ea)} function ff(a,b,c,d,e){if(c)if("?"==c)a.F('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;mf(a,b,c,d,!1,e)}else of(a,!1)}function mf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,of(a,!0),a.j.Fa?a.F("PC11 busy"):(e&&a.m++,pf(a,b,c,d,f)?g++:a.j.Fa=!0);g&&qf(a,a.C,a.i,a.f,a.K,a.ga,a.fa)}
function of(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),pf(a,b,c,d,e),a.s="?");mf(a)};g.readAsArrayBuffer(e);return!0}0>c.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.F('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Sa(a.na,e,f),(e=ta(e,f))&&pf(a,b,c,d,e.K,e.fa,e.ea)); function pf(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),qf(a,b,c,d,e),a.s="?");nf(a)};g.readAsArrayBuffer(e);return!0}0>c.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))&&qf(a,b,c,d,e.K,e.ga,e.fa));
a.l.Fa=!1;a.m&&(a.m--,a.m||F(a));mf(a)})}function jf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function mf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}} a.j.Fa=!1;a.m&&(a.m--,a.m||F(a));nf(a)})}function kf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function nf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
function gf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function pf(a,b,c,d,e,f,g){a.D=b;a.i=c;a.f=d;a.K=e;a.fa=f;a.ea=g;2==d?a.J&&Xe(a.J,e,f,g)?a.status("tape loaded: "+b):(a.D="",a.i="",a.s=cf,a.f=df,a.F("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),gf(a,0))} function hf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function qf(a,b,c,d,e,f,g){a.C=b;a.i=c;a.f=d;a.K=e;a.ga=f;a.fa=g;2==d?a.J&&Ye(a.J,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=df,a.f=ef,a.F("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),hf(a,0))}
function nf(a,b){if(a.i||!1===b)a.D="",a.i="",b||(a.f&&a.status(1==a.f?"tape detached":"tape unloaded"),a.s=cf,a.f=df,mf(a))}h.save=function(){return(new Q(this)).data()};h.restore=function(){return!0};h.Jc=function(){return this.b&65534};h.Bd=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Pb(this.a,this.N)):(this.b&=-129,this.b|=2048,this.A=0,Qb(this.a,this.R,1E3/Math.round(this.P/10))));this.b=this.b&-66|a&65};h.Ic=function(){this.b&=-129;this.b|=2048;return this.A};h.Ad=function(){}; function of(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.f&&a.status(1==a.f?"tape detached":"tape unloaded"),a.s=df,a.f=ef,nf(a))}h.save=function(){return(new Q(this)).data()};h.restore=function(){return!0};h.Jc=function(){return this.b&65534};h.Bd=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Qb(this.a,this.N)):(this.b&=-129,this.b|=2048,this.A=0,Rb(this.a,this.R,1E3/Math.round(this.P/10))));this.b=this.b&-66|a&65};h.Ic=function(){this.b&=-129;this.b|=2048;return this.A};h.Ad=function(){};
var qf={},hf=(qf[65384]=[null,null,Vb.prototype.Jc,Vb.prototype.Bd,"PRS"],qf[65386]=[null,null,Vb.prototype.Ic,Vb.prototype.Ad,"PRB"],qf);function rf(a,b,c){x.call(this,"Disk",{id:a.na+".disk"+m(++sf,4)},rf);this.controller=a;this.j=a.j;this.C=a.C;this.f=b;this.va=b.name;this.sb=b.sb;tf(this,c,b.V,b.Z,b.S,b.ga);F(this)}var sf=0;z(rf);h=rf.prototype;h.ha=function(a,b,c,d){this.C=d}; var rf={},jf=(rf[65384]=[null,null,Wb.prototype.Jc,Wb.prototype.Bd,"PRS"],rf[65386]=[null,null,Wb.prototype.Ic,Wb.prototype.Ad,"PRB"],rf);function sf(a,b,c){x.call(this,"Disk",{id:a.oa+".disk"+m(++tf,4)},sf);this.controller=a;this.l=a.l;this.D=a.D;this.f=b;this.va=b.name;this.sb=b.sb;uf(this,c,b.V,b.Z,b.S,b.ha);F(this)}var tf=0;z(sf);h=sf.prototype;h.ia=function(a,b,c,d){this.D=d};
function tf(a,b,c,d,e,f){a.mode=b;a.V=c;a.Z=d;a.S=e;a.ga=f;a.a=[];if("preload"!=a.mode){b=Array(a.V);for(c=0;c<b.length;c++){d=Array(a.Z);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=uf(null,c,e,g,a.ga,0);d[e]=f}b[c]=d}a.a=b}a.b=null} function uf(a,b,c,d,e,f){a.mode=b;a.V=c;a.Z=d;a.S=e;a.ha=f;a.a=[];if("preload"!=a.mode){b=Array(a.V);for(c=0;c<b.length;c++){d=Array(a.Z);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=vf(null,c,e,g,a.ha,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
function vf(a,b,c,d,e){var f=c;if(a.h)return!0;a.va=b;a.Ea=c;a.Wb=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.V=e[0];a.Z=e[1];a.S=e[2];a.ga=e[3]||512;c=a.ga>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Z),E=0;E<w.length;E++)for(var va=w[E]=Array(a.S),wa=0;wa<va.length;wa++){for(var Sb=uf(null,d,E,wa+1,a.ga,0),Xf=Sb.data,gc=0;gc<c;gc++,f+=4)var Yf=Xf[gc]=b.getInt32(f, function wf(a,b,c,d,e){var f=c;if(a.h)return!0;a.va=b;a.Ea=c;a.Wb=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.V=e[0];a.Z=e[1];a.S=e[2];a.ha=e[3]||512;c=a.ha>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Z),E=0;E<w.length;E++)for(var wa=w[E]=Array(a.S),xa=0;xa<wa.length;xa++){for(var Tb=vf(null,d,E,xa+1,a.ha,0),Yf=Tb.data,hc=0;hc<c;hc++,f+=4)var Zf=Yf[hc]=b.getInt32(f,
!0),e=e+Yf&-1;Sb.ba=c;va[wa]=Sb}a.b=e;c=a}else a.F("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.f,c,a.va,a.Ea),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.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, !0),e=e+Zf&-1;Tb.ba=c;wa[xa]=Tb}a.b=e;c=a}else a.F("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.f,c,a.va,a.Ea),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.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,
null,!0,function(b,c,d){wf(a,b,c,d)})} null,!0,function(b,c,d){xf(a,b,c,d)})}
function wf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.j&&!a.j.l.O;if(d)a.controller.F('Unable to load disk "'+a.va+'" (error '+d+": "+b+")",f);else{Sa(a.controller.na,b,c);try{if(0<q(a.Wb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.va]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ function xf(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(0<q(a.Wb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.va]:k=0>c.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<a.V;d++)for(f=0;f<a.Z;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>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,va=w.length;va<E;va++)w[va]=p;xf(l,w)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}uf(l,d,f);for(E= 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<a.V;d++)for(f=0;f<a.Z;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>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,wa=w.length;wa<E;wa++)w[wa]=p;yf(l,w)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}vf(l,d,f);for(E=
0;E<t.length;E++)c=c+t[E]&-1}a.a=k;a.b=c;e=a}else u("Empty disk image: "+a.va)}catch(wa){u("Disk image error ("+b+"): "+wa.message)}}a.h&&(a.h.call(a.i,a.f,e,a.va,a.Ea),a.h=null)}function uf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.de=b;a.ee=c;a.la=a.ba=0;a.ta=!1;return a} 0;E<t.length;E++)c=c+t[E]&-1}a.a=k;a.b=c;e=a}else u("Empty disk image: "+a.va)}catch(xa){u("Disk image error ("+b+"): "+xa.message)}}a.h&&(a.h.call(a.i,a.f,e,a.va,a.Ea),a.h=null)}function vf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.de=b;a.ee=c;a.ma=a.ba=0;a.ua=!1;return a}
h.seek=function(a,b,c,d,e){d=null;var f=this.f,g=this.a[a];if(g){var k=g[b];if(!k&&f.bc&&b<f.Z)for(k=g[b]=Array(f.cc),g=0;g<k.length;g++)k[g]=uf(null,a,b,g+1,f.Pb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.bc&&9==f.Fb&&(d=k[g]=uf(null,a,b,f.Fb,f.Pb,0))}}e&&e(d,!1);return d};function xf(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e} h.seek=function(a,b,c,d,e){d=null;var f=this.f,g=this.a[a];if(g){var k=g[b];if(!k&&f.bc&&b<f.Z)for(k=g[b]=Array(f.cc),g=0;g<k.length;g++)k[g]=vf(null,a,b,g+1,f.Pb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.bc&&9==f.Fb&&(d=k[g]=vf(null,a,b,f.Fb,f.Pb,0))}}e&&e(d,!1);return d};function yf(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=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.la-f,a.la=f):f>=a.la+a.ba&&(a.ba+=f-(a.la+a.ba)+1):(a.la=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null}; h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=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.ma-f,a.ma=f):f>=a.ma+a.ba&&(a.ba+=f-(a.ma+a.ba)+1):(a.ma=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function yf(a,b){var c=a.Z*a.S,d=b/c|0;return d<a.V?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function zf(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Ea,this.b,this.V,this.Z,this.S,this.ga];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var k=[],l=0,n=g.la,p=g.la+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.la,k]}}return b}; function zf(a,b){var c=a.Z*a.S,d=b/c|0;return d<a.V?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function Af(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Ea,this.b,this.V,this.Z,this.S,this.ha];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var k=[],l=0,n=g.ma,p=g.ma+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.ma,k]}}return b};
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?tf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?uf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=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;l<e;)k.data[l++]=k.pattern;l=0;k.la=e;for(k.ba=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-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;l<e;)k.data[l++]=k.pattern;l=0;k.ma=e;for(k.ba=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.F("Unable to restore disk '"+this.va+": "+c);return b};
h.toJSON=function(){var a;a=0;for(var b;b=yf(this,a++);)Af(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")}; h.toJSON=function(){var a;a=0;for(var b;b=zf(this,a++);)Bf(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 Af(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; function Bf(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='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Bf(d,a)},!0;case "loadDrive":return this.o[b]= 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='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Cf(d,a)},!0;case "loadDrive":return this.o[b]=
c,c.onclick=function(){var a=d.o.listDisks;a&&Cf(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=yf(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(zf(a,k,l));b=btoa(b);a=a.Wb.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!= c,c.onclick=function(){var a=d.o.listDisks;a&&Df(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=zf(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(Af(a,k,l));b=btoa(b);a=a.Wb.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");u(a)}else d.F("No disk loaded in drive.");else d.F("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}), typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");u(a)}else d.F("No disk loaded in drive.");else d.F("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return 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;Cf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Df(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.C=d;if((this.f=mc(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}Df(this);this.G=Rb(112,5);bb(b,this,Ef,2097152);Ff(this,"None","",!0);this.A&&Ff(this,"Local Disk","?");Ff(this,"Remote Disk","??");Gf(this)||F(this)}; h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;if((this.f=nc(this.l,"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}Ef(this);this.G=Sb(112,5);cb(b,this,Ff,2097152);Gf(this,"None","",!0);this.A&&Gf(this,"Local Disk","?");Gf(this,"Remote Disk","??");Hf(this)||F(this)};
h.ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.j.Hb){for(a=0;a<this.b.length;a++)Hf(this,a,!0);Gf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Bf(this,0)}}return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){Df(this)};h.save=function(){return(new Q(this)).data()}; h.la=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Hb){for(a=0;a<this.b.length;a++)If(this,a,!0);Hf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Cf(this,0)}}return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){Ef(this)};h.save=function(){return(new Q(this)).data()};
h.restore=function(a){return Df(this,a[0])};function Gf(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;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!If(a,g,f,e,!0)&&b&&F(a,!1);continue}a.F("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s} h.restore=function(a){return Ef(this,a[0])};function Hf(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;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Jf(a,g,f,e,!0)&&b&&F(a,!1);continue}a.F("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s}
function Cf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||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+'"')}If(a,e,b,c,!1,d)}else Hf(a,e)} function Df(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||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+'"')}Jf(a,e,b,c,!1,d)}else If(a,e)}
function If(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ea.toLowerCase()!=d.toLowerCase()&&(g++,Hf(a,b,!0),k.rb?a.F("RL11 busy"):(k.rb=!0,e&&(k.qb=!0,a.s++),k.ib=!!f,vf(new rf(a,k,"preload"),c,d,f,a.dc)&&g++));return g} function Jf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ea.toLowerCase()!=d.toLowerCase()&&(g++,If(a,b,!0),k.rb?a.F("RL11 busy"):(k.rb=!0,e&&(k.qb=!0,a.s++),k.ib=!!f,wf(new sf(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.j&&sc(this.j)):a.ib=!1;a.qb&&(a.qb=!1,--this.s||F(this));Bf(this,a.wb)}; 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&&tc(this.l)):a.ib=!1;a.qb&&(a.qb=!1,--this.s||F(this));Cf(this,a.wb)};
function Ff(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} function Gf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Bf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.ib?"?":c.Ea,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Hf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.va="",d.Ea="",d.ca=null,d.ib=!1,c||(a.F("Drive RL"+b+" unloaded",c),Bf(a,b))} function Cf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.ib?"?":c.Ea,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function If(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.va="",d.Ea="",d.ca=null,d.ib=!1,c||(a.F("Drive RL"+b+" unloaded",c),Cf(a,b))}
function Df(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.wb=b;d.rb=d.ib=!1;d.name=c.Pa;d.V=512;d.Z=2;d.S=40;d.ga=256;d.sb=!0;d.ce=0;d.be=0;d.Fb=1;d.cc=d.S;d.Pb=d.ga;d.fe=0;d.ge=null;d.ca||(d.Ea="");d.status=29|(512==d.V?128:0)}return!0} function Ef(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.wb=b;d.rb=d.ib=!1;d.name=c.Pa;d.V=512;d.Z=2;d.S=40;d.ha=256;d.sb=!0;d.ce=0;d.be=0;d.Fb=1;d.cc=d.S;d.Pb=d.ha;d.fe=0;d.ge=null;d.ca||(d.Ea="");d.status=29|(512==d.V?128:0)}return!0}
h.ec=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>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.ec=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>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}Kb(this.h,f,t|w<<8);if(Nb(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.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.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=Jb(this.h,f);if(Nb(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.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.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.Ld=function(a){this.L=this.L&-1023|a&1022;this.D=this.D&-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& 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&&Pb(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.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};
var Jf={},Ef=(Jf[63744]=[null,null,O.prototype.Tc,O.prototype.Ld,"RLCS"],Jf[63746]=[null,null,O.prototype.Rc,O.prototype.Jd,"RLBA"],Jf[65284]=[null,null,O.prototype.Uc,O.prototype.Md,"RLDA"],Jf[65286]=[null,null,O.prototype.Vc,O.prototype.Nd,"RLMP"],Jf[65288]=[null,null,O.prototype.Sc,O.prototype.Kd,"RLBE"],Jf); var Kf={},Ff=(Kf[63744]=[null,null,O.prototype.Tc,O.prototype.Ld,"RLCS"],Kf[63746]=[null,null,O.prototype.Rc,O.prototype.Jd,"RLBA"],Kf[65284]=[null,null,O.prototype.Uc,O.prototype.Md,"RLDA"],Kf[65286]=[null,null,O.prototype.Vc,O.prototype.Nd,"RLMP"],Kf[65288]=[null,null,O.prototype.Sc,O.prototype.Kd,"RLBE"],Kf);
function Kf(a,b,c){x.call(this,"Computer",a,Kf);this.l.O=!1;Lf(this,b);this.A=mc(this,"autoPower",a);this.j=0;this.N=a.busWidth||a.buswidth;this.b=Mf;this.v=null;this.m=this.I=!1;this.P=mc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Nf(this);if(this.a=Ua("CPU",this.id)){this.C=Ua("Debugger",this.id);this.h=new tb({id:this.na+".bus",busWidth:this.N},this.a,this.C);var d,e=A(this.id);if((this.f=Ua("Panel",this.id))&&this.f.Va)for(b=0;b<e.length;b++)d=e[b],d.F=this.f.F,d.T=this.f.T,d.Va=this.f.Va; function Lf(a,b,c){x.call(this,"Computer",a,Lf);this.j.O=!1;Mf(this,b);this.A=nc(this,"autoPower",a);this.l=0;this.N=a.busWidth||a.buswidth;this.b=Nf;this.v=null;this.m=this.I=!1;this.P=nc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Of(this);if(this.a=Ua("CPU",this.id)){this.D=Ua("Debugger",this.id);this.h=new ub({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<e.length;b++)d=e[b],d.F=this.f.F,d.T=this.f.T,d.Va=this.f.Va;
this.T("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ha&&d.ha(this,this.h,this.a,this.C);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.s=d:this.b=parseInt(d,10));var f;if(a=mc(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.m=!0,this.b=Mf),this.b&&(this.w=new Q(this, this.T("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ia&&d.ia(this,this.h,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.s=d:this.b=parseInt(d,10));var f;if(a=nc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.m=!0,this.b=Nf),this.b&&(this.w=new Q(this,
"1.30.2"),Of(this.w)?b=null:delete this.w);!b&&this.b&&(b=Pf(this))&&(this.m=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.s=null,g.m=!1,g.F("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.v=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Qf(this,this.Wa)}else u("Unable to find CPU component")}z(Kf);var Mf=0; "1.30.2"),Pf(this.w)?b=null:delete this.w);!b&&this.b&&(b=Qf(this))&&(this.m=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.s=null,g.m=!1,g.F("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.v=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Rf(this,this.Wa)}else u("Unable to find CPU component")}z(Lf);var Nf=0;
function Lf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.J=b}function mc(a,b,c){var d=b.toLowerCase(),d=Ma[b]||Ma[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Qf(a,b,c){for(var d=A(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Wa(f)){Wa(f,function(){Qf(a,b,c)});return}}b.call(a,c)} function Mf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.J=b}function nc(a,b,c){var d=b.toLowerCase(),d=Ma[b]||Ma[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Rf(a,b,c){for(var d=A(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Wa(f)){Wa(f,function(){Rf(a,b,c)});return}}b.call(a,c)}
function Rf(a,b){var c=new Q(a,"1.30.2","validate");if(Of(c)&&Sf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.F("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Kf.prototype; function Sf(a,b){var c=new Q(a,"1.30.2","validate");if(Pf(c)&&Tf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.F("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Lf.prototype;
h.Wa=function(a){void 0===a&&(a=this.b||(this.v?1:Mf));if(!this.j){this.j++;var b=!1,c=!1;this.G=!1;var d=this.w||new Q(this,"1.30.2");if(-1==a)b=!0;else if(a>Mf){if(Of(d,this.v)){this.i=new Q(this,"1.30.2","failsafe");Of(this.i)&&(Tf(this,d),a=2,Uf(this.i));this.i.set("timestamp",sa());Vf(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=Sf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Of(d,g):("error"== h.Wa=function(a){void 0===a&&(a=this.b||(this.v?1:Nf));if(!this.l){this.l++;var b=!1,c=!1;this.G=!1;var d=this.w||new Q(this,"1.30.2");if(-1==a)b=!0;else if(a>Nf){if(Pf(d,this.v)){this.i=new Q(this,"1.30.2","failsafe");Pf(this.i)&&(Uf(this,d),a=2,Vf(this.i));this.i.set("timestamp",sa());Wf(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=Tf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Pf(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),Uf(d),Of(d)?(c=Sf(d),e=!0):c=!1))}e&&Rf(this,c?d:null)}else 2==a&&d.clear()}else Rf(this);delete this.v;delete this.w}e=A(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=Wf(this,g,d,b,c));b=[d,a,c];-1!=a?Qf(this,this.Gb,b):this.Gb(b)}}; f&&"no machine state"!=g?(this.F("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),Vf(d),Pf(d)?(c=Tf(d),e=!0):c=!1))}e&&Sf(this,c?d:null)}else 2==a&&d.clear()}else Sf(this);delete this.v;delete this.w}e=A(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=Xf(this,g,d,b,c));b=[d,a,c];-1!=a?Rf(this,this.Gb,b):this.Gb(b)}};
function Wf(a,b,c,d,e){if(!b.l.O){b.l.O=!0;if(b.ja){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ja(f,d)&&f&&(u("Unable to restore state for "+b.type),a.D&&!a.I?(c.clear(),a.b=Mf,window&&window.location.reload()):a.G=!0,b.ja(null),e=!1)}if(!d&&b.Lb)for(a=b.Lb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} function Xf(a,b,c,d,e){if(!b.j.O){b.j.O=!0;if(b.la){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.la(f,d)&&f&&(u("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=Nf,window&&window.location.reload()):a.G=!0,b.la(null),e=!1)}if(!d&&b.Lb)for(a=b.Lb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
h.Gb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.l.O=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Wf(this,this.a,b,c,a),this.a.Ua());this.G&&(Tf(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.j=0}; h.Gb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.j.O=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Xf(this,this.a,b,c,a),this.da(),this.a.Ua());this.G&&(Uf(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.l=0};
function Tf(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.2"};d.url=a.P;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} function Uf(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.2"};d.url=a.P;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}}
function Zf(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new Q(a,"1.30.2"),g=new Q(a,"1.30.2","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&G(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.O=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l<k.length;l++){var n=k[l];n.l.O&&(n.ia&&(d=n.ia(b,c),"object"===typeof d&&f.set(n.id, function $f(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new Q(a,"1.30.2"),g=new Q(a,"1.30.2","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.2");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<k.length;l++){var n=k[l];n.j.O&&(n.ka&&(d=n.ka(b,c),"object"===typeof d&&f.set(n.id,
d)),c&&(n.l.O=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&$f(a,a.c,f.toString()),Vf(g)&&Vf(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.l.O=!1,b=a.o.power)&&(b.textContent="Power");a.j=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c.reset&&c.reset()}};h.start=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ka(!0)}; d)),c&&(n.j.O=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&ag(a,a.c,f.toString()),Wf(g)&&Wf(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.j.O=!1,b=a.o.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();this.a&&this.a.reset&&this.a.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c!==this.a&&c.reset&&c.reset()}this.da(!0)};
h.stop=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ka(!0)}; h.start=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.da(!0)};h.stop=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.da(!0)};h.da=function(a){this.a&&this.a.da(a);this.f&&this.f.da(a)};
h.$=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.j||(d.l.O?Zf(d,!1,!0):Qf(d,d.Wa))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.l.O&&!d.j)if(d.b&&!d.s){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Zf(d,a,!0);!a&&d.D?window&&window.location.reload():(a||(d.Hb=!0),d.Wa(Mf),d.Hb=!1)}else d.reset(),d.a&&d.a.Ua()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c); h.$=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.l||(d.j.O?$f(d,!1,!0):Rf(d,d.Wa))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.O&&!d.l)if(d.b&&!d.s){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");$f(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Hb=!0),d.Wa(Nf),d.Hb=!1)}else d.reset(),d.a&&d.a.Ua()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);
else return this.o[b]=c,c.onclick=function(){var a=Nf(d,!0);if(a){var b=!!(d.b&&!d.s||d.D),c=Zf(d,b);b?$f(d,a,c):d.F("Resume disabled, machine state not saved")}},!0}return!1}; else return this.o[b]=c,c.onclick=function(){var a=Of(d,!0);if(a){var b=!!(d.b&&!d.s||d.C),c=$f(d,b);b?ag(d,a,c):d.F("Resume disabled, machine state not saved")}},!0}return!1};
function Nf(a,b){var c=a.c;c||((c=za("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ag(a,c))||a.F("The user ID is invalid.")):b&&a.F("Browser local storage is not available"));return c} function Of(a,b){var c=a.c;c||((c=za("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=bg(a,c))||a.F("The user ID is invalid.")):b&&a.F("Browser local storage is not available"));return c}
function ag(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){u(d.message+" ("+c+")")}return a.c}function Pf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+bg(a,"1.30.2"));return b} function bg(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){u(d.message+" ("+c+")")}return a.c}function Qf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+cg(a,"1.30.2"));return b}
function $f(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=bg(a,"1.30.2");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.F("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.F(c),Aa("user",""),a.c=null)}} function ag(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=cg(a,"1.30.2");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.F("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.F(c),Aa("user",""),a.c=null)}}
function ff(a){var b;a=A(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function sc(a){if(a.Va){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Va.focus();window&&window.scrollTo(b,c)}}h.ka=function(a){this.a&&this.a.ka(a);this.f&&this.f.ka(a)}; function gf(a){var b;a=A(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function tc(a){if(a.Va){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Va.focus();window&&window.scrollTo(b,c)}}Ha(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new Lf(g,d,!0);C(g,f);g.A&&Rf(g,g.Wa)}});
Ha(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new Kf(g,d,!0);C(g,f);g.A&&Qf(g,g.Wa)}});Ca.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ua("Computer",c.id))&&c.R&&!c.l.O&&c.Wa(-1)}});Ca.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ua("Computer",c.id))&&c.l.O&&Zf(c,!(!c.b||c.s),!0)}}); Ca.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ua("Computer",c.id))&&c.R&&!c.j.O&&c.Wa(-1)}});Ca.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ua("Computer",c.id))&&c.j.O&&$f(c,!(!c.b||c.s),!0)}});function Q(a,b,c){this.id=a.id;this.key=cg(a,b,c);this.D=a.D;Vf(this,a.jc)}function cg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
function Q(a,b,c){this.id=a.id;this.key=bg(a,b,c);this.C=a.C;Uf(this,a.jc)}function bg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a} Q.prototype={constructor:Q,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Vf(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
Q.prototype={constructor:Q,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Uf(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c, 1);c=0}}};function Vf(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Wf(a){var b=!0;if(ya()){var c=JSON.stringify(a[a.id]);Aa(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Tf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){u(c.message||c),b=!1}return b}function Pf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:ya()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var dg=0;
1);c=0}}};function Uf(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Vf(a){var b=!0;if(ya()){var c=JSON.stringify(a[a.id]);Aa(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Sf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){u(c.message||c),b=!1}return b}function Of(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:ya()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var cg=0; function eg(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):fg(k,a,b,c,d,e,f)})}
function dg(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):eg(k,a,b,c,d,e,f)})} function fg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Sa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
function eg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Sa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"), a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?gg(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?fg(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)} function gg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
function fg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, "");a=a.replace(d[0],g);gg(a,b,c)}})}else c(a,null)}
"");a=a.replace(d[0],g);fg(a,b,c)}})}else c(a,null)} function hg(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--dg||Ja(!0));l=!1}var g,k,l=!0;dg++;Ra[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n));p.appendChild(t)}c||
function gg(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--cg||Ja(!0));l=!1}var g,k,l=!0;cg++;Ra[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n));p.appendChild(t)}c|| (c="/versions/pdpjs/1.30.2/components.xsl");n=function(d,k){k?eg(c,null,null,!1,e,function(d,l){l?(Sa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--dg||Ja(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--dg||Ja(!0)):f("invalid machine element: "+
(c="/versions/pdpjs/1.30.2/components.xsl");n=function(d,k){k?dg(c,null,null,!1,e,function(d,l){l?(Sa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--cg||Ja(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--cg||Ja(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?eg(b,a,d,!0,e,n):fg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ja(!1);return hg(a,b,c,d)};window.enableEvents=Ja;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?dg(b,a,d,!0,e,n):eg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ja(!1);return gg(a,b,c,d)};window.enableEvents=Ja;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map