diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 707bcc0c9..423de801f 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -42,7 +42,7 @@ if (NODE) { } /** - * BusPDP11(cpu, dbg) + * BusPDP11(parmsBus, cpu, dbg) * * The BusPDP11 component manages physical memory and I/O address spaces. * @@ -69,8 +69,18 @@ function BusPDP11(parmsBus, cpu, dbg) this.cpu = cpu; this.dbg = dbg; + /* + * Supported values for nBusWidth are 16 (default), 18, and 22. This represents the maximum size + * of the bus for the life of the machine, regardless what memory management mode the CPU has enabled. + */ this.nBusWidth = parmsBus['busWidth'] || 16; + /* + * This controls the location of the IOPAGE (ie, at the top of 16-bit, 18-bit, or 22-bit address range). + * It is managed by setIOPageRange(). initMemory() establishes the default (16). + */ + this.nIOPageRange = 0; // zero means no IOPAGE access (yet) + /* * Compute all BusPDP11 memory block parameters, based on the width of the bus. The entire * address space is divided into blocks, using a block size that is (hopefully) appropriate to @@ -130,10 +140,26 @@ function BusPDP11(parmsBus, cpu, dbg) */ this.aIOHandlers = []; this.fIOBreakAll = false; + + /* + * Array of RESET notification handlers registered by Device components. + */ this.afnReset = []; /* - * Allocate empty Memory blocks to span the entire physical address space. + * Before we can add any memory blocks that declare our component as a custom memory controller, + * we must initialize the array that the getControllerAccess() method supplies to the Memory component. + */ + this.afnIOPage = [ + BusPDP11.IOController.readByte, + BusPDP11.IOController.writeByte, + BusPDP11.IOController.readWord, + BusPDP11.IOController.writeWord + ]; + + /* + * We're ready to allocate empty Memory blocks to span the entire physical address space, including the + * initial location of the IOPAGE. */ this.initMemory(); @@ -142,7 +168,7 @@ function BusPDP11(parmsBus, cpu, dbg) Component.subclass(BusPDP11); -BusPDP11.IOPAGE_VIRT = 0xE000; /*000160000*/ +BusPDP11.IOPAGE_16BIT = 0xE000; /*000160000*/ // eg, PDP-11/20 BusPDP11.IOPAGE_18BIT = 0x3E000; /*000760000*/ // eg, PDP-11/45 BusPDP11.IOPAGE_UNIBUS = 0x3C0000; /*017000000*/ BusPDP11.IOPAGE_22BIT = 0x3FE000; /*017760000*/ // eg, PDP-11/70 @@ -365,18 +391,31 @@ BusPDP11.prototype.initMemory = function() for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) { this.aMemBlocks[iBlock] = block; } - this.afnIOPage = new Array(4); - this.afnIOPage[0] = BusPDP11.IOController.readByte; - this.afnIOPage[1] = BusPDP11.IOController.writeByte; - this.afnIOPage[2] = BusPDP11.IOController.readWord; - this.afnIOPage[3] = BusPDP11.IOController.writeWord; - /* - * Map IOPAGE at the top of the address space (as determined by nBusWidth), as well as at IOPAGE_VIRT - * (which is the only place that 16-bit code can reach the IOPAGE when memory management is not enabled). - */ - var addr = this.addrTotal - BusPDP11.IOPAGE_LENGTH; - this.addMemory(addr, BusPDP11.IOPAGE_LENGTH, MemoryPDP11.TYPE.CONTROLLER, this); - this.addMemory(BusPDP11.IOPAGE_VIRT, BusPDP11.IOPAGE_LENGTH, MemoryPDP11.TYPE.CONTROLLER, this); + this.setIOPageRange(16); +}; + +/** + * setIOPageRange(nRange) + * + * We can define the IOPAGE address range with a single number, because the size of the IOPAGE is fixed at 8Kb. + * The bottom of the range is (2 ^ nRange) - IOPAGE_LENGTH, and the top is (2 ^ nRange) - 1. + * + * @this {BusPDP11} + * @param {number} nRange (16, 18 or 22) + */ +BusPDP11.prototype.setIOPageRange = function(nRange) +{ + if (nRange != this.nIOPageRange) { + var addr; + if (this.nIOPageRange) { + addr = (1 << this.nIOPageRange) - BusPDP11.IOPAGE_LENGTH; + if (!this.removeMemory(addr, BusPDP11.IOPAGE_LENGTH)) return; + this.nIOPageRange = 0; + } + addr = (1 << nRange) - BusPDP11.IOPAGE_LENGTH; + if (!this.addMemory(addr, BusPDP11.IOPAGE_LENGTH, MemoryPDP11.TYPE.CONTROLLER, this)) return; + this.nIOPageRange = nRange; + } }; /** @@ -390,6 +429,9 @@ BusPDP11.prototype.initMemory = function() */ BusPDP11.prototype.getControllerBuffer = function(addr) { + /* + * No buffer is required; all accesses go to a registered I/O handler or the bit-bucket. + */ return [null, 0]; }; diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index a3381ddeb..354fda36f 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -197,11 +197,6 @@ CPUPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) if (control) this.cmp.setBinding(null, CPUPDP11.BUTTONS[i], control); } - /* - * Attach the ChipSet component to the CPU so that it can be notified whenever the CPU stops and starts. - */ - this.chipset = null; // /** @type {ChipSetPDP11} */ (cmp.getMachineComponent("ChipSet")); - /* * We've already saved the parmsCPU 'autoStart' setting, but there may be a machine (or URL) override. */ @@ -210,12 +205,27 @@ CPUPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.flags.autoStart = (sAutoStart == "true"? true : (sAutoStart == "false"? false : !!sAutoStart)); } + this.initBusComplete(); + this.setReady(); }; +/** + * initBusComplete() + * + * Stub for Bus finalization (overridden by the CPUStatePDP11 component). + * + * @this {CPUPDP11} + */ +CPUPDP11.prototype.initBusComplete = function() +{ +}; + /** * reset() * + * Stub for reset notification (overridden by the CPUStatePDP11 component). + * * @this {CPUPDP11} */ CPUPDP11.prototype.reset = function() @@ -225,7 +235,7 @@ CPUPDP11.prototype.reset = function() /** * save() * - * This is a placeholder for save support (overridden by the CPUStatePDP11 component). + * Stub for save support (overridden by the CPUStatePDP11 component). * * @this {CPUPDP11} * @return {Object|null} @@ -238,7 +248,7 @@ CPUPDP11.prototype.save = function() /** * restore(data) * - * This is a placeholder for restore support (overridden by the CPUStatePDP11 component). + * Stub for restore support (overridden by the CPUStatePDP11 component). * * @this {CPUPDP11} * @param {Object} data @@ -552,40 +562,6 @@ CPUPDP11.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) return fBound; }; -/** - * setBurstCycles(nCycles) - * - * This function is used by the ChipSet component whenever a very low timer count is set, - * in anticipation of the timer requiring an update sooner than the normal nCyclesPerYield - * period in runCPU() would normally provide. - * - * NOTE: In this context, "timer" refers to a timer chip (eg, an Intel 8253) being emulated by - * by the ChipSet component, not the timers managed by the CPU (eg, addTimer(), setTimer(), etc). - * - * @this {CPUPDP11} - * @param {number} nCycles is the target number of cycles to drop the current burst to - * @return {boolean} - */ -CPUPDP11.prototype.setBurstCycles = function(nCycles) -{ - if (this.flags.running) { - var nDelta = this.nStepCycles - nCycles; - /* - * NOTE: If nDelta is negative, we will actually be increasing nStepCycles and nBurstCycles. - * Which is OK, but if we're also taking snapshots of the cycle counts, to make sure that instruction - * costs are being properly assessed, then we need to update nSnapCycles as well. - * - * TODO: If the delta is negative, we could simply ignore the request, but we must first carefully - * consider the impact on the ChipSet timers, if any. - */ - // if (DEBUG) this.nSnapCycles -= nDelta; - this.nStepCycles -= nDelta; - this.nBurstCycles -= nDelta; - return true; - } - return false; -}; - /** * addCycles(nCycles, fEndStep) * @@ -1183,7 +1159,6 @@ CPUPDP11.prototype.startCPU = function(fUpdateFocus) this.setSpeed(); this.flags.running = true; this.flags.starting = true; - if (this.chipset) this.chipset.start(); var controlRun = this.bindings["run"]; if (controlRun) controlRun.textContent = "Halt"; if (this.cmp) { @@ -1227,7 +1202,6 @@ CPUPDP11.prototype.stopCPU = function(fComplete) this.addCycles(this.nRunCycles); this.nRunCycles = 0; this.flags.running = false; - if (this.chipset) this.chipset.stop(); var controlRun = this.bindings["run"]; if (controlRun) controlRun.textContent = "Run"; if (this.cmp) { diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 0e465f0da..c7f1324a5 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -98,6 +98,17 @@ Component.subclass(CPUStatePDP11, CPUPDP11); */ var InterruptEvent; +/** + * initBusComplete() + * + * @this {CPUStatePDP11} + */ +CPUStatePDP11.prototype.initBusComplete = function() +{ + this.assert(this.bus); + this.setMemoryAccess(); +}; + /** * initProcessor() * @@ -216,11 +227,12 @@ CPUStatePDP11.prototype.resetRegs = function() /** @type {Array.} */ this.interruptQueue = []; this.opFlags |= PDP11.OPFLAG.INTQ; - this.initMemoryAccess(); + + if (this.bus) this.setMemoryAccess(); }; /** - * initMemoryAccess() + * setMemoryAccess() * * Define handlers and DSPACE setting appropriate for the current MMU mode, in order to eliminate * unnecessary calls to mapVirtualToPhysical(). @@ -231,18 +243,20 @@ CPUStatePDP11.prototype.resetRegs = function() * * @this {CPUStatePDP11} */ -CPUStatePDP11.prototype.initMemoryAccess = function() +CPUStatePDP11.prototype.setMemoryAccess = function() { if (this.mmuEnable) { this.addrDSpace = PDP11.ACCESS.DSPACE; this.getAddrByMode = this.getVirtualAddrByMode; this.readWordFromAddr = this.readWordFromVirtual; this.writeWordToAddr = this.writeWordToVirtual; + this.bus.setIOPageRange((this.regMMR3 & PDP11.MMR3.MMU_22BIT)? 22 : 18); } else { this.addrDSpace = 0; this.getAddrByMode = this.getPhysicalAddrByMode; this.readWordFromAddr = this.readWordFromPhysical; this.writeWordToAddr = this.writeWordToPhysical; + this.bus.setIOPageRange(16); } }; @@ -265,19 +279,23 @@ CPUStatePDP11.prototype.getMMR0 = function() */ CPUStatePDP11.prototype.setMMR0 = function(newMMR0) { - this.regMMR0 = newMMR0 &= 0xf381; - this.mmuLastMode = (newMMR0 >> 5) & 3; - this.mmuLastPage = (newMMR0 >> 1) & 0xf; - if (newMMR0 & 0x101) { - if (newMMR0 & 0x1) { - this.mmuEnable = PDP11.ACCESS.READ | PDP11.ACCESS.WRITE; - } else { - this.mmuEnable = PDP11.ACCESS.WRITE; + newMMR0 &= 0xf381; + if (this.regMMR0 != newMMR0) { + this.regMMR0 = newMMR0; + this.mmuLastMode = (newMMR0 >> 5) & 3; + this.mmuLastPage = (newMMR0 >> 1) & 0xf; + var mmuEnable = 0; + if (newMMR0 & 0x101) { + mmuEnable = PDP11.ACCESS.WRITE; + if (newMMR0 & 0x1) { + mmuEnable |= PDP11.ACCESS.READ; + } + } + if (this.mmuEnable != mmuEnable) { + this.mmuEnable = mmuEnable; + this.setMemoryAccess(); } - } else { - this.mmuEnable = 0; } - this.initMemoryAccess(); }; /** @@ -309,13 +327,16 @@ CPUStatePDP11.prototype.setMMR3 = function(newMMR3) 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; + if (this.regMMR3 != newMMR3) { + this.regMMR3 = newMMR3; + if (newMMR3 & PDP11.MMR3.MMU_22BIT) { + this.mmuMask = 0x3fffff; + this.mmuMemorySize = BusPDP11.MAX_MEMORY; + } else { + this.mmuMask = 0x3ffff; + this.mmuMemorySize = BusPDP11.IOPAGE_18BIT; + } + this.setMemoryAccess(); } }; @@ -1515,7 +1536,7 @@ CPUStatePDP11.prototype.getAddress = function(mode, reg, accessFlags) /** * getPhysicalAddrByMode(mode, reg, accessFlags) * - * This is a handler set up by initMemoryAccess(). All calls should go through getAddrByMode(). + * This is a handler set up by setMemoryAccess(). All calls should go through getAddrByMode(). * * @this {CPUStatePDP11} * @param {number} mode @@ -1531,7 +1552,7 @@ CPUStatePDP11.prototype.getPhysicalAddrByMode = function(mode, reg, accessFlags) /** * getVirtualAddrByMode(mode, reg, accessFlags) * - * This is a handler set up by initMemoryAccess(). All calls should go through getAddrByMode(). + * This is a handler set up by setMemoryAccess(). All calls should go through getAddrByMode(). * * @this {CPUStatePDP11} * @param {number} mode @@ -1547,7 +1568,7 @@ CPUStatePDP11.prototype.getVirtualAddrByMode = function(mode, reg, accessFlags) /** * readWordFromPhysical(physicalAddress) * - * This is a handler set up by initMemoryAccess(). All calls should go through readWordFromAddr(). + * This is a handler set up by setMemoryAccess(). All calls should go through readWordFromAddr(). * * @this {CPUStatePDP11} * @param {number} physicalAddress @@ -1561,7 +1582,7 @@ CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress) /** * readWordFromVirtual(virtualAddress) * - * This is a handler set up by initMemoryAccess(). All calls should go through readWordFromAddr(). + * This is a handler set up by setMemoryAccess(). All calls should go through readWordFromAddr(). * * @this {CPUStatePDP11} * @param {number} virtualAddress (input address is 17 bit (I&D)) @@ -1575,7 +1596,7 @@ CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress) /** * writeWordToPhysical(physicalAddress, data) * - * This is a handler set up by initMemoryAccess(). All calls should go through writeWordToAddr(). + * This is a handler set up by setMemoryAccess(). All calls should go through writeWordToAddr(). * * @this {CPUStatePDP11} * @param {number} physicalAddress @@ -1589,7 +1610,7 @@ CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data) /** * writeWordToVirtual(virtualAddress, data) * - * This is a handler set up by initMemoryAccess(). All calls should go through writeWordToAddr(). + * This is a handler set up by setMemoryAccess(). All calls should go through writeWordToAddr(). * * @this {CPUStatePDP11} * @param {number} virtualAddress (input address is 17 bit (I&D)) @@ -1659,7 +1680,7 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, dat * TODO: Consider replacing the following code with writeWordToAddr(), by adding optional mmuMode * 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. + * setMemoryAccess() handlers. */ this.mmuMode = (this.regPSW >> 12) & 3; addr = this.mapVirtualToPhysical(addr | (accessFlags & PDP11.ACCESS.DSPACE), PDP11.ACCESS.WRITE); diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index a29d9ae67..76cf2211b 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -79,16 +79,24 @@ var BYTEARRAYS = false; var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined'); /** - * WORDBUS forces the Bus and Memory interfaces to assume even addresses when accessing words. Since PDPjs inherited - * its Bus component from PCx86, it originally supported both aligned and unaligned word accesses by default, but since - * the PDP-11 requires aligned (even) word addresses, we can turn off support for unaligned accesses and get some - * performance gains. + * MEMFAULT forces the Memory interfaces to signal a CPU fault when a word is accessed using an odd (unaligned) address. * - * When WORDBUS is true, the Bus and Memory components simply ignore the low bit of word addresses, because it is the - * CPU, not the Bus, that's responsible for validating addresses and generating the appropriate traps. + * Since PDPjs inherited its Bus component from PCx86, it included support for both aligned and unaligned word accesses + * by default. However, the PDP-11 adds a wrinkle: when an odd address is used to access a memory word, a BUS_ERROR trap + * must be generated. Note that odd IOPAGE word accesses are fine; this only affects the Memory component. * - * Don't worry that the source code looks MORE complicated rather than LESS with the additional WORDBUS checks, because - * the Closure Compiler eliminates those checks and throws away the (unreachable) code blocks that deal with unaligned + * When the MMU is enabled, these checks may also be performed at a higher level, eliminating the need for them at the + * physical memory level. + */ +var MEMFAULT = true; + +/** + * WORDBUS turns off support for unaligned memory words. Whereas MEMFAULT necessarily slows down memory word accesses + * slightly, WORDBUS is able to speed them up slightly, by assuming that all word accesses (which didn't fault) must be + * aligned. This affects all word accesses, even IOPAGE accesses, because it also eliminates cross-block boundary checks. + * + * Don't worry that the source code looks MORE complicated rather than LESS with the additional MEMFAULT and WORDBUS checks, + * because the Closure Compiler eliminates those checks and throws away the (unreachable) code blocks that deal with unaligned * accesses. */ var WORDBUS = true; @@ -109,6 +117,7 @@ var PDP11 = { MAXDEBUG: MAXDEBUG, // shared PRIVATE: PRIVATE, // shared TYPEDARRAYS:TYPEDARRAYS, + MEMFAULT: MEMFAULT, WORDBUS: WORDBUS, SITEHOST: SITEHOST, // shared XMLVERSION: XMLVERSION, // shared diff --git a/modules/pdp11/lib/memory.js b/modules/pdp11/lib/memory.js index 15c3af409..a2ed951cb 100644 --- a/modules/pdp11/lib/memory.js +++ b/modules/pdp11/lib/memory.js @@ -623,7 +623,7 @@ MemoryPDP11.prototype = { * @return {number} */ readWordMemory: function readWordMemory(off, addr) { - if (PDP11.WORDBUS && (off & 0x1)) { + if (PDP11.MEMFAULT && (off & 0x1)) { this.cpu.fault(addr); } if (BYTEARRAYS) { @@ -667,7 +667,7 @@ MemoryPDP11.prototype = { * @param {number} addr */ writeWordMemory: function writeWordMemory(off, w, addr) { - if (PDP11.WORDBUS && (off & 0x1)) { + if (PDP11.MEMFAULT && (off & 0x1)) { this.cpu.fault(addr); } if (BYTEARRAYS) { @@ -777,7 +777,7 @@ MemoryPDP11.prototype = { * @return {number} */ readWordBE: function readWordBE(off, addr) { - if (PDP11.WORDBUS && (off & 0x1)) { + if (PDP11.MEMFAULT && (off & 0x1)) { this.cpu.fault(addr); } return this.dv.getUint16(off, true); @@ -791,15 +791,15 @@ MemoryPDP11.prototype = { * @return {number} */ readWordLE: function readWordLE(off, addr) { + var w; + if (PDP11.MEMFAULT && (off & 0x1)) { + this.cpu.fault(addr); + } /* * TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset * for an aligned read vs. always reading the bytes separately. */ - var w; - if (PDP11.WORDBUS && (off & 0x1)) { - this.cpu.fault(addr); - } - if (!(off & 0x1)) { + if (PDP11.WORDBUS || !(off & 0x1)) { w = this.aw[off >> 1]; } else { w = this.ab[off] | (this.ab[off+1] << 8); @@ -845,7 +845,7 @@ MemoryPDP11.prototype = { * @param {number} w */ writeWordBE: function writeWordBE(off, w, addr) { - if (PDP11.WORDBUS && (off & 0x1)) { + if (PDP11.MEMFAULT && (off & 0x1)) { this.cpu.fault(addr); } this.dv.setUint16(off, w, true); @@ -860,14 +860,14 @@ MemoryPDP11.prototype = { * @param {number} w */ writeWordLE: function writeWordLE(off, w, addr) { + if (PDP11.MEMFAULT && (off & 0x1)) { + this.cpu.fault(addr); + } /* * 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)) { - this.cpu.fault(addr); - } - if (!(off & 0x1)) { + if (PDP11.WORDBUS || !(off & 0x1)) { this.aw[off >> 1] = w; } else { this.ab[off] = w; diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index df044655d..6e1eac17b 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -693,211 +693,211 @@ function m(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window. function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Da(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ea(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.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={}; +function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Nb=b.comment;this.xc=b;b=this.id.indexOf(".");0>b?this.Xa=this.id:(this.xb=this.id.substr(0,b),this.Xa=this.id.substr(b+1));this[a]=c;this.v={ready:!1,hb:!1,yb:!1,fa:!1,error:!1};this.qb=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.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}; +function Ab(a,b,c){r.call(this,"Bus",a,Ab,64);this.b=b;this.j=c;this.C=a.busWidth||16;this.B=0;this.G=Math.pow(2,this.C);this.g=this.G-1|0;this.Y=(this.C>>1)+2;10>this.Y&&(this.Y=10);15>2;this.f=this.qa-1;this.A=this.G/this.qa|0;this.Ka=[];this.F=[];this.pc=[Bb,Cb,Db,Eb];a=new H(this.b);Fb(a,this.j);this.P=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=Hb(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 Cb(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):(Hb(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 Db(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=Hb(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 Eb(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):(Hb(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))} +function Gb(a,b){if(b!=a.B){var c;if(a.B){c=(1<>>a.Y;0>>a.Y;0g&&(q=g);if(n&&n.size){if(n.type==d&&n.controller==e){if(f+g<=n.w)return n.ob+=n.w-f,n.w=f,!0;if(f>=n.w+n.ob){q=n.size-(f-p);q>g&&(q=g);n.ob=f-n.w+q;f=p+a.qa;g-=q;l++;continue}}return Ib(1,f,g)}f=new H(a.b,f,q,a.qa,d,e);Fb(f,a.j,n);a.P[l++]=f;f=p+a.qa;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Lb[d]+" at "+k(b,8,!0)),!0):Ib(2,b,c)} +h.Ua=function(a){return this.P[(a&this.g)>>>this.Y].ub(a&this.f,a)};h.ma=function(a){return this.P[(a&this.g)>>>this.Y].cc(a&this.f,a)};function Mb(a,b){return a.P[(b&a.g)>>>a.Y].Cb(b&a.f,b)}h.mb=function(a,b){this.P[(a&this.g)>>>this.Y].vb(a&this.f,b&255,a)};h.Wa=function(a,b){this.P[(a&this.g)>>>this.Y].nc(a&this.f,b&65535,a)}; +function Nb(a){for(var b=0,c=[],d=0;da.b.Wb))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 Pb(a,b){a.F.push(b)}function Ib(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,sb:20,Jd:0};this.f={Hd:0,Hb:-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.Hb=Qb(this.b,function(){e.f.Ma|=128;e.f.Ma&64&&(Rb(e.b,0,6,64),Sb(e.b,e.f.Hb,1E3/60))});Ob(b,this,K);Pb(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&&Sb(this.b,this.f.Hb,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;a&=62337;if(b.G!=a){b.G=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.tb!=c&&(b.tb=c,Tb(b))}Ub(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.Eb};h.Lc=function(){return this.b.Pa};h.nd=function(a){var b=this.b;b.Pa!=a&&(b.Pa=a,a&16?(b.ab=4194303,b.ya=3915776):(b.ab=262143,b.ya=253952),Tb(b));Ub(this)}; +function Ub(a){a.g.sb=a.g.sb&-8|(a.b.tb?a.b.Pa&16?1:2:4)}h.Tc=function(a){return this.b.T[1][a>>1&7]};h.vd=function(a,b){this.b.T[1][b>>1&7]=a&65295};h.Rc=function(a){return this.b.T[1][(a>>1&7)+8]};h.td=function(a,b){this.b.T[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.T[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.T[1][b]&=65295}; +h.Fc=function(a){return this.b.T[0][a>>1&7]};h.jd=function(a,b){this.b.T[0][b>>1&7]=a&65295};h.Dc=function(a){return this.b.T[0][(a>>1&7)+8]};h.gd=function(a,b){this.b.T[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.T[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.T[0][b]&=65295};h.Zc=function(a){return this.b.T[3][a>>1&7]}; +h.Bd=function(a,b){this.b.T[3][b>>1&7]=a&65295};h.Xc=function(a){return this.b.T[3][(a>>1&7)+8]};h.zd=function(a,b){this.b.T[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.T[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.T[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.Yb=function(){return this.b.K&49152?this.b.ta[0]:this.b.u[6]};h.ic=function(a){this.b.K&49152?this.b.ta[0]=a:this.b.u[6]=a};h.ac=function(){return this.b.u[7]};h.lc=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.Zb=function(){return 1==(this.b.K&49152)>>14?this.b.u[6]:this.b.ta[1]}; +h.jc=function(a){1==(this.b.K&49152)>>14?this.b.u[6]=a:this.b.ta[1]=a};h.$b=function(){return 3==(this.b.K&49152)>>14?this.b.u[6]:this.b.ta[3]};h.kc=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.fc[a-65504>>1]};h.ed=function(a,b){this.b.fc[b-65504>>1]=a};h.bc=function(a){return 65520==a?61183:0};h.mc=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.ec}; +h.ld=function(a,b){b&1||(a&=255);this.b.ec=a};h.Mc=function(){return this.b.Fb};h.od=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Fb=a;b.D|=2};h.Uc=function(){return this.b.Qa&65280};h.wd=function(a){this.b.Qa=a|255};h.Nc=function(){return Vb(this.b)};h.pd=function(a){Wb(this.b,a&-1809|Vb(this.b)&1808);this.b.D|=128};h.reset=function(){this.g.sb=this.g.sb&-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]= +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.Yb,J.prototype.ic,J.prototype.Yb, +J.prototype.ic,"R6KERNEL"],L[65479]=[J.prototype.ac,J.prototype.lc,J.prototype.ac,J.prototype.lc,"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.Zb,J.prototype.jc,J.prototype.Zb,J.prototype.jc,"R6SUPER"],L[65487]=[J.prototype.$b,J.prototype.kc,J.prototype.$b,J.prototype.kc,"R6USER"],L[65504]=[null,null,J.prototype.Bc,J.prototype.ed,"CTRL",1170],L[65520]=[null,null,J.prototype.bc,J.prototype.mc,"LSIZE",1170],L[65522]=[null,null,J.prototype.bc,J.prototype.mc,"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; +La(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.f=new Int32Array(this.A,0,d>>2),lc(this,hc?mc:nc);else{this.f=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},X: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},U:function(a,b){if(this.j&&null!=this.w){var c=this.j;sc(c,this.w+a,1,c.N)&&c.ea(!0)}return this.Bb(a,b)},ca:function(a,b){if(this.j&&null!=this.w){var c=this.j;sc(c,this.w+a,2,c.N)&&c.ea(!0)}return this.Cb(a,b)},ka:function(a,b,c){if(this.j&&null!=this.w){var d=this.j;sc(d,this.w+a, +1,d.G)&&d.ea(!0)}this.g?this.F(a,b,c):this.wb(a,b,c)},xa:function(a,b,c){if(this.j&&null!=this.w){var d=this.j;sc(d,this.w+a,2,d.G)&&d.ea(!0)}this.g?this.F(a,b,c):this.Ib(a,b,c)},N:function(a){return this.C[a]},W:function(a,b){a=this.C[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=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.C[a]=b;this.La=!0},la:function(a,b,c){this.C[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)},wa:function(a,b,c){a&1&&this.b.O(4,c);this.G.setUint16(a,b,!0);this.La=!0},ya:function(a,b,c){a&1&&this.b.O(4,c);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 Fb(a,b,c){a.j=b;a.B=a.J=0;c&&((a.B=c.B)&&rc(a,qc,!1),(a.J=c.J)&&pc(a,qc,!1))}function tc(a,b){b?--a.J||(a.vb=a.g?a.F:a.wb,a.nc=a.g?a.H:a.Ib):--a.B||(a.ub=a.Bb,a.cc=a.Cb)}function pc(a,b,c){c&&a.J||(a.vb=!a.g&&b[1]||a.F,a.nc=!a.g&&b[3]||a.H);if(c||void 0===c)a.wb=b[1]||a.F,a.Ib=b[3]||a.H}function rc(a,b,c){c&&a.B||(a.ub=b[0]||a.L,a.cc=b[2]||a.M);if(c||void 0===c)a.Bb=b[0]||a.L,a.Cb=b[2]||a.M}function lc(a,b){b||(b=uc);rc(a,b,void 0);pc(a,b,void 0)} +var uc=[],oc=[H.prototype.X,H.prototype.oa,H.prototype.ga,H.prototype.Xa],qc=[H.prototype.U,H.prototype.ka,H.prototype.ca,H.prototype.xa];if(wb)var nc=[H.prototype.N,H.prototype.ia,H.prototype.aa,H.prototype.wa],mc=[H.prototype.W,H.prototype.la,H.prototype.da,H.prototype.ya]; +function vc(a,b){r.call(this,"CPU",a,vc,1);var c=a.multiplier||1;this.Ja=a.cycles||b;this.Na=c;this.Za=Math.round(this.Ja/1E4)/100;this.Va=this.Za*this.Na;this.v.ba=!1;this.v.Gb=!1;this.v.gb=a.autoStart;this.v.Lb=!1;this.v.$a=!1;this.jb=this.ia=0;this.kb=a.csStart;this.bb=a.csInterval;this.cb=a.csStop;this.L=[];this.Ub=this.cd.bind(this);G(this)}y(vc);var wc=["power","reset"];h=vc.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<=Cc(a)&&(a.bb=a.cb=-1,zc(a),a.ea(),c=!0);c&&a.i(Cc(a)+" cycles: checksum="+k(a.jb))}} +function Dc(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.Lb?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.Za*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.nb()}Fc(a,a.X);a.X=0;a.W=ra();a.da=0;Gc(a);return d}function Qb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Sb(a,b,c){0<=b&&ba.L[b][0]&&(c*=a.Ja*a.Na/1E3,a.L[b][0]=c)}function Hc(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 Ic(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.ib>=this.Ja&&Gc(this,!0);this.oa=0;this.Ia=ra();if(this.da){var a=this.Ia-this.da;a>this.rb&&(this.W+=a,this.W>this.Ia&&(this.W=this.Ia))}try{do{var b=Hc(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;Ic(this,c);this.oa+=c;this.X+=c;Fc(this,0,!0);Bc(this,c);this.ka-=c;if(0>=this.ka){this.ka+=this.Ra;15<=++this.Rb&&(this.F&&this.F.za(),this.Rb=0);break}}while(this.v.ba)}catch(e){this.ea();M(this);this.F&&this.F.stop(ra(), +Cc(this));vb(this,e.stack||e.message);return}if(this.v.ba){a=setTimeout;b=this.Ub;this.da=ra();c=this.rb;this.oa&&(c=Math.round(c*this.oa/this.Ra));var c=c-(this.da-this.Ia),d=this.da-this.W;d&&(this.ca=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ga=0,Ec(this)));if(0>c||this.cac&&(this.W-=c),c=0;this.ib+=this.oa;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;Ec(this);this.v.ba=!0;this.v.Gb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.F&&(a&&this.F.nb(!0),this.F.start(this.W,Cc(this)));M(this,!0);setTimeout(this.Ub,0);return!0};h.fb=function(){return 0};h.ea=function(a){if(this.v.ba){this.N-=this.b;this.b=0;Fc(this,this.X);this.X=0;this.v.ba=!1;var b=this.J.run;b&&(b.textContent="Run");this.F&&this.F.stop(ra(),Cc(this));M(this)}this.v.complete=a}; +function M(a,b){a.F&&a.F.za(b)} +function Jc(a){this.Wb=+a.model||1170;this.yc=a.resetAddr||0;vc.call(this,a,6666667);this.pb=0;this.decode=Kc.bind(this);this.R=65536;this.S=32768;this.Z=65535;this.V=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.vc=[4,2,0,1];this.T=[[0,0,0,0,0,0,0,0,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.fc=[0,0,0,0,0,0,0,0];this.g=this.f=this.Ya=this.H=this.I=this.D=this.ec=0;this.la=-1;Lc(this);this.v.complete=this.v.rc=!1}y(Jc,vc);h=Jc.prototype;h.Sb=function(){Tb(this)};h.reset=function(){this.v.ba&&this.ea();Lc(this);yc(this);this.v.error=!1;this.parent.reset.call(this)}; +function Lc(a){a.Qa=255;a.$=0;a.Fb=0;a.G=0;a.Oa=0;a.Eb=0;a.Pa=0;a.tb=0;a.wa=0;a.ab=262143;a.ya=253952;a.A=[];a.D|=2;a.B&&Tb(a)}function Tb(a){a.tb?(a.aa=65536,a.M=a.uc,a.U=a.dc,a.Vb=a.Dd,Gb(a.B,a.Pa&16?22:18)):(a.aa=0,a.M=a.tc,a.U=a.$c,a.Vb=a.Cd,Gb(a.B,16))}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,Nb(this.B));return a.data()}; +h.restore=function(a){var b=a[1];this.ga=b[1];Ec(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,Xb:c<<5&224,hc:d,Ab:e})}a.D|=2}function Vb(a){return a.K=a.K&63728|a.Fa()|gd(a)|fd(a)|ed(a)} +function Wb(a,b){a.V=b<<12;a.Z=~b&4;a.S=b<<14;a.R=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.V=a.Z=b,a.S=0)}function jd(a,b,c){a.D&128||(a.V=a.Z=a.R=b,a.S=c||0)}function kd(a,b,c,d){a.D&128||(a.V=a.Z=a.R=b,a.S=(c^b)&(d^b))}function ld(a,b){a.D&128||(a.V=a.Z=a.R=b,a.S=a.V^a.R>>1)}function md(a,b,c,d){a.D&128||(a.V=a.Z=a.R=b,a.S=(c^d)&(d^b))} +h.O=function(a){var b=!1;0>this.la?this.la=Vb(this):this.C||(a=4,b=!0);this.G&57344||(this.Oa=63222,this.Eb=a);this.C=0;var c=this.U(a|this.aa),d=this.U(a+2&65535|this.aa);Wb(this,d&-12289|this.la>>2&12288);b&&(this.$|=4,this.u[6]=4);nd(this,this.la);nd(this,this.u[7]);id(this,c);this.D&=-113;this.la=-1;throw a;};function od(a){var b=pd(a),c=pd(a)&-1793;a.K&49152&&(c=c&-225|a.K&63712);id(a,b);Wb(a,c);a.D&=-17} +function qd(a,b,c){var d,e,f,g=0;d=b>>13;a.Pa&a.vc[a.C]||(d&=7);e=a.T[a.C][d];f=(a.pa[a.C][d]<<6)+(b&8191)&a.ab;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Pa&32&&(f=a.zc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&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.T[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.U(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.U(e)|g;a.b-= +8;break;case 6:return e=hd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=hd(a),e=e+a.u[c]&65535,e=a.U(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.Qa||65534<=a.u[6])&&(a.u[6]<=a.Qa-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 rd(this,a,b,c)};h.uc=function(a,b,c){return qd(this,rd(this,a,b,c),c)};h.$c=function(a){return this.B.ma(a)};h.dc=function(a){return this.B.ma(qd(this,a,2))}; +h.Cd=function(a,b){this.B.Wa(a,b&65535)};h.Dd=function(a,b){this.B.Wa(qd(this,a,4),b)};function sd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=rd(a,b,d,2),c&65536||61440!==(a.K&61440)&&(d&=65535),a.C=a.K>>12&3,c=a.U(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 td(a,b,c,d){a.G&57344||(a.Oa=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=rd(a,b,e,4),c&65536||(e&=65535),a.C=a.K>>12&3,e=qd(a,e|c&65536,4),a.C=a.K>>14&3,a.B.Wa(e,d)):6!=e||(a.K>>2&12288)===(a.K&12288)?a.u[e]=d:a.ta[a.K>>12&3]=d}function ud(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 vd(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 wd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return rd(a,b,c,8)} +function xd(a,b){var c=a.f=b&7;(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 yd(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.Ya=a.M(b,e,7),c=d.call(a,c,a.B.Ua(e)),e&1&&a.b--,a.B.mb(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.Wa(e,d.call(a,c,a.B.ma(e)))):a.u[e]=d.call(a,c,a.u[e])} +function zd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.M(b,e,5),d&1&&a.b--,a.B.mb(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 Ad(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.B.Wa(a.M(b,d,4),c):a.u[d]=c&65535;return c}function R(a,b,c){c&&(id(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&&Bd(this.j),c=a?this.v.Gb?0:1:-1;this.v.Gb=!1;this.N=this.b=a;do{if(b){if(Cd(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.Fb&224,e=this.A.length;0<=--e;){if(0d&&(d=this.A[e].Xb,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.hc,26):this.O(160,26))}else this.D&1&&this.D++;this.G&57344||(this.Oa=0,this.Eb=this.u[7]);this.D=this.D&7|this.K&16;this.decode(hd(this))}while(0>1|b<<16;ld(this,a);return a&65535}function Id(a,b){a=b&2048|b>>1|b<<8;ld(this,a<<8);return a&255}function Jd(a,b){a=b&~a;O(this,a);return a}function Kd(a,b){a=b&~a;O(this,a<<8);return a}function Ld(a,b){a|=b;O(this,a);return a} +function Md(a,b){a|=b;O(this,a<<8);return a}function Nd(a,b){a=~b|65536;jd(this,a);return a&65535}function Od(a,b){a=~b|256;jd(this,a<<8);return a&255}function Pd(a,b){a=b-a;this.D&128||(this.V=this.Z=a,this.S=b&(b^a));return a&65535}function Qd(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.V=this.Z=c,this.S=b&(b^c));return a&255}function Rd(a,b){a=b+a;this.D&128||(this.V=this.Z=a,this.S=a&(b^a));return a&65535} +function Sd(a,b){a=b+a;var c=a<<8;this.D&128||(this.V=this.Z=c,this.S=c&(b<<8^c));return a&255}function Td(a,b){a=-b;jd(this,a,a&b&32768);return a&65535}function Ud(a,b){a=-b;jd(this,a<<8,(a&b&128)<<8);return a&255}function Vd(a,b){a=b<<1|this.R>>16&1;ld(this,a);return a&65535}function Wd(a,b){a=b<<1|this.R>>16&1;ld(this,a<<8);return a&255}function Xd(a,b){a=(this.R&65536|b)>>1|b<<16;ld(this,a);return a&65535}function Yd(a,b){a=((this.R&65536)>>8|b)>>1|b<<8;ld(this,a<<8);return a&255} +function Zd(a,b){var c=b-a;md(this,c,a,b);return c&65535}function $d(a,b){var c=b-a;md(this,c<<8,a<<8,b<<8);return c&255}function ae(a,b){this.D&128||(this.V=this.Z=b&65280,this.S=this.R=0);return(b<<8|b>>8)&65535}function be(a,b){a^=b;O(this,a);return a&65535} +function ce(a){var b=yd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.R=this.S=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.S=32768)}this.u[a]=c&65535;this.V=this.Z=c;this.b-=(this.g?6:7)+b} +function de(a){var b=yd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.R=this.S=0;b&=63;if(b&32){b=64-b;32>b-1;this.R=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.V=d>>16;this.Z=d>>16|d;this.b-=(this.g?6:7)+b}function S(a){a&1&&(this.R=0);a&2&&(this.S=0);a&4&&(this.Z=1);a&8&&(this.V=0);this.b-=5} +function ee(a){var b=yd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.R=this.S=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.Z=d>>16|d,this.V=d>>16):(this.S=32768,this.Z=d>>15|d,this.V=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Z=this.V=0,this.S=32768,this.R=65536,this.b-=7}var fe=[0,7,7,10,7,11,9,13];function ge(a){var b=this.b;id(this,wd(this,a));this.b=b-fe[this.g]} +var he=[0,14,14,17,14,18,16,20];function ie(a){var b=this.b,c=wd(this,a);a=a>>6&7;nd(this,this.u[a]);this.u[a]=this.u[7];id(this,c);this.b=b-he[this.g]}var je=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],ke=[7,13,13,17,14,18,17,21];function le(a){var b=yd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.D&128||(this.V=b>>16,this.Z=this.V|b,this.S=0,this.R=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)id(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function oe(a){Q(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}function pe(a){Q(this,a,vd(this,a),be);this.b-=this.g?9:3+(7==this.f?2:0)}function V(){this.O(8,6)}function Kc(a){qe[a>>12].call(this,a)} +var qe=[function(a){re[a>>8&15].call(this,a)},function(a){var b=vd(this,a),c=this.b;O(this,Ad(this,a,b));this.b=c-je[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)},function(a){var b=vd(this,a);a=yd(this,a);md(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,vd(this,a)&yd(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,vd(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){Q(this,a,vd(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,vd(this,a),Dd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){se[a>>8&15].call(this,a)},function(a){Me[a>>8&15].call(this,a)},function(a){var b=ud(this,a);O(this,zd(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=ud(this,a)<<8;a=xd(this,a)<<8;md(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))<<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,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){P(this,a,ud(this,a),Md);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,vd(this,a),Zd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},V],re= +[function(a){Ne[a>>4&15].call(this,a)},function(a){R(this,a,!0)},function(a){R(this,a,!gd(this))},function(a){R(this,a,gd(this))},function(a){R(this,a,!this.Fa()==!fd(this))},function(a){R(this,a,!this.Fa()!=!fd(this))},function(a){R(this,a,!gd(this)&&!this.Fa()==!fd(this))},function(a){R(this,a,gd(this)||!this.Fa()!=!fd(this))},ie,ie,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)},function(a){Re[a>>6&3].call(this,a)},V,V],Oe=[function(a){jd(this, +Ad(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Nd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Rd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Pd);this.b-=this.g?9:3+(7==this.f?2:0)}],Pe=[function(a){Q(this,a,0,Td);this.b-=this.g?11:6},function(a){Q(this,a,ed(this)?1:0,Dd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,ed(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=yd(this,a);jd(this,a);this.b-=this.g?4:3+(7==this.f? +2:0)}],Qe=[function(a){Q(this,a,0,Xd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Vd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Hd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Fd);this.b-=this.g?9:3+(7==this.f?2:0)}],Re=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.dc(a|65536);id(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=sd(this,a,0);nd(this,a);O(this,a);this.b-=11},function(a){var b=pd(this),c=this.b;td(this,a, +0,b);O(this,b);this.b=c-ke[this.g]},function(a){O(this,Ad(this,a,this.Fa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Ne=[function(a){Se[a&15].call(this,a)},V,V,V,ge,ge,ge,ge,function(a){if(a&8)this.O(8,6);else{var b=pd(this);a&=7;id(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){Te[a&15].call(this,a)},function(a){Ue[a&15].call(this,a)},oe,oe,oe,oe],Se=[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(){od(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||(Lc(this),this.B.reset());this.b-=667},function(){od(this);this.b-=13},V,V,V,V,V,V,V,V,V],Te=[me,function(){this.R=0;this.b-=5},function(){this.S=0;this.b-=5},S,function(){this.Z=1;this.b-=5},S,S,S,function(){this.V=0;this.b-=5},S,S,S,S,S,S,S],Ue=[me,function(){this.R= +65536;this.b-=5},function(){this.S=32768;this.b-=5},T,function(){this.Z=0;this.b-=5},T,T,T,function(){this.V=32768;this.b-=5},T,T,T,T,T,T,T],se=[le,le,ee,ee,ce,ce,de,de,pe,pe,V,V,V,V,ne,ne],Me=[function(a){R(this,a,!this.Fa())},function(a){R(this,a,this.Fa())},function(a){R(this,a,!ed(this)&&!gd(this))},function(a){R(this,a,ed(this)||gd(this))},function(a){R(this,a,!fd(this))},function(a){R(this,a,fd(this))},function(a){R(this,a,!ed(this))},function(a){R(this,a,ed(this))},function(){this.O(24,2); +this.b-=25},function(){this.O(28,5);this.b-=5},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)},function(a){Ye[a>>6&3].call(this,a)},V,V],Ve=[function(a){jd(this,zd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Od);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Sd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Qd);this.b-=this.g?9:3+(7==this.f?2:0)}],We=[function(a){P(this,a,0,Ud);this.b-= +this.g?11:6},function(a){P(this,a,ed(this)?1:0,Ed);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,ed(this)?1:0,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=xd(this,a);jd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Xe=[function(a){P(this,a,0,Yd);this.b-=this.g?9+(this.Ya&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Wd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Id);this.b-=this.g?9+(this.Ya&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Gd);this.b-=this.g?9:3+(7== +this.f?2:0)}],Ye=[V,function(a){a=sd(this,a,65536);nd(this,a);O(this,a);this.b-=11},function(a){var b=pd(this),c=this.b;td(this,a,65536,b);O(this,b);this.b=c-ke[this.g]},V];function Ze(a){r.call(this,"ROM",a,Ze);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){$e(c,a,b,f)})}}y(Ze); +Ze.prototype.Ga=function(a,b,c,d){this.B=b;this.b=c;this.j=d;af(this)};Ze.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.Kb);0>v&&q.splice(-(v+1),0,n)}p&&(l.a=p.replace(/''/g,'"'))}a.H.push({Id:b,w:c,wc:d,Da:e,Jb:f})}delete this.Da}return!0};Ze.prototype.Ba=function(){return!0}; +function $e(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.xb,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.Y].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.Y;0>>=e.Y;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=oa(b[0]);if(c!=this.Xa)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.xb+"."+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(){ff(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return ff(this)};function ff(a){a.U=0;a.f=0;a.g=128;a.C=[];return!0}h.Db=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.W||8,c=a-this.H%a,this.W&&(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;Rb(this.b,100,4,52,this.N)}};var gf={},ef=(gf[65392]=[null,null,W.prototype.Pc,W.prototype.rd,"RCSR"],gf[65394]=[null,null,W.prototype.Oc,W.prototype.qd,"RBUF"],gf[65396]=[null,null,W.prototype.bd,W.prototype.Fd,"XCSR"],gf[65398]=[null,null,W.prototype.ad,W.prototype.Ed,"XBUF"],gf);La(function(){for(var a=A(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};hf.prototype.Pb=function(){return-1};hf.prototype.Qb=function(){}; +function kf(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.X?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 lf(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 lf(a,b,c){var d;if(b){b=mf(a,b);for(var e=0,f=!1,g=b,l=[],n=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);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=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);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 qf(a,b){if(b)return pf(a,b,a.ca[b]);var c=0;for(b in a.ca)pf(a,b,a.ca[b]),c++;return 0>>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;n>>d.B.Y;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=Lb[c],q&&d.i(k(q.id,8)+" %"+k(e<>>c.Y].Bb(d&c.f,d),this.g--,b&&Af(a,b));return c};h.ma=function(a,b){var c=65535,d=Y(a);-1!==d&&(this.g++,c=Mb(this.B,d),this.g--,b&&Af(a,b));return c}; +h.mb=function(a,b,c){var d=Y(a);if(-1!==d){this.g++;var e=this.B;e.P[(d&e.g)>>>e.Y].wb(d&e.f,b&255,d);this.g--;c&&Af(a,c);M(this.b,!0)}};h.Wa=function(a,b,c){var d=Y(a);if(-1!==d){this.g++;var e=this.B;e.P[(d&e.g)>>>e.Y].Ib(d&e.f,b&65535,d);this.g--;c&&Af(a,c);M(this.b,!0)}};function X(a){return{w:a,Aa:!1}}function Bf(a){return[a.w,a.Aa]}function Cf(a){return{w:a[0],Aa:a[1]}} +function zf(a,b,c){var d;c=(c?a.M:a.Ra).w;if(void 0!==b){d=b=nf(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=Vb(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.wa.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 tf(a){var b;if(Bd(a)){if(!a.L||!a.L.length){a.L=Array(1E3);for(b=0;b>>d.Y],!1)}a.N=["br"];if(a.G)for(b=1;b>>d.Y],!0);a.G=["bw"];a.Ya=0} +h.Sa=function(a,b,c){var d=!0;c||Jf(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.P[e>>>f.Y].Sa(e&f.f,a==this.G)}}d&&(a.push(b),c?b.Aa=!0:(Kf(this,a,a.length-1,"set"),tf(this)));return d};function Jf(a,b,c,d,e){var f=!1;c=Y(c);for(var g=1;g>>d.Y],b==a.G));l.Aa||tf(a);break}}return f} +function Lf(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=Ef(B);break;case 8:x="@"+Ef(B);break;case 16:7>B?x="("+Ef(B)+ +")+":(C=w.ma(u,2),x="#"+I(w,C,0,!0));break;case 24:7>B?x="@("+Ef(B)+")+":(C=w.ma(u,2),x="@#"+I(w,C,0,!0));break;case 32:x="-("+Ef(B)+")";break;case 40:x="@-("+Ef(B)+")";break;case 48:C=w.ma(u,2);x=I(w,C,0,!0)+"("+Ef(B)+")";7==B&&(x=[x,I(w,C+u.w&65535)]);break;case 56:C=w.ma(u,2),x="@"+I(w,C)+"("+Ef(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=Ef(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,Vb(d)));c&&(c+=" ");return c}function Qf(a){var b,c="";for(b=0;6>b;b++)c+=Pf(a,b);c=c+"\n"+(Pf(a,6)+Pf(a,7)+Pf(a,20));return c+=Of(a,"T")+Of(a,"N")+Of(a,"Z")+Of(a,"V")+Of(a,"C")}h.Kb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.wc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}M(d);a.i("updated registers:")}a.i(Qf(a));c&&(a.M=X(d.u[7]),Hf(a,I(a,a.M.w)))}}function Vf(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=Nf(a,b,g,f);a.i(f);a.M=b;e-=b.w-n;c++}}} +function Mf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.X&&(a.i("ended assemble at "+I(a,a.W.w)),a.M=a.W,a.X=!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 Pc=[];"call"==ye&&(jb=1E5,Pc=["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 Yb=zf(a,ia);if(Yb){var Zb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||og),Zb=of(a,za)>>>0,65536>4||1;qg--&&0<$b;){var ac=0,Qc=0,nb,Rc="",De="",ia=I(a,Yb.w);for(nb=4==mb?16:a.ia;0bc?String.fromCharCode(bc):".";$b--}lb&&(lb+="\n");lb+=ia+" "+Rc+(0==nb?" "+De:"")}lb&&a.i(lb);a.Ra=Yb}}}}break;case "e":if("else"==g[0])break;var Ra,Sc,Tc,Uc,Vc=g[0],Wc=g[1];"eb"==Vc?(Ra=1,Sc=255,Tc=a.Ua,Uc=a.mb):"e"==Vc||"ew"==Vc?(Ra=2,Sc=65535,Tc=a.ma,Uc=a.Wa):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 cc=zf(a,Wc);if(cc)for(var dc=2;dcZc;){for(var Aa=null,ug=256;65536>qb.w>>>0;){$c.w=a.ma(qb,2);if(null==qb.w||!ug--)break;if(!($c.w&1)){for(var vg=a,ec=$c,Fe=null,rb=ec.w,Ge=rb,ad=1;6>=ad&& +rb;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;b$f){if(bg(d,this.I)){this.C=new N(this,"1.30.1","failsafe");bg(this.C)&&(gg(this,d),a=2,hg(this.C));this.C.set("timestamp",sa());ig(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=fg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?bg(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),hg(d),bg(d)?(c=fg(d),e=!0):c=!1))}e&&eg(this,c?d:null)}else 2==a&&d.clear()}else eg(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&&(jg(this,this.b,b,c,a),this.b.gb());this.U&&(gg(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.F=0}; +function gg(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 Xf(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;})(); +h.ja=function(a,b,c){var d=this;switch(b){case "power":return this.J[b]=c,c.onclick=function(){d.F||(d.v.fa?Xf(d,!1,!0):dg(d,d.lb))},!0;case "reset":return this.J[b]=c,c.onclick=function(){if(d.v.fa&&!d.F)if(d.f&&!d.H){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Xf(d,a,!0);!a&&d.N?window&&window.location.reload():d.lb($f)}else d.reset(),d.b&&d.b.gb()},!0;case "save":if(fa())c.parentNode.removeChild(c);else return this.J[b]= +c,c.onclick=function(){var a=ag(d,!0);if(a){var b=!!(d.f&&!d.H||d.N),c=Xf(d,b);b?kg(d,a,c):d.na("Resume disabled, machine state not saved")}},!0}return!1}; +function ag(a,b){var c=a.g;c||((c=Ba("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=lg(a,c))||a.na("The user ID is invalid.")):b&&a.na("Browser local storage is not available"));return c} +function lg(a,b){a.g=null;b=ua(ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ca("user",b.data),a.g=b.data)}catch(d){m(d.message+" ("+c+")")}return a.g}function cg(a){var b=null;a.g&&(b=ga()+"/api/v1/user?req=load&user="+a.g+"&state="+mg(a,"1.30.1"));return b} +function kg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=mg(a,"1.30.1");d.data=c;b=ua(ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(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);Bg(a,b,c)}})}else c(a,null)} +function Cg(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&&(--ng||Sa(!0));n=!1}var g,l,n=!0;ng++;$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?zg(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,--ng||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),--ng||Sa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?zg(b,a,d,!0,e,p):Ag(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 Cg(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 b44677083..903f8be0d 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -692,141 +692,142 @@ typeof b){var n="",q;for(q in b)b.hasOwnProperty(q)&&(n&&(n+="&"),n+=q+"="+encod 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.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={}; +function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.jb=b.comment;this.Nb=b;b=this.id.indexOf(".");0>b?this.Da=this.id:(this.Ua=this.id.substr(0,b),this.Da=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Yc:!1,Zc:!1,L:!1,error:!1};this.Ma=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.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]; +g.R=function(a,b,c,d){return this.B&&this.B.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.B=a;this.m=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.m=this.g-1;this.s=this.B/this.g|0;this.la=[];this.o=[];this.Gb=[Na,Oa,Pa,Qa];a=new E(this.b);Ra(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 Oa(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 Pa(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 Qa(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)} +function Sa(a,b){if(b!=a.l){var c;if(a.l){c=(1<>>a.c;0>>a.c;0k&&(t=k);if(n&&n.size){if(n.type==d&&n.controller==e){if(f+k<=n.za)return n.Pa+=n.za-f,n.za=f,!0;if(f>=n.za+n.Pa){t=n.size-(f-q);t>k&&(t=k);n.Pa=f-n.za+t;f=q+a.g;k-=t;m++;continue}}return Ta(1,f,k)}f=new E(a.b,f,t,a.g,d,e);Ra(f,a.I,n);a.a[m++]=f;f=q+a.g;k-=t}return 0>=k?(a.status(Math.floor(c/1024)+"Kb "+Wa[d]+" at "+h(b,8,!0)),!0):Ta(2,b,c)} +function Xa(a,b){return a.a[(b&a.h)>>>a.c].Ya(b&a.m,b)}function Ya(a,b){return a.a[(b&a.h)>>>a.c].oc(b&a.m,b)}function Za(a,b,c){a.a[(b&a.h)>>>a.c].Sc(b&a.m,c&65535,b)}function $a(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 bb(a,b){a.o.push(b)}function Ta(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,Na:20,ad:0};this.a={$c:0,bb:-1}}x(G);g=G.prototype;g.oa=function(a,b,c,d){this.m=b;this.b=c;this.I=d;var e=this;this.a.bb=cb(this.b,function(){e.a.pa|=128;e.a.pa&64&&(db(e.b,0,6,64),eb(e.b,e.a.bb,1E3/60))});ab(b,this,H);bb(b,this.reset.bind(this));D(this)};g.Vb=function(){var a=this.a.pa;this.a.pa&=-129;return a};g.Ac=function(a){this.a.pa=a;a&64&&eb(this.b,this.a.bb,1E3/60);this.a.pa=a&-129}; +g.Xb=function(){var a=this.b;return a.D&62337|a.Ea<<5|a.Fa<<1};g.Cc=function(a){var b=this.b;a&=62337;if(b.D!=a){b.D=a;b.Ea=a>>5&3;b.Fa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Oa!=c&&(b.Oa=c,fb(b))}gb(this)};g.Yb=function(){var a=this.b.qa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Zb=function(){return this.b.$a};g.$b=function(){return this.b.ra};g.Dc=function(a){var b=this.b;b.ra!=a&&(b.ra=a,a&16?(b.Wa=4194303,b.Ga=3915776):(b.Wa=262143,b.Ga=253952),fb(b));gb(this)}; +function gb(a){a.c.Na=a.c.Na&-8|(a.b.Oa?a.b.ra&16?1:2:4)}g.hc=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.fc=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.gc=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.ec=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.Ub=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.Sb=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.Tb=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.Rb=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.nc=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.lc=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.mc=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.kc=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.pb=function(){return this.b.v&49152?this.b.Z[0]:this.b.f[6]};g.Bb=function(a){this.b.v&49152?this.b.Z[0]=a:this.b.f[6]=a};g.sb=function(){return this.b.f[7]};g.Eb=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.qb=function(){return 1==(this.b.v&49152)>>14?this.b.f[6]:this.b.Z[1]}; +g.Cb=function(a){1==(this.b.v&49152)>>14?this.b.f[6]=a:this.b.Z[1]=a};g.rb=function(){return 3==(this.b.v&49152)>>14?this.b.f[6]:this.b.Z[3]};g.Db=function(a){3==(this.b.v&49152)>>14?this.b.f[6]=a:this.b.Z[3]=a};g.Qb=function(a){return this.b.wb[a-65504>>1]};g.vc=function(a,b){this.b.wb[b-65504>>1]=a};g.tb=function(a){return 65520==a?61183:0};g.Fb=function(){};g.jc=function(){return 1};g.Nc=function(){};g.Pb=function(){return this.b.F};g.uc=function(){this.b.F=0};g.Wb=function(){return this.b.vb}; +g.Bc=function(a,b){b&1||(a&=255);this.b.vb=a};g.ac=function(){return this.b.ab};g.Ec=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ab=a;b.j|=2};g.ic=function(){return this.b.sa&65280};g.Mc=function(a){this.b.sa=a|255};g.bc=function(){return hb(this.b)};g.Fc=function(a){ib(this.b,a&-1809|hb(this.b)&1808);this.b.j|=128};g.reset=function(){this.c.Na=this.c.Na&-120|20;this.a.pa=0}; +var I={},H=(I[62592]=[null,null,G.prototype.hc,G.prototype.Lc,"SISDR"],I[62608]=[null,null,G.prototype.fc,G.prototype.Jc,"SDSDR"],I[62624]=[null,null,G.prototype.gc,G.prototype.Kc,"SISAR"],I[62640]=[null,null,G.prototype.ec,G.prototype.Ic,"SDSAR"],I[62656]=[null,null,G.prototype.Ub,G.prototype.zc,"KISDR"],I[62672]=[null,null,G.prototype.Sb,G.prototype.xc,"KDSDR"],I[62688]=[null,null,G.prototype.Tb,G.prototype.yc,"KISAR"],I[62704]=[null,null,G.prototype.Rb,G.prototype.wc,"KDSAR"],I[62798]=[null,null, +G.prototype.$b,G.prototype.Dc,"MMR3"],I[65382]=[null,null,G.prototype.Vb,G.prototype.Ac,"LKS"],I[65402]=[null,null,G.prototype.Xb,G.prototype.Cc,"MMR0"],I[65404]=[null,null,G.prototype.Yb,null,"MMR1"],I[65406]=[null,null,G.prototype.Zb,null,"MMR2"],I[65408]=[null,null,G.prototype.nc,G.prototype.Rc,"UISDR"],I[65424]=[null,null,G.prototype.lc,G.prototype.Pc,"UDSDR"],I[65440]=[null,null,G.prototype.mc,G.prototype.Qc,"UISAR"],I[65456]=[null,null,G.prototype.kc,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.pb,G.prototype.Bb,G.prototype.pb,G.prototype.Bb, +"R6KERNEL"],I[65479]=[G.prototype.sb,G.prototype.Eb,G.prototype.sb,G.prototype.Eb,"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.qb,G.prototype.Cb,G.prototype.qb,G.prototype.Cb,"R6SUPER"],I[65487]=[G.prototype.rb,G.prototype.Db,G.prototype.rb,G.prototype.Db,"R6USER"],I[65504]=[null,null,G.prototype.Qb,G.prototype.vc,"CTRL",1170],I[65520]=[null,null,G.prototype.tb,G.prototype.Fb,"LSIZE",1170],I[65522]=[null,null,G.prototype.tb,G.prototype.Fb,"HSIZE",1170],I[65524]=[null,null,G.prototype.jc,G.prototype.Nc,"SYSID",1170],I[65526]=[null,null,G.prototype.Pb,G.prototype.uc, +"CPUERR",1170],I[65528]=[null,null,G.prototype.Wb,G.prototype.Bc,"MB",1170],I[65530]=[null,null,G.prototype.ac,G.prototype.Ec,"PIR"],I[65532]=[null,null,G.prototype.ic,G.prototype.Mc,"SL"],I[65534]=[null,null,G.prototype.bc,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;n>1),this.a=new Int32Array(this.c,0,d>>2),pb(this,lb?qb:rb);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.Ab(a,b,c)},ja:function(a,b,c){this.h||this.ka(a,b,c)},D:function(a){return this.g[a]},J:function(a){return this.g[a]},O:function(a){a&1&&F(this.b,4);return this.m.getUint16(a,!0)},$:function(a){a&1&&F(this.b,4);return this.o[a>>1]},ba:function(a,b){this.g[a]=b;this.ma=!0},da:function(a,b){this.g[a]=b;this.ma=!0},ia:function(a,b){a&1&&F(this.b,4);this.m.setUint16(a,b,!0);this.ma=!0},ta:function(a,b){a&1&&F(this.b,4);this.o[a>> +1]=b;this.ma=!0}};function Ra(a,b,c){a.I=b;a.w=a.l=0;c&&((a.w=c.w)&&tb(a,ub,!1),(a.l=c.l)&&vb(a,ub,!1))}function vb(a,b,c){c&&a.l||(a.Qa=!a.h&&b[1]||a.B,a.Sc=!a.h&&b[3]||a.A);if(c||void 0===c)a.Ab=b[1]||a.B,a.ka=b[3]||a.A}function tb(a,b,c){c&&a.w||(a.Ya=b[0]||a.s,a.oc=b[2]||a.u);if(c||void 0===c)a.H=b[0]||a.s,a.Y=b[2]||a.u}function pb(a,b){b||(b=wb);tb(a,b,void 0);vb(a,b,void 0)} +var wb=[],sb=[E.prototype.N,E.prototype.ea,E.prototype.aa,E.prototype.ua],ub=[E.prototype.G,E.prototype.ca,E.prototype.S,E.prototype.ja];if(Ja)var rb=[E.prototype.D,E.prototype.ba,E.prototype.O,E.prototype.ia],qb=[E.prototype.J,E.prototype.da,E.prototype.$,E.prototype.ta]; +function xb(a,b){v.call(this,"CPU",a,xb);var c=a.multiplier||1;this.Ja=a.cycles||b;this.da=c;this.Va=Math.round(this.Ja/1E4)/100;this.ia=this.Va*this.da;this.i.V=!1;this.i.xb=!1;this.i.Aa=a.autoStart;this.i.cb=!1;this.i.La=!1;this.Ca=this.ja=0;this.Ia=a.csStart;this.ta=a.csInterval;this.ua=a.csStop;this.J=[];this.mb=this.sc.bind(this);D(this)}x(xb);var yb=["power","reset"];g=xb.prototype; +g.oa=function(a,b,c,d){this.B=a;this.m=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.B)if(a=d.B,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.Va*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)}Fb(a,a.Y);a.Y=0;a.S=ja();a.ba=0;Gb(a)}function cb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function eb(a,b,c){0<=b&&ba.J[b][0]&&(c*=a.Ja*a.da/1E3,a.J[b][0]=c)} +g.sc=function(){if(this.i.V){this.Xa>=this.Ja&&Gb(this,!0);this.ya=0;this.Ha=ja();if(this.ba){var a=this.Ha-this.ba;a>this.kb&&(this.S+=a,this.S>this.Ha&&(this.S=this.Ha))}try{do{for(var b,c=this.i.La?1:this.Ka,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.yb(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.ya+=f;this.Y+=f;Fb(this,0,!0);a=f;if(this.i.La){var n= +!1;this.Ca=this.Ca+this.fb()|0;this.ja-=a;0>=this.ja&&(this.ja+=this.ta,n=!0);0<=this.ua&&this.ua<=Hb(this)&&(this.ta=this.ua=-1,Bb(this),L(this),n=!0);n&&this.M(Hb(this)+" cycles: checksum="+h(this.Ca))}this.xa-=f;if(0>=this.xa){this.xa+=this.Ka;15<=++this.lb&&(this.B&&this.B.wa(),this.lb=0);break}}while(this.i.V)}catch(q){L(this);Cb(this);this.B&&this.B.stop(ja(),Hb(this));b=q.stack||q.message;this.i.error=!0;this.K(b);return}if(this.i.V){b=setTimeout;c=this.mb;this.ba=ja();d=this.kb;this.ya&&(d= +Math.round(d*this.ya/this.Ka));d-=this.ba-this.Ha;if(e=this.ba-this.S)this.aa=Math.round(this.Y/(10*e))/100,864E5<=e&&(this.ea=0,Eb(this));if(0>d||this.aad&&(this.S-=d),d=0;this.Xa+=this.ya;this.ba+=d;b(c,d)}}};function Db(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{Eb(a);a.i.V=!0;a.i.xb=!0;if(b=a.w.run)b.textContent="Halt";a.B&&a.B.start(a.S,Hb(a));Cb(a,!0);setTimeout(a.mb,0)}}g.yb=function(){return 0}; +function L(a){if(a.i.V){a.ca-=a.a;a.a=0;Fb(a,a.Y);a.Y=0;a.i.V=!1;var b=a.w.run;b&&(b.textContent="Run");a.B&&a.B.stop(ja(),Hb(a));Cb(a)}a.i.complete=void 0}function Cb(a,b){a.B&&a.B.wa(b)} +function Ib(a){this.Mb=+a.model||1170;this.Ob=a.resetAddr||0;xb.call(this,a,6666667);this.gb=0;this.decode=Jb.bind(this);this.o=65536;this.h=32768;this.l=65535;this.s=32768;this.v=15;this.f=[0,0,0,0,0,0,0,this.Ob];this.va=[0,0,0,0,0,0];this.Z=[0,0,0,0];this.Fa=this.A=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.wb=[0,0,0,0,0,0,0,0];this.g=this.c=this.Ta=this.G=this.H=this.j=this.vb=0;this.ka=-1;Kb(this);this.i.complete=this.i.Hb=!1}x(Ib,xb);g=Ib.prototype;g.hb=function(){fb(this)};g.reset=function(){this.i.V&&L(this);Kb(this);Ab(this);this.i.error=!1;this.parent.reset.call(this)}; +function Kb(a){a.sa=255;a.F=0;a.ab=0;a.D=0;a.qa=0;a.$a=0;a.ra=0;a.Oa=0;a.Ea=0;a.Wa=262143;a.Ga=253952;a.u=[];a.j|=2;a.m&&fb(a)}function fb(a){a.Oa?(a.$=65536,a.N=a.Kb,a.O=a.ub,a.nb=a.Uc,Sa(a.m,a.ra&16?22:18)):(a.$=0,a.N=a.Jb,a.O=a.pc,a.nb=a.Tc,Sa(a.m,16))}g.fb=function(){return 0};g.save=function(){var a=new M(this);a.set(0,[]);a.set(1,[this.ea,this.da]);a.set(2,$a(this.m));return a.data()}; +g.restore=function(a){var b=a[1];this.ea=b[1];Eb(this,b[3]);a:{b=this.m;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,ob:c<<5&224,zb:d,Ra:e})}a.j|=2}function hb(a){return a.v=a.v&63728|a.na()|(a.l&65535?0:4)|(a.h&32768?2:0)|N(a)} +function ib(a,b){a.s=b<<12;a.l=~b&4;a.h=b<<14;a.o=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.A=b>>14&3;c=a.v>>14&3;a.A!=c&&(a.Z[c]=a.f[6],a.f[6]=a.Z[a.A]);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.o=b,a.h=c||0)}function Mb(a,b,c,d){a.j&128||(a.s=a.l=a.o=b,a.h=(c^b)&(d^b))}function Q(a,b){a.j&128||(a.s=a.l=a.o=b,a.h=a.s^a.o>>1)}function Nb(a,b,c,d){a.j&128||(a.s=a.l=a.o=b,a.h=(c^d)&(d^b))} +function F(a,b){var c=!1;0>a.ka?a.ka=hb(a):a.A||(b=4,c=!0);a.D&57344||(a.qa=63222,a.$a=b);a.A=0;var d=a.O(b|a.$),e=a.O(b+2&65535|a.$);ib(a,e&-12289|a.ka>>2&12288);c&&(a.F|=4,a.f[6]=4);Ob(a,a.ka);Ob(a,a.f[7]);a.f[7]=d&65535;a.j&=-113;a.ka=-1;throw b;}function Pb(a){var b=Qb(a),c=Qb(a)&-1793;a.v&49152&&(c=c&-225|a.v&63712);a.f[7]=b&65535;ib(a,c);a.j&=-17} +function Rb(a,b,c){var d,e,f,k=0;d=b>>13;a.ra&a.Lb[a.A]||(d&=7);e=a.C[a.A][d];f=(a.P[a.A][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var m=f>>13&31;31>m?a.ra&32&&(f=a.tc[m]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ga&&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.A][d]=e;if(4194170!==f||a.A)a.Ea=a.A,a.Fa=d;k&&(k&57344&&(0<=a.ka&&(k|=128),a.D&57344||(a.D=a.D|k|a.Ea<<5|a.Fa<<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=Lb(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=Lb(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.A&&d&4&&0>=f&&(a.f[6]<=a.sa||65534<=a.f[6])&&(a.f[6]<=a.sa-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 Sb(this,a,b,c)};g.Kb=function(a,b,c){return Rb(this,Sb(this,a,b,c),c)};g.pc=function(a){return Ya(this.m,a)};g.ub=function(a){return Ya(this.m,Rb(this,a,2))}; +g.Tc=function(a,b){Za(this.m,a,b&65535)};g.Uc=function(a,b){Za(this.m,Rb(this,a,4),b)};function Tb(a,b,c){var d=a.c=b&7;(b=a.g=(b&56)>>3)?(d=Sb(a,b,d,2),c&65536||61440!==(a.v&61440)&&(d&=65535),a.A=a.v>>12&3,c=a.O(d|c&a.$),a.A=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 Ub(a,b,c,d){a.D&57344||(a.qa=22);var e=a.c=b&7;(b=a.g=(b&56)>>3)?(e=Sb(a,b,e,4),c&65536||(e&=65535),a.A=a.v>>12&3,e=Rb(a,e|c&65536,4),a.A=a.v>>14&3,Za(a.m,e,d)):6!=e||(a.v>>2&12288)===(a.v&12288)?a.f[e]=d:a.Z[a.v>>12&3]=d}function Vb(a,b){b>>=6;var c=a.H=b&7;(b=a.G=(b&56)>>3)?(c=a.N(b,c,3),a=Xa(a.m,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)?Ya(a.m,a.N(b,c,2)):a.f[c]}function Wb(a,b){var c=a.c=b&7;b=a.g=(b&56)>>3;return Sb(a,b,c,8)} +function Xb(a,b){var c=a.c=b&7;(b=a.g=(b&56)>>3)?(c=a.N(b,c,3),a=Xa(a.m,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)?Ya(a.m,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.Ta=a.N(b,e,7),c=d.call(a,c,Xa(a.m,e)),e&1&&a.a--,a=a.m,a.a[(e&a.h)>>>a.c].Qa(e&a.m,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),Za(a.m,e,d.call(a,c,Ya(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])} +function Yb(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.m,a.a[(d&a.h)>>>a.c].Qa(d&a.m,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 Zb(a,b,c){var d=a.c=b&7;(b=a.g=(b&56)>>3)?Za(a.m,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.yb=function(a){this.i.complete=!0;this.i.Hb=!1;this.i.xb=!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.ab&224,c=this.u.length;0<=--c;){if(0b&&(b=this.u[c].ob,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.zb):F(this,160))}else this.j&1&&this.j++;this.D&57344||(this.qa=0,this.$a=this.f[7]);this.j=this.j&7|this.v&16;this.decode(Lb(this))}while(0>1|b<<16;Q(this,a);return a&65535}function ec(a,b){a=b&2048|b>>1|b<<8;Q(this,a<<8);return a&255}function fc(a,b){a=b&~a;O(this,a);return a}function gc(a,b){a=b&~a;O(this,a<<8);return a}function hc(a,b){a|=b;O(this,a);return a}function ic(a,b){a|=b;O(this,a<<8);return a}function jc(a,b){a=~b|65536;P(this,a);return a&65535} +function kc(a,b){a=~b|256;P(this,a<<8);return a&255}function lc(a,b){a=b-a;this.j&128||(this.s=this.l=a,this.h=b&(b^a));return a&65535}function mc(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 nc(a,b){a=b+a;this.j&128||(this.s=this.l=a,this.h=a&(b^a));return a&65535}function oc(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 pc(a,b){a=-b;P(this,a,a&b&32768);return a&65535} +function qc(a,b){a=-b;P(this,a<<8,(a&b&128)<<8);return a&255}function rc(a,b){a=b<<1|this.o>>16&1;Q(this,a);return a&65535}function sc(a,b){a=b<<1|this.o>>16&1;Q(this,a<<8);return a&255}function tc(a,b){a=(this.o&65536|b)>>1|b<<16;Q(this,a);return a&65535}function uc(a,b){a=((this.o&65536)>>8|b)>>1|b<<8;Q(this,a<<8);return a&255}function vc(a,b){var c=b-a;Nb(this,c,a,b);return c&65535}function wc(a,b){var c=b-a;Nb(this,c<<8,a<<8,b<<8);return c&255} +function xc(a,b){this.j&128||(this.s=this.l=b&65280,this.h=this.o=0);return(b<<8|b>>8)&65535}function yc(a,b){a^=b;O(this,a);return a&65535}function zc(a){var b=S(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.o=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 Ac(a){var b=S(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.o=this.h=0;b&=63;if(b&32){b=64-b;32>b-1;this.o=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.o=0);a&2&&(this.h=0);a&4&&(this.l=1);a&8&&(this.s=0);this.a-=5} +function Bc(a){var b=S(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.o=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.o=65536,this.a-=7}var Cc=[0,7,7,10,7,11,9,13];function Dc(a){var b=this.a;a=Wb(this,a);this.f[7]=a&65535;this.a=b-Cc[this.g]} +var Ec=[0,14,14,17,14,18,16,20];function Fc(a){var b=this.a,c=Wb(this,a);a=a>>6&7;Ob(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Ec[this.g]}var Gc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Hc=[7,13,13,17,14,18,17,21];function Ic(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.o=-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 Lc(a){U(this,a,0,xc);this.a-=this.g?9:3+(7==this.c?2:0)}function Mc(a){U(this,a,R(this,a),yc);this.a-=this.g?9:3+(7==this.c?2:0)}function Y(){F(this,8)}function Jb(a){Nc[a>>12].call(this,a)} +var Nc=[function(a){Oc[a>>8&15].call(this,a)},function(a){var b=R(this,a),c=this.a;O(this,Zb(this,a,b));this.a=c-Gc[(this.G?8:0)+this.g]+(7!=this.c||this.g?0:2)},function(a){var b=R(this,a);a=S(this,a);Nb(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),fc);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),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),$b);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){Pc[a>>8&15].call(this,a)},function(a){Qc[a>>8&15].call(this,a)},function(a){var b=Vb(this,a);O(this,Yb(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=Vb(this,a)<<8;a=Xb(this,a)<<8;Nb(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,(Vb(this,a)&Xb(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,Vb(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){T(this,a,Vb(this,a),ic);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),vc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},Y],Oc=[function(a){Rc[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))},Fc,Fc,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)},function(a){Vc[a>> +6&3].call(this,a)},Y,Y],Sc=[function(a){P(this,Zb(this,a,0));this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,jc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,1,nc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,1,lc);this.a-=this.g?9:3+(7==this.c?2:0)}],Tc=[function(a){U(this,a,0,pc);this.a-=this.g?11:6},function(a){U(this,a,N(this)?1:0,$b);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,N(this)?1:0,vc);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)}],Uc=[function(a){U(this,a,0,tc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,rc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,dc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,bc);this.a-=this.g?9:3+(7==this.c?2:0)}],Vc=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.ub(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=Tb(this,a,0);Ob(this,a);O(this,a);this.a-= +11},function(a){var b=Qb(this),c=this.a;Ub(this,a,0,b);O(this,b);this.a=c-Hc[this.g]},function(a){O(this,Zb(this,a,this.na?65535:0));this.a-=this.g?9:3+(7==this.c?2:0)}],Rc=[function(a){Wc[a&15].call(this,a)},Y,Y,Y,Dc,Dc,Dc,Dc,function(a){if(a&8)F(this,8);else{var b=Qb(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){Xc[a&15].call(this,a)},function(a){Yc[a&15].call(this,a)},Lc,Lc, +Lc,Lc],Wc=[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(){Pb(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||(Kb(this),this.m.reset());this.a-=667},function(){Pb(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Xc=[Jc,function(){this.o=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],Yc=[Jc,function(){this.o=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],Pc=[Ic,Ic,Bc,Bc,zc,zc,Ac,Ac,Mc,Mc,Y,Y,Y,Y,Kc,Kc],Qc=[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){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)},function(a){bd[a>>6&3].call(this,a)},Y,Y],Zc=[function(a){P(this,Yb(this,a,0));this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,0,kc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,1,oc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,1,mc);this.a-=this.g? +9:3+(7==this.c?2:0)}],$c=[function(a){T(this,a,0,qc);this.a-=this.g?11:6},function(a){T(this,a,N(this)?1:0,ac);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,N(this)?1:0,wc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){a=Xb(this,a);P(this,a<<8);this.a-=this.g?4:3+(7==this.c?2:0)}],ad=[function(a){T(this,a,0,uc);this.a-=this.g?9+(this.Ta&1):3+(7==this.c?2:0)},function(a){T(this,a,0,sc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,0,ec);this.a-=this.g?9+(this.Ta&1):3+(7==this.c? +2:0)},function(a){T(this,a,0,cc);this.a-=this.g?9:3+(7==this.c?2:0)}],bd=[Y,function(a){a=Tb(this,a,65536);Ob(this,a);O(this,a);this.a-=11},function(a){var b=Qb(this),c=this.a;Ub(this,a,65536,b);O(this,b);this.a=c-Hc[this.g]},Y]; +function cd(a){v.call(this,"ROM",a,cd);this.a=null;this.o=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){dd(c,a,b,f)})}}x(cd);cd.prototype.oa=function(a,b,c,d){this.m=b;this.b=c;this.I=d;ed(this)};cd.prototype.ha=function(){this.l&&(this.I&&this.I.a(this.id,this.o,this.c,this.l),delete this.l);return!0}; +cd.prototype.ga=function(){return!0}; +function dd(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Ua,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].Ab(e&d.m,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.Da)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.Ua+"."+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(){jd(this)};g.save=function(){var a=new M(this);a.set(0,[]);return a.data()};g.restore=function(){return jd(this)};function jd(a){a.G=0;a.a=0;a.c=128;a.h=[];return!0}g.Za=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.o%a,this.H&&(b=" ".slice(0,c)));this.A&&!this.o&&c&&(b=String.fromCharCode(this.A)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=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;db(this.b,100,4,52,this.D)}};var kd={},id=(kd[65392]=[null,null,Z.prototype.dc,Z.prototype.Hc,"RCSR"],kd[65394]=[null,null,Z.prototype.cc,Z.prototype.Gc,"RBUF"],kd[65396]=[null,null,Z.prototype.rc,Z.prototype.Wc,"XCSR"],kd[65398]=[null,null,Z.prototype.qc,Z.prototype.Vc,"XBUF"],kd);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;bnd){if(pd(d,this.u)){this.l=new M(this,"1.30.1","failsafe");pd(this.l)&&(ud(this,d),a=2,vd(this.l));this.l.set("timestamp",ka());wd(this.l);var e=this.a&&!this.o;if(1==a||la("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=td(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?pd(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),vd(d),pd(d)?(c=td(d),e=!0):c=!1))}e&&sd(this,c?d:null)}else 2==a&&d.clear()}else sd(this);delete this.u;delete this.B}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&&(xd(this,this.b,b,c,a),this.b.Aa());this.G&&(ud(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.g=0}; +function ud(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 yd(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;})(); +g.R=function(a,b,c){var d=this;switch(b){case "power":return this.w[b]=c,c.onclick=function(){d.g||(d.i.L?yd(d,!1,!0):rd(d,d.Ba))},!0;case "reset":return this.w[b]=c,c.onclick=function(){if(d.i.L&&!d.g)if(d.a&&!d.s){var a=la("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");yd(d,a,!0);!a&&d.D?window&&window.location.reload():d.Ba(nd)}else d.reset(),d.b&&d.b.Aa()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.w[b]= +c,c.onclick=function(){var a=od(d,!0);if(a){var b=!!(d.a&&!d.s||d.D),c=yd(d,b);b?zd(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1}; +function od(a,b){var c=a.c;c||((c=oa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Ad(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c} +function Ad(a,b){a.c=null;b=l(ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(pa("user",b.data),a.c=b.data)}catch(d){p(d.message+" ("+c+")")}return a.c}function qd(a){var b=null;a.c&&(b=ea()+"/api/v1/user?req=load&user="+a.c+"&state="+Bd(a,"1.30.1"));return b} +function zd(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Bd(a,"1.30.1");d.data=c;b=l(ea()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(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);Fd(a,b,c)}})}else c(a,null)} +function Gd(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&&(--Cd||wa(!0));n=!1}var k,m,n=!0;Cd++;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?Dd(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,--Cd||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),--Cd||wa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Dd(b,a,d,!0,e,q):Ed(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 Gd(a,b,c,d)};window.enableEvents=wa;window.sendEvent=xa;})();