diff --git a/apps/pdp11/tapes/diags/README.md b/apps/pdp11/tapes/diags/README.md index de513d4a4..8f903d4f7 100644 --- a/apps/pdp11/tapes/diags/README.md +++ b/apps/pdp11/tapes/diags/README.md @@ -256,7 +256,7 @@ MD-11 11/70 CPU EXERCISER ------------------------- When started in a [PDP-11/70](/devices/pdp11/machine/1170/panel/debugger/cpuexer/) with no disk drives attached, -this diagnostic displays the following startup information: +this diagnostic displays the following startup information ("EXERCISOR" is DEC's typo, not mine): MAINDEC-11-DEQKC-B...PDP 11/70 CPU EXERCISOR OPT.CP=145406 diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index b1a63e8ed..c611ba1a9 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -1221,6 +1221,7 @@ CPUPDP11.prototype.stopCPU = function(fComplete) this.cmp.stop(usr.getTime(), this.getCycles()); } fStopped = true; + if (!this.dbg) this.status("Stopped"); } this.flags.complete = fComplete; return fStopped; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 88fe8b682..09808b041 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -161,8 +161,8 @@ CPUStatePDP11.prototype.initProcessor = function() * finish() * * TODO: This function simply ensures that we don't leave any IRQs installed with unresolved floating - * (negative) vectors; properly assigning vectors according to device type (ie, auto-configuration) is an - * exercise left for another day. + * (negative) vectors; however, properly assigning vectors according to device type (ie, auto-configuration) + * is an exercise left for another day. * * @this {CPUStatePDP11} */ @@ -185,7 +185,7 @@ CPUStatePDP11.prototype.finish = function() */ CPUStatePDP11.prototype.reset = function() { - this.status("model " + this.model); + this.status("Model " + this.model); if (this.flags.running) this.stopCPU(); this.initRegs(); this.resetCycles(); @@ -220,8 +220,7 @@ CPUStatePDP11.prototype.initRegs = function() this.regsAltStack = [ // Alternate R6 stack pointers (KERNEL, SUPER, UNUSED, USER) 0, 0, 0, 0 ]; - this.mmuMode = 0; // current memory management mode (see PDP11.MODE.KERNEL | SUPER | UNUSED | USER) - this.mmuLastPage = 0; + this.pswMode = 0; // current memory management mode (see PDP11.MODE.KERNEL | SUPER | UNUSED | USER) this.mapMMR3 = [4,2,0,1]; // map from mode to MMR3 I/D bit this.mmuPDR = [ // memory management PDR registers by mode [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // KERNEL (8 KIPDR regs followed by 8 KDPDR regs) @@ -257,8 +256,9 @@ CPUStatePDP11.prototype.initRegs = function() this.srcMode = this.srcReg = 0; this.dstMode = this.dstReg = this.dstAddr = 0; - this.trapPSW = -1; - this.resetMMU(); + this.pswTrap = -1; + + this.resetRegs(); }; /** @@ -269,25 +269,30 @@ CPUStatePDP11.prototype.initRegs = function() CPUStatePDP11.prototype.resetCPU = function() { this.bus.reset(); - this.resetMMU(); + this.resetRegs(); }; /** - * resetMMU() + * resetRegs() + * + * Reset all registers required as part of a RESET instruction. + * + * TODO: Do we ever need to automatically clear regErr, or is it cleared manually? * * @this {CPUStatePDP11} */ -CPUStatePDP11.prototype.resetMMU = function() +CPUStatePDP11.prototype.resetRegs = function() { this.regMMR0 = 0; // 177572 this.regMMR1 = 0; // 177574 this.regMMR2 = 0; // 177576 this.regMMR3 = 0; // 172516 - this.regErr = 0; // 177766 TODO: Do we ever need to automatically clear this, or is it manually cleared? + this.regErr = 0; // 177766 this.regPIR = 0; // 177772 this.regSL = 0xff; // 177774 this.mmuEnable = 0; // MMU enabled for PDP11.ACCESS.READ or PDP11.ACCESS.WRITE this.mmuLastMode = 0; + this.mmuLastPage = 0; this.mmuMask = 0x3ffff; this.addrLast = 0; // this is queried by the Panel when it's not using its own ADDRESS register @@ -317,8 +322,8 @@ CPUStatePDP11.prototype.getMMUState = function() /** * setMemoryAccess() * - * Define handlers and DSPACE setting appropriate for the current MMU mode, in order to eliminate - * unnecessary calls to mapVirtualToPhysical(). + * Define handlers and DSPACE setting appropriate for the current MMU mode, in order to eliminate unnecessary calls + * to mapVirtualToPhysical(). * * TODO: We could further optimize readWord(), splitting it into readWordFromDSpace() and readWordFromISpace(), * eliminating the need to OR the addrDSpace bit when we know that bit is zero, but that's a pretty tiny optimization. @@ -389,14 +394,12 @@ CPUStatePDP11.prototype.setMMR0 = function(newMMR0) * NOTE: We are not protecting the read-only state of the COMPLETED bit here; that's handled by writeMMR0(). */ this.regMMR0 = newMMR0; - this.mmuLastMode = (newMMR0 >> 5) & 3; - this.mmuLastPage = (newMMR0 >> 1) & 0xf; + this.mmuLastMode = (newMMR0 & PDP11.MMR0.MODE) >> PDP11.MMR0.SHIFT.MODE; + this.mmuLastPage = (newMMR0 & PDP11.MMR0.PAGE) >> PDP11.MMR0.SHIFT.PAGE; var mmuEnable = 0; - if (newMMR0 & 0x101) { + if (newMMR0 & (PDP11.MMR0.ENABLED | PDP11.MMR0.MAINT)) { mmuEnable = PDP11.ACCESS.WRITE; - if (newMMR0 & 0x1) { - mmuEnable |= PDP11.ACCESS.READ; - } + if (newMMR0 & PDP11.MMR0.ENABLED) mmuEnable |= PDP11.ACCESS.READ; } if (this.mmuEnable != mmuEnable) { this.mmuEnable = mmuEnable; @@ -528,7 +531,33 @@ CPUStatePDP11.prototype.getChecksum = function() CPUStatePDP11.prototype.save = function() { var state = new State(this); - state.set(0, []); + state.set(0, [ + this.regsGen, + this.regsAlt, + this.regsAltStack, + this.regsUniMap, + this.regsControl, + this.regErr, + this.regMB, + this.regPIR, + this.regSL, + this.getPSW(), + this.pswTrap, + this.pswMode, + this.opFlags, + this.regMMR0, + this.regMMR1, + this.regMMR2, + this.regMMR3, + this.mmuLastMode, + this.mmuLastPage, + this.mmuPDR, + this.mmuPAR, + this.mmuEnable, + this.mmuMask, + this.addrLast, + this.opLast + ]); state.set(1, [this.nTotalCycles, this.getSpeed()]); state.set(2, this.bus.saveMemory()); return state.data(); @@ -1106,14 +1135,14 @@ CPUStatePDP11.prototype.setPSW = function(newPSW) this.regsAlt[i] = tmp; } } - this.mmuMode = (newPSW >> PDP11.PSW.SHIFT.CMODE) & PDP11.MODE.MASK; + this.pswMode = (newPSW >> PDP11.PSW.SHIFT.CMODE) & PDP11.MODE.MASK; var oldMode = (this.regPSW >> PDP11.PSW.SHIFT.CMODE) & PDP11.MODE.MASK; - if (this.mmuMode != oldMode) { + if (this.pswMode != oldMode) { /* * Swap stack pointers */ this.regsAltStack[oldMode] = this.regsGen[6]; - this.regsGen[6] = this.regsAltStack[this.mmuMode]; + this.regsGen[6] = this.regsAltStack[this.pswMode]; } this.regPSW = newPSW; @@ -1337,9 +1366,9 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason) if (this.nDisableTraps) return; - if (this.trapPSW < 0) { - this.trapPSW = this.getPSW(); - } else if (!this.mmuMode) { + if (this.pswTrap < 0) { + this.pswTrap = this.getPSW(); + } else if (!this.pswMode) { reason = PDP11.REASON.RED; // double-fault (nested trap) forces a RED condition } @@ -1374,16 +1403,16 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason) /* * Read from kernel D space */ - this.mmuMode = 0; + this.pswMode = 0; var newPC = this.readWord(vector | this.addrDSpace); var newPSW = this.readWord(((vector + 2) & 0xffff) | this.addrDSpace); /* * Set new PSW with previous mode */ - this.setPSW((newPSW & ~PDP11.PSW.PMODE) | ((this.trapPSW >> 2) & PDP11.PSW.PMODE)); + this.setPSW((newPSW & ~PDP11.PSW.PMODE) | ((this.pswTrap >> 2) & PDP11.PSW.PMODE)); - this.pushWord(this.trapPSW); + this.pushWord(this.pswTrap); this.pushWord(this.regsGen[7]); this.setPC(newPC); } @@ -1428,7 +1457,7 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason) this.opFlags &= ~(flag | PDP11.OPFLAG.TRAP_TF | PDP11.OPFLAG.IRQ_MASK); this.opFlags |= PDP11.OPFLAG.IRQ_DELAY | PDP11.OPFLAG.TRAP_LAST; - this.trapPSW = -1; // reset flag that we have a trap within a trap + this.pswTrap = -1; // reset flag that we have a trap within a trap /* * These next properties (in conjunction with setting PDP11.OPFLAG.TRAP_LAST) are purely an aid for the Debugger; @@ -1539,55 +1568,88 @@ CPUStatePDP11.prototype.mapUnibus = function(addr) return addr; }; +/** + * getAddrInfo(addrVirtual) + * + * @this {CPUStatePDP11} + * @param {number} addrVirtual + * @return {Array} + */ +CPUStatePDP11.prototype.getAddrInfo = function(addrVirtual) +{ + var addr; + var a = []; + + if (!this.mmuEnable) { + addr = addrVirtual & 0xffff; + if (addr >= BusPDP11.IOPAGE_16BIT) addr |= this.addrIOPage; + a.push(addr); + } + else { + var mode = this.pswMode << 1; + var page = addrVirtual >> 13; + if (page > 7) mode |= 1; + if (!(this.regMMR3 & this.mapMMR3[this.pswMode])) page &= 7; + var pdr = this.mmuPDR[this.pswMode][page]; + var off = addrVirtual & 0x1fff; + var paf = (this.mmuPAR[this.pswMode][page] << 6); + addr = (paf + off) & this.mmuMask; + if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.mapUnibus(addr); + a.push(addr); // a[0] + a.push(off); // a[1] + a.push(mode); // a[2] (0=KI, 1=KD, 2=SI, 3=SD, 4=??, 5=??, 6=UI, 7=UD) + a.push(page & 7); // a[3] + a.push(paf); // a[4] + a.push(this.mmuMask); // a[5] + } + return a; +}; + /** * mapVirtualToPhysical(addrVirtual, access) * - * mapVirtualToPhysical() does memory management. It converts a 17-bit I/D virtual address to a - * 22-bit physical address. A real PDP 11/70 memory management unit can be enabled separately - * for read and write for diagnostic purposes. This is handled here by having an enable mask - * (mmuEnable) which is tested against the operation access mask (access). If there is no - * match, then the virtual address is simply mapped as a 16 bit physical address with the upper - * page going to the IO address space. Significant access mask values used are PDP11.ACCESS.READ - * and PDP11.ACCESS.WRITE. + * mapVirtualToPhysical() does memory management. It converts a 17-bit I/D virtual address to a + * 22-bit physical address. A real PDP 11/70 memory management unit can be enabled separately for + * read and write for diagnostic purposes. This is handled here by having an enable mask (mmuEnable) + * which is tested against the operation access mask (access). If there is no match, then the virtual + * address is simply mapped as a 16 bit physical address with the upper page going to the IO address + * space. Significant access mask values used are PDP11.ACCESS.READ and PDP11.ACCESS.WRITE. * - * As an aside it turns out that it is the memory management unit that does odd address and - * non-existent memory trapping: who knew? :-) I thought these would have been handled at - * access time. - * - * When doing mapping, mmuMode is used to decide what address space is to be used (0 = kernel, - * 1 = supervisor, 2 = illegal, 3 = user). Normally, mmuMode is set by the setPSW() function, - * but there are exceptions for instructions which move data between address spaces (MFPD, MFPI, - * MTPD, and MTPI) and trap(). These will modify mmuMode outside of setPSW() and then restore - * it again if all worked. If however something happens to cause a trap then no restore is - * done as setPSW() will have been invoked as part of the trap, which will resynchronize mmuMode. + * When doing mapping, pswMode is used to decide what address space is to be used (0 = kernel, + * 1 = supervisor, 2 = illegal, 3 = user). Normally, pswMode is set by the setPSW() function, but + * there are exceptions for instructions which move data between address spaces (MFPD, MFPI, MTPD, + * and MTPI) and trap(). These will modify pswMode outside of setPSW() and then restore it again if + * all worked. If however something happens to cause a trap then no restore is done as setPSW() + * will have been invoked as part of the trap, which will resynchronize pswMode. * * A PDP-11/70 is different from other PDP-11s in that the highest 18 bit space (017000000 & above) - * maps directly to UNIBUS space - including low memory. This doesn't appear to be particularly - * useful as it restricts maximum system memory - although it does appear to allow software - * testing of the UNIBUS map. This feature also appears to confuse some OSes which test consecutive - * memory locations to find maximum memory -- and on a full memory system find themselves accessing - * low memory again at high addresses. + * maps directly to UNIBUS space - including low memory. This doesn't appear to be particularly useful + * as it restricts maximum system memory - although it does appear to allow software testing of the + * UNIBUS map. This feature also appears to confuse some OSes which test consecutive memory locations + * to find maximum memory -- and on a full memory system find themselves accessing low memory again at + * high addresses. * * Construction of a Physical Address * ---------------------------------- * * Virtual Addr (VA) 12 11 10 9 8 7 6 5 4 3 2 1 0 - * Page Addr Field (PAF) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - * + ----------------------------------------------------------------- - * Physical Addr (PA) 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + * + Page Addr Field (PAF) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + * ----------------------------------------------------------------- + * = Physical Addr (PA) 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 * - * The Page Address Field (PAF) comes from a Page Address Register (PAR) that is selected by Virtual Address (VA) - * bits 15-13. You can see from the above alignments that the VA contributes to the low 13 bits, providing an 8Kb - * range. + * The Page Address Field (PAF) comes from a Page Address Register (PAR) that is selected by Virtual + * Address (VA) bits 15-13. You can see from the above alignments that the VA contributes to the low + * 13 bits, providing an 8Kb range. * * VA bits 0-5 pass directly through to the PA; those are also called the DIB (Displacement in Block) bits. * VA bits 6-12 are added to the low 7 bits of the PAF and are also called the BN (Block Number) bits. * - * You can also think of the entire PAF as a block number, where each block is 64 bytes. This is consistent with - * the LSIZE register at 177760, which is supposed to contain the number of 64-byte blocks of memory installed. + * You can also think of the entire PAF as a block number, where each block is 64 bytes. This is consistent + * with the LSIZE register at 177760, which is supposed to contain the block number of the last 64-byte block + * of memory installed. * - * Note that if a PAR is initialized to zero, successively adding 0200 (0x80) to the PAR will advance the base - * physical address to the next 8Kb page. + * Note that if a PAR is initialized to zero, successively adding 0200 (0x80) to the PAR will advance the + * base physical address to the next 8Kb page. * * @this {CPUStatePDP11} * @param {number} addrVirtual @@ -1599,7 +1661,7 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(addrVirtual, access) var page, pdr, addr; /* - * This can happen when the DSTMODE (MAINT) bit of MMR0 is set but not the ENABLED bit. + * This can happen when the MAINT bit of MMR0 is set but not the ENABLED bit. */ if (!(access & this.mmuEnable)) { addr = addrVirtual & 0xffff; @@ -1608,17 +1670,17 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(addrVirtual, access) } page = addrVirtual >> 13; - if (!(this.regMMR3 & this.mapMMR3[this.mmuMode])) page &= 7; - pdr = this.mmuPDR[this.mmuMode][page]; - addr = ((this.mmuPAR[this.mmuMode][page] << 6) + (addrVirtual & 0x1fff)) & this.mmuMask; + if (!(this.regMMR3 & this.mapMMR3[this.pswMode])) page &= 7; + pdr = this.mmuPDR[this.pswMode][page]; + addr = ((this.mmuPAR[this.pswMode][page] << 6) + (addrVirtual & 0x1fff)) & this.mmuMask; if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.mapUnibus(addr); if (this.nDisableTraps) return addr; /* - * TEST #122 ("KT BEND") in the "EKBEE1" diagnostic (PC 076060) triggers a NOMEMORY error - * using this instruction: + * TEST #122 ("KT BEND") in the "EKBEE1" diagnostic (PC 076060) triggers a NOMEMORY error using + * this instruction: * * 076170: 005037 140100 CLR @#140100 * @@ -1626,7 +1688,14 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(addrVirtual, access) * * 076356: 005037 140001 CLR @#140001 * - * These tests exercise the MMU checks that Paul mentions in the function description above. + * @paulnank: So it turns out that the memory management unit that does odd address and non-existent + * memory trapping: who knew? :-) I thought these would have been handled at access time. + * + * @jeffpar: We're assuming, at least, that the MMU does its "NEXM" (NOMEMORY) non-existent memory test + * very simplistically, by range-checking the address against something like the memory SIZE registers, + * because otherwise the MMU would have to wait for a bus time-out: something so prohibitively expensive + * that the MMU could not afford to do it. I rely on addrInvalid, which is derived from the same Bus + * getMemoryLimit() service that the SIZE registers (177760--177762) use to derive their value. */ if (addr >= this.addrInvalid && addr < this.addrIOPage) { this.regErr |= PDP11.CPUERR.NOMEMORY; @@ -1692,16 +1761,15 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(addrVirtual, access) /* * Aborts and traps: log FIRST trap and MOST RECENT abort */ - - this.mmuPDR[this.mmuMode][page] = pdr; - if (addr != ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.MMR0) & this.mmuMask) || this.mmuMode) { - this.mmuLastMode = this.mmuMode; + this.mmuPDR[this.pswMode][page] = pdr; + if (addr != ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.MMR0) & this.mmuMask) || this.pswMode) { + this.mmuLastMode = this.pswMode; this.mmuLastPage = page; } if (newMMR0) { if (newMMR0 & PDP11.MMR0.ABORT) { - if (this.trapPSW >= 0) { + if (this.pswTrap >= 0) { newMMR0 |= PDP11.MMR0.COMPLETED; } if (!(this.regMMR0 & PDP11.MMR0.ABORT)) { @@ -1710,9 +1778,13 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(addrVirtual, access) this.setMMR0((this.regMMR0 & ~PDP11.MMR0.UPDATE) | (newMMR0 & PDP11.MMR0.UPDATE)); } /* - * TODO: In unusual circumstances, if regMMR0 already indicated an ABORT condition above, + * NOTE: In unusual circumstances, if regMMR0 already indicated an ABORT condition above, * we run the risk of infinitely looping; eg, we call trap(), which calls mapVirtualToPhysical() - * on the trap vector, which faults again, etc. We should add some safeguards against that. + * on the trap vector, which faults again, etc. + * + * TODO: Determine what a real PDP-11 does in that situation; in our case, trap() deals with it + * by checking an internal OPFLAG (TRAP_RED) and turning the next trap into a PANIC, triggering an + * immediate HALT. */ this.trap(PDP11.TRAP.MMU, PDP11.OPFLAG.TRAP_MMU, PDP11.REASON.ABORT); } @@ -1723,9 +1795,7 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(addrVirtual, access) if (addr < ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.SIPDR0) & this.mmuMask) || addr > ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.UDPAR7 | 0x1) & this.mmuMask)) { this.regMMR0 |= PDP11.MMR0.TRAP_MMU; - if (this.regMMR0 & PDP11.MMR0.MMU_TRAPS) { - this.opFlags |= PDP11.OPFLAG.TRAP_MMU; - } + if (this.regMMR0 & PDP11.MMR0.MMU_TRAPS) this.opFlags |= PDP11.OPFLAG.TRAP_MMU; } } } @@ -1958,7 +2028,7 @@ CPUStatePDP11.prototype.checkStackLimit1120 = function(access, step, addr) * * so if the step parameter is positive, we let it go. */ - if (!this.mmuMode && step <= 0 && addr <= this.regSL) { + if (!this.pswMode && step <= 0 && addr <= this.regSL) { /* * On older machines (eg, the PDP-11/20), there is no "YELLOW" and "RED" distinction, and the * instruction is always allowed to complete, so the trap must always be issued in this fashion. @@ -1977,7 +2047,7 @@ CPUStatePDP11.prototype.checkStackLimit1120 = function(access, step, addr) */ CPUStatePDP11.prototype.checkStackLimit1145 = function(access, step, addr) { - if (!this.mmuMode) { + if (!this.pswMode) { /* * NOTE: The 11/70 CPU Instruction Exerciser does NOT expect reads to trigger a stack overflow, * so we check the access parameter. @@ -2191,9 +2261,9 @@ CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, access) if (!(access & PDP11.ACCESS.DSPACE)) { if ((this.regPSW & 0xf000) !== 0xf000) addr &= 0xffff; } - this.mmuMode = (this.regPSW >> 12) & 3; + this.pswMode = (this.regPSW >> 12) & 3; data = this.readWord(addr | (access & this.addrDSpace)); - this.mmuMode = (this.regPSW >> 14) & 3; + this.pswMode = (this.regPSW >> 14) & 3; } return data; }; @@ -2221,14 +2291,14 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, access, data) var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.WRITE_WORD); if (!(access & PDP11.ACCESS.DSPACE)) addr &= 0xffff; /* - * TODO: Consider replacing the following code with writeWord(), by adding optional mmuMode + * TODO: Consider replacing the following code with writeWord(), by adding optional pswMode * 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 * setMemoryAccess() handlers. */ - this.mmuMode = (this.regPSW >> 12) & 3; + this.pswMode = (this.regPSW >> 12) & 3; addr = this.mapVirtualToPhysical(addr | (access & PDP11.ACCESS.DSPACE), PDP11.ACCESS.WRITE); - this.mmuMode = (this.regPSW >> 14) & 3; + this.pswMode = (this.regPSW >> 14) & 3; this.bus.setWord(addr, data); } }; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 2c1fe427e..08dbff12f 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -294,6 +294,8 @@ if (DEBUGGER) { "SR": DebuggerPDP11.REG_SR }; + DebuggerPDP11.MODES = ["KI","KD","SI","SD","??","??","UI","UD"]; + /* * Operand type masks; anything that's not covered by OP_SRC or OP_DST must be a OP_OTHER value. */ @@ -3013,6 +3015,7 @@ if (DEBUGGER) { } sDumpers += ",state,symbols"; this.println("dump memory commands:"); + this.println("\tda [a] dump info for address a"); this.println("\tdb [a] [n] dump n bytes at address a"); this.println("\tdw [a] [n] dump n words at address a"); this.println("\tdd [a] [n] dump n dwords at address a"); @@ -3077,6 +3080,27 @@ if (DEBUGGER) { var dbgAddr = this.parseAddr(sAddr); if (!dbgAddr) return; + if (sCmd == "da") { + /* + * Sample output ("da 23042"): + * + * 00,010,011,000,100,010 00000023042 + * 0,011,000,100,010 00000003042 + * + KIPAR[1]: 0,000,001,101,111,010,000,000 00000157200 + * & MMU MASK: 1,111,111,111,111,111,111,111 00017777777 + * = PHYSICAL: 0,000,001,110,010,010,100,010 00000162242 + */ + var a = this.cpu.getAddrInfo(dbgAddr.addr); + this.println(str.pad("", 19) + str.toBin(dbgAddr.addr, 17, 3) + " " + str.toOct(dbgAddr.addr, 8)); + if (a.length > 1) { + this.println(str.pad("", 24) + str.toBin(a[1], 13, 3) + " " + str.toOct(a[1], 8)); + this.println("+ " + DebuggerPDP11.MODES[a[2]] + "PAR[" + a[3] + "]: " + str.toBin(a[4], 22, 3) + " " + str.toOct(a[4], 8)); + this.println("& MMU MASK: " + str.toBin(a[5], 22, 3) + " " + str.toOct(a[5], 8)); + this.println("= PHYSICAL: " + str.toBin(a[0], 22, 3) + " " + str.toOct(a[0], 8)) + } + return; + } + var len = 0; // 0 is not a default; it triggers the appropriate default below var fRange = false; var fJSON = (sCmd == "ds"); diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 87797af13..3e752d527 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -349,7 +349,7 @@ var PDP11 = { PAGE: 0x001E, // 000176 (all of the PAGE bits) MODE: 0x0060, // 000140 processor mode as of last fault COMPLETED: 0x0080, // 000200 last instruction completed (R/O) (11/70 only) - DSTMODE: 0x0100, // 000400 only destination mode references will be relocated (aka MAINT bit) + MAINT: 0x0100, // 000400 only destination mode references will be relocated MMU_TRAPS: 0x0200, // 001000 enable MMU traps (11/70 only) UNUSED: 0x0C00, // 006000 TRAP_MMU: 0x1000, // 010000 trap: MMU (11/70 only) @@ -357,7 +357,11 @@ var PDP11 = { ABORT_PL: 0x4000, // 040000 abort: page length ABORT_NR: 0x8000, // 100000 abort: non-resident ABORT: 0xE000, // 160000 (all of the ABORT bits) - UPDATE: 0xF0FE // Includes all of: ABORT, TRAP, COMPLETED, MODE, and PAGE bits + UPDATE: 0xF0FE, // Includes all of: ABORT, TRAP, COMPLETED, MODE, and PAGE bits + SHIFT: { + PAGE: 1, + MODE: 5 + } }, MMR1: { // 177574: general purpose auto-inc/auto-dec register (11/44 and 11/70 only) REG1_NUM: 0x0007, // @@ -743,15 +747,15 @@ var PDP11 = { DS: 13 } }, - FUNC: { // NOTE: These function codes are pre-shifted to read/write directly from/to RKCS.FUNC - CRESET: 0b0000, // Controller Reset - WRITE: 0b0010, // Write - READ: 0b0100, // Read - WCHK: 0b0110, // Write Check - SEEK: 0b1000, // Seek - RCHK: 0b1010, // Read Check - DRESET: 0b1100, // Drive Reset - WLOCK: 0b1110 // Write Lock + FUNC: { + CRESET: 0b000, // Controller Reset + WRITE: 0b001, // Write + READ: 0b010, // Read + WCHK: 0b011, // Write Check + SEEK: 0b100, // Seek + RCHK: 0b101, // Read Check + DRESET: 0b110, // Drive Reset + WLOCK: 0b111 // Write Lock } }, RL11: { // RL11 Disk Controller diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index 8f7e0f541..aac69cb3f 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -887,7 +887,7 @@ RK11.prototype.initDrive = function(drive, iDrive, data) if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with - drive.status = PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.DRDY | PDP11.RK11.RKDS.RRDY; + drive.status = PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.RRDY; return fSuccess; }; @@ -899,32 +899,59 @@ RK11.prototype.initDrive = function(drive, iDrive, data) */ RK11.prototype.processCommand = function() { - var fnReadWrite; var fInterrupt = true; + var fnReadWrite, sFunc = ""; var iDrive = (this.regRKDA & PDP11.RK11.RKDA.DS) >> PDP11.RK11.RKDA.SHIFT.DS; var drive = this.aDrives[iDrive]; var iCylinder, iHead, iSector, nWords, addr; this.regRKCS &= ~PDP11.RK11.RKCS.CRDY; + var func = (this.regRKCS & PDP11.RK11.RKCS.FUNC) >> PDP11.RK11.RKCS.SHIFT.FUNC; - switch(this.regRKCS & PDP11.RK11.RKCS.FUNC) { + switch(func) { case PDP11.RK11.FUNC.CRESET: - this.regRKDS = drive.status; + if (this.messageEnabled()) this.printMessage(this.type + ": CRESET(" + iDrive + ")", true); this.regRKER = 0; this.regRKCS = PDP11.RK11.RKCS.CRDY; this.regRKDA = 0; break; + case PDP11.RK11.FUNC.SEEK: + iCylinder = (this.regRKDA & PDP11.RK11.RKDA.CA) >> PDP11.RK11.RKDA.SHIFT.CA; + if (this.messageEnabled()) this.printMessage(this.type + ": SEEK(" + iCylinder + ")", true); + if (iCylinder >= drive.nCylinders) { + this.regRKER |= PDP11.RK11.RKER.DRE | PDP11.RK11.RKER.NXC; + this.regRKCS |= PDP11.RK11.RKCS.HE | PDP11.RK11.RKCS.ERR; + } + break; + + case PDP11.RK11.FUNC.RCHK: + sFunc = "RCHK"; + /* falls through */ + case PDP11.RK11.FUNC.READ: + if (!sFunc) sFunc = "READ"; fnReadWrite = this.readData; /* falls through */ + case PDP11.RK11.FUNC.WCHK: + if (!sFunc) sFunc = "WCHK"; + /* falls through */ + case PDP11.RK11.FUNC.WRITE: - if (!fnReadWrite) fnReadWrite = this.writeData; + if (!sFunc) sFunc = "WRITE"; + iCylinder = (this.regRKDA & PDP11.RK11.RKDA.CA) >> PDP11.RK11.RKDA.SHIFT.CA; iHead = (this.regRKDA & PDP11.RK11.RKDA.HS) >> PDP11.RK11.RKDA.SHIFT.HS; iSector = this.regRKDA & PDP11.RK11.RKDA.SA; + nWords = (0x10000 - this.regRKWC) & 0xffff; + addr = (((this.regRKCS & PDP11.RK11.RKCS.MEX)) << (16 - PDP11.RK11.RKCS.SHIFT.MEX)) | this.regRKBA; + + if (this.messageEnabled()) this.printMessage(this.type + ": " + sFunc + "(" + iCylinder + ":" + iHead + ":" + iSector + ") @" + str.toOct(addr) + "-" + str.toOct(addr + ((nWords - 1) << 1)), true); + + if (!fnReadWrite) fnReadWrite = this.writeData; + if (iCylinder >= drive.nCylinders) { this.regRKER |= PDP11.RK11.RKER.DRE | PDP11.RK11.RKER.NXC; this.regRKCS |= PDP11.RK11.RKCS.HE | PDP11.RK11.RKCS.ERR; @@ -935,23 +962,24 @@ RK11.prototype.processCommand = function() this.regRKCS |= PDP11.RK11.RKCS.HE | PDP11.RK11.RKCS.ERR; break; } - addr = (((this.regRKCS & PDP11.RK11.RKCS.MEX)) << (16 - PDP11.RK11.RKCS.SHIFT.MEX)) | this.regRKBA; - nWords = (0x10000 - this.regRKWC) & 0xffff; - if (DEBUG && (this.messageEnabled(MessagesPDP11.READ) || this.messageEnabled(MessagesPDP11.WRITE))) { - var pos = ((((iCylinder << 1) + iHead) * drive.nSectors) + iSector) * 256; - console.log((fnReadWrite == this.readData? "readData" : "writeData") + "(pos=" + pos + ",addr=" + str.toOct(addr) + ",bytes=" + (nWords * 2) + ")"); - } - fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, this.endReadWrite.bind(this)); + + fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, (func >= PDP11.RK11.FUNC.WCHK), this.endReadWrite.bind(this)); + break; + + case PDP11.RK11.FUNC.DRESET: + if (this.messageEnabled()) this.printMessage(this.type + ": DRESET(" + iDrive + ")"); break; default: + if (this.messageEnabled()) this.printMessage(this.type + ": UNSUPPORTED(" + func + ")"); break; } - /* - * TODO: Determine what's up with the "regRKDA % 9".... - */ - this.regRKDS = drive.status | (iDrive << PDP11.RK11.RKDS.SHIFT.ID) | ((this.regRKDA % 9) & PDP11.RK11.RKDS.SC); + this.regRKDS = drive.status | (drive.disk? PDP11.RK11.RKDS.DRDY : 0) | (iDrive << PDP11.RK11.RKDS.SHIFT.ID) | (this.regRKDA & PDP11.RK11.RKDS.SC); + + if (this.regRKER & PDP11.RK11.RKER.DRE) { + if (this.messageEnabled()) this.printMessage(this.type + ": ERROR: " + str.toOct(this.regRKER) + ")"); + } if (fInterrupt) { this.regRKCS &= ~PDP11.RK11.RKCS.GO; @@ -977,6 +1005,7 @@ RK11.prototype.endReadWrite = function(err, iCylinder, iHead, iSector, nWords, a this.regRKBA = addr & 0xffff; this.regRKCS = (this.regRKCS & ~PDP11.RK11.RKCS.MEX) | ((addr >> (16 - PDP11.RK11.RKCS.SHIFT.MEX)) & PDP11.RK11.RKCS.MEX); this.regRKWC = (0x10000 - nWords) & 0xffff; + this.regRKDA = (this.regRKDA & ~PDP11.RK11.RKDA.SA) | (iSector & PDP11.RK11.RKDA.SA); if (err) { this.regRKER |= err | PDP11.RK11.RKER.DRE; this.regRKCS |= PDP11.RK11.RKCS.HE | PDP11.RK11.RKCS.ERR; @@ -985,7 +1014,7 @@ RK11.prototype.endReadWrite = function(err, iCylinder, iHead, iSector, nWords, a }; /** - * readData(drive, iCylinder, iHead, iSector, nWords, addr, done) + * readData(drive, iCylinder, iHead, iSector, nWords, addr, fCheck, done) * * @this {RK11} * @param {Object} drive @@ -994,10 +1023,11 @@ RK11.prototype.endReadWrite = function(err, iCylinder, iHead, iSector, nWords, a * @param {number} iSector * @param {number} nWords * @param {number} addr + * @param {boolean} fCheck * @param {function(...)} done * @return {boolean} true if complete, false if queued */ -RK11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, addr, done) +RK11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, addr, fCheck, done) { var err = 0; var disk = drive.disk; @@ -1018,23 +1048,26 @@ RK11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add } ibSector = 0; } - var b0, b1, data; + var b0, b1; if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) { err = PDP11.RK11.RKER.NXS; break; } - this.bus.setWordDirect(addr, data = b0 | (b1 << 8)); - if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { - if (!sWords) sWords = str.toOct(addr) + ": "; - sWords += str.toOct(data) + ' '; - if (sWords.length >= 64) { - console.log(sWords); - sWords = ""; + if (!fCheck) { + var data = b0 | (b1 << 8); + this.bus.setWordDirect(addr, data); + if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { + if (!sWords) sWords = str.toOct(addr) + ": "; + sWords += str.toOct(data) + ' '; + if (sWords.length >= 64) { + console.log(sWords); + sWords = ""; + } + } + if (this.bus.checkFault()) { + err = PDP11.RK11.RKER.NXM; + break; } - } - if (this.bus.checkFault()) { - err = PDP11.RK11.RKER.NXM; - break; } addr += 2; if (ibSector >= disk.cbSector) { @@ -1055,7 +1088,7 @@ RK11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add }; /** - * writeData(drive, iCylinder, iHead, iSector, nWords, addr, done) + * writeData(drive, iCylinder, iHead, iSector, nWords, addr, fCheck, done) * * @this {RK11} * @param {Object} drive @@ -1064,10 +1097,11 @@ RK11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add * @param {number} iSector * @param {number} nWords * @param {number} addr + * @param {boolean} fCheck * @param {function(...)} done * @return {boolean} true if complete, false if queued */ -RK11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, addr, done) +RK11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, addr, fCheck, done) { var err = 0; var disk = drive.disk; @@ -1093,9 +1127,21 @@ RK11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, ad } ibSector = 0; } - if (!disk.write(sector, ibSector++, data & 0xff) || !disk.write(sector, ibSector++, data >> 8)) { - err = PDP11.RK11.RKER.NXS; - break; + if (fCheck) { + var b0, b1; + if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) { + err = PDP11.RK11.RKER.NXS; + break; + } + if (data != (b0 | (b1 << 8))) { + err = PDP11.RK11.RKER.WCE; + break; + } + } else { + if (!disk.write(sector, ibSector++, data & 0xff) || !disk.write(sector, ibSector++, data >> 8)) { + err = PDP11.RK11.RKER.NXS; + break; + } } if (ibSector >= disk.cbSector) { sector = null; diff --git a/modules/shared/lib/strlib.js b/modules/shared/lib/strlib.js index 3c8ff6cdc..4276f767e 100644 --- a/modules/shared/lib/strlib.js +++ b/modules/shared/lib/strlib.js @@ -140,15 +140,16 @@ str.parseInt = function(s, base) }; /** - * toBin(n, cch) + * toBin(n, cch, grouping) * * Converts an integer to binary, with the specified number of digits (up to the default of 32). * * @param {number|null|undefined} n is a 32-bit value * @param {number} [cch] is the desired number of binary digits (32 is both the default and the maximum) + * @param {number} [grouping] * @return {string} the binary representation of n */ -str.toBin = function(n, cch) +str.toBin = function(n, cch, grouping) { var s = ""; if (!cch) { @@ -164,13 +165,16 @@ str.toBin = function(n, cch) * since JavaScript coerces such operands to zero, but I think there's "value" in seeing those * values displayed differently. */ - if (n == null || isNaN(n)) { - while (cch-- > 0) s = '?' + s; - } else { - while (cch-- > 0) { - s = ((n & 0x1)? '1' : '0') + s; - n >>= 1; + var fInvalid = (n == null || isNaN(n)); + var group = (grouping = grouping || cch); + while (cch-- > 0) { + if (!group) { + s = "," + s; + group = grouping; } + s = (fInvalid? '?' : ((n & 0x1)? '1' : '0')) + s; + n >>= 1; + group--; } return s; }; diff --git a/versions/pc8080/1.30.5/pc8080-dbg.js b/versions/pc8080/1.30.5/pc8080-dbg.js index 67b929096..313032329 100644 --- a/versions/pc8080/1.30.5/pc8080-dbg.js +++ b/versions/pc8080/1.30.5/pc8080-dbg.js @@ -33,7 +33,7 @@ var l,n={qe:0,te:1,ue:2,ve:3,we:4,xe:5,ye:6,ze:7,Ae:8,Be:9,Ce:10,De:11,Ee:12,Fe: Hd:88,Id:89,Pb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jd:97,Bf:98,Cf:99,d:100,e:101,Df:102,Ef:103,Ff:104,Gf:105,Hf:106,k:107,If:108,Jf:109,n:110,Kf:111,p:112,q:113,r:114,Lf:115,t:116,Nf:117,Of:118,Pf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Te:127}; function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function t(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ca(a){return t(a,2,!0)} -function u(a){return t(a,4,!0)}function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function la(a){return a.replace(/[&<>"']/g,function(a){return ka[a]})} +function v(a){return t(a,4,!0)}function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function la(a){return a.replace(/[&<>"']/g,function(a){return ka[a]})} function ma(a,b){return(a+" ").slice(0,b)}function na(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var oa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function pa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function sa(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c>1)+2;10>this.ha&&(this.ha=10);15>2;this.w=this.Ja-1;this.I=this.K/this.Ja|0;this.D=this.I-1;this.A=[];this.j=[];this.F=this.B=!1;this.N=[];this.O=[];a=new G;xb(a,this.H);this.W=Array(this.I);for(b=0;b>>a.ha;0f&&(m=f);if(h&&h.size){if(h.type==d){if(e+f<=h.G)return h.Cb+=h.G-e,h.G=e,!0;if(e>=h.G+h.Cb){m=h.size-(e-k);m>f&&(m=f);h.Cb=e-h.G+m;e=k+a.Ja;f-=m;g++;continue}}return zb(1,e,f)}e=new G(e,m,a.Ja,d);xb(e,a.H,h);a.W[g++]=e;e=k+a.Ja;f-=m}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Ab[d]+" at "+u(b)),!0):zb(2,b,c)} +l.Ga=function(a,b){b||this.reset();return!0};function yb(a,b,c,d){for(var e=b,f=c,g=e>>>a.ha;0f&&(m=f);if(h&&h.size){if(h.type==d){if(e+f<=h.G)return h.Cb+=h.G-e,h.G=e,!0;if(e>=h.G+h.Cb){m=h.size-(e-k);m>f&&(m=f);h.Cb=e-h.G+m;e=k+a.Ja;f-=m;g++;continue}}return zb(1,e,f)}e=new G(e,m,a.Ja,d);xb(e,a.H,h);a.W[g++]=e;e=k+a.Ja;f-=m}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Ab[d]+" at "+v(b)),!0):zb(2,b,c)} l.Z=function(a){return this.W[(a&this.u)>>>this.ha].nb(a&this.w,a)};function Bb(a,b){return a.W[(b&a.u)>>>a.ha].Ab(b&a.w,b)}l.bb=function(a){var b=a&this.w,c=(a&this.u)>>>this.ha;return b!=this.w?this.W[c].Fc(b,a):this.W[c++].nb(b,a)|this.W[c&this.D].nb(0,a+1)<<8};function Cb(a,b){var c=b&a.w,d=(b&a.u)>>>a.ha;return c!=a.w?a.W[d].Vb(c,b):a.W[d++].Ab(c,b)|a.W[d&a.D].Ab(0,b+1)<<8}l.ua=function(a,b){this.W[(a&this.u)>>>this.ha].pb(a&this.w,b&255,a)}; function Db(a,b,c){a.W[(b&a.u)>>>a.ha].Db(b&a.w,c&255,b)}l.Mb=function(a,b){var c=a&this.w,d=(a&this.u)>>>this.ha;c!=this.w?this.W[d].Hc(c,b&65535,a):(this.W[d++].pb(c,b&255,a),this.W[d&this.D].pb(0,b>>8&255,a+1))};function Eb(a){for(var b=0,c=[],d=0;d>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,d);a.H&&a.B!=g[1]&&Wb(a.H,b,k)}else a.H&&(hb(a.H,a,b,k,d),a.B&&Wb(a.H,b,k));f+=h<<3;b+=h;e-=h}} +function Ub(a,b,c,d){void 0===d&&(d=0);if(c)for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.j[k]?w("Output port "+v(k)+" already registered"):f.j[k]=[h,!1]}}function Vb(a,b,c,d){for(var e=1,f=0;0>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,d);a.H&&a.B!=g[1]&&Wb(a.H,b,k)}else a.H&&(hb(a.H,a,b,k,d),a.B&&Wb(a.H,b,k));f+=h<<3;b+=h;e-=h}} function zb(a,b,c){w("Memory block error ("+a+": "+t(b)+","+t(c)+")");return!1}var Xb;if(ob){var Yb=new ArrayBuffer(2);(new DataView(Yb)).setUint16(0,256,!0);Xb=256===(new Uint16Array(Yb))[0]}else Xb=!1;var Zb=Xb; function G(a,b,c,d){this.id=$b+=2;this.b=null;this.G=a;this.Cb=b;this.size=c||0;this.type=d||ac;this.M=d==bc;xb(this);this.Oa=this.Cc=!1;if(c)if(ob)this.F=new ArrayBuffer(c),this.B=new DataView(this.F,0,c),this.w=new Uint8Array(this.F,0,c),this.I=new Uint16Array(this.F,0,c>>1),this.b=new Int32Array(this.F,0,c>>2),cc(this,Zb?dc:ec);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},X:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ea:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},hb:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<> +u:function(a,b){this.H&&jb(this.H,129)&&this.H.message("attempt to write "+v(b)+" to invalid block %"+t(this.G),!0)},K:function(a,b){return this.nb(a++,b++)|this.nb(a,b)<<8},D:function(a,b,c){this.pb(a++,b&255,c++);this.pb(a,b>>8,c)},X:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ea:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},hb:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<> 2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Oa=!0},N:function(a,b){if(this.H&&null!=this.G){var c=this.H;jc(c,this.G+a,1,c.N)&&c.qa(!0)}return this.Ab(a,b)},ba:function(a,b){if(this.H&&null!=this.G){var c=this.H;jc(c,this.G+a,2,c.N)&&c.qa(!0)}return this.Vb(a,b)},ia:function(a,b,c){if(this.H&&null!=this.G){var d=this.H;jc(d,this.G+a,1,d.B)&&d.qa(!0)}this.M?this.u(a,b,c):this.Db(a,b,c)},la:function(a,b,c){if(this.H&& null!=this.G){var d=this.H;jc(d,this.G+a,2,d.B)&&d.qa(!0)}this.M?this.u(a,b,c):this.Zb(a,b,c)},L:function(a){return this.w[a]},O:function(a){return this.w[a]},aa:function(a){return this.B.getUint16(a,!0)},da:function(a){return a&1?this.w[a]|this.w[a+1]<<8:this.I[a>>1]},ga:function(a,b){this.w[a]=b;this.Oa=!0},gb:function(a,b){this.w[a]=b;this.Oa=!0},ka:function(a,b){this.B.setUint16(a,b,!0);this.Oa=!0},ma:function(a,b){a&1?(this.w[a]=b,this.w[a+1]=b>>8):this.I[a>>1]=b;this.Oa=!0}}; function xb(a,b,c){a.H=b;a.A=a.j=0;c&&((a.A=c.A)&&ic(a,hc,!1),(a.j=c.j)&&gc(a,hc,!1))}function kc(a,b){b?--a.j||(a.pb=a.M?a.u:a.Db,a.Hc=a.M?a.D:a.Zb):--a.A||(a.nb=a.Ab,a.Fc=a.Vb)}function gc(a,b,c){c&&a.j||(a.pb=!a.M&&b[1]||a.u,a.Hc=!a.M&&b[3]||a.D);if(c||void 0===c)a.Db=b[1]||a.u,a.Zb=b[3]||a.D}function ic(a,b,c){c&&a.A||(a.nb=b[0]||a.J,a.Fc=b[2]||a.K);if(c||void 0===c)a.Ab=b[0]||a.J,a.Vb=b[2]||a.K}function cc(a,b){b||(b=lc);ic(a,b,void 0);gc(a,b,void 0)} @@ -121,7 +121,7 @@ J(this));this.b-=11},function(){this.i=id(this,L(this));this.b-=7},function(){P( N(this)),this.b-=6);this.b-=5},function(){this.oa=J(this)&65535;this.b-=5},function(){var a=M(this);fd(this)&&I(this,a);this.b-=10},function(){this.ta|=512;this.b-=4;Id(this)},function(){var a=M(this);fd(this)&&(P(this,this.P),I(this,a),this.b-=6);this.b-=11},Pd,function(){K(this,L(this));this.b-=7},function(){P(this,this.P);I(this,56);this.b-=11}]; function R(a){x.call(this,"ChipSet",a,R,32768);var b=a.model;b&&!Qd[b]&&Qa("Unrecognized ChipSet model: "+b);this.u=Qd[b]||{};a.sound&&(this.ga=null,window&&(this.ga=window.AudioContext||window.webkitAudioContext),this.ga&&new this.ga);F(this)}A(R); var S={Da:1978.1,Ad:{Ea:0,Ve:1,Ze:16,ff:32,qf:64,pf:128,qb:14},Za:{Ea:1,Pc:1,sd:2,od:4,pd:16,qd:32,rd:64,qb:8},Bd:{Ea:2,Ue:3,yf:4,We:8,kf:16,lf:32,mf:64,Xe:128,qb:0},uf:{Ea:3},sf:{Ea:2,gf:7},wf:{Ea:3,zf:1,vf:2,nf:4,df:8,Ye:16,pe:32},tf:{Ea:4},xf:{Ea:5,$e:1,af:2,bf:4,cf:8,Af:16}},T={Da:100,La:{Ea:66,rc:1,gc:2,ld:4,jf:8,hf:16,ic:32,hc:64,cc:128},Nc:{Ea:66,INIT:0},Ua:{Ea:194,se:0,ac:16,ud:32,nc:48,Xc:0,Yc:32},Fb:{Ea:162,rf:0,$c:0,Wc:0,Zc:0,Vc:0},Ma:{ef:{Ea:98},Ta:{Kc:0,Jc:1,xd:2,Gd:4,Qc:5,vd:6,yd:7}, -Gb:16383}},Qd={SI1978:S,VT100:T};R.prototype.pa=function(){return!1};R.prototype.Qa=function(a,b,c,d){this.w=b;this.b=c;this.H=d;this.A=a;this.I=ub(a,"Keyboard");this.J=ub(a,"SerialPort");this.video=ub(a,"Video");Gb(b,this,this.u.Kb);Ub(b,this,this.u.Lb);if(d){var e=this;Rd(d,16384,function(){for(var a="",b=0;b>8-this.ea&255;E(this,a,null,b,"SHIFT.RESULT",c,!0);return c};l.ee=function(a,b,c){E(this,a,b,c,"SHIFT.COUNT",null,!0);this.ea=b};l.ge=function(a,b,c){E(this,a,b,c,"SOUND1",null,!0);this.ma=b};l.fe=function(a,b,c){E(this,a,b,c,"SHIFT.DATA",null,!0);this.aa=b<<8|this.aa>>8}; l.he=function(a,b,c){E(this,a,b,c,"SOUND2",null,!0);this.va=b};l.ie=function(a,b,c){E(this,a,b,c,"WATCHDOG",null,!0)};function Sd(a){var b=0,c=0,d=~a.X;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c} -l.Yd=function(a,b){var c=this.K,c=c&~T.La.hc;if((Gc(this.b)&64)<<1&&(c|=T.La.hc,c!=this.K)){var d,e;d=this.O&1;e=this.O>>1&7;switch(e){case T.Ma.Ta.yd:break;case T.Ma.Ta.Jc:this.X=this.X<<1|d;break;case T.Ma.Ta.Qc:d=Sd(this);this.F[d]=T.Ma.Gb;ib(this,"doNVRCommand(): erase data at addr "+u(d));break;case T.Ma.Ta.Kc:this.j=this.j<<1|d;break;case T.Ma.Ta.Gd:d=Sd(this);e=this.j&T.Ma.Gb;this.F[d]=e;ib(this,"doNVRCommand(): write data "+u(e)+" to addr "+u(d));break;case T.Ma.Ta.vd:d=Sd(this);e=this.F[d]; -null==e&&(e=T.Ma.Gb);this.j=e;ib(this,"doNVRCommand(): read data "+u(e)+" from addr "+u(d));break;case T.Ma.Ta.xd:this.j<<=1;this.da=this.j&T.Ma.Gb+1;break;default:ib(this,"doNVRCommand(): unrecognized command "+ca(e))}}c&=~T.La.ic;this.da&&(c|=T.La.ic);c&=~T.La.cc;if(d=this.I){d=this.I;if(e=d.D)e=d.b,e=Gc(d.b)>=d.L+e.X*e.Ra/1E3*1.2731488;e&&(d.D=!1);d=!d.D}d&&(c|=T.La.cc);c&=~T.La.rc;this.J&&this.J.wa&1&&(c|=T.La.rc);this.K=c;E(this,a,null,b,"FLAGS",c);return c}; +l.Yd=function(a,b){var c=this.K,c=c&~T.La.hc;if((Gc(this.b)&64)<<1&&(c|=T.La.hc,c!=this.K)){var d,e;d=this.O&1;e=this.O>>1&7;switch(e){case T.Ma.Ta.yd:break;case T.Ma.Ta.Jc:this.X=this.X<<1|d;break;case T.Ma.Ta.Qc:d=Sd(this);this.F[d]=T.Ma.Gb;ib(this,"doNVRCommand(): erase data at addr "+v(d));break;case T.Ma.Ta.Kc:this.j=this.j<<1|d;break;case T.Ma.Ta.Gd:d=Sd(this);e=this.j&T.Ma.Gb;this.F[d]=e;ib(this,"doNVRCommand(): write data "+v(e)+" to addr "+v(d));break;case T.Ma.Ta.vd:d=Sd(this);e=this.F[d]; +null==e&&(e=T.Ma.Gb);this.j=e;ib(this,"doNVRCommand(): read data "+v(e)+" from addr "+v(d));break;case T.Ma.Ta.xd:this.j<<=1;this.da=this.j&T.Ma.Gb+1;break;default:ib(this,"doNVRCommand(): unrecognized command "+ca(e))}}c&=~T.La.ic;this.da&&(c|=T.La.ic);c&=~T.La.cc;if(d=this.I){d=this.I;if(e=d.D)e=d.b,e=Gc(d.b)>=d.L+e.X*e.Ra/1E3*1.2731488;e&&(d.D=!1);d=!d.D}d&&(c|=T.La.cc);c&=~T.La.rc;this.J&&this.J.wa&1&&(c|=T.La.rc);this.K=c;E(this,a,null,b,"FLAGS",c);return c}; l.je=function(a,b,c){E(this,a,b,c,"BRIGHTNESS");this.ia=b};l.me=function(a,b,c){E(this,a,b,c,"NVR.LATCH");this.O=b};l.le=function(a,b,c){E(this,a,b,c,"DC012");a=b&3;switch(b>>2&3){case 0:this.B=this.B&-4|a;break;case 1:this.B=this.B&-13|a<<2;this.video&&(b=this.video,a=this.B,ib(b,"updateScrollOffset("+a+")"),b.ib!==a&&((b.ib=a)?Nc(b,!0):b.sb=!0));break;case 2:switch(a){case 0:this.ba=~this.ba;break;case 2:case 3:this.la=3-a}break;case 3:this.ka=a}}; l.ke=function(a,b,c){E(this,a,b,c,"DC011");b&T.Ua.ud?(b&=T.Ua.nc,this.N!=b&&(this.N=b,this.video&&(a=this.video,b=this.N==T.Ua.nc?50:60,ib(a,"updateRate("+b+")"),a.vc=b))):(b&=T.Ua.ac,this.L!=b&&(this.L=b,this.video&&(a=this.L==T.Ua.ac?132:80,b=this.video,ib(b,"updateDimensions("+a+","+(80=a.kc?8:16,f=8>(7=a.kc?8:16,f=8>(7>4)*c)}return k}ke.prototype.Ga=function(){return!0};ke.prototype.pa=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.Ob[b]=c,!0;switch(b){case "fullScreen":return this.M[b]=c,this.j&&this.j.kb?c.onclick=function(){d.kb()}:c.parentNode.removeChild(c),!0}return!1}; ke.prototype.kb=function(){var a=!1;if(this.j){if(this.j.kb){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.X/this.N;b>c&&(a=Math.round(c/b*100)+"%")}this.pc?(this.L.style.width=a,this.L.style.width=a,this.L.style.display="block",this.L.style.margin="auto"):(this.j.style.width=a,this.j.style.height="auto");this.j.style.backgroundColor="black";this.j.kb();a=!0}this.ka&&this.ka.focus()}return a}; function ne(a,b){!b&&a.j&&(a.pc?a.L.style.width=a.L.style.height="":a.j.style.width=a.j.style.height="");ib(a,"notifyFullScreen("+b+")")}function pe(a,b){a.sc=b;a.ia=!1;if(void 0===a.D||a.D.length!=a.sc)a.D=Array(a.sc)}function re(a,b,c,d,e){d=a.u?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.ma&&(208<=c&&236>c?e=a.la+0:28<=c&&72>c&&(e=a.la+1));a=a.ga[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} -function Nc(a,b){var c=!0;if(!b){a.Xa&&(120==a.Xa?a.uc&1?(Jd(a.b,2),c=!1):Jd(a.b,1):Jd(a.b,4));if(c&&a.ia&&a.O){for(var d=a.w,e=a.O,f=!0,g=a.Va>>>d.ha;0>=1);;){var v=Bb(a.w,p++);if(127==(v&127)){var r=Bb(a.w,p++),d=r&96,c=(r&15)<<8|Bb(a.w,p),c=c+ -(r&16?8192:16384);break}if(m>4)*v.na,C,U,ea,Y,va=v.ra,Hb=v.na;z?(C=y*r.ra,U=e*r.na,ea=r.ra,Y=r.na):(C=y*r.lc,U=e*r.mc,ea=r.lc,Y=r.mc);v.ra>r.ra&&(C*=2,ea*=2);v.na>r.na&&(q||(H+=r.na),Hb=r.na);z?z.drawImage(v.canvas,ha,H,va,Hb,C,U,ea,Y):(C+=0,U+=0,r.F.drawImage(v.canvas, -ha,H,va,Hb,C,U,ea,Y))}h++}g++}e++}}a.ia=!0;!b&&a.sb&&1==h&&(a.D[k]=-1,h=0);a.sb=!1;(h||b)&&a.rb&&a.F.drawImage(a.K,0,a.ib,a.J,a.aa-a.na,0,0,a.Ic,a.Ld)}else{e=a.Va;f=e+a.O;k=h=g=0;b=a.J;m=0;c=a.aa;q=d=0;p=a.Wa;y=(1<>8|(r&255)<<8);h>z&y,re(a,a.qc,h++,k,ha),z+=p;h>m&&(m=h);k=d&&(d=k+1)}e+=2;g++;if(h>=a.J&&(h=0,k++,k>a.aa))break}a.ia=!0;b>>d.ha;0>=1);;){var u=Bb(a.w,p++);if(127==(u&127)){var r=Bb(a.w,p++),d=r&96,c=(r&15)<<8|Bb(a.w,p),c=c+ +(r&16?8192:16384);break}if(m>4)*u.na,C,U,ea,Y,va=u.ra,Hb=u.na;z?(C=y*r.ra,U=e*r.na,ea=r.ra,Y=r.na):(C=y*r.lc,U=e*r.mc,ea=r.lc,Y=r.mc);u.ra>r.ra&&(C*=2,ea*=2);u.na>r.na&&(q||(H+=r.na),Hb=r.na);z?z.drawImage(u.canvas,ha,H,va,Hb,C,U,ea,Y):(C+=0,U+=0,r.F.drawImage(u.canvas, +ha,H,va,Hb,C,U,ea,Y))}h++}g++}e++}}a.ia=!0;!b&&a.sb&&1==h&&(a.D[k]=-1,h=0);a.sb=!1;(h||b)&&a.rb&&a.F.drawImage(a.K,0,a.ib,a.J,a.aa-a.na,0,0,a.Ic,a.Ld)}else{e=a.Va;f=e+a.O;k=h=g=0;b=a.J;m=0;c=a.aa;q=d=0;p=a.Wa;y=(1<>8|(r&255)<<8);h>z&y,re(a,a.qc,h++,k,ha),z+=p;h>m&&(m=h);k=d&&(d=k+1)}e+=2;g++;if(h>=a.J&&(h=0,k++,k>a.aa))break}a.ia=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=xa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height= (a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Wa.aspect);f&&.3<=f&&3.33>=f&&(Na("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");Da("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new ke(d,e,g,f,c);gb(d,c)}}); @@ -192,8 +192,9 @@ case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d function Ee(a,b,c){var d;if(b){b=Fe(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=p+g;d>>=8}d=t(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function Je(a,b){if(b)return He(a,b,a.da[b]);var c=0;for(b in a.da)He(a,b,a.da[b]),c++;return 0>=1,u--;g=q+g;d>>=8}d=t(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e} +function Je(a,b){if(b)return He(a,b,a.da[b]);var c=0;for(b in a.da)He(a,b,a.da[b]),c++;return 0>>d.w.ha;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;k--;){var p=b[e];p.type==c?m++||d.g("..."):(c=p.type,m=Ab[c],p&&d.g(t(p.id)+" %"+t(e<>>d.w.ha;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;k--;){var p=b[e];p.type==c?m++||d.g("..."):(c=p.type,m=Ab[c],p&&d.g(t(p.id)+" %"+t(e<>>e.ha;f!=e.w?e.W[g].Zb(f,b&65535,d):(e.W[g++].Db(f,b&255,d),e.W[g&e.D].Db(0,b>>8&255,d+1));c&&We(a,c);Ec(this.b,!0)}};function X(a){return{G:a,Pa:!1}}function wf(a){return[a.G,a.Pa]}function xf(a){return{G:a[0],Pa:a[1]}} @@ -214,24 +215,24 @@ l.Sb=function(a,b){var c;a=a.toUpperCase();null==b?c=sa(Se,a):(c=sa(Se,a.substr( l.Tb=function(a){var b;if(0<=a){var c=this.b;switch(a){case 7:b=c.i;break;case 0:b=c.R;break;case 1:b=c.S;break;case 8:b=Wc(c);break;case 2:b=c.T;break;case 3:b=c.U;break;case 9:b=Yc(c);break;case 4:b=c.V;break;case 5:b=c.Y;break;case 10:b=J(c);break;case 6:b=c.Z(J(c));break;case 11:b=c.oa;break;case 12:b=c.P;break;case 13:b=Uc(c);break;case 14:b=Uc(c)&255|c.i<<8}}return b}; function Bf(a,b){b=Fe(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.Sb(b,c+1),0<=e&&(b=b.substr(0,c)+Af(a,e)+b.substr(c+1+Se[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=Ve(a,e))?(d=e+' "'+zf(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=Ve(a,e))?(We(d),d=e+ ' "'+zf(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}l.message=function(a,b){b&&(a+=" at "+Z(X(this.b.P).G));this.sa&1073741824?this.la.push(a):this.ka&&a==this.ka||(this.ka=a,this.sa&-2147483648&&(this.qa(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Mc(a),a.O=0,Ec(a)))}; -function hb(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.sa&h)!=h||a.message(b.gb+"."+(null!=d?"outPort":"inPort")+"("+u(c)+","+(f?f:"unknown")+(null!=d?","+ca(d):"")+")"+(null!=g?": "+ca(g):"")+(null!=e?" at "+Z(e):""))} +function hb(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.sa&h)!=h||a.message(b.gb+"."+(null!=d?"outPort":"inPort")+"("+v(c)+","+(f?f:"unknown")+(null!=d?","+ca(d):"")+")"+(null!=g?": "+ca(g):"")+(null!=e?" at "+Z(e):""))} function Ne(a){var b;if(Kd(a)){if(!a.K||!a.K.length){a.K=Array(1E3);for(b=0;b>>d.ha],!1)}a.N=["br"];if(a.B)for(b=1;b>>d.ha],!0);a.B=["bw"];a.Xa=0}l.$a=function(a,b,c){var d=!0;c||Gf(this,a,b,!1,!0);if(a!=this.F){var e=Ue(b);if(-1===e)this.g("invalid address: "+Z(b.G)),d=!1;else{var f=this.w;f.W[e>>>f.ha].$a(e&f.w,a==this.B)}}d&&(a.push(b),c?b.Pa=!0:(Hf(this,a,a.length-1,"set"),Ne(this)));return d}; function Gf(a,b,c,d,e){var f=!1;c=Ue(c);for(var g=1;g>>d.ha],b==a.B));h.Pa||Ne(a);break}}return f}function If(a,b){for(var c=1;c>24,4);break;case 3:z=t(v.bb(z,2),4);break;default:v="imm("+u(r)+")";break a}8086==v.style&&r&64?z="["+z+"]":r&16||(z=(v.style==Le?"$":"0x")+z);v=z}else r&16?(v= -(q&3840)>>8,r=Se[v],8086==a.style&&q&64&&(6==v&&(r="HL"),r="["+r+"]"),v=r):r&128&&(v=(f>>3&7).toString());if(!v||!v.length){h="INVALID";break}0>24,4);break;case 3:z=t(u.bb(z,2),4);break;default:u="imm("+v(r)+")";break a}8086==u.style&&r&64?z="["+z+"]":r&16||(z=(u.style==Le?"$":"0x")+z);u=z}else r&16?(u= +(q&3840)>>8,r=Se[u],8086==a.style&&q&64&&(6==u&&(r="HL"),r="["+r+"]"),u=r):r&128&&(u=(f>>3&7).toString());if(!u||!u.length){h="INVALID";break}0b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.$d;if(e>=g&&e>8&255;case "C":d.S=f&255;break;case "D":d.T=f&255;break; @@ -240,8 +241,8 @@ case "IF":d.ta=f?d.ta|512:d.ta&-513;break;default:a.g("unknown register: "+e);re function Ef(a,b,c,d){if(b=Ve(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Ve(a,c,!0);if(!d||d.Gh[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.g(m)}h[3]&&(g=h[3],f=null);f=Kf(a,b,g,f);a.g(f);a.L=b;e-=b.G-k;c++}}} l.Jb=function(a,b,c){if(b)if(a){0>this.j&&this.u.length&&(this.j=0);if(0>this.j||a!=this.u[this.j])this.u.splice(0,0,a),this.j=0;this.j--}else this.O?a="end":a=this.u[this.j+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b}; function Jf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.O&&(a.g("ended assemble at "+Z(a.ba.G)),a.L=a.ba,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ka=null;if(mb(a)&&0m||"z"Ha.length&&(a.g("note: only "+Ha.length+" available"),ja=Ha.length);wa-=ja;0>wa&&(null==Ha[Ha.length-1].G?(ja=wa+ja,wa=0):wa+=Ha.length);var od=[];"call"==bf&&(Lb=1E5,od=["CALL"]);for(void 0!==af&&a.g(ja+" instructions earlier:");0< @@ -249,10 +250,10 @@ Lb&&wa!=a.ea;){var ef=Ha[wa++];if(null==ef.G)break;var Mb=X(ef.G),ng=ja--,ff=Kf( gf="",Y=Z(rc.G);for(Ob=16;0wc?String.fromCharCode(wc):".";uc--}Nb&&(Nb+="\n");Nb+=Y+" "+qd+(Ob?"":" "+gf)}Nb&&a.g(Nb);a.Va=rc}}}}break;case "e":if("else"==f[0])break;var xc=1,hf=255,jf=a.Z,kf=a.ua;"ew"==f[0]&&(xc=2,hf=65535,jf=a.bb,kf=a.Mb);var lf=xc<<1,mf=f[1];if(null==mf)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a"); else{var yc=Ve(a,mf);if(yc)for(var zc=2;zcxd;){for(var $a=null,ug=256;65536>Rb.G>>>0;){of.G=a.bb(Rb,2);if(null==Rb.G||!ug--)break;for(var vg=a,Bc=of,pf= +Ge(a,vd);if(void 0!==wd){var sg=Ib(a.w,wd);a.g(v(wd)+": "+ca(sg))}}else a.g("input commands:"),a.g("\ti [p]\tread port [p]"),a.g("warning: port accesses can affect hardware state");break;case "k":var tg=f[0];if("?"==f[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var xd=0,of=X(),Rb=X(a.b.oa);for(a.g("stack trace for "+Z(Rb.G));10>xd;){for(var $a=null,ug=256;65536>Rb.G>>>0;){of.G=a.bb(Rb,2);if(null==Rb.G||!ug--)break;for(var vg=a,Bc=of,pf= null,Sb=Bc.G,qf=Sb,yd=1;6>=yd&&Sb;yd++){if(2"];da[191]=p["?"]; da[192]=p["~"];da[219]=p["{"];da[220]=p["|"];da[221]=p["}"];da[222]=p['"'];da[173]=p._;da[61]=p["+"];da[59]=p[":"]; function ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=1;return c}function ha(a,b,c){var d="";if(!b||4>=8;return(c?"0b":"")+d} +d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function fa(a,b){var c,d="";b?32>=1,f--;return d}function ha(a,b,c){var d="";if(!b||4>=8;return(c?"0b":"")+d} function ia(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d}function r(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function u(a){return r(a,2,!0)}function v(a){return r(a,4,!0)} function ja(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})} function pa(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; diff --git a/versions/pdpjs/1.30.5/pdp11-dbg.js b/versions/pdpjs/1.30.5/pdp11-dbg.js index d8d9477ad..7e10bd2ea 100644 --- a/versions/pdpjs/1.30.5/pdp11-dbg.js +++ b/versions/pdpjs/1.30.5/pdp11-dbg.js @@ -32,328 +32,332 @@ http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],ea=0;ea":62,"?":63,"@":64,vc:65,Ef:66,Gf:67,cg:68,E:69,dg:70,eg:71,fg:72,gg:73,hg:74,ig:75,jg:76,kg:77,lg:78,mg:79,ng:80,Q:81,og:82,pg:83,qg:84,rg:85,sg:86,tg:87,ug:88,vg:89,fd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,wg:97,xg:98,yg:99,d:100,e:101,Ag:102,Bg:103,Cg:104,Dg:105,Gg:106,k:107,Hg:108,Ig:109,n:110,Jg:111,p:112,q:113,r:114,Kg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Xc:127}; -function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function q(a){return p(a,4,!0)} -function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function sa(a){return a.replace(/[&<>"']/g,function(a){return qa[a]})} -function ta(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== +for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da":62,"?":63,"@":64,xc:65,Ef:66,Gf:67,cg:68,E:69,dg:70,eg:71,fg:72,gg:73,hg:74,ig:75,jg:76,kg:77,lg:78,mg:79,ng:80,Q:81,og:82,pg:83,qg:84,rg:85,sg:86,tg:87,ug:88,vg:89,gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,wg:97,xg:98,yg:99,d:100,e:101,Ag:102,Bg:103,Cg:104,Dg:105,Gg:106,k:107,Hg:108,Ig:109,n:110,Jg:111,p:112,q:113,r:114,Kg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Yc:127}; +function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=1,f--;return d}function p(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} +function q(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function v(a){return q(a,4,!0)}function w(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function sa(a){return a.replace(/[&<>"']/g,function(a){return ra[a]})}function ua(a,b){return(a+" ").slice(0,b)}function va(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +var Ca={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function Da(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function Ga(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ea(a,b){var c,d={ga:null,ia:null,Ta:null,Sa:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ta=g.load;d.Sa=g.exec;if(e=g.bytes)d.ga=e;else if(e=g.words)for(d.ga=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ga=Array(4*e.length),f=c=0;c>8&255,d.ga[f++]=e[c]>>16&255,d.ga[f++]=e[c]>>24&255;else d.ga=g;d.ia=g.symbols;d.ga.length?1==d.ga.length&&(v(d.ga[0]),d=null):(v("Empty resource: "+a),d=null)}catch(h){v("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.gb=this.id:(this.hb=this.id.substr(0,b),this.gb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,jb:!1,nc:!1,la:!1,error:!1};this.cc=null;this.C.error=!1;this.D={};this.j=null;this.oa=d||0;z.push(this)}var fb=void 0,gb={}; -if(window){fb||(fb=window.location.search.substr(1));for(var hb,ib=/\+/g,jb=/([^&=]+)=?([^&]*)/g;hb=jb.exec(fb);)gb[decodeURIComponent(hb[1].replace(ib," "))]=decodeURIComponent(hb[2].replace(ib," "))}function kb(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 B(a,b){b||(b=x);a.prototype=kb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var lb=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else lb={},z=[];function mb(a,b,c){lb[a]&&b&&(lb[a][b]=c)}function nb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ua=g.load;d.Ta=g.exec;if(e=g.bytes)d.ha=e;else if(e=g.words)for(d.ha=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ha=Array(4*e.length),f=c=0;c>8&255,d.ha[f++]=e[c]>>16&255,d.ha[f++]=e[c]>>24&255;else d.ha=g;d.ja=g.symbols;d.ha.length?1==d.ha.length&&(x(d.ha[0]),d=null):(x("Empty resource: "+a),d=null)}catch(h){x("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.hb=this.id:(this.ib=this.id.substr(0,b),this.hb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,kb:!1,nc:!1,la:!1,error:!1};this.cc=null;this.C.error=!1;this.D={};this.j=null;this.pa=d||0;A.push(this)}var ib=void 0,jb={}; +if(window){ib||(ib=window.location.search.substr(1));for(var kb,lb=/\+/g,mb=/([^&=]+)=?([^&]*)/g;kb=mb.exec(ib);)jb[decodeURIComponent(kb[1].replace(lb," "))]=decodeURIComponent(kb[2].replace(lb," "))}function nb(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 D(a,b){b||(b=y);a.prototype=nb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ob=window.PCjs.Machines||(window.PCjs.Machines={}),A=window.PCjs.Components||(window.PCjs.Components=[])}else ob={},A=[];function pb(a,b,c){ob[a]&&b&&(ob[a][b]=c)}function qb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.f["S"+a]=[0,0,!1,!1,this.Gd,a]}B(Fb);var Gb=7;function Hb(a,b){return a.f[b]&&a.f[b][1]}k=Fb.prototype; +var Db="undefined"!==typeof ArrayBuffer,Eb="UNKNOWN PANIC ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Fb={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"},Gb={cpu:1,trap:2,fault:4,"int":8,bus:16,memory:32,mmu:64,rom:128,device:256,panel:512,keyboard:1024,key:2048,pc11:4096,paper:4096,disk:8192,read:16384,write:32768,rk11:65536,rl11:131072,dl11:262144,serial:262144,kw11:524288,timer:524288,speaker:16777216,computer:33554432,log:268435456,warn:536870912, +buffer:1073741824,halt:-2147483648};function Hb(a){y.call(this,"Panel",a,Hb,512);this.Da=this.v=this.gb=this.Ab=this.A=this.F=0;this.I=this.J=this.H=!1;this.K=Ib;this.g={};this.f={START:[1,1,!0,!1,this.Ed],STEP:[1,1,!1,!1,this.Fd],ENABLE:[1,1,!1,!1,this.Ad],CONT:[1,1,!0,!1,this.yd],DEP:[0,0,!0,!1,this.zd],EXAM:[1,1,!0,!1,this.Bd],LOAD:[1,1,!0,!1,this.Dd],TEST:[0,0,!0,!1,this.Cd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.Gd,a]}D(Hb);var Ib=7;function Jb(a,b){return a.f[b]&&a.f[b][1]}k=Hb.prototype; k.reset=function(){this.stop()}; -k.wa=function(a,b,c,d){if(this.A&&this.A.wa(a,b,c,d)||this.b&&this.b.wa(a,b,c,d)||this.j&&this.j.wa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Ib(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Jb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Ib(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Jb(a,b)}}(this,b),!0):this.parent.wa.call(this,a,b,c,d)}};k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;Kb(b,this,Lb);Mb(b,this.reset.bind(this));Nb(this);Ob(this)};k.Ja=function(a,b){b||(Pb(),this.reset());return!0};k.Ia=function(){return!0}; -function Qb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Nb(a,b){for(var c in a.g)Qb(a,c,null!=b?b:a.g[c])}function Rb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Ob(a){for(var b in a.f)Rb(a,b,a.f[b][1])}function Sb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.ba()),c=8==(a.j&&a.j.ma||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} -function Ib(a,b){var c=a.f[b];Rb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.J="EXAM"==b)}function Jb(a,b){var c=a.f[b];c[2]&&c[3]&&(Rb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ed=function(a){a||this.b.C.X||(a=this.b,a.w.reset(),Tb(a),Hb(this,"ENABLE")&&this.b.pb())};k.Fd=function(){};k.Ad=function(a){a||this.b.ba()}; -k.yd=function(a){if(!a&&!this.b.C.X)if(Hb(this,"ENABLE"))this.b.pb();else{if((a=this.j)&&!xb(a,!0))wb(a,!0),a.qb(0,null),wb(a,!1);else try{var b=this.b.qb(1);0a.b.kb?8:16,c=65472<=a.Ca&&a.Ca<65472+b,b=c?1:2,c=c?15:a.w.Gb;Hb(a,"STEP")||(b=-b);pc(a,a.Ca&~c|a.Ca+b&c)} -function pc(a,b){a.Ca=b&a.w.Gb;b=a.Ca;for(var c=0;22>c;c++)rc(a,"A"+c,b&1<c;c++)rc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.w=this.Ha-1;this.v=this.B/this.Ha|0;this.ib=[];this.qa=0;this.A=!1;this.F=[];this.kd=[wc,xc,yc,zc];a=new K(this);Ac(a,this.j);this.ea=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.pa;this.G=0;this.g=this.Gb;J(this)}B(uc); -var vc=8192,Dc=vc-1;function wc(a,b){var c=-1,d=this.controller,e=d.ib[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.ib[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} -function xc(a,b,c){var d=!1,e=this.controller,f=e.ib[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.ib[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, -b),!0,!e.qa))}function yc(a,b){var c=-1,d=this.controller;a=d.ib[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} -function zc(a,b,c){var d=!1,e=this.controller;a=e.ib[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.qa))} -function Ec(a,b){if(b!=a.G){for(var c=0;c>>a.pa,a.f[a.J]=a.ea[a.I])}}k=uc.prototype;k.reset=function(){for(var a=0;a>>a.pa;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.H)return l.Nb+=l.H-f,l.H=f,!0;if(f>=l.H+l.Nb){n=l.size-(f-m);n>g&&(n=g);l.Nb=f-l.H+n;f=m+a.Ha;g-=n;h++;continue}}return Fc(1,f,g)}f=new K(a,f,n,a.Ha,d,e);Ac(f,a.j,l);a.ea[h++]=f;f=m+a.Ha;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Gc[d]+" at "+na(b)),!0):Fc(2,b,c)}k.dc=function(a){return this.f[(a&this.g)>>>this.pa].ec(a&this.w,a)}; -k.ua=function(a){return this.f[(a&this.g)>>>this.pa].Ba(a&this.w,a)};k.Mb=function(a,b){this.f[(a&this.g)>>>this.pa].hc(a&this.w,b,a)};k.Bb=function(a,b){this.f[(a&this.g)>>>this.pa].$b(a&this.w,b,a)};function Hc(a,b){return a.ea[(b&a.Gb)>>>a.pa]}function nc(a,b){a.A=!1;a.qa++;b=Hc(a,b).J(b&a.w,b);a.qa--;return b}function Ic(a,b,c){a.A=!1;a.qa++;Hc(a,b).G(b&a.w,c&255,b);a.qa--}function lc(a,b,c){a.A=!1;a.qa++;Hc(a,b).M(b&a.w,c&65535,b);a.qa--} -function Jc(a){for(var b=0,c=[],d=0;da.b.kb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],w=g[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Fb=128;Qc(this.b,this.f.tc,1E3/60,!0)};k.Od=function(){return this.f.Fb};k.Oe=function(a){this.f.Fb=a&192;this.f.Fb&64||bd(this.b,this.f.Eb)};k.Qd=function(){return cd(this.b)}; -k.Qe=function(a){dd(this.b,a&-129|this.b.Ea&128)};k.Rd=function(){return ed(this.b)};k.Sd=function(){return fd(this.b)};k.Td=function(){return this.b.Xa};k.Re=function(a){gd(this.b,a)};k.Ae=function(a){a=a>>1&63;var b=this.b.Yb[a>>1];return a&1?b>>16:b&65535};k.Af=function(a,b){b=b>>1&63;var c=b>>1;this.b.Yb[c]=b&1?this.b.Yb[c]&65535|(a&63)<<16:this.b.Yb[c]&-65536|a&65534};k.te=function(a){return this.b.R[1][a>>1&7]};k.tf=function(a,b){this.b.R[1][b>>1&7]=a&65295}; -k.re=function(a){return this.b.R[1][(a>>1&7)+8]};k.rf=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295};k.se=function(a){return this.b.ja[1][a>>1&7]};k.sf=function(a,b){b=b>>1&7;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.qe=function(a){return this.b.ja[1][(a>>1&7)+8]};k.qf=function(a,b){b=(b>>1&7)+8;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.Nd=function(a){return this.b.R[0][a>>1&7]};k.Ne=function(a,b){this.b.R[0][b>>1&7]=a&65295};k.Ld=function(a){return this.b.R[0][(a>>1&7)+8]}; -k.Le=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295};k.Md=function(a){return this.b.ja[0][a>>1&7]};k.Me=function(a,b){b=b>>1&7;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.Kd=function(a){return this.b.ja[0][(a>>1&7)+8]};k.Ke=function(a,b){b=(b>>1&7)+8;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.ze=function(a){return this.b.R[3][a>>1&7]};k.zf=function(a,b){this.b.R[3][b>>1&7]=a&65295};k.xe=function(a){return this.b.R[3][(a>>1&7)+8]};k.xf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295}; -k.ye=function(a){return this.b.ja[3][a>>1&7]};k.yf=function(a,b){b=b>>1&7;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.we=function(a){return this.b.ja[3][(a>>1&7)+8]};k.wf=function(a,b){b=(b>>1&7)+8;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.Jb=function(a){a&=7;return this.b.O&2048?this.b.fb[a]:this.b.u[a]};k.Ob=function(a,b){b&=7;this.b.O&2048?this.b.fb[b]=a:this.b.u[b]=a};k.Yd=function(){return this.b.O&49152?this.b.Pa[0]:this.b.u[6]};k.We=function(a){this.b.O&49152?this.b.Pa[0]=a:this.b.u[6]=a}; -k.ae=function(){return this.b.u[7]};k.Ze=function(a){this.b.u[7]=a};k.Kb=function(a){a&=7;return this.b.O&2048?this.b.u[a]:this.b.fb[a]};k.Pb=function(a,b){b&=7;this.b.O&2048?this.b.u[b]=a:this.b.fb[b]=a};k.Zd=function(){return 1==(this.b.O&49152)>>14?this.b.u[6]:this.b.Pa[1]};k.Xe=function(a){1==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Pa[1]=a};k.$d=function(){return 3==(this.b.O&49152)>>14?this.b.u[6]:this.b.Pa[3]};k.Ye=function(a){3==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Pa[3]=a}; -k.Jd=function(a){return this.b.Pc[a-65504>>1]};k.Je=function(a,b){this.b.Pc[b-65504>>1]=a};k.Mc=function(a){return 65520==a?(Kc(this.w)>>6)-1:0};k.Sc=function(){};k.ve=function(){return 1};k.vf=function(){};k.Id=function(){return this.b.ra};k.Ie=function(){this.b.ra=0};k.Pd=function(){return this.b.Oc};k.Pe=function(a,b){b&1||(a&=255);this.b.Oc=a};k.Ud=function(a,b){return b?0:this.b.Lb};k.Se=function(a){hd(this.b,a)};k.ue=function(a,b){return b?0:this.b.nb&65280};k.uf=function(a){this.b.nb=a|255}; -k.Xd=function(){return id(this.b)};k.Ve=function(a){jd(this.b,a&-1793|id(this.b)&1792)};k.Rc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; -var O={},$c=(O[61568]=[null,null,M.prototype.Ae,M.prototype.Af,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.te,M.prototype.tf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.re,M.prototype.rf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.se,M.prototype.sf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.qe,M.prototype.qf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Nd,M.prototype.Ne,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Ld,M.prototype.Le,"KDPDR",8,1145,64],O[62688]= -[null,null,M.prototype.Md,M.prototype.Me,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Kd,M.prototype.Ke,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Td,M.prototype.Re,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Od,M.prototype.Oe,"LKS"],O[65402]=[null,null,M.prototype.Qd,M.prototype.Qe,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Rd,M.prototype.Rc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Sd,M.prototype.Rc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.ze,M.prototype.zf, -"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.xe,M.prototype.xf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ye,M.prototype.yf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.we,M.prototype.wf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Jb,M.prototype.Ob,"R0SET0"],O[65473]=[null,null,M.prototype.Jb,M.prototype.Ob,"R1SET0"],O[65474]=[null,null,M.prototype.Jb,M.prototype.Ob,"R2SET0"],O[65475]=[null,null,M.prototype.Jb,M.prototype.Ob,"R3SET0"],O[65476]=[null,null,M.prototype.Jb, -M.prototype.Ob,"R4SET0"],O[65477]=[null,null,M.prototype.Jb,M.prototype.Ob,"R5SET0"],O[65478]=[null,null,M.prototype.Yd,M.prototype.We,"R6KERNEL"],O[65479]=[null,null,M.prototype.ae,M.prototype.Ze,"R7KERNEL"],O[65480]=[null,null,M.prototype.Kb,M.prototype.Pb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Kb,M.prototype.Pb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Kb,M.prototype.Pb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Kb,M.prototype.Pb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Kb, -M.prototype.Pb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Kb,M.prototype.Pb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Zd,M.prototype.Xe,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.$d,M.prototype.Ye,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Jd,M.prototype.Je,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Mc,M.prototype.Sc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Mc,M.prototype.Sc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.ve,M.prototype.vf,"SYSID",1,1170],O[65526]= -[null,null,M.prototype.Id,M.prototype.Ie,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Pd,M.prototype.Pe,"MB",1,1170],O[65530]=[null,null,M.prototype.Ud,M.prototype.Se,"PIR"],O[65532]=[null,null,M.prototype.ue,M.prototype.uf,"SL"],O[65534]=[null,null,M.prototype.Xd,M.prototype.Ve,"PSW"],O); -bb(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),rd(this,nd?sd:td);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ya:function(a,b){a&1&&this.w.Na(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ -1]&255)<<8},Qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.bb=!0},hb:function(a,b){if(this.j&&null!=this.H){var c=this.j;yd(c,this.H+a,1,c.M)&&c.ba(!0)}return this.I(a,b)},ma:function(a,b){if(this.j&&null!=this.H){var c=this.j;yd(c,this.H+a,2,c.M)&&c.ba(!0)}return this.J(a,b)},za:function(a, -b,c){if(this.j&&null!=this.H){var d=this.j;yd(d,this.H+a,1,d.F)&&d.ba(!0)}this.f?this.v(a,b,c):this.G(a,b,c)},Ya:function(a,b,c){if(this.j&&null!=this.H){var d=this.j;yd(d,this.H+a,2,d.F)&&d.ba(!0)}this.f?this.v(a,b,c):this.M(a,b,c)},gb:function(a){return this.D[a]},Z:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},da:function(a,b){a&1&&this.w.Na(b,64,2);return this.F.getUint16(a,!0)},na:function(a,b){a&1&&this.w.Na(b,64,2);a= -this.P[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ta:function(a,b){this.D[a]=b;this.bb=!0},La:function(a,b,c){this.D[a]=b;this.bb=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Ra:function(a,b,c){a&1&&this.w.Na(c,64,4);this.F.setUint16(a,b,!0);this.bb=!0},Za:function(a,b,c){a&1&&this.w.Na(c,64,4);this.P[a>>1]=b;this.bb=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, -b)+")",!0)}};function Ac(a,b,c){a.j=b;a.A=a.g=0;c&&((a.A=c.A)&&xd(a,wd,!1),(a.g=c.g)&&vd(a,wd,!1))}function zd(a,b){b?--a.g||(a.hc=a.f?a.v:a.G,a.$b=a.f?a.K:a.M):--a.A||(a.ec=a.I,a.Ba=a.J)}function vd(a,b,c){c&&a.g||(a.hc=!a.f&&b[1]||a.v,a.$b=!a.f&&b[3]||a.K);if(c||void 0===c)a.G=b[1]||a.v,a.M=b[3]||a.K}function xd(a,b,c){c&&a.A||(a.ec=b[0]||a.S,a.Ba=b[2]||a.T);if(c||void 0===c)a.I=b[0]||a.S,a.J=b[2]||a.T}function rd(a,b){b||(b=Ad);xd(a,b,void 0);vd(a,b,void 0)} -var Ad=[],ud=[K.prototype.ca,K.prototype.Qa,K.prototype.ya,K.prototype.$a],wd=[K.prototype.hb,K.prototype.za,K.prototype.ma,K.prototype.Ya];if(Bb)var td=[K.prototype.gb,K.prototype.ta,K.prototype.da,K.prototype.Ra],sd=[K.prototype.Z,K.prototype.La,K.prototype.na,K.prototype.Za]; -function Bd(a,b){x.call(this,"CPU",a,Bd,1);b=a.cycles||b;var c=a.multiplier||1;this.Qb=0;this.sb=b;this.lb=c;this.ic=Math.round(this.sb/1E4)/100;this.zb=this.ic*this.lb;this.C.X=!1;this.C.gc=!1;this.C.Cb=a.autoStart;this.C.Db=!1;this.Vb=this.ya=0;this.Wb=a.csStart;this.Hb=a.csInterval;this.Ib=a.csStop;this.M=[];this.Dc=this.Fe.bind(this);J(this)}B(Bd);var Cd=["power","reset"];k=Bd.prototype; -k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.j=d;this.v=a.v;for(b=0;b=a.ya&&(a.ya+=a.Hb,c=!0);0<=a.Ib&&a.Ib<=Id(a)&&(a.Hb=a.Ib=-1,Fd(a),a.ba(),c=!0);c&&a.i(Id(a)+" cycles: checksum="+p(a.Vb))}} -k.wa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.la)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;ca.na/a.zb?b=1:d=!0;a.lb=b;b=a.ic*a.lb;if(a.zb!=b){a.zb=b;b=a.zb.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.A&&a.A.ob()}Vb(a,a.T);a.T=0;a.S=Ba();a.Z=0;Kd(a);return d}function Oc(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function Qc(a,b,c,d){0<=b&&ba.M[b][0])&&(c=a.sb*a.lb/1E3*c|0,a.C.X&&(c+=Ld(a)),a.M[b][0]=c)} -function Md(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Ub(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Ld(a,b){var c=a.ca-=a.b;a.b=a.K=0;b&&(a.ca=0);return c} -k.Fe=function(){if(this.C.X){this.jc>=this.sb&&Kd(this,!0);this.Ra=0;this.$a=Ba();if(this.Z){var a=this.$a-this.Z;a>this.Bc&&(this.S+=a,this.S>this.$a&&(this.S=this.$a))}try{do{var b=Md(this,this.C.Db?1:this.tb);try{this.qb(b)}catch(e){if("number"!=typeof e)throw e;}b=Ld(this,!0);this.Ra+=b;this.T+=b;Wb(this,b);Ub(this,b);this.ta-=b;if(0>=this.ta){this.ta+=this.tb;15<=++this.Cc&&(this.xa(),this.Cc=0);break}}while(this.C.X)}catch(e){this.ba();this.A&&this.A.stop(Ba(),Id(this));Ab(this,e.stack||e.message); -return}if(this.C.X){a=setTimeout;b=this.Dc;this.Z=Ba();var c=this.Bc;this.Ra&&(c=Math.round(c*this.Ra/this.tb));var c=c-(this.Z-this.$a),d=this.Z-this.S;d&&(this.na=Math.round(this.T/(10*d))/100,864E5<=d&&(this.da=0,Jd(this)));if(0>c||this.nac&&(this.S-=c),c=0;this.jc+=this.Ra;this.Z+=c;a(b,c)}}}; -k.pb=function(a){if(zb(this))return!1;if(this.C.X)return this.i(this.toString()+" busy"),!1;Jd(this);this.C.X=!0;this.C.gc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.ob(!0),this.A.start(this.S,Id(this)));setTimeout(this.Dc,0);return!0};k.qb=function(){return 0};k.ba=function(a){var b=!1;if(this.C.X){Ld(this);Vb(this,this.T);this.T=0;this.C.X=!1;if(b=this.D.run)b.textContent="Run";this.A&&this.A.stop(Ba(),Id(this));b=!0}this.C.complete=a;return b}; -function Nd(a){this.kb=+a.model||1170;this.yc=a.addrReset||0;Bd.call(this,a,6666667);this.ub=0;this.Ac=255;1120==this.kb?(this.decode=Od.bind(this),this.ma=this.rd,this.ub=8,this.Ac=-1):(this.decode=Pd.bind(this),this.ma=this.sd);Qd(this);this.J=0;this.I=null;this.Rb=[];this.C.complete=!1}B(Nd,Bd);k=Nd.prototype;k.wc=function(){for(var a=192,b=0;bc.Zb&&(c.Zb=a,a+=4)}}; -k.reset=function(){this.status("model "+this.kb);this.C.X&&this.ba();Qd(this);Ed(this);this.C.error=!1;this.parent.reset.call(this)}; -function Qd(a){a.U=65536;a.V=32768;a.Y=65535;a.W=32768;a.O=15;a.u=[0,0,0,0,0,0,0,a.yc,-1,-2,-3,-4,-5,-6,-7,-8];a.fb=[0,0,0,0,0,0];a.Pa=[0,0,0,0];a.B=0;a.Za=0;a.Tc=[4,2,0,1];a.R=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ja=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0]];a.Yb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Pc=[0,0,0,0,0,0,0,0];a.Oc=0;a.L=0;a.F=a.G=0;a.g=a.f=a.Tb=0;a.za=-1;Tb(a)}function Tb(a){a.Ea=0;a.kc=0;a.lc=0;a.Xa=0;a.ra=0;a.Lb=0;a.nb=255;a.La=0;a.Ya=0;a.Qa=262143;a.Ub=0;a.va=0;a.I=null;a.w&&(Rd(a),a.gd=Kc(a.w))}function Rd(a){a.La?(a.P=65536,a.Sb=a.Xa&16?4186112:253952,a.aa=a.vd,a.Ba=a.Be,a.$b=a.Bf,Ec(a.w,a.Xa&16?22:18)):(a.P=0,a.Sb=57344,a.aa=a.ud,a.Ba=a.Nc,a.$b=a.uc,Ec(a.w,16))} -function cd(a){var b=a.Ea;b&57344||(b=b&-3199|a.Ya<<5|a.Za<<1);return b}function dd(a,b){b&=-3073;if(a.Ea!=b){b&57344&&!(a.Ea&57344)&&(a.kc=a.va>>16&65535,a.lc=a.va&65535);a.Ea=b;a.Ya=b>>5&3;a.Za=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.La!=c&&(a.La=c,Rd(a))}}function ed(a){a.Ea&57344||(a.kc=a.va>>16&65535);a=a.kc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function fd(a){a.Ea&57344||(a.lc=a.va&65535);return a.lc} -function gd(a,b){1170>a.kb&&(b&=-49);a.Xa!=b&&(a.Xa=b,a.Qa=b&16?4194303:262143,Rd(a))}k.Ic=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.da,this.lb]);a.set(2,Jc(this.w));return a.data()}; -k.restore=function(a){var b=a[1];this.da=b[1];Jd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.O>>14&3;a.B!=c&&(a.Pa[c]=a.u[6],a.u[6]=a.Pa[a.B]);a.O=b;a.L&=-3;a.L|=a.I?2:1}function hd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.L|=1}a.Lb=b}k.Fa=function(a){this.W=this.Y=a;this.V=0};k.rb=function(a,b){this.W=this.Y=this.U=a;this.V=b||0}; -function te(a,b){a.W=a.Y=a.U=b;a.V=a.W^a.U>>1}function ue(a,b,c,d){a.W=a.Y=a.U=b;a.V=(c^d)&(d^b)} -k.sa=function(a,b,c){if(!this.J){0>this.za?this.za=id(this):this.B||(c=-4);-4==c&&(this.L&256&&(c=-1),this.L|=256,this.ra|=4,this.u[6]=a=4);if(-1!=c){this.va=a|4143316992;this.B=0;var d=this.Ba(a|this.P),e=this.Ba(a+2&65535|this.P);jd(this,e&-12289|this.za>>2&12288);ve(this,this.za);ve(this,this.u[7]);T(this,d)}this.b-=5;this.L&=~(b|19);this.L|=129;this.za=-1;this.qd=a;this.od=c;-1==c&&this.ba();if(-4<=c)throw a;}}; -function we(a){var b=xe(a),c=xe(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);T(a,b);jd(a,c);a.L&=-17}k.Oa=function(a){var b=a>>13&31;31>b&&(a=this.Xa&32?this.Yb[b]+(a&8190)&4194302:a&-3932161);return a}; -function mc(a,b,c){var d,e,f;if(!(c&a.La))return f=b&65535,57344<=f&&(f|=a.Sb),f;d=b>>13;a.Xa&a.Tc[a.B]||(d&=7);e=a.R[a.B][d];f=(a.ja[a.B][d]<<6)+(b&8191)&a.Qa;3932160<=f&&(f=a.Oa(f));if(a.J)return f;f>=a.gd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& -8128)&&(g|=16384));a.R[a.B][d]=e;if(f!=(4194170&a.Qa)||a.B)a.Ya=a.B,a.Za=d;g&&(g&57344&&(0<=a.za&&(g|=128),a.Ea&57344||(g|=a.Ea&4096|a.Ya<<5|a.Za<<1,dd(a,a.Ea&-61695|g&61694)),a.sa(168,64,-2)),a.Ea&61440||!(f<(4191360&a.Qa)||f>(4194239&a.Qa))||(a.Ea|=4096,a.Ea&512&&(a.L|=64)));return f}function ye(a,b){return a.w.dc(b)}function xe(a){var b=a.Ba(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b} -function ve(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.va=a.va&65535|(a.va&-65536)<<8|16121856;a.L&256||a.ma(4,-2,c);a.$b(c,b)} -function ze(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.sa(4,0,-3),0;case 1:return 6==c&&a.ma(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.ma(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Ba(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.ma(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Ba(e)|g;a.b-=8;break;case 6:return e=a.Ba(Xd(a,2)),e=e+a.u[c]&65535,6==c&&a.ma(d, -0,e),a.b-=6,e|g;case 7:return e=a.Ba(Xd(a,2)),e=e+a.u[c]&65535,e=a.Ba(e|a.P),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.va=a.va&65535|(a.va&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.B&&0>=b&&c<=this.nb&&(this.L|=32)};k.sd=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.nb&&(c<=this.nb-32?this.sa(4,0,-4):(this.ra|=8,this.L|=32)))};function oc(a,b){a.J++;b=a.Nc(mc(a,b,2));a.J--;return b}k.ud=function(a,b,c){a=ze(this,a,b,c);3932160<=a&&(a=this.Oa(a));return a}; -k.vd=function(a,b,c){return mc(this,ze(this,a,b,c),c)};k.Nc=function(a){3932160<=a&&(a=this.Oa(a));return this.w.ua(this.Ub=a)};k.Be=function(a){return this.w.ua(this.Ub=mc(this,a,2))};k.uc=function(a,b){3932160<=a&&(a=this.Oa(a));this.w.Bb(this.Ub=a,b)};k.Bf=function(a,b){this.w.Bb(this.Ub=mc(this,a,4),b)}; -function Ae(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ze(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.B=a.O>>12&3,c=a.Ba(d|c&a.P),a.B=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.Pa[a.O>>12&3];return c}function Be(a,b,c,d){a.va=a.va&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ze(a,b,e,4),c&65536||(e&=65535),a.B=a.O>>12&3,e=mc(a,e|c&65536,4),a.B=a.O>>14&3,a.w.Bb(e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.Pa[a.O>>12&3]=d} -function Ce(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?ye(a,a.aa(b,c,3)):a.u[c+a.ub]&a.Ac}function De(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?a.w.ua(a.aa(b,c,2)):a.u[c+a.ub]}function Ee(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ze(a,b,c,8)}function Fe(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ye(a,a.aa(b,c,3)):a.u[c]&255}function Ge(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ua(a.aa(b,c,2)):a.u[c]} -function U(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Tb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,ye(a,e)),e&1&&a.b--,a.w.Mb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.Bb(e,d.call(a,0>c?a.u[-c-1]:c,a.w.ua(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} -function He(a,b,c,d,e){var f=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,f,5),e.call(a,(c=0>c?a.u[-c-1]&255:c)<<8),d&1&&a.b--,a.w.Mb(d,c)):(c?(c=0>c?a.u[-c-1]&255:c,a.u[f]=a.u[f]&~d|c<<24>>24&d):a.u[f]&=~d,e.call(a,c<<8))}function Ie(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,4),d.call(a,c=0>c?a.u[-c-1]:c),a.w.Bb(e,c)):(a.u[e]=c=0>c?a.u[-c-1]:c,d.call(a,c))}function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.qb=function(a){this.C.complete=!0;var b=this.j?Je(this.j)?1:this.C.gc?-1:0:0,c=a?this.C.gc?0:1:-1;this.C.gc=!1;this.ca=this.b=a;do{if(b){if(Ke(this.j,this.u[7],c)){this.ba();break}c||c++;b++}if(this.L){if(a=this.L&11)if(a=!1,this.L&2){var d=160,e=(this.Lb&224)>>5,f=this.I&&this.I.mb>e?this.I:null;f&&(d=f.Zb,e=f.mb);e>(this.O&224)>>5?(this.L&8&&(Xd(this,2),this.L&=-9),this.sa(d,0,-10),e=!0):e=!1;e&&(f&&Yd(this,f),a=!0);this.I||this.Lb||(this.L&=-3)}else this.L&1&&this.L++;if(a){if(b&&Ke(this.j,this.u[7], -c)){this.ba();break}if(0>c)break}if(this.L&112&&se(this)){if(b&&Ke(this.j,this.u[7],c)){this.ba();break}if(0>c)break}}this.L=this.L&15|this.O&16;this.decode(Wd(this))}while(0>1|b<<16;te(this,a);return a&65535}function Qe(a,b){a=b&128|b>>1|b<<8;te(this,a<<8);return a&255}function Re(a,b){a=b&~a;this.Fa(a);return a}function Se(a,b){a=b&~a;this.Fa(a<<8);return a}function Te(a,b){a|=b;this.Fa(a);return a}function Ue(a,b){a|=b;this.Fa(a<<8);return a} -function Ve(a,b){a=~b|65536;this.rb(a);return a&65535}function We(a,b){a=~b|256;this.rb(a<<8);return a&255}function Xe(a,b){this.W=this.Y=a=b-a;this.V=b&(b^a);return a&65535}function Ye(a,b){a=b-a;var c=a<<8;b<<=8;this.W=this.Y=c;this.V=b&(b^c);return a&255}function Ze(a,b){this.W=this.Y=a=b+a;this.V=a&(b^a);return a&65535}function $e(a,b){a=b+a;var c=a<<8;this.W=this.Y=c;this.V=c&(b<<8^c);return a&255}function af(a,b){a=-b;this.rb(a,a&b&32768);return a&65535} -function bf(a,b){a=-b;this.rb(a<<8,(a&b&128)<<8);return a&255}function cf(a,b){a=b<<1|this.U>>16&1;te(this,a);return a&65535}function df(a,b){a=b<<1|this.U>>16&1;te(this,a<<8);return a&255}function ef(a,b){a=(this.U&65536|b)>>1|b<<16;te(this,a);return a&65535}function ff(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;te(this,a<<8);return a&255}function gf(a,b){var c=b-a;ue(this,c,a,b);return c&65535}function hf(a,b){var c=b-a;ue(this,c<<8,a<<8,b<<8);return c&255} -function jf(a,b){this.W=this.Y=b&65280;this.V=this.U=0;return(b<<8|b>>8)&65535}function kf(a,b){a^=b;this.Fa(a);return a&65535}function lf(a){V(this,a,De(this,a),Le);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function mf(a){var b=Ge(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.W=this.Y=c;this.b-=(this.g?6:7)+b} -function nf(a){var b=Ge(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.W=d>>16;this.Y=d>>16|d;this.b-=(this.g?6:7)+b}function of(a){W(this,a,!Sd(this))}function pf(a){W(this,a,Sd(this))} -function qf(a){V(this,a,De(this,a),Re);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function rf(a){U(this,a,Ce(this,a),Se);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function sf(a){V(this,a,De(this,a),Te);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function tf(a){U(this,a,Ce(this,a),Ue);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function uf(a){var b=De(this,a);a=Ge(this,a);this.Fa((0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function vf(a){var b=Ce(this,a);a=Fe(this,a);this.Fa(((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function wf(a){W(this,a,Ud(this))}function xf(a){W(this,a,!Vd(this)==!Td(this))}function yf(a){W(this,a,!Ud(this)&&!Vd(this)==!Td(this))}function zf(a){W(this,a,!Sd(this)&&!Ud(this))} -function Af(a){W(this,a,Ud(this)||!Vd(this)!=!Td(this))}function Bf(a){W(this,a,Sd(this)||Ud(this))}function Cf(a){W(this,a,!Vd(this)!=!Td(this))}function Df(a){W(this,a,Vd(this))}function Ef(a){W(this,a,!Ud(this))}function Ff(a){W(this,a,!Vd(this))}function Gf(){this.sa(12,0,-9)}function Hf(a){W(this,a,!0)}function If(a){W(this,a,!Td(this))}function Jf(a){W(this,a,Td(this))}function Kf(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.Y=1);a&8&&(this.W=0);this.b-=5} -function Lf(a){var b=De(this,a);a=Ge(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ue(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Mf(a){var b=Ce(this,a);a=Fe(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ue(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} -function Nf(a){var b=Ge(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Y=d>>16|d,this.W=d>>16):(this.V=32768,this.Y=d>>15|d,this.W=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Y=this.W=0,this.V=32768,this.U=65536,this.b-=7}function Of(){this.sa(24,0,-9);this.b-=20} -function Pf(){this.O&49152?(this.ra|=128,this.sa(4,0,-8)):(this.v&&1120==this.kb&&this.v.setData(this.u[0],!0),this.j?Qf(this.j):this.ba());this.b-=7}function Rf(){this.sa(16,0,-9);this.b-=20}var Sf=[0,7,7,10,7,11,9,13];function Tf(a){this.K=this.b;T(this,Ee(this,a));this.b=this.K-Sf[this.g]}var Uf=[0,14,14,17,14,18,16,20];function Vf(a){this.K=this.b;var b=Ee(this,a);a=a>>6&7;ve(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.K-Uf[this.g]} -var Wf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Xf(a){var b=De(this,a);this.K=this.b;Ie(this,a,b,this.Fa);this.b=this.K-Wf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Yf(a){var b=Ce(this,a);He(this,a,b,65535,this.Fa);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var Zf=[7,13,13,17,14,18,17,21]; -function $f(a){var b=Ge(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.W=b>>16;this.Y=this.W|b;this.V=0;this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function gg(a){V(this,a,De(this,a),gf);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function hg(a){V(this,a,0,jf);this.b-=this.g?9:3+(7==this.f?2:0)}function ig(){this.sa(28,0,-9)} -function jg(){this.v&&(this.v.sc(this.u[7],!0),this.v.setData(this.u[0],!0));this.L|=8;Xd(this,-2);this.b-=3}function kg(a){V(this,a,this.u[(a>>6&7)+this.ub],kf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Qf(b)):b=!1;b||this.sa(8,0,-9)}function Od(a){lg[a>>12].call(this,a)}function mg(a){ng[a>>6&3].call(this,a)}function og(a){pg[a>>6&3].call(this,a)}function qg(a){rg[a>>6&3].call(this,a)} -function sg(a){tg[a&15].call(this,a)}function ug(a){vg[a&15].call(this,a)}function wg(a){xg[a>>6&3].call(this,a)}function yg(a){zg[a>>6&3].call(this,a)}function Ag(a){Bg[a>>6&3].call(this,a)} -var lg=[function(a){Cg[a>>8&15].call(this,a)},Xf,Lf,uf,qf,sf,lf,X,function(a){Dg[a>>8&15].call(this,a)},Yf,Mf,vf,rf,tf,gg,X],Cg=[function(a){Eg[a>>4&15].call(this,a)},Hf,Ef,wf,xf,Cf,yf,Af,Vf,Vf,mg,og,qg,X,X,X],ng=[function(a){Ie(this,a,0,this.rb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Xe);this.b-=this.g?9:3+(7==this.f?2:0)}],pg=[function(a){V(this,a,0,af); -this.b-=this.g?11:6},function(a){V(this,a,Sd(this)?1:0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Sd(this)?1:0,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ge(this,a);this.rb(a);this.b-=this.g?4:3+(7==this.f?2:0)}],rg=[function(a){V(this,a,0,ef);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}],Eg= -[function(a){Fg[a&15].call(this,a)},X,X,X,Tf,Tf,Tf,Tf,cg,X,sg,ug,hg,hg,hg,hg],Fg=[Pf,jg,dg,Gf,Rf,bg,X,X,X,X,X,X,X,X,X,X],tg=[ag,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},Kf,function(){this.Y=1;this.b-=5},Kf,Kf,Kf,function(){this.W=0;this.b-=5},Kf,Kf,Kf,Kf,Kf,Kf,Kf],vg=[ag,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},eg,function(){this.Y=0;this.b-=5},eg,eg,eg,function(){this.W=32768;this.b-=5},eg,eg,eg,eg,eg,eg,eg],Dg=[Ff,Df,zf,Bf,If,Jf,of,pf,Of,ig,wg,yg, -Ag,X,X,X],xg=[function(a){He(this,a,0,255,this.rb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Ye);this.b-=this.g?9:3+(7==this.f?2:0)}],zg=[function(a){U(this,a,0,bf);this.b-=this.g?11:6},function(a){U(this,a,Sd(this)?1:0,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,Sd(this)?1:0,hf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Fe(this,a); -this.rb(a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Bg=[function(a){U(this,a,0,ff);this.b-=this.g?9+(this.Tb&1):3+(7==this.f?2:0)},function(a){U(this,a,0,df);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Qe);this.b-=this.g?9+(this.Tb&1):3+(7==this.f?2:0)},function(a){U(this,a,0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)}];function Pd(a){Gg[a>>12].call(this,a)} -var Gg=[function(a){Hg[a>>8&15].call(this,a)},Xf,Lf,uf,qf,sf,lf,function(a){Ig[a>>8&15].call(this,a)},function(a){Jg[a>>8&15].call(this,a)},Yf,Mf,vf,rf,tf,gg,X],Hg=[function(a){Kg[a>>4&15].call(this,a)},Hf,Ef,wf,xf,Cf,yf,Af,Vf,Vf,mg,og,qg,function(a){Lg[a>>6&3].call(this,a)},X,X],Lg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Ba(a|this.P);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ae(this,a,0);this.Fa(a);ve(this,a);this.b-=11},function(a){var b=xe(this);this.K= -this.b;this.Fa(b);Be(this,a,0,b);this.b=this.K-Zf[this.g]},function(a){Ie(this,a,Vd(this)?65535:0,this.Fa);this.b-=this.g?9:3+(7==this.f?2:0)}],Kg=[function(a){Mg[a&15].call(this,a)},X,X,X,Tf,Tf,Tf,Tf,cg,function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.L|=1,this.L&=-3),this.b-=5):X.call(this,a)},sg,ug,hg,hg,hg,hg],Mg=[Pf,jg,function(){we(this);this.L|=this.O&16;this.b-=13},Gf,Rf,bg,dg,function(){this.sa(8,0,-9)},X,X,X,X,X,X,X,X],Ig=[$f,$f,Nf,Nf,mf,mf,nf,nf,kg,kg,X,X,X,X,fg,fg],Jg= -[Ff,Df,zf,Bf,If,Jf,of,pf,Of,ig,wg,yg,Ag,function(a){Ng[a>>6&3].call(this,a)},X,X],Ng=[X,function(a){a=Ae(this,a,65536);this.Fa(a);ve(this,a);this.b-=11},function(a){var b=xe(this);this.K=this.b;this.Fa(b);Be(this,a,65536,b);this.b=this.K-Zf[this.g]},X]; -function Og(a){x.call(this,"ROM",a,Og,128);this.ia=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.v=a.alias;this.g=a.file;this.G=u(this.g);if(this.g){a=this.g;var b=oa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(mb(c.hb,a,b),(a=Ea(a,b))?(c.A=a.ga,c.ia=a.ia):c.g=null);Pg(c)})}}B(Og);k=Og.prototype; -k.Ga=function(a,b,c,d){this.w=b;this.b=c;this.j=d;Pg(this)};k.Ja=function(){this.ia&&(this.j&&Qg(this.j,this.id,this.B,this.f,this.ia),delete this.ia);return!0};k.Ia=function(){return!0}; -function Pg(a){if(!yb(a)){if(a.g){if(!a.A||!a.w)return;a.f||(a.f=a.A.length);if(a.A.length!=a.f)Ab(a,"ROM size ("+p(a.A.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+vc){var c={};b=(c[b]=[Og.prototype.pe,Og.prototype.pf,null,null,null,a.f>>1],c);if(Kb(a.w,a,b)){b=a.F=!0;break a}}else if(Bc(a.w,b,a.f,qd)){for(c=0;c>>f.pa;0>>=f.pa;0>>a.pa;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),w=h,t=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= -b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(t)for(G(a,"loading "+q(t)+" bytes at "+q(r)+"-"+q(r+t-1),4096);t--;)Ic(a.w,r++,b[w++]&255);else r&1?a.b.ba():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.vc&&c<=la.fd&&(b=c-(la.vc-la.Uc));b&&(a.preventDefault&&a.preventDefault(),d.fc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.Wc&&(b=la.Vc);d.fc(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +k.xa=function(a,b,c,d){if(this.B&&this.B.xa(a,b,c,d)||this.b&&this.b.xa(a,b,c,d)||this.j&&this.j.xa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){Kb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Lb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Kb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Lb(a,b)}}(this,b),!0):this.parent.xa.call(this,a,b,c,d)}};k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;Mb(b,this,Nb);Ob(b,this.reset.bind(this));Pb(this);Qb(this)};k.La=function(a,b){b||(Rb(),this.reset());return!0};k.Ka=function(){return!0}; +function Sb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Pb(a,b){for(var c in a.g)Sb(a,c,null!=b?b:a.g[c])}function Tb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Qb(a){for(var b in a.f)Tb(a,b,a.f[b][1])}function Ub(a,b,c,d){a.D[b]&&(void 0===c&&(Cb(a,"Value for "+b+" is invalid"),a.b.ba()),c=8==(a.j&&a.j.ma||8)?p(c,d):q(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} +function Kb(a,b){var c=a.f[b];Tb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.J="EXAM"==b)}function Lb(a,b){var c=a.f[b];c[2]&&c[3]&&(Tb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ed=function(a){a||this.b.C.X||(a=this.b,a.w.reset(),Vb(a),Jb(this,"ENABLE")&&this.b.pb())};k.Fd=function(){};k.Ad=function(a){a||this.b.ba()}; +k.yd=function(a){if(!a&&!this.b.C.X)if(Jb(this,"ENABLE"))this.b.pb();else{if((a=this.j)&&!zb(a,!0))tb(a,!0),a.qb(0,null),tb(a,!1);else try{var b=this.b.qb(1);0a.b.lb?8:16,c=65472<=a.Da&&a.Da<65472+b,b=c?1:2,c=c?15:a.w.Lb;Jb(a,"STEP")||(b=-b);rc(a,a.Da&~c|a.Da+b&c)} +function rc(a,b){a.Da=b&a.w.Lb;b=a.Da;for(var c=0;22>c;c++)tc(a,"A"+c,b&1<c;c++)tc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.w=this.Ja-1;this.v=this.A/this.Ja|0;this.jb=[];this.ra=0;this.B=!1;this.F=[];this.kd=[yc,zc,Ac,Bc];a=new M(this);Cc(a,this.j);this.ea=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.qa;this.H=0;this.g=this.Lb;L(this)}D(wc); +var xc=8192,Fc=xc-1;function yc(a,b){var c=-1,d=this.controller,e=d.jb[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.jb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&K(this.j,16|e[5])&&J(this.j,e[4]+".readByte("+N(this.j,b)+"): "+N(this.j,c),!0,!d.ra),c;d.Qa(b,16,3);c=255;this.j&&K(this.j,16)&&J(this.j,"warning: unconverted read access to byte @"+N(this.j,b)+": "+N(this.j,c),!0,!d.ra);return c} +function zc(a,b,c){var d=!1,e=this.controller,f=e.jb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.jb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&K(this.j,16|f[5])&&J(this.j,f[4]+".writeByte("+N(this.j,c)+","+N(this.j,b)+")",!0,!e.ra):(e.Qa(c,16,5),this.j&&K(this.j,16)&&J(this.j,"warning: unconverted write access to byte @"+N(this.j,c)+": "+N(this.j, +b),!0,!e.ra))}function Ac(a,b){var c=-1,d=this.controller;a=d.jb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&K(this.j,16|a[5])&&J(this.j,a[4]+".readWord("+N(this.j,b)+"): "+N(this.j,c),!0,!d.ra),c;d.Qa(b,16,2);c=65535;this.j&&K(this.j,16)&&J(this.j,"warning: unconverted read access to word @"+N(this.j,b)+": "+N(this.j,c),!0,!d.ra);return c} +function Bc(a,b,c){var d=!1,e=this.controller;a=e.jb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&K(this.j,16|a[5])&&J(this.j,a[4]+".writeWord("+N(this.j,c)+","+N(this.j,b)+")",!0,!e.ra):(e.Qa(c,16,4),this.j&&K(this.j,16)&&J(this.j,"warning: unconverted write access to word @"+N(this.j,c)+": "+N(this.j,b),!0,!e.ra))} +function Gc(a,b){if(b!=a.H){for(var c=0;c>>a.qa,a.f[a.J]=a.ea[a.I])}}k=wc.prototype;k.reset=function(){for(var a=0;a>>a.qa;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.G)return l.Sb+=l.G-f,l.G=f,!0;if(f>=l.G+l.Sb){n=l.size-(f-m);n>g&&(n=g);l.Sb=f-l.G+n;f=m+a.Ja;g-=n;h++;continue}}return Hc(1,f,g)}f=new M(a,f,n,a.Ja,d,e);Cc(f,a.j,l);a.ea[h++]=f;f=m+a.Ja;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Ic[d]+" at "+p(b)),!0):Hc(2,b,c)}k.dc=function(a){return this.f[(a&this.g)>>>this.qa].ec(a&this.w,a)}; +k.wa=function(a){return this.f[(a&this.g)>>>this.qa].Ca(a&this.w,a)};k.Rb=function(a,b){this.f[(a&this.g)>>>this.qa].hc(a&this.w,b,a)};k.Cb=function(a,b){this.f[(a&this.g)>>>this.qa].$b(a&this.w,b,a)};function Jc(a,b){return a.ea[(b&a.Lb)>>>a.qa]}function pc(a,b){a.B=!1;a.ra++;b=Jc(a,b).J(b&a.w,b);a.ra--;return b}function Kc(a,b,c){a.B=!1;a.ra++;Jc(a,b).H(b&a.w,c&255,b);a.ra--}function ac(a,b,c){a.B=!1;a.ra++;Jc(a,b).M(b&a.w,c&65535,b);a.ra--} +function Lc(a){for(var b=0,c=[],d=0;da.b.lb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+N(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Kb=128;Sc(this.b,this.f.vc,1E3/60,!0)};k.Od=function(){return this.f.Kb};k.Oe=function(a){this.f.Kb=a&192;this.f.Kb&64||ed(this.b,this.f.Jb)};k.Qd=function(){return fd(this.b)}; +k.Qe=function(a){gd(this.b,a&-129|this.b.Ea&128)};k.Rd=function(){return hd(this.b)};k.Sd=function(){return id(this.b)};k.Td=function(){return this.b.Ra};k.Re=function(a){jd(this.b,a)};k.Ae=function(a){a=a>>1&63;var b=this.b.Qb[a>>1];return a&1?b>>16:b&65535};k.Af=function(a,b){b=b>>1&63;var c=b>>1;this.b.Qb[c]=b&1?this.b.Qb[c]&65535|(a&63)<<16:this.b.Qb[c]&-65536|a&65534};k.te=function(a){return this.b.R[1][a>>1&7]};k.tf=function(a,b){this.b.R[1][b>>1&7]=a&65295}; +k.re=function(a){return this.b.R[1][(a>>1&7)+8]};k.rf=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295};k.se=function(a){return this.b.ga[1][a>>1&7]};k.sf=function(a,b){b=b>>1&7;this.b.ga[1][b]=a;this.b.R[1][b]&=65295};k.qe=function(a){return this.b.ga[1][(a>>1&7)+8]};k.qf=function(a,b){b=(b>>1&7)+8;this.b.ga[1][b]=a;this.b.R[1][b]&=65295};k.Nd=function(a){return this.b.R[0][a>>1&7]};k.Ne=function(a,b){this.b.R[0][b>>1&7]=a&65295};k.Ld=function(a){return this.b.R[0][(a>>1&7)+8]}; +k.Le=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295};k.Md=function(a){return this.b.ga[0][a>>1&7]};k.Me=function(a,b){b=b>>1&7;this.b.ga[0][b]=a;this.b.R[0][b]&=65295};k.Kd=function(a){return this.b.ga[0][(a>>1&7)+8]};k.Ke=function(a,b){b=(b>>1&7)+8;this.b.ga[0][b]=a;this.b.R[0][b]&=65295};k.ze=function(a){return this.b.R[3][a>>1&7]};k.zf=function(a,b){this.b.R[3][b>>1&7]=a&65295};k.xe=function(a){return this.b.R[3][(a>>1&7)+8]};k.xf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295}; +k.ye=function(a){return this.b.ga[3][a>>1&7]};k.yf=function(a,b){b=b>>1&7;this.b.ga[3][b]=a;this.b.R[3][b]&=65295};k.we=function(a){return this.b.ga[3][(a>>1&7)+8]};k.wf=function(a,b){b=(b>>1&7)+8;this.b.ga[3][b]=a;this.b.R[3][b]&=65295};k.Ob=function(a){a&=7;return this.b.O&2048?this.b.$a[a]:this.b.u[a]};k.Tb=function(a,b){b&=7;this.b.O&2048?this.b.$a[b]=a:this.b.u[b]=a};k.Yd=function(){return this.b.O&49152?this.b.Ma[0]:this.b.u[6]};k.We=function(a){this.b.O&49152?this.b.Ma[0]=a:this.b.u[6]=a}; +k.ae=function(){return this.b.u[7]};k.Ze=function(a){this.b.u[7]=a};k.Pb=function(a){a&=7;return this.b.O&2048?this.b.u[a]:this.b.$a[a]};k.Ub=function(a,b){b&=7;this.b.O&2048?this.b.u[b]=a:this.b.$a[b]=a};k.Zd=function(){return 1==(this.b.O&49152)>>14?this.b.u[6]:this.b.Ma[1]};k.Xe=function(a){1==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Ma[1]=a};k.$d=function(){return 3==(this.b.O&49152)>>14?this.b.u[6]:this.b.Ma[3]};k.Ye=function(a){3==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Ma[3]=a}; +k.Jd=function(a){return this.b.sc[a-65504>>1]};k.Je=function(a,b){this.b.sc[b-65504>>1]=a};k.Pc=function(a){return 65520==a?(Mc(this.w)>>6)-1:0};k.Tc=function(){};k.ve=function(){return 1};k.vf=function(){};k.Id=function(){return this.b.oa};k.Ie=function(){this.b.oa=0};k.Pd=function(){return this.b.rc};k.Pe=function(a,b){b&1||(a&=255);this.b.rc=a};k.Ud=function(a,b){return b?0:this.b.Bb};k.Se=function(a){kd(this.b,a)};k.ue=function(a,b){return b?0:this.b.fb&65280};k.uf=function(a){this.b.fb=a|255}; +k.Xd=function(){return ld(this.b)};k.Ve=function(a){md(this.b,a&-1793|ld(this.b)&1792)};k.Sc=function(a,b){K(this)&&J(this,"writeIgnored("+p(b)+"): "+p(a),!0,!0)}; +var Q={},Uc=(Q[61568]=[null,null,O.prototype.Ae,O.prototype.Af,"UNIMAP",64,1170],Q[62592]=[null,null,O.prototype.te,O.prototype.tf,"SIPDR",8,1145,64],Q[62608]=[null,null,O.prototype.re,O.prototype.rf,"SDPDR",8,1145,64],Q[62624]=[null,null,O.prototype.se,O.prototype.sf,"SIPAR",8,1145,64],Q[62640]=[null,null,O.prototype.qe,O.prototype.qf,"SDPAR",8,1145,64],Q[62656]=[null,null,O.prototype.Nd,O.prototype.Ne,"KIPDR",8,1145,64],Q[62672]=[null,null,O.prototype.Ld,O.prototype.Le,"KDPDR",8,1145,64],Q[62688]= +[null,null,O.prototype.Md,O.prototype.Me,"KIPAR",8,1145,64],Q[62704]=[null,null,O.prototype.Kd,O.prototype.Ke,"KDPAR",8,1145,64],Q[62798]=[null,null,O.prototype.Td,O.prototype.Re,"MMR3",1,1145,64],Q[65382]=[null,null,O.prototype.Od,O.prototype.Oe,"LKS"],Q[65402]=[null,null,O.prototype.Qd,O.prototype.Qe,"MMR0",1,1145,64],Q[65404]=[null,null,O.prototype.Rd,O.prototype.Sc,"MMR1",1,1145,64],Q[65406]=[null,null,O.prototype.Sd,O.prototype.Sc,"MMR2",1,1145,64],Q[65408]=[null,null,O.prototype.ze,O.prototype.zf, +"UIPDR",8,1145,64],Q[65424]=[null,null,O.prototype.xe,O.prototype.xf,"UDPDR",8,1145,64],Q[65440]=[null,null,O.prototype.ye,O.prototype.yf,"UIPAR",8,1145,64],Q[65456]=[null,null,O.prototype.we,O.prototype.wf,"UDPAR",8,1145,64],Q[65472]=[null,null,O.prototype.Ob,O.prototype.Tb,"R0SET0"],Q[65473]=[null,null,O.prototype.Ob,O.prototype.Tb,"R1SET0"],Q[65474]=[null,null,O.prototype.Ob,O.prototype.Tb,"R2SET0"],Q[65475]=[null,null,O.prototype.Ob,O.prototype.Tb,"R3SET0"],Q[65476]=[null,null,O.prototype.Ob, +O.prototype.Tb,"R4SET0"],Q[65477]=[null,null,O.prototype.Ob,O.prototype.Tb,"R5SET0"],Q[65478]=[null,null,O.prototype.Yd,O.prototype.We,"R6KERNEL"],Q[65479]=[null,null,O.prototype.ae,O.prototype.Ze,"R7KERNEL"],Q[65480]=[null,null,O.prototype.Pb,O.prototype.Ub,"R0SET1",1,1145],Q[65481]=[null,null,O.prototype.Pb,O.prototype.Ub,"R1SET1",1,1145],Q[65482]=[null,null,O.prototype.Pb,O.prototype.Ub,"R2SET1",1,1145],Q[65483]=[null,null,O.prototype.Pb,O.prototype.Ub,"R3SET1",1,1145],Q[65484]=[null,null,O.prototype.Pb, +O.prototype.Ub,"R4SET1",1,1145],Q[65485]=[null,null,O.prototype.Pb,O.prototype.Ub,"R5SET1",1,1145],Q[65486]=[null,null,O.prototype.Zd,O.prototype.Xe,"R6SUPER",1,1145],Q[65487]=[null,null,O.prototype.$d,O.prototype.Ye,"R6USER",1,1145],Q[65504]=[null,null,O.prototype.Jd,O.prototype.Je,"CTRL",8,1170],Q[65520]=[null,null,O.prototype.Pc,O.prototype.Tc,"LSIZE",1,1170],Q[65522]=[null,null,O.prototype.Pc,O.prototype.Tc,"HSIZE",1,1170],Q[65524]=[null,null,O.prototype.ve,O.prototype.vf,"SYSID",1,1170],Q[65526]= +[null,null,O.prototype.Id,O.prototype.Ie,"CPUERR",1,1170],Q[65528]=[null,null,O.prototype.Pd,O.prototype.Pe,"MB",1,1170],Q[65530]=[null,null,O.prototype.Ud,O.prototype.Se,"PIR"],Q[65532]=[null,null,O.prototype.ue,O.prototype.uf,"SL"],Q[65534]=[null,null,O.prototype.Xd,O.prototype.Ve,"PSW"],Q); +eb(function(){for(var a=G(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.A,0,this.size>>2),ud(this,qd?vd:wd);else{a=this.b=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ua:function(a,b){a&1&&this.w.Qa(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ +1]&255)<<8},Oa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.cb=!0},hb:function(a,b){if(this.j&&null!=this.G){var c=this.j;Bd(c,this.G+a,1,c.M)&&c.ba(!0)}return this.I(a,b)},ma:function(a,b){if(this.j&&null!=this.G){var c=this.j;Bd(c,this.G+a,2,c.M)&&c.ba(!0)}return this.J(a,b)},za:function(a, +b,c){if(this.j&&null!=this.G){var d=this.j;Bd(d,this.G+a,1,d.F)&&d.ba(!0)}this.f?this.v(a,b,c):this.H(a,b,c)},Wa:function(a,b,c){if(this.j&&null!=this.G){var d=this.j;Bd(d,this.G+a,2,d.F)&&d.ba(!0)}this.f?this.v(a,b,c):this.M(a,b,c)},Y:function(a){return this.D[a]},ib:function(a,b){a=this.D[a];this.j&&K(this.j,32)&&J(this.j,"Memory.readByte("+N(this.j,b)+"): "+N(this.j,a),!0);return a},da:function(a,b){a&1&&this.w.Qa(b,64,2);return this.F.getUint16(a,!0)},na:function(a,b){a&1&&this.w.Qa(b,64,2);a= +this.P[a>>1];this.j&&K(this.j,32)&&J(this.j,"Memory.readWord("+N(this.j,b)+"): "+N(this.j,a),!0);return a},va:function(a,b){this.D[a]=b;this.cb=!0},Ga:function(a,b,c){this.D[a]=b;this.cb=!0;this.j&&K(this.j,32)&&J(this.j,"Memory.writeByte("+N(this.j,c)+","+N(this.j,b)+")",!0)},Sa:function(a,b,c){a&1&&this.w.Qa(c,64,4);this.F.setUint16(a,b,!0);this.cb=!0},Xa:function(a,b,c){a&1&&this.w.Qa(c,64,4);this.P[a>>1]=b;this.cb=!0;this.j&&K(this.j,32)&&J(this.j,"Memory.writeWord("+N(this.j,c)+","+N(this.j, +b)+")",!0)}};function Cc(a,b,c){a.j=b;a.B=a.g=0;c&&((a.B=c.B)&&Ad(a,zd,!1),(a.g=c.g)&&yd(a,zd,!1))}function Cd(a,b){b?--a.g||(a.hc=a.f?a.v:a.H,a.$b=a.f?a.K:a.M):--a.B||(a.ec=a.I,a.Ca=a.J)}function yd(a,b,c){c&&a.g||(a.hc=!a.f&&b[1]||a.v,a.$b=!a.f&&b[3]||a.K);if(c||void 0===c)a.H=b[1]||a.v,a.M=b[3]||a.K}function Ad(a,b,c){c&&a.B||(a.ec=b[0]||a.S,a.Ca=b[2]||a.T);if(c||void 0===c)a.I=b[0]||a.S,a.J=b[2]||a.T}function ud(a,b){b||(b=Dd);Ad(a,b,void 0);yd(a,b,void 0)} +var Dd=[],xd=[M.prototype.ca,M.prototype.Oa,M.prototype.ua,M.prototype.ab],zd=[M.prototype.hb,M.prototype.za,M.prototype.ma,M.prototype.Wa];if(Db)var wd=[M.prototype.Y,M.prototype.va,M.prototype.da,M.prototype.Sa],vd=[M.prototype.ib,M.prototype.Ga,M.prototype.na,M.prototype.Xa]; +function Ed(a,b){y.call(this,"CPU",a,Ed,1);b=a.cycles||b;var c=a.multiplier||1;this.Vb=0;this.tb=b;this.mb=c;this.kc=Math.round(this.tb/1E4)/100;this.zb=this.kc*this.mb;this.C.X=!1;this.C.gc=!1;this.C.Hb=a.autoStart;this.C.Ib=!1;this.Wb=this.Ga=0;this.Xb=a.csStart;this.Mb=a.csInterval;this.Nb=a.csStop;this.M=[];this.Gc=this.Fe.bind(this);L(this)}D(Ed);var Fd=["power","reset"];k=Ed.prototype; +k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.j=d;this.v=a.v;for(b=0;b=a.Ga&&(a.Ga+=a.Mb,c=!0);0<=a.Nb&&a.Nb<=Ld(a)&&(a.Mb=a.Nb=-1,Id(a),a.ba(),c=!0);c&&a.i(Ld(a)+" cycles: checksum="+q(a.Wb))}} +k.xa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.C.la)a=!0;else{var b=null,c,h=qb(a.id);for(c=0;ca.za/a.zb?b=1:d=!0;a.mb=b;b=a.kc*a.mb;if(a.zb!=b){a.zb=b;b=a.zb.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.B&&a.B.ob()}Xb(a,a.Y);a.Y=0;a.T=Ea();a.da=0;Nd(a);return d}function Qc(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function Sc(a,b,c,d){0<=b&&ba.M[b][0])&&(c=a.tb*a.mb/1E3*c|0,a.C.X&&(c+=Od(a)),a.M[b][0]=c)} +function Pd(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Wb(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Od(a,b){var c=a.ma-=a.b;a.b=a.K=0;b&&(a.ma=0);return c} +k.Fe=function(){if(this.C.X){this.lc>=this.tb&&Nd(this,!0);this.Xa=0;this.sb=Ea();if(this.da){var a=this.sb-this.da;a>this.Ec&&(this.T+=a,this.T>this.sb&&(this.T=this.sb))}try{do{var b=Pd(this,this.C.Ib?1:this.ub);try{this.qb(b)}catch(e){if("number"!=typeof e)throw e;}b=Od(this,!0);this.Xa+=b;this.Y+=b;Yb(this,b);Wb(this,b);this.Oa-=b;if(0>=this.Oa){this.Oa+=this.ub;15<=++this.Fc&&(this.ya(),this.Fc=0);break}}while(this.C.X)}catch(e){this.ba();this.B&&this.B.stop(Ea(),Ld(this));Cb(this,e.stack||e.message); +return}if(this.C.X){a=setTimeout;b=this.Gc;this.da=Ea();var c=this.Ec;this.Xa&&(c=Math.round(c*this.Xa/this.ub));var c=c-(this.da-this.sb),d=this.da-this.T;d&&(this.za=Math.round(this.Y/(10*d))/100,864E5<=d&&(this.na=0,Md(this)));if(0>c||this.zac&&(this.T-=c),c=0;this.lc+=this.Xa;this.da+=c;a(b,c)}}}; +k.pb=function(a){if(Bb(this))return!1;if(this.C.X)return this.i(this.toString()+" busy"),!1;Md(this);this.C.X=!0;this.C.gc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.ob(!0),this.B.start(this.T,Ld(this)));setTimeout(this.Gc,0);return!0};k.qb=function(){return 0};k.ba=function(a){var b=!1;if(this.C.X){Od(this);Xb(this,this.Y);this.Y=0;this.C.X=!1;if(b=this.D.run)b.textContent="Run";this.B&&this.B.stop(Ea(),Ld(this));b=!0;this.j||this.status("Stopped")}this.C.complete=a;return b}; +function Qd(a){this.lb=+a.model||1170;this.Ac=a.addrReset||0;Ed.call(this,a,6666667);this.Db=0;this.Dc=255;1120==this.lb?(this.decode=Rd.bind(this),this.va=this.rd,this.Db=8,this.Dc=-1):(this.decode=Sd.bind(this),this.va=this.sd);Td(this);this.J=0;this.I=null;this.ic=[];this.C.complete=!1}D(Qd,Ed);k=Qd.prototype;k.yc=function(){for(var a=192,b=0;bc.Zb&&(c.Zb=a,a+=4)}}; +k.reset=function(){this.status("Model "+this.lb);this.C.X&&this.ba();Td(this);Hd(this);this.C.error=!1;this.parent.reset.call(this)}; +function Td(a){a.U=65536;a.V=32768;a.Z=65535;a.W=32768;a.O=15;a.u=[0,0,0,0,0,0,0,a.Ac,-1,-2,-3,-4,-5,-6,-7,-8];a.$a=[0,0,0,0,0,0];a.Ma=[0,0,0,0];a.A=0;a.Cc=[4,2,0,1];a.R=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ga=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0]];a.Qb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.sc=[0,0,0,0,0,0,0,0];a.rc=0;a.L=0;a.F=a.H=0;a.g=a.f=a.jc=0;a.ua=-1;Vb(a)}function Vb(a){a.Ea=0;a.Eb=0;a.Fb=0;a.Ra=0;a.oa=0;a.Bb=0;a.fb=255;a.ca=0;a.Sa=0;a.Wa=0;a.S=262143;a.Gb=0;a.sa=0;a.I=null;a.w&&(Ud(a),a.Uc=Mc(a.w))}function Ud(a){a.ca?(a.P=65536,a.ab=a.Ra&16?4186112:253952,a.aa=a.vd,a.Ca=a.Be,a.$b=a.Bf,Gc(a.w,a.Ra&16?22:18)):(a.P=0,a.ab=57344,a.aa=a.ud,a.Ca=a.Qc,a.$b=a.wc,Gc(a.w,16))} +function fd(a){var b=a.Ea;b&57344||(b=b&-3199|a.Sa<<5|a.Wa<<1);return b}function gd(a,b){b&=-3073;if(a.Ea!=b){b&57344&&!(a.Ea&57344)&&(a.Eb=a.sa>>16&65535,a.Fb=a.sa&65535);a.Ea=b;a.Sa=(b&96)>>5;a.Wa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.ca!=c&&(a.ca=c,Ud(a))}}function hd(a){a.Ea&57344||(a.Eb=a.sa>>16&65535);a=a.Eb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function id(a){a.Ea&57344||(a.Fb=a.sa&65535);return a.Fb} +function jd(a,b){1170>a.lb&&(b&=-49);a.Ra!=b&&(a.Ra=b,a.S=b&16?4194303:262143,Ud(a))}k.Lc=function(){return 0};k.save=function(){var a=new U(this);a.set(0,[this.u,this.$a,this.Ma,this.Qb,this.sc,this.oa,this.rc,this.Bb,this.fb,ld(this),this.ua,this.A,this.L,this.Ea,this.Eb,this.Fb,this.Ra,this.Sa,this.Wa,this.R,this.ga,this.ca,this.S,this.Gb,this.sa]);a.set(1,[this.na,this.mb]);a.set(2,Lc(this.w));return a.data()}; +k.restore=function(a){var b=a[1];this.na=b[1];Md(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.O>>14&3;a.A!=c&&(a.Ma[c]=a.u[6],a.u[6]=a.Ma[a.A]);a.O=b;a.L&=-3;a.L|=a.I?2:1}function kd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.L|=1}a.Bb=b}k.Fa=function(a){this.W=this.Z=a;this.V=0};k.rb=function(a,b){this.W=this.Z=this.U=a;this.V=b||0}; +function ye(a,b){a.W=a.Z=a.U=b;a.V=a.W^a.U>>1}function ze(a,b,c,d){a.W=a.Z=a.U=b;a.V=(c^d)&(d^b)} +k.ta=function(a,b,c){if(!this.J){0>this.ua?this.ua=ld(this):this.A||(c=-4);-4==c&&(this.L&256&&(c=-1),this.L|=256,this.oa|=4,this.u[6]=a=4);if(-1!=c){this.sa=a|4143316992;this.A=0;var d=this.Ca(a|this.P),e=this.Ca(a+2&65535|this.P);md(this,e&-12289|this.ua>>2&12288);Ae(this,this.ua);Ae(this,this.u[7]);ae(this,d)}this.b-=5;this.L&=~(b|19);this.L|=129;this.ua=-1;this.qd=a;this.od=c;-1==c&&this.ba();if(-4<=c)throw a;}}; +function Be(a){var b=Ce(a),c=Ce(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);ae(a,b);md(a,c);a.L&=-17}k.Ia=function(a){var b=a>>13&31;31>b&&(a=this.Ra&32?this.Qb[b]+(a&8190)&4194302:a&-3932161);return a}; +function oc(a,b,c){var d,e,f;if(!(c&a.ca))return f=b&65535,57344<=f&&(f|=a.ab),f;d=b>>13;a.Ra&a.Cc[a.A]||(d&=7);e=a.R[a.A][d];f=(a.ga[a.A][d]<<6)+(b&8191)&a.S;3932160<=f&&(f=a.Ia(f));if(a.J)return f;f>=a.Uc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& +8128)&&(g|=16384));a.R[a.A][d]=e;if(f!=(4194170&a.S)||a.A)a.Sa=a.A,a.Wa=d;g&&(g&57344&&(0<=a.ua&&(g|=128),a.Ea&57344||(g|=a.Ea&4096|a.Sa<<5|a.Wa<<1,gd(a,a.Ea&-61695|g&61694)),a.ta(168,64,-2)),a.Ea&61440||!(f<(4191360&a.S)||f>(4194239&a.S))||(a.Ea|=4096,a.Ea&512&&(a.L|=64)));return f}function De(a,b){return a.w.dc(b)}function Ce(a){var b=a.Ca(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b} +function Ae(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.sa=a.sa&65535|(a.sa&-65536)<<8|16121856;a.L&256||a.va(4,-2,c);a.$b(c,b)} +function Ee(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.ta(4,0,-3),0;case 1:return 6==c&&a.va(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.va(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Ca(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.va(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Ca(e)|g;a.b-=8;break;case 6:return e=a.Ca($d(a,2)),e=e+a.u[c]&65535,6==c&&a.va(d, +0,e),a.b-=6,e|g;case 7:return e=a.Ca($d(a,2)),e=e+a.u[c]&65535,e=a.Ca(e|a.P),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.sa=a.sa&65535|(a.sa&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.A&&0>=b&&c<=this.fb&&(this.L|=32)};k.sd=function(a,b,c){this.A||(65534<=c&&(c|=-65536),a&4&&c<=this.fb&&(c<=this.fb-32?this.ta(4,0,-4):(this.oa|=8,this.L|=32)))};function qc(a,b){a.J++;b=a.Qc(oc(a,b,2));a.J--;return b}k.ud=function(a,b,c){a=Ee(this,a,b,c);3932160<=a&&(a=this.Ia(a));return a}; +k.vd=function(a,b,c){return oc(this,Ee(this,a,b,c),c)};k.Qc=function(a){3932160<=a&&(a=this.Ia(a));return this.w.wa(this.Gb=a)};k.Be=function(a){return this.w.wa(this.Gb=oc(this,a,2))};k.wc=function(a,b){3932160<=a&&(a=this.Ia(a));this.w.Cb(this.Gb=a,b)};k.Bf=function(a,b){this.w.Cb(this.Gb=oc(this,a,4),b)}; +function Fe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Ee(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.A=a.O>>12&3,c=a.Ca(d|c&a.P),a.A=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.Ma[a.O>>12&3];return c}function Ge(a,b,c,d){a.sa=a.sa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Ee(a,b,e,4),c&65536||(e&=65535),a.A=a.O>>12&3,e=oc(a,e|c&65536,4),a.A=a.O>>14&3,a.w.Cb(e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.Ma[a.O>>12&3]=d} +function He(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?De(a,a.aa(b,c,3)):a.u[c+a.Db]&a.Dc}function Ie(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?a.w.wa(a.aa(b,c,2)):a.u[c+a.Db]}function Je(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Ee(a,b,c,8)}function Ke(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?De(a,a.aa(b,c,3)):a.u[c]&255}function Le(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.wa(a.aa(b,c,2)):a.u[c]} +function Me(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.jc=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,De(a,e)),e&1&&a.b--,a.w.Rb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.Cb(e,d.call(a,0>c?a.u[-c-1]:c,a.w.wa(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} +function Ne(a,b,c,d,e){var f=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,f,5),e.call(a,(c=0>c?a.u[-c-1]&255:c)<<8),d&1&&a.b--,a.w.Rb(d,c)):(c?(c=0>c?a.u[-c-1]&255:c,a.u[f]=a.u[f]&~d|c<<24>>24&d):a.u[f]&=~d,e.call(a,c<<8))}function Oe(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,4),d.call(a,c=0>c?a.u[-c-1]:c),a.w.Cb(e,c)):(a.u[e]=c=0>c?a.u[-c-1]:c,d.call(a,c))}function W(a,b,c){c&&(ae(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.qb=function(a){this.C.complete=!0;var b=this.j?Pe(this.j)?1:this.C.gc?-1:0:0,c=a?this.C.gc?0:1:-1;this.C.gc=!1;this.ma=this.b=a;do{if(b){if(Qe(this.j,this.u[7],c)){this.ba();break}c||c++;b++}if(this.L){if(a=this.L&11)if(a=!1,this.L&2){var d=160,e=(this.Bb&224)>>5,f=this.I&&this.I.nb>e?this.I:null;f&&(d=f.Zb,e=f.nb);e>(this.O&224)>>5?(this.L&8&&($d(this,2),this.L&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&be(this,f),a=!0);this.I||this.Bb||(this.L&=-3)}else this.L&1&&this.L++;if(a){if(b&&Qe(this.j,this.u[7], +c)){this.ba();break}if(0>c)break}if(this.L&112&&ce(this)){if(b&&Qe(this.j,this.u[7],c)){this.ba();break}if(0>c)break}}this.L=this.L&15|this.O&16;this.decode(Zd(this))}while(0>1|b<<16;ye(this,a);return a&65535}function We(a,b){a=b&128|b>>1|b<<8;ye(this,a<<8);return a&255}function Xe(a,b){a=b&~a;this.Fa(a);return a}function Ye(a,b){a=b&~a;this.Fa(a<<8);return a}function Ze(a,b){a|=b;this.Fa(a);return a}function $e(a,b){a|=b;this.Fa(a<<8);return a} +function af(a,b){a=~b|65536;this.rb(a);return a&65535}function bf(a,b){a=~b|256;this.rb(a<<8);return a&255}function cf(a,b){this.W=this.Z=a=b-a;this.V=b&(b^a);return a&65535}function df(a,b){a=b-a;var c=a<<8;b<<=8;this.W=this.Z=c;this.V=b&(b^c);return a&255}function ef(a,b){this.W=this.Z=a=b+a;this.V=a&(b^a);return a&65535}function ff(a,b){a=b+a;var c=a<<8;this.W=this.Z=c;this.V=c&(b<<8^c);return a&255}function gf(a,b){a=-b;this.rb(a,a&b&32768);return a&65535} +function hf(a,b){a=-b;this.rb(a<<8,(a&b&128)<<8);return a&255}function jf(a,b){a=b<<1|this.U>>16&1;ye(this,a);return a&65535}function kf(a,b){a=b<<1|this.U>>16&1;ye(this,a<<8);return a&255}function lf(a,b){a=(this.U&65536|b)>>1|b<<16;ye(this,a);return a&65535}function mf(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;ye(this,a<<8);return a&255}function nf(a,b){var c=b-a;ze(this,c,a,b);return c&65535}function of(a,b){var c=b-a;ze(this,c<<8,a<<8,b<<8);return c&255} +function pf(a,b){this.W=this.Z=b&65280;this.V=this.U=0;return(b<<8|b>>8)&65535}function qf(a,b){a^=b;this.Fa(a);return a&65535}function rf(a){V(this,a,Ie(this,a),Re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function sf(a){var b=Le(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.W=this.Z=c;this.b-=(this.g?6:7)+b} +function tf(a){var b=Le(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.W=d>>16;this.Z=d>>16|d;this.b-=(this.g?6:7)+b}function uf(a){W(this,a,!Vd(this))}function vf(a){W(this,a,Vd(this))} +function wf(a){V(this,a,Ie(this,a),Xe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function xf(a){Me(this,a,He(this,a),Ye);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function yf(a){V(this,a,Ie(this,a),Ze);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function zf(a){Me(this,a,He(this,a),$e);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function Af(a){var b=Ie(this,a);a=Le(this,a);this.Fa((0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Bf(a){var b=He(this,a);a=Ke(this,a);this.Fa(((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Cf(a){W(this,a,Xd(this))}function Df(a){W(this,a,!Yd(this)==!Wd(this))}function Ef(a){W(this,a,!Xd(this)&&!Yd(this)==!Wd(this))}function Ff(a){W(this,a,!Vd(this)&&!Xd(this))} +function Gf(a){W(this,a,Xd(this)||!Yd(this)!=!Wd(this))}function Hf(a){W(this,a,Vd(this)||Xd(this))}function If(a){W(this,a,!Yd(this)!=!Wd(this))}function Jf(a){W(this,a,Yd(this))}function Kf(a){W(this,a,!Xd(this))}function Lf(a){W(this,a,!Yd(this))}function Mf(){this.ta(12,0,-9)}function Nf(a){W(this,a,!0)}function Of(a){W(this,a,!Wd(this))}function Pf(a){W(this,a,Wd(this))}function Qf(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.Z=1);a&8&&(this.W=0);this.b-=5} +function Rf(a){var b=Ie(this,a);a=Le(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ze(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Sf(a){var b=He(this,a);a=Ke(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ze(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} +function Tf(a){var b=Le(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Z=d>>16|d,this.W=d>>16):(this.V=32768,this.Z=d>>15|d,this.W=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Z=this.W=0,this.V=32768,this.U=65536,this.b-=7}function Uf(){this.ta(24,0,-9);this.b-=20} +function Vf(){this.O&49152?(this.oa|=128,this.ta(4,0,-8)):(this.v&&1120==this.lb&&this.v.setData(this.u[0],!0),this.j?Wf(this.j):this.ba());this.b-=7}function Xf(){this.ta(16,0,-9);this.b-=20}var Yf=[0,7,7,10,7,11,9,13];function Zf(a){this.K=this.b;ae(this,Je(this,a));this.b=this.K-Yf[this.g]}var $f=[0,14,14,17,14,18,16,20];function ag(a){this.K=this.b;var b=Je(this,a);a=a>>6&7;Ae(this,this.u[a]);this.u[a]=this.u[7];ae(this,b);this.b=this.K-$f[this.g]} +var bg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function cg(a){var b=Ie(this,a);this.K=this.b;Oe(this,a,b,this.Fa);this.b=this.K-bg[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function dg(a){var b=He(this,a);Ne(this,a,b,65535,this.Fa);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var eg=[7,13,13,17,14,18,17,21]; +function fg(a){var b=Le(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.W=b>>16;this.Z=this.W|b;this.V=0;this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)ae(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function mg(a){V(this,a,Ie(this,a),nf);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function ng(a){V(this,a,0,pf);this.b-=this.g?9:3+(7==this.f?2:0)}function og(){this.ta(28,0,-9)} +function pg(){this.v&&(this.v.uc(this.u[7],!0),this.v.setData(this.u[0],!0));this.L|=8;$d(this,-2);this.b-=3}function qg(a){V(this,a,this.u[(a>>6&7)+this.Db],qf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,K(b,1)?(J(b,"undefined opcode "+N(b,a),!0,!0),b=Wf(b)):b=!1;b||this.ta(8,0,-9)}function Rd(a){rg[a>>12].call(this,a)}function sg(a){tg[a>>6&3].call(this,a)}function ug(a){vg[a>>6&3].call(this,a)}function wg(a){xg[a>>6&3].call(this,a)} +function yg(a){zg[a&15].call(this,a)}function Ag(a){Bg[a&15].call(this,a)}function Cg(a){Dg[a>>6&3].call(this,a)}function Eg(a){Fg[a>>6&3].call(this,a)}function Gg(a){Hg[a>>6&3].call(this,a)} +var rg=[function(a){Ig[a>>8&15].call(this,a)},cg,Rf,Af,wf,yf,rf,X,function(a){Jg[a>>8&15].call(this,a)},dg,Sf,Bf,xf,zf,mg,X],Ig=[function(a){Kg[a>>4&15].call(this,a)},Nf,Kf,Cf,Df,If,Ef,Gf,ag,ag,sg,ug,wg,X,X,X],tg=[function(a){Oe(this,a,0,this.rb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,af);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,ef);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,cf);this.b-=this.g?9:3+(7==this.f?2:0)}],vg=[function(a){V(this,a,0,gf); +this.b-=this.g?11:6},function(a){V(this,a,Vd(this)?1:0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Vd(this)?1:0,nf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Le(this,a);this.rb(a);this.b-=this.g?4:3+(7==this.f?2:0)}],xg=[function(a){V(this,a,0,lf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,jf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)}],Kg= +[function(a){Lg[a&15].call(this,a)},X,X,X,Zf,Zf,Zf,Zf,ig,X,yg,Ag,ng,ng,ng,ng],Lg=[Vf,pg,jg,Mf,Xf,hg,X,X,X,X,X,X,X,X,X,X],zg=[gg,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},Qf,function(){this.Z=1;this.b-=5},Qf,Qf,Qf,function(){this.W=0;this.b-=5},Qf,Qf,Qf,Qf,Qf,Qf,Qf],Bg=[gg,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},kg,function(){this.Z=0;this.b-=5},kg,kg,kg,function(){this.W=32768;this.b-=5},kg,kg,kg,kg,kg,kg,kg],Jg=[Lf,Jf,Ff,Hf,Of,Pf,uf,vf,Uf,og,Cg,Eg, +Gg,X,X,X],Dg=[function(a){Ne(this,a,0,255,this.rb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Me(this,a,0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Me(this,a,1,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Me(this,a,1,df);this.b-=this.g?9:3+(7==this.f?2:0)}],Fg=[function(a){Me(this,a,0,hf);this.b-=this.g?11:6},function(a){Me(this,a,Vd(this)?1:0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Me(this,a,Vd(this)?1:0,of);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ke(this, +a);this.rb(a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Hg=[function(a){Me(this,a,0,mf);this.b-=this.g?9+(this.jc&1):3+(7==this.f?2:0)},function(a){Me(this,a,0,kf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Me(this,a,0,We);this.b-=this.g?9+(this.jc&1):3+(7==this.f?2:0)},function(a){Me(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)}];function Sd(a){Mg[a>>12].call(this,a)} +var Mg=[function(a){Ng[a>>8&15].call(this,a)},cg,Rf,Af,wf,yf,rf,function(a){Og[a>>8&15].call(this,a)},function(a){Pg[a>>8&15].call(this,a)},dg,Sf,Bf,xf,zf,mg,X],Ng=[function(a){Qg[a>>4&15].call(this,a)},Nf,Kf,Cf,Df,If,Ef,Gf,ag,ag,sg,ug,wg,function(a){Rg[a>>6&3].call(this,a)},X,X],Rg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Ca(a|this.P);ae(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Fe(this,a,0);this.Fa(a);Ae(this,a);this.b-=11},function(a){var b=Ce(this); +this.K=this.b;this.Fa(b);Ge(this,a,0,b);this.b=this.K-eg[this.g]},function(a){Oe(this,a,Yd(this)?65535:0,this.Fa);this.b-=this.g?9:3+(7==this.f?2:0)}],Qg=[function(a){Sg[a&15].call(this,a)},X,X,X,Zf,Zf,Zf,Zf,ig,function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.L|=1,this.L&=-3),this.b-=5):X.call(this,a)},yg,Ag,ng,ng,ng,ng],Sg=[Vf,pg,function(){Be(this);this.L|=this.O&16;this.b-=13},Mf,Xf,hg,jg,function(){this.ta(8,0,-9)},X,X,X,X,X,X,X,X],Og=[fg,fg,Tf,Tf,sf,sf,tf,tf,qg,qg,X,X,X,X,lg, +lg],Pg=[Lf,Jf,Ff,Hf,Of,Pf,uf,vf,Uf,og,Cg,Eg,Gg,function(a){Tg[a>>6&3].call(this,a)},X,X],Tg=[X,function(a){a=Fe(this,a,65536);this.Fa(a);Ae(this,a);this.b-=11},function(a){var b=Ce(this);this.K=this.b;this.Fa(b);Ge(this,a,65536,b);this.b=this.K-eg[this.g]},X]; +function Ug(a){y.call(this,"ROM",a,Ug,128);this.ja=this.B=null;this.A=a.addr;this.f=a.size;this.F=!1;this.v=a.alias;this.g=a.file;this.H=w(this.g);if(this.g){a=this.g;var b=pa(this.H);"json"!=b&&"hex"!=b&&(a=Ia()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Ga(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(pb(c.ib,a,b),(a=Ha(a,b))?(c.B=a.ha,c.ja=a.ja):c.g=null);Vg(c)})}}D(Ug);k=Ug.prototype; +k.Ha=function(a,b,c,d){this.w=b;this.b=c;this.j=d;Vg(this)};k.La=function(){this.ja&&(this.j&&Wg(this.j,this.id,this.A,this.f,this.ja),delete this.ja);return!0};k.Ka=function(){return!0}; +function Vg(a){if(!Ab(a)){if(a.g){if(!a.B||!a.w)return;a.f||(a.f=a.B.length);if(a.B.length!=a.f)Cb(a,"ROM size ("+q(a.B.length,8,!0)+") does not match specified size ("+q(a.f,8,!0)+")");else{var b;a:{b=a.A;a.status(a.f+"-byte ROM at "+p(b));if(57344<=b&&b<57344+xc){var c={};b=(c[b]=[Ug.prototype.pe,Ug.prototype.pf,null,null,null,a.f>>1],c);if(Mb(a.w,a,b)){b=a.F=!0;break a}}else if(Dc(a.w,b,a.f,td)){for(c=0;c>>f.qa;0>>=f.qa;0>>a.qa;0=b.length){J(a,"invalid block at offset "+v(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),u=h,t=n-=6;0=b.length){J(a,"insufficient data for block at offset "+v(m),4096);break}l+= +b[h++]&255;if(l&255){J(a,"invalid checksum ("+q(l,2,!0)+") for block at offset "+v(m),4096);break}if(t)for(J(a,"loading "+v(t)+" bytes at "+v(r)+"-"+v(r+t-1),4096);t--;)Kc(a.w,r++,b[u++]&255);else r&1?a.b.ba():null==d&&(d=r),null!=d&&J(a,"starting address: "+v(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=ma.xc&&c<=ma.gd&&(b=c-(ma.xc-ma.Vc));b&&(a.preventDefault&&a.preventDefault(),d.fc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==ma.Xc&&(b=ma.Wc);d.fc(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.fc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;var e=this;this.da=Rc(this.b,this.K?-1:48,4,262144);this.na=Oc(this.b,function(){var a;a=-1;e.I.length&&(a=e.I.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.ya&&97<=a&&122>a&&(a-=32),Qc(e.b,e.na,1E3/Math.round(e.Z/10)));0<=a&&(e.M=a,e.f&128?e.M|=49152:e.f|=128,e.f&64&&Pc(c,e.da))});this.T=Rc(this.b,this.K?-1:52,4,262144);this.za=Oc(this.b,function(){e.g|=128;e.g&64&&Pc(c,e.T)});Kb(b,this,Xg,this.K?64832+8*(this.K-1)-65392:0);Mb(b,this.reset.bind(this)); -J(this)};k.Lc=function(a){if(!this.B){var b=Dd(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ya(c[0]);if(d!=this.gb)return;c=ya(c[1]);if(this.B=ob(c)){var e=this.B.exports;if(e){var f=e.connect;f&&f.call(this.B,this.J);if(this.P=e.receiveData){this.J=a;this.S=e.receiveStatus;this.status(this.hb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -k.Ja=function(a,b){if(!b)if(this.Lc(this.J),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ia=function(a){return a?this.save():!0};k.reset=function(){Yg(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return Yg(this)};function Yg(a){a.M=0;a.f=8192;a.g=128;a.I=[];return!0} -k.fc=function(a){if("number"==typeof a)this.I.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.ma||8,c=a-this.G%a,this.ma&&(b=ta("",c)));this.ca&&!this.G&&c&&(b=String.fromCharCode(this.ca)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.G+=c}}else if(null!=this.F){if(10==a||1024<= -this.F.length)this.i(this.F),this.F="";10!=a&&(this.F+=String.fromCharCode(a))}Qc(this.b,this.za,1E3/Math.round(this.ta/10));this.g&=-129};var sh={},Xg=(sh[65392]=[null,null,Vg.prototype.ce,Vg.prototype.af,"RCSR"],sh[65394]=[null,null,Vg.prototype.be,Vg.prototype.$e,"RBUF"],sh[65396]=[null,null,Vg.prototype.De,Vg.prototype.Df,"XCSR"],sh[65398]=[null,null,Vg.prototype.Ce,Vg.prototype.Cf,"XBUF"],sh); -bb(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= -function(){var a=d.D.listTapes;a&&vh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.D[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;vh(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; -k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;this.Z=wh(a);var e=this;if((this.g=Dd(this.A,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){v("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.S=Rc(this.b,56,4,4096);this.da=Oc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Jc.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.A&&!a.A.C.la;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.hb,e,f),(e=Ea(e,f))&&Fh(a,b,c,d,e.ga,e.Ta, -e.Sa));a.C.jb=!1;a.F&&(a.F--,a.F||J(a));Ch(a)})}function zh(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.fa);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.bc?"":e)+"&format=json"));return!!Da(f, -null,!0,function(b,c,d){Mh(a,b,c,d)})} -function Mh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.A&&!a.A.C.la;if(d)a.controller.N('Unable to load disk "'+a.Ua+'" (error '+d+": "+b+")",f);else{mb(a.controller.hb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)v(h[0]);else{a.fa=h.length;a.ka=h[0].length;a.ha=h[0][0].length;var l=h[0][0][0];a.Aa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var w=l.bytes;if(void 0!==w&&w.length){for(var t=m<<2,A=w.length;A>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ma?f=a.Wa+a.Ma&&(a.Ma+=f-(a.Wa+a.Ma)+1):(a.Wa=f,a.Ma=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Ua+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=Oh(this,a++);)Rh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Rh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function R(a){x.call(this,"RK11",a,R,65536);this.J=a.autoMount||{};this.F=0;this.g=Array(8);this.K=!Ma("Mobi")&&window&&"FileReader"in window}B(R);k=R.prototype; -k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){v("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Sh(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&Th(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.K){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Da)?(a=Na(Qh(a),a.rc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.K)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Th(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Dd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.J[e]=a[e]);Uh(this);this.Eb=Rc(this.b,144,5,65536);Kb(b,this,Vh);Mb(b,this.reset.bind(this));Wh(this,"None","",!0);this.K&&Wh(this,"Local Disk","?");Wh(this,"Remote Disk","??");Xh(this)||J(this)}; -k.Ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Sh(this,0)}}return!0};k.Ia=function(a){return a?this.save():!0};k.reset=function(){Uh(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return Uh(this,a[0])};function Xh(a,b){b||(a.F=0);for(var c in a.J){var d=a.J[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}Zh(a,e,b,c,!1,d)}else Yh(a,e)} -function Zh(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ka.toLowerCase()!=d.toLowerCase()&&(g++,Yh(a,b,!0),h.xb?a.N("RK11 busy"):(h.xb=!0,e&&(h.wb=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.cb=!!f,Lh(new Hh(a,h,"preload"),c,d,f,a.Zc)&&g++));return g} -k.Zc=function(a,b,c,d,e){a.xb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.yb)),b=null);b?(a.Da=b,a.Ua=c,a.Ka=d,this.N('Mounted disk "'+c+'" in drive '+("RK"+a.yb),a.wb||e),this.A&&this.A.ob()):a.cb=!1;a.wb&&(a.wb=!1,--this.F||J(this));Sh(this,a.yb)}; -function Wh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.I=65536-e&65535;a&&(this.B=this.B|a|32768,this.f|=49152);return!0};k.$c=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=4096;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=32;break}lc(this.w,f,n|r<<8);if(Nc(this.w)){h=1024;break}f+=2;if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)}; -k.ad=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=128,e=0);for(;e--;){var n=nc(this.w,f);if(Nc(this.w)){h=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=4096;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=32;break}if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)};k.he=function(){return this.M};k.ff=function(){};k.ie=function(){return this.B};k.gf=function(){};k.ee=function(){return this.f&61438}; -k.cf=function(a){this.f=this.f&-3968|a&3967;if(this.f&1){var b,c=!0;a=(this.v&57344)>>13;var d=this.g[a],e,f,g,h;this.f&=-129;switch(this.f&14){case 0:this.M=d.status;this.B=0;this.f=128;this.v=0;break;case 4:b=this.$c;case 2:b||(b=this.ad),e=(this.v&8160)>>5,f=(this.v&16)>>4,g=this.v&15,e>=d.fa?(this.B|=32832,this.f|=49152):g>=d.ha?(this.B|=32800,this.f|=49152):(h=(this.f&48)<<12|this.G,c=65536-this.I&65535,c=b.call(this,d,e,f,g,c,h,this.Yc.bind(this)))}this.M=d.status|a<<13|this.v%9&15;c&&(this.f&= --2,this.f|=128,this.f&64&&Pc(this.b,this.Eb))}};k.je=function(){return this.I};k.hf=function(a){this.I=a};k.de=function(){return this.G};k.bf=function(a){this.G=a};k.fe=function(){return this.v};k.df=function(a){this.v=a};k.ge=function(){return this.P};k.ef=function(a){this.P=a}; -var $h={},Vh=($h[65280]=[null,null,R.prototype.he,R.prototype.ff,"RKDS"],$h[65282]=[null,null,R.prototype.ie,R.prototype.gf,"RKER"],$h[65284]=[null,null,R.prototype.ee,R.prototype.cf,"RKCS"],$h[65286]=[null,null,R.prototype.je,R.prototype.hf,"RKWC"],$h[65288]=[null,null,R.prototype.de,R.prototype.bf,"RKBA"],$h[65290]=[null,null,R.prototype.fe,R.prototype.df,"RKDA"],$h[65294]=[null,null,R.prototype.ge,R.prototype.ef,"RKDB"],$h); -function P(a){x.call(this,"RL11",a,P,131072);this.K=a.autoMount||{};this.I=0;this.g=Array(4);this.M=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; -k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){v("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&ai(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&bi(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.M){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Da)?(a=Na(Qh(a),a.rc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.M)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;bi(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Dd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.K[e]=a[e]);ci(this);this.Eb=Rc(this.b,112,5,131072);Kb(b,this,di);Mb(b,this.reset.bind(this));ei(this,"None","",!0);this.M&&ei(this,"Local Disk","?");ei(this,"Remote Disk","??");fi(this)||J(this)}; -k.Ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ai(this,0)}}return!0};k.Ia=function(a){return a?this.save():!0};k.reset=function(){ci(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return ci(this,a[0])};function fi(a,b){b||(a.I=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}hi(a,e,b,c,!1,d)}else gi(a,e)} -function hi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ka.toLowerCase()!=d.toLowerCase()&&(g++,gi(a,b,!0),h.xb?a.N("RL11 busy"):(h.xb=!0,e&&(h.wb=!0,a.I++,I(a)&&G(a,"auto-loading disk: "+c)),h.cb=!!f,Lh(new Hh(a,h,"preload"),c,d,f,a.cd)&&g++));return g} -k.cd=function(a,b,c,d,e){a.xb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.Da=b,a.Ua=c,a.Ka=d,this.N('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.wb||e),this.A&&this.A.ob()):a.cb=!1;a.wb&&(a.wb=!1,--this.I||J(this));ai(this,a.yb)}; +k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;var e=this;this.da=Tc(this.b,this.K?-1:48,4,262144);this.na=Qc(this.b,function(){var a;a=-1;e.I.length&&(a=e.I.shift()&255,J(e,"receiveByte("+q(a,2,!0)+")"),e.ua&&97<=a&&122>a&&(a-=32),Sc(e.b,e.na,1E3/Math.round(e.Y/10)));0<=a&&(e.M=a,e.f&128?e.M|=49152:e.f|=128,e.f&64&&Rc(c,e.da))});this.T=Tc(this.b,this.K?-1:52,4,262144);this.za=Qc(this.b,function(){e.g|=128;e.g&64&&Rc(c,e.T)});Mb(b,this,ch,this.K?64832+8*(this.K-1)-65392:0);Ob(b,this.reset.bind(this)); +L(this)};k.Oc=function(a){if(!this.A){var b=Gd(this.B,"connection");if(b){var c=b.split("->");if(2==c.length){var d=va(c[0]);if(d!=this.hb)return;c=va(c[1]);if(this.A=rb(c)){var e=this.A.exports;if(e){var f=e.connect;f&&f.call(this.A,this.J);if(this.P=e.receiveData){this.J=a;this.S=e.receiveStatus;this.status(this.ib+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +k.La=function(a,b){if(!b)if(this.Oc(this.J),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ka=function(a){return a?this.save():!0};k.reset=function(){dh(this)};k.save=function(){var a=new U(this);a.set(0,[]);return a.data()};k.restore=function(){return dh(this)};function dh(a){a.M=0;a.f=8192;a.g=128;a.I=[];return!0} +k.fc=function(a){if("number"==typeof a)this.I.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.ma||8,c=a-this.H%a,this.ma&&(b=ua("",c)));this.ca&&!this.H&&c&&(b=String.fromCharCode(this.ca)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.H+=c}}else if(null!=this.F){if(10==a||1024<= +this.F.length)this.i(this.F),this.F="";10!=a&&(this.F+=String.fromCharCode(a))}Sc(this.b,this.za,1E3/Math.round(this.va/10));this.g&=-129};var Bh={},ch=(Bh[65392]=[null,null,ah.prototype.ce,ah.prototype.af,"RCSR"],Bh[65394]=[null,null,ah.prototype.be,ah.prototype.$e,"RBUF"],Bh[65396]=[null,null,ah.prototype.De,ah.prototype.Df,"XCSR"],Bh[65398]=[null,null,ah.prototype.Ce,ah.prototype.Cf,"XBUF"],Bh); +eb(function(){for(var a=G(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= +function(){var a=d.D.listTapes;a&&Eh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.D[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Eh(d,w(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; +k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;this.Y=Fh(a);var e=this;if((this.g=Gd(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){x("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.S=Tc(this.b,56,4,4096);this.da=Qc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Jc.indexOf("/api/v1/dump")&&(e=pa(c),f="json"==e||"gz"==e?encodeURI(c):Ia()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ga(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.C.la;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(pb(a.ib,e,f),(e=Ha(e,f))&&Oh(a,b,c,d,e.ha,e.Ua, +e.Ta));a.C.kb=!1;a.F&&(a.F--,a.F||L(a));Lh(a)})}function Ih(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.fa);for(d=0;dc.indexOf("/api/v1/dump")&&(b=pa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):qa(c,"/")&&(d="dir"),f=Ia()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.bc?"":e)+"&format=json"));return!!Ga(f, +null,!0,function(b,c,d){Vh(a,b,c,d)})} +function Vh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.C.la;if(d)a.controller.N('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{pb(a.controller.ib,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(h.length)if(1==h.length)x(h[0]);else{a.fa=h.length;a.ka=h[0].length;a.ia=h[0][0].length;var l=h[0][0][0];a.Aa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,B=u.length;B>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Pa?f=a.Za+a.Pa&&(a.Pa+=f-(a.Za+a.Pa)+1):(a.Za=f,a.Pa=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Va+": "+c);return b}; +k.toJSON=function(){var a;a=0;for(var b;b=Xh(this,a++);)$h(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function $h(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function T(a){y.call(this,"RK11",a,T,65536);this.J=a.autoMount||{};this.F=0;this.g=Array(8);this.K=!Qa("Mobi")&&window&&"FileReader"in window}D(T);k=T.prototype; +k.xa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){x("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=na(c.value,10);null!=a&&ai(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&bi(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.K){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[na(a.value,10)||0])?(a=a.Ba)?(a=Ra(Zh(a),a.tc.replace(".json",".img")),x(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.K)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;bi(d,w(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;if((a=Gd(this.B,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.J[e]=a[e]);ci(this);this.Jb=Tc(this.b,144,5,65536);Mb(b,this,di);Ob(b,this.reset.bind(this));ei(this,"None","",!0);this.K&&ei(this,"Local Disk","?");ei(this,"Remote Disk","??");fi(this)||L(this)}; +k.La=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";ai(this,0)}}return!0};k.Ka=function(a){return a?this.save():!0};k.reset=function(){ci(this)};k.save=function(){return(new U(this)).data()}; +k.restore=function(a){return ci(this,a[0])};function fi(a,b){b||(a.F=0);for(var c in a.J){var d=a.J[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=w(c);a.status("Attempting to load "+c+' as "'+b+'"')}hi(a,e,b,c,!1,d)}else gi(a,e)} +function hi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Na.toLowerCase()!=d.toLowerCase()&&(g++,gi(a,b,!0),h.xb?a.N("RK11 busy"):(h.xb=!0,e&&(h.wb=!0,a.F++,K(a)&&J(a,"auto-loading disk: "+c)),h.eb=!!f,Uh(new Qh(a,h,"preload"),c,d,f,a.$c)&&g++));return g} +k.$c=function(a,b,c,d,e){a.xb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.yb)),b=null);b?(a.Ba=b,a.Va=c,a.Na=d,this.N('Mounted disk "'+c+'" in drive '+("RK"+a.yb),a.wb||e),this.B&&this.B.ob()):a.eb=!1;a.wb&&(a.wb=!1,--this.F||L(this));ai(this,a.yb)}; function ei(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.F=f>>16&63;this.B=this.v=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.f=this.f|a|32768);return!0}; -k.dd=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=5120;break}lc(this.w,this.b.Oa(f),n|r<<8);if(Nc(this.w)){h=8192;break}f+=2;if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.ed=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=5120,e=0);for(;e--;){var n=nc(this.w,this.b.Oa(f));if(Nc(this.w)){h=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=5120;break}if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.me=function(){return this.f&65535}; -k.lf=function(a){this.f=this.f&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.f&128)){var b;a=!0;var c=this.g[(this.f&768)>>8],d=c.Da,e,f,g;this.f&=-2;switch(this.f&14){case 4:this.G&8&&(this.f&=63);this.G=c.status|this.B&64|(d&&512==d.fa?128:0);break;case 6:1==(this.v&3)&&(b=this.v&65408,c=(this.v&16)<<2,this.B=this.v&4?this.B+b:this.B-b,this.v=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.dd;case 10:b||(b=this.ed),e=this.v>>7,f=this.v&64?1:0,g=this.v&63,!d||e>=d.fa|| -g>=d.ha?this.f|=37888:(d=(this.F&63)<<16|this.J,a=65536-this.G&65535,a=b.call(this,c,e,f,g,a,d,this.bd.bind(this)))}a&&(this.f|=129,this.f&64&&Pc(this.b,this.Eb))}};k.ke=function(){return this.J};k.jf=function(a){this.J=a&65534};k.ne=function(){return this.v};k.mf=function(a){this.v=a};k.oe=function(){return this.G};k.nf=function(a){this.G=a};k.le=function(){return this.F};k.kf=function(a){this.F=a&63;this.f=this.f&-49|(this.F&3)<<4}; -var ii={},di=(ii[63744]=[null,null,P.prototype.me,P.prototype.lf,"RLCS"],ii[63746]=[null,null,P.prototype.ke,P.prototype.jf,"RLBA"],ii[63748]=[null,null,P.prototype.ne,P.prototype.mf,"RLDA"],ii[63750]=[null,null,P.prototype.oe,P.prototype.nf,"RLMP"],ii[63752]=[null,null,P.prototype.le,P.prototype.kf,"RLBE"],ii);function ji(a){x.call(this,"Debugger",a,ji);this.ma=a.base||16;this.La=!1;this.J=0;this.T=!1;this.B=-1;this.g=[];this.ca={}}B(ji); -var ki={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};ji.prototype.Jc=function(){return-1};ji.prototype.Kc=function(){}; -function li(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.T?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a} -function mi(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; +function ai(a,b){if(0<=b&&b>12&48;this.I=65536-e&65535;this.A=this.A&-16|d&15;a&&(this.v=this.v|a|32768,this.f|=49152);return!0}; +k.ad=function(a,b,c,d,e,f,g,h){var l=0;a=a.Ba;var m=null,n;a||(l=128,e=0);for(;e--;){if(!m){m=a.seek(b,c,d+1);if(!m){l=4096;break}n=0}var r,u;if(0>(r=a.read(m,n++))||0>(u=a.read(m,n++))){l=32;break}if(!g&&(ac(this.w,f,r|u<<8),Pc(this.w))){l=1024;break}f+=2;if(n>=a.Aa&&(m=null,++d>=a.ia&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){l=64;break}}return h(l,b,c,d,e,f)}; +k.bd=function(a,b,c,d,e,f,g,h){var l=0;a=a.Ba;var m=null,n;a||(l=128,e=0);for(;e--;){var r=pc(this.w,f);if(Pc(this.w)){l=1024;break}f+=2;if(!m){m=a.seek(b,c,d+1,!0);if(!m){l=4096;break}n=0}if(g){var u,t;if(0>(u=a.read(m,n++))||0>(t=a.read(m,n++))){l=32;break}if(r!=(u|t<<8)){l=1;break}}else if(!a.write(m,n++,r&255)||!a.write(m,n++,r>>8)){l=32;break}if(n>=a.Aa&&(m=null,++d>=a.ia&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){l=64;break}}return h(l,b,c,d,e,f)};k.he=function(){return this.P};k.ff=function(){}; +k.ie=function(){return this.v};k.gf=function(){};k.ee=function(){return this.f&61438}; +k.cf=function(a){this.f=this.f&-3968|a&3967;if(this.f&1){a=!0;var b,c="",d=(this.A&57344)>>13,e=this.g[d],f,g,h,l,m;this.f&=-129;var n=(this.f&14)>>1;switch(n){case 0:K(this)&&J(this,this.type+": CRESET("+d+")",!0);this.v=0;this.f=128;this.A=0;break;case 4:f=(this.A&8160)>>5;K(this)&&J(this,this.type+": SEEK("+f+")",!0);f>=e.fa&&(this.v|=32832,this.f|=49152);break;case 5:c="RCHK";case 2:c||(c="READ"),b=this.ad;case 3:c||(c="WCHK");case 1:c||(c="WRITE");f=(this.A&8160)>>5;g=(this.A&16)>>4;h=this.A& +15;l=65536-this.I&65535;m=(this.f&48)<<12|this.H;K(this)&&J(this,this.type+": "+c+"("+f+":"+g+":"+h+") @"+p(m)+"-"+p(m+(l-1<<1)),!0);b||(b=this.bd);if(f>=e.fa){this.v|=32832;this.f|=49152;break}if(h>=e.ia){this.v|=32800;this.f|=49152;break}a=b.call(this,e,f,g,h,l,m,3<=n,this.Zc.bind(this));break;case 6:K(this)&&J(this,this.type+": DRESET("+d+")");break;default:K(this)&&J(this,this.type+": UNSUPPORTED("+n+")")}this.P=e.status|(e.Ba?128:0)|d<<13|this.A&15;this.v&32768&&K(this)&&J(this,this.type+": ERROR: "+ +p(this.v)+")");a&&(this.f&=-2,this.f|=128,this.f&64&&Rc(this.b,this.Jb))}};k.je=function(){return this.I};k.hf=function(a){this.I=a};k.de=function(){return this.H};k.bf=function(a){this.H=a};k.fe=function(){return this.A};k.df=function(a){this.A=a};k.ge=function(){return this.M};k.ef=function(a){this.M=a}; +var ii={},di=(ii[65280]=[null,null,T.prototype.he,T.prototype.ff,"RKDS"],ii[65282]=[null,null,T.prototype.ie,T.prototype.gf,"RKER"],ii[65284]=[null,null,T.prototype.ee,T.prototype.cf,"RKCS"],ii[65286]=[null,null,T.prototype.je,T.prototype.hf,"RKWC"],ii[65288]=[null,null,T.prototype.de,T.prototype.bf,"RKBA"],ii[65290]=[null,null,T.prototype.fe,T.prototype.df,"RKDA"],ii[65294]=[null,null,T.prototype.ge,T.prototype.ef,"RKDB"],ii); +function R(a){y.call(this,"RL11",a,R,131072);this.K=a.autoMount||{};this.I=0;this.g=Array(4);this.M=!Qa("Mobi")&&window&&"FileReader"in window}D(R);k=R.prototype; +k.xa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){x("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=na(c.value,10);null!=a&&ji(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&ki(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.M){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[na(a.value,10)||0])?(a=a.Ba)?(a=Ra(Zh(a),a.tc.replace(".json",".img")),x(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.M)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;ki(d,w(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;if((a=Gd(this.B,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.K[e]=a[e]);li(this);this.Jb=Tc(this.b,112,5,131072);Mb(b,this,mi);Ob(b,this.reset.bind(this));ni(this,"None","",!0);this.M&&ni(this,"Local Disk","?");ni(this,"Remote Disk","??");oi(this)||L(this)}; +k.La=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ji(this,0)}}return!0};k.Ka=function(a){return a?this.save():!0};k.reset=function(){li(this)};k.save=function(){return(new U(this)).data()}; +k.restore=function(a){return li(this,a[0])};function oi(a,b){b||(a.I=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=w(c);a.status("Attempting to load "+c+' as "'+b+'"')}qi(a,e,b,c,!1,d)}else pi(a,e)} +function qi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Na.toLowerCase()!=d.toLowerCase()&&(g++,pi(a,b,!0),h.xb?a.N("RL11 busy"):(h.xb=!0,e&&(h.wb=!0,a.I++,K(a)&&J(a,"auto-loading disk: "+c)),h.eb=!!f,Uh(new Qh(a,h,"preload"),c,d,f,a.dd)&&g++));return g} +k.dd=function(a,b,c,d,e){a.xb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.Ba=b,a.Va=c,a.Na=d,this.N('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.wb||e),this.B&&this.B.ob()):a.eb=!1;a.wb&&(a.wb=!1,--this.I||L(this));ji(this,a.yb)}; +function ni(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.F=f>>16&63;this.A=this.v=b<<7|(c?64:0)|d&63;this.H=65536-e&65535;a&&(this.f=this.f|a|32768);return!0}; +k.ed=function(a,b,c,d,e,f,g){var h=0;a=a.Ba;var l=null,m;a||(h=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=5120;break}ac(this.w,this.b.Ia(f),n|r<<8);if(Pc(this.w)){h=8192;break}f+=2;if(m>=a.Aa&&(l=null,++d>=a.ia&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.fd=function(a,b,c,d,e,f,g){var h=0;a=a.Ba;var l=null,m;a||(h=5120,e=0);for(;e--;){var n=pc(this.w,this.b.Ia(f));if(Pc(this.w)){h=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=5120;break}if(m>=a.Aa&&(l=null,++d>=a.ia&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.me=function(){return this.f&65535}; +k.lf=function(a){this.f=this.f&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.f&128)){var b;a=!0;var c=this.g[(this.f&768)>>8],d=c.Ba,e,f,g;this.f&=-2;switch(this.f&14){case 4:this.H&8&&(this.f&=63);this.H=c.status|this.A&64|(d&&512==d.fa?128:0);break;case 6:1==(this.v&3)&&(b=this.v&65408,c=(this.v&16)<<2,this.A=this.v&4?this.A+b:this.A-b,this.v=this.A=this.A&65408|c);break;case 8:this.H=this.A;break;case 12:b=this.ed;case 10:b||(b=this.fd),e=this.v>>7,f=this.v&64?1:0,g=this.v&63,!d||e>=d.fa|| +g>=d.ia?this.f|=37888:(d=(this.F&63)<<16|this.J,a=65536-this.H&65535,a=b.call(this,c,e,f,g,a,d,this.cd.bind(this)))}a&&(this.f|=129,this.f&64&&Rc(this.b,this.Jb))}};k.ke=function(){return this.J};k.jf=function(a){this.J=a&65534};k.ne=function(){return this.v};k.mf=function(a){this.v=a};k.oe=function(){return this.H};k.nf=function(a){this.H=a};k.le=function(){return this.F};k.kf=function(a){this.F=a&63;this.f=this.f&-49|(this.F&3)<<4}; +var ri={},mi=(ri[63744]=[null,null,R.prototype.me,R.prototype.lf,"RLCS"],ri[63746]=[null,null,R.prototype.ke,R.prototype.jf,"RLBA"],ri[63748]=[null,null,R.prototype.ne,R.prototype.mf,"RLDA"],ri[63750]=[null,null,R.prototype.oe,R.prototype.nf,"RLMP"],ri[63752]=[null,null,R.prototype.le,R.prototype.kf,"RLBE"],ri);function si(a){y.call(this,"Debugger",a,si);this.ma=a.base||16;this.Ga=!1;this.J=0;this.T=!1;this.A=-1;this.g=[];this.ca={}}D(si); +var ti={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};si.prototype.Mc=function(){return-1};si.prototype.Nc=function(){}; +function ui(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.T?b="end":b=a.g[a.A+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(va(b.substring(c,f))),c=f+1}}return a} +function vi(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 ni(a,b,c){var d;if(b){b=oi(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function ri(a,b){if(b)return qi(a,b,a.ca[b]);var c=0;for(b in a.ca)qi(a,b,a.ca[b]),c++;return 0this.b.kb?Bi:[];ad(this,16,function(a){a:{var b=d.w.ea,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(Ci(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.pa;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Gc[c],n&&d.i(p(n.id,8)+" %"+ -p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -k.Kc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.fb[a-8];else if(20>a)b=this.b.Pa[a-16];else{var c=this.b,d=this.v;switch(a){case 20:b=id(this.b);break;case 21:b=c.Lb;break;case 22:b=c.ra;break;case 23:b=c.nb;break;case 24:b=cd(c);break;case 25:b=ed(c);break;case 26:b=fd(c);break;case 27:b=c.Xa;break;case 28:d&&(b=d.Ca);break;case 29:d&&(b=d.Ab);break;case 30:d&&sc(d)&&(b=d.eb)}}return b}; -k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.va&65535).H));if(!this.na||a!=this.na)if(this.na=a,this.oa&1073741824)this.Z.push(a);else{var c;if(this.oa&-2147483648&&this.b&&(c=this.b.C.X)||xb(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Ld(a),a.ta=0,a.xa())}}; -function ui(a){var b;if(!Je(a))a.G&&a.G.length&&a.i("instruction history buffer freed"),a.da=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.K=Y(a.b.u[7]);b&&1!=a.P?Ji(a):Ki(a)}}function Ii(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.la?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.X?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ja=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Ia=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ui(this);this.za=0;this.na=null;this.J=0;this.K=Y(this.b.u[7]);this.C.X=!1;Li(this);a||Gd(this)};k.save=function(){var a=new S(this);a.set(0,Ei(this.K));a.set(1,Ei(this.S));a.set(2,[this.g,this.T,this.oa]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Fi(a[b++]),this.S=Fi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.T=a[b][1],this.oa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.P||this.i("running");this.C.X=!0;this.Rb=a;this.Sb=b}; -k.stop=function(a,b){if(this.C.X){this.C.X=!1;this.J=b-this.Sb;if(!this.P){b="stopped";if(this.J){a-=this.Rb;var c=0d&&(d=oc(a.b,b)),65535!=(d&65535)&&(a.sc(a.G[a.da],b),++a.da==a.G.length&&(a.da=0)));return!1}function Qf(a){var b=a.b;if(b.C.X)throw T(b,a.b.va&65535),a.ba(),-1;return!1} -function ti(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.pa],!1)}a.M=["br"];if(a.F)for(b=1;b>>d.pa],!0);a.F=["bw"];a.$a=0}k.vb=function(a,b,c){var d=!0;c||Mi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.i("invalid address: "+L(this,b.H)),d=!1;else{var f=this.w;f.ea[e>>>f.pa].vb(e&f.w,a==this.F)}}d&&(a.push(b),c?b.Va=!0:(Ni(this,a,a.length-1,"set"),ui(this)));return d}; -function Mi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.pa],b==a.F));h.Va||ui(a);break}}return f}function Oi(a,b){for(var c=1;c>23)&65535,y=L(t,w);else if(8192==C)w=w.H-((f&63)<<1)&65535,y=L(t,w);else if(12288==C)y=L(t,f&7,1);else if(24576==C)y=L(t,f&63,1);else if(32768==C)y=L(t,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), -A&63)switch(A=C&7,C&56){case 0:y=Hi(A);break;case 8:y="@"+Hi(A);break;case 16:7>A?y="("+Hi(A)+")+":(C=t.ua(w,2),y="#"+L(t,C,0,!0));break;case 24:7>A?y="@("+Hi(A)+")+":(C=t.ua(w,2),y="@#"+L(t,C,0,!0));break;case 32:y="-("+Hi(A)+")";break;case 40:y="@-("+Hi(A)+")";break;case 48:C=t.ua(w,2);y=L(t,C,0,!0)+"("+Hi(A)+")";7==A&&(y=L(t,C+w.H&65535));break;case 56:C=t.ua(w,2),y="@"+L(t,C)+"("+Hi(A)+")",7==A&&(y="@"+L(t,C+w.H&65535))}t=y;if(!t||!t.length){h="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]); -0b)c=Hi(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.fb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Pa[b-16]);else switch(b){case 20:c="PS="+L(a,id(d));break;case 21:c="IR="+L(a,d.Lb);break;case 22:c="ER="+L(a,d.ra);break;case 23:c="SL="+L(a,d.nb);break;case 24:c="MMR0="+L(a,cd(d));break;case 25:c="MMR1="+L(a,ed(d));break;case 26:c="MMR2="+L(a,fd(d));break;case 27:c="MMR3="+L(a,d.Xa);break;case 28:a.v&&(c="AR="+L(a,a.v.Ca,3));break;case 29:a.v&& -(c="DR="+L(a,a.v.Ab));break;case 30:a.v&&sc(a.v)&&(c="SR="+L(a,a.v.eb,3))}c&&(c+=" ");return c}function Si(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ri(a,"T")+Ri(a,"N")+Ri(a,"Z")+Ri(a,"V")+Ri(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Gc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Gc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Lg:b,H:c,xd:d,ia:e,Ec:f})}function Ti(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.xd;if(e>=g&&eb)){e.u[b]= -g&65535;break}a.i("unknown register: "+f);return}a.A.xa();a.i("updated registers:")}}a.i(Si(a,d));c&&(a.K=Y(e.u[7]),Ki(a,L(a,a.K.H)))}}function Xi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Qi(a,b,g,f);a.i(f);a.K=b;e-=b.H-l;c++}}} -function Pi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+L(a,a.S.H)),a.K=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.na=null;if(yb(a)&&0n||"z"va.length&&(a.i("note: only "+va.length+" available"),da=va.length);ha-=da;0>ha&&(null==va[va.length-1].H?(da=ha+da,ha=0):ha+=va.length);var ae=[];"call"==dh&&(Yb=1E5,ae=["CALL"]);for(void 0!==ch&&a.i(da+" instructions earlier:");0=va.length&&(ha=0);a.sb=da;fh++;Yb--}}fh||(a.i("no "+eh+"history available"),a.sb=void 0)}else{var sb=Ci(a,ua);if(sb){var $b=0,be=!1,ce="ds"==Qa;Ra&&(be=!0,"l"==Ra.charAt(0)&&(be=!1,Ra=Ra.substr(1)||qj),$b=pi(a,Ra)>>>0,65536<$b&&($b=65536));for(var Sa="dd"==Qa?4:"db"==Qa?1:2,Sc=(be?$b-sb.H:Sa*$b)||128,de=ce?16:a.ma,sj=(Sc+de-1)/de|0||1,Ta="";sj--&&0fe?String.fromCharCode(fe):"."),Uc=Uc>>8}Ta&&(Ta+="\n");Ta=ce?Ta+(Ua+","):Ta+(ua+": "+Ua+(0==Tc?" "+ee:""))}Ta&&a.i(Ta);a.Ya=sb}}}}break;case "e":if("else"==g[0])break;var ub,ge,he,ie,je=g[0],ke=g[1];"eb"==je?(ub=1,ge=255,he=a.dc,ie= -a.Mb):"e"==je||"ew"==je?(ub=2,ge=65535,he=a.ua,ie=a.Bb):ke=null;if(null==ke)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 Vc=Ci(a,ke);if(Vc)for(var Wc=2;Wcne;){for(var Va=null,vj=256;65536>ec.H>>>0;){oe.H=a.ua(ec,2);if(null==ec.H||!vj--)break;if(!(oe.H&1)){for(var wj=a,Xc=oe,jh=null,fc=Xc.H,kh=fc,pe=1;6>=pe&&fc;pe++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bbj){if(dj(d,this.I)){this.B=new S(this,"1.30.5","failsafe");dj(this.B)&&(ij(this,d),a=2,jj(this.B));this.B.set("timestamp",Ca());kj(this.B);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=hj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?dj(d,g):("error"== -f&&"no machine state"!=g?(this.N("Error: "+g),"unable to verify user"==g&&(La("user",""),this.A=null)):this.i(f+": "+g),jj(d),dj(d)?(c=hj(d),e=!0):c=!1))}e&&gj(this,c?d:null)}else 2==a&&d.clear()}else gj(this);delete this.I;delete this.J}e=nb(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.C.la=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(lj(this,this.b,b,c,a),this.xa(),this.b.Cb());this.P&&(ij(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.g=0}; -function ij(a,b){if(Ga("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.A||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} -function Zi(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.5"),g=new S(a,"1.30.5","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ia&&(c&&a.b.ba(),d=a.b.Ia(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.la=!1,!1===d&&(e=null)));for(var h=nb(a.id),l=0;l=c||30<=(b.Qb+=c))&&(d.textContent=b.C.X?b.na.toFixed(2)+"Mhz":"Stopped",b.Qb=0)}if(this.v&&(b=this.v,a=a||0,b.F)){c=b.b.C.X;d=!!(b.b.L&8);if(0>=a||60<=(b.B+=a)){for(var e=0;e=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=q(c,0,!0)+" "+c+". "+p(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e} +function Ai(a,b){if(b)return zi(a,b,a.ca[b]);var c=0;for(b in a.ca)zi(a,b,a.ca[b]),c++;return 0this.b.lb?Li:[];Vc(this,16,function(a){a:{var b=d.w.ea,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(Mi(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.qa;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Ic[c],n&&d.i(q(n.id,8)+" %"+ +q(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +k.Nc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.$a[a-8];else if(20>a)b=this.b.Ma[a-16];else{var c=this.b,d=this.v;switch(a){case 20:b=ld(this.b);break;case 21:b=c.Bb;break;case 22:b=c.oa;break;case 23:b=c.fb;break;case 24:b=fd(c);break;case 25:b=hd(c);break;case 26:b=id(c);break;case 27:b=c.Ra;break;case 28:d&&(b=d.Da);break;case 29:d&&(b=d.Ab);break;case 30:d&&uc(d)&&(b=d.gb)}}return b}; +k.message=function(a,b){b&&(a+=" @"+N(this,Y(this.b.sa&65535).G));if(!this.na||a!=this.na)if(this.na=a,this.pa&1073741824)this.Y.push(a);else{var c;if(this.pa&-2147483648&&this.b&&(c=this.b.C.X)||zb(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Od(a),a.Oa=0,a.ya())}}; +function Di(a){var b;if(!Pe(a))a.H&&a.H.length&&a.i("instruction history buffer freed"),a.da=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.i("trapped to "+N(a,c&255,1)+" ("+(0>d?Eb[-d]:N(a,d))+")")}a.K=Y(a.b.u[7]);b&&1!=a.P?Ti(a):Ui(a)}}function Si(a,b){var c;(c=!a.b||!Ab(a.b))||(c=a.b,c.C.la?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.X?(b||a.i("cpu busy or unavailable, command ignored"),!1):!Bb(a.b)}k.La=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Ka=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Di(this);this.za=0;this.na=null;this.J=0;this.K=Y(this.b.u[7]);this.C.X=!1;Vi(this);a||Jd(this)};k.save=function(){var a=new U(this);a.set(0,Oi(this.K));a.set(1,Oi(this.S));a.set(2,[this.g,this.T,this.pa]);a.set(3,this.I);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Pi(a[b++]),this.S=Pi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.T=a[b][1],this.pa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.P||this.i("running");this.C.X=!0;this.Eb=a;this.Fb=b}; +k.stop=function(a,b){if(this.C.X){this.C.X=!1;this.J=b-this.Fb;if(!this.P){b="stopped";if(this.J){a-=this.Eb;var c=0d&&(d=qc(a.b,b)),65535!=(d&65535)&&(a.uc(a.H[a.da],b),++a.da==a.H.length&&(a.da=0)));return!1}function Wf(a){var b=a.b;if(b.C.X)throw ae(b,a.b.sa&65535),a.ba(),-1;return!1} +function Ci(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.qa],!1)}a.M=["br"];if(a.F)for(b=1;b>>d.qa],!0);a.F=["bw"];a.ab=0}k.vb=function(a,b,c){var d=!0;c||Wi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.i("invalid address: "+N(this,b.G)),d=!1;else{var f=this.w;f.ea[e>>>f.qa].vb(e&f.w,a==this.F)}}d&&(a.push(b),c?b.Ya=!0:(Xi(this,a,a.length-1,"set"),Di(this)));return d}; +function Wi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.qa],b==a.F));h.Ya||Di(a);break}}return f}function Yi(a,b){for(var c=1;c>23)&65535,z=N(t,u);else if(8192==C)u=u.G-((f&63)<<1)&65535,z=N(t,u);else if(12288==C)z=N(t,f&7,1);else if(24576==C)z=N(t,f&63,1);else if(32768==C)z=N(t,f&255,1);else if(C=f&B,B&4032&&(C>>=6,B>>=6), +B&63)switch(B=C&7,C&56){case 0:z=Ri(B);break;case 8:z="@"+Ri(B);break;case 16:7>B?z="("+Ri(B)+")+":(C=t.wa(u,2),z="#"+N(t,C,0,!0));break;case 24:7>B?z="@("+Ri(B)+")+":(C=t.wa(u,2),z="@#"+N(t,C,0,!0));break;case 32:z="-("+Ri(B)+")";break;case 40:z="@-("+Ri(B)+")";break;case 48:C=t.wa(u,2);z=N(t,C,0,!0)+"("+Ri(B)+")";7==B&&(z=N(t,C+u.G&65535));break;case 56:C=t.wa(u,2),z="@"+N(t,C)+"("+Ri(B)+")",7==B&&(z="@"+N(t,C+u.G&65535))}t=z;if(!t||!t.length){h="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]); +0b)c=Ri(b),c+="="+N(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+N(a,d.$a[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+N(a,d.Ma[b-16]);else switch(b){case 20:c="PS="+N(a,ld(d));break;case 21:c="IR="+N(a,d.Bb);break;case 22:c="ER="+N(a,d.oa);break;case 23:c="SL="+N(a,d.fb);break;case 24:c="MMR0="+N(a,fd(d));break;case 25:c="MMR1="+N(a,hd(d));break;case 26:c="MMR2="+N(a,id(d));break;case 27:c="MMR3="+N(a,d.Ra);break;case 28:a.v&&(c="AR="+N(a,a.v.Da,3));break;case 29:a.v&& +(c="DR="+N(a,a.v.Ab));break;case 30:a.v&&uc(a.v)&&(c="SR="+N(a,a.v.gb,3))}c&&(c+=" ");return c}function bj(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=aj(a,"T")+aj(a,"N")+aj(a,"Z")+aj(a,"V")+aj(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Jc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Da(n,l,a.Jc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Lg:b,G:c,xd:d,ja:e,Hc:f})}function cj(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.xd;if(e>=g&&eb)){e.u[b]= +g&65535;break}a.i("unknown register: "+f);return}a.B.ya();a.i("updated registers:")}}a.i(bj(a,d));c&&(a.K=Y(e.u[7]),Ui(a,N(a,a.K.G)))}}function gj(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=$i(a,b,g,f);a.i(f);a.K=b;e-=b.G-l;c++}}} +function Zi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+N(a,a.S.G)),a.K=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.na=null;if(Ab(a)&&0n||"z"xa.length&&(a.i("note: only "+xa.length+" available"),fa=xa.length);ka-=fa;0>ka&&(null==xa[xa.length-1].G?(fa=ka+fa,ka=0):ka+=xa.length);var fe=[];"call"==jh&&(bc=1E5,fe=["CALL"]);for(void 0!==ih&&a.i(fa+" instructions earlier:");0=xa.length&&(ka=0);a.sb=fa;lh++;bc--}}lh||(a.i("no "+kh+"history available"),a.sb=void 0)}else{var ya=Mi(a,wa);if(ya)if("da"==Ma){var ga=a.b,ge=ya.G,za,H=[];if(ga.ca){var oh=ga.A<<1,Wc=ge>>13;7>>0,65536le?String.fromCharCode(le):"."),Zc=Zc>>8}Za&&(Za+="\n");Za=ie?Za+($a+","):Za+(wa+": "+$a+(0==Yc?" "+ke:""))}Za&&a.i(Za);a.Wa=ya}}}}break;case "e":if("else"== +g[0])break;var yb,me,ne,oe,pe=g[0],qe=g[1];"eb"==pe?(yb=1,me=255,ne=a.dc,oe=a.Rb):"e"==pe||"ew"==pe?(yb=2,me=65535,ne=a.wa,oe=a.Cb):qe=null;if(null==qe)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 $c=Mi(a,qe);if($c)for(var ad=2;adte;){for(var ab=null,Fj=256;65536>ic.G>>>0;){ue.G=a.wa(ic,2);if(null==ic.G||!Fj--)break;if(!(ue.G&1)){for(var Gj=a,bd=ue,sh=null,jc=bd.G,th=jc,ve=1;6>=ve&&jc;ve++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;blj){if(nj(d,this.I)){this.A=new U(this,"1.30.5","failsafe");nj(this.A)&&(sj(this,d),a=2,tj(this.A));this.A.set("timestamp",Fa());uj(this.A);var e=this.f&&!this.F;if(1==a||Ja("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=rj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?nj(d,g):("error"== +f&&"no machine state"!=g?(this.N("Error: "+g),"unable to verify user"==g&&(Pa("user",""),this.B=null)):this.i(f+": "+g),tj(d),nj(d)?(c=rj(d),e=!0):c=!1))}e&&qj(this,c?d:null)}else 2==a&&d.clear()}else qj(this);delete this.I;delete this.J}e=qb(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.C.la=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(vj(this,this.b,b,c,a),this.ya(),this.b.Hb());this.P&&(sj(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.g=0}; +function sj(a,b){if(Ja("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.B||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Ga("http://www.pcjs.org/api/v1/report",d,!0)}} +function ij(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new U(a,"1.30.5"),g=new U(a,"1.30.5","validate"),h=Fa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ka&&(c&&a.b.ba(),d=a.b.Ka(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.la=!1,!1===d&&(e=null)));for(var h=qb(a.id),l=0;l=c||30<=(b.Vb+=c))&&(d.textContent=b.C.X?b.za.toFixed(2)+"Mhz":"Stopped",b.Vb=0)}if(this.v&&(b=this.v,a=a||0,b.F)){c=b.b.C.X;d=!!(b.b.L&8);if(0>=a||60<=(b.A+=a)){for(var e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Cj(a,b,c)}})}else c(a,null)} -function Dj(a,b,c,d){function e(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=sa(a))}function f(a){e("Error: "+a);l&&(--pj||db(!0));l=!1}var g,h,l=!0;pj++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Aj(c,null,null,!1,e,function(d,l){l?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--pj||db(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--pj||db(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Aj(b,a,d,!0,e,m):Bj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){db(!1);return Dj(a,b,c,d)};window.enableEvents=db;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map +k.xa=function(a,b,c){var d=this;switch(b){case "power":return this.D[b]=c,c.onclick=function(){d.g||(d.C.la?ij(d,!1,!0):pj(d,d.Yb))},!0;case "reset":return this.D[b]=c,c.onclick=function(){if(d.C.la&&!d.g)if(d.f&&!d.H){var a=Ja("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");ij(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.pc=!0),d.Yb(lj),d.pc=!1)}else d.reset(),d.b&&d.b.Hb()},!0;case "save":if(qa(Ia(),"pcjs.org"))c.parentNode.removeChild(c);else return this.D[b]= +c,c.onclick=function(){var a=mj(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=ij(d,b);b?wj(d,a,c):d.N("Resume disabled, machine state not saved")}},!0}return!1}; +function mj(a,b){var c=a.B;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=xj(a,c))||a.N("The user ID is invalid.")):b&&a.N("Browser local storage is not available"));return c} +function xj(a,b){a.B=null;b=Ga(Ia()+"/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.B=b.data)}catch(d){x(d.message+" ("+c+")")}return a.B}function oj(a){var b=null;a.B&&(b=Ia()+"/api/v1/user?req=load&user="+a.B+"&state="+yj(a,"1.30.5"));return b} +function wj(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=yj(a,"1.30.5");d.data=c;b=Ga(Ia()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ga(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Mj(a,b,c)}})}else c(a,null)} +function Nj(a,b,c,d){function e(a){if(void 0===h){var b=g&&G(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=sa(a))}function f(a){e("Error: "+a);l&&(--zj||gb(!0));l=!1}var g,h,l=!0;zj++;ob[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Kj(c,null,null,!1,e,function(d,l){l?(pb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--zj||gb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--zj||gb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Kj(b,a,d,!0,e,m):Lj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){gb(!1);return Nj(a,b,c,d)};window.enableEvents=gb;window.sendEvent=hb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.5/pdp11.js b/versions/pdpjs/1.30.5/pdp11.js index 9ccffc6a6..6542313b2 100644 --- a/versions/pdpjs/1.30.5/pdp11.js +++ b/versions/pdpjs/1.30.5/pdp11.js @@ -34,237 +34,240 @@ */ for(var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da":62,"?":63,"@":64,Tb:65,Ue:66,We:67,uf:68,E:69,vf:70,wf:71,xf:72,yf:73,zf:74,Af:75,Bf:76,Cf:77,Df:78,Ef:79,Ff:80,Q:81,Gf:82,Hf:83,If:84,Jf:85,Kf:86,Lf:87,Mf:88,Nf:89,Ac:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Of:97,Pf:98,Qf:99,d:100,e:101,Sf:102,Tf:103,Uf:104,Vf:105,Yf:106,k:107,Zf:108,$f:109,n:110,ag:111,p:112,q:113,r:114,bg:115,t:116,cg:117,dg:118,eg:119,x:120,y:121,z:122,"{":123, +var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},m={Ve:0,oc:1,Xe:2,Ye:3,Ze:4,$e:5,af:6,bf:7,Xb:8,cf:9,pc:10,df:11,ef:12,qc:13,ff:14,gf:15,hf:16,jf:17,kf:18,lf:19,mf:20,nf:21,pf:22,qf:23,rf:24,sf:25,tf:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, +"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Vb:65,Ue:66,We:67,uf:68,E:69,vf:70,wf:71,xf:72,yf:73,zf:74,Af:75,Bf:76,Cf:77,Df:78,Ef:79,Ff:80,Q:81,Gf:82,Hf:83,If:84,Jf:85,Kf:86,Lf:87,Mf:88,Nf:89,Ac:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Of:97,Pf:98,Qf:99,d:100,e:101,Sf:102,Tf:103,Uf:104,Vf:105,Yf:106,k:107,Zf:108,$f:109,n:110,ag:111,p:112,q:113,r:114,bg:115,t:116,cg:117,dg:118,eg:119,x:120,y:121,z:122,"{":123, "|":124,"}":125,"~":126,rc:127}; function q(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function r(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function t(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function na(a){return a.replace(/[&<>"']/g,function(a){return ma[a]})} function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},qa=Date.now||function(){return+new Date}; function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function v(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== +function w(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function sa(a,b){var c,d={M:null,ca:null,pa:null,oa:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.pa=g.load;d.oa=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ca=g.symbols;d.M.length?1==d.M.length&&(w(d.M[0]),d=null):(w("Empty resource: "+a),d=null)}catch(k){w("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.pa=g.load;d.oa=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.da=g.symbols;d.M.length?1==d.M.length&&(x(d.M[0]),d=null):(x("Empty resource: "+a),d=null)}catch(k){x("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.ya=this.id:(this.za=this.id.substr(0,b),this.ya=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Ha:!1,Ib:!1,P:!1,error:!1};this.vb=null;this.o.error=!1;this.l={};this.G=null;this.Mc=d||0;y.push(this)}var Ma=void 0,Na={}; +function Ha(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ia(a){Da.init.push(a)}function Ja(a){if(Ga)try{for(var b=0;bb?this.Aa=this.id:(this.Ba=this.id.substr(0,b),this.Aa=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Ia:!1,Ib:!1,P:!1,error:!1};this.yb=null;this.o.error=!1;this.l={};this.G=null;this.Mc=d||0;z.push(this)}var Ma=void 0,Na={}; if(window){Ma||(Ma=window.location.search.substr(1));for(var Oa,Pa=/\+/g,Qa=/([^&=]+)=?([^&]*)/g;Oa=Qa.exec(Ma);)Na[decodeURIComponent(Oa[1].replace(Pa," "))]=decodeURIComponent(Oa[2].replace(Pa," "))}function Ra(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} -function z(a,b){b||(b=x);a.prototype=Ra(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Sa=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Sa={},y=[];function Ta(a,b,c){Sa[a]&&b&&(Sa[a][b]=c)}function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Xc,a]}z(ab);var bb=7;function cb(a,b){return a.b[b]&&a.b[b][1]}h=ab.prototype;h.reset=function(){this.stop()}; -h.aa=function(a,b,c,d){if(this.m&&this.m.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.f[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){db(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){eb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){db(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){eb(a,b)}}(this,b),!0):this.parent.aa.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;fb(b,this,gb);hb(b,this.reset.bind(this));ib(this);jb(this)};h.ka=function(a,b){b||(kb(),this.reset());return!0};h.ja=function(){return!0}; +function ab(a){y.call(this,"Panel",a,ab,512);this.la=this.i=this.c=this.j=this.s=this.u=0;this.w=this.B=this.A=!1;this.F=bb;this.f={};this.b={START:[1,1,!0,!1,this.Vc],STEP:[1,1,!1,!1,this.Wc],ENABLE:[1,1,!1,!1,this.Rc],CONT:[1,1,!0,!1,this.Pc],DEP:[0,0,!0,!1,this.Qc],EXAM:[1,1,!0,!1,this.Sc],LOAD:[1,1,!0,!1,this.Uc],TEST:[0,0,!0,!1,this.Tc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Xc,a]}B(ab);var bb=7;function cb(a,b){return a.b[b]&&a.b[b][1]}h=ab.prototype;h.reset=function(){this.stop()}; +h.ba=function(a,b,c,d){if(this.m&&this.m.ba(a,b,c,d)||this.a&&this.a.ba(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.f[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){db(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){eb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){db(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){eb(a,b)}}(this,b),!0):this.parent.ba.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;fb(b,this,gb);hb(b,this.reset.bind(this));ib(this);jb(this)};h.ka=function(a,b){b||(kb(),this.reset());return!0};h.ja=function(){return!0}; function lb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ib(a,b){for(var c in a.f)lb(a,c,null!=b?b:a.f[c])}function mb(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function jb(a){for(var b in a.b)mb(a,b,a.b[b][1])}function nb(a,b,c,d){a.l[b]&&(void 0===c&&(Ya(a,"Value for "+b+" is invalid"),H(a.a)),c=8==(a.G&&a.G.b||8)?ja(c,d):r(c,d),a.l[b].textContent!=c&&(a.l[b].textContent=c))} -function db(a,b){var c=a.b[b];mb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.B="EXAM"==b)}function eb(a,b){var c=a.b[b];c[2]&&c[3]&&(mb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Vc=function(a){a||this.a.o.S||(a=this.a,a.h.reset(),ob(a),cb(this,"ENABLE")&&pb(this.a))};h.Wc=function(){};h.Rc=function(a){a||H(this.a)}; -h.Pc=function(a){if(!a&&!this.a.o.S)if(cb(this,"ENABLE"))pb(this.a);else{a=this.G;var b;if(b=a)a.o.Ha&&(a.o.Ib=!0),b=!a.o.Ha;if(b)Wa(a,!0),a.yb(0,null),Wa(a,!1);else try{var c=this.a.yb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Sa?8:16,c=65472<=a.la&&a.la<65472+b,b=c?1:2,c=c?15:a.h.Da;cb(a,"STEP")||(b=-b);yb(a,a.la&~c|a.la+b&c)}function yb(a,b){a.la=b&a.h.Da;b=a.la;for(var c=0;22>c;c++)zb(a,"A"+c,b&1<c;c++)zb(a,"D"+c,b&1<>2;this.m=this.c-1;this.u=this.w/this.c|0;this.Ca=[];this.j=0;this.s=!1;this.A=[];this.Bc=[Db,Eb,Fb,Gb];a=new I(this);Hb(a,this.G);this.h=Array(this.u);this.f=Array(this.u);for(b=0;b>>this.b;this.B=0;this.i=this.Da;G(this)}z(Bb); -var Cb=8192,Kb=Cb-1;function Db(a,b){var c=-1,d=this.controller,e=d.Ca[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ca[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} -function Eb(a,b,c){var d=!1,e=this.controller,f=e.Ca[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ca[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Fb(a,b){var c=-1,d=this.controller;a=d.Ca[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} -function Gb(a,b,c){var d=!1,e=this.controller;a=e.Ca[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Lb(a,b){if(b!=a.B){for(var c=0;c>>a.b,a.f[a.H]=a.h[a.F])}}Bb.prototype.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ga)return l.kb+=l.Ga-f,l.Ga=f,!0;if(f>=l.Ga+l.kb){p=l.size-(f-n);p>g&&(p=g);l.kb=f-l.Ga+p;f=n+a.c;g-=p;k++;continue}}return Mb(1,f,g)}f=new I(a,f,p,a.c,d,e);Hb(f,a.G,l);a.h[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Nb[d]+" at "+ja(b)),!0):Mb(2,b,c)}function Ob(a,b){return a.f[(b&a.i)>>>a.b].Nb(b&a.m,b)} -function Pb(a,b){return a.f[(b&a.i)>>>a.b].X(b&a.m,b)}function Qb(a,b,c){a.f[(b&a.i)>>>a.b].Ab(b&a.m,c,b)}function xb(a,b){a.s=!1;a.j++;b=a.h[(b&a.Da)>>>a.b].gc(b&a.m,b);a.j--;return b}function Rb(a,b,c){a.s=!1;a.j++;a.h[(b&a.Da)>>>a.b].Sb(b&a.m,c&255,b);a.j--}function vb(a,b,c){a.s=!1;a.j++;a.h[(b&a.Da)>>>a.b].mc(b&a.m,c&65535,b);a.j--} -function Sb(a){for(var b=0,c=[],d=0;da.a.Sa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var u=g[4],A=g[5]||1,F=0;F>16&65535);a=a.Jb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.jd=function(){var a=this.a;a.Z&57344||(a.Kb=a.A&65535);return a.Kb};h.kd=function(){return this.a.Ea};h.ie=function(a){var b=this.a;1170>b.Sa&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Za=a&16?4194303:262143,dc(b))};h.Sd=function(a){a=a>>1&63;var b=this.a.jb[a>>1];return a&1?b>>16:b&65535}; -h.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.a.jb[c]=b&1?this.a.jb[c]&65535|(a&63)<<16:this.a.jb[c]&-65536|a&65534};h.Ld=function(a){return this.a.J[1][a>>1&7]};h.Je=function(a,b){this.a.J[1][b>>1&7]=a&65295};h.Jd=function(a){return this.a.J[1][(a>>1&7)+8]};h.He=function(a,b){this.a.J[1][(b>>1&7)+8]=a&65295};h.Kd=function(a){return this.a.da[1][a>>1&7]};h.Ie=function(a,b){b=b>>1&7;this.a.da[1][b]=a;this.a.J[1][b]&=65295};h.Id=function(a){return this.a.da[1][(a>>1&7)+8]}; -h.Ge=function(a,b){b=(b>>1&7)+8;this.a.da[1][b]=a;this.a.J[1][b]&=65295};h.dd=function(a){return this.a.J[0][a>>1&7]};h.ee=function(a,b){this.a.J[0][b>>1&7]=a&65295};h.bd=function(a){return this.a.J[0][(a>>1&7)+8]};h.ce=function(a,b){this.a.J[0][(b>>1&7)+8]=a&65295};h.cd=function(a){return this.a.da[0][a>>1&7]};h.de=function(a,b){b=b>>1&7;this.a.da[0][b]=a;this.a.J[0][b]&=65295};h.ad=function(a){return this.a.da[0][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.da[0][b]=a;this.a.J[0][b]&=65295}; -h.Rd=function(a){return this.a.J[3][a>>1&7]};h.Pe=function(a,b){this.a.J[3][b>>1&7]=a&65295};h.Pd=function(a){return this.a.J[3][(a>>1&7)+8]};h.Ne=function(a,b){this.a.J[3][(b>>1&7)+8]=a&65295};h.Qd=function(a){return this.a.da[3][a>>1&7]};h.Oe=function(a,b){b=b>>1&7;this.a.da[3][b]=a;this.a.J[3][b]&=65295};h.Od=function(a){return this.a.da[3][(a>>1&7)+8]};h.Me=function(a,b){b=(b>>1&7)+8;this.a.da[3][b]=a;this.a.J[3][b]&=65295};h.Ua=function(a){a&=7;return this.a.D&2048?this.a.La[a]:this.a.g[a]}; -h.Wa=function(a,b){b&=7;this.a.D&2048?this.a.La[b]=a:this.a.g[b]=a};h.pd=function(){return this.a.D&49152?this.a.ta[0]:this.a.g[6]};h.ne=function(a){this.a.D&49152?this.a.ta[0]=a:this.a.g[6]=a};h.sd=function(){return this.a.g[7]};h.qe=function(a){this.a.g[7]=a};h.Va=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.La[a]};h.Xa=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.La[b]=a};h.qd=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.ta[1]}; -h.oe=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.ta[1]=a};h.rd=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.ta[3]};h.pe=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.ta[3]=a};h.$c=function(a){return this.a.jc[a-65504>>1]};h.ae=function(a,b){this.a.jc[b-65504>>1]=a};h.fc=function(a){return 65520==a?(Tb(this.h)>>6)-1:0};h.lc=function(){};h.Nd=function(){return 1};h.Le=function(){};h.Zc=function(){return this.a.Y};h.$d=function(){this.a.Y=0};h.fd=function(){return this.a.ic}; -h.ge=function(a,b){b&1||(a&=255);this.a.ic=a};h.ld=function(a,b){return b?0:this.a.xb};h.je=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.v|=1}b.xb=a};h.Md=function(a,b){return b?0:this.a.ib&65280};h.Ke=function(a){this.a.ib=a|255};h.od=function(){return ec(this.a)};h.me=function(a){fc(this.a,a&-1793|ec(this.a)&1792)};h.kc=function(){}; +function db(a,b){var c=a.b[b];mb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.w="DEP"==b,a.B="EXAM"==b)}function eb(a,b){var c=a.b[b];c[2]&&c[3]&&(mb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Vc=function(a){a||this.a.o.S||(a=this.a,a.h.reset(),ob(a),cb(this,"ENABLE")&&pb(this.a))};h.Wc=function(){};h.Rc=function(a){a||H(this.a)}; +h.Pc=function(a){if(!a&&!this.a.o.S)if(cb(this,"ENABLE"))pb(this.a);else{a=this.G;var b;if(b=a)a.o.Ia&&(a.o.Ib=!0),b=!a.o.Ia;if(b)Wa(a,!0),a.Ab(0,null),Wa(a,!1);else try{var c=this.a.Ab(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Va?8:16,c=65472<=a.la&&a.la<65472+b,b=c?1:2,c=c?15:a.h.Ea;cb(a,"STEP")||(b=-b);yb(a,a.la&~c|a.la+b&c)}function yb(a,b){a.la=b&a.h.Ea;b=a.la;for(var c=0;22>c;c++)zb(a,"A"+c,b&1<c;c++)zb(a,"D"+c,b&1<>2;this.m=this.c-1;this.u=this.A/this.c|0;this.Da=[];this.j=0;this.s=!1;this.w=[];this.Bc=[Db,Eb,Fb,Gb];a=new I(this);Hb(a,this.G);this.h=Array(this.u);this.f=Array(this.u);for(b=0;b>>this.b;this.B=0;this.i=this.Ea;G(this)}B(Bb); +var Cb=8192,Kb=Cb-1;function Db(a,b){var c=-1,d=this.controller,e=d.Da[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Da[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} +function Eb(a,b,c){var d=!1,e=this.controller,f=e.Da[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Da[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Fb(a,b){var c=-1,d=this.controller;a=d.Da[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} +function Gb(a,b,c){var d=!1,e=this.controller;a=e.Da[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Lb(a,b){if(b!=a.B){for(var c=0;c>>a.b,a.f[a.I]=a.h[a.F])}}Bb.prototype.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ha)return l.nb+=l.Ha-f,l.Ha=f,!0;if(f>=l.Ha+l.nb){p=l.size-(f-n);p>g&&(p=g);l.nb=f-l.Ha+p;f=n+a.c;g-=p;k++;continue}}return Mb(1,f,g)}f=new I(a,f,p,a.c,d,e);Hb(f,a.G,l);a.h[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Nb[d]+" at "+ja(b)),!0):Mb(2,b,c)}function Ob(a,b){return a.f[(b&a.i)>>>a.b].Nb(b&a.m,b)} +function Pb(a,b){return a.f[(b&a.i)>>>a.b].aa(b&a.m,b)}function Qb(a,b,c){a.f[(b&a.i)>>>a.b].Cb(b&a.m,c,b)}function xb(a,b){a.s=!1;a.j++;b=a.h[(b&a.Ea)>>>a.b].ic(b&a.m,b);a.j--;return b}function Rb(a,b,c){a.s=!1;a.j++;a.h[(b&a.Ea)>>>a.b].Ub(b&a.m,c&255,b);a.j--}function vb(a,b,c){a.s=!1;a.j++;a.h[(b&a.Ea)>>>a.b].mc(b&a.m,c&65535,b);a.j--} +function Sb(a){for(var b=0,c=[],d=0;da.a.Va)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var u=g[4],v=g[5]||1,A=0;A>16&65535);a=a.ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.jd=function(){var a=this.a;a.Y&57344||(a.vb=a.w&65535);return a.vb};h.kd=function(){return this.a.ya};h.ie=function(a){var b=this.a;1170>b.Va&&(a&=-49);b.ya!=a&&(b.ya=a,b.Pa=a&16?4194303:262143,dc(b))};h.Sd=function(a){a=a>>1&63;var b=this.a.$a[a>>1];return a&1?b>>16:b&65535}; +h.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.a.$a[c]=b&1?this.a.$a[c]&65535|(a&63)<<16:this.a.$a[c]&-65536|a&65534};h.Ld=function(a){return this.a.H[1][a>>1&7]};h.Je=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Jd=function(a){return this.a.H[1][(a>>1&7)+8]};h.He=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.Kd=function(a){return this.a.Z[1][a>>1&7]};h.Ie=function(a,b){b=b>>1&7;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.Id=function(a){return this.a.Z[1][(a>>1&7)+8]}; +h.Ge=function(a,b){b=(b>>1&7)+8;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.dd=function(a){return this.a.H[0][a>>1&7]};h.ee=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[0][(a>>1&7)+8]};h.ce=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.cd=function(a){return this.a.Z[0][a>>1&7]};h.de=function(a,b){b=b>>1&7;this.a.Z[0][b]=a;this.a.H[0][b]&=65295};h.ad=function(a){return this.a.Z[0][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.Z[0][b]=a;this.a.H[0][b]&=65295}; +h.Rd=function(a){return this.a.H[3][a>>1&7]};h.Pe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.Pd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Ne=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.Qd=function(a){return this.a.Z[3][a>>1&7]};h.Oe=function(a,b){b=b>>1&7;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Od=function(a){return this.a.Z[3][(a>>1&7)+8]};h.Me=function(a,b){b=(b>>1&7)+8;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Xa=function(a){a&=7;return this.a.D&2048?this.a.Fa[a]:this.a.g[a]}; +h.ab=function(a,b){b&=7;this.a.D&2048?this.a.Fa[b]=a:this.a.g[b]=a};h.pd=function(){return this.a.D&49152?this.a.qa[0]:this.a.g[6]};h.ne=function(a){this.a.D&49152?this.a.qa[0]=a:this.a.g[6]=a};h.sd=function(){return this.a.g[7]};h.qe=function(a){this.a.g[7]=a};h.Ya=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.Fa[a]};h.bb=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.Fa[b]=a};h.qd=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.qa[1]}; +h.oe=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.qa[1]=a};h.rd=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.qa[3]};h.pe=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.qa[3]=a};h.$c=function(a){return this.a.Pb[a-65504>>1]};h.ae=function(a,b){this.a.Pb[b-65504>>1]=a};h.hc=function(a){return 65520==a?(Tb(this.h)>>6)-1:0};h.lc=function(){};h.Nd=function(){return 1};h.Le=function(){};h.Zc=function(){return this.a.X};h.$d=function(){this.a.X=0};h.fd=function(){return this.a.Ob}; +h.ge=function(a,b){b&1||(a&=255);this.a.Ob=a};h.ld=function(a,b){return b?0:this.a.mb};h.je=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.v|=1}b.mb=a};h.Md=function(a,b){return b?0:this.a.Za&65280};h.Ke=function(a){this.a.Za=a|255};h.od=function(){return ec(this.a)};h.me=function(a){fc(this.a,a&-1793|ec(this.a)&1792)};h.kc=function(){}; var N={},$b=(N[61568]=[null,null,L.prototype.Sd,L.prototype.Qe,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Ld,L.prototype.Je,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.Jd,L.prototype.He,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.Kd,L.prototype.Ie,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.Id,L.prototype.Ge,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.dd,L.prototype.ee,"KIPDR",8,1145,64],N[62672]=[null,null,L.prototype.bd,L.prototype.ce,"KDPDR",8,1145,64],N[62688]= [null,null,L.prototype.cd,L.prototype.de,"KIPAR",8,1145,64],N[62704]=[null,null,L.prototype.ad,L.prototype.be,"KDPAR",8,1145,64],N[62798]=[null,null,L.prototype.kd,L.prototype.ie,"MMR3",1,1145,64],N[65382]=[null,null,L.prototype.ed,L.prototype.fe,"LKS"],N[65402]=[null,null,L.prototype.gd,L.prototype.he,"MMR0",1,1145,64],N[65404]=[null,null,L.prototype.hd,L.prototype.kc,"MMR1",1,1145,64],N[65406]=[null,null,L.prototype.jd,L.prototype.kc,"MMR2",1,1145,64],N[65408]=[null,null,L.prototype.Rd,L.prototype.Pe, -"UIPDR",8,1145,64],N[65424]=[null,null,L.prototype.Pd,L.prototype.Ne,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.Qd,L.prototype.Oe,"UIPAR",8,1145,64],N[65456]=[null,null,L.prototype.Od,L.prototype.Me,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.Ua,L.prototype.Wa,"R0SET0"],N[65473]=[null,null,L.prototype.Ua,L.prototype.Wa,"R1SET0"],N[65474]=[null,null,L.prototype.Ua,L.prototype.Wa,"R2SET0"],N[65475]=[null,null,L.prototype.Ua,L.prototype.Wa,"R3SET0"],N[65476]=[null,null,L.prototype.Ua, -L.prototype.Wa,"R4SET0"],N[65477]=[null,null,L.prototype.Ua,L.prototype.Wa,"R5SET0"],N[65478]=[null,null,L.prototype.pd,L.prototype.ne,"R6KERNEL"],N[65479]=[null,null,L.prototype.sd,L.prototype.qe,"R7KERNEL"],N[65480]=[null,null,L.prototype.Va,L.prototype.Xa,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Va,L.prototype.Xa,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Va,L.prototype.Xa,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Va,L.prototype.Xa,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Va, -L.prototype.Xa,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Va,L.prototype.Xa,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.qd,L.prototype.oe,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.rd,L.prototype.pe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.$c,L.prototype.ae,"CTRL",8,1170],N[65520]=[null,null,L.prototype.fc,L.prototype.lc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.fc,L.prototype.lc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Nd,L.prototype.Le,"SYSID",1,1170],N[65526]= +"UIPDR",8,1145,64],N[65424]=[null,null,L.prototype.Pd,L.prototype.Ne,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.Qd,L.prototype.Oe,"UIPAR",8,1145,64],N[65456]=[null,null,L.prototype.Od,L.prototype.Me,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.Xa,L.prototype.ab,"R0SET0"],N[65473]=[null,null,L.prototype.Xa,L.prototype.ab,"R1SET0"],N[65474]=[null,null,L.prototype.Xa,L.prototype.ab,"R2SET0"],N[65475]=[null,null,L.prototype.Xa,L.prototype.ab,"R3SET0"],N[65476]=[null,null,L.prototype.Xa, +L.prototype.ab,"R4SET0"],N[65477]=[null,null,L.prototype.Xa,L.prototype.ab,"R5SET0"],N[65478]=[null,null,L.prototype.pd,L.prototype.ne,"R6KERNEL"],N[65479]=[null,null,L.prototype.sd,L.prototype.qe,"R7KERNEL"],N[65480]=[null,null,L.prototype.Ya,L.prototype.bb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Ya,L.prototype.bb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Ya,L.prototype.bb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Ya,L.prototype.bb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Ya, +L.prototype.bb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Ya,L.prototype.bb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.qd,L.prototype.oe,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.rd,L.prototype.pe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.$c,L.prototype.ae,"CTRL",8,1170],N[65520]=[null,null,L.prototype.hc,L.prototype.lc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.hc,L.prototype.lc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Nd,L.prototype.Le,"SYSID",1,1170],N[65526]= [null,null,L.prototype.Zc,L.prototype.$d,"CPUERR",1,1170],N[65528]=[null,null,L.prototype.fd,L.prototype.ge,"MB",1,1170],N[65530]=[null,null,L.prototype.ld,L.prototype.je,"PIR"],N[65532]=[null,null,L.prototype.Md,L.prototype.Ke,"SL"],N[65534]=[null,null,L.prototype.od,L.prototype.me,"PSW"],N); -Ia(function(){for(var a=E(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),nc(this,jc?oc:qc);else{a=this.a=Array(this.size>> +Ia(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),nc(this,jc?oc:qc);else{a=this.a=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ga:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ma: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.va=!0},F:function(a,b){return this.H(a,b)},T:function(a,b){return this.gc(a,b)},za:function(a,b,c){this.m?this.f(a,b,c):this.Sb(a,b,c)},ua:function(a,b,c){this.m?this.f(a,b,c):this.mc(a,b,c)},B:function(a){return this.l[a]},I:function(a){return this.l[a]},R:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},fa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},ya:function(a,b){this.l[a]=b;this.va=!0},ra:function(a,b){this.l[a]=b;this.va=!0},na:function(a,b,c){a&1&&J(this.h, -c,64);this.c.setUint16(a,b,!0);this.va=!0},Aa:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.va=!0}};function Hb(a,b,c){a.G=b;a.i=a.j=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.j=c.j)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.j||(a.zb=!a.m&&b[1]||a.f,a.Ab=!a.m&&b[3]||a.A);if(c||void 0===c)a.Sb=b[1]||a.f,a.mc=b[3]||a.A}function sc(a,b,c){c&&a.i||(a.Nb=b[0]||a.u,a.X=b[2]||a.w);if(c||void 0===c)a.H=b[0]||a.u,a.gc=b[2]||a.w}function nc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)} -var vc=[],rc=[I.prototype.L,I.prototype.ma,I.prototype.ga,I.prototype.Ba],tc=[I.prototype.F,I.prototype.za,I.prototype.T,I.prototype.ua];if(Za)var qc=[I.prototype.B,I.prototype.ya,I.prototype.R,I.prototype.na],oc=[I.prototype.I,I.prototype.ra,I.prototype.fa,I.prototype.Aa]; -function wc(a,b){x.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Cb=0;this.qb=b;this.na=c;this.Fb=Math.round(this.qb/1E4)/100;this.Ma=this.Fb*this.na;this.o.S=!1;this.o.Pb=!1;this.o.fb=a.autoStart;this.o.tb=!1;this.ob=this.Na=0;this.pb=a.csStart;this.$a=a.csInterval;this.ab=a.csStop;this.L=[];this.ec=this.Xd.bind(this);G(this)}z(wc);var xc=["power","reset"];h=wc.prototype; -h.ia=function(a,b,c,d){this.m=a;this.h=b;this.G=d;this.w=a.w;for(b=0;b=a.Na&&(a.Na+=a.$a,c=!0);0<=a.ab&&a.ab<=Bc(a)&&(a.$a=a.ab=-1,Ac(a),H(a),c=!0);c&&a.V(Bc(a)+" cycles: checksum="+r(a.ob))}} -h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.m)if(a=d.m,a.o.P)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.Ba/a.Ma&&(b=1);a.na=b;b=a.Fb*a.na;if(a.Ma!=b){a.Ma=b;b=a.Ma.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.V("target speed: "+b)}c&&a.m&&Ec(a.m)}rb(a,a.ga);a.ga=0;a.fa=qa();a.ra=0;Dc(a)}function Xb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.qb*a.na/1E3*c|0,a.o.S&&(c+=Fc(a)),a.L[b][0]=c)} -function qb(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fc(a,b){var c=a.ma-=a.a;a.a=a.I=0;b&&(a.ma=0);return c} -h.Xd=function(){if(this.o.S){this.Hb>=this.qb&&Dc(this,!0);this.cb=0;this.nb=qa();if(this.ra){var a=this.nb-this.ra;a>this.bc&&(this.fa+=a,this.fa>this.nb&&(this.fa=this.nb))}try{do{for(var b,c=this.o.tb?1:this.rb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.yb(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.cb+=b;this.ga+=b;sb(this,b);qb(this,b);this.bb-=b;if(0>=this.bb){this.bb+=this.rb;15<=++this.dc&&(this.xa(),this.dc=0);break}}while(this.o.S)}catch(f){H(this); -this.m&&this.m.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.S){a=setTimeout;b=this.ec;this.ra=qa();c=this.bc;this.cb&&(c=Math.round(c*this.cb/this.rb));c-=this.ra-this.nb;if(d=this.ra-this.fa)this.Ba=Math.round(this.ga/(10*d))/100,864E5<=d&&(this.ua=0,Cc(this));if(0>c||this.Bac&&(this.fa-=c),c=0;this.Hb+=this.cb;this.ra+=c;a(b,c)}}}; -function pb(a){var b;a.o.error?(a.V(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.S)a.V(a.toString()+" busy");else{Cc(a);a.o.S=!0;a.o.Pb=!0;if(b=a.l.run)b.textContent="Halt";a.m&&a.m.start(a.fa,Bc(a));setTimeout(a.ec,0)}}h.yb=function(){return 0};function H(a){var b=!1;if(a.o.S){Fc(a);rb(a,a.ga);a.ga=0;a.o.S=!1;if(b=a.l.run)b.textContent="Run";a.m&&a.m.stop(qa(),Bc(a));b=!0}a.o.complete=void 0;return b} -function Gc(a){this.Sa=+a.model||1170;this.Yb=a.addrReset||0;wc.call(this,a,6666667);this.sb=0;this.ac=255;1120==this.Sa?(this.decode=Hc.bind(this),this.Aa=this.Fc,this.sb=8,this.ac=-1):(this.decode=Ic.bind(this),this.Aa=this.Gc);Jc(this);this.Oa=0;this.H=null;this.Db=[];this.o.complete=!1}z(Gc,wc);h=Gc.prototype;h.Ub=function(){for(var a=192,b=0;bc.Rb&&(c.Rb=a,a+=4)}}; -h.reset=function(){this.status("model "+this.Sa);this.o.S&&H(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)}; -function Jc(a){a.j=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.Yb,-1,-2,-3,-4,-5,-6,-7,-8];a.La=[0,0,0,0,0,0];a.ta=[0,0,0,0];a.u=0;a.mb=0;a.Nc=[4,2,0,1];a.J=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.da=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0]];a.jb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.jc=[0,0,0,0,0,0,0,0];a.ic=0;a.v=0;a.B=a.F=0;a.c=a.b=a.Bb=0;a.Pa=-1;ob(a)}function ob(a){a.Z=0;a.Jb=0;a.Kb=0;a.Ea=0;a.Y=0;a.xb=0;a.ib=255;a.Ya=0;a.lb=0;a.Za=262143;a.eb=0;a.A=0;a.H=null;a.h&&(dc(a),a.Lc=Tb(a.h))}function dc(a){a.Ya?(a.T=65536,a.Eb=a.Ea&16?4186112:253952,a.R=a.Jc,a.X=a.Td,a.Ab=a.Re,Lb(a.h,a.Ea&16?22:18)):(a.T=0,a.Eb=57344,a.R=a.Ic,a.X=a.hc,a.Ab=a.nc,Lb(a.h,16))} -function cc(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Jb=a.A>>16&65535,a.Kb=a.A&65535);a.Z=b;a.lb=b>>5&3;a.mb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ya!=c&&(a.Ya=c,dc(a))}}h.$b=function(){return 0};h.save=function(){var a=new Q(this);a.set(0,[]);a.set(1,[this.ua,this.na]);a.set(2,Sb(this.h));return a.data()}; -h.restore=function(a){var b=a[1];this.ua=b[1];Cc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.D>>14&3;a.u!=c&&(a.ta[c]=a.g[6],a.g[6]=a.ta[a.u]);a.D=b;a.v&=-3;a.v|=a.H?2:1}h.ba=function(a){this.s=this.i=a;this.f=0}; -h.Fa=function(a,b){this.s=this.i=this.j=a;this.f=b||0};function Oc(a,b){a.s=a.i=a.j=b;a.f=a.s^a.j>>1}function Pc(a,b,c,d){a.s=a.i=a.j=b;a.f=(c^d)&(d^b)}function K(a,b,c,d){if(!a.Oa){0>a.Pa?a.Pa=ec(a):a.u||(d=-4);-4==d&&(a.v&256&&(d=-1),a.v|=256,a.Y|=4,a.g[6]=b=4);if(-1!=d){a.A=b|4143316992;a.u=0;var e=a.X(b|a.T),f=a.X(b+2&65535|a.T);fc(a,f&-12289|a.Pa>>2&12288);Qc(a,a.Pa);Qc(a,a.g[7]);S(a,e)}a.a-=5;a.v&=~(c|19);a.v|=129;a.Pa=-1;-1==d&&H(a);if(-4<=d)throw b;}} -function Rc(a){var b=Sc(a),c=Sc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);S(a,b);fc(a,c);a.v&=-17}function Tc(a,b){var c=b>>13&31;31>c&&(b=a.Ea&32?a.jb[c]+(b&8190)&4194302:b&-3932161);return b} -function wb(a,b,c){var d,e,f;if(!(c&a.Ya))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.Ea&a.Nc[a.u]||(d&=7);e=a.J[a.u][d];f=(a.da[a.u][d]<<6)+(b&8191)&a.Za;3932160<=f&&(f=Tc(a,f));if(a.Oa)return f;f>=a.Lc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.J[a.u][d]=e;if(f!=(4194170&a.Za)||a.u)a.lb=a.u,a.mb=d;g&&(g&57344&&(0<=a.Pa&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.lb<<5|a.mb<<1,cc(a,a.Z&-61695|g&61694)),K(a,168,64,-2)),a.Z&61440||!(f<(4191360&a.Za)||f>(4194239&a.Za))||(a.Z|=4096,a.Z&512&&(a.v|=64)));return f}function Sc(a){var b=a.X(a.g[6]|a.T);a.g[6]=a.g[6]+2&65535;return b}function Qc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;a.v&256||a.Aa(4,-2,c);a.Ab(c,b)} -function Uc(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Aa(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Aa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.X(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Aa(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.X(e)|g;a.a-=8;break;case 6:return e=a.X(Mc(a,2)),e=e+a.g[c]&65535,6==c&&a.Aa(d,0, -e),a.a-=6,e|g;case 7:return e=a.X(Mc(a,2)),e=e+a.g[c]&65535,e=a.X(e|a.T),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fc=function(a,b,c){!this.u&&0>=b&&c<=this.ib&&(this.v|=32)};h.Gc=function(a,b,c){this.u||(65534<=c&&(c|=-65536),a&4&&c<=this.ib&&(c<=this.ib-32?K(this,4,0,-4):(this.Y|=8,this.v|=32)))};h.Ic=function(a,b,c){a=Uc(this,a,b,c);3932160<=a&&(a=Tc(this,a));return a};h.Jc=function(a,b,c){return wb(this,Uc(this,a,b,c),c)}; -h.hc=function(a){3932160<=a&&(a=Tc(this,a));return Pb(this.h,this.eb=a)};h.Td=function(a){return Pb(this.h,this.eb=wb(this,a,2))};h.nc=function(a,b){3932160<=a&&(a=Tc(this,a));Qb(this.h,this.eb=a,b)};h.Re=function(a,b){Qb(this.h,this.eb=wb(this,a,4),b)};function Vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Uc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.u=a.D>>12&3,c=a.X(d|c&a.T),a.u=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.ta[a.D>>12&3];return c} -function Wc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Uc(a,b,e,4),c&65536||(e&=65535),a.u=a.D>>12&3,e=wb(a,e|c&65536,4),a.u=a.D>>14&3,Qb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.ta[a.D>>12&3]=d}function Xc(a,b){b>>=6;var c=a.F=b&7;(b=a.B=(b&56)>>3)?(c=a.R(b,c,3),a=Ob(a.h,c)):a=a.g[c+a.sb]&a.ac;return a}function Yc(a,b){b>>=6;var c=a.F=b&7;return(b=a.B=(b&56)>>3)?Pb(a.h,a.R(b,c,2)):a.g[c+a.sb]} -function Zc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Uc(a,b,c,8)}function $c(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.R(b,c,3),a=Ob(a.h,c)):a=a.g[c]&255;return a}function ad(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Pb(a.h,a.R(b,c,2)):a.g[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Bb=a.R(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Ob(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].zb(e&a.m,c,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,6),Qb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Pb(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function bd(a,b,c,d,e){var f=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].zb(d&a.m,c,d)):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} +I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Za)for(a=Array(this.size>>2),b=0;b>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ga:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ma: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.wa=!0},F:function(a,b){return this.I(a,b)},T:function(a,b){return this.ic(a,b)},Ba:function(a,b,c){this.m?this.f(a,b,c):this.Ub(a,b,c)},ua:function(a,b,c){this.m?this.f(a,b,c):this.mc(a,b,c)},B:function(a){return this.l[a]},J:function(a){return this.l[a]},R:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},fa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},Aa:function(a,b){this.l[a]=b;this.wa=!0},sa:function(a,b){this.l[a]=b;this.wa=!0},na:function(a,b,c){a&1&&J(this.h, +c,64);this.c.setUint16(a,b,!0);this.wa=!0},va:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.wa=!0}};function Hb(a,b,c){a.G=b;a.i=a.j=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.j=c.j)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.j||(a.Bb=!a.m&&b[1]||a.f,a.Cb=!a.m&&b[3]||a.w);if(c||void 0===c)a.Ub=b[1]||a.f,a.mc=b[3]||a.w}function sc(a,b,c){c&&a.i||(a.Nb=b[0]||a.u,a.aa=b[2]||a.A);if(c||void 0===c)a.I=b[0]||a.u,a.ic=b[2]||a.A}function nc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)} +var vc=[],rc=[I.prototype.L,I.prototype.ma,I.prototype.ga,I.prototype.Ca],tc=[I.prototype.F,I.prototype.Ba,I.prototype.T,I.prototype.ua];if(Za)var qc=[I.prototype.B,I.prototype.Aa,I.prototype.R,I.prototype.na],oc=[I.prototype.J,I.prototype.sa,I.prototype.fa,I.prototype.va]; +function wc(a,b){y.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Eb=0;this.rb=b;this.na=c;this.Jb=Math.round(this.rb/1E4)/100;this.Na=this.Jb*this.na;this.o.S=!1;this.o.Rb=!1;this.o.jb=a.autoStart;this.o.wb=!1;this.pb=this.Qa=0;this.qb=a.csStart;this.fb=a.csInterval;this.gb=a.csStop;this.L=[];this.gc=this.Xd.bind(this);G(this)}B(wc);var xc=["power","reset"];h=wc.prototype; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.G=d;this.A=a.A;for(b=0;b=a.Qa&&(a.Qa+=a.fb,c=!0);0<=a.gb&&a.gb<=Bc(a)&&(a.fb=a.gb=-1,Ac(a),H(a),c=!0);c&&a.W(Bc(a)+" cycles: checksum="+r(a.pb))}} +h.ba=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.m)if(a=d.m,a.o.P)a=!0;else{var b=null,c,k=C(a.id);for(c=0;ca.Ma/a.Na&&(b=1);a.na=b;b=a.Jb*a.na;if(a.Na!=b){a.Na=b;b=a.Na.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.W("target speed: "+b)}c&&a.m&&Ec(a.m)}rb(a,a.ga);a.ga=0;a.fa=qa();a.sa=0;Dc(a)}function Xb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.rb*a.na/1E3*c|0,a.o.S&&(c+=Fc(a)),a.L[b][0]=c)} +function qb(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fc(a,b){var c=a.ma-=a.a;a.a=a.J=0;b&&(a.ma=0);return c} +h.Xd=function(){if(this.o.S){this.Kb>=this.rb&&Dc(this,!0);this.ib=0;this.ob=qa();if(this.sa){var a=this.ob-this.sa;a>this.dc&&(this.fa+=a,this.fa>this.ob&&(this.fa=this.ob))}try{do{for(var b,c=this.o.wb?1:this.sb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Ab(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.ib+=b;this.ga+=b;sb(this,b);qb(this,b);this.hb-=b;if(0>=this.hb){this.hb+=this.sb;15<=++this.fc&&(this.za(),this.fc=0);break}}while(this.o.S)}catch(f){H(this); +this.m&&this.m.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.S){a=setTimeout;b=this.gc;this.sa=qa();c=this.dc;this.ib&&(c=Math.round(c*this.ib/this.sb));c-=this.sa-this.ob;if(d=this.sa-this.fa)this.Ma=Math.round(this.ga/(10*d))/100,864E5<=d&&(this.ua=0,Cc(this));if(0>c||this.Mac&&(this.fa-=c),c=0;this.Kb+=this.ib;this.sa+=c;a(b,c)}}}; +function pb(a){var b;a.o.error?(a.W(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.S)a.W(a.toString()+" busy");else{Cc(a);a.o.S=!0;a.o.Rb=!0;if(b=a.l.run)b.textContent="Halt";a.m&&a.m.start(a.fa,Bc(a));setTimeout(a.gc,0)}}h.Ab=function(){return 0};function H(a){var b=!1;if(a.o.S){Fc(a);rb(a,a.ga);a.ga=0;a.o.S=!1;if(b=a.l.run)b.textContent="Run";a.m&&a.m.stop(qa(),Bc(a));b=!0;a.G||a.status("Stopped")}a.o.complete=void 0;return b} +function Gc(a){this.Va=+a.model||1170;this.$b=a.addrReset||0;wc.call(this,a,6666667);this.tb=0;this.cc=255;1120==this.Va?(this.decode=Hc.bind(this),this.Ca=this.Fc,this.tb=8,this.cc=-1):(this.decode=Ic.bind(this),this.Ca=this.Gc);Jc(this);this.Ra=0;this.I=null;this.Db=[];this.o.complete=!1}B(Gc,wc);h=Gc.prototype;h.Wb=function(){for(var a=192,b=0;bc.Tb&&(c.Tb=a,a+=4)}}; +h.reset=function(){this.status("Model "+this.Va);this.o.S&&H(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)}; +function Jc(a){a.j=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.$b,-1,-2,-3,-4,-5,-6,-7,-8];a.Fa=[0,0,0,0,0,0];a.qa=[0,0,0,0];a.u=0;a.Nc=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Z=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0]];a.$a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Pb=[0,0,0,0,0,0,0,0];a.Ob=0;a.v=0;a.B=a.F=0;a.c=a.b=a.Hb=0;a.va=-1;ob(a)}function ob(a){a.Y=0;a.ub=0;a.vb=0;a.ya=0;a.X=0;a.mb=0;a.Za=255;a.Oa=0;a.cb=0;a.eb=0;a.Pa=262143;a.Sa=0;a.w=0;a.I=null;a.h&&(dc(a),a.Lc=Tb(a.h))}function dc(a){a.Oa?(a.T=65536,a.Fb=a.ya&16?4186112:253952,a.R=a.Jc,a.aa=a.Td,a.Cb=a.Re,Lb(a.h,a.ya&16?22:18)):(a.T=0,a.Fb=57344,a.R=a.Ic,a.aa=a.jc,a.Cb=a.nc,Lb(a.h,16))} +function cc(a,b){b&=-3073;if(a.Y!=b){b&57344&&!(a.Y&57344)&&(a.ub=a.w>>16&65535,a.vb=a.w&65535);a.Y=b;a.cb=(b&96)>>5;a.eb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Oa!=c&&(a.Oa=c,dc(a))}}h.bc=function(){return 0}; +h.save=function(){var a=new Q(this);a.set(0,[this.g,this.Fa,this.qa,this.$a,this.Pb,this.X,this.Ob,this.mb,this.Za,ec(this),this.va,this.u,this.v,this.Y,this.ub,this.vb,this.ya,this.cb,this.eb,this.H,this.Z,this.Oa,this.Pa,this.Sa,this.w]);a.set(1,[this.ua,this.na]);a.set(2,Sb(this.h));return a.data()}; +h.restore=function(a){var b=a[1];this.ua=b[1];Cc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.D>>14&3;a.u!=c&&(a.qa[c]=a.g[6],a.g[6]=a.qa[a.u]);a.D=b;a.v&=-3;a.v|=a.I?2:1}h.ca=function(a){this.s=this.i=a;this.f=0}; +h.Ga=function(a,b){this.s=this.i=this.j=a;this.f=b||0};function Oc(a,b){a.s=a.i=a.j=b;a.f=a.s^a.j>>1}function Pc(a,b,c,d){a.s=a.i=a.j=b;a.f=(c^d)&(d^b)}function K(a,b,c,d){if(!a.Ra){0>a.va?a.va=ec(a):a.u||(d=-4);-4==d&&(a.v&256&&(d=-1),a.v|=256,a.X|=4,a.g[6]=b=4);if(-1!=d){a.w=b|4143316992;a.u=0;var e=a.aa(b|a.T),f=a.aa(b+2&65535|a.T);fc(a,f&-12289|a.va>>2&12288);Qc(a,a.va);Qc(a,a.g[7]);S(a,e)}a.a-=5;a.v&=~(c|19);a.v|=129;a.va=-1;-1==d&&H(a);if(-4<=d)throw b;}} +function Rc(a){var b=Sc(a),c=Sc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);S(a,b);fc(a,c);a.v&=-17}function Tc(a,b){var c=b>>13&31;31>c&&(b=a.ya&32?a.$a[c]+(b&8190)&4194302:b&-3932161);return b} +function wb(a,b,c){var d,e,f;if(!(c&a.Oa))return f=b&65535,57344<=f&&(f|=a.Fb),f;d=b>>13;a.ya&a.Nc[a.u]||(d&=7);e=a.H[a.u][d];f=(a.Z[a.u][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=Tc(a,f));if(a.Ra)return f;f>=a.Lc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.H[a.u][d]=e;if(f!=(4194170&a.Pa)||a.u)a.cb=a.u,a.eb=d;g&&(g&57344&&(0<=a.va&&(g|=128),a.Y&57344||(g|=a.Y&4096|a.cb<<5|a.eb<<1,cc(a,a.Y&-61695|g&61694)),K(a,168,64,-2)),a.Y&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Y|=4096,a.Y&512&&(a.v|=64)));return f}function Sc(a){var b=a.aa(a.g[6]|a.T);a.g[6]=a.g[6]+2&65535;return b}function Qc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.w=a.w&65535|(a.w&-65536)<<8|16121856;a.v&256||a.Ca(4,-2,c);a.Cb(c,b)} +function Uc(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ca(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ca(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.aa(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ca(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.aa(e)|g;a.a-=8;break;case 6:return e=a.aa(Mc(a,2)),e=e+a.g[c]&65535,6==c&&a.Ca(d, +0,e),a.a-=6,e|g;case 7:return e=a.aa(Mc(a,2)),e=e+a.g[c]&65535,e=a.aa(e|a.T),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.w=a.w&65535|(a.w&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fc=function(a,b,c){!this.u&&0>=b&&c<=this.Za&&(this.v|=32)};h.Gc=function(a,b,c){this.u||(65534<=c&&(c|=-65536),a&4&&c<=this.Za&&(c<=this.Za-32?K(this,4,0,-4):(this.X|=8,this.v|=32)))};h.Ic=function(a,b,c){a=Uc(this,a,b,c);3932160<=a&&(a=Tc(this,a));return a};h.Jc=function(a,b,c){return wb(this,Uc(this,a,b,c),c)}; +h.jc=function(a){3932160<=a&&(a=Tc(this,a));return Pb(this.h,this.Sa=a)};h.Td=function(a){return Pb(this.h,this.Sa=wb(this,a,2))};h.nc=function(a,b){3932160<=a&&(a=Tc(this,a));Qb(this.h,this.Sa=a,b)};h.Re=function(a,b){Qb(this.h,this.Sa=wb(this,a,4),b)};function Vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Uc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.u=a.D>>12&3,c=a.aa(d|c&a.T),a.u=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.qa[a.D>>12&3];return c} +function Wc(a,b,c,d){a.w=a.w&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Uc(a,b,e,4),c&65536||(e&=65535),a.u=a.D>>12&3,e=wb(a,e|c&65536,4),a.u=a.D>>14&3,Qb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.qa[a.D>>12&3]=d}function Xc(a,b){b>>=6;var c=a.F=b&7;(b=a.B=(b&56)>>3)?(c=a.R(b,c,3),a=Ob(a.h,c)):a=a.g[c+a.tb]&a.cc;return a}function Yc(a,b){b>>=6;var c=a.F=b&7;return(b=a.B=(b&56)>>3)?Pb(a.h,a.R(b,c,2)):a.g[c+a.tb]} +function Zc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Uc(a,b,c,8)}function $c(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.R(b,c,3),a=Ob(a.h,c)):a=a.g[c]&255;return a}function ad(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Pb(a.h,a.R(b,c,2)):a.g[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Hb=a.R(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Ob(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].Bb(e&a.m,c,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,6),Qb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Pb(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function bd(a,b,c,d,e){var f=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].Bb(d&a.m,c,d)):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} function cd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),Qb(a.h,e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}function V(a,b,c){c&&(S(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} -h.yb=function(a){this.o.complete=!0;var b=a?this.o.Pb?0:1:-1;this.o.Pb=!1;this.ma=this.a=a;do{if(this.v){if(a=this.v&11){a=!1;if(this.v&2){var c=160,d=(this.xb&224)>>5,e=this.H&&this.H.Ta>d?this.H:null;e&&(c=e.Rb,d=e.Ta);d>(this.D&224)>>5?(this.v&8&&(Mc(this,2),this.v&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&bc(this,e),a=!0);this.H||this.xb||(this.v&=-3)}else this.v&1&&this.v++;a=a&&0>b}if(a)break;if(this.v&112&&Nc(this)&&0>b)break}this.v=this.v&15|this.D&16;this.decode(Lc(this))}while(0>1|b<<16;Oc(this,a);return a&65535} -function id(a,b){a=b&128|b>>1|b<<8;Oc(this,a<<8);return a&255}function jd(a,b){a=b&~a;this.ba(a);return a}function kd(a,b){a=b&~a;this.ba(a<<8);return a}function ld(a,b){a|=b;this.ba(a);return a}function md(a,b){a|=b;this.ba(a<<8);return a}function nd(a,b){a=~b|65536;this.Fa(a);return a&65535}function od(a,b){a=~b|256;this.Fa(a<<8);return a&255}function pd(a,b){this.s=this.i=a=b-a;this.f=b&(b^a);return a&65535}function qd(a,b){a=b-a;var c=a<<8;b<<=8;this.s=this.i=c;this.f=b&(b^c);return a&255} -function rd(a,b){this.s=this.i=a=b+a;this.f=a&(b^a);return a&65535}function sd(a,b){a=b+a;var c=a<<8;this.s=this.i=c;this.f=c&(b<<8^c);return a&255}function td(a,b){a=-b;this.Fa(a,a&b&32768);return a&65535}function ud(a,b){a=-b;this.Fa(a<<8,(a&b&128)<<8);return a&255}function vd(a,b){a=b<<1|this.j>>16&1;Oc(this,a);return a&65535}function wd(a,b){a=b<<1|this.j>>16&1;Oc(this,a<<8);return a&255}function xd(a,b){a=(this.j&65536|b)>>1|b<<16;Oc(this,a);return a&65535} -function yd(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;Oc(this,a<<8);return a&255}function zd(a,b){var c=b-a;Pc(this,c,a,b);return c&65535}function Ad(a,b){var c=b-a;Pc(this,c<<8,a<<8,b<<8);return c&255}function Bd(a,b){this.s=this.i=b&65280;this.f=this.j=0;return(b<<8|b>>8)&65535}function Cd(a,b){a^=b;this.ba(a);return a&65535}function Dd(a){U(this,a,Yc(this,a),dd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +h.Ab=function(a){this.o.complete=!0;var b=a?this.o.Rb?0:1:-1;this.o.Rb=!1;this.ma=this.a=a;do{if(this.v){if(a=this.v&11){a=!1;if(this.v&2){var c=160,d=(this.mb&224)>>5,e=this.I&&this.I.Wa>d?this.I:null;e&&(c=e.Tb,d=e.Wa);d>(this.D&224)>>5?(this.v&8&&(Mc(this,2),this.v&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&bc(this,e),a=!0);this.I||this.mb||(this.v&=-3)}else this.v&1&&this.v++;a=a&&0>b}if(a)break;if(this.v&112&&Nc(this)&&0>b)break}this.v=this.v&15|this.D&16;this.decode(Lc(this))}while(0>1|b<<16;Oc(this,a);return a&65535} +function id(a,b){a=b&128|b>>1|b<<8;Oc(this,a<<8);return a&255}function jd(a,b){a=b&~a;this.ca(a);return a}function kd(a,b){a=b&~a;this.ca(a<<8);return a}function ld(a,b){a|=b;this.ca(a);return a}function md(a,b){a|=b;this.ca(a<<8);return a}function nd(a,b){a=~b|65536;this.Ga(a);return a&65535}function od(a,b){a=~b|256;this.Ga(a<<8);return a&255}function pd(a,b){this.s=this.i=a=b-a;this.f=b&(b^a);return a&65535}function qd(a,b){a=b-a;var c=a<<8;b<<=8;this.s=this.i=c;this.f=b&(b^c);return a&255} +function rd(a,b){this.s=this.i=a=b+a;this.f=a&(b^a);return a&65535}function sd(a,b){a=b+a;var c=a<<8;this.s=this.i=c;this.f=c&(b<<8^c);return a&255}function td(a,b){a=-b;this.Ga(a,a&b&32768);return a&65535}function ud(a,b){a=-b;this.Ga(a<<8,(a&b&128)<<8);return a&255}function vd(a,b){a=b<<1|this.j>>16&1;Oc(this,a);return a&65535}function wd(a,b){a=b<<1|this.j>>16&1;Oc(this,a<<8);return a&255}function xd(a,b){a=(this.j&65536|b)>>1|b<<16;Oc(this,a);return a&65535} +function yd(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;Oc(this,a<<8);return a&255}function zd(a,b){var c=b-a;Pc(this,c,a,b);return c&65535}function Ad(a,b){var c=b-a;Pc(this,c<<8,a<<8,b<<8);return c&255}function Bd(a,b){this.s=this.i=b&65280;this.f=this.j=0;return(b<<8|b>>8)&65535}function Cd(a,b){a^=b;this.ca(a);return a&65535}function Dd(a){U(this,a,Yc(this,a),dd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} function Ed(a){var b=ad(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.j=this.f=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} function Fd(a){var b=ad(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.j=this.f=0;b&=63;if(b&32){b=64-b;32>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Gd(a){V(this,a,!R(this))}function Hd(a){V(this,a,R(this))} function Id(a){U(this,a,Yc(this,a),jd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Jd(a){T(this,a,Xc(this,a),kd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Kd(a){U(this,a,Yc(this,a),ld);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Ld(a){T(this,a,Xc(this,a),md);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function Md(a){var b=Yc(this,a);a=ad(this,a);this.ba((0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Nd(a){var b=Xc(this,a);a=$c(this,a);this.ba(((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Od(a){V(this,a,this.i&65535?0:4)}function Pd(a){V(this,a,!Kc(this)==!(this.f&32768))}function Qd(a){V(this,a,!!(this.i&65535)&&!Kc(this)==!(this.f&32768))} +function Md(a){var b=Yc(this,a);a=ad(this,a);this.ca((0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Nd(a){var b=Xc(this,a);a=$c(this,a);this.ca(((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Od(a){V(this,a,this.i&65535?0:4)}function Pd(a){V(this,a,!Kc(this)==!(this.f&32768))}function Qd(a){V(this,a,!!(this.i&65535)&&!Kc(this)==!(this.f&32768))} function Rd(a){V(this,a,!R(this)&&!!(this.i&65535))}function Sd(a){V(this,a,(this.i&65535?0:4)||!Kc(this)!=!(this.f&32768))}function Td(a){V(this,a,R(this)||(this.i&65535?0:4))}function Ud(a){V(this,a,!Kc(this)!=!(this.f&32768))}function Vd(a){V(this,a,Kc(this))}function Wd(a){V(this,a,!!(this.i&65535))}function Xd(a){V(this,a,!Kc(this))}function Yd(){K(this,12,0,-9)}function Zd(a){V(this,a,!0)}function $d(a){V(this,a,!(this.f&32768))}function ae(a){V(this,a,this.f&32768?2:0)} function W(a){a&1&&(this.j=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function be(a){var b=Yc(this,a);a=ad(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Pc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ce(a){var b=Xc(this,a);a=$c(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Pc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} function de(a){var b=ad(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.j=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.j=65536,this.a-=7}function ee(){K(this,24,0,-9);this.a-=20} -function fe(){this.D&49152?(this.Y|=128,K(this,4,0,-8)):(this.w&&1120==this.Sa&&this.w.setData(this.g[0],!0),this.G?this.G.c():H(this));this.a-=7}function ge(){K(this,16,0,-9);this.a-=20}var he=[0,7,7,10,7,11,9,13];function ie(a){this.I=this.a;S(this,Zc(this,a));this.a=this.I-he[this.c]}var je=[0,14,14,17,14,18,16,20];function ke(a){this.I=this.a;var b=Zc(this,a);a=a>>6&7;Qc(this,this.g[a]);this.g[a]=this.g[7];S(this,b);this.a=this.I-je[this.c]}var le=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function me(a){var b=Yc(this,a);this.I=this.a;cd(this,a,b,this.ba);this.a=this.I-le[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ne(a){var b=Xc(this,a);bd(this,a,b,65535,this.ba);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var oe=[7,13,13,17,14,18,17,21]; -function pe(a){var b=ad(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.s=b>>16;this.i=this.s|b;this.f=0;this.j=-32768>b||32767>6&7;Qc(this,this.g[a]);this.g[a]=this.g[7];S(this,b);this.a=this.J-je[this.c]}var le=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function me(a){var b=Yc(this,a);this.J=this.a;cd(this,a,b,this.ca);this.a=this.J-le[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ne(a){var b=Xc(this,a);bd(this,a,b,65535,this.ca);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var oe=[7,13,13,17,14,18,17,21]; +function pe(a){var b=ad(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.s=b>>16;this.i=this.s|b;this.f=0;this.j=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)S(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ve(a){U(this,a,Yc(this,a),zd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function we(a){U(this,a,0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)}function xe(){K(this,28,0,-9)} -function ye(){this.w&&(this.w.la=this.g[7],this.w.setData(this.g[0],!0));this.v|=8;Mc(this,-2);this.a-=3}function ze(a){U(this,a,this.g[(a>>6&7)+this.sb],Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-9)}function Hc(a){Ae[a>>12].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a&15].call(this,a)}function Je(a){Ke[a&15].call(this,a)}function Le(a){Me[a>>6&3].call(this,a)} +function ye(){this.A&&(this.A.la=this.g[7],this.A.setData(this.g[0],!0));this.v|=8;Mc(this,-2);this.a-=3}function ze(a){U(this,a,this.g[(a>>6&7)+this.tb],Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-9)}function Hc(a){Ae[a>>12].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a&15].call(this,a)}function Je(a){Ke[a&15].call(this,a)}function Le(a){Me[a>>6&3].call(this,a)} function Ne(a){Oe[a>>6&3].call(this,a)}function Pe(a){Qe[a>>6&3].call(this,a)} -var Ae=[function(a){Re[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,Y,function(a){Se[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],Re=[function(a){Te[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,Y,Y,Y],Ce=[function(a){cd(this,a,0,this.Fa);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ee=[function(a){U(this,a,0,td); -this.a-=this.c?11:6},function(a){U(this,a,R(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,R(this)?1:0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ad(this,a);this.Fa(a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ge=[function(a){U(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}],Te=[function(a){Ue[a& +var Ae=[function(a){Re[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,Y,function(a){Se[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],Re=[function(a){Te[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,Y,Y,Y],Ce=[function(a){cd(this,a,0,this.Ga);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ee=[function(a){U(this,a,0,td); +this.a-=this.c?11:6},function(a){U(this,a,R(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,R(this)?1:0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ad(this,a);this.Ga(a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ge=[function(a){U(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}],Te=[function(a){Ue[a& 15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,Y,He,Je,we,we,we,we],Ue=[fe,ye,te,Yd,ge,re,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ie=[qe,function(){this.j=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ke=[qe,function(){this.j=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Se=[Xd,Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,Y,Y,Y],Me=[function(a){bd(this,a,0, -255,this.Fa);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)}],Oe=[function(a){T(this,a,0,ud);this.a-=this.c?11:6},function(a){T(this,a,R(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,R(this)?1:0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=$c(this,a);this.Fa(a<<8);this.a-=this.c?4:3+(7==this.b? -2:0)}],Qe=[function(a){T(this,a,0,yd);this.a-=this.c?9+(this.Bb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,id);this.a-=this.c?9+(this.Bb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Ic(a){Ve[a>>12].call(this,a)} -var Ve=[function(a){We[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,function(a){Xe[a>>8&15].call(this,a)},function(a){Ye[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],We=[function(a){Ze[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,function(a){$e[a>>6&3].call(this,a)},Y,Y],$e=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.X(a|this.T);S(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Vc(this,a,0);this.ba(a);Qc(this,a);this.a-=11},function(a){var b=Sc(this);this.I= -this.a;this.ba(b);Wc(this,a,0,b);this.a=this.I-oe[this.c]},function(a){cd(this,a,Kc(this)?65535:0,this.ba);this.a-=this.c?9:3+(7==this.b?2:0)}],Ze=[function(a){af[a&15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,function(a){a&8?(this.D&49152||(this.D=this.D&-2017|(a&7)<<5,this.v|=1,this.v&=-3),this.a-=5):K(this,8,0,-9)},He,Je,we,we,we,we],af=[fe,ye,function(){Rc(this);this.v|=this.D&16;this.a-=13},Yd,ge,re,te,function(){K(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],Xe=[pe,pe,de,de,Ed,Ed,Fd,Fd,ze,ze,Y,Y,Y,Y,ue,ue],Ye= -[Xd,Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,function(a){bf[a>>6&3].call(this,a)},Y,Y],bf=[Y,function(a){a=Vc(this,a,65536);this.ba(a);Qc(this,a);this.a-=11},function(a){var b=Sc(this);this.I=this.a;this.ba(b);Wc(this,a,65536,b);this.a=this.I-oe[this.c]},Y]; -function cf(a){x.call(this,"ROM",a,cf,128);this.ca=this.c=null;this.i=a.addr;this.b=a.size;this.j=!1;this.f=a.alias;this.m=a.file;this.s=t(this.m);if(this.m){a=this.m;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.m+"&format=bytes&decimal=true");var c=this;v(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.m=null):(Ta(c.za,a,b),(a=sa(a,b))?(c.c=a.M,c.ca=a.ca):c.m=null);df(c)})}}z(cf);h=cf.prototype; -h.ia=function(a,b,c,d){this.h=b;this.a=c;this.G=d;df(this)};h.ka=function(){this.ca&&(this.G&&this.G.a(this.id,this.i,this.b,this.ca),delete this.ca);return!0};h.ja=function(){return!0}; +255,this.Ga);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)}],Oe=[function(a){T(this,a,0,ud);this.a-=this.c?11:6},function(a){T(this,a,R(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,R(this)?1:0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=$c(this,a);this.Ga(a<<8);this.a-=this.c?4:3+(7==this.b? +2:0)}],Qe=[function(a){T(this,a,0,yd);this.a-=this.c?9+(this.Hb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,id);this.a-=this.c?9+(this.Hb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Ic(a){Ve[a>>12].call(this,a)} +var Ve=[function(a){We[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,function(a){Xe[a>>8&15].call(this,a)},function(a){Ye[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],We=[function(a){Ze[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,function(a){$e[a>>6&3].call(this,a)},Y,Y],$e=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.aa(a|this.T);S(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Vc(this,a,0);this.ca(a);Qc(this,a);this.a-=11},function(a){var b=Sc(this);this.J= +this.a;this.ca(b);Wc(this,a,0,b);this.a=this.J-oe[this.c]},function(a){cd(this,a,Kc(this)?65535:0,this.ca);this.a-=this.c?9:3+(7==this.b?2:0)}],Ze=[function(a){af[a&15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,function(a){a&8?(this.D&49152||(this.D=this.D&-2017|(a&7)<<5,this.v|=1,this.v&=-3),this.a-=5):K(this,8,0,-9)},He,Je,we,we,we,we],af=[fe,ye,function(){Rc(this);this.v|=this.D&16;this.a-=13},Yd,ge,re,te,function(){K(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],Xe=[pe,pe,de,de,Ed,Ed,Fd,Fd,ze,ze,Y,Y,Y,Y,ue,ue],Ye= +[Xd,Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,function(a){bf[a>>6&3].call(this,a)},Y,Y],bf=[Y,function(a){a=Vc(this,a,65536);this.ca(a);Qc(this,a);this.a-=11},function(a){var b=Sc(this);this.J=this.a;this.ca(b);Wc(this,a,65536,b);this.a=this.J-oe[this.c]},Y]; +function cf(a){y.call(this,"ROM",a,cf,128);this.da=this.c=null;this.i=a.addr;this.b=a.size;this.j=!1;this.f=a.alias;this.m=a.file;this.s=t(this.m);if(this.m){a=this.m;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.m+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.m=null):(Ta(c.Ba,a,b),(a=sa(a,b))?(c.c=a.M,c.da=a.da):c.m=null);df(c)})}}B(cf);h=cf.prototype; +h.ia=function(a,b,c,d){this.h=b;this.a=c;this.G=d;df(this)};h.ka=function(){this.da&&(this.G&&this.G.a(this.id,this.i,this.b,this.da),delete this.da);return!0};h.ja=function(){return!0}; function df(a){if(!Xa(a)){if(a.m){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Cb){var c={};b=(c[b]=[cf.prototype.Hd,cf.prototype.Fe,null,null,null,a.b>>1],c);if(fb(a.h,a,b)){b=a.j=!0;break a}}else if(Ib(a.h,b,a.b,mc)){for(c=0;c>>f.b;0>>=f.b;0>>a.b;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,A=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(A)for(;A--;)Rb(a.h,p++,b[u++]&255);else p&1?H(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=m.Tb&&c<=m.Ac&&(b=c-(m.Tb-m.oc));b&&(a.preventDefault&&a.preventDefault(),d.wb(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.qc&&(b=m.pc);d.wb(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&& -a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.wb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;var e=this;this.T=Zb(this.a,this.A?-1:48,4,262144);this.ga=Xb(this.a,function(){var a;a=-1;e.u.length&&(a=e.u.shift()&255,e.ra&&97<=a&&122>a&&(a-=32),Yb(e.a,e.ga,1E3/Math.round(e.L/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&M(c,e.T))});this.I=Zb(this.a,this.A?-1:52,4,262144);this.na=Xb(this.a,function(){e.c|=128;e.c&64&&M(c,e.I)});fb(b,this,kf,this.A?64832+8*(this.A-1)-65392:0);hb(b,this.reset.bind(this));G(this)}; -h.cc=function(a){if(!this.i){var b=yc(this.m,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.ya)return;c=oa(c[1]);if(this.i=Ua(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.w);if(this.F=e.receiveData){this.w=a;this.H=e.receiveStatus;this.status(this.za+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.ka=function(a,b){if(!b)if(this.cc(this.w),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){lf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return lf(this)};function lf(a){a.B=0;a.b=8192;a.c=128;a.u=[];return!0} -h.wb=function(a){if("number"==typeof a)this.u.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d>>f.b;0>>=f.b;0>>a.b;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,v=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(v)for(;v--;)Rb(a.h,p++,b[u++]&255);else p&1?H(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=m.Vb&&c<=m.Ac&&(b=c-(m.Vb-m.oc));b&&(a.preventDefault&&a.preventDefault(),d.zb(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.qc&&(b=m.pc);d.zb(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&& +a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.zb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;var e=this;this.T=Zb(this.a,this.w?-1:48,4,262144);this.ga=Xb(this.a,function(){var a;a=-1;e.u.length&&(a=e.u.shift()&255,e.sa&&97<=a&&122>a&&(a-=32),Yb(e.a,e.ga,1E3/Math.round(e.L/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&M(c,e.T))});this.J=Zb(this.a,this.w?-1:52,4,262144);this.na=Xb(this.a,function(){e.c|=128;e.c&64&&M(c,e.J)});fb(b,this,kf,this.w?64832+8*(this.w-1)-65392:0);hb(b,this.reset.bind(this));G(this)}; +h.ec=function(a){if(!this.i){var b=yc(this.m,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.Aa)return;c=oa(c[1]);if(this.i=Ua(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.A);if(this.F=e.receiveData){this.A=a;this.I=e.receiveStatus;this.status(this.Ba+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.ka=function(a,b){if(!b)if(this.ec(this.A),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){lf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return lf(this)};function lf(a){a.B=0;a.b=8192;a.c=128;a.u=[];return!0} +h.zb=function(a){if("number"==typeof a)this.u.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.fa||8,c=a-this.s%a,this.fa&&(b=" ".slice(0,c)));this.R&&!this.s&&c&&(b=String.fromCharCode(this.R)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}}else if(null!=this.j){if(10== -a||1024<=this.j.length)this.V(this.j),this.j="";10!=a&&(this.j+=String.fromCharCode(a))}Yb(this.a,this.na,1E3/Math.round(this.ma/10));this.c&=-129};var mf={},kf=(mf[65392]=[null,null,Z.prototype.ud,Z.prototype.se,"RCSR"],mf[65394]=[null,null,Z.prototype.td,Z.prototype.re,"RBUF"],mf[65396]=[null,null,Z.prototype.Vd,Z.prototype.Te,"XCSR"],mf[65398]=[null,null,Z.prototype.Ud,Z.prototype.Se,"XBUF"],mf); -Ia(function(){for(var a=E(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.l[b]=c,c.onclick= +a||1024<=this.j.length)this.W(this.j),this.j="";10!=a&&(this.j+=String.fromCharCode(a))}Yb(this.a,this.na,1E3/Math.round(this.ma/10));this.c&=-129};var mf={},kf=(mf[65392]=[null,null,Z.prototype.ud,Z.prototype.se,"RCSR"],mf[65394]=[null,null,Z.prototype.td,Z.prototype.re,"RBUF"],mf[65396]=[null,null,Z.prototype.Vd,Z.prototype.Te,"XCSR"],mf[65398]=[null,null,Z.prototype.Ud,Z.prototype.Se,"XBUF"],mf); +Ia(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.l[b]=c,c.onclick= function(){var a=d.l.listTapes;a&&pf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;pf(d,t(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.l[b]=c,!0}return!1}; -h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;this.L=qf(a);var e=this;if((this.c=yc(this.m,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.H=Zb(this.a,56,4,4096);this.T=Xb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!v(f,null,!0,function(e,f,g){var k=0>g&&a.m&&!a.m.o.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.za,e,f),(e=sa(e,f))&&zf(a,b,c,d,e.M,e.pa,e.oa)); -a.o.Ha=!1;a.j&&(a.j--,a.j||G(a));wf(a)})}function tf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;ec.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!w(f,null,!0,function(e,f,g){var k=0>g&&a.m&&!a.m.o.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.Ba,e,f),(e=sa(e,f))&&zf(a,b,c,d,e.M,e.pa,e.oa)); +a.o.Ia=!1;a.j&&(a.j--,a.j||G(a));wf(a)})}function tf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.K);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ub?"":e)+"&format=json"));return!!v(f, +function Ff(a,b,c,d,e){var f=c;if(a.h)return!0;a.ra=b;a.ea=c;a.Qb=t(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.K=e[0];a.O=e[1];a.N=e[2];a.U=e[3]||512;c=a.U>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.K);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.xb?"":e)+"&format=json"));return!!w(f, null,!0,function(b,c,d){Gf(a,b,c,d)})} -function Gf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.m&&!a.m.o.P;if(d)a.controller.C('Unable to load disk "'+a.qa+'" (error '+d+": "+b+")",f);else{Ta(a.controller.za,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)w(k[0]);else{a.K=k.length;a.O=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var A=l.bytes;if(void 0!==A&&A.length){for(var F=n<<2,xa=A.length;xa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ha?f=a.sa+a.ha&&(a.ha+=f-(a.sa+a.ha)+1):(a.sa=f,a.ha=1);d[f]=d[f]&~(255<d&&a.m&&!a.m.o.P;if(d)a.controller.C('Unable to load disk "'+a.ra+'" (error '+d+": "+b+")",f);else{Ta(a.controller.Ba,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)x(k[0]);else{a.K=k.length;a.O=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var v=l.bytes;if(void 0!==v&&v.length){for(var A=n<<2,xa=v.length;xa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ha?f=a.ta+a.ha&&(a.ha+=f-(a.ta+a.ha)+1):(a.ta=f,a.ha=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.qa+": "+c);return b}; +b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.ra+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=If(this,a++);)Lf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Lf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function P(a){x.call(this,"RK11",a,P,65536);this.w=a.autoMount||{};this.j=0;this.c=Array(8);this.A=!Ba("Mobi")&&window&&"FileReader"in window}z(P);h=P.prototype; -h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Mf(d,a)},!0;case "loadDrive":return this.l[b]= -c,c.onclick=function(){var a=d.l.listDisks;a&&Nf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Ca(Kf(a),a.Ob.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.A)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +function Lf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function P(a){y.call(this,"RK11",a,P,65536);this.A=a.autoMount||{};this.j=0;this.c=Array(8);this.w=!Ba("Mobi")&&window&&"FileReader"in window}B(P);h=P.prototype; +h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Mf(d,a)},!0;case "loadDrive":return this.l[b]= +c,c.onclick=function(){var a=d.l.listDisks;a&&Nf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.w){c.parentNode.removeChild(c);break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.V)?(a=Ca(Kf(a),a.Qb.replace(".json",".img")),x(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.w)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Nf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;if((a=yc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);Of(this);this.Qa=Zb(this.a,144,5,65536);fb(b,this,Pf);hb(b,this.reset.bind(this));Qf(this,"None","",!0);this.A&&Qf(this,"Local Disk","?");Qf(this,"Remote Disk","??");Rf(this)||G(this)}; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;if((a=yc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);Of(this);this.Ta=Zb(this.a,144,5,65536);fb(b,this,Pf);hb(b,this.reset.bind(this));Qf(this,"None","",!0);this.w&&Qf(this,"Local Disk","?");Qf(this,"Remote Disk","??");Rf(this)||G(this)}; h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.m.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Mf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Of(this)};h.save=function(){return(new Q(this)).data()}; -h.restore=function(a){return Of(this,a[0])};function Rf(a,b){b||(a.j=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9g||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}Tf(a,e,b,c,!1,d)}else Sf(a,e)} -function Tf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,Sf(a,b,!0),k.Ja?a.C("RK11 busy"):(k.Ja=!0,e&&(k.Ia=!0,a.j++),k.wa=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.tc)&&g++));return g}h.tc=function(a,b,c,d,e){a.Ja=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ka)),b=null);b?(a.W=b,a.qa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ka),a.Ia||e),this.m&&Ec(this.m)):a.wa=!1;a.Ia&&(a.Ia=!1,--this.j||G(this));Mf(this,a.Ka)}; +function Tf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,Sf(a,b,!0),k.Ka?a.C("RK11 busy"):(k.Ka=!0,e&&(k.Ja=!0,a.j++),k.xa=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.tc)&&g++));return g}h.tc=function(a,b,c,d,e){a.Ka=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.La)),b=null);b?(a.V=b,a.ra=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.La),a.Ja||e),this.m&&Ec(this.m)):a.xa=!1;a.Ja&&(a.Ja=!1,--this.j||G(this));Mf(this,a.La)}; function Qf(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e>12&48;this.u=65536-e&65535;a&&(this.i=this.i|a|32768,this.b|=49152);return!0}; -h.uc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=4096;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=32;break}vb(this.h,f,p|u<<8);if(Wb(this.h)){k=1024;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)}; -h.vc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){var p=xb(this.h,f);if(Wb(this.h)){k=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=4096;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=32;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)};h.zd=function(){return this.B};h.xe=function(){};h.Ad=function(){return this.i};h.ye=function(){};h.wd=function(){return this.b&61438}; -h.ue=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.c[a],e,f,g,k;this.b&=-129;switch(this.b&14){case 0:this.B=d.status;this.i=0;this.b=128;this.f=0;break;case 4:b=this.uc;case 2:b||(b=this.vc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):(k=(this.b&48)<<12|this.s,c=65536-this.u&65535,c=b.call(this,d,e,f,g,c,k,this.sc.bind(this)))}this.B=d.status|a<<13|this.f%9&15;c&&(this.b&= --2,this.b|=128,this.b&64&&M(this.a,this.Qa))}};h.Bd=function(){return this.u};h.ze=function(a){this.u=a};h.vd=function(){return this.s};h.te=function(a){this.s=a};h.xd=function(){return this.f};h.ve=function(a){this.f=a};h.yd=function(){return this.F};h.we=function(a){this.F=a}; +function Mf(a,b){if(0<=b&&b>12&48;this.u=65536-e&65535;this.f=this.f&-16|d&15;a&&(this.i=this.i|a|32768,this.b|=49152);return!0}; +h.uc=function(a,b,c,d,e,f,g,k){var l=0;a=a.V;var n=null,p;a||(l=128,e=0);for(;e--;){if(!n){n=a.seek(b,c,d+1);if(!n){l=4096;break}p=0}var u,v;if(0>(u=a.read(n,p++))||0>(v=a.read(n,p++))){l=32;break}if(!g&&(vb(this.h,f,u|v<<8),Wb(this.h))){l=1024;break}f+=2;if(p>=a.U&&(n=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){l=64;break}}return k(l,b,c,d,e,f)}; +h.vc=function(a,b,c,d,e,f,g,k){var l=0;a=a.V;var n=null,p;a||(l=128,e=0);for(;e--;){var u=xb(this.h,f);if(Wb(this.h)){l=1024;break}f+=2;if(!n){n=a.seek(b,c,d+1,!0);if(!n){l=4096;break}p=0}if(g){var v,A;if(0>(v=a.read(n,p++))||0>(A=a.read(n,p++))){l=32;break}if(u!=(v|A<<8)){l=1;break}}else if(!a.write(n,p++,u&255)||!a.write(n,p++,u>>8)){l=32;break}if(p>=a.U&&(n=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){l=64;break}}return k(l,b,c,d,e,f)};h.zd=function(){return this.F};h.xe=function(){};h.Ad=function(){return this.i}; +h.ye=function(){};h.wd=function(){return this.b&61438}; +h.ue=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c=(this.f&57344)>>13,d=this.c[c],e,f,g,k,l;this.b&=-129;var n=(this.b&14)>>1;switch(n){case 0:this.i=0;this.b=128;this.f=0;break;case 4:e=(this.f&8160)>>5;e>=d.K&&(this.i|=32832,this.b|=49152);break;case 5:case 2:b=this.uc;case 3:case 1:e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,k=65536-this.u&65535,l=(this.b&48)<<12|this.s,b||(b=this.vc),e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):a=b.call(this, +d,e,f,g,k,l,3<=n,this.sc.bind(this))}this.F=d.status|(d.V?128:0)|c<<13|this.f&15;a&&(this.b&=-2,this.b|=128,this.b&64&&M(this.a,this.Ta))}};h.Bd=function(){return this.u};h.ze=function(a){this.u=a};h.vd=function(){return this.s};h.te=function(a){this.s=a};h.xd=function(){return this.f};h.ve=function(a){this.f=a};h.yd=function(){return this.B};h.we=function(a){this.B=a}; var Uf={},Pf=(Uf[65280]=[null,null,P.prototype.zd,P.prototype.xe,"RKDS"],Uf[65282]=[null,null,P.prototype.Ad,P.prototype.ye,"RKER"],Uf[65284]=[null,null,P.prototype.wd,P.prototype.ue,"RKCS"],Uf[65286]=[null,null,P.prototype.Bd,P.prototype.ze,"RKWC"],Uf[65288]=[null,null,P.prototype.vd,P.prototype.te,"RKBA"],Uf[65290]=[null,null,P.prototype.xd,P.prototype.ve,"RKDA"],Uf[65294]=[null,null,P.prototype.yd,P.prototype.we,"RKDB"],Uf); -function O(a){x.call(this,"RL11",a,O,131072);this.A=a.autoMount||{};this.u=0;this.c=Array(4);this.B=!Ba("Mobi")&&window&&"FileReader"in window}z(O);h=O.prototype; -h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Vf(d,a)},!0;case "loadDrive":return this.l[b]= -c,c.onclick=function(){var a=d.l.listDisks;a&&Wf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Ca(Kf(a),a.Ob.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +function O(a){y.call(this,"RL11",a,O,131072);this.w=a.autoMount||{};this.u=0;this.c=Array(4);this.B=!Ba("Mobi")&&window&&"FileReader"in window}B(O);h=O.prototype; +h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Vf(d,a)},!0;case "loadDrive":return this.l[b]= +c,c.onclick=function(){var a=d.l.listDisks;a&&Wf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.V)?(a=Ca(Kf(a),a.Qb.replace(".json",".img")),x(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Wf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;if((a=yc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);Xf(this);this.Qa=Zb(this.a,112,5,131072);fb(b,this,Yf);hb(b,this.reset.bind(this));Zf(this,"None","",!0);this.B&&Zf(this,"Local Disk","?");Zf(this,"Remote Disk","??");$f(this)||G(this)}; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;if((a=yc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);Xf(this);this.Ta=Zb(this.a,112,5,131072);fb(b,this,Yf);hb(b,this.reset.bind(this));Zf(this,"None","",!0);this.B&&Zf(this,"Local Disk","?");Zf(this,"Remote Disk","??");$f(this)||G(this)}; h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.m.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Vf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Xf(this)};h.save=function(){return(new Q(this)).data()}; -h.restore=function(a){return Xf(this,a[0])};function $f(a,b){b||(a.u=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9g||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}bg(a,e,b,c,!1,d)}else ag(a,e)} -function bg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,ag(a,b,!0),k.Ja?a.C("RL11 busy"):(k.Ja=!0,e&&(k.Ia=!0,a.u++),k.wa=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.xc)&&g++));return g}h.xc=function(a,b,c,d,e){a.Ja=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ka)),b=null);b?(a.W=b,a.qa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ka),a.Ia||e),this.m&&Ec(this.m)):a.wa=!1;a.Ia&&(a.Ia=!1,--this.u||G(this));Vf(this,a.Ka)}; +function bg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,ag(a,b,!0),k.Ka?a.C("RL11 busy"):(k.Ka=!0,e&&(k.Ja=!0,a.u++),k.xa=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.xc)&&g++));return g}h.xc=function(a,b,c,d,e){a.Ka=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.La)),b=null);b?(a.V=b,a.ra=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.La),a.Ja||e),this.m&&Ec(this.m)):a.xa=!1;a.Ja&&(a.Ja=!1,--this.u||G(this));Vf(this,a.La)}; function Zf(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e>12&48;this.j=f>>16&63;this.i=this.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0}; -h.yc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=5120;break}vb(this.h,Tc(this.a,f),p|u<<8);if(Wb(this.h)){k=8192;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)}; -h.zc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){var p=xb(this.h,Tc(this.a,f));if(Wb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=5120;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Ed=function(){return this.b&65535}; -h.Ce=function(a){this.b=this.b&-1023|a&1022;this.j=this.j&60|(a&48)>>4;if(!(this.b&128)){var b;a=!0;var c=this.c[(this.b&768)>>8],d=c.W,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.yc;case 10:b||(b=this.zc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>= -d.N?this.b|=37888:(d=(this.j&63)<<16|this.w,a=65536-this.s&65535,a=b.call(this,c,e,f,g,a,d,this.wc.bind(this)))}a&&(this.b|=129,this.b&64&&M(this.a,this.Qa))}};h.Cd=function(){return this.w};h.Ae=function(a){this.w=a&65534};h.Fd=function(){return this.f};h.De=function(a){this.f=a};h.Gd=function(){return this.s};h.Ee=function(a){this.s=a};h.Dd=function(){return this.j};h.Be=function(a){this.j=a&63;this.b=this.b&-49|(this.j&3)<<4}; +function Vf(a,b){if(0<=b&&b>12&48;this.j=f>>16&63;this.i=this.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0}; +h.yc=function(a,b,c,d,e,f,g){var k=0;a=a.V;var l=null,n;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=5120;break}vb(this.h,Tc(this.a,f),p|u<<8);if(Wb(this.h)){k=8192;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)}; +h.zc=function(a,b,c,d,e,f,g){var k=0;a=a.V;var l=null,n;a||(k=5120,e=0);for(;e--;){var p=xb(this.h,Tc(this.a,f));if(Wb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=5120;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Ed=function(){return this.b&65535}; +h.Ce=function(a){this.b=this.b&-1023|a&1022;this.j=this.j&60|(a&48)>>4;if(!(this.b&128)){var b;a=!0;var c=this.c[(this.b&768)>>8],d=c.V,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.yc;case 10:b||(b=this.zc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>= +d.N?this.b|=37888:(d=(this.j&63)<<16|this.A,a=65536-this.s&65535,a=b.call(this,c,e,f,g,a,d,this.wc.bind(this)))}a&&(this.b|=129,this.b&64&&M(this.a,this.Ta))}};h.Cd=function(){return this.A};h.Ae=function(a){this.A=a&65534};h.Fd=function(){return this.f};h.De=function(a){this.f=a};h.Gd=function(){return this.s};h.Ee=function(a){this.s=a};h.Dd=function(){return this.j};h.Be=function(a){this.j=a&63;this.b=this.b&-49|(this.j&3)<<4}; var cg={},Yf=(cg[63744]=[null,null,O.prototype.Ed,O.prototype.Ce,"RLCS"],cg[63746]=[null,null,O.prototype.Cd,O.prototype.Ae,"RLBA"],cg[63748]=[null,null,O.prototype.Fd,O.prototype.De,"RLDA"],cg[63750]=[null,null,O.prototype.Gd,O.prototype.Ee,"RLMP"],cg[63752]=[null,null,O.prototype.Dd,O.prototype.Be,"RLBE"],cg); -function dg(a,b,c){x.call(this,"Computer",a,dg,33554432);this.o.P=!1;eg(this,b);this.A=yc(this,"autoPower",a);this.m=0;this.L=a.busWidth||a.buswidth;this.b=fg;this.s=null;this.i=this.H=!1;this.R=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=gg(this);if(this.a=Va("CPU",this.id)){this.G=Va("Debugger",this.id);this.h=new Bb({id:this.za+".bus",busWidth:this.L},this.a,this.G);var d,e=B(this.id);if((this.w=Va("Panel",this.id))&&this.w.gb)for(b=0;b\nLicense: GPL version 3 or later ");this.V("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.W("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bfg){if(hg(d,this.s)){this.f=new Q(this,"1.30.5","failsafe");hg(this.f)&&(mg(this,d),a=2,ng(this.f));this.f.set("timestamp",ra());og(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=lg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?hg(d,g):("error"== -f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.V(f+": "+g),ng(d),hg(d)?(c=lg(d),e=!0):c=!1))}e&&kg(this,c?d:null)}else 2==a&&d.clear()}else kg(this);delete this.s;delete this.u}e=B(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.o.P=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.a&&(rg(this,this.a,b,c,a),this.xa(),this.a.fb());this.F&&(mg(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.m=0}; -function mg(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.R;d.user=c;d.type="bug";d.data=b;v("http://www.pcjs.org/api/v1/report",d,!0)}} -function sg(a,b,c){var d,e="none";if(a.m)return null;a.m--;var f=new Q(a,"1.30.5"),g=new Q(a,"1.30.5","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&H(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.P=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l=c||30<=(b.Cb+=c))&&(d.textContent=b.o.S?b.Ba.toFixed(2)+"Mhz":"Stopped",b.Cb=0)}if(this.w&&(b=this.w,a=a||0,b.u)){c=b.a.o.S;d=!!(b.a.v&8);if(0>=a||60<=(b.s+=a)){for(var e=0;efg){if(hg(d,this.s)){this.f=new Q(this,"1.30.5","failsafe");hg(this.f)&&(mg(this,d),a=2,ng(this.f));this.f.set("timestamp",ra());og(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=lg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?hg(d,g):("error"== +f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.W(f+": "+g),ng(d),hg(d)?(c=lg(d),e=!0):c=!1))}e&&kg(this,c?d:null)}else 2==a&&d.clear()}else kg(this);delete this.s;delete this.u}e=C(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.o.P=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.a&&(rg(this,this.a,b,c,a),this.za(),this.a.jb());this.F&&(mg(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.m=0}; +function mg(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.R;d.user=c;d.type="bug";d.data=b;w("http://www.pcjs.org/api/v1/report",d,!0)}} +function sg(a,b,c){var d,e="none";if(a.m)return null;a.m--;var f=new Q(a,"1.30.5"),g=new Q(a,"1.30.5","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&H(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.P=!1,!1===d&&(e=null)));for(var k=C(a.id),l=0;l=c||30<=(b.Eb+=c))&&(d.textContent=b.o.S?b.Ma.toFixed(2)+"Mhz":"Stopped",b.Eb=0)}if(this.A&&(b=this.A,a=a||0,b.u)){c=b.a.o.S;d=!!(b.a.v&8);if(0>=a||60<=(b.s+=a)){for(var e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");v(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +function zg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");w(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, "");a=a.replace(d[0],g);zg(a,b,c)}})}else c(a,null)} -function Ag(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--wg||Ka(!0));l=!1}var g,k,l=!0;wg++;Sa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| +function Ag(a,b,c,d){function e(a){if(void 0===k){var b=g&&F(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--wg||Ka(!0));l=!1}var g,k,l=!0;wg++;Sa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| (c="/versions/pdpjs/1.30.5/components.xsl");n=function(d,k){k?xg(c,null,null,!1,e,function(d,l){l?(Ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--wg||Ka(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--wg||Ka(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xg(b,a,d,!0,e,n):yg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(A){f(A.message)}return l}window.embedPDP11=function(a,b,c,d){Ka(!1);return Ag(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xg(b,a,d,!0,e,n):yg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(v){f(v.message)}return l}window.embedPDP11=function(a,b,c,d){Ka(!1);return Ag(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map