From 0ee3a091b49309a71a55b3ef06b3b5b9279cf289 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Fri, 7 Oct 2016 17:37:13 -0700 Subject: [PATCH] More device refactoring --- devices/pdp11/machine/1170/machine.xml | 2 +- devices/pdp11/machine/1170/test/machine.xml | 2 +- modules/pdp11/lib/bus.js | 81 +- modules/pdp11/lib/cpustate.js | 154 +- modules/pdp11/lib/debugger.js | 8 +- modules/pdp11/lib/defines.js | 39 +- modules/pdp11/lib/device.js | 1802 ++++++------------- modules/pdp11/lib/memory.js | 28 +- modules/pdp11/lib/rk11.js | 85 + versions/pdpjs/1.30.1/pdp11-dbg.js | 444 +++-- versions/pdpjs/1.30.1/pdp11.js | 302 ++-- 11 files changed, 1192 insertions(+), 1755 deletions(-) create mode 100644 modules/pdp11/lib/rk11.js diff --git a/devices/pdp11/machine/1170/machine.xml b/devices/pdp11/machine/1170/machine.xml index 0210592e0..a0926e60b 100644 --- a/devices/pdp11/machine/1170/machine.xml +++ b/devices/pdp11/machine/1170/machine.xml @@ -7,7 +7,7 @@ - + diff --git a/devices/pdp11/machine/1170/test/machine.xml b/devices/pdp11/machine/1170/test/machine.xml index f4a587aee..8ceb0eef0 100644 --- a/devices/pdp11/machine/1170/test/machine.xml +++ b/devices/pdp11/machine/1170/test/machine.xml @@ -7,7 +7,7 @@ - + diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 9b3ef927a..707bcc0c9 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -116,23 +116,21 @@ function BusPDP11(parmsBus, cpu, dbg) * Memory access handlers must service the entire block; see the setAccess() function in the Memory * component for details. * + * Finally, for debugging purposes, if an I/O address has a symbolic name, it will be saved here: + * + * [4]: symbolic name of I/O address + * * UPDATE: The Debugger wants to piggy-back on these arrays to indicate addresses for which it wants * notification. In those cases, the following additional element will be set: * - * [4]: true to break on I/O, false to ignore I/O + * [5]: true to break on I/O, false to ignore I/O * * The false case is important if fIOBreakAll is set, because it allows the Debugger to selectively * ignore specific addresses. - * - * Finally, for debugging purposes, if an I/O address has a symbolic name, it will be saved here: - * - * [5]: symbolic name of I/O address */ this.aIOHandlers = []; this.fIOBreakAll = false; - - this.fnReset = null; - this.fnIOAccess = this.unknownIO; + this.afnReset = []; /* * Allocate empty Memory blocks to span the entire physical address space. @@ -151,7 +149,6 @@ 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.MAX_ADDRESS = 0x400000; /*020000000*/ // Register addresses are above 22 bit addressing BusPDP11.ERROR = { RANGE_INUSE: 1, @@ -191,7 +188,7 @@ BusPDP11.IOController = { var afn = bus.aIOHandlers[off]; if (afn) { if (afn[0]) { - b = afn[0](addr); + b = afn[0](addr) & 0xff; // we mask the result of readByte() in case the caller is re-using their readWord() handler } else if (afn[2]) { if (!(addr & 0x1)) { b = afn[2](addr) & 0xff; @@ -209,13 +206,13 @@ BusPDP11.IOController = { } if (b >= 0) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage(afn[5] + ".readByte(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(b), true, true); + this.dbg.printMessage(afn[4] + ".readByte(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(b), true, true); } return b; } - b = bus.fnIOAccess(addr | BusPDP11.IOPAGE_22BIT, -1, 1); + b = bus.unknownAccess(addr | BusPDP11.IOPAGE_22BIT, -1, 1); if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage("warning: unconverted read access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b)); + this.dbg.printMessage("warning: unconverted read access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b), true, true); } return b; }, @@ -274,13 +271,13 @@ BusPDP11.IOController = { } if (fWrite) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage(afn[5] + ".writeByte(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(b) + ")", true, true); + this.dbg.printMessage(afn[4] + ".writeByte(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(b) + ")", true, true); } return; } - bus.fnIOAccess(addr | BusPDP11.IOPAGE_22BIT, b, 1); + bus.unknownAccess(addr | BusPDP11.IOPAGE_22BIT, b, 1); if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage("warning: unconverted write access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b)); + this.dbg.printMessage("warning: unconverted write access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b), true, true); } }, @@ -296,7 +293,6 @@ BusPDP11.IOController = { { var w = -1; var bus = this.controller; - Component.assert(!(addr & 1)); // unaligned addresses should be getting trapped at a higher level var afn = bus.aIOHandlers[off]; if (afn) { if (afn[2]) { @@ -307,13 +303,13 @@ BusPDP11.IOController = { } if (w >= 0) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage(afn[5] + ".readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true, true); + this.dbg.printMessage(afn[4] + ".readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true, true); } return w; } - w = bus.fnIOAccess(addr | BusPDP11.IOPAGE_22BIT, -1, 0); + w = bus.unknownAccess(addr | BusPDP11.IOPAGE_22BIT, -1, 0); if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage("warning: unconverted read access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w)); + this.dbg.printMessage("warning: unconverted read access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w), true, true); } return w; }, @@ -330,7 +326,6 @@ BusPDP11.IOController = { { var fWrite = false; var bus = this.controller; - Component.assert(!(addr & 1)); // unaligned addresses should be getting trapped at a higher level var afn = bus.aIOHandlers[off]; if (afn) { if (afn[3]) { @@ -344,13 +339,13 @@ BusPDP11.IOController = { } if (fWrite) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage(afn[5] + ".writeWord(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(w) + ")", true, true); + this.dbg.printMessage(afn[4] + ".writeWord(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(w) + ")", true, true); } return; } - bus.fnIOAccess(addr | BusPDP11.IOPAGE_22BIT, w, 0); + bus.unknownAccess(addr | BusPDP11.IOPAGE_22BIT, w, 0); if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage("warning: unconverted write access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w)); + this.dbg.printMessage("warning: unconverted write access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w), true, true); } } }; @@ -364,7 +359,7 @@ BusPDP11.IOController = { */ BusPDP11.prototype.initMemory = function() { - var block = new MemoryPDP11(); + var block = new MemoryPDP11(this.cpu); block.copyBreakpoints(this.dbg); this.aMemBlocks = new Array(this.nBlockTotal); for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) { @@ -414,18 +409,19 @@ BusPDP11.prototype.getControllerAccess = function() /** * reset() * - * The Device component initializes fnReset by calling addIODefaultHandlers() from its initBus() function; - * it will be that function's responsibility to reset all the necessary devices. + * Call all registered reset() handlers. * * @this {BusPDP11} */ BusPDP11.prototype.reset = function() { - if (this.fnReset) this.fnReset(); + for (var i = 0; i < this.afnReset.length; i++) { + this.afnReset[i](); + } }; /** - * unknownIO(addr, data, byteFlag) + * unknownAccess(addr, data, byteFlag) * * This is our default I/O handler, called whenever there's an IOPAGE access without a corresponding entry * in aIOHandlers; in the interim, our Device component will override this default handler with its own function @@ -437,12 +433,12 @@ BusPDP11.prototype.reset = function() * @param {number} data (-1 if read, otherwise write) * @param {number} byteFlag (true if byte I/O, otherwise word) */ -BusPDP11.prototype.unknownIO = function(addr, data, byteFlag) +BusPDP11.prototype.unknownAccess = function(addr, data, byteFlag) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage("warning: unrecognized I/O access(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(data) + "," + byteFlag + ")"); + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.WARN)) { + this.dbg.printMessage("warning: unrecognized I/O access(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(data) + "," + byteFlag + ")", true, true); } - return 0; + this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr); }; /** @@ -537,7 +533,7 @@ BusPDP11.prototype.addMemory = function(addr, size, type, controller) return this.reportError(BusPDP11.ERROR.RANGE_INUSE, addrNext, sizeLeft); } - var blockNew = new MemoryPDP11(addrNext, sizeBlock, this.nBlockSize, type, controller); + var blockNew = new MemoryPDP11(this.cpu, addrNext, sizeBlock, this.nBlockSize, type, controller); blockNew.copyBreakpoints(this.dbg, block); this.aMemBlocks[iBlock++] = blockNew; @@ -675,7 +671,7 @@ BusPDP11.prototype.removeMemory = function(addr, size) var iBlock = addr >>> this.nBlockShift; while (size > 0) { var blockOld = this.aMemBlocks[iBlock]; - var blockNew = new MemoryPDP11(addr); + var blockNew = new MemoryPDP11(this.cpu, addr); blockNew.copyBreakpoints(this.dbg, blockOld); this.aMemBlocks[iBlock++] = blockNew; addr = iBlock * this.nBlockSize; @@ -761,7 +757,7 @@ BusPDP11.prototype.setMemoryBlocks = function(addr, size, aBlocks, type) this.assert(block); if (!block) break; if (type !== undefined) { - var blockNew = new MemoryPDP11(addr); + var blockNew = new MemoryPDP11(this.cpu, addr); blockNew.clone(block, type, this.dbg); block = blockNew; } @@ -1044,7 +1040,7 @@ BusPDP11.prototype.addIOHandlers = function(start, end, fnReadByte, fnWriteByte, Component.warning("I/O address already registered: " + str.toHexLong(addr)); continue; } - this.aIOHandlers[off] = [fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, false, sName || "unknown"]; + this.aIOHandlers[off] = [fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, sName || "unknown", false]; if (MAXDEBUG) this.log("addIOHandlers(" + str.toHexLong(addr) + ")"); } }; @@ -1062,6 +1058,7 @@ BusPDP11.prototype.addIOTable = function(component, table) { for (var port in table) { var afn = table[port]; + if (afn[5] && afn[5] > this.cpu.model) continue; var fnReadByte = afn[0]? afn[0].bind(component) : null; var fnWriteByte = afn[1]? afn[1].bind(component) : null; var fnReadWord = afn[2]? afn[2].bind(component) : null; @@ -1071,18 +1068,14 @@ BusPDP11.prototype.addIOTable = function(component, table) }; /** - * addIODefaultHandlers(fnReset, fnIOAccess) - * - * Add default I/O notification handlers. + * addResetHandler(fnReset) * * @this {BusPDP11} * @param {function()} fnReset - * @param {function(number,number,number)} fnIOAccess */ -BusPDP11.prototype.addIODefaultHandlers = function(fnReset, fnIOAccess) +BusPDP11.prototype.addResetHandler = function(fnReset) { - this.fnReset = fnReset; - this.fnIOAccess = fnIOAccess; + this.afnReset.push(fnReset); }; /** diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index fa8f8df0f..0e465f0da 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -151,7 +151,6 @@ CPUStatePDP11.prototype.initRegs = function() this.mmuMode = 0; // current memory management mode (see PDP11.MODE.KERNEL | SUPER | UNUSED | USER) this.mmuLastPage = 0; this.mmuLastVirtual = 0; - this.mapMMR3 = [4,2,0,1]; // map from mode to MMR3 I/D bit this.mmuPDR = [ // memory management PDR registers by mode [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // kernel 0 @@ -165,20 +164,14 @@ CPUStatePDP11.prototype.initRegs = function() [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // mode 2 (not used) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // user 3 ]; - - this.mmuMap = [ // memory management register by mode - 16 PDR (8 I then 8 D descriptors) followed by 16 PAR (I/D addresses) - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // kernel - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // super - [0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // illegal mode 2 requires illegal PDRs - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // user - ]; this.unibusMap = [ // 32 unibus map registers 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; - this.controlReg = [ // various control registers we don't really care about - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + this.regsControl = [ // various control registers we don't really care about + 0, 0, 0, 0, 0, 0, 0, 0 ]; + this.regMB = 0; /* * opFlags contains various triggers that stepCPU() needs to be aware of @@ -269,7 +262,6 @@ CPUStatePDP11.prototype.getMMR0 = function() * * @this {CPUStatePDP11} * @param {number} newMMR0 - * @return {number} */ CPUStatePDP11.prototype.setMMR0 = function(newMMR0) { @@ -286,7 +278,45 @@ CPUStatePDP11.prototype.setMMR0 = function(newMMR0) this.mmuEnable = 0; } this.initMemoryAccess(); - return this.regMMR0; +}; + +/** + * getMMR1() + * + * @this {CPUStatePDP11} + * @return {number} + */ +CPUStatePDP11.prototype.getMMR1 = function() +{ + var result = this.regMMR1; + if (result & 0xff00) { + result = ((result << 8) | (result >> 8)) & 0xffff; + } + return result; +}; + +/** + * setMMR3() + * + * @this {CPUStatePDP11} + * @param {number} newMMR3 + */ +CPUStatePDP11.prototype.setMMR3 = function(newMMR3) +{ + /* + * Don't allow 11/45 to do 22 bit or use unibus map + */ + if (this.cpuType !== 70) { + newMMR3 &= ~(PDP11.MMR3.MMU_22BIT | PDP11.MMR3.UNIBUS_MAP); + } + this.regMMR3 = newMMR3; + if (this.regMMR3 & PDP11.MMR3.MMU_22BIT) { + this.mmuMask = 0x3fffff; + this.mmuMemorySize = BusPDP11.MAX_MEMORY; + } else { + this.mmuMask = 0x3ffff; + this.mmuMemorySize = BusPDP11.IOPAGE_18BIT; + } }; /** @@ -772,6 +802,58 @@ CPUStatePDP11.prototype.setPSW = function(newPSW) this.regPSW = newPSW; }; +/** + * getSL() + * + * @this {CPUStatePDP11} + * @return {number} + */ +CPUStatePDP11.prototype.getSL = function() +{ + return this.regSL & 0xff00; +}; + +/** + * setSL(newSL) + * + * @this {CPUStatePDP11} + * @param {number} newSL + */ +CPUStatePDP11.prototype.setSL = function(newSL) +{ + this.regSL = newSL | 0xff; +}; + +/** + * getPIR() + * + * @this {CPUStatePDP11} + * @return {number} + */ +CPUStatePDP11.prototype.getPIR = function() +{ + return this.regPIR; +}; + +/** + * setPIR(newPIR) + * + * @this {CPUStatePDP11} + * @param {number} newPIR + */ +CPUStatePDP11.prototype.setPIR = function(newPIR) +{ + newPIR &= 0xfe00; + if (newPIR) { + var i = newPIR >> 9; + do { + newPIR += 0x22; + } while (i >>= 1); + } + this.regPIR = newPIR; + this.opFlags |= PDP11.OPFLAG.INTQ; +}; + /** * updateNZVFlags(result) * @@ -926,6 +1008,19 @@ CPUStatePDP11.prototype.updateSubFlags = function(result, src, dst) } }; +/** + * fault(addr) + * + * Memory interface for signaling alignment errors. + * + * @this {CPUStatePDP11} + * @param {number} addr + */ +CPUStatePDP11.prototype.fault = function(addr) +{ + this.trap(PDP11.TRAP.BUS_ERROR, addr); +}; + /** * panic(reason) * @@ -992,7 +1087,7 @@ CPUStatePDP11.prototype.trap = function(vector, reason) if (DEBUG && this.dbg) { if (this.messageEnabled(MessagesPDP11.TRAP)) { - this.printMessage("trap to vector " + this.dbg.toStrBase(vector, 0, true) + (reason? " (reason " + reason + ")" : ""), MessagesPDP11.TRAP, true); + this.printMessage("trap to vector " + this.dbg.toStrBase(vector, 0, true) + (reason? " (" + this.dbg.toStrBase(reason) + ")" : ""), MessagesPDP11.TRAP, true); } } @@ -1057,7 +1152,7 @@ CPUStatePDP11.prototype.mapUnibus = function(unibusAddress) * the operation access mask (accessFlags). If there is no match then the virtual * address is simply mapped as a 16 bit physical address with the upper page going * to the IO address space. Significant access mask values used are PDP11.ACCESS.READ - * and PDP11.ACCESS.WRITE + * and PDP11.ACCESS.WRITE. * * As an aside it turns out that it is the memory management unit that does odd address * and non-existent memory trapping: who knew? :-) I thought these would have been @@ -1106,11 +1201,6 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl physicalAddress = ((this.mmuPAR[this.mmuMode][page] << 6) + (virtualAddress & 0x1fff)) & this.mmuMask; if (physicalAddress < this.mmuMemorySize) { - /* - * I'm leaving this code here, per Paul's comments above, but it does surprisingly redundant - * to have to perform this check here AND at the physical level (see readWordFromPhysical() and - * writeWordToPhysical()). - */ if ((physicalAddress & 1) && !(accessFlags & PDP11.ACCESS.BYTE)) { this.regErr |= PDP11.CPUERR.ODDADDR; this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.ODDMEMADDR); @@ -1465,10 +1555,6 @@ CPUStatePDP11.prototype.getVirtualAddrByMode = function(mode, reg, accessFlags) */ CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress) { - if (physicalAddress & 0x1) { - this.regErr |= PDP11.CPUERR.ODDADDR; - this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.ODDMEMADDR); - } return this.bus.getWord(physicalAddress); }; @@ -1483,7 +1569,7 @@ CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress) */ CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress) { - return this.readWordFromPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ_WORD)); + return this.bus.getWord(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ_WORD)); }; /** @@ -1497,10 +1583,6 @@ CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress) */ CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data) { - if (physicalAddress & 0x1) { - this.regErr |= PDP11.CPUERR.ODDADDR; - this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.ODDMEMADDR); - } this.bus.setWord(physicalAddress, data & 0xffff); }; @@ -1515,7 +1597,7 @@ CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data) */ CPUStatePDP11.prototype.writeWordToVirtual = function(virtualAddress, data) { - this.writeWordToPhysical(this.mapVirtualToPhysical(virtualAddress | PDP11.ACCESS.DSPACE, PDP11.ACCESS.WRITE_WORD), data); + this.bus.setWord(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.WRITE_WORD), data); }; /** @@ -1575,14 +1657,14 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, dat if (!(accessFlags & PDP11.ACCESS.DSPACE)) addr &= 0xffff; /* * TODO: Consider replacing the following code with writeWordToAddr(), by adding optional mmuMode - * parameters for each of the discrete mapVirtualToPhysical() and writeWordToPhysical() operations, - * because as it stands, this is the only remaining call to mapVirtualToPhysical() outside of our + * parameters for each of the discrete mapVirtualToPhysical() and bus.setWord() operations, because + * as it stands, this is the only remaining call to mapVirtualToPhysical() outside of our * initMemoryAccess() handlers. */ this.mmuMode = (this.regPSW >> 12) & 3; addr = this.mapVirtualToPhysical(addr | (accessFlags & PDP11.ACCESS.DSPACE), PDP11.ACCESS.WRITE); this.mmuMode = (this.regPSW >> 14) & 3; - this.writeWordToPhysical(addr, data); + this.bus.setWord(addr, data); } }; @@ -1623,7 +1705,7 @@ CPUStatePDP11.prototype.readSrcWord = function(opCode) if (!mode) { result = this.regsGen[reg]; } else { - result = this.readWordFromPhysical(this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD)); + result = this.bus.getWord(this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD)); } return result; }; @@ -1677,7 +1759,7 @@ CPUStatePDP11.prototype.readDstWord = function(opCode) if (!mode) { result = this.regsGen[reg]; } else { - result = this.readWordFromPhysical(this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD)); + result = this.bus.getWord(this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD)); } return result; }; @@ -1722,7 +1804,7 @@ CPUStatePDP11.prototype.updateDstWord = function(opCode, src, fnOp) this.regsGen[reg] = fnOp.call(this, src, this.regsGen[reg]); } else { var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.UPDATE_WORD); - this.writeWordToPhysical(addr, fnOp.call(this, src, this.readWordFromPhysical(addr))); + this.bus.setWord(addr, fnOp.call(this, src, this.bus.getWord(addr))); } }; @@ -1772,7 +1854,7 @@ CPUStatePDP11.prototype.writeDstWord = function(opCode, data) if (!mode) { this.regsGen[reg] = data & 0xffff; } else { - this.writeWordToPhysical(this.getAddrByMode(mode, reg, PDP11.ACCESS.WRITE_WORD), data); + this.bus.setWord(this.getAddrByMode(mode, reg, PDP11.ACCESS.WRITE_WORD), data); } return data; }; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 05d98af18..8cbd7edde 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -589,7 +589,7 @@ if (DEBUGGER) { if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; /* - * TODO: We also need a Bus interface to disable fnIOAccess() calls that could trigger a trap(). + * TODO: We also need a Bus interface to disable accesses that could trigger a trap(). */ b = this.bus.getByteDirect(addr); this.nDisableMessages--; @@ -613,7 +613,7 @@ if (DEBUGGER) { if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; /* - * TODO: We also need a Bus interface to disable fnIOAccess() calls that could trigger a trap(). + * TODO: We also need a Bus interface to disable accesses that could trigger a trap(). * * NOTE: We don't care if the word address is aligned, because 1) we assume the user knows what * they're doing, and 2) the Bus simply ignores the low address bit anyway. Alignment checks are @@ -640,7 +640,7 @@ if (DEBUGGER) { if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; /* - * TODO: We also need a Bus interface to disable fnIOAccess() calls that could trigger a trap(). + * TODO: We also need a Bus interface to disable accesses that could trigger a trap(). */ this.bus.setByteDirect(addr, b); this.nDisableMessages--; @@ -663,7 +663,7 @@ if (DEBUGGER) { if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; /* - * TODO: We also need a Bus interface to disable fnIOAccess() calls that could trigger a trap(). + * TODO: We also need a Bus interface to disable accesses that could trigger a trap(). * * NOTE: We don't care if the word address is aligned, because 1) we assume the user knows what * they're doing, and 2) the Bus simply ignores the low address bit anyway. Alignment checks are diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 147c603c0..a29d9ae67 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -455,11 +455,40 @@ var PDP11 = { UDSAR6: 0o177674, // User D Space Address Register 6 UDSAR7: 0o177676, // User D Space Address Register 7 - SIZE_LO: 0o177760, // Lower Size Register (last 32-word block) (11/70 only?) - SIZE_HI: 0o177762, // Upper Size Register (always zero) (11/70 only?) - SYSID: 0o177764, // System ID Register (11/70 only?) - CPUERR: 0o177766, // CPU error (11/70 only?) - MB: 0o177770, // Microprogram break (11/70 only?) + R0SET0: 0o177700, + R1SET0: 0o177701, + R2SET0: 0o177702, + R3SET0: 0o177703, + R4SET0: 0o177704, + R5SET0: 0o177705, + R6KERNEL: 0o177706, + R7KERNEL: 0o177707, + R0SET1: 0o177710, + R1SET1: 0o177711, + R2SET1: 0o177712, + R3SET1: 0o177713, + R4SET1: 0o177714, + R5SET1: 0o177715, + R6SUPER: 0o177716, + R6USER: 0o177717, + + /* + * This next group of registers is largely ignored; all accesses are routed to regsControl[] + */ + LAERR: 0o177740, // Low Address Error (11/70 only) + HAERR: 0o177742, // High Address Error (11/70 only) + MEMERR: 0o177744, // Memory System Error (11/70 only) + CACHEC: 0o177746, // Cache Control (11/70 only) + MAINT: 0o177750, // Maintenance (11/70 only) + HITMISS: 0o177752, // Hit/Miss (11/70 only) + UNDEF1: 0o177754, + UNDEF2: 0o177756, + + LSIZE: 0o177760, // Lower Size Register (last 32-word block) (11/70 only) + HSIZE: 0o177762, // Upper Size Register (always zero) (11/70 only) + SYSID: 0o177764, // System ID Register (11/70 only) + CPUERR: 0o177766, // CPU error (11/70 only) + MB: 0o177770, // Microprogram break PIR: 0o177772, // Program Interrupt Request SL: 0o177774, // Stack Limit Register PSW: 0o177776 // 777776 17777776 0x3FFFFE Processor Status Word diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index ac1d91c11..015d87043 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -42,13 +42,12 @@ if (NODE) { /** * DevicePDP11(parmsDevice) * - * The DevicePDP11 component supports the following (parmsDevice) properties: + * The Device component implements the following "default" devices: * - * name: the name of the device to be supported (eg, "unibus" for generic UNIBUS support) - * - * TODO: This is currently a "catch-all" device; ideally, each of the assorted devices emulated here - * (eg, DL11, KW11, RK11, RL11, etc) would be a separate component. But because we're in the middle of - * porting all this code from a common module (iopage.js), that's the way it is. + * KW11 + * DISPLAY Registers + * MMU Registers + * CPU Registers (eg, PSW) * * @constructor * @extends Component @@ -57,114 +56,55 @@ if (NODE) { function DevicePDP11(parmsDevice) { Component.call(this, "Device", parmsDevice, DevicePDP11); - this.sDeviceName = parmsDevice['name']; this.display = { - data: 0, - address: 0, - misc: 0x14, - switches: 0 + data: 0, + address: 0, + misc: 0x14, + switches: 0 }; this.kw11 = { - csr: 0, - timer: -1 // initBus() will initialize this timer ID - }; - - this.rk11 = { - rkds: 0x9C0, /*04700*/ // 017777400 Drive Status - rker: 0, // 017777402 Error Register - rkcs: 0x80, /*0200*/ // 017777404 Control Status - rkwc: 0, // 017777406 Word Count - rkba: 0, // 017777410 Bus Address - rkda: 0, // 017777412 Disk Address - rkdb: 0, // 017777416 Data Buffer - meta: [], - TRACKS: [406, 406, 406, 406], - SECTORS: [12, 12, 12, 12] - }; - - this.rl11 = { - csr: 0x81, // 017774400 Control status register - bar: 0, // 017774402 Bus address - dar: 0, // 017774404 Disk address - mpr: 0, // 017774406 Multi purpose - bae: 0, // 017774410 Bus address extension - DAR: 0, // internal disk address - meta: [], // sector cache - SECTORS: [40, 40, 40, 40], // sectors per track - TRACKS: [1024, 1024, 512, 512], // First two drives RL02 - last two RL01 - cylinders * 2 - STATUS: [0x9D /*0235*/, 0x9D /*0235*/, 0x1D /*035*/, 0x1D /*035*/] // First two drives RL02 - last two RL01 - }; - - this.rp11 = { - DTYPE: [0x2012 /*020022*/, 0x2010 /*020020*/, 0x2012 /*020022*/, 0x2022 /*020042*/], // Drive type rp04, rp06, rp07 - SECTORS: [22, 22, 22, 50], // sectors per track - SURFACES: [19, 19, 19, 32], // - CYLINDERS: [815, 411, 815, 630], - meta: [], //meta data for drive - rpcs1: 0x880, // Massbus 00 - actual register is a mix of controller and drive bits :-( - rpwc: 0, - rpba: 0, - rpda: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 05 - rpcs2: 0, - rpds: [0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0], // Massbus 01 Read only - rper1: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 02 - rpas: 0, // Massbus 04??? - rpla: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 07 Read only - rpdb: 0, - rpmr: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 03 - rpdt: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 06 Read only - rpsn: [1, 2, 3, 4, 5, 6, 7, 8], // Massbus 10 Read only - rpof: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 11 - rpdc: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 12 - rpcc: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 13 Read only - rper2: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 14 - rper3: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 15 - rpec1: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 16 Read only - rpec2: [0, 0, 0, 0, 0, 0, 0, 0], // Massbus 17 Read only - rpbae: 0, - rpcs3: 0 + csr: 0, + timer: -1 // initBus() will initialize this timer ID }; } Component.subclass(DevicePDP11); -DevicePDP11.UNIBUS_NAME = "unibus"; - DevicePDP11.M9312 = [ - 0x101F, /*0010037*/ 0x1C0, /*0000700*/ 0x105F, /*0010137*/ 0x1C2, /*0000702*/ 0x111F, /*0010437*/ 0x1C4, /*0000704*/ 0xA1F, /*0005037*/ 0x1C6, /*0000706*/ - 0x55DF, /*0052737*/ 0x8000, /*0100000*/ 0xFFFE, /*0177776*/ 0x35DF, /*0032737*/ 0x4000, /*0040000*/ 0xFFFE, /*0177776*/ 0x302, /*0001402*/ 0xA9F, /*0005237*/ - 0x1C6, /*0000706*/ 0xA1F, /*0005037*/ 0xFFFE, /*0177776*/ 0x101, /*0000401*/ 0x0, /*0000000*/ 0xA06, /*0005006*/ 0x8104, /*0100404*/ 0x8503, /*0102403*/ - 0x8202, /*0101002*/ 0x501, /*0002401*/ 0x8301, /*0101401*/ 0x0, /*0000000*/ 0xAC6, /*0005306*/ 0x8003, /*0100003*/ 0x302, /*0001402*/ 0x401, /*0002001*/ - 0x701, /*0003401*/ 0x0, /*0000000*/ 0xC06, /*0006006*/ 0x8402, /*0102002*/ 0x8601, /*0103001*/ 0x201, /*0001001*/ 0x0, /*0000000*/ 0x15C6, /*0012706*/ + 0x101F, /*0010037*/ 0x01C0, /*0000700*/ 0x105F, /*0010137*/ 0x01C2, /*0000702*/ 0x111F, /*0010437*/ 0x01C4, /*0000704*/ 0x0A1F, /*0005037*/ 0x01C6, /*0000706*/ + 0x55DF, /*0052737*/ 0x8000, /*0100000*/ 0xFFFE, /*0177776*/ 0x35DF, /*0032737*/ 0x4000, /*0040000*/ 0xFFFE, /*0177776*/ 0x0302, /*0001402*/ 0x0A9F, /*0005237*/ + 0x01C6, /*0000706*/ 0x0A1F, /*0005037*/ 0xFFFE, /*0177776*/ 0x0101, /*0000401*/ 0x0000, /*0000000*/ 0x0A06, /*0005006*/ 0x8104, /*0100404*/ 0x8503, /*0102403*/ + 0x8202, /*0101002*/ 0x0501, /*0002401*/ 0x8301, /*0101401*/ 0x0000, /*0000000*/ 0x0AC6, /*0005306*/ 0x8003, /*0100003*/ 0x0302, /*0001402*/ 0x0401, /*0002001*/ + 0x0701, /*0003401*/ 0x0000, /*0000000*/ 0x0C06, /*0006006*/ 0x8402, /*0102002*/ 0x8601, /*0103001*/ 0x0201, /*0001001*/ 0x0000, /*0000000*/ 0x15C6, /*0012706*/ 0xAAAA, /*0125252*/ 0x1180, /*0010600*/ 0x1001, /*0010001*/ 0x1042, /*0010102*/ 0x1083, /*0010203*/ 0x10C4, /*0010304*/ 0x1105, /*0010405*/ 0xE141, /*0160501*/ - 0x501, /*0002401*/ 0x301, /*0001401*/ 0x0, /*0000000*/ 0xC42, /*0006102*/ 0x8601, /*0103001*/ 0x501, /*0002401*/ 0x0, /*0000000*/ 0x6083, /*0060203*/ - 0xA83, /*0005203*/ 0xA43, /*0005103*/ 0x60C1, /*0060301*/ 0x8701, /*0103401*/ 0x701, /*0003401*/ 0x0, /*0000000*/ 0xC04, /*0006004*/ 0x5103, /*0050403*/ - 0x6143, /*0060503*/ 0xA83, /*0005203*/ 0x8702, /*0103402*/ 0xAC1, /*0005301*/ 0x501, /*0002401*/ 0x0, /*0000000*/ 0xA40, /*0005100*/ 0x8301, /*0101401*/ - 0x0, /*0000000*/ 0x4001, /*0040001*/ 0x6041, /*0060101*/ 0x601, /*0003001*/ 0x701, /*0003401*/ 0x0, /*0000000*/ 0xC1, /*0000301*/ 0x2057, /*0020127*/ - 0x5455, /*0052125*/ 0x204, /*0001004*/ 0x3105, /*0030405*/ 0x602, /*0003002*/ 0xA45, /*0005105*/ 0x201, /*0001001*/ 0x0, /*0000000*/ 0x95C0, /*0112700*/ - 0xFF01, /*0177401*/ 0x8001, /*0100001*/ 0x0, /*0000000*/ 0x7E02, /*0077002*/ 0xA01, /*0005001*/ 0xA81, /*0005201*/ 0x7E02, /*0077002*/ 0xBC0, /*0005700*/ - 0x202, /*0001002*/ 0xBC1, /*0005701*/ 0x301, /*0001401*/ 0x0, /*0000000*/ 0x15C6, /*0012706*/ 0x1FE, /*0000776*/ 0x9F7, /*0004767*/ 0x2, /*0000002*/ - 0x0, /*0000000*/ 0x25CE, /*0022716*/ 0xD0, /*0000320*/ 0x301, /*0001401*/ 0x0, /*0000000*/ 0x15CE, /*0012716*/ 0xE2, /*0000342*/ 0x87, /*0000207*/ - 0x0, /*0000000*/ 0xA26, /*0005046*/ 0x15E6, /*0012746*/ 0xEC, /*0000354*/ 0x2, /*0000002*/ 0x0, /*0000000*/ 0x5F, /*0000137*/ 0xF2, /*0000362*/ - 0x80, /*0000200*/ 0x15C5, /*0012705*/ 0xE000, /*0160000*/ 0xA1F, /*0005037*/ 0x6, /*0000006*/ 0x15DF, /*0012737*/ 0x100, /*0000400*/ 0x4, /*0000004*/ - 0x15C6, /*0012706*/ 0x1FE, /*0000776*/ 0xBE5, /*0005745*/ 0x15DF, /*0012737*/ 0x1CC, /*0000714*/ 0x4C, /*0000114*/ 0xA1F, /*0005037*/ 0x4E, /*0000116*/ - 0x15C3, /*0012703*/ 0xFFE6, /*0177746*/ 0x15CB, /*0012713*/ 0xC, /*0000014*/ 0x15C2, /*0012702*/ 0x200, /*0001000*/ 0x1080, /*0010200*/ 0x1008, /*0010010*/ - 0xBD0, /*0005720*/ 0x2005, /*0020005*/ 0x83FC, /*0101774*/ 0x1080, /*0010200*/ 0x1201, /*0011001*/ 0x2001, /*0020001*/ 0x301, /*0001401*/ 0x0, /*0000000*/ - 0xA50, /*0005120*/ 0x2005, /*0020005*/ 0x83F9, /*0101771*/ 0x1801, /*0014001*/ 0xA41, /*0005101*/ 0x2001, /*0020001*/ 0x301, /*0001401*/ 0x0, /*0000000*/ - 0x2002, /*0020002*/ 0x2F9, /*0001371*/ 0xA0E, /*0005016*/ 0x15C4, /*0012704*/ 0xAAAA, /*0125252*/ 0x15CB, /*0012713*/ 0x18, /*0000030*/ 0x15C0, /*0012700*/ - 0x800, /*0004000*/ 0x15C2, /*0012702*/ 0x200, /*0001000*/ 0xA44, /*0005104*/ 0x1108, /*0010410*/ 0xA48, /*0005110*/ 0xA48, /*0005110*/ 0x2204, /*0021004*/ - 0x301, /*0001401*/ 0x0, /*0000000*/ 0xC1F, /*0006037*/ 0xFFEA, /*0177752*/ 0x8702, /*0103402*/ 0x0, /*0000000*/ 0x131, /*0000461*/ 0x8A4E, /*0105116*/ - 0x2F2, /*0001362*/ 0x102, /*0000402*/ 0x77, /*0000167*/ 0xFE88, /*0177210*/ 0xBD0, /*0005720*/ 0x7E93, /*0077223*/ 0x15CB, /*0012713*/ 0x24, /*0000044*/ - 0x15C0, /*0012700*/ 0xC00, /*0006000*/ 0x8A76, /*0105166*/ 0x1, /*0000001*/ 0x2E4, /*0001344*/ 0x15C2, /*0012702*/ 0x200, /*0001000*/ 0x1080, /*0010200*/ - 0x1008, /*0010010*/ 0xBD0, /*0005720*/ 0x2005, /*0020005*/ 0x83FC, /*0101774*/ 0x15C1, /*0012701*/ 0x3, /*0000003*/ 0xA0E, /*0005016*/ 0xBDF, /*0005737*/ - 0x1C6, /*0000706*/ 0x210, /*0001020*/ 0x15CE, /*0012716*/ 0x18, /*0000030*/ 0x1080, /*0010200*/ 0xA48, /*0005110*/ 0xA48, /*0005110*/ 0x2008, /*0020010*/ - 0x301, /*0001401*/ 0x0, /*0000000*/ 0xBD0, /*0005720*/ 0xC1F, /*0006037*/ 0xFFEA, /*0177752*/ 0x8702, /*0103402*/ 0x0, /*0000000*/ 0x108, /*0000410*/ - 0x2005, /*0020005*/ 0x83F3, /*0101763*/ 0x138B, /*0011613*/ 0xA0E, /*0005016*/ 0x7E51, /*0077121*/ 0x104, /*0000404*/ 0x0, /*0000000*/ 0x102, /*0000402*/ - 0x15CB, /*0012713*/ 0xC, /*0000014*/ 0x17C0, /*0013700*/ 0x1C0, /*0000700*/ 0x17C1, /*0013701*/ 0x1C2, /*0000702*/ 0x17C4, /*0013704*/ 0x1C4, /*0000704*/ - 0x74, /*0000164*/ 0x2, /*0000002*/ 0x17C4, /*0013704*/ 0xFF78, /*0177570*/ 0x45C4, /*0042704*/ 0xFE00, /*0177000*/ 0x55C4, /*0052704*/ 0xF600, /*0173000*/ - 0x97C0, /*0113700*/ 0xFF79, /*0177571*/ 0xC80, /*0006200*/ 0xA1, /*0000241*/ 0x4C, /*0000114*/ 0x0, /*0000000*/ 0x4230, /*0041060*/ 0x2A2D /*0025055*/ + 0x0501, /*0002401*/ 0x0301, /*0001401*/ 0x0000, /*0000000*/ 0x0C42, /*0006102*/ 0x8601, /*0103001*/ 0x0501, /*0002401*/ 0x0000, /*0000000*/ 0x6083, /*0060203*/ + 0x0A83, /*0005203*/ 0x0A43, /*0005103*/ 0x60C1, /*0060301*/ 0x8701, /*0103401*/ 0x0701, /*0003401*/ 0x0000, /*0000000*/ 0x0C04, /*0006004*/ 0x5103, /*0050403*/ + 0x6143, /*0060503*/ 0x0A83, /*0005203*/ 0x8702, /*0103402*/ 0x0AC1, /*0005301*/ 0x0501, /*0002401*/ 0x0000, /*0000000*/ 0x0A40, /*0005100*/ 0x8301, /*0101401*/ + 0x0000, /*0000000*/ 0x4001, /*0040001*/ 0x6041, /*0060101*/ 0x0601, /*0003001*/ 0x0701, /*0003401*/ 0x0000, /*0000000*/ 0x00C1, /*0000301*/ 0x2057, /*0020127*/ + 0x5455, /*0052125*/ 0x0204, /*0001004*/ 0x3105, /*0030405*/ 0x0602, /*0003002*/ 0x0A45, /*0005105*/ 0x0201, /*0001001*/ 0x0000, /*0000000*/ 0x95C0, /*0112700*/ + 0xFF01, /*0177401*/ 0x8001, /*0100001*/ 0x0000, /*0000000*/ 0x7E02, /*0077002*/ 0x0A01, /*0005001*/ 0x0A81, /*0005201*/ 0x7E02, /*0077002*/ 0x0BC0, /*0005700*/ + 0x0202, /*0001002*/ 0x0BC1, /*0005701*/ 0x0301, /*0001401*/ 0x0000, /*0000000*/ 0x15C6, /*0012706*/ 0x01FE, /*0000776*/ 0x09F7, /*0004767*/ 0x0002, /*0000002*/ + 0x0000, /*0000000*/ 0x25CE, /*0022716*/ 0x00D0, /*0000320*/ 0x0301, /*0001401*/ 0x0000, /*0000000*/ 0x15CE, /*0012716*/ 0x00E2, /*0000342*/ 0x0087, /*0000207*/ + 0x0000, /*0000000*/ 0x0A26, /*0005046*/ 0x15E6, /*0012746*/ 0x00EC, /*0000354*/ 0x0002, /*0000002*/ 0x0000, /*0000000*/ 0x005F, /*0000137*/ 0x00F2, /*0000362*/ + 0x0080, /*0000200*/ 0x15C5, /*0012705*/ 0xE000, /*0160000*/ 0x0A1F, /*0005037*/ 0x0006, /*0000006*/ 0x15DF, /*0012737*/ 0x0100, /*0000400*/ 0x0004, /*0000004*/ + 0x15C6, /*0012706*/ 0x01FE, /*0000776*/ 0x0BE5, /*0005745*/ 0x15DF, /*0012737*/ 0x01CC, /*0000714*/ 0x004C, /*0000114*/ 0x0A1F, /*0005037*/ 0x004E, /*0000116*/ + 0x15C3, /*0012703*/ 0xFFE6, /*0177746*/ 0x15CB, /*0012713*/ 0x000C, /*0000014*/ 0x15C2, /*0012702*/ 0x0200, /*0001000*/ 0x1080, /*0010200*/ 0x1008, /*0010010*/ + 0x0BD0, /*0005720*/ 0x2005, /*0020005*/ 0x83FC, /*0101774*/ 0x1080, /*0010200*/ 0x1201, /*0011001*/ 0x2001, /*0020001*/ 0x0301, /*0001401*/ 0x0000, /*0000000*/ + 0x0A50, /*0005120*/ 0x2005, /*0020005*/ 0x83F9, /*0101771*/ 0x1801, /*0014001*/ 0x0A41, /*0005101*/ 0x2001, /*0020001*/ 0x0301, /*0001401*/ 0x0000, /*0000000*/ + 0x2002, /*0020002*/ 0x02F9, /*0001371*/ 0x0A0E, /*0005016*/ 0x15C4, /*0012704*/ 0xAAAA, /*0125252*/ 0x15CB, /*0012713*/ 0x0018, /*0000030*/ 0x15C0, /*0012700*/ + 0x0800, /*0004000*/ 0x15C2, /*0012702*/ 0x0200, /*0001000*/ 0x0A44, /*0005104*/ 0x1108, /*0010410*/ 0x0A48, /*0005110*/ 0x0A48, /*0005110*/ 0x2204, /*0021004*/ + 0x0301, /*0001401*/ 0x0000, /*0000000*/ 0x0C1F, /*0006037*/ 0xFFEA, /*0177752*/ 0x8702, /*0103402*/ 0x0000, /*0000000*/ 0x0131, /*0000461*/ 0x8A4E, /*0105116*/ + 0x02F2, /*0001362*/ 0x0102, /*0000402*/ 0x0077, /*0000167*/ 0xFE88, /*0177210*/ 0x0BD0, /*0005720*/ 0x7E93, /*0077223*/ 0x15CB, /*0012713*/ 0x0024, /*0000044*/ + 0x15C0, /*0012700*/ 0x0C00, /*0006000*/ 0x8A76, /*0105166*/ 0x0001, /*0000001*/ 0x02E4, /*0001344*/ 0x15C2, /*0012702*/ 0x0200, /*0001000*/ 0x1080, /*0010200*/ + 0x1008, /*0010010*/ 0x0BD0, /*0005720*/ 0x2005, /*0020005*/ 0x83FC, /*0101774*/ 0x15C1, /*0012701*/ 0x0003, /*0000003*/ 0x0A0E, /*0005016*/ 0x0BDF, /*0005737*/ + 0x01C6, /*0000706*/ 0x0210, /*0001020*/ 0x15CE, /*0012716*/ 0x0018, /*0000030*/ 0x1080, /*0010200*/ 0x0A48, /*0005110*/ 0x0A48, /*0005110*/ 0x2008, /*0020010*/ + 0x0301, /*0001401*/ 0x0000, /*0000000*/ 0x0BD0, /*0005720*/ 0x0C1F, /*0006037*/ 0xFFEA, /*0177752*/ 0x8702, /*0103402*/ 0x0000, /*0000000*/ 0x0108, /*0000410*/ + 0x2005, /*0020005*/ 0x83F3, /*0101763*/ 0x138B, /*0011613*/ 0x0A0E, /*0005016*/ 0x7E51, /*0077121*/ 0x0104, /*0000404*/ 0x0000, /*0000000*/ 0x0102, /*0000402*/ + 0x15CB, /*0012713*/ 0x000C, /*0000014*/ 0x17C0, /*0013700*/ 0x01C0, /*0000700*/ 0x17C1, /*0013701*/ 0x01C2, /*0000702*/ 0x17C4, /*0013704*/ 0x01C4, /*0000704*/ + 0x0074, /*0000164*/ 0x0002, /*0000002*/ 0x17C4, /*0013704*/ 0xFF78, /*0177570*/ 0x45C4, /*0042704*/ 0xFE00, /*0177000*/ 0x55C4, /*0052704*/ 0xF600, /*0173000*/ + 0x97C0, /*0113700*/ 0xFF79, /*0177571*/ 0x0C80, /*0006200*/ 0x00A1, /*0000241*/ 0x004C, /*0000114*/ 0x0000, /*0000000*/ 0x4230, /*0041060*/ 0x2A2D /*0025055*/ ]; /** @@ -187,13 +127,9 @@ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg) device.kw11_interrupt(); }); - switch(this.sDeviceName) { - case DevicePDP11.UNIBUS_NAME: - default: - bus.addIOTable(this, DevicePDP11.UNIBUS_IOTABLE); - bus.addIODefaultHandlers(this.reset.bind(this), this.access.bind(this)); - break; - } + bus.addIOTable(this, DevicePDP11.UNIBUS_IOTABLE); + bus.addResetHandler(this.reset.bind(this)); + this.setReady(); }; @@ -247,16 +183,84 @@ DevicePDP11.prototype.readMMR0 = function(addr) * @param {number} addr (eg, PDP11.UNIBUS.MMR0 or 177572) */ DevicePDP11.prototype.writeMMR0 = function(data, addr) +{ + this.cpu.setMMR0(data); + this.updateDisplayMode(); +}; + +/** + * readMMR1(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.MMR1 or 177574) + * @return {number} + */ +DevicePDP11.prototype.readMMR1 = function(addr) +{ + return this.cpu.getMMR1(); +}; + +/** + * readMMR2(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.MMR2 or 177576) + * @return {number} + */ +DevicePDP11.prototype.readMMR2 = function(addr) +{ + return this.cpu.regMMR2; +}; + +/** + * writeMMR2(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.MMR2 or 177576) + */ +DevicePDP11.prototype.writeMMR2 = function(data, addr) +{ + this.cpu.regMMR2 = data; +}; + +/** + * readMMR3(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.MMR3 or 172516) + * @return {number} + */ +DevicePDP11.prototype.readMMR3 = function(addr) +{ + return this.cpu.regMMR3; +}; + +/** + * writeMMR3(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.MMR3 or 172516) + */ +DevicePDP11.prototype.writeMMR3 = function(data, addr) +{ + this.cpu.setMMR3(data); + this.updateDisplayMode(); +}; + +/** + * updateDisplayMode() + * + * @this {DevicePDP11} + */ +DevicePDP11.prototype.updateDisplayMode = function() { /* - * Set idx to 1 (22-bit), 2 (18-bit), or 4 (16-bit) + * Set bit to 1 (22-bit), 2 (18-bit), or 4 (16-bit) */ - var idx = 4; - data = this.cpu.setMMR0(data); - if (data & PDP11.MMR0.ENABLED | PDP11.MMR0.DSTMODE) { - idx = (this.cpu.regMMR3 & PDP11.MMR3.MMU_22BIT)? 1 : 2; - } - this.display.misc = (this.display.misc & ~7) | idx; + var bit = this.cpu.mmuEnable? ((this.cpu.regMMR3 & PDP11.MMR3.MMU_22BIT)? 1 : 2) : 4; + this.display.misc = (this.display.misc & ~7) | bit; }; /** @@ -580,6 +584,377 @@ DevicePDP11.prototype.writeUDSAR = function(data, addr) this.cpu.mmuPDR[3][reg] &= 0xff0f; }; +/** + * readRSET0(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.R0SET0--R5SET0 or 177700--177705) + * @return {number} + */ +DevicePDP11.prototype.readRSET0 = function(addr) +{ + var data; + var reg = addr & 7; + if (this.cpu.regPSW & PDP11.PSW.REGSET) { + data = this.cpu.regsAlt[reg]; + } else { + data = this.cpu.regsGen[reg]; + } + return data; +}; + +/** + * writeRSET0(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.R0SET0--R5SET0 or 177700--177705) + */ +DevicePDP11.prototype.writeRSET0 = function(data, addr) +{ + var reg = addr & 7; + if (this.cpu.regPSW & PDP11.PSW.REGSET) { + this.cpu.regsAlt[reg] = data; + } else { + this.cpu.regsGen[reg] = data; + } +}; + +/** + * readR6KERNEL(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.R6KERNEL or 177706) + * @return {number} + */ +DevicePDP11.prototype.readR6KERNEL = function(addr) +{ + var data; + if (!(this.cpu.regPSW & PDP11.PSW.CMODE)) { // Kernel Mode + data = this.cpu.regsGen[6]; + } else { + data = this.cpu.regsAltStack[0]; + } + return data; +}; + +/** + * writeR6KERNEL(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.R6KERNEL or 177706) + */ +DevicePDP11.prototype.writeR6KERNEL = function(data, addr) +{ + if (!(this.cpu.regPSW & PDP11.PSW.CMODE)) { // Kernel Mode + this.cpu.regsGen[6] = data; + } else { + this.cpu.regsAltStack[0] = data; + } +}; + +/** + * readR7KERNEL(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.R7KERNEL or 177707) + * @return {number} + */ +DevicePDP11.prototype.readR7KERNEL = function(addr) +{ + return this.cpu.regsGen[7]; +}; + +/** + * writeR7KERNEL(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.R7KERNEL or 177707) + */ +DevicePDP11.prototype.writeR7KERNEL = function(data, addr) +{ + this.cpu.regsGen[7] = data; +}; + +/** + * readRSET1(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.R0SET1--R5SET1 or 177710--177715) + * @return {number} + */ +DevicePDP11.prototype.readRSET1 = function(addr) +{ + var data; + var reg = addr & 7; + if (this.cpu.regPSW & PDP11.PSW.REGSET) { + data = this.cpu.regsGen[reg]; + } else { + data = this.cpu.regsAlt[reg]; + } + return data; +}; + +/** + * writeRSET1(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.R0SET1--R5SET1 or 177710--177715) + */ +DevicePDP11.prototype.writeRSET1 = function(data, addr) +{ + var reg = addr & 7; + if (this.cpu.regPSW & PDP11.PSW.REGSET) { + this.cpu.regsGen[reg] = data; + } else { + this.cpu.regsAlt[reg] = data; + } +}; + +/** + * readR6SUPER(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.R6SUPER or 177716) + * @return {number} + */ +DevicePDP11.prototype.readR6SUPER = function(addr) +{ + var data; + if (((this.cpu.regPSW & PDP11.PSW.CMODE) >> PDP11.PSW.SHIFT.CMODE) == PDP11.MODE.SUPER) { + data = this.cpu.regsGen[6]; + } else { + data = this.cpu.regsAltStack[1]; + } + return data; +}; + +/** + * writeR6SUPER(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.R6SUPER or 177716) + */ +DevicePDP11.prototype.writeR6SUPER = function(data, addr) +{ + if (((this.cpu.regPSW & PDP11.PSW.CMODE) >> PDP11.PSW.SHIFT.CMODE) == PDP11.MODE.SUPER) { + this.cpu.regsGen[6] = data; + } else { + this.cpu.regsAltStack[1] = data; + } +}; + +/** + * readR6USER(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.R6USER or 177717) + * @return {number} + */ +DevicePDP11.prototype.readR6USER = function(addr) +{ + var data; + if (((this.cpu.regPSW & PDP11.PSW.CMODE) >> PDP11.PSW.SHIFT.CMODE) == PDP11.MODE.USER) { + data = this.cpu.regsGen[6]; + } else { + data = this.cpu.regsAltStack[3]; + } + return data; +}; + +/** + * writeR6USER(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.R6USER or 177717) + */ +DevicePDP11.prototype.writeR6USER = function(data, addr) +{ + if (((this.cpu.regPSW & PDP11.PSW.CMODE) >> PDP11.PSW.SHIFT.CMODE) == PDP11.MODE.USER) { + this.cpu.regsGen[6] = data; + } else { + this.cpu.regsAltStack[3] = data; + } +}; + +/** + * readCTRL(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.LAERR--UNDEF2 or 177740--177756) + * @return {number} + */ +DevicePDP11.prototype.readCTRL = function(addr) +{ + var reg = (addr - PDP11.UNIBUS.LAERR) >> 1; + return this.cpu.regsControl[reg]; +}; + +/** + * writeCTRL(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.LAERR--UNDEF2 or 177740--177756) + */ +DevicePDP11.prototype.writeCTRL = function(data, addr) +{ + var reg = (addr - PDP11.UNIBUS.LAERR) >> 1; + this.cpu.regsControl[reg] = data; +}; + +/** + * readSIZE(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.LSIZE--HSIZE or 177760--177762) + * @return {number} + */ +DevicePDP11.prototype.readSIZE = function(addr) +{ + return addr == PDP11.UNIBUS.LSIZE? ((BusPDP11.MAX_MEMORY >> 6) - 1) : 0; +}; + +/** + * writeSIZE(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.LSIZE--HSIZE or 177760--177762) + */ +DevicePDP11.prototype.writeSIZE = function(data, addr) +{ +}; + +/** + * readSYSID(addr) + * + * TODO: For SYSID, we currently ignore writes and return 1 on reads + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.SYSID or 177764) + * @return {number} + */ +DevicePDP11.prototype.readSYSID = function(addr) +{ + return 1; +}; + +/** + * writeSYSID(data, addr) + * + * TODO: For SYSID, we currently ignore writes and return 1 on reads + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.SYSID or 177764) + */ +DevicePDP11.prototype.writeSYSID = function(data, addr) +{ +}; + +/** + * readCPUERR(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.CPUERR or 177766) + * @return {number} + */ +DevicePDP11.prototype.readCPUERR = function(addr) +{ + return this.cpu.regErr; +}; + +/** + * writeCPUERR(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.CPUERR or 177766) + */ +DevicePDP11.prototype.writeCPUERR = function(data, addr) +{ + this.cpu.regErr = 0; // TODO: Confirm that writes always zero the register +}; + +/** + * readMB(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.MB or 177770) + * @return {number} + */ +DevicePDP11.prototype.readMB = function(addr) +{ + return this.cpu.regMB; +}; + +/** + * writeMB(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.MB or 177770) + */ +DevicePDP11.prototype.writeMB = function(data, addr) +{ + if (!(addr & 0x1)) data &= 0xff; // Required for KB11-CM without MFPT instruction + this.cpu.regMB = data; +}; + +/** + * readPIR(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.PIR or 177772) + * @return {number} + */ +DevicePDP11.prototype.readPIR = function(addr) +{ + return this.cpu.getPIR(); +}; + +/** + * writePIR(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.PIR or 177772) + */ +DevicePDP11.prototype.writePIR = function(data, addr) +{ + this.cpu.setPIR(data); +}; + +/** + * readSL(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, PDP11.UNIBUS.SL or 177774) + * @return {number} + */ +DevicePDP11.prototype.readSL = function(addr) +{ + return this.cpu.getSL(); +}; + +/** + * writeSL(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.SL or 177774) + */ +DevicePDP11.prototype.writeSL = function(data, addr) +{ + this.cpu.setSL(data); +}; + /** * readPSW(addr) * @@ -606,381 +981,6 @@ DevicePDP11.prototype.writePSW = function(data, addr) this.cpu.opFlags |= PDP11.OPFLAG.NO_FLAGS; }; -/** - * rk11_go() - * - * @this {DevicePDP11} - */ -DevicePDP11.prototype.rk11_go = function() -{ - var rk11 = this.rk11; - var sector, address, count; - var drive = (rk11.rkda >> 13) & 7; - if (typeof rk11.meta[drive] === "undefined") { - rk11.meta[drive] = { - "cache": [], - "postProcess": this.rk11_end, - "drive": drive, - "blocksize": 256, - "mapped": 0, - "maxblock": rk11.TRACKS[drive] * rk11.SECTORS[drive], - "url": "rk" + drive + ".dsk" - }; - } - rk11.rkcs &= ~0x80; // turn off done bit - switch ((rk11.rkcs >> 1) & 7) { // function code - case 0: // controller reset - rk11.rkds = 0x9C0; /*04700*/ // Set bits 6, 7, 8, 11 - rk11.rker = 0; // - rk11.rkcs = 0x80; /*0200*/ - rk11.rkda = 0; - break; - case 1: // write - if (((rk11.rkda >> 4) & 0x1ff) >= rk11.TRACKS[drive]) { - rk11.rker |= 0x8040; // NXC - rk11.rkcs |= 0xc000; // err - break; - } - if ((rk11.rkda & 0xf) >= rk11.SECTORS[drive]) { - rk11.rker |= 0x8020; // NXS - rk11.rkcs |= 0xc000; // err - break; - } - sector = (((rk11.rkda >> 4) & 0x1ff) * rk11.SECTORS[drive] + (rk11.rkda & 0xf)); - address = (((rk11.rkcs & 0x30)) << 12) | rk11.rkba; - count = (0x10000 - rk11.rkwc) & 0xffff; - this.writeData(rk11.meta[drive], sector, address, count); - return; - case 2: // read - if (((rk11.rkda >> 4) & 0x1ff) >= rk11.TRACKS[drive]) { - rk11.rker |= 0x8040; // NXC - rk11.rkcs |= 0xc000; // err - break; - } - if ((rk11.rkda & 0xf) >= rk11.SECTORS[drive]) { - rk11.rker |= 0x8020; // NXS - rk11.rkcs |= 0xc000; // err - break; - } - sector = (((rk11.rkda >> 4) & 0x1ff) * rk11.SECTORS[drive] + (rk11.rkda & 0xf)); - address = (((rk11.rkcs & 0x30)) << 12) | rk11.rkba; - count = (0x10000 - rk11.rkwc) & 0xffff; - this.readData(rk11.meta[drive], sector, address, count); - return; - case 3: // Write Check - break; - case 4: // Seek - complete immediately - break; - default: - break; - } - rk11.rkds = (drive << 13) | (rk11.rkds & 0x1ff0) | ((rk11.rkda % 9) & 0xf); - this.cpu.interrupt(20, 5, 0x90, /*0220*/ function() { - rk11.rkcs = (rk11.rkcs & 0xfffe) | 0x80; // turn off go & set done - return !!(rk11.rkcs & 0x40); - }); -}; - -/** - * rk11_end(err, meta, block, address, count) - * - * @this {DevicePDP11} - * @param {number} err - * @param {Object} meta - * @param {number} block - * @param {number} address - * @param {number} count - */ -DevicePDP11.prototype.rk11_end = function(err, meta, block, address, count) -{ - var rk11 = this.rk11; - rk11.rkba = address & 0xffff; - rk11.rkcs = (rk11.rkcs & ~0x30) | ((address >> 12) & 0x30); - rk11.rkwc = (0x10000 - count) & 0xffff; - switch (err) { - case 1: // read error - rk11.rker |= 0x8100; // Report TE (Timing error) - rk11.rkcs |= 0xc000; // err - break; - case 2: // NXM - rk11.rker |= 0x8400; // NXM - rk11.rkcs |= 0xc000; // err - break; - } - this.cpu.interrupt(20, 5, 0x90, /*0220*/ function() { - rk11.rkcs = (rk11.rkcs & 0xfffe) | 0x80; // turn off go & set done - return !!(rk11.rkcs & 0x40); - }); -}; - -/** - * rl11_go() - * - * @this {DevicePDP11} - */ -DevicePDP11.prototype.rl11_go = function() -{ - var rl11 = this.rl11; - var sector, address, count; - var drive = (rl11.csr >> 8) & 3; - rl11.csr &= ~0x1; // ready bit (0!) - if (typeof rl11.meta[drive] === "undefined") { - rl11.meta[drive] = { - "cache": [], - "postProcess": this.rl11_end, - "drive": drive, - "blocksize": 128, - "mapped": 1, - "maxblock": rl11.TRACKS[drive] * rl11.SECTORS[drive], - "url": "rl" + drive + ".dsk" - }; - } - switch ((rl11.csr >> 1) & 7) { // function code - case 0: // no op - break; - case 1: // write check - break; - case 2: // get status - if (rl11.mpr & 8) rl11.csr &= 0x3f; - rl11.mpr = rl11.STATUS[drive] | (rl11.DAR & 0x40) /*0100*/; // bit 6 Head Select bit 7 Drive Type 1=rl02 - break; - case 3: // seek - if ((rl11.dar & 3) == 1) { - if (rl11.dar & 4) { - rl11.DAR = ((rl11.DAR + (rl11.dar & 0xff80)) & 0xff80) | ((rl11.dar << 2) & 0x40); - } else { - rl11.DAR = ((rl11.DAR - (rl11.dar & 0xff80)) & 0xff80) | ((rl11.dar << 2) & 0x40); - } - rl11.dar = rl11.DAR; - } - break; - case 4: // read header - rl11.mpr = rl11.DAR; - break; - case 5: // write - if ((rl11.dar >> 6) >= rl11.TRACKS[drive]) { - rl11.csr |= 0x9400; // HNF - break; - } - if ((rl11.dar & 0x3f) >= rl11.SECTORS[drive]) { - rl11.csr |= 0x9400; // HNF - break; - } - sector = ((rl11.dar >> 6) * rl11.SECTORS[drive]) + (rl11.dar & 0x3f); - address = (((rl11.bae & 0x3f)) << 16) | rl11.bar; // 22 bit mode - count = (0x10000 - rl11.mpr) & 0xffff; - this.writeData(rl11.meta[drive], sector, address, count); - return; - case 6: // read - if ((rl11.dar >> 6) >= rl11.TRACKS[drive]) { - rl11.csr |= 0x9400; // HNF - break; - } - if ((rl11.dar & 0x3f) >= rl11.SECTORS[drive]) { - rl11.csr |= 0x9400; // HNF - break; - } - sector = ((rl11.dar >> 6) * rl11.SECTORS[drive]) + (rl11.dar & 0x3f); - address = (((rl11.bae & 0x3f)) << 16) | rl11.bar; // 22 bit mode - count = (0x10000 - rl11.mpr) & 0xffff; - this.readData(rl11.meta[drive], sector, address, count); - return; - case 7: // Read data without header check - break; - } - this.cpu.interrupt(20, 5, 0x70, /*0160*/ function() { - rl11.csr |= 0x81; // turn off go & set ready - return !!(rl11.csr & 0x40); - }); -}; - -/** - * rl11_end(err, meta, block, address, count) - * - * @this {DevicePDP11} - * @param {number} err - * @param {Object} meta - * @param {number} block - * @param {number} address - * @param {number} count - */ -DevicePDP11.prototype.rl11_end = function(err, meta, block, address, count) -{ - var rl11 = this.rl11; - var sector = block; - rl11.bar = address & 0xffff; - rl11.csr = (rl11.csr & ~0x30) | ((address >> 12) & 0x30); - rl11.bae = (address >> 16) & 0x3f; // 22 bit mode - rl11.dar = ((~~(sector / rl11.SECTORS[meta.drive])) << 6) | (sector % rl11.SECTORS[meta.drive]); - rl11.DAR = rl11.dar; - rl11.mpr = (0x10000 - count) & 0xffff; - switch (err) { - case 1: // read error - rl11.csr |= 0x8400; // Report operation incomplete - break; - case 2: // NXM - rl11.csr |= 0xa000; // NXM - break; - } - this.cpu.interrupt(20, 5, 0x70, /*0160*/ function() { - rl11.csr |= 0x81; // turn off go & set ready - return !!(rl11.csr & 0x40); - }); -}; - -/** - * rp11_init() - * - * @this {DevicePDP11} - */ -DevicePDP11.prototype.rp11_init = function() -{ - var rp11 = this.rp11; - rp11.rpcs1 = 0x880; - rp11.rpcs2 = 0; - rp11.rpds = [0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0]; - rp11.rper1 = [0, 0, 0, 0, 0, 0, 0, 0]; - rp11.rpas = rp11.rpwc = rp11.rpba = rp11.rpbae = rp11.rpcs3 = 0; -}; - -/** - * rp11_init() - * - * @this {DevicePDP11} - * @param {number} drive - * @param {number} flags - */ -DevicePDP11.prototype.rp11_attention = function(drive, flags) -{ - var rp11= this.rp11; - rp11.rpas |= 1 << drive; - rp11.rpds[drive] |= 0x8080; - if (flags) { - rp11.rper1[drive] |= flags; - rp11.rpds[drive] |= 0x4000; - } -}; - -//optional increment :-( -// cs1 is half in drive and half in controller :-( - -/** - * rp11_go() - * - * @this {DevicePDP11} - * @param {number} drive - */ -DevicePDP11.prototype.rp11_go = function(drive) -{ - var rp11 = this.rp11; - var sector, address, count; - rp11.rpcs1 &= ~0x4080; // Turn TRE & ready off - rp11.rpcs2 &= ~0x800; // Turn off NEM (NXM) - rp11.rpds[drive] &= ~0x480; // Turn off LST & ATA - this.cpu.interrupt(-1, 0, 0xAC) /*0254*/; //remove pending interrupt - if (typeof rp11.meta[drive] === "undefined") { - rp11.meta[drive] = { - "cache": [], - "postProcess": this.rp11_end, - "drive": drive, - "blocksize": 256, - "mapped": 0, - "maxblock": rp11.CYLINDERS[0] * rp11.SURFACES[0] * rp11.SECTORS[0], - "url": "rp" + drive + ".dsk" - }; - } - switch (rp11.rpcs1 & 0x3f) { // function code - case 0x1: /*01*/ // NULL - break; - case 0x5: /*05*/ // seek - rp11.rpcc[drive] = rp11.rpdc[drive]; - rp11.rpcs1 |= 0x8080; - rp11.rpds[drive] |= 0x8080; // ATA - rp11.rpas |= 1 << drive; - break; - case 0x9: /*011*/ // init - this.rp11_init(); - break; - case 0x13: /*023*/ // pack ack - rp11.rpds[drive] |= 0x40; // set VV - break; - case 0x31: /*061*/ // write - if (rp11.rpdc[drive] >= rp11.CYLINDERS[0] || (rp11.rpda[drive] >> 8) >= rp11.SURFACES[0] || - (rp11.rpda[drive] & 0xff) >= rp11.SECTORS[0]) { - rp11.rper1[drive] |= 0x400; // invalid sector address - rp11.rpcs1 |= 0xc000; // set SC & TRE - break; - } - sector = (rp11.rpdc[drive] * rp11.SURFACES[0] + (rp11.rpda[drive] >> 8)) * rp11.SECTORS[0] + (rp11.rpda[drive] & 0xff); - address = ((rp11.rpbae & 0x3f) << 16) | rp11.rpba; // 22 bit mode - count = (0x10000 - rp11.rpwc) & 0xffff; - this.writeData(rp11.meta[drive], sector, address, count); - return; - case 0x39: /*071*/ // read - if (rp11.rpdc[drive] >= rp11.CYLINDERS[0] || (rp11.rpda[drive] >> 8) >= rp11.SURFACES[0] || - (rp11.rpda[drive] & 0xff) >= rp11.SECTORS[0]) { - rp11.rper1[drive] |= 0x400; // invalid sector address - rp11.rpcs1 |= 0xc000; // set SC & TRE - break; - } - sector = (rp11.rpdc[drive] * rp11.SURFACES[0] + (rp11.rpda[drive] >> 8)) * rp11.SECTORS[0] + (rp11.rpda[drive] & 0xff); - address = ((rp11.rpbae & 0x3f) << 16) | rp11.rpba; // 22 bit mode - count = (0x10000 - rp11.rpwc) & 0xffff; - this.readData(rp11.meta[drive], sector, address, count); - return; - default: - break; - } - this.cpu.interrupt(3, 5, 0xAC, /*0254*/ function() { - rp11.rpcs1 = (rp11.rpcs1 & 0xfffe) | 0x80; // Turn go off and ready on - rp11.rpds[drive] |= 0x80; // ATA - return !!(rp11.rpcs1 & 0x40); - }); -}; - -/** - * rp11_end() - * - * @this {DevicePDP11} - * @param {number} err - * @param {Object} meta - * @param {number} block - * @param {number} address - * @param {number} count - */ -DevicePDP11.prototype.rp11_end = function(err, meta, block, address, count) -{ - var rp11 = this.rp11; - var surface, sector; - rp11.rpwc = (0x10000 - count) & 0xffff; - rp11.rpba = address & 0xffff; - rp11.rpcs1 = (rp11.rpcs1 & ~0x300) | ((address >> 8) & 0x300); - rp11.rpbae = (address >> 16) & 0x3f; // 22 bit mode - sector = ~~(block / rp11.SECTORS[0]); - surface = ~~(sector / rp11.SURFACES[0]); - rp11.rpda[meta.drive] = ((sector % rp11.SURFACES[0]) << 8) | (block % rp11.SECTORS[0]); - rp11.rpcc[meta.drive] = rp11.rpdc[meta.drive] = surface; - rp11.rpas |= 1 << meta.drive; - if (block >= meta.maxblock - 1) { - rp11.rpds[meta.drive] |= 0x400; // LST - } - switch (err) { - case 1: // read error - rp11.rpcs2 |= 0x200; // MXF Missed transfer - rp11.rpcs1 |= 0xc000; // set SC & TRE - break; - case 2: // NXM - rp11.rpcs2 |= 0x800; // NEM (NXM) - rp11.rpcs1 |= 0xc000; // set SC & TRE - break; - } - this.cpu.interrupt(20, 5, 0xAC, /*0254*/ function() { - rp11.rpds[meta.drive] |= 0x80; - rp11.rpcs1 = (rp11.rpcs1 & 0xfffe) | 0x80; // Turn go off and ready on - return !!(rp11.rpcs1 & 0x40); - }); -}; - /** * kw11_interrupt() * @@ -995,176 +995,6 @@ DevicePDP11.prototype.kw11_interrupt = function() } }; -/** - * getData(xhr, callback, meta, block, address, count) - * - * @this {DevicePDP11} - * @param {XMLHttpRequest} xhr - * @param {function(Object,number,number,number)} callback - * @param {Object} meta - * @param {number} block - * @param {number} address - * @param {number} count - */ -DevicePDP11.prototype.getData = function(xhr, callback, meta, block, address, count) -{ - var arrayBuffer, byteArray, blockno, word, base; - arrayBuffer = /** @type {ArrayBuffer} */ (xhr.response); - if ((xhr.status != 0 && xhr.status != 206) || !arrayBuffer) { - meta.postProcess(1, meta, block, address, count); // NXD - read error? - } else { - byteArray = new Uint8Array(arrayBuffer); - blockno = block; - for (base = 0; base < byteArray.length;) { - if (typeof meta.cache[blockno] === "undefined") { - meta.cache[blockno] = []; - for (word = 0; word < meta.blocksize; word++) { - if (base < byteArray.length) { - meta.cache[blockno][word] = (byteArray[base] & 0xff) | ((byteArray[base + 1] << 8) & 0xff00); - } else { - meta.cache[blockno][word] = 0; - } - base += 2; - } - } else { - base += meta.blocksize << 1; - } - blockno++; - } - callback(meta, block, address, count); - } -}; - -/** - * getCache(callback, meta, block, address, count) - * - * @this {DevicePDP11} - * @param {function(Object,number,number,number)} callback - * @param {Object} meta - * @param {number} block - * @param {number} address - * @param {number} count - */ -DevicePDP11.prototype.getCache = function(callback, meta, block, address, count) -{ - var device = this; - var sectors = ~~((count + meta.blocksize - 1) / meta.blocksize); - var xhr = new XMLHttpRequest(); - if (sectors < 2048 && block + 2048 < meta.maxblock) sectors = 2048; // make it a decent read - xhr.open("GET", meta.url, true); - xhr.setRequestHeader("Range", "bytes=" + ((block * meta.blocksize) << 1) + "-" + - ((((block + sectors) * meta.blocksize) << 1) - 1)); - xhr.responseType = "arraybuffer"; - xhr.onreadystatechange = function() { - if (xhr.readyState == 4 /* xhr.DONE */) { - device.getData(xhr, callback.bind(device), meta, block, address, count); - } - }; - xhr.send(null); -}; - -/** - * insertData(original, physicalAddress, data, byteFlag) - * - * @this {DevicePDP11} - * @param {number} original - * @param {number} physicalAddress - * @param {number} data - * @param {number} byteFlag - * @return {number} - */ -DevicePDP11.prototype.insertData = function(original, physicalAddress, data, byteFlag) -{ - if (physicalAddress & 1) { - if (!byteFlag) { - //log.push("TRAP 4 201 " + physicalAddress.toString(8) + " " + data.toString(8)); - this.cpu.trap(PDP11.TRAP.BUS_ERROR, 122); - } - else if (data >= 0) { - data = ((data << 8) & 0xff00) | (original & 0xff); - } else { - data = original; - } - } else { - if (data >= 0) { - if (byteFlag) { - data = (original & 0xff00) | (data & 0xff); - } - } else { - data = original; - } - } - return data; -}; - -/** - * readData(meta, block, address, count) - * - * @this {DevicePDP11} - * @param {Object} meta - * @param {number} block - * @param {number} address - * @param {number} count - */ -DevicePDP11.prototype.readData = function(meta, block, address, count) -{ - var word; - while (count > 0) { - if (typeof meta.cache[block] === "undefined") { - this.getCache(this.readData, meta, block, address, count); - return; - } - for (word = 0; word < meta.blocksize && count > 0; word++) { - if (this.cpu.writeWordToPhysical((meta.mapped? this.cpu.mapUnibus(address) : address), meta.cache[block][word]) < 0) { - meta.postProcess(2, meta, block, address, count); // NXM - return; - } - //if (meta.increment) { - address += 2; - //} - --count; - } - block++; - } - meta.postProcess(0, meta, block, address, count); // success -}; - -/** - * writeData(meta, block, address, count) - * - * @this {DevicePDP11} - * @param {Object} meta - * @param {number} block - * @param {number} address - * @param {number} count - */ -DevicePDP11.prototype.writeData = function(meta, block, address, count) -{ - var word, data; - while (count > 0) { - if (typeof meta.cache[block] === "undefined") { - meta.cache[block] = []; - for (word = 0; word < meta.blocksize; word++) { - meta.cache[block][word] = 0; - } - } - for (word = 0; word < meta.blocksize && count > 0; word++) { - data = this.cpu.readWordFromPhysical((meta.mapped? this.cpu.mapUnibus(address) : address)); - if (data < 0) { - meta.postProcess(2, meta, block, address, count); // NXM - return; - } - meta.cache[block][word] = data; - //if (meta.increment) { - address += 2; - //} - --count; - } - block++; - } - meta.postProcess(0, meta, block, address, count); // success -}; - /** * reset() * @@ -1176,611 +1006,6 @@ DevicePDP11.prototype.reset = function() { this.display.misc = (this.display.misc & ~0x77) | 0x14; // kernel 16 bit this.kw11.lks = 0; - this.rk11.rkcs = 0x80; /*0200*/ - this.rl11.csr = 0x80; - this.rp11_init(); -}; - -/** - * access(physicalAddress, data, byteFlag) - * - * Formerly access_iopage(). - * - * @this {DevicePDP11} - * @param {number} physicalAddress - * @param {number} data (-1 if read) - * @param {number} byteFlag (zero if word, non-zero if byte) - * @return {number} - */ -DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag) -{ - var result, idx; - var cpu = this.cpu; - switch (physicalAddress & ~0x3F) /*077*/ { - case 0x3FFFC0: /*017777700*/ // 017777700 - 017777777 - switch (physicalAddress & ~1) { - // - // Superseded by UNIBUS_IOTABLE (more of this code will be commented out - // as it is replaced by read/write handlers in UNIBUS_IOTABLE; stay tuned). - // - // case 0x3FFFFE: // 017777776 // PSW - // result = cpu.getPSW(); - // if (data >= 0) { - // if (physicalAddress & 1) { - // data = (data << 8) | (result & 0xff); - // } else { - // if (byteFlag) data = (result & 0xff00) | (data & 0xff); - // } - // data = (data & 0xf8ef) | (result & 0x0710); - // cpu.setPSW(data); - // return -1; // KLUDGE - no trap but abort any CC updates - // } - // break; - case 0x3FFFFC: /*017777774*/ // stack limit - if (data < 0) { - result = cpu.regSL & 0xff00; - } else { - if (physicalAddress & 1) { - data = data << 8; - } - cpu.regSL = data | 0xff; - result = 0; - } - //log.push("stack limit access "+cpu.regSL.toString(8)); - break; - case 0x3FFFFA: /*017777772*/ // PIR - if (data < 0) { - result = cpu.regPIR; - } else { - if (physicalAddress & 1) { - data = data << 8; - } - result = data & 0xfe00; - if (result) { - idx = result >> 9; - do { - result += 0x22; - } while (idx >>= 1); - } - cpu.regPIR = result; - cpu.opFlags |= PDP11.OPFLAG.INTQ; - } - break; - case 0x3FFFF6: /*017777766*/ // CPU error - if (cpu.cpuType !== 70) return cpu.trap(PDP11.TRAP.BUS_ERROR, 222); - if (data < 0) { - result = cpu.regErr; - } else { - result = cpu.regErr = 0; // TODO: Always writes as zero? - } - break; - case 0x3FFFF4: /*017777764*/ // System I/D - if (cpu.cpuType !== 70) return cpu.trap(PDP11.TRAP.BUS_ERROR, 224); - result = 1; - break; - case 0x3FFFF2: /*017777762*/ // Upper size - if (cpu.cpuType !== 70) return cpu.trap(PDP11.TRAP.BUS_ERROR, 226); - result = 0; - break; - case 0x3FFFF0: /*017777760*/ // Lower size - if (cpu.cpuType !== 70) return cpu.trap(PDP11.TRAP.BUS_ERROR, 228); - result = (BusPDP11.MAX_MEMORY >> 6) - 1; - break; - case 0x3FFFF8: /*017777770*/ // Microprogram break - if (data >= 0 && !(physicalAddress & 1)) data &= 0xff; // Required for KB11-CM without MFPT instruction - /* falls through */ - case 0x3FFFEE: /*017777756*/ // - case 0x3FFFEC: /*017777754*/ // - case 0x3FFFEA: /*017777752*/ // Hit/miss - case 0x3FFFE8: /*017777750*/ // Maintenance - case 0x3FFFE6: /*017777746*/ // Cache control - case 0x3FFFE4: /*017777744*/ // Memory system error - case 0x3FFFE2: /*017777742*/ // High error address - case 0x3FFFE0: /*017777740*/ // Low error address - if (cpu.cpuType !== 70) return cpu.trap(PDP11.TRAP.BUS_ERROR, 232); - idx = (physicalAddress - 0x3FFFE0) /*017777740*/ >> 1; - if (data < 0) { - result = cpu.controlReg[idx]; - } else { - result = this.insertData(cpu.controlReg[idx], physicalAddress, data, byteFlag); - if (result >= 0) { - cpu.controlReg[idx] = result; - } - } - break; - case 0x3FFFCE: /*017777716*/ // User and Super SP - if (physicalAddress & 1) { - if ((cpu.regPSW >> 14) & 3 == 3) { // User Mode - if (data >= 0) cpu.regsGen[6] = data; - result = cpu.regsGen[6]; - } else { - if (data >= 0) cpu.regsAltStack[3] = data; - result = cpu.regsAltStack[3]; - } - } else { - if ((cpu.regPSW >> 14) & 3 == 1) { // Super Mode - if (data >= 0) cpu.regsGen[6] = data; - result = cpu.regsGen[6]; - } else { - if (data >= 0) cpu.regsAltStack[1] = data; - result = cpu.regsAltStack[1]; - } - } - return result; - case 0x3FFFCC: /*017777714*/ - case 0x3FFFCA: /*017777712*/ - case 0x3FFFC8: /*017777710*/ // Register set 1 - idx = physicalAddress & 7; - if (cpu.regPSW & 0x800) { - if (data >= 0) cpu.regsGen[idx] = data; - result = cpu.regsGen[idx]; - } else { - if (data >= 0) cpu.regsAlt[idx] = data; - result = cpu.regsAlt[idx]; - } - return result; - case 0x3FFFC6: /*017777706*/ // Kernel SP & PC - if (physicalAddress & 1) { - if (data >= 0) cpu.regsGen[7] = data; - result = cpu.regsGen[7]; - } else { - if ((cpu.regPSW >> 14) & 3 == 0) { // Kernel Mode - if (data >= 0) cpu.regsGen[6] = data; - result = cpu.regsGen[6]; - } else { - if (data >= 0) cpu.regsAltStack[0] = data; - result = cpu.regsAltStack[0]; - } - } - return result; - case 0x3FFFC4: /*017777704*/ - case 0x3FFFC2: /*017777702*/ - case 0x3FFFC0: /*017777700*/ // Register set 0 - idx = physicalAddress & 7; - if (cpu.regPSW & 0x800) { - if (data >= 0) cpu.regsAlt[idx] = data; - result = cpu.regsAlt[idx]; - } else { - if (data >= 0) cpu.regsGen[idx] = data; - result = cpu.regsGen[idx]; - } - return result; - default: - cpu.regErr |= PDP11.CPUERR.TIMEOUT; - return cpu.trap(PDP11.TRAP.BUS_ERROR, 124); - } - break; - case 0x3FFF80: /*017777600*/ // 017777600 - 017777677 MMU user mode Map - idx = (physicalAddress >> 1) & 0x1F; /*037*/ - result = this.insertData(cpu.mmuMap[3][idx], physicalAddress, data, byteFlag); - if (result >= 0) { - cpu.mmuMap[3][idx] = result; - cpu.mmuMap[3][idx & 0xf] &= 0xff0f; - } - break; - case 0x3FFF40: /*017777500*/ // 017777500 - 017777577 - // var tty = this.tty; - var kw11 = this.kw11; - switch (physicalAddress & ~1) { - case 0x3FFF7E: /*017777576*/ // MMR2 - result = this.insertData(cpu.regMMR2, physicalAddress, data, byteFlag); - if (result >= 0) cpu.regMMR2 = result; - break; - case 0x3FFF7C: /*017777574*/ // MMR1 - result = cpu.regMMR1; - if (result & 0xff00) result = ((result << 8) | (result >> 8)) & 0xffff; - break; - // case 0x3FFF7A: /*017777572*/ // MMR0 - // cpu.regMMR0 = (cpu.regMMR0 & 0xf381) | (cpu.mmuLastMode << 5) | (cpu.mmuLastPage << 1); - // if (data < 0) { - // result = cpu.regMMR0; - // } else { - // result = this.insertData(cpu.regMMR0, physicalAddress, data, byteFlag); - // if (result >= 0) { - // cpu.regMMR0 = result &= 0xf381; - // cpu.mmuLastMode = (result >> 5) & 3; - // cpu.mmuLastPage = (result >> 1) & 0xf; - // if (result & 0x101) { - // idx = 2; // 18 bit - // if (cpu.regMMR3 & 0x10) idx = 1; // 22 bit - // if (result & 0x1) { - // cpu.mmuEnable = PDP11.ACCESS.READ | PDP11.ACCESS.WRITE; - // } else { - // cpu.mmuEnable = PDP11.ACCESS.WRITE; - // } - // } else { - // cpu.mmuEnable = 0; - // idx = 4; // 16 bit - // } - // this.display.misc = (this.display.misc & ~7) | idx; - // } - // } - // break; - case 0x3FFF78: /*017777570*/ // console display/switch; - if (data < 0) { - result = this.display.switches & 0xffff; - } else { - result = this.insertData(this.display.data, physicalAddress, data, byteFlag); - if (result >= 0) this.display.data = result; - } - break; - // case 0x3FFF76: /*017777566*/ // console xbuf - // if (data >= 0) { - // data &= 0x7f; - // if (data) { - // switch (data) { - // case 0: - // case 0xD: /*015*/ - // /* - // if (document.forms.console.line.value.length > 9000) { - // document.forms.console.line.value = document.forms.console.line.value.substring(document.forms.console.line.value.length - 8192); - // } - // */ - // break; - // case 0x8: /*010*/ - // /* - // if (!tty.del) { - // document.forms.console.line.value = document.forms.console.line.value.substring(0, document.forms.console.line.value.length - 1); - // } - // */ - // break; - // default: - // /* - // document.forms.console.line.value += String.fromCharCode(data); - // if (data == 0x0A) { - // document.forms.console.line.scrollTop = document.forms.console.line.scrollHeight; - // } - // */ - // } - // tty.del = 0; - // } - // tty.xcsr &= ~0x80; /*0200*/ - // cpu.interrupt(100, 4, 0x34, /*064*/ function() { - // tty.xcsr |= 0x80; /*0200*/ - // return !!(tty.xcsr & 0x40); /*0100*/ - // }); - // } - // result = 0; - // break; - // case 0x3FFF74: /*017777564*/ // console xcsr - // if (data < 0) { - // result = tty.xcsr; - // } else { - // result = this.insertData(tty.xcsr, physicalAddress, data, byteFlag); - // if (result >= 0) { - // if ((tty.xcsr & 0xC0) /*0300*/ == 0x80 /*0200*/&& (result & 0x40) /*0100*/) { - // cpu.interrupt(8, 4, 0x34, /*064*/ function() { - // tty.xcsr |= 0x80; /*0200*/ - // return !!(tty.xcsr & 0x40); /*0100*/ - // }); - // } - // tty.xcsr = (tty.xcsr & 0x80) /*0200*/ | (result & ~0x80) /*0200*/; - // } - // } - // break; - // case 0x3FFF72: /*017777562*/ // console rbuf - // result = 0; - // if (data < 0) { - // tty.rcsr &= ~0x80; /*0200*/ - // if (tty.rbuf.length > 0) { - // result = tty.rbuf.shift(); - // if (tty.rbuf.length > 0) { - // setTimeout(function() { - // tty.rcsr |= 0x80; /*0200*/ - // if (tty.rcsr & 0x40) /*0100*/ cpu.interrupt(40, 4, 0x30) /*060*/; - // }, 50); - // } - // } - // } - // break; - // case 0x3FFF70: /*017777560*/ // console rcsr - // if (data < 0) { - // result = tty.rcsr; - // } else { - // result = this.insertData(tty.rcsr, physicalAddress, data, byteFlag); - // if (result >= 0) tty.rcsr = (tty.rcsr & 0x80) /*0200*/ | (result & ~0x80) /*0200*/; - // } - // break; - // case 0x3FFF66: /*017777546*/ // kw11.lks - // if (data < 0) { - // result = kw11.lks; - // kw11.lks &= ~0x80; /*0200*/ - // } else { - // result = this.insertData(kw11.lks, physicalAddress, data, byteFlag); - // if (result >= 0) { - // if (result & 0x40) /*0100*/ { - // if (!kw11.init) { - // setInterval(this.kw11_interrupt.bind(this), 25); - // kw11.init = 1; - // } - // } - // kw11.lks = result & ~0x80; /*0200*/ - // } - // } - // break; - default: - cpu.regErr |= PDP11.CPUERR.TIMEOUT; - return cpu.trap(PDP11.TRAP.BUS_ERROR, 126); - } - break; - case 0x3FFF00: /*017777400*/ // 017777400 - 017777477 - var rk11 = this.rk11; - switch (physicalAddress & ~1) { - case 0x3FFF00: /*017777400*/ // rk11.rkds - result = this.insertData(rk11.rkds, physicalAddress, data, byteFlag); - if (result >= 0) rk11.rkds = result; - break; - case 0x3FFF02: /*017777402*/ // rk11.rker - result = this.insertData(rk11.rker, physicalAddress, data, byteFlag); - if (result >= 0) rk11.rker = result; - break; - case 0x3FFF04: /*017777404*/ // rk11.rkcs - result = this.insertData(rk11.rkcs, physicalAddress, data, byteFlag); - if (data >= 0 && result >= 0) { - rk11.rkcs = (result & ~0x9080) | (rk11.rkcs & 0x9080); // Bits 7 and 12 - 15 are read only - if (rk11.rkcs & 1) { - this.rk11_go(); - } - } - break; - case 0x3FFF06: /*017777406*/ // rk11.rkwc - result = this.insertData(rk11.rkwc, physicalAddress, data, byteFlag); - if (result >= 0) rk11.rkwc = result; - break; - case 0x3FFF08: /*017777410*/ // rk11.rkba - result = this.insertData(rk11.rkba, physicalAddress, data, byteFlag); - if (result >= 0) rk11.rkba = result; - break; - case 0x3FFF0A: /*017777412*/ // rk11.rkda - result = this.insertData(rk11.rkda, physicalAddress, data, byteFlag); - if (result >= 0) rk11.rkda = result; - break; - case 0x3FFF0C: /*017777414*/ // rk11.unused - break; - case 0x3FFF0E: /*017777416*/ // rk11.rkdb - result = this.insertData(rk11.rkdb, physicalAddress, data, byteFlag); - if (result >= 0) rk11.rkdb = result; - break; - default: - cpu.regErr |= PDP11.CPUERR.TIMEOUT; - return cpu.trap(PDP11.TRAP.BUS_ERROR, 128); - } - break; - case 0x3FFDC0: /*017776700*/ // 017777600 - 017777677 rp11 controller - //if (physicalAddress != 017776700) console.log("RP11 register " + physicalAddress.toString(8) + " " + data.toString(8)); - var rp11 = this.rp11; - idx = rp11.rpcs2 & 7; - switch (physicalAddress & ~1) { - case 0x3FFDC0: /*017776700*/ // rp11.rpcs1 Control status 1 - result = this.insertData(rp11.rpcs1, physicalAddress, data, byteFlag); - if (data >= 0 && result >= 0) { - rp11.rpbae = (rp11.rpbae & 0x3c) | ((result >> 8) & 0x3); - rp11.rpcs1 = (result & 0x437f) | (rp11.rpcs1 & 0x8880) | 0x800; - if (result & 1 && (rp11.rpcs1 & 0x80)) { - this.rp11_go(idx); - } else { - if ((result & 0xc0) == 0xc0) { - cpu.interrupt(0, 5, 0xAC) /*0254*/; - } - } - } - break; - case 0x3FFDC2: /*017776702*/ // rp11.rpwc Word count - result = this.insertData(rp11.rpwc, physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpwc = result; - break; - case 0x3FFDC4: /*017776704*/ // rp11.rpba Memory address - result = this.insertData(rp11.rpba, physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpba = result & 0xfffe; // must be even - break; - case 0x3FFDC6: /*017776706*/ // rp11.rpda Disk address - result = this.insertData(rp11.rpda[idx], physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpda[idx] = result & 0x1f1f; - break; - case 0x3FFDC8: /*017776710*/ // rp11.rpcs2 Control status 2 - result = this.insertData(rp11.rpcs2, physicalAddress, data, byteFlag); - if (result >= 0) { - rp11.rpcs2 = (result & 0x3f) | (rp11.rpcs2 & 0xffc0); - if (result & 0x80) /*0200*/ this.rp11_init(); - } - break; - case 0x3FFDCA: /*017776712*/ // rp11.rpds drive status - result = rp11.rpds[idx]; - break; - case 0x3FFDCC: /*017776714*/ // rp11.rper1 Error 1 - result = rp11.rper1[idx]; - break; - case 0x3FFDCE: /*017776716*/ // rp11.rpas Attention summary - result = this.insertData(rp11.rpas, physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpas = result & 0xff; - break; - case 0x3FFDD0: /*017776720*/ // rp11.rpla Look ahead - result = rp11.rpla[idx]; - break; - case 0x3FFDD2: /*017776722*/ // rp11.rpdb Data buffer - result = this.insertData(rp11.rpdb, physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpdb = result; - break; - case 0x3FFDD4: /*017776724*/ // rp11.rpmr Maintenance - result = this.insertData(rp11.rpmr[idx], physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpmr[idx] = result & 0x3ff; - break; - case 0x3FFDD6: /*017776726*/ // rp11.rpdt drive type read only - result = 0x2012; /*020022*/ // rp11.rpdt[idx]; - break; - case 0x3FFDD8: /*017776730*/ // rp11.rpsn Serial number read only - result = rp11.rpsn[idx]; - break; - case 0x3FFDDA: /*017776732*/ // rp11.rpof Offset register - result = this.insertData(rp11.rpof[idx], physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpof[idx] = result; - break; - case 0x3FFDDC: /*017776734*/ // rp11.rpdc Desired cylinder - result = this.insertData(rp11.rpdc[idx], physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpdc[idx] = result & 0x1ff; - break; - case 0x3FFDDE: /*017776736*/ // rp11.rpcc Current cylinder read only - rp11.rpcc[idx] = rp11.rpdc[idx]; - result = rp11.rpcc[idx]; - break; - case 0x3FFDE0: /*017776740*/ // rp11.rper2 Error 2 - result = rp11.rper2[idx]; - break; - case 0x3FFDE2: /*017776742*/ // rp11.rper3 Error 3 - result = rp11.rper3[idx]; - break; - case 0x3FFDE4: /*017776744*/ // rp11.rpec1 Error correction 1 read only - result = rp11.rpec1[idx]; - break; - case 0x3FFDE6: /*017776746*/ // rp11.rpec2 Error correction 2 read only - result = rp11.rpec2[idx]; - break; - case 0x3FFDE8: /*017776750*/ // rp11.rpbae Bus address extension - result = this.insertData(rp11.rpbae, physicalAddress, data, byteFlag); - if (result >= 0) { - rp11.rpbae = result & 0x3f; - rp11.rpcs1 = (rp11.rpcs1 & ~0x300) | ((result & 0x3) << 8); - } - break; - case 0x3FFDEA: /*017776752*/ // rp11.rpcs3 Control status 3 - result = this.insertData(rp11.rpcs3, physicalAddress, data, byteFlag); - if (result >= 0) rp11.rpcs3 = result; - break; - default: - cpu.regErr |= PDP11.CPUERR.TIMEOUT; - return cpu.trap(PDP11.TRAP.BUS_ERROR, 132); - } - break; - case 0x3FF900: /*017774400*/ // 017774400 - 017774477 - var rl11 = this.rl11; - switch (physicalAddress & ~1) { - case 0x3FF900: /*017774400*/ // rl11.csr - result = this.insertData(rl11.csr, physicalAddress, data, byteFlag); - if (data >= 0 && result >= 0) { - rl11.bae = (rl11.bae & 0x3c) | ((result >> 4) & 0x3); - rl11.csr = (rl11.csr & ~0x3fe) | (result & 0x3fe); - if (!(rl11.csr & 0x80)) { - this.rl11_go(); - } - } - break; - case 0x3FF902: /*017774402*/ // rl11.bar - result = this.insertData(rl11.bar, physicalAddress, data, byteFlag); - if (result >= 0) { - rl11.bar = result & 0xfffe; - } - break; - case 0x3FF904: /*017774404*/ // rl11.dar - result = this.insertData(rl11.dar, physicalAddress, data, byteFlag); - if (result >= 0) rl11.dar = result; - break; - case 0x3FF906: /*017774406*/ // rl11.mpr - result = this.insertData(rl11.mpr, physicalAddress, data, byteFlag); - if (result >= 0) rl11.mpr = result; - break; - case 0x3FF908: /*017774410*/ // rl11.bae - result = this.insertData(rl11.bae, physicalAddress, data, byteFlag); - if (result >= 0) { - rl11.bae = result & 0x3f; - rl11.csr = (rl11.csr & ~0x30) | ((rl11.bae & 0x3) << 4); - } - break; - default: - cpu.regErr |= PDP11.CPUERR.TIMEOUT; - return cpu.trap(PDP11.TRAP.BUS_ERROR, 134); - } - break; - case 0x3FF540: /*017772500*/ // 017772500 - 017772577 - switch (physicalAddress & ~1) { - case 0x3FF54E: /*017772516*/ // MMR3 - UB 22 x K S U - if (data < 0) { - result = cpu.regMMR3; - } else { - result = this.insertData(cpu.regMMR3, physicalAddress, data, byteFlag); - if (result >= 0) { - if (cpu.cpuType !== 70) result &= ~0x30; // don't allow 11/45 to do 22 bit or use unibus map - cpu.regMMR3 = result; - cpu.mmuMask[0] = (result & 4 ? 0xf : 0x7); - cpu.mmuMask[1] = (result & 2 ? 0xf : 0x7); - cpu.mmuMask[3] = (result & 1 ? 0xf : 0x7); - if (cpu.mmuEnable) { - idx = 2; // 18 bit - if (cpu.regMMR3 & 0x10) idx = 1; // 22 bit - this.display.misc = (this.display.misc & ~7) | idx; - } - } - } - break; - default: - cpu.regErr |= PDP11.CPUERR.TIMEOUT; - return cpu.trap(PDP11.TRAP.BUS_ERROR, 136); - } - break; - case 0x3FF4C0: /*017772300*/ // 017772300 - 017772377 MMU kernel mode Map - idx = (physicalAddress >> 1) & 0x1F; /*037*/ - result = this.insertData(cpu.mmuMap[0][idx], physicalAddress, data, byteFlag); - if (result >= 0) { - cpu.mmuMap[0][idx] = result; - cpu.mmuMap[0][idx & 0xf] &= 0xff0f; - } - break; - case 0x3FF480: /*017772200*/ // 017772200 - 017772277 MMU super mode Map - idx = (physicalAddress >> 1) & 0x1F; /*037*/ - result = this.insertData(cpu.mmuMap[1][idx], physicalAddress, data, byteFlag); - if (result >= 0) { - cpu.mmuMap[1][idx] = result; - cpu.mmuMap[1][idx & 0xf] &= 0xff0f; - } - break; - case 0x3FF0C0: /*017770300*/ // 017770300 - 017770377 Unibus Map - case 0x3FF080: /*017770200*/ // 017770200 - 017770277 Unibus Map - if (cpu.cpuType !== 70) return cpu.trap(PDP11.TRAP.BUS_ERROR, 234); - idx = (physicalAddress >> 2) & 0x1f; - result = cpu.unibusMap[idx]; - if (physicalAddress & 0x2) /*02*/ result = result >> 16; - result &= 0xffff; - if (data >= 0) { - result = this.insertData(result, physicalAddress, data, byteFlag); - if (result >= 0) { - if (physicalAddress & 0x2) /*02*/ { - cpu.unibusMap[idx] = (result << 16) | (cpu.unibusMap[idx] & 0xffff); - } else { - cpu.unibusMap[idx] = (cpu.unibusMap[idx] & 0xffff0000) | (result & 0xfffe); - } - } - } - break; - case 0x3FEA00: /*017765000*/ // 017765000 - 017765777 Bootstrap diagnostic - case 0x3FEA40: /*017765100*/ - case 0x3FEA80: /*017765200*/ - case 0x3FEAC0: /*017765300*/ - case 0x3FEB00: /*017765400*/ - case 0x3FEB40: /*017765500*/ - case 0x3FEB80: /*017765600*/ - case 0x3FEBC0: /*017765700*/ - if (data < 0) { - idx = (physicalAddress >> 1) & 0xff; - result = DevicePDP11.M9312[idx]; - } else { - cpu.regErr |= PDP11.CPUERR.TIMEOUT; - return cpu.trap(PDP11.TRAP.BUS_ERROR, 138); - } - break; - default: - cpu.regErr |= PDP11.CPUERR.TIMEOUT; - return cpu.trap(PDP11.TRAP.BUS_ERROR, 142); - } - if (byteFlag && result >= 0) { // make any required byte adjustment - if ((physicalAddress & 1)) { - result = result >> 8; - } else { - result &= 0xff; - } - } - if (typeof result === "undefined") { - cpu.panic(76); - } - return result; }; /* @@ -1795,13 +1020,40 @@ DevicePDP11.UNIBUS_IOTABLE = { [PDP11.UNIBUS.KDSDR0]: /* 172320 */ [null, null, DevicePDP11.prototype.readKDSDR, DevicePDP11.prototype.writeKDSDR, "KDSDR"], [PDP11.UNIBUS.KISAR0]: /* 172340 */ [null, null, DevicePDP11.prototype.readKISAR, DevicePDP11.prototype.writeKISAR, "KISAR"], [PDP11.UNIBUS.KDSAR0]: /* 172360 */ [null, null, DevicePDP11.prototype.readKDSAR, DevicePDP11.prototype.writeKDSAR, "KDSAR"], + [PDP11.UNIBUS.MMR3]: /* 172516 */ [null, null, DevicePDP11.prototype.readMMR3, DevicePDP11.prototype.writeMMR3, "MMR3"], [PDP11.UNIBUS.LKS]: /* 177546 */ [null, null, DevicePDP11.prototype.readLKS, DevicePDP11.prototype.writeLKS, "LKS"], [PDP11.UNIBUS.MMR0]: /* 177572 */ [null, null, DevicePDP11.prototype.readMMR0, DevicePDP11.prototype.writeMMR0, "MMR0"], + [PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, null, "MMR1"], + [PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, null, "MMR2"], [PDP11.UNIBUS.UISDR0]: /* 177600 */ [null, null, DevicePDP11.prototype.readUISDR, DevicePDP11.prototype.writeUISDR, "UISDR"], [PDP11.UNIBUS.UDSDR0]: /* 177620 */ [null, null, DevicePDP11.prototype.readUDSDR, DevicePDP11.prototype.writeUDSDR, "UDSDR"], [PDP11.UNIBUS.UISAR0]: /* 177640 */ [null, null, DevicePDP11.prototype.readUISAR, DevicePDP11.prototype.writeUISAR, "UISAR"], [PDP11.UNIBUS.UDSAR0]: /* 177660 */ [null, null, DevicePDP11.prototype.readUDSAR, DevicePDP11.prototype.writeUDSAR, "UDSAR"], - [PDP11.UNIBUS.PSW]: /* 177776 */ [null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW, "PSW"], + [PDP11.UNIBUS.R0SET0]: /* 177700 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R0SET0"], + [PDP11.UNIBUS.R1SET0]: /* 177701 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R1SET0"], + [PDP11.UNIBUS.R2SET0]: /* 177702 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R2SET0"], + [PDP11.UNIBUS.R3SET0]: /* 177703 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R3SET0"], + [PDP11.UNIBUS.R4SET0]: /* 177704 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R4SET0"], + [PDP11.UNIBUS.R5SET0]: /* 177705 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R5SET0"], + [PDP11.UNIBUS.R6KERNEL]:/* 177706 */ [DevicePDP11.prototype.readR6KERNEL,DevicePDP11.prototype.writeR6KERNEL,DevicePDP11.prototype.readR6KERNEL, DevicePDP11.prototype.writeR6KERNEL,"R6KERNEL"], + [PDP11.UNIBUS.R7KERNEL]:/* 177707 */ [DevicePDP11.prototype.readR7KERNEL,DevicePDP11.prototype.writeR7KERNEL,DevicePDP11.prototype.readR7KERNEL, DevicePDP11.prototype.writeR7KERNEL,"R7KERNEL"], + [PDP11.UNIBUS.R0SET1]: /* 177710 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R0SET1"], + [PDP11.UNIBUS.R1SET1]: /* 177711 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R1SET1"], + [PDP11.UNIBUS.R2SET1]: /* 177712 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R2SET1"], + [PDP11.UNIBUS.R3SET1]: /* 177713 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R3SET1"], + [PDP11.UNIBUS.R4SET1]: /* 177714 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R4SET1"], + [PDP11.UNIBUS.R5SET1]: /* 177715 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R5SET1"], + [PDP11.UNIBUS.R6SUPER]: /* 177716 */ [DevicePDP11.prototype.readR6SUPER, DevicePDP11.prototype.writeR6SUPER, DevicePDP11.prototype.readR6SUPER, DevicePDP11.prototype.writeR6SUPER, "R6SUPER"], + [PDP11.UNIBUS.R6USER]: /* 177717 */ [DevicePDP11.prototype.readR6USER, DevicePDP11.prototype.writeR6USER, DevicePDP11.prototype.readR6USER, DevicePDP11.prototype.writeR6USER, "R6USER"], + [PDP11.UNIBUS.LAERR]: /* 177740 */ [null, null, DevicePDP11.prototype.readCTRL, DevicePDP11.prototype.writeCTRL, "CTRL", PDP11.MODEL_1170], + [PDP11.UNIBUS.LSIZE]: /* 177760 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "LSIZE", PDP11.MODEL_1170], + [PDP11.UNIBUS.HSIZE]: /* 177762 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "HSIZE", PDP11.MODEL_1170], + [PDP11.UNIBUS.SYSID]: /* 177764 */ [null, null, DevicePDP11.prototype.readSYSID, DevicePDP11.prototype.writeSYSID, "SYSID", PDP11.MODEL_1170], + [PDP11.UNIBUS.CPUERR]: /* 177766 */ [null, null, DevicePDP11.prototype.readCPUERR, DevicePDP11.prototype.writeCPUERR, "CPUERR", PDP11.MODEL_1170], + [PDP11.UNIBUS.MB]: /* 177770 */ [null, null, DevicePDP11.prototype.readMB, DevicePDP11.prototype.writeMB, "MB", PDP11.MODEL_1170], + [PDP11.UNIBUS.PIR]: /* 177772 */ [null, null, DevicePDP11.prototype.readPIR, DevicePDP11.prototype.writePIR, "PIR"], + [PDP11.UNIBUS.SL]: /* 177774 */ [null, null, DevicePDP11.prototype.readSL, DevicePDP11.prototype.writeSL, "SL"], + [PDP11.UNIBUS.PSW]: /* 177776 */ [null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW, "PSW"] }; DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR0]; @@ -1900,6 +1152,14 @@ DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR5] = DevicePDP11.UNIBUS_IOTABLE[PDP DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0]; DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0]; +DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.HAERR] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; +DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.MEMERR] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; +DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.CACHEC] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; +DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.MAINT] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; +DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.HITMISS]= DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; +DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UNDEF1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; +DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UNDEF2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; + /** * DevicePDP11.init() * @@ -1914,8 +1174,12 @@ DevicePDP11.init = function() for (var iDevice = 0; iDevice < aeDevice.length; iDevice++) { var eDevice = aeDevice[iDevice]; var parmsDevice = Component.getComponentParms(eDevice); - var device = new DevicePDP11(parmsDevice); - Component.bindComponentControls(device, eDevice, PDP11.APPCLASS); + switch(parmsDevice['name']) { + case 'default': + var device = new DevicePDP11(parmsDevice); + Component.bindComponentControls(device, eDevice, PDP11.APPCLASS); + break; + } } }; diff --git a/modules/pdp11/lib/memory.js b/modules/pdp11/lib/memory.js index 71c2599e5..15c3af409 100644 --- a/modules/pdp11/lib/memory.js +++ b/modules/pdp11/lib/memory.js @@ -56,7 +56,7 @@ var littleEndian = (TYPEDARRAYS? (function() { })() : false); /** - * MemoryPDP11(addr, used, size, type, controller) + * MemoryPDP11(cpu, addr, used, size, type, controller) * * The Bus component allocates Memory objects so that each has a memory buffer with a * block-granular starting address and an address range equal to bus.nBlockSize; however, @@ -89,15 +89,17 @@ var littleEndian = (TYPEDARRAYS? (function() { * is available). * * @constructor + * @param {CPUStatePDP11} cpu * @param {number|null} [addr] of lowest used address in block * @param {number} [used] portion of block in bytes (0 for none); must be a multiple of 4 * @param {number} [size] of block's buffer in bytes (0 for none); must be a multiple of 4 * @param {number} [type] is one of the MemoryPDP11.TYPE constants (default is MemoryPDP11.TYPE.NONE) * @param {Object} [controller] is an optional memory controller component */ -function MemoryPDP11(addr, used, size, type, controller) +function MemoryPDP11(cpu, addr, used, size, type, controller) { var i; + this.cpu = cpu; this.id = (MemoryPDP11.idBlock += 2); this.adw = null; this.offset = 0; @@ -621,6 +623,9 @@ MemoryPDP11.prototype = { * @return {number} */ readWordMemory: function readWordMemory(off, addr) { + if (PDP11.WORDBUS && (off & 0x1)) { + this.cpu.fault(addr); + } if (BYTEARRAYS) { return this.ab[off] | (this.ab[off + 1] << 8); } @@ -662,6 +667,9 @@ MemoryPDP11.prototype = { * @param {number} addr */ writeWordMemory: function writeWordMemory(off, w, addr) { + if (PDP11.WORDBUS && (off & 0x1)) { + this.cpu.fault(addr); + } if (BYTEARRAYS) { this.ab[off] = (w & 0xff); this.ab[off + 1] = (w >> 8); @@ -769,6 +777,9 @@ MemoryPDP11.prototype = { * @return {number} */ readWordBE: function readWordBE(off, addr) { + if (PDP11.WORDBUS && (off & 0x1)) { + this.cpu.fault(addr); + } return this.dv.getUint16(off, true); }, /** @@ -785,7 +796,10 @@ MemoryPDP11.prototype = { * for an aligned read vs. always reading the bytes separately. */ var w; - if (PDP11.WORDBUS || !(off & 0x1)) { + if (PDP11.WORDBUS && (off & 0x1)) { + this.cpu.fault(addr); + } + if (!(off & 0x1)) { w = this.aw[off >> 1]; } else { w = this.ab[off] | (this.ab[off+1] << 8); @@ -831,6 +845,9 @@ MemoryPDP11.prototype = { * @param {number} w */ writeWordBE: function writeWordBE(off, w, addr) { + if (PDP11.WORDBUS && (off & 0x1)) { + this.cpu.fault(addr); + } this.dv.setUint16(off, w, true); this.fDirty = true; }, @@ -847,7 +864,10 @@ MemoryPDP11.prototype = { * TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset * for an aligned write vs. always writing the bytes separately. */ - if (PDP11.WORDBUS || !(off & 0x1)) { + if (PDP11.WORDBUS && (off & 0x1)) { + this.cpu.fault(addr); + } + if (!(off & 0x1)) { this.aw[off >> 1] = w; } else { this.ab[off] = w; diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js new file mode 100644 index 000000000..6f9ae4d1e --- /dev/null +++ b/modules/pdp11/lib/rk11.js @@ -0,0 +1,85 @@ +/** + * @fileoverview Implements RK11 device support. + * @author Jeff Parsons + * @copyright Jeff Parsons 2012-2016 + * + * This file is part of PCjs, a computer emulation software project at . + * + * It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis + * (paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code + * may be used freely provided the original author name is acknowledged in any modified source code. + * + * PCjs is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with PCjs. If not, + * see . + * + * You are required to include the above copyright notice in every source code file of every + * copy or modified version of this work, and to display that copyright notice on every screen + * that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js). + * + * Some PCjs files also attempt to load external resource files, such as character-image files, + * ROM files, and disk image files. Those external resource files are not considered part of PCjs + * for purposes of the GNU General Public License, and the author does not claim any copyright + * as to their contents. + */ + +"use strict"; + +if (NODE) { + var web = require("../../shared/lib/weblib"); + var Component = require("../../shared/lib/component"); + var State = require("../../shared/lib/state"); + var BusPDP11 = require("./bus"); +} + +/** + * RK11(parmsDevice) + * + * @constructor + * @extends Component + * @param {Object} parmsRK11 + */ +function RK11(parmsRK11) +{ + Component.call(this, "RK11", parmsRK11, RK11); + + this.rkds = 0x9C0;/*04700*/ // 017777400 Drive Status + this.rker = 0; // 017777402 Error Register + this.rkcs = 0x80; /*0200*/ // 017777404 Control Status + this.rkwc = 0; // 017777406 Word Count + this.rkba = 0; // 017777410 Bus Address + this.rkda = 0; // 017777412 Disk Address + this.rkdb = 0; // 017777416 Data Buffer + this.meta = []; + this.TRACKS = [406, 406, 406, 406]; + this.SECTORS = [12, 12, 12, 12]; +} + +Component.subclass(RK11); + +/** + * initBus(cmp, bus, cpu, dbg) + * + * @this {DevicePDP11} + * @param {ComputerPDP11} cmp + * @param {BusPDP11} bus + * @param {CPUStatePDP11} cpu + * @param {DebuggerPDP11} dbg + */ +RK11.prototype.initBus = function(cmp, bus, cpu, dbg) +{ + this.bus = bus; + this.cpu = cpu; + this.dbg = dbg; + + this.setReady(); +}; + +if (NODE) module.exports = RK11; diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index fb1e12144..df044655d 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -683,239 +683,221 @@ */ var h; function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function l(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ja(a){return a.replace(/[&<>"']/g,function(a){return ia[a]})}function oa(a,b){return(a+" ").slice(0,b)} -function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function ra(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=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 ua(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var m="",n;for(n in b)b.hasOwnProperty(n)&&(m&&(m+="&"),m+=n+"="+encodeURIComponent(b[n]));m=m.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(m)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ha(){return"http://"+(window?window.location.host:"www.pcjs.org")} -function q(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}var xa=null;function ya(){if(null==xa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}xa=a}return xa}function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} -function Da(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ea(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Fa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.Sb=this.id:(this.fc=this.id.substr(0,b),this.Sb=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Gb:!1,gc:!1,ja:!1,error:!1};this.Ub=null;this.v.error=!1;this.L={};this.j=null;this.ma=d||0;v.push(this)}var Va=void 0,Wa={}; -if(window){Va||(Va=window.location.search.substr(1));for(var Xa,Ya=/\+/g,Za=/([^&=]+)=?([^&]*)/g;Xa=Za.exec(Va);)Wa[decodeURIComponent(Xa[1].replace(Ya," "))]=decodeURIComponent(Xa[2].replace(Ya," "))}function $a(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} -function y(a,b){b||(b=u);a.prototype=$a(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ab=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else ab={},v=[];function bb(a,b,c){ab[a]&&b&&(ab[a][b]=c)}function cb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;return(c?"0o":"")+d}function k(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return ha[a]})}function na(a,b){return(a+" ").slice(0,b)} +function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function qa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,l;l=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 ua(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 l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== +typeof b){var n="",p;for(p in b)b.hasOwnProperty(p)&&(n&&(n+="&"),n+=p+"="+encodeURIComponent(b[p]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ga(){return"http://"+(window?window.location.host:"www.pcjs.org")} +function m(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function Ba(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} +function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Da(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ea(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.Ya=this.id:(this.zb=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.v={ready:!1,ib:!1,xb:!1,fa:!1,error:!1};this.rb=null;this.v.error=!1;this.J={};this.j=null;this.ha=d||0;t.push(this)}var Ua=void 0,Va={}; +if(window){Ua||(Ua=window.location.search.substr(1));for(var Wa,Xa=/\+/g,Ya=/([^&=]+)=?([^&]*)/g;Wa=Ya.exec(Ua);)Va[decodeURIComponent(Wa[1].replace(Xa," "))]=decodeURIComponent(Wa[2].replace(Xa," "))}function Za(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} +function y(a,b){b||(b=r);a.prototype=Za(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var $a=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else $a={},t=[];function ab(a,b,c){$a[a]&&b&&($a[a][b]=c)}function bb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.ca&&(this.ca=10);15>2;this.f=this.Da-1;this.w=this.F/this.Da|0;this.Ua=[];this.D=null;this.Hb=this.Jd;a=new H;Cb(a,this.j);this.aa=Array(this.w);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ua[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&F(this.j,64)&&D(this.j,e[5]+".readByte("+I(this.j,b)+"): "+I(this.j,c),!0,!0),c;c=d.Hb(b|4186112,-1,1);this.j&&F(this.j,64)&&D(this.j,"warning: unconverted read access to byte @"+I(this.j,b)+": "+I(this.j,c));return c} -function Eb(a,b,c){var d=!1,e=this.controller,f=e.Ua[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ua[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&F(this.j,64)&&D(this.j,f[5]+".writeByte("+I(this.j,c)+","+I(this.j,b)+")",!0,!0):(e.Hb(c|4186112,b,1),this.j&&F(this.j,64)&&D(this.j,"warning: unconverted write access to byte @"+I(this.j,c)+": "+I(this.j,b)))} -function Fb(a,b){var c=-1,d=this.controller;(a=d.Ua[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&F(this.j,64)&&D(this.j,a[5]+".readWord("+I(this.j,b)+"): "+I(this.j,c),!0,!0),c;c=d.Hb(b|4186112,-1,0);this.j&&F(this.j,64)&&D(this.j,"warning: unconverted read access to word @"+I(this.j,b)+": "+I(this.j,c));return c} -function Gb(a,b,c){var d=!1,e=this.controller;if(a=e.Ua[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.j&&F(this.j,64)&&D(this.j,a[5]+".writeWord("+I(this.j,c)+","+I(this.j,b)+")",!0,!0):(e.Hb(c|4186112,b,0),this.j&&F(this.j,64)&&D(this.j,"warning: unconverted write access to word @"+I(this.j,c)+": "+I(this.j,b)))}h=Bb.prototype;h.reset=function(){this.D&&this.D()}; -h.Jd=function(a,b,c){this.j&&F(this.j,64)&&D(this.j,"warning: unrecognized I/O access("+I(this.j,a)+","+I(this.j,b)+","+c+")");return 0};h.Ka=function(a,b){b||this.reset();return!0}; -function Hb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.ca;0g&&(p=g);if(m&&m.size){if(m.type==d&&m.controller==e){if(f+g<=m.A)return m.Rb+=m.A-f,m.A=f,!0;if(f>=m.A+m.Rb){p=m.size-(f-n);p>g&&(p=g);m.Rb=f-m.A+p;f=n+a.Da;g-=p;k++;continue}}return Jb(1,f,g)}f=new H(f,p,a.Da,d,e);Cb(f,a.j,m);a.aa[k++]=f;f=n+a.Da;g-=p}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Kb[d]+" at "+l(b,8,!0)),!0):Jb(2,b,c)} -h.mb=function(a){return this.aa[(a&this.g)>>>this.ca].Zb(a&this.f,a)};h.Ia=function(a){return this.aa[(a&this.g)>>>this.ca].Hc(a&this.f,a)};function Lb(a,b){return a.aa[(b&a.g)>>>a.ca].mc(b&a.f,b)}h.Ob=function(a,b){this.aa[(a&this.g)>>>this.ca].cc(a&this.f,b&255,a)};h.qc=function(a,b){this.aa[(a&this.g)>>>this.ca].Pc(a&this.f,b&65535,a)}; -function Mb(a){for(var b=0,c=[],d=0;d>5&3;c.Ca=a>>1&15;c.kc=a&257?a&1?6:4:0;Sb(c);a=c.G;a&1|256&&(b=this.b.bb&16?1:2);this.g.tb=this.g.tb&-8|b};h.rd=function(a){return this.b.W[1][a>>1&7]};h.Wd=function(a,b){this.b.W[1][b>>1&7]=a&65295};h.pd=function(a){return this.b.W[1][(a>>1&7)+8]};h.Ud=function(a,b){this.b.W[1][(b>>1&7)+8]=a&65295}; -h.qd=function(a){return this.b.wa[1][a>>1&7]};h.Vd=function(a,b){b=b>>1&7;this.b.wa[1][b]=a;this.b.W[1][b]&=65295};h.od=function(a){return this.b.wa[1][(a>>1&7)+8]};h.Td=function(a,b){b=(b>>1&7)+8;this.b.wa[1][b]=a;this.b.W[1][b]&=65295};h.hd=function(a){return this.b.W[0][a>>1&7]};h.Nd=function(a,b){this.b.W[0][b>>1&7]=a&65295};h.fd=function(a){return this.b.W[0][(a>>1&7)+8]};h.Ld=function(a,b){this.b.W[0][(b>>1&7)+8]=a&65295};h.gd=function(a){return this.b.wa[0][a>>1&7]}; -h.Md=function(a,b){b=b>>1&7;this.b.wa[0][b]=a;this.b.W[0][b]&=65295};h.ed=function(a){return this.b.wa[0][(a>>1&7)+8]};h.Kd=function(a,b){b=(b>>1&7)+8;this.b.wa[0][b]=a;this.b.W[0][b]&=65295};h.vd=function(a){return this.b.W[3][a>>1&7]};h.$d=function(a,b){this.b.W[3][b>>1&7]=a&65295};h.td=function(a){return this.b.W[3][(a>>1&7)+8]};h.Yd=function(a,b){this.b.W[3][(b>>1&7)+8]=a&65295};h.ud=function(a){return this.b.wa[3][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.b.wa[3][b]=a;this.b.W[3][b]&=65295}; -h.sd=function(a){return this.b.wa[3][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.b.wa[3][b]=a;this.b.W[3][b]&=65295};h.ld=function(){return Tb(this.b)};h.Qd=function(a){Ub(this.b,a&-1809|Tb(this.b)&1808);this.b.C|=128}; -function Vb(a){var b=a.D,c,d,e,f=b.xa>>13&7;"undefined"===typeof b.sa[f]&&(b.sa[f]={cache:[],postProcess:a.yd,drive:f,blocksize:256,mapped:0,maxblock:b.ib[f]*b.da[f],url:"rk"+f+".dsk"});b.P&=-129;switch(b.P>>1&7){case 0:b.Mb=2496;b.oa=0;b.P=128;b.xa=0;break;case 1:if((b.xa>>4&511)>=b.ib[f]){b.oa|=32832;b.P|=49152;break}if((b.xa&15)>=b.da[f]){b.oa|=32800;b.P|=49152;break}c=(b.xa>>4&511)*b.da[f]+(b.xa&15);d=(b.P&48)<<12|b.Lb;e=65536-b.Nb&65535;Wb(a,b.sa[f],c,d,e);return;case 2:if((b.xa>>4&511)>=b.ib[f])b.oa|= -32832,b.P|=49152;else if((b.xa&15)>=b.da[f])b.oa|=32800,b.P|=49152;else{c=(b.xa>>4&511)*b.da[f]+(b.xa&15);d=(b.P&48)<<12|b.Lb;e=65536-b.Nb&65535;a.$b(b.sa[f],c,d,e);return}}b.Mb=f<<13|b.Mb&8176|b.xa%9&15;K(a.b,20,5,144,function(){b.P=b.P&65534|128;return!!(b.P&64)})}h.yd=function(a,b,c,d,e){var f=this.D;f.Lb=d&65535;f.P=f.P&-49|d>>12&48;f.Nb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.P|=49152;break;case 2:f.oa|=33792,f.P|=49152}K(this.b,20,5,144,function(){f.P=f.P&65534|128;return!!(f.P&64)})}; -function fc(a){var b=a.w,c,d,e,f=b.M>>8&3;b.M&=-2;"undefined"===typeof b.sa[f]&&(b.sa[f]={cache:[],postProcess:a.zd,drive:f,blocksize:128,mapped:1,maxblock:b.ib[f]*b.da[f],url:"rl"+f+".dsk"});switch(b.M>>1&7){case 2:b.Za&8&&(b.M&=63);b.Za=b.Qc[f]|b.gb&64;break;case 3:1==(b.fa&3)&&(b.gb=b.fa&4?b.gb+(b.fa&65408)&65408|b.fa<<2&64:b.gb-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.gb);break;case 4:b.Za=b.gb;break;case 5:if(b.fa>>6>=b.ib[f]){b.M|=37888;break}if((b.fa&63)>=b.da[f]){b.M|=37888;break}c=(b.fa>>6)* -b.da[f]+(b.fa&63);d=(b.Va&63)<<16|b.Fb;e=65536-b.Za&65535;Wb(a,b.sa[f],c,d,e);return;case 6:if(b.fa>>6>=b.ib[f])b.M|=37888;else if((b.fa&63)>=b.da[f])b.M|=37888;else{c=(b.fa>>6)*b.da[f]+(b.fa&63);d=(b.Va&63)<<16|b.Fb;e=65536-b.Za&65535;a.$b(b.sa[f],c,d,e);return}}K(a.b,20,5,112,function(){b.M|=129;return!!(b.M&64)})} -h.zd=function(a,b,c,d,e){var f=this.w;f.Fb=d&65535;f.M=f.M&-49|d>>12&48;f.Va=d>>16&63;f.fa=~~(c/f.da[b.Na])<<6|c%f.da[b.Na];f.gb=f.fa;f.Za=65536-e&65535;switch(a){case 1:f.M|=33792;break;case 2:f.M|=40960}K(this.b,20,5,112,function(){f.M|=129;return!!(f.M&64)})};function gc(a){a=a.B;a.T=2176;a.Ea=0;a.ua=[4544,4544,4544,4544,4544,4544,4544,4544];a.yb=[0,0,0,0,0,0,0,0];a.ob=a.zb=a.xb=a.eb=a.pc=0} -function hc(a,b){var c=a.B,d,e,f;c.T&=-16513;c.Ea&=-2049;c.ua[b]&=-1153;K(a.b,-1,0,172);"undefined"===typeof c.sa[b]&&(c.sa[b]={cache:[],postProcess:a.Ad,drive:b,blocksize:256,mapped:0,maxblock:c.ec[0]*c.hb[0]*c.da[0],url:"rp"+b+".dsk"});switch(c.T&63){case 5:c.bc[b]=c.Ra[b];c.T|=32896;c.ua[b]|=32896;c.ob|=1<=c.ec[0]||c.Fa[b]>>8>=c.hb[0]||(c.Fa[b]&255)>=c.da[0]){c.yb[b]|=1024;c.T|=49152;break}d=(c.Ra[b]*c.hb[0]+(c.Fa[b]>>8))* -c.da[0]+(c.Fa[b]&255);e=(c.eb&63)<<16|c.xb;f=65536-c.zb&65535;Wb(a,c.sa[b],d,e,f);return;case 57:if(c.Ra[b]>=c.ec[0]||c.Fa[b]>>8>=c.hb[0]||(c.Fa[b]&255)>=c.da[0])c.yb[b]|=1024,c.T|=49152;else{d=(c.Ra[b]*c.hb[0]+(c.Fa[b]>>8))*c.da[0]+(c.Fa[b]&255);e=(c.eb&63)<<16|c.xb;f=65536-c.zb&65535;a.$b(c.sa[b],d,e,f);return}}K(a.b,3,5,172,function(){c.T=c.T&65534|128;c.ua[b]|=128;return!!(c.T&64)})} -h.Ad=function(a,b,c,d,e){var f=this.B;f.zb=65536-e&65535;f.xb=d&65535;f.T=f.T&-769|d>>8&768;f.eb=d>>16&63;e=~~(c/f.da[0]);d=~~(e/f.hb[0]);f.Fa[b.Na]=e%f.hb[0]<<8|c%f.da[0];f.bc[b.Na]=f.Ra[b.Na]=d;f.ob|=1<=b.bd-1&&(f.ua[b.Na]|=1024);switch(a){case 1:f.Ea|=512;f.T|=49152;break;case 2:f.Ea|=2048,f.T|=49152}K(this.b,20,5,172,function(){f.ua[b.Na]|=128;f.T=f.T&65534|128;return!!(f.T&64)})}; -function ic(a,b,c,d,e,f){var g=~~((f+c.Wa-1)/c.Wa),k=new XMLHttpRequest;2048>g&&d+2048this.b.Cb(a.ad?jc(this.b,c):c,a.cache[b][e])){a.Yb(2,a,b,c,d);return}c+=2;--d}b++}a.Yb(0,a,b,c,d)}; -function Wb(a,b,c,d,e){for(var f,g;0g){b.Yb(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.Yb(0,b,c,d,e)}h.reset=function(){this.g.tb=this.g.tb&-120|20;this.f.Ya=0;this.D.P=128;this.w.M=128;gc(this)}; -h.Sc=function(a,b,c){var d,e,f=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.cb&65280:(a&1&&(b<<=8),f.cb=b|255,d=0);break;case 4194298:if(0>b)d=f.oc;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.oc=d;f.C|=2}break;case 4194294:if(70!==f.lb)return f.K(4,222);0>b?d=f.I:d=f.I=0;break;case 4194292:if(70!==f.lb)return f.K(4,224);d=1;break;case 4194290:if(70!==f.lb)return f.K(4,226);d=0;break;case 4194288:if(70!==f.lb)return f.K(4,228);d=61183;break;case 4194296:0<= -b&&!(a&1)&&(b&=255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==f.lb)return f.K(4,232);e=a-4194272>>1;0>b?d=f.jc[e]:(d=M(this,f.jc[e],a,b,c),0<=d&&(f.jc[e]=d));break;case 4194254:return a&1?f.O>>14&1?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.Aa[3]=b),d=f.Aa[3]):f.O>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.Aa[1]=b),d=f.Aa[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.O&2048?(0<=b&&(f.u[e]=b),d=f.u[e]):(0<=b&&(f.Qa[e]= -b),d=f.Qa[e]),d;case 4194246:return a&1?(0<=b&&(f.u[7]=b),d=f.u[7]):f.O>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.Aa[0]=b),d=f.Aa[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.O&2048?(0<=b&&(f.Qa[e]=b),d=f.Qa[e]):(0<=b&&(f.u[e]=b),d=f.u[e]),d;default:return f.I|=16,f.K(4,124)}break;case 4194176:e=a>>1&31;d=M(this,f.za[3][e],a,b,c);0<=d&&(f.za[3][e]=d,f.za[3][e&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=M(this,f.ac,a,b,c);0<=d&&(f.ac=d);break;case 4194172:d=f.ab;d&65280&& -(d=(d<<8|d>>8)&65535);break;case 4194168:0>b?d=this.g.Id&65535:(d=M(this,this.g.data,a,b,c),0<=d&&(this.g.data=d));break;default:return f.I|=16,f.K(4,126)}break;case 4194048:e=this.D;switch(a&-2){case 4194048:d=M(this,e.Mb,a,b,c);0<=d&&(e.Mb=d);break;case 4194050:d=M(this,e.oa,a,b,c);0<=d&&(e.oa=d);break;case 4194052:d=M(this,e.P,a,b,c);0<=b&&0<=d&&(e.P=d&-36993|e.P&36992,e.P&1&&Vb(this));break;case 4194054:d=M(this,e.Nb,a,b,c);0<=d&&(e.Nb=d);break;case 4194056:d=M(this,e.Lb,a,b,c);0<=d&&(e.Lb=d); -break;case 4194058:d=M(this,e.xa,a,b,c);0<=d&&(e.xa=d);break;case 4194060:break;case 4194062:d=M(this,e.Jc,a,b,c);0<=d&&(e.Jc=d);break;default:return f.I|=16,f.K(4,128)}break;case 4193728:var g=this.B;e=g.Ea&7;switch(a&-2){case 4193728:d=M(this,g.T,a,b,c);0<=b&&0<=d&&(g.eb=g.eb&60|d>>8&3,g.T=d&17279|g.T&34944|2048,d&1&&g.T&128?hc(this,e):192==(d&192)&&K(f,0,5,172));break;case 4193730:d=M(this,g.zb,a,b,c);0<=d&&(g.zb=d);break;case 4193732:d=M(this,g.xb,a,b,c);0<=d&&(g.xb=d&65534);break;case 4193734:d= -M(this,g.Fa[e],a,b,c);0<=d&&(g.Fa[e]=d&7967);break;case 4193736:d=M(this,g.Ea,a,b,c);0<=d&&(g.Ea=d&63|g.Ea&65472,d&128&&gc(this));break;case 4193738:d=g.ua[e];break;case 4193740:d=g.yb[e];break;case 4193742:d=M(this,g.ob,a,b,c);0<=d&&(g.ob=d&255);break;case 4193744:d=g.Fd[e];break;case 4193746:d=M(this,g.Kc,a,b,c);0<=d&&(g.Kc=d);break;case 4193748:d=M(this,g.Lc[e],a,b,c);0<=d&&(g.Lc[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.Gd[e];break;case 4193754:d=M(this,g.Mc[e],a,b,c);0<=d&& -(g.Mc[e]=d);break;case 4193756:d=M(this,g.Ra[e],a,b,c);0<=d&&(g.Ra[e]=d&511);break;case 4193758:g.bc[e]=g.Ra[e];d=g.bc[e];break;case 4193760:d=g.Dd[e];break;case 4193762:d=g.Ed[e];break;case 4193764:d=g.Bd[e];break;case 4193766:d=g.Cd[e];break;case 4193768:d=M(this,g.eb,a,b,c);0<=d&&(g.eb=d&63,g.T=g.T&-769|(d&3)<<8);break;case 4193770:d=M(this,g.pc,a,b,c);0<=d&&(g.pc=d);break;default:return f.I|=16,f.K(4,132)}break;case 4192512:e=this.w;switch(a&-2){case 4192512:d=M(this,e.M,a,b,c);0<=b&&0<=d&&(e.Va= -e.Va&60|d>>4&3,e.M=e.M&-1023|d&1022,e.M&128||fc(this));break;case 4192514:d=M(this,e.Fb,a,b,c);0<=d&&(e.Fb=d&65534);break;case 4192516:d=M(this,e.fa,a,b,c);0<=d&&(e.fa=d);break;case 4192518:d=M(this,e.Za,a,b,c);0<=d&&(e.Za=d);break;case 4192520:d=M(this,e.Va,a,b,c);0<=d&&(e.Va=d&63,e.M=e.M&-49|(e.Va&3)<<4);break;default:return f.I|=16,f.K(4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=f.bb:(d=M(this,f.bb,a,b,c),0<=d&&(70!==f.lb&&(d&=-49),f.bb=d,f.Xb[0]=d&4?15:7,f.Xb[1]=d&2?15:7,f.Xb[3]= -d&1?15:7,f.kc&&(e=2,f.bb&16&&(e=1),this.g.tb=this.g.tb&-8|e)));break;default:return f.I|=16,f.K(4,136)}break;case 4191424:e=a>>1&31;d=M(this,f.za[0][e],a,b,c);0<=d&&(f.za[0][e]=d,f.za[0][e&15]&=65295);break;case 4191360:e=a>>1&31;d=M(this,f.za[1][e],a,b,c);0<=d&&(f.za[1][e]=d,f.za[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.lb)return f.K(4,234);e=a>>2&31;d=f.Pb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=M(this,d,a,b,c),0<=d&&(f.Pb[e]=a&2?d<<16|f.Pb[e]&65535:f.Pb[e]&4294901760|d&65534));break; -case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)d=Pb[a>>1&255];else return f.I|=16,f.K(4,138);break;default:return f.I|=16,f.K(4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d}; -var N={},L=(N[62592]=[null,null,J.prototype.rd,J.prototype.Wd,"SISDR"],N[62608]=[null,null,J.prototype.pd,J.prototype.Ud,"SDSDR"],N[62624]=[null,null,J.prototype.qd,J.prototype.Vd,"SISAR"],N[62640]=[null,null,J.prototype.od,J.prototype.Td,"SDSAR"],N[62656]=[null,null,J.prototype.hd,J.prototype.Nd,"KISDR"],N[62672]=[null,null,J.prototype.fd,J.prototype.Ld,"KDSDR"],N[62688]=[null,null,J.prototype.gd,J.prototype.Md,"KISAR"],N[62704]=[null,null,J.prototype.ed,J.prototype.Kd,"KDSAR"],N[65382]=[null,null, -J.prototype.jd,J.prototype.Od,"LKS"],N[65402]=[null,null,J.prototype.kd,J.prototype.Pd,"MMR0"],N[65408]=[null,null,J.prototype.vd,J.prototype.$d,"UISDR"],N[65424]=[null,null,J.prototype.td,J.prototype.Yd,"UDSDR"],N[65440]=[null,null,J.prototype.ud,J.prototype.Zd,"UISAR"],N[65456]=[null,null,J.prototype.sd,J.prototype.Xd,"UDSAR"],N[65534]=[null,null,J.prototype.ld,J.prototype.Qd,"PSW"],N);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592]; -L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624];L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640];L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656]; -L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688];L[62698]=L[62688];L[62700]=L[62688];L[62702]=L[62688];L[62706]=L[62704];L[62708]=L[62704];L[62710]=L[62704];L[62712]=L[62704];L[62714]=L[62704];L[62716]=L[62704];L[62718]=L[62704];L[65410]=L[65408];L[65412]=L[65408];L[65414]=L[65408];L[65416]=L[65408];L[65418]=L[65408];L[65420]=L[65408]; -L[65422]=L[65408];L[65426]=L[65424];L[65428]=L[65424];L[65430]=L[65424];L[65432]=L[65424];L[65434]=L[65424];L[65436]=L[65424];L[65438]=L[65424];L[65442]=L[65440];L[65444]=L[65440];L[65446]=L[65440];L[65448]=L[65440];L[65450]=L[65440];L[65452]=L[65440];L[65454]=L[65440];L[65458]=L[65456];L[65460]=L[65456];L[65462]=L[65456];L[65464]=L[65456];L[65466]=L[65456];L[65468]=L[65456];L[65470]=L[65456]; -Ma(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.D,0,c>>2),qc(this,mc?rc:sc);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},Z:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ka:function(a){var 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},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<< -a)|b<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Xa=!0},S:function(a,b){if(this.j&&null!=this.A){var c=this.j;xc(c,this.A+a,1,c.S)&&c.ia(!0)}return this.lc(a,b)},ea:function(a,b){if(this.j&&null!=this.A){var c=this.j;xc(c,this.A+a,2,c.S)&&c.ia(!0)}return this.mc(a,b)},na:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;xc(d,this.A+a,1,d.G)&&d.ia(!0)}this.f?this.L(a, -b,c):this.dc(a,b,c)},ya:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;xc(d,this.A+a,2,d.G)&&d.ia(!0)}this.f?this.L(a,b,c):this.tc(a,b,c)},R:function(a){return this.w[a]},X:function(a,b){a=this.w[a];this.j&&F(this.j,128)&&D(this.j,"Memory.readByte("+I(this.j,b)+"): "+I(this.j,a),!0);return a},$:function(a){return this.B.getUint16(a,!0)},ha:function(a,b){a=this.H[a>>1];this.j&&F(this.j,128)&&D(this.j,"Memory.readWord("+I(this.j,b)+"): "+I(this.j,a),!0);return a},la:function(a,b){this.w[a]=b; -this.Xa=!0},qa:function(a,b,c){this.w[a]=b;this.Xa=!0;this.j&&F(this.j,128)&&D(this.j,"Memory.writeByte("+I(this.j,c)+","+I(this.j,b)+")",!0)},va:function(a,b){this.B.setUint16(a,b,!0);this.Xa=!0},Ba:function(a,b,c){this.H[a>>1]=b;this.Xa=!0;this.j&&F(this.j,128)&&D(this.j,"Memory.writeWord("+I(this.j,c)+","+I(this.j,b)+")",!0)}};function Cb(a,b,c){a.j=b;a.g=a.F=0;c&&((a.g=c.g)&&wc(a,vc,!1),(a.F=c.F)&&uc(a,vc,!1))} -function yc(a,b){b?--a.F||(a.cc=a.f?a.L:a.dc,a.Pc=a.f?a.G:a.tc):--a.g||(a.Zb=a.lc,a.Hc=a.mc)}function uc(a,b,c){c&&a.F||(a.cc=!a.f&&b[1]||a.L,a.Pc=!a.f&&b[3]||a.G);if(c||void 0===c)a.dc=b[1]||a.L,a.tc=b[3]||a.G}function wc(a,b,c){c&&a.g||(a.Zb=b[0]||a.J,a.Hc=b[2]||a.N);if(c||void 0===c)a.lc=b[0]||a.J,a.mc=b[2]||a.N}function qc(a,b){b||(b=zc);wc(a,b,void 0);uc(a,b,void 0)}var zc=[],tc=[H.prototype.Z,H.prototype.ra,H.prototype.ka,H.prototype.Ca],vc=[H.prototype.S,H.prototype.na,H.prototype.ea,H.prototype.ya]; -if(xb)var sc=[H.prototype.R,H.prototype.la,H.prototype.$,H.prototype.va],rc=[H.prototype.X,H.prototype.qa,H.prototype.ha,H.prototype.Ba];function Ac(a,b){u.call(this,"CPU",a,Ac,1);var c=a.multiplier||1;this.Ta=a.cycles||b;this.$a=c;this.qb=Math.round(this.Ta/1E4)/100;this.nb=this.qb*this.$a;this.v.ga=!1;this.v.rc=!1;this.v.Eb=a.autoStart;this.v.wc=!1;this.v.rb=!1;this.Ib=this.na=0;this.Jb=a.csStart;this.ub=a.csInterval;this.vb=a.csStop;this.N=[];this.Ec=this.Hd.bind(this);G(this)}y(Ac); -var Bc=["power","reset"];h=Ac.prototype;h.Pa=function(a,b,c,d){this.D=a;this.F=b;this.j=d;for(b=0;b=a.na&&(a.na+=a.ub,c=!0);0<=a.vb&&a.vb<=Hc(a)&&(a.ub=a.vb=-1,Ec(a),a.ia(),c=!0);c&&a.i(Hc(a)+" cycles: checksum="+l(a.Ib))}} -function Ic(a,b,c,d){if(a.L[b]){void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.ia());var e=a.j&&a.j.na||8;c=!a.v.ga||a.v.wc?8==e?ca(c,d):l(c,d):"--------".substr(0,d||4);a.L[b].textContent!=c&&(a.L[b].textContent=c)}} -h.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.L[b]=c;a=!0;break;case "run":this.L[b]=c;c.onclick=function(){var a;if(a=d.D)if(a=d.D,a.v.ja)a=!0;else{var b=null,c,k=cb(a.id);for(c=0;ca.ha/a.nb?b=1:d=!0;a.$a=b;b=a.qb*a.$a;if(a.nb!=b){a.nb=b;b=a.nb.toFixed(2)+"Mhz";var e=a.L.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.D&&a.D.Qb()}Kc(a,a.$);a.$=0;a.Z=sa();a.ka=0;Lc(a);return d}function Qb(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Rb(a,b,c){0<=b&&ba.N[b][0]&&(c*=a.Ta*a.$a/1E3,a.N[b][0]=c)}function ed(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||b>d[0]&&(b=d[0])}return b} -function fd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}} -h.Hd=function(){if(this.v.ga){this.sb>=this.Ta&&Lc(this,!0);this.ya=0;this.Sa=sa();if(this.ka){var a=this.Sa-this.ka;a>this.Wb&&(this.Z+=a,this.Z>this.Sa&&(this.Z=this.Sa))}try{do{var b=ed(this,this.v.rb?1:this.fb);try{this.Bb(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.S-this.b;fd(this,c);this.ya+=c;this.$+=c;Kc(this,0,!0);Gc(this,c);this.qa-=c;if(0>=this.qa){this.qa+=this.fb;15<=++this.Cc&&(this.D&&this.D.Ga(),this.Cc=0);break}}while(this.v.ga)}catch(e){this.ia();O(this);this.D&&this.D.stop(sa(), -Hc(this));kb(this,e.stack||e.message);return}if(this.v.ga){a=setTimeout;b=this.Ec;this.ka=sa();c=this.Wb;this.ya&&(c=Math.round(c*this.ya/this.fb));var c=c-(this.ka-this.Sa),d=this.ka-this.Z;d&&(this.ha=Math.round(this.$/(10*d))/100,864E5<=d&&(this.la=0,Jc(this)));if(0>c||this.hac&&(this.Z-=c),c=0;this.sb+=this.ya;this.ka+=c;a(b,c)}}}; -h.Ab=function(a){if(jb(this))return!1;if(this.v.ga)return this.i(this.toString()+" busy"),!1;Jc(this);this.v.ga=!0;this.v.rc=!0;this.va&&this.va.start();var b=this.L.run;b&&(b.textContent="Halt");this.D&&(a&&this.D.Qb(!0),this.D.start(this.Z,Hc(this)));O(this,!0);setTimeout(this.Ec,0);return!0};h.Bb=function(){return 0}; -h.ia=function(a){if(this.v.ga){this.S-=this.b;this.b=0;Kc(this,this.$);this.$=0;this.v.ga=!1;this.va&&this.va.stop();var b=this.L.run;b&&(b.textContent="Run");this.D&&this.D.stop(sa(),Hc(this));O(this)}this.v.complete=a};function O(a,b){a.D&&a.D.Ga(b)} -function gd(a){this.cd=+a.model||1170;this.dd=a.resetAddr||0;Ac.call(this,a,6666667);this.Tb=0;this.decode=hd.bind(this);this.U=65536;this.V=32768;this.ba=65535;this.Y=32768;this.O=15;this.u=[0,0,0,0,0,0,0,this.dd];this.Qa=[0,0,0,0,0,0];this.Aa=[0,0,0,0];this.Ca=this.B=0;this.Yc=[4,2,0,1];this.W=[[0,0,0,0,0,0,0,0,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]];this.wa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.za=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Pb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.jc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.g=this.f=this.pb=this.H=this.J=this.C=0;this.lb=70;this.ra=-1;id(this);this.v.complete=this.v.Uc=!1}y(gd,Ac);h=gd.prototype;h.reset=function(){this.v.ga&&this.ia();id(this);Dc(this);this.v.error=!1;this.parent.reset.call(this)};function id(a){a.cb=255;a.I=0;a.oc=0;a.G=0;a.ab=0;a.ac=0;a.bb=0;a.kc=0;a.Ba=0;a.Xb=262143;a.Vb=253952;a.w=[];a.C|=2;Sb(a)} -function Sb(a){a.kc?(a.ea=65536,a.R=a.Xc,a.X=a.Ic,a.Fc=a.ae):(a.ea=0,a.R=a.Wc,a.X=a.wb,a.Fc=a.Cb)}h.zc=function(){return 0};h.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.la,this.$a]);a.set(2,Mb(this.F));return a.data()}; -h.restore=function(a){var b=a[1];this.la=b[1];Jc(this,b[3]);a:{b=this.F;a=a[2];var c;for(c=0;cb){a.w[f].Ma-=b;break}b-=a.w[f].Ma}a.w.splice(f+1,0,{Ma:b,Gc:c<<5&224,Oc:d,ic:e})}a.C|=2}function Tb(a){return a.O=a.O&63728|a.Oa()|ld(a)|kd(a)|jd(a)} -function Ub(a,b){a.Y=b<<12;a.ba=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.O)&2048)for(var c=a.Qa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Qa[c];a.Qa[c]=d}a.B=b>>14&3;c=a.O>>14&3;a.B!=c&&(a.Aa[c]=a.u[6],a.u[6]=a.Aa[a.B]);a.C|=2;a.O=b}function Q(a,b){a.C&128||(a.Y=a.ba=b,a.V=0)}function od(a,b,c){a.C&128||(a.Y=a.ba=a.U=b,a.V=c||0)}function pd(a,b,c,d){a.C&128||(a.Y=a.ba=a.U=b,a.V=(c^b)&(d^b))}function qd(a,b){a.C&128||(a.Y=a.ba=a.U=b,a.V=a.Y^a.U>>1)} -function rd(a,b,c,d){a.C&128||(a.Y=a.ba=a.U=b,a.V=(c^d)&(d^b))}h.K=function(a){var b=!1;0>this.ra?this.ra=Tb(this):this.B||(a=4,b=!0);this.G&57344||(this.ab=63222,this.ac=a);this.B=0;var c=this.X(a|this.ea),d=this.X(a+2&65535|this.ea);Ub(this,d&-12289|this.ra>>2&12288);b&&(this.I|=4,this.u[6]=4);sd(this,this.ra);sd(this,this.u[7]);nd(this,c);this.C&=-113;this.ra=-1;throw a;};function td(a){var b=ud(a),c=ud(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);nd(a,b);Ub(a,c);a.C&=-17} -function jc(a,b){var c=b>>13&31;31>c?a.bb&32&&(b=a.Pb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} -function vd(a,b,c){var d,e,f,g=0;d=b>>13;a.bb&a.Yc[a.B]||(d&=7);e=a.W[a.B][d];f=(a.wa[a.B][d]<<6)+(b&8191)&a.Xb;ff&&(3932160<=f&&(f=jc(a,f&262143)),f>=a.Vb&&4186112>f&&(a.I|=32,a.K(4,12))));switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|= -16384));a.W[a.B][d]=e;if(4194170!==f||a.B)a.Ba=a.B,a.Ca=d;g&&(g&57344&&(0<=a.ra&&(g|=128),a.G&57344||(a.G=a.G|g|a.Ba<<5|a.Ca<<1),a.K(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.X(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.X(e)|g;a.b-= -8;break;case 6:return e=md(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=md(a),e=e+a.u[c]&65535,e=a.X(e|a.ea)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.ab=a.ab<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.u[6]<=a.cb||65534<=a.u[6])&&(a.u[6]<=a.cb-32?(a.I|=4,a.u[6]=4,a.K(4,24)):(a.I|=8,a.C|=64));return e}h.Wc=function(a,b,c){return wd(this,a,b,c)};h.Xc=function(a,b,c){return vd(this,wd(this,a,b,c),c)};h.wb=function(a){a&1&&(this.I|=64,this.K(4,10));return this.F.Ia(a)}; -h.Ic=function(a){return this.wb(vd(this,a,2))};h.Cb=function(a,b){a&1&&(this.I|=64,this.K(4,10));this.F.qc(a,b&65535)};h.ae=function(a,b){this.Cb(vd(this,a|65536,4),b)};function xd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=wd(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.B=a.O>>12&3,c=a.X(d|c&a.ea),a.B=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.Aa[a.O>>12&3];return c} -function yd(a,b,c,d){a.G&57344||(a.ab=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=wd(a,b,e,4),c&65536||(e&=65535),a.B=a.O>>12&3,e=vd(a,e|c&65536,4),a.B=a.O>>14&3,a.Cb(e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.Aa[a.O>>12&3]=d}function zd(a,b){b>>=6;var c=a.J=b&7;(b=a.H=(b&56)>>3)?(c=a.R(b,c,3),a=a.F.mb(c)):a=a.u[c]&255;return a}function Ad(a,b){var c;b>>=6;var d=a.J=b&7;(b=a.H=(b&56)>>3)?c=a.wb(a.R(b,d,2)):c=a.u[d];return c}function Bd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return wd(a,b,c,8)} -function Cd(a,b){var c=a.f=b&7;(b=a.g=(b&56)>>3)?(c=a.R(b,c,3),a=a.F.mb(c)):a=a.u[c]&255;return a}function Dd(a,b){var c,d=a.f=b&7;(b=a.g=(b&56)>>3)?c=a.wb(a.R(b,d,2)):c=a.u[d];return c}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.pb=a.R(b,e,7),c=d.call(a,c,a.F.mb(e)),e&1&&a.b--,a.F.Ob(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.R(b,e,6),a.Cb(e,d.call(a,c,a.wb(e)))):a.u[e]=d.call(a,c,a.u[e])} -function Ed(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.R(b,e,5),d&1&&a.b--,a.F.Ob(d,c&255)):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Fd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.Cb(a.R(b,d,4),c):a.u[d]=c&65535;return c}function T(a,b,c){c&&(nd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -h.Bb=function(a){this.v.complete=!0;var b=this.v.Uc=this.j&&Gd(this.j),c=a?this.v.rc?0:1:-1;this.v.rc=!1;this.S=this.b=a;do{if(b){if(Hd(this.j,this.u[7],c)){this.ia();break}c=1}if(this.C&&(this.C&112&&(this.C&32?this.K(168,28):this.C&64?this.K(4,30):this.C&16&&this.K(12,32),this.C&=-113),this.C&7))if(this.C&2){this.C&=-3;a=null;for(var d=this.oc&224,e=this.w.length;0<=--e;){if(0d&&(d=this.w[e].Gc,a=this.w[e],this.w.splice(e,1))}d>(this.O&224)&&(this.C&4&&(this.u[7]=this.u[7]+2&65535,this.C&=-5),a?this.K(a.Oc,26):this.K(160,26))}else this.C&1&&this.C++;this.G&57344||(this.ab=0,this.ac=this.u[7]);this.C=this.C&7|this.O&16;this.decode(md(this))}while(0>1|b<<16;qd(this,a);return a&65535}function Nd(a,b){a=b&2048|b>>1|b<<8;qd(this,a<<8);return a&255}function Od(a,b){a=b&~a;Q(this,a);return a}function Pd(a,b){a=b&~a;Q(this,a<<8);return a}function Qd(a,b){a|=b;Q(this,a);return a} -function Rd(a,b){a|=b;Q(this,a<<8);return a}function Sd(a,b){a=~b|65536;od(this,a);return a&65535}function Td(a,b){a=~b|256;od(this,a<<8);return a&255}function Ud(a,b){a=b-a;this.C&128||(this.Y=this.ba=a,this.V=b&(b^a));return a&65535}function Vd(a,b){a=b-a;var c=a<<8;b<<=8;this.C&128||(this.Y=this.ba=c,this.V=b&(b^c));return a&255}function Wd(a,b){a=b+a;this.C&128||(this.Y=this.ba=a,this.V=a&(b^a));return a&65535} -function Xd(a,b){a=b+a;var c=a<<8;this.C&128||(this.Y=this.ba=c,this.V=c&(b<<8^c));return a&255}function Yd(a,b){a=-b;od(this,a,a&b&32768);return a&65535}function Zd(a,b){a=-b;od(this,a<<8,(a&b&128)<<8);return a&255}function $d(a,b){a=b<<1|this.U>>16&1;qd(this,a);return a&65535}function ae(a,b){a=b<<1|this.U>>16&1;qd(this,a<<8);return a&255}function be(a,b){a=(this.U&65536|b)>>1|b<<16;qd(this,a);return a&65535}function ce(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;qd(this,a<<8);return a&255} -function de(a,b){var c=b-a;rd(this,c,a,b);return c&65535}function ee(a,b){var c=b-a;rd(this,c<<8,a<<8,b<<8);return c&255}function fe(a,b){this.C&128||(this.Y=this.ba=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function ge(a,b){a^=b;Q(this,a);return a&65535} -function he(a){var b=Dd(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.Y=this.ba=c;this.b-=(this.g?6:7)+b} -function ie(a){var b=Dd(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.Y=d>>16;this.ba=d>>16|d;this.b-=(this.g?6:7)+b}function U(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.ba=1);a&8&&(this.Y=0);this.b-=5} -function je(a){var b=Dd(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.ba=d>>16|d,this.Y=d>>16):(this.V=32768,this.ba=d>>15|d,this.Y=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.ba=this.Y=0,this.V=32768,this.U=65536,this.b-=7}var ke=[0,7,7,10,7,11,9,13];function le(a){var b=this.b;nd(this,Bd(this,a));this.b=b-ke[this.g]} -var me=[0,14,14,17,14,18,16,20];function ne(a){var b=this.b,c=Bd(this,a);a=a>>6&7;sd(this,this.u[a]);this.u[a]=this.u[7];nd(this,c);this.b=b-me[this.g]}var oe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],pe=[7,13,13,17,14,18,17,21];function qe(a){var b=Dd(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.C&128||(this.Y=b>>16,this.ba=this.Y|b,this.V=0,this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)nd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function ue(a){S(this,a,0,fe);this.b-=this.g?9:3+(7==this.f?2:0)}function Oe(a){S(this,a,Ad(this,a),ge);this.b-=this.g?9:3+(7==this.f?2:0)}function V(){this.K(8,6)}function hd(a){Pe[a>>12].call(this,a)} -var Pe=[function(a){Qe[a>>8&15].call(this,a)},function(a){var b=Ad(this,a),c=this.b;Q(this,Fd(this,a,b));this.b=c-oe[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)},function(a){var b=Ad(this,a);a=Dd(this,a);rd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,Ad(this,a)&Dd(this,a));this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){S(this,a,Ad(this,a),Od);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f? -2:0)},function(a){S(this,a,Ad(this,a),Qd);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){S(this,a,Ad(this,a),Id);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Re[a>>8&15].call(this,a)},function(a){Se[a>>8&15].call(this,a)},function(a){var b=zd(this,a);Q(this,Ed(this,a,b,1)<<8);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=zd(this,a)<<8;a=Cd(this,a)<<8;rd(this,b-a,a,b);this.b-=this.g? -4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,(zd(this,a)&Cd(this,a))<<8);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){R(this,a,zd(this,a),Pd);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,zd(this,a),Rd);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){S(this,a,Ad(this,a),de);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},V],Qe= -[function(a){Te[a>>4&15].call(this,a)},function(a){T(this,a,!0)},function(a){T(this,a,!ld(this))},function(a){T(this,a,ld(this))},function(a){T(this,a,!this.Oa()==!kd(this))},function(a){T(this,a,!this.Oa()!=!kd(this))},function(a){T(this,a,!ld(this)&&!this.Oa()==!kd(this))},function(a){T(this,a,ld(this)||!this.Oa()!=!kd(this))},ne,ne,function(a){Ue[a>>6&3].call(this,a)},function(a){Ve[a>>6&3].call(this,a)},function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},V,V],Ue=[function(a){od(this, -Fd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Sd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Wd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ud);this.b-=this.g?9:3+(7==this.f?2:0)}],Ve=[function(a){S(this,a,0,Yd);this.b-=this.g?11:6},function(a){S(this,a,jd(this)?1:0,Id);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,jd(this)?1:0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Dd(this,a);od(this,a);this.b-=this.g?4:3+(7==this.f? -2:0)}],We=[function(a){S(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Md);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Kd);this.b-=this.g?9:3+(7==this.f?2:0)}],Xe=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Ic(a|65536);nd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=xd(this,a,0);sd(this,a);Q(this,a);this.b-=11},function(a){var b=ud(this),c=this.b;yd(this,a, -0,b);Q(this,b);this.b=c-pe[this.g]},function(a){Q(this,Fd(this,a,this.Oa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Te=[function(a){Ye[a&15].call(this,a)},V,V,V,le,le,le,le,function(a){if(a&8)this.K(8,6);else{var b=ud(this);a&=7;nd(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.C|=1),this.b-=5):this.K(8,6)},function(a){Ze[a&15].call(this,a)},function(a){$e[a&15].call(this,a)},ue,ue,ue,ue],Ye=[function(){this.O&49152?(this.I|=128,this.K(4, -3)):this.ia();this.b-=7},function(){this.C|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){td(this);this.C|=this.O&16;this.b-=13},function(){this.K(12,1);this.b-=5},function(){this.K(16,4);this.b-=25},function(){this.O&49152||(id(this),this.F.reset());this.b-=667},function(){td(this);this.b-=13},V,V,V,V,V,V,V,V,V],Ze=[re,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},U,function(){this.ba=1;this.b-=5},U,U,U,function(){this.Y=0;this.b-=5},U,U,U,U,U,U,U],$e=[re,function(){this.U= -65536;this.b-=5},function(){this.V=32768;this.b-=5},se,function(){this.ba=0;this.b-=5},se,se,se,function(){this.Y=32768;this.b-=5},se,se,se,se,se,se,se],Re=[qe,qe,je,je,he,he,ie,ie,Oe,Oe,V,V,V,V,te,te],Se=[function(a){T(this,a,!this.Oa())},function(a){T(this,a,this.Oa())},function(a){T(this,a,!jd(this)&&!ld(this))},function(a){T(this,a,jd(this)||ld(this))},function(a){T(this,a,!kd(this))},function(a){T(this,a,kd(this))},function(a){T(this,a,!jd(this))},function(a){T(this,a,jd(this))},function(){this.K(24, -2);this.b-=25},function(){this.K(28,5);this.b-=5},function(a){af[a>>6&3].call(this,a)},function(a){bf[a>>6&3].call(this,a)},function(a){cf[a>>6&3].call(this,a)},function(a){df[a>>6&3].call(this,a)},V,V],af=[function(a){od(this,Ed(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Td);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Xd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Vd);this.b-=this.g?9:3+(7==this.f?2:0)}],bf=[function(a){R(this,a,0,Zd);this.b-= -this.g?11:6},function(a){R(this,a,jd(this)?1:0,Jd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,jd(this)?1:0,ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Cd(this,a);od(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],cf=[function(a){R(this,a,0,ce);this.b-=this.g?9+(this.pb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Nd);this.b-=this.g?9+(this.pb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ld);this.b-=this.g?9:3+(7== -this.f?2:0)}],df=[V,function(a){a=xd(this,a,65536);sd(this,a);Q(this,a);this.b-=11},function(a){var b=ud(this),c=this.b;yd(this,a,65536,b);Q(this,b);this.b=c-pe[this.g]},V];function ef(a){u.call(this,"ROM",a,ef);this.f=null;this.B=a.addr;this.g=a.size;this.G=a.writable;this.D=a.alias;this.w=a.file;this.H=da(this.w);if(this.w){a=this.w;var b=fa(this.H);"json"!=b&&"hex"!=b&&(a=ha()+"/api/v1/dump?file="+this.w+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){ff(c,a,b,f)})}}y(ef); -ef.prototype.Pa=function(a,b,c,d){this.F=b;this.b=c;this.j=d;gf(this)};ef.prototype.Ka=function(){if(this.La){if(this.j){var a=this.j,b=this.id,c=this.B,d=this.g,e=this.La,f=[],g;for(g in e){var k=e[g];"number"==typeof k&&(e[g]=k={o:k});var m=k.o,n=k.a;if(void 0!==m){var p=f,m=[m>>>0,g],t=ra(p,m,a.vc);0>t&&p.splice(-(t+1),0,m)}n&&(k.a=n.replace(/''/g,'"'))}a.H.push({ee:b,A:c,Zc:d,La:e,uc:f})}delete this.La}return!0};ef.prototype.Ja=function(){return!0}; -function ff(a,b,c,d){if(d)a.ta("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.fc,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,k=eval("("+c+")");if(f=k.bytes)a.f=f;else if(f=k.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=k.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=k;a.La=k.symbols;if(!a.f.length){q("Empty ROM: "+ -b);return}if(1==a.f.length){q(a.f[0]);return}}catch(m){a.ta("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e>>d.ca].dc(e&d.f,a.f[c]&255,e);a.j&&a.j.g--}b=!0}else b=!1;if(b){b=[];"number"==typeof a.D?b.push(a.D):null!=a.D&&a.D.length&&(b=a.D);for(c=0;c>>e.ca;0>>=e.ca;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=pa(b[0]);if(c!=this.Sb)return;b=pa(b[1]);if(this.J=db(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.N=d.receiveData){this.status(this.fc+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Ka=function(a,b){if(!b)if(this.Dc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.Ja=function(a){return a?this.save():!0};h.reset=function(){mf(this)};h.save=function(){var a=new P(this);a.set(0,[]);return a.data()};h.restore=function(){return mf(this)};function mf(a){a.X=0;a.f=0;a.g=128;a.B=[];return!0}h.nc=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.Z||8,c=a-this.H%a,this.Z&&(b=oa("",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.G){if(10==a||1024<=this.G.length)this.i(this.G), -this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;K(this.b,100,4,52,this.S)}};var nf={},lf=(nf[65392]=[null,null,X.prototype.nd,X.prototype.Sd,"RCSR"],nf[65394]=[null,null,X.prototype.md,X.prototype.Rd,"RBUF"],nf[65396]=[null,null,X.prototype.xd,X.prototype.ce,"XCSR"],nf[65398]=[null,null,X.prototype.wd,X.prototype.be,"XBUF"],nf);Ma(function(){for(var a=A(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};of.prototype.Ac=function(){return-1};of.prototype.Bc=function(){}; -function qf(a,b,c,d){if(c)if(b){0>a.B&&a.w.length&&(a.B=0);if(0>a.B||b!=a.w[a.B])a.w.splice(0,0,b),a.B=0;a.B--}else a.$?b="end":b=a.w[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(pa(b.substring(c,f))),c=f+1}}return a} -function rf(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +var wb="undefined"!==typeof ArrayBuffer,xb={cpu:1,trap:16,bus:64,mem:128,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function yb(a){r.call(this,"Panel",a,yb)}y(yb);h=yb.prototype;h.ja=function(a,b,c,d){return this.F&&this.F.ja(a,b,c,d)||this.b&&this.b.ja(a,b,c,d)||this.j&&this.j.ja(a,b,c,d)?!0:this.parent.ja.call(this,a,b,c,d)};h.Ga=function(a,b,c,d){this.F=a;this.B=b;this.b=c;this.j=d}; +h.Ca=function(a,b){b||zb();return!0};h.Ba=function(){return!0};h.za=function(){};function zb(){for(var a=!1,b=A(document,"pdp11","panel"),c=0;c>1)+2;10>this.Z&&(this.Z=10);15>2;this.f=this.ya-1;this.A=this.B/this.ya|0;this.Ka=[];this.F=[];a=new H(this.b);Bb(a,this.j);this.X=Array(this.A);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ka[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&F(this.j,64)&&D(this.j,e[4]+".readByte("+I(this.j,b)+"): "+I(this.j,c),!0,!0),c;c=Ib(d,b|4186112,-1,1);this.j&&F(this.j,64)&&D(this.j,"warning: unconverted read access to byte @"+I(this.j,b)+": "+I(this.j,c),!0,!0);return c} +function Db(a,b,c){var d=!1,e=this.controller,f=e.Ka[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ka[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&F(this.j,64)&&D(this.j,f[4]+".writeByte("+I(this.j,c)+","+I(this.j,b)+")",!0,!0):(Ib(e,c|4186112,b,1),this.j&&F(this.j,64)&&D(this.j,"warning: unconverted write access to byte @"+I(this.j,c)+": "+I(this.j,b),!0,!0))} +function Eb(a,b){var c=-1,d=this.controller;(a=d.Ka[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&F(this.j,64)&&D(this.j,a[4]+".readWord("+I(this.j,b)+"): "+I(this.j,c),!0,!0),c;c=Ib(d,b|4186112,-1,0);this.j&&F(this.j,64)&&D(this.j,"warning: unconverted read access to word @"+I(this.j,b)+": "+I(this.j,c),!0,!0);return c} +function Fb(a,b,c){var d=!1,e=this.controller;if(a=e.Ka[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.j&&F(this.j,64)&&D(this.j,a[4]+".writeWord("+I(this.j,c)+","+I(this.j,b)+")",!0,!0):(Ib(e,c|4186112,b,0),this.j&&F(this.j,64)&&D(this.j,"warning: unconverted write access to word @"+I(this.j,c)+": "+I(this.j,b),!0,!0))}h=Ab.prototype;h.reset=function(){for(var a=0;a>>a.Z;0g&&(q=g);if(n&&n.size){if(n.type==d&&n.controller==e){if(f+g<=n.w)return n.qb+=n.w-f,n.w=f,!0;if(f>=n.w+n.qb){q=n.size-(f-p);q>g&&(q=g);n.qb=f-n.w+q;f=p+a.ya;g-=q;l++;continue}}return Jb(1,f,g)}f=new H(a.b,f,q,a.ya,d,e);Bb(f,a.j,n);a.X[l++]=f;f=p+a.ya;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Kb[d]+" at "+k(b,8,!0)),!0):Jb(2,b,c)} +h.Ua=function(a){return this.X[(a&this.g)>>>this.Z].ub(a&this.f,a)};h.ma=function(a){return this.X[(a&this.g)>>>this.Z].dc(a&this.f,a)};function Lb(a,b){return a.X[(b&a.g)>>>a.Z].Db(b&a.f,b)}h.ob=function(a,b){this.X[(a&this.g)>>>this.Z].vb(a&this.f,b&255,a)};h.Xa=function(a,b){this.X[(a&this.g)>>>this.Z].oc(a&this.f,b&65535,a)}; +function Mb(a){for(var b=0,c=[],d=0;da.b.Xb))for(var f=e[0]?e[0].bind(b):null,g=e[1]?e[1].bind(b):null,l=e[2]?e[2].bind(b):null,n=e[3]?e[3].bind(b):null,p=a,q=+d,e=e[4],v=+d;v<=q;v+=2){var u=v&8191;void 0!==p.Ka[u]?m("I/O address already registered: "+k(v,8,!0)):p.Ka[u]=[f,g,l,n,e||"unknown",!1]}}}function Ob(a,b){a.F.push(b)}function Jb(a,b,c){m("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1} +function J(a){r.call(this,"Device",a,J);this.g={data:0,Gd:0,tb:20,Jd:0};this.f={Hd:0,Ib:-1}}y(J);h=J.prototype;h.Ga=function(a,b,c,d){this.B=b;this.b=c;this.j=d;var e=this;this.f.Ib=Pb(this.b,function(){e.f.Ma|=128;e.f.Ma&64&&(Qb(e.b,0,6,64),Rb(e.b,e.f.Ib,1E3/60))});Nb(b,this,K);Ob(b,this.reset.bind(this));G(this)};h.Gc=function(){var a=this.f.Ma;this.f.Ma&=-129;return a};h.kd=function(a){this.f.Ma=a;a&64&&Rb(this.b,this.f.Ib,1E3/60);this.f.Ma=a&-129}; +h.Ic=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};h.md=function(a){var b=this.b;b.G=a&=62337;b.wa=a>>5&3;b.xa=a>>1&15;b.Bb=a&257?a&1?6:4:0;Sb(b);Tb(this)};h.Jc=function(){var a=this.b.Oa;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Kc=function(){return this.b.Fb};h.Lc=function(){return this.b.Wa};h.nd=function(a){var b=this.b;b.Wa=a;b.Wa&16?(b.jb=4194303,b.Ia=3915776):(b.jb=262143,b.Ia=253952);Tb(this)};function Tb(a){a.g.tb=a.g.tb&-8|(a.b.Bb?a.b.Wa&16?1:2:4)} +h.Tc=function(a){return this.b.S[1][a>>1&7]};h.vd=function(a,b){this.b.S[1][b>>1&7]=a&65295};h.Rc=function(a){return this.b.S[1][(a>>1&7)+8]};h.td=function(a,b){this.b.S[1][(b>>1&7)+8]=a&65295};h.Sc=function(a){return this.b.pa[1][a>>1&7]};h.ud=function(a,b){b=b>>1&7;this.b.pa[1][b]=a;this.b.S[1][b]&=65295};h.Qc=function(a){return this.b.pa[1][(a>>1&7)+8]};h.sd=function(a,b){b=(b>>1&7)+8;this.b.pa[1][b]=a;this.b.S[1][b]&=65295};h.Fc=function(a){return this.b.S[0][a>>1&7]}; +h.jd=function(a,b){this.b.S[0][b>>1&7]=a&65295};h.Dc=function(a){return this.b.S[0][(a>>1&7)+8]};h.gd=function(a,b){this.b.S[0][(b>>1&7)+8]=a&65295};h.Ec=function(a){return this.b.pa[0][a>>1&7]};h.hd=function(a,b){b=b>>1&7;this.b.pa[0][b]=a;this.b.S[0][b]&=65295};h.Cc=function(a){return this.b.pa[0][(a>>1&7)+8]};h.fd=function(a,b){b=(b>>1&7)+8;this.b.pa[0][b]=a;this.b.S[0][b]&=65295};h.Zc=function(a){return this.b.S[3][a>>1&7]};h.Bd=function(a,b){this.b.S[3][b>>1&7]=a&65295}; +h.Xc=function(a){return this.b.S[3][(a>>1&7)+8]};h.zd=function(a,b){this.b.S[3][(b>>1&7)+8]=a&65295};h.Yc=function(a){return this.b.pa[3][a>>1&7]};h.Ad=function(a,b){b=b>>1&7;this.b.pa[3][b]=a;this.b.S[3][b]&=65295};h.Wc=function(a){return this.b.pa[3][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.b.pa[3][b]=a;this.b.S[3][b]&=65295};h.ra=function(a){a&=7;return this.b.K&2048?this.b.Ha[a]:this.b.u[a]};h.ua=function(a,b){b&=7;this.b.K&2048?this.b.Ha[b]=a:this.b.u[b]=a}; +h.Zb=function(){return this.b.K&49152?this.b.ta[0]:this.b.u[6]};h.jc=function(a){this.b.K&49152?this.b.ta[0]=a:this.b.u[6]=a};h.bc=function(){return this.b.u[7]};h.mc=function(a){this.b.u[7]=a};h.sa=function(a){a&=7;return this.b.K&2048?this.b.u[a]:this.b.Ha[a]};h.va=function(a,b){b&=7;this.b.K&2048?this.b.u[b]=a:this.b.Ha[b]=a};h.$b=function(){return 1==(this.b.K&49152)>>14?this.b.u[6]:this.b.ta[1]};h.kc=function(a){1==(this.b.K&49152)>>14?this.b.u[6]=a:this.b.ta[1]=a}; +h.ac=function(){return 3==(this.b.K&49152)>>14?this.b.u[6]:this.b.ta[3]};h.lc=function(a){3==(this.b.K&49152)>>14?this.b.u[6]=a:this.b.ta[3]=a};h.Bc=function(a){return this.b.gc[a-65504>>1]};h.ed=function(a,b){this.b.gc[b-65504>>1]=a};h.cc=function(a){return 65520==a?61183:0};h.nc=function(){};h.Vc=function(){return 1};h.xd=function(){};h.Ac=function(){return this.b.$};h.dd=function(){this.b.$=0};h.Hc=function(){return this.b.fc};h.ld=function(a,b){b&1||(a&=255);this.b.fc=a};h.Mc=function(){return this.b.Gb}; +h.od=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Gb=a;b.D|=2};h.Uc=function(){return this.b.Pa&65280};h.wd=function(a){this.b.Pa=a|255};h.Nc=function(){return Ub(this.b)};h.pd=function(a){Vb(this.b,a&-1809|Ub(this.b)&1808);this.b.D|=128};h.reset=function(){this.g.tb=this.g.tb&-120|20;this.f.Ma=0}; +var L={},K=(L[62592]=[null,null,J.prototype.Tc,J.prototype.vd,"SISDR"],L[62608]=[null,null,J.prototype.Rc,J.prototype.td,"SDSDR"],L[62624]=[null,null,J.prototype.Sc,J.prototype.ud,"SISAR"],L[62640]=[null,null,J.prototype.Qc,J.prototype.sd,"SDSAR"],L[62656]=[null,null,J.prototype.Fc,J.prototype.jd,"KISDR"],L[62672]=[null,null,J.prototype.Dc,J.prototype.gd,"KDSDR"],L[62688]=[null,null,J.prototype.Ec,J.prototype.hd,"KISAR"],L[62704]=[null,null,J.prototype.Cc,J.prototype.fd,"KDSAR"],L[62798]=[null,null, +J.prototype.Lc,J.prototype.nd,"MMR3"],L[65382]=[null,null,J.prototype.Gc,J.prototype.kd,"LKS"],L[65402]=[null,null,J.prototype.Ic,J.prototype.md,"MMR0"],L[65404]=[null,null,J.prototype.Jc,null,"MMR1"],L[65406]=[null,null,J.prototype.Kc,null,"MMR2"],L[65408]=[null,null,J.prototype.Zc,J.prototype.Bd,"UISDR"],L[65424]=[null,null,J.prototype.Xc,J.prototype.zd,"UDSDR"],L[65440]=[null,null,J.prototype.Yc,J.prototype.Ad,"UISAR"],L[65456]=[null,null,J.prototype.Wc,J.prototype.yd,"UDSAR"],L[65472]=[J.prototype.ra, +J.prototype.ua,J.prototype.ra,J.prototype.ua,"R0SET0"],L[65473]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R1SET0"],L[65474]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R2SET0"],L[65475]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R3SET0"],L[65476]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R4SET0"],L[65477]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R5SET0"],L[65478]=[J.prototype.Zb,J.prototype.jc,J.prototype.Zb, +J.prototype.jc,"R6KERNEL"],L[65479]=[J.prototype.bc,J.prototype.mc,J.prototype.bc,J.prototype.mc,"R7KERNEL"],L[65480]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R0SET1"],L[65481]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R1SET1"],L[65482]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R2SET1"],L[65483]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R3SET1"],L[65484]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R4SET1"], +L[65485]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R5SET1"],L[65486]=[J.prototype.$b,J.prototype.kc,J.prototype.$b,J.prototype.kc,"R6SUPER"],L[65487]=[J.prototype.ac,J.prototype.lc,J.prototype.ac,J.prototype.lc,"R6USER"],L[65504]=[null,null,J.prototype.Bc,J.prototype.ed,"CTRL",1170],L[65520]=[null,null,J.prototype.cc,J.prototype.nc,"LSIZE",1170],L[65522]=[null,null,J.prototype.cc,J.prototype.nc,"HSIZE",1170],L[65524]=[null,null,J.prototype.Vc,J.prototype.xd,"SYSID",1170],L[65526]= +[null,null,J.prototype.Ac,J.prototype.dd,"CPUERR",1170],L[65528]=[null,null,J.prototype.Hc,J.prototype.ld,"MB",1170],L[65530]=[null,null,J.prototype.Mc,J.prototype.od,"PIR"],L[65532]=[null,null,J.prototype.Uc,J.prototype.wd,"SL"],L[65534]=[null,null,J.prototype.Nc,J.prototype.pd,"PSW"],L);K[62594]=K[62592];K[62596]=K[62592];K[62598]=K[62592];K[62600]=K[62592];K[62602]=K[62592];K[62604]=K[62592];K[62606]=K[62592];K[62610]=K[62608];K[62612]=K[62608];K[62614]=K[62608];K[62616]=K[62608];K[62618]=K[62608]; +K[62620]=K[62608];K[62622]=K[62608];K[62626]=K[62624];K[62628]=K[62624];K[62630]=K[62624];K[62632]=K[62624];K[62634]=K[62624];K[62636]=K[62624];K[62638]=K[62624];K[62642]=K[62640];K[62644]=K[62640];K[62646]=K[62640];K[62648]=K[62640];K[62650]=K[62640];K[62652]=K[62640];K[62654]=K[62640];K[62658]=K[62656];K[62660]=K[62656];K[62662]=K[62656];K[62664]=K[62656];K[62666]=K[62656];K[62668]=K[62656];K[62670]=K[62656];K[62674]=K[62672];K[62676]=K[62672];K[62678]=K[62672];K[62680]=K[62672];K[62682]=K[62672]; +K[62684]=K[62672];K[62686]=K[62672];K[62690]=K[62688];K[62692]=K[62688];K[62694]=K[62688];K[62696]=K[62688];K[62698]=K[62688];K[62700]=K[62688];K[62702]=K[62688];K[62706]=K[62704];K[62708]=K[62704];K[62710]=K[62704];K[62712]=K[62704];K[62714]=K[62704];K[62716]=K[62704];K[62718]=K[62704];K[65410]=K[65408];K[65412]=K[65408];K[65414]=K[65408];K[65416]=K[65408];K[65418]=K[65408];K[65420]=K[65408];K[65422]=K[65408];K[65426]=K[65424];K[65428]=K[65424];K[65430]=K[65424];K[65432]=K[65424];K[65434]=K[65424]; +K[65436]=K[65424];K[65438]=K[65424];K[65442]=K[65440];K[65444]=K[65440];K[65446]=K[65440];K[65448]=K[65440];K[65450]=K[65440];K[65452]=K[65440];K[65454]=K[65440];K[65458]=K[65456];K[65460]=K[65456];K[65462]=K[65456];K[65464]=K[65456];K[65466]=K[65456];K[65468]=K[65456];K[65470]=K[65456];K[65506]=K[65504];K[65508]=K[65504];K[65510]=K[65504];K[65512]=K[65504];K[65514]=K[65504];K[65516]=K[65504];K[65518]=K[65504]; +La(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.f=new Int32Array(this.C,0,d>>2),kc(this,gc?lc:mc);else{this.f=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},W:function(a){return this.f[a>>2]>>>((a&3)<<3)&255},ga:function(a,b){a&1&&this.b.O(4,b);b=a>>2;a=(a&3)<<3;var c=this.f[b]>>a;return 24>a?c&65535:c&255|(this.f[b+1]&255)<<8},oa:function(a,b){var c=a>>2;a=(a&3)<<3;this.f[c]= +this.f[c]&~(255<>2;a=(a&3)<<3;24>a?this.f[c]=this.f[c]&~(65535<>8);this.La=!0},T:function(a,b){if(this.j&&null!=this.w){var c=this.j;rc(c,this.w+a,1,c.N)&&c.ea(!0)}return this.Cb(a,b)},ca:function(a,b){if(this.j&&null!=this.w){var c=this.j;rc(c,this.w+a,2,c.N)&&c.ea(!0)}return this.Db(a,b)},ka:function(a,b,c){if(this.j&&null!=this.w){var d=this.j;rc(d,this.w+a, +1,d.G)&&d.ea(!0)}this.B?this.A(a,b,c):this.wb(a,b,c)},wa:function(a,b,c){if(this.j&&null!=this.w){var d=this.j;rc(d,this.w+a,2,d.G)&&d.ea(!0)}this.B?this.A(a,b,c):this.Jb(a,b,c)},N:function(a){return this.g[a]},V:function(a,b){a=this.g[a];this.j&&F(this.j,128)&&D(this.j,"Memory.readByte("+I(this.j,b)+"): "+I(this.j,a),!0);return a},aa:function(a,b){a&1&&this.b.O(4,b);return this.G.getUint16(a,!0)},da:function(a,b){a&1&&this.b.O(4,b);a=a&1?this.g[a]|this.g[a+1]<<8:this.I[a>>1];this.j&&F(this.j,128)&& +D(this.j,"Memory.readWord("+I(this.j,b)+"): "+I(this.j,a),!0);return a},ia:function(a,b){this.g[a]=b;this.La=!0},la:function(a,b,c){this.g[a]=b;this.La=!0;this.j&&F(this.j,128)&&D(this.j,"Memory.writeByte("+I(this.j,c)+","+I(this.j,b)+")",!0)},qa:function(a,b,c){a&1&&this.b.O(4,c);this.G.setUint16(a,b,!0);this.La=!0},xa:function(a,b,c){a&1&&this.b.O(4,c);a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.I[a>>1]=b;this.La=!0;this.j&&F(this.j,128)&&D(this.j,"Memory.writeWord("+I(this.j,c)+","+I(this.j,b)+")", +!0)}};function Bb(a,b,c){a.j=b;a.J=a.F=0;c&&((a.J=c.J)&&qc(a,pc,!1),(a.F=c.F)&&oc(a,pc,!1))}function sc(a,b){b?--a.F||(a.vb=a.B?a.A:a.wb,a.oc=a.B?a.H:a.Jb):--a.J||(a.ub=a.Cb,a.dc=a.Db)}function oc(a,b,c){c&&a.F||(a.vb=!a.B&&b[1]||a.A,a.oc=!a.B&&b[3]||a.H);if(c||void 0===c)a.wb=b[1]||a.A,a.Jb=b[3]||a.H}function qc(a,b,c){c&&a.J||(a.ub=b[0]||a.L,a.dc=b[2]||a.M);if(c||void 0===c)a.Cb=b[0]||a.L,a.Db=b[2]||a.M}function kc(a,b){b||(b=tc);qc(a,b,void 0);oc(a,b,void 0)} +var tc=[],nc=[H.prototype.W,H.prototype.oa,H.prototype.ga,H.prototype.Ya],pc=[H.prototype.T,H.prototype.ka,H.prototype.ca,H.prototype.wa];if(wb)var mc=[H.prototype.N,H.prototype.ia,H.prototype.aa,H.prototype.qa],lc=[H.prototype.V,H.prototype.la,H.prototype.da,H.prototype.xa]; +function uc(a,b){r.call(this,"CPU",a,uc,1);var c=a.multiplier||1;this.Qa=a.cycles||b;this.Na=c;this.ab=Math.round(this.Qa/1E4)/100;this.Va=this.ab*this.Na;this.v.ba=!1;this.v.Hb=!1;this.v.hb=a.autoStart;this.v.Mb=!1;this.v.$a=!1;this.lb=this.ia=0;this.mb=a.csStart;this.bb=a.csInterval;this.cb=a.csStop;this.L=[];this.Vb=this.cd.bind(this);G(this)}y(uc);var vc=["power","reset"];h=uc.prototype; +h.Ga=function(a,b,c,d){this.F=a;this.B=b;this.j=d;for(b=0;b=a.ia&&(a.ia+=a.bb,c=!0);0<=a.cb&&a.cb<=Bc(a)&&(a.bb=a.cb=-1,yc(a),a.ea(),c=!0);c&&a.i(Bc(a)+" cycles: checksum="+k(a.lb))}} +function Cc(a,b,c,d){if(a.J[b]){void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.ea());var e=a.j&&a.j.ia||8;c=!a.v.ba||a.v.Mb?8==e?ba(c,d):k(c,d):"--------".substr(0,d||4);a.J[b].textContent!=c&&(a.J[b].textContent=c)}} +h.ja=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.J[b]=c;a=!0;break;case "run":this.J[b]=c;c.onclick=function(){var a;if(a=d.F)if(a=d.F,a.v.fa)a=!0;else{var b=null,c,l=bb(a.id);for(c=0;ca.ca/a.Va?b=1:d=!0;a.Na=b;b=a.ab*a.Na;if(a.Va!=b){a.Va=b;b=a.Va.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.F&&a.F.pb()}Ec(a,a.W);a.W=0;a.V=ra();a.da=0;Fc(a);return d}function Pb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Rb(a,b,c){0<=b&&ba.L[b][0]&&(c*=a.Qa*a.Na/1E3,a.L[b][0]=c)}function Gc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b} +function Hc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}} +h.cd=function(){if(this.v.ba){this.kb>=this.Qa&&Fc(this,!0);this.qa=0;this.Ja=ra();if(this.da){var a=this.Ja-this.da;a>this.Sb&&(this.V+=a,this.V>this.Ja&&(this.V=this.Ja))}try{do{var b=Gc(this,this.v.$a?1:this.Ra);try{this.fb(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.N-this.b;Hc(this,c);this.qa+=c;this.W+=c;Ec(this,0,!0);Ac(this,c);this.ka-=c;if(0>=this.ka){this.ka+=this.Ra;15<=++this.Ub&&(this.F&&this.F.za(),this.Ub=0);break}}while(this.v.ba)}catch(e){this.ea();M(this);this.F&&this.F.stop(ra(), +Bc(this));vb(this,e.stack||e.message);return}if(this.v.ba){a=setTimeout;b=this.Vb;this.da=ra();c=this.Sb;this.qa&&(c=Math.round(c*this.qa/this.Ra));var c=c-(this.da-this.Ja),d=this.da-this.V;d&&(this.ca=Math.round(this.W/(10*d))/100,864E5<=d&&(this.ga=0,Dc(this)));if(0>c||this.cac&&(this.V-=c),c=0;this.kb+=this.qa;this.da+=c;a(b,c)}}}; +h.eb=function(a){if(ib(this))return!1;if(this.v.ba)return this.i(this.toString()+" busy"),!1;Dc(this);this.v.ba=!0;this.v.Hb=!0;this.oa&&this.oa.start();var b=this.J.run;b&&(b.textContent="Halt");this.F&&(a&&this.F.pb(!0),this.F.start(this.V,Bc(this)));M(this,!0);setTimeout(this.Vb,0);return!0};h.fb=function(){return 0}; +h.ea=function(a){if(this.v.ba){this.N-=this.b;this.b=0;Ec(this,this.W);this.W=0;this.v.ba=!1;this.oa&&this.oa.stop();var b=this.J.run;b&&(b.textContent="Run");this.F&&this.F.stop(ra(),Bc(this));M(this)}this.v.complete=a};function M(a,b){a.F&&a.F.za(b)} +function Ic(a){this.Xb=+a.model||1170;this.yc=a.resetAddr||0;uc.call(this,a,6666667);this.sb=0;this.decode=bd.bind(this);this.P=65536;this.R=32768;this.Y=65535;this.U=32768;this.K=15;this.u=[0,0,0,0,0,0,0,this.yc];this.Ha=[0,0,0,0,0,0];this.ta=[0,0,0,0];this.xa=this.C=0;this.wc=[4,2,0,1];this.S=[[0,0,0,0,0,0,0,0,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]];this.pa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.zc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.gc=[0,0,0,0,0,0,0,0];this.g=this.f=this.Za=this.H=this.I=this.D=this.fc=0;this.la=-1;cd(this);this.v.complete=this.v.rc=!1}y(Ic,uc);h=Ic.prototype;h.reset=function(){this.v.ba&&this.ea();cd(this);xc(this);this.v.error=!1;this.parent.reset.call(this)}; +function cd(a){a.Pa=255;a.$=0;a.Gb=0;a.G=0;a.Oa=0;a.Fb=0;a.Wa=0;a.Bb=0;a.wa=0;a.jb=262143;a.Ia=253952;a.A=[];a.D|=2;Sb(a)}function Sb(a){a.Bb?(a.aa=65536,a.M=a.uc,a.T=a.ec,a.Wb=a.Dd):(a.aa=0,a.M=a.tc,a.T=a.$c,a.Wb=a.Cd)}h.Ob=function(){return 0};h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ga,this.Na]);a.set(2,Mb(this.B));return a.data()}; +h.restore=function(a){var b=a[1];this.ga=b[1];Dc(this,b[3]);a:{b=this.B;a=a[2];var c;for(c=0;cb){a.A[f].Ea-=b;break}b-=a.A[f].Ea}a.A.splice(f+1,0,{Ea:b,Yb:c<<5&224,ic:d,Ab:e})}a.D|=2}function Ub(a){return a.K=a.K&63728|a.Fa()|fd(a)|ed(a)|dd(a)} +function Vb(a,b){a.U=b<<12;a.Y=~b&4;a.R=b<<14;a.P=b<<16;if((b^a.K)&2048)for(var c=a.Ha.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ha[c];a.Ha[c]=d}a.C=b>>14&3;c=a.K>>14&3;a.C!=c&&(a.ta[c]=a.u[6],a.u[6]=a.ta[a.C]);a.D|=2;a.K=b}function O(a,b){a.D&128||(a.U=a.Y=b,a.R=0)}function id(a,b,c){a.D&128||(a.U=a.Y=a.P=b,a.R=c||0)}function jd(a,b,c,d){a.D&128||(a.U=a.Y=a.P=b,a.R=(c^b)&(d^b))}function kd(a,b){a.D&128||(a.U=a.Y=a.P=b,a.R=a.U^a.P>>1)}function ld(a,b,c,d){a.D&128||(a.U=a.Y=a.P=b,a.R=(c^d)&(d^b))} +h.O=function(a){var b=!1;0>this.la?this.la=Ub(this):this.C||(a=4,b=!0);this.G&57344||(this.Oa=63222,this.Fb=a);this.C=0;var c=this.T(a|this.aa),d=this.T(a+2&65535|this.aa);Vb(this,d&-12289|this.la>>2&12288);b&&(this.$|=4,this.u[6]=4);md(this,this.la);md(this,this.u[7]);hd(this,c);this.D&=-113;this.la=-1;throw a;};function nd(a){var b=od(a),c=od(a)&-1793;a.K&49152&&(c=c&-225|a.K&63712);hd(a,b);Vb(a,c);a.D&=-17} +function pd(a,b,c){var d,e,f,g=0;d=b>>13;a.Wa&a.wc[a.C]||(d&=7);e=a.S[a.C][d];f=(a.pa[a.C][d]<<6)+(b&8191)&a.jb;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Wa&32&&(f=a.zc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ia&&4186112>f&&(a.$|=32,a.O(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192: +128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.S[a.C][d]=e;if(4194170!==f||a.C)a.wa=a.C,a.xa=d;g&&(g&57344&&(0<=a.la&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.O(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.T(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.T(e)|g;a.b-= +8;break;case 6:return e=gd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=gd(a),e=e+a.u[c]&65535,e=a.T(e|a.aa)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Oa=a.Oa<<8|f<<3&248|c);6==c&&!a.C&&d&4&&0>=f&&(a.u[6]<=a.Pa||65534<=a.u[6])&&(a.u[6]<=a.Pa-32?(a.$|=4,a.u[6]=4,a.O(4,24)):(a.$|=8,a.D|=64));return e}h.tc=function(a,b,c){return qd(this,a,b,c)};h.uc=function(a,b,c){return pd(this,qd(this,a,b,c),c)};h.$c=function(a){return this.B.ma(a)};h.ec=function(a){return this.B.ma(pd(this,a,2))}; +h.Cd=function(a,b){this.B.Xa(a,b&65535)};h.Dd=function(a,b){this.B.Xa(pd(this,a,4),b)};function rd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=qd(a,b,d,2),c&65536||61440!==(a.K&61440)&&(d&=65535),a.C=a.K>>12&3,c=a.T(d|c&a.aa),a.C=a.K>>14&3):c=6!=d||(a.K>>2&12288)===(a.K&12288)?a.u[d]:a.ta[a.K>>12&3];return c} +function sd(a,b,c,d){a.G&57344||(a.Oa=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=qd(a,b,e,4),c&65536||(e&=65535),a.C=a.K>>12&3,e=pd(a,e|c&65536,4),a.C=a.K>>14&3,a.B.Xa(e,d)):6!=e||(a.K>>2&12288)===(a.K&12288)?a.u[e]=d:a.ta[a.K>>12&3]=d}function td(a,b){b>>=6;var c=a.I=b&7;(b=a.H=(b&56)>>3)?(c=a.M(b,c,3),a=a.B.Ua(c)):a=a.u[c]&255;return a}function ud(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.B.ma(a.M(b,c,2)):a.u[c]}function vd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return qd(a,b,c,8)} +function wd(a,b){var c=a.f=b&7;(b=a.g=(b&56)>>3)?(c=a.M(b,c,3),a=a.B.Ua(c)):a=a.u[c]&255;return a}function xd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.B.ma(a.M(b,c,2)):a.u[c]}function P(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Za=a.M(b,e,7),c=d.call(a,c,a.B.Ua(e)),e&1&&a.b--,a.B.ob(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.M(b,e,6),a.B.Xa(e,d.call(a,c,a.B.ma(e)))):a.u[e]=d.call(a,c,a.u[e])} +function yd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.M(b,e,5),d&1&&a.b--,a.B.ob(d,c&255)):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function zd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.B.Xa(a.M(b,d,4),c):a.u[d]=c&65535;return c}function R(a,b,c){c&&(hd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +h.fb=function(a){this.v.complete=!0;var b=this.v.rc=this.j&&Ad(this.j),c=a?this.v.Hb?0:1:-1;this.v.Hb=!1;this.N=this.b=a;do{if(b){if(Bd(this.j,this.u[7],c)){this.ea();break}c=1}if(this.D&&(this.D&112&&(this.D&32?this.O(168,28):this.D&64?this.O(4,30):this.D&16&&this.O(12,32),this.D&=-113),this.D&7))if(this.D&2){this.D&=-3;a=null;for(var d=this.Gb&224,e=this.A.length;0<=--e;){if(0d&&(d=this.A[e].Yb,a=this.A[e],this.A.splice(e,1))}d>(this.K&224)&&(this.D&4&&(this.u[7]=this.u[7]+2&65535,this.D&=-5),a?this.O(a.ic,26):this.O(160,26))}else this.D&1&&this.D++;this.G&57344||(this.Oa=0,this.Fb=this.u[7]);this.D=this.D&7|this.K&16;this.decode(gd(this))}while(0>1|b<<16;kd(this,a);return a&65535}function Hd(a,b){a=b&2048|b>>1|b<<8;kd(this,a<<8);return a&255}function Id(a,b){a=b&~a;O(this,a);return a}function Jd(a,b){a=b&~a;O(this,a<<8);return a}function Kd(a,b){a|=b;O(this,a);return a} +function Ld(a,b){a|=b;O(this,a<<8);return a}function Md(a,b){a=~b|65536;id(this,a);return a&65535}function Nd(a,b){a=~b|256;id(this,a<<8);return a&255}function Od(a,b){a=b-a;this.D&128||(this.U=this.Y=a,this.R=b&(b^a));return a&65535}function Pd(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.U=this.Y=c,this.R=b&(b^c));return a&255}function Qd(a,b){a=b+a;this.D&128||(this.U=this.Y=a,this.R=a&(b^a));return a&65535} +function Rd(a,b){a=b+a;var c=a<<8;this.D&128||(this.U=this.Y=c,this.R=c&(b<<8^c));return a&255}function Sd(a,b){a=-b;id(this,a,a&b&32768);return a&65535}function Td(a,b){a=-b;id(this,a<<8,(a&b&128)<<8);return a&255}function Ud(a,b){a=b<<1|this.P>>16&1;kd(this,a);return a&65535}function Vd(a,b){a=b<<1|this.P>>16&1;kd(this,a<<8);return a&255}function Wd(a,b){a=(this.P&65536|b)>>1|b<<16;kd(this,a);return a&65535}function Xd(a,b){a=((this.P&65536)>>8|b)>>1|b<<8;kd(this,a<<8);return a&255} +function Yd(a,b){var c=b-a;ld(this,c,a,b);return c&65535}function Zd(a,b){var c=b-a;ld(this,c<<8,a<<8,b<<8);return c&255}function $d(a,b){this.D&128||(this.U=this.Y=b&65280,this.R=this.P=0);return(b<<8|b>>8)&65535}function ae(a,b){a^=b;O(this,a);return a&65535} +function be(a){var b=xd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.P=this.R=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.R=32768)}this.u[a]=c&65535;this.U=this.Y=c;this.b-=(this.g?6:7)+b} +function ce(a){var b=xd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.P=this.R=0;b&=63;if(b&32){b=64-b;32>b-1;this.P=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.U=d>>16;this.Y=d>>16|d;this.b-=(this.g?6:7)+b}function S(a){a&1&&(this.P=0);a&2&&(this.R=0);a&4&&(this.Y=1);a&8&&(this.U=0);this.b-=5} +function de(a){var b=xd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.P=this.R=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.Y=d>>16|d,this.U=d>>16):(this.R=32768,this.Y=d>>15|d,this.U=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Y=this.U=0,this.R=32768,this.P=65536,this.b-=7}var ee=[0,7,7,10,7,11,9,13];function fe(a){var b=this.b;hd(this,vd(this,a));this.b=b-ee[this.g]} +var ge=[0,14,14,17,14,18,16,20];function he(a){var b=this.b,c=vd(this,a);a=a>>6&7;md(this,this.u[a]);this.u[a]=this.u[7];hd(this,c);this.b=b-ge[this.g]}var ie=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],je=[7,13,13,17,14,18,17,21];function ke(a){var b=xd(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.D&128||(this.U=b>>16,this.Y=this.U|b,this.R=0,this.P=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)hd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function ne(a){Q(this,a,0,$d);this.b-=this.g?9:3+(7==this.f?2:0)}function oe(a){Q(this,a,ud(this,a),ae);this.b-=this.g?9:3+(7==this.f?2:0)}function V(){this.O(8,6)}function bd(a){pe[a>>12].call(this,a)} +var pe=[function(a){qe[a>>8&15].call(this,a)},function(a){var b=ud(this,a),c=this.b;O(this,zd(this,a,b));this.b=c-ie[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)},function(a){var b=ud(this,a);a=xd(this,a);ld(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){O(this,ud(this,a)&xd(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,a,ud(this,a),Id);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f? +2:0)},function(a){Q(this,a,ud(this,a),Kd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,ud(this,a),Cd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){re[a>>8&15].call(this,a)},function(a){se[a>>8&15].call(this,a)},function(a){var b=td(this,a);O(this,yd(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=td(this,a)<<8;a=wd(this,a)<<8;ld(this,b-a,a,b);this.b-=this.g? +4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){O(this,(td(this,a)&wd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,a,td(this,a),Jd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){P(this,a,td(this,a),Ld);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,ud(this,a),Yd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},V],qe= +[function(a){Me[a>>4&15].call(this,a)},function(a){R(this,a,!0)},function(a){R(this,a,!fd(this))},function(a){R(this,a,fd(this))},function(a){R(this,a,!this.Fa()==!ed(this))},function(a){R(this,a,!this.Fa()!=!ed(this))},function(a){R(this,a,!fd(this)&&!this.Fa()==!ed(this))},function(a){R(this,a,fd(this)||!this.Fa()!=!ed(this))},he,he,function(a){Ne[a>>6&3].call(this,a)},function(a){Oe[a>>6&3].call(this,a)},function(a){Pe[a>>6&3].call(this,a)},function(a){Qe[a>>6&3].call(this,a)},V,V],Ne=[function(a){id(this, +zd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Md);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Qd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Od);this.b-=this.g?9:3+(7==this.f?2:0)}],Oe=[function(a){Q(this,a,0,Sd);this.b-=this.g?11:6},function(a){Q(this,a,dd(this)?1:0,Cd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,dd(this)?1:0,Yd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=xd(this,a);id(this,a);this.b-=this.g?4:3+(7==this.f? +2:0)}],Pe=[function(a){Q(this,a,0,Wd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Ud);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Gd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Ed);this.b-=this.g?9:3+(7==this.f?2:0)}],Qe=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ec(a|65536);hd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=rd(this,a,0);md(this,a);O(this,a);this.b-=11},function(a){var b=od(this),c=this.b;sd(this,a, +0,b);O(this,b);this.b=c-je[this.g]},function(a){O(this,zd(this,a,this.Fa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Me=[function(a){Re[a&15].call(this,a)},V,V,V,fe,fe,fe,fe,function(a){if(a&8)this.O(8,6);else{var b=od(this);a&=7;hd(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.K&49152||(this.K=this.K&-2017|(a&7)<<5,this.D|=1),this.b-=5):this.O(8,6)},function(a){Se[a&15].call(this,a)},function(a){Te[a&15].call(this,a)},ne,ne,ne,ne],Re=[function(){this.K&49152?(this.$|=128,this.O(4, +3)):this.ea();this.b-=7},function(){this.D|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){nd(this);this.D|=this.K&16;this.b-=13},function(){this.O(12,1);this.b-=5},function(){this.O(16,4);this.b-=25},function(){this.K&49152||(cd(this),this.B.reset());this.b-=667},function(){nd(this);this.b-=13},V,V,V,V,V,V,V,V,V],Se=[le,function(){this.P=0;this.b-=5},function(){this.R=0;this.b-=5},S,function(){this.Y=1;this.b-=5},S,S,S,function(){this.U=0;this.b-=5},S,S,S,S,S,S,S],Te=[le,function(){this.P= +65536;this.b-=5},function(){this.R=32768;this.b-=5},T,function(){this.Y=0;this.b-=5},T,T,T,function(){this.U=32768;this.b-=5},T,T,T,T,T,T,T],re=[ke,ke,de,de,be,be,ce,ce,oe,oe,V,V,V,V,me,me],se=[function(a){R(this,a,!this.Fa())},function(a){R(this,a,this.Fa())},function(a){R(this,a,!dd(this)&&!fd(this))},function(a){R(this,a,dd(this)||fd(this))},function(a){R(this,a,!ed(this))},function(a){R(this,a,ed(this))},function(a){R(this,a,!dd(this))},function(a){R(this,a,dd(this))},function(){this.O(24,2); +this.b-=25},function(){this.O(28,5);this.b-=5},function(a){Ue[a>>6&3].call(this,a)},function(a){Ve[a>>6&3].call(this,a)},function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},V,V],Ue=[function(a){id(this,yd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Nd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Rd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Pd);this.b-=this.g?9:3+(7==this.f?2:0)}],Ve=[function(a){P(this,a,0,Td);this.b-= +this.g?11:6},function(a){P(this,a,dd(this)?1:0,Dd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,dd(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=wd(this,a);id(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],We=[function(a){P(this,a,0,Xd);this.b-=this.g?9+(this.Za&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Vd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Hd);this.b-=this.g?9+(this.Za&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Fd);this.b-=this.g?9:3+(7== +this.f?2:0)}],Xe=[V,function(a){a=rd(this,a,65536);md(this,a);O(this,a);this.b-=11},function(a){var b=od(this),c=this.b;sd(this,a,65536,b);O(this,b);this.b=c-je[this.g]},V];function Ye(a){r.call(this,"ROM",a,Ye);this.f=null;this.C=a.addr;this.g=a.size;this.G=a.writable;this.F=a.alias;this.A=a.file;this.H=da(this.A);if(this.A){a=this.A;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ga()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){Ze(c,a,b,f)})}}y(Ye); +Ye.prototype.Ga=function(a,b,c,d){this.B=b;this.b=c;this.j=d;$e(this)};Ye.prototype.Ca=function(){if(this.Da){if(this.j){var a=this.j,b=this.id,c=this.C,d=this.g,e=this.Da,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var n=l.o,p=l.a;if(void 0!==n){var q=f,n=[n>>>0,g],v=qa(q,n,a.Lb);0>v&&q.splice(-(v+1),0,n)}p&&(l.a=p.replace(/''/g,'"'))}a.H.push({Id:b,w:c,vc:d,Da:e,Kb:f})}delete this.Da}return!0};Ye.prototype.Ba=function(){return!0}; +function Ze(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.zb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.Da=l.symbols;if(!a.f.length){m("Empty ROM: "+ +b);return}if(1==a.f.length){m(a.f[0]);return}}catch(n){a.na("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e>>d.Z].wb(e&d.f,a.f[c]&255,e);a.j&&a.j.g--}b=!0}else b=!1;if(b){b=[];"number"==typeof a.F?b.push(a.F):null!=a.F&&a.F.length&&(b=a.F);for(c=0;c>> +e.Z;0>>=e.Z;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=oa(b[0]);if(c!=this.Ya)return;b=oa(b[1]);if(this.I=cb(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.zb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Ca=function(a,b){if(!b)if(this.Tb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.Ba=function(a){return a?this.save():!0};h.reset=function(){ef(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return ef(this)};function ef(a){a.T=0;a.f=0;a.g=128;a.C=[];return!0}h.Eb=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.V||8,c=a-this.H%a,this.V&&(b=na("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.i(this.G), +this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;Qb(this.b,100,4,52,this.N)}};var ff={},df=(ff[65392]=[null,null,W.prototype.Pc,W.prototype.rd,"RCSR"],ff[65394]=[null,null,W.prototype.Oc,W.prototype.qd,"RBUF"],ff[65396]=[null,null,W.prototype.bd,W.prototype.Fd,"XCSR"],ff[65398]=[null,null,W.prototype.ad,W.prototype.Ed,"XBUF"],ff);La(function(){for(var a=A(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};gf.prototype.Pb=function(){return-1};gf.prototype.Qb=function(){}; +function jf(a,b,c,d){if(c)if(b){0>a.C&&a.A.length&&(a.C=0);if(0>a.C||b!=a.A[a.C])a.A.splice(0,0,b),a.C=0;a.C--}else a.W?b="end":b=a.A[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(oa(b.substring(c,f))),c=f+1}}return a} +function kf(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 sf(a,b,c){var d;if(b){b=tf(a,b);for(var e=0,f=!1,g=b,k=[],m=[],n=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=p+g;d>>=8}d=l(c,0,!0)+" "+c+". "+ca(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function wf(a,b){if(b)return vf(a,b,a.ha[b]);var c=0;for(b in a.ha)vf(a,b,a.ha[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function pf(a,b){if(b)return of(a,b,a.ca[b]);var c=0;for(b in a.ca)of(a,b,a.ca[b]),c++;return 0>>d.F.ca;m=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,n=0;m--;){var p=b[e];p.type==c?n++||d.i("..."):(c=p.type,n=Kb[c],p&&d.i(l(p.id,8)+" %"+l(e<>>c.ca].lc(d&c.f,d),this.g--,b&&Gf(a,b));return c};h.Ia=function(a,b){var c=65535,d=Z(a);-1!==d&&(this.g++,c=Lb(this.F,d),this.g--,b&&Gf(a,b));return c}; -h.Ob=function(a,b,c){var d=Z(a);if(-1!==d){this.g++;var e=this.F;e.aa[(d&e.g)>>>e.ca].dc(d&e.f,b&255,d);this.g--;c&&Gf(a,c);O(this.b,!0)}};h.qc=function(a,b,c){var d=Z(a);if(-1!==d){this.g++;var e=this.F;e.aa[(d&e.g)>>>e.ca].tc(d&e.f,b&65535,d);this.g--;c&&Gf(a,c);O(this.b,!0)}};function Y(a){return{A:a,Ha:!1}}function Hf(a){return[a.A,a.Ha]}function If(a){return{A:a[0],Ha:a[1]}} -function Ff(a,b,c){var d;c=(c?a.R:a.fb).A;if(void 0!==b){d=b=tf(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cd&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.Bc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Qa[a-8]:20>a?b=this.b.Aa[a-16]:20==a&&(b=Tb(this.b)));return b}; -h.message=function(a,b){this.g||(b&&(a+=" @"+I(this,Y(this.b.u[7]).A)),this.ma&1073741824?this.ya.push(a):this.va&&a==this.va||(this.va=a,this.ma&-2147483648&&(this.ia(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,a.S-=a.b,a.b=0,a.qa=0,O(a))))}; -function zf(a){var b;if(Gd(a)){if(!a.N||!a.N.length){a.N=Array(1E3);for(b=0;b>>d.ca],!1)}a.S=["br"];if(a.G)for(b=1;b>>d.ca],!0);a.G=["bw"];a.pb=0} -h.jb=function(a,b,c){var d=!0;c||Pf(this,a,b,!1,!0);if(a!=this.f){var e=Z(b);if(-1===e)this.i("invalid address: "+I(this,b.A)),d=!1;else{var f=this.F;f.aa[e>>>f.ca].jb(e&f.f,a==this.G)}}d&&(a.push(b),c?b.Ha=!0:(Qf(this,a,a.length-1,"set"),zf(this)));return d};function Pf(a,b,c,d,e){var f=!1;c=Z(c);for(var g=1;g>>d.ca],b==a.G));k.Ha||zf(a);break}}return f} -function Rf(a,b){for(var c=1;c>23)&65535,x=I(w,r);else if(8192==C)r=r.A-((f&63)<<1)&65535,x=I(w,r);else if(12288==C)x=I(w,f&7,1);else if(24576==C)x=I(w,f&63,1);else if(C=f&B,B&4032&&(C>>=6,B>>=6),B&63)switch(B=C&7,C&56){case 0:x=Kf(B);break;case 8:x="@"+Kf(B);break;case 16:7>B?x="("+Kf(B)+ -")+":(C=w.Ia(r,2),x="#"+I(w,C,0,!0));break;case 24:7>B?x="@("+Kf(B)+")+":(C=w.Ia(r,2),x="@#"+I(w,C,0,!0));break;case 32:x="-("+Kf(B)+")";break;case 40:x="@-("+Kf(B)+")";break;case 48:C=w.Ia(r,2);x=I(w,C,0,!0)+"("+Kf(B)+")";7==B&&(x=[x,I(w,C+r.A&65535)]);break;case 56:C=w.Ia(r,2),x="@"+I(w,C)+"("+Kf(B)+")",7==B&&(x=[x,I(w,C+r.A&65535)])}w=x;if(!w||!w.length){k="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]);0b?(c=Kf(b),c+="="+I(a,d.u[b])):13>b?c="A"+(b-8)+"="+I(a,d.Qa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+I(a,d.Aa[b-16]):20==b&&(c="PS="+I(a,Tb(d)));c&&(c+=" ");return c}function Wf(a){var b,c="";for(b=0;6>b;b++)c+=Vf(a,b);c=c+"\n"+(Vf(a,6)+Vf(a,7)+Vf(a,20));return c+=Uf(a,"T")+Uf(a,"N")+Uf(a,"Z")+Uf(a,"V")+Uf(a,"C")}h.vc=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,k=f.Zc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}O(d);a.i("updated registers:")}a.i(Wf(a));c&&(a.R=Y(d.u[7]),Nf(a,I(a,a.R.A)))}}function ag(a,b){b=pa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var n=k[0]+":";k[2]&&(n+=" "+k[2]);a.i(n)}k[3]&&(g=k[3],f=null);f=Tf(a,b,g,f);a.i(f);a.R=b;e-=b.A-m;c++}}} -function Sf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.$&&(a.i("ended assemble at "+I(a,a.Z.A)),a.R=a.Z,a.$=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.va=null;if(ib(a)&&0p||"z"la.length&&(a.i("note: only "+la.length+" available"),ba=la.length);ea-=ba;0>ea&&(null==la[la.length-1].A?(ba=ea+ba,ea=0):ea+=la.length);var Pc=[];"call"==Ae&&(lb=1E5,Pc=["CALL"]);for(void 0!==ze&&a.i(ba+" instructions earlier:");0=la.length&&(ea=0);a.qb=ba;Ce++;lb--}}Ce||(a.i("no "+Be+"history available"),a.qb=void 0)}else{var Xb=Ff(a,ka);if(Xb){var Yb=0;Ba&&("l"==Ba.charAt(0)&&(Ba=Ba.substr(1)||ug),Yb=uf(a,Ba)>>>0,65536>4||1;wg--&&0ac?String.fromCharCode(ac):".";Zb--}nb&&(nb+="\n");nb+=ka+" "+Rc+(0==pb?" "+Fe:"")}nb&&a.i(nb);a.fb=Xb}}}}break;case "e":if("else"==g[0])break;var Ta,Sc,Tc,Uc,Vc=g[0],Wc=g[1];"eb"==Vc?(Ta=1,Sc=255,Tc=a.mb,Uc=a.Ob):"e"==Vc||"ew"==Vc?(Ta=2,Sc=65535,Tc=a.Ia,Uc=a.qc):Wc=null;if(null==Wc)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var bc=Ff(a,Wc);if(bc)for(var cc=2;ccZc;){for(var Ca=null,Ag=256;65536>sb.A>>>0;){$c.A=a.Ia(sb,2);if(null==sb.A||!Ag--)break;if(!($c.A&1)){for(var Bg=a,dc=$c,He=null,tb=dc.A, -Ie=tb,ad=1;6>=ad&&tb;ad++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bfg){if(hg(d,this.J)){this.B=new P(this,"1.30.1","failsafe");hg(this.B)&&(mg(this,d),a=2,ng(this.B));this.B.set("timestamp",ta());og(this.B);var e=this.f&&!this.G;if(1==a||wa("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=lg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?hg(d,g):("error"== -f&&"no machine state"!=g?(this.ta("Error: "+g),"unable to verify user"==g&&(Da("user",""),this.g=null)):this.i(f+": "+g),ng(d),hg(d)?(c=lg(d),e=!0):c=!1))}e&&kg(this,c?d:null)}else 2==a&&d.clear()}else kg(this);delete this.J;delete this.N}e=cb(this.id);for(f=0;fa[1];a=a[2];this.ha=!0;this.v.ja=!0;var d=this.L.power;d&&(d.textContent="Shutdown");this.b&&(pg(this,this.b,b,c,a),this.b.Eb());this.X&&(mg(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.D=0}; -function mg(a,b){if(wa("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.url;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}} -function cg(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new P(a,"1.30.1"),g=new P(a,"1.30.1","validate"),k=ta();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.ia(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ja=!1,!1===d&&(e=null)));for(var k=cb(a.id),m=0;mf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");ua(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)m=0>m.indexOf(n[1])?m.replace(">",n[0]+">"):m.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=m&&(g=g.replace(k[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Hg(a,b,c)}})}else c(a,null)} -function Ig(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ja(a))}function f(a){e("Error: "+a);m&&(--tg||Oa(!0));m=!1}var g,k,m=!0;tg++;ab[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n));p.appendChild(t)}c|| -(c="/versions/pdp11/1.30.1/components.xsl");n=function(d,k){k?Fg(c,null,null,!1,e,function(d,m){m?(bb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=k.transformNode(m))?(g.outerHTML=m,--tg||Oa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--tg||Oa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Fg(b,a,d,!0,e,n):Gg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(r){f(r.message)}return m}window.embedPDP11=function(a,b,c,d){Oa(!1);return Ig(a,b,c,d)};window.enableEvents=Oa;window.sendEvent=Ua;})(); +63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}};h=qf.prototype; +h.Ga=function(a,b,c,d){this.B=b;this.b=c;this.F=a;(a=wc(a,"messages"))&&tf(this,a);this.ab=wf;xf(this,function(a){a:{var b=d.B.X,c=a[0],e=a=0,n=b.length;if(c){a=Y(yf(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.B.Z;n=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;n--;){var q=b[e];q.type==c?p++||d.i("..."):(c=q.type,p=Kb[c],q&&d.i(k(q.id,8)+" %"+k(e<>>c.Z].Cb(d&c.f,d),this.g--,b&&zf(a,b));return c};h.ma=function(a,b){var c=65535,d=Y(a);-1!==d&&(this.g++,c=Lb(this.B,d),this.g--,b&&zf(a,b));return c}; +h.ob=function(a,b,c){var d=Y(a);if(-1!==d){this.g++;var e=this.B;e.X[(d&e.g)>>>e.Z].wb(d&e.f,b&255,d);this.g--;c&&zf(a,c);M(this.b,!0)}};h.Xa=function(a,b,c){var d=Y(a);if(-1!==d){this.g++;var e=this.B;e.X[(d&e.g)>>>e.Z].Jb(d&e.f,b&65535,d);this.g--;c&&zf(a,c);M(this.b,!0)}};function X(a){return{w:a,Aa:!1}}function Af(a){return[a.w,a.Aa]}function Bf(a){return{w:a[0],Aa:a[1]}} +function yf(a,b,c){var d;c=(c?a.M:a.Qa).w;if(void 0!==b){d=b=mf(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cd&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.Qb=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ha[a-8]:20>a?b=this.b.ta[a-16]:20==a&&(b=Ub(this.b)));return b}; +h.message=function(a,b){this.g||(b&&(a+=" @"+I(this,X(this.b.u[7]).w)),this.ha&1073741824?this.qa.push(a):this.oa&&a==this.oa||(this.oa=a,this.ha&-2147483648&&(this.ea(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,a.N-=a.b,a.b=0,a.ka=0,M(a))))}; +function sf(a){var b;if(Ad(a)){if(!a.L||!a.L.length){a.L=Array(1E3);for(b=0;b>>d.Z],!1)}a.N=["br"];if(a.G)for(b=1;b>>d.Z],!0);a.G=["bw"];a.Ra=0} +h.Sa=function(a,b,c){var d=!0;c||If(this,a,b,!1,!0);if(a!=this.f){var e=Y(b);if(-1===e)this.i("invalid address: "+I(this,b.w)),d=!1;else{var f=this.B;f.X[e>>>f.Z].Sa(e&f.f,a==this.G)}}d&&(a.push(b),c?b.Aa=!0:(Jf(this,a,a.length-1,"set"),sf(this)));return d};function If(a,b,c,d,e){var f=!1;c=Y(c);for(var g=1;g>>d.Z],b==a.G));l.Aa||sf(a);break}}return f} +function Kf(a,b){for(var c=1;c>23)&65535,x=I(w,u);else if(8192==C)u=u.w-((f&63)<<1)&65535,x=I(w,u);else if(12288==C)x=I(w,f&7,1);else if(24576==C)x=I(w,f&63,1);else if(C=f&B,B&4032&&(C>>=6,B>>=6),B&63)switch(B=C&7,C&56){case 0:x=Df(B);break;case 8:x="@"+Df(B);break;case 16:7>B?x="("+Df(B)+ +")+":(C=w.ma(u,2),x="#"+I(w,C,0,!0));break;case 24:7>B?x="@("+Df(B)+")+":(C=w.ma(u,2),x="@#"+I(w,C,0,!0));break;case 32:x="-("+Df(B)+")";break;case 40:x="@-("+Df(B)+")";break;case 48:C=w.ma(u,2);x=I(w,C,0,!0)+"("+Df(B)+")";7==B&&(x=[x,I(w,C+u.w&65535)]);break;case 56:C=w.ma(u,2),x="@"+I(w,C)+"("+Df(B)+")",7==B&&(x=[x,I(w,C+u.w&65535)])}w=x;if(!w||!w.length){l="INVALID";break}"string"!=typeof w&&(n=w[1],w=w[0]);0b?(c=Df(b),c+="="+I(a,d.u[b])):13>b?c="A"+(b-8)+"="+I(a,d.Ha[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+I(a,d.ta[b-16]):20==b&&(c="PS="+I(a,Ub(d)));c&&(c+=" ");return c}function Pf(a){var b,c="";for(b=0;6>b;b++)c+=Of(a,b);c=c+"\n"+(Of(a,6)+Of(a,7)+Of(a,20));return c+=Nf(a,"T")+Nf(a,"N")+Nf(a,"Z")+Nf(a,"V")+Nf(a,"C")}h.Lb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}M(d);a.i("updated registers:")}a.i(Pf(a));c&&(a.M=X(d.u[7]),Gf(a,I(a,a.M.w)))}}function Uf(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.i(p)}l[3]&&(g=l[3],f=null);f=Mf(a,b,g,f);a.i(f);a.M=b;e-=b.w-n;c++}}} +function Lf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.W&&(a.i("ended assemble at "+I(a,a.V.w)),a.M=a.V,a.W=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.oa=null;if(hb(a)&&0q||"z"ja.length&&(a.i("note: only "+ja.length+" available"),Z=ja.length);ca-=Z;0>ca&&(null==ja[ja.length-1].w?(Z=ca+Z,ca=0):ca+=ja.length);var Mc=[];"call"==ye&&(jb=1E5,Mc=["CALL"]);for(void 0!==xe&&a.i(Z+" instructions earlier:");0=ja.length&&(ca=0);a.Za=Z;Ae++;jb--}}Ae||(a.i("no "+ze+"history available"),a.Za=void 0)}else{var Xb=yf(a,ia);if(Xb){var Yb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||ng),Yb=nf(a,za)>>>0,65536>4||1;pg--&&0ac?String.fromCharCode(ac):".";Zb--}lb&&(lb+="\n");lb+=ia+" "+Oc+(0==nb?" "+De:"")}lb&&a.i(lb);a.Qa=Xb}}}}break;case "e":if("else"==g[0])break;var Ra,Pc,Qc,Rc,Sc=g[0],Tc=g[1];"eb"==Sc?(Ra=1,Pc=255,Qc=a.Ua,Rc=a.ob):"e"==Sc||"ew"==Sc?(Ra=2,Pc=65535,Qc=a.ma,Rc=a.Xa):Tc=null;if(null==Tc)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var bc=yf(a,Tc);if(bc)for(var cc=2;ccWc;){for(var Aa=null,tg=256;65536>qb.w>>>0;){Xc.w=a.ma(qb,2);if(null==qb.w||!tg--)break;if(!(Xc.w&1)){for(var ug=a,dc=Xc,Fe=null,rb=dc.w,Ge=rb,Yc=1;6>=Yc&& +rb;Yc++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bZf){if(ag(d,this.I)){this.C=new N(this,"1.30.1","failsafe");ag(this.C)&&(fg(this,d),a=2,gg(this.C));this.C.set("timestamp",sa());hg(this.C);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=eg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ag(d,g):("error"== +f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.g=null)):this.i(f+": "+g),gg(d),ag(d)?(c=eg(d),e=!0):c=!1))}e&&dg(this,c?d:null)}else 2==a&&d.clear()}else dg(this);delete this.I;delete this.L}e=bb(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.v.fa=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(ig(this,this.b,b,c,a),this.b.hb());this.T&&(fg(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.F=0}; +function fg(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}} +function Wf(a,b,c){var d,e="none";if(a.F)return null;a.F--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=sa();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ba&&(c&&a.b.ea(),d=a.b.Ba(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.fa=!1,!1===d&&(e=null)));for(var l=bb(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");ua(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)n=0>n.indexOf(p[1])?n.replace(">",p[0]+">"):n.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=n&&(g=g.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Ag(a,b,c)}})}else c(a,null)} +function Bg(a,b,c,d){function e(a){if(void 0===l){var b=g&&A(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ma(a))}function f(a){e("Error: "+a);n&&(--mg||Sa(!0));n=!1}var g,l,n=!0;mg++;$a[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| +(c="/versions/pdp11/1.30.1/components.xsl");p=function(d,l){l?yg(c,null,null,!1,e,function(d,n){n?(ab(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(g.outerHTML=n,--mg||Sa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(n,g),--mg||Sa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?yg(b,a,d,!0,e,p):zg(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(u){f(u.message)}return n}window.embedPDP11=function(a,b,c,d){Sa(!1);return Bg(a,b,c,d)};window.enableEvents=Sa;window.sendEvent=Ta;})(); diff --git a/versions/pdpjs/1.30.1/pdp11.js b/versions/pdpjs/1.30.1/pdp11.js index 6432a8d2d..b44677083 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -681,170 +681,152 @@ for purposes of the GNU General Public License, and the author does not claim any copyright as to their contents. */ -var h; +var g; function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var ia={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ja=Date.now||function(){return+new Date}; function ka(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function p(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 l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var m="",n;for(n in b)b.hasOwnProperty(n)&&(m&&(m+="&"),m+=n+"="+encodeURIComponent(b[n]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")} -function q(a){window&&window.alert(a)}function la(a){var b=!1;window&&(b=window.confirm(a));return b}var ma=null;function na(){if(null==ma){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}ma=a}return ma}function oa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} +function l(a,b,c,d){var e=0,f=null,k=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),k;var m=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(m.onreadystatechange=function(){4===m.readyState&&(f=m.responseText,200==m.status||!m.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=m.status||-1),d&&d(a,f,e))});if(b&&"object"== +typeof b){var n="",q;for(q in b)b.hasOwnProperty(q)&&(n&&(n+="&"),n+=q+"="+encodeURIComponent(b[q]));n=n.replace(/%20/g,"+");m.open("POST",a,!!c);m.setRequestHeader("Content-type","application/x-www-form-urlencoded");m.send(n)}else m.open("GET",a,!!c),"bytes"==b&&m.overrideMimeType("text/plain; charset=x-user-defined"),m.send();c||(f=m.responseText,200!=m.status&&(e=m.status||-1),d&&d(a,f,e),k=[f,e]);return k}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")} +function p(a){window&&window.alert(a)}function la(a){var b=!1;window&&(b=window.confirm(a));return b}var ma=null;function na(){if(null==ma){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}ma=a}return ma}function oa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} function pa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function qa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var r={init:[],show:[],exit:[]},ra=!1,sa=!1,ta=!0;function ua(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function u(a){r.init.push(a)} -function va(a){if(ta)try{for(var b=0;bb?this.jb=this.id:(this.Eb=this.id.substr(0,b),this.jb=this.id.substr(b+1));this[a]=c;this.i={ready:!1,td:!1,ud:!1,R:!1,error:!1};this.rb=null;this.i.error=!1;this.A={};this.L=null;w.push(this)}var ya=void 0,za={}; -if(window){ya||(ya=window.location.search.substr(1));for(var Aa,Ba=/\+/g,Ca=/([^&=]+)=?([^&]*)/g;Aa=Ca.exec(ya);)za[decodeURIComponent(Aa[1].replace(Ba," "))]=decodeURIComponent(Aa[2].replace(Ba," "))}function Da(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} -function x(a,b){b||(b=v);a.prototype=Da(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ea=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Ea={},w=[];function Fa(a,b,c){Ea[a]&&b&&(Ea[a][b]=c)}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bb?this.Fa=this.id:(this.Va=this.id.substr(0,b),this.Fa=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Yc:!1,Zc:!1,L:!1,error:!1};this.Oa=null;this.i.error=!1;this.w={};this.I=null;w.push(this)}var ya=void 0,za={}; +if(window){ya||(ya=window.location.search.substr(1));for(var Aa,Ca=/\+/g,Da=/([^&=]+)=?([^&]*)/g;Aa=Da.exec(ya);)za[decodeURIComponent(Aa[1].replace(Ca," "))]=decodeURIComponent(Aa[2].replace(Ca," "))}function Ea(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} +function x(a,b){b||(b=v);a.prototype=Ea(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Fa=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Fa={},w=[];function Ga(a,b,c){Fa[a]&&b&&(Fa[a][b]=c)}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.c&&(this.c=10);15>2;this.h=this.g-1;this.o=this.l/this.g|0;this.ua=[];this.m=null;this.bb=this.H;a=new E;Na(a,this.L);this.b=Array(this.o);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ua[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=d.bb(b|4186112,-1,1)}function Pa(a,b,c){var d=!1,e=this.controller,f=e.ua[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ua[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||e.bb(c|4186112,b,1)} -function Qa(a,b){var c=-1,d=this.controller;(a=d.ua[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=d.bb(b|4186112,-1,0)}function Ra(a,b,c){var d=!1,e=this.controller;if(a=e.ua[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||e.bb(c|4186112,b,0)}Ma.prototype.reset=function(){this.m&&this.m()};Ma.prototype.H=function(){return 0};Ma.prototype.pa=function(a,b){b||this.reset();return!0}; -function Sa(a,b,c,d,e){for(var f=b,g=c,l=f>>>a.c;0g&&(t=g);if(m&&m.size){if(m.type==d&&m.controller==e){if(f+g<=m.Ya)return m.xb+=m.Ya-f,m.Ya=f,!0;if(f>=m.Ya+m.xb){t=m.size-(f-n);t>g&&(t=g);m.xb=f-m.Ya+t;f=n+a.g;g-=t;l++;continue}}return Ua(1,f,g)}f=new E(f,t,a.g,d,e);Na(f,a.L,m);a.b[l++]=f;f=n+a.g;g-=t}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Va[d]+" at "+k(b,8,!0)),!0):Ua(2,b,c)}function Wa(a,b){return a.b[(b&a.u)>>>a.c].Ib(b&a.h,b)} -function Xa(a){for(var b=0,c=[],d=0;d>5&3;c.lb=a>>1&15;c.Hb=a&257?a&1?6:4:0;cb(c);a=c.H;a&1|256&&(b=this.a.Da&16?1:2);this.c.Oa=this.c.Oa&-8|b};h.Ec=function(a){return this.a.G[1][a>>1&7]};h.jd=function(a,b){this.a.G[1][b>>1&7]=a&65295};h.Cc=function(a){return this.a.G[1][(a>>1&7)+8]};h.gd=function(a,b){this.a.G[1][(b>>1&7)+8]=a&65295}; -h.Dc=function(a){return this.a.X[1][a>>1&7]};h.hd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.G[1][b]&=65295};h.Bc=function(a){return this.a.X[1][(a>>1&7)+8]};h.fd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.G[1][b]&=65295};h.vc=function(a){return this.a.G[0][a>>1&7]};h.$c=function(a,b){this.a.G[0][b>>1&7]=a&65295};h.tc=function(a){return this.a.G[0][(a>>1&7)+8]};h.Yc=function(a,b){this.a.G[0][(b>>1&7)+8]=a&65295};h.uc=function(a){return this.a.X[0][a>>1&7]}; -h.Zc=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.G[0][b]&=65295};h.sc=function(a){return this.a.X[0][(a>>1&7)+8]};h.Xc=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.G[0][b]&=65295};h.Ic=function(a){return this.a.G[3][a>>1&7]};h.nd=function(a,b){this.a.G[3][b>>1&7]=a&65295};h.Gc=function(a){return this.a.G[3][(a>>1&7)+8]};h.ld=function(a,b){this.a.G[3][(b>>1&7)+8]=a&65295};h.Hc=function(a){return this.a.X[3][a>>1&7]};h.md=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.G[3][b]&=65295}; -h.Fc=function(a){return this.a.X[3][(a>>1&7)+8]};h.kd=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.G[3][b]&=65295};h.yc=function(){return db(this.a)};h.cd=function(a){eb(this.a,a&-1809|db(this.a)&1808);this.a.j|=128}; -function fb(a){var b=a.g,c,d,e,f=b.Y>>13&7;"undefined"===typeof b.T[f]&&(b.T[f]={cache:[],postProcess:a.Mc,drive:f,blocksize:256,mapped:0,maxblock:b.Ka[f]*b.K[f],url:"rk"+f+".dsk"});b.D&=-129;switch(b.D>>1&7){case 0:b.fb=2496;b.S=0;b.D=128;b.Y=0;break;case 1:if((b.Y>>4&511)>=b.Ka[f]){b.S|=32832;b.D|=49152;break}if((b.Y&15)>=b.K[f]){b.S|=32800;b.D|=49152;break}c=(b.Y>>4&511)*b.K[f]+(b.Y&15);d=(b.D&48)<<12|b.eb;e=65536-b.gb&65535;gb(a,b.T[f],c,d,e);return;case 2:if((b.Y>>4&511)>=b.Ka[f])b.S|=32832, -b.D|=49152;else if((b.Y&15)>=b.K[f])b.S|=32800,b.D|=49152;else{c=(b.Y>>4&511)*b.K[f]+(b.Y&15);d=(b.D&48)<<12|b.eb;e=65536-b.gb&65535;a.ub(b.T[f],c,d,e);return}}b.fb=f<<13|b.fb&8176|b.Y%9&15;G(a.a,20,5,144,function(){b.D=b.D&65534|128;return!!(b.D&64)})}h.Mc=function(a,b,c,d,e){var f=this.g;f.eb=d&65535;f.D=f.D&-49|d>>12&48;f.gb=65536-e&65535;switch(a){case 1:f.S|=33024;f.D|=49152;break;case 2:f.S|=33792,f.D|=49152}G(this.a,20,5,144,function(){f.D=f.D&65534|128;return!!(f.D&64)})}; -function hb(a){var b=a.h,c,d,e,f=b.v>>8&3;b.v&=-2;"undefined"===typeof b.T[f]&&(b.T[f]={cache:[],postProcess:a.Nc,drive:f,blocksize:128,mapped:1,maxblock:b.Ka[f]*b.K[f],url:"rl"+f+".dsk"});switch(b.v>>1&7){case 2:b.Ba&8&&(b.v&=63);b.Ba=b.hc[f]|b.Ga&64;break;case 3:1==(b.M&3)&&(b.Ga=b.M&4?b.Ga+(b.M&65408)&65408|b.M<<2&64:b.Ga-(b.M&65408)&65408|b.M<<2&64,b.M=b.Ga);break;case 4:b.Ba=b.Ga;break;case 5:if(b.M>>6>=b.Ka[f]){b.v|=37888;break}if((b.M&63)>=b.K[f]){b.v|=37888;break}c=(b.M>>6)*b.K[f]+(b.M&63); -d=(b.va&63)<<16|b.ab;e=65536-b.Ba&65535;gb(a,b.T[f],c,d,e);return;case 6:if(b.M>>6>=b.Ka[f])b.v|=37888;else if((b.M&63)>=b.K[f])b.v|=37888;else{c=(b.M>>6)*b.K[f]+(b.M&63);d=(b.va&63)<<16|b.ab;e=65536-b.Ba&65535;a.ub(b.T[f],c,d,e);return}}G(a.a,20,5,112,function(){b.v|=129;return!!(b.v&64)})} -h.Nc=function(a,b,c,d,e){var f=this.h;f.ab=d&65535;f.v=f.v&-49|d>>12&48;f.va=d>>16&63;f.M=~~(c/f.K[b.na])<<6|c%f.K[b.na];f.Ga=f.M;f.Ba=65536-e&65535;switch(a){case 1:f.v|=33792;break;case 2:f.v|=40960}G(this.a,20,5,112,function(){f.v|=129;return!!(f.v&64)})};function ib(a){a=a.l;a.F=2176;a.ca=0;a.V=[4544,4544,4544,4544,4544,4544,4544,4544];a.Ra=[0,0,0,0,0,0,0,0];a.Na=a.Sa=a.Qa=a.Fa=a.Lb=0} -function jb(a,b){var c=a.l,d,e,f;c.F&=-16513;c.ca&=-2049;c.V[b]&=-1153;G(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.Oc,drive:b,blocksize:256,mapped:0,maxblock:c.zb[0]*c.Ja[0]*c.K[0],url:"rp"+b+".dsk"});switch(c.F&63){case 5:c.wb[b]=c.qa[b];c.F|=32896;c.V[b]|=32896;c.Na|=1<=c.zb[0]||c.da[b]>>8>=c.Ja[0]||(c.da[b]&255)>=c.K[0]){c.Ra[b]|=1024;c.F|=49152;break}d=(c.qa[b]*c.Ja[0]+(c.da[b]>>8))*c.K[0]+ -(c.da[b]&255);e=(c.Fa&63)<<16|c.Qa;f=65536-c.Sa&65535;gb(a,c.T[b],d,e,f);return;case 57:if(c.qa[b]>=c.zb[0]||c.da[b]>>8>=c.Ja[0]||(c.da[b]&255)>=c.K[0])c.Ra[b]|=1024,c.F|=49152;else{d=(c.qa[b]*c.Ja[0]+(c.da[b]>>8))*c.K[0]+(c.da[b]&255);e=(c.Fa&63)<<16|c.Qa;f=65536-c.Sa&65535;a.ub(c.T[b],d,e,f);return}}G(a.a,3,5,172,function(){c.F=c.F&65534|128;c.V[b]|=128;return!!(c.F&64)})} -h.Oc=function(a,b,c,d,e){var f=this.l;f.Sa=65536-e&65535;f.Qa=d&65535;f.F=f.F&-769|d>>8&768;f.Fa=d>>16&63;e=~~(c/f.K[0]);d=~~(e/f.Ja[0]);f.da[b.na]=e%f.Ja[0]<<8|c%f.K[0];f.wb[b.na]=f.qa[b.na]=d;f.Na|=1<=b.oc-1&&(f.V[b.na]|=1024);switch(a){case 1:f.ca|=512;f.F|=49152;break;case 2:f.ca|=2048,f.F|=49152}G(this.a,20,5,172,function(){f.V[b.na]|=128;f.F=f.F&65534|128;return!!(f.F&64)})}; -function kb(a,b,c,d,e,f){var g=~~((f+c.wa-1)/c.wa),l=new XMLHttpRequest;2048>g&&d+2048this.a.Ua(a.nc?lb(this.a,c):c,a.cache[b][e])){a.tb(2,a,b,c,d);return}c+=2;--d}b++}a.tb(0,a,b,c,d)}; -function gb(a,b,c,d,e){for(var f,g;0g){b.tb(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.tb(0,b,c,d,e)}h.reset=function(){this.c.Oa=this.c.Oa&-120|20;this.b.Aa=0;this.g.D=128;this.h.v=128;ib(this)}; -h.ic=function(a,b,c){var d,e,f=this.a;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.Ea&65280:(a&1&&(b<<=8),f.Ea=b|255,d=0);break;case 4194298:if(0>b)d=f.Kb;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.Kb=d;f.j|=2}break;case 4194294:if(70!==f.La)return K(f,4);0>b?d=f.s:d=f.s=0;break;case 4194292:if(70!==f.La)return K(f,4);d=1;break;case 4194290:if(70!==f.La)return K(f,4);d=0;break;case 4194288:if(70!==f.La)return K(f,4);d=61183;break;case 4194296:0<=b&&!(a&1)&&(b&= -255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==f.La)return K(f,4);e=a-4194272>>1;0>b?d=f.Cb[e]:(d=J(this,f.Cb[e],a,b,c),0<=d&&(f.Cb[e]=d));break;case 4194254:return a&1?f.C>>14&1?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.fa[3]=b),d=f.fa[3]):f.C>>14&0?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.fa[1]=b),d=f.fa[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.C&2048?(0<=b&&(f.f[e]=b),d=f.f[e]):(0<=b&&(f.Ma[e]=b),d=f.Ma[e]),d;case 4194246:return a& -1?(0<=b&&(f.f[7]=b),d=f.f[7]):f.C>>14&0?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.fa[0]=b),d=f.fa[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.C&2048?(0<=b&&(f.Ma[e]=b),d=f.Ma[e]):(0<=b&&(f.f[e]=b),d=f.f[e]),d;default:return f.s|=16,K(f,4)}break;case 4194176:e=a>>1&31;d=J(this,f.aa[3][e],a,b,c);0<=d&&(f.aa[3][e]=d,f.aa[3][e&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=J(this,f.vb,a,b,c);0<=d&&(f.vb=d);break;case 4194172:d=f.Ca;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194168:0> -b?d=this.c.Wc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;default:return f.s|=16,K(f,4)}break;case 4194048:e=this.g;switch(a&-2){case 4194048:d=J(this,e.fb,a,b,c);0<=d&&(e.fb=d);break;case 4194050:d=J(this,e.S,a,b,c);0<=d&&(e.S=d);break;case 4194052:d=J(this,e.D,a,b,c);0<=b&&0<=d&&(e.D=d&-36993|e.D&36992,e.D&1&&fb(this));break;case 4194054:d=J(this,e.gb,a,b,c);0<=d&&(e.gb=d);break;case 4194056:d=J(this,e.eb,a,b,c);0<=d&&(e.eb=d);break;case 4194058:d=J(this,e.Y,a,b,c);0<=d&&(e.Y= -d);break;case 4194060:break;case 4194062:d=J(this,e.$b,a,b,c);0<=d&&(e.$b=d);break;default:return f.s|=16,K(f,4)}break;case 4193728:var g=this.l;e=g.ca&7;switch(a&-2){case 4193728:d=J(this,g.F,a,b,c);0<=b&&0<=d&&(g.Fa=g.Fa&60|d>>8&3,g.F=d&17279|g.F&34944|2048,d&1&&g.F&128?jb(this,e):192==(d&192)&&G(f,0,5,172));break;case 4193730:d=J(this,g.Sa,a,b,c);0<=d&&(g.Sa=d);break;case 4193732:d=J(this,g.Qa,a,b,c);0<=d&&(g.Qa=d&65534);break;case 4193734:d=J(this,g.da[e],a,b,c);0<=d&&(g.da[e]=d&7967);break;case 4193736:d= -J(this,g.ca,a,b,c);0<=d&&(g.ca=d&63|g.ca&65472,d&128&&ib(this));break;case 4193738:d=g.V[e];break;case 4193740:d=g.Ra[e];break;case 4193742:d=J(this,g.Na,a,b,c);0<=d&&(g.Na=d&255);break;case 4193744:d=g.Tc[e];break;case 4193746:d=J(this,g.ac,a,b,c);0<=d&&(g.ac=d);break;case 4193748:d=J(this,g.bc[e],a,b,c);0<=d&&(g.bc[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.Uc[e];break;case 4193754:d=J(this,g.cc[e],a,b,c);0<=d&&(g.cc[e]=d);break;case 4193756:d=J(this,g.qa[e],a,b,c);0<=d&&(g.qa[e]= -d&511);break;case 4193758:g.wb[e]=g.qa[e];d=g.wb[e];break;case 4193760:d=g.Rc[e];break;case 4193762:d=g.Sc[e];break;case 4193764:d=g.Pc[e];break;case 4193766:d=g.Qc[e];break;case 4193768:d=J(this,g.Fa,a,b,c);0<=d&&(g.Fa=d&63,g.F=g.F&-769|(d&3)<<8);break;case 4193770:d=J(this,g.Lb,a,b,c);0<=d&&(g.Lb=d);break;default:return f.s|=16,K(f,4)}break;case 4192512:e=this.h;switch(a&-2){case 4192512:d=J(this,e.v,a,b,c);0<=b&&0<=d&&(e.va=e.va&60|d>>4&3,e.v=e.v&-1023|d&1022,e.v&128||hb(this));break;case 4192514:d= -J(this,e.ab,a,b,c);0<=d&&(e.ab=d&65534);break;case 4192516:d=J(this,e.M,a,b,c);0<=d&&(e.M=d);break;case 4192518:d=J(this,e.Ba,a,b,c);0<=d&&(e.Ba=d);break;case 4192520:d=J(this,e.va,a,b,c);0<=d&&(e.va=d&63,e.v=e.v&-49|(e.va&3)<<4);break;default:return f.s|=16,K(f,4)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=f.Da:(d=J(this,f.Da,a,b,c),0<=d&&(70!==f.La&&(d&=-49),f.Da=d,f.sb[0]=d&4?15:7,f.sb[1]=d&2?15:7,f.sb[3]=d&1?15:7,f.Hb&&(e=2,f.Da&16&&(e=1),this.c.Oa=this.c.Oa&-8|e)));break;default:return f.s|= -16,K(f,4)}break;case 4191424:e=a>>1&31;d=J(this,f.aa[0][e],a,b,c);0<=d&&(f.aa[0][e]=d,f.aa[0][e&15]&=65295);break;case 4191360:e=a>>1&31;d=J(this,f.aa[1][e],a,b,c);0<=d&&(f.aa[1][e]=d,f.aa[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.La)return K(f,4);e=a>>2&31;d=f.hb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(f.hb[e]=a&2?d<<16|f.hb[e]&65535:f.hb[e]&4294901760|d&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0> -b)d=$a[a>>1&255];else return f.s|=16,K(f,4);break;default:return f.s|=16,K(f,4)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d}; -var L={},I=(L[62592]=[null,null,F.prototype.Ec,F.prototype.jd,"SISDR"],L[62608]=[null,null,F.prototype.Cc,F.prototype.gd,"SDSDR"],L[62624]=[null,null,F.prototype.Dc,F.prototype.hd,"SISAR"],L[62640]=[null,null,F.prototype.Bc,F.prototype.fd,"SDSAR"],L[62656]=[null,null,F.prototype.vc,F.prototype.$c,"KISDR"],L[62672]=[null,null,F.prototype.tc,F.prototype.Yc,"KDSDR"],L[62688]=[null,null,F.prototype.uc,F.prototype.Zc,"KISAR"],L[62704]=[null,null,F.prototype.sc,F.prototype.Xc,"KDSAR"],L[65382]=[null,null, -F.prototype.wc,F.prototype.ad,"LKS"],L[65402]=[null,null,F.prototype.xc,F.prototype.bd,"MMR0"],L[65408]=[null,null,F.prototype.Ic,F.prototype.nd,"UISDR"],L[65424]=[null,null,F.prototype.Gc,F.prototype.ld,"UDSDR"],L[65440]=[null,null,F.prototype.Hc,F.prototype.md,"UISAR"],L[65456]=[null,null,F.prototype.Fc,F.prototype.kd,"UDSAR"],L[65534]=[null,null,F.prototype.yc,F.prototype.cd,"PSW"],L);I[62594]=I[62592];I[62596]=I[62592];I[62598]=I[62592];I[62600]=I[62592];I[62602]=I[62592];I[62604]=I[62592]; -I[62606]=I[62592];I[62610]=I[62608];I[62612]=I[62608];I[62614]=I[62608];I[62616]=I[62608];I[62618]=I[62608];I[62620]=I[62608];I[62622]=I[62608];I[62626]=I[62624];I[62628]=I[62624];I[62630]=I[62624];I[62632]=I[62624];I[62634]=I[62624];I[62636]=I[62624];I[62638]=I[62624];I[62642]=I[62640];I[62644]=I[62640];I[62646]=I[62640];I[62648]=I[62640];I[62650]=I[62640];I[62652]=I[62640];I[62654]=I[62640];I[62658]=I[62656];I[62660]=I[62656];I[62662]=I[62656];I[62664]=I[62656];I[62666]=I[62656];I[62668]=I[62656]; -I[62670]=I[62656];I[62674]=I[62672];I[62676]=I[62672];I[62678]=I[62672];I[62680]=I[62672];I[62682]=I[62672];I[62684]=I[62672];I[62686]=I[62672];I[62690]=I[62688];I[62692]=I[62688];I[62694]=I[62688];I[62696]=I[62688];I[62698]=I[62688];I[62700]=I[62688];I[62702]=I[62688];I[62706]=I[62704];I[62708]=I[62704];I[62710]=I[62704];I[62712]=I[62704];I[62714]=I[62704];I[62716]=I[62704];I[62718]=I[62704];I[65410]=I[65408];I[65412]=I[65408];I[65414]=I[65408];I[65416]=I[65408];I[65418]=I[65408];I[65420]=I[65408]; -I[65422]=I[65408];I[65426]=I[65424];I[65428]=I[65424];I[65430]=I[65424];I[65432]=I[65424];I[65434]=I[65424];I[65436]=I[65424];I[65438]=I[65424];I[65442]=I[65440];I[65444]=I[65440];I[65446]=I[65440];I[65448]=I[65440];I[65450]=I[65440];I[65452]=I[65440];I[65454]=I[65440];I[65458]=I[65456];I[65460]=I[65456];I[65462]=I[65456];I[65464]=I[65456];I[65466]=I[65456];I[65468]=I[65456];I[65470]=I[65456]; -u(function(){for(var a=C(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,c>>2),sb(this,ob?tb:ub);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},O:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ha:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},la:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.xa=!0},I:function(a,b){return this.J(a,b)},$:function(a,b){return this.ea(a, -b)},ja:function(a,b,c){this.A||this.gc(a,b,c)},sa:function(a,b,c){this.A||this.ta(a,b,c)},H:function(a){return this.c[a]},N:function(a){return this.c[a]},W:function(a){return this.g.getUint16(a,!0)},ga:function(a){return this.l[a>>1]},ia:function(a,b){this.c[a]=b;this.xa=!0},ka:function(a,b){this.c[a]=b;this.xa=!0},ra:function(a,b){this.g.setUint16(a,b,!0);this.xa=!0},Ha:function(a,b){this.l[a>>1]=b;this.xa=!0}}; -function Na(a,b,c){a.L=b;a.h=a.u=0;c&&((a.h=c.h)&&wb(a,xb,!1),(a.u=c.u)&&yb(a,xb,!1))}function yb(a,b,c){c&&a.u||(a.yb=!a.A&&b[1]||a.B,a.od=!a.A&&b[3]||a.w);if(c||void 0===c)a.gc=b[1]||a.B,a.ta=b[3]||a.w}function wb(a,b,c){c&&a.h||(a.Ib=b[0]||a.m,a.Jc=b[2]||a.o);if(c||void 0===c)a.J=b[0]||a.m,a.ea=b[2]||a.o}function sb(a,b){b||(b=zb);wb(a,b,void 0);yb(a,b,void 0)}var zb=[],vb=[E.prototype.O,E.prototype.la,E.prototype.ha,E.prototype.Ia],xb=[E.prototype.I,E.prototype.ja,E.prototype.$,E.prototype.sa]; -if(Ja)var ub=[E.prototype.H,E.prototype.ia,E.prototype.W,E.prototype.ra],tb=[E.prototype.N,E.prototype.ka,E.prototype.ga,E.prototype.Ha];function Ab(a,b){v.call(this,"CPU",a,Ab);var c=a.multiplier||1;this.ob=a.cycles||b;this.ka=c;this.Fb=Math.round(this.ob/1E4)/100;this.ra=this.Fb*this.ka;this.i.ba=!1;this.i.dc=!1;this.i.$a=a.autoStart;this.i.Nb=!1;this.i.qb=!1;this.ib=this.sa=0;this.nb=a.csStart;this.Ia=a.csInterval;this.Va=a.csStop;this.N=[];this.Wb=this.Vc.bind(this);D(this)}x(Ab); -var Bb=["power","reset"];h=Ab.prototype;h.za=function(a,b,c,d){this.B=a;this.u=b;this.L=d;for(b=0;b>=3;d=""+e}else d=k(c,d);else d="--------".substr(0,d||4);a.A[b].textContent!=d&&(a.A[b].textContent=d)}} -h.Z=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.A[b]=c;a=!0;break;case "run":this.A[b]=c;c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.i.R)a=!0;else{var b=null,c,l=y(a.id);for(c=0;ca.ha/a.ra&&(b=1),a.ka=b,b=a.Fb*a.ka,a.ra!=b)){a.ra=b;b=a.ra.toFixed(2)+"Mhz";var c=a.A.setSpeed;c&&(c.textContent=b);a.U("target speed: "+b)}Jb(a,a.ea);a.ea=0;a.$=ja();a.ia=0;Kb(a)}function ab(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function bb(a,b,c){0<=b&&ba.N[b][0]&&(c*=a.ob*a.ka/1E3,a.N[b][0]=c)} -h.Vc=function(){if(this.i.ba){this.Gb>=this.ob&&Kb(this,!0);this.Xa=0;this.mb=ja();if(this.ia){var a=this.mb-this.ia;a>this.Ub&&(this.$+=a,this.$>this.mb&&(this.$=this.mb))}try{do{for(var b,c=this.i.qb?1:this.pb,d=this.N.length-1;0<=d;d--){var e=this.N[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.ec(b)}catch(n){if("number"!=typeof n)throw n;}for(var f=this.ja-this.a,a=f,g=this.N.length-1;0<=g;g--){var l=this.N[g];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.Xa+=f;this.ea+=f;Jb(this,0,!0);a=f;if(this.i.qb){var m= -!1;this.ib=this.ib+this.Pb()|0;this.sa-=a;0>=this.sa&&(this.sa+=this.Ia,m=!0);0<=this.Va&&this.Va<=Lb(this)&&(this.Ia=this.Va=-1,Eb(this),M(this),m=!0);m&&this.U(Lb(this)+" cycles: checksum="+k(this.ib))}this.Wa-=f;if(0>=this.Wa){this.Wa+=this.pb;15<=++this.Vb&&(this.B&&this.B.Ta(),this.Vb=0);break}}while(this.i.ba)}catch(n){M(this);Fb(this);this.B&&this.B.stop(ja(),Lb(this));b=n.stack||n.message;this.i.error=!0;this.P(b);return}if(this.i.ba){b=setTimeout;c=this.Wb;this.ia=ja();d=this.Ub;this.Xa&& -(d=Math.round(d*this.Xa/this.pb));d-=this.ia-this.mb;if(e=this.ia-this.$)this.ha=Math.round(this.ea/(10*e))/100,864E5<=e&&(this.la=0,Ib(this));if(0>d||this.had&&(this.$-=d),d=0;this.Gb+=this.Xa;this.ia+=d;b(c,d)}}};function Gb(a){var b;a.i.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.ba)a.U(a.toString()+" busy");else{Ib(a);a.i.ba=!0;a.i.dc=!0;a.Ha&&a.Ha.start();if(b=a.A.run)b.textContent="Halt";a.B&&a.B.start(a.$,Lb(a));Fb(a,!0);setTimeout(a.Wb,0)}}h.ec=function(){return 0}; -function M(a){if(a.i.ba){a.ja-=a.a;a.a=0;Jb(a,a.ea);a.ea=0;a.i.ba=!1;a.Ha&&a.Ha.stop();var b=a.A.run;b&&(b.textContent="Run");a.B&&a.B.stop(ja(),Lb(a));Fb(a)}a.i.complete=void 0}function Fb(a,b){a.B&&a.B.Ta(b)} -function Mb(a){this.rc=a.resetAddr||0;Ab.call(this,a,6666667);this.Qb=0;this.decode=Nb.bind(this);this.l=65536;this.g=32768;this.h=65535;this.m=32768;this.C=15;this.f=[0,0,0,0,0,0,0,this.rc];this.Ma=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.lb=this.w=0;this.pc=[4,2,0,1];this.G=[[0,0,0,0,0,0,0,0,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]];this.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], -[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.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],[65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.hb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0];this.Cb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.c=this.b=this.Db=this.I=this.J=this.j=0;this.La=70;this.ta=-1;Ob(this);this.i.complete=this.i.jc=!1}x(Mb,Ab);h=Mb.prototype;h.reset=function(){this.i.ba&&M(this);Ob(this);Db(this);this.i.error=!1;this.parent.reset.call(this)};function Ob(a){a.Ea=255;a.s=0;a.Kb=0;a.H=0;a.Ca=0;a.vb=0;a.Da=0;a.Hb=0;a.kb=0;a.sb=262143;a.Tb=253952;a.o=[];a.j|=2;cb(a)} -function cb(a){a.Hb?(a.ga=65536,a.O=a.mc,a.W=a.Zb,a.Xb=a.pd):(a.ga=0,a.O=a.lc,a.W=a.Pa,a.Xb=a.Ua)}h.Pb=function(){return 0};h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.la,this.ka]);a.set(2,Xa(this.u));return a.data()}; -h.restore=function(a){var b=a[1];this.la=b[1];Ib(this,b[3]);a:{b=this.u;a=a[2];var c;for(c=0;cb){a.o[f].ma-=b;break}b-=a.o[f].ma}a.o.splice(f+1,0,{ma:b,Yb:c<<5&224,fc:d,Ab:e})}a.j|=2}function db(a){return a.C=a.C&63728|a.ya()|(a.h&65535?0:4)|(a.g&32768?2:0)|O(a)} -function eb(a,b){a.m=b<<12;a.h=~b&4;a.g=b<<14;a.l=b<<16;if((b^a.C)&2048)for(var c=a.Ma.length;0<=--c;){var d=a.f[c];a.f[c]=a.Ma[c];a.Ma[c]=d}a.w=b>>14&3;c=a.C>>14&3;a.w!=c&&(a.fa[c]=a.f[6],a.f[6]=a.fa[a.w]);a.j|=2;a.C=b}function P(a,b){a.j&128||(a.m=a.h=b,a.g=0)}function Q(a,b,c){a.j&128||(a.m=a.h=a.l=b,a.g=c||0)}function Qb(a,b,c,d){a.j&128||(a.m=a.h=a.l=b,a.g=(c^b)&(d^b))}function R(a,b){a.j&128||(a.m=a.h=a.l=b,a.g=a.m^a.l>>1)}function Rb(a,b,c,d){a.j&128||(a.m=a.h=a.l=b,a.g=(c^d)&(d^b))} -function K(a,b){var c=!1;0>a.ta?a.ta=db(a):a.w||(b=4,c=!0);a.H&57344||(a.Ca=63222,a.vb=b);a.w=0;var d=a.W(b|a.ga),e=a.W(b+2&65535|a.ga);eb(a,e&-12289|a.ta>>2&12288);c&&(a.s|=4,a.f[6]=4);Sb(a,a.ta);Sb(a,a.f[7]);a.f[7]=d&65535;a.j&=-113;a.ta=-1;throw b;}function Tb(a){var b=Ub(a),c=Ub(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);a.f[7]=b&65535;eb(a,c);a.j&=-17} -function lb(a,b){var c=b>>13&31;31>c?a.Da&32&&(b=a.hb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} -function Vb(a,b,c){var d,e,f,g=0;d=b>>13;a.Da&a.pc[a.w]||(d&=7);e=a.G[a.w][d];f=(a.X[a.w][d]<<6)+(b&8191)&a.sb;ff&&(3932160<=f&&(f=lb(a,f&262143)),f>=a.Tb&&4186112>f&&(a.s|=32,K(a,4))));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.G[a.w][d]=e;if(4194170!==f||a.w)a.kb=a.w,a.lb=d;g&&(g&57344&&(0<=a.ta&&(g|=128),a.H&57344||(a.H=a.H|g|a.kb<<5|a.lb<<1),K(a,168)),a.H&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.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.W(e)|g;a.a-=8;break; -case 6:return e=Pb(a),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=Pb(a),e=e+a.f[c]&65535,e=a.W(e|a.ga)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!g||a.H&57344||(a.Ca=a.Ca<<8|f<<3&248|c);6==c&&!a.w&&d&4&&0>=f&&(a.f[6]<=a.Ea||65534<=a.f[6])&&(a.f[6]<=a.Ea-32?(a.s|=4,a.f[6]=4,K(a,4)):(a.s|=8,a.j|=64));return e}h.lc=function(a,b,c){return Wb(this,a,b,c)};h.mc=function(a,b,c){return Vb(this,Wb(this,a,b,c),c)};h.Pa=function(a){a&1&&(this.s|=64,K(this,4));var b=this.u;return b.b[(a&b.u)>>>b.c].Jc(a&b.h,a)}; -h.Zb=function(a){return this.Pa(Vb(this,a,2))};h.Ua=function(a,b){a&1&&(this.s|=64,K(this,4));var c=this.u;c.b[(a&c.u)>>>c.c].od(a&c.h,b&65535,a)};h.pd=function(a,b){this.Ua(Vb(this,a|65536,4),b)};function Xb(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Wb(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.w=a.C>>12&3,c=a.W(d|c&a.ga),a.w=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.fa[a.C>>12&3];return c} -function Yb(a,b,c,d){a.H&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Wb(a,b,e,4),c&65536||(e&=65535),a.w=a.C>>12&3,e=Vb(a,e|c&65536,4),a.w=a.C>>14&3,a.Ua(e,d)):6!=e||(a.C>>2&12288)===(a.C&12288)?a.f[e]=d:a.fa[a.C>>12&3]=d}function Zb(a,b){b>>=6;var c=a.J=b&7;(b=a.I=(b&56)>>3)?(c=a.O(b,c,3),a=Wa(a.u,c)):a=a.f[c]&255;return a}function S(a,b){var c;b>>=6;var d=a.J=b&7;(b=a.I=(b&56)>>3)?c=a.Pa(a.O(b,d,2)):c=a.f[d];return c}function $b(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Wb(a,b,c,8)} -function ac(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.O(b,c,3),a=Wa(a.u,c)):a=a.f[c]&255;return a}function bc(a,b){var c,d=a.b=b&7;(b=a.c=(b&56)>>3)?c=a.Pa(a.O(b,d,2)):c=a.f[d];return c}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Db=a.O(b,e,7),c=d.call(a,c,Wa(a.u,e)),e&1&&a.a--,a=a.u,a.b[(e&a.u)>>>a.c].yb(e&a.h,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.O(b,e,6),a.Ua(e,d.call(a,c,a.Pa(e)))):a.f[e]=d.call(a,c,a.f[e])} -function cc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.O(b,e,5),d&1&&a.a--,a=a.u,a.b[(d&a.u)>>>a.c].yb(d&a.h,c&255,d)):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function dc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?a.Ua(a.O(b,d,4),c):a.f[d]=c&65535;return c}function V(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} -h.ec=function(a){this.i.complete=!0;this.i.jc=!1;this.i.dc=!1;this.ja=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?K(this,168):this.j&64?K(this,4):this.j&16&&K(this,12),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;a=null;for(var b=this.Kb&224,c=this.o.length;0<=--c;){if(0b&&(b=this.o[c].Yb,a=this.o[c],this.o.splice(c,1))}b>(this.C&224)&&(this.j&4&&(this.f[7]= -this.f[7]+2&65535,this.j&=-5),a?K(this,a.fc):K(this,160))}else this.j&1&&this.j++;this.H&57344||(this.Ca=0,this.vb=this.f[7]);this.j=this.j&7|this.C&16;this.decode(Pb(this))}while(0>1|b<<16;R(this,a);return a&65535}function jc(a,b){a=b&2048|b>>1|b<<8;R(this,a<<8);return a&255}function kc(a,b){a=b&~a;P(this,a);return a}function lc(a,b){a=b&~a;P(this,a<<8);return a}function mc(a,b){a|=b;P(this,a);return a}function nc(a,b){a|=b;P(this,a<<8);return a}function oc(a,b){a=~b|65536;Q(this,a);return a&65535} -function pc(a,b){a=~b|256;Q(this,a<<8);return a&255}function qc(a,b){a=b-a;this.j&128||(this.m=this.h=a,this.g=b&(b^a));return a&65535}function rc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.m=this.h=c,this.g=b&(b^c));return a&255}function sc(a,b){a=b+a;this.j&128||(this.m=this.h=a,this.g=a&(b^a));return a&65535}function tc(a,b){a=b+a;var c=a<<8;this.j&128||(this.m=this.h=c,this.g=c&(b<<8^c));return a&255}function uc(a,b){a=-b;Q(this,a,a&b&32768);return a&65535} -function vc(a,b){a=-b;Q(this,a<<8,(a&b&128)<<8);return a&255}function wc(a,b){a=b<<1|this.l>>16&1;R(this,a);return a&65535}function xc(a,b){a=b<<1|this.l>>16&1;R(this,a<<8);return a&255}function yc(a,b){a=(this.l&65536|b)>>1|b<<16;R(this,a);return a&65535}function zc(a,b){a=((this.l&65536)>>8|b)>>1|b<<8;R(this,a<<8);return a&255}function Ac(a,b){var c=b-a;Rb(this,c,a,b);return c&65535}function Bc(a,b){var c=b-a;Rb(this,c<<8,a<<8,b<<8);return c&255} -function Cc(a,b){this.j&128||(this.m=this.h=b&65280,this.g=this.l=0);return(b<<8|b>>8)&65535}function Dc(a,b){a^=b;P(this,a);return a&65535}function Ec(a){var b=bc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.l=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.m=this.h=c;this.a-=(this.c?6:7)+b} -function Fc(a){var b=bc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.l=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.l=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.m=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function W(a){a&1&&(this.l=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.m=0);this.a-=5} -function Gc(a){var b=bc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.l=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.m=d>>16):(this.g=32768,this.h=d>>15|d,this.m=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.m=0,this.g=32768,this.l=65536,this.a-=7}var Hc=[0,7,7,10,7,11,9,13];function Ic(a){var b=this.a;a=$b(this,a);this.f[7]=a&65535;this.a=b-Hc[this.c]} -var Jc=[0,14,14,17,14,18,16,20];function Kc(a){var b=this.a,c=$b(this,a);a=a>>6&7;Sb(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Jc[this.c]}var Lc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Mc=[7,13,13,17,14,18,17,21];function Nc(a){var b=bc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.j&128||(this.m=b>>16,this.h=this.m|b,this.g=0,this.l=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Qc(a){U(this,a,0,Cc);this.a-=this.c?9:3+(7==this.b?2:0)}function Rc(a){U(this,a,S(this,a),Dc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8)}function Nb(a){Sc[a>>12].call(this,a)} -var Sc=[function(a){Tc[a>>8&15].call(this,a)},function(a){var b=S(this,a),c=this.a;P(this,dc(this,a,b));this.a=c-Lc[(this.I?8:0)+this.c]+(7!=this.b||this.c?0:2)},function(a){var b=S(this,a);a=bc(this,a);Rb(this,b-a,a,b);this.a-=this.c?4+(this.J&&6<=this.b?1:0):(this.I?4:3)+(7==this.b?2:0)},function(a){P(this,S(this,a)&bc(this,a));this.a-=this.c?4+(this.J&&6<=this.b?1:0):(this.I?4:3)+(7==this.b?2:0)},function(a){U(this,a,S(this,a),kc);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b? -2:0)},function(a){U(this,a,S(this,a),mc);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){U(this,a,S(this,a),ec);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){Uc[a>>8&15].call(this,a)},function(a){Vc[a>>8&15].call(this,a)},function(a){var b=Zb(this,a);P(this,cc(this,a,b,1)<<8);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){var b=Zb(this,a)<<8;a=ac(this,a)<<8;Rb(this,b-a,a,b);this.a-=this.c?4+ -(this.J&&6<=this.b?1:0):(this.I?4:3)+(7==this.b?2:0)},function(a){P(this,(Zb(this,a)&ac(this,a))<<8);this.a-=this.c?4+(this.J&&6<=this.b?1:0):(this.I?4:3)+(7==this.b?2:0)},function(a){T(this,a,Zb(this,a),lc);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){T(this,a,Zb(this,a),nc);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){U(this,a,S(this,a),Ac);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},Y],Tc=[function(a){Wc[a>> -4&15].call(this,a)},function(a){V(this,a,!0)},function(a){V(this,a,!!(this.h&65535))},function(a){V(this,a,this.h&65535?0:4)},function(a){V(this,a,!this.ya()==!(this.g&32768))},function(a){V(this,a,!this.ya()!=!(this.g&32768))},function(a){V(this,a,!!(this.h&65535)&&!this.ya()==!(this.g&32768))},function(a){V(this,a,(this.h&65535?0:4)||!this.ya()!=!(this.g&32768))},Kc,Kc,function(a){Xc[a>>6&3].call(this,a)},function(a){Yc[a>>6&3].call(this,a)},function(a){Zc[a>>6&3].call(this,a)},function(a){$c[a>> -6&3].call(this,a)},Y,Y],Xc=[function(a){Q(this,dc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,qc);this.a-=this.c?9:3+(7==this.b?2:0)}],Yc=[function(a){U(this,a,0,uc);this.a-=this.c?11:6},function(a){U(this,a,O(this)?1:0,ec);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,O(this)?1:0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bc(this, -a);Q(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Zc=[function(a){U(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,gc);this.a-=this.c?9:3+(7==this.b?2:0)}],$c=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.Zb(a|65536);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Xb(this,a,0);Sb(this,a);P(this,a);this.a-= -11},function(a){var b=Ub(this),c=this.a;Yb(this,a,0,b);P(this,b);this.a=c-Mc[this.c]},function(a){P(this,dc(this,a,this.ya?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Wc=[function(a){ad[a&15].call(this,a)},Y,Y,Y,Ic,Ic,Ic,Ic,function(a){if(a&8)K(this,8);else{var b=Ub(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.C&49152||(this.C=this.C&-2017|(a&7)<<5,this.j|=1),this.a-=5):K(this,8)},function(a){bd[a&15].call(this,a)},function(a){cd[a&15].call(this,a)},Qc,Qc, -Qc,Qc],ad=[function(){this.C&49152?(this.s|=128,K(this,4)):M(this);this.a-=7},function(){this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Tb(this);this.j|=this.C&16;this.a-=13},function(){K(this,12);this.a-=5},function(){K(this,16);this.a-=25},function(){this.C&49152||(Ob(this),this.u.reset());this.a-=667},function(){Tb(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],bd=[Oc,function(){this.l=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.h=1;this.a-=5},W,W,W,function(){this.m=0;this.a-= -5},W,W,W,W,W,W,W],cd=[Oc,function(){this.l=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.m=32768;this.a-=5},X,X,X,X,X,X,X],Uc=[Nc,Nc,Gc,Gc,Ec,Ec,Fc,Fc,Rc,Rc,Y,Y,Y,Y,Pc,Pc],Vc=[function(a){V(this,a,!this.ya())},function(a){V(this,a,this.ya())},function(a){V(this,a,!O(this)&&!!(this.h&65535))},function(a){V(this,a,O(this)||(this.h&65535?0:4))},function(a){V(this,a,!(this.g&32768))},function(a){V(this,a,this.g&32768?2:0)},function(a){V(this, -a,!O(this))},function(a){V(this,a,O(this))},function(){K(this,24);this.a-=25},function(){K(this,28);this.a-=5},function(a){dd[a>>6&3].call(this,a)},function(a){ed[a>>6&3].call(this,a)},function(a){fd[a>>6&3].call(this,a)},function(a){gd[a>>6&3].call(this,a)},Y,Y],dd=[function(a){Q(this,cc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,rc);this.a-=this.c? -9:3+(7==this.b?2:0)}],ed=[function(a){T(this,a,0,vc);this.a-=this.c?11:6},function(a){T(this,a,O(this)?1:0,fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,O(this)?1:0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ac(this,a);Q(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],fd=[function(a){T(this,a,0,zc);this.a-=this.c?9+(this.Db&1):3+(7==this.b?2:0)},function(a){T(this,a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,jc);this.a-=this.c?9+(this.Db&1):3+(7==this.b? -2:0)},function(a){T(this,a,0,hc);this.a-=this.c?9:3+(7==this.b?2:0)}],gd=[Y,function(a){a=Xb(this,a,65536);Sb(this,a);P(this,a);this.a-=11},function(a){var b=Ub(this),c=this.a;Yb(this,a,65536,b);P(this,b);this.a=c-Mc[this.c]},Y]; -function hd(a){v.call(this,"ROM",a,hd);this.b=null;this.m=a.addr;this.c=a.size;this.o=a.writable;this.g=a.alias;this.h=a.file;this.B=ba(this.h);if(this.h){a=this.h;var b=ca(this.B);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.h+"&format=bytes&decimal=true");var c=this;p(a,null,!0,function(a,b,f){id(c,a,b,f)})}}x(hd);hd.prototype.za=function(a,b,c,d){this.u=b;this.a=c;this.L=d;jd(this)};hd.prototype.pa=function(){this.l&&(this.L&&this.L.a(this.id,this.m,this.c,this.l),delete this.l);return!0}; -hd.prototype.oa=function(){return!0}; -function id(a,b,c,d){if(d)a.P("Unable to load system ROM (error "+d+": "+b+")");else{Fa(a.Eb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.b=Array(4*f.length),g=e=0;e>8&255,a.b[g++]=f[e]>>16&255,a.b[g++]=f[e]>>24&255;else a.b=l;a.l=l.symbols;if(!a.b.length){q("Empty ROM: "+b); -return}if(1==a.b.length){q(a.b[0]);return}}catch(m){a.P("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e>>d.c].gc(e&d.h,a.b[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c>>e.c;0>>=e.c;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.jb)return;b=ha(b[1]);if(this.o=Ga(b)){var d=this.o.exports;if(d){var e=d.connect;e&&e.call(this.o);if(this.w=d.receiveData){this.status(this.Eb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.pa=function(a,b){if(!b)if(this.Sb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.oa=function(a){return a?this.save():!0};h.reset=function(){od(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return od(this)};function od(a){a.J=0;a.b=0;a.c=128;a.h=[];return!0}h.Jb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.N||8,c=a-this.m%a,this.N&&(b=" ".slice(0,c)));this.H&&!this.m&&c&&(b=String.fromCharCode(this.H)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}else if(null!=this.l){if(10==a||1024<=this.l.length)this.U(this.l), -this.l="";10!=a&&(this.l+=String.fromCharCode(a))}this.c&=-129;G(this.a,100,4,52,this.I)}};var pd={},nd=(pd[65392]=[null,null,Z.prototype.Ac,Z.prototype.ed,"RCSR"],pd[65394]=[null,null,Z.prototype.zc,Z.prototype.dd,"RBUF"],pd[65396]=[null,null,Z.prototype.Lc,Z.prototype.rd,"XCSR"],pd[65398]=[null,null,Z.prototype.Kc,Z.prototype.qd,"XBUF"],pd);u(function(){for(var a=C(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.U("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bsd){if(ud(d,this.B)){this.l=new N(this,"1.30.1","failsafe");ud(this.l)&&(zd(this,d),a=2,Ad(this.l));this.l.set("timestamp",ka());Bd(this.l);var e=this.b&&!this.m;if(1==a||la("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=yd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ud(d,g):("error"== -f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(pa("user",""),this.c=null)):this.U(f+": "+g),Ad(d),ud(d)?(c=yd(d),e=!0):c=!1))}e&&xd(this,c?d:null)}else 2==a&&d.clear()}else xd(this);delete this.B;delete this.w}e=y(this.id);for(f=0;fa[1];a=a[2];this.$=!0;this.i.R=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(Cd(this,this.a,b,c,a),this.a.$a());this.J&&(zd(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.g=0}; -function zd(a,b){if(la("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.url;d.user=c;d.type="bug";d.data=b;p("http://www.pcjs.org/api/v1/report",d,!0)}} -function Dd(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=ka();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.oa&&(c&&M(a.a),d=a.a.oa(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.R=!1,!1===d&&(e=null)));for(var l=y(a.id),m=0;mf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");p(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],n,t=/( [a-z]+=)(['"])(.*?)\2/g;n=t.exec(f);)m=0>m.indexOf(n[1])?m.replace(">",n[0]+">"):m.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Kd(a,b,c)}})}else c(a,null)} -function Ld(a,b,c,d){function e(a){if(void 0===l){var b=g&&C(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ga(a))}function f(a){e("Error: "+a);m&&(--Hd||wa(!0));m=!1}var g,l,m=!0;Hd++;Ea[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css";z.styleSheet?z.styleSheet.cssText=n:z.appendChild(document.createTextNode(n));t.appendChild(z)}c|| -(c="/versions/pdp11/1.30.1/components.xsl");n=function(d,l){l?Id(c,null,null,!1,e,function(d,m){m?(Fa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Hd||wa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Hd||wa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Id(b,a,d,!0,e,n):Jd(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(H){f(H.message)}return m}window.embedPDP11=function(a,b,c,d){wa(!1);return Ld(a,b,c,d)};window.enableEvents=wa;window.sendEvent=xa;})(); +Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ja="undefined"!==typeof ArrayBuffer;function Ka(a){v.call(this,"Panel",a,Ka)}x(Ka);g=Ka.prototype; +g.R=function(a,b,c,d){return this.A&&this.A.R(a,b,c,d)||this.b&&this.b.R(a,b,c,d)?!0:this.parent.R.call(this,a,b,c,d)};g.oa=function(a,b,c,d){this.A=a;this.o=b;this.b=c;this.I=d};g.ha=function(a,b){b||La();return!0};g.ga=function(){return!0};g.wa=function(){};function La(){for(var a=!1,b=C(document,"pdp11","panel"),c=0;c>1)+2;10>this.c&&(this.c=10);15>2;this.o=this.g-1;this.s=this.l/this.g|0;this.la=[];this.m=[];a=new E(this.b);Na(a,this.I);this.a=Array(this.s);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.la[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return c;F(d.b,4)}function Pa(a,b,c){var d=!1,e=this.controller,f=e.la[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.la[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||F(e.b,4)} +function Qa(a,b){var c=-1,d=this.controller;(a=d.la[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return c;F(d.b,4)}function Ra(a,b,c){var d=!1,e=this.controller;if(a=e.la[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||F(e.b,4)}Ma.prototype.reset=function(){for(var a=0;a>>a.c;0k&&(t=k);if(n&&n.size){if(n.type==d&&n.controller==e){if(f+k<=n.Aa)return n.Qa+=n.Aa-f,n.Aa=f,!0;if(f>=n.Aa+n.Qa){t=n.size-(f-q);t>k&&(t=k);n.Qa=f-n.Aa+t;f=q+a.g;k-=t;m++;continue}}return Ua(1,f,k)}f=new E(a.b,f,t,a.g,d,e);Na(f,a.I,n);a.a[m++]=f;f=q+a.g;k-=t}return 0>=k?(a.status(Math.floor(c/1024)+"Kb "+Va[d]+" at "+h(b,8,!0)),!0):Ua(2,b,c)} +function Wa(a,b){return a.a[(b&a.h)>>>a.c].$a(b&a.o,b)}function Xa(a,b){return a.a[(b&a.h)>>>a.c].nc(b&a.o,b)}function Ya(a,b,c){a.a[(b&a.h)>>>a.c].Sc(b&a.o,c&65535,b)}function Za(a){for(var b=0,c=[],d=0;da.b.Mb))for(var f=e[0]?e[0].bind(b):null,k=e[1]?e[1].bind(b):null,m=e[2]?e[2].bind(b):null,n=e[3]?e[3].bind(b):null,q=a,t=+d,e=e[4],J=+d;J<=t;J+=2){var Ba=J&8191;void 0!==q.la[Ba]?p("I/O address already registered: "+h(J,8,!0)):q.la[Ba]=[f,k,m,n,e||"unknown",!1]}}}function ab(a,b){a.m.push(b)}function Ua(a,b,c){p("Memory block error ("+a+": "+h(b)+","+h(c)+")");return!1} +function G(a){v.call(this,"Device",a,G);this.c={data:0,Xc:0,Pa:20,ad:0};this.a={$c:0,eb:-1}}x(G);g=G.prototype;g.oa=function(a,b,c,d){this.o=b;this.b=c;this.I=d;var e=this;this.a.eb=bb(this.b,function(){e.a.pa|=128;e.a.pa&64&&(cb(e.b,0,6,64),db(e.b,e.a.eb,1E3/60))});$a(b,this,H);ab(b,this.reset.bind(this));D(this)};g.Ub=function(){var a=this.a.pa;this.a.pa&=-129;return a};g.Ac=function(a){this.a.pa=a;a&64&&db(this.b,this.a.eb,1E3/60);this.a.pa=a&-129}; +g.Wb=function(){var a=this.b;return a.D&62337|a.Ga<<5|a.Ha<<1};g.Cc=function(a){var b=this.b;b.D=a&=62337;b.Ga=a>>5&3;b.Ha=a>>1&15;b.Za=a&257?a&1?6:4:0;eb(b);fb(this)};g.Xb=function(){var a=this.b.qa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Yb=function(){return this.b.bb};g.Zb=function(){return this.b.ua};g.Dc=function(a){var b=this.b;b.ua=a;b.ua&16?(b.Xa=4194303,b.Ia=3915776):(b.Xa=262143,b.Ia=253952);fb(this)};function fb(a){a.c.Pa=a.c.Pa&-8|(a.b.Za?a.b.ua&16?1:2:4)} +g.gc=function(a){return this.b.C[1][a>>1&7]};g.Lc=function(a,b){this.b.C[1][b>>1&7]=a&65295};g.ec=function(a){return this.b.C[1][(a>>1&7)+8]};g.Jc=function(a,b){this.b.C[1][(b>>1&7)+8]=a&65295};g.fc=function(a){return this.b.P[1][a>>1&7]};g.Kc=function(a,b){b=b>>1&7;this.b.P[1][b]=a;this.b.C[1][b]&=65295};g.dc=function(a){return this.b.P[1][(a>>1&7)+8]};g.Ic=function(a,b){b=(b>>1&7)+8;this.b.P[1][b]=a;this.b.C[1][b]&=65295};g.Tb=function(a){return this.b.C[0][a>>1&7]}; +g.zc=function(a,b){this.b.C[0][b>>1&7]=a&65295};g.Rb=function(a){return this.b.C[0][(a>>1&7)+8]};g.xc=function(a,b){this.b.C[0][(b>>1&7)+8]=a&65295};g.Sb=function(a){return this.b.P[0][a>>1&7]};g.yc=function(a,b){b=b>>1&7;this.b.P[0][b]=a;this.b.C[0][b]&=65295};g.Qb=function(a){return this.b.P[0][(a>>1&7)+8]};g.wc=function(a,b){b=(b>>1&7)+8;this.b.P[0][b]=a;this.b.C[0][b]&=65295};g.mc=function(a){return this.b.C[3][a>>1&7]};g.Rc=function(a,b){this.b.C[3][b>>1&7]=a&65295}; +g.kc=function(a){return this.b.C[3][(a>>1&7)+8]};g.Pc=function(a,b){this.b.C[3][(b>>1&7)+8]=a&65295};g.lc=function(a){return this.b.P[3][a>>1&7]};g.Qc=function(a,b){b=b>>1&7;this.b.P[3][b]=a;this.b.C[3][b]&=65295};g.jc=function(a){return this.b.P[3][(a>>1&7)+8]};g.Oc=function(a,b){b=(b>>1&7)+8;this.b.P[3][b]=a;this.b.C[3][b]&=65295};g.T=function(a){a&=7;return this.b.v&2048?this.b.va[a]:this.b.f[a]};g.W=function(a,b){b&=7;this.b.v&2048?this.b.va[b]=a:this.b.f[b]=a}; +g.qb=function(){return this.b.v&49152?this.b.Z[0]:this.b.f[6]};g.Cb=function(a){this.b.v&49152?this.b.Z[0]=a:this.b.f[6]=a};g.tb=function(){return this.b.f[7]};g.Fb=function(a){this.b.f[7]=a};g.U=function(a){a&=7;return this.b.v&2048?this.b.f[a]:this.b.va[a]};g.X=function(a,b){b&=7;this.b.v&2048?this.b.f[b]=a:this.b.va[b]=a};g.rb=function(){return 1==(this.b.v&49152)>>14?this.b.f[6]:this.b.Z[1]};g.Db=function(a){1==(this.b.v&49152)>>14?this.b.f[6]=a:this.b.Z[1]=a}; +g.sb=function(){return 3==(this.b.v&49152)>>14?this.b.f[6]:this.b.Z[3]};g.Eb=function(a){3==(this.b.v&49152)>>14?this.b.f[6]=a:this.b.Z[3]=a};g.Pb=function(a){return this.b.xb[a-65504>>1]};g.vc=function(a,b){this.b.xb[b-65504>>1]=a};g.ub=function(a){return 65520==a?61183:0};g.Gb=function(){};g.ic=function(){return 1};g.Nc=function(){};g.Ob=function(){return this.b.F};g.uc=function(){this.b.F=0};g.Vb=function(){return this.b.wb};g.Bc=function(a,b){b&1||(a&=255);this.b.wb=a};g.$b=function(){return this.b.cb}; +g.Ec=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.cb=a;b.j|=2};g.hc=function(){return this.b.ra&65280};g.Mc=function(a){this.b.ra=a|255};g.ac=function(){return gb(this.b)};g.Fc=function(a){hb(this.b,a&-1809|gb(this.b)&1808);this.b.j|=128};g.reset=function(){this.c.Pa=this.c.Pa&-120|20;this.a.pa=0}; +var I={},H=(I[62592]=[null,null,G.prototype.gc,G.prototype.Lc,"SISDR"],I[62608]=[null,null,G.prototype.ec,G.prototype.Jc,"SDSDR"],I[62624]=[null,null,G.prototype.fc,G.prototype.Kc,"SISAR"],I[62640]=[null,null,G.prototype.dc,G.prototype.Ic,"SDSAR"],I[62656]=[null,null,G.prototype.Tb,G.prototype.zc,"KISDR"],I[62672]=[null,null,G.prototype.Rb,G.prototype.xc,"KDSDR"],I[62688]=[null,null,G.prototype.Sb,G.prototype.yc,"KISAR"],I[62704]=[null,null,G.prototype.Qb,G.prototype.wc,"KDSAR"],I[62798]=[null,null, +G.prototype.Zb,G.prototype.Dc,"MMR3"],I[65382]=[null,null,G.prototype.Ub,G.prototype.Ac,"LKS"],I[65402]=[null,null,G.prototype.Wb,G.prototype.Cc,"MMR0"],I[65404]=[null,null,G.prototype.Xb,null,"MMR1"],I[65406]=[null,null,G.prototype.Yb,null,"MMR2"],I[65408]=[null,null,G.prototype.mc,G.prototype.Rc,"UISDR"],I[65424]=[null,null,G.prototype.kc,G.prototype.Pc,"UDSDR"],I[65440]=[null,null,G.prototype.lc,G.prototype.Qc,"UISAR"],I[65456]=[null,null,G.prototype.jc,G.prototype.Oc,"UDSAR"],I[65472]=[G.prototype.T, +G.prototype.W,G.prototype.T,G.prototype.W,"R0SET0"],I[65473]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R1SET0"],I[65474]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R2SET0"],I[65475]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R3SET0"],I[65476]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R4SET0"],I[65477]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R5SET0"],I[65478]=[G.prototype.qb,G.prototype.Cb,G.prototype.qb,G.prototype.Cb, +"R6KERNEL"],I[65479]=[G.prototype.tb,G.prototype.Fb,G.prototype.tb,G.prototype.Fb,"R7KERNEL"],I[65480]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R0SET1"],I[65481]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R1SET1"],I[65482]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R2SET1"],I[65483]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R3SET1"],I[65484]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R4SET1"],I[65485]=[G.prototype.U,G.prototype.X, +G.prototype.U,G.prototype.X,"R5SET1"],I[65486]=[G.prototype.rb,G.prototype.Db,G.prototype.rb,G.prototype.Db,"R6SUPER"],I[65487]=[G.prototype.sb,G.prototype.Eb,G.prototype.sb,G.prototype.Eb,"R6USER"],I[65504]=[null,null,G.prototype.Pb,G.prototype.vc,"CTRL",1170],I[65520]=[null,null,G.prototype.ub,G.prototype.Gb,"LSIZE",1170],I[65522]=[null,null,G.prototype.ub,G.prototype.Gb,"HSIZE",1170],I[65524]=[null,null,G.prototype.ic,G.prototype.Nc,"SYSID",1170],I[65526]=[null,null,G.prototype.Ob,G.prototype.uc, +"CPUERR",1170],I[65528]=[null,null,G.prototype.Vb,G.prototype.Bc,"MB",1170],I[65530]=[null,null,G.prototype.$b,G.prototype.Ec,"PIR"],I[65532]=[null,null,G.prototype.hc,G.prototype.Mc,"SL"],I[65534]=[null,null,G.prototype.ac,G.prototype.Fc,"PSW"],I);H[62594]=H[62592];H[62596]=H[62592];H[62598]=H[62592];H[62600]=H[62592];H[62602]=H[62592];H[62604]=H[62592];H[62606]=H[62592];H[62610]=H[62608];H[62612]=H[62608];H[62614]=H[62608];H[62616]=H[62608];H[62618]=H[62608];H[62620]=H[62608];H[62622]=H[62608]; +H[62626]=H[62624];H[62628]=H[62624];H[62630]=H[62624];H[62632]=H[62624];H[62634]=H[62624];H[62636]=H[62624];H[62638]=H[62624];H[62642]=H[62640];H[62644]=H[62640];H[62646]=H[62640];H[62648]=H[62640];H[62650]=H[62640];H[62652]=H[62640];H[62654]=H[62640];H[62658]=H[62656];H[62660]=H[62656];H[62662]=H[62656];H[62664]=H[62656];H[62666]=H[62656];H[62668]=H[62656];H[62670]=H[62656];H[62674]=H[62672];H[62676]=H[62672];H[62678]=H[62672];H[62680]=H[62672];H[62682]=H[62672];H[62684]=H[62672];H[62686]=H[62672]; +H[62690]=H[62688];H[62692]=H[62688];H[62694]=H[62688];H[62696]=H[62688];H[62698]=H[62688];H[62700]=H[62688];H[62702]=H[62688];H[62706]=H[62704];H[62708]=H[62704];H[62710]=H[62704];H[62712]=H[62704];H[62714]=H[62704];H[62716]=H[62704];H[62718]=H[62704];H[65410]=H[65408];H[65412]=H[65408];H[65414]=H[65408];H[65416]=H[65408];H[65418]=H[65408];H[65420]=H[65408];H[65422]=H[65408];H[65426]=H[65424];H[65428]=H[65424];H[65430]=H[65424];H[65432]=H[65424];H[65434]=H[65424];H[65436]=H[65424];H[65438]=H[65424]; +H[65442]=H[65440];H[65444]=H[65440];H[65446]=H[65440];H[65448]=H[65440];H[65450]=H[65440];H[65452]=H[65440];H[65454]=H[65440];H[65458]=H[65456];H[65460]=H[65456];H[65462]=H[65456];H[65464]=H[65456];H[65466]=H[65456];H[65468]=H[65456];H[65470]=H[65456];H[65506]=H[65504];H[65508]=H[65504];H[65510]=H[65504];H[65512]=H[65504];H[65514]=H[65504];H[65516]=H[65504];H[65518]=H[65504]; +u(function(){for(var a=C(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.g,0,d>>2),ob(this,kb?pb:qb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a){a&1&&F(this.b,4);var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ea:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ma=!0},G:function(a,b){return this.H(a, +b)},S:function(a,b){return this.Y(a,b)},ca:function(a,b,c){this.h||this.Bb(a,b,c)},ja:function(a,b,c){this.h||this.ka(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},O:function(a){a&1&&F(this.b,4);return this.o.getUint16(a,!0)},$:function(a){a&1&&F(this.b,4);return a&1?this.c[a]|this.c[a+1]<<8:this.m[a>>1]},ba:function(a,b){this.c[a]=b;this.ma=!0},da:function(a,b){this.c[a]=b;this.ma=!0},ia:function(a,b){a&1&&F(this.b,4);this.o.setUint16(a,b,!0);this.ma=!0},sa:function(a,b){a& +1&&F(this.b,4);a&1?(this.c[a]=b,this.c[a+1]=b>>8):this.m[a>>1]=b;this.ma=!0}};function Na(a,b,c){a.I=b;a.w=a.l=0;c&&((a.w=c.w)&&sb(a,tb,!1),(a.l=c.l)&&ub(a,tb,!1))}function ub(a,b,c){c&&a.l||(a.Ra=!a.h&&b[1]||a.A,a.Sc=!a.h&&b[3]||a.B);if(c||void 0===c)a.Bb=b[1]||a.A,a.ka=b[3]||a.B}function sb(a,b,c){c&&a.w||(a.$a=b[0]||a.s,a.nc=b[2]||a.u);if(c||void 0===c)a.H=b[0]||a.s,a.Y=b[2]||a.u}function ob(a,b){b||(b=vb);sb(a,b,void 0);ub(a,b,void 0)} +var vb=[],rb=[E.prototype.N,E.prototype.ea,E.prototype.aa,E.prototype.ta],tb=[E.prototype.G,E.prototype.ca,E.prototype.S,E.prototype.ja];if(Ja)var qb=[E.prototype.D,E.prototype.ba,E.prototype.O,E.prototype.ia],pb=[E.prototype.J,E.prototype.da,E.prototype.$,E.prototype.sa]; +function wb(a,b){v.call(this,"CPU",a,wb);var c=a.multiplier||1;this.La=a.cycles||b;this.da=c;this.Wa=Math.round(this.La/1E4)/100;this.ia=this.Wa*this.da;this.i.V=!1;this.i.yb=!1;this.i.Ca=a.autoStart;this.i.fb=!1;this.i.Ma=!1;this.Ja=this.ja=0;this.Ka=a.csStart;this.ta=a.csInterval;this.xa=a.csStop;this.J=[];this.nb=this.rc.bind(this);D(this)}x(wb);var xb=["power","reset"];g=wb.prototype; +g.oa=function(a,b,c,d){this.A=a;this.o=b;this.I=d;for(b=0;b>=3;d=""+e}else d=h(c,d);else d="--------".substr(0,d||4);a.w[b].textContent!=d&&(a.w[b].textContent=d)}} +g.R=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.w[b]=c;a=!0;break;case "run":this.w[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.i.L)a=!0;else{var b=null,c,m=y(a.id);for(c=0;ca.aa/a.ia&&(b=1),a.da=b,b=a.Wa*a.da,a.ia!=b)){a.ia=b;b=a.ia.toFixed(2)+"Mhz";var c=a.w.setSpeed;c&&(c.textContent=b);a.M("target speed: "+b)}Eb(a,a.Y);a.Y=0;a.S=ja();a.ba=0;Fb(a)}function bb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function db(a,b,c){0<=b&&ba.J[b][0]&&(c*=a.La*a.da/1E3,a.J[b][0]=c)} +g.rc=function(){if(this.i.V){this.Ya>=this.La&&Fb(this,!0);this.za=0;this.Ea=ja();if(this.ba){var a=this.Ea-this.ba;a>this.lb&&(this.S+=a,this.S>this.Ea&&(this.S=this.Ea))}try{do{for(var b,c=this.i.Ma?1:this.Na,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.zb(b)}catch(q){if("number"!=typeof q)throw q;}for(var f=this.ca-this.a,a=f,k=this.J.length-1;0<=k;k--){var m=this.J[k];0>m[0]||(m[0]-=a,0>=m[0]&&(m[0]=-1,m[1]()))}this.za+=f;this.Y+=f;Eb(this,0,!0);a=f;if(this.i.Ma){var n= +!1;this.Ja=this.Ja+this.hb()|0;this.ja-=a;0>=this.ja&&(this.ja+=this.ta,n=!0);0<=this.xa&&this.xa<=Gb(this)&&(this.ta=this.xa=-1,Ab(this),L(this),n=!0);n&&this.M(Gb(this)+" cycles: checksum="+h(this.Ja))}this.ya-=f;if(0>=this.ya){this.ya+=this.Na;15<=++this.mb&&(this.A&&this.A.wa(),this.mb=0);break}}while(this.i.V)}catch(q){L(this);Bb(this);this.A&&this.A.stop(ja(),Gb(this));b=q.stack||q.message;this.i.error=!0;this.K(b);return}if(this.i.V){b=setTimeout;c=this.nb;this.ba=ja();d=this.lb;this.za&&(d= +Math.round(d*this.za/this.Na));d-=this.ba-this.Ea;if(e=this.ba-this.S)this.aa=Math.round(this.Y/(10*e))/100,864E5<=e&&(this.ea=0,Db(this));if(0>d||this.aad&&(this.S-=d),d=0;this.Ya+=this.za;this.ba+=d;b(c,d)}}};function Cb(a){var b;a.i.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.V)a.M(a.toString()+" busy");else{Db(a);a.i.V=!0;a.i.yb=!0;a.sa&&a.sa.start();if(b=a.w.run)b.textContent="Halt";a.A&&a.A.start(a.S,Gb(a));Bb(a,!0);setTimeout(a.nb,0)}}g.zb=function(){return 0}; +function L(a){if(a.i.V){a.ca-=a.a;a.a=0;Eb(a,a.Y);a.Y=0;a.i.V=!1;a.sa&&a.sa.stop();var b=a.w.run;b&&(b.textContent="Run");a.A&&a.A.stop(ja(),Gb(a));Bb(a)}a.i.complete=void 0}function Bb(a,b){a.A&&a.A.wa(b)} +function Hb(a){this.Mb=+a.model||1170;this.sc=a.resetAddr||0;wb.call(this,a,6666667);this.jb=0;this.decode=Ib.bind(this);this.m=65536;this.h=32768;this.l=65535;this.s=32768;this.v=15;this.f=[0,0,0,0,0,0,0,this.sc];this.va=[0,0,0,0,0,0];this.Z=[0,0,0,0];this.Ha=this.B=0;this.Lb=[4,2,0,1];this.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.tc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.xb=[0,0,0,0,0,0,0,0];this.g=this.c=this.Ua=this.G=this.H=this.j=this.wb=0;this.ka=-1;Jb(this);this.i.complete=this.i.Hb=!1}x(Hb,wb);g=Hb.prototype;g.reset=function(){this.i.V&&L(this);Jb(this);zb(this);this.i.error=!1;this.parent.reset.call(this)}; +function Jb(a){a.ra=255;a.F=0;a.cb=0;a.D=0;a.qa=0;a.bb=0;a.ua=0;a.Za=0;a.Ga=0;a.Xa=262143;a.Ia=253952;a.u=[];a.j|=2;eb(a)}function eb(a){a.Za?(a.$=65536,a.N=a.Kb,a.O=a.vb,a.ob=a.Uc):(a.$=0,a.N=a.Jb,a.O=a.oc,a.ob=a.Tc)}g.hb=function(){return 0};g.save=function(){var a=new M(this);a.set(0,[]);a.set(1,[this.ea,this.da]);a.set(2,Za(this.o));return a.data()}; +g.restore=function(a){var b=a[1];this.ea=b[1];Db(this,b[3]);a:{b=this.o;a=a[2];var c;for(c=0;cb){a.u[f].fa-=b;break}b-=a.u[f].fa}a.u.splice(f+1,0,{fa:b,pb:c<<5&224,Ab:d,Sa:e})}a.j|=2}function gb(a){return a.v=a.v&63728|a.na()|(a.l&65535?0:4)|(a.h&32768?2:0)|N(a)} +function hb(a,b){a.s=b<<12;a.l=~b&4;a.h=b<<14;a.m=b<<16;if((b^a.v)&2048)for(var c=a.va.length;0<=--c;){var d=a.f[c];a.f[c]=a.va[c];a.va[c]=d}a.B=b>>14&3;c=a.v>>14&3;a.B!=c&&(a.Z[c]=a.f[6],a.f[6]=a.Z[a.B]);a.j|=2;a.v=b}function O(a,b){a.j&128||(a.s=a.l=b,a.h=0)}function P(a,b,c){a.j&128||(a.s=a.l=a.m=b,a.h=c||0)}function Lb(a,b,c,d){a.j&128||(a.s=a.l=a.m=b,a.h=(c^b)&(d^b))}function Q(a,b){a.j&128||(a.s=a.l=a.m=b,a.h=a.s^a.m>>1)}function Mb(a,b,c,d){a.j&128||(a.s=a.l=a.m=b,a.h=(c^d)&(d^b))} +function F(a,b){var c=!1;0>a.ka?a.ka=gb(a):a.B||(b=4,c=!0);a.D&57344||(a.qa=63222,a.bb=b);a.B=0;var d=a.O(b|a.$),e=a.O(b+2&65535|a.$);hb(a,e&-12289|a.ka>>2&12288);c&&(a.F|=4,a.f[6]=4);Nb(a,a.ka);Nb(a,a.f[7]);a.f[7]=d&65535;a.j&=-113;a.ka=-1;throw b;}function Ob(a){var b=Pb(a),c=Pb(a)&-1793;a.v&49152&&(c=c&-225|a.v&63712);a.f[7]=b&65535;hb(a,c);a.j&=-17} +function Qb(a,b,c){var d,e,f,k=0;d=b>>13;a.ua&a.Lb[a.B]||(d&=7);e=a.C[a.B][d];f=(a.P[a.B][d]<<6)+(b&8191)&a.Xa;if(ff){if(3932160<=f){f&=262143;var m=f>>13&31;31>m?a.ua&32&&(f=a.tc[m]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ia&&4186112>f&&(a.F|=32,F(a,4))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192:128;break; +default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.B][d]=e;if(4194170!==f||a.B)a.Ga=a.B,a.Ha=d;k&&(k&57344&&(0<=a.ka&&(k|=128),a.D&57344||(a.D=a.D|k|a.Ga<<5|a.Ha<<1),F(a,168)),a.D&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.O(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.O(e)|k;a.a-=8;break; +case 6:return e=Kb(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=Kb(a),e=e+a.f[c]&65535,e=a.O(e|a.$)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.D&57344||(a.qa=a.qa<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.f[6]<=a.ra||65534<=a.f[6])&&(a.f[6]<=a.ra-32?(a.F|=4,a.f[6]=4,F(a,4)):(a.F|=8,a.j|=64));return e}g.Jb=function(a,b,c){return Rb(this,a,b,c)};g.Kb=function(a,b,c){return Qb(this,Rb(this,a,b,c),c)};g.oc=function(a){return Xa(this.o,a)};g.vb=function(a){return Xa(this.o,Qb(this,a,2))}; +g.Tc=function(a,b){Ya(this.o,a,b&65535)};g.Uc=function(a,b){Ya(this.o,Qb(this,a,4),b)};function Sb(a,b,c){var d=a.c=b&7;(b=a.g=(b&56)>>3)?(d=Rb(a,b,d,2),c&65536||61440!==(a.v&61440)&&(d&=65535),a.B=a.v>>12&3,c=a.O(d|c&a.$),a.B=a.v>>14&3):c=6!=d||(a.v>>2&12288)===(a.v&12288)?a.f[d]:a.Z[a.v>>12&3];return c} +function Tb(a,b,c,d){a.D&57344||(a.qa=22);var e=a.c=b&7;(b=a.g=(b&56)>>3)?(e=Rb(a,b,e,4),c&65536||(e&=65535),a.B=a.v>>12&3,e=Qb(a,e|c&65536,4),a.B=a.v>>14&3,Ya(a.o,e,d)):6!=e||(a.v>>2&12288)===(a.v&12288)?a.f[e]=d:a.Z[a.v>>12&3]=d}function Ub(a,b){b>>=6;var c=a.H=b&7;(b=a.G=(b&56)>>3)?(c=a.N(b,c,3),a=Wa(a.o,c)):a=a.f[c]&255;return a}function R(a,b){b>>=6;var c=a.H=b&7;return(b=a.G=(b&56)>>3)?Xa(a.o,a.N(b,c,2)):a.f[c]}function Vb(a,b){var c=a.c=b&7;b=a.g=(b&56)>>3;return Rb(a,b,c,8)} +function Wb(a,b){var c=a.c=b&7;(b=a.g=(b&56)>>3)?(c=a.N(b,c,3),a=Wa(a.o,c)):a=a.f[c]&255;return a}function S(a,b){var c=a.c=b&7;return(b=a.g=(b&56)>>3)?Xa(a.o,a.N(b,c,2)):a.f[c]}function T(a,b,c,d){var e=a.c=b&7;(b=a.g=(b&56)>>3)?(e=a.Ua=a.N(b,e,7),c=d.call(a,c,Wa(a.o,e)),e&1&&a.a--,a=a.o,a.a[(e&a.h)>>>a.c].Ra(e&a.o,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.c=b&7;(b=a.g=(b&56)>>3)?(e=a.N(b,e,6),Ya(a.o,e,d.call(a,c,Xa(a.o,e)))):a.f[e]=d.call(a,c,a.f[e])} +function Xb(a,b,c,d){var e=a.c=b&7;(b=a.g=(b&56)>>3)?(d=a.N(b,e,5),d&1&&a.a--,a=a.o,a.a[(d&a.h)>>>a.c].Ra(d&a.o,c&255,d)):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function Yb(a,b,c){var d=a.c=b&7;(b=a.g=(b&56)>>3)?Ya(a.o,a.N(b,d,4),c):a.f[d]=c&65535;return c}function V(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} +g.zb=function(a){this.i.complete=!0;this.i.Hb=!1;this.i.yb=!1;this.ca=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?F(this,168):this.j&64?F(this,4):this.j&16&&F(this,12),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;a=null;for(var b=this.cb&224,c=this.u.length;0<=--c;){if(0b&&(b=this.u[c].pb,a=this.u[c],this.u.splice(c,1))}b>(this.v&224)&&(this.j&4&&(this.f[7]= +this.f[7]+2&65535,this.j&=-5),a?F(this,a.Ab):F(this,160))}else this.j&1&&this.j++;this.D&57344||(this.qa=0,this.bb=this.f[7]);this.j=this.j&7|this.v&16;this.decode(Kb(this))}while(0>1|b<<16;Q(this,a);return a&65535}function dc(a,b){a=b&2048|b>>1|b<<8;Q(this,a<<8);return a&255}function ec(a,b){a=b&~a;O(this,a);return a}function fc(a,b){a=b&~a;O(this,a<<8);return a}function gc(a,b){a|=b;O(this,a);return a}function hc(a,b){a|=b;O(this,a<<8);return a}function ic(a,b){a=~b|65536;P(this,a);return a&65535} +function jc(a,b){a=~b|256;P(this,a<<8);return a&255}function kc(a,b){a=b-a;this.j&128||(this.s=this.l=a,this.h=b&(b^a));return a&65535}function lc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.s=this.l=c,this.h=b&(b^c));return a&255}function mc(a,b){a=b+a;this.j&128||(this.s=this.l=a,this.h=a&(b^a));return a&65535}function nc(a,b){a=b+a;var c=a<<8;this.j&128||(this.s=this.l=c,this.h=c&(b<<8^c));return a&255}function oc(a,b){a=-b;P(this,a,a&b&32768);return a&65535} +function pc(a,b){a=-b;P(this,a<<8,(a&b&128)<<8);return a&255}function qc(a,b){a=b<<1|this.m>>16&1;Q(this,a);return a&65535}function rc(a,b){a=b<<1|this.m>>16&1;Q(this,a<<8);return a&255}function sc(a,b){a=(this.m&65536|b)>>1|b<<16;Q(this,a);return a&65535}function tc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Q(this,a<<8);return a&255}function uc(a,b){var c=b-a;Mb(this,c,a,b);return c&65535}function vc(a,b){var c=b-a;Mb(this,c<<8,a<<8,b<<8);return c&255} +function wc(a,b){this.j&128||(this.s=this.l=b&65280,this.h=this.m=0);return(b<<8|b>>8)&65535}function xc(a,b){a^=b;O(this,a);return a&65535}function yc(a){var b=S(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.h=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.h=32768)}this.f[a]=c&65535;this.s=this.l=c;this.a-=(this.g?6:7)+b} +function zc(a){var b=S(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.h=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.l=d>>16|d;this.a-=(this.g?6:7)+b}function W(a){a&1&&(this.m=0);a&2&&(this.h=0);a&4&&(this.l=1);a&8&&(this.s=0);this.a-=5} +function Ac(a){var b=S(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.h=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.l=d>>16|d,this.s=d>>16):(this.h=32768,this.l=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.l=this.s=0,this.h=32768,this.m=65536,this.a-=7}var Bc=[0,7,7,10,7,11,9,13];function Cc(a){var b=this.a;a=Vb(this,a);this.f[7]=a&65535;this.a=b-Bc[this.g]} +var Dc=[0,14,14,17,14,18,16,20];function Ec(a){var b=this.a,c=Vb(this,a);a=a>>6&7;Nb(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Dc[this.g]}var Fc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Gc=[7,13,13,17,14,18,17,21];function Hc(a){var b=S(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.j&128||(this.s=b>>16,this.l=this.s|b,this.h=0,this.m=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Kc(a){U(this,a,0,wc);this.a-=this.g?9:3+(7==this.c?2:0)}function Lc(a){U(this,a,R(this,a),xc);this.a-=this.g?9:3+(7==this.c?2:0)}function Y(){F(this,8)}function Ib(a){Mc[a>>12].call(this,a)} +var Mc=[function(a){Nc[a>>8&15].call(this,a)},function(a){var b=R(this,a),c=this.a;O(this,Yb(this,a,b));this.a=c-Fc[(this.G?8:0)+this.g]+(7!=this.c||this.g?0:2)},function(a){var b=R(this,a);a=S(this,a);Mb(this,b-a,a,b);this.a-=this.g?4+(this.H&&6<=this.c?1:0):(this.G?4:3)+(7==this.c?2:0)},function(a){O(this,R(this,a)&S(this,a));this.a-=this.g?4+(this.H&&6<=this.c?1:0):(this.G?4:3)+(7==this.c?2:0)},function(a){U(this,a,R(this,a),ec);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c? +2:0)},function(a){U(this,a,R(this,a),gc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){U(this,a,R(this,a),Zb);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){Oc[a>>8&15].call(this,a)},function(a){Pc[a>>8&15].call(this,a)},function(a){var b=Ub(this,a);O(this,Xb(this,a,b,1)<<8);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){var b=Ub(this,a)<<8;a=Wb(this,a)<<8;Mb(this,b-a,a,b);this.a-=this.g?4+ +(this.H&&6<=this.c?1:0):(this.G?4:3)+(7==this.c?2:0)},function(a){O(this,(Ub(this,a)&Wb(this,a))<<8);this.a-=this.g?4+(this.H&&6<=this.c?1:0):(this.G?4:3)+(7==this.c?2:0)},function(a){T(this,a,Ub(this,a),fc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){T(this,a,Ub(this,a),hc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){U(this,a,R(this,a),uc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},Y],Nc=[function(a){Qc[a>> +4&15].call(this,a)},function(a){V(this,a,!0)},function(a){V(this,a,!!(this.l&65535))},function(a){V(this,a,this.l&65535?0:4)},function(a){V(this,a,!this.na()==!(this.h&32768))},function(a){V(this,a,!this.na()!=!(this.h&32768))},function(a){V(this,a,!!(this.l&65535)&&!this.na()==!(this.h&32768))},function(a){V(this,a,(this.l&65535?0:4)||!this.na()!=!(this.h&32768))},Ec,Ec,function(a){Rc[a>>6&3].call(this,a)},function(a){Sc[a>>6&3].call(this,a)},function(a){Tc[a>>6&3].call(this,a)},function(a){Uc[a>> +6&3].call(this,a)},Y,Y],Rc=[function(a){P(this,Yb(this,a,0));this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,ic);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,1,mc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,1,kc);this.a-=this.g?9:3+(7==this.c?2:0)}],Sc=[function(a){U(this,a,0,oc);this.a-=this.g?11:6},function(a){U(this,a,N(this)?1:0,Zb);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,N(this)?1:0,uc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){a=S(this, +a);P(this,a);this.a-=this.g?4:3+(7==this.c?2:0)}],Tc=[function(a){U(this,a,0,sc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,qc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,cc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,ac);this.a-=this.g?9:3+(7==this.c?2:0)}],Uc=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.vb(a|65536);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Sb(this,a,0);Nb(this,a);O(this,a);this.a-= +11},function(a){var b=Pb(this),c=this.a;Tb(this,a,0,b);O(this,b);this.a=c-Gc[this.g]},function(a){O(this,Yb(this,a,this.na?65535:0));this.a-=this.g?9:3+(7==this.c?2:0)}],Qc=[function(a){Vc[a&15].call(this,a)},Y,Y,Y,Cc,Cc,Cc,Cc,function(a){if(a&8)F(this,8);else{var b=Pb(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.v&49152||(this.v=this.v&-2017|(a&7)<<5,this.j|=1),this.a-=5):F(this,8)},function(a){Wc[a&15].call(this,a)},function(a){Xc[a&15].call(this,a)},Kc,Kc, +Kc,Kc],Vc=[function(){this.v&49152?(this.F|=128,F(this,4)):L(this);this.a-=7},function(){this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Ob(this);this.j|=this.v&16;this.a-=13},function(){F(this,12);this.a-=5},function(){F(this,16);this.a-=25},function(){this.v&49152||(Jb(this),this.o.reset());this.a-=667},function(){Ob(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Wc=[Ic,function(){this.m=0;this.a-=5},function(){this.h=0;this.a-=5},W,function(){this.l=1;this.a-=5},W,W,W,function(){this.s=0;this.a-= +5},W,W,W,W,W,W,W],Xc=[Ic,function(){this.m=65536;this.a-=5},function(){this.h=32768;this.a-=5},X,function(){this.l=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Oc=[Hc,Hc,Ac,Ac,yc,yc,zc,zc,Lc,Lc,Y,Y,Y,Y,Jc,Jc],Pc=[function(a){V(this,a,!this.na())},function(a){V(this,a,this.na())},function(a){V(this,a,!N(this)&&!!(this.l&65535))},function(a){V(this,a,N(this)||(this.l&65535?0:4))},function(a){V(this,a,!(this.h&32768))},function(a){V(this,a,this.h&32768?2:0)},function(a){V(this, +a,!N(this))},function(a){V(this,a,N(this))},function(){F(this,24);this.a-=25},function(){F(this,28);this.a-=5},function(a){Yc[a>>6&3].call(this,a)},function(a){Zc[a>>6&3].call(this,a)},function(a){$c[a>>6&3].call(this,a)},function(a){ad[a>>6&3].call(this,a)},Y,Y],Yc=[function(a){P(this,Xb(this,a,0));this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,0,jc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,1,nc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,1,lc);this.a-=this.g? +9:3+(7==this.c?2:0)}],Zc=[function(a){T(this,a,0,pc);this.a-=this.g?11:6},function(a){T(this,a,N(this)?1:0,$b);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,N(this)?1:0,vc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){a=Wb(this,a);P(this,a<<8);this.a-=this.g?4:3+(7==this.c?2:0)}],$c=[function(a){T(this,a,0,tc);this.a-=this.g?9+(this.Ua&1):3+(7==this.c?2:0)},function(a){T(this,a,0,rc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,0,dc);this.a-=this.g?9+(this.Ua&1):3+(7==this.c? +2:0)},function(a){T(this,a,0,bc);this.a-=this.g?9:3+(7==this.c?2:0)}],ad=[Y,function(a){a=Sb(this,a,65536);Nb(this,a);O(this,a);this.a-=11},function(a){var b=Pb(this),c=this.a;Tb(this,a,65536,b);O(this,b);this.a=c-Gc[this.g]},Y]; +function bd(a){v.call(this,"ROM",a,bd);this.a=null;this.m=a.addr;this.c=a.size;this.s=a.writable;this.g=a.alias;this.h=a.file;this.u=ba(this.h);if(this.h){a=this.h;var b=ca(this.u);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.h+"&format=bytes&decimal=true");var c=this;l(a,null,!0,function(a,b,f){cd(c,a,b,f)})}}x(bd);bd.prototype.oa=function(a,b,c,d){this.o=b;this.b=c;this.I=d;dd(this)};bd.prototype.ha=function(){this.l&&(this.I&&this.I.a(this.id,this.m,this.c,this.l),delete this.l);return!0}; +bd.prototype.ga=function(){return!0}; +function cd(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Va,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,k,m=eval("("+c+")");if(f=m.bytes)a.a=f;else if(f=m.words)for(a.a=Array(2*f.length),k=e=0;e>8&255;else if(f=m.data)for(a.a=Array(4*f.length),k=e=0;e>8&255,a.a[k++]=f[e]>>16&255,a.a[k++]=f[e]>>24&255;else a.a=m;a.l=m.symbols;if(!a.a.length){p("Empty ROM: "+b); +return}if(1==a.a.length){p(a.a[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.a=Array(b.length),e=0;e>>d.c].Bb(e&d.o,a.a[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c>>e.c;0>>=e.c;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.Fa)return;b=ha(b[1]);if(this.s=Ha(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.u=d.receiveData){this.status(this.Va+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.ha=function(a,b){if(!b)if(this.ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +g.ga=function(a){return a?this.save():!0};g.reset=function(){id(this)};g.save=function(){var a=new M(this);a.set(0,[]);return a.data()};g.restore=function(){return id(this)};function id(a){a.G=0;a.a=0;a.c=128;a.h=[];return!0}g.ab=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.m%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.m&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}else if(null!=this.l){if(10==a||1024<=this.l.length)this.M(this.l), +this.l="";10!=a&&(this.l+=String.fromCharCode(a))}this.c&=-129;cb(this.b,100,4,52,this.D)}};var jd={},hd=(jd[65392]=[null,null,Z.prototype.cc,Z.prototype.Hc,"RCSR"],jd[65394]=[null,null,Z.prototype.bc,Z.prototype.Gc,"RBUF"],jd[65396]=[null,null,Z.prototype.qc,Z.prototype.Wc,"XCSR"],jd[65398]=[null,null,Z.prototype.pc,Z.prototype.Vc,"XBUF"],jd);u(function(){for(var a=C(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.M("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bmd){if(od(d,this.u)){this.l=new M(this,"1.30.1","failsafe");od(this.l)&&(td(this,d),a=2,ud(this.l));this.l.set("timestamp",ka());vd(this.l);var e=this.a&&!this.m;if(1==a||la("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=sd(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?od(d,k):("error"== +f&&"no machine state"!=k?(this.K("Error: "+k),"unable to verify user"==k&&(pa("user",""),this.c=null)):this.M(f+": "+k),ud(d),od(d)?(c=sd(d),e=!0):c=!1))}e&&rd(this,c?d:null)}else 2==a&&d.clear()}else rd(this);delete this.u;delete this.A}e=y(this.id);for(f=0;fa[1];a=a[2];this.S=!0;this.i.L=!0;var d=this.w.power;d&&(d.textContent="Shutdown");this.b&&(wd(this,this.b,b,c,a),this.b.Ca());this.G&&(td(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.g=0}; +function td(a,b){if(la("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;l("http://www.pcjs.org/api/v1/report",d,!0)}} +function xd(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new M(a,"1.30.1"),k=new M(a,"1.30.1","validate"),m=ka();k.set("timestamp",m);f.set("timestamp",m);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.ga&&(c&&L(a.b),d=a.b.ga(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.i.L=!1,!1===d&&(e=null)));for(var m=y(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");l(e,null,!0,function(f,k,m){if(m||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+m+")");else{if(f=d[3])if(m=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=m[0],q,t=/( [a-z]+=)(['"])(.*?)\2/g;q=t.exec(f);)n=0>n.indexOf(q[1])?n.replace(">",q[0]+">"):n.replace(new RegExp(q[1]+"(['\"])(.*?)\\1"),q[0]);m[0]!=n&&(k=k.replace(m[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],k);Ed(a,b,c)}})}else c(a,null)} +function Fd(a,b,c,d){function e(a){if(void 0===m){var b=k&&C(k,"machine-warning");m=b&&b[0]||k}m&&(m.innerHTML=ga(a))}function f(a){e("Error: "+a);n&&(--Bd||wa(!0));n=!1}var k,m,n=!0;Bd++;Fa[a]={};try{if(k=document.getElementById(a)){var q;if("object"==typeof resources&&(q=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],J=document.createElement("style");J.type="text/css";J.styleSheet?J.styleSheet.cssText=q:J.appendChild(document.createTextNode(q));t.appendChild(J)}c|| +(c="/versions/pdp11/1.30.1/components.xsl");q=function(d,m){m?Cd(c,null,null,!1,e,function(d,n){n?(Ga(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=m.transformNode(n))?(k.outerHTML=n,--Bd||wa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(m,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--Bd||wa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Cd(b,a,d,!0,e,q):Dd(b,null,a,d,!1,e,q)}else f("missing machine element: "+a)}catch(Ba){f(Ba.message)}return n}window.embedPDP11=function(a,b,c,d){wa(!1);return Fd(a,b,c,d)};window.enableEvents=wa;window.sendEvent=xa;})();