From 9148cec085d3ea1276c393892eb8ca2948b49e68 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 17 Nov 2016 13:22:25 -0800 Subject: [PATCH] Added MMU dump command ("d mmu [filter]"), fixed byte updates of PDRs, masked 18-bit UNIBUS addresses when UNIBUS relocation map not enabled, and fixed reads of MMR0 when ABORT bits are set --- modules/pdp11/lib/bus.js | 57 ++- modules/pdp11/lib/cpustate.js | 46 ++- modules/pdp11/lib/debugger.js | 16 +- modules/pdp11/lib/defines.js | 18 + modules/pdp11/lib/device.js | 76 +++- modules/pdp11/lib/messages.js | 8 +- versions/pdpjs/1.30.3/pdp11-dbg.js | 543 +++++++++++++++-------------- versions/pdpjs/1.30.3/pdp11.js | 20 +- 8 files changed, 424 insertions(+), 360 deletions(-) diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 5c63417ca..4f05e514c 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -166,11 +166,12 @@ Component.subclass(BusPDP11); BusPDP11.IOPAGE_16BIT = 0xE000; /*000160000*/ // eg, PDP-11/20 BusPDP11.IOPAGE_18BIT = 0x3E000; /*000760000*/ // eg, PDP-11/45 -BusPDP11.IOPAGE_UNIBUS = 0x3C0000; /*017000000*/ BusPDP11.IOPAGE_22BIT = 0x3FE000; /*017760000*/ // eg, PDP-11/70 BusPDP11.IOPAGE_LENGTH = 0x2000; // ie, 8Kb BusPDP11.IOPAGE_MASK = BusPDP11.IOPAGE_LENGTH - 1; -BusPDP11.MAX_MEMORY = BusPDP11.IOPAGE_UNIBUS - 16384; // Maximum memory address (need less memory for BSD 2.9 boot) + +BusPDP11.UNIBUS_22BIT = 0x3C0000; /*017000000*/ +BusPDP11.MAX_MEMORY = BusPDP11.UNIBUS_22BIT - 16384; // Maximum memory address (need less memory for BSD 2.9 boot) BusPDP11.ERROR = { RANGE_INUSE: 1, @@ -319,15 +320,11 @@ BusPDP11.IOController = { fWrite = true; } /* - * If a writeWord() handler exists, call the readWord() handler first to get the original data, - * then call writeWord() with the new data pre-inserted in the original data. - * - * WARNING: Whenever we call readWord() under these circumstances, we zero the address parameter, - * so that the handler can distinguish this case. Thus, if we're dealing with a special register - * where a byte write operation modifies the entire register, the handler can simply return zero. + * If a writeWord() handler exists, call the readWord() handler first to get the original data + * (with fPreWrite set to true) and call writeWord() with the new data inserted into the original data. */ else if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) { - w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](0) : 0; + w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](addrMasked, true) : 0; if (!(addrMasked & 0x1)) { afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & ~0xff) | b, addrMasked); fWrite = true; @@ -339,18 +336,14 @@ BusPDP11.IOController = { } else if (addrMasked & 0x1) { /* * If no handler existed, and this address was odd, then perhaps a handler exists for the even address; - * if so, call the readWord() handler first to get the original data, then call writeWord() with the new - * data pre-inserted in (the high byte of) the original data. - * - * WARNING: Whenever we call readWord() under these circumstances, we zero the address parameter, - * so that the handler can distinguish this case. Thus, if we're dealing with a special register - * where a byte write operation modifies the entire register, the handler can simply return zero. + * if so, call the readWord() handler first to get the original data (with fPreWrite set to true) and call + * writeWord() with the new data inserted into (the high byte of) the original data. */ afn = bus.aIOHandlers[off & ~0x1]; if (afn) { if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) { addrMasked &= ~0x1; - w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](0) : 0; + w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](addrMasked, true) : 0; afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & 0xff) | (b << 8), addrMasked); fWrite = true; } else if (afn[BusPDP11.IOHANDLER.WRITE_BYTE]) { @@ -930,11 +923,11 @@ BusPDP11.prototype.setMemoryBlocks = function(addr, size, aBlocks, type) BusPDP11.prototype.getByte = function(addr) { /* - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * UNIBUS relocation map. */ - if (addr >= BusPDP11.IOPAGE_UNIBUS) { + if (addr >= BusPDP11.UNIBUS_22BIT) { addr = this.cpu.mapUnibus(addr); } return this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr); @@ -952,11 +945,11 @@ BusPDP11.prototype.getByte = function(addr) BusPDP11.prototype.getByteDirect = function(addr) { /* - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * UNIBUS relocation map. */ - if (addr >= BusPDP11.IOPAGE_UNIBUS) { + if (addr >= BusPDP11.UNIBUS_22BIT) { addr = this.cpu.mapUnibus(addr); } this.fFault = false; @@ -976,11 +969,11 @@ BusPDP11.prototype.getByteDirect = function(addr) BusPDP11.prototype.getWord = function(addr) { /* - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * UNIBUS relocation map. */ - if (addr >= BusPDP11.IOPAGE_UNIBUS) { + if (addr >= BusPDP11.UNIBUS_22BIT) { addr = this.cpu.mapUnibus(addr); } var off = addr & this.nBlockLimit; @@ -1003,11 +996,11 @@ BusPDP11.prototype.getWord = function(addr) BusPDP11.prototype.getWordDirect = function(addr) { /* - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * UNIBUS relocation map. */ - if (addr >= BusPDP11.IOPAGE_UNIBUS) { + if (addr >= BusPDP11.UNIBUS_22BIT) { addr = this.cpu.mapUnibus(addr); } var w; @@ -1034,11 +1027,11 @@ BusPDP11.prototype.getWordDirect = function(addr) BusPDP11.prototype.setByte = function(addr, b) { /* - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * UNIBUS relocation map. */ - if (addr >= BusPDP11.IOPAGE_UNIBUS) { + if (addr >= BusPDP11.UNIBUS_22BIT) { addr = this.cpu.mapUnibus(addr); } this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr); @@ -1057,11 +1050,11 @@ BusPDP11.prototype.setByte = function(addr, b) BusPDP11.prototype.setByteDirect = function(addr, b) { /* - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * UNIBUS relocation map. */ - if (addr >= BusPDP11.IOPAGE_UNIBUS) { + if (addr >= BusPDP11.UNIBUS_22BIT) { addr = this.cpu.mapUnibus(addr); } this.fFault = false; @@ -1080,11 +1073,11 @@ BusPDP11.prototype.setByteDirect = function(addr, b) BusPDP11.prototype.setWord = function(addr, w) { /* - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * UNIBUS relocation map. */ - if (addr >= BusPDP11.IOPAGE_UNIBUS) { + if (addr >= BusPDP11.UNIBUS_22BIT) { addr = this.cpu.mapUnibus(addr); } var off = addr & this.nBlockLimit; @@ -1110,11 +1103,11 @@ BusPDP11.prototype.setWord = function(addr, w) BusPDP11.prototype.setWordDirect = function(addr, w) { /* - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * UNIBUS relocation map. */ - if (addr >= BusPDP11.IOPAGE_UNIBUS) { + if (addr >= BusPDP11.UNIBUS_22BIT) { addr = this.cpu.mapUnibus(addr); } var off = addr & this.nBlockLimit; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index b34f2d637..2f7ac3397 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -318,11 +318,11 @@ CPUStatePDP11.prototype.setMemoryAccess = function() */ CPUStatePDP11.prototype.getMMR0 = function() { - /* - * Technically, we never allow the UNUSED bits to be set, so there's no point going out of our way - * to clear them, but it doesn't hurt to include them in the mask. - */ - return (this.regMMR0 & ~(PDP11.MMR0.UNUSED | PDP11.MMR0.PAGE | PDP11.MMR0.MODE)) | (this.mmuLastMode << 5) | (this.mmuLastPage << 1); + var data = this.regMMR0; + if (!(data & PDP11.MMR0.ABORT)) { + data = (data & ~(PDP11.MMR0.UNUSED | PDP11.MMR0.PAGE | PDP11.MMR0.MODE)) | (this.mmuLastMode << 5) | (this.mmuLastPage << 1); + } + return data; }; /** @@ -1278,19 +1278,6 @@ CPUStatePDP11.prototype.updateSubFlags = function(result, src, dst) } }; -/** - * panic(reason) - * - * TODO: Something. - * - * @this {CPUStatePDP11} - * @param {number} reason - */ -CPUStatePDP11.prototype.panic = function(reason) -{ - console.log("panic(" + reason + ")"); -}; - /** * trap(vector, flag, reason) * @@ -1433,7 +1420,7 @@ CPUStatePDP11.prototype.getTrapStatus = function() /** * mapUnibus(addr) * - * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), + * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000), * then we have a 22-bit address pointing to the top 256Kb range, so if the UNIBUS relocation map is enabled, * we must pass the lower 18 bits of that address through the map. * @@ -1470,8 +1457,19 @@ CPUStatePDP11.prototype.mapUnibus = function(addr) var idx = (addr >> 13) & 0x1f; if (idx < 31) { if (this.regMMR3 & PDP11.MMR3.UNIBUS_MAP) { + /* + * The UNIBUS map relocation is enabled + */ addr = (this.unibusMap[idx] + (addr & 0x1ffe)) & 0x3ffffe; - if (addr >= BusPDP11.IOPAGE_UNIBUS && addr < BusPDP11.IOPAGE_22BIT) this.panic(898); + this.assert(addr < BusPDP11.UNIBUS_22BIT || addr >= BusPDP11.IOPAGE_22BIT); + } else { + /* + * Since UNIBUS map relocation is NOT enabled, then as explained above: + * + * If the UNIBUS map relocation is not enabled, an incoming 18-bit UNIBUS address has 4 leading zeroes added for + * referencing a 22-bit physical address. The lower 18 bits are the same. No relocation is performed. + */ + addr &= ~BusPDP11.UNIBUS_22BIT; } } return addr; @@ -1607,7 +1605,6 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl this.mmuLastPage = page; } - var fAbort = false; if (newMMR0) { if (newMMR0 & PDP11.MMR0.ABORT) { if (this.trapPSW >= 0) { @@ -1618,11 +1615,11 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl this.assert(!(newMMR0 & ~PDP11.MMR0.UPDATE)); this.setMMR0((this.regMMR0 & ~PDP11.MMR0.UPDATE) | newMMR0); /* - * I've decided to NOT set fAbort if MMR0 already indicates an ABORT condition, + * I've decided to NOT abort if MMR0 already indicates an ABORT condition, * because otherwise we run the risk of infinitely looping; eg, we call trap(), which * calls mapVirtualToPhysical() on the trap vector, which faults again, etc. */ - fAbort = true; + this.trap(PDP11.TRAP.MMU, 0, PDP11.REASON.ABORT); } } if (!(this.regMMR0 & (PDP11.MMR0.ABORT | PDP11.MMR0.TRAP_MMU))) { @@ -1637,9 +1634,6 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl } } } - if (fAbort) { // don't abort until the end, because it throws an exception - this.trap(PDP11.TRAP.MMU, 0, PDP11.REASON.ABORT); - } } return physicalAddress; }; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 5dc89dc67..6d449dec1 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1207,26 +1207,22 @@ if (DEBUGGER) { value = cpu.regSL; break; case DebuggerPDP11.REG_MMR0: - value = panel.getMMR0(); + value = cpu.getMMR0(); break; case DebuggerPDP11.REG_MMR1: - value = panel.getMMR1(); + value = cpu.getMMR1(); break; case DebuggerPDP11.REG_MMR2: - value = panel.getMMR2(); + value = cpu.getMMR2(); break; case DebuggerPDP11.REG_MMR3: - value = panel.getMMR3(); + value = cpu.getMMR3(); break; case DebuggerPDP11.REG_AR: - if (panel) { - value = panel.getAR(); - } + if (panel) value = panel.getAR(); break; case DebuggerPDP11.REG_DR: - if (panel) { - value = panel.getDR(); - } + if (panel) value = panel.getDR(); break; case DebuggerPDP11.REG_SR: if (panel && panel.hasSwitches()) { diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index f78b33c2a..da6fe83e7 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -351,6 +351,24 @@ var PDP11 = { MMU_22BIT: 0x0010, UNIBUS_MAP: 0x0020 // UNIBUS map relocation enabled }, + PDR: { + ACF: { + NR: 0x0, // non-resident, abort all accesses + RO1: 0x1, // read-only, abort on write attempt, memory management trap on read (11/70 only) + RO: 0x2, // read-only, abort on write attempt + U1: 0x3, // unused, abort all accesses--reserved for future use + RW1: 0x4, // read/write, memory management trap upon completion of a read or write + RW2: 0x5, // read/write, memory management trap upon completion of a write (11/70 only) + RW: 0x6, // read/write, no system trap/abort action + U2: 0x7 // unused, abort all accesses--reserved for future use + }, + ED: 0x0080, // expansion direction (if set, the page expands downward from block number 127) + UNUSED: 0x0030, + MODIFIED: 0x0040, // page has been written (bit cleared when either PDR or PAR is written) + ACCESSED: 0x0080, // page has been accessed (bit cleared when either PDR or PAR is written) (11/70 only) + PLF: 0x7F00, // page length field + BC: 0x8000 // bypass cache (11/44 only) + }, /* * Assorted special (UNIBUS) addresses * diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 272185589..c1c808337 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -130,9 +130,62 @@ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg) bus.addIOTable(this, DevicePDP11.UNIBUS_IOTABLE); bus.addResetHandler(this.reset.bind(this)); + if (DEBUGGER && dbg) { + dbg.messageDump(MessagesPDP11.MMU, function onDumpMMU(asArgs) { + device.dumpMMU(asArgs); + }); + } this.setReady(); }; +/** + * dumpMMU(asArgs) + * + * @this {DevicePDP11} + * @param {Array.} asArgs + */ +DevicePDP11.prototype.dumpMMU = function(asArgs) +{ + if (DEBUGGER) { + var cpu = this.cpu; + this.dumpRegs("KIPDR", cpu.mmuPDR[0], 0, asArgs[0]); + this.dumpRegs("KDPDR", cpu.mmuPDR[0], 8, asArgs[0]); + this.dumpRegs("KIPAR", cpu.mmuPAR[0], 0, asArgs[0]); + this.dumpRegs("KDPAR", cpu.mmuPAR[0], 8, asArgs[0], true); + this.dumpRegs("SIPDR", cpu.mmuPDR[1], 0, asArgs[0]); + this.dumpRegs("SDPDR", cpu.mmuPDR[1], 8, asArgs[0]); + this.dumpRegs("SIPAR", cpu.mmuPAR[1], 0, asArgs[0]); + this.dumpRegs("SDPAR", cpu.mmuPAR[1], 8, asArgs[0], true); + this.dumpRegs("UIPDR", cpu.mmuPDR[3], 0, asArgs[0]); + this.dumpRegs("UDPDR", cpu.mmuPDR[3], 8, asArgs[0]); + this.dumpRegs("UIPAR", cpu.mmuPAR[3], 0, asArgs[0]); + this.dumpRegs("UDPAR", cpu.mmuPAR[3], 8, asArgs[0], true); + } +}; + +/** + * dumpRegs(sName, aRegs, offset, sFilter, fBreak) + * + * @this {DevicePDP11} + * @param {string} sName + * @param {Array.} aRegs + * @param {number} offset + * @param {string} sFilter + * @param {boolean} [fBreak] + */ +DevicePDP11.prototype.dumpRegs = function(sName, aRegs, offset, sFilter, fBreak) +{ + if (DEBUGGER) { + var dbg = this.dbg; + if (sFilter && sName.indexOf(sFilter.toUpperCase()) < 0) return; + var sDump = sName + ":"; + for (var i = 0; i < 8; i++) { + sDump += ' ' + dbg.toStrBase(aRegs[offset + i]); + } + dbg.println(sDump + (fBreak? '\n' : '')); + } +}; + /** * reset() * @@ -435,7 +488,10 @@ DevicePDP11.prototype.readKIPDR = function(addr) DevicePDP11.prototype.writeKIPDR = function(data, addr) { var reg = (addr >> 1) & 7; - this.cpu.mmuPDR[0][reg] = data & 0xff0f; + this.cpu.mmuPDR[0][reg] = data &= 0xff0f; + if (this.messageEnabled(MessagesPDP11.MMU)) { + this.printMessage("writeKIPDR[" + reg + "]: " + str.toOct(data), true); + } }; /** @@ -962,20 +1018,23 @@ DevicePDP11.prototype.readMB = function(addr) */ DevicePDP11.prototype.writeMB = function(data, addr) { - if (!(addr & 0x1)) data &= 0xff; // Required for KB11-CM without MFPT instruction + if (!(addr & 0x1)) { + data &= 0xff; // required for KB11-CM without MFPT instruction + } this.cpu.regMB = data; }; /** - * readPIR(addr) + * readPIR(addr, fPreWrite) * * @this {DevicePDP11} * @param {number} addr (eg, PDP11.UNIBUS.PIR or 177772) + * @param {boolean} [fPreWrite] * @return {number} */ -DevicePDP11.prototype.readPIR = function(addr) +DevicePDP11.prototype.readPIR = function(addr, fPreWrite) { - if (!addr) return 0; // the caller is preparing to write the low or high byte; these are the bits to return for the other byte + if (fPreWrite) return 0; return this.cpu.getPIR(); }; @@ -992,15 +1051,16 @@ DevicePDP11.prototype.writePIR = function(data, addr) }; /** - * readSL(addr) + * readSL(addr, fPreWrite) * * @this {DevicePDP11} * @param {number} addr (eg, PDP11.UNIBUS.SL or 177774) + * @param {boolean} [fPreWrite] * @return {number} */ -DevicePDP11.prototype.readSL = function(addr) +DevicePDP11.prototype.readSL = function(addr, fPreWrite) { - if (!addr) return 0; // the caller is preparing to write the low or high byte; these are the bits to return for the other byte + if (fPreWrite) return 0; return this.cpu.getSL(); }; diff --git a/modules/pdp11/lib/messages.js b/modules/pdp11/lib/messages.js index 2dd37ece9..9175a7f58 100644 --- a/modules/pdp11/lib/messages.js +++ b/modules/pdp11/lib/messages.js @@ -38,9 +38,10 @@ var MessagesPDP11 = { FAULT: 0x00000020, BUS: 0x00000040, MEMORY: 0x00000080, - ROM: 0x00000100, - DEVICE: 0x00000200, - PANEL: 0x00000400, + MMU: 0x00000100, + ROM: 0x00000200, + DEVICE: 0x00000400, + PANEL: 0x00000800, KEYBOARD: 0x00010000, KEYS: 0x00020000, PAPER: 0x00100000, @@ -74,6 +75,7 @@ MessagesPDP11.CATEGORIES = { "fault": MessagesPDP11.FAULT, "bus": MessagesPDP11.BUS, "memory": MessagesPDP11.MEMORY, + "mmu": MessagesPDP11.MMU, "rom": MessagesPDP11.ROM, "device": MessagesPDP11.DEVICE, "panel": MessagesPDP11.PANEL, diff --git a/versions/pdpjs/1.30.3/pdp11-dbg.js b/versions/pdpjs/1.30.3/pdp11-dbg.js index b9e72a96c..b750bc35c 100644 --- a/versions/pdpjs/1.30.3/pdp11-dbg.js +++ b/versions/pdpjs/1.30.3/pdp11-dbg.js @@ -31,297 +31,298 @@ http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -for(var k,ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function na(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})} function xa(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",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"}; function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function Ea(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== +function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Fa(a,b){var c,d={ea:null,ga:null,Oa:null,Na:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Oa=g.load;d.Na=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Oa=g.load;d.Na=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ga=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.ab=this.id:(this.Ua=this.id.substr(0,b),this.ab=this.id.substr(b+1));this[a]=c;this.A={ready:!1,eb:!1,ec:!1,ha:!1,error:!1};this.Yb=null;this.A.error=!1;this.G={};this.i=null;this.ka=d||0;u.push(this)}var db=void 0,eb={}; +function ab(a){if(Ya)try{for(var b=0;bb?this.ab=this.id:(this.Ua=this.id.substr(0,b),this.ab=this.id.substr(b+1));this[a]=c;this.A={ready:!1,eb:!1,ec:!1,ia:!1,error:!1};this.Yb=null;this.A.error=!1;this.G={};this.i=null;this.la=d||0;u.push(this)}var db=void 0,eb={}; if(window){db||(db=window.location.search.substr(1));for(var fb,gb=/\+/g,hb=/([^&=]+)=?([^&]*)/g;fb=hb.exec(db);)eb[decodeURIComponent(fb[1].replace(gb," "))]=decodeURIComponent(fb[2].replace(gb," "))}function ib(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} -function z(a,b){b||(b=t);a.prototype=ib(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var qb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else qb={},u=[];function rb(a,b,c){qb[a]&&b&&(qb[a][b]=c)}function sb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.f["S"+a]=[0,0,!1,!1,this.kd,a]}z(Db);var Eb=7;function Fb(a,b){return a.f[b]&&a.f[b][1]}k=Db.prototype;k.reset=function(){this.stop()}; -k.ua=function(a,b,c,d){if(this.C&&this.C.ua(a,b,c,d)||this.b&&this.b.ua(a,b,c,d)||this.i&&this.i.ua(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.g[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Gb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Hb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Gb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Hb(a,b)}}(this,b),!0):this.parent.ua.call(this,a,b,c,d)}};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Ib(b,this,Jb);Kb(b,this.reset.bind(this));Lb(this);Mb(this)};k.Ka=function(a,b){b||(Nb(),this.reset());return!0};k.Ja=function(){return!0}; -function Ob(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Lb(a,b){for(var c in a.g)Ob(a,c,null!=b?b:a.g[c])}function Pb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Mb(a){for(var b in a.f)Pb(a,b,a.f[b][1])}function Qb(a,b,c,d){a.G[b]&&(void 0===c&&(zb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} +var Ab="undefined"!==typeof ArrayBuffer,Bb="UNKNOWN ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Cb={cpu:1,trap:16,fault:32,bus:64,memory:128,mmu:256,rom:512,device:1024,panel:2048,keyboard:65536,key:131072,paper:1048576,disk:4194304,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648}; +function Db(a){t.call(this,"Panel",a,Db,2048);this.ta=this.w=this.Ya=this.rb=this.B=this.D=0;this.I=this.K=this.H=!1;this.L=Eb;this.g={};this.f={START:[1,1,!0,!1,this.hd],STEP:[1,1,!1,!1,this.jd],ENABLE:[1,1,!1,!1,this.dd],CONT:[1,1,!0,!1,this.bd],DEP:[0,0,!0,!1,this.cd],EXAM:[1,1,!0,!1,this.ed],LOAD:[1,1,!0,!1,this.gd],TEST:[0,0,!0,!1,this.fd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.kd,a]}z(Db);var Eb=7;function Fb(a,b){return a.f[b]&&a.f[b][1]}k=Db.prototype;k.reset=function(){this.stop()}; +k.va=function(a,b,c,d){if(this.C&&this.C.va(a,b,c,d)||this.b&&this.b.va(a,b,c,d)||this.i&&this.i.va(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.g[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){Gb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Hb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Gb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Hb(a,b)}}(this,b),!0):this.parent.va.call(this,a,b,c,d)}};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Ib(b,this,Jb);Kb(b,this.reset.bind(this));Lb(this);Mb(this)};k.Ka=function(a,b){b||(Nb(),this.reset());return!0};k.Ja=function(){return!0}; +function Ob(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Lb(a,b){for(var c in a.g)Ob(a,c,null!=b?b:a.g[c])}function Pb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Mb(a){for(var b in a.f)Pb(a,b,a.f[b][1])}function Qb(a,b,c,d){a.G[b]&&(void 0===c&&(zb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?na(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} function Gb(a,b){var c=a.f[b];Pb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Hb(a,b){var c=a.f[b];c[2]&&c[3]&&(Pb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.hd=function(a){a||this.b.A.W||(a=this.b,a.v.reset(),Rb(a),Fb(this,"ENABLE")&&this.b.jb())};k.jd=function(){};k.dd=function(a){a||this.b.da()}; -k.bd=function(a){if(!a&&!this.b.A.W)if(Fb(this,"ENABLE"))this.b.jb();else{if((a=this.i)&&!wb(a,!0))vb(a,!0),a.kb(0,null),vb(a,!1);else try{var b=this.b.kb(1);0a.b.Xa?8:16,c=65472<=a.sa&&a.sa<65472+b,b=c?1:2,c=c?15:a.v.Qa;Fb(a,"STEP")||(b=-b);ic(a,a.sa&~c|a.sa+b&c)} -function ic(a,b){a.sa=b&a.v.Qa;b=a.sa;for(var c=0;22>c;c++)kc(a,"A"+c,b&1<c;c++)kc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<a.b.Xa?8:16,c=65472<=a.ta&&a.ta<65472+b,b=c?1:2,c=c?15:a.v.Qa;Fb(a,"STEP")||(b=-b);ic(a,a.ta&~c|a.ta+b&c)} +function ic(a,b){a.ta=b&a.v.Qa;b=a.ta;for(var c=0;22>c;c++)kc(a,"A"+c,b&1<c;c++)kc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.v=this.Ba-1;this.D=this.H/this.Ba|0;this.cb=[];this.la=0;this.f=!1;this.gc=0;this.B=[];this.Qc=[pc,qc,rc,sc];a=new I(this);tc(a,this.i);this.Y=Array(this.D);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.cb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Ha(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} -function qc(a,b,c){var d=!1,e=this.controller,f=e.cb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.cb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Ha(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b), -!0,!e.la))}function rc(a,b){var c=-1,d=this.controller;a=d.cb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Ha(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} -function sc(a,b,c){var d=!1,e=this.controller;a=e.cb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Ha(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} +function nc(a,b,c){t.call(this,"Bus",a,nc,64);this.b=b;this.i=c;this.K=a.busWidth||16;this.C=0;this.w=[];this.g=null;this.H=1<>2;this.v=this.Ba-1;this.D=this.H/this.Ba|0;this.cb=[];this.ma=0;this.f=!1;this.gc=0;this.B=[];this.Qc=[pc,qc,rc,sc];a=new I(this);tc(a,this.i);this.Y=Array(this.D);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.cb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Ha(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.ma);return c} +function qc(a,b,c){var d=!1,e=this.controller,f=e.cb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.cb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Ha(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i, +b),!0,!e.ma))}function rc(a,b){var c=-1,d=this.controller;a=d.cb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Ha(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.ma);return c} +function sc(a,b,c){var d=!1,e=this.controller;a=e.cb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Ha(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.ma))} function vc(a,b){if(b!=a.C){var c;a.C&&(c=(1<>>a.ja;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Ub+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ub){n=l.size-(f-m);n>g&&(n=g);l.Ub=f-l.F+n;f=m+a.Ba;g-=n;h++;continue}}return Ac(1,f,g)}f=new I(a,f,n,a.Ba,d,e);tc(f,a.i,l);a.Y[h++]=f;f=m+a.Ba;g-=n}return 0>=g?(d==Bc&&(a.gc+=c),a.status((c>>10)+"Kb "+Cc[d]+" at "+ra(b)),!0):Ac(2,b,c)} -function xc(a,b,c){var d=[];for(b>>>=a.ja;0>>=a.ja;0>>this.ja].$b(a&this.v,a)};k.Zb=function(a){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Qa)>>>this.ja].lc(a&this.v,a);this.la--;return a}; -k.na=function(a){3932160<=a&&(a=Dc(this.b,a));return this.Y[(a&this.Qa)>>>this.ja].ra(a&this.v,a)};k.fb=function(a){3932160<=a&&(a=Dc(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].mc(b,a);this.la--;return a};k.Eb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ja].cc(a&this.v,b&255,a)};k.tb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Qa)>>>this.ja].dc(a&this.v,b&255,a);this.la--}; -k.ib=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ja].Vb(a&this.v,b&65535,a)};k.Fb=function(a,b){3932160<=a&&(a=Dc(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ja;this.f=!1;this.la++;this.Y[d].pc(c,b&65535,a);this.la--}; +function yc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ka;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Ub+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ub){n=l.size-(f-m);n>g&&(n=g);l.Ub=f-l.F+n;f=m+a.Ba;g-=n;h++;continue}}return Ac(1,f,g)}f=new I(a,f,n,a.Ba,d,e);tc(f,a.i,l);a.Y[h++]=f;f=m+a.Ba;g-=n}return 0>=g?(d==Bc&&(a.gc+=c),a.status((c>>10)+"Kb "+Cc[d]+" at "+na(b)),!0):Ac(2,b,c)} +function xc(a,b,c){var d=[];for(b>>>=a.ka;0>>=a.ka;0>>this.ka].$b(a&this.v,a)};k.Zb=function(a){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.ma++;a=this.Y[(a&this.Qa)>>>this.ka].lc(a&this.v,a);this.ma--;return a}; +k.oa=function(a){3932160<=a&&(a=Dc(this.b,a));return this.Y[(a&this.Qa)>>>this.ka].sa(a&this.v,a)};k.fb=function(a){3932160<=a&&(a=Dc(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ka;this.f=!1;this.ma++;a=this.Y[c].mc(b,a);this.ma--;return a};k.Eb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ka].cc(a&this.v,b&255,a)};k.tb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.ma++;this.Y[(a&this.Qa)>>>this.ka].dc(a&this.v,b&255,a);this.ma--}; +k.ib=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ka].Vb(a&this.v,b&65535,a)};k.Fb=function(a,b){3932160<=a&&(a=Dc(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ka;this.f=!1;this.ma++;this.Y[d].pc(c,b&65535,a);this.ma--}; function Ec(a){for(var b=0,c=[],d=0;da.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r>1&63;var b=this.b.Tb[a>>1];return a&1?b>>16:b&65535};k.Te=function(a,b){b=b>>1&63;var c=b>>1;this.b.Tb[c]=b&1?this.b.Tb[c]&65535|(a&63)<<16:this.b.Tb[c]&-65536|a&65534};k.Ud=function(a){return this.b.V[1][a>>1&7]};k.Me=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Sd=function(a){return this.b.V[1][(a>>1&7)+8]};k.Ke=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295}; -k.Td=function(a){return this.b.Aa[1][a>>1&7]};k.Le=function(a,b){b=b>>1&7;this.b.Aa[1][b]=a;this.b.V[1][b]&=65295};k.Rd=function(a){return this.b.Aa[1][(a>>1&7)+8]};k.Je=function(a,b){b=(b>>1&7)+8;this.b.Aa[1][b]=a;this.b.V[1][b]&=65295};k.ud=function(a){return this.b.V[0][a>>1&7]};k.oe=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.sd=function(a){return this.b.V[0][(a>>1&7)+8]};k.me=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.td=function(a){return this.b.Aa[0][a>>1&7]}; -k.ne=function(a,b){b=b>>1&7;this.b.Aa[0][b]=a;this.b.V[0][b]&=65295};k.rd=function(a){return this.b.Aa[0][(a>>1&7)+8]};k.le=function(a,b){b=(b>>1&7)+8;this.b.Aa[0][b]=a;this.b.V[0][b]&=65295};k.$d=function(a){return this.b.V[3][a>>1&7]};k.Se=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Yd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Qe=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Zd=function(a){return this.b.Aa[3][a>>1&7]};k.Re=function(a,b){b=b>>1&7;this.b.Aa[3][b]=a;this.b.V[3][b]&=65295}; -k.Xd=function(a){return this.b.Aa[3][(a>>1&7)+8]};k.Pe=function(a,b){b=(b>>1&7)+8;this.b.Aa[3][b]=a;this.b.V[3][b]&=65295};k.Cb=function(a){a&=7;return this.b.N&2048?this.b.Za[a]:this.b.u[a]};k.Gb=function(a,b){b&=7;this.b.N&2048?this.b.Za[b]=a:this.b.u[b]=a};k.Fd=function(){return this.b.N&49152?this.b.La[0]:this.b.u[6]};k.xe=function(a){this.b.N&49152?this.b.La[0]=a:this.b.u[6]=a};k.Id=function(){return this.b.u[7]};k.Ae=function(a){this.b.u[7]=a}; -k.Db=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Za[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Za[b]=a};k.Gd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.ye=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Hd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.ze=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.pd=function(a){return this.b.Jc[a-65504>>1]}; -k.je=function(a,b){this.b.Jc[b-65504>>1]=a};k.Gc=function(a){if(65520==a){a=0;switch(Bc){case Bc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Nc=function(){};k.Wd=function(){return 1};k.Oe=function(){};k.od=function(){return this.b.ta};k.ie=function(){this.b.ta=0};k.wd=function(){return this.b.Ic};k.qe=function(a,b){b&1||(a&=255);this.b.Ic=a};k.Bd=function(a){return a?this.b.Sb:0};k.te=function(a){Yc(this.b,a)};k.Vd=function(a){return a?this.b.sb&65280:0};k.Ne=function(a){this.b.sb=a|255};k.Ed=function(){return Zc(this.b)}; -k.we=function(a){$c(this.b,a&-1793|Zc(this.b)&1792);this.b.J|=128};k.Mc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; -var L={},Sc=(L[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.td, -K.prototype.ne,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145],L[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],L[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145],L[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.$d,K.prototype.Se,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Yd, -K.prototype.Qe,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.Cb,K.prototype.Gb,"R0SET0"],L[65473]=[null,null,K.prototype.Cb,K.prototype.Gb,"R1SET0"],L[65474]=[null,null,K.prototype.Cb,K.prototype.Gb,"R2SET0"],L[65475]=[null,null,K.prototype.Cb,K.prototype.Gb,"R3SET0"],L[65476]=[null,null,K.prototype.Cb,K.prototype.Gb,"R4SET0"],L[65477]=[null,null,K.prototype.Cb,K.prototype.Gb, -"R5SET0"],L[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],L[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],L[65480]=[null,null,K.prototype.Db,K.prototype.Hb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Db,K.prototype.Hb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Db,K.prototype.Hb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Db,K.prototype.Hb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Db,K.prototype.Hb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Db, -K.prototype.Hb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],L[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,"SYSID",1,1170],L[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],L[65528]= -[null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],L[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],L[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],L[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],L);$a(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),hd(this,dd?id:jd);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Ha(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ -1]&255)<<8},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Wa=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;od(c,this.F+a,1,c.M)&&c.da(!0)}return this.lc(a,b)},Ua:function(a,b){if(this.i&&null!=this.F){var c=this.i;od(c,this.F+a,2,c.M)&&c.da(!0)}return this.mc(a,b)},ab:function(a, -b,c){if(this.i&&null!=this.F){var d=this.i;od(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.dc(a,b,c)},za:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;od(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.pc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Ha(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Ha(b,64,2); -a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Wa=!0},ma:function(a,b,c){this.G[a]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},ya:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.D.setUint16(a,b,!0);this.Wa=!0},Ea:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.I[a>>1]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, -b)+")",!0)}};function tc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&nd(a,md,!1),(a.C=c.C)&&ld(a,md,!1))}function pd(a,b){b?--a.C||(a.cc=a.f?a.w:a.dc,a.Vb=a.f?a.H:a.pc):--a.g||(a.$b=a.lc,a.ra=a.mc)}function ld(a,b,c){c&&a.C||(a.cc=!a.f&&b[1]||a.w,a.Vb=!a.f&&b[3]||a.H);if(c||void 0===c)a.dc=b[1]||a.w,a.pc=b[3]||a.H}function nd(a,b,c){c&&a.g||(a.$b=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.lc=b[0]||a.K,a.mc=b[2]||a.L}function hd(a,b){b||(b=qd);nd(a,b,void 0);ld(a,b,void 0)} -var qd=[],kd=[I.prototype.S,I.prototype.wa,I.prototype.ca,I.prototype.Ma],md=[I.prototype.O,I.prototype.ab,I.prototype.Ua,I.prototype.za];if(Ab)var jd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.ya],id=[I.prototype.R,I.prototype.ma,I.prototype.ba,I.prototype.Ea]; -function rd(a,b){t.call(this,"CPU",a,rd,1);b=a.cycles||b;var c=a.multiplier||1;this.wb=0;this.nb=b;this.gb=c;this.Ib=Math.round(this.nb/1E4)/100;this.qb=this.Ib*this.gb;this.A.W=!1;this.A.bc=!1;this.A.vb=a.autoStart;this.A.xb=!1;this.Pb=this.wa=0;this.Qb=a.csStart;this.zb=a.csInterval;this.Ab=a.csStop;this.K=[];this.Fc=this.ee.bind(this);H(this)}z(rd);var sd=["power","reset"];k=rd.prototype; -k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.w=a.w;for(b=0;b=a.wa&&(a.wa+=a.zb,c=!0);0<=a.Ab&&a.Ab<=yd(a)&&(a.zb=a.Ab=-1,vd(a),a.da(),c=!0);c&&a.j(yd(a)+" cycles: checksum="+p(a.Pb))}} -k.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.A.ha)a=!0;else{var b=null,c,h=sb(a.id);for(c=0;ca.ma/a.qb?b=1:d=!0;a.gb=b;b=a.Ib*a.gb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ub()}ec(a,a.X);a.X=0;a.S=Ba();a.ba=0;Ad(a);return d}function Hc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Qc(a,b,c,d){0<=b&&ba.K[b][0])&&(c=a.nb*a.gb/1E3*c|0,a.A.W&&(c+=Bd(a)),a.K[b][0]=c)} -function Cd(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 dc(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 Bd(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c} -k.ee=function(){if(this.A.W){this.Jb>=this.nb&&Ad(this,!0);this.Ma=0;this.lb=Ba();if(this.ba){var a=this.lb-this.ba;a>this.Cc&&(this.S+=a,this.S>this.lb&&(this.S=this.lb))}try{do{var b=Cd(this,this.A.xb?1:this.pb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=Bd(this,!0);this.Ma+=b;this.X+=b;fc(this,b);dc(this,b);this.ya-=b;if(0>=this.ya){this.ya+=this.pb;15<=++this.Dc&&(this.pa(),this.Dc=0);break}}while(this.A.W)}catch(e){this.da();this.C&&this.C.stop(Ba(),yd(this));zb(this,e.stack||e.message); -return}if(this.A.W){a=setTimeout;b=this.Fc;this.ba=Ba();var c=this.Cc;this.Ma&&(c=Math.round(c*this.Ma/this.pb));var c=c-(this.ba-this.lb),d=this.ba-this.S;d&&(this.ma=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ia=0,zd(this)));if(0>c||this.mac&&(this.S-=c),c=0;this.Jb+=this.Ma;this.ba+=c;a(b,c)}}}; -k.jb=function(a){if(yb(this))return!1;if(this.A.W)return this.j(this.toString()+" busy"),!1;zd(this);this.A.W=!0;this.A.bc=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ub(!0),this.C.start(this.S,yd(this)));setTimeout(this.Fc,0);return!0};k.kb=function(){return 0};k.da=function(a){var b=!1;if(this.A.W){Bd(this);ec(this,this.X);this.X=0;this.A.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),yd(this));b=!0}this.A.complete=a;return b}; -function Dd(a){this.Xa=+a.model||1170;this.Ac=a.addrReset||0;rd.call(this,a,6666667);this.decode=1120==this.Xa?Ed.bind(this):Fd.bind(this);Gd(this);this.M=0;this.O=null;this.A.complete=!1}z(Dd,rd);k=Dd.prototype;k.reset=function(){this.status("model "+this.Xa);this.A.W&&this.da();Gd(this);ud(this);this.A.error=!1;this.parent.reset.call(this)}; -function Gd(a){a.T=65536;a.U=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Ac];a.Za=[0,0,0,0,0,0];a.La=[0,0,0,0];a.B=0;a.mb=0;a.$c=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Aa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Tb=[0,0,0,0,0,0,0,0,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.Jc=[0,0,0,0,0,0,0,0];a.Ic=0;a.J=0;a.D=a.H=0;a.g=a.f=a.yb=0;a.za=-1;Rb(a)}function Rb(a){a.Da=0;a.Kb=0;a.Mb=0;a.Ta=0;a.ta=0;a.Sb=0;a.sb=255;a.L=0;a.bb=0;a.Ea=262143;a.Nb=0;a.oa=0;a.O=null;a.v&&Hd(a)}function Hd(a){a.L?(a.R=65536,a.yc=a.Ta&16?4186112:253952,a.aa=a.Yc,a.ra=a.be,a.Vb=a.Ue,vc(a.v,a.Ta&16?22:18)):(a.R=0,a.yc=57344,a.aa=a.Xc,a.ra=a.Hc,a.Vb=a.Oc,vc(a.v,16))}function Tc(a){return a.Da&-3199|a.bb<<5|a.mb<<1} -function Uc(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.Kb=a.oa>>16&65535,a.Mb=a.oa&65535);a.Da=b;a.bb=b>>5&3;a.mb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.L!=c&&(a.L=c,Hd(a))}}function Vc(a){a.Da&57344||(a.Kb=a.oa>>16&65535);a=a.Kb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function Wc(a){a.Da&57344||(a.Mb=a.oa&65535);return a.Mb}function Xc(a,b){1170>a.Xa&&(b&=-49);a.Ta!=b&&(a.Ta=b,a.Ea=b&16?4194303:262143,Hd(a))}k.vc=function(){return 0}; -k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ia,this.gb]);a.set(2,Ec(this.v));return a.data()};k.restore=function(a){var b=a[1];this.ia=b[1];zd(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.N>>14&3;a.B!=c&&(a.La[c]=a.u[6],a.u[6]=a.La[a.B]);a.N=b;a.J|=2}function Yc(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1)}a.Sb=b;a.J|=2}function Q(a,b){a.J&128||(a.Z=a.$=b,a.U=0)}function ke(a,b,c){a.J&128||(a.Z=a.$=a.T=b,a.U=c||0)}function le(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^b)&(d^b))} -function me(a,b){a.J&128||(a.Z=a.$=a.T=b,a.U=a.Z^a.T>>1)}function ne(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^d)&(d^b))}k.va=function(a,b,c){if(!this.M){0>this.za?this.za=Zc(this):this.B||(a=4,this.ta|=4,this.u[6]=4,c=-3);this.oa=a;this.B=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);$c(this,e&-12289|this.za>>2&12288);oe(this,this.za);oe(this,this.u[7]);O(this,d);this.J&=~(b|18);this.J|=9;this.za=-1;this.md=a;this.ld=c;if(-3<=c)throw a;}}; -function pe(a){var b=qe(a),c=qe(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);$c(a,c);a.J&=-17}function Dc(a,b){var c=b>>13&31;31>c&&a.Ta&32&&(b=a.Tb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function re(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.yc),f;d=b>>13;a.Ta&a.$c[a.B]||(d&=7);e=a.V[a.B][d];f=(a.Aa[a.B][d]<<6)+(b&8191)&a.Ea;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.B][d]=e;if(f!=(4194170&a.Ea)||a.B)a.bb=a.B,a.mb=d;b=!1;g&&(g&57344&&(0<=a.za&&(g|=128),a.Da& -57344||(g|=a.bb<<5|a.mb<<1,Uc(a,a.Da&-61695|g),b=!0)),a.Da&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)),b&&a.va(168,0,-1));return f}function se(a,b){return a.v.Lb(b)}function qe(a){var b=a.ra(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function oe(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.oa=a.oa&65535|(a.oa&-65536)<<8|16121856;te(a,0,c);a.Vb(c,b)}function te(a,b,c){!a.B&&c<=a.sb&&(b||4c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.ra(e)|g;a.b-=8;break;case 6:return e=a.ra(Nd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Nd(a,2)),e=e+ -a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.oa=a.oa&65535|(a.oa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&te(a,b,a.u[6]);return e}k.Zb=function(a){if(!this.L)return this.v.Zb(a);this.M++;a=se(this,re(this,a,3));this.M--;return a};k.fb=function(a){if(!this.L)return this.v.fb(a);this.M++;a=this.Hc(re(this,a,2));this.M--;return a};k.tb=function(a,b){this.L?(this.M++,a=re(this,a,5),a&1&&this.b--,this.v.Eb(a,b),this.M--):this.v.tb(a,b)}; -k.Fb=function(a,b){this.L?(this.M++,this.Oc(re(this,a,4),b),this.M--):this.v.Fb(a,b)};k.Xc=function(a,b,c){return ue(this,a,b,c)};k.Yc=function(a,b,c){return re(this,ue(this,a,b,c),c)};k.Hc=function(a){return this.v.na(this.Nb=a)};k.be=function(a){return this.v.na(this.Nb=re(this,a,2))};k.Oc=function(a,b){this.v.ib(this.Nb=a,b&65535)};k.Ue=function(a,b){this.v.ib(this.Nb=re(this,a,4),b)}; -function ve(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ue(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.ra(d|c&a.R),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.La[a.N>>12&3];return c}function we(a,b,c,d){a.oa=a.oa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ue(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=re(a,e|c&65536,4),a.B=a.N>>14&3,a.v.ib(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.La[a.N>>12&3]=d} -function xe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?se(a,a.aa(b,c,3)):-c-1}function ye(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.aa(b,d,2)):c=-d-1;return c}function ze(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ue(a,b,c,8)}function Ae(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?se(a,a.aa(b,c,3)):a.u[c]&255}function Be(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.aa(b,c,2)):a.u[c]} -function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.yb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,se(a,e)),e&1&&a.b--,a.v.Eb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.ib(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} -function Ce(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Eb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function De(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.ib(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.kb=function(a){this.A.complete=!0;var b=this.i?Ee(this.i)?1:this.A.bc?-1:0:0,c=a?this.A.bc?0:1:-1;this.A.bc=!1;this.ca=this.b=a;do{if(b){if(Fe(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&7)if(a=!1,this.J&2){this.J&=-3;var d=160,e=(this.Sb&224)>>5,f=this.O&&this.O.Bb>e?this.O:null;f&&(d=f.ge,e=f.Bb);e>(this.N&224)>>5?(this.J&4&&(Nd(this,2),this.J&=-5),this.va(d,0,-9),e=!0):e=!1;e&&(f&&Od(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&Fe(this.i,this.u[7],c)){this.da(); -break}if(0>c)break}if(this.J&112&&je(this)){if(b&&Fe(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Md(this))}while(0>1|b<<16;me(this,a);return a&65535}function Le(a,b){a=b&128|b>>1|b<<8;me(this,a<<8);return a&255}function Me(a,b){a=b&~a;Q(this,a);return a}function Ne(a,b){a=b&~a;Q(this,a<<8);return a}function Oe(a,b){a|=b;Q(this,a);return a}function Pe(a,b){a|=b;Q(this,a<<8);return a}function Qe(a,b){a=~b|65536;ke(this,a);return a&65535} -function Re(a,b){a=~b|256;ke(this,a<<8);return a&255}function Se(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.U=b&(b^a));return a&65535}function Te(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.U=b&(b^c));return a&255}function Ue(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.U=a&(b^a));return a&65535}function Ve(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.U=c&(b<<8^c));return a&255}function We(a,b){a=-b;ke(this,a,a&b&32768);return a&65535} -function Xe(a,b){a=-b;ke(this,a<<8,(a&b&128)<<8);return a&255}function Ye(a,b){a=b<<1|this.T>>16&1;me(this,a);return a&65535}function Ze(a,b){a=b<<1|this.T>>16&1;me(this,a<<8);return a&255}function $e(a,b){a=(this.T&65536|b)>>1|b<<16;me(this,a);return a&65535}function af(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;me(this,a<<8);return a&255}function bf(a,b){var c=b-a;ne(this,c,a,b);return c&65535}function cf(a,b){var c=b-a;ne(this,c<<8,a<<8,b<<8);return c&255} -function df(a,b){this.J&128||(this.Z=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function ef(a,b){a^=b;Q(this,a);return a&65535}function ff(a){S(this,a,ye(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function gf(a){var b=Be(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Z=this.$=c;this.b-=(this.g?6:7)+b} -function hf(a){var b=Be(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function jf(a){T(this,a,!Id(this))}function kf(a){T(this,a,Id(this))} -function lf(a){S(this,a,ye(this,a),Me);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function mf(a){R(this,a,xe(this,a),Ne);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function nf(a){S(this,a,ye(this,a),Oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function of(a){R(this,a,xe(this,a),Pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function pf(a){var b=ye(this,a);a=Be(this,a);Q(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function qf(a){var b=xe(this,a);a=Ae(this,a);Q(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function rf(a){T(this,a,Kd(this))}function sf(a){T(this,a,!Ld(this)==!Jd(this))}function tf(a){T(this,a,!Kd(this)&&!Ld(this)==!Jd(this))}function uf(a){T(this,a,!Id(this)&&!Kd(this))} -function vf(a){T(this,a,Kd(this)||!Ld(this)!=!Jd(this))}function wf(a){T(this,a,Id(this)||Kd(this))}function xf(a){T(this,a,!Ld(this)!=!Jd(this))}function yf(a){T(this,a,Ld(this))}function zf(a){T(this,a,!Kd(this))}function Af(a){T(this,a,!Ld(this))}function Bf(){this.va(12,0,-8);this.b-=5}function Cf(a){T(this,a,!0)}function Df(a){T(this,a,!Jd(this))}function Ef(a){T(this,a,Jd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5} -function Ff(a){var b=ye(this,a);a=Be(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ne(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Gf(a){var b=xe(this,a);a=Ae(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ne(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} -function Hf(a){var b=Be(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.Z=d>>16):(this.U=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function If(){this.va(24,0,-8);this.b-=25} -function Jf(){this.N&49152?(this.ta|=128,this.va(4,0,-7)):(this.w&&1120==this.Xa&&this.w.setData(this.u[0],!0),this.i?Kf(this.i):this.da());this.b-=7}function Lf(){this.va(16,0,-8);this.b-=25}var Mf=[0,7,7,10,7,11,9,13];function Nf(a){this.I=this.b;O(this,ze(this,a));this.b=this.I-Mf[this.g]}var Of=[0,14,14,17,14,18,16,20];function Pf(a){this.I=this.b;var b=ze(this,a);a=a>>6&7;oe(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Of[this.g]} -var Qf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Rf(a){var b=ye(this,a);this.I=this.b;Q(this,De(this,a,b));this.b=this.I-Qf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Sf(a){var b=xe(this,a);Q(this,Ce(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Tf=[7,13,13,17,14,18,17,21]; -function Uf(a){var b=Be(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.J&128||(this.Z=b>>16,this.$=this.Z|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function $f(a){S(this,a,ye(this,a),bf);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ag(a){S(this,a,0,df);this.b-=this.g?9:3+(7==this.f?2:0)}function bg(){this.va(28,0,-8);this.b-=5} -function cg(){this.w&&(this.w.nc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=4;Nd(this,-2);this.b-=3}function dg(a){S(this,a,this.u[a>>6&7],ef);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Kf(b)):b=!1;b||this.va(8,0,-8)}function Ed(a){eg[a>>12].call(this,a)}function fg(a){gg[a>>6&3].call(this,a)}function hg(a){ig[a>>6&3].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a&15].call(this,a)} -function ng(a){og[a&15].call(this,a)}function pg(a){qg[a>>6&3].call(this,a)}function rg(a){sg[a>>6&3].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)} -var eg=[function(a){vg[a>>8&15].call(this,a)},Rf,Ff,pf,lf,nf,ff,V,function(a){wg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,$f,V],vg=[function(a){xg[a>>4&15].call(this,a)},Cf,zf,rf,sf,xf,tf,vf,Pf,Pf,fg,hg,jg,V,V,V],gg=[function(a){ke(this,De(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Se);this.b-=this.g?9:3+(7==this.f?2:0)}],ig=[function(a){S(this,a,0, -We);this.b-=this.g?11:6},function(a){S(this,a,Id(this)?1:0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Id(this)?1:0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Be(this,a);ke(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],kg=[function(a){S(this,a,0,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)}], -xg=[function(a){yg[a&15].call(this,a)},V,V,V,Nf,Nf,Nf,Nf,Xf,V,lg,ng,ag,ag,ag,ag],yg=[Jf,cg,Yf,Bf,Lf,Wf,V,V,V,V,V,V,V,V,V,V],mg=[Vf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.$=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],og=[Vf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.$=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],wg=[Af,yf,uf,wf,Df,Ef,jf,kf,If,bg,pg,rg,tg,V,V,V],qg=[function(a){ke(this, -Ce(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Te);this.b-=this.g?9:3+(7==this.f?2:0)}],sg=[function(a){R(this,a,0,Xe);this.b-=this.g?11:6},function(a){R(this,a,Id(this)?1:0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Id(this)?1:0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ae(this,a);ke(this,a<<8);this.b-=this.g?4:3+ -(7==this.f?2:0)}],ug=[function(a){R(this,a,0,af);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Le);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)}];function Fd(a){zg[a>>12].call(this,a)} -var zg=[function(a){Ag[a>>8&15].call(this,a)},Rf,Ff,pf,lf,nf,ff,function(a){Bg[a>>8&15].call(this,a)},function(a){Cg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,$f,V],Ag=[function(a){Dg[a>>4&15].call(this,a)},Cf,zf,rf,sf,xf,tf,vf,Pf,Pf,fg,hg,jg,function(a){Eg[a>>6&3].call(this,a)},V,V],Eg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ve(this,a,0);oe(this,a);Q(this,a);this.b-=11},function(a){var b=qe(this);this.I= -this.b;we(this,a,0,b);Q(this,b);this.b=this.I-Tf[this.g]},function(a){Q(this,De(this,a,Ld(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Dg=[function(a){Fg[a&15].call(this,a)},V,V,V,Nf,Nf,Nf,Nf,Xf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):V.call(this,a)},lg,ng,ag,ag,ag,ag],Fg=[Jf,cg,function(){pe(this);this.J|=this.N&16;this.b-=13},Bf,Lf,Wf,Yf,function(){this.va(8,0,-8)},V,V,V,V,V,V,V,V],Bg=[Uf,Uf,Hf,Hf,gf,gf,hf,hf,dg,dg,V,V,V,V,Zf,Zf],Cg=[Af,yf,uf,wf, -Df,Ef,jf,kf,If,bg,pg,rg,tg,function(a){Gg[a>>6&3].call(this,a)},V,V],Gg=[V,function(a){a=ve(this,a,65536);oe(this,a);Q(this,a);this.b-=11},function(a){var b=qe(this);this.I=this.b;we(this,a,65536,b);Q(this,b);this.b=this.I-Tf[this.g]},V]; -function Hg(a){t.call(this,"ROM",a,Hg,256);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.w=a.alias;this.C=a.file;this.H=sa(this.C);if(this.C){a=this.C;var b=ta(this.H);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(rb(c.Ua,a,b),(a=Fa(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);$g(c)})}}z(Hg);k=Hg.prototype; -k.Ia=function(a,b,c,d){this.v=b;this.b=c;this.i=d;$g(this)};k.Ka=function(){this.ga&&(this.i&&ah(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ja=function(){return!0}; -function $g(a){if(!xb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)zb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+ra(b));if(57344<=b&&b<57344+oc){var c={};b=(c[b]=[Hg.prototype.Qd,Hg.prototype.Ie,null,null,null,a.f>>1],c);if(Ib(a.v,a,b)){b=a.D=!0;break a}}else if(yc(a.v,b,a.f,gd)){for(c=0;c>>a.ja;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.tb(n++,b[v++]&255);else n&1?a.b.da():null==d&& -(d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&Ic(e.b,e.ma))});this.M=Rc(52,4);this.ia=Hc(this.b,function(){e.g|=128;e.g&64&&Ic(e.b,e.M)});Ib(b,this,gh);Kb(b,this.reset.bind(this));H(this)}; -k.zc=function(){if(!this.I){var a=td(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.ab)return;b=ya(b[1]);if(this.I=tb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Ja=function(a){return a?this.save():!0};k.reset=function(){hh(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return hh(this)};function hh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.ac=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=xa("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), -this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Qc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var ih={},gh=(ih[65392]=[null,null,X.prototype.Kd,X.prototype.Ce,"RCSR"],ih[65394]=[null,null,X.prototype.Jd,X.prototype.Be,"RBUF"],ih[65396]=[null,null,X.prototype.de,X.prototype.We,"XCSR"],ih[65398]=[null,null,X.prototype.ce,X.prototype.Ve,"XBUF"],ih);$a(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= -function(){var a=d.G.listTapes;a&&lh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;lh(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; -k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=mh(a);var e=this;if((this.g=td(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Rc(56,4);this.ca=Hc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.A.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(rb(a.Ua,e,f),(e=Fa(e,f))&&vh(a,b,c,d,e.ea,e.Oa, -e.Na));a.A.eb=!1;a.D&&(a.D--,a.D||H(a));sh(a)})}function ph(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.xa);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.jc?"":e)+"&format=json"));return!!Ea(f, -null,!0,function(b,c,d){Ch(a,b,c,d)})} -function Ch(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ha;if(d)a.controller.P('Unable to load disk "'+a.$a+'" (error '+d+": "+b+")",f);else{rb(a.controller.Ua,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)q(h[0]);else{a.xa=h.length;a.Ca=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Pa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y>2,e=Array(d),f=0;fa.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;rb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+J(a,c[d+e]);a.j(b+(f?"\n":""))}}k.reset=function(){this.f.Ob=128;Jc(this.b,this.f.oc,1E3/60,!0)};k.vd=function(){return this.f.Ob};k.pe=function(a){this.f.Ob=a&192};k.xd=function(){return Uc(this.b)};k.re=function(a){Vc(this.b,a&-129|this.b.Da&128)};k.yd=function(){return Wc(this.b)}; +k.zd=function(){return Xc(this.b)};k.Ad=function(){return this.b.Ta};k.se=function(a){Yc(this.b,a)};k.ae=function(a){a=a>>1&63;var b=this.b.Tb[a>>1];return a&1?b>>16:b&65535};k.Te=function(a,b){b=b>>1&63;var c=b>>1;this.b.Tb[c]=b&1?this.b.Tb[c]&65535|(a&63)<<16:this.b.Tb[c]&-65536|a&65534};k.Ud=function(a){return this.b.O[1][a>>1&7]};k.Me=function(a,b){this.b.O[1][b>>1&7]=a&65295};k.Sd=function(a){return this.b.O[1][(a>>1&7)+8]};k.Ke=function(a,b){this.b.O[1][(b>>1&7)+8]=a&65295}; +k.Td=function(a){return this.b.ha[1][a>>1&7]};k.Le=function(a,b){b=b>>1&7;this.b.ha[1][b]=a;this.b.O[1][b]&=65295};k.Rd=function(a){return this.b.ha[1][(a>>1&7)+8]};k.Je=function(a,b){b=(b>>1&7)+8;this.b.ha[1][b]=a;this.b.O[1][b]&=65295};k.ud=function(a){return this.b.O[0][a>>1&7]};k.oe=function(a,b){b=b>>1&7;this.b.O[0][b]=a&=65295;F(this,256)&&E(this,"writeKIPDR["+b+"]: "+na(a),!0)};k.sd=function(a){return this.b.O[0][(a>>1&7)+8]};k.me=function(a,b){this.b.O[0][(b>>1&7)+8]=a&65295}; +k.td=function(a){return this.b.ha[0][a>>1&7]};k.ne=function(a,b){b=b>>1&7;this.b.ha[0][b]=a;this.b.O[0][b]&=65295};k.rd=function(a){return this.b.ha[0][(a>>1&7)+8]};k.le=function(a,b){b=(b>>1&7)+8;this.b.ha[0][b]=a;this.b.O[0][b]&=65295};k.$d=function(a){return this.b.O[3][a>>1&7]};k.Se=function(a,b){this.b.O[3][b>>1&7]=a&65295};k.Yd=function(a){return this.b.O[3][(a>>1&7)+8]};k.Qe=function(a,b){this.b.O[3][(b>>1&7)+8]=a&65295};k.Zd=function(a){return this.b.ha[3][a>>1&7]}; +k.Re=function(a,b){b=b>>1&7;this.b.ha[3][b]=a;this.b.O[3][b]&=65295};k.Xd=function(a){return this.b.ha[3][(a>>1&7)+8]};k.Pe=function(a,b){b=(b>>1&7)+8;this.b.ha[3][b]=a;this.b.O[3][b]&=65295};k.Cb=function(a){a&=7;return this.b.N&2048?this.b.Za[a]:this.b.u[a]};k.Gb=function(a,b){b&=7;this.b.N&2048?this.b.Za[b]=a:this.b.u[b]=a};k.Fd=function(){return this.b.N&49152?this.b.La[0]:this.b.u[6]};k.xe=function(a){this.b.N&49152?this.b.La[0]=a:this.b.u[6]=a};k.Id=function(){return this.b.u[7]}; +k.Ae=function(a){this.b.u[7]=a};k.Db=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Za[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Za[b]=a};k.Gd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.ye=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Hd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.ze=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.pd=function(a){return this.b.Jc[a-65504>>1]}; +k.je=function(a,b){this.b.Jc[b-65504>>1]=a};k.Gc=function(a){if(65520==a){a=0;switch(Bc){case Bc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Nc=function(){};k.Wd=function(){return 1};k.Oe=function(){};k.od=function(){return this.b.ua};k.ie=function(){this.b.ua=0};k.wd=function(){return this.b.Ic};k.qe=function(a,b){b&1||(a&=255);this.b.Ic=a};k.Bd=function(a,b){return b?0:this.b.Sb};k.te=function(a){Zc(this.b,a)};k.Vd=function(a,b){return b?0:this.b.sb&65280};k.Ne=function(a){this.b.sb=a|255}; +k.Ed=function(){return $c(this.b)};k.we=function(a){ad(this.b,a&-1793|$c(this.b)&1792);this.b.J|=128};k.Mc=function(a,b){F(this)&&E(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; +var M={},Sc=(M[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145],M[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145],M[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145],M[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145],M[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145],M[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145],M[62688]=[null,null,K.prototype.td, +K.prototype.ne,"KIPAR",8,1145],M[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145],M[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145],M[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],M[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145],M[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.$d,K.prototype.Se,"UIPDR",8,1145],M[65424]=[null,null,K.prototype.Yd, +K.prototype.Qe,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145],M[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145],M[65472]=[null,null,K.prototype.Cb,K.prototype.Gb,"R0SET0"],M[65473]=[null,null,K.prototype.Cb,K.prototype.Gb,"R1SET0"],M[65474]=[null,null,K.prototype.Cb,K.prototype.Gb,"R2SET0"],M[65475]=[null,null,K.prototype.Cb,K.prototype.Gb,"R3SET0"],M[65476]=[null,null,K.prototype.Cb,K.prototype.Gb,"R4SET0"],M[65477]=[null,null,K.prototype.Cb,K.prototype.Gb, +"R5SET0"],M[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],M[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],M[65480]=[null,null,K.prototype.Db,K.prototype.Hb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Db,K.prototype.Hb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Db,K.prototype.Hb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Db,K.prototype.Hb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Db,K.prototype.Hb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Db, +K.prototype.Hb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],M[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],M[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,"SYSID",1,1170],M[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],M[65528]= +[null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],M[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],M[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],M[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],M);$a(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),id(this,ed?jd:kd);else{a=this.b=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},T:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Ha(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ +1]&255)<<8},xa: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.Wa=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;pd(c,this.F+a,1,c.M)&&c.da(!0)}return this.lc(a,b)},Ua:function(a,b){if(this.i&&null!=this.F){var c=this.i;pd(c,this.F+a,2,c.M)&&c.da(!0)}return this.mc(a,b)},ab:function(a, +b,c){if(this.i&&null!=this.F){var d=this.i;pd(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.dc(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;pd(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.pc(a,b,c)},M:function(a){return this.G[a]},S:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Ha(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Ha(b,64,2); +a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ja:function(a,b){this.G[a]=b;this.Wa=!0},na:function(a,b,c){this.G[a]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},za:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.D.setUint16(a,b,!0);this.Wa=!0},Ea:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.I[a>>1]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, +b)+")",!0)}};function tc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&od(a,nd,!1),(a.C=c.C)&&md(a,nd,!1))}function qd(a,b){b?--a.C||(a.cc=a.f?a.w:a.dc,a.Vb=a.f?a.H:a.pc):--a.g||(a.$b=a.lc,a.sa=a.mc)}function md(a,b,c){c&&a.C||(a.cc=!a.f&&b[1]||a.w,a.Vb=!a.f&&b[3]||a.H);if(c||void 0===c)a.dc=b[1]||a.w,a.pc=b[3]||a.H}function od(a,b,c){c&&a.g||(a.$b=b[0]||a.K,a.sa=b[2]||a.L);if(c||void 0===c)a.lc=b[0]||a.K,a.mc=b[2]||a.L}function id(a,b){b||(b=rd);od(a,b,void 0);md(a,b,void 0)} +var rd=[],ld=[I.prototype.T,I.prototype.xa,I.prototype.ca,I.prototype.Ma],nd=[I.prototype.P,I.prototype.ab,I.prototype.Ua,I.prototype.Aa];if(Ab)var kd=[I.prototype.M,I.prototype.ja,I.prototype.X,I.prototype.za],jd=[I.prototype.S,I.prototype.na,I.prototype.ba,I.prototype.Ea]; +function sd(a,b){t.call(this,"CPU",a,sd,1);b=a.cycles||b;var c=a.multiplier||1;this.wb=0;this.nb=b;this.gb=c;this.Ib=Math.round(this.nb/1E4)/100;this.qb=this.Ib*this.gb;this.A.W=!1;this.A.bc=!1;this.A.vb=a.autoStart;this.A.xb=!1;this.Pb=this.xa=0;this.Qb=a.csStart;this.zb=a.csInterval;this.Ab=a.csStop;this.K=[];this.Fc=this.ee.bind(this);H(this)}z(sd);var td=["power","reset"];k=sd.prototype; +k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.w=a.w;for(b=0;b=a.xa&&(a.xa+=a.zb,c=!0);0<=a.Ab&&a.Ab<=zd(a)&&(a.zb=a.Ab=-1,wd(a),a.da(),c=!0);c&&a.j(zd(a)+" cycles: checksum="+p(a.Pb))}} +k.va=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.A.ia)a=!0;else{var b=null,c,h=sb(a.id);for(c=0;ca.na/a.qb?b=1:d=!0;a.gb=b;b=a.Ib*a.gb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ub()}ec(a,a.X);a.X=0;a.T=Ba();a.ba=0;Bd(a);return d}function Hc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Jc(a,b,c,d){0<=b&&ba.K[b][0])&&(c=a.nb*a.gb/1E3*c|0,a.A.W&&(c+=Cd(a)),a.K[b][0]=c)} +function Dd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Sb(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Cd(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c} +k.ee=function(){if(this.A.W){this.Jb>=this.nb&&Bd(this,!0);this.Ma=0;this.lb=Ba();if(this.ba){var a=this.lb-this.ba;a>this.Cc&&(this.T+=a,this.T>this.lb&&(this.T=this.lb))}try{do{var b=Dd(this,this.A.xb?1:this.pb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=Cd(this,!0);this.Ma+=b;this.X+=b;fc(this,b);Sb(this,b);this.za-=b;if(0>=this.za){this.za+=this.pb;15<=++this.Dc&&(this.qa(),this.Dc=0);break}}while(this.A.W)}catch(e){this.da();this.C&&this.C.stop(Ba(),zd(this));zb(this,e.stack||e.message); +return}if(this.A.W){a=setTimeout;b=this.Fc;this.ba=Ba();var c=this.Cc;this.Ma&&(c=Math.round(c*this.Ma/this.pb));var c=c-(this.ba-this.lb),d=this.ba-this.T;d&&(this.na=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ja=0,Ad(this)));if(0>c||this.nac&&(this.T-=c),c=0;this.Jb+=this.Ma;this.ba+=c;a(b,c)}}}; +k.jb=function(a){if(yb(this))return!1;if(this.A.W)return this.j(this.toString()+" busy"),!1;Ad(this);this.A.W=!0;this.A.bc=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ub(!0),this.C.start(this.T,zd(this)));setTimeout(this.Fc,0);return!0};k.kb=function(){return 0};k.da=function(a){var b=!1;if(this.A.W){Cd(this);ec(this,this.X);this.X=0;this.A.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),zd(this));b=!0}this.A.complete=a;return b}; +function Ed(a){this.Xa=+a.model||1170;this.Ac=a.addrReset||0;sd.call(this,a,6666667);this.decode=1120==this.Xa?Fd.bind(this):Gd.bind(this);Hd(this);this.M=0;this.P=null;this.A.complete=!1}z(Ed,sd);k=Ed.prototype;k.reset=function(){this.status("model "+this.Xa);this.A.W&&this.da();Hd(this);vd(this);this.A.error=!1;this.parent.reset.call(this)}; +function Hd(a){a.U=65536;a.V=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Ac];a.Za=[0,0,0,0,0,0];a.La=[0,0,0,0];a.B=0;a.mb=0;a.$c=[4,2,0,1];a.O=[[0,0,0,0,0,0,0,0,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.ha=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Tb=[0,0,0,0,0,0,0,0,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.Jc=[0,0,0,0,0,0,0,0];a.Ic=0;a.J=0;a.D=a.H=0;a.g=a.f=a.yb=0;a.Aa=-1;Rb(a)}function Rb(a){a.Da=0;a.Kb=0;a.Mb=0;a.Ta=0;a.ua=0;a.Sb=0;a.sb=255;a.L=0;a.bb=0;a.Ea=262143;a.Nb=0;a.pa=0;a.P=null;a.v&&Id(a)}function Id(a){a.L?(a.S=65536,a.yc=a.Ta&16?4186112:253952,a.aa=a.Yc,a.sa=a.be,a.Vb=a.Ue,vc(a.v,a.Ta&16?22:18)):(a.S=0,a.yc=57344,a.aa=a.Xc,a.sa=a.Hc,a.Vb=a.Oc,vc(a.v,16))}function Uc(a){var b=a.Da;b&57344||(b=b&-3199|a.bb<<5|a.mb<<1);return b} +function Vc(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.Kb=a.pa>>16&65535,a.Mb=a.pa&65535);a.Da=b;a.bb=b>>5&3;a.mb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.L!=c&&(a.L=c,Id(a))}}function Wc(a){a.Da&57344||(a.Kb=a.pa>>16&65535);a=a.Kb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function Xc(a){a.Da&57344||(a.Mb=a.pa&65535);return a.Mb}function Yc(a,b){1170>a.Xa&&(b&=-49);a.Ta!=b&&(a.Ta=b,a.Ea=b&16?4194303:262143,Id(a))}k.vc=function(){return 0}; +k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ja,this.gb]);a.set(2,Ec(this.v));return a.data()};k.restore=function(a){var b=a[1];this.ja=b[1];Ad(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.N>>14&3;a.B!=c&&(a.La[c]=a.u[6],a.u[6]=a.La[a.B]);a.N=b;a.J|=2}function Zc(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1)}a.Sb=b;a.J|=2}function R(a,b){a.J&128||(a.Z=a.$=b,a.V=0)}function le(a,b,c){a.J&128||(a.Z=a.$=a.U=b,a.V=c||0)}function me(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^b)&(d^b))} +function ne(a,b){a.J&128||(a.Z=a.$=a.U=b,a.V=a.Z^a.U>>1)}function oe(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^d)&(d^b))}k.wa=function(a,b,c){if(!this.M){0>this.Aa?this.Aa=$c(this):this.B||(a=4,this.ua|=4,this.u[6]=4,c=-3);this.pa=a;this.B=0;var d=this.sa(a|this.S),e=this.sa(a+2&65535|this.S);ad(this,e&-12289|this.Aa>>2&12288);pe(this,this.Aa);pe(this,this.u[7]);Q(this,d);this.J&=~(b|18);this.J|=9;this.Aa=-1;this.md=a;this.ld=c;if(-3<=c)throw a;}}; +function qe(a){var b=re(a),c=re(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);Q(a,b);ad(a,c);a.J&=-17}function Dc(a,b){var c=b>>13&31;31>c&&(b=a.Ta&32?a.Tb[c]+(b&8190)&4194302:b&-3932161);return b} +function se(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.yc),f;d=b>>13;a.Ta&a.$c[a.B]||(d&=7);e=a.O[a.B][d];f=(a.ha[a.B][d]<<6)+(b&8191)&a.Ea;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.O[a.B][d]=e;if(f!=(4194170&a.Ea)||a.B)a.bb=a.B,a.mb=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.Da&57344|| +(g|=a.bb<<5|a.mb<<1,Vc(a,a.Da&-61695|g),a.wa(168,0,-1))),a.Da&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function te(a,b){return a.v.Lb(b)}function re(a){var b=a.sa(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b}function pe(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.pa=a.pa&65535|(a.pa&-65536)<<8|16121856;ue(a,0,c);a.Vb(c,b)}function ue(a,b,c){!a.B&&c<=a.sb&&(b||4c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.sa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.sa(e)|g;a.b-=8;break;case 6:return e=a.sa(Od(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Od(a,2)),e=e+ +a.u[c]&65535,e=a.sa(e|a.S)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.pa=a.pa&65535|(a.pa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&ue(a,b,a.u[6]);return e}k.Zb=function(a){if(!this.L)return this.v.Zb(a);this.M++;a=te(this,se(this,a,3));this.M--;return a};k.fb=function(a){if(!this.L)return this.v.fb(a);this.M++;a=this.Hc(se(this,a,2));this.M--;return a};k.tb=function(a,b){this.L?(this.M++,a=se(this,a,5),a&1&&this.b--,this.v.Eb(a,b),this.M--):this.v.tb(a,b)}; +k.Fb=function(a,b){this.L?(this.M++,this.Oc(se(this,a,4),b),this.M--):this.v.Fb(a,b)};k.Xc=function(a,b,c){return ve(this,a,b,c)};k.Yc=function(a,b,c){return se(this,ve(this,a,b,c),c)};k.Hc=function(a){return this.v.oa(this.Nb=a)};k.be=function(a){return this.v.oa(this.Nb=se(this,a,2))};k.Oc=function(a,b){this.v.ib(this.Nb=a,b&65535)};k.Ue=function(a,b){this.v.ib(this.Nb=se(this,a,4),b)}; +function we(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ve(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.sa(d|c&a.S),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.La[a.N>>12&3];return c}function xe(a,b,c,d){a.pa=a.pa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ve(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=se(a,e|c&65536,4),a.B=a.N>>14&3,a.v.ib(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.La[a.N>>12&3]=d} +function ye(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?te(a,a.aa(b,c,3)):-c-1}function ze(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.oa(a.aa(b,d,2)):c=-d-1;return c}function Ae(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ve(a,b,c,8)}function Be(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?te(a,a.aa(b,c,3)):a.u[c]&255}function Ce(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.oa(a.aa(b,c,2)):a.u[c]} +function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.yb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,te(a,e)),e&1&&a.b--,a.v.Eb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.ib(e,d.call(a,0>c?a.u[-c-1]:c,a.v.oa(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} +function De(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Eb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function Ee(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.ib(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function U(a,b,c){c&&(Q(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.kb=function(a){this.A.complete=!0;var b=this.i?Fe(this.i)?1:this.A.bc?-1:0:0,c=a?this.A.bc?0:1:-1;this.A.bc=!1;this.ca=this.b=a;do{if(b){if(Ge(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&7)if(a=!1,this.J&2){this.J&=-3;var d=160,e=(this.Sb&224)>>5,f=this.P&&this.P.Bb>e?this.P:null;f&&(d=f.ge,e=f.Bb);e>(this.N&224)>>5?(this.J&4&&(Od(this,2),this.J&=-5),this.wa(d,0,-9),e=!0):e=!1;e&&(f&&Pd(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&Ge(this.i,this.u[7],c)){this.da(); +break}if(0>c)break}if(this.J&112&&ke(this)){if(b&&Ge(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Nd(this))}while(0>1|b<<16;ne(this,a);return a&65535}function Me(a,b){a=b&128|b>>1|b<<8;ne(this,a<<8);return a&255}function Ne(a,b){a=b&~a;R(this,a);return a}function Oe(a,b){a=b&~a;R(this,a<<8);return a}function Pe(a,b){a|=b;R(this,a);return a}function Qe(a,b){a|=b;R(this,a<<8);return a}function Re(a,b){a=~b|65536;le(this,a);return a&65535} +function Se(a,b){a=~b|256;le(this,a<<8);return a&255}function Te(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.V=b&(b^a));return a&65535}function Ue(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.V=b&(b^c));return a&255}function Ve(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.V=a&(b^a));return a&65535}function We(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.V=c&(b<<8^c));return a&255}function Xe(a,b){a=-b;le(this,a,a&b&32768);return a&65535} +function Ye(a,b){a=-b;le(this,a<<8,(a&b&128)<<8);return a&255}function Ze(a,b){a=b<<1|this.U>>16&1;ne(this,a);return a&65535}function $e(a,b){a=b<<1|this.U>>16&1;ne(this,a<<8);return a&255}function af(a,b){a=(this.U&65536|b)>>1|b<<16;ne(this,a);return a&65535}function bf(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;ne(this,a<<8);return a&255}function cf(a,b){var c=b-a;oe(this,c,a,b);return c&65535}function df(a,b){var c=b-a;oe(this,c<<8,a<<8,b<<8);return c&255} +function ef(a,b){this.J&128||(this.Z=this.$=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function ff(a,b){a^=b;R(this,a);return a&65535}function gf(a){T(this,a,ze(this,a),He);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function hf(a){var b=Ce(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.Z=this.$=c;this.b-=(this.g?6:7)+b} +function jf(a){var b=Ce(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=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.Z=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function kf(a){U(this,a,!Jd(this))}function lf(a){U(this,a,Jd(this))} +function mf(a){T(this,a,ze(this,a),Ne);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function nf(a){S(this,a,ye(this,a),Oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function of(a){T(this,a,ze(this,a),Pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function pf(a){S(this,a,ye(this,a),Qe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function qf(a){var b=ze(this,a);a=Ce(this,a);R(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function rf(a){var b=ye(this,a);a=Be(this,a);R(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function sf(a){U(this,a,Ld(this))}function tf(a){U(this,a,!Md(this)==!Kd(this))}function uf(a){U(this,a,!Ld(this)&&!Md(this)==!Kd(this))}function vf(a){U(this,a,!Jd(this)&&!Ld(this))} +function wf(a){U(this,a,Ld(this)||!Md(this)!=!Kd(this))}function xf(a){U(this,a,Jd(this)||Ld(this))}function yf(a){U(this,a,!Md(this)!=!Kd(this))}function zf(a){U(this,a,Md(this))}function Af(a){U(this,a,!Ld(this))}function Bf(a){U(this,a,!Md(this))}function Cf(){this.wa(12,0,-8);this.b-=5}function Df(a){U(this,a,!0)}function Ef(a){U(this,a,!Kd(this))}function Ff(a){U(this,a,Kd(this))}function V(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5} +function Gf(a){var b=ze(this,a);a=Ce(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;oe(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Hf(a){var b=ye(this,a);a=Be(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);oe(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} +function If(a){var b=Ce(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.Z=d>>16):(this.V=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.V=32768,this.U=65536,this.b-=7}function Jf(){this.wa(24,0,-8);this.b-=25} +function Kf(){this.N&49152?(this.ua|=128,this.wa(4,0,-7)):(this.w&&1120==this.Xa&&this.w.setData(this.u[0],!0),this.i?Lf(this.i):this.da());this.b-=7}function Mf(){this.wa(16,0,-8);this.b-=25}var Nf=[0,7,7,10,7,11,9,13];function Of(a){this.I=this.b;Q(this,Ae(this,a));this.b=this.I-Nf[this.g]}var Pf=[0,14,14,17,14,18,16,20];function Qf(a){this.I=this.b;var b=Ae(this,a);a=a>>6&7;pe(this,this.u[a]);this.u[a]=this.u[7];Q(this,b);this.b=this.I-Pf[this.g]} +var Rf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Sf(a){var b=ze(this,a);this.I=this.b;R(this,Ee(this,a,b));this.b=this.I-Rf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Tf(a){var b=ye(this,a);R(this,De(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Uf=[7,13,13,17,14,18,17,21]; +function Vf(a){var b=Ce(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&128||(this.Z=b>>16,this.$=this.Z|b,this.V=0,this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)Q(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function bg(a){T(this,a,ze(this,a),cf);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function cg(a){T(this,a,0,ef);this.b-=this.g?9:3+(7==this.f?2:0)}function dg(){this.wa(28,0,-8);this.b-=5} +function eg(){this.w&&(this.w.nc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=4;Od(this,-2);this.b-=3}function fg(a){T(this,a,this.u[a>>6&7],ff);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Lf(b)):b=!1;b||this.wa(8,0,-8)}function Fd(a){gg[a>>12].call(this,a)}function hg(a){ig[a>>6&3].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a>>6&3].call(this,a)}function ng(a){og[a&15].call(this,a)} +function pg(a){qg[a&15].call(this,a)}function rg(a){sg[a>>6&3].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)}function vg(a){wg[a>>6&3].call(this,a)} +var gg=[function(a){xg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,gf,W,function(a){yg[a>>8&15].call(this,a)},Tf,Hf,rf,nf,pf,bg,W],xg=[function(a){zg[a>>4&15].call(this,a)},Df,Af,sf,tf,yf,uf,wf,Qf,Qf,hg,jg,lg,W,W,W],ig=[function(a){le(this,Ee(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Te);this.b-=this.g?9:3+(7==this.f?2:0)}],kg=[function(a){T(this,a,0, +Xe);this.b-=this.g?11:6},function(a){T(this,a,Jd(this)?1:0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,Jd(this)?1:0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ce(this,a);le(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],mg=[function(a){T(this,a,0,af);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)}], +zg=[function(a){Ag[a&15].call(this,a)},W,W,W,Of,Of,Of,Of,Yf,W,ng,pg,cg,cg,cg,cg],Ag=[Kf,eg,Zf,Cf,Mf,Xf,W,W,W,W,W,W,W,W,W,W],og=[Wf,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},V,function(){this.$=1;this.b-=5},V,V,V,function(){this.Z=0;this.b-=5},V,V,V,V,V,V,V],qg=[Wf,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},$f,function(){this.$=0;this.b-=5},$f,$f,$f,function(){this.Z=32768;this.b-=5},$f,$f,$f,$f,$f,$f,$f],yg=[Bf,zf,vf,xf,Ef,Ff,kf,lf,Jf,dg,rg,tg,vg,W,W, +W],sg=[function(a){le(this,De(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ue);this.b-=this.g?9:3+(7==this.f?2:0)}],ug=[function(a){S(this,a,0,Ye);this.b-=this.g?11:6},function(a){S(this,a,Jd(this)?1:0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Jd(this)?1:0,df);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Be(this,a);le(this, +a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],wg=[function(a){S(this,a,0,bf);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Me);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)}];function Gd(a){Bg[a>>12].call(this,a)} +var Bg=[function(a){Cg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,gf,function(a){Dg[a>>8&15].call(this,a)},function(a){Eg[a>>8&15].call(this,a)},Tf,Hf,rf,nf,pf,bg,W],Cg=[function(a){Fg[a>>4&15].call(this,a)},Df,Af,sf,tf,yf,uf,wf,Qf,Qf,hg,jg,lg,function(a){Gg[a>>6&3].call(this,a)},W,W],Gg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.sa(a|this.S);Q(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=we(this,a,0);pe(this,a);R(this,a);this.b-=11},function(a){var b=re(this);this.I= +this.b;xe(this,a,0,b);R(this,b);this.b=this.I-Uf[this.g]},function(a){R(this,Ee(this,a,Md(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Fg=[function(a){Hg[a&15].call(this,a)},W,W,W,Of,Of,Of,Of,Yf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):W.call(this,a)},ng,pg,cg,cg,cg,cg],Hg=[Kf,eg,function(){qe(this);this.J|=this.N&16;this.b-=13},Cf,Mf,Xf,Zf,function(){this.wa(8,0,-8)},W,W,W,W,W,W,W,W],Dg=[Vf,Vf,If,If,hf,hf,jf,jf,fg,fg,W,W,W,W,ag,ag],Eg=[Bf,zf,vf,xf, +Ef,Ff,kf,lf,Jf,dg,rg,tg,vg,function(a){Ig[a>>6&3].call(this,a)},W,W],Ig=[W,function(a){a=we(this,a,65536);pe(this,a);R(this,a);this.b-=11},function(a){var b=re(this);this.I=this.b;xe(this,a,65536,b);R(this,b);this.b=this.I-Uf[this.g]},W]; +function Jg(a){t.call(this,"ROM",a,Jg,512);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.w=a.alias;this.C=a.file;this.H=sa(this.C);if(this.C){a=this.C;var b=ta(this.H);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.R("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(rb(c.Ua,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);bh(c)})}}z(Jg);k=Jg.prototype; +k.Ia=function(a,b,c,d){this.v=b;this.b=c;this.i=d;bh(this)};k.Ka=function(){this.ga&&(this.i&&ch(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ja=function(){return!0}; +function bh(a){if(!xb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)zb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+oc){var c={};b=(c[b]=[Jg.prototype.Qd,Jg.prototype.Ie,null,null,null,a.f>>1],c);if(Ib(a.v,a,b)){b=a.D=!0;break a}}else if(yc(a.v,b,a.f,hd)){for(c=0;c>>a.ka;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.tb(n++,b[v++]&255);else n&1?a.b.da():null==d&& +(d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&Ic(e.b,e.na))});this.M=Rc(52,4);this.ja=Hc(this.b,function(){e.g|=128;e.g&64&&Ic(e.b,e.M)});Ib(b,this,ih);Kb(b,this.reset.bind(this));H(this)}; +k.zc=function(){if(!this.I){var a=ud(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.ab)return;b=ya(b[1]);if(this.I=tb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.Ja=function(a){return a?this.save():!0};k.reset=function(){jh(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return jh(this)};function jh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.ac=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":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=xa("",c)));this.S&&!this.H&&c&&(b=String.fromCharCode(this.S)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), +this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Jc(this.b,this.ja,1E3/Math.round(this.ca/10))}};var kh={},ih=(kh[65392]=[null,null,X.prototype.Kd,X.prototype.Ce,"RCSR"],kh[65394]=[null,null,X.prototype.Jd,X.prototype.Be,"RBUF"],kh[65396]=[null,null,X.prototype.de,X.prototype.We,"XCSR"],kh[65398]=[null,null,X.prototype.ce,X.prototype.Ve,"XBUF"],kh);$a(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= +function(){var a=d.G.listTapes;a&&nh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;nh(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; +k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.T=oh(a);var e=this;if((this.g=ud(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Rc(56,4);this.ca=Hc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.A.ia;g?a.R('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(rb(a.Ua,e,f),(e=Ea(e,f))&&xh(a,b,c,d,e.ea,e.Oa, +e.Na));a.A.eb=!1;a.D&&(a.D--,a.D||H(a));uh(a)})}function rh(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ya);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.jc?"":e)+"&format=json"));return!!Da(f, +null,!0,function(b,c,d){Eh(a,b,c,d)})} +function Eh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ia;if(d)a.controller.R('Unable to load disk "'+a.$a+'" (error '+d+": "+b+")",f);else{rb(a.controller.Ua,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ya=h.length;a.Ca=h[0].length;a.ra=h[0][0].length;var l=h[0][0][0];a.Pa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Fa?f=a.Sa+a.Fa&&(a.Fa+=f-(a.Sa+a.Fa)+1):(a.Sa=f,a.Fa=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.P("Unable to restore disk '"+this.$a+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=Eh(this,a++);)Gh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Gh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,4194304);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Sa("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype; -k.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Hh(d,a)},!0;case "loadDrive":return this.G[b]= -c,c.onclick=function(){var a=d.G.listDisks;a&&Ih(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[ma(a.value,10)||0])if(a=a.Ga){var b;b="";for(var c=0,h;h=Eh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Hh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Jh(this)};k.save=function(){return(new N(this)).data()}; -k.restore=function(a){return Jh(this,a[0])};function Mh(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Oh(a,e,b,c,!1,d)}else Nh(a,e)} -function Oh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,Nh(a,b,!0),h.ic?a.P("RL11 busy"):(h.ic=!0,e&&(h.hc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Wb=!!f,Bh(new xh(a,h,"preload"),c,d,f,a.Wc)&&g++));return g} -k.Wc=function(a,b,c,d,e){var f;a.ic=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.xa||f[1]>a.Ca)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.kc)),b=null);b?(a.Ga=b,a.$a=c,a.hb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.kc),a.hc||e),this.C&&this.C.ub()):a.Wb=!1;a.hc&&(a.hc=!1,--this.H||H(this));Hh(this,a.kc)}; -function Lh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;eg)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.R("Unable to restore disk '"+this.$a+": "+c);return b}; +k.toJSON=function(){var a;a=0;for(var b;b=Gh(this,a++);)Ih(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function Ih(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){t.call(this,"RL11",a,N,4194304);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Na("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype; +k.va=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Jh(d,a)},!0;case "loadDrive":return this.G[b]= +c,c.onclick=function(){var a=d.G.listDisks;a&&Kh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[ma(a.value,10)||0])if(a=a.Ga){var b;b="";for(var c=0,h;h=Gh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Jh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Lh(this)};k.save=function(){return(new O(this)).data()}; +k.restore=function(a){return Lh(this,a[0])};function Oh(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.R("Unable to load the selected drive");else if(c)if("?"==c)a.R('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Qh(a,e,b,c,!1,d)}else Ph(a,e)} +function Qh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,Ph(a,b,!0),h.ic?a.R("RL11 busy"):(h.ic=!0,e&&(h.hc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Wb=!!f,Dh(new zh(a,h,"preload"),c,d,f,a.Wc)&&g++));return g} +k.Wc=function(a,b,c,d,e){var f;a.ic=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ya||f[1]>a.Ca)&&(this.R('Disk "'+c+'" too large for drive '+("RL"+a.kc)),b=null);b?(a.Ga=b,a.$a=c,a.hb=d,this.R('Mounted disk "'+c+'" in drive '+("RL"+a.kc),a.hc||e),this.C&&this.C.ub()):a.Wb=!1;a.hc&&(a.hc=!1,--this.H||H(this));Jh(this,a.kc)}; +function Nh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; -k.qd=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ga.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ga.read(m,n++))||0>(r=a.Ga.read(m,n++))){h=5120;break}this.v.ib(f,v|r<<8);if(Gc(this.v)){h=8192;break}f+=2;if(n>=l.Pa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Ca&&(c=0,++b>=l.xa)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.ke=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Gc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ga.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ga.write(m,n++,v&255)||!a.Ga.write(m,n++,v>>8)){h=5120;break}if(n>=l.Pa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Ca&&(c=0,++b>=l.xa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Nd=function(){return this.fa&65535}; -k.Fe=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.qd;case 10:b||(b=this.ke),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.xa||f>=c.qa?this.fa|=37888: -(g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Uc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Ic(this.b,this.O))}};k.Ld=function(){return this.I};k.De=function(a){this.I=a&65534};k.Od=function(){return this.g};k.Ge=function(a){this.g=a};k.Pd=function(){return this.D};k.He=function(a){this.D=a};k.Md=function(){return this.K};k.Ee=function(a){this.K=a&63}; -var Ph={},Kh=(Ph[63744]=[null,null,M.prototype.Nd,M.prototype.Fe,"RLCS"],Ph[63746]=[null,null,M.prototype.Ld,M.prototype.De,"RLBA"],Ph[63748]=[null,null,M.prototype.Od,M.prototype.Ge,"RLDA"],Ph[63750]=[null,null,M.prototype.Pd,M.prototype.He,"RLMP"],Ph[63752]=[null,null,M.prototype.Md,M.prototype.Ee,"RLBE"],Ph);function Qh(a){t.call(this,"Debugger",a,Qh);this.ca=a.base||16;this.Ea=!1;this.K=0;this.R=!1;this.B=-1;this.g=[];this.X={}}z(Qh); -var Rh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Qh.prototype.wc=function(){return-1};Qh.prototype.xc=function(){}; -function Sh(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.R?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a} -function Th(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; +k.qd=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ga.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ga.read(m,n++))||0>(r=a.Ga.read(m,n++))){h=5120;break}this.v.ib(f,v|r<<8);if(Gc(this.v)){h=8192;break}f+=2;if(n>=l.Pa&&(m=null,++d>=l.ra&&(d=0,++c>=l.Ca&&(c=0,++b>=l.ya)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.ke=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.oa(f);if(Gc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ga.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ga.write(m,n++,v&255)||!a.Ga.write(m,n++,v>>8)){h=5120;break}if(n>=l.Pa&&(m=null,++d>=l.ra&&(d=0,++c>=l.Ca&&(c=0,++b>=l.ya)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Nd=function(){return this.fa&65535}; +k.Fe=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.qd;case 10:b||(b=this.ke),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ya||f>=c.ra?this.fa|=37888: +(g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Uc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Ic(this.b,this.P))}};k.Ld=function(){return this.I};k.De=function(a){this.I=a&65534};k.Od=function(){return this.g};k.Ge=function(a){this.g=a};k.Pd=function(){return this.D};k.He=function(a){this.D=a};k.Md=function(){return this.K};k.Ee=function(a){this.K=a&63}; +var Rh={},Mh=(Rh[63744]=[null,null,N.prototype.Nd,N.prototype.Fe,"RLCS"],Rh[63746]=[null,null,N.prototype.Ld,N.prototype.De,"RLBA"],Rh[63748]=[null,null,N.prototype.Od,N.prototype.Ge,"RLDA"],Rh[63750]=[null,null,N.prototype.Pd,N.prototype.He,"RLMP"],Rh[63752]=[null,null,N.prototype.Md,N.prototype.Ee,"RLBE"],Rh);function Sh(a){t.call(this,"Debugger",a,Sh);this.ca=a.base||16;this.Ea=!1;this.K=0;this.S=!1;this.B=-1;this.g=[];this.X={}}z(Sh); +var Th={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Sh.prototype.wc=function(){return-1};Sh.prototype.xc=function(){}; +function Uh(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.S?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a} +function Vh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function Uh(a,b,c){var d;if(b){b=Vh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Yh(a,b){if(b)return Xh(a,b,a.X[b]);var c=0;for(b in a.X)Xh(a,b,a.X[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function $h(a,b){if(b)return Zh(a,b,a.X[b]);var c=0;for(b in a.X)Zh(a,b,a.X[b]),c++;return 0this.b.Xa?hi:[];ii(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ji(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Cc[c],n&&d.j(p(n.id,8)+" %"+ -p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -k.xc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.Za[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=Zc(this.b);break;case 21:b=c.Sb;break;case 22:b=c.ta;break;case 23:b=c.sb;break;case 24:b=Tc(d);break;case 25:b=Vc(d);break;case 26:b=Wc(d);break;case 27:b=d.Ta;break;case 28:d&&(b=d.sa);break;case 29:d&&(b=d.rb);break;case 30:d&&lc(d)&&(b=d.Ya)}}return b}; -k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.oa&65535).F));if(this.ka&1073741824)this.ya.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ka&-2147483648&&this.b&&this.b.A.W||wb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,Bd(a),a.ya=0,a.pa())}}; -function ai(a){var b;if(!Ee(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Bb[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?qi(a):ri(a)}}function pi(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Ja=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ai(this);this.za=0;this.ia=null;this.K=0;this.L=Y(this.b.u[7]);this.A.W=!1;si(this);a||wd(this)};k.save=function(){var a=new N(this);a.set(0,li(this.L));a.set(1,li(this.O));a.set(2,[this.g,this.R,this.ka]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=mi(a[b++]),this.O=mi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ka|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.A.W=!0;this.Jb=a;this.Kb=b}; -k.stop=function(a,b){if(this.A.W){this.A.W=!1;this.K=b-this.Kb;if(!this.S){b="stopped";if(this.K){a-=this.Jb;var c=0d&&(d=a.b.fb(b)),65535!=(d&65535)&&(a.nc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Kf(a){var b=a.b;if(b.A.W)throw O(b,a.b.oa&65535),a.da(),-1;return!1} -function $h(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.ja],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ja],!0);a.D=["bw"];a.nb=0}k.ob=function(a,b,c){var d=!0;c||ti(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].ob(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Ra=!0:(ui(this,a,a.length-1,"set"),ai(this)));return d}; -function ti(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.ja],b==a.D));h.Ra||ai(a);break}}return f}function vi(a,b){for(var c=1;c>23)&65535,x=J(w,r);else if(8192==C)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==C)x=J(w,f&7,1);else if(24576==C)x=J(w,f&63,1);else if(32768==C)x=J(w,f&255,1);else if(C=f&y,y&4032&&(C>>=6,y>>=6), -y&63)switch(y=C&7,C&56){case 0:x=oi(y);break;case 8:x="@"+oi(y);break;case 16:7>y?x="("+oi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+oi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+oi(y)+")";break;case 40:x="@-("+oi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+oi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+oi(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); -0b)c=oi(b),c+="="+J(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+J(a,d.Za[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+J(a,d.La[b-16]);else switch(b){case 20:c="PS="+J(a,Zc(d));break;case 21:c="IR="+J(a,d.Sb);break;case 22:c="ER="+J(a,d.ta);break;case 23:c="SL="+J(a,d.sb);break;case 24:c="MMR0="+J(a,Tc(d));break;case 25:c="MMR1="+J(a,Vc(d));break;case 26:c="MMR2="+J(a,Wc(d));break;case 27:c="MMR3="+J(a,d.Ta);break;case 28:a.w&&(c="AR="+J(a,a.w.sa,3));break;case 29:a.w&& -(c="DR="+J(a,a.w.rb));break;case 30:a.w&&lc(a.w)&&(c="SR="+J(a,a.w.Ya,3))}c&&(c+=" ");return c}function zi(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=yi(a,"T")+yi(a,"N")+yi(a,"Z")+yi(a,"V")+yi(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.sc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],v=Aa(n,l,a.sc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({bf:b,F:c,Zc:d,ga:e,qc:f})}function Ai(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.Zc;if(e>=g&&eb)){e.u[b]= -g&65535;break}a.j("unknown register: "+f);return}a.C.pa();a.j("updated registers:")}}a.j(zi(a,d));c&&(a.L=Y(e.u[7]),ri(a,J(a,a.L.F)))}}function Ei(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=xi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} -function wi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(xb(a)&&0n||"z"oa.length&&(a.j("note: only "+oa.length+" available"),aa=oa.length);ga-=aa;0>ga&&(null==oa[oa.length-1].F?(aa=ga+aa,ga=0):ga+=oa.length);var Rd=[];"call"==Ng&&(Sb=1E5,Rd=["CALL"]);for(void 0!==Mg&&a.j(aa+" instructions earlier:");0=oa.length&&(ga=0);a.pb=aa;Pg++;Sb--}}Pg||(a.j("no "+Og+"history available"),a.pb=void 0)}else{var mb=ji(a,na);if(mb){var Ub=0,Sd=!1,Td="ds"==Na;Oa&&(Sd=!0,"l"==Oa.charAt(0)&&(Sd=!1,Oa=Oa.substr(1)||Yi),Ub=Wh(a,Oa)>>>0,65536Wd?String.fromCharCode(Wd):"."),Lc=Lc>>8}Pa&&(Pa+="\n");Pa=Td?Pa+(Qa+","):Pa+(na+" "+Qa+(0==Kc?" "+Vd:""))}Pa&&a.j(Pa);a.mb=mb}}}}break;case "e":if("else"==g[0])break;var pb,Xd,Yd,Zd,$d=g[0],ae=g[1];"eb"==$d?(pb=1,Xd=255,Yd=a.Lb,Zd=a.Eb):"e"==$d||"ew"==$d?(pb=2,Xd=65535,Yd=a.na,Zd=a.ib):ae=null;if(null==ae)a.j("edit memory commands:"), -a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Mc=ji(a,ae);if(Mc)for(var Nc=2;Ncde;){for(var Ra=null,cj=256;65536> -Zb.F>>>0;){ee.F=a.na(Zb,2);if(null==Zb.F||!cj--)break;if(!(ee.F&1)){for(var dj=a,Oc=ee,Tg=null,$b=Oc.F,Ug=$b,fe=1;6>=fe&&$b;fe++){if(2\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bJi){if(Li(d,this.I)){this.B=new N(this,"1.30.3","failsafe");Li(this.B)&&(Qi(this,d),a=2,Ri(this.B));this.B.set("timestamp",Ca());Si(this.B);var e=this.f&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Pi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Li(d,g):("error"== -f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Ma("user",""),this.g=null)):this.j(f+": "+g),Ri(d),Li(d)?(c=Pi(d),e=!0):c=!1))}e&&Oi(this,c?d:null)}else 2==a&&d.clear()}else Oi(this);delete this.I;delete this.K}e=sb(this.id);for(f=0;fa[1];a=a[2];this.ca=!0;this.A.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ti(this,this.b,b,c,a),this.pa(),this.b.vb());this.O&&(Qi(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0}; -function Qi(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} -function Gi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.da(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ha=!1,!1===d&&(e=null)));for(var h=sb(a.id),l=0;l=c||30<=(b.wb+=c))&&(d.textContent=b.A.W?b.ma.toFixed(2)+"Mhz":"Stopped",b.wb=0)}if(this.w&&(b=this.w,a=a||0,b.D)){c=b.b.A.W;d=!!(b.b.J&4);if(0>=a||60<=(b.B+=a)){for(var e=0;ethis.b.Xa?ji:[];Tc(this,64,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ki(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Cc[c],n&&d.j(p(n.id,8)+" %"+ +p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +k.xc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.Za[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=$c(this.b);break;case 21:b=c.Sb;break;case 22:b=c.ua;break;case 23:b=c.sb;break;case 24:b=Uc(c);break;case 25:b=Wc(c);break;case 26:b=Xc(c);break;case 27:b=c.Ta;break;case 28:d&&(b=d.ta);break;case 29:d&&(b=d.rb);break;case 30:d&&lc(d)&&(b=d.Ya)}}return b}; +k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.pa&65535).F));if(this.la&1073741824)this.za.push(a);else if(!this.ja||a!=this.ja){this.ja=a;if(this.la&-2147483648&&this.b&&this.b.A.W||wb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,Cd(a),a.za=0,a.qa())}}; +function ci(a){var b;if(!Fe(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Bb[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.T?ri(a):si(a)}}function qi(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Ja=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ci(this);this.Aa=0;this.ja=null;this.K=0;this.L=Y(this.b.u[7]);this.A.W=!1;ti(this);a||xd(this)};k.save=function(){var a=new O(this);a.set(0,mi(this.L));a.set(1,mi(this.P));a.set(2,[this.g,this.S,this.la]);a.set(3,this.I);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=ni(a[b++]),this.P=ni(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.S=a[b][1],this.la|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.T||this.j("running");this.A.W=!0;this.Jb=a;this.Kb=b}; +k.stop=function(a,b){if(this.A.W){this.A.W=!1;this.K=b-this.Kb;if(!this.T){b="stopped";if(this.K){a-=this.Jb;var c=0d&&(d=a.b.fb(b)),65535!=(d&65535)&&(a.nc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Lf(a){var b=a.b;if(b.A.W)throw Q(b,a.b.pa&65535),a.da(),-1;return!1} +function bi(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.ka],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ka],!0);a.D=["bw"];a.nb=0}k.ob=function(a,b,c){var d=!0;c||ui(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ka].ob(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Ra=!0:(vi(this,a,a.length-1,"set"),ci(this)));return d}; +function ui(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.ka],b==a.D));h.Ra||ci(a);break}}return f}function wi(a,b){for(var c=1;c>23)&65535,x=J(w,r);else if(8192==C)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==C)x=J(w,f&7,1);else if(24576==C)x=J(w,f&63,1);else if(32768==C)x=J(w,f&255,1);else if(C=f&y,y&4032&&(C>>=6,y>>=6), +y&63)switch(y=C&7,C&56){case 0:x=pi(y);break;case 8:x="@"+pi(y);break;case 16:7>y?x="("+pi(y)+")+":(C=w.oa(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+pi(y)+")+":(C=w.oa(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+pi(y)+")";break;case 40:x="@-("+pi(y)+")";break;case 48:C=w.oa(r,2);x=J(w,C,0,!0)+"("+pi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.oa(r,2),x="@"+J(w,C)+"("+pi(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); +0b)c=pi(b),c+="="+J(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+J(a,d.Za[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+J(a,d.La[b-16]);else switch(b){case 20:c="PS="+J(a,$c(d));break;case 21:c="IR="+J(a,d.Sb);break;case 22:c="ER="+J(a,d.ua);break;case 23:c="SL="+J(a,d.sb);break;case 24:c="MMR0="+J(a,Uc(d));break;case 25:c="MMR1="+J(a,Wc(d));break;case 26:c="MMR2="+J(a,Xc(d));break;case 27:c="MMR3="+J(a,d.Ta);break;case 28:a.w&&(c="AR="+J(a,a.w.ta,3));break;case 29:a.w&& +(c="DR="+J(a,a.w.rb));break;case 30:a.w&&lc(a.w)&&(c="SR="+J(a,a.w.Ya,3))}c&&(c+=" ");return c}function Ai(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=zi(a,"T")+zi(a,"N")+zi(a,"Z")+zi(a,"V")+zi(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.sc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],v=Aa(n,l,a.sc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({bf:b,F:c,Zc:d,ga:e,qc:f})}function Bi(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.Zc;if(e>=g&&eb)){e.u[b]= +g&65535;break}a.j("unknown register: "+f);return}a.C.qa();a.j("updated registers:")}}a.j(Ai(a,d));c&&(a.L=Y(e.u[7]),si(a,J(a,a.L.F)))}}function Fi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=yi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} +function xi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.S&&(a.j("ended assemble at "+J(a,a.P.F)),a.L=a.P,a.S=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ja=null;if(xb(a)&&0n||"z"pa.length&&(a.j("note: only "+pa.length+" available"),ba=pa.length);ha-=ba;0>ha&&(null==pa[pa.length-1].F?(ba=ha+ba,ha=0):ha+=pa.length);var Sd=[];"call"==Pg&&(Tb=1E5,Sd=["CALL"]);for(void 0!==Og&&a.j(ba+" instructions earlier:");0=pa.length&&(ha=0);a.pb=ba;Rg++;Tb--}}Rg||(a.j("no "+Qg+"history available"),a.pb=void 0)}else{var nb=ki(a,oa);if(nb){var Vb=0,Td=!1,Ud="ds"==Oa;Pa&&(Td=!0,"l"==Pa.charAt(0)&&(Td=!1,Pa=Pa.substr(1)||Zi),Vb=Yh(a,Pa)>>>0,65536Xd?String.fromCharCode(Xd):"."),Mc=Mc>>8}Qa&&(Qa+="\n");Qa=Ud?Qa+(Ra+","):Qa+(oa+" "+Ra+(0==Lc?" "+Wd:""))}Qa&&a.j(Qa);a.mb=nb}}}}break;case "e":if("else"==g[0])break;var qb,Yd,Zd,$d,ae=g[0],be=g[1];"eb"==ae?(qb=1,Yd=255,Zd=a.Lb,$d=a.Eb):"e"==ae||"ew"==ae?(qb=2,Yd=65535,Zd=a.oa,$d=a.ib):be=null;if(null==be)a.j("edit memory commands:"), +a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Nc=ki(a,be);if(Nc)for(var Oc=2;Ocee;){for(var Sa=null,dj=256;65536> +$b.F>>>0;){fe.F=a.oa($b,2);if(null==$b.F||!dj--)break;if(!(fe.F&1)){for(var ej=a,Pc=fe,Vg=null,ac=Pc.F,Wg=ac,ge=1;6>=ge&∾ge++){if(2\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bKi){if(Mi(d,this.I)){this.B=new O(this,"1.30.3","failsafe");Mi(this.B)&&(Ri(this,d),a=2,Si(this.B));this.B.set("timestamp",Ca());Ti(this.B);var e=this.f&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Qi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Mi(d,g):("error"== +f&&"no machine state"!=g?(this.R("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.j(f+": "+g),Si(d),Mi(d)?(c=Qi(d),e=!0):c=!1))}e&&Pi(this,c?d:null)}else 2==a&&d.clear()}else Pi(this);delete this.I;delete this.K}e=sb(this.id);for(f=0;fa[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ui(this,this.b,b,c,a),this.qa(),this.b.vb());this.P&&(Ri(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0}; +function Ri(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} +function Hi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.da(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=sb(a.id),l=0;l=c||30<=(b.wb+=c))&&(d.textContent=b.A.W?b.na.toFixed(2)+"Mhz":"Stopped",b.wb=0)}if(this.w&&(b=this.w,a=a||0,b.D)){c=b.b.A.W;d=!!(b.b.J&4);if(0>=a||60<=(b.B+=a)){for(var e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);jj(a,b,c)}})}else c(a,null)} -function kj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Xi||bb(!0));l=!1}var g,h,l=!0;Xi++;qb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c|| -(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?hj(c,null,null,!1,e,function(d,l){l?(rb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Xi||bb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Xi||bb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?hj(b,a,d,!0,e,m):ij(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){bb(!1);return kj(a,b,c,d)};window.enableEvents=bb;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map +k.va=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.A.ia?Hi(d,!1,!0):Oi(d,d.Rb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ia&&!d.C)if(d.f&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Hi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.uc=!0),d.Rb(Ki),d.uc=!1)}else d.reset(),d.b&&d.b.vb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]= +c,c.onclick=function(){var a=Li(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=Hi(d,b);b?Vi(d,a,c):d.R("Resume disabled, machine state not saved")}},!0}return!1}; +function Li(a,b){var c=a.g;c||((c=Ka("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Wi(a,c))||a.R("The user ID is invalid.")):b&&a.R("Browser local storage is not available"));return c} +function Wi(a,b){a.g=null;b=Da(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Ni(a){var b=null;a.g&&(b=Ga()+"/api/v1/user?req=load&user="+a.g+"&state="+Xi(a,"1.30.3"));return b} +function Vi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Xi(a,"1.30.3");d.data=c;b=Da(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);kj(a,b,c)}})}else c(a,null)} +function lj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Yi||bb(!0));l=!1}var g,h,l=!0;Yi++;jb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c|| +(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?ij(c,null,null,!1,e,function(d,l){l?(rb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Yi||bb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Yi||bb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ij(b,a,d,!0,e,m):jj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){bb(!1);return lj(a,b,c,d)};window.enableEvents=bb;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.3/pdp11.js b/versions/pdpjs/1.30.3/pdp11.js index 14779dd03..ddd9aeea8 100644 --- a/versions/pdpjs/1.30.3/pdp11.js +++ b/versions/pdpjs/1.30.3/pdp11.js @@ -55,7 +55,7 @@ y.prototype={constructor:y,parent:null,toString:function(){return this.name?this this.G=function(a){this.T(a,this.za)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.za+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},la:function(){return this.j.N=!0},ka:function(a,b){b&&(this.j.N=!1);return!0}};function Ua(a,b){a.j.tb?(a.j.Da=!1,a.j.tb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Da=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.kb,a.kb=null,b&&b()))} function Va(a,b){b&&(a.j.ready?b():a.kb=b);return a.j.ready}function Wa(a,b){a.j.error=!0;a.G(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.wc,a]}A(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()}; +function Ya(a){y.call(this,"Panel",a,Ya,2048);this.ea=this.i=this.c=this.m=this.s=this.v=0;this.A=this.B=this.w=!1;this.D=Za;this.g={};this.b={START:[1,1,!0,!1,this.uc],STEP:[1,1,!1,!1,this.vc],ENABLE:[1,1,!1,!1,this.qc],CONT:[1,1,!0,!1,this.oc],DEP:[0,0,!0,!1,this.pc],EXAM:[1,1,!0,!1,this.rc],LOAD:[1,1,!0,!1,this.tc],TEST:[0,0,!0,!1,this.sc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.wc,a]}A(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()}; h.$=function(a,b,c,d){if(this.l&&this.l.$(a,b,c,d)||this.a&&this.a.$(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ab(a,b)}}(this, b),a.onmouseup=a.onmouseout=function(a,b){return function(){bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){bb(a,b)}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.la=function(a,b){b||(hb(),this.reset());return!0};h.ka=function(){return!0}; function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.g)ib(a,c,null!=b?b:a.g[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.b)jb(a,b,a.b[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.F&&a.F.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))} @@ -66,22 +66,22 @@ function qb(a){var b=1145>a.a.Ea?8:16,c=65472<=a.ea&&a.ea<65472+b,b=c?1:2,c=c?15 var ub={},db=(ub[65400]=[null,null,Ya.prototype.xc,Ya.prototype.vd,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c>2;this.l=this.b-1;this.A=this.B/this.b|0;this.Aa=[];this.g=0;this.m=!1;this.ub=0;this.w=[];this.gc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.h=Array(this.A);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.Aa[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} -function xb(a,b,c){var d=!1,e=this.controller,f=e.Aa[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Aa[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.Aa[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} +function xb(a,b,c){var d=!1,e=this.controller,f=e.Aa[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Aa[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.Aa[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} function zb(a,b,c){var d=!1,e=this.controller;a=e.Aa[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.rb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.rb){p=l.size-(f-n);p>g&&(p=g);l.rb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.F,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.ub+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)} function Eb(a,b,c){var d=[];for(b>>>=a.c;0>>=a.c;0>>a.c].Fb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.oa)>>>a.c].V(b&a.l,b)}h.mb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.oa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a}; function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].Jb(b&a.l,c&255,b)}h.$a=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.oa)>>>this.c].Kb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].sb(b&a.l,c&65535,b)}h.pb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.oa)>>>this.c;this.m=!1;this.g++;this.h[d].ec(c,b&65535,a);this.g--}; function Pb(a){for(var b=0,c=[],d=0;da.a.Ea)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,w=0;w>16&65535);a=a.Db;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Jc=function(){var a=this.a;a.Z&57344||(a.Eb=a.A&65535);return a.Eb};h.Kc=function(){return this.a.Ba}; +function J(a,b,c){a.m=!0;a.g||(c&&(a.a.fa|=c),K(a.a,4,0,b))}function Rb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){y.call(this,"Device",a,L,1024);this.b={L:0,Ib:-1}}A(L);h=L.prototype;h.ja=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.F=d;var e=this;this.b.Ib=Sb(c,function(){e.b.Ya|=128;e.b.Ya&64&&Tb(e.a,e.b.rd);e.l&&e.l.ya(1);Ub(e.a,e.b.Ib,1E3/60)});this.b.rd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)}; +h.reset=function(){this.b.Ya=128;Ub(this.a,this.b.Ib,1E3/60,!0)};h.Fc=function(){return this.b.Ya};h.Dd=function(a){this.b.Ya=a&192};h.Hc=function(){var a=this.a,b=a.Z;b&57344||(b=b&-3199|a.bb<<5|a.cb<<1);return b};h.Fd=function(a){Xb(this.a,a&-129|this.a.Z&128)};h.Ic=function(){var a=this.a;a.Z&57344||(a.Db=a.A>>16&65535);a=a.Db;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Jc=function(){var a=this.a;a.Z&57344||(a.Eb=a.A&65535);return a.Eb};h.Kc=function(){return this.a.Ba}; h.Gd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Ra=a&16?4194303:262143,Yb(b))};h.ld=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};h.ge=function(a,b){b=b>>1&63;var c=b>>1;this.a.ab[c]=b&1?this.a.ab[c]&65535|(a&63)<<16:this.a.ab[c]&-65536|a&65534};h.dd=function(a){return this.a.H[1][a>>1&7]};h.$d=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[1][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; h.cd=function(a){return this.a.X[1][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.ad=function(a){return this.a.X[1][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Ec=function(a){return this.a.H[0][a>>1&7]};h.Cd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Cc=function(a){return this.a.H[0][(a>>1&7)+8]};h.Ad=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Dc=function(a){return this.a.X[0][a>>1&7]}; h.Bd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Bc=function(a){return this.a.X[0][(a>>1&7)+8]};h.zd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.kd=function(a){return this.a.H[3][a>>1&7]};h.fe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.hd=function(a){return this.a.H[3][(a>>1&7)+8]};h.de=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.jd=function(a){return this.a.X[3][a>>1&7]};h.ee=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295}; h.gd=function(a){return this.a.X[3][(a>>1&7)+8]};h.ce=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.C&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.C&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Pc=function(){return this.a.C&49152?this.a.pa[0]:this.a.f[6]};h.Ld=function(a){this.a.C&49152?this.a.pa[0]=a:this.a.f[6]=a};h.Sc=function(){return this.a.f[7]};h.Od=function(a){this.a.f[7]=a}; h.Na=function(a){a&=7;return this.a.C&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.C&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Qc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[1]};h.Md=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[1]=a};h.Rc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[3]};h.Nd=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[3]=a};h.zc=function(a){return this.a.$b[a-65504>>1]}; -h.xd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.ub}a=(a>>6)-1}else a=0;return a};h.dc=function(){};h.fd=function(){return 1};h.be=function(){};h.yc=function(){return this.a.fa};h.wd=function(){this.a.fa=0};h.Gc=function(){return this.a.Zb};h.Ed=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Lc=function(a){return a?this.a.Gb:0};h.Hd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Gb=a;b.u|=2}; -h.ed=function(a){return a?this.a.ob&65280:0};h.ae=function(a){this.a.ob=a|255};h.Oc=function(){return Zb(this.a)};h.Kd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.cc=function(){}; +h.xd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.ub}a=(a>>6)-1}else a=0;return a};h.dc=function(){};h.fd=function(){return 1};h.be=function(){};h.yc=function(){return this.a.fa};h.wd=function(){this.a.fa=0};h.Gc=function(){return this.a.Zb};h.Ed=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Lc=function(a,b){return b?0:this.a.Gb};h.Hd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Gb=a;b.u|=2}; +h.ed=function(a,b){return b?0:this.a.ob&65280};h.ae=function(a){this.a.ob=a|255};h.Oc=function(){return Zb(this.a)};h.Kd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.cc=function(){}; var M={},Wb=(M[61568]=[null,null,L.prototype.ld,L.prototype.ge,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.dd,L.prototype.$d,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.bd,L.prototype.Yd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Ec,L.prototype.Cd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Cc,L.prototype.Ad,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Dc, L.prototype.Bd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Kc,L.prototype.Gd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Fc,L.prototype.Dd,"LKS"],M[65402]=[null,null,L.prototype.Hc,L.prototype.Fd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Ic,L.prototype.cc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Jc,L.prototype.cc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.kd,L.prototype.fe,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.hd, L.prototype.de,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.jd,L.prototype.ee,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.gd,L.prototype.ce,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa, @@ -114,9 +114,9 @@ h.restore=function(a){var b=a[1];this.va=b[1];xc(this,b[3]);a:{b=this.h;a=a[2];v function Hc(a,b){var c=a.f[7];a.f[7]=c+b&65535;return c}function Q(a,b){a.f[7]=b&65535}function Vb(a,b){return{ud:a,La:b,next:null}}function Ic(a,b){var c=a.O;if(c==b)a.O=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}}function Tb(a,b){if(b!=a.O){var c=a.O;if(!c||c.La<=b.La)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.La<=b.La){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=1}function Jc(a){return a.u&64?(K(a,168,64,-5),!0):a.u&32?(K(a,4,32,-4),!0):a.u&16?(K(a,12,16,-6),!0):!1} function Zb(a){return a.C=a.C&63728|Fc(a)|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}function $b(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.C)&2048)for(var c=a.Fa.length;0<=--c;){var d=a.f[c];a.f[c]=a.Fa[c];a.Fa[c]=d}a.v=b>>14&3;c=a.C>>14&3;a.v!=c&&(a.pa[c]=a.f[6],a.f[6]=a.pa[a.v]);a.C=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Kc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Lc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))} function Mc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Nc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ua){0>a.Ja?a.Ja=Zb(a):a.v||(b=4,a.fa|=4,a.f[6]=4,d=-3);a.A=b;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ja>>2&12288);Oc(a,a.Ja);Oc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Pc(a){var b=Qc(a),c=Qc(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);Q(a,b);$b(a,c);a.u&=-17} -function Lb(a,b){var c=b>>13&31;31>c&&a.Ba&32&&(b=a.ab[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function Rc(a,b,c){var d,e,f;if(!(c&a.aa))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Ba&a.sd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.bb=a.v,a.cb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.Z& -57344||(g|=a.bb<<5|a.cb<<1,Xb(a,a.Z&-61695|g),b=!0)),a.Z&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.sb(c,b)}function Sc(a,b,c){!a.v&&c<=a.ob&&(b||4>13&31;31>c&&(b=a.Ba&32?a.ab[c]+(b&8190)&4194302:b&-3932161);return b} +function Rc(a,b,c){var d,e,f;if(!(c&a.aa))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Ba&a.sd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.bb=a.v,a.cb=d;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.Z&57344|| +(g|=a.bb<<5|a.cb<<1,Xb(a,a.Z&-61695|g),K(a,168,0,-1))),a.Z&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.sb(c,b)}function Sc(a,b,c){!a.v&&c<=a.ob&&(b||4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Hc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Hc(a,2)),e=e+a.f[c]& 65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&Sc(a,b,a.f[6]);return e}h.mb=function(a){if(!this.aa)return this.h.mb(a);this.ua++;a=this.Yb(Rc(this,a,2));this.ua--;return a};h.$a=function(a,b){this.aa?(this.ua++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.$a(a,b)};h.pb=function(a,b){this.aa?(this.ua++,this.fc(Rc(this,a,4),b),this.ua--):this.h.pb(a,b)};h.mc=function(a,b,c){return Tc(this,a,b,c)}; h.nc=function(a,b,c){return Rc(this,Tc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,this.Xa=a)};h.md=function(a){return Mb(this.h,this.Xa=Rc(this,a,2))};h.fc=function(a,b){Ob(this.h,this.Xa=a,b&65535)};h.he=function(a,b){Ob(this.h,this.Xa=Rc(this,a,4),b)};function Uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Tc(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.v=a.C>>12&3,c=a.V(d|c&a.R),a.v=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.pa[a.C>>12&3];return c} @@ -150,7 +150,7 @@ this.b?2:0)}],Pe=[function(a){S(this,a,0,xd);this.a-=this.c?9+(this.Ab&1):3+(7== var Ue=[function(a){Ve[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,Cd,function(a){We[a>>8&15].call(this,a)},function(a){Xe[a>>8&15].call(this,a)},me,be,Md,Id,Kd,ue,Y],Ve=[function(a){Ye[a>>4&15].call(this,a)},Yd,Vd,Nd,Od,Td,Pd,Rd,je,je,Ae,Ce,Ee,function(a){Ze[a>>6&3].call(this,a)},Y,Y],Ze=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Uc(this,a,0);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I= this.a;Vc(this,a,0,b);R(this,b);this.a=this.I-ne[this.c]},function(a){R(this,bd(this,a,Fc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ye=[function(a){$e[a&15].call(this,a)},Y,Y,Y,he,he,he,he,re,function(a){a&8?(this.C&49152||(this.C=this.C&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},Ge,Ie,ve,ve,ve,ve],$e=[ee,xe,function(){Pc(this);this.u|=this.C&16;this.a-=13},Xd,fe,qe,se,function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],We=[oe,oe,ce,ce,Dd,Dd,Ed,Ed,ye,ye,Y,Y,Y,Y,te,te],Xe=[Wd,Ud,Qd,Sd, Zd,$d,Fd,Gd,de,we,Ke,Me,Oe,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[Y,function(a){a=Uc(this,a,65536);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I=this.a;Vc(this,a,65536,b);R(this,b);this.a=this.I-ne[this.c]},Y]; -function bf(a){y.call(this,"ROM",a,bf,256);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.qa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);cf(c)})}}A(bf);h=bf.prototype; +function bf(a){y.call(this,"ROM",a,bf,512);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.qa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);cf(c)})}}A(bf);h=bf.prototype; h.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;cf(this)};h.la=function(){this.W&&(this.F&&this.F.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ka=function(){return!0}; function cf(a){if(!Va(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[bf.prototype.$c,bf.prototype.Wd,null,null,null,a.b>>1],c);if(cb(a.h,a,b)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c