diff --git a/devices/pdp11/panel/1170/debugger/front.xml b/devices/pdp11/panel/1170/debugger/front.xml index 2ac379374..2908d39e2 100644 --- a/devices/pdp11/panel/1170/debugger/front.xml +++ b/devices/pdp11/panel/1170/debugger/front.xml @@ -2,91 +2,181 @@ Control Panel - - ADDRESS + + + + + ADDRESS - - . + + . - - . + + . - - . + + . - - . + + . - - . + + . - - . + + . - - . - + + . + - - DATA + + + + + DATA - - . + + . - - . + + . - - . + + . - - . + + . - - . - + + . + + + + + + START + STEP + ENABLE + + + + + + CONT + DEP + EXAM + + + + + + LOAD + TEST + + + + + 0 + 1 + 2 + + + + + + 3 + 4 + 5 + + + + + + 6 + 7 + 8 + + + + + + 9 + 10 + 11 + + + + + + 12 + 13 + 14 + + + + + + 15 + 16 + 17 + + + + + + 18 + 19 + 20 + + + + + + 21 + - + Enter diff --git a/devices/pdp11/panel/1170/front.xml b/devices/pdp11/panel/1170/front.xml index 6c0c91ca5..616ae5d1d 100644 --- a/devices/pdp11/panel/1170/front.xml +++ b/devices/pdp11/panel/1170/front.xml @@ -2,91 +2,181 @@ Control Panel - - ADDRESS + + + + + ADDRESS - - . + + . - - . + + . - - . + + . - - . + + . - - . + + . - - . + + . - - . - + + . + - - DATA + + + + + DATA - - . + + . - - . + + . - - . + + . - - . + + . - - . - + + . + + + + + + START + STEP + ENABLE + + + + + + CONT + DEP + EXAM + + + + + + LOAD + TEST + + + + + 0 + 1 + 2 + + + + + + 3 + 4 + 5 + + + + + + 6 + 7 + 8 + + + + + + 9 + 10 + 11 + + + + + + 12 + 13 + 14 + + + + + + 15 + 16 + 17 + + + + + + 18 + 19 + 20 + + + + + + 21 + - + Run diff --git a/docs/pcx86/examples/components.css b/docs/pcx86/examples/components.css index 707d508a0..11db5cd24 100644 --- a/docs/pcx86/examples/components.css +++ b/docs/pcx86/examples/components.css @@ -127,11 +127,19 @@ .pcjs-tripled { padding: 1px; } -.pcjs-tripled-label { +.pcjs-ledlbl0 { text-align: right; - padding: 8px; + font-size: 50%; + background-color: #8d4076; +} +.pcjs-ledlbl1 { + text-align: right; + font-size: 50%; + background-color: #d83662; } .pcjs-ledpad { + text-align: center; + font-size: x-small; line-height: 32px; background-color: #000000; } @@ -154,6 +162,25 @@ text-align: center; vertical-align: middle; background-color: #ff0000; + max-width: 50%; + max-height: 50%; +} +.pcjs-swlbl { + text-align: center; + font-size: 40%; + line-height: 32px; + background-color: #000000; +} +.pcjs-swpad { + height: 32px; + background-color: #000000; +} +.pcjs-switch { + height: 10px; + width: 28px; + margin-top: 0%; + max-width: 90%; + background-color: #00ff00; } .pcjs-screen { clear: both; diff --git a/docs/pcx86/examples/components.xsl b/docs/pcx86/examples/components.xsl index 314f41e5a..4946e4a80 100644 --- a/docs/pcx86/examples/components.xsl +++ b/docs/pcx86/examples/components.xsl @@ -421,7 +421,10 @@ -
+
+
+ +
diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index 7f3c485f0..5d484d360 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -186,6 +186,7 @@ CPUPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.cmp = cmp; this.bus = bus; this.dbg = dbg; + this.panel = cmp.panel; for (var i = 0; i < CPUPDP11.BUTTONS.length; i++) { var control = this.bindings[CPUPDP11.BUTTONS[i]]; diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 3e82980da..fb1e604e6 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -1411,8 +1411,8 @@ PDP11.opNOP = function(opCode) PDP11.opRESET = function(opCode) { if (!(this.regPSW & PDP11.PSW.CMODE)) { - this.resetRegs(); this.bus.reset(); + this.resetRegs(); // display.data = this.regsGen[0]; // TODO: Review } this.nStepCycles -= 667; // TODO: Review (but it's definitely a big number) diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 1cc7ca70d..38cc223e8 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -310,6 +310,7 @@ CPUStatePDP11.prototype.setMMR0 = function(newMMR0) this.mmuEnable = mmuEnable; this.setMemoryAccess(); } + if (this.panel) this.panel.updateStatus(); } }; @@ -357,6 +358,7 @@ CPUStatePDP11.prototype.setMMR3 = function(newMMR3) this.regMMR3 = newMMR3; this.mmuMask = (newMMR3 & PDP11.MMR3.MMU_22BIT)? 0x3fffff : 0x3ffff; this.setMemoryAccess(); + if (this.panel) this.panel.updateStatus(); } }; diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 50fa653d3..8a3dafbb3 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -450,7 +450,7 @@ var PDP11 = { XCSR: 0o177564, // Display Terminal: Transmitter Status Register XBUF: 0o177566, // Display Terminal: Transmitter Data Buffer Register - CNSL: 0o177570, // Console Switch and Front Panel Display + CNSW: 0o177570, // Console (Front Panel) Switch Register MMR0: 0o177572, // 777572 17777572 MMR1: 0o177574, // 777574 17777574 diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 3ddbd6331..11eeb48fc 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -49,7 +49,6 @@ if (NODE) { * The Device component implements the following "default" devices: * * KW11 (KW11-L Line Time Clock) - * CNSL (Console Switch and Front Panel Display) * * as well providing access to all the MMU and CPU registers, PSW, etc. * @@ -61,13 +60,6 @@ function DevicePDP11(parmsDevice) { Component.call(this, "Device", parmsDevice, DevicePDP11, MessagesPDP11.DEVICE); - this.console = { // CNSL registers - data: 0, - address: 0, - misc: 0x14, - switches: 0 - }; - this.kw11 = { // LW11 registers csr: 0, timer: -1 // initBus() will initialize this timer ID @@ -146,7 +138,6 @@ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg) */ DevicePDP11.prototype.reset = function() { - this.console.misc = (this.console.misc & ~0x77) | 0x14; // kernel 16 bit this.kw11.lks = 0; }; @@ -194,33 +185,6 @@ DevicePDP11.prototype.writeLKS = function(data, addr) this.kw11.lks = data & ~PDP11.KW11.LKS.MON; }; -/** - * readCNSL(addr) - * - * If addr is set, then this a normal read, so we should return normal results (ie, switches); - * if addr is NOT set, then this is a read-before-write, so we must return the value being updated (ie, data). - * - * @this {DevicePDP11} - * @param {number} addr (eg, PDP11.UNIBUS.CNSL or 177570) - * @return {number} - */ -DevicePDP11.prototype.readCNSL = function(addr) -{ - return (addr? this.console.switches : this.console.data) & 0xffff; -}; - -/** - * writeCNSL(data, addr) - * - * @this {DevicePDP11} - * @param {number} data - * @param {number} addr (eg, PDP11.UNIBUS.CNSL or 177570) - */ -DevicePDP11.prototype.writeCNSL = function(data, addr) -{ - this.console.data = data; -}; - /** * readMMR0(addr) * @@ -243,7 +207,6 @@ DevicePDP11.prototype.readMMR0 = function(addr) DevicePDP11.prototype.writeMMR0 = function(data, addr) { this.cpu.setMMR0(data); - this.updateConsoleMode(); }; /** @@ -304,21 +267,6 @@ DevicePDP11.prototype.readMMR3 = function(addr) DevicePDP11.prototype.writeMMR3 = function(data, addr) { this.cpu.setMMR3(data); - this.updateConsoleMode(); -}; - -/** - * updateConsoleMode() - * - * @this {DevicePDP11} - */ -DevicePDP11.prototype.updateConsoleMode = function() -{ - /* - * Set bit to 1 (22-bit), 2 (18-bit), or 4 (16-bit) - */ - var bit = this.cpu.mmuEnable? ((this.cpu.regMMR3 & PDP11.MMR3.MMU_22BIT)? 1 : 2) : 4; - this.console.misc = (this.console.misc & ~7) | bit; }; /** @@ -1105,7 +1053,6 @@ DevicePDP11.UNIBUS_IOTABLE = { [PDP11.UNIBUS.KDSAR0]: /* 172360 */ [null, null, DevicePDP11.prototype.readKDSAR, DevicePDP11.prototype.writeKDSAR, "KDSAR", 8, PDP11.MODEL_1145], [PDP11.UNIBUS.MMR3]: /* 172516 */ [null, null, DevicePDP11.prototype.readMMR3, DevicePDP11.prototype.writeMMR3, "MMR3", 1, PDP11.MODEL_1145], [PDP11.UNIBUS.LKS]: /* 177546 */ [null, null, DevicePDP11.prototype.readLKS, DevicePDP11.prototype.writeLKS, "LKS"], - [PDP11.UNIBUS.CNSL]: /* 177570 */ [null, null, DevicePDP11.prototype.readCNSL, DevicePDP11.prototype.writeCNSL, "CNSL"], [PDP11.UNIBUS.MMR0]: /* 177572 */ [null, null, DevicePDP11.prototype.readMMR0, DevicePDP11.prototype.writeMMR0, "MMR0", 1, PDP11.MODEL_1145], [PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, DevicePDP11.prototype.writeIgnored, "MMR1", 1, PDP11.MODEL_1145], [PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, DevicePDP11.prototype.writeIgnored, "MMR2", 1, PDP11.MODEL_1145], diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index be23848e4..09feb0a64 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -54,19 +54,112 @@ if (NODE) { function PanelPDP11(parmsPanel) { Component.call(this, "Panel", parmsPanel, PanelPDP11); + /* * If there are any live registers, LEDs, etc, to display, this will provide a count. + * + * TODO: Add some UI for fDisplayLiveRegs (either an XML property, or a UI checkbox, or both). */ this.cLiveRegs = 0; - /* - * TODO: Add some UI for displayLiveRegs (either an XML property, or a UI checkbox, or both) - */ - this.flags.displayLiveRegs = true; + this.fDisplayLiveRegs = true; + this.fLampTest = false; + this.fExamine = this.fDeposit = false; + /* + * regCNSW contains the Console (Front Panel) Switch Register, which is also available 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, + * and regData corresponds to the DATA display. They are updated by setAddr() and setData(), + * which in turn take care of calling updateLEDArray(). + */ + this.regCNSW = 0; + this.regAddr = this.regData = 0; + this.regMisc = 0x14; + + /* + * Every LED has a simple numeric value, assigned when setBinding() is called: + * + * 0 if off, 1 if on + * + * initBus() will call updateLEDs() to ensure that every LED is set to its initial value. + */ + this.leds = {}; + + /* + * Every switch has an array associated with it: + * + * [0]: initial/current value of switch (0 if down, 1 if up) + * [1]: true if the switch is momentary, false if not + * [2]: true if the switch is currently being pressed, false if not + * [3]: optional handler to call whenever the switch is pressed or released + * [4]: optional switch index (used with CNSW switches 'S0' through 'S21') + * + * initBus() will call updateSwitches() 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 + * when it is momentarily pressed "up", whereas 'LOAD [ADRS]' will load the address register from the switch + * register when it is momentarily pressed "down". + * + * This means that processLampTest(value) must act when value == 1, whereas processLoadAddr(value) must + * act when value == 0. You can infer all this from the table below, because the initial value of any + * momentary switch is its "passive" value, so the opposite is its "active" value. + */ + this.switches = { + 'START': [1, true, false, this.processStart], + 'STEP': [1, false, false, this.processStep], + 'ENABLE': [1, false, false, this.processEnable], + 'CONT': [1, true, false, this.processContinue], + 'DEP': [0, true, false, this.processDeposit], + 'EXAM': [1, true, false, this.processExamine], + 'LOAD': [1, true, false, this.processLoadAddr], + 'TEST': [0, true, false, this.processLampTest] + }; + for (var i = 0; i < 22; i++) { + this.switches['S'+i] = [0, false, false, this.processSwitchReg, i]; + } } Component.subclass(PanelPDP11); +/* + * To get the current state of a switch; eg:: + * + * this.getSwitch(PanelPDP11.SWITCH.ENABLE) + * + * However, I haven't filled out this table, primarily because the only switches we need to query + * are the non-momentary ones (eg, ENABLE and STEP), and EXAM and DEP (because they have special + * "step" behavior when pressed more than once in a row). + */ +PanelPDP11.SWITCH = { + DEP: 'DEP', + ENABLE: 'ENABLE', + EXAM: 'EXAM', + STEP: 'STEP' +}; + +/** + * getSwitch(name) + * + * @this {PanelPDP11} + * @param {string} name + * @return {number|undefined} 0 if switch is off ("down"), 1 if on ("up"), or undefined if unrecognized + */ +PanelPDP11.prototype.getSwitch = function(name) +{ + return this.switches[name] && this.switches[name][0]; +}; + +/** + * reset() + * + * @this {PanelPDP11} + */ +PanelPDP11.prototype.reset = function() +{ + this.regMisc = (this.regMisc & ~0x77) | 0x14; // kernel 16 bit +}; + /** * setBinding(sType, sBinding, control, sValue) * @@ -93,29 +186,72 @@ PanelPDP11.prototype.setBinding = function(sType, sBinding, control, sValue) if (DEBUGGER && this.dbg && this.dbg.setBinding(sType, sBinding, control, sValue)) { return true; } + switch (sBinding) { - 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": + 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': this.bindings[sBinding] = control; this.cLiveRegs++; return true; + default: - if (sType == "rled") { + /* + * Square (default) or round LEDs are defined in machine XML files like so: + * + * + * + * Only *type* and *binding* attributes are required; if *value* is omitted, the default value is 0 (off). + */ + if (sType == "led" || sType == "rled") { this.bindings[sBinding] = control; + this.leds[sBinding] = sValue? 1 : 0; this.cLiveRegs++; return true; } + /* + * Switches are defined in machine XML files like so: + * + * + * + * Only *type* and *binding* attributes are required; if *value* is omitted, the default value is 0 ("down"). + * + * Currently, there is no XML attribute to indicate whether a switch is "momentary"; only recognized switches + * in our internal table can have that attribute. + */ + if (sType == "switch") { + /* + * Like LEDs, we allow unrecognized switches to be defined as well, but they won't do anything useful, + * since only recognized switches will have handlers that perform the appropriate operations. + */ + if (this.switches[sBinding] === undefined) { + this.switches[sBinding] = [sValue? 1 : 0]; + } + this.bindings[sBinding] = control; + var parent = control.parentElement || control; + parent = parent.parentElement || parent; + parent.onmousedown = function(panel, sBinding) { + return function onPressSwitch() { + panel.pressSwitch(sBinding); + }; + }(this, sBinding); + parent.onmouseup = parent.onmouseout = function(panel, sBinding) { + return function onReleaseSwitch() { + panel.releaseSwitch(sBinding); + }; + }(this, sBinding); + return true; + } return this.parent.setBinding.call(this, sType, sBinding, control, sValue); } }; @@ -135,6 +271,12 @@ PanelPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.bus = bus; this.cpu = cpu; this.dbg = dbg; + + bus.addIOTable(this, PanelPDP11.UNIBUS_IOTABLE); + bus.addResetHandler(this.reset.bind(this)); + + this.updateLEDs(); + this.updateSwitches(); }; /** @@ -147,7 +289,20 @@ PanelPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) */ PanelPDP11.prototype.powerUp = function(data, fRepower) { - if (!fRepower) PanelPDP11.init(); + if (!fRepower) { + /* + * As noted in init(), our powerUp() method gives us a second opportunity to notify any + * components that that might care (eg, CPU, Keyboard, and Debugger) that we have some controls + * they might want to use. + */ + PanelPDP11.init(); + /* + * TODO: Until we implement a restore() function, all we can do is reset(); however, that's + * currently unnecessary, since we've added reset() to the addResetHandler() list. + * + * this.reset(); + */ + } return true; }; @@ -184,7 +339,7 @@ PanelPDP11.prototype.updateValue = function(sLabel, nValue, cch) } var sVal; var nBase = this.dbg && this.dbg.nBase || 8; - if (!this.cpu.isRunning() || this.flags.displayLiveRegs) { + if (!this.cpu.isRunning() || this.fDisplayLiveRegs) { sVal = nBase == 8? str.toOct(nValue, cch) : str.toHex(nValue, cch); } else { sVal = "--------".substr(0, cch || 4); @@ -200,39 +355,308 @@ PanelPDP11.prototype.updateValue = function(sLabel, nValue, cch) }; /** - * setLED(control, f) + * setLED(sBinding, value) * * @this {PanelPDP11} - * @param {Object} control is an HTML control DOM object - * @param {boolean|number} f is true if the LED represented by control should be "on", false if "off" + * @param {string} sBinding + * @param {boolean|number} value (true if the LED should be on, false if off) */ -PanelPDP11.prototype.setLED = function(control, f) +PanelPDP11.prototype.setLED = function(sBinding, value) { - /* - * TODO: Add support for user-definable LED colors - */ - control.style.backgroundColor = (f? "#ff0000" : "#000000"); + var control = this.bindings[sBinding]; + if (control) { + /* + * TODO: Add support for user-definable LED colors? + */ + control.style.backgroundColor = (value? "#ff0000" : "#000000"); + } }; /** - * updateLEDs(sPrefix, data, nLEDs) + * updateLEDs(override) + * + * @this {PanelPDP11} + * @param {boolean|number|null} [override] (true turn on all LEDs, false to turn off all LEDs, null or undefined for normal LED activity) + */ +PanelPDP11.prototype.updateLEDs = function(override) +{ + for (var sBinding in this.leds) { + this.setLED(sBinding, override != null? override : this.leds[sBinding]); + } +}; + +/** + * updateLEDArray(sPrefix, data, nLEDs) * * @this {PanelPDP11} * @param {string} sPrefix * @param {number} data * @param {number} nLEDs */ -PanelPDP11.prototype.updateLEDs = function(sPrefix, data, nLEDs) +PanelPDP11.prototype.updateLEDArray = function(sPrefix, data, nLEDs) { for (var i = 0; i < nLEDs; i++) { - var id = sPrefix + i; - var control = this.bindings[id]; - if (control) { - this.setLED(control, data & (1 << i)); + var sBinding = sPrefix + i; + this.setLED(sBinding, data & (1 << i)); + } +}; + +/** + * setSwitch(sBinding, value) + * + * @this {PanelPDP11} + * @param {string} sBinding + * @param {boolean|number} value (true if the switch should be "up" (on), false if "down" (off)) + */ +PanelPDP11.prototype.setSwitch = function(sBinding, value) +{ + var control = this.bindings[sBinding]; + if (control) { + control.style.marginTop = (value? "0px" : "20px"); + control.style.backgroundColor = (value? "#00ff00" : "#228B22"); + } +}; + +/** + * pressSwitch(sBinding) + * + * @this {PanelPDP11} + * @param {string} sBinding + */ +PanelPDP11.prototype.pressSwitch = function(sBinding) +{ + var sw = this.switches[sBinding]; + this.setSwitch(sBinding, sw[0] = 1 - sw[0]); + sw[2] = true; + if (sw[3]) sw[3].call(this, sw[0], sw[4]); + this.fDeposit = (sBinding == PanelPDP11.SWITCH.DEP); + this.fExamine = (sBinding == PanelPDP11.SWITCH.EXAM); +}; + +/** + * releaseSwitch(sBinding) + * + * @this {PanelPDP11} + * @param {string} sBinding + */ +PanelPDP11.prototype.releaseSwitch = function(sBinding) +{ + /* + * pressSwitch() is simple: flip the switch's current value in sw[0] and marked it "pressed" in sw[2]. + * + * releaseSwitch() is more complicated, because we must handle both mouseUp and mouseOut events. The first time + * we receive EITHER of those events AND the switch is marked momentary (sw[1]) AND the switch is pressed (sw[2]), + * then we must flip the switch back to its original value. + * + * Otherwise, the only thing we have to do is mark the switch as no longer "pressed" (ie, set sw[2] to false). + */ + var sw = this.switches[sBinding]; + if (sw[1] && sw[2]) { + this.setSwitch(sBinding, sw[0] = 1 - sw[0]); + if (sw[3]) sw[3].call(this, sw[0], sw[4]); + } + sw[2] = false; +}; + +/** + * processStart(value, index) + * + * @this {PanelPDP11} + * @param {number} value + * @param {number} [index] + */ +PanelPDP11.prototype.processStart = function(value, index) +{ + if (!value && !this.cpu.isRunning()) { + /* + * TODO: Verify what the PDP-11/70 Handbook means when it says that when the 'START' switch + * is depressed, "the computer system will be cleared." I take it to mean that it performs + * the equivalent of a RESET instruction. + */ + this.bus.reset(); + this.cpu.resetRegs(); + /* + * The PDP-11/70 Handbook goes on to say: "If the system needs to be initialized but execution + * is not wanted, the START switch should be depressed while the HALT/ENABLE switch is in the HALT + * position." + */ + if (this.getSwitch(PanelPDP11.SWITCH.ENABLE)) { + this.cpu.startCPU(); } } }; +/** + * processStep(value, index) + * + * 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 + * latter. + * + * @this {PanelPDP11} + * @param {number} value + * @param {number} [index] + */ +PanelPDP11.prototype.processStep = function(value, index) +{ +}; + +/** + * processEnable(value, index) + * + * If value == 1 (our initial value), then the 'ENABLE'/'HALT' switch is set to 'ENABLE', otherwise 'HALT'. + * + * @this {PanelPDP11} + * @param {number} value + * @param {number} [index] + */ +PanelPDP11.prototype.processEnable = function(value, index) +{ + /* + * The "down" (0) position is 'HALT', which stops the CPU; however, the "up" (1) position ('ENABLE') + * does NOT start the CPU. You must press 'CONT' to continue execution, which will either continue for + * one instruction if this switch to set to 'HALT' or indefinitely if it is set to 'ENABLE'. + */ + if (!value) { + this.cpu.stopCPU(); + } +}; + +/** + * processContinue(value, index) + * + * @this {PanelPDP11} + * @param {number} value + * @param {number} [index] + */ +PanelPDP11.prototype.processContinue = function(value, index) +{ + if (!value && !this.cpu.isRunning()) { + if (!this.getSwitch(PanelPDP11.SWITCH.ENABLE)) { + /* + * TODO: Technically, we're also supposed to check the 'STEP' switch to determine if we should + * step one instruction or just one cycle, but we don't currently have the ability to do the latter. + */ + var dbg = this.dbg; + if (dbg && !dbg.isBusy(true)) { + dbg.setBusy(true); + dbg.stepCPU(0); + dbg.setBusy(false); + } else { + this.cpu.stepCPU(1); + this.updateStatus(); + } + } + else { + this.cpu.startCPU(); + } + } +}; + +/** + * processDeposit(value, index) + * + * @this {PanelPDP11} + * @param {number} value + * @param {number} [index] + */ +PanelPDP11.prototype.processDeposit = function(value, index) +{ + if (value && !this.cpu.isRunning()) { + if (this.fDeposit) { + this.setAddr(this.regAddr + 2); + } + this.bus.setWordDirect(this.regAddr, this.setData(this.regCNSW)); + } +}; + +/** + * processExamine(value, index) + * + * @this {PanelPDP11} + * @param {number} value + * @param {number} [index] + */ +PanelPDP11.prototype.processExamine = function(value, index) +{ + if (!value && !this.cpu.isRunning()) { + if (this.fExamine) { + this.setAddr(this.regAddr + 2); + } + this.setData(this.bus.getWordDirect(this.regAddr)); + } +}; + +/** + * processLoadAddr(value, index) + * + * @this {PanelPDP11} + * @param {number} value + * @param {number} [index] + */ +PanelPDP11.prototype.processLoadAddr = function(value, index) +{ + if (!value && !this.cpu.isRunning()) { + this.setAddr(this.regCNSW); + } +}; + +/** + * processLampTest(value, index) + * + * @this {PanelPDP11} + * @param {number} value + * @param {number} [index] + */ +PanelPDP11.prototype.processLampTest = function(value, index) +{ + this.updateLEDs(value || null); +}; + +/** + * processSwitchReg(value, index) + * + * @this {PanelPDP11} + * @param {number} value (normally 0 or 1, but we only depend on it being zero or non-zero) + * @param {number} index + */ +PanelPDP11.prototype.processSwitchReg = function(value, index) +{ + if (value) { + this.regCNSW |= 1 << index; + } else { + this.regCNSW &= ~(1 << index); + } +}; + +/** + * setAddr(value) + * + * @this {PanelPDP11} + * @param {number} value + * @return {number} + */ +PanelPDP11.prototype.setAddr = function(value) +{ + this.regAddr = value & this.bus.nBusMask; + this.updateLEDArray("A", this.regAddr, 22); + return this.regAddr; +}; + +/** + * setData(value) + * + * @this {PanelPDP11} + * @param {number} value + * @return {number} + */ +PanelPDP11.prototype.setData = function(value) +{ + this.regData = value & 0xffff; + this.updateLEDArray("D", this.regData, 16); + return this.regData; +}; + /** * updateStatus(fForce) * @@ -242,7 +666,7 @@ PanelPDP11.prototype.updateLEDs = function(sPrefix, data, nLEDs) PanelPDP11.prototype.updateStatus = function(fForce) { if (this.cLiveRegs) { - if (fForce || !this.cpu.isRunning() || this.flags.displayLiveRegs) { + if (fForce || !this.cpu.isRunning() || this.fDisplayLiveRegs) { for (var i = 0; i < this.cpu.regsGen.length; i++) { this.updateValue('R'+i, this.cpu.regsGen[i]); } @@ -252,12 +676,62 @@ PanelPDP11.prototype.updateStatus = function(fForce) this.updateValue("ZF", (regPSW & PDP11.PSW.ZF)? 1 : 0, 1); this.updateValue("VF", (regPSW & PDP11.PSW.VF)? 1 : 0, 1); this.updateValue("CF", (regPSW & PDP11.PSW.CF)? 1 : 0, 1); - this.updateLEDs("D", this.cpu.regsGen[0], 16); - this.updateLEDs("A", this.cpu.regsGen[7], 22); + if (!this.fLampTest) { + this.setData(this.cpu.regsGen[0]); + this.setAddr(this.cpu.regsGen[7]); + /* + * Set bit to 1 (22-bit), 2 (18-bit), or 4 (16-bit) + */ + var bit = this.cpu.mmuEnable? ((this.cpu.regMMR3 & PDP11.MMR3.MMU_22BIT)? 1 : 2) : 4; + // this.misc = (this.misc & ~7) | bit; + } } } }; +/** + * updateSwitches() + * + * @this {PanelPDP11} + */ +PanelPDP11.prototype.updateSwitches = function() +{ + for (var sBinding in this.switches) { + this.setSwitch(sBinding, this.switches[sBinding][0]); + } +}; + +/** + * readCNSW(addr) + * + * If addr is set, then this a normal read, so we should return normal results (ie, switches); + * if addr is NOT set, then this is a read-before-write, so we must return the value being updated (ie, data). + * + * @this {PanelPDP11} + * @param {number} addr (eg, PDP11.UNIBUS.CNSW or 177570) + * @return {number} + */ +PanelPDP11.prototype.readCNSW = function(addr) +{ + return (addr? this.regCNSW : this.regData) & 0xffff; +}; + +/** + * writeCNSW(data, addr) + * + * @this {PanelPDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.CNSW or 177570) + */ +PanelPDP11.prototype.writeCNSW = function(data, addr) +{ + this.regData = data; +}; + +PanelPDP11.UNIBUS_IOTABLE = { + [PDP11.UNIBUS.CNSW]: /* 177570 */ [null, null, PanelPDP11.prototype.readCNSW, PanelPDP11.prototype.writeCNSW, "CNSW"] +}; + /** * PanelPDP11.init() * diff --git a/modules/shared/templates/components.css b/modules/shared/templates/components.css index 13163caa8..21f04854f 100644 --- a/modules/shared/templates/components.css +++ b/modules/shared/templates/components.css @@ -132,11 +132,19 @@ .pcjs-tripled { padding: 1px; } -.pcjs-tripled-label { +.pcjs-ledlbl0 { text-align: right; - padding: 8px; + font-size: 50%; + background-color: #8d4076; +} +.pcjs-ledlbl1 { + text-align: right; + font-size: 50%; + background-color: #d83662; } .pcjs-ledpad { + text-align: center; + font-size: x-small; line-height: 32px; background-color: #000000; } @@ -159,6 +167,25 @@ text-align: center; vertical-align: middle; background-color: #ff0000; + max-width: 50%; + max-height: 50%; +} +.pcjs-swlbl { + text-align: center; + font-size: 40%; + line-height: 32px; + background-color: #000000; +} +.pcjs-swpad { + height: 32px; + background-color: #000000; +} +.pcjs-switch { + height: 10px; + width: 28px; + margin-top: 0%; + max-width: 90%; + background-color: #00ff00; } .pcjs-screen { clear: both; diff --git a/modules/shared/templates/components.xsl b/modules/shared/templates/components.xsl index d51334e25..5fef032ed 100644 --- a/modules/shared/templates/components.xsl +++ b/modules/shared/templates/components.xsl @@ -422,7 +422,10 @@ -
+
+
+ +
diff --git a/versions/pc8080/1.30.2/components.css b/versions/pc8080/1.30.2/components.css index 707d508a0..11db5cd24 100644 --- a/versions/pc8080/1.30.2/components.css +++ b/versions/pc8080/1.30.2/components.css @@ -127,11 +127,19 @@ .pcjs-tripled { padding: 1px; } -.pcjs-tripled-label { +.pcjs-ledlbl0 { text-align: right; - padding: 8px; + font-size: 50%; + background-color: #8d4076; +} +.pcjs-ledlbl1 { + text-align: right; + font-size: 50%; + background-color: #d83662; } .pcjs-ledpad { + text-align: center; + font-size: x-small; line-height: 32px; background-color: #000000; } @@ -154,6 +162,25 @@ text-align: center; vertical-align: middle; background-color: #ff0000; + max-width: 50%; + max-height: 50%; +} +.pcjs-swlbl { + text-align: center; + font-size: 40%; + line-height: 32px; + background-color: #000000; +} +.pcjs-swpad { + height: 32px; + background-color: #000000; +} +.pcjs-switch { + height: 10px; + width: 28px; + margin-top: 0%; + max-width: 90%; + background-color: #00ff00; } .pcjs-screen { clear: both; diff --git a/versions/pc8080/1.30.2/components.xsl b/versions/pc8080/1.30.2/components.xsl index da16eb76d..4af6972cf 100644 --- a/versions/pc8080/1.30.2/components.xsl +++ b/versions/pc8080/1.30.2/components.xsl @@ -421,7 +421,10 @@ -
+
+
+ +
diff --git a/versions/pcx86/1.30.2/components.css b/versions/pcx86/1.30.2/components.css index 707d508a0..11db5cd24 100644 --- a/versions/pcx86/1.30.2/components.css +++ b/versions/pcx86/1.30.2/components.css @@ -127,11 +127,19 @@ .pcjs-tripled { padding: 1px; } -.pcjs-tripled-label { +.pcjs-ledlbl0 { text-align: right; - padding: 8px; + font-size: 50%; + background-color: #8d4076; +} +.pcjs-ledlbl1 { + text-align: right; + font-size: 50%; + background-color: #d83662; } .pcjs-ledpad { + text-align: center; + font-size: x-small; line-height: 32px; background-color: #000000; } @@ -154,6 +162,25 @@ text-align: center; vertical-align: middle; background-color: #ff0000; + max-width: 50%; + max-height: 50%; +} +.pcjs-swlbl { + text-align: center; + font-size: 40%; + line-height: 32px; + background-color: #000000; +} +.pcjs-swpad { + height: 32px; + background-color: #000000; +} +.pcjs-switch { + height: 10px; + width: 28px; + margin-top: 0%; + max-width: 90%; + background-color: #00ff00; } .pcjs-screen { clear: both; diff --git a/versions/pcx86/1.30.2/components.xsl b/versions/pcx86/1.30.2/components.xsl index b68b0dc6b..1c3a4aa71 100644 --- a/versions/pcx86/1.30.2/components.xsl +++ b/versions/pcx86/1.30.2/components.xsl @@ -421,7 +421,10 @@ -
+
+
+ +
diff --git a/versions/pdpjs/1.30.2/components.css b/versions/pdpjs/1.30.2/components.css index 707d508a0..11db5cd24 100644 --- a/versions/pdpjs/1.30.2/components.css +++ b/versions/pdpjs/1.30.2/components.css @@ -127,11 +127,19 @@ .pcjs-tripled { padding: 1px; } -.pcjs-tripled-label { +.pcjs-ledlbl0 { text-align: right; - padding: 8px; + font-size: 50%; + background-color: #8d4076; +} +.pcjs-ledlbl1 { + text-align: right; + font-size: 50%; + background-color: #d83662; } .pcjs-ledpad { + text-align: center; + font-size: x-small; line-height: 32px; background-color: #000000; } @@ -154,6 +162,25 @@ text-align: center; vertical-align: middle; background-color: #ff0000; + max-width: 50%; + max-height: 50%; +} +.pcjs-swlbl { + text-align: center; + font-size: 40%; + line-height: 32px; + background-color: #000000; +} +.pcjs-swpad { + height: 32px; + background-color: #000000; +} +.pcjs-switch { + height: 10px; + width: 28px; + margin-top: 0%; + max-width: 90%; + background-color: #00ff00; } .pcjs-screen { clear: both; diff --git a/versions/pdpjs/1.30.2/components.xsl b/versions/pdpjs/1.30.2/components.xsl index e25148dcc..cb090c226 100644 --- a/versions/pdpjs/1.30.2/components.xsl +++ b/versions/pdpjs/1.30.2/components.xsl @@ -421,7 +421,10 @@ -
+
+
+ +
diff --git a/versions/pdpjs/1.30.2/pdp11-dbg.js b/versions/pdpjs/1.30.2/pdp11-dbg.js index e7aa695e8..ce64b8d1a 100644 --- a/versions/pdpjs/1.30.2/pdp11-dbg.js +++ b/versions/pdpjs/1.30.2/pdp11-dbg.js @@ -40,274 +40,278 @@ function xa(a,b){return(a+" ").slice(0,b) function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Ea(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Fa(a,b){var c,d={da:null,ha:null,Ha:null,Ga: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.Ha=g.load;d.Ga=g.exec;if(e=g.bytes)d.da=e;else if(e=g.words)for(d.da=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.da=Array(4*e.length),f=c=0;c>8&255,d.da[f++]=e[c]>>16&255,d.da[f++]=e[c]>>24&255;else d.da=g;d.ha=g.symbols;d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.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>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ia=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.cb=this.id:(this.Na=this.id.substr(0,b),this.cb=this.id.substr(b+1));this[a]=c;this.A={ready:!1,Ua:!1,Xb:!1,ia:!1,error:!1};this.Nb=null;this.A.error=!1;this.G={};this.i=null;this.na=d||0;v.push(this)}var ab=void 0,bb={}; -if(window){ab||(ab=window.location.search.substr(1));for(var ib,jb=/\+/g,kb=/([^&=]+)=?([^&]*)/g;ib=kb.exec(ab);)bb[decodeURIComponent(ib[1].replace(jb," "))]=decodeURIComponent(ib[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} +function u(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.mc=b.comment;this.Rc=b;b=this.id.indexOf(".");0>b?this.fb=this.id:(this.Na=this.id.substr(0,b),this.fb=this.id.substr(b+1));this[a]=c;this.A={ready:!1,Va:!1,Wb:!1,ja:!1,error:!1};this.Pb=null;this.A.error=!1;this.G={};this.i=null;this.na=d||0;v.push(this)}var ab=void 0,bb={}; +if(window){ab||(ab=window.location.search.substr(1));for(var cb,db=/\+/g,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>2;this.w=this.xa-1;this.F=this.J/this.xa|0;this.Ta=[];this.f=0;this.B=!1;this.C=[];this.Gc=[Sb,Tb,Ub,Vb];a=new I(this);Wb(a,this.i);this.W=Array(this.F);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ta[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,64)&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;K(d,b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Tb(a,b,c){var d=!1,e=this.controller,f=e.Ta[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.Ta[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,64)&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(K(e,c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Ub(a,b){var c=-1,d=this.controller;(a=d.Ta[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,64)&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;K(d,b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Vb(a,b,c){var d=!1,e=this.controller;if(a=e.Ta[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,64)&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(K(e,c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Yb(a,b){if(b!=a.v){var c;a.v&&(c=(1<>>a.ka;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.D)return l.Hb+=l.D-f,l.D=f,!0;if(f>=l.D+l.Hb){n=l.size-(f-m);n>g&&(n=g);l.Hb=f-l.D+n;f=m+a.xa;g-=n;h++;continue}}return cc(1,f,g)}f=new I(a,f,n,a.xa,d,e);Wb(f,a.i,l);a.W[h++]=f;f=m+a.xa;g-=n}if(0>=g){c/=1024;var r;e="";r?10>>=a.ka;0>>=a.ka;0>>this.ka].Rb(a&this.w,a)};k.Pb=function(a){this.B=!1;this.f++;a=this.W[(a&this.g)>>>this.ka].cc(a&this.w,a);this.f--;return a}; -k.oa=function(a){3932160<=a&&(a=ec(this.b,a));return this.W[(a&this.g)>>>this.ka].ra(a&this.w,a)};k.pb=function(a){var b=a&this.w,c=(a&this.g)>>>this.ka;this.B=!1;this.f++;a=this.W[c].dc(b,a);this.f--;return a};k.Sb=function(a,b){3932160<=a&&(a=ec(this.b,a));this.W[(a&this.g)>>>this.ka].Vb(a&this.w,b&255,a)};k.jb=function(a,b){this.B=!1;this.f++;this.W[(a&this.g)>>>this.ka].Wb(a&this.w,b&255,a);this.f--}; -k.ab=function(a,b){3932160<=a&&(a=ec(this.b,a));this.W[(a&this.g)>>>this.ka].Ib(a&this.w,b&65535,a)};k.Tb=function(a,b){var c=a&this.w,d=(a&this.g)>>>this.ka;this.B=!1;this.f++;this.W[d].hc(c,b&65535,a);this.f--};function fc(a){for(var b=0,c=[],d=0;da.b.qb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null,n=f[5]||1;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var r=f[4],t=0;t>5&3;b.Ka=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Wa!=c&&(b.Wa=c,pc(b))}qc(this)};k.ed=function(){var a=this.b.Ya;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.fd=function(){return this.b.Fb};k.gd=function(){return this.b.ib};k.$d=function(a){var b=this.b;1170>b.qb&&(a&=-49);b.ib!=a&&(b.ib=a,b.Mb=a&16?4194303:262143,pc(b));qc(this)}; -function qc(a){a.g.Qb=a.g.Qb&-8|(a.b.Wa?a.b.ib&16?1:2:4)}k.Hd=function(a){a=a>>1&63;var b=this.b.Gb[a>>1];return a&1?b>>16:b&65535};k.ze=function(a,b){b=b>>1&63;var c=b>>1;this.b.Gb[c]=b&1?this.b.Gb[c]&65535|(a&63)<<16:this.b.Gb[c]&-65536|a&65534};k.Ad=function(a){return this.b.V[1][a>>1&7]};k.se=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.yd=function(a){return this.b.V[1][(a>>1&7)+8]};k.qe=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.zd=function(a){return this.b.wa[1][a>>1&7]}; -k.re=function(a,b){b=b>>1&7;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.xd=function(a){return this.b.wa[1][(a>>1&7)+8]};k.pe=function(a,b){b=(b>>1&7)+8;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.ad=function(a){return this.b.V[0][a>>1&7]};k.Wd=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.Zc=function(a){return this.b.V[0][(a>>1&7)+8]};k.Ud=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.$c=function(a){return this.b.wa[0][a>>1&7]};k.Vd=function(a,b){b=b>>1&7;this.b.wa[0][b]=a;this.b.V[0][b]&=65295}; -k.Yc=function(a){return this.b.wa[0][(a>>1&7)+8]};k.Td=function(a,b){b=(b>>1&7)+8;this.b.wa[0][b]=a;this.b.V[0][b]&=65295};k.Gd=function(a){return this.b.V[3][a>>1&7]};k.ye=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Ed=function(a){return this.b.V[3][(a>>1&7)+8]};k.we=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Fd=function(a){return this.b.wa[3][a>>1&7]};k.xe=function(a,b){b=b>>1&7;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.Dd=function(a){return this.b.wa[3][(a>>1&7)+8]}; -k.ve=function(a,b){b=(b>>1&7)+8;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.ub=function(a){a&=7;return this.b.M&2048?this.b.Ra[a]:this.b.u[a]};k.yb=function(a,b){b&=7;this.b.M&2048?this.b.Ra[b]=a:this.b.u[b]=a};k.md=function(){return this.b.M&49152?this.b.Fa[0]:this.b.u[6]};k.ee=function(a){this.b.M&49152?this.b.Fa[0]=a:this.b.u[6]=a};k.pd=function(){return this.b.u[7]};k.he=function(a){this.b.u[7]=a};k.vb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Ra[a]}; -k.zb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Ra[b]=a};k.nd=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Fa[1]};k.fe=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Fa[1]=a};k.od=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Fa[3]};k.ge=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Fa[3]=a};k.Wc=function(a){return this.b.zc[a-65504>>1]};k.Rd=function(a,b){this.b.zc[b-65504>>1]=a};k.wc=function(a){return 65520==a?61183:0};k.Dc=function(){}; -k.Cd=function(){return 1};k.ue=function(){};k.Vc=function(){return this.b.fa};k.Qd=function(){this.b.fa=0};k.cd=function(){return this.b.yc};k.Yd=function(a,b){b&1||(a&=255);this.b.yc=a};k.hd=function(a){return a?this.b.fc:0};k.ae=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.fc=a;b.H|=2};k.Bd=function(a){return a?this.b.Za&65280:0};k.te=function(a){this.b.Za=a|255};k.ld=function(){return Cb(this.b)};k.de=function(a){rc(this.b,a&-1809|Cb(this.b)&1808);this.b.H|=128}; -k.Cc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; -var N={},M=(N[61568]=[null,null,L.prototype.Hd,L.prototype.ze,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Ad,L.prototype.se,"SISDR",8,1145],N[62608]=[null,null,L.prototype.yd,L.prototype.qe,"SDSDR",8,1145],N[62624]=[null,null,L.prototype.zd,L.prototype.re,"SISAR",8,1145],N[62640]=[null,null,L.prototype.xd,L.prototype.pe,"SDSAR",8,1145],N[62656]=[null,null,L.prototype.ad,L.prototype.Wd,"KISDR",8,1145],N[62672]=[null,null,L.prototype.Zc,L.prototype.Ud,"KDSDR",8,1145],N[62688]=[null,null,L.prototype.$c, -L.prototype.Vd,"KISAR",8,1145],N[62704]=[null,null,L.prototype.Yc,L.prototype.Td,"KDSAR",8,1145],N[62798]=[null,null,L.prototype.gd,L.prototype.$d,"MMR3",1,1145],N[65382]=[null,null,L.prototype.bd,L.prototype.Xd,"LKS"],N[65400]=[null,null,L.prototype.Uc,L.prototype.Pd,"CNSL"],N[65402]=[null,null,L.prototype.dd,L.prototype.Zd,"MMR0",1,1145],N[65404]=[null,null,L.prototype.ed,L.prototype.Cc,"MMR1",1,1145],N[65406]=[null,null,L.prototype.fd,L.prototype.Cc,"MMR2",1,1145],N[65408]=[null,null,L.prototype.Gd, -L.prototype.ye,"UISDR",8,1145],N[65424]=[null,null,L.prototype.Ed,L.prototype.we,"UDSDR",8,1145],N[65440]=[null,null,L.prototype.Fd,L.prototype.xe,"UISAR",8,1145],N[65456]=[null,null,L.prototype.Dd,L.prototype.ve,"UDSAR",8,1145],N[65472]=[null,null,L.prototype.ub,L.prototype.yb,"R0SET0"],N[65473]=[null,null,L.prototype.ub,L.prototype.yb,"R1SET0"],N[65474]=[null,null,L.prototype.ub,L.prototype.yb,"R2SET0"],N[65475]=[null,null,L.prototype.ub,L.prototype.yb,"R3SET0"],N[65476]=[null,null,L.prototype.ub, -L.prototype.yb,"R4SET0"],N[65477]=[null,null,L.prototype.ub,L.prototype.yb,"R5SET0"],N[65478]=[null,null,L.prototype.md,L.prototype.ee,"R6KERNEL"],N[65479]=[null,null,L.prototype.pd,L.prototype.he,"R7KERNEL"],N[65480]=[null,null,L.prototype.vb,L.prototype.zb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.vb,L.prototype.zb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.vb,L.prototype.zb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.vb,L.prototype.zb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.vb, -L.prototype.zb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.vb,L.prototype.zb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.nd,L.prototype.fe,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.od,L.prototype.ge,"R6USER",1,1145],N[65504]=[null,null,L.prototype.Wc,L.prototype.Rd,"CTRL",1,1170],N[65520]=[null,null,L.prototype.wc,L.prototype.Dc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.wc,L.prototype.Dc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Cd,L.prototype.ue,"SYSID",1,1170],N[65526]= -[null,null,L.prototype.Vc,L.prototype.Qd,"CPUERR",1,1170],N[65528]=[null,null,L.prototype.cd,L.prototype.Yd,"MB",1,1170],N[65530]=[null,null,L.prototype.hd,L.prototype.ae,"PIR"],N[65532]=[null,null,L.prototype.Bd,L.prototype.te,"SL"],N[65534]=[null,null,L.prototype.ld,L.prototype.de,"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]; -Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,this.size>>2),Ic(this,vc?Jc:Kc);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ba:function(a,b){a&1&&K(this.w,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<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Pa=!0},P:function(a,b){if(this.i&&null!=this.D){var c=this.i;Pc(c,this.D+a,1,c.L)&&c.ja(!0)}return this.cc(a,b)},Y:function(a,b){if(this.i&&null!=this.D){var c=this.i;Pc(c,this.D+a,2,c.L)&&c.ja(!0)}return this.dc(a, -b)},ma:function(a,b,c){if(this.i&&null!=this.D){var d=this.i;Pc(d,this.D+a,1,d.C)&&d.ja(!0)}this.f?this.v(a,b,c):this.Wb(a,b,c)},za:function(a,b,c){if(this.i&&null!=this.D){var d=this.i;Pc(d,this.D+a,2,d.C)&&d.ja(!0)}this.f?this.v(a,b,c):this.hc(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},Na:function(a,b){a&1&&K(this.w,b,64,2);return this.F.getUint16(a,!0)},Z:function(a,b){a&1&&K(this.w, -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},la:function(a,b){this.G[a]=b;this.Pa=!0},ua:function(a,b,c){this.G[a]=b;this.Pa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},cb:function(a,b,c){a&1&&K(this.w,c,64,4);this.F.setUint16(a,b,!0);this.Pa=!0},Ja:function(a,b,c){a&1&&K(this.w,c,64,4);this.J[a>>1]=b;this.Pa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+ -J(this.i,b)+")",!0)}};function Wb(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&Oc(a,Nc,!1),(a.B=c.B)&&Mc(a,Nc,!1))}function Qc(a,b){b?--a.B||(a.Vb=a.f?a.v:a.Wb,a.Ib=a.f?a.I:a.hc):--a.g||(a.Rb=a.cc,a.ra=a.dc)}function Mc(a,b,c){c&&a.B||(a.Vb=!a.f&&b[1]||a.v,a.Ib=!a.f&&b[3]||a.I);if(c||void 0===c)a.Wb=b[1]||a.v,a.hc=b[3]||a.I}function Oc(a,b,c){c&&a.g||(a.Rb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.cc=b[0]||a.K,a.dc=b[2]||a.L}function Ic(a,b){b||(b=Rc);Oc(a,b,void 0);Mc(a,b,void 0)} -var Rc=[],Lc=[I.prototype.S,I.prototype.va,I.prototype.ba,I.prototype.Ka],Nc=[I.prototype.P,I.prototype.ma,I.prototype.Y,I.prototype.za];if(wb)var Kc=[I.prototype.N,I.prototype.la,I.prototype.Na,I.prototype.cb],Jc=[I.prototype.R,I.prototype.ua,I.prototype.Z,I.prototype.Ja]; -function Sc(a,b){u.call(this,"CPU",a,Sc,1);var c=a.multiplier||1;this.fb=a.cycles||b;this.Xa=c;this.nb=Math.round(this.fb/1E4)/100;this.hb=this.nb*this.Xa;this.A.ga=!1;this.A.Ub=!1;this.A.mb=a.autoStart;this.A.ob=!1;this.Cb=this.ma=0;this.Db=a.csStart;this.rb=a.csInterval;this.sb=a.csStop;this.K=[];this.tc=this.Ld.bind(this);H(this)}z(Sc);var Tc=["power","reset"];k=Sc.prototype; -k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b=a.ma&&(a.ma+=a.rb,c=!0);0<=a.sb&&a.sb<=Zc(a)&&(a.rb=a.sb=-1,Wc(a),a.ja(),c=!0);c&&a.j(Zc(a)+" cycles: checksum="+p(a.Cb))}} -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.B)if(a=d.B,a.A.ia)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;ca.Y/a.hb?b=1:d=!0;a.Xa=b;b=a.nb*a.Xa;if(a.hb!=b){a.hb=b;b=a.hb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.kb()}ad(a,a.S);a.S=0;a.R=Ba();a.Z=0;bd(a);return d}function lc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function nc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.fb*a.Xa/1E3*c|0,a.K[b][0]=c+cd(a))} -function dd(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 ed(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 cd(a,b){var c=a.ba-=a.b;a.b=a.J=0;b&&(a.ba=0);return c} -k.Ld=function(){if(this.A.ga){this.Ab>=this.fb&&bd(this,!0);this.za=0;this.eb=Ba();if(this.Z){var a=this.eb-this.Z;a>this.Ob&&(this.R+=a,this.R>this.eb&&(this.R=this.eb))}try{do{var b=dd(this,this.A.ob?1:this.bb);try{this.xb(b)}catch(e){if("number"!=typeof e)throw e;}b=cd(this,!0);this.za+=b;this.S+=b;Yc(this,b);ed(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.bb;15<=++this.sc&&(this.B&&this.B.ca(),this.sc=0);break}}while(this.A.ga)}catch(e){this.ja();this.B&&this.B.stop(Ba(),Zc(this));vb(this, -e.stack||e.message);return}if(this.A.ga){a=setTimeout;b=this.tc;this.Z=Ba();var c=this.Ob;this.za&&(c=Math.round(c*this.za/this.bb));var c=c-(this.Z-this.eb),d=this.Z-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.la=0,$c(this)));if(0>c||this.Yc&&(this.R-=c),c=0;this.Ab+=this.za;this.Z+=c;a(b,c)}}}; -k.wb=function(a){if(ub(this))return!1;if(this.A.ga)return this.j(this.toString()+" busy"),!1;$c(this);this.A.ga=!0;this.A.Ub=!0;var b=this.G.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.kb(!0),this.B.start(this.R,Zc(this)));setTimeout(this.tc,0);return!0};k.xb=function(){return 0};k.ja=function(a){var b=!1;if(this.A.ga){cd(this);ad(this,this.S);this.S=0;this.A.ga=!1;if(b=this.G.run)b.textContent="Run";this.B&&this.B.stop(Ba(),Zc(this));b=!0}this.A.complete=a;return b}; -function fd(a){this.qb=+a.model||1170;this.Jb=a.addrReset||0;Sc.call(this,a,6666667);this.decode=1120==this.qb?gd.bind(this):hd.bind(this);id(this);this.L=0;this.N=null;this.A.complete=!1}z(fd,Sc);k=fd.prototype;k.reset=function(){this.status("model "+this.qb);this.A.ga&&this.ja();id(this);Vc(this);this.A.error=!1;this.parent.reset.call(this)}; -function id(a){a.T=65536;a.U=32768;a.$=65535;a.X=32768;a.M=15;a.u=[0,0,0,0,0,0,0,a.Jb];a.Ra=[0,0,0,0,0,0];a.Fa=[0,0,0,0];a.v=0;a.Ka=0;a.Pc=[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.Gb=[0,0,0,0,0,0,0,0,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.zc=[0,0,0,0,0,0,0,0];a.yc=0;a.H=0;a.F=a.I=0;a.g=a.f=a.lb=0;a.va=-1;jd(a)}function jd(a){a.Za=255;a.fa=0;a.fc=0;a.C=0;a.Ya=0;a.Fb=0;a.ib=0;a.Wa=0;a.Ja=0;a.Mb=262143;a.N=null;a.w&&pc(a)}function pc(a){a.Wa?(a.P=65536,a.aa=a.Oc,a.ra=a.Id,a.Ib=a.Ae,Yb(a.w,a.ib&16?22:18)):(a.P=0,a.aa=a.Nc,a.ra=a.xc,a.Ib=a.Ec,Yb(a.w,16))}function kd(a,b,c){a.Jb=b;P(a,b);!c&&a.i&&(a.ja()||a.i.ca())}k.pc=function(){return 0}; -k.save=function(){var a=new R(this);a.set(0,[]);a.set(1,[this.la,this.Xa]);a.set(2,fc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.la=b[1];$c(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.M>>14&3;a.v!=c&&(a.Fa[c]=a.u[6],a.u[6]=a.Fa[a.v]);a.M=b;a.H|=2}function S(a,b){a.H&128||(a.X=a.$=b,a.U=0)}function qd(a,b,c){a.H&128||(a.X=a.$=a.T=b,a.U=c||0)}function rd(a,b,c,d){a.H&128||(a.X=a.$=a.T=b,a.U=(c^b)&(d^b))}function sd(a,b){a.H&128||(a.X=a.$=a.T=b,a.U=a.X^a.T>>1)} -function td(a,b,c,d){a.H&128||(a.X=a.$=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=Cb(this):this.v||(a=4,c=!0);this.C&57344||(this.Ya=63222,this.Fb=a);this.v=0;var d=this.ra(a|this.P),e=this.ra(a+2&65535|this.P);rc(this,e&-12289|this.va>>2&12288);c&&(this.fa|=4,this.u[6]=4);ud(this,this.va);ud(this,this.u[7]);P(this,d);this.H&=-113;this.va=-1;this.H|=8;this.Tc=a;this.Rc=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);P(a,b);rc(a,c);a.H&=-17}function ec(a,b){var c=b>>13&31;31>c&&a.ib&32&&(b=a.Gb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function Od(a,b,c){var d,e,f,g=0;d=b>>13;a.ib&a.Pc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.wa[a.v][d]<<6)+(b&8191)&a.Mb;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.v][d]=e;if(4194170!==f||a.v)a.Ja=a.v,a.Ka=d;b=!1;g&&(g&57344&&(0<=a.va&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ja<<5|a.Ka<<1),b=!0),a.C&61440||!(4191360> -f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.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(pd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(pd(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.Ya=a.Ya<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32?(a.fa|=4,a.u[6]=4,a.pa(4,24)):(a.fa|=8,a.H|=64));return e}k.Pb=function(a){if(!this.Wa)return this.w.Pb(a);this.L++;a=Pd(this,Od(this,a,3));this.L--;return a}; -k.pb=function(a){if(!this.Wa)return this.w.pb(a);this.L++;a=this.xc(Od(this,a,2));this.L--;return a};k.jb=function(a,b){this.Wa?(this.L++,Qd(this,Od(this,a,5),b),this.L--):this.w.jb(a,b)};k.Tb=function(a,b){this.Wa?(this.L++,this.Ec(Od(this,a,4),b),this.L--):this.w.Tb(a,b)};k.Nc=function(a,b,c){return Rd(this,a,b,c)};k.Oc=function(a,b,c){return Od(this,Rd(this,a,b,c),c)};k.xc=function(a){return this.w.oa(a)};k.Id=function(a){return this.w.oa(Od(this,a,2))};k.Ec=function(a,b){this.w.ab(a,b&65535)}; -k.Ae=function(a,b){this.w.ab(Od(this,a,4),b)};function Sd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Rd(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.Fa[a.M>>12&3];return c}function Td(a,b,c,d){a.C&57344||(a.Ya=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Rd(a,b,e,4),c&65536||(e&=65535),a.v=a.M>>12&3,e=Od(a,e|c&65536,4),a.v=a.M>>14&3,a.w.ab(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.u[e]=d:a.Fa[a.M>>12&3]=d} -function Ud(a,b){b>>=6;var c=a.I=b&7;return(b=a.F=(b&56)>>3)?Pd(a,a.aa(b,c,3)):a.u[c]&255}function Vd(a,b){b>>=6;var c=a.I=b&7;return(b=a.F=(b&56)>>3)?a.w.oa(a.aa(b,c,2)):a.u[c]}function Wd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Rd(a,b,c,8)}function Xd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Pd(a,a.aa(b,c,3)):a.u[c]&255}function Yd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(a.aa(b,c,2)):a.u[c]} -function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.lb=a.aa(b,e,7),Qd(a,e,d.call(a,c,Pd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function U(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.ab(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function Zd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Qd(a,a.aa(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 $d(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.ab(a.aa(b,d,4),c):a.u[d]=c&65535;return c}function V(a,b,c){c&&(P(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.xb=function(a){this.A.complete=!0;var b=this.i&&ae(this.i)?1:this.A.Ub?-1:0,c=a?this.A.Ub?0:1:-1;this.A.Ub=!1;this.ba=this.b=a;do{if(b){if(this.i&&be(this.i,this.u[7],c)){this.ja();break}c||c++;b++}if(this.H){this.H&112&&(this.H&32?this.pa(168,28):this.H&64?this.pa(4,30):this.H&16&&this.pa(12,32),this.H&=-113);if(a=this.H&7){a=!1;if(this.H&2){this.H&=-3;var d=160,e=(this.fc&224)>>5,f=this.N&&this.N.tb>e?this.N:null;f&&(d=f.Od,e=f.tb);e>(this.M&224)>>5?(this.H&4&&(pd(this,2),this.H&=-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.H&1&&this.H++;a=a&&0>c}if(a)break}this.H=this.H&7|this.M&16;this.decode(od(this))}while(0>1|b<<16;sd(this,a);return a&65535}function he(a,b){a=b&2048|b>>1|b<<8;sd(this,a<<8);return a&255}function ie(a,b){a=b&~a;S(this,a);return a}function je(a,b){a=b&~a;S(this,a<<8);return a}function ke(a,b){a|=b;S(this,a);return a}function le(a,b){a|=b;S(this,a<<8);return a} -function me(a,b){a=~b|65536;qd(this,a);return a&65535}function ne(a,b){a=~b|256;qd(this,a<<8);return a&255}function oe(a,b){a=b-a;this.H&128||(this.X=this.$=a,this.U=b&(b^a));return a&65535}function pe(a,b){a=b-a;var c=a<<8;b<<=8;this.H&128||(this.X=this.$=c,this.U=b&(b^c));return a&255}function qe(a,b){a=b+a;this.H&128||(this.X=this.$=a,this.U=a&(b^a));return a&65535}function re(a,b){a=b+a;var c=a<<8;this.H&128||(this.X=this.$=c,this.U=c&(b<<8^c));return a&255} -function se(a,b){a=-b;qd(this,a,a&b&32768);return a&65535}function te(a,b){a=-b;qd(this,a<<8,(a&b&128)<<8);return a&255}function ue(a,b){a=b<<1|this.T>>16&1;sd(this,a);return a&65535}function ve(a,b){a=b<<1|this.T>>16&1;sd(this,a<<8);return a&255}function we(a,b){a=(this.T&65536|b)>>1|b<<16;sd(this,a);return a&65535}function xe(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;sd(this,a<<8);return a&255}function ye(a,b){var c=b-a;td(this,c,a,b);return c&65535} -function ze(a,b){var c=b-a;td(this,c<<8,a<<8,b<<8);return c&255}function Ae(a,b){this.H&128||(this.X=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Be(a,b){a^=b;S(this,a);return a&65535}function Ce(a){U(this,a,Vd(this,a),ce);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function De(a){var b=Yd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.X=this.$=c;this.b-=(this.g?6:7)+b} -function Ee(a){var b=Yd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function Fe(a){V(this,a,!ld(this))}function Ge(a){V(this,a,ld(this))} -function He(a){U(this,a,Vd(this,a),ie);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Ie(a){T(this,a,Ud(this,a),je);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Je(a){U(this,a,Vd(this,a),ke);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Ke(a){T(this,a,Ud(this,a),le);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function Le(a){S(this,Vd(this,a)&Yd(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Me(a){S(this,(Ud(this,a)&Xd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Ne(a){V(this,a,nd(this))}function Oe(a){V(this,a,!this.Qa()==!md(this))}function Pe(a){V(this,a,!nd(this)&&!this.Qa()==!md(this))}function Qe(a){V(this,a,!ld(this)&&!nd(this))}function Re(a){V(this,a,nd(this)||!this.Qa()!=!md(this))} -function Se(a){V(this,a,ld(this)||nd(this))}function Te(a){V(this,a,!this.Qa()!=!md(this))}function Ue(a){V(this,a,this.Qa())}function Ve(a){V(this,a,!nd(this))}function We(a){V(this,a,!this.Qa())}function Xe(){this.pa(12,1);this.b-=5}function Ye(a){V(this,a,!0)}function Ze(a){V(this,a,!md(this))}function $e(a){V(this,a,md(this))}function W(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.X=0);this.b-=5} -function af(a){var b=Vd(this,a);a=Yd(this,a);td(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function bf(a){var b=Ud(this,a)<<8;a=Xd(this,a)<<8;td(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} -function cf(a){var b=Yd(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.$=d>>16|d,this.X=d>>16):(this.U=32768,this.$=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.$=this.X=0,this.U=32768,this.T=65536,this.b-=7}function df(){this.pa(24,2);this.b-=25} -function ef(){this.M&49152?(this.fa|=128,this.pa(4,3)):this.i?jc(this.i):this.ja();this.b-=7}function ff(){this.pa(16,4);this.b-=25}var gf=[0,7,7,10,7,11,9,13];function hf(a){this.J=this.b;P(this,Wd(this,a));this.b=this.J-gf[this.g]}var jf=[0,14,14,17,14,18,16,20];function kf(a){this.J=this.b;var b=Wd(this,a);a=a>>6&7;ud(this,this.u[a]);this.u[a]=this.u[7];P(this,b);this.b=this.J-jf[this.g]}var lf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function mf(a){var b=Vd(this,a);this.J=this.b;S(this,$d(this,a,b));this.b=this.J-lf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function nf(a){var b=Ud(this,a);S(this,Zd(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var of=[7,13,13,17,14,18,17,21]; -function pf(a){var b=Yd(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.H&128||(this.X=b>>16,this.$=this.X|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)P(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function wf(a){U(this,a,Vd(this,a),ye);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function xf(a){U(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)}function yf(){this.pa(28,5);this.b-=5}function zf(){this.H&4||this.B.ca();this.H|=4;pd(this,-2);this.b-=3}function Af(a){U(this,a,Vd(this,a),Be);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=jc(b);b||this.pa(8,6)}function gd(a){Bf[a>>12].call(this,a)}function Cf(a){Df[a>>6&3].call(this,a)}function Ef(a){Ff[a>>6&3].call(this,a)} -function Gf(a){Hf[a>>6&3].call(this,a)}function If(a){Jf[a&15].call(this,a)}function Kf(a){Lf[a&15].call(this,a)}function Mf(a){Nf[a>>6&3].call(this,a)}function Of(a){Pf[a>>6&3].call(this,a)}function Qf(a){Rf[a>>6&3].call(this,a)} -var Bf=[function(a){Sf[a>>8&15].call(this,a)},mf,af,Le,He,Je,Ce,X,function(a){Tf[a>>8&15].call(this,a)},nf,bf,Me,Ie,Ke,wf,X],Sf=[function(a){Uf[a>>4&15].call(this,a)},Ye,Ve,Ne,Oe,Te,Pe,Re,kf,kf,Cf,Ef,Gf,X,X,X],Df=[function(a){qd(this,$d(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,oe);this.b-=this.g?9:3+(7==this.f?2:0)}],Ff=[function(a){U(this,a,0, -se);this.b-=this.g?11:6},function(a){U(this,a,ld(this)?1:0,ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,ld(this)?1:0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Yd(this,a);qd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Hf=[function(a){U(this,a,0,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ee);this.b-=this.g?9:3+(7==this.f?2:0)}], -Uf=[function(a){Vf[a&15].call(this,a)},X,X,X,hf,hf,hf,hf,tf,X,If,Kf,xf,xf,xf,xf],Vf=[ef,zf,sf,Xe,ff,rf,X,X,X,X,X,X,X,X,X,X],Jf=[qf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},W,function(){this.$=1;this.b-=5},W,W,W,function(){this.X=0;this.b-=5},W,W,W,W,W,W,W],Lf=[qf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},uf,function(){this.$=0;this.b-=5},uf,uf,uf,function(){this.X=32768;this.b-=5},uf,uf,uf,uf,uf,uf,uf],Tf=[We,Ue,Qe,Se,Ze,$e,Fe,Ge,df,yf,Mf,Of,Qf,X,X, -X],Nf=[function(a){qd(this,Zd(this,a,0));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)},function(a){T(this,a,1,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,pe);this.b-=this.g?9:3+(7==this.f?2:0)}],Pf=[function(a){T(this,a,0,te);this.b-=this.g?11:6},function(a){T(this,a,ld(this)?1:0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,ld(this)?1:0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Xd(this,a);qd(this,a<< -8);this.b-=this.g?4:3+(7==this.f?2:0)}],Rf=[function(a){T(this,a,0,xe);this.b-=this.g?9+(this.lb&1):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,0,he);this.b-=this.g?9+(this.lb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,fe);this.b-=this.g?9:3+(7==this.f?2:0)}];function hd(a){Wf[a>>12].call(this,a)} -var Wf=[function(a){Xf[a>>8&15].call(this,a)},mf,af,Le,He,Je,Ce,function(a){Yf[a>>8&15].call(this,a)},function(a){Zf[a>>8&15].call(this,a)},nf,bf,Me,Ie,Ke,wf,X],Xf=[function(a){$f[a>>4&15].call(this,a)},Ye,Ve,Ne,Oe,Te,Pe,Re,kf,kf,Cf,Ef,Gf,function(a){ag[a>>6&3].call(this,a)},X,X],ag=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.P);P(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Sd(this,a,0);ud(this,a);S(this,a);this.b-=11},function(a){var b=wd(this);this.J= -this.b;Td(this,a,0,b);S(this,b);this.b=this.J-of[this.g]},function(a){S(this,$d(this,a,this.Qa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],$f=[function(a){bg[a&15].call(this,a)},X,X,X,hf,hf,hf,hf,tf,function(a){a&8?(this.M&49152||(this.M=this.M&-2017|(a&7)<<5,this.H|=1),this.b-=5):X.call(this,a)},If,Kf,xf,xf,xf,xf],bg=[ef,zf,sf,Xe,ff,rf,function(){vd(this);this.b-=13},X,X,X,X,X,X,X,X,X],Yf=[pf,pf,cf,cf,De,De,Ee,Ee,Af,Af,X,X,X,X,vf,vf],Zf=[We,Ue,Qe,Se,Ze,$e,Fe,Ge,df,yf,Mf,Of,Qf,function(a){cg[a>> -6&3].call(this,a)},X,X],cg=[X,function(a){a=Sd(this,a,65536);ud(this,a);S(this,a);this.b-=11},function(a){var b=wd(this);this.J=this.b;Td(this,a,65536,b);S(this,b);this.b=this.J-of[this.g]},X]; -function dg(a){u.call(this,"ROM",a,dg);this.ha=this.f=null;this.C=a.addr;this.g=a.size;this.v=a.alias;this.B=a.file;this.F=sa(this.B);if(this.B){a=this.B;var b=ta(this.F);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?c.O("Unable to load ROM resource (error "+f+": "+a+")"):(nb(c.Na,a,b),(a=Fa(a,b))?(c.f=a.da,c.ha=a.ha):c.B=null,eg(c))})}}z(dg);dg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;eg(this)}; -dg.prototype.Ea=function(){this.ha&&(this.i&&fg(this.i,this.id,this.C,this.g,this.ha),delete this.ha);return!0};dg.prototype.Da=function(){return!0}; -function eg(a){if(!tb(a)){if(a.B){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)vb(a,"ROM size ("+p(a.f.length,8,!0)+") does not match specified size ("+p(a.g,8,!0)+")");else{var b;b=a.C;if(ac(a.w,b,a.g,Hc)){var c;for(c=0;c>>a.ka;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),r=h,t=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.jb(n++,b[r++]&255);else n&1?a.b.ja():kd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&mc(e.b,e.la))});this.ma=oc(52,4);this.Z=lc(this.b,function(){e.g|=128;e.g&64&&mc(e.b,e.ma)});hc(b,this,Eg);H(this)}; -k.uc=function(){if(!this.J){var a=Uc(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.cb)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.Na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ea=function(a,b){if(!b)if(this.uc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Da=function(a){return a?this.save():!0};k.reset=function(){Fg(this)};k.save=function(){var a=new R(this);a.set(0,[]);return a.data()};k.restore=function(){return Fg(this)};function Fg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.ec=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.I%a,this.S&&(b=xa("",c)));this.P&&!this.I&&c&&(b=String.fromCharCode(this.P)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.I+=c}else if(null!=this.F){if(10==a||1024<=this.F.length)this.j(this.F), -this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;nc(this.b,this.Z,1E3/Math.round(this.R/10))}};var Gg={},Eg=(Gg[65392]=[null,null,Y.prototype.rd,Y.prototype.je,"RCSR"],Gg[65394]=[null,null,Y.prototype.qd,Y.prototype.ie,"RBUF"],Gg[65396]=[null,null,Y.prototype.Kd,Y.prototype.Ce,"XCSR"],Gg[65398]=[null,null,Y.prototype.Jd,Y.prototype.Be,"XBUF"],Gg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= -function(){var a=d.G.listTapes;a&&Jg(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;Jg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; -k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;this.S=Kg(a);var e=this;if((this.g=Uc(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.Y=oc(56,4);this.ba=lc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.A.ia;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Na,e,f),(e=Fa(e,f))&&Tg(a,b,c,d,e.da,e.Ha, -e.Ga));a.A.Ua=!1;a.F&&(a.F--,a.F||H(a));Qg(a)})}function Ng(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ta);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ac?"":e)+"&format=json"));return!!Ea(f, -null,!0,function(b,c,d){$g(a,b,c,d)})} -function $g(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.A.ia;if(d)a.controller.O('Unable to load disk "'+a.Sa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ta=h.length;a.ya=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Ia=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var w=m<<2,y=t.length;y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Aa?f=a.Ma+a.Aa&&(a.Aa+=f-(a.Ma+a.Aa)+1):(a.Ma=f,a.Aa=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Sa+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=bh(this,a++);)dh(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 dh(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){u.call(this,"RL11",a,O,2097152);this.v=a.autoMount||null;this.I=0;this.f=Array(1);this.L=!Pa("Mobi")&&window&&"FileReader"in window}z(O);k=O.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=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&eh(d,a)},!0;case "loadDrive":return this.G[b]= -c,c.onclick=function(){var a=d.G.listDisks;a&&fh(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[ma(a.value,10)||0])if(a=a.Ba){var b;b="";for(var c=0,h;h=bh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";eh(this,0)}}return!0};k.Da=function(a){return a?this.save():!0};k.reset=function(){gh(this)};k.save=function(){return(new R(this)).data()}; -k.restore=function(a){return gh(this,a[0])};function jh(a,b){b||(a.I=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}lh(a,e,b,c,!1,d)}else kh(a,e)} -function lh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.$a.toLowerCase()!=d.toLowerCase()&&(g++,kh(a,b,!0),h.$b?a.O("RL11 busy"):(h.$b=!0,e&&(h.Zb=!0,a.I++,F(a)&&E(a,"auto-loading disk: "+c)),h.Kb=!!f,Zg(new Vg(a,h,"preload"),c,d,f,a.Kc)&&g++));return g} -k.Kc=function(a,b,c,d,e){var f;a.$b=!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.ta||f[1]>a.ya)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.bc)),b=null);b?(a.Ba=b,a.Sa=c,a.$a=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.bc),a.Zb||e),this.B&&this.B.kb()):a.Kb=!1;a.Zb&&(a.Zb=!1,--this.I||H(this));eh(this,a.bc)}; -function ih(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.C=this.g=b<<7|(c?64:0)|d&63;this.F=65536-e&65535;a&&(this.ea=this.ea|a|32768);return!0}; -k.Xc=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.ab(f,r|t<<8);if(kc(this.w)){h=8192;break}f+=2;if(n>=l.Ia&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ta)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.Sd=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(kc(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.Ia&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ta)))){h=5120;break}}return g(h,b,c,d,e,f)};k.ud=function(){return this.ea&65535}; -k.me=function(a){this.ea=this.ea&-1023|a&1022;this.N=this.N&-4|(a&48)>>4;if(!(this.ea&128)){var b;a=!0;var c=this.f[(this.ea&768)>>8],d,e,f,g;this.ea&=-2;switch(this.ea&14){case 4:this.g&8&&(this.ea&=63);this.F=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.F=this.C;break;case 12:b=this.Xc;case 10:b||(b=this.Sd),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.ta||f>=c.qa?this.ea|=37888: -(g=(this.K&63)<<16|this.J,a=65536-this.F&65535,a=b.call(this,c,d,e,f,a,g,this.Lc.bind(this)))}a&&(this.ea|=129,this.ea&64&&mc(this.b,this.P))}};k.sd=function(){return this.J};k.ke=function(a){this.J=a&65534};k.vd=function(){return this.g};k.ne=function(a){this.g=a};k.wd=function(){return this.F};k.oe=function(a){this.F=a};k.td=function(){return this.K};k.le=function(a){this.K=a&63}; -var mh={},hh=(mh[63744]=[null,null,O.prototype.ud,O.prototype.me,"RLCS"],mh[63746]=[null,null,O.prototype.sd,O.prototype.ke,"RLBA"],mh[65284]=[null,null,O.prototype.vd,O.prototype.ne,"RLDA"],mh[65286]=[null,null,O.prototype.wd,O.prototype.oe,"RLMP"],mh[65288]=[null,null,O.prototype.td,O.prototype.le,"RLBE"],mh);function nh(a){u.call(this,"Debugger",a,nh);this.Z=a.base||16;this.za=!1;this.J=0;this.P=!1;this.v=-1;this.g=[];this.S={}}z(nh); -var oh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};nh.prototype.qc=function(){return-1};nh.prototype.rc=function(){}; -function ph(a,b,c,d){if(c)if(b){0>a.v&&a.g.length&&(a.v=0);if(0>a.v||b!=a.g[a.v])a.g.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.g[a.v+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 qh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +var wb="undefined"!==typeof ArrayBuffer,xb={cpu:1,trap:16,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.D=0;this.K=this.J=!1;this.g=this.B=this.v=0;this.L=20;this.I={};this.f={START:[1,!0,!1,this.$c],STEP:[1,!1,!1,this.ad],ENABLE:[1,!1,!1,this.Wc],CONT:[1,!0,!1,this.Uc],DEP:[0,!0,!1,this.Vc],EXAM:[1,!0,!1,this.Xc],LOAD:[1,!0,!1,this.Zc],TEST:[0,!0,!1,this.Yc]};for(a=0;22>a;a++)this.f["S"+a]=[0,!1,!1,this.bd,a]}z(yb);k=yb.prototype;k.reset=function(){this.L=this.L&-120|20}; +k.sa=function(a,b,c,d){if(this.C&&this.C.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.I[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= +a.f[b];zb(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);a.J="DEP"==b;a.K="EXAM"==b}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.f[b];c[1]&&c[2]&&(zb(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.C=a;this.w=b;this.b=c;this.i=d;Ab(b,this,Bb);Cb(b,this.reset.bind(this));Db(this);for(var e in this.f)zb(this,e,this.f[e][0])};k.Fa=function(a,b){b||Eb();return!0};k.Ea=function(){return!0}; +function Fb(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.$||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}function Gb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Db(a,b){for(var c in a.I)Gb(a,c,null!=b?b:a.I[c])}function zb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +k.$c=function(a){a||this.b.A.ca||(this.w.reset(),Ub(this.b),this.f.ENABLE&&this.f.ENABLE[0]&&this.b.bb())};k.ad=function(){};k.Wc=function(a){a||this.b.ha()};k.Uc=function(a){a||this.b.A.ca||(this.f.ENABLE&&this.f.ENABLE[0]?this.b.bb():(a=this.i)&&!sb(a,!0)?(rb(a,!0),a.cb(0),rb(a,!1)):(this.b.cb(1),this.Z()))};k.Vc=function(a){a&&!this.b.A.ca&&(this.J&&Vb(this,this.g+2),this.w.Ib(this.g,Wb(this,this.v)))};k.Xc=function(a){a||this.b.A.ca||(this.K&&Vb(this,this.g+2),Wb(this,this.w.lb(this.g)))}; +k.Zc=function(a){a||this.b.A.ca||Vb(this,this.v)};k.Yc=function(a){Db(this,a||null)};k.bd=function(a,b){this.v=a?this.v|1<c;c++)Gb(a,"A"+c,b&1<c;c++)Gb(a,"D"+c,b&1<>2;this.w=this.ya-1;this.B=this.I/this.ya|0;this.Ua=[];this.f=0;this.g=!1;this.v=[];this.Gc=[ac,bc,cc,dc];a=new I(this);ec(a,this.i);this.X=Array(this.B);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ua[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,64)&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;K(d,b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function bc(a,b,c){var d=!1,e=this.controller,f=e.Ua[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.Ua[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,64)&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(K(e,c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function cc(a,b){var c=-1,d=this.controller;(a=d.Ua[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,64)&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;K(d,b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function dc(a,b,c){var d=!1,e=this.controller;if(a=e.Ua[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,64)&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(K(e,c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function gc(a,b){if(b!=a.C){var c;a.C&&(c=(1<>>a.ka;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Kb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.F+n;f=m+a.ya;g-=n;h++;continue}}return lc(1,f,g)}f=new I(a,f,n,a.ya,d,e);ec(f,a.i,l);a.X[h++]=f;f=m+a.ya;g-=n}if(0>=g){c/=1024;var r;e="";r?10>>=a.ka;0>>=a.ka;0>>this.ka].Rb(a&this.w,a)};k.Qb=function(a){this.g=!1;this.f++;a=this.X[(a&this.Ra)>>>this.ka].bc(a&this.w,a);this.f--;return a}; +k.oa=function(a){3932160<=a&&(a=nc(this.b,a));return this.X[(a&this.Ra)>>>this.ka].ra(a&this.w,a)};k.lb=function(a){var b=a&this.w,c=(a&this.Ra)>>>this.ka;this.g=!1;this.f++;a=this.X[c].cc(b,a);this.f--;return a};k.Sb=function(a,b){3932160<=a&&(a=nc(this.b,a));this.X[(a&this.Ra)>>>this.ka].Ub(a&this.w,b&255,a)};k.nb=function(a,b){this.g=!1;this.f++;this.X[(a&this.Ra)>>>this.ka].Vb(a&this.w,b&255,a);this.f--}; +k.ab=function(a,b){3932160<=a&&(a=nc(this.b,a));this.X[(a&this.Ra)>>>this.ka].Lb(a&this.w,b&65535,a)};k.Ib=function(a,b){var c=a&this.w,d=(a&this.Ra)>>>this.ka;this.g=!1;this.f++;this.X[d].gc(c,b&65535,a);this.f--};function oc(a){for(var b=0,c=[],d=0;da.b.rb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null,n=f[5]||1;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var r=f[4],t=0;t>5&3;b.hb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.da!=c&&(b.da=c,wc(b));b.I&&b.I.Z()}};k.od=function(){var a=this.b.Ya;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.pd=function(){return this.b.Hb};k.qd=function(){return this.b.xb};k.he=function(a){var b=this.b;1170>b.rb&&(a&=-49);b.xb!=a&&(b.xb=a,b.qc=a&16?4194303:262143,wc(b),b.I&&b.I.Z())};k.Qd=function(a){a=a>>1&63;var b=this.b.Jb[a>>1];return a&1?b>>16:b&65535}; +k.He=function(a,b){b=b>>1&63;var c=b>>1;this.b.Jb[c]=b&1?this.b.Jb[c]&65535|(a&63)<<16:this.b.Jb[c]&-65536|a&65534};k.Jd=function(a){return this.b.V[1][a>>1&7]};k.Ae=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Hd=function(a){return this.b.V[1][(a>>1&7)+8]};k.ye=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Id=function(a){return this.b.xa[1][a>>1&7]};k.ze=function(a,b){b=b>>1&7;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.Gd=function(a){return this.b.xa[1][(a>>1&7)+8]}; +k.xe=function(a,b){b=(b>>1&7)+8;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.kd=function(a){return this.b.V[0][a>>1&7]};k.de=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.hd=function(a){return this.b.V[0][(a>>1&7)+8]};k.be=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.jd=function(a){return this.b.xa[0][a>>1&7]};k.ce=function(a,b){b=b>>1&7;this.b.xa[0][b]=a;this.b.V[0][b]&=65295};k.gd=function(a){return this.b.xa[0][(a>>1&7)+8]};k.ae=function(a,b){b=(b>>1&7)+8;this.b.xa[0][b]=a;this.b.V[0][b]&=65295}; +k.Pd=function(a){return this.b.V[3][a>>1&7]};k.Ge=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Nd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ee=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Od=function(a){return this.b.xa[3][a>>1&7]};k.Fe=function(a,b){b=b>>1&7;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Md=function(a){return this.b.xa[3][(a>>1&7)+8]};k.De=function(a,b){b=(b>>1&7)+8;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.vb=function(a){a&=7;return this.b.M&2048?this.b.Sa[a]:this.b.u[a]}; +k.yb=function(a,b){b&=7;this.b.M&2048?this.b.Sa[b]=a:this.b.u[b]=a};k.vd=function(){return this.b.M&49152?this.b.Ga[0]:this.b.u[6]};k.me=function(a){this.b.M&49152?this.b.Ga[0]=a:this.b.u[6]=a};k.yd=function(){return this.b.u[7]};k.pe=function(a){this.b.u[7]=a};k.wb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Sa[a]};k.zb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Sa[b]=a};k.wd=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ga[1]}; +k.ne=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ga[1]=a};k.xd=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ga[3]};k.oe=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ga[3]=a};k.ed=function(a){return this.b.zc[a-65504>>1]};k.Zd=function(a,b){this.b.zc[b-65504>>1]=a};k.wc=function(a){return 65520==a?61183:0};k.Dc=function(){};k.Ld=function(){return 1};k.Ce=function(){};k.dd=function(){return this.b.ga};k.Yd=function(){this.b.ga=0};k.md=function(){return this.b.yc}; +k.fe=function(a,b){b&1||(a&=255);this.b.yc=a};k.rd=function(a){return a?this.b.ec:0};k.ie=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ec=a;b.H|=2};k.Kd=function(a){return a?this.b.Za&65280:0};k.Be=function(a){this.b.Za=a|255};k.ud=function(){return Xb(this.b)};k.le=function(a){xc(this.b,a&-1809|Xb(this.b)&1808);this.b.H|=128};k.Cc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; +var N={},M=(N[61568]=[null,null,L.prototype.Qd,L.prototype.He,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Jd,L.prototype.Ae,"SISDR",8,1145],N[62608]=[null,null,L.prototype.Hd,L.prototype.ye,"SDSDR",8,1145],N[62624]=[null,null,L.prototype.Id,L.prototype.ze,"SISAR",8,1145],N[62640]=[null,null,L.prototype.Gd,L.prototype.xe,"SDSAR",8,1145],N[62656]=[null,null,L.prototype.kd,L.prototype.de,"KISDR",8,1145],N[62672]=[null,null,L.prototype.hd,L.prototype.be,"KDSDR",8,1145],N[62688]=[null,null,L.prototype.jd, +L.prototype.ce,"KISAR",8,1145],N[62704]=[null,null,L.prototype.gd,L.prototype.ae,"KDSAR",8,1145],N[62798]=[null,null,L.prototype.qd,L.prototype.he,"MMR3",1,1145],N[65382]=[null,null,L.prototype.ld,L.prototype.ee,"LKS"],N[65402]=[null,null,L.prototype.nd,L.prototype.ge,"MMR0",1,1145],N[65404]=[null,null,L.prototype.od,L.prototype.Cc,"MMR1",1,1145],N[65406]=[null,null,L.prototype.pd,L.prototype.Cc,"MMR2",1,1145],N[65408]=[null,null,L.prototype.Pd,L.prototype.Ge,"UISDR",8,1145],N[65424]=[null,null,L.prototype.Nd, +L.prototype.Ee,"UDSDR",8,1145],N[65440]=[null,null,L.prototype.Od,L.prototype.Fe,"UISAR",8,1145],N[65456]=[null,null,L.prototype.Md,L.prototype.De,"UDSAR",8,1145],N[65472]=[null,null,L.prototype.vb,L.prototype.yb,"R0SET0"],N[65473]=[null,null,L.prototype.vb,L.prototype.yb,"R1SET0"],N[65474]=[null,null,L.prototype.vb,L.prototype.yb,"R2SET0"],N[65475]=[null,null,L.prototype.vb,L.prototype.yb,"R3SET0"],N[65476]=[null,null,L.prototype.vb,L.prototype.yb,"R4SET0"],N[65477]=[null,null,L.prototype.vb,L.prototype.yb, +"R5SET0"],N[65478]=[null,null,L.prototype.vd,L.prototype.me,"R6KERNEL"],N[65479]=[null,null,L.prototype.yd,L.prototype.pe,"R7KERNEL"],N[65480]=[null,null,L.prototype.wb,L.prototype.zb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.wb,L.prototype.zb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.wb,L.prototype.zb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.wb,L.prototype.zb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.wb,L.prototype.zb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.wb, +L.prototype.zb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.wd,L.prototype.ne,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.xd,L.prototype.oe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.ed,L.prototype.Zd,"CTRL",1,1170],N[65520]=[null,null,L.prototype.wc,L.prototype.Dc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.wc,L.prototype.Dc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Ld,L.prototype.Ce,"SYSID",1,1170],N[65526]=[null,null,L.prototype.dd,L.prototype.Yd,"CPUERR",1,1170],N[65528]= +[null,null,L.prototype.md,L.prototype.fe,"MB",1,1170],N[65530]=[null,null,L.prototype.rd,L.prototype.ie,"PIR"],N[65532]=[null,null,L.prototype.Kd,L.prototype.Be,"SL"],N[65534]=[null,null,L.prototype.ud,L.prototype.le,"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]; +Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),Oc(this,Kc?Pc:Qc);else{a=this.b=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},da:function(a,b){a&1&&K(this.w,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<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Pa=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;Vc(c,this.F+a,1,c.L)&&c.ha(!0)}return this.bc(a,b)},Na:function(a,b){if(this.i&&null!=this.F){var c=this.i;Vc(c,this.F+a,2,c.L)&&c.ha(!0)}return this.cc(a, +b)},ma:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;Vc(d,this.F+a,1,d.B)&&d.ha(!0)}this.f?this.v(a,b,c):this.Vb(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;Vc(d,this.F+a,2,d.B)&&d.ha(!0)}this.f?this.v(a,b,c):this.gc(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},W:function(a,b){a&1&&K(this.w,b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&K(this.w, +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},la:function(a,b){this.G[a]=b;this.Pa=!0},ta:function(a,b,c){this.G[a]=b;this.Pa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&K(this.w,c,64,4);this.D.setUint16(a,b,!0);this.Pa=!0},fb:function(a,b,c){a&1&&K(this.w,c,64,4);this.J[a>>1]=b;this.Pa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+ +J(this.i,b)+")",!0)}};function ec(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&Uc(a,Tc,!1),(a.C=c.C)&&Sc(a,Tc,!1))}function Wc(a,b){b?--a.C||(a.Ub=a.f?a.v:a.Vb,a.Lb=a.f?a.I:a.gc):--a.g||(a.Rb=a.bc,a.ra=a.cc)}function Sc(a,b,c){c&&a.C||(a.Ub=!a.f&&b[1]||a.v,a.Lb=!a.f&&b[3]||a.I);if(c||void 0===c)a.Vb=b[1]||a.v,a.gc=b[3]||a.I}function Uc(a,b,c){c&&a.g||(a.Rb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.bc=b[0]||a.K,a.cc=b[2]||a.L}function Oc(a,b){b||(b=Xc);Uc(a,b,void 0);Sc(a,b,void 0)} +var Xc=[],Rc=[I.prototype.S,I.prototype.va,I.prototype.da,I.prototype.Ha],Tc=[I.prototype.O,I.prototype.ma,I.prototype.Na,I.prototype.Aa];if(wb)var Qc=[I.prototype.N,I.prototype.la,I.prototype.W,I.prototype.wa],Pc=[I.prototype.R,I.prototype.ta,I.prototype.$,I.prototype.fb]; +function Yc(a,b){u.call(this,"CPU",a,Yc,1);var c=a.multiplier||1;this.ib=a.cycles||b;this.Xa=c;this.Bb=Math.round(this.ib/1E4)/100;this.mb=this.Bb*this.Xa;this.A.ca=!1;this.A.Tb=!1;this.A.pb=a.autoStart;this.A.qb=!1;this.Eb=this.va=0;this.Fb=a.csStart;this.sb=a.csInterval;this.tb=a.csStop;this.L=[];this.uc=this.Ud.bind(this);H(this)}z(Yc);var Zc=["power","reset"];k=Yc.prototype; +k.Da=function(a,b,c,d){this.C=a;this.w=b;this.i=d;this.I=a.I;for(b=0;b=a.va&&(a.va+=a.sb,c=!0);0<=a.tb&&a.tb<=ed(a)&&(a.sb=a.tb=-1,bd(a),a.ha(),c=!0);c&&a.j(ed(a)+" cycles: checksum="+p(a.Eb))}} +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.C)if(a=d.C,a.A.ja)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;ca.$/a.mb?b=1:d=!0;a.Xa=b;b=a.Bb*a.Xa;if(a.mb!=b){a.mb=b;b=a.mb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ob()}gd(a,a.W);a.W=0;a.S=Ba();a.la=0;hd(a);return d}function sc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function uc(a,b,c){0<=b&&ba.L[b][0]&&(c=a.ib*a.Xa/1E3*c|0,a.L[b][0]=c+id(a))} +function jd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function kd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function id(a,b){var c=a.ma-=a.b;a.b=a.K=0;b&&(a.ma=0);return c} +k.Ud=function(){if(this.A.ca){this.Cb>=this.ib&&hd(this,!0);this.Ha=0;this.eb=Ba();if(this.la){var a=this.eb-this.la;a>this.rc&&(this.S+=a,this.S>this.eb&&(this.S=this.eb))}try{do{var b=jd(this,this.A.qb?1:this.kb);try{this.cb(b)}catch(e){if("number"!=typeof e)throw e;}b=id(this,!0);this.Ha+=b;this.W+=b;dd(this,b);kd(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.kb;15<=++this.tc&&(this.C&&this.C.Z(),this.tc=0);break}}while(this.A.ca)}catch(e){this.ha();this.C&&this.C.stop(Ba(),ed(this));vb(this, +e.stack||e.message);return}if(this.A.ca){a=setTimeout;b=this.uc;this.la=Ba();var c=this.rc;this.Ha&&(c=Math.round(c*this.Ha/this.kb));var c=c-(this.la-this.eb),d=this.la-this.S;d&&(this.$=Math.round(this.W/(10*d))/100,864E5<=d&&(this.ta=0,fd(this)));if(0>c||this.$c&&(this.S-=c),c=0;this.Cb+=this.Ha;this.la+=c;a(b,c)}}}; +k.bb=function(a){if(ub(this))return!1;if(this.A.ca)return this.j(this.toString()+" busy"),!1;fd(this);this.A.ca=!0;this.A.Tb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ob(!0),this.C.start(this.S,ed(this)));setTimeout(this.uc,0);return!0};k.cb=function(){return 0};k.ha=function(a){var b=!1;if(this.A.ca){id(this);gd(this,this.W);this.W=0;this.A.ca=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),ed(this));b=!0}this.A.complete=a;return b}; +function ld(a){this.rb=+a.model||1170;this.Ob=a.addrReset||0;Yc.call(this,a,6666667);this.decode=1120==this.rb?md.bind(this):nd.bind(this);od(this);this.N=0;this.O=null;this.A.complete=!1}z(ld,Yc);k=ld.prototype;k.reset=function(){this.status("model "+this.rb);this.A.ca&&this.ha();od(this);ad(this);this.A.error=!1;this.parent.reset.call(this)}; +function od(a){a.T=65536;a.U=32768;a.aa=65535;a.Y=32768;a.M=15;a.u=[0,0,0,0,0,0,0,a.Ob];a.Sa=[0,0,0,0,0,0];a.Ga=[0,0,0,0];a.v=0;a.hb=0;a.Pc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.xa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Jb=[0,0,0,0,0,0,0,0,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.zc=[0,0,0,0,0,0,0,0];a.yc=0;a.H=0;a.D=a.J=0;a.g=a.f=a.Ab=0;a.Aa=-1;Ub(a)}function Ub(a){a.Za=255;a.ga=0;a.ec=0;a.B=0;a.Ya=0;a.Hb=0;a.xb=0;a.da=0;a.gb=0;a.qc=262143;a.O=null;a.w&&wc(a)}function wc(a){a.da?(a.R=65536,a.ba=a.Oc,a.ra=a.Rd,a.Lb=a.Ie,gc(a.w,a.xb&16?22:18)):(a.R=0,a.ba=a.Nc,a.ra=a.xc,a.Lb=a.Ec,gc(a.w,16))}function pd(a,b,c){a.Ob=b;P(a,b);!c&&a.i&&(a.ha()||a.i.Z())}k.nc=function(){return 0}; +k.save=function(){var a=new R(this);a.set(0,[]);a.set(1,[this.ta,this.Xa]);a.set(2,oc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ta=b[1];fd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.M>>14&3;a.v!=c&&(a.Ga[c]=a.u[6],a.u[6]=a.Ga[a.v]);a.M=b;a.H|=2}function S(a,b){a.H&128||(a.Y=a.aa=b,a.U=0)}function vd(a,b,c){a.H&128||(a.Y=a.aa=a.T=b,a.U=c||0)}function wd(a,b,c,d){a.H&128||(a.Y=a.aa=a.T=b,a.U=(c^b)&(d^b))} +function xd(a,b){a.H&128||(a.Y=a.aa=a.T=b,a.U=a.Y^a.T>>1)}function yd(a,b,c,d){a.H&128||(a.Y=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.pa=function(a,b){if(!this.N){var c=!1;0>this.Aa?this.Aa=Xb(this):this.v||(a=4,c=!0);this.B&57344||(this.Ya=63222,this.Hb=a);this.v=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);xc(this,e&-12289|this.Aa>>2&12288);c&&(this.ga|=4,this.u[6]=4);zd(this,this.Aa);zd(this,this.u[7]);P(this,d);this.H&=-113;this.Aa=-1;this.H|=8;this.Tc=a;this.Sc=b;if(26!=b)throw a;}}; +function Ad(a){var b=Bd(a),c=Bd(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);P(a,b);xc(a,c);a.H&=-17}function nc(a,b){var c=b>>13&31;31>c&&a.xb&32&&(b=a.Jb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function Td(a,b,c){var d,e,f,g=0;d=b>>13;a.xb&a.Pc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.xa[a.v][d]<<6)+(b&8191)&a.qc;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.gb=a.v,a.hb=d;b=!1;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.B&57344||(a.B=a.B|g|a.gb<<5|a.hb<<1),b=!0),a.B&61440||!(4191360> +f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.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(ud(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(ud(a,2)),e=e+a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.B&57344||(a.Ya=a.Ya<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32?(a.ga|=4,a.u[6]=4,a.pa(4,24)):(a.ga|=8,a.H|=64));return e}k.Qb=function(a){if(!this.da)return this.w.Qb(a);this.N++;a=Ud(this,Td(this,a,3));this.N--;return a}; +k.lb=function(a){if(!this.da)return this.w.lb(a);this.N++;a=this.xc(Td(this,a,2));this.N--;return a};k.nb=function(a,b){this.da?(this.N++,Vd(this,Td(this,a,5),b),this.N--):this.w.nb(a,b)};k.Ib=function(a,b){this.da?(this.N++,this.Ec(Td(this,a,4),b),this.N--):this.w.Ib(a,b)};k.Nc=function(a,b,c){return Wd(this,a,b,c)};k.Oc=function(a,b,c){return Td(this,Wd(this,a,b,c),c)};k.xc=function(a){return this.w.oa(a)};k.Rd=function(a){return this.w.oa(Td(this,a,2))};k.Ec=function(a,b){this.w.ab(a,b&65535)}; +k.Ie=function(a,b){this.w.ab(Td(this,a,4),b)};function Xd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Wd(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.v=a.M>>12&3,c=a.ra(d|c&a.R),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 Yd(a,b,c,d){a.B&57344||(a.Ya=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Wd(a,b,e,4),c&65536||(e&=65535),a.v=a.M>>12&3,e=Td(a,e|c&65536,4),a.v=a.M>>14&3,a.w.ab(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.u[e]=d:a.Ga[a.M>>12&3]=d} +function Zd(a,b){b>>=6;var c=a.J=b&7;return(b=a.D=(b&56)>>3)?Ud(a,a.ba(b,c,3)):a.u[c]&255}function $d(a,b){b>>=6;var c=a.J=b&7;return(b=a.D=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]}function ae(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Wd(a,b,c,8)}function be(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Ud(a,a.ba(b,c,3)):a.u[c]&255}function ce(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 T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Ab=a.ba(b,e,7),Vd(a,e,d.call(a,c,Ud(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function U(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.w.ab(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function de(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Vd(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 ee(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.ab(a.ba(b,d,4),c):a.u[d]=c&65535;return c}function V(a,b,c){c&&(P(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.cb=function(a){this.A.complete=!0;var b=this.i&&fe(this.i)?1:this.A.Tb?-1:0,c=a?this.A.Tb?0:1:-1;this.A.Tb=!1;this.ma=this.b=a;do{if(b){if(this.i&&ge(this.i,this.u[7],c)){this.ha();break}c||c++;b++}if(this.H){this.H&112&&(this.H&32?this.pa(168,28):this.H&64?this.pa(4,30):this.H&16&&this.pa(12,32),this.H&=-113);if(a=this.H&7){a=!1;if(this.H&2){this.H&=-3;var d=160,e=(this.ec&224)>>5,f=this.O&&this.O.ub>e?this.O:null;f&&(d=f.Wd,e=f.ub);e>(this.M&224)>>5?(this.H&4&&(ud(this,2),this.H&=-5),this.pa(d, +26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.O,f==a)this.O=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.H&1&&this.H++;a=a&&0>c}if(a)break}this.H=this.H&7|this.M&16;this.decode(td(this))}while(0>1|b<<16;xd(this,a);return a&65535}function me(a,b){a=b&2048|b>>1|b<<8;xd(this,a<<8);return a&255}function ne(a,b){a=b&~a;S(this,a);return a}function oe(a,b){a=b&~a;S(this,a<<8);return a}function pe(a,b){a|=b;S(this,a);return a}function qe(a,b){a|=b;S(this,a<<8);return a} +function re(a,b){a=~b|65536;vd(this,a);return a&65535}function se(a,b){a=~b|256;vd(this,a<<8);return a&255}function te(a,b){a=b-a;this.H&128||(this.Y=this.aa=a,this.U=b&(b^a));return a&65535}function ue(a,b){a=b-a;var c=a<<8;b<<=8;this.H&128||(this.Y=this.aa=c,this.U=b&(b^c));return a&255}function ve(a,b){a=b+a;this.H&128||(this.Y=this.aa=a,this.U=a&(b^a));return a&65535}function we(a,b){a=b+a;var c=a<<8;this.H&128||(this.Y=this.aa=c,this.U=c&(b<<8^c));return a&255} +function xe(a,b){a=-b;vd(this,a,a&b&32768);return a&65535}function ye(a,b){a=-b;vd(this,a<<8,(a&b&128)<<8);return a&255}function ze(a,b){a=b<<1|this.T>>16&1;xd(this,a);return a&65535}function Ae(a,b){a=b<<1|this.T>>16&1;xd(this,a<<8);return a&255}function Be(a,b){a=(this.T&65536|b)>>1|b<<16;xd(this,a);return a&65535}function Ce(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;xd(this,a<<8);return a&255}function De(a,b){var c=b-a;yd(this,c,a,b);return c&65535} +function Ee(a,b){var c=b-a;yd(this,c<<8,a<<8,b<<8);return c&255}function Fe(a,b){this.H&128||(this.Y=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ge(a,b){a^=b;S(this,a);return a&65535}function He(a){U(this,a,$d(this,a),he);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Ie(a){var b=ce(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Y=this.aa=c;this.b-=(this.g?6:7)+b} +function Je(a){var b=ce(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.Y=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Ke(a){V(this,a,!qd(this))}function Le(a){V(this,a,qd(this))} +function Me(a){U(this,a,$d(this,a),ne);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ne(a){T(this,a,Zd(this,a),oe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Oe(a){U(this,a,$d(this,a),pe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Pe(a){T(this,a,Zd(this,a),qe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Qe(a){S(this,$d(this,a)&ce(this,a));this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Re(a){S(this,(Zd(this,a)&be(this,a))<<8);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Se(a){V(this,a,sd(this))}function Te(a){V(this,a,!this.Qa()==!rd(this))}function Ue(a){V(this,a,!sd(this)&&!this.Qa()==!rd(this))}function Ve(a){V(this,a,!qd(this)&&!sd(this))}function We(a){V(this,a,sd(this)||!this.Qa()!=!rd(this))} +function Xe(a){V(this,a,qd(this)||sd(this))}function Ye(a){V(this,a,!this.Qa()!=!rd(this))}function Ze(a){V(this,a,this.Qa())}function $e(a){V(this,a,!sd(this))}function af(a){V(this,a,!this.Qa())}function bf(){this.pa(12,1);this.b-=5}function cf(a){V(this,a,!0)}function df(a){V(this,a,!rd(this))}function ef(a){V(this,a,rd(this))}function W(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.Y=0);this.b-=5} +function ff(a){var b=$d(this,a);a=ce(this,a);yd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function gf(a){var b=Zd(this,a)<<8;a=be(this,a)<<8;yd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} +function hf(a){var b=ce(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.Y=d>>16):(this.U=32768,this.aa=d>>15|d,this.Y=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.Y=0,this.U=32768,this.T=65536,this.b-=7}function jf(){this.pa(24,2);this.b-=25} +function kf(){this.M&49152?(this.ga|=128,this.pa(4,3)):this.i?qc(this.i):this.ha();this.b-=7}function lf(){this.pa(16,4);this.b-=25}var mf=[0,7,7,10,7,11,9,13];function nf(a){this.K=this.b;P(this,ae(this,a));this.b=this.K-mf[this.g]}var of=[0,14,14,17,14,18,16,20];function pf(a){this.K=this.b;var b=ae(this,a);a=a>>6&7;zd(this,this.u[a]);this.u[a]=this.u[7];P(this,b);this.b=this.K-of[this.g]}var qf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function rf(a){var b=$d(this,a);this.K=this.b;S(this,ee(this,a,b));this.b=this.K-qf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function sf(a){var b=Zd(this,a);S(this,de(this,a,b,1)<<8);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var tf=[7,13,13,17,14,18,17,21]; +function uf(a){var b=ce(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.H&128||(this.Y=b>>16,this.aa=this.Y|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)P(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Bf(a){U(this,a,$d(this,a),De);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Cf(a){U(this,a,0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)}function Df(){this.pa(28,5);this.b-=5}function Ef(){this.H&4||this.C.Z();this.H|=4;ud(this,-2);this.b-=3}function Ff(a){U(this,a,$d(this,a),Ge);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=qc(b);b||this.pa(8,6)}function md(a){Gf[a>>12].call(this,a)}function Hf(a){If[a>>6&3].call(this,a)}function Jf(a){Kf[a>>6&3].call(this,a)} +function Lf(a){Mf[a>>6&3].call(this,a)}function Nf(a){Of[a&15].call(this,a)}function Pf(a){Qf[a&15].call(this,a)}function Rf(a){Sf[a>>6&3].call(this,a)}function Tf(a){Uf[a>>6&3].call(this,a)}function Vf(a){Wf[a>>6&3].call(this,a)} +var Gf=[function(a){Xf[a>>8&15].call(this,a)},rf,ff,Qe,Me,Oe,He,X,function(a){Yf[a>>8&15].call(this,a)},sf,gf,Re,Ne,Pe,Bf,X],Xf=[function(a){Zf[a>>4&15].call(this,a)},cf,$e,Se,Te,Ye,Ue,We,pf,pf,Hf,Jf,Lf,X,X,X],If=[function(a){vd(this,ee(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,te);this.b-=this.g?9:3+(7==this.f?2:0)}],Kf=[function(a){U(this,a,0, +xe);this.b-=this.g?11:6},function(a){U(this,a,qd(this)?1:0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,qd(this)?1:0,De);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ce(this,a);vd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Mf=[function(a){U(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,je);this.b-=this.g?9:3+(7==this.f?2:0)}], +Zf=[function(a){$f[a&15].call(this,a)},X,X,X,nf,nf,nf,nf,yf,X,Nf,Pf,Cf,Cf,Cf,Cf],$f=[kf,Ef,xf,bf,lf,wf,X,X,X,X,X,X,X,X,X,X],Of=[vf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},W,function(){this.aa=1;this.b-=5},W,W,W,function(){this.Y=0;this.b-=5},W,W,W,W,W,W,W],Qf=[vf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},zf,function(){this.aa=0;this.b-=5},zf,zf,zf,function(){this.Y=32768;this.b-=5},zf,zf,zf,zf,zf,zf,zf],Yf=[af,Ze,Ve,Xe,df,ef,Ke,Le,jf,Df,Rf,Tf,Vf,X, +X,X],Sf=[function(a){vd(this,de(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,ue);this.b-=this.g?9:3+(7==this.f?2:0)}],Uf=[function(a){T(this,a,0,ye);this.b-=this.g?11:6},function(a){T(this,a,qd(this)?1:0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,qd(this)?1:0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=be(this,a);vd(this, +a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Wf=[function(a){T(this,a,0,Ce);this.b-=this.g?9+(this.Ab&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,me);this.b-=this.g?9+(this.Ab&1):3+(7==this.f?2:0)},function(a){T(this,a,0,ke);this.b-=this.g?9:3+(7==this.f?2:0)}];function nd(a){ag[a>>12].call(this,a)} +var ag=[function(a){bg[a>>8&15].call(this,a)},rf,ff,Qe,Me,Oe,He,function(a){cg[a>>8&15].call(this,a)},function(a){dg[a>>8&15].call(this,a)},sf,gf,Re,Ne,Pe,Bf,X],bg=[function(a){eg[a>>4&15].call(this,a)},cf,$e,Se,Te,Ye,Ue,We,pf,pf,Hf,Jf,Lf,function(a){fg[a>>6&3].call(this,a)},X,X],fg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);P(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Xd(this,a,0);zd(this,a);S(this,a);this.b-=11},function(a){var b=Bd(this);this.K= +this.b;Yd(this,a,0,b);S(this,b);this.b=this.K-tf[this.g]},function(a){S(this,ee(this,a,this.Qa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],eg=[function(a){gg[a&15].call(this,a)},X,X,X,nf,nf,nf,nf,yf,function(a){a&8?(this.M&49152||(this.M=this.M&-2017|(a&7)<<5,this.H|=1),this.b-=5):X.call(this,a)},Nf,Pf,Cf,Cf,Cf,Cf],gg=[kf,Ef,xf,bf,lf,wf,function(){Ad(this);this.b-=13},X,X,X,X,X,X,X,X,X],cg=[uf,uf,hf,hf,Ie,Ie,Je,Je,Ff,Ff,X,X,X,X,Af,Af],dg=[af,Ze,Ve,Xe,df,ef,Ke,Le,jf,Df,Rf,Tf,Vf,function(a){hg[a>> +6&3].call(this,a)},X,X],hg=[X,function(a){a=Xd(this,a,65536);zd(this,a);S(this,a);this.b-=11},function(a){var b=Bd(this);this.K=this.b;Yd(this,a,65536,b);S(this,b);this.b=this.K-tf[this.g]},X]; +function ig(a){u.call(this,"ROM",a,ig);this.ia=this.f=null;this.B=a.addr;this.g=a.size;this.v=a.alias;this.C=a.file;this.D=sa(this.C);if(this.C){a=this.C;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(nb(c.Na,a,b),(a=Fa(a,b))?(c.f=a.ea,c.ia=a.ia):c.C=null);jg(c)})}}z(ig);ig.prototype.Da=function(a,b,c,d){this.w=b;this.b=c;this.i=d;jg(this)}; +ig.prototype.Fa=function(){this.ia&&(this.i&&kg(this.i,this.id,this.B,this.g,this.ia),delete this.ia);return!0};ig.prototype.Ea=function(){return!0}; +function jg(a){if(!tb(a)){if(a.C){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.B;if(jc(a.w,b,a.g,Nc)){var c;for(c=0;c>>a.ka;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),r=h,t=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.nb(n++,b[r++]&255);else n&1?a.b.ha():pd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&tc(e.b,e.la))});this.ma=vc(52,4);this.$=sc(this.b,function(){e.g|=128;e.g&64&&tc(e.b,e.ma)});Ab(b,this,Jg);H(this)}; +k.sc=function(){if(!this.J){var a=$c(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.fb)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.Na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Fa=function(a,b){if(!b)if(this.sc(),!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(){Kg(this)};k.save=function(){var a=new R(this);a.set(0,[]);return a.data()};k.restore=function(){return Kg(this)};function Kg(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.dc=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.I%a,this.S&&(b=xa("",c)));this.O&&!this.I&&c&&(b=String.fromCharCode(this.O)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.I+=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;uc(this.b,this.$,1E3/Math.round(this.R/10))}};var Lg={},Jg=(Lg[65392]=[null,null,Y.prototype.Ad,Y.prototype.re,"RCSR"],Lg[65394]=[null,null,Y.prototype.zd,Y.prototype.qe,"RBUF"],Lg[65396]=[null,null,Y.prototype.Td,Y.prototype.Ke,"XCSR"],Lg[65398]=[null,null,Y.prototype.Sd,Y.prototype.Je,"XBUF"],Lg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= +function(){var a=d.G.listTapes;a&&Og(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){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;Og(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.C=a;this.w=b;this.b=c;this.i=d;this.S=Pg(a);var e=this;if((this.g=$c(this.C,"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.W=vc(56,4);this.da=sc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.A.ja;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Na,e,f),(e=Fa(e,f))&&Yg(a,b,c,d,e.ea,e.Ja, +e.Ia));a.A.Va=!1;a.D&&(a.D--,a.D||H(a));Vg(a)})}function Sg(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ua);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.$b?"":e)+"&format=json"));return!!Ea(f, +null,!0,function(b,c,d){eh(a,b,c,d)})} +function eh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ja;if(d)a.controller.P('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{nb(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.za=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>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var w=m<<2,y=t.length;y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f=a.Ma+a.Ba&&(a.Ba+=f-(a.Ma+a.Ba)+1):(a.Ma=f,a.Ba=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.P("Unable to restore disk '"+this.Ta+": "+c);return b}; +k.toJSON=function(){var a;a=0;for(var b;b=gh(this,a++);)ih(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 ih(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){u.call(this,"RL11",a,O,2097152);this.v=a.autoMount||null;this.I=0;this.f=Array(1);this.L=!Pa("Mobi")&&window&&"FileReader"in window}z(O);k=O.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=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&jh(d,a)},!0;case "loadDrive":return this.G[b]= +c,c.onclick=function(){var a=d.G.listDisks;a&&kh(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[ma(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=gh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";jh(this,0)}}return!0};k.Ea=function(a){return a?this.save():!0};k.reset=function(){lh(this)};k.save=function(){return(new R(this)).data()}; +k.restore=function(a){return lh(this,a[0])};function oh(a,b){b||(a.I=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('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+'"')}qh(a,e,b,c,!1,d)}else ph(a,e)} +function qh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.$a.toLowerCase()!=d.toLowerCase()&&(g++,ph(a,b,!0),h.Zb?a.P("RL11 busy"):(h.Zb=!0,e&&(h.Yb=!0,a.I++,F(a)&&E(a,"auto-loading disk: "+c)),h.Mb=!!f,dh(new $g(a,h,"preload"),c,d,f,a.Kc)&&g++));return g} +k.Kc=function(a,b,c,d,e){var f;a.Zb=!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.za)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.ac)),b=null);b?(a.Ca=b,a.Ta=c,a.$a=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.ac),a.Yb||e),this.C&&this.C.ob()):a.Mb=!1;a.Yb&&(a.Yb=!1,--this.I||H(this));jh(this,a.ac)}; +function nh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; +k.fd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ca.read(m,n++))||0>(t=a.Ca.read(m,n++))){h=5120;break}this.w.ab(f,r|t<<8);if(rc(this.w)){h=8192;break}f+=2;if(n>=l.Ka&&(m=null,++d>=l.qa&&(d=0,++c>=l.za&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.$d=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var r=this.w.oa(f);if(rc(this.w)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,r&255)||!a.Ca.write(m,n++,r>>8)){h=5120;break}if(n>=l.Ka&&(m=null,++d>=l.qa&&(d=0,++c>=l.za&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Dd=function(){return this.fa&65535}; +k.ue=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.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.fd;case 10:b||(b=this.$d),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.Lc.bind(this)))}a&&(this.fa|=129,this.fa&64&&tc(this.b,this.O))}};k.Bd=function(){return this.J};k.se=function(a){this.J=a&65534};k.Ed=function(){return this.g};k.ve=function(a){this.g=a};k.Fd=function(){return this.D};k.we=function(a){this.D=a};k.Cd=function(){return this.K};k.te=function(a){this.K=a&63}; +var rh={},mh=(rh[63744]=[null,null,O.prototype.Dd,O.prototype.ue,"RLCS"],rh[63746]=[null,null,O.prototype.Bd,O.prototype.se,"RLBA"],rh[65284]=[null,null,O.prototype.Ed,O.prototype.ve,"RLDA"],rh[65286]=[null,null,O.prototype.Fd,O.prototype.we,"RLMP"],rh[65288]=[null,null,O.prototype.Cd,O.prototype.te,"RLBE"],rh);function sh(a){u.call(this,"Debugger",a,sh);this.$=a.base||16;this.wa=!1;this.J=0;this.O=!1;this.v=-1;this.g=[];this.S={}}z(sh); +var th={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};sh.prototype.oc=function(){return-1};sh.prototype.pc=function(){}; +function uh(a,b,c,d){if(c)if(b){0>a.v&&a.g.length&&(a.v=0);if(0>a.v||b!=a.g[a.v])a.g.splice(0,0,b),a.v=0;a.v--}else a.O?b="end":b=a.g[a.v+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 vh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function rh(a,b,c){var d;if(b){b=sh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function vh(a,b){if(b)return uh(a,b,a.S[b]);var c=0;for(b in a.S)uh(a,b,a.S[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Ah(a,b){if(b)return zh(a,b,a.S[b]);var c=0;for(b in a.S)zh(a,b,a.S[b]),c++;return 0this.b.qb?Eh:[];Fh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(Gh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=dc[c],n&&d.j(p(n.id,8)+" %"+p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.rc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ra[a-8]:20>a?b=this.b.Fa[a-16]:20==a&&(b=Cb(this.b)));return b}; -k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Fb).D));this.na&1073741824?this.ua.push(a):this.ba&&a==this.ba||(this.ba=a,this.na&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,cd(a),a.ua=0,a.B.ca()))};function yh(a){var b;if(!ae(a))a.F&&a.F.length&&a.j("instruction history buffer freed"),a.Y=0,a.F=[];else if(!a.F||!a.F.length){a.F=Array(1E3);for(b=0;b>8;this.j("trapped to "+J(this,b&255,1)+(c?" ("+J(this,c)+")":""))}this.K=Z(this.b.u[7]);a&&1!=this.R?Nh(this):Oh(this)}};function Mh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.ga?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ea=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Da=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){yh(this);this.va=0;this.ba=null;this.J=0;this.K=Z(this.b.u[7]);this.A.ga=!1;Ph(this);a||this.ca()};k.save=function(){var a=new R(this);a.set(0,Ih(this.K));a.set(1,Ih(this.N));a.set(2,[this.g,this.P,this.na]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Jh(a[b++]),this.N=Jh(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.P=a[b][1],this.na|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.R||this.j("running");this.A.ga=!0;this.Jb=a;this.Mb=b}; -k.stop=function(a,b){if(this.A.ga){this.A.ga=!1;this.J=b-this.Mb;if(!this.R){b="stopped";if(this.J){a-=this.Jb;var c=0d&&(d=a.b.pb(b)),65535!=(d&65535)&&(c=a.F[a.Y],c.D=b,c.La=!1,++a.Y==a.F.length&&(a.Y=0)));return!1}function jc(a){var b=a.b;if(b.A.ga)throw P(b,a.b.Fb),a.ja(),-1;return!1} -function xh(a){var b,c;a.f=["bp"];if(a.L)for(b=1;b>>d.ka],!1)}a.L=["br"];if(a.C)for(b=1;b>>d.ka],!0);a.C=["bw"];a.bb=0}k.gb=function(a,b,c){var d=!0;c||Qh(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.D)),d=!1;else{var f=this.w;f.W[e>>>f.ka].gb(e&f.w,a==this.C)}}d&&(a.push(b),c?b.La=!0:(Rh(this,a,a.length-1,"set"),yh(this)));return d}; -function Qh(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.ka],b==a.C));h.La||yh(a);break}}return f}function Sh(a,b){for(var c=1;c>23)&65535,x=J(w,t);else if(8192==A)t=t.D-((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=Lh(y);break;case 8:x="@"+Lh(y);break;case 16:7>y?x="("+Lh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Lh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Lh(y)+")";break;case 40:x="@-("+Lh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Lh(y)+")";7==y&&(x=J(w,A+t.D&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Lh(y)+")",7==y&&(x="@"+J(w,A+t.D&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); -0b?(c=Lh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ra[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Fa[b-16]):20==b&&(c="PS="+J(a,Cb(d)));c&&(c+=" ");return c}function Xh(a){var b,c="";for(b=0;6>b;b++)c+=Wh(a,b);c=c+"\n"+(Wh(a,6)+Wh(a,7)+Wh(a,20));return c+=Vh(a,"T")+Vh(a,"N")+Vh(a,"Z")+Vh(a,"V")+Vh(a,"C")}k.kc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.kc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Je:b,D:c,Sc:d,ha:e,ic:f})}function Yh(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.Sc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.ca();a.j("updated registers:")}a.j(Xh(a));c&&(a.K=Z(d.u[7]),Oh(a,J(a,a.K.D)))}}function bi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=Uh(a,b,g,f);a.j(f);a.K=b;e-=b.D-l;c++}}} -function Th(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.P&&(a.j("ended assemble at "+J(a,a.N.D)),a.K=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ba=null;if(tb(a)&&0n||"z"oa.length&&(a.j("note: only "+oa.length+" available"),ba=oa.length);ga-=ba;0>ga&&(null==oa[oa.length-1].D?(ba=ga+ba,ga=0):ga+=oa.length);var zd=[];"call"==ng&&(Eb=1E5,zd=["CALL"]);for(void 0!==mg&&a.j(ba+" instructions earlier:");0=oa.length&&(ga=0);a.lb=ba;pg++;Eb--}}pg||(a.j("no "+og+"history available"),a.lb=void 0)}else{var Gb=Gh(a,na);if(Gb){var wc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||vi),wc=th(a,La)>>>0,65536>4||1;xi--&&0Ac?String.fromCharCode(Ac):".";xc-=zc}Hb&&(Hb+="\n");Hb+=na+" "+Ad+(0==Jb?" "+sg:"")}Hb&&a.j(Hb);a.eb=Gb}}}}break;case "e":if("else"==g[0])break;var hb,Bd,Cd,Dd,Ed=g[0],Fd=g[1];"eb"==Ed?(hb=1,Bd=255,Cd=a.Bb,Dd=a.Sb):"e"==Ed||"ew"==Ed?(hb=2,Bd=65535,Cd=a.oa,Dd=a.ab):Fd=null;if(null==Fd)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 Bc=Gh(a,Fd);if(Bc)for(var Cc= -2;CcId;){for(var Ma=null,Bi=256;65536>Mb.D>>>0;){Jd.D=a.oa(Mb,2);if(null==Mb.D||!Bi--)break;if(!(Jd.D&1)){for(var Ci=a,Dc=Jd,ug=null,Nb=Dc.D,vg=Nb,Kd=1;6>=Kd&&Nb;Kd++){if(2< -Kd){Dc.D=Nb;var Ec=Uh(Ci,Dc);if(0<=Ec.indexOf("JSR")){var wg=Ec.indexOf(" ");if(Nb+(Ec.indexOf(" ",wg+1)-wg-1)/2==vg){ug=Ec;break}}}Nb-=2}Dc.D=vg;if(Ma=ug)break}}if(!Ma||null==Ma)break;var xg=null;if("ks"==Ai){var yg=Ma.match(/[0-9A-F]+$/);yg&&(xg=ai(a,yg[0]))}Ma=xa(Ma,50)+" ;"+(xg||"stack="+J(a,Mb.D));a.j(Ma);Id++}Id||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){ai(a,g[1],!0);break}f=!0;break;case "m":a:{var pa,qa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Da=0;if("all"== -G)Da=1878917119,G=null;else if("on"==G)qa=!0,G=null;else if("off"==G)qa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(pa in xb)if(G==pa){Da=xb[pa];qa=!!(a.na&Da);break}if(!Da){a.j("unknown message category: "+G);break a}}if(Da)if("on"==g[2])a.na|=Da,qa=!0;else if("off"==g[2]&&(a.na&=~Da,qa=!1,1073741824==Da)){for(var Ld=0;Ld\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bgi){if(ii(d,this.J)){this.C=new R(this,"1.30.2","failsafe");ii(this.C)&&(ni(this,d),a=2,oi(this.C));this.C.set("timestamp",Ca());pi(this.C);var e=this.f&&!this.F;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=mi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ii(d,g):("error"== -f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.g=null)):this.j(f+": "+g),oi(d),ii(d)?(c=mi(d),e=!0):c=!1))}e&&li(this,c?d:null)}else 2==a&&d.clear()}else li(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;fa[1];a=a[2];this.ba=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(qi(this,this.b,b,c,a),this.b.mb());this.P&&(ni(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.B=0}; -function ni(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.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.Z;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} -function di(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new R(a,"1.30.2"),g=new R(a,"1.30.2","validate"),h=Ca();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.Da&&(c&&a.b.ja(),d=a.b.Da(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Ii(a,b,c)}})}else c(a,null)} -function Ji(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&&(--ui||Za(!0));l=!1}var g,h,l=!0;ui++;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?Gi(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,--ui||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),--ui||Za(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Gi(b,a,d,!0,e,m):Hi(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 Ji(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map +63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Ih=[0],Jh= +[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Bh.prototype; +k.Da=function(a,b,c,d){this.w=b;this.b=c;this.C=a;(a=$c(a,"messages"))&&Eh(this,a);this.kb=Hh;this.Ab=1145>this.b.rb?Jh:[];Kh(this,function(a){a:{var b=d.w.X,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Lh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=mc[c],n&&d.j(p(n.id,8)+" %"+p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.pc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Sa[a-8]:20>a?b=this.b.Ga[a-16]:20==a&&(b=Xb(this.b)));return b}; +k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Hb).F));this.na&1073741824?this.ta.push(a):this.da&&a==this.da||(this.da=a,this.na&-2147483648&&(this.ha(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,id(a),a.wa=0,a.C.Z()))};function Dh(a){var b;if(!fe(a))a.D&&a.D.length&&a.j("instruction history buffer freed"),a.W=0,a.D=[];else if(!a.D||!a.D.length){a.D=Array(1E3);for(b=0;b>8;this.j("trapped to "+J(this,b&255,1)+(c?" ("+J(this,c)+")":""))}this.K=Z(this.b.u[7]);a&&1!=this.R?Sh(this):Th(this)}};function Rh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.A.ja?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.ca?(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.Ea=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Dh(this);this.va=0;this.da=null;this.J=0;this.K=Z(this.b.u[7]);this.A.ca=!1;Uh(this);a||this.Z()};k.save=function(){var a=new R(this);a.set(0,Nh(this.K));a.set(1,Nh(this.N));a.set(2,[this.g,this.O,this.na]);a.set(3,this.I);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Oh(a[b++]),this.N=Oh(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.O=a[b][1],this.na|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.R||this.j("running");this.A.ca=!0;this.Bb=a;this.Cb=b}; +k.stop=function(a,b){if(this.A.ca){this.A.ca=!1;this.J=b-this.Cb;if(!this.R){b="stopped";if(this.J){a-=this.Bb;var c=0d&&(d=a.b.lb(b)),65535!=(d&65535)&&(c=a.D[a.W],c.F=b,c.La=!1,++a.W==a.D.length&&(a.W=0)));return!1}function qc(a){var b=a.b;if(b.A.ca)throw P(b,a.b.Hb),a.ha(),-1;return!1} +function Ch(a){var b,c;a.f=["bp"];if(a.L)for(b=1;b>>d.ka],!1)}a.L=["br"];if(a.B)for(b=1;b>>d.ka],!0);a.B=["bw"];a.eb=0}k.jb=function(a,b,c){var d=!0;c||Vh(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.w;f.X[e>>>f.ka].jb(e&f.w,a==this.B)}}d&&(a.push(b),c?b.La=!0:(Wh(this,a,a.length-1,"set"),Dh(this)));return d}; +function Vh(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ka],b==a.B));h.La||Dh(a);break}}return f}function Xh(a,b){for(var c=1;c>23)&65535,x=J(w,t);else if(8192==A)t=t.F-((f&63)<<1)&65535,x=J(w,t);else if(12288==A)x=J(w,f&7,1);else if(24576==A)x=J(w,f&63,1);else if(32768==A)x=J(w,f&255,1);else if(A=f&y,y&4032&&(A>>=6,y>>=6), +y&63)switch(y=A&7,A&56){case 0:x=Qh(y);break;case 8:x="@"+Qh(y);break;case 16:7>y?x="("+Qh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Qh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Qh(y)+")";break;case 40:x="@-("+Qh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Qh(y)+")";7==y&&(x=J(w,A+t.F&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Qh(y)+")",7==y&&(x="@"+J(w,A+t.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); +0b?(c=Qh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Sa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ga[b-16]):20==b&&(c="PS="+J(a,Xb(d)));c&&(c+=" ");return c}function bi(a){var b,c="";for(b=0;6>b;b++)c+=ai(a,b);c=c+"\n"+(ai(a,6)+ai(a,7)+ai(a,20));return c+=$h(a,"T")+$h(a,"N")+$h(a,"Z")+$h(a,"V")+$h(a,"C")}k.jc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.jc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Qe:b,F:c,Qc:d,ia:e,hc:f})}function ci(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b>>0,h=f.Qc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.Z();a.j("updated registers:")}a.j(bi(a));c&&(a.K=Z(d.u[7]),Th(a,J(a,a.K.F)))}}function gi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=Zh(a,b,g,f);a.j(f);a.K=b;e-=b.F-l;c++}}} +function Yh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.O&&(a.j("ended assemble at "+J(a,a.N.F)),a.K=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.da=null;if(tb(a)&&0n||"z"oa.length&&(a.j("note: only "+oa.length+" available"),ba=oa.length);ga-=ba;0>ga&&(null==oa[oa.length-1].F?(ba=ga+ba,ga=0):ga+=oa.length);var Ed=[];"call"==sg&&(Hb=1E5,Ed=["CALL"]);for(void 0!==rg&&a.j(ba+" instructions earlier:");0=oa.length&&(ga=0);a.ib=ba;ug++;Hb--}}ug||(a.j("no "+tg+"history available"),a.ib=void 0)}else{var Jb=Lh(a,na);if(Jb){var yc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||Ai),yc=yh(a,La)>>>0,65536>4||1;Ci--&&0Cc?String.fromCharCode(Cc):".";zc-=Bc}Kb&&(Kb+="\n");Kb+=na+" "+Fd+(0==Mb?" "+xg:"")}Kb&&a.j(Kb);a.gb=Jb}}}}break;case "e":if("else"==g[0])break;var jb,Gd,Hd,Id,Jd=g[0],Kd=g[1];"eb"==Jd?(jb=1,Gd=255,Hd=a.Db,Id=a.Sb):"e"==Jd||"ew"==Jd?(jb=2,Gd=65535,Hd=a.oa,Id=a.ab):Kd=null;if(null==Kd)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 Dc=Lh(a,Kd);if(Dc)for(var Ec= +2;EcNd;){for(var Ma=null,Gi=256;65536>Pb.F>>>0;){Od.F=a.oa(Pb,2);if(null==Pb.F||!Gi--)break;if(!(Od.F&1)){for(var Hi=a,Fc=Od,zg=null,Qb=Fc.F,Ag=Qb,Pd=1;6>=Pd&&Qb;Pd++){if(2< +Pd){Fc.F=Qb;var Gc=Zh(Hi,Fc);if(0<=Gc.indexOf("JSR")){var Bg=Gc.indexOf(" ");if(Qb+(Gc.indexOf(" ",Bg+1)-Bg-1)/2==Ag){zg=Gc;break}}}Qb-=2}Fc.F=Ag;if(Ma=zg)break}}if(!Ma||null==Ma)break;var Cg=null;if("ks"==Fi){var Dg=Ma.match(/[0-9A-F]+$/);Dg&&(Cg=fi(a,Dg[0]))}Ma=xa(Ma,50)+" ;"+(Cg||"stack="+J(a,Pb.F));a.j(Ma);Nd++}Nd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){fi(a,g[1],!0);break}f=!0;break;case "m":a:{var pa,qa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Da=0;if("all"== +G)Da=1878917119,G=null;else if("on"==G)qa=!0,G=null;else if("off"==G)qa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(pa in xb)if(G==pa){Da=xb[pa];qa=!!(a.na&Da);break}if(!Da){a.j("unknown message category: "+G);break a}}if(Da)if("on"==g[2])a.na|=Da,qa=!0;else if("off"==g[2]&&(a.na&=~Da,qa=!1,1073741824==Da)){for(var Qd=0;Qd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bli){if(ni(d,this.J)){this.v=new R(this,"1.30.2","failsafe");ni(this.v)&&(si(this,d),a=2,ti(this.v));this.v.set("timestamp",Ca());ui(this.v);var e=this.f&&!this.B;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ri(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ni(d,g):("error"== +f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.g=null)):this.j(f+": "+g),ti(d),ni(d)?(c=ri(d),e=!0):c=!1))}e&&qi(this,c?d:null)}else 2==a&&d.clear()}else qi(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.A.ja=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(vi(this,this.b,b,c,a),this.b.pb());this.O&&(si(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.C=0}; +function si(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.g||"";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 ii(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new R(a,"1.30.2"),g=new R(a,"1.30.2","validate"),h=Ca();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.A.ja=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Ni(a,b,c)}})}else c(a,null)} +function Oi(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&&(--zi||Za(!0));l=!1}var g,h,l=!0;zi++;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?Li(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,--zi||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),--zi||Za(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Li(b,a,d,!0,e,m):Mi(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 Oi(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.2/pdp11.js b/versions/pdpjs/1.30.2/pdp11.js index 8494b3248..985012bc0 100644 --- a/versions/pdpjs/1.30.2/pdp11.js +++ b/versions/pdpjs/1.30.2/pdp11.js @@ -31,205 +31,211 @@ http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da>=3;return""+c}function m(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function q(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})} function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ra=Date.now||function(){return+new Date}; 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 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="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));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 ta(a,b){var c,d={K:null,W: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>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.W=g.symbols;d.K.length?1==d.K.length&&(u(d.K[0]),d=null):(u("Empty resource: "+a),d=null)}catch(h){u("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ga=g.load;d.fa=g.exec;if(e=g.bytes)d.K=e;else if(e=g.words)for(d.K=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.X=g.symbols;d.K.length?1==d.K.length&&(u(d.K[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Da=this.id:(this.na=this.id.substr(0,b),this.Da=this.id.substr(b+1));this[a]=c;this.l={ready:!1,kb:!1,Td:!1,P:!1,error:!1};this.gb=null;this.l.error=!1;this.o={};this.F=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.Mb=b.comment;this.tc=b;b=this.id.indexOf(".");0>b?this.Qa=this.id:(this.oa=this.id.substr(0,b),this.Qa=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Ea:!1,ob:!1,P:!1,error:!1};this.jb=null;this.j.error=!1;this.o={};this.C=null;y.push(this)}var La=void 0,Ma={}; if(window){La||(La=window.location.search.substr(1));for(var Na,Oa=/\+/g,Pa=/([^&=]+)=?([^&]*)/g;Na=Pa.exec(La);)Ma[decodeURIComponent(Na[1].replace(Oa," "))]=decodeURIComponent(Na[2].replace(Oa," "))}function Qa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function z(a,b){b||(b=x);a.prototype=Qa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ra=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Ra={},y=[];function Sa(a,b,c){Ra[a]&&b&&(Ra[a][b]=c)}function A(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.j=this.i-1;this.v=this.D/this.i|0;this.xa=[];this.w=0;this.m=!1;this.u=[];this.Vb=[cb,db,eb,fb];a=new H(this);gb(a,this.F);this.b=Array(this.v);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.xa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return c;I(d,b,16);return 255}function db(a,b,c){var d=!1,e=this.controller,f=e.xa[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.xa[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||I(e,c,16)} -function eb(a,b){var c=-1,d=this.controller;(a=d.xa[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return c;I(d,b,16);return 65535}function fb(a,b,c){var d=!1,e=this.controller;if(a=e.xa[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||I(e,c,16)}function ib(a,b){if(b!=a.h){var c;a.h&&(c=(1<>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ha)return l.ib+=l.Ha-f,l.Ha=f,!0;if(f>=l.Ha+l.ib){p=l.size-(f-n);p>g&&(p=g);l.ib=f-l.Ha+p;f=n+a.i;g-=p;h++;continue}}return nb(1,f,g)}f=new H(a,f,p,a.i,d,e);gb(f,a.F,l);a.b[h++]=f;f=n+a.i;g-=p}if(0>=g){c/=1024;var t;e="";t?10>>=a.c;0>>=a.c;0>>a.c].tb(b&a.j,b)}function rb(a,b){3932160<=b&&(b=qb(a.a,b));return a.b[(b&a.g)>>>a.c].V(b&a.j,b)} -bb.prototype.Ua=function(a,b){this.m=!1;this.w++;this.b[(a&this.g)>>>this.c].Ab(a&this.j,b&255,a);this.w--};function sb(a,b,c){3932160<=b&&(b=qb(a.a,b));a.b[(b&a.g)>>>a.c].jb(b&a.j,c&65535,b)}function tb(a){for(var b=0,c=[],d=0;da.a.Za)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null,p=f[5]||1;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&n&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=f[4],w=0;w>5&3;b.Ya=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Sa!=c&&(b.Sa=c,Cb(b))}Db(this)}; -k.pc=function(){var a=this.a.Aa;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.qc=function(){return this.a.vb};k.rc=function(){return this.a.Fa};k.ld=function(a){var b=this.a;1170>b.Za&&(a&=-49);b.Fa!=a&&(b.Fa=a,b.Jb=a&16?4194303:262143,Cb(b));Db(this)};function Db(a){a.c.hb=a.c.hb&-8|(a.a.Sa?a.a.Fa&16?1:2:4)}k.Rc=function(a){a=a>>1&63;var b=this.a.Va[a>>1];return a&1?b>>16:b&65535};k.Ld=function(a,b){b=b>>1&63;var c=b>>1;this.a.Va[c]=b&1?this.a.Va[c]&65535|(a&63)<<16:this.a.Va[c]&-65536|a&65534}; -k.Kc=function(a){return this.a.H[1][a>>1&7]};k.Ed=function(a,b){this.a.H[1][b>>1&7]=a&65295};k.Ic=function(a){return this.a.H[1][(a>>1&7)+8]};k.Cd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};k.Jc=function(a){return this.a.X[1][a>>1&7]};k.Dd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};k.Hc=function(a){return this.a.X[1][(a>>1&7)+8]};k.Bd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};k.lc=function(a){return this.a.H[0][a>>1&7]}; -k.gd=function(a,b){this.a.H[0][b>>1&7]=a&65295};k.jc=function(a){return this.a.H[0][(a>>1&7)+8]};k.ed=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};k.kc=function(a){return this.a.X[0][a>>1&7]};k.fd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};k.ic=function(a){return this.a.X[0][(a>>1&7)+8]};k.dd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};k.Qc=function(a){return this.a.H[3][a>>1&7]};k.Kd=function(a,b){this.a.H[3][b>>1&7]=a&65295}; -k.Oc=function(a){return this.a.H[3][(a>>1&7)+8]};k.Id=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};k.Pc=function(a){return this.a.X[3][a>>1&7]};k.Jd=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};k.Nc=function(a){return this.a.X[3][(a>>1&7)+8]};k.Hd=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};k.Ja=function(a){a&=7;return this.a.B&2048?this.a.Ga[a]:this.a.f[a]};k.La=function(a,b){b&=7;this.a.B&2048?this.a.Ga[b]=a:this.a.f[b]=a}; -k.wc=function(){return this.a.B&49152?this.a.la[0]:this.a.f[6]};k.qd=function(a){this.a.B&49152?this.a.la[0]=a:this.a.f[6]=a};k.zc=function(){return this.a.f[7]};k.td=function(a){this.a.f[7]=a};k.Ka=function(a){a&=7;return this.a.B&2048?this.a.f[a]:this.a.Ga[a]};k.Ma=function(a,b){b&=7;this.a.B&2048?this.a.f[b]=a:this.a.Ga[b]=a};k.xc=function(){return 1==(this.a.B&49152)>>14?this.a.f[6]:this.a.la[1]};k.rd=function(a){1==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.la[1]=a}; -k.yc=function(){return 3==(this.a.B&49152)>>14?this.a.f[6]:this.a.la[3]};k.sd=function(a){3==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.la[3]=a};k.gc=function(a){return this.a.Qb[a-65504>>1]};k.bd=function(a,b){this.a.Qb[b-65504>>1]=a};k.Ob=function(a){return 65520==a?61183:0};k.Ub=function(){};k.Mc=function(){return 1};k.Gd=function(){};k.fc=function(){return this.a.M};k.ad=function(){this.a.M=0};k.nc=function(){return this.a.Pb};k.jd=function(a,b){b&1||(a&=255);this.a.Pb=a}; -k.sc=function(a){return a?this.a.wb:0};k.md=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.wb=a;b.s|=2};k.Lc=function(a){return a?this.a.Ba&65280:0};k.Fd=function(a){this.a.Ba=a|255};k.vc=function(){return ab(this.a)};k.pd=function(a){Eb(this.a,a&-1809|ab(this.a)&1808);this.a.s|=128};k.Tb=function(){}; -var M={},L=(M[61568]=[null,null,K.prototype.Rc,K.prototype.Ld,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Kc,K.prototype.Ed,"SISDR",8,1145],M[62608]=[null,null,K.prototype.Ic,K.prototype.Cd,"SDSDR",8,1145],M[62624]=[null,null,K.prototype.Jc,K.prototype.Dd,"SISAR",8,1145],M[62640]=[null,null,K.prototype.Hc,K.prototype.Bd,"SDSAR",8,1145],M[62656]=[null,null,K.prototype.lc,K.prototype.gd,"KISDR",8,1145],M[62672]=[null,null,K.prototype.jc,K.prototype.ed,"KDSDR",8,1145],M[62688]=[null,null,K.prototype.kc, -K.prototype.fd,"KISAR",8,1145],M[62704]=[null,null,K.prototype.ic,K.prototype.dd,"KDSAR",8,1145],M[62798]=[null,null,K.prototype.rc,K.prototype.ld,"MMR3",1,1145],M[65382]=[null,null,K.prototype.mc,K.prototype.hd,"LKS"],M[65400]=[null,null,K.prototype.ec,K.prototype.$c,"CNSL"],M[65402]=[null,null,K.prototype.oc,K.prototype.kd,"MMR0",1,1145],M[65404]=[null,null,K.prototype.pc,K.prototype.Tb,"MMR1",1,1145],M[65406]=[null,null,K.prototype.qc,K.prototype.Tb,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Qc, -K.prototype.Kd,"UISDR",8,1145],M[65424]=[null,null,K.prototype.Oc,K.prototype.Id,"UDSDR",8,1145],M[65440]=[null,null,K.prototype.Pc,K.prototype.Jd,"UISAR",8,1145],M[65456]=[null,null,K.prototype.Nc,K.prototype.Hd,"UDSAR",8,1145],M[65472]=[null,null,K.prototype.Ja,K.prototype.La,"R0SET0"],M[65473]=[null,null,K.prototype.Ja,K.prototype.La,"R1SET0"],M[65474]=[null,null,K.prototype.Ja,K.prototype.La,"R2SET0"],M[65475]=[null,null,K.prototype.Ja,K.prototype.La,"R3SET0"],M[65476]=[null,null,K.prototype.Ja, -K.prototype.La,"R4SET0"],M[65477]=[null,null,K.prototype.Ja,K.prototype.La,"R5SET0"],M[65478]=[null,null,K.prototype.wc,K.prototype.qd,"R6KERNEL"],M[65479]=[null,null,K.prototype.zc,K.prototype.td,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ka,K.prototype.Ma,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Ka,K.prototype.Ma,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Ka,K.prototype.Ma,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Ka,K.prototype.Ma,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Ka, -K.prototype.Ma,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Ka,K.prototype.Ma,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.xc,K.prototype.rd,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.yc,K.prototype.sd,"R6USER",1,1145],M[65504]=[null,null,K.prototype.gc,K.prototype.bd,"CTRL",1,1170],M[65520]=[null,null,K.prototype.Ob,K.prototype.Ub,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Ob,K.prototype.Ub,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Mc,K.prototype.Gd,"SYSID",1,1170],M[65526]= -[null,null,K.prototype.fc,K.prototype.ad,"CPUERR",1,1170],M[65528]=[null,null,K.prototype.nc,K.prototype.jd,"MB",1,1170],M[65530]=[null,null,K.prototype.sc,K.prototype.md,"PIR"],M[65532]=[null,null,K.prototype.Lc,K.prototype.Fd,"SL"],M[65534]=[null,null,K.prototype.vc,K.prototype.pd,"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]; -Ha(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.o,0,this.size>>2),Mb(this,Ib?Nb:Ob);else{a=this.a=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},na:function(a,b){a&1&&I(this.i,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},ta:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ra=!0},G:function(a,b){return this.I(a,b)},R:function(a,b){return this.$(a,b)},pa:function(a,b,c){this.j?this.g(a,b,c):this.Ab(a,b,c)},va:function(a,b,c){this.j?this.g(a,b,c):this.wa(a,b,c)},D:function(a){return this.b[a]},J:function(a){return this.b[a]},O:function(a,b){a&1&&I(this.i,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&I(this.i,b,64);return this.u[a>>1]},oa:function(a,b){this.b[a]=b;this.ra=!0},qa:function(a,b){this.b[a]=b;this.ra=!0},ua:function(a,b,c){a&1&&I(this.i, -c,64);this.c.setUint16(a,b,!0);this.ra=!0},Da:function(a,b,c){a&1&&I(this.i,c,64);this.u[a>>1]=b;this.ra=!0}};function gb(a,b,c){a.F=b;a.h=a.m=0;c&&((a.h=c.h)&&Qb(a,Rb,!1),(a.m=c.m)&&Sb(a,Rb,!1))}function Sb(a,b,c){c&&a.m||(a.zb=!a.j&&b[1]||a.g,a.jb=!a.j&&b[3]||a.A);if(c||void 0===c)a.Ab=b[1]||a.g,a.wa=b[3]||a.A}function Qb(a,b,c){c&&a.h||(a.tb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.$=b[2]||a.w}function Mb(a,b){b||(b=Tb);Qb(a,b,void 0);Sb(a,b,void 0)} -var Tb=[],Pb=[H.prototype.N,H.prototype.ta,H.prototype.na,H.prototype.Ea],Rb=[H.prototype.G,H.prototype.pa,H.prototype.R,H.prototype.va];if(Wa)var Ob=[H.prototype.D,H.prototype.oa,H.prototype.O,H.prototype.ua],Nb=[H.prototype.J,H.prototype.qa,H.prototype.aa,H.prototype.Da]; -function Ub(a,b){x.call(this,"CPU",a,Ub);var c=a.multiplier||1;this.bb=a.cycles||b;this.qa=c;this.pb=Math.round(this.bb/1E4)/100;this.ta=this.pb*this.qa;this.l.da=!1;this.l.xb=!1;this.l.Qa=a.autoStart;this.l.cb=!1;this.$a=this.va=0;this.ab=a.csStart;this.Ea=a.csInterval;this.Na=a.csStop;this.I=[];this.Nb=this.Wc.bind(this);E(this)}z(Ub);var Vb=["power","reset"];k=Ub.prototype; -k.ha=function(a,b,c,d){this.j=a;this.i=b;this.F=d;for(b=0;ba.oa/a.ta&&(b=1);a.qa=b;b=a.pb*a.qa;if(a.ta!=b){a.ta=b;b=a.ta.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.U("target speed: "+b)}c&&a.j&&ec(a.j)}a.N+=a.aa;a.aa=0;a.$=ra();a.pa=0;cc(a)}function yb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Ab(a,b,c){0<=b&&ba.I[b][0]&&(c=a.bb*a.qa/1E3*c|0,a.I[b][0]=c+fc(a))}function fc(a,b){var c=a.ua-=a.a;a.a=a.G=0;b&&(a.ua=0);return c} -k.Wc=function(){if(this.l.da){this.qb>=this.bb&&cc(this,!0);this.Pa=0;this.Wa=ra();if(this.pa){var a=this.Wa-this.pa;a>this.Kb&&(this.$+=a,this.$>this.Wa&&(this.$=this.Wa))}try{do{for(var b,c=this.l.cb?1:this.eb,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.Sb(b)}catch(l){if("number"!=typeof l)throw l;}b=fc(this,!0);this.Pa+=b;this.aa+=b;a=b;if(this.l.cb){var f=!1;this.$a=this.$a+this.Fb()|0;this.va-=a;0>=this.va&&(this.va+=this.Ea,f=!0);0<=this.Na&&this.Na<=dc(this)&& -(this.Ea=this.Na=-1,$b(this),F(this),f=!0);f&&this.U(dc(this)+" cycles: checksum="+m(this.$a))}for(var a=b,g=this.I.length-1;0<=g;g--){var h=this.I[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Oa-=b;if(0>=this.Oa){this.Oa+=this.eb;15<=++this.Lb&&(this.j&&this.j.ma(),this.Lb=0);break}}while(this.l.da)}catch(l){F(this);this.j&&this.j.stop(ra(),dc(this));b=l.stack||l.message;this.l.error=!0;this.C(b);return}if(this.l.da){b=setTimeout;c=this.Nb;this.pa=ra();d=this.Kb;this.Pa&&(d=Math.round(d*this.Pa/ -this.eb));d-=this.pa-this.Wa;if(e=this.pa-this.$)this.oa=Math.round(this.aa/(10*e))/100,864E5<=e&&(this.N=0,bc(this));if(0>d||this.oad&&(this.$-=d),d=0;this.qb+=this.Pa;this.pa+=d;b(c,d)}}};function ac(a){var b;a.l.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.da)a.U(a.toString()+" busy");else{bc(a);a.l.da=!0;a.l.xb=!0;if(b=a.o.run)b.textContent="Halt";a.j&&a.j.start(a.$,dc(a));setTimeout(a.Nb,0)}}k.Sb=function(){return 0}; -function F(a){var b=!1;if(a.l.da){fc(a);a.N+=a.aa;a.aa=0;a.l.da=!1;if(b=a.o.run)b.textContent="Run";a.j&&a.j.stop(ra(),dc(a));b=!0}a.l.complete=void 0;return b}function gc(a){this.Za=+a.model||1170;this.Gb=a.addrReset||0;Ub.call(this,a,6666667);this.decode=1120==this.Za?hc.bind(this):ic.bind(this);jc(this);this.rb=0;this.O=null;this.l.complete=!1}z(gc,Ub);k=gc.prototype;k.reset=function(){this.status("model "+this.Za);this.l.da&&F(this);jc(this);Zb(this);this.l.error=!1;this.parent.reset.call(this)}; -function jc(a){a.m=65536;a.g=32768;a.h=65535;a.u=32768;a.B=15;a.f=[0,0,0,0,0,0,0,a.Gb];a.Ga=[0,0,0,0,0,0];a.la=[0,0,0,0];a.v=0;a.Ya=0;a.cc=[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.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Va=[0,0,0,0,0,0,0,0,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.Qb=[0,0,0,0,0,0,0,0];a.Pb=0;a.s=0;a.A=a.D=0;a.c=a.b=a.lb=0;a.wa=-1;kc(a)}function kc(a){a.Ba=255;a.M=0;a.wb=0;a.w=0;a.Aa=0;a.vb=0;a.Fa=0;a.Sa=0;a.Xa=0;a.Jb=262143;a.O=null;a.i&&Cb(a)}function Cb(a){a.Sa?(a.R=65536,a.J=a.bc,a.V=a.Tc,a.jb=a.Nd,ib(a.i,a.Fa&16?22:18)):(a.R=0,a.J=a.ac,a.V=a.Sc,a.jb=a.Md,ib(a.i,16))}function lc(a,b,c){a.Gb=b;O(a,b);!c&&a.F&&(F(a)||a.F.ma())}k.Fb=function(){return 0}; -k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.N,this.qa]);a.set(2,tb(this.i));return a.data()};k.restore=function(a){var b=a[1];this.N=b[1];bc(this,b[3]);a:{b=this.i;a=a[2];var c;for(c=0;c>14&3;c=a.B>>14&3;a.v!=c&&(a.la[c]=a.f[6],a.f[6]=a.la[a.v]);a.B=b;a.s|=2}function R(a,b){a.s&128||(a.u=a.h=b,a.g=0)}function oc(a,b,c){a.s&128||(a.u=a.h=a.m=b,a.g=c||0)}function pc(a,b,c,d){a.s&128||(a.u=a.h=a.m=b,a.g=(c^b)&(d^b))}function qc(a,b){a.s&128||(a.u=a.h=a.m=b,a.g=a.u^a.m>>1)}function rc(a,b,c,d){a.s&128||(a.u=a.h=a.m=b,a.g=(c^d)&(d^b))} -function J(a,b,c){if(!a.rb){var d=!1;0>a.wa?a.wa=ab(a):a.v||(b=4,d=!0);a.w&57344||(a.Aa=63222,a.vb=b);a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);Eb(a,f&-12289|a.wa>>2&12288);d&&(a.M|=4,a.f[6]=4);sc(a,a.wa);sc(a,a.f[7]);O(a,e);a.s&=-113;a.wa=-1;a.s|=8;if(26!=c)throw b;}}function tc(a){var b=uc(a),c=uc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);O(a,b);Eb(a,c);a.s&=-17} -function qb(a,b){var c=b>>13&31;31>c&&a.Fa&32&&(b=a.Va[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function vc(a,b,c){var d,e,f,g=0;d=b>>13;a.Fa&a.cc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Jb;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.Xa=a.v,a.Ya=d;b=!1;g&&(g&57344&&(0<=a.wa&&(g|=128),a.w&57344||(a.w=a.w|g|a.Xa<<5|a.Ya<<1),b=!0),a.w&61440||!(4191360> -f||4194239>>a.c].zb(b&a.j,c&255,b)}function uc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function sc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.w&57344||(a.Aa=a.Aa<<8|246);!a.v&&c<=a.Ba&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=g);e=a.V(e)|g;a.a-= -8;break;case 6:return e=a.V(nc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(nc(a,2)),e=e+a.f[c]&65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!g||a.w&57344||(a.Aa=a.Aa<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.f[6]<=a.Ba||65534<=a.f[6])&&(a.f[6]<=a.Ba-32?(a.M|=4,a.f[6]=4,J(a,4,24)):(a.M|=8,a.s|=64));return e}k.Ua=function(a,b){this.Sa?(this.rb++,wc(this,vc(this,a,5),b),this.rb--):this.i.Ua(a,b)};k.ac=function(a,b,c){return xc(this,a,b,c)}; -k.bc=function(a,b,c){return vc(this,xc(this,a,b,c),c)};k.Sc=function(a){return rb(this.i,a)};k.Tc=function(a){return rb(this.i,vc(this,a,2))};k.Md=function(a,b){sb(this.i,a,b&65535)};k.Nd=function(a,b){sb(this.i,vc(this,a,4),b)};function yc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=xc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.f[d]:a.la[a.B>>12&3];return c} -function zc(a,b,c,d){a.w&57344||(a.Aa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=xc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=vc(a,e|c&65536,4),a.v=a.B>>14&3,sb(a.i,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.f[e]=d:a.la[a.B>>12&3]=d}function Ac(a,b){b>>=6;var c=a.D=b&7;(b=a.A=(b&56)>>3)?(c=a.J(b,c,3),a=pb(a.i,c)):a=a.f[c]&255;return a}function Bc(a,b){b>>=6;var c=a.D=b&7;return(b=a.A=(b&56)>>3)?rb(a.i,a.J(b,c,2)):a.f[c]}function Cc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return xc(a,b,c,8)} -function Dc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=pb(a.i,c)):a=a.f[c]&255;return a}function Ec(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?rb(a.i,a.J(b,c,2)):a.f[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.lb=a.J(b,e,7),wc(a,e,d.call(a,c,pb(a.i,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[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),sb(a.i,e,d.call(a,c,rb(a.i,e)))):a.f[e]=d.call(a,c,a.f[e])} -function Fc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?wc(a,a.J(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function Gc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?sb(a.i,a.J(b,d,4),c):a.f[d]=c&65535;return c}function V(a,b,c){c&&(O(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} -k.Sb=function(a){this.l.complete=!0;var b=a?this.l.xb?0:1:-1;this.l.xb=!1;this.ua=this.a=a;do{if(this.s){this.s&112&&(this.s&32?J(this,168,28):this.s&64?J(this,4,30):this.s&16&&J(this,12,32),this.s&=-113);if(a=this.s&7){a=!1;if(this.s&2){this.s&=-3;var c=160,d=(this.wb&224)>>5,e=this.O&&this.O.Ia>d?this.O:null;e&&(c=e.Zc,d=e.Ia);d>(this.B&224)>>5?(this.s&4&&(nc(this,2),this.s&=-5),J(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.O,e==a)this.O=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e= -d}a=!0}}else this.s&1&&this.s++;a=a&&0>b}if(a)break}this.s=this.s&7|this.B&16;this.decode(mc(this))}while(0>1|b<<16;qc(this,a);return a&65535}function Mc(a,b){a=b&2048|b>>1|b<<8;qc(this,a<<8);return a&255}function Nc(a,b){a=b&~a;R(this,a);return a}function Oc(a,b){a=b&~a;R(this,a<<8);return a}function Pc(a,b){a|=b;R(this,a);return a}function Qc(a,b){a|=b;R(this,a<<8);return a}function Rc(a,b){a=~b|65536;oc(this,a);return a&65535}function Sc(a,b){a=~b|256;oc(this,a<<8);return a&255} -function Tc(a,b){a=b-a;this.s&128||(this.u=this.h=a,this.g=b&(b^a));return a&65535}function Uc(a,b){a=b-a;var c=a<<8;b<<=8;this.s&128||(this.u=this.h=c,this.g=b&(b^c));return a&255}function Vc(a,b){a=b+a;this.s&128||(this.u=this.h=a,this.g=a&(b^a));return a&65535}function Wc(a,b){a=b+a;var c=a<<8;this.s&128||(this.u=this.h=c,this.g=c&(b<<8^c));return a&255}function Xc(a,b){a=-b;oc(this,a,a&b&32768);return a&65535}function Yc(a,b){a=-b;oc(this,a<<8,(a&b&128)<<8);return a&255} -function Zc(a,b){a=b<<1|this.m>>16&1;qc(this,a);return a&65535}function $c(a,b){a=b<<1|this.m>>16&1;qc(this,a<<8);return a&255}function ad(a,b){a=(this.m&65536|b)>>1|b<<16;qc(this,a);return a&65535}function bd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;qc(this,a<<8);return a&255}function cd(a,b){var c=b-a;rc(this,c,a,b);return c&65535}function dd(a,b){var c=b-a;rc(this,c<<8,a<<8,b<<8);return c&255}function ed(a,b){this.s&128||(this.u=this.h=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535} -function fd(a,b){a^=b;R(this,a);return a&65535}function gd(a){U(this,a,Bc(this,a),Hc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function hd(a){var b=Ec(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.u=this.h=c;this.a-=(this.c?6:7)+b} -function id(a){var b=Ec(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.u=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function jd(a){V(this,a,!Q(this))}function kd(a){V(this,a,Q(this))} -function ld(a){U(this,a,Bc(this,a),Nc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function md(a){T(this,a,Ac(this,a),Oc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function nd(a){U(this,a,Bc(this,a),Pc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function od(a){T(this,a,Ac(this,a),Qc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} -function pd(a){R(this,Bc(this,a)&Ec(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function qd(a){R(this,(Ac(this,a)&Dc(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 rd(a){V(this,a,this.h&65535?0:4)}function sd(a){V(this,a,!this.ya()==!(this.g&32768))}function td(a){V(this,a,!!(this.h&65535)&&!this.ya()==!(this.g&32768))}function ud(a){V(this,a,!Q(this)&&!!(this.h&65535))} -function vd(a){V(this,a,(this.h&65535?0:4)||!this.ya()!=!(this.g&32768))}function wd(a){V(this,a,Q(this)||(this.h&65535?0:4))}function xd(a){V(this,a,!this.ya()!=!(this.g&32768))}function yd(a){V(this,a,this.ya())}function zd(a){V(this,a,!!(this.h&65535))}function Ad(a){V(this,a,!this.ya())}function Bd(){J(this,12,1);this.a-=5}function Cd(a){V(this,a,!0)}function Dd(a){V(this,a,!(this.g&32768))}function Ed(a){V(this,a,this.g&32768?2:0)} -function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.u=0);this.a-=5}function Fd(a){var b=Bc(this,a);a=Ec(this,a);rc(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 Gd(a){var b=Ac(this,a)<<8;a=Dc(this,a)<<8;rc(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 Hd(a){var b=Ec(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.u=d>>16):(this.g=32768,this.h=d>>15|d,this.u=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.u=0,this.g=32768,this.m=65536,this.a-=7}function Id(){J(this,24,2);this.a-=25} -function Jd(){this.B&49152?(this.M|=128,J(this,4,3)):this.F?this.F.i():F(this);this.a-=7}function Kd(){J(this,16,4);this.a-=25}var Ld=[0,7,7,10,7,11,9,13];function Md(a){this.G=this.a;O(this,Cc(this,a));this.a=this.G-Ld[this.c]}var Nd=[0,14,14,17,14,18,16,20];function Od(a){this.G=this.a;var b=Cc(this,a);a=a>>6&7;sc(this,this.f[a]);this.f[a]=this.f[7];O(this,b);this.a=this.G-Nd[this.c]}var Pd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function Qd(a){var b=Bc(this,a);this.G=this.a;R(this,Gc(this,a,b));this.a=this.G-Pd[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function Rd(a){var b=Ac(this,a);R(this,Fc(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 Sd=[7,13,13,17,14,18,17,21]; -function Td(a){var b=Ec(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.s&128||(this.u=b>>16,this.h=this.u|b,this.g=0,this.m=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)O(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Zd(a){U(this,a,Bc(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 $d(a){U(this,a,0,ed);this.a-=this.c?9:3+(7==this.b?2:0)}function ae(){J(this,28,5);this.a-=5}function be(){this.s&4||this.j.ma();this.s|=4;nc(this,-2);this.a-=3}function ce(a){U(this,a,Bc(this,a),fd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,6)}function hc(a){de[a>>12].call(this,a)}function ee(a){fe[a>>6&3].call(this,a)}function ge(a){he[a>>6&3].call(this,a)}function ie(a){je[a>>6&3].call(this,a)}function ke(a){le[a&15].call(this,a)}function me(a){ne[a&15].call(this,a)} -function oe(a){pe[a>>6&3].call(this,a)}function qe(a){re[a>>6&3].call(this,a)}function se(a){te[a>>6&3].call(this,a)} -var de=[function(a){ue[a>>8&15].call(this,a)},Qd,Fd,pd,ld,nd,gd,Y,function(a){ve[a>>8&15].call(this,a)},Rd,Gd,qd,md,od,Zd,Y],ue=[function(a){we[a>>4&15].call(this,a)},Cd,zd,rd,sd,xd,td,vd,Od,Od,ee,ge,ie,Y,Y,Y],fe=[function(a){oc(this,Gc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Tc);this.a-=this.c?9:3+(7==this.b?2:0)}],he=[function(a){U(this,a,0, -Xc);this.a-=this.c?11:6},function(a){U(this,a,Q(this)?1:0,Hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,Q(this)?1:0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Ec(this,a);oc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],je=[function(a){U(this,a,0,ad);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,Lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Jc);this.a-=this.c?9:3+(7==this.b?2:0)}], -we=[function(a){xe[a&15].call(this,a)},Y,Y,Y,Md,Md,Md,Md,Xd,Y,ke,me,$d,$d,$d,$d],xe=[Jd,be,Wd,Bd,Kd,Vd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],le=[Ud,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.h=1;this.a-=5},W,W,W,function(){this.u=0;this.a-=5},W,W,W,W,W,W,W],ne=[Ud,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.u=32768;this.a-=5},X,X,X,X,X,X,X],ve=[Ad,yd,ud,wd,Dd,Ed,jd,kd,Id,ae,oe,qe,se,Y,Y,Y],pe=[function(a){oc(this, -Fc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Uc);this.a-=this.c?9:3+(7==this.b?2:0)}],re=[function(a){T(this,a,0,Yc);this.a-=this.c?11:6},function(a){T(this,a,Q(this)?1:0,Ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,Q(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Dc(this,a);oc(this,a<<8);this.a-=this.c?4:3+(7==this.b? -2:0)}],te=[function(a){T(this,a,0,bd);this.a-=this.c?9+(this.lb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,$c);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Mc);this.a-=this.c?9+(this.lb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Kc);this.a-=this.c?9:3+(7==this.b?2:0)}];function ic(a){ye[a>>12].call(this,a)} -var ye=[function(a){ze[a>>8&15].call(this,a)},Qd,Fd,pd,ld,nd,gd,function(a){Ae[a>>8&15].call(this,a)},function(a){Be[a>>8&15].call(this,a)},Rd,Gd,qd,md,od,Zd,Y],ze=[function(a){Ce[a>>4&15].call(this,a)},Cd,zd,rd,sd,xd,td,vd,Od,Od,ee,ge,ie,function(a){De[a>>6&3].call(this,a)},Y,Y],De=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);O(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=yc(this,a,0);sc(this,a);R(this,a);this.a-=11},function(a){var b=uc(this);this.G= -this.a;zc(this,a,0,b);R(this,b);this.a=this.G-Sd[this.c]},function(a){R(this,Gc(this,a,this.ya?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ce=[function(a){Ee[a&15].call(this,a)},Y,Y,Y,Md,Md,Md,Md,Xd,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.s|=1),this.a-=5):J(this,8,6)},ke,me,$d,$d,$d,$d],Ee=[Jd,be,Wd,Bd,Kd,Vd,function(){tc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Ae=[Td,Td,Hd,Hd,hd,hd,id,id,ce,ce,Y,Y,Y,Y,Yd,Yd],Be=[Ad,yd,ud,wd,Dd,Ed,jd,kd,Id,ae,oe,qe,se,function(a){Fe[a>>6& -3].call(this,a)},Y,Y],Fe=[Y,function(a){a=yc(this,a,65536);sc(this,a);R(this,a);this.a-=11},function(a){var b=uc(this);this.G=this.a;zc(this,a,65536,b);R(this,b);this.a=this.G-Sd[this.c]},Y]; -function Ge(a){x.call(this,"ROM",a,Ge);this.W=this.b=null;this.h=a.addr;this.c=a.size;this.g=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.C("Unable to load ROM resource (error "+f+": "+a+")"):(Sa(c.na,a,b),(a=ta(a,b))?(c.b=a.K,c.W=a.W):c.j=null,He(c))})}}z(Ge);Ge.prototype.ha=function(a,b,c,d){this.i=b;this.a=c;this.F=d;He(this)}; -Ge.prototype.ja=function(){this.W&&(this.F&&this.F.a(this.id,this.h,this.c,this.W),delete this.W);return!0};Ge.prototype.ia=function(){return!0}; -function He(a){if(!Va(a)){if(a.j){if(!a.b||!a.i)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+m(a.b.length,8,!0)+") does not match specified size ("+m(a.c,8,!0)+")";a.l.error=!0;a.C(b)}else{b=a.h;if(lb(a.i,b,a.c,Lb)){var c;for(c=0;c>>a.c;0=b.length)break;for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,p=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),t=h,w=n-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(w)for(;w--;)a.a.Ua(p++,b[t++]&255);else p&1?F(a.a):lc(a.a,p,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.w&&(e.w-=32),e.b|=128,e.b&64&&zb(e.a,e.$))});this.aa=Bb(52,4);this.O=yb(this.a,function(){e.c|=128;e.c&64&&zb(e.a,e.aa)});vb(b,this,Ne);E(this)}; -k.Hb=function(){if(!this.v){var a=Wb(this.j,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Da)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)}}};k.ja=function(a,b){if(!b)if(this.Hb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.ia=function(a){return a?this.save():!0};k.reset=function(){Oe(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Oe(this)};function Oe(a){a.w=0;a.b=0;a.c=128;a.h=[];return!0}k.ub=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.u%a,this.J&&(b=" ".slice(0,c)));this.G&&!this.u&&c&&(b=String.fromCharCode(this.G)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.u+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.U(this.m), -this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ab(this.a,this.O,1E3/Math.round(this.I/10))}};var Pe={},Ne=(Pe[65392]=[null,null,Z.prototype.Bc,Z.prototype.vd,"RCSR"],Pe[65394]=[null,null,Z.prototype.Ac,Z.prototype.ud,"RBUF"],Pe[65396]=[null,null,Z.prototype.Vc,Z.prototype.Pd,"XCSR"],Pe[65398]=[null,null,Z.prototype.Uc,Z.prototype.Od,"XBUF"],Pe);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a= -d.o.listTapes;a&&Se(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;Se(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; -k.ha=function(a,b,c,d){this.j=a;this.i=b;this.a=c;this.F=d;this.J=Te(a);var e=this;if((this.c=Wb(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=Bb(56,4);this.R=yb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var h=0>g&&a.j&&!a.j.l.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(Sa(a.na,e,f),(e=ta(e,f))&&bf(a,b,c,d,e.K,e.fa,e.ea)); -a.l.kb=!1;a.m&&(a.m--,a.m||E(a));Ze(a)})}function We(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.T);for(d=0;dc.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ob?"":e)+"&format=json"));return!!r(f, -null,!0,function(b,c,d){jf(a,b,c,d)})} -function jf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.j&&!a.j.l.P;if(d)a.controller.C('Unable to load disk "'+a.sa+'" (error '+d+": "+b+")",f);else{Sa(a.controller.na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)u(h[0]);else{a.T=h.length;a.Y=h[0].length;a.S=h[0][0].length;var l=h[0][0][0];a.ga=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var S=n<<2,ua=w.length;ua>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f=a.ka+a.ba&&(a.ba+=f-(a.ka+a.ba)+1):(a.ka=f,a.ba=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[h].length||n>=this.a[h][l].length){c="sector (CHS="+h+":"+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(h=this.a[h][l][n]){for(l=h.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.sa+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=lf(this,a++);)nf(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 nf(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){x.call(this,"RL11",a,N);this.g=a.autoMount||null;this.u=0;this.b=Array(1);this.A=!Ba("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype; -k.Z=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(h){u("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&of(d,a)},!0;case "loadDrive":return this.o[b]= -c,c.onclick=function(){var a=d.o.listDisks;a&&pf(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,h;h=lf(a,c++);)for(var l=0,n=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";of(this,0)}}return!0};k.ia=function(a){return a?this.save():!0};k.reset=function(){qf(this)};k.save=function(){return(new P(this)).data()}; -k.restore=function(a){return qf(this,a[0])};function tf(a,b){b||(a.u=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('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+'"')}vf(a,e,b,c,!1,d)}else uf(a,e)} -function vf(a,b,c,d,e,f){var g=-1,h=a.b[b];h.Ca.toLowerCase()!=d.toLowerCase()&&(g++,uf(a,b,!0),h.nb?a.C("RL11 busy"):(h.nb=!0,e&&(h.mb=!0,a.u++),h.fb=!!f,hf(new df(a,h,"preload"),c,d,f,a.Yb)&&g++));return g} -k.Yb=function(a,b,c,d,e){var f;a.nb=!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.T||f[1]>a.Y)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.sb)),b=null);b?(a.ca=b,a.sa=c,a.Ca=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.sb),a.mb||e),this.j&&ec(this.j)):a.fb=!1;a.mb&&(a.mb=!1,--this.u||E(this));of(this,a.sb)}; -function sf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e>12&48;this.w=f>>16&63;this.h=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; -k.hc=function(a,b,c,d,e,f,g){for(var h=0,l=a.ca,n=null,p;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){h=5120;break}p=0}var t,w;if(0>(t=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){h=5120;break}sb(this.i,f,t|w<<8);if(xb(this.i)){h=8192;break}f+=2;if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.T)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.cd=function(a,b,c,d,e,f,g){for(var h=0,l=a.ca,n=null,p;e--;){var t=rb(this.i,f);if(xb(this.i)){h=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){h=5120;break}p=0}if(!a.ca.write(n,p++,t&255)||!a.ca.write(n,p++,t>>8)){h=5120;break}if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.T)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Ec=function(){return this.L&65535}; -k.yd=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.h&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.h=this.c&4?this.h+b:this.h-b,this.c=this.h=this.h&65408|c);break;case 8:this.m=this.h;break;case 12:b=this.hc;case 10:b||(b=this.cd),d=this.c>>7,e=this.c&64?0:1,f=this.c&63,d>=c.T||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.Zb.bind(this)))}a&&(this.L|=129,this.L&64&&zb(this.a,this.G))}};k.Cc=function(){return this.v};k.wd=function(a){this.v=a&65534};k.Fc=function(){return this.c};k.zd=function(a){this.c=a};k.Gc=function(){return this.m};k.Ad=function(a){this.m=a};k.Dc=function(){return this.w};k.xd=function(a){this.w=a&63}; -var wf={},rf=(wf[63744]=[null,null,N.prototype.Ec,N.prototype.yd,"RLCS"],wf[63746]=[null,null,N.prototype.Cc,N.prototype.wd,"RLBA"],wf[65284]=[null,null,N.prototype.Fc,N.prototype.zd,"RLDA"],wf[65286]=[null,null,N.prototype.Gc,N.prototype.Ad,"RLMP"],wf[65288]=[null,null,N.prototype.Dc,N.prototype.xd,"RLBE"],wf); -function xf(a,b,c){x.call(this,"Computer",a,xf);this.l.P=!1;yf(this,b);this.A=Wb(this,"autoPower",a);this.j=0;this.N=a.busWidth||a.buswidth;this.b=zf;this.v=null;this.m=this.I=!1;this.O=Wb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Af(this);if(this.a=Ua("CPU",this.id)){this.F=Ua("Debugger",this.id);this.i=new bb({id:this.na+".bus",busWidth:this.N},this.a,this.F);var d,e=A(this.id);if((this.g=Ua("Panel",this.id))&&this.g.Ra)for(b=0;b\nLicense: GPL version 3 or later ");this.U("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bzf){if(Bf(d,this.v)){this.h=new P(this,"1.30.2","failsafe");Bf(this.h)&&(Gf(this,d),a=2,Hf(this.h));this.h.set("timestamp",sa());If(this.h);var e=this.b&&!this.m;if(1==a||wa("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ff(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Bf(d,g):("error"== -f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.U(f+": "+g),Hf(d),Bf(d)?(c=Ff(d),e=!0):c=!1))}e&&Ef(this,c?d:null)}else 2==a&&d.clear()}else Ef(this);delete this.v;delete this.w}e=A(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.l.P=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Jf(this,this.a,b,c,a),this.a.Qa());this.G&&(Gf(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.j=0}; -function Gf(a,b){if(wa("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.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} -function Mf(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),h=sa();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.a&&a.a.ia&&(c&&F(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.P=!1,!1===d&&(e=null)));for(var h=A(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(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],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]);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);Tf(a,b,c)}})}else c(a,null)} -function Uf(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=oa(a))}function f(a){e("Error: "+a);l&&(--Qf||Ja(!0));l=!1}var g,h,l=!0;Qf++;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,h){h?Rf(c,null,null,!1,e,function(d,l){l?(Sa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Qf||Ja(!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),--Qf||Ja(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Rf(b,a,d,!0,e,n):Sf(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 Uf(a,b,c,d)};window.enableEvents=Ja;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map +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.Wa=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192a;a++)this.b["S"+a]=[0,!1,!1,this.rc,a]}z(Ya);h=Ya.prototype;h.reset=function(){this.A=this.A&-120|20}; +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.m++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.s[b]=d?1:0,this.m++,!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];Za(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]&&(Za(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.C=d;$a(b,this,ab);bb(b,this.reset.bind(this));cb(this);for(var e in this.b)Za(this,e,this.b[e][0])};h.ka=function(a,b){b||db();return!0};h.ja=function(){return!0}; +function eb(a,b,c,d){a.o[b]&&(void 0===c&&(a.j.error=!0,a.D("Value for "+b+" is invalid"),F(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))}function fb(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function cb(a,b){for(var c in a.s)fb(a,c,null!=b?b:a.s[c])}function Za(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +h.pc=function(a){a||this.a.j.U||(this.h.reset(),gb(this.a),this.b.ENABLE&&this.b.ENABLE[0]&&hb(this.a))};h.qc=function(){};h.lc=function(a){a||F(this.a)};h.jc=function(a){if(!a&&!this.a.j.U)if(this.b.ENABLE&&this.b.ENABLE[0])hb(this.a);else{a=this.C;var b;if(b=a)a.j.Ea&&(a.j.ob=!0),b=!a.j.Ea;b?(Va(a,!0),a.lb(0),Va(a,!1)):(this.a.lb(1),this.aa())}};h.kc=function(a){a&&!this.a.j.U&&(this.v&&ib(this,this.c+2),this.h.Bb(this.c,jb(this,this.f)))}; +h.mc=function(a){a||this.a.j.U||(this.w&&ib(this,this.c+2),jb(this,this.h.sb(this.c)))};h.oc=function(a){a||this.a.j.U||ib(this,this.f)};h.nc=function(a){cb(this,a||null)};h.rc=function(a,b){this.f=a?this.f|1<c;c++)fb(a,"A"+c,b&1<c;c++)fb(a,"D"+c,b&1<>2;this.l=this.b-1;this.v=this.A/this.b|0;this.xa=[];this.f=0;this.i=!1;this.s=[];this.bc=[nb,ob,pb,qb];a=new H(this);rb(a,this.C);this.h=Array(this.v);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.xa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return c;I(d,b,16);return 255}function ob(a,b,c){var d=!1,e=this.controller,f=e.xa[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.xa[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||I(e,c,16)} +function pb(a,b){var c=-1,d=this.controller;(a=d.xa[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return c;I(d,b,16);return 65535}function qb(a,b,c){var d=!1,e=this.controller;if(a=e.xa[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||I(e,c,16)}function tb(a,b){if(b!=a.m){var c;a.m&&(c=(1<>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ja)return l.mb+=l.Ja-f,l.Ja=f,!0;if(f>=l.Ja+l.mb){p=l.size-(f-n);p>g&&(p=g);l.mb=f-l.Ja+p;f=n+a.b;g-=p;k++;continue}}return yb(1,f,g)}f=new H(a,f,p,a.b,d,e);rb(f,a.C,l);a.h[k++]=f;f=n+a.b;g-=p}if(0>=g){c/=1024;var t;e="";t?10>>=a.c;0>>=a.c;0>>a.c].xb(b&a.l,b)}function Cb(a,b){3932160<=b&&(b=Bb(a.a,b));return a.h[(b&a.Aa)>>>a.c].W(b&a.l,b)} +h.sb=function(a){var b=a&this.l,c=(a&this.Aa)>>>this.c;this.i=!1;this.f++;a=this.h[c].Tb(b,a);this.f--;return a};h.Ya=function(a,b){this.i=!1;this.f++;this.h[(a&this.Aa)>>>this.c].Fb(a&this.l,b&255,a);this.f--};function Db(a,b,c){3932160<=b&&(b=Bb(a.a,b));a.h[(b&a.Aa)>>>a.c].nb(b&a.l,c&65535,b)}h.Bb=function(a,b){var c=a&this.l,d=(a&this.Aa)>>>this.c;this.i=!1;this.f++;this.h[d].$b(c,b&65535,a);this.f--}; +function Eb(a){for(var b=0,c=[],d=0;da.a.bb)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null,p=f[5]||1;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=f[4],w=0;w>5&3;b.ab=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.wa!=c&&(b.wa=c,Lb(b));b.G&&b.G.aa()}};h.Fc=function(){var a=this.a.Ba;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Gc=function(){return this.a.zb};h.Hc=function(){return this.a.Na}; +h.zd=function(a){var b=this.a;1170>b.bb&&(a&=-49);b.Na!=a&&(b.Na=a,b.Nb=a&16?4194303:262143,Lb(b),b.G&&b.G.aa())};h.gd=function(a){a=a>>1&63;var b=this.a.Za[a>>1];return a&1?b>>16:b&65535};h.Zd=function(a,b){b=b>>1&63;var c=b>>1;this.a.Za[c]=b&1?this.a.Za[c]&65535|(a&63)<<16:this.a.Za[c]&-65536|a&65534};h.$c=function(a){return this.a.H[1][a>>1&7]};h.Sd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Yc=function(a){return this.a.H[1][(a>>1&7)+8]};h.Qd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; +h.Zc=function(a){return this.a.Y[1][a>>1&7]};h.Rd=function(a,b){b=b>>1&7;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Xc=function(a){return this.a.Y[1][(a>>1&7)+8]};h.Pd=function(a,b){b=(b>>1&7)+8;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Bc=function(a){return this.a.H[0][a>>1&7]};h.vd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.zc=function(a){return this.a.H[0][(a>>1&7)+8]};h.td=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Ac=function(a){return this.a.Y[0][a>>1&7]}; +h.ud=function(a,b){b=b>>1&7;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.yc=function(a){return this.a.Y[0][(a>>1&7)+8]};h.sd=function(a,b){b=(b>>1&7)+8;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.fd=function(a){return this.a.H[3][a>>1&7]};h.Yd=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.dd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Wd=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.ed=function(a){return this.a.Y[3][a>>1&7]};h.Xd=function(a,b){b=b>>1&7;this.a.Y[3][b]=a;this.a.H[3][b]&=65295}; +h.cd=function(a){return this.a.Y[3][(a>>1&7)+8]};h.Vd=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.Fa[a]:this.a.g[a]};h.Oa=function(a,b){b&=7;this.a.B&2048?this.a.Fa[b]=a:this.a.g[b]=a};h.Mc=function(){return this.a.B&49152?this.a.na[0]:this.a.g[6]};h.Ed=function(a){this.a.B&49152?this.a.na[0]=a:this.a.g[6]=a};h.Pc=function(){return this.a.g[7]};h.Hd=function(a){this.a.g[7]=a}; +h.Ma=function(a){a&=7;return this.a.B&2048?this.a.g[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.g[b]=a:this.a.Fa[b]=a};h.Nc=function(){return 1==(this.a.B&49152)>>14?this.a.g[6]:this.a.na[1]};h.Fd=function(a){1==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.na[1]=a};h.Oc=function(){return 3==(this.a.B&49152)>>14?this.a.g[6]:this.a.na[3]};h.Gd=function(a){3==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.na[3]=a};h.wc=function(a){return this.a.Wb[a-65504>>1]}; +h.qd=function(a,b){this.a.Wb[b-65504>>1]=a};h.Sb=function(a){return 65520==a?61183:0};h.Zb=function(){};h.bd=function(){return 1};h.Ud=function(){};h.vc=function(){return this.a.M};h.pd=function(){this.a.M=0};h.Dc=function(){return this.a.Vb};h.xd=function(a,b){b&1||(a&=255);this.a.Vb=a};h.Ic=function(a){return a?this.a.Ab:0};h.Ad=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.ad=function(a){return a?this.a.Ca&65280:0};h.Td=function(a){this.a.Ca=a|255}; +h.Lc=function(){return kb(this.a)};h.Dd=function(a){Mb(this.a,a&-1809|kb(this.a)&1808);this.a.u|=128};h.Yb=function(){}; +var M={},L=(M[61568]=[null,null,K.prototype.gd,K.prototype.Zd,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.$c,K.prototype.Sd,"SISDR",8,1145],M[62608]=[null,null,K.prototype.Yc,K.prototype.Qd,"SDSDR",8,1145],M[62624]=[null,null,K.prototype.Zc,K.prototype.Rd,"SISAR",8,1145],M[62640]=[null,null,K.prototype.Xc,K.prototype.Pd,"SDSAR",8,1145],M[62656]=[null,null,K.prototype.Bc,K.prototype.vd,"KISDR",8,1145],M[62672]=[null,null,K.prototype.zc,K.prototype.td,"KDSDR",8,1145],M[62688]=[null,null,K.prototype.Ac, +K.prototype.ud,"KISAR",8,1145],M[62704]=[null,null,K.prototype.yc,K.prototype.sd,"KDSAR",8,1145],M[62798]=[null,null,K.prototype.Hc,K.prototype.zd,"MMR3",1,1145],M[65382]=[null,null,K.prototype.Cc,K.prototype.wd,"LKS"],M[65402]=[null,null,K.prototype.Ec,K.prototype.yd,"MMR0",1,1145],M[65404]=[null,null,K.prototype.Fc,K.prototype.Yb,"MMR1",1,1145],M[65406]=[null,null,K.prototype.Gc,K.prototype.Yb,"MMR2",1,1145],M[65408]=[null,null,K.prototype.fd,K.prototype.Yd,"UISDR",8,1145],M[65424]=[null,null,K.prototype.dd, +K.prototype.Wd,"UDSDR",8,1145],M[65440]=[null,null,K.prototype.ed,K.prototype.Xd,"UISAR",8,1145],M[65456]=[null,null,K.prototype.cd,K.prototype.Vd,"UDSAR",8,1145],M[65472]=[null,null,K.prototype.La,K.prototype.Oa,"R0SET0"],M[65473]=[null,null,K.prototype.La,K.prototype.Oa,"R1SET0"],M[65474]=[null,null,K.prototype.La,K.prototype.Oa,"R2SET0"],M[65475]=[null,null,K.prototype.La,K.prototype.Oa,"R3SET0"],M[65476]=[null,null,K.prototype.La,K.prototype.Oa,"R4SET0"],M[65477]=[null,null,K.prototype.La,K.prototype.Oa, +"R5SET0"],M[65478]=[null,null,K.prototype.Mc,K.prototype.Ed,"R6KERNEL"],M[65479]=[null,null,K.prototype.Pc,K.prototype.Hd,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ma,K.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Ma,K.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Ma,K.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Ma,K.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Ma,K.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Ma, +K.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Nc,K.prototype.Fd,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Oc,K.prototype.Gd,"R6USER",1,1145],M[65504]=[null,null,K.prototype.wc,K.prototype.qd,"CTRL",1,1170],M[65520]=[null,null,K.prototype.Sb,K.prototype.Zb,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Sb,K.prototype.Zb,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.bd,K.prototype.Ud,"SYSID",1,1170],M[65526]=[null,null,K.prototype.vc,K.prototype.pd,"CPUERR",1,1170],M[65528]= +[null,null,K.prototype.Dc,K.prototype.xd,"MB",1,1170],M[65530]=[null,null,K.prototype.Ic,K.prototype.Ad,"PIR"],M[65532]=[null,null,K.prototype.ad,K.prototype.Td,"SL"],M[65534]=[null,null,K.prototype.Lc,K.prototype.Dd,"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]; +Ha(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),Ub(this,Qb?Vb:Wb);else{a=this.a=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&I(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ta=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Tb(a,b)},oa:function(a,b,c){this.l?this.f(a,b,c):this.Fb(a,b,c)},sa:function(a,b,c){this.l?this.f(a,b,c):this.$b(a,b,c)},G:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&I(this.h,b,64);return this.c.getUint16(a,!0)},ba:function(a,b){a&1&&I(this.h,b,64);return this.s[a>>1]},la: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&&I(this.h, +c,64);this.c.setUint16(a,b,!0);this.ta=!0},va:function(a,b,c){a&1&&I(this.h,c,64);this.s[a>>1]=b;this.ta=!0}};function rb(a,b,c){a.C=b;a.i=a.m=0;c&&((a.i=c.i)&&Yb(a,Zb,!1),(a.m=c.m)&&$b(a,Zb,!1))}function $b(a,b,c){c&&a.m||(a.Eb=!a.l&&b[1]||a.f,a.nb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Fb=b[1]||a.f,a.$b=b[3]||a.A}function Yb(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.Tb=b[2]||a.w}function Ub(a,b){b||(b=ac);Yb(a,b,void 0);$b(a,b,void 0)} +var ac=[],Xb=[H.prototype.N,H.prototype.qa,H.prototype.ca,H.prototype.wa],Zb=[H.prototype.F,H.prototype.oa,H.prototype.R,H.prototype.sa];if(Xa)var Wb=[H.prototype.G,H.prototype.la,H.prototype.O,H.prototype.ra],Vb=[H.prototype.J,H.prototype.pa,H.prototype.ba,H.prototype.va]; +function bc(a,b){x.call(this,"CPU",a,bc);var c=a.multiplier||1;this.ib=a.cycles||b;this.ra=c;this.vb=Math.round(this.ib/1E4)/100;this.va=this.vb*this.ra;this.j.U=!1;this.j.Cb=!1;this.j.Va=a.autoStart;this.j.eb=!1;this.fb=this.Ha=0;this.gb=a.csStart;this.Ra=a.csInterval;this.Sa=a.csStop;this.J=[];this.Rb=this.ld.bind(this);E(this)}z(bc);var ec=["power","reset"];h=bc.prototype; +h.ia=function(a,b,c,d){this.l=a;this.h=b;this.C=d;this.G=a.G;for(b=0;ba.pa/a.va&&(b=1);a.ra=b;b=a.vb*a.ra;if(a.va!=b){a.va=b;b=a.va.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&lc(a.l)}a.O+=a.la;a.la=0;a.ca=ra();a.qa=0;jc(a)}function Hb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Jb(a,b,c){0<=b&&ba.J[b][0]&&(c=a.ib*a.ra/1E3*c|0,a.J[b][0]=c+mc(a))}function mc(a,b){var c=a.Ga-=a.a;a.a=a.I=0;b&&(a.Ga=0);return c} +h.ld=function(){if(this.j.U){this.wb>=this.ib&&jc(this,!0);this.Ua=0;this.cb=ra();if(this.qa){var a=this.cb-this.qa;a>this.Pb&&(this.ca+=a,this.ca>this.cb&&(this.ca=this.cb))}try{do{for(var b,c=this.j.eb?1:this.kb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.lb(b)}catch(l){if("number"!=typeof l)throw l;}b=mc(this,!0);this.Ua+=b;this.la+=b;a=b;if(this.j.eb){var f=!1;this.fb=this.fb+this.Jb()|0;this.Ha-=a;0>=this.Ha&&(this.Ha+=this.Ra,f=!0);0<=this.Sa&&this.Sa<= +kc(this)&&(this.Ra=this.Sa=-1,hc(this),F(this),f=!0);f&&this.T(kc(this)+" cycles: checksum="+m(this.fb))}for(var a=b,g=this.J.length-1;0<=g;g--){var k=this.J[g];0>k[0]||(k[0]-=a,0>=k[0]&&(k[0]=-1,k[1]()))}this.Ta-=b;if(0>=this.Ta){this.Ta+=this.kb;15<=++this.Qb&&(this.l&&this.l.aa(),this.Qb=0);break}}while(this.j.U)}catch(l){F(this);this.l&&this.l.stop(ra(),kc(this));b=l.stack||l.message;this.j.error=!0;this.D(b);return}if(this.j.U){b=setTimeout;c=this.Rb;this.qa=ra();d=this.Pb;this.Ua&&(d=Math.round(d* +this.Ua/this.kb));d-=this.qa-this.cb;if(e=this.qa-this.ca)this.pa=Math.round(this.la/(10*e))/100,864E5<=e&&(this.O=0,ic(this));if(0>d||this.pad&&(this.ca-=d),d=0;this.wb+=this.Ua;this.qa+=d;b(c,d)}}};function hb(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{ic(a);a.j.U=!0;a.j.Cb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.ca,kc(a));setTimeout(a.Rb,0)}}h.lb=function(){return 0}; +function F(a){var b=!1;if(a.j.U){mc(a);a.O+=a.la;a.la=0;a.j.U=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),kc(a));b=!0}a.j.complete=void 0;return b}function nc(a){this.bb=+a.model||1170;this.Lb=a.addrReset||0;bc.call(this,a,6666667);this.decode=1120==this.bb?oc.bind(this):pc.bind(this);qc(this);this.sa=0;this.R=null;this.j.complete=!1}z(nc,bc);h=nc.prototype;h.reset=function(){this.status("model "+this.bb);this.j.U&&F(this);qc(this);gc(this);this.j.error=!1;this.parent.reset.call(this)}; +function qc(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.Lb];a.Fa=[0,0,0,0,0,0];a.na=[0,0,0,0];a.v=0;a.ab=0;a.sc=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Y=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Za=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0];a.Wb=[0,0,0,0,0,0,0,0];a.Vb=0;a.u=0;a.A=a.F=0;a.c=a.b=a.tb=0;a.Ia=-1;gb(a)}function gb(a){a.Ca=255;a.M=0;a.Ab=0;a.w=0;a.Ba=0;a.zb=0;a.Na=0;a.wa=0;a.$a=0;a.Nb=262143;a.R=null;a.h&&Lb(a)}function Lb(a){a.wa?(a.ba=65536,a.N=a.ic,a.W=a.hd,a.nb=a.$d,tb(a.h,a.Na&16?22:18)):(a.ba=0,a.N=a.hc,a.W=a.Ub,a.nb=a.ac,tb(a.h,16))}function rc(a,b,c){a.Lb=b;O(a,b);!c&&a.C&&(F(a)||a.C.aa())}h.Jb=function(){return 0}; +h.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.O,this.ra]);a.set(2,Eb(this.h));return a.data()};h.restore=function(a){var b=a[1];this.O=b[1];ic(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.B>>14&3;a.v!=c&&(a.na[c]=a.g[6],a.g[6]=a.na[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function uc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function vc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function wc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function xc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} +function J(a,b,c){if(!a.sa){var d=!1;0>a.Ia?a.Ia=kb(a):a.v||(b=4,d=!0);a.w&57344||(a.Ba=63222,a.zb=b);a.v=0;var e=a.W(b|a.ba),f=a.W(b+2&65535|a.ba);Mb(a,f&-12289|a.Ia>>2&12288);d&&(a.M|=4,a.g[6]=4);yc(a,a.Ia);yc(a,a.g[7]);O(a,e);a.u&=-113;a.Ia=-1;a.u|=8;if(26!=c)throw b;}}function zc(a){var b=Ac(a),c=Ac(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);O(a,b);Mb(a,c);a.u&=-17} +function Bb(a,b){var c=b>>13&31;31>c&&a.Na&32&&(b=a.Za[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function Bc(a,b,c){var d,e,f,g=0;d=b>>13;a.Na&a.sc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Y[a.v][d]<<6)+(b&8191)&a.Nb;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(4194170!==f||a.v)a.$a=a.v,a.ab=d;b=!1;g&&(g&57344&&(0<=a.Ia&&(g|=128),a.w&57344||(a.w=a.w|g|a.$a<<5|a.ab<<1),b=!0),a.w&61440||!(4191360> +f||4194239>>a.c].Eb(b&a.l,c&255,b)}function Ac(a){var b=a.W(a.g[6]|a.ba);a.g[6]=a.g[6]+2&65535;return b}function yc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.w&57344||(a.Ba=a.Ba<<8|246);!a.v&&c<=a.Ca&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!==c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!==c&&(e|=g);e=a.W(e)|g;a.a-= +8;break;case 6:return e=a.W(tc(a,2)),e=e+a.g[c]&65535|g,a.a-=6,e;case 7:return e=a.W(tc(a,2)),e=e+a.g[c]&65535,e=a.W(e|a.ba)|g,a.a-=10,e}a.g[c]=a.g[c]+f&65535;!g||a.w&57344||(a.Ba=a.Ba<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.g[6]<=a.Ca||65534<=a.g[6])&&(a.g[6]<=a.Ca-32?(a.M|=4,a.g[6]=4,J(a,4,24)):(a.M|=8,a.u|=64));return e}h.sb=function(a){if(!this.wa)return this.h.sb(a);this.sa++;a=this.Ub(Bc(this,a,2));this.sa--;return a}; +h.Ya=function(a,b){this.wa?(this.sa++,Cc(this,Bc(this,a,5),b),this.sa--):this.h.Ya(a,b)};h.Bb=function(a,b){this.wa?(this.sa++,this.ac(Bc(this,a,4),b),this.sa--):this.h.Bb(a,b)};h.hc=function(a,b,c){return Dc(this,a,b,c)};h.ic=function(a,b,c){return Bc(this,Dc(this,a,b,c),c)};h.Ub=function(a){return Cb(this.h,a)};h.hd=function(a){return Cb(this.h,Bc(this,a,2))};h.ac=function(a,b){Db(this.h,a,b&65535)};h.$d=function(a,b){Db(this.h,Bc(this,a,4),b)}; +function Ec(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Dc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.W(d|c&a.ba),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 Fc(a,b,c,d){a.w&57344||(a.Ba=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Dc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Bc(a,e|c&65536,4),a.v=a.B>>14&3,Db(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 Gc(a,b){b>>=6;var c=a.F=b&7;(b=a.A=(b&56)>>3)?(c=a.N(b,c,3),a=Ab(a.h,c)):a=a.g[c]&255;return a}function Hc(a,b){b>>=6;var c=a.F=b&7;return(b=a.A=(b&56)>>3)?Cb(a.h,a.N(b,c,2)):a.g[c]}function Ic(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Dc(a,b,c,8)}function Jc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.N(b,c,3),a=Ab(a.h,c)):a=a.g[c]&255;return a}function Kc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Cb(a.h,a.N(b,c,2)):a.g[c]} +function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.tb=a.N(b,e,7),Cc(a,e,d.call(a,c,Ab(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.N(b,e,6),Db(a.h,e,d.call(a,c,Cb(a.h,e)))):a.g[e]=d.call(a,c,a.g[e])}function Lc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Cc(a,a.N(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 Mc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Db(a.h,a.N(b,d,4),c):a.g[d]=c&65535;return c}function V(a,b,c){c&&(O(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} +h.lb=function(a){this.j.complete=!0;var b=a?this.j.Cb?0:1:-1;this.j.Cb=!1;this.Ga=this.a=a;do{if(this.u){this.u&112&&(this.u&32?J(this,168,28):this.u&64?J(this,4,30):this.u&16&&J(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.R&&this.R.Ka>d?this.R:null;e&&(c=e.nd,d=e.Ka);d>(this.B&224)>>5?(this.u&4&&(tc(this,2),this.u&=-5),J(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.R,e==a)this.R=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(sc(this))}while(0>1|b<<16;wc(this,a);return a&65535}function Sc(a,b){a=b&2048|b>>1|b<<8;wc(this,a<<8);return a&255}function Tc(a,b){a=b&~a;R(this,a);return a}function Uc(a,b){a=b&~a;R(this,a<<8);return a}function Vc(a,b){a|=b;R(this,a);return a}function Wc(a,b){a|=b;R(this,a<<8);return a}function Xc(a,b){a=~b|65536;uc(this,a);return a&65535}function Yc(a,b){a=~b|256;uc(this,a<<8);return a&255} +function Zc(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function $c(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 ad(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function bd(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 cd(a,b){a=-b;uc(this,a,a&b&32768);return a&65535}function dd(a,b){a=-b;uc(this,a<<8,(a&b&128)<<8);return a&255} +function ed(a,b){a=b<<1|this.m>>16&1;wc(this,a);return a&65535}function fd(a,b){a=b<<1|this.m>>16&1;wc(this,a<<8);return a&255}function gd(a,b){a=(this.m&65536|b)>>1|b<<16;wc(this,a);return a&65535}function hd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;wc(this,a<<8);return a&255}function id(a,b){var c=b-a;xc(this,c,a,b);return c&65535}function jd(a,b){var c=b-a;xc(this,c<<8,a<<8,b<<8);return c&255}function kd(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535} +function ld(a,b){a^=b;R(this,a);return a&65535}function md(a){U(this,a,Hc(this,a),Nc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function nd(a){var b=Kc(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;else if(b)if(16>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 od(a){var b=Kc(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-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function pd(a){V(this,a,!Q(this))}function qd(a){V(this,a,Q(this))} +function rd(a){U(this,a,Hc(this,a),Tc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function sd(a){S(this,a,Gc(this,a),Uc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function td(a){U(this,a,Hc(this,a),Vc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function ud(a){S(this,a,Gc(this,a),Wc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} +function vd(a){R(this,Hc(this,a)&Kc(this,a));this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function wd(a){R(this,(Gc(this,a)&Jc(this,a))<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function xd(a){V(this,a,this.i&65535?0:4)}function yd(a){V(this,a,!this.ya()==!(this.f&32768))}function zd(a){V(this,a,!!(this.i&65535)&&!this.ya()==!(this.f&32768))}function Ad(a){V(this,a,!Q(this)&&!!(this.i&65535))} +function Bd(a){V(this,a,(this.i&65535?0:4)||!this.ya()!=!(this.f&32768))}function Cd(a){V(this,a,Q(this)||(this.i&65535?0:4))}function Dd(a){V(this,a,!this.ya()!=!(this.f&32768))}function Ed(a){V(this,a,this.ya())}function Fd(a){V(this,a,!!(this.i&65535))}function Gd(a){V(this,a,!this.ya())}function Hd(){J(this,12,1);this.a-=5}function Id(a){V(this,a,!0)}function Jd(a){V(this,a,!(this.f&32768))}function Kd(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 Ld(a){var b=Hc(this,a);a=Kc(this,a);xc(this,b-a,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Md(a){var b=Gc(this,a)<<8;a=Jc(this,a)<<8;xc(this,b-a,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)} +function Nd(a){var b=Kc(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 Od(){J(this,24,2);this.a-=25} +function Pd(){this.B&49152?(this.M|=128,J(this,4,3)):this.C?this.C.b():F(this);this.a-=7}function Qd(){J(this,16,4);this.a-=25}var Rd=[0,7,7,10,7,11,9,13];function Sd(a){this.I=this.a;O(this,Ic(this,a));this.a=this.I-Rd[this.c]}var Td=[0,14,14,17,14,18,16,20];function Ud(a){this.I=this.a;var b=Ic(this,a);a=a>>6&7;yc(this,this.g[a]);this.g[a]=this.g[7];O(this,b);this.a=this.I-Td[this.c]}var Vd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function Wd(a){var b=Hc(this,a);this.I=this.a;R(this,Mc(this,a,b));this.a=this.I-Vd[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function Xd(a){var b=Gc(this,a);R(this,Lc(this,a,b,1)<<8);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var Yd=[7,13,13,17,14,18,17,21]; +function Zd(a){var b=Kc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)O(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ee(a){U(this,a,Hc(this,a),id);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} +function fe(a){U(this,a,0,kd);this.a-=this.c?9:3+(7==this.b?2:0)}function ge(){J(this,28,5);this.a-=5}function he(){this.u&4||this.l.aa();this.u|=4;tc(this,-2);this.a-=3}function ie(a){U(this,a,Hc(this,a),ld);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,6)}function oc(a){je[a>>12].call(this,a)}function ke(a){le[a>>6&3].call(this,a)}function me(a){ne[a>>6&3].call(this,a)}function oe(a){pe[a>>6&3].call(this,a)}function qe(a){re[a&15].call(this,a)}function se(a){te[a&15].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>>6&3].call(this,a)} +var je=[function(a){Ae[a>>8&15].call(this,a)},Wd,Ld,vd,rd,td,md,Y,function(a){Be[a>>8&15].call(this,a)},Xd,Md,wd,sd,ud,ee,Y],Ae=[function(a){Ce[a>>4&15].call(this,a)},Id,Fd,xd,yd,Dd,zd,Bd,Ud,Ud,ke,me,oe,Y,Y,Y],le=[function(a){uc(this,Mc(this,a,0));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)},function(a){U(this,a,1,ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Zc);this.a-=this.c?9:3+(7==this.b?2:0)}],ne=[function(a){U(this,a,0, +cd);this.a-=this.c?11:6},function(a){U(this,a,Q(this)?1:0,Nc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,Q(this)?1:0,id);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Kc(this,a);uc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],pe=[function(a){U(this,a,0,gd);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,0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)}], +Ce=[function(a){De[a&15].call(this,a)},Y,Y,Y,Sd,Sd,Sd,Sd,ce,Y,qe,se,fe,fe,fe,fe],De=[Pd,he,be,Hd,Qd,ae,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],re=[$d,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],te=[$d,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],Be=[Gd,Ed,Ad,Cd,Jd,Kd,pd,qd,Od,ge,ue,we,ye,Y,Y,Y],ve=[function(a){uc(this, +Lc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,$c);this.a-=this.c?9:3+(7==this.b?2:0)}],xe=[function(a){S(this,a,0,dd);this.a-=this.c?11:6},function(a){S(this,a,Q(this)?1:0,Oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,Q(this)?1:0,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Jc(this,a);uc(this,a<<8);this.a-=this.c?4:3+(7==this.b? +2:0)}],ze=[function(a){S(this,a,0,hd);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Sc);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)}];function pc(a){Ee[a>>12].call(this,a)} +var Ee=[function(a){Fe[a>>8&15].call(this,a)},Wd,Ld,vd,rd,td,md,function(a){Ge[a>>8&15].call(this,a)},function(a){He[a>>8&15].call(this,a)},Xd,Md,wd,sd,ud,ee,Y],Fe=[function(a){Ie[a>>4&15].call(this,a)},Id,Fd,xd,yd,Dd,zd,Bd,Ud,Ud,ke,me,oe,function(a){Je[a>>6&3].call(this,a)},Y,Y],Je=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.W(a|this.ba);O(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Ec(this,a,0);yc(this,a);R(this,a);this.a-=11},function(a){var b=Ac(this);this.I= +this.a;Fc(this,a,0,b);R(this,b);this.a=this.I-Yd[this.c]},function(a){R(this,Mc(this,a,this.ya?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ie=[function(a){Ke[a&15].call(this,a)},Y,Y,Y,Sd,Sd,Sd,Sd,ce,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):J(this,8,6)},qe,se,fe,fe,fe,fe],Ke=[Pd,he,be,Hd,Qd,ae,function(){zc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Ge=[Zd,Zd,Nd,Nd,nd,nd,od,od,ie,ie,Y,Y,Y,Y,de,de],He=[Gd,Ed,Ad,Cd,Jd,Kd,pd,qd,Od,ge,ue,we,ye,function(a){Le[a>>6& +3].call(this,a)},Y,Y],Le=[Y,function(a){a=Ec(this,a,65536);yc(this,a);R(this,a);this.a-=11},function(a){var b=Ac(this);this.I=this.a;Fc(this,a,65536,b);R(this,b);this.a=this.I-Yd[this.c]},Y]; +function Me(a){x.call(this,"ROM",a,Me);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.D("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);Ne(c)})}}z(Me);Me.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.C=d;Ne(this)}; +Me.prototype.ka=function(){this.X&&(this.C&&this.C.a(this.id,this.i,this.c,this.X),delete this.X);return!0};Me.prototype.ja=function(){return!0}; +function Ne(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){var b="ROM size ("+m(a.b.length,8,!0)+") does not match specified size ("+m(a.c,8,!0)+")";a.j.error=!0;a.D(b)}else{b=a.i;if(wb(a.h,b,a.c,Tb)){var c;for(c=0;c>>a.c;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),t=k,w=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Ya(p++,b[t++]&255);else p&1?F(a.a):rc(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.w&&(e.w-=32),e.b|=128,e.b&64&&Ib(e.a,e.ba))});this.ca=Kb(52,4);this.O=Hb(this.a,function(){e.c|=128;e.c&64&&Ib(e.a,e.ca)});$a(b,this,Te);E(this)}; +h.Kb=function(){if(!this.v){var a=fc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Qa)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.ka=function(a,b){if(!b)if(this.Kb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ja=function(a){return a?this.save():!0};h.reset=function(){Ue(this)};h.save=function(){var a=new P(this);a.set(0,[]);return a.data()};h.restore=function(){return Ue(this)};function Ue(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.yb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.F&&!this.s&&c&&(b=String.fromCharCode(this.F)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.T(this.m), +this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Jb(this.a,this.O,1E3/Math.round(this.I/10))}};var Ve={},Te=(Ve[65392]=[null,null,Z.prototype.Rc,Z.prototype.Jd,"RCSR"],Ve[65394]=[null,null,Z.prototype.Qc,Z.prototype.Id,"RBUF"],Ve[65396]=[null,null,Z.prototype.kd,Z.prototype.be,"XCSR"],Ve[65398]=[null,null,Z.prototype.jd,Z.prototype.ae,"XBUF"],Ve);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a= +d.o.listTapes;a&&Ye(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ye(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; +h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.C=d;this.J=Ze(a);var e=this;if((this.c=fc(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=Kb(56,4);this.R=Hb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.P;g?a.D('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Sa(a.oa,e,f),(e=ta(e,f))&&hf(a,b,c,d,e.K,e.ga,e.fa)); +a.j.Ea=!1;a.m&&(a.m--,a.m||E(a));ef(a)})}function bf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;dc.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.rb?"":e)+"&format=json"));return!!r(f, +null,!0,function(b,c,d){pf(a,b,c,d)})} +function pf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.P;if(d)a.controller.D('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{Sa(a.controller.oa,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)u(k[0]);else{a.V=k.length;a.Z=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ha=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var T=n<<2,va=w.length;va>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.da?f=a.ma+a.da&&(a.da+=f-(a.ma+a.da)+1):(a.ma=f,a.da=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.D("Unable to restore disk '"+this.ua+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=rf(this,a++);)tf(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 tf(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){x.call(this,"RL11",a,N);this.f=a.autoMount||null;this.s=0;this.b=Array(1);this.A=!Ba("Mobi")&&window&&"FileReader"in window}z(N);h=N.prototype; +h.$=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&uf(d,a)},!0;case "loadDrive":return this.o[b]= +c,c.onclick=function(){var a=d.o.listDisks;a&&vf(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.ea){var b;b="";for(var c=0,k;k=rf(a,c++);)for(var l=0,n=k.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";uf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){wf(this)};h.save=function(){return(new P(this)).data()}; +h.restore=function(a){return wf(this,a[0])};function zf(a,b){b||(a.s=0);if(a.f)for(var c in a.f){var d=a.f[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.D("Unable to load the selected drive");else if(c)if("?"==c)a.D('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+'"')}Bf(a,e,b,c,!1,d)}else Af(a,e)} +function Bf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Da.toLowerCase()!=d.toLowerCase()&&(g++,Af(a,b,!0),k.qb?a.D("RL11 busy"):(k.qb=!0,e&&(k.pb=!0,a.s++),k.hb=!!f,of(new kf(a,k,"preload"),c,d,f,a.ec)&&g++));return g} +h.ec=function(a,b,c,d,e){var f;a.qb=!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.D('Disk "'+c+'" too large for drive '+("RL"+a.ub)),b=null);b?(a.ea=b,a.ua=c,a.Da=d,this.D('Mounted disk "'+c+'" in drive '+("RL"+a.ub),a.pb||e),this.l&&lc(this.l)):a.hb=!1;a.pb&&(a.pb=!1,--this.s||E(this));uf(this,a.ub)}; +function yf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; +h.xc=function(a,b,c,d,e,f,g){for(var k=0,l=a.ea,n=null,p;e--;){if(!n){n=a.ea.seek(b,c,d+1);if(!n){k=5120;break}p=0}var t,w;if(0>(t=a.ea.read(n,p++))||0>(w=a.ea.read(n,p++))){k=5120;break}Db(this.h,f,t|w<<8);if(Gb(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.rd=function(a,b,c,d,e,f,g){for(var k=0,l=a.ea,n=null,p;e--;){var t=Cb(this.h,f);if(Gb(this.h)){k=8192;break}f+=2;if(!n){n=a.ea.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ea.write(n,p++,t&255)||!a.ea.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.Uc=function(){return this.L&65535}; +h.Md=function(a){this.L=this.L&-1023|a&1022;this.G=this.G&-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.xc;case 10:b||(b=this.rd),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.fc.bind(this)))}a&&(this.L|=129,this.L&64&&Ib(this.a,this.F))}};h.Sc=function(){return this.v};h.Kd=function(a){this.v=a&65534};h.Vc=function(){return this.c};h.Nd=function(a){this.c=a};h.Wc=function(){return this.m};h.Od=function(a){this.m=a};h.Tc=function(){return this.w};h.Ld=function(a){this.w=a&63}; +var Cf={},xf=(Cf[63744]=[null,null,N.prototype.Uc,N.prototype.Md,"RLCS"],Cf[63746]=[null,null,N.prototype.Sc,N.prototype.Kd,"RLBA"],Cf[65284]=[null,null,N.prototype.Vc,N.prototype.Nd,"RLDA"],Cf[65286]=[null,null,N.prototype.Wc,N.prototype.Od,"RLMP"],Cf[65288]=[null,null,N.prototype.Tc,N.prototype.Ld,"RLBE"],Cf); +function Df(a,b,c){x.call(this,"Computer",a,Df);this.j.P=!1;Ef(this,b);this.w=fc(this,"autoPower",a);this.l=0;this.N=a.busWidth||a.buswidth;this.b=Ff;this.s=null;this.i=this.I=!1;this.O=fc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Gf(this);if(this.a=Ua("CPU",this.id)){this.C=Ua("Debugger",this.id);this.h=new mb({id:this.oa+".bus",busWidth:this.N},this.a,this.C);var d,e=A(this.id);if((this.G=Ua("Panel",this.id))&&this.G.Wa)for(b=0;b\nLicense: GPL version 3 or later ");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bFf){if(Hf(d,this.s)){this.f=new P(this,"1.30.2","failsafe");Hf(this.f)&&(Mf(this,d),a=2,Nf(this.f));this.f.set("timestamp",sa());Of(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Lf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Hf(d,g):("error"== +f&&"no machine state"!=g?(this.D("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),Nf(d),Hf(d)?(c=Lf(d),e=!0):c=!1))}e&&Kf(this,c?d:null)}else 2==a&&d.clear()}else Kf(this);delete this.s;delete this.v}e=A(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.j.P=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Pf(this,this.a,b,c,a),this.a.Va());this.F&&(Mf(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0}; +function Mf(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.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} +function Sf(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new P(a,"1.30.2"),g=new P(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.ja&&(c&&F(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.P=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/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);Zf(a,b,c)}})}else c(a,null)} +function $f(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&&(--Wf||Ja(!0));l=!1}var g,k,l=!0;Wf++;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?Xf(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,--Wf||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),--Wf||Ja(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Xf(b,a,d,!0,e,n):Yf(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 $f(a,b,c,d)};window.enableEvents=Ja;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map