From 854b40c419322c61b3d12b921068756b37f1512f Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 13 Oct 2016 16:35:10 -0700 Subject: [PATCH] Cleaned up PDP-11/70 configs --- devices/pdp11/machine/1170/README.md | 5 +- devices/pdp11/machine/1170/panel/README.md | 10 + .../machine/1170/panel/debugger/README.md | 11 + .../machine/1170/panel/debugger/machine.xml | 14 + devices/pdp11/machine/1170/panel/machine.xml | 13 + devices/pdp11/machine/1170/test/README.md | 4 - .../machine/1170/test/debugger/README.md | 11 + .../1170/{ => test/debugger}/machine.xml | 6 +- devices/pdp11/machine/1170/test/machine.xml | 5 +- devices/pdp11/machine/1170/vt100/README.md | 6 +- .../machine/1170/vt100/debugger/README.md | 19 ++ .../machine/1170/vt100/debugger/machine.xml | 14 + devices/pdp11/machine/1170/vt100/machine.xml | 13 + .../panel/1170/{led.xml => debugger/leds.xml} | 0 devices/pdp11/panel/1170/debugger/test.xml | 35 +++ devices/pdp11/panel/1170/leds.xml | 96 ++++++ devices/pdp11/panel/1170/test.xml | 23 -- modules/pdp11/README.md | 3 + modules/pdp11/lib/bus.js | 13 +- modules/pdp11/lib/cpuops.js | 14 + modules/pdp11/lib/cpustate.js | 14 + modules/pdp11/lib/debugger.js | 2 +- modules/pdp11/lib/defines.js | 11 +- modules/pdp11/lib/device.js | 52 +++- modules/pdp11/lib/serialport.js | 4 +- modules/shared/lib/strlib.js | 2 +- versions/pdpjs/1.30.1/pdp11-dbg.js | 278 +++++++++--------- versions/pdpjs/1.30.1/pdp11.js | 114 +++---- 28 files changed, 531 insertions(+), 261 deletions(-) create mode 100644 devices/pdp11/machine/1170/panel/README.md create mode 100644 devices/pdp11/machine/1170/panel/debugger/README.md create mode 100644 devices/pdp11/machine/1170/panel/debugger/machine.xml create mode 100644 devices/pdp11/machine/1170/panel/machine.xml create mode 100644 devices/pdp11/machine/1170/test/debugger/README.md rename devices/pdp11/machine/1170/{ => test/debugger}/machine.xml (77%) create mode 100644 devices/pdp11/machine/1170/vt100/debugger/README.md create mode 100644 devices/pdp11/machine/1170/vt100/debugger/machine.xml create mode 100644 devices/pdp11/machine/1170/vt100/machine.xml rename devices/pdp11/panel/1170/{led.xml => debugger/leds.xml} (100%) create mode 100644 devices/pdp11/panel/1170/debugger/test.xml create mode 100644 devices/pdp11/panel/1170/leds.xml diff --git a/devices/pdp11/machine/1170/README.md b/devices/pdp11/machine/1170/README.md index 59f53c72e..a76320cc6 100644 --- a/devices/pdp11/machine/1170/README.md +++ b/devices/pdp11/machine/1170/README.md @@ -9,5 +9,6 @@ PDP-11/70 Machine Configurations PCjs is adding support the following PDP-11/70 configurations: -* [PDP-11/70 Test Machine](/devices/pdp11/machine/1170/test/) -* [PDP-11/70 with VT100 Terminal](/devices/pdp11/machine/1170/vt100/) +* [PDP-11/70 Test Machine](/devices/pdp11/machine/1170/test/) ([Debugger](/devices/pdp11/machine/1170/test/debugger/)) +* [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel) ([Debugger](/devices/pdp11/machine/1170/panel/debugger/)) +* [PDP-11/70 with VT100 Terminal](/devices/pdp11/machine/1170/vt100/) ([Debugger](/devices/pdp11/machine/1170/vt100/debugger/)) diff --git a/devices/pdp11/machine/1170/panel/README.md b/devices/pdp11/machine/1170/panel/README.md new file mode 100644 index 000000000..820a36b2d --- /dev/null +++ b/devices/pdp11/machine/1170/panel/README.md @@ -0,0 +1,10 @@ +--- +layout: page +title: PDP-11/70 with Front Panel +permalink: /devices/pdp11/machine/1170/panel/ +machines: + - id: test1170 + type: pdp11 +--- + +{% include machine.html id="test1170" %} diff --git a/devices/pdp11/machine/1170/panel/debugger/README.md b/devices/pdp11/machine/1170/panel/debugger/README.md new file mode 100644 index 000000000..3c0448f6a --- /dev/null +++ b/devices/pdp11/machine/1170/panel/debugger/README.md @@ -0,0 +1,11 @@ +--- +layout: page +title: PDP-11/70 with Front Panel and Debugger +permalink: /devices/pdp11/machine/1170/panel/debugger/ +machines: + - id: test1170 + type: pdp11 + debugger: true +--- + +{% include machine.html id="test1170" %} diff --git a/devices/pdp11/machine/1170/panel/debugger/machine.xml b/devices/pdp11/machine/1170/panel/debugger/machine.xml new file mode 100644 index 000000000..9884fa131 --- /dev/null +++ b/devices/pdp11/machine/1170/panel/debugger/machine.xml @@ -0,0 +1,14 @@ + + + + PDP-11/70 with Front Panel and Debugger + + + + + + + + + + diff --git a/devices/pdp11/machine/1170/panel/machine.xml b/devices/pdp11/machine/1170/panel/machine.xml new file mode 100644 index 000000000..9232b558f --- /dev/null +++ b/devices/pdp11/machine/1170/panel/machine.xml @@ -0,0 +1,13 @@ + + + + PDP-11/70 with Front Panel + + + + + + + + + diff --git a/devices/pdp11/machine/1170/test/README.md b/devices/pdp11/machine/1170/test/README.md index bb97fc5be..6bda346ad 100644 --- a/devices/pdp11/machine/1170/test/README.md +++ b/devices/pdp11/machine/1170/test/README.md @@ -5,10 +5,6 @@ permalink: /devices/pdp11/machine/1170/test/ machines: - id: test1170 type: pdp11 - debugger: true --- -PDP-11/70 Test Machine ----------------------- - {% include machine.html id="test1170" %} diff --git a/devices/pdp11/machine/1170/test/debugger/README.md b/devices/pdp11/machine/1170/test/debugger/README.md new file mode 100644 index 000000000..8c7bdde0e --- /dev/null +++ b/devices/pdp11/machine/1170/test/debugger/README.md @@ -0,0 +1,11 @@ +--- +layout: page +title: PDP-11/70 Test Machine with Debugger +permalink: /devices/pdp11/machine/1170/test/ +machines: + - id: test1170 + type: pdp11 + debugger: true +--- + +{% include machine.html id="test1170" %} diff --git a/devices/pdp11/machine/1170/machine.xml b/devices/pdp11/machine/1170/test/debugger/machine.xml similarity index 77% rename from devices/pdp11/machine/1170/machine.xml rename to devices/pdp11/machine/1170/test/debugger/machine.xml index b8805f8d0..1663c4a2e 100644 --- a/devices/pdp11/machine/1170/machine.xml +++ b/devices/pdp11/machine/1170/test/debugger/machine.xml @@ -1,14 +1,14 @@ - PDP-11/70 Test Machine + PDP-11/70 Test Machine with Debugger - - + + diff --git a/devices/pdp11/machine/1170/test/machine.xml b/devices/pdp11/machine/1170/test/machine.xml index 95333a243..3e3b39bad 100644 --- a/devices/pdp11/machine/1170/test/machine.xml +++ b/devices/pdp11/machine/1170/test/machine.xml @@ -3,12 +3,11 @@ PDP-11/70 Test Machine - + - - + diff --git a/devices/pdp11/machine/1170/vt100/README.md b/devices/pdp11/machine/1170/vt100/README.md index a0a37749c..16ecf323e 100644 --- a/devices/pdp11/machine/1170/vt100/README.md +++ b/devices/pdp11/machine/1170/vt100/README.md @@ -5,8 +5,7 @@ permalink: /devices/pdp11/machine/1170/vt100/ machines: - id: test1170 type: pdp11 - debugger: true - config: /devices/pdp11/machine/1170/machine.xml + config: /devices/pdp11/machine/1170/vt100/machine.xml connection: dl11->vt100.serialPort - id: vt100 type: pc8080 @@ -14,9 +13,6 @@ machines: connection: serialPort->test1170.dl11 --- -PDP-11/70 with VT100 Terminal ------------------------------------------- - {% include machine.html id="test1170" %} {% include machine.html id="vt100" %} diff --git a/devices/pdp11/machine/1170/vt100/debugger/README.md b/devices/pdp11/machine/1170/vt100/debugger/README.md new file mode 100644 index 000000000..80af00db5 --- /dev/null +++ b/devices/pdp11/machine/1170/vt100/debugger/README.md @@ -0,0 +1,19 @@ +--- +layout: page +title: PDP-11/70 with VT100 Terminal and Debugger +permalink: /devices/pdp11/machine/1170/vt100/ +machines: + - id: test1170 + type: pdp11 + debugger: true + config: /devices/pdp11/machine/1170/vt100/debugger/machine.xml + connection: dl11->vt100.serialPort + - id: vt100 + type: pc8080 + config: /devices/pc8080/machine/vt100/machine.xml + connection: serialPort->test1170.dl11 +--- + +{% include machine.html id="test1170" %} + +{% include machine.html id="vt100" %} diff --git a/devices/pdp11/machine/1170/vt100/debugger/machine.xml b/devices/pdp11/machine/1170/vt100/debugger/machine.xml new file mode 100644 index 000000000..32ff0bc71 --- /dev/null +++ b/devices/pdp11/machine/1170/vt100/debugger/machine.xml @@ -0,0 +1,14 @@ + + + + PDP-11/70 with Front Panel + + + + + + + + + + diff --git a/devices/pdp11/machine/1170/vt100/machine.xml b/devices/pdp11/machine/1170/vt100/machine.xml new file mode 100644 index 000000000..ae389343f --- /dev/null +++ b/devices/pdp11/machine/1170/vt100/machine.xml @@ -0,0 +1,13 @@ + + + + PDP-11/70 with Front Panel + + + + + + + + + diff --git a/devices/pdp11/panel/1170/led.xml b/devices/pdp11/panel/1170/debugger/leds.xml similarity index 100% rename from devices/pdp11/panel/1170/led.xml rename to devices/pdp11/panel/1170/debugger/leds.xml diff --git a/devices/pdp11/panel/1170/debugger/test.xml b/devices/pdp11/panel/1170/debugger/test.xml new file mode 100644 index 000000000..702346ccd --- /dev/null +++ b/devices/pdp11/panel/1170/debugger/test.xml @@ -0,0 +1,35 @@ + + + Control Panel + + + + + Enter + Clear + + + + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + + 0 + 0 + 0 + 0 + + + + Run + Step + Reset + Fast + + diff --git a/devices/pdp11/panel/1170/leds.xml b/devices/pdp11/panel/1170/leds.xml new file mode 100644 index 000000000..23448ae9e --- /dev/null +++ b/devices/pdp11/panel/1170/leds.xml @@ -0,0 +1,96 @@ + + + Control Panel + + + ADDRESS + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + DATA + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + + + Run + Reset + Fast + + diff --git a/devices/pdp11/panel/1170/test.xml b/devices/pdp11/panel/1170/test.xml index 702346ccd..177f6c688 100644 --- a/devices/pdp11/panel/1170/test.xml +++ b/devices/pdp11/panel/1170/test.xml @@ -3,32 +3,9 @@ Control Panel - - - Enter - Clear - - - - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - - 0 - 0 - 0 - 0 - Run - Step Reset Fast diff --git a/modules/pdp11/README.md b/modules/pdp11/README.md index 363bbf838..ae7a7f3e3 100644 --- a/modules/pdp11/README.md +++ b/modules/pdp11/README.md @@ -13,6 +13,9 @@ PDPjs is our PDP-11 machine emulation module. The code is being adapted from the JavaScript [PDP 11/70 Emulator (v1.3)](http://skn.noip.me/pdp11/pdp11.html) written by [Paul Nankervis](mailto:paulnank@hotmail.com). +See the list of available [PDP-11 Machines](/devices/pdp11/machine/), which includes a +[PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) and [PDP-11/70 with VT100 Terminal](/devices/pdp11/machine/1170/vt100/). + PDPjs is currently comprised of the following non-shared components, as listed in [package.json](../../package.json) (see the *pdp11Files* property): diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index aff9285a7..4c6226a49 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -216,7 +216,7 @@ BusPDP11.IOHANDLER = { * Those fallbacks may not always be appropriate; for example, byte writes to some device registers * must be zero-extended to update the entire word. For those cases, the fallback's "preliminary" read * is issued with a zero address so that the handler can distinguish a normal read from one of these - * preliminary reads, and return an appropriate value for the update (ie, zero). + * preliminary reads (aka read-before-write), and return an appropriate value for the update (eg, zero). * * If none of these fallback behaviors are appropriate, the device has a simple recourse: register * handlers for all possible addresses and sizes. @@ -543,10 +543,15 @@ BusPDP11.prototype.reset = function() */ BusPDP11.prototype.unknownAccess = function(addr, data, byteFlag) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.WARN)) { + /* + * TODO: For 22-bit machines, let's display addr as a 3-byte value (for a total of 9 octal digits) + */ + this.dbg.printMessage("warning: unknown I/O access (" + this.dbg.toStrBase(addr, 3) + "," + this.dbg.toStrBase(data) + "," + byteFlag + ")", true, true); + this.cpu.setPC(this.cpu.getLastPC()); + this.cpu.stopCPU(); + } if (!this.nDisableTraps) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.WARN)) { - this.dbg.printMessage("warning: unrecognized I/O access(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(data) + "," + byteFlag + ")", true, true); - } this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr); } return 0; diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 8556cfbcc..24cfb1367 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -1039,6 +1039,20 @@ PDP11.opDECB = function(opCode) /** * opDIV(opCode) * + * The instruction "DIV SRC,Rn" determines SRC using the DSTMODE portion of the opcode and Rn using + * the SRCMODE portion; Rn can only be a register (and it should be an EVEN-numbered register, lest you + * get unexpected results). The dividend (DST) is then calculated as: + * + * DST = (regs[Rn] << 16) | (regs[Rn|1]) + * + * DST is divided by SRC, and the quotient is stored in regs[Rn] and the remainder in regs[Rn|1]. + * + * For example: + * + * DIV R4,R0 + * + * where R4 = 006400 and R0,R1 = 000000,015000 will result in R0,R1 = 000002,000000. + * * @this {CPUStatePDP11} * @param {number} opCode */ diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 78a8a57b3..e107b62cc 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -534,6 +534,20 @@ CPUStatePDP11.prototype.getPC = function() return this.regsGen[PDP11.REG.PC]; }; +/** + * getLastPC() + * + * @this {CPUStatePDP11} + * @return {number} + */ +CPUStatePDP11.prototype.getLastPC = function() +{ + /* + * As long as we're always snapping the PC before every opcode, we might as well use it.... + */ + return this.regMMR2; +}; + /** * getPCWord() * diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 2b5c1da8b..3a591b6e4 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1152,7 +1152,7 @@ if (DEBUGGER) { DebuggerPDP11.prototype.message = function(sMessage, fAddress) { if (fAddress) { - sMessage += " @" + this.toStrAddr(this.newAddr(this.cpu.getPC())); + sMessage += " @" + this.toStrAddr(this.newAddr(this.cpu.getLastPC())); } if (this.bitsMessage & MessagesPDP11.BUFFER) { diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 4ec828132..8f14d388d 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -421,11 +421,12 @@ var PDP11 = { LKS: 0o177546, // KW11-L Clock Status - RCSR: 0o177560, // Console Terminal: Receiver Status Register - RBUF: 0o177562, // Console Terminal: Receiver Data Buffer Register - XCSR: 0o177564, // Console Terminal: Transmitter Status Register - XBUF: 0o177566, // Console Terminal: Transmitter Data Buffer Register - DISPLAY: 0o177570, // Console Switch and Display + RCSR: 0o177560, // Display Terminal: Receiver Status Register + RBUF: 0o177562, // Display Terminal: Receiver Data Buffer Register + XCSR: 0o177564, // Display Terminal: Transmitter Status Register + XBUF: 0o177566, // Display Terminal: Transmitter Data Buffer Register + + CNSL: 0o177570, // Console Switch and Front Panel Display MMR0: 0o177572, // 777572 17777572 MMR1: 0o177574, // 777574 17777574 diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index bc8a5e0d7..4de377a71 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -46,10 +46,10 @@ if (NODE) { * * The Device component implements the following "default" devices: * - * KW11 - * DISPLAY Registers - * MMU Registers - * CPU Registers (eg, PSW) + * 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. * * @constructor * @extends Component @@ -59,14 +59,14 @@ function DevicePDP11(parmsDevice) { Component.call(this, "Device", parmsDevice, DevicePDP11, MessagesPDP11.DEVICE); - this.display = { + this.console = { // CNSL registers data: 0, address: 0, misc: 0x14, switches: 0 }; - this.kw11 = { + this.kw11 = { // LW11 registers csr: 0, timer: -1 // initBus() will initialize this timer ID }; @@ -167,6 +167,33 @@ 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) * @@ -189,7 +216,7 @@ DevicePDP11.prototype.readMMR0 = function(addr) DevicePDP11.prototype.writeMMR0 = function(data, addr) { this.cpu.setMMR0(data); - this.updateDisplayMode(); + this.updateConsoleMode(); }; /** @@ -250,21 +277,21 @@ DevicePDP11.prototype.readMMR3 = function(addr) DevicePDP11.prototype.writeMMR3 = function(data, addr) { this.cpu.setMMR3(data); - this.updateDisplayMode(); + this.updateConsoleMode(); }; /** - * updateDisplayMode() + * updateConsoleMode() * * @this {DevicePDP11} */ -DevicePDP11.prototype.updateDisplayMode = function() +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.display.misc = (this.display.misc & ~7) | bit; + this.console.misc = (this.console.misc & ~7) | bit; }; /** @@ -1024,7 +1051,7 @@ DevicePDP11.prototype.kw11_interrupt = function() */ DevicePDP11.prototype.reset = function() { - this.display.misc = (this.display.misc & ~0x77) | 0x14; // kernel 16 bit + this.console.misc = (this.console.misc & ~0x77) | 0x14; // kernel 16 bit this.kw11.lks = 0; }; @@ -1042,6 +1069,7 @@ DevicePDP11.UNIBUS_IOTABLE = { [PDP11.UNIBUS.KDSAR0]: /* 172360 */ [null, null, DevicePDP11.prototype.readKDSAR, DevicePDP11.prototype.writeKDSAR, "KDSAR"], [PDP11.UNIBUS.MMR3]: /* 172516 */ [null, null, DevicePDP11.prototype.readMMR3, DevicePDP11.prototype.writeMMR3, "MMR3"], [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"], [PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, DevicePDP11.prototype.writeIgnored, "MMR1"], [PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, DevicePDP11.prototype.writeIgnored, "MMR2"], diff --git a/modules/pdp11/lib/serialport.js b/modules/pdp11/lib/serialport.js index bddd5a75b..13c4c9cc9 100644 --- a/modules/pdp11/lib/serialport.js +++ b/modules/pdp11/lib/serialport.js @@ -262,7 +262,7 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.triggerReceiveInterrupt = this.cpu.addTrigger(PDP11.DL11.RVEC, PDP11.DL11.PRI); - this.timerReceiveInterrupt = this.cpu.addTimer(function readyReceiver() { + this.timerReceiveInterrupt = this.cpu.addTimer(function() { if (!(serial.rcsr & PDP11.DL11.RCSR.RD)) { if (serial.abReceive.length) { serial.rbuf = serial.abReceive.shift(); @@ -276,7 +276,7 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.triggerTransmitInterrupt = this.cpu.addTrigger(PDP11.DL11.XVEC, PDP11.DL11.PRI); - this.timerTransmitInterrupt = this.cpu.addTimer(function readyTransmitter() { + this.timerTransmitInterrupt = this.cpu.addTimer(function readyransmitter() { serial.xcsr |= PDP11.DL11.XCSR.READY; if (serial.xcsr & PDP11.DL11.XCSR.TIE) { serial.cpu.setTrigger(serial.triggerTransmitInterrupt); diff --git a/modules/shared/lib/strlib.js b/modules/shared/lib/strlib.js index e0ea069ce..b69f25869 100644 --- a/modules/shared/lib/strlib.js +++ b/modules/shared/lib/strlib.js @@ -218,7 +218,7 @@ str.toOct = function(n, cch, fPrefix) if (cch) { if (cch > 11) cch = 11; } else { - cch = (n & ~0xffff)? 11 : 6; + cch = (n & ~0xffff)? 11 : 6; // TODO: For our 22-bit machines, we really don't need more than 8 digits max } /* * An initial "falsey" check for null takes care of both null and undefined; diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index 49fa0342e..e0511dc25 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -682,7 +682,7 @@ as to their contents. */ var h; -function ba(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function k(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function na(a,b){return(a+" ").slice(0,b)} function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={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"}; @@ -693,131 +693,131 @@ function n(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window. function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Da(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ea(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.Ua=this.id:(this.Db=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,ib:!1,Eb:!1,ha:!1,error:!1};this.vb=null;this.v.error=!1;this.J={};this.i=null;this.ia=d||0;t.push(this)}var Va=void 0,Wa={}; +function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ub=b.comment;this.pc=b;b=this.id.indexOf(".");0>b?this.Ua=this.id:(this.Eb=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,ib:!1,Fb:!1,ha:!1,error:!1};this.wb=null;this.v.error=!1;this.J={};this.j=null;this.ia=d||0;t.push(this)}var Va=void 0,Wa={}; if(window){Va||(Va=window.location.search.substr(1));for(var Xa,Ya=/\+/g,Za=/([^&=]+)=?([^&]*)/g;Xa=Za.exec(Va);)Wa[decodeURIComponent(Xa[1].replace(Ya," "))]=decodeURIComponent(Xa[2].replace(Ya," "))}function $a(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 y(a,b){b||(b=r);a.prototype=$a(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ab=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else ab={},t=[];function bb(a,b,c){ab[a]&&b&&(ab[a][b]=c)}function cb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.Z&&(this.Z=10);15>2;this.A=this.wa-1;this.D=this.I/this.wa|0;this.Ga=[];this.C=0;this.B=[];this.ic=[Fb,Gb,Hb,Ib];a=new I(this);Jb(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&E(this.i,64)&&B(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Kb(d,b|4186112,-1,1);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Gb(a,b,c){var d=!1,e=this.controller,f=e.Ga[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.Ga[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&&E(this.i,64)&&B(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Kb(e,c|4186112,b,1),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Hb(a,b){var c=-1,d=this.controller;(a=d.Ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&E(this.i,64)&&B(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Kb(d,b|4186112,-1,0);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Ib(a,b,c){var d=!1,e=this.controller;if(a=e.Ga[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&&E(this.i,64)&&B(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Kb(e,c|4186112,b,0),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Lb(a,b){if(b!=a.j){var c;a.j&&(c=(1<>>a.Z;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.w)return m.rb+=m.w-f,m.w=f,!0;if(f>=m.w+m.rb){q=m.size-(f-p);q>g&&(q=g);m.rb=f-m.w+q;f=p+a.wa;g-=q;l++;continue}}return Qb(1,f,g)}f=new I(a,f,q,a.wa,d,e);Jb(f,a.i,m);a.W[l++]=f;f=p+a.wa;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Rb[d]+" at "+k(b,8,!0)),!0):Qb(2,b,c)} -function Nb(a,b,c){var d=[];for(b>>>=a.Z;0>>=a.Z;0>>this.Z].zb(a&this.A,a)};h.xb=function(a){this.C++;a=this.W[(a&this.f)>>>this.Z].Hb(a&this.A,a);this.C--;return a};h.ka=function(a){return this.W[(a&this.f)>>>this.Z].qa(a&this.A,a)}; -h.lb=function(a){var b=a&this.A,c=(a&this.f)>>>this.Z;this.C++;a=this.W[c].Ib(b,a);this.C--;return a};h.Ab=function(a,b){this.W[(a&this.f)>>>this.Z].Cb(a&this.A,b&255,a)};h.pb=function(a,b){this.C++;this.W[(a&this.f)>>>this.Z].Ob(a&this.A,b&255,a);this.C--};h.Sa=function(a,b){this.W[(a&this.f)>>>this.Z].sb(a&this.A,b&65535,a)};h.Bb=function(a,b){var c=a&this.A,d=(a&this.f)>>>this.Z;this.C++;this.W[d].Pb(c,b&65535,a);this.C--}; +function Eb(a,b,c){r.call(this,"Bus",a,Eb,64);this.b=b;this.j=c;this.H=a.busWidth||16;this.i=0;this.M=[];this.G=null;this.I=Math.pow(2,this.H);this.f=this.I-1|0;this.Z=(this.H>>1)+2;10>this.Z&&(this.Z=10);15>2;this.A=this.wa-1;this.D=this.I/this.wa|0;this.Ga=[];this.C=0;this.B=[];this.ic=[Fb,Gb,Hb,Ib];a=new I(this);Jb(a,this.j);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&E(this.j,64)&&B(this.j,e[4]+".readByte("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=Kb(d,b|4186112,-1,1);this.j&&E(this.j,64)&&B(this.j,"warning: unconverted read access to byte @"+J(this.j,b)+": "+J(this.j,c),!0,!0);return c} +function Gb(a,b,c){var d=!1,e=this.controller,f=e.Ga[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.Ga[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&E(this.j,64)&&B(this.j,f[4]+".writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(Kb(e,c|4186112,b,1),this.j&&E(this.j,64)&&B(this.j,"warning: unconverted write access to byte @"+J(this.j,c)+": "+J(this.j,b),!0,!0))} +function Hb(a,b){var c=-1,d=this.controller;(a=d.Ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&E(this.j,64)&&B(this.j,a[4]+".readWord("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=Kb(d,b|4186112,-1,0);this.j&&E(this.j,64)&&B(this.j,"warning: unconverted read access to word @"+J(this.j,b)+": "+J(this.j,c),!0,!0);return c} +function Ib(a,b,c){var d=!1,e=this.controller;if(a=e.Ga[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.j&&E(this.j,64)&&B(this.j,a[4]+".writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(Kb(e,c|4186112,b,0),this.j&&E(this.j,64)&&B(this.j,"warning: unconverted write access to word @"+J(this.j,c)+": "+J(this.j,b),!0,!0))} +function Lb(a,b){if(b!=a.i){var c;a.i&&(c=(1<>>a.Z;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.w)return m.sb+=m.w-f,m.w=f,!0;if(f>=m.w+m.sb){q=m.size-(f-p);q>g&&(q=g);m.sb=f-m.w+q;f=p+a.wa;g-=q;l++;continue}}return Qb(1,f,g)}f=new I(a,f,q,a.wa,d,e);Jb(f,a.j,m);a.W[l++]=f;f=p+a.wa;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Rb[d]+" at "+k(b,8,!0)),!0):Qb(2,b,c)} +function Nb(a,b,c){var d=[];for(b>>>=a.Z;0>>=a.Z;0>>this.Z].Ab(a&this.A,a)};h.yb=function(a){this.C++;a=this.W[(a&this.f)>>>this.Z].Ib(a&this.A,a);this.C--;return a};h.ka=function(a){return this.W[(a&this.f)>>>this.Z].qa(a&this.A,a)}; +h.lb=function(a){var b=a&this.A,c=(a&this.f)>>>this.Z;this.C++;a=this.W[c].Jb(b,a);this.C--;return a};h.Bb=function(a,b){this.W[(a&this.f)>>>this.Z].Db(a&this.A,b&255,a)};h.qb=function(a,b){this.C++;this.W[(a&this.f)>>>this.Z].Ob(a&this.A,b&255,a);this.C--};h.Sa=function(a,b){this.W[(a&this.f)>>>this.Z].tb(a&this.A,b&65535,a)};h.Cb=function(a,b){var c=a&this.A,d=(a&this.f)>>>this.Z;this.C++;this.W[d].Pb(c,b&65535,a);this.C--}; function Sb(a){for(var b=0,c=[],d=0;da.b.Gb)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));Tb(a,e,e,g,l,m,p,f[4])}}}function Vb(a,b){a.B.push(b)} -function Wb(a,b){a.C||(a.i&&E(a.i,536870912)&&B(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.aa(4,b))}function Qb(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.j={data:0,Id:0,yb:20,Ld:0};this.f={Jd:0,Nb:-1}}y(K);h=K.prototype; -h.Da=function(a,b,c,d){this.A=b;this.b=c;this.i=d;var e=this;this.f.Nb=Xb(c,function(){e.f.Ia|=128;e.f.Ia&64&&(fc(e.b,e.f.ad),gc(e.b,e.f.Nb,1E3/60))});this.f.ad=hc(64,6);Ub(b,this,L);Vb(b,this.reset.bind(this));G(this)};h.zc=function(){var a=this.f.Ia;this.f.Ia&=-129;return a};h.jd=function(a){this.f.Ia=a;a&64&&gc(this.b,this.f.Nb,1E3/60);this.f.Ia=a&-129};h.Bc=function(){var a=this.b;return a.G&62337|a.ta<<5|a.ua<<1}; -h.ld=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.ta=a>>5&3;b.ua=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ja!=c&&(b.Ja=c,ic(b))}jc(this)};h.Cc=function(){var a=this.b.La;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Dc=function(){return this.b.Kb};h.Ec=function(){return this.b.Ma};h.md=function(a){var b=this.b;1170>b.Gb&&(a&=-49);b.Ma!=a&&(b.Ma=a,a&16?(b.Wa=4194303,b.va=3915776):(b.Wa=262143,b.va=253952),ic(b));jc(this)};function jc(a){a.j.yb=a.j.yb&-8|(a.b.Ja?a.b.Ma&16?1:2:4)} -h.Qc=function(a){return this.b.P[1][a>>1&7]};h.yd=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Oc=function(a){return this.b.P[1][(a>>1&7)+8]};h.wd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Pc=function(a){return this.b.pa[1][a>>1&7]};h.xd=function(a,b){b=b>>1&7;this.b.pa[1][b]=a;this.b.P[1][b]&=65295};h.Nc=function(a){return this.b.pa[1][(a>>1&7)+8]};h.vd=function(a,b){b=(b>>1&7)+8;this.b.pa[1][b]=a;this.b.P[1][b]&=65295};h.yc=function(a){return this.b.P[0][a>>1&7]}; -h.hd=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.wc=function(a){return this.b.P[0][(a>>1&7)+8]};h.fd=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.xc=function(a){return this.b.pa[0][a>>1&7]};h.gd=function(a,b){b=b>>1&7;this.b.pa[0][b]=a;this.b.P[0][b]&=65295};h.vc=function(a){return this.b.pa[0][(a>>1&7)+8]};h.ed=function(a,b){b=(b>>1&7)+8;this.b.pa[0][b]=a;this.b.P[0][b]&=65295};h.Wc=function(a){return this.b.P[3][a>>1&7]};h.Ed=function(a,b){this.b.P[3][b>>1&7]=a&65295}; -h.Uc=function(a){return this.b.P[3][(a>>1&7)+8]};h.Cd=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.pa[3][a>>1&7]};h.Dd=function(a,b){b=b>>1&7;this.b.pa[3][b]=a;this.b.P[3][b]&=65295};h.Tc=function(a){return this.b.pa[3][(a>>1&7)+8]};h.Bd=function(a,b){b=(b>>1&7)+8;this.b.pa[3][b]=a;this.b.P[3][b]&=65295};h.ab=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.fb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a}; -h.Hc=function(){return this.b.L&49152?this.b.sa[0]:this.b.u[6]};h.pd=function(a){this.b.L&49152?this.b.sa[0]=a:this.b.u[6]=a};h.Kc=function(){return this.b.u[7]};h.sd=function(a){this.b.u[7]=a};h.bb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]};h.gb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Ic=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.sa[1]};h.qd=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.sa[1]=a}; -h.Jc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.sa[3]};h.rd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.sa[3]=a};h.uc=function(a){return this.b.cc[a-65504>>1]};h.dd=function(a,b){this.b.cc[b-65504>>1]=a};h.$b=function(a){return 65520==a?61183:0};h.fc=function(){};h.Sc=function(){return 1};h.Ad=function(){};h.tc=function(){return this.b.$};h.cd=function(){this.b.$=0};h.Ac=function(){return this.b.bc};h.kd=function(a,b){b&1||(a&=255);this.b.bc=a}; -h.Fc=function(a){return a?this.b.Lb:0};h.nd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Lb=a;b.F|=2};h.Rc=function(a){return a?this.b.Na&65280:0};h.zd=function(a){this.b.Na=a|255};h.Gc=function(){return Db(this.b)};h.od=function(a){kc(this.b,a&-1809|Db(this.b)&1808);this.b.F|=128};h.ec=function(a,b){E(this)&&B(this,"writeIgnored("+ca(b)+"): "+ca(a),!0,!0)};h.reset=function(){this.j.yb=this.j.yb&-120|20;this.f.Ia=0}; -var M={},L=(M[62592]=[null,null,K.prototype.Qc,K.prototype.yd,"SISDR"],M[62608]=[null,null,K.prototype.Oc,K.prototype.wd,"SDSDR"],M[62624]=[null,null,K.prototype.Pc,K.prototype.xd,"SISAR"],M[62640]=[null,null,K.prototype.Nc,K.prototype.vd,"SDSAR"],M[62656]=[null,null,K.prototype.yc,K.prototype.hd,"KISDR"],M[62672]=[null,null,K.prototype.wc,K.prototype.fd,"KDSDR"],M[62688]=[null,null,K.prototype.xc,K.prototype.gd,"KISAR"],M[62704]=[null,null,K.prototype.vc,K.prototype.ed,"KDSAR"],M[62798]=[null,null, -K.prototype.Ec,K.prototype.md,"MMR3"],M[65382]=[null,null,K.prototype.zc,K.prototype.jd,"LKS"],M[65402]=[null,null,K.prototype.Bc,K.prototype.ld,"MMR0"],M[65404]=[null,null,K.prototype.Cc,K.prototype.ec,"MMR1"],M[65406]=[null,null,K.prototype.Dc,K.prototype.ec,"MMR2"],M[65408]=[null,null,K.prototype.Wc,K.prototype.Ed,"UISDR"],M[65424]=[null,null,K.prototype.Uc,K.prototype.Cd,"UDSDR"],M[65440]=[null,null,K.prototype.Vc,K.prototype.Dd,"UISAR"],M[65456]=[null,null,K.prototype.Tc,K.prototype.Bd,"UDSAR"], -M[65472]=[null,null,K.prototype.ab,K.prototype.fb,"R0SET0"],M[65473]=[null,null,K.prototype.ab,K.prototype.fb,"R1SET0"],M[65474]=[null,null,K.prototype.ab,K.prototype.fb,"R2SET0"],M[65475]=[null,null,K.prototype.ab,K.prototype.fb,"R3SET0"],M[65476]=[null,null,K.prototype.ab,K.prototype.fb,"R4SET0"],M[65477]=[null,null,K.prototype.ab,K.prototype.fb,"R5SET0"],M[65478]=[null,null,K.prototype.Hc,K.prototype.pd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Kc,K.prototype.sd,"R7KERNEL"],M[65480]=[null,null, -K.prototype.bb,K.prototype.gb,"R0SET1"],M[65481]=[null,null,K.prototype.bb,K.prototype.gb,"R1SET1"],M[65482]=[null,null,K.prototype.bb,K.prototype.gb,"R2SET1"],M[65483]=[null,null,K.prototype.bb,K.prototype.gb,"R3SET1"],M[65484]=[null,null,K.prototype.bb,K.prototype.gb,"R4SET1"],M[65485]=[null,null,K.prototype.bb,K.prototype.gb,"R5SET1"],M[65486]=[null,null,K.prototype.Ic,K.prototype.qd,"R6SUPER"],M[65487]=[null,null,K.prototype.Jc,K.prototype.rd,"R6USER"],M[65504]=[null,null,K.prototype.uc,K.prototype.dd, -"CTRL",1170],M[65520]=[null,null,K.prototype.$b,K.prototype.fc,"LSIZE",1170],M[65522]=[null,null,K.prototype.$b,K.prototype.fc,"HSIZE",1170],M[65524]=[null,null,K.prototype.Sc,K.prototype.Ad,"SYSID",1170],M[65526]=[null,null,K.prototype.tc,K.prototype.cd,"CPUERR",1170],M[65528]=[null,null,K.prototype.Ac,K.prototype.kd,"MB",1170],M[65530]=[null,null,K.prototype.Fc,K.prototype.nd,"PIR"],M[65532]=[null,null,K.prototype.Rc,K.prototype.zd,"SL"],M[65534]=[null,null,K.prototype.Gc,K.prototype.od,"PSW"], -M);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592];L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624];L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640]; -L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656];L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688];L[62698]=L[62688];L[62700]=L[62688];L[62702]=L[62688];L[62706]=L[62704];L[62708]=L[62704];L[62710]=L[62704];L[62712]=L[62704];L[62714]=L[62704];L[62716]=L[62704];L[62718]=L[62704]; -L[65410]=L[65408];L[65412]=L[65408];L[65414]=L[65408];L[65416]=L[65408];L[65418]=L[65408];L[65420]=L[65408];L[65422]=L[65408];L[65426]=L[65424];L[65428]=L[65424];L[65430]=L[65424];L[65432]=L[65424];L[65434]=L[65424];L[65436]=L[65424];L[65438]=L[65424];L[65442]=L[65440];L[65444]=L[65440];L[65446]=L[65440];L[65448]=L[65440];L[65450]=L[65440];L[65452]=L[65440];L[65454]=L[65440];L[65458]=L[65456];L[65460]=L[65456];L[65462]=L[65456];L[65464]=L[65456];L[65466]=L[65456];L[65468]=L[65456];L[65470]=L[65456]; -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];La(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,d>>2),rc(this,nc?sc:tc);else{this.b=Array(d>>2);for(a=0;aa.b.Hb)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));Tb(a,e,e,g,l,m,p,f[4])}}}function Vb(a,b){a.B.push(b)} +function Wb(a,b){a.C||(a.j&&E(a.j,536870912)&&B(a.j,"memory fault on address "+J(a.j,b),!0,!0),a.b.aa(4,b))}function Qb(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function L(a){r.call(this,"Device",a,L,256);this.i={data:0,Ld:0,zb:20,bd:0};this.f={Md:0,Nb:-1}}y(L);h=L.prototype; +h.Da=function(a,b,c,d){this.A=b;this.b=c;this.j=d;var e=this;this.f.Nb=Xb(c,function(){e.f.Ia|=128;e.f.Ia&64&&(fc(e.b,e.f.cd),gc(e.b,e.f.Nb,1E3/60))});this.f.cd=hc(64,6);Ub(b,this,M);Vb(b,this.reset.bind(this));G(this)};h.Ac=function(){var a=this.f.Ia;this.f.Ia&=-129;return a};h.md=function(a){this.f.Ia=a;a&64&&gc(this.b,this.f.Nb,1E3/60);this.f.Ia=a&-129};h.tc=function(a){return(a?this.i.bd:this.i.data)&65535};h.ed=function(a){this.i.data=a}; +h.Cc=function(){var a=this.b;return a.G&62337|a.ta<<5|a.ua<<1};h.od=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.ta=a>>5&3;b.ua=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ja!=c&&(b.Ja=c,ic(b))}jc(this)};h.Dc=function(){var a=this.b.La;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ec=function(){return this.b.pb};h.Fc=function(){return this.b.Ma};h.pd=function(a){var b=this.b;1170>b.Hb&&(a&=-49);b.Ma!=a&&(b.Ma=a,a&16?(b.Wa=4194303,b.va=3915776):(b.Wa=262143,b.va=253952),ic(b));jc(this)}; +function jc(a){a.i.zb=a.i.zb&-8|(a.b.Ja?a.b.Ma&16?1:2:4)}h.Rc=function(a){return this.b.P[1][a>>1&7]};h.Bd=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Pc=function(a){return this.b.P[1][(a>>1&7)+8]};h.zd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Qc=function(a){return this.b.pa[1][a>>1&7]};h.Ad=function(a,b){b=b>>1&7;this.b.pa[1][b]=a;this.b.P[1][b]&=65295};h.Oc=function(a){return this.b.pa[1][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.b.pa[1][b]=a;this.b.P[1][b]&=65295}; +h.zc=function(a){return this.b.P[0][a>>1&7]};h.ld=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.xc=function(a){return this.b.P[0][(a>>1&7)+8]};h.jd=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.yc=function(a){return this.b.pa[0][a>>1&7]};h.kd=function(a,b){b=b>>1&7;this.b.pa[0][b]=a;this.b.P[0][b]&=65295};h.wc=function(a){return this.b.pa[0][(a>>1&7)+8]};h.hd=function(a,b){b=(b>>1&7)+8;this.b.pa[0][b]=a;this.b.P[0][b]&=65295};h.Xc=function(a){return this.b.P[3][a>>1&7]}; +h.Hd=function(a,b){this.b.P[3][b>>1&7]=a&65295};h.Vc=function(a){return this.b.P[3][(a>>1&7)+8]};h.Fd=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.Wc=function(a){return this.b.pa[3][a>>1&7]};h.Gd=function(a,b){b=b>>1&7;this.b.pa[3][b]=a;this.b.P[3][b]&=65295};h.Uc=function(a){return this.b.pa[3][(a>>1&7)+8]};h.Ed=function(a,b){b=(b>>1&7)+8;this.b.pa[3][b]=a;this.b.P[3][b]&=65295};h.ab=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]}; +h.fb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Ic=function(){return this.b.L&49152?this.b.sa[0]:this.b.u[6]};h.sd=function(a){this.b.L&49152?this.b.sa[0]=a:this.b.u[6]=a};h.Lc=function(){return this.b.u[7]};h.vd=function(a){this.b.u[7]=a};h.bb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]};h.gb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Jc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.sa[1]}; +h.td=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.sa[1]=a};h.Kc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.sa[3]};h.ud=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.sa[3]=a};h.vc=function(a){return this.b.cc[a-65504>>1]};h.gd=function(a,b){this.b.cc[b-65504>>1]=a};h.$b=function(a){return 65520==a?61183:0};h.fc=function(){};h.Tc=function(){return 1};h.Dd=function(){};h.uc=function(){return this.b.$};h.fd=function(){this.b.$=0};h.Bc=function(){return this.b.bc}; +h.nd=function(a,b){b&1||(a&=255);this.b.bc=a};h.Gc=function(a){return a?this.b.Lb:0};h.qd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Lb=a;b.F|=2};h.Sc=function(a){return a?this.b.Na&65280:0};h.Cd=function(a){this.b.Na=a|255};h.Hc=function(){return Db(this.b)};h.rd=function(a){kc(this.b,a&-1809|Db(this.b)&1808);this.b.F|=128};h.ec=function(a,b){E(this)&&B(this,"writeIgnored("+ca(b)+"): "+ca(a),!0,!0)};h.reset=function(){this.i.zb=this.i.zb&-120|20;this.f.Ia=0}; +var N={},M=(N[62592]=[null,null,L.prototype.Rc,L.prototype.Bd,"SISDR"],N[62608]=[null,null,L.prototype.Pc,L.prototype.zd,"SDSDR"],N[62624]=[null,null,L.prototype.Qc,L.prototype.Ad,"SISAR"],N[62640]=[null,null,L.prototype.Oc,L.prototype.yd,"SDSAR"],N[62656]=[null,null,L.prototype.zc,L.prototype.ld,"KISDR"],N[62672]=[null,null,L.prototype.xc,L.prototype.jd,"KDSDR"],N[62688]=[null,null,L.prototype.yc,L.prototype.kd,"KISAR"],N[62704]=[null,null,L.prototype.wc,L.prototype.hd,"KDSAR"],N[62798]=[null,null, +L.prototype.Fc,L.prototype.pd,"MMR3"],N[65382]=[null,null,L.prototype.Ac,L.prototype.md,"LKS"],N[65400]=[null,null,L.prototype.tc,L.prototype.ed,"CNSL"],N[65402]=[null,null,L.prototype.Cc,L.prototype.od,"MMR0"],N[65404]=[null,null,L.prototype.Dc,L.prototype.ec,"MMR1"],N[65406]=[null,null,L.prototype.Ec,L.prototype.ec,"MMR2"],N[65408]=[null,null,L.prototype.Xc,L.prototype.Hd,"UISDR"],N[65424]=[null,null,L.prototype.Vc,L.prototype.Fd,"UDSDR"],N[65440]=[null,null,L.prototype.Wc,L.prototype.Gd,"UISAR"], +N[65456]=[null,null,L.prototype.Uc,L.prototype.Ed,"UDSAR"],N[65472]=[null,null,L.prototype.ab,L.prototype.fb,"R0SET0"],N[65473]=[null,null,L.prototype.ab,L.prototype.fb,"R1SET0"],N[65474]=[null,null,L.prototype.ab,L.prototype.fb,"R2SET0"],N[65475]=[null,null,L.prototype.ab,L.prototype.fb,"R3SET0"],N[65476]=[null,null,L.prototype.ab,L.prototype.fb,"R4SET0"],N[65477]=[null,null,L.prototype.ab,L.prototype.fb,"R5SET0"],N[65478]=[null,null,L.prototype.Ic,L.prototype.sd,"R6KERNEL"],N[65479]=[null,null, +L.prototype.Lc,L.prototype.vd,"R7KERNEL"],N[65480]=[null,null,L.prototype.bb,L.prototype.gb,"R0SET1"],N[65481]=[null,null,L.prototype.bb,L.prototype.gb,"R1SET1"],N[65482]=[null,null,L.prototype.bb,L.prototype.gb,"R2SET1"],N[65483]=[null,null,L.prototype.bb,L.prototype.gb,"R3SET1"],N[65484]=[null,null,L.prototype.bb,L.prototype.gb,"R4SET1"],N[65485]=[null,null,L.prototype.bb,L.prototype.gb,"R5SET1"],N[65486]=[null,null,L.prototype.Jc,L.prototype.td,"R6SUPER"],N[65487]=[null,null,L.prototype.Kc,L.prototype.ud, +"R6USER"],N[65504]=[null,null,L.prototype.vc,L.prototype.gd,"CTRL",1170],N[65520]=[null,null,L.prototype.$b,L.prototype.fc,"LSIZE",1170],N[65522]=[null,null,L.prototype.$b,L.prototype.fc,"HSIZE",1170],N[65524]=[null,null,L.prototype.Tc,L.prototype.Dd,"SYSID",1170],N[65526]=[null,null,L.prototype.uc,L.prototype.fd,"CPUERR",1170],N[65528]=[null,null,L.prototype.Bc,L.prototype.nd,"MB",1170],N[65530]=[null,null,L.prototype.Gc,L.prototype.qd,"PIR"],N[65532]=[null,null,L.prototype.Sc,L.prototype.Cd,"SL"], +N[65534]=[null,null,L.prototype.Hc,L.prototype.rd,"PSW"],N);M[62594]=M[62592];M[62596]=M[62592];M[62598]=M[62592];M[62600]=M[62592];M[62602]=M[62592];M[62604]=M[62592];M[62606]=M[62592];M[62610]=M[62608];M[62612]=M[62608];M[62614]=M[62608];M[62616]=M[62608];M[62618]=M[62608];M[62620]=M[62608];M[62622]=M[62608];M[62626]=M[62624];M[62628]=M[62624];M[62630]=M[62624];M[62632]=M[62624];M[62634]=M[62624];M[62636]=M[62624];M[62638]=M[62624];M[62642]=M[62640];M[62644]=M[62640];M[62646]=M[62640]; +M[62648]=M[62640];M[62650]=M[62640];M[62652]=M[62640];M[62654]=M[62640];M[62658]=M[62656];M[62660]=M[62656];M[62662]=M[62656];M[62664]=M[62656];M[62666]=M[62656];M[62668]=M[62656];M[62670]=M[62656];M[62674]=M[62672];M[62676]=M[62672];M[62678]=M[62672];M[62680]=M[62672];M[62682]=M[62672];M[62684]=M[62672];M[62686]=M[62672];M[62690]=M[62688];M[62692]=M[62688];M[62694]=M[62688];M[62696]=M[62688];M[62698]=M[62688];M[62700]=M[62688];M[62702]=M[62688];M[62706]=M[62704];M[62708]=M[62704];M[62710]=M[62704]; +M[62712]=M[62704];M[62714]=M[62704];M[62716]=M[62704];M[62718]=M[62704];M[65410]=M[65408];M[65412]=M[65408];M[65414]=M[65408];M[65416]=M[65408];M[65418]=M[65408];M[65420]=M[65408];M[65422]=M[65408];M[65426]=M[65424];M[65428]=M[65424];M[65430]=M[65424];M[65432]=M[65424];M[65434]=M[65424];M[65436]=M[65424];M[65438]=M[65424];M[65442]=M[65440];M[65444]=M[65440];M[65446]=M[65440];M[65448]=M[65440];M[65450]=M[65440];M[65452]=M[65440];M[65454]=M[65440];M[65458]=M[65456];M[65460]=M[65456];M[65462]=M[65456]; +M[65464]=M[65456];M[65466]=M[65456];M[65468]=M[65456];M[65470]=M[65456];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];La(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,d>>2),rc(this,nc?sc:tc);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ja:function(a,b){a&1&&Wb(this.A,b);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},ta: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.Ha=!0},T:function(a,b){if(this.i&&null!=this.w){var c=this.i;yc(c,this.w+a,1,c.M)&&c.ga(!0)}return this.Hb(a,b)},da:function(a,b){if(this.i&&null!=this.w){var c=this.i;yc(c,this.w+a,2,c.M)&&c.ga(!0)}return this.Ib(a,b)},ma:function(a,b,c){if(this.i&&null!=this.w){var d=this.i;yc(d,this.w+a, -1,d.D)&&d.ga(!0)}this.f?this.J(a,b,c):this.Ob(a,b,c)},va:function(a,b,c){if(this.i&&null!=this.w){var d=this.i;yc(d,this.w+a,2,d.D)&&d.ga(!0)}this.f?this.J(a,b,c):this.Pb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&E(this.i,128)&&B(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ca:function(a,b){a&1&&Wb(this.A,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&Wb(this.A,b);a=this.I[a>>1];this.i&&E(this.i,128)&&B(this.i,"Memory.readWord("+ -J(this.i,b)+"): "+J(this.i,a),!0);return a},la:function(a,b){this.D[a]=b;this.Ha=!0},oa:function(a,b,c){this.D[a]=b;this.Ha=!0;this.i&&E(this.i,128)&&B(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},ua:function(a,b,c){a&1&&Wb(this.A,c);this.G.setUint16(a,b,!0);this.Ha=!0},Ua:function(a,b,c){a&1&&Wb(this.A,c);this.I[a>>1]=b;this.Ha=!0;this.i&&E(this.i,128)&&B(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}}; -function Jb(a,b,c){a.i=b;a.j=a.B=0;c&&((a.j=c.j)&&xc(a,wc,!1),(a.B=c.B)&&vc(a,wc,!1))}function zc(a,b){b?--a.B||(a.Cb=a.f?a.J:a.Ob,a.sb=a.f?a.H:a.Pb):--a.j||(a.zb=a.Hb,a.qa=a.Ib)}function vc(a,b,c){c&&a.B||(a.Cb=!a.f&&b[1]||a.J,a.sb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Ob=b[1]||a.J,a.Pb=b[3]||a.H}function xc(a,b,c){c&&a.j||(a.zb=b[0]||a.K,a.qa=b[2]||a.M);if(c||void 0===c)a.Hb=b[0]||a.K,a.Ib=b[2]||a.M}function rc(a,b){b||(b=Ac);xc(a,b,void 0);vc(a,b,void 0)} -var Ac=[],uc=[I.prototype.V,I.prototype.ta,I.prototype.ja,I.prototype.xa],wc=[I.prototype.T,I.prototype.ma,I.prototype.da,I.prototype.va];if(lb)var tc=[I.prototype.R,I.prototype.la,I.prototype.ca,I.prototype.ua],sc=[I.prototype.U,I.prototype.oa,I.prototype.fa,I.prototype.Ua]; -function Bc(a,b){r.call(this,"CPU",a,Bc,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.Ka=c;this.Va=Math.round(this.Fa/1E4)/100;this.Ra=this.Va*this.Ka;this.v.ea=!1;this.v.Mb=!1;this.v.hb=a.autoStart;this.v.Xa=!1;this.mb=this.ja=0;this.nb=a.csStart;this.Ya=a.csInterval;this.Za=a.csStop;this.K=[];this.Yb=this.$c.bind(this);G(this)}y(Bc);var Cc=["power","reset"];h=Bc.prototype; -h.Da=function(a,b,c,d){this.B=a;this.A=b;this.i=d;for(b=0;b=a.ja&&(a.ja+=a.Ya,c=!0);0<=a.Za&&a.Za<=Ic(a)&&(a.Ya=a.Za=-1,Fc(a),a.ga(),c=!0);c&&a.g(Ic(a)+" cycles: checksum="+k(a.mb))}} -h.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ha)a=!0;else{var b=null,c,l=cb(a.id);for(c=0;ca.V/a.Ra?b=1:d=!0;a.Ka=b;b=a.Va*a.Ka;if(a.Ra!=b){a.Ra=b;b=a.Ra.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.B&&a.B.qb()}Kc(a,a.T);a.T=0;a.R=ra();a.ca=0;Lc(a);return d}function Xb(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function gc(a,b,c){0<=b&&ba.K[b][0]&&(c*=a.Fa*a.Ka/1E3,a.K[b][0]=c+Mc(a))} +I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(lb)for(a=Array(this.size>>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ja:function(a,b){a&1&&Wb(this.A,b);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},ta: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.Ha=!0},T:function(a,b){if(this.j&&null!=this.w){var c=this.j;yc(c,this.w+a,1,c.M)&&c.fa(!0)}return this.Ib(a,b)},da:function(a,b){if(this.j&&null!=this.w){var c=this.j;yc(c,this.w+a,2,c.M)&&c.fa(!0)}return this.Jb(a,b)},ma:function(a,b,c){if(this.j&&null!=this.w){var d=this.j;yc(d,this.w+a, +1,d.D)&&d.fa(!0)}this.f?this.J(a,b,c):this.Ob(a,b,c)},va:function(a,b,c){if(this.j&&null!=this.w){var d=this.j;yc(d,this.w+a,2,d.D)&&d.fa(!0)}this.f?this.J(a,b,c):this.Pb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.j&&E(this.j,128)&&B(this.j,"Memory.readByte("+J(this.j,b)+"): "+J(this.j,a),!0);return a},ca:function(a,b){a&1&&Wb(this.A,b);return this.G.getUint16(a,!0)},ga:function(a,b){a&1&&Wb(this.A,b);a=this.I[a>>1];this.j&&E(this.j,128)&&B(this.j,"Memory.readWord("+ +J(this.j,b)+"): "+J(this.j,a),!0);return a},la:function(a,b){this.D[a]=b;this.Ha=!0},oa:function(a,b,c){this.D[a]=b;this.Ha=!0;this.j&&E(this.j,128)&&B(this.j,"Memory.writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0)},ua:function(a,b,c){a&1&&Wb(this.A,c);this.G.setUint16(a,b,!0);this.Ha=!0},Ua:function(a,b,c){a&1&&Wb(this.A,c);this.I[a>>1]=b;this.Ha=!0;this.j&&E(this.j,128)&&B(this.j,"Memory.writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0)}}; +function Jb(a,b,c){a.j=b;a.i=a.B=0;c&&((a.i=c.i)&&xc(a,wc,!1),(a.B=c.B)&&vc(a,wc,!1))}function zc(a,b){b?--a.B||(a.Db=a.f?a.J:a.Ob,a.tb=a.f?a.H:a.Pb):--a.i||(a.Ab=a.Ib,a.qa=a.Jb)}function vc(a,b,c){c&&a.B||(a.Db=!a.f&&b[1]||a.J,a.tb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Ob=b[1]||a.J,a.Pb=b[3]||a.H}function xc(a,b,c){c&&a.i||(a.Ab=b[0]||a.K,a.qa=b[2]||a.M);if(c||void 0===c)a.Ib=b[0]||a.K,a.Jb=b[2]||a.M}function rc(a,b){b||(b=Ac);xc(a,b,void 0);vc(a,b,void 0)} +var Ac=[],uc=[I.prototype.V,I.prototype.ta,I.prototype.ja,I.prototype.xa],wc=[I.prototype.T,I.prototype.ma,I.prototype.da,I.prototype.va];if(lb)var tc=[I.prototype.R,I.prototype.la,I.prototype.ca,I.prototype.ua],sc=[I.prototype.U,I.prototype.oa,I.prototype.ga,I.prototype.Ua]; +function Bc(a,b){r.call(this,"CPU",a,Bc,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.Ka=c;this.Va=Math.round(this.Fa/1E4)/100;this.Ra=this.Va*this.Ka;this.v.ea=!1;this.v.Mb=!1;this.v.hb=a.autoStart;this.v.Xa=!1;this.mb=this.ja=0;this.nb=a.csStart;this.Ya=a.csInterval;this.Za=a.csStop;this.K=[];this.Yb=this.ad.bind(this);G(this)}y(Bc);var Cc=["power","reset"];h=Bc.prototype; +h.Da=function(a,b,c,d){this.B=a;this.A=b;this.j=d;for(b=0;b=a.ja&&(a.ja+=a.Ya,c=!0);0<=a.Za&&a.Za<=Ic(a)&&(a.Ya=a.Za=-1,Fc(a),a.fa(),c=!0);c&&a.g(Ic(a)+" cycles: checksum="+k(a.mb))}} +h.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ha)a=!0;else{var b=null,c,l=cb(a.id);for(c=0;ca.V/a.Ra?b=1:d=!0;a.Ka=b;b=a.Va*a.Ka;if(a.Ra!=b){a.Ra=b;b=a.Ra.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.B&&a.B.rb()}Kc(a,a.T);a.T=0;a.R=ra();a.ca=0;Lc(a);return d}function Xb(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function gc(a,b,c){0<=b&&ba.K[b][0]&&(c*=a.Fa*a.Ka/1E3,a.K[b][0]=c+Mc(a))} function Nc(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 Oc(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 Mc(a,b){var c=a.da-=a.b;a.b=0;b&&(a.da=0);return c} -h.$c=function(){if(this.v.ea){this.jb>=this.Fa&&Lc(this,!0);this.oa=0;this.xa=ra();if(this.ca){var a=this.xa-this.ca;a>this.ub&&(this.R+=a,this.R>this.xa&&(this.R=this.xa))}try{do{var b=Nc(this,this.v.Xa?1:this.Oa);try{this.eb(b)}catch(e){if("number"!=typeof e)throw e;}b=Mc(this,!0);this.oa+=b;this.T+=b;Hc(this,b);Oc(this,b);this.la-=b;if(0>=this.la){this.la+=this.Oa;15<=++this.wb&&(this.B&&this.B.ba(),this.wb=0);break}}while(this.v.ea)}catch(e){this.ga();this.B&&this.B.stop(ra(),Ic(this));kb(this, -e.stack||e.message);return}if(this.v.ea){a=setTimeout;b=this.Yb;this.ca=ra();var c=this.ub;this.oa&&(c=Math.round(c*this.oa/this.Oa));var c=c-(this.ca-this.xa),d=this.ca-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Jc(this)));if(0>c||this.Vc&&(this.R-=c),c=0;this.jb+=this.oa;this.ca+=c;a(b,c)}}}; -h.cb=function(a){if(jb(this))return!1;if(this.v.ea)return this.g(this.toString()+" busy"),!1;Jc(this);this.v.ea=!0;this.v.Mb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.qb(!0),this.B.start(this.R,Ic(this)));setTimeout(this.Yb,0);return!0};h.eb=function(){return 0};h.ga=function(a){if(this.v.ea){Mc(this);Kc(this,this.T);this.T=0;this.v.ea=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(ra(),Ic(this))}this.v.complete=a}; -function Pc(a){this.Gb=+a.model||1170;this.qc=a.resetAddr||0;Bc.call(this,a,6666667);this.decode=Qc.bind(this);jd(this);this.C=0;this.U=null;this.v.complete=this.v.kc=!1}y(Pc,Bc);h=Pc.prototype;h.reset=function(){this.v.ea&&this.ga();jd(this);Ec(this);this.v.error=!1;this.parent.reset.call(this)}; +h.ad=function(){if(this.v.ea){this.jb>=this.Fa&&Lc(this,!0);this.oa=0;this.xa=ra();if(this.ca){var a=this.xa-this.ca;a>this.vb&&(this.R+=a,this.R>this.xa&&(this.R=this.xa))}try{do{var b=Nc(this,this.v.Xa?1:this.Oa);try{this.eb(b)}catch(e){if("number"!=typeof e)throw e;}b=Mc(this,!0);this.oa+=b;this.T+=b;Hc(this,b);Oc(this,b);this.la-=b;if(0>=this.la){this.la+=this.Oa;15<=++this.xb&&(this.B&&this.B.ba(),this.xb=0);break}}while(this.v.ea)}catch(e){this.fa();this.B&&this.B.stop(ra(),Ic(this));kb(this, +e.stack||e.message);return}if(this.v.ea){a=setTimeout;b=this.Yb;this.ca=ra();var c=this.vb;this.oa&&(c=Math.round(c*this.oa/this.Oa));var c=c-(this.ca-this.xa),d=this.ca-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.ga=0,Jc(this)));if(0>c||this.Vc&&(this.R-=c),c=0;this.jb+=this.oa;this.ca+=c;a(b,c)}}}; +h.cb=function(a){if(jb(this))return!1;if(this.v.ea)return this.g(this.toString()+" busy"),!1;Jc(this);this.v.ea=!0;this.v.Mb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.rb(!0),this.B.start(this.R,Ic(this)));setTimeout(this.Yb,0);return!0};h.eb=function(){return 0};h.fa=function(a){if(this.v.ea){Mc(this);Kc(this,this.T);this.T=0;this.v.ea=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(ra(),Ic(this))}this.v.complete=a}; +function Pc(a){this.Hb=+a.model||1170;this.qc=a.resetAddr||0;Bc.call(this,a,6666667);this.decode=Qc.bind(this);jd(this);this.C=0;this.U=null;this.v.complete=this.v.kc=!1}y(Pc,Bc);h=Pc.prototype;h.reset=function(){this.v.ea&&this.fa();jd(this);Ec(this);this.v.error=!1;this.parent.reset.call(this)}; function jd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.qc];a.Ea=[0,0,0,0,0,0];a.sa=[0,0,0,0];a.D=0;a.ua=0;a.oc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,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.pa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.rc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.cc=[0,0,0,0,0,0,0,0];a.bc=0;a.F=0;a.H=a.I=0;a.j=a.f=a.Ta=0;a.ma=-1;kd(a)}function kd(a){a.Na=255;a.$=0;a.Lb=0;a.G=0;a.La=0;a.Kb=0;a.Ma=0;a.Ja=0;a.ta=0;a.Wa=262143;a.va=253952;a.F|=2;a.A&&ic(a)}function ic(a){a.Ja?(a.M=65536,a.Y=a.nc,a.qa=a.Xc,a.sb=a.Fd,Lb(a.A,a.Ma&16?22:18)):(a.M=0,a.Y=a.mc,a.qa=a.ac,a.sb=a.gc,Lb(a.A,16))}h.Vb=function(){return 0}; -h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.Ka]);a.set(2,Sb(this.A));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Jc(this,b[3]);a:{b=this.A;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.D!=c&&(a.sa[c]=a.u[6],a.u[6]=a.sa[a.D]);a.L=b;a.F|=2}function P(a,b){a.F&128||(a.S=a.X=b,a.O=0)}function pd(a,b,c){a.F&128||(a.S=a.X=a.N=b,a.O=c||0)}function qd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function rd(a,b){a.F&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function sd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))} -h.aa=function(a,b){if(!this.C){var c=!1;0>this.ma?this.ma=Db(this):this.D||(a=4,c=!0);this.G&57344||(this.La=63222,this.Kb=a);this.D=0;var d=this.qa(a|this.M),e=this.qa(a+2&65535|this.M);kc(this,e&-12289|this.ma>>2&12288);c&&(this.$|=4,this.u[6]=4);td(this,this.ma);td(this,this.u[7]);od(this,d);this.F&=-113;this.ma=-1;if(26!=b)throw a;}};function ud(a){var b=vd(a),c=vd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);od(a,b);kc(a,c);a.F&=-17} +h.aa=function(a,b){if(!this.C){var c=!1;0>this.ma?this.ma=Db(this):this.D||(a=4,c=!0);this.G&57344||(this.La=63222,this.pb=a);this.D=0;var d=this.qa(a|this.M),e=this.qa(a+2&65535|this.M);kc(this,e&-12289|this.ma>>2&12288);c&&(this.$|=4,this.u[6]=4);td(this,this.ma);td(this,this.u[7]);K(this,d);this.F&=-113;this.ma=-1;if(26!=b)throw a;}};function ud(a){var b=vd(a),c=vd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);K(a,b);kc(a,c);a.F&=-17} function wd(a,b,c){var d,e,f,g=0;d=b>>13;a.Ma&a.oc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.pa[a.D][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Ma&32&&(f=a.rc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.va&&4186112>f&&(a.$|=32,a.aa(4,12))}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.P[a.D][d]=e;if(4194170!==f||a.D)a.ta=a.D,a.ua=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.ta<<5|a.ua<<1),a.aa(168,16)),a.G&61440||!(4191360>f||4194239>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.ta=a.D,a.ua=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.ta<<5|a.ua<<1),a.aa(168,16)),a.G&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.qa(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.qa(e)|g; -a.b-=8;break;case 6:return e=nd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=nd(a),e=e+a.u[c]&65535,e=a.qa(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.La=a.La<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32?(a.$|=4,a.u[6]=4,a.aa(4,24)):(a.$|=8,a.F|=64));return e}h.xb=function(a){if(!this.Ja)return this.A.xb(a);this.C++;a=xd(this,wd(this,a,3));this.C--;return a}; -h.lb=function(a){if(!this.Ja)return this.A.lb(a);this.C++;a=this.ac(wd(this,a,2));this.C--;return a};h.pb=function(a,b){this.Ja?(this.C++,yd(this,wd(this,a,5),b),this.C--):this.A.pb(a,b)};h.Bb=function(a,b){this.Ja?(this.C++,this.gc(wd(this,a,4),b),this.C--):this.A.Bb(a,b)};h.mc=function(a,b,c){return zd(this,a,b,c)};h.nc=function(a,b,c){return wd(this,zd(this,a,b,c),c)};h.ac=function(a){return this.A.ka(a)};h.Xc=function(a){return this.A.ka(wd(this,a,2))};h.gc=function(a,b){this.A.Sa(a,b&65535)}; -h.Fd=function(a,b){this.A.Sa(wd(this,a,4),b)};function Ad(a,b,c){var d=a.f=b&7;(b=a.j=(b&56)>>3)?(d=zd(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.qa(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.sa[a.L>>12&3];return c}function Bd(a,b,c,d){a.G&57344||(a.La=22);var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=zd(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=wd(a,e|c&65536,4),a.D=a.L>>14&3,a.A.Sa(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.sa[a.L>>12&3]=d} -function Cd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?xd(a,a.Y(b,c,3)):a.u[c]&255}function Dd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.A.ka(a.Y(b,c,2)):a.u[c]}function Ed(a,b){var c=a.f=b&7;b=a.j=(b&56)>>3;return zd(a,b,c,8)}function Fd(a,b){var c=a.f=b&7;return(b=a.j=(b&56)>>3)?xd(a,a.Y(b,c,3)):a.u[c]&255}function Gd(a,b){var c=a.f=b&7;return(b=a.j=(b&56)>>3)?a.A.ka(a.Y(b,c,2)):a.u[c]} -function Q(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=a.Ta=a.Y(b,e,7),yd(a,e,d.call(a,c,xd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=a.Y(b,e,6),a.A.Sa(e,d.call(a,c,a.A.ka(e)))):a.u[e]=d.call(a,c,a.u[e])}function Hd(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?yd(a,a.Y(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 Id(a,b,c){var d=a.f=b&7;(b=a.j=(b&56)>>3)?a.A.Sa(a.Y(b,d,4),c):a.u[d]=c&65535;return c} -function S(a,b,c){c&&(od(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -h.eb=function(a){this.v.complete=!0;var b=this.v.kc=this.i&&Jd(this.i),c=a?this.v.Mb?0:1:-1;this.v.Mb=!1;this.da=this.b=a;do{if(b){if(Kd(this.i,this.u[7],c)){this.ga();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.aa(168,28):this.F&64?this.aa(4,30):this.F&16&&this.aa(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Lb&224)>>5;if(a=this.U&&this.U.$a>e?this.U:null)d=a.bd,e=a.$a;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.aa(d,26),e=!0):e=!1; -if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.La=0,this.Kb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(nd(this))}while(0=f&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32?(a.$|=4,a.u[6]=4,a.aa(4,24)):(a.$|=8,a.F|=64));return e}h.yb=function(a){if(!this.Ja)return this.A.yb(a);this.C++;a=xd(this,wd(this,a,3));this.C--;return a}; +h.lb=function(a){if(!this.Ja)return this.A.lb(a);this.C++;a=this.ac(wd(this,a,2));this.C--;return a};h.qb=function(a,b){this.Ja?(this.C++,yd(this,wd(this,a,5),b),this.C--):this.A.qb(a,b)};h.Cb=function(a,b){this.Ja?(this.C++,this.gc(wd(this,a,4),b),this.C--):this.A.Cb(a,b)};h.mc=function(a,b,c){return zd(this,a,b,c)};h.nc=function(a,b,c){return wd(this,zd(this,a,b,c),c)};h.ac=function(a){return this.A.ka(a)};h.Yc=function(a){return this.A.ka(wd(this,a,2))};h.gc=function(a,b){this.A.Sa(a,b&65535)}; +h.Id=function(a,b){this.A.Sa(wd(this,a,4),b)};function Ad(a,b,c){var d=a.f=b&7;(b=a.i=(b&56)>>3)?(d=zd(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.qa(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.sa[a.L>>12&3];return c}function Bd(a,b,c,d){a.G&57344||(a.La=22);var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=zd(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=wd(a,e|c&65536,4),a.D=a.L>>14&3,a.A.Sa(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.sa[a.L>>12&3]=d} +function Cd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?xd(a,a.Y(b,c,3)):a.u[c]&255}function Dd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.A.ka(a.Y(b,c,2)):a.u[c]}function Ed(a,b){var c=a.f=b&7;b=a.i=(b&56)>>3;return zd(a,b,c,8)}function Fd(a,b){var c=a.f=b&7;return(b=a.i=(b&56)>>3)?xd(a,a.Y(b,c,3)):a.u[c]&255}function Gd(a,b){var c=a.f=b&7;return(b=a.i=(b&56)>>3)?a.A.ka(a.Y(b,c,2)):a.u[c]} +function Q(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=a.Ta=a.Y(b,e,7),yd(a,e,d.call(a,c,xd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=a.Y(b,e,6),a.A.Sa(e,d.call(a,c,a.A.ka(e)))):a.u[e]=d.call(a,c,a.u[e])}function Hd(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?yd(a,a.Y(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 Id(a,b,c){var d=a.f=b&7;(b=a.i=(b&56)>>3)?a.A.Sa(a.Y(b,d,4),c):a.u[d]=c&65535;return c} +function S(a,b,c){c&&(K(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +h.eb=function(a){this.v.complete=!0;var b=this.v.kc=this.j&&Jd(this.j),c=a?this.v.Mb?0:1:-1;this.v.Mb=!1;this.da=this.b=a;do{if(b){if(Kd(this.j,this.u[7],c)){this.fa();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.aa(168,28):this.F&64?this.aa(4,30):this.F&16&&this.aa(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Lb&224)>>5;if(a=this.U&&this.U.$a>e?this.U:null)d=a.dd,e=a.$a;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.aa(d,26),e=!0):e=!1; +if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.La=0,this.pb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(od(this))}while(0>1|b<<16;rd(this,a);return a&65535}function Qd(a,b){a=b&2048|b>>1|b<<8;rd(this,a<<8);return a&255}function Rd(a,b){a=b&~a;P(this,a);return a}function Sd(a,b){a=b&~a;P(this,a<<8);return a}function Td(a,b){a|=b;P(this,a);return a}function Ud(a,b){a|=b;P(this,a<<8);return a} function Vd(a,b){a=~b|65536;pd(this,a);return a&65535}function Wd(a,b){a=~b|256;pd(this,a<<8);return a&255}function Xd(a,b){a=b-a;this.F&128||(this.S=this.X=a,this.O=b&(b^a));return a&65535}function Yd(a,b){a=b-a;var c=a<<8;b<<=8;this.F&128||(this.S=this.X=c,this.O=b&(b^c));return a&255}function Zd(a,b){a=b+a;this.F&128||(this.S=this.X=a,this.O=a&(b^a));return a&65535}function $d(a,b){a=b+a;var c=a<<8;this.F&128||(this.S=this.X=c,this.O=c&(b<<8^c));return a&255} function ae(a,b){a=-b;pd(this,a,a&b&32768);return a&65535}function be(a,b){a=-b;pd(this,a<<8,(a&b&128)<<8);return a&255}function ce(a,b){a=b<<1|this.N>>16&1;rd(this,a);return a&65535}function de(a,b){a=b<<1|this.N>>16&1;rd(this,a<<8);return a&255}function ee(a,b){a=(this.N&65536|b)>>1|b<<16;rd(this,a);return a&65535}function fe(a,b){a=((this.N&65536)>>8|b)>>1|b<<8;rd(this,a<<8);return a&255}function ge(a,b){var c=b-a;sd(this,c,a,b);return c&65535} function he(a,b){var c=b-a;sd(this,c<<8,a<<8,b<<8);return c&255}function ie(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function je(a,b){a^=b;P(this,a);return a&65535} -function ke(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.j?6:7)+b} -function le(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32>b-1;this.N=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.S=d>>16;this.X=d>>16|d;this.b-=(this.j?6:7)+b}function U(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5} -function me(a){var b=Gd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=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.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}var ne=[0,7,7,10,7,11,9,13];function oe(a){var b=this.b;od(this,Ed(this,a));this.b=b-ne[this.j]} -var pe=[0,14,14,17,14,18,16,20];function qe(a){var b=this.b,c=Ed(this,a);a=a>>6&7;td(this,this.u[a]);this.u[a]=this.u[7];od(this,c);this.b=b-pe[this.j]}var re=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],se=[7,13,13,17,14,18,17,21];function te(a){var b=Gd(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.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)od(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function we(a){R(this,a,0,ie);this.b-=this.j?9:3+(7==this.f?2:0)}function xe(a){R(this,a,Dd(this,a),je);this.b-=this.j?9:3+(7==this.f?2:0)}function W(){this.aa(8,6)}function Qc(a){ye[a>>12].call(this,a)} -var ye=[function(a){ze[a>>8&15].call(this,a)},function(a){var b=Dd(this,a),c=this.b;P(this,Id(this,a,b));this.b=c-re[(this.H?8:0)+this.j]+(7!=this.f||this.j?0:2)},function(a){var b=Dd(this,a);a=Gd(this,a);sd(this,b-a,a,b);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,Dd(this,a)&Gd(this,a));this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Rd);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f? -2:0)},function(a){R(this,a,Dd(this,a),Td);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Ld);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},function(a){var b=Cd(this,a);P(this,Hd(this,a,b,1)<<8);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=Cd(this,a)<<8;a=Fd(this,a)<<8;sd(this,b-a,a,b);this.b-=this.j? -4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,(Cd(this,a)&Fd(this,a))<<8);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Sd);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Ud);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),ge);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},W],ze= -[function(a){Ve[a>>4&15].call(this,a)},function(a){S(this,a,!0)},function(a){S(this,a,!md(this))},function(a){S(this,a,md(this))},function(a){S(this,a,!this.Ca()==!ld(this))},function(a){S(this,a,!this.Ca()!=!ld(this))},function(a){S(this,a,!md(this)&&!this.Ca()==!ld(this))},function(a){S(this,a,md(this)||!this.Ca()!=!ld(this))},qe,qe,function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},function(a){Ye[a>>6&3].call(this,a)},function(a){Ze[a>>6&3].call(this,a)},W,W],We=[function(a){pd(this, -Id(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Vd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Zd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Xd);this.b-=this.j?9:3+(7==this.f?2:0)}],Xe=[function(a){R(this,a,0,ae);this.b-=this.j?11:6},function(a){R(this,a,O(this)?1:0,Ld);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,O(this)?1:0,ge);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Gd(this,a);pd(this,a);this.b-=this.j?4:3+(7==this.f? -2:0)}],Ye=[function(a){R(this,a,0,ee);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ce);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Pd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Nd);this.b-=this.j?9:3+(7==this.f?2:0)}],Ze=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.qa(a|this.M);od(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ad(this,a,0);td(this,a);P(this,a);this.b-=11},function(a){var b=vd(this),c=this.b;Bd(this,a, -0,b);P(this,b);this.b=c-se[this.j]},function(a){P(this,Id(this,a,this.Ca?65535:0));this.b-=this.j?9:3+(7==this.f?2:0)}],Ve=[function(a){$e[a&15].call(this,a)},W,W,W,oe,oe,oe,oe,function(a){if(a&8)this.aa(8,6);else{var b=vd(this);a&=7;od(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):this.aa(8,6)},function(a){af[a&15].call(this,a)},function(a){bf[a&15].call(this,a)},we,we,we,we],$e=[function(){this.L&49152?(this.$|=128,this.aa(4, -3)):this.ga();this.b-=7},function(){this.F&4||this.B.ba();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){ud(this);this.F|=this.L&16;this.b-=13},function(){this.aa(12,1);this.b-=5},function(){this.aa(16,4);this.b-=25},function(){this.L&49152||(kd(this),this.A.reset());this.b-=667},function(){ud(this);this.b-=13},W,W,W,W,W,W,W,W,W],af=[ue,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},U,function(){this.X=1;this.b-=5},U,U,U,function(){this.S=0;this.b-=5},U,U,U,U,U,U,U],bf= -[ue,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},V,function(){this.X=0;this.b-=5},V,V,V,function(){this.S=32768;this.b-=5},V,V,V,V,V,V,V],Te=[te,te,me,me,ke,ke,le,le,xe,xe,W,W,W,W,ve,ve],Ue=[function(a){S(this,a,!this.Ca())},function(a){S(this,a,this.Ca())},function(a){S(this,a,!O(this)&&!md(this))},function(a){S(this,a,O(this)||md(this))},function(a){S(this,a,!ld(this))},function(a){S(this,a,ld(this))},function(a){S(this,a,!O(this))},function(a){S(this,a,O(this))},function(){this.aa(24, -2);this.b-=25},function(){this.aa(28,5);this.b-=5},function(a){cf[a>>6&3].call(this,a)},function(a){df[a>>6&3].call(this,a)},function(a){ef[a>>6&3].call(this,a)},function(a){ff[a>>6&3].call(this,a)},W,W],cf=[function(a){pd(this,Hd(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Wd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,$d);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Yd);this.b-=this.j?9:3+(7==this.f?2:0)}],df=[function(a){Q(this,a,0,be);this.b-= -this.j?11:6},function(a){Q(this,a,O(this)?1:0,Md);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,O(this)?1:0,he);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Fd(this,a);pd(this,a<<8);this.b-=this.j?4:3+(7==this.f?2:0)}],ef=[function(a){Q(this,a,0,fe);this.b-=this.j?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,de);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Qd);this.b-=this.j?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,Od);this.b-=this.j?9:3+(7== -this.f?2:0)}],ff=[W,function(a){a=Ad(this,a,65536);td(this,a);P(this,a);this.b-=11},function(a){var b=vd(this),c=this.b;Bd(this,a,65536,b);P(this,b);this.b=c-se[this.j]},W];function gf(a){r.call(this,"ROM",a,gf);this.f=null;this.D=a.addr;this.j=a.size;this.G=a.writable;this.B=a.alias;this.C=a.file;this.H=da(this.C);if(this.C){a=this.C;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){hf(c,a,b,f)})}}y(gf); -gf.prototype.Da=function(a,b,c,d){this.A=b;this.b=c;this.i=d;jf(this)};gf.prototype.Aa=function(){if(this.Ba){if(this.i){var a=this.i,b=this.id,c=this.D,d=this.j,e=this.Ba,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],w=qa(q,m,a.Rb);0>w&&q.splice(-(w+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Kd:b,w:c,sc:d,Ba:e,Qb:f})}delete this.Ba}return!0};gf.prototype.za=function(){return!0}; -function hf(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.Db,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.Ba=l.symbols;if(!a.f.length){n("Empty ROM: "+ -b);return}if(1==a.f.length){n(a.f[0]);return}}catch(m){a.na("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=oa(b[0]);if(c!=this.Ua)return;b=oa(b[1]);if(this.I=db(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Db+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.Zb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.za=function(a){return a?this.save():!0};h.reset=function(){of(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return of(this)};function of(a){a.R=0;a.f=0;a.j=128;a.D=[];return!0}h.Jb=function(a){if("number"==typeof a)this.D.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.T||8,c=a-this.H%a,this.T&&(b=na("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.g(this.G), -this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.j&=-129;gc(this.b,this.V,1)}};var pf={},nf=(pf[65392]=[null,null,Y.prototype.Mc,Y.prototype.ud,"RCSR"],pf[65394]=[null,null,Y.prototype.Lc,Y.prototype.td,"RBUF"],pf[65396]=[null,null,Y.prototype.Zc,Y.prototype.Hd,"XCSR"],pf[65398]=[null,null,Y.prototype.Yc,Y.prototype.Gd,"XBUF"],pf);La(function(){for(var a=A(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};qf.prototype.Wb=function(){return-1};qf.prototype.Xb=function(){}; -function sf(a,b,c,d){if(c)if(b){0>a.C&&a.j.length&&(a.C=0);if(0>a.C||b!=a.j[a.C])a.j.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.j[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(oa(b.substring(c,f))),c=f+1}}return a} +function ke(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.i?6:7)+b} +function le(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32>b-1;this.N=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.S=d>>16;this.X=d>>16|d;this.b-=(this.i?6:7)+b}function U(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5} +function me(a){var b=Gd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=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.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}var ne=[0,7,7,10,7,11,9,13];function oe(a){var b=this.b;K(this,Ed(this,a));this.b=b-ne[this.i]} +var pe=[0,14,14,17,14,18,16,20];function qe(a){var b=this.b,c=Ed(this,a);a=a>>6&7;td(this,this.u[a]);this.u[a]=this.u[7];K(this,c);this.b=b-pe[this.i]}var re=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],se=[7,13,13,17,14,18,17,21];function te(a){var b=Gd(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.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)K(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function we(a){R(this,a,0,ie);this.b-=this.i?9:3+(7==this.f?2:0)}function xe(a){R(this,a,Dd(this,a),je);this.b-=this.i?9:3+(7==this.f?2:0)}function W(){this.aa(8,6)}function Qc(a){ye[a>>12].call(this,a)} +var ye=[function(a){ze[a>>8&15].call(this,a)},function(a){var b=Dd(this,a),c=this.b;P(this,Id(this,a,b));this.b=c-re[(this.H?8:0)+this.i]+(7!=this.f||this.i?0:2)},function(a){var b=Dd(this,a);a=Gd(this,a);sd(this,b-a,a,b);this.b-=this.i?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,Dd(this,a)&Gd(this,a));this.b-=this.i?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Rd);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f? +2:0)},function(a){R(this,a,Dd(this,a),Td);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Ld);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},function(a){var b=Cd(this,a);P(this,Hd(this,a,b,1)<<8);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=Cd(this,a)<<8;a=Fd(this,a)<<8;sd(this,b-a,a,b);this.b-=this.i? +4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,(Cd(this,a)&Fd(this,a))<<8);this.b-=this.i?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Sd);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Ud);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),ge);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},W],ze= +[function(a){Ve[a>>4&15].call(this,a)},function(a){S(this,a,!0)},function(a){S(this,a,!nd(this))},function(a){S(this,a,nd(this))},function(a){S(this,a,!this.Ca()==!md(this))},function(a){S(this,a,!this.Ca()!=!md(this))},function(a){S(this,a,!nd(this)&&!this.Ca()==!md(this))},function(a){S(this,a,nd(this)||!this.Ca()!=!md(this))},qe,qe,function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},function(a){Ye[a>>6&3].call(this,a)},function(a){Ze[a>>6&3].call(this,a)},W,W],We=[function(a){pd(this, +Id(this,a,0));this.b-=this.i?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Vd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Zd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Xd);this.b-=this.i?9:3+(7==this.f?2:0)}],Xe=[function(a){R(this,a,0,ae);this.b-=this.i?11:6},function(a){R(this,a,ld(this)?1:0,Ld);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){R(this,a,ld(this)?1:0,ge);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){a=Gd(this,a);pd(this,a);this.b-=this.i?4:3+(7==this.f? +2:0)}],Ye=[function(a){R(this,a,0,ee);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ce);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Pd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Nd);this.b-=this.i?9:3+(7==this.f?2:0)}],Ze=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.qa(a|this.M);K(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ad(this,a,0);td(this,a);P(this,a);this.b-=11},function(a){var b=vd(this),c=this.b;Bd(this,a, +0,b);P(this,b);this.b=c-se[this.i]},function(a){P(this,Id(this,a,this.Ca?65535:0));this.b-=this.i?9:3+(7==this.f?2:0)}],Ve=[function(a){$e[a&15].call(this,a)},W,W,W,oe,oe,oe,oe,function(a){if(a&8)this.aa(8,6);else{var b=vd(this);a&=7;K(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):this.aa(8,6)},function(a){af[a&15].call(this,a)},function(a){bf[a&15].call(this,a)},we,we,we,we],$e=[function(){this.L&49152?(this.$|=128,this.aa(4, +3)):this.fa();this.b-=7},function(){this.F&4||this.B.ba();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){ud(this);this.F|=this.L&16;this.b-=13},function(){this.aa(12,1);this.b-=5},function(){this.aa(16,4);this.b-=25},function(){this.L&49152||(kd(this),this.A.reset());this.b-=667},function(){ud(this);this.b-=13},W,W,W,W,W,W,W,W,W],af=[ue,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},U,function(){this.X=1;this.b-=5},U,U,U,function(){this.S=0;this.b-=5},U,U,U,U,U,U,U],bf= +[ue,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},V,function(){this.X=0;this.b-=5},V,V,V,function(){this.S=32768;this.b-=5},V,V,V,V,V,V,V],Te=[te,te,me,me,ke,ke,le,le,xe,xe,W,W,W,W,ve,ve],Ue=[function(a){S(this,a,!this.Ca())},function(a){S(this,a,this.Ca())},function(a){S(this,a,!ld(this)&&!nd(this))},function(a){S(this,a,ld(this)||nd(this))},function(a){S(this,a,!md(this))},function(a){S(this,a,md(this))},function(a){S(this,a,!ld(this))},function(a){S(this,a,ld(this))},function(){this.aa(24, +2);this.b-=25},function(){this.aa(28,5);this.b-=5},function(a){cf[a>>6&3].call(this,a)},function(a){df[a>>6&3].call(this,a)},function(a){ef[a>>6&3].call(this,a)},function(a){ff[a>>6&3].call(this,a)},W,W],cf=[function(a){pd(this,Hd(this,a,0));this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Wd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,$d);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Yd);this.b-=this.i?9:3+(7==this.f?2:0)}],df=[function(a){Q(this,a,0,be);this.b-= +this.i?11:6},function(a){Q(this,a,ld(this)?1:0,Md);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,ld(this)?1:0,he);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){a=Fd(this,a);pd(this,a<<8);this.b-=this.i?4:3+(7==this.f?2:0)}],ef=[function(a){Q(this,a,0,fe);this.b-=this.i?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,de);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Qd);this.b-=this.i?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,Od);this.b-=this.i?9:3+(7== +this.f?2:0)}],ff=[W,function(a){a=Ad(this,a,65536);td(this,a);P(this,a);this.b-=11},function(a){var b=vd(this),c=this.b;Bd(this,a,65536,b);P(this,b);this.b=c-se[this.i]},W];function gf(a){r.call(this,"ROM",a,gf);this.f=null;this.D=a.addr;this.i=a.size;this.G=a.writable;this.B=a.alias;this.C=a.file;this.H=da(this.C);if(this.C){a=this.C;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){hf(c,a,b,f)})}}y(gf); +gf.prototype.Da=function(a,b,c,d){this.A=b;this.b=c;this.j=d;jf(this)};gf.prototype.Aa=function(){if(this.Ba){if(this.j){var a=this.j,b=this.id,c=this.D,d=this.i,e=this.Ba,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],w=qa(q,m,a.Rb);0>w&&q.splice(-(w+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Nd:b,w:c,sc:d,Ba:e,Qb:f})}delete this.Ba}return!0};gf.prototype.za=function(){return!0}; +function hf(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.Eb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.Ba=l.symbols;if(!a.f.length){n("Empty ROM: "+ +b);return}if(1==a.f.length){n(a.f[0]);return}}catch(m){a.na("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=oa(b[0]);if(c!=this.Ua)return;b=oa(b[1]);if(this.I=db(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Eb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.Zb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.za=function(a){return a?this.save():!0};h.reset=function(){of(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return of(this)};function of(a){a.R=0;a.f=0;a.i=128;a.D=[];return!0}h.Kb=function(a){if("number"==typeof a)this.D.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.T||8,c=a-this.H%a,this.T&&(b=na("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.g(this.G), +this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.i&=-129;gc(this.b,this.V,1)}};var pf={},nf=(pf[65392]=[null,null,Y.prototype.Nc,Y.prototype.xd,"RCSR"],pf[65394]=[null,null,Y.prototype.Mc,Y.prototype.wd,"RBUF"],pf[65396]=[null,null,Y.prototype.$c,Y.prototype.Kd,"XCSR"],pf[65398]=[null,null,Y.prototype.Zc,Y.prototype.Jd,"XBUF"],pf);La(function(){for(var a=A(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};qf.prototype.Wb=function(){return-1};qf.prototype.Xb=function(){}; +function sf(a,b,c,d){if(c)if(b){0>a.C&&a.i.length&&(a.C=0);if(0>a.C||b!=a.i[a.C])a.i.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.i[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(oa(b.substring(c,f))),c=f+1}}return a} function tf(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 uf(a,b,c){var d;if(b){b=vf(a,b);for(var e=0,f=!1,g=b,l=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+ca(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function yf(a,b){if(b)return xf(a,b,a.ca[b]);var c=0;for(b in a.ca)xf(a,b,a.ca[b]),c++;return 0>>d.A.Z;m=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.g("..."):(c=q.type,p=Rb[c],q&&d.g(k(q.id,8)+" %"+k(e<>>d.A.Z;m=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.g("..."):(c=q.type,p=Rb[c],q&&d.g(k(q.id,8)+" %"+k(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;dd&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.Xb=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.sa[a-16]:20==a&&(b=Db(this.b)));return b}; -h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.u[7]).w));this.ia&1073741824?this.ta.push(a):this.oa&&a==this.oa||(this.oa=a,this.ia&-2147483648&&(this.ga(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Mc(a),a.la=0,a.B.ba()))}; -function Bf(a){var b;if(Jd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b>>d.Z],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.Z],!0);a.D=["bw"];a.Ta=0} +h.save=function(){var a=new O(this);a.set(0,Jf(this.K));a.set(1,Jf(this.T));a.set(2,[this.i,this.U,this.ia]);a.set(3,this.G);return a.data()};h.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Kf(a[b++]),this.T=Kf(a[b++]),this.i=a[b][0],"string"==typeof this.i&&(this.i=[this.i]),this.U=a[b][1],this.ia|=a[b][2]);a[3]&&(this.G=a[3]);return!0};h.start=function(a,b){this.V||this.g("running");this.v.ea=!0;this.jb=a;this.vb=b}; +h.stop=function(a,b){if(this.v.ea){this.v.ea=!1;this.H=b-this.vb;if(!this.V){b="stopped";if(this.H){a-=this.jb;var c=0>>d.Z],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.Z],!0);a.D=["bw"];a.Ta=0} h.Pa=function(a,b,c){var d=!0;c||Rf(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.g("invalid address: "+J(this,b.w)),d=!1;else{var f=this.A;f.W[e>>>f.Z].Pa(e&f.A,a==this.D)}}d&&(a.push(b),c?b.ya=!0:(Sf(this,a,a.length-1,"set"),Bf(this)));return d};function Rf(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.Z],b==a.D));l.ya||Bf(a);break}}return f} function Tf(a,b){for(var c=1;c>23)&65535,x=J(v,u);else if(8192==D)u=u.w-((f&63)<<1)&65535,x=J(v,u);else if(12288==D)x=J(v,f&7,1);else if(24576==D)x=J(v,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:x=Mf(C);break;case 8:x="@"+Mf(C);break;case 16:7>C?x="("+Mf(C)+ ")+":(D=v.ka(u,2),x="#"+J(v,D,0,!0));break;case 24:7>C?x="@("+Mf(C)+")+":(D=v.ka(u,2),x="@#"+J(v,D,0,!0));break;case 32:x="-("+Mf(C)+")";break;case 40:x="@-("+Mf(C)+")";break;case 48:D=v.ka(u,2);x=J(v,D,0,!0)+"("+Mf(C)+")";7==C&&(x=[x,J(v,D+u.w&65535)]);break;case 56:D=v.ka(u,2),x="@"+J(v,D)+"("+Mf(C)+")",7==C&&(x=[x,J(v,D+u.w&65535)])}v=x;if(!v||!v.length){l="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]);0b?(c=Mf(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.sa[b-16]):20==b&&(c="PS="+J(a,Db(d)));c&&(c+=" ");return c}function Yf(a){var b,c="";for(b=0;6>b;b++)c+=Xf(a,b);c=c+"\n"+(Xf(a,6)+Xf(a,7)+Xf(a,20));return c+=Wf(a,"T")+Wf(a,"N")+Wf(a,"Z")+Wf(a,"V")+Wf(a,"C")}h.Rb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.sc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.g("unknown register: "+e);return}a.B.ba();a.g("updated registers:")}a.g(Yf(a));c&&(a.K=Z(d.u[7]),Pf(a,J(a,a.K.w)))}}function cg(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1b)){d.u[b]=f&65535;break}a.g("unknown register: "+e);return}a.B.ba();a.g("updated registers:")}a.g(Yf(a));c&&(a.K=Z(d.u[7]),Pf(a,J(a,a.K.w)))}}function cg(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.g(p)}l[3]&&(g=l[3],f=null);f=Vf(a,b,g,f);a.g(f);a.K=b;e-=b.w-m;c++}}} function Uf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.U&&(a.g("ended assemble at "+J(a,a.T.w)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.oa=null;if(ib(a)&&0q||"z"ha.length&&(a.g("note: only "+ha.length+" available"),X=ha.length);aa-=X;0>aa&&(null==ha[ha.length-1].w?(X=aa+X,aa=0):aa+=ha.length);var Uc=[];"call"==Fe&&(nb=1E5,Uc=["CALL"]);for(void 0!==Ee&&a.g(X+" instructions earlier:");0=ha.length&&(aa=0);a.Va=X;He++;nb--}}He||(a.g("no "+Ge+"history available"),a.Va=void 0)}else{var pb=Hf(a,ga);if(pb){var Yb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||wg),Yb=wf(a,za)>>>0,65536>4||1;yg--&&0ac?String.fromCharCode(ac):".";Zb--}qb&&(qb+="\n");qb+=ga+" "+Vc+(0==sb?" "+Ke:"")}qb&&a.g(qb);a.Oa=pb}}}}break;case "e":if("else"==g[0])break;var Ua,Xc,Yc,Zc,$c=g[0],ad=g[1];"eb"==$c?(Ua=1,Xc=255,Yc=a.kb,Zc=a.Ab):"e"==$c||"ew"==$c?(Ua=2,Xc=65535,Yc=a.ka,Zc=a.Sa):ad=null;if(null==ad)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var bc=Hf(a,ad);if(bc)for(var cc=2;cc< -g.length;cc++){var tb=uf(a,g[cc]);if(void 0===tb){a.g("unrecognized value: "+g[cc]);break}tb&~Xc&&a.g("warning: "+k(tb)+" exceeds "+Ua+"-byte value");var zg=Yc.call(a,bc);a.g("changing "+J(a,bc.w)+" from "+J(a,zg,Ua)+" to "+J(a,tb,Ua));Zc.call(a,bc,tb,Ua)}}break;case "g":a:{var Le=g[1],Ag=b;if(void 0!==Le){var bd=Hf(a,Le,!0);if(!bd)break a;Lf(a,bd,Ag);a.Pa(a.f,bd,!0)}a.cb(!0,c)}break;case "h":a.v.ea?(c||a.g("halting"),a.ga()):hb(a,!0)||c||a.g("already halted");break;case "i":if("if"==g[0]){var cd; +a.g("dump extension commands:\n\t"+Ra)}else if("state"==ga){var Ae=eg(a.B,!0);"console"==za?console.log(Ae):(a.Qa&&(a.Qa.value=""),a.g(Ae))}else if("symbols"==ga)for(var Sc=0;Scha.length&&(a.g("note: only "+ha.length+" available"),X=ha.length);ba-=X;0>ba&&(null==ha[ha.length-1].w?(X=ba+X,ba=0):ba+=ha.length);var Uc=[];"call"==Fe&&(nb=1E5,Uc=["CALL"]);for(void 0!==Ee&&a.g(X+" instructions earlier:");0=ha.length&&(ba=0);a.Va=X;He++;nb--}}He||(a.g("no "+Ge+"history available"),a.Va=void 0)}else{var pb=Hf(a,ga);if(pb){var Yb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||wg),Yb=wf(a,za)>>>0,65536>4||1;yg--&&0ac?String.fromCharCode(ac):".";Zb--}qb&&(qb+="\n");qb+=ga+" "+Vc+(0==sb?" "+Ke:"")}qb&&a.g(qb);a.Oa=pb}}}}break;case "e":if("else"==g[0])break;var Ua,Xc,Yc,Zc,$c=g[0],ad=g[1];"eb"==$c?(Ua=1,Xc=255,Yc=a.kb,Zc=a.Bb):"e"==$c||"ew"==$c?(Ua=2,Xc=65535,Yc=a.ka,Zc=a.Sa):ad=null;if(null==ad)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var bc=Hf(a,ad);if(bc)for(var cc=2;cc< +g.length;cc++){var tb=uf(a,g[cc]);if(void 0===tb){a.g("unrecognized value: "+g[cc]);break}tb&~Xc&&a.g("warning: "+k(tb)+" exceeds "+Ua+"-byte value");var zg=Yc.call(a,bc);a.g("changing "+J(a,bc.w)+" from "+J(a,zg,Ua)+" to "+J(a,tb,Ua));Zc.call(a,bc,tb,Ua)}}break;case "g":a:{var Le=g[1],Ag=b;if(void 0!==Le){var bd=Hf(a,Le,!0);if(!bd)break a;Lf(a,bd,Ag);a.Pa(a.f,bd,!0)}a.cb(!0,c)}break;case "h":a.v.ea?(c||a.g("halting"),a.fa()):hb(a,!0)||c||a.g("already halted");break;case "i":if("if"==g[0]){var cd; var ub=b.substr(2),ub=oa(ub);uf(a,ub)?(c||a.g("true: "+ub),cd=!0):(c||a.g("false: "+ub),cd=!1);cd||(d=!1);break}f=!0;break;case "k":var Bg=g[0];if("?"==g[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var dd=0,ed=Z(),vb=Z(a.b.u[6]);for(a.g("stack trace for "+J(a,vb.w));10>dd;){for(var Aa=null,Cg=256;65536>vb.w>>>0;){ed.w=a.ka(vb,2);if(null==vb.w||!Cg--)break;if(!(ed.w&1)){for(var Dg=a,dc=ed,Me=null,wb=dc.w,Ne=wb,fd=1;6>=fd&&wb;fd++){if(2< fd){dc.w=wb;var ec=Vf(Dg,dc);if(0<=ec.indexOf("JSR")){var Oe=ec.indexOf(" ");if(wb+(ec.indexOf(" ",Oe+1)-Oe-1)/2==Ne){Me=ec;break}}}wb-=2}dc.w=Ne;if(Aa=Me)break}}if(!Aa||null==Aa)break;var Pe=null;if("ks"==Bg){var Qe=Aa.match(/[0-9A-F]+$/);Qe&&(Pe=bg(a,Qe[0]))}Aa=na(Aa,50)+" ;"+(Pe||"stack="+J(a,vb.w));a.g(Aa);dd++}dd||a.g("no return addresses found")}break;case "l":if("ln"==g[0]){bg(a,g[1],!0);break}f=!0;break;case "m":a:{var ia,ja=null,F=g[1];"?"==F&&(F=void 0);if(void 0!==F){var sa=0;if("all"== F)sa=1878917119,F=null;else if("on"==F)ja=!0,F=null;else if("off"==F)ja=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ia in H)if(F==ia){sa=H[ia];ja=!!(a.ia&sa);break}if(!sa){a.g("unknown message category: "+F);break a}}if(sa)if("on"==g[2])a.ia|=sa,ja=!0;else if("off"==g[2]&&(a.ia&=~sa,ja=!1,1073741824==sa)){for(var gd=0;gd\nLicense: GPL version 3 or later ");this.g("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.g("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bhg){if(jg(d,this.I)){this.D=new N(this,"1.30.1","failsafe");jg(this.D)&&(og(this,d),a=2,pg(this.D));this.D.set("timestamp",ta());qg(this.D);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"== -f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.j=null)):this.g(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.I;delete this.K}e=cb(this.id);for(f=0;fhg){if(jg(d,this.I)){this.D=new O(this,"1.30.1","failsafe");jg(this.D)&&(og(this,d),a=2,pg(this.D));this.D.set("timestamp",ta());qg(this.D);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"== +f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.i=null)):this.g(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.I;delete this.K}e=cb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(rg(this,this.b,b,c,a),this.b.hb());this.T&&(og(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0}; -function og(a,b){if(va("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.j||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.da;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}} -function eg(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=ta();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.ga(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var l=cb(a.id),m=0;ma[1];a=a[2];this.ga=!0;this.v.ha=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(rg(this,this.b,b,c,a),this.b.hb());this.T&&(og(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0}; +function og(a,b){if(va("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.i||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.da;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}} +function eg(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new O(a,"1.30.1"),g=new O(a,"1.30.1","validate"),l=ta();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.fa(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var l=cb(a.id),m=0;mf.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"), diff --git a/versions/pdpjs/1.30.1/pdp11.js b/versions/pdpjs/1.30.1/pdp11.js index 362af0325..ceecceec5 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -683,53 +683,53 @@ */ var g; function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var ja={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"},ka=Date.now||function(){return+new Date}; function la(){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 m(a,b,c,d){var e=0,f=null,h=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)}),h;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var n="",q;for(q in b)b.hasOwnProperty(q)&&(n&&(n+="&"),n+=q+"="+encodeURIComponent(b[q]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),h=[f,e]);return h}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")} +function m(a,b,c,d){var e=0,f=null,k=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)}),k;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== +typeof b){var n="",q;for(q in b)b.hasOwnProperty(q)&&(n&&(n+="&"),n+=q+"="+encodeURIComponent(b[q]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),k=[f,e]);return k}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")} function p(a){window&&window.alert(a)}function ma(a){var b=!1;window&&(b=window.confirm(a));return b}var na=null;function oa(){if(null==na){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}na=a}return na}function pa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} function qa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var r={init:[],show:[],exit:[]},sa=!1,ta=!1,ua=!0;function va(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function u(a){r.init.push(a)} function wa(a){if(ua)try{for(var b=0;bb?this.Ea=this.id:(this.Ta=this.id.substr(0,b),this.Ea=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Vc:!1,Wc:!1,L:!1,error:!1};this.Na=null;this.h.error=!1;this.v={};this.H=null;w.push(this)}var za=void 0,Aa={}; +function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.hb=b.comment;this.Bb=b;b=this.id.indexOf(".");0>b?this.Ea=this.id:(this.Ta=this.id.substr(0,b),this.Ea=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Yc:!1,Zc:!1,L:!1,error:!1};this.Na=null;this.h.error=!1;this.v={};this.H=null;w.push(this)}var za=void 0,Aa={}; if(window){za||(za=window.location.search.substr(1));for(var Ba,Ca=/\+/g,Da=/([^&=]+)=?([^&]*)/g;Ba=Da.exec(za);)Aa[decodeURIComponent(Ba[1].replace(Ca," "))]=decodeURIComponent(Ba[2].replace(Ca," "))}function Ea(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 x(a,b){b||(b=v);a.prototype=Ea(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Fa=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Fa={},w=[];function Ga(a,b,c){Fa[a]&&b&&(Fa[a][b]=c)}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;d=""+e}else d=k(c,d);else d="--------".substr(0,d||4);a.v[b].textContent!=d&&(a.v[b].textContent=d)}}function Ma(a,b,c,d){for(var e=0;e>=3;d=""+e}else d=h(c,d);else d="--------".substr(0,d||4);a.v[b].textContent!=d&&(a.v[b].textContent=d)}}function Ma(a,b,c,d){for(var e=0;e>1)+2;10>this.c&&(this.c=10);15>2;this.g=this.l-1;this.w=this.B/this.l|0;this.ha=[];this.R=0;this.o=[];this.vb=[Pa,Qa,Ra,Sa];a=new G(this);Ta(a,this.H);this.b=Array(this.w);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=Ua(d,b|4186112)}function Qa(a,b,c){var d=!1,e=this.controller,f=e.ha[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.ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||Ua(e,c|4186112)} function Ra(a,b){var c=-1,d=this.controller;(a=d.ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=Ua(d,b|4186112)}function Sa(a,b,c){var d=!1,e=this.controller;if(a=e.ha[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||Ua(e,c|4186112)}function Va(a,b){if(b!=a.m){var c;a.m&&(c=(1<>>a.c;0h&&(t=h);if(!e&&n&&n.size){if(n.type==d){if(f+h<=n.za)return n.Pa+=n.za-f,n.za=f,!0;if(f>=n.za+n.Pa){t=n.size-(f-q);t>h&&(t=h);n.Pa=f-n.za+t;f=q+a.l;h-=t;l++;continue}}return $a(1,f,h)}f=new G(a,f,t,a.l,d,e);Ta(f,a.H,n);a.b[l++]=f;f=q+a.l;h-=t}return 0>=h?(a.status(Math.floor(c/1024)+"Kb "+ab[d]+" at "+k(b,8,!0)),!0):$a(2,b,c)} +function Ya(a,b,c,d,e){for(var f=b,k=c,l=f>>>a.c;0k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.za)return n.Pa+=n.za-f,n.za=f,!0;if(f>=n.za+n.Pa){t=n.size-(f-q);t>k&&(t=k);n.Pa=f-n.za+t;f=q+a.l;k-=t;l++;continue}}return $a(1,f,k)}f=new G(a,f,t,a.l,d,e);Ta(f,a.H,n);a.b[l++]=f;f=q+a.l;k-=t}return 0>=k?(a.status(Math.floor(c/1024)+"Kb "+ab[d]+" at "+h(b,8,!0)),!0):$a(2,b,c)} function Xa(a,b,c){var d=[];for(b>>>=a.c;0>>=a.c;0>>a.c].Xa(b&a.g,b)}function cb(a,b){return a.b[(b&a.i)>>>a.c].S(b&a.g,b)}Oa.prototype.ab=function(a,b){this.R++;this.b[(a&this.i)>>>this.c].sb(a&this.g,b&255,a);this.R--};function db(a,b,c){a.b[(b&a.i)>>>a.c].Qa(b&a.g,c&65535,b)} -function eb(a){for(var b=0,c=[],d=0;da.a.jb)){var h=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,q=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&q&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(q)));fb(a,e,e,h,l,n,q,f[4])}}}function hb(a,b){a.o.push(b)}function ib(a,b){a.R||H(a.a,4,b)} -function $a(a,b,c){p("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function I(a){v.call(this,"Device",a,I);this.c={data:0,Uc:0,Oa:20,Yc:0};this.b={Xc:0,bb:-1}}x(I);g=I.prototype;g.ka=function(a,b,c,d){this.l=b;this.a=c;this.H=d;var e=this;this.b.bb=jb(c,function(){e.b.la|=128;e.b.la&64&&(kb(e.a,e.b.mc),lb(e.a,e.b.bb,1E3/60))});this.b.mc=mb(64,6);gb(b,this,J);hb(b,this.reset.bind(this));D(this)};g.Kb=function(){var a=this.b.la;this.b.la&=-129;return a}; -g.uc=function(a){this.b.la=a;a&64&&lb(this.a,this.b.bb,1E3/60);this.b.la=a&-129};g.Mb=function(){var a=this.a;return a.A&62337|a.Fa<<5|a.Ga<<1};g.wc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Fa=a>>5&3;b.Ga=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,nb(b))}ob(this)};g.Nb=function(){var a=this.a.ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Ob=function(){return this.a.Za};g.Pb=function(){return this.a.na}; -g.xc=function(a){var b=this.a;1170>b.jb&&(a&=-49);b.na!=a&&(b.na=a,a&16?(b.Va=4194303,b.Ha=3915776):(b.Va=262143,b.Ha=253952),nb(b));ob(this)};function ob(a){a.c.Oa=a.c.Oa&-8|(a.a.Ba?a.a.na&16?1:2:4)}g.ac=function(a){return this.a.C[1][a>>1&7]};g.Jc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.Zb=function(a){return this.a.C[1][(a>>1&7)+8]};g.Hc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.$b=function(a){return this.a.P[1][a>>1&7]};g.Ic=function(a,b){b=b>>1&7;this.a.P[1][b]=a;this.a.C[1][b]&=65295}; -g.Yb=function(a){return this.a.P[1][(a>>1&7)+8]};g.Gc=function(a,b){b=(b>>1&7)+8;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.Jb=function(a){return this.a.C[0][a>>1&7]};g.tc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Hb=function(a){return this.a.C[0][(a>>1&7)+8]};g.rc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};g.Ib=function(a){return this.a.P[0][a>>1&7]};g.sc=function(a,b){b=b>>1&7;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.Gb=function(a){return this.a.P[0][(a>>1&7)+8]}; -g.qc=function(a,b){b=(b>>1&7)+8;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.gc=function(a){return this.a.C[3][a>>1&7]};g.Pc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.ec=function(a){return this.a.C[3][(a>>1&7)+8]};g.Nc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.fc=function(a){return this.a.P[3][a>>1&7]};g.Oc=function(a,b){b=b>>1&7;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.dc=function(a){return this.a.P[3][(a>>1&7)+8]};g.Mc=function(a,b){b=(b>>1&7)+8;this.a.P[3][b]=a;this.a.C[3][b]&=65295}; -g.ua=function(a){a&=7;return this.a.u&2048?this.a.sa[a]:this.a.f[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.sa[b]=a:this.a.f[b]=a};g.Sb=function(){return this.a.u&49152?this.a.X[0]:this.a.f[6]};g.Ac=function(a){this.a.u&49152?this.a.X[0]=a:this.a.f[6]=a};g.Vb=function(){return this.a.f[7]};g.Dc=function(a){this.a.f[7]=a};g.va=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.sa[a]};g.xa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.sa[b]=a}; -g.Tb=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.X[1]};g.Bc=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.X[1]=a};g.Ub=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.X[3]};g.Cc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.X[3]=a};g.Fb=function(a){return this.a.pb[a-65504>>1]};g.pc=function(a,b){this.a.pb[b-65504>>1]=a};g.nb=function(a){return 65520==a?61183:0};g.ub=function(){};g.cc=function(){return 1};g.Lc=function(){};g.Eb=function(){return this.a.F}; -g.oc=function(){this.a.F=0};g.Lb=function(){return this.a.ob};g.vc=function(a,b){b&1||(a&=255);this.a.ob=a};g.Qb=function(a){return a?this.a.$a:0};g.yc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.$a=a;b.j|=2};g.bc=function(a){return a?this.a.oa&65280:0};g.Kc=function(a){this.a.oa=a|255};g.Rb=function(){return Na(this.a)};g.zc=function(a){pb(this.a,a&-1809|Na(this.a)&1808);this.a.j|=128};g.tb=function(){};g.reset=function(){this.c.Oa=this.c.Oa&-120|20;this.b.la=0}; -var K={},J=(K[62592]=[null,null,I.prototype.ac,I.prototype.Jc,"SISDR"],K[62608]=[null,null,I.prototype.Zb,I.prototype.Hc,"SDSDR"],K[62624]=[null,null,I.prototype.$b,I.prototype.Ic,"SISAR"],K[62640]=[null,null,I.prototype.Yb,I.prototype.Gc,"SDSAR"],K[62656]=[null,null,I.prototype.Jb,I.prototype.tc,"KISDR"],K[62672]=[null,null,I.prototype.Hb,I.prototype.rc,"KDSDR"],K[62688]=[null,null,I.prototype.Ib,I.prototype.sc,"KISAR"],K[62704]=[null,null,I.prototype.Gb,I.prototype.qc,"KDSAR"],K[62798]=[null,null, -I.prototype.Pb,I.prototype.xc,"MMR3"],K[65382]=[null,null,I.prototype.Kb,I.prototype.uc,"LKS"],K[65402]=[null,null,I.prototype.Mb,I.prototype.wc,"MMR0"],K[65404]=[null,null,I.prototype.Nb,I.prototype.tb,"MMR1"],K[65406]=[null,null,I.prototype.Ob,I.prototype.tb,"MMR2"],K[65408]=[null,null,I.prototype.gc,I.prototype.Pc,"UISDR"],K[65424]=[null,null,I.prototype.ec,I.prototype.Nc,"UDSDR"],K[65440]=[null,null,I.prototype.fc,I.prototype.Oc,"UISAR"],K[65456]=[null,null,I.prototype.dc,I.prototype.Mc,"UDSAR"], -K[65472]=[null,null,I.prototype.ua,I.prototype.wa,"R0SET0"],K[65473]=[null,null,I.prototype.ua,I.prototype.wa,"R1SET0"],K[65474]=[null,null,I.prototype.ua,I.prototype.wa,"R2SET0"],K[65475]=[null,null,I.prototype.ua,I.prototype.wa,"R3SET0"],K[65476]=[null,null,I.prototype.ua,I.prototype.wa,"R4SET0"],K[65477]=[null,null,I.prototype.ua,I.prototype.wa,"R5SET0"],K[65478]=[null,null,I.prototype.Sb,I.prototype.Ac,"R6KERNEL"],K[65479]=[null,null,I.prototype.Vb,I.prototype.Dc,"R7KERNEL"],K[65480]=[null,null, -I.prototype.va,I.prototype.xa,"R0SET1"],K[65481]=[null,null,I.prototype.va,I.prototype.xa,"R1SET1"],K[65482]=[null,null,I.prototype.va,I.prototype.xa,"R2SET1"],K[65483]=[null,null,I.prototype.va,I.prototype.xa,"R3SET1"],K[65484]=[null,null,I.prototype.va,I.prototype.xa,"R4SET1"],K[65485]=[null,null,I.prototype.va,I.prototype.xa,"R5SET1"],K[65486]=[null,null,I.prototype.Tb,I.prototype.Bc,"R6SUPER"],K[65487]=[null,null,I.prototype.Ub,I.prototype.Cc,"R6USER"],K[65504]=[null,null,I.prototype.Fb,I.prototype.pc, -"CTRL",1170],K[65520]=[null,null,I.prototype.nb,I.prototype.ub,"LSIZE",1170],K[65522]=[null,null,I.prototype.nb,I.prototype.ub,"HSIZE",1170],K[65524]=[null,null,I.prototype.cc,I.prototype.Lc,"SYSID",1170],K[65526]=[null,null,I.prototype.Eb,I.prototype.oc,"CPUERR",1170],K[65528]=[null,null,I.prototype.Lb,I.prototype.vc,"MB",1170],K[65530]=[null,null,I.prototype.Qb,I.prototype.yc,"PIR"],K[65532]=[null,null,I.prototype.bc,I.prototype.Kc,"SL"],K[65534]=[null,null,I.prototype.Rb,I.prototype.zc,"PSW"], -K);J[62594]=J[62592];J[62596]=J[62592];J[62598]=J[62592];J[62600]=J[62592];J[62602]=J[62592];J[62604]=J[62592];J[62606]=J[62592];J[62610]=J[62608];J[62612]=J[62608];J[62614]=J[62608];J[62616]=J[62608];J[62618]=J[62608];J[62620]=J[62608];J[62622]=J[62608];J[62626]=J[62624];J[62628]=J[62624];J[62630]=J[62624];J[62632]=J[62624];J[62634]=J[62624];J[62636]=J[62624];J[62638]=J[62624];J[62642]=J[62640];J[62644]=J[62640];J[62646]=J[62640];J[62648]=J[62640];J[62650]=J[62640];J[62652]=J[62640];J[62654]=J[62640]; -J[62658]=J[62656];J[62660]=J[62656];J[62662]=J[62656];J[62664]=J[62656];J[62666]=J[62656];J[62668]=J[62656];J[62670]=J[62656];J[62674]=J[62672];J[62676]=J[62672];J[62678]=J[62672];J[62680]=J[62672];J[62682]=J[62672];J[62684]=J[62672];J[62686]=J[62672];J[62690]=J[62688];J[62692]=J[62688];J[62694]=J[62688];J[62696]=J[62688];J[62698]=J[62688];J[62700]=J[62688];J[62702]=J[62688];J[62706]=J[62704];J[62708]=J[62704];J[62710]=J[62704];J[62712]=J[62704];J[62714]=J[62704];J[62716]=J[62704];J[62718]=J[62704]; -J[65410]=J[65408];J[65412]=J[65408];J[65414]=J[65408];J[65416]=J[65408];J[65418]=J[65408];J[65420]=J[65408];J[65422]=J[65408];J[65426]=J[65424];J[65428]=J[65424];J[65430]=J[65424];J[65432]=J[65424];J[65434]=J[65424];J[65436]=J[65424];J[65438]=J[65424];J[65442]=J[65440];J[65444]=J[65440];J[65446]=J[65440];J[65448]=J[65440];J[65450]=J[65440];J[65452]=J[65440];J[65454]=J[65440];J[65458]=J[65456];J[65460]=J[65456];J[65462]=J[65456];J[65464]=J[65456];J[65466]=J[65456];J[65468]=J[65456];J[65470]=J[65456]; -J[65506]=J[65504];J[65508]=J[65504];J[65510]=J[65504];J[65512]=J[65504];J[65514]=J[65504];J[65516]=J[65504];J[65518]=J[65504];u(function(){for(var a=C(document,"pdp11","device"),b=0;ba.a.jb)){var k=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,q=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&q&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(q)));fb(a,e,e,k,l,n,q,f[4])}}}function hb(a,b){a.o.push(b)}function ib(a,b){a.R||H(a.a,4,b)} +function $a(a,b,c){p("Memory block error ("+a+": "+h(b)+","+h(c)+")");return!1}function I(a){v.call(this,"Device",a,I);this.c={data:0,Xc:0,Oa:20,nc:0};this.b={$c:0,bb:-1}}x(I);g=I.prototype;g.ka=function(a,b,c,d){this.l=b;this.a=c;this.H=d;var e=this;this.b.bb=jb(c,function(){e.b.la|=128;e.b.la&64&&(kb(e.a,e.b.oc),lb(e.a,e.b.bb,1E3/60))});this.b.oc=mb(64,6);gb(b,this,J);hb(b,this.reset.bind(this));D(this)};g.Lb=function(){var a=this.b.la;this.b.la&=-129;return a}; +g.xc=function(a){this.b.la=a;a&64&&lb(this.a,this.b.bb,1E3/60);this.b.la=a&-129};g.Eb=function(a){return(a?this.c.nc:this.c.data)&65535};g.qc=function(a){this.c.data=a};g.Nb=function(){var a=this.a;return a.A&62337|a.Fa<<5|a.Ga<<1};g.zc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Fa=a>>5&3;b.Ga=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,nb(b))}ob(this)};g.Ob=function(){var a=this.a.ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Pb=function(){return this.a.Za};g.Qb=function(){return this.a.na}; +g.Ac=function(a){var b=this.a;1170>b.jb&&(a&=-49);b.na!=a&&(b.na=a,a&16?(b.Va=4194303,b.Ha=3915776):(b.Va=262143,b.Ha=253952),nb(b));ob(this)};function ob(a){a.c.Oa=a.c.Oa&-8|(a.a.Ba?a.a.na&16?1:2:4)}g.bc=function(a){return this.a.C[1][a>>1&7]};g.Mc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.$b=function(a){return this.a.C[1][(a>>1&7)+8]};g.Kc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.ac=function(a){return this.a.P[1][a>>1&7]};g.Lc=function(a,b){b=b>>1&7;this.a.P[1][b]=a;this.a.C[1][b]&=65295}; +g.Zb=function(a){return this.a.P[1][(a>>1&7)+8]};g.Jc=function(a,b){b=(b>>1&7)+8;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.Kb=function(a){return this.a.C[0][a>>1&7]};g.wc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Ib=function(a){return this.a.C[0][(a>>1&7)+8]};g.uc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};g.Jb=function(a){return this.a.P[0][a>>1&7]};g.vc=function(a,b){b=b>>1&7;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.Hb=function(a){return this.a.P[0][(a>>1&7)+8]}; +g.tc=function(a,b){b=(b>>1&7)+8;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.hc=function(a){return this.a.C[3][a>>1&7]};g.Sc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.fc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Qc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.gc=function(a){return this.a.P[3][a>>1&7]};g.Rc=function(a,b){b=b>>1&7;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.ec=function(a){return this.a.P[3][(a>>1&7)+8]};g.Pc=function(a,b){b=(b>>1&7)+8;this.a.P[3][b]=a;this.a.C[3][b]&=65295}; +g.ua=function(a){a&=7;return this.a.u&2048?this.a.sa[a]:this.a.f[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.sa[b]=a:this.a.f[b]=a};g.Tb=function(){return this.a.u&49152?this.a.X[0]:this.a.f[6]};g.Dc=function(a){this.a.u&49152?this.a.X[0]=a:this.a.f[6]=a};g.Wb=function(){return this.a.f[7]};g.Gc=function(a){this.a.f[7]=a};g.va=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.sa[a]};g.xa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.sa[b]=a}; +g.Ub=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.X[1]};g.Ec=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.X[1]=a};g.Vb=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.X[3]};g.Fc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.X[3]=a};g.Gb=function(a){return this.a.pb[a-65504>>1]};g.sc=function(a,b){this.a.pb[b-65504>>1]=a};g.nb=function(a){return 65520==a?61183:0};g.ub=function(){};g.dc=function(){return 1};g.Oc=function(){};g.Fb=function(){return this.a.F}; +g.rc=function(){this.a.F=0};g.Mb=function(){return this.a.ob};g.yc=function(a,b){b&1||(a&=255);this.a.ob=a};g.Rb=function(a){return a?this.a.$a:0};g.Bc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.$a=a;b.j|=2};g.cc=function(a){return a?this.a.oa&65280:0};g.Nc=function(a){this.a.oa=a|255};g.Sb=function(){return Na(this.a)};g.Cc=function(a){pb(this.a,a&-1809|Na(this.a)&1808);this.a.j|=128};g.tb=function(){};g.reset=function(){this.c.Oa=this.c.Oa&-120|20;this.b.la=0}; +var K={},J=(K[62592]=[null,null,I.prototype.bc,I.prototype.Mc,"SISDR"],K[62608]=[null,null,I.prototype.$b,I.prototype.Kc,"SDSDR"],K[62624]=[null,null,I.prototype.ac,I.prototype.Lc,"SISAR"],K[62640]=[null,null,I.prototype.Zb,I.prototype.Jc,"SDSAR"],K[62656]=[null,null,I.prototype.Kb,I.prototype.wc,"KISDR"],K[62672]=[null,null,I.prototype.Ib,I.prototype.uc,"KDSDR"],K[62688]=[null,null,I.prototype.Jb,I.prototype.vc,"KISAR"],K[62704]=[null,null,I.prototype.Hb,I.prototype.tc,"KDSAR"],K[62798]=[null,null, +I.prototype.Qb,I.prototype.Ac,"MMR3"],K[65382]=[null,null,I.prototype.Lb,I.prototype.xc,"LKS"],K[65400]=[null,null,I.prototype.Eb,I.prototype.qc,"CNSL"],K[65402]=[null,null,I.prototype.Nb,I.prototype.zc,"MMR0"],K[65404]=[null,null,I.prototype.Ob,I.prototype.tb,"MMR1"],K[65406]=[null,null,I.prototype.Pb,I.prototype.tb,"MMR2"],K[65408]=[null,null,I.prototype.hc,I.prototype.Sc,"UISDR"],K[65424]=[null,null,I.prototype.fc,I.prototype.Qc,"UDSDR"],K[65440]=[null,null,I.prototype.gc,I.prototype.Rc,"UISAR"], +K[65456]=[null,null,I.prototype.ec,I.prototype.Pc,"UDSAR"],K[65472]=[null,null,I.prototype.ua,I.prototype.wa,"R0SET0"],K[65473]=[null,null,I.prototype.ua,I.prototype.wa,"R1SET0"],K[65474]=[null,null,I.prototype.ua,I.prototype.wa,"R2SET0"],K[65475]=[null,null,I.prototype.ua,I.prototype.wa,"R3SET0"],K[65476]=[null,null,I.prototype.ua,I.prototype.wa,"R4SET0"],K[65477]=[null,null,I.prototype.ua,I.prototype.wa,"R5SET0"],K[65478]=[null,null,I.prototype.Tb,I.prototype.Dc,"R6KERNEL"],K[65479]=[null,null, +I.prototype.Wb,I.prototype.Gc,"R7KERNEL"],K[65480]=[null,null,I.prototype.va,I.prototype.xa,"R0SET1"],K[65481]=[null,null,I.prototype.va,I.prototype.xa,"R1SET1"],K[65482]=[null,null,I.prototype.va,I.prototype.xa,"R2SET1"],K[65483]=[null,null,I.prototype.va,I.prototype.xa,"R3SET1"],K[65484]=[null,null,I.prototype.va,I.prototype.xa,"R4SET1"],K[65485]=[null,null,I.prototype.va,I.prototype.xa,"R5SET1"],K[65486]=[null,null,I.prototype.Ub,I.prototype.Ec,"R6SUPER"],K[65487]=[null,null,I.prototype.Vb,I.prototype.Fc, +"R6USER"],K[65504]=[null,null,I.prototype.Gb,I.prototype.sc,"CTRL",1170],K[65520]=[null,null,I.prototype.nb,I.prototype.ub,"LSIZE",1170],K[65522]=[null,null,I.prototype.nb,I.prototype.ub,"HSIZE",1170],K[65524]=[null,null,I.prototype.dc,I.prototype.Oc,"SYSID",1170],K[65526]=[null,null,I.prototype.Fb,I.prototype.rc,"CPUERR",1170],K[65528]=[null,null,I.prototype.Mb,I.prototype.yc,"MB",1170],K[65530]=[null,null,I.prototype.Rb,I.prototype.Bc,"PIR"],K[65532]=[null,null,I.prototype.cc,I.prototype.Nc,"SL"], +K[65534]=[null,null,I.prototype.Sb,I.prototype.Cc,"PSW"],K);J[62594]=J[62592];J[62596]=J[62592];J[62598]=J[62592];J[62600]=J[62592];J[62602]=J[62592];J[62604]=J[62592];J[62606]=J[62592];J[62610]=J[62608];J[62612]=J[62608];J[62614]=J[62608];J[62616]=J[62608];J[62618]=J[62608];J[62620]=J[62608];J[62622]=J[62608];J[62626]=J[62624];J[62628]=J[62624];J[62630]=J[62624];J[62632]=J[62624];J[62634]=J[62624];J[62636]=J[62624];J[62638]=J[62624];J[62642]=J[62640];J[62644]=J[62640];J[62646]=J[62640]; +J[62648]=J[62640];J[62650]=J[62640];J[62652]=J[62640];J[62654]=J[62640];J[62658]=J[62656];J[62660]=J[62656];J[62662]=J[62656];J[62664]=J[62656];J[62666]=J[62656];J[62668]=J[62656];J[62670]=J[62656];J[62674]=J[62672];J[62676]=J[62672];J[62678]=J[62672];J[62680]=J[62672];J[62682]=J[62672];J[62684]=J[62672];J[62686]=J[62672];J[62690]=J[62688];J[62692]=J[62688];J[62694]=J[62688];J[62696]=J[62688];J[62698]=J[62688];J[62700]=J[62688];J[62702]=J[62688];J[62706]=J[62704];J[62708]=J[62704];J[62710]=J[62704]; +J[62712]=J[62704];J[62714]=J[62704];J[62716]=J[62704];J[62718]=J[62704];J[65410]=J[65408];J[65412]=J[65408];J[65414]=J[65408];J[65416]=J[65408];J[65418]=J[65408];J[65420]=J[65408];J[65422]=J[65408];J[65426]=J[65424];J[65428]=J[65424];J[65430]=J[65424];J[65432]=J[65424];J[65434]=J[65424];J[65436]=J[65424];J[65438]=J[65424];J[65442]=J[65440];J[65444]=J[65440];J[65446]=J[65440];J[65448]=J[65440];J[65450]=J[65440];J[65452]=J[65440];J[65454]=J[65440];J[65458]=J[65456];J[65460]=J[65456];J[65462]=J[65456]; +J[65464]=J[65456];J[65466]=J[65456];J[65468]=J[65456];J[65470]=J[65456];J[65506]=J[65504];J[65508]=J[65504];J[65510]=J[65504];J[65512]=J[65504];J[65514]=J[65504];J[65516]=J[65504];J[65518]=J[65504];u(function(){for(var a=C(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,d>>2),wb(this,sb?xb:yb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255 R:function(a,b){return this.V(a,b)},$:function(a,b,c){this.v||this.sb(a,b,c)},ga:function(a,b,c){this.v||this.pa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},N:function(a,b){a&1&&ib(this.l,b);return this.g.getUint16(a,!0)},W:function(a,b){a&1&&ib(this.l,b);return this.o[a>>1]},Z:function(a,b){this.c[a]=b;this.ia=!0},da:function(a,b){this.c[a]=b;this.ia=!0},fa:function(a,b,c){a&1&&ib(this.l,c);this.g.setUint16(a,b,!0);this.ia=!0},qa:function(a,b,c){a&1&&ib(this.l,c);this.o[a>> 1]=b;this.ia=!0}};function Ta(a,b,c){a.H=b;a.i=a.m=0;c&&((a.i=c.i)&&Ab(a,Bb,!1),(a.m=c.m)&&Cb(a,Bb,!1))}function Cb(a,b,c){c&&a.m||(a.cb=!a.v&&b[1]||a.A,a.Qa=!a.v&&b[3]||a.B);if(c||void 0===c)a.sb=b[1]||a.A,a.pa=b[3]||a.B}function Ab(a,b,c){c&&a.i||(a.Xa=b[0]||a.w,a.S=b[2]||a.s);if(c||void 0===c)a.I=b[0]||a.w,a.V=b[2]||a.s}function wb(a,b){b||(b=Db);Ab(a,b,void 0);Cb(a,b,void 0)} var Db=[],zb=[G.prototype.M,G.prototype.ea,G.prototype.Y,G.prototype.ra],Bb=[G.prototype.G,G.prototype.$,G.prototype.R,G.prototype.ga];if(Ja)var yb=[G.prototype.D,G.prototype.Z,G.prototype.N,G.prototype.fa],xb=[G.prototype.J,G.prototype.da,G.prototype.W,G.prototype.qa]; -function Eb(a,b){v.call(this,"CPU",a,Eb);var c=a.multiplier||1;this.Ka=a.cycles||b;this.$=c;this.Ua=Math.round(this.Ka/1E4)/100;this.da=this.Ua*this.$;this.h.T=!1;this.h.qb=!1;this.h.Aa=a.autoStart;this.h.Ma=!1;this.Da=this.fa=0;this.Ja=a.csStart;this.pa=a.csInterval;this.qa=a.csStop;this.G=[];this.mb=this.lc.bind(this);D(this)}x(Eb);var Fb=["power","reset"];g=Eb.prototype; +function Eb(a,b){v.call(this,"CPU",a,Eb);var c=a.multiplier||1;this.Ka=a.cycles||b;this.$=c;this.Ua=Math.round(this.Ka/1E4)/100;this.da=this.Ua*this.$;this.h.T=!1;this.h.qb=!1;this.h.Aa=a.autoStart;this.h.Ma=!1;this.Da=this.fa=0;this.Ja=a.csStart;this.pa=a.csInterval;this.qa=a.csStop;this.G=[];this.mb=this.mc.bind(this);D(this)}x(Eb);var Fb=["power","reset"];g=Eb.prototype; g.ka=function(a,b,c,d){this.w=a;this.l=b;this.H=d;for(b=0;ba.Y/a.da&&(b=1),a.$=b,b=a.Ua*a.$,a.da!=b)){a.da=b;b=a.da.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.O("target speed: "+b)}a.J+=a.V;a.V=0;a.N=ka();a.Z=0;Lb(a)}function jb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function lb(a,b,c){0<=b&&ba.G[b][0]&&(c*=a.Ka*a.$/1E3,a.G[b][0]=c+Nb(a))}function Nb(a,b){var c=a.ea-=a.a;a.a=0;b&&(a.ea=0);return c} -g.lc=function(){if(this.h.T){this.Wa>=this.Ka&&Lb(this,!0);this.ya=0;this.Ia=ka();if(this.Z){var a=this.Ia-this.Z;a>this.kb&&(this.N+=a,this.N>this.Ia&&(this.N=this.Ia))}try{do{for(var b,c=this.h.Ma?1:this.La,d=this.G.length-1;0<=d;d--){var e=this.G[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.rb(b)}catch(n){if("number"!=typeof n)throw n;}b=Nb(this,!0);this.ya+=b;this.V+=b;a=b;if(this.h.Ma){var f=!1;this.Da=this.Da+this.gb()|0;this.fa-=a;0>=this.fa&&(this.fa+=this.pa,f=!0);0<=this.qa&&this.qa<=Mb(this)&& -(this.pa=this.qa=-1,Ib(this),F(this),f=!0);f&&this.O(Mb(this)+" cycles: checksum="+k(this.Da))}for(var a=b,h=this.G.length-1;0<=h;h--){var l=this.G[h];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ra-=b;if(0>=this.ra){this.ra+=this.La;15<=++this.lb&&(this.w&&this.w.ca(),this.lb=0);break}}while(this.h.T)}catch(n){F(this);this.w&&this.w.stop(ka(),Mb(this));b=n.stack||n.message;this.h.error=!0;this.K(b);return}if(this.h.T){b=setTimeout;c=this.mb;this.Z=ka();d=this.kb;this.ya&&(d=Math.round(d*this.ya/ +g.mc=function(){if(this.h.T){this.Wa>=this.Ka&&Lb(this,!0);this.ya=0;this.Ia=ka();if(this.Z){var a=this.Ia-this.Z;a>this.kb&&(this.N+=a,this.N>this.Ia&&(this.N=this.Ia))}try{do{for(var b,c=this.h.Ma?1:this.La,d=this.G.length-1;0<=d;d--){var e=this.G[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.rb(b)}catch(n){if("number"!=typeof n)throw n;}b=Nb(this,!0);this.ya+=b;this.V+=b;a=b;if(this.h.Ma){var f=!1;this.Da=this.Da+this.gb()|0;this.fa-=a;0>=this.fa&&(this.fa+=this.pa,f=!0);0<=this.qa&&this.qa<=Mb(this)&& +(this.pa=this.qa=-1,Ib(this),F(this),f=!0);f&&this.O(Mb(this)+" cycles: checksum="+h(this.Da))}for(var a=b,k=this.G.length-1;0<=k;k--){var l=this.G[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ra-=b;if(0>=this.ra){this.ra+=this.La;15<=++this.lb&&(this.w&&this.w.ca(),this.lb=0);break}}while(this.h.T)}catch(n){F(this);this.w&&this.w.stop(ka(),Mb(this));b=n.stack||n.message;this.h.error=!0;this.K(b);return}if(this.h.T){b=setTimeout;c=this.mb;this.Z=ka();d=this.kb;this.ya&&(d=Math.round(d*this.ya/ this.La));d-=this.Z-this.Ia;if(e=this.Z-this.N)this.Y=Math.round(this.V/(10*e))/100,864E5<=e&&(this.J=0,Kb(this));if(0>d||this.Yd&&(this.N-=d),d=0;this.Wa+=this.ya;this.Z+=d;b(c,d)}}};function Jb(a){var b;a.h.error?(a.O(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.T)a.O(a.toString()+" busy");else{Kb(a);a.h.T=!0;a.h.qb=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.N,Mb(a));setTimeout(a.mb,0)}}g.rb=function(){return 0}; function F(a){if(a.h.T){Nb(a);a.J+=a.V;a.V=0;a.h.T=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(ka(),Mb(a))}a.h.complete=void 0}function Ob(a){this.jb=+a.model||1170;this.Cb=a.resetAddr||0;Eb.call(this,a,6666667);this.decode=Pb.bind(this);Qb(this);this.R=0;this.W=null;this.h.complete=this.h.wb=!1}x(Ob,Eb);g=Ob.prototype;g.reset=function(){this.h.T&&F(this);Qb(this);Hb(this);this.h.error=!1;this.parent.reset.call(this)}; function Qb(a){a.m=65536;a.g=32768;a.i=65535;a.o=32768;a.u=15;a.f=[0,0,0,0,0,0,0,a.Cb];a.sa=[0,0,0,0,0,0];a.X=[0,0,0,0];a.s=0;a.Ga=0;a.Ab=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,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.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Db=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.pb=[0,0,0,0,0,0,0,0];a.ob=0;a.j=0;a.B=a.D=0;a.c=a.b=a.Sa=0;a.ga=-1;Rb(a)}function Rb(a){a.oa=255;a.F=0;a.$a=0;a.A=0;a.ma=0;a.Za=0;a.na=0;a.Ba=0;a.Fa=0;a.Va=262143;a.Ha=253952;a.j|=2;a.l&&nb(a)}function nb(a){a.Ba?(a.M=65536,a.I=a.zb,a.S=a.ic,a.Qa=a.Rc,Va(a.l,a.na&16?22:18)):(a.M=0,a.I=a.yb,a.S=a.hc,a.Qa=a.Qc,Va(a.l,16))}g.gb=function(){return 0}; -g.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.J,this.$]);a.set(2,eb(this.l));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Kb(this,b[3]);a:{b=this.l;a=a[2];var c;for(c=0;c>14&3;c=a.u>>14&3;a.s!=c&&(a.X[c]=a.f[6],a.f[6]=a.X[a.s]);a.u=b;a.j|=2}function N(a,b){a.j&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.j&128||(a.o=a.i=a.m=b,a.g=c||0)}function Tb(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^b)&(d^b))}function P(a,b){a.j&128||(a.o=a.i=a.m=b,a.g=a.o^a.m>>1)}function Ub(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^d)&(d^b))} function H(a,b,c){if(!a.R){var d=!1;0>a.ga?a.ga=Na(a):a.s||(b=4,d=!0);a.A&57344||(a.ma=63222,a.Za=b);a.s=0;var e=a.S(b|a.M),f=a.S(b+2&65535|a.M);pb(a,f&-12289|a.ga>>2&12288);d&&(a.F|=4,a.f[6]=4);Vb(a,a.ga);Vb(a,a.f[7]);a.f[7]=e&65535;a.j&=-113;a.ga=-1;if(26!=c)throw b;}}function Wb(a){var b=Xb(a),c=Xb(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);a.f[7]=b&65535;pb(a,c);a.j&=-17} -function Yb(a,b,c){var d,e,f,h=0;d=b>>13;a.na&a.Ab[a.s]||(d&=7);e=a.C[a.s][d];f=(a.P[a.s][d]<<6)+(b&8191)&a.Va;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.na&32&&(f=a.Db[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ha&&4186112>f&&(a.F|=32,H(a,4,12))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192: -128;break;default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Fa=a.s,a.Ga=d;h&&(h&57344&&(0<=a.ga&&(h|=128),a.A&57344||(a.A=a.A|h|a.Fa<<5|a.Ga<<1),H(a,168,16)),a.A&61440||!(4191360>f||4194239>>a.c].cb(b&a.g,c&255,b)}function Xb(a){var b=a.S(a.f[6]|a.M);a.f[6]=a.f[6]+2&65535;return b} +function Yb(a,b,c){var d,e,f,k=0;d=b>>13;a.na&a.Ab[a.s]||(d&=7);e=a.C[a.s][d];f=(a.P[a.s][d]<<6)+(b&8191)&a.Va;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.na&32&&(f=a.Db[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ha&&4186112>f&&(a.F|=32,H(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192: +128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Fa=a.s,a.Ga=d;k&&(k&57344&&(0<=a.ga&&(k|=128),a.A&57344||(a.A=a.A|k|a.Fa<<5|a.Ga<<1),H(a,168,16)),a.A&61440||!(4191360>f||4194239>>a.c].cb(b&a.g,c&255,b)}function Xb(a){var b=a.S(a.f[6]|a.M);a.f[6]=a.f[6]+2&65535;return b} function Vb(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.ma=a.ma<<8|246);!a.s&&c<=a.oa&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.S(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.S(e)|h;a.a-= -8;break;case 6:return e=Sb(a),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=Sb(a),e=e+a.f[c]&65535,e=a.S(e|a.M)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.A&57344||(a.ma=a.ma<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32?(a.F|=4,a.f[6]=4,H(a,4,24)):(a.F|=8,a.j|=64));return e}g.ab=function(a,b){this.Ba?(this.R++,Zb(this,Yb(this,a,5),b),this.R--):this.l.ab(a,b)};g.yb=function(a,b,c){return $b(this,a,b,c)};g.zb=function(a,b,c){return Yb(this,$b(this,a,b,c),c)}; -g.hc=function(a){return cb(this.l,a)};g.ic=function(a){return cb(this.l,Yb(this,a,2))};g.Qc=function(a,b){db(this.l,a,b&65535)};g.Rc=function(a,b){db(this.l,Yb(this,a,4),b)};function ac(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=$b(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.S(d|c&a.M),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.X[a.u>>12&3];return c} +function $b(a,b,c,d){var e,f,k=d&8?0:a.M;switch(b){case 0:return H(a,4,20),0;case 1:return 6===c&&!a.s&&d&4&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32||65534<=a.f[6]?(a.F|=4,a.f[6]=4,H(a,4,22)):(a.F|=8,a.j|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|k;case 2:f=2;e=a.f[c];7!==c&&(e|=k,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.S(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.S(e)|k;a.a-= +8;break;case 6:return e=Sb(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=Sb(a),e=e+a.f[c]&65535,e=a.S(e|a.M)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.ma=a.ma<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32?(a.F|=4,a.f[6]=4,H(a,4,24)):(a.F|=8,a.j|=64));return e}g.ab=function(a,b){this.Ba?(this.R++,Zb(this,Yb(this,a,5),b),this.R--):this.l.ab(a,b)};g.yb=function(a,b,c){return $b(this,a,b,c)};g.zb=function(a,b,c){return Yb(this,$b(this,a,b,c),c)}; +g.ic=function(a){return cb(this.l,a)};g.jc=function(a){return cb(this.l,Yb(this,a,2))};g.Tc=function(a,b){db(this.l,a,b&65535)};g.Uc=function(a,b){db(this.l,Yb(this,a,4),b)};function ac(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=$b(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.S(d|c&a.M),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.X[a.u>>12&3];return c} function bc(a,b,c,d){a.A&57344||(a.ma=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=$b(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=Yb(a,e|c&65536,4),a.s=a.u>>14&3,db(a.l,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.X[a.u>>12&3]=d}function cc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=bb(a.l,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?cb(a.l,a.I(b,c,2)):a.f[c]}function dc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return $b(a,b,c,8)} function ec(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=bb(a.l,c)):a=a.f[c]&255;return a}function R(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?cb(a.l,a.I(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Sa=a.I(b,e,7),Zb(a,e,d.call(a,c,bb(a.l,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),db(a.l,e,d.call(a,c,cb(a.l,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)?Zb(a,a.I(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)?db(a.l,a.I(b,d,4),c):a.f[d]=c&65535;return c}function U(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} -g.rb=function(a){this.h.complete=!0;this.h.wb=!1;this.h.qb=!1;this.ea=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?H(this,168,28):this.j&64?H(this,4,30):this.j&16&&H(this,12,32),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;var b=160,c=(this.$a&224)>>5;if(a=this.W&&this.W.ta>c?this.W:null)b=a.nc,c=a.ta;c>(this.u&224)>>5?(this.j&4&&(this.f[7]=this.f[7]+2&65535,this.j&=-5),H(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.W,c==a)this.W=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.j& +g.rb=function(a){this.h.complete=!0;this.h.wb=!1;this.h.qb=!1;this.ea=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?H(this,168,28):this.j&64?H(this,4,30):this.j&16&&H(this,12,32),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;var b=160,c=(this.$a&224)>>5;if(a=this.W&&this.W.ta>c?this.W:null)b=a.pc,c=a.ta;c>(this.u&224)>>5?(this.j&4&&(this.f[7]=this.f[7]+2&65535,this.j&=-5),H(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.W,c==a)this.W=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.j& 1&&this.j++;this.A&57344||(this.ma=0,this.Za=this.f[7]);this.j=this.j&7|this.u&16;this.decode(Sb(this))}while(0>1|b<<16;P(this,a);return a&65535}function mc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function nc(a,b){a=b&~a;N(this,a);return a}function oc(a,b){a=b&~a;N(this,a<<8);return a}function pc(a,b){a|=b;N(this,a);return a}function qc(a,b){a|=b;N(this,a<<8);return a}function rc(a,b){a=~b|65536;O(this,a);return a&65535}function sc(a,b){a=~b|256;O(this,a<<8);return a&255} function tc(a,b){a=b-a;this.j&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function uc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function vc(a,b){a=b+a;this.j&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function wc(a,b){a=b+a;var c=a<<8;this.j&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function xc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function yc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255} @@ -786,46 +786,46 @@ this.g&32768?2:0)},function(a){U(this,a,!M(this))},function(a){U(this,a,M(this)) a,0,mc);this.a-=this.c?9+(this.Sa&1):3+(7==this.b?2:0)},function(a){S(this,a,0,kc);this.a-=this.c?9:3+(7==this.b?2:0)}],kd=[X,function(a){a=ac(this,a,65536);Vb(this,a);N(this,a);this.a-=11},function(a){var b=Xb(this),c=this.a;bc(this,a,65536,b);N(this,b);this.a=c-Qc[this.c]},X]; function ld(a){v.call(this,"ROM",a,ld);this.b=null;this.o=a.addr;this.c=a.size;this.w=a.writable;this.g=a.alias;this.i=a.file;this.s=ba(this.i);if(this.i){a=this.i;var b=ca(this.s);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;m(a,null,!0,function(a,b,f){md(c,a,b,f)})}}x(ld);ld.prototype.ka=function(a,b,c,d){this.l=b;this.a=c;this.H=d;nd(this)};ld.prototype.ba=function(){this.m&&(this.H&&this.H.a(this.id,this.o,this.c,this.m),delete this.m);return!0}; ld.prototype.aa=function(){return!0}; -function md(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Ta,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,h,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),h=e=0;e>8&255;else if(f=l.data)for(a.b=Array(4*f.length),h=e=0;e>8&255,a.b[h++]=f[e]>>16&255,a.b[h++]=f[e]>>24&255;else a.b=l;a.m=l.symbols;if(!a.b.length){p("Empty ROM: "+b); +function md(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Ta,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,k,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),k=e=0;e>8&255;else if(f=l.data)for(a.b=Array(4*f.length),k=e=0;e>8&255,a.b[k++]=f[e]>>16&255,a.b[k++]=f[e]>>24&255;else a.b=l;a.m=l.symbols;if(!a.b.length){p("Empty ROM: "+b); return}if(1==a.b.length){p(a.b[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.Ea)return;b=ha(b[1]);if(this.s=Ha(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Ta+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.ba=function(a,b){if(!b)if(this.ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -g.aa=function(a){return a?this.save():!0};g.reset=function(){rd(this)};g.save=function(){var a=new L(this);a.set(0,[]);return a.data()};g.restore=function(){return rd(this)};function rd(a){a.D=0;a.b=0;a.c=128;a.i=[];return!0}g.Ya=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.G||8,c=a-this.o%a,this.G&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.O(this.m), -this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;lb(this.a,this.J,1)}};var sd={},qd=(sd[65392]=[null,null,Z.prototype.Xb,Z.prototype.Fc,"RCSR"],sd[65394]=[null,null,Z.prototype.Wb,Z.prototype.Ec,"RBUF"],sd[65396]=[null,null,Z.prototype.kc,Z.prototype.Tc,"XCSR"],sd[65398]=[null,null,Z.prototype.jc,Z.prototype.Sc,"XBUF"],sd);u(function(){for(var a=C(document,"pdp11","serial"),b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.G||8,c=a-this.o%a,this.G&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.O(this.m), +this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;lb(this.a,this.J,1)}};var sd={},qd=(sd[65392]=[null,null,Z.prototype.Yb,Z.prototype.Ic,"RCSR"],sd[65394]=[null,null,Z.prototype.Xb,Z.prototype.Hc,"RBUF"],sd[65396]=[null,null,Z.prototype.lc,Z.prototype.Wc,"XCSR"],sd[65398]=[null,null,Z.prototype.kc,Z.prototype.Vc,"XBUF"],sd);u(function(){for(var a=C(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.O("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bvd){if(xd(d,this.s)){this.m=new L(this,"1.30.1","failsafe");xd(this.m)&&(Cd(this,d),a=2,Dd(this.m));this.m.set("timestamp",la());Ed(this.m);var e=this.b&&!this.o;if(1==a||ma("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Bd(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?xd(d,h):("error"== -f&&"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(qa("user",""),this.c=null)):this.O(f+": "+h),Dd(d),xd(d)?(c=Bd(d),e=!0):c=!1))}e&&Ad(this,c?d:null)}else 2==a&&d.clear()}else Ad(this);delete this.s;delete this.A}e=y(this.id);for(f=0;fvd){if(xd(d,this.s)){this.m=new L(this,"1.30.1","failsafe");xd(this.m)&&(Cd(this,d),a=2,Dd(this.m));this.m.set("timestamp",la());Ed(this.m);var e=this.b&&!this.o;if(1==a||ma("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Bd(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?xd(d,k):("error"== +f&&"no machine state"!=k?(this.K("Error: "+k),"unable to verify user"==k&&(qa("user",""),this.c=null)):this.O(f+": "+k),Dd(d),xd(d)?(c=Bd(d),e=!0):c=!1))}e&&Ad(this,c?d:null)}else 2==a&&d.clear()}else Ad(this);delete this.s;delete this.A}e=y(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.h.L=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Fd(this,this.a,b,c,a),this.a.Aa());this.G&&(Cd(this,b),b.clear());!c&&this.m&&(this.m.clear(),delete this.m);this.g=0}; function Cd(a,b){if(ma("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.1"};d.url=a.N;d.user=c;d.type="bug";d.data=b;m("http://www.pcjs.org/api/v1/report",d,!0)}} -function Gd(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),h=new L(a,"1.30.1","validate"),l=la();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.aa&&(c&&F(a.a),d=a.a.aa(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=y(a.id),n=0;nf.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(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,h,l){if(l||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],q,t=/( [a-z]+=)(['"])(.*?)\2/g;q=t.exec(f);)n=0>n.indexOf(q[1])?n.replace(">",q[0]+">"):n.replace(new RegExp(q[1]+"(['\"])(.*?)\\1"),q[0]);l[0]!=n&&(h=h.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],h);Nd(a,b,c)}})}else c(a,null)} -function Od(a,b,c,d){function e(a){if(void 0===l){var b=h&&C(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=ga(a))}function f(a){e("Error: "+a);n&&(--Kd||xa(!0));n=!1}var h,l,n=!0;Kd++;Fa[a]={};try{if(h=document.getElementById(a)){var q;if("object"==typeof resources&&(q=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],ia=document.createElement("style");ia.type="text/css";ia.styleSheet?ia.styleSheet.cssText=q:ia.appendChild(document.createTextNode(q));t.appendChild(ia)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");q=function(d,l){l?Ld(c,null,null,!1,e,function(d,n){n?(Ga(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(h.outerHTML=n,--Kd||xa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(n,h),--Kd||xa(!0)):f("invalid machine element: "+ +function Ld(a,b,c,d,e,f){e("Loading "+a+"...");m(a,null,!0,function(k,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):Md(l,a,b,c,d,e,f)})} +function Md(a,b,c,d,e,f,k){function l(a,f){if(f)k(f,null);else{c&&(Ga(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\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(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],q,t=/( [a-z]+=)(['"])(.*?)\2/g;q=t.exec(f);)n=0>n.indexOf(q[1])?n.replace(">",q[0]+">"):n.replace(new RegExp(q[1]+"(['\"])(.*?)\\1"),q[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],k);Nd(a,b,c)}})}else c(a,null)} +function Od(a,b,c,d){function e(a){if(void 0===l){var b=k&&C(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=ga(a))}function f(a){e("Error: "+a);n&&(--Kd||xa(!0));n=!1}var k,l,n=!0;Kd++;Fa[a]={};try{if(k=document.getElementById(a)){var q;if("object"==typeof resources&&(q=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],ia=document.createElement("style");ia.type="text/css";ia.styleSheet?ia.styleSheet.cssText=q:ia.appendChild(document.createTextNode(q));t.appendChild(ia)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");q=function(d,l){l?Ld(c,null,null,!1,e,function(d,n){n?(Ga(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--Kd||xa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--Kd||xa(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ld(b,a,d,!0,e,q):Md(b,null,a,d,!1,e,q)}else f("missing machine element: "+a)}catch(Jc){f(Jc.message)}return n}window.embedPDP11=function(a,b,c,d){xa(!1);return Od(a,b,c,d)};window.enableEvents=xa;window.sendEvent=ya;})();