From a451bbc5bc742392cd8a99c9ebeb89272fa8f5b2 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 25 Sep 2016 15:15:06 -0700 Subject: [PATCH] Added another example of an I/O address handler (XCSR) --- modules/pdp11/lib/cpuops.js | 2 +- modules/pdp11/lib/cpustate.js | 213 ++++++++++++------------ modules/pdp11/lib/defines.js | 18 ++- modules/pdp11/lib/device.js | 100 ++++++++---- versions/pdp11/1.30.0/pdp11-dbg.js | 249 +++++++++++++++-------------- versions/pdp11/1.30.0/pdp11.js | 143 +++++++++-------- 6 files changed, 391 insertions(+), 334 deletions(-) diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 6c318b6d7..d4252d90b 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -591,7 +591,7 @@ PDP11.opCLR = function(opCode) */ PDP11.opCLRB = function(opCode) { - this.updateNZCFlags(this.writeByteByMode(opCode, 0, PDP11.WRITE.ZERO)); + this.updateNZCFlags(this.writeByteByMode(opCode, 0)); this.nStepCycles -= 1; }; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index fc9fbe0b5..2a50e9126 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -205,9 +205,9 @@ CPUStatePDP11.prototype.resetRegs = function() * Define getAddr(), readWord(), etc, handlers appropriate for the current MMU mode. * * The initial goal is to eliminate unnecessary calls to mapVirtualToPhysical(); for example, - * readWordByVirtual() always does this: + * readWordFromVirtual() always does this: * - * return this.readWordByPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ)); + * return this.readWordFromPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ)); * * and getAddrVirtual() -- formerly getAddrByMode() -- always does this: * @@ -222,11 +222,11 @@ CPUStatePDP11.prototype.initMemoryAccess = function() if (this.mmuEnable) { this.addrDSpace = PDP11.ACCESS.DSPACE; this.getAddr = this.getAddrVirtual; - this.readWord = this.readWordByVirtual; + this.readWord = this.readWordFromVirtual; } else { this.addrDSpace = 0; this.getAddr = this.getAddrPhysical; - this.readWord = this.readWordByPhysical; + this.readWord = this.readWordFromPhysical; } }; @@ -594,7 +594,7 @@ CPUStatePDP11.prototype.interrupt = function(delay, priority, vector, callback) } this.interruptQueue.splice(i + 1, 0, { "delay": delay, - "priority": priority & 0xe0, + "priority": (priority << 5) & 0xe0, "vector": vector, "callback": callback }); @@ -771,8 +771,8 @@ CPUStatePDP11.prototype.trap = function(vector, reason) this.MMR2 = vector; } this.mmuMode = 0; // read from kernel D space - if ((newPC = this.readWordByVirtual(vector | PDP11.ACCESS.DSPACE)) >= 0) { - if ((newPSW = this.readWordByVirtual(((vector + 2) & 0xffff) | PDP11.ACCESS.DSPACE)) >= 0) { + if ((newPC = this.readWordFromVirtual(vector | PDP11.ACCESS.DSPACE)) >= 0) { + if ((newPSW = this.readWordFromVirtual(((vector + 2) & 0xffff) | PDP11.ACCESS.DSPACE)) >= 0) { this.setPSW((newPSW & 0xcfff) | ((this.trapPSW >> 2) & 0x3000)); // set new this.PSW with previous mode if (doubleTrap) { this.regCPUErr |= PDP11.CPUERR.RED; @@ -964,13 +964,13 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl }; /** - * readWordByPhysical(physicalAddress) [formerly readWordByAddr] + * readWordFromPhysical(physicalAddress) [formerly readWordByAddr] * * @this {CPUStatePDP11} * @param {number} physicalAddress * @return {number} */ -CPUStatePDP11.prototype.readWordByPhysical = function(physicalAddress) +CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress) { if (physicalAddress >= BusPDP11.MAX_ADDRESS) { return this.regsGen[physicalAddress - BusPDP11.MAX_ADDRESS]; @@ -987,25 +987,25 @@ CPUStatePDP11.prototype.readWordByPhysical = function(physicalAddress) }; /** - * readWordByVirtual(virtualAddress) + * readWordFromVirtual(virtualAddress) * * @this {CPUStatePDP11} * @param {number} virtualAddress (input address is 17 bit (I&D)) */ -CPUStatePDP11.prototype.readWordByVirtual = function(virtualAddress) +CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress) { - return this.readWordByPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ)); + return this.readWordFromPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ)); }; /** - * writeWordByPhysical(physicalAddress, data) [formerly writeWordByAddr] + * writeWordToPhysical(physicalAddress, data) [formerly writeWordByAddr] * * @this {CPUStatePDP11} * @param {number} physicalAddress * @param {number} data * @return {number} */ -CPUStatePDP11.prototype.writeWordByPhysical = function(physicalAddress, data) +CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data) { data &= 0xffff; if (physicalAddress >= BusPDP11.MAX_ADDRESS) { @@ -1024,13 +1024,13 @@ CPUStatePDP11.prototype.writeWordByPhysical = function(physicalAddress, data) }; /** - * readByteByPhysical(physicalAddress) [formerly readByteByAddr] + * readByteFromPhysical(physicalAddress) [formerly readByteByAddr] * * @this {CPUStatePDP11} * @param {number} physicalAddress * @return {number} */ -CPUStatePDP11.prototype.readByteByPhysical = function(physicalAddress) +CPUStatePDP11.prototype.readByteFromPhysical = function(physicalAddress) { var result; if (physicalAddress >= BusPDP11.MAX_ADDRESS) { @@ -1048,14 +1048,14 @@ CPUStatePDP11.prototype.readByteByPhysical = function(physicalAddress) }; /** - * writeByteByPhysical(physicalAddress, data) [formerly writeByteByAddr] + * writeByteToPhysical(physicalAddress, data) [formerly writeByteByAddr] * * @this {CPUStatePDP11} * @param {number} physicalAddress * @param {number} data * @return {number} */ -CPUStatePDP11.prototype.writeByteByPhysical = function(physicalAddress, data) +CPUStatePDP11.prototype.writeByteToPhysical = function(physicalAddress, data) { data &= 0xff; if (physicalAddress >= BusPDP11.MAX_ADDRESS) { @@ -1081,7 +1081,7 @@ CPUStatePDP11.prototype.writeByteByPhysical = function(physicalAddress, data) */ CPUStatePDP11.prototype.popWord = function() { - var result = this.readWordByVirtual(this.regsGen[6] | PDP11.ACCESS.DSPACE); + var result = this.readWordFromVirtual(this.regsGen[6] | PDP11.ACCESS.DSPACE); if (result >= 0) { this.regsGen[6] = (this.regsGen[6] + 2) & 0xffff; } @@ -1113,7 +1113,7 @@ CPUStatePDP11.prototype.pushWord = function(data) } } if ((physicalAddress = this.mapVirtualToPhysical(virtualAddress | PDP11.ACCESS.DSPACE, PDP11.ACCESS.WRITE)) >= 0) { - return this.writeWordByPhysical(physicalAddress, data); + return this.writeWordToPhysical(physicalAddress, data); } return physicalAddress; }; @@ -1185,7 +1185,7 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags) stepSize = 2; virtualAddress = this.regsGen[reg]; if (reg !== 7) virtualAddress |= this.addrDSpace; - if ((virtualAddress = this.readWordByVirtual(virtualAddress)) < 0) { + if ((virtualAddress = this.readWordFromVirtual(virtualAddress)) < 0) { return virtualAddress; } // if (reg === 7) LOG_ADDRESS(virtualAddress); // @#n not operational @@ -1203,13 +1203,13 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags) stepSize = -2; virtualAddress = (this.regsGen[reg] - 2) & 0xffff; if (reg !== 7) virtualAddress |= this.addrDSpace; - if ((virtualAddress = this.readWordByVirtual(virtualAddress)) < 0) { + if ((virtualAddress = this.readWordFromVirtual(virtualAddress)) < 0) { return virtualAddress; } virtualAddress |= this.addrDSpace; break; case 6: // Mode 6: d(R) - if ((virtualAddress = this.readWordByVirtual(this.regsGen[7])) < 0) { + if ((virtualAddress = this.readWordFromVirtual(this.regsGen[7])) < 0) { return virtualAddress; } this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff; @@ -1222,7 +1222,7 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags) } return virtualAddress | this.addrDSpace; case 7: // Mode 7: @d(R) - if ((virtualAddress = this.readWordByVirtual(this.regsGen[7])) < 0) { + if ((virtualAddress = this.readWordFromVirtual(this.regsGen[7])) < 0) { return virtualAddress; } this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff; @@ -1233,7 +1233,7 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags) virtualAddress = (virtualAddress + this.regsGen[reg]) & 0xffff; //LOG_ADDRESS(virtualAddress); } - if ((virtualAddress = this.readWordByVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) < 0) { + if ((virtualAddress = this.readWordFromVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) < 0) { return virtualAddress; } return virtualAddress | this.addrDSpace; @@ -1306,7 +1306,7 @@ CPUStatePDP11.prototype.readWordByMode = function(addressMode) result = this.regsGen[addressMode & PDP11.OPREG.MASK]; } else { /* - * NOTE: This used to call readWordByPhysical(), after calling getAddrVirtual(), but the latter is + * NOTE: This used to call readWordFromPhysical(), after calling getAddrVirtual(), but the latter is * just a wrapper around mapVirtualToPhysical() on the result from getVirtualByMode(), so now we call * getVirtualByMode() directly, knowing that the current readWord() will call the correct function. */ @@ -1328,7 +1328,7 @@ CPUStatePDP11.prototype.readByteByMode = function(addressMode) if (!(addressMode & 0x38)) { result = this.regsGen[addressMode & 7] & 0xff; } else { - result = this.readByteByPhysical(this.getAddr(addressMode, PDP11.ACCESS.READ_BYTE)); + result = this.readByteFromPhysical(this.getAddr(addressMode, PDP11.ACCESS.READ_BYTE)); } return result; }; @@ -1352,7 +1352,7 @@ CPUStatePDP11.prototype.updateWordByMode = function(addressMode, src, fnOp) this.regsGen[reg] = (data = fnOp.call(this, src, this.regsGen[reg]) & 0xffff); } else { var addr = this.getAddr(addressMode, PDP11.ACCESS.UPDATE); - this.writeWordByPhysical(addr, (data = fnOp.call(this, src, this.readWordByPhysical(addr)))); + this.writeWordToPhysical(addr, (data = fnOp.call(this, src, this.readWordFromPhysical(addr)))); } return data; }; @@ -1376,7 +1376,7 @@ CPUStatePDP11.prototype.updateByteByMode = function(addressMode, src, fnOp) this.regsGen[reg] = (this.regsGen[reg] & 0xff00) | ((data = fnOp.call(this, src, this.regsGen[reg]) & 0xff)); } else { var addr = this.getAddr(addressMode, PDP11.ACCESS.UPDATE_BYTE); - this.writeByteByPhysical(addr, (data = fnOp.call(this, src, this.readByteByPhysical(addr)))); + this.writeByteToPhysical(addr, (data = fnOp.call(this, src, this.readByteFromPhysical(addr)))); } return data; }; @@ -1396,7 +1396,7 @@ CPUStatePDP11.prototype.writeWordByMode = function(addressMode, data) if (!(addressMode & PDP11.OPMODE.MASK)) { this.regsGen[addressMode & PDP11.OPREG.MASK] = data & 0xffff; } else { - this.writeWordByPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE), data); + this.writeWordToPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE), data); } return data; }; @@ -1416,16 +1416,15 @@ CPUStatePDP11.prototype.writeByteByMode = function(addressMode, data, writeFlags { if (!(addressMode & PDP11.OPMODE.MASK)) { var reg = addressMode & PDP11.OPREG.MASK; - if (!writeFlags) { - this.regsGen[reg] = (this.regsGen[reg] & ~0xff) | (data & 0xff); - } else if (writeFlags & PDP11.WRITE.ZERO) { - this.regsGen[reg] &= ~0xff; - } else { - this.assert(writeFlags & PDP11.WRITE.SIGNEXT); + if (!data) { + this.regsGen[reg] &= ~0xff; // TODO: Profile to determine if this is a win + } else if (writeFlags & PDP11.WRITE.SIGNEXT) { this.regsGen[reg] = ((data << 24) >> 24) & 0xffff; + } else { + this.regsGen[reg] = (this.regsGen[reg] & ~0xff) | (data & 0xff); } } else { - this.writeByteByPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE_BYTE), data); + this.writeByteToPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE_BYTE), data); } return data; }; @@ -1600,7 +1599,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) * it to detect if our new decode() function has processed (ie, "consumed") the opcode, * by setting it to -1. If it has, then we can skip the older opcode decode logic below. */ - this.regOp = opCode = this.readWordByVirtual(this.regsGen[7]); + this.regOp = opCode = this.readWordFromVirtual(this.regsGen[7]); if (opCode >= 0) this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff; this.decode(opCode); @@ -1616,7 +1615,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // this.flagV = 0; // } else { // if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE)) >= 0) { - // if (this.writeWordByPhysical(dstAddr, src) >= 0) { + // if (this.writeWordToPhysical(dstAddr, src) >= 0) { // this.flagN = this.flagZ = src; // this.flagV = 0; // } @@ -1651,9 +1650,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // this.flagN = this.flagZ = result; // this.flagV = 0; // } else { - // if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { + // if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { // result = dst & ~src; - // if (this.writeWordByPhysical(dstAddr, result) >= 0) { + // if (this.writeWordToPhysical(dstAddr, result) >= 0) { // this.flagN = this.flagZ = result; // this.flagV = 0; // } @@ -1669,9 +1668,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // this.flagN = this.flagZ = result; // this.flagV = 0; // } else { - // if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { + // if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { // result = dst | src; - // if (this.writeWordByPhysical(dstAddr, result) >= 0) { + // if (this.writeWordToPhysical(dstAddr, result) >= 0) { // this.flagN = this.flagZ = result; // this.flagV = 0; // } @@ -1689,9 +1688,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // this.flagN = this.flagZ = this.flagC = result; // this.flagV = (src ^ result) & (dst ^ result); // } else { - // if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { + // if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { // result = src + dst; - // if (this.writeWordByPhysical(dstAddr, result) >= 0) { + // if (this.writeWordToPhysical(dstAddr, result) >= 0) { // this.flagN = this.flagZ = this.flagC = result; // this.flagV = (src ^ result) & (dst ^ result); // } @@ -1709,7 +1708,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // this.flagV = 0; // } else { // if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte - // if (this.writeByteByPhysical(dstAddr, src) >= 0) { + // if (this.writeByteToPhysical(dstAddr, src) >= 0) { // this.flagN = this.flagZ = src << 8; // this.flagV = 0; // } @@ -1739,9 +1738,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) case 0xC000: /*0140000*/ // BICB 14SSDD //LOG_INSTRUCTION(opCode, 2, "BICB"); // if ((src = this.readByteByMode(opCode >> 6)) >= 0) { - // if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { + // if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { // result = dst & ~src; - // if (this.writeByteByPhysical(dstAddr, result) >= 0) { + // if (this.writeByteToPhysical(dstAddr, result) >= 0) { // this.flagN = this.flagZ = result << 8; // this.flagV = 0; // } @@ -1751,9 +1750,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) case 0xD000: /*0150000*/ // BISB 15SSDD //LOG_INSTRUCTION(opCode, 2, "BISB"); // if ((src = this.readByteByMode(opCode >> 6)) >= 0) { - // if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { + // if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { // result = dst | src; - // if (this.writeByteByPhysical(dstAddr, result) >= 0) { + // if (this.writeByteToPhysical(dstAddr, result) >= 0) { // this.flagN = this.flagZ = result << 8; // this.flagV = 0; // } @@ -1770,9 +1769,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // this.flagN = this.flagZ = this.flagC = result; // this.flagV = (src ^ dst) & (dst ^ result); // } else { - // if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { + // if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { // result = dst - src; - // if (this.writeWordByPhysical(dstAddr, result) >= 0) { + // if (this.writeWordToPhysical(dstAddr, result) >= 0) { // this.flagN = this.flagZ = this.flagC = result; // this.flagV = (src ^ dst) & (dst ^ result); // } @@ -1909,9 +1908,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = dst; this.flagV = 0; } else { - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { dst ^= this.regsGen[(opCode >> 6) & 7]; - if (this.writeWordByPhysical(dstAddr, dst) >= 0) { + if (this.writeWordToPhysical(dstAddr, dst) >= 0) { this.flagN = this.flagZ = dst; this.flagV = 0; } @@ -2019,10 +2018,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = dst & 0xff00; this.flagV = this.flagC = 0; } else { - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = (dst << 8) | (dst >> 8); - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = dst & 0xff00; this.flagV = this.flagC = 0; } @@ -2036,7 +2035,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // this.flagN = this.flagC = this.flagV = this.flagZ = 0; // } else { // if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE)) >= 0) { // write word - // if (this.writeWordByPhysical(dstAddr, 0) >= 0) { + // if (this.writeWordToPhysical(dstAddr, 0) >= 0) { // this.flagN = this.flagC = this.flagV = this.flagZ = 0; // } // } @@ -2047,10 +2046,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = ~dst; - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = result; this.flagC = 0x10000; this.flagV = 0; @@ -2067,10 +2066,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = result; this.flagV = result & (result ^ dst); } else { - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst + 1; - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = result; this.flagV = result & (result ^ dst); } @@ -2087,10 +2086,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = result; this.flagV = (result ^ dst) & dst; } else { - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst - 1; - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = result; this.flagV = (result ^ dst) & dst; } @@ -2102,10 +2101,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = -dst; - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagC = this.flagN = this.flagZ = result; this.flagV = result & dst; } @@ -2116,10 +2115,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst + ((this.flagC >> 16) & 1); - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagC = this.flagN = this.flagZ = result; this.flagV = result & (result ^ dst); } @@ -2130,10 +2129,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst - ((this.flagC >> 16) & 1); - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagC = this.flagN = this.flagZ = result; this.flagV = (result ^ dst) & dst; } @@ -2157,10 +2156,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = result; this.flagV = result ^ (this.flagC >> 1); } else { - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = ((this.flagC & 0x10000) | dst) >> 1; - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagC = (dst << 16); this.flagN = this.flagZ = result; this.flagV = result ^ (this.flagC >> 1); @@ -2178,10 +2177,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagC = this.flagN = this.flagZ = result; this.flagV = result ^ dst; } else { - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = (dst << 1) | ((this.flagC >> 16) & 1); - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagC = this.flagN = this.flagZ = result; this.flagV = result ^ dst; } @@ -2199,10 +2198,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = result; this.flagV = this.flagN ^ (this.flagC >> 1); } else { - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = (dst & 0x8000) | (dst >> 1); - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagC = dst << 16; this.flagN = this.flagZ = result; this.flagV = this.flagN ^ (this.flagC >> 1); @@ -2220,10 +2219,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagC = this.flagN = this.flagZ = result; this.flagV = result ^ dst; } else { - if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst << 1; - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagC = this.flagN = this.flagZ = result; this.flagV = result ^ dst; } @@ -2233,7 +2232,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) case 0xD00: /*0006400*/ // MARK 0064nn //LOG_INSTRUCTION(opCode, 8, "MARK"); virtualAddress = (this.regsGen[7] + ((opCode & 0x3F) /*077*/ << 1)) & 0xffff; - if ((src = this.readWordByVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) >= 0) { + if ((src = this.readWordFromVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) >= 0) { this.regsGen[7] = this.regsGen[5]; this.regsGen[5] = src; this.regsGen[6] = (virtualAddress + 2) & 0xffff; @@ -2256,7 +2255,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) { if ((this.PSW & 0xf000) !== 0xf000) virtualAddress &= 0xffff; this.mmuMode = (this.PSW >> 12) & 3; - if ((src = this.readWordByVirtual(virtualAddress)) >= 0) { + if ((src = this.readWordFromVirtual(virtualAddress)) >= 0) { this.mmuMode = (this.PSW >> 14) & 3; if (this.pushWord(src) >= 0) { this.flagN = this.flagZ = src; @@ -2285,7 +2284,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.mmuMode = (this.PSW >> 12) & 3; if ((dstAddr = this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.WRITE)) >= 0) { this.mmuMode = (this.PSW >> 14) & 3; - if (this.writeWordByPhysical(dstAddr, dst) >= 0) { + if (this.writeWordToPhysical(dstAddr, dst) >= 0) { this.flagN = this.flagZ = dst; this.flagV = 0; } @@ -2301,7 +2300,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) */ if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE)) >= 0) { // write word result = -((this.flagN >> 15) & 1); - if (this.writeWordByPhysical(dstAddr, result) >= 0) { + if (this.writeWordToPhysical(dstAddr, result) >= 0) { this.flagZ = result; this.flagV = 0; } @@ -2314,7 +2313,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // this.flagN = this.flagC = this.flagV = this.flagZ = 0; // } else { // if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte - // if (this.writeByteByPhysical(dstAddr, 0) >= 0) { + // if (this.writeByteToPhysical(dstAddr, 0) >= 0) { // this.flagN = this.flagC = this.flagV = this.flagZ = 0; // } // } @@ -2325,10 +2324,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = ~dst; - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = result << 8; this.flagC = 0x10000; this.flagV = 0; @@ -2340,10 +2339,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst + 1; - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = result << 8; this.flagV = (result & (result ^ dst)) << 8; } @@ -2354,10 +2353,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst - 1; - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = result << 8; this.flagV = ((result ^ dst) & dst) << 8; } @@ -2368,10 +2367,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = -dst; - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagC = this.flagN = this.flagZ = result << 8; this.flagV = (result & dst) << 8; } @@ -2382,10 +2381,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst + ((this.flagC >> 16) & 1); - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = this.flagC = result << 8; this.flagV = (result & (result ^ dst)) << 8; } @@ -2396,10 +2395,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst - ((this.flagC >> 16) & 1); - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagN = this.flagZ = this.flagC = result << 8; this.flagV = ((result ^ dst) & dst) << 8; } @@ -2417,10 +2416,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = (((this.flagC & 0x10000) >> 8) | dst) >> 1; - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagC = (dst << 16); this.flagN = this.flagZ = (result << 8); this.flagV = this.flagN ^ (this.flagC >> 1); @@ -2432,10 +2431,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = (dst << 1) | ((this.flagC >> 16) & 1); - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagC = this.flagN = this.flagZ = result << 8; this.flagV = (result ^ dst) << 8; } @@ -2446,10 +2445,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = (dst & 0x80) | (dst >> 1); - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagC = dst << 16; this.flagN = this.flagZ = result << 8; this.flagV = this.flagN ^ (this.flagC >> 1); @@ -2461,10 +2460,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) /* * TODO: Here's an example where getAddr() could be called in the register-only case. */ - if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= + if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst << 1; - if (this.writeByteByPhysical(dstAddr, result) >= 0) { + if (this.writeByteToPhysical(dstAddr, result) >= 0) { this.flagC = this.flagN = this.flagZ = result << 8; this.flagV = (result ^ dst) << 8; } @@ -2492,7 +2491,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } else { if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) { this.mmuMode = (this.PSW >> 12) & 3; - if ((src = this.readWordByVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) >= 0) { + if ((src = this.readWordFromVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) >= 0) { this.mmuMode = (this.PSW >> 14) & 3; if (this.pushWord(src) >= 0) { this.flagN = this.flagZ = src; @@ -2520,7 +2519,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.mmuMode = (this.PSW >> 12) & 3; if ((dstAddr = this.mapVirtualToPhysical(virtualAddress | PDP11.ACCESS.DSPACE, PDP11.ACCESS.WRITE)) >= 0) { this.mmuMode = (this.PSW >> 14) & 3; - if (this.writeWordByPhysical(dstAddr, dst) >= 0) { + if (this.writeWordToPhysical(dstAddr, dst) >= 0) { this.flagN = this.flagZ = dst; this.flagV = 0; } @@ -2534,7 +2533,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // src = this.getPSW() & 0xff; // if (instruction & 0x38) { // if ((dstAddr = this.getAddr(instruction, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte - // if (this.writeByteByPhysical(dstAddr, src) >= 0) { + // if (this.writeByteToPhysical(dstAddr, src) >= 0) { // this.flagN = this.flagZ = src << 8; // this.flagV = 0; // } @@ -2625,9 +2624,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) case 0x6: /*0000006*/ // RTT 000006 //LOG_INSTRUCTION(opCode, 0, "RTT"); dstAddr = this.regsGen[6]; - if ((virtualAddress = this.readWordByVirtual(dstAddr | PDP11.ACCESS.DSPACE)) >= 0) { + if ((virtualAddress = this.readWordFromVirtual(dstAddr | PDP11.ACCESS.DSPACE)) >= 0) { dstAddr = (dstAddr + 2) & 0xffff; - if ((savePSW = this.readWordByVirtual(dstAddr | PDP11.ACCESS.DSPACE)) >= 0) { + if ((savePSW = this.readWordFromVirtual(dstAddr | PDP11.ACCESS.DSPACE)) >= 0) { this.regsGen[6] = (dstAddr + 2) & 0xffff; savePSW &= 0xf8ff; if (this.PSW & 0xc000) { // user / super restrictions diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 83d177c2d..bee0a0997 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -234,8 +234,7 @@ var PDP11 = { */ WRITE: { NORMAL: 0x0, // write byte or word normally - ZERO: 0x1, // zero byte or word - SIGNEXT: 0x2 // sign-extend a byte to a word + SIGNEXT: 0x1 // sign-extend a byte to a word }, CPUERR: { RED: 0x0004, // red zone stack limit @@ -307,6 +306,10 @@ var PDP11 = { SIZE_HI: 0o177762, // Upper Size Register (always zero) (11/70 only?) SIZE_LO: 0o177760, // Lower Size Register (last 32-word block) (11/70 only?) DISPLAY: 0o177570, // Console Switch and Display + XBUF: 0o177566, // Console Terminal: Transmitter Data Buffer Register + XCSR: 0o177564, // Console Terminal: Transmitter Status Register + RBUF: 0o177562, // Console Terminal: Receiver Data Buffer Register + RCSR: 0o177560, // Console Terminal: Receiver Status Register MMR0: 0o177572, // 777572 17777572 MMR1: 0o177574, // 777574 17777574 MMR2: 0o177576, // 777576 17777576 @@ -407,6 +410,17 @@ var PDP11 = { KDSAR5: 0o172372, // Kernel D Space Address Register 5 KDSAR6: 0o172374, // Kernel D Space Address Register 6 KDSAR7: 0o172376, // Kernel D Space Address Register 7 + }, + DL11: { + DELAY: 8, + PRI: 4, + VEC: 0o64, + XCSR: { + READY: 0x80, // Transmitter Ready (read-only) + INT_ENABLE: 0x40, // Transmitter Interrupt Enable (read-write) + MAINT: 0x04, // Maintenance (read-write) + BREAK: 0x01 // BREAK (read-write) + } } }; diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index ee8dfc187..4b7848123 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -204,7 +204,7 @@ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg) * readPSW(addr) * * @this {DevicePDP11} - * @param {number} addr (eg, PDP11.UNIBUS.PSW) + * @param {number} addr (eg, 177776) * @return {number} */ DevicePDP11.prototype.readPSW = function(addr) @@ -217,7 +217,7 @@ DevicePDP11.prototype.readPSW = function(addr) * * @this {DevicePDP11} * @param {number} data - * @param {number} addr (ie, PDP11.UNIBUS.PSW) + * @param {number} addr (eg, 177776) */ DevicePDP11.prototype.writePSW = function(data, addr) { @@ -226,6 +226,43 @@ DevicePDP11.prototype.writePSW = function(data, addr) this.cpu.opFlags |= PDP11.OPFLAG.SKIP_FLAGS; }; +/** + * readXCSR(addr) + * + * @this {DevicePDP11} + * @param {number} addr (eg, 177564) + * @return {number} + */ +DevicePDP11.prototype.readXCSR = function(addr) +{ + return this.tty.xcsr; +}; + +/** + * writeXCSR(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr (eg, 177564) + */ +DevicePDP11.prototype.writeXCSR = function(data, addr) +{ + /* + * If the device is READY and INT_ENABLE is transitioning to *set*, generate an interrupt. + */ + var device = this; + if ((this.tty.xcsr & (PDP11.DL11.XCSR.READY | PDP11.DL11.XCSR.INT_ENABLE)) == PDP11.DL11.XCSR.READY && (data & PDP11.DL11.XCSR.INT_ENABLE)) { + this.cpu.interrupt(PDP11.DL11.DELAY, PDP11.DL11.PRI, PDP11.DL11.VEC, function() { + device.tty.xcsr |= PDP11.DL11.XCSR.READY; + return !!(device.tty.xcsr & PDP11.DL11.XCSR.INT_ENABLE); + }); + } + /* + * In any event, update all bits from data *except* for READY. + */ + this.tty.xcsr = (this.tty.xcsr & PDP11.DL11.XCSR.READY) | (data & ~PDP11.DL11.XCSR.READY); +}; + /** * rk11_go() * @@ -295,7 +332,7 @@ DevicePDP11.prototype.rk11_go = function() break; } rk11.rkds = (drive << 13) | (rk11.rkds & 0x1ff0) | ((rk11.rkda % 9) & 0xf); - this.cpu.interrupt(20, 5 << 5, 0x90, /*0220*/ function() { + this.cpu.interrupt(20, 5, 0x90, /*0220*/ function() { rk11.rkcs = (rk11.rkcs & 0xfffe) | 0x80; // turn off go & set done return !!(rk11.rkcs & 0x40); }); @@ -327,7 +364,7 @@ DevicePDP11.prototype.rk11_end = function(err, meta, block, address, count) rk11.rkcs |= 0xc000; // err break; } - this.cpu.interrupt(20, 5 << 5, 0x90, /*0220*/ function() { + this.cpu.interrupt(20, 5, 0x90, /*0220*/ function() { rk11.rkcs = (rk11.rkcs & 0xfffe) | 0x80; // turn off go & set done return !!(rk11.rkcs & 0x40); }); @@ -408,7 +445,7 @@ DevicePDP11.prototype.rl11_go = function() case 7: // Read data without header check break; } - this.cpu.interrupt(20, 5 << 5, 0x70, /*0160*/ function() { + this.cpu.interrupt(20, 5, 0x70, /*0160*/ function() { rl11.csr |= 0x81; // turn off go & set ready return !!(rl11.csr & 0x40); }); @@ -442,7 +479,7 @@ DevicePDP11.prototype.rl11_end = function(err, meta, block, address, count) rl11.csr |= 0xa000; // NXM break; } - this.cpu.interrupt(20, 5 << 5, 0x70, /*0160*/ function() { + this.cpu.interrupt(20, 5, 0x70, /*0160*/ function() { rl11.csr |= 0x81; // turn off go & set ready return !!(rl11.csr & 0x40); }); @@ -551,7 +588,7 @@ DevicePDP11.prototype.rp11_go = function(drive) default: break; } - this.cpu.interrupt(3, 5 << 5, 0xAC, /*0254*/ function() { + this.cpu.interrupt(3, 5, 0xAC, /*0254*/ function() { rp11.rpcs1 = (rp11.rpcs1 & 0xfffe) | 0x80; // Turn go off and ready on rp11.rpds[drive] |= 0x80; // ATA return !!(rp11.rpcs1 & 0x40); @@ -594,7 +631,7 @@ DevicePDP11.prototype.rp11_end = function(err, meta, block, address, count) rp11.rpcs1 |= 0xc000; // set SC & TRE break; } - this.cpu.interrupt(20, 5 << 5, 0xAC, /*0254*/ function() { + this.cpu.interrupt(20, 5, 0xAC, /*0254*/ function() { rp11.rpds[meta.drive] |= 0x80; rp11.rpcs1 = (rp11.rpcs1 & 0xfffe) | 0x80; // Turn go off and ready on return !!(rp11.rpcs1 & 0x40); @@ -610,7 +647,7 @@ DevicePDP11.prototype.kw11_interrupt = function() { this.kw11.csr |= 0x80; if (this.kw11.csr & 0x40) { - this.cpu.interrupt(0, 6 << 5, 0x40 /*0100*/); + this.cpu.interrupt(0, 6, 0x40 /*0100*/); } }; @@ -734,7 +771,7 @@ DevicePDP11.prototype.readData = function(meta, block, address, count) return; } for (word = 0; word < meta.blocksize && count > 0; word++) { - if (this.cpu.writeWordByPhysical((meta.mapped? this.cpu.mapUnibus(address) : address), meta.cache[block][word]) < 0) { + if (this.cpu.writeWordToPhysical((meta.mapped? this.cpu.mapUnibus(address) : address), meta.cache[block][word]) < 0) { meta.postProcess(2, meta, block, address, count); // NXM return; } @@ -768,7 +805,7 @@ DevicePDP11.prototype.writeData = function(meta, block, address, count) } } for (word = 0; word < meta.blocksize && count > 0; word++) { - data = this.cpu.readWordByPhysical((meta.mapped? this.cpu.mapUnibus(address) : address)); + data = this.cpu.readWordFromPhysical((meta.mapped? this.cpu.mapUnibus(address) : address)); if (data < 0) { meta.postProcess(2, meta, block, address, count); // NXM return; @@ -1057,7 +1094,7 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag) tty.del = 0; } tty.xcsr &= ~0x80; /*0200*/ - cpu.interrupt(100, 4 << 5, 0x34, /*064*/ function() { + cpu.interrupt(100, 4, 0x34, /*064*/ function() { tty.xcsr |= 0x80; /*0200*/ return !!(tty.xcsr & 0x40); /*0100*/ }); @@ -1065,20 +1102,20 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag) result = 0; break; case 0x3FFF74: /*017777564*/ // console xcsr - if (data < 0) { - result = tty.xcsr; - } else { - result = this.insertData(tty.xcsr, physicalAddress, data, byteFlag); - if (result >= 0) { - if ((tty.xcsr & 0xC0) /*0300*/ == 0x80 /*0200*/&& (result & 0x40) /*0100*/) { - cpu.interrupt(8, 4 << 5, 0x34, /*064*/ function() { - tty.xcsr |= 0x80; /*0200*/ - return !!(tty.xcsr & 0x40); /*0100*/ - }); - } - tty.xcsr = (tty.xcsr & 0x80) /*0200*/ | (result & ~0x80) /*0200*/; - } - } + // if (data < 0) { + // result = tty.xcsr; + // } else { + // result = this.insertData(tty.xcsr, physicalAddress, data, byteFlag); + // if (result >= 0) { + // if ((tty.xcsr & 0xC0) /*0300*/ == 0x80 /*0200*/&& (result & 0x40) /*0100*/) { + // cpu.interrupt(8, 4, 0x34, /*064*/ function() { + // tty.xcsr |= 0x80; /*0200*/ + // return !!(tty.xcsr & 0x40); /*0100*/ + // }); + // } + // tty.xcsr = (tty.xcsr & 0x80) /*0200*/ | (result & ~0x80) /*0200*/; + // } + // } break; case 0x3FFF72: /*017777562*/ // console rbuf result = 0; @@ -1089,7 +1126,7 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag) if (tty.rbuf.length > 0) { setTimeout(function() { tty.rcsr |= 0x80; /*0200*/ - if (tty.rcsr & 0x40) /*0100*/ cpu.interrupt(40, 4 << 5, 0x30) /*060*/; + if (tty.rcsr & 0x40) /*0100*/ cpu.interrupt(40, 4, 0x30) /*060*/; }, 50); } } @@ -1182,7 +1219,7 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag) this.rp11_go(idx); } else { if ((result & 0xc0) == 0xc0) { - cpu.interrupt(0, 5 << 5, 0xAC) /*0254*/; + cpu.interrupt(0, 5, 0xAC) /*0254*/; } } } @@ -1409,7 +1446,12 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag) * ES6 ALERT: As you can see below, I've finally started using computed property names. */ DevicePDP11.UNIBUS_TABLE = { - [PDP11.UNIBUS.PSW]: [null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW] + [PDP11.UNIBUS.PSW]: [ + null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW + ], + [PDP11.UNIBUS.XCSR]: [ + null, null, DevicePDP11.prototype.readXCSR, DevicePDP11.prototype.writeXCSR + ] }; /** diff --git a/versions/pdp11/1.30.0/pdp11-dbg.js b/versions/pdp11/1.30.0/pdp11-dbg.js index f2b9c5de3..29b57f0b6 100644 --- a/versions/pdp11/1.30.0/pdp11-dbg.js +++ b/versions/pdp11/1.30.0/pdp11-dbg.js @@ -2,7 +2,7 @@ function ba(a,b){var d;if(a){b||(b=10);var c=a.charAt(0),e=0>=3;return(d?"0o":"")+c}function r(a,b,d){var c="";b?8=e?48:55),c=String.fromCharCode(e)+c;a>>=4}return(d?"0x":"")+c} function da(a){var b=a,d=a.lastIndexOf("/");0<=d&&(b=a.substr(d+1));d=b.indexOf("&");0":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function na(a,b){return(a+" ").slice(0,b)} -function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function qa(a,b,d){var c=0,e=a.length,f=0;for(d||(d=function(a,b){return a>b?1:a>1,h;h=d(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 oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function qa(a,b,d){var c=0,e=a.length,f=0;for(d||(d=function(a,b){return a>b?1:a>1,h;h=d(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 wa(a,b,d,c){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return c&&c(a,f,e),[f,e];if(d&&"function"==typeof resources)return resources(a,function(b,d){c&&c(a,b,d)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");d&&(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),c&&c(a,f,e))});if(b&&"object"== typeof b){var k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,!!d);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}else h.open("GET",a,!!d),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();d||(f=h.responseText,200!=h.status&&(e=h.status||-1),c&&c(a,f,e),g=[f,e]);return g}function ka(){return"http://"+(window?window.location.host:"www.pcjs.org")} function t(a){window&&window.alert(a)}function xa(a){var b=!1;window&&(b=window.confirm(a));return b}var ya=null;function za(){if(null==ya){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}ya=a}return ya}function Aa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(d){}return b} @@ -13,75 +13,76 @@ function u(a,b,d,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.nam if(window){Sa||(Sa=window.location.search.substr(1));for(var Ua,Va=/\+/g,Wa=/([^&=]+)=?([^&]*)/g;Ua=Wa.exec(Sa);)Ta[decodeURIComponent(Ua[1].replace(Va," "))]=decodeURIComponent(Ua[2].replace(Va," "))}function Xa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var d=typeof a;if("object"!==d&&"function"!==d)throw new TypeError;}b.prototype=a;return new b} function w(a,b){b||(b=u);a.prototype=Xa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ya=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Ya={},v=[];function Za(a,b,d){Ya[a]&&b&&(Ya[a][b]=d)}function $a(a){var b,d=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.Z&&(this.Z=10);15>2;this.g=this.Da-1;this.u=this.G/this.Da|0;this.B=this.u-1;this.Wa=[];this.J=null;this.Mb=this.Gc;a=new I;zb(a,this.I);this.S=Array(this.u);for(b=0;b>1)+2;10>this.Z&&(this.Z=10);15>2;this.g=this.Da-1;this.u=this.G/this.Da|0;this.w=this.u-1;this.Wa=[];this.J=null;this.Mb=this.Gc;a=new I;zb(a,this.I);this.S=Array(this.u);for(b=0;b>8:c[2](b)&255}else if(b&1&&(c=d.Wa[a&-2],c[2]))return c[2](b&-2)>>8;return d.Mb(b,-1,1)} function Bb(a,b,d){var c=this.controller,e=c.Wa[a];if(e){if(e[1]){e[1](b,d);return}if(e[3]){a=e[2]?e[2](d):0;if(d&1)e[3](a&255|b<<8,d&-2);else e[3](a&-256|b,d);return}}else if(d&1&&(e=c.Wa[a&-2],e[3])){d&=-2;a=e[2]?e[2](d):0;e[3](a&255|b<<8,d);return}c.Mb(d,b,1)}function Cb(a,b){var d=this.controller;if(a=d.Wa[a]){if(a[2])return a[2](b);if(a[0])return a[0](b)|a[0](b+1)<<8}return d.Mb(b,-1,0)} function Db(a,b,d){var c=this.controller;if(a=c.Wa[a]){if(a[3]){a[3](b,d);return}if(a[1]){a[1](b&255,d);a[1](b>>8,d+1);return}}c.Mb(d,b,0)}l=yb.prototype;l.reset=function(){this.J&&this.J()};l.Gc=function(){return 0};l.Qa=function(a,b){b||this.reset();return!0}; -function Eb(a,b,d,c,e){for(var f=b,g=d,h=f>>>a.Z;0g&&(n=g);if(k&&k.size){if(k.type==c&&k.controller==e){if(f+g<=k.w)return k.Zb+=k.w-f,k.w=f,!0;if(f>=k.w+k.Zb){n=k.size-(f-m);n>g&&(n=g);k.Zb=f-k.w+n;f=m+a.Da;g-=n;h++;continue}}return Gb(1,f,g)}f=new I(f,n,a.Da,c,e);zb(f,a.I,k);a.S[h++]=f;f=m+a.Da;g-=n}return 0>=g?(a.status(Math.floor(d/1024)+"Kb "+Hb[c]+" at "+r(b,8,!0)),!0):Gb(2,b,d)} -l.Nb=function(a){return this.S[(a&this.H)>>>this.Z].wb(a&this.g,a)};l.La=function(a){var b=a&this.g,d=(a&this.H)>>>this.Z;return b!=this.g?this.S[d].zc(b,a):this.S[d++].wb(b,a)|this.S[d&this.B].wb(0,a+1)<<8};function Ib(a,b){var d=b&a.g,c=(b&a.H)>>>a.Z;return d!=a.g?a.S[c].mc(d,b):a.S[c++].Tb(d,b)|a.S[c&a.B].Tb(0,b+1)<<8}l.fc=function(a,b){this.S[(a&this.H)>>>this.Z].Bb(a&this.g,b&255,a)}; -l.oc=function(a,b){var d=a&this.g,c=(a&this.H)>>>this.Z;d!=this.g?this.S[c].Fc(d,b&65535,a):(this.S[c++].Bb(d,b&255,a),this.S[c&this.B].Bb(0,b>>8&255,a+1))};function Jb(a){for(var b=0,d=[],c=0;c>>a.Z;0g&&(n=g);if(k&&k.size){if(k.type==c&&k.controller==e){if(f+g<=k.A)return k.Zb+=k.A-f,k.A=f,!0;if(f>=k.A+k.Zb){n=k.size-(f-m);n>g&&(n=g);k.Zb=f-k.A+n;f=m+a.Da;g-=n;h++;continue}}return Gb(1,f,g)}f=new I(f,n,a.Da,c,e);zb(f,a.I,k);a.S[h++]=f;f=m+a.Da;g-=n}return 0>=g?(a.status(Math.floor(d/1024)+"Kb "+Hb[c]+" at "+r(b,8,!0)),!0):Gb(2,b,d)} +l.Nb=function(a){return this.S[(a&this.H)>>>this.Z].wb(a&this.g,a)};l.La=function(a){var b=a&this.g,d=(a&this.H)>>>this.Z;return b!=this.g?this.S[d].zc(b,a):this.S[d++].wb(b,a)|this.S[d&this.w].wb(0,a+1)<<8};function Ib(a,b){var d=b&a.g,c=(b&a.H)>>>a.Z;return d!=a.g?a.S[c].mc(d,b):a.S[c++].Tb(d,b)|a.S[c&a.w].Tb(0,b+1)<<8}l.fc=function(a,b){this.S[(a&this.H)>>>this.Z].Bb(a&this.g,b&255,a)}; +l.oc=function(a,b){var d=a&this.g,c=(a&this.H)>>>this.Z;d!=this.g?this.S[c].Fc(d,b&65535,a):(this.S[c++].Bb(d,b&255,a),this.S[c&this.w].Bb(0,b>>8&255,a+1))};function Jb(a){for(var b=0,d=[],c=0;c>13&7;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.$c,drive:f,blocksize:256,mapped:0,maxblock:b.gb[f]*b.aa[f],url:"rk"+f+".dsk"});b.T&=-129;switch(b.T>>1&7){case 0:b.Vb=2496;b.oa=0;b.T=128;b.wa=0;break;case 1:if((b.wa>>4&511)>=b.gb[f]){b.oa|=32832;b.T|=49152;break}if((b.wa&15)>=b.aa[f]){b.oa|=32800;b.T|=49152;break}d=(b.wa>>4&511)*b.aa[f]+(b.wa&15);c=(b.T&48)<<12|b.Ub;e=65536-b.Wb&65535;ac(a,b.ra[f],d,c,e);return;case 2:if((b.wa>>4&511)>=b.gb[f])b.oa|= -32832,b.T|=49152;else if((b.wa&15)>=b.aa[f])b.oa|=32800,b.T|=49152;else{d=(b.wa>>4&511)*b.aa[f]+(b.wa&15);c=(b.T&48)<<12|b.Ub;e=65536-b.Wb&65535;a.cc(b.ra[f],d,c,e);return}}b.Vb=f<<13|b.Vb&8176|b.wa%9&15;J(a.b,20,160,144,function(){b.T=b.T&65534|128;return!!(b.T&64)})}l.$c=function(a,b,d,c,e){var f=this.u;f.Ub=c&65535;f.T=f.T&-49|c>>12&48;f.Wb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.T|=49152;break;case 2:f.oa|=33792,f.T|=49152}J(this.b,20,160,144,function(){f.T=f.T&65534|128;return!!(f.T&64)})}; -function bc(a){var b=a.G,d,c,e,f=b.K>>8&3;b.K&=-2;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.ad,drive:f,blocksize:128,mapped:1,maxblock:b.gb[f]*b.aa[f],url:"rl"+f+".dsk"});switch(b.K>>1&7){case 2:b.ab&8&&(b.K&=63);b.ab=b.Ic[f]|b.eb&64;break;case 3:1==(b.fa&3)&&(b.eb=b.fa&4?b.eb+(b.fa&65408)&65408|b.fa<<2&64:b.eb-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.eb);break;case 4:b.ab=b.eb;break;case 5:if(b.fa>>6>=b.gb[f]){b.K|=37888;break}if((b.fa&63)>=b.aa[f]){b.K|=37888;break}d=(b.fa>>6)* -b.aa[f]+(b.fa&63);c=(b.Xa&63)<<16|b.Jb;e=65536-b.ab&65535;ac(a,b.ra[f],d,c,e);return;case 6:if(b.fa>>6>=b.gb[f])b.K|=37888;else if((b.fa&63)>=b.aa[f])b.K|=37888;else{d=(b.fa>>6)*b.aa[f]+(b.fa&63);c=(b.Xa&63)<<16|b.Jb;e=65536-b.ab&65535;a.cc(b.ra[f],d,c,e);return}}J(a.b,20,160,112,function(){b.K|=129;return!!(b.K&64)})} -l.ad=function(a,b,d,c,e){var f=this.G;f.Jb=c&65535;f.K=f.K&-49|c>>12&48;f.Xa=c>>16&63;f.fa=~~(d/f.aa[b.Oa])<<6|d%f.aa[b.Oa];f.eb=f.fa;f.ab=65536-e&65535;switch(a){case 1:f.K|=33792;break;case 2:f.K|=40960}J(this.b,20,160,112,function(){f.K|=129;return!!(f.K&64)})};function cc(a){a=a.J;a.U=2176;a.Ea=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.yb=[0,0,0,0,0,0,0,0];a.nb=a.zb=a.xb=a.cb=a.nc=0} -function dc(a,b){var d=a.J,c,e,f;d.U&=-16513;d.Ea&=-2049;d.ta[b]&=-1153;J(a.b,-1,0,172);"undefined"===typeof d.ra[b]&&(d.ra[b]={cache:[],postProcess:a.bd,drive:b,blocksize:256,mapped:0,maxblock:d.gc[0]*d.fb[0]*d.aa[0],url:"rp"+b+".dsk"});switch(d.U&63){case 5:d.ec[b]=d.Ta[b];d.U|=32896;d.ta[b]|=32896;d.nb|=1<=d.gc[0]||d.Fa[b]>>8>=d.fb[0]||(d.Fa[b]&255)>=d.aa[0]){d.yb[b]|=1024;d.U|=49152;break}c=(d.Ta[b]*d.fb[0]+(d.Fa[b]>>8))* -d.aa[0]+(d.Fa[b]&255);e=(d.cb&63)<<16|d.xb;f=65536-d.zb&65535;ac(a,d.ra[b],c,e,f);return;case 57:if(d.Ta[b]>=d.gc[0]||d.Fa[b]>>8>=d.fb[0]||(d.Fa[b]&255)>=d.aa[0])d.yb[b]|=1024,d.U|=49152;else{c=(d.Ta[b]*d.fb[0]+(d.Fa[b]>>8))*d.aa[0]+(d.Fa[b]&255);e=(d.cb&63)<<16|d.xb;f=65536-d.zb&65535;a.cc(d.ra[b],c,e,f);return}}J(a.b,3,160,172,function(){d.U=d.U&65534|128;d.ta[b]|=128;return!!(d.U&64)})} -l.bd=function(a,b,d,c,e){var f=this.J;f.zb=65536-e&65535;f.xb=c&65535;f.U=f.U&-769|c>>8&768;f.cb=c>>16&63;e=~~(d/f.aa[0]);c=~~(e/f.fb[0]);f.Fa[b.Oa]=e%f.fb[0]<<8|d%f.aa[0];f.ec[b.Oa]=f.Ta[b.Oa]=c;f.nb|=1<=b.Wc-1&&(f.ta[b.Oa]|=1024);switch(a){case 1:f.Ea|=512;f.U|=49152;break;case 2:f.Ea|=2048,f.U|=49152}J(this.b,20,160,172,function(){f.ta[b.Oa]|=128;f.U=f.U&65534|128;return!!(f.U&64)})};l.Tc=function(){this.B.K|=128;this.B.K&64&&J(this.b,0,192,64)}; +l.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;a=Xb;for(var e in a){var f=a[e];d=b;c=+e;for(var g=f[0]?f[0].bind(this):null,h=f[1]?f[1].bind(this):null,k=f[2]?f[2].bind(this):null,f=f[3]?f[3].bind(this):null,m=+e;m<=c;m+=2){var n=m&8191;void 0!==d.Wa[n]?t("I/O address already registered: "+r(m,8,!0)):d.Wa[n]=[g,h,k,f,!1]}}e=this.Hc.bind(this);b.J=this.reset.bind(this);b.Mb=e;D(this)};l.Zc=function(){return Yb(this.b)};l.md=function(a){Zb(this.b,a&-1809|Yb(this.b)&1808);this.b.V|=128};l.$c=function(){return this.g.xa}; +l.nd=function(a){var b=this;128==(this.g.xa&192)&&a&64&&J(this.b,8,4,52,function(){b.g.xa|=128;return!!(b.g.xa&64)});this.g.xa=this.g.xa&128|a&-129}; +function $b(a){var b=a.G,d,c,e,f=b.va>>13&7;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.ad,drive:f,blocksize:256,mapped:0,maxblock:b.gb[f]*b.aa[f],url:"rk"+f+".dsk"});b.T&=-129;switch(b.T>>1&7){case 0:b.Vb=2496;b.oa=0;b.T=128;b.va=0;break;case 1:if((b.va>>4&511)>=b.gb[f]){b.oa|=32832;b.T|=49152;break}if((b.va&15)>=b.aa[f]){b.oa|=32800;b.T|=49152;break}d=(b.va>>4&511)*b.aa[f]+(b.va&15);c=(b.T&48)<<12|b.Ub;e=65536-b.Wb&65535;ac(a,b.ra[f],d,c,e);return;case 2:if((b.va>>4&511)>=b.gb[f])b.oa|= +32832,b.T|=49152;else if((b.va&15)>=b.aa[f])b.oa|=32800,b.T|=49152;else{d=(b.va>>4&511)*b.aa[f]+(b.va&15);c=(b.T&48)<<12|b.Ub;e=65536-b.Wb&65535;a.cc(b.ra[f],d,c,e);return}}b.Vb=f<<13|b.Vb&8176|b.va%9&15;J(a.b,20,5,144,function(){b.T=b.T&65534|128;return!!(b.T&64)})}l.ad=function(a,b,d,c,e){var f=this.G;f.Ub=c&65535;f.T=f.T&-49|c>>12&48;f.Wb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.T|=49152;break;case 2:f.oa|=33792,f.T|=49152}J(this.b,20,5,144,function(){f.T=f.T&65534|128;return!!(f.T&64)})}; +function bc(a){var b=a.J,d,c,e,f=b.K>>8&3;b.K&=-2;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.bd,drive:f,blocksize:128,mapped:1,maxblock:b.gb[f]*b.aa[f],url:"rl"+f+".dsk"});switch(b.K>>1&7){case 2:b.ab&8&&(b.K&=63);b.ab=b.Ic[f]|b.eb&64;break;case 3:1==(b.fa&3)&&(b.eb=b.fa&4?b.eb+(b.fa&65408)&65408|b.fa<<2&64:b.eb-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.eb);break;case 4:b.ab=b.eb;break;case 5:if(b.fa>>6>=b.gb[f]){b.K|=37888;break}if((b.fa&63)>=b.aa[f]){b.K|=37888;break}d=(b.fa>>6)* +b.aa[f]+(b.fa&63);c=(b.Xa&63)<<16|b.Jb;e=65536-b.ab&65535;ac(a,b.ra[f],d,c,e);return;case 6:if(b.fa>>6>=b.gb[f])b.K|=37888;else if((b.fa&63)>=b.aa[f])b.K|=37888;else{d=(b.fa>>6)*b.aa[f]+(b.fa&63);c=(b.Xa&63)<<16|b.Jb;e=65536-b.ab&65535;a.cc(b.ra[f],d,c,e);return}}J(a.b,20,5,112,function(){b.K|=129;return!!(b.K&64)})} +l.bd=function(a,b,d,c,e){var f=this.J;f.Jb=c&65535;f.K=f.K&-49|c>>12&48;f.Xa=c>>16&63;f.fa=~~(d/f.aa[b.Oa])<<6|d%f.aa[b.Oa];f.eb=f.fa;f.ab=65536-e&65535;switch(a){case 1:f.K|=33792;break;case 2:f.K|=40960}J(this.b,20,5,112,function(){f.K|=129;return!!(f.K&64)})};function cc(a){a=a.O;a.U=2176;a.Ea=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.yb=[0,0,0,0,0,0,0,0];a.nb=a.zb=a.xb=a.cb=a.nc=0} +function dc(a,b){var d=a.O,c,e,f;d.U&=-16513;d.Ea&=-2049;d.ta[b]&=-1153;J(a.b,-1,0,172);"undefined"===typeof d.ra[b]&&(d.ra[b]={cache:[],postProcess:a.cd,drive:b,blocksize:256,mapped:0,maxblock:d.gc[0]*d.fb[0]*d.aa[0],url:"rp"+b+".dsk"});switch(d.U&63){case 5:d.ec[b]=d.Ta[b];d.U|=32896;d.ta[b]|=32896;d.nb|=1<=d.gc[0]||d.Fa[b]>>8>=d.fb[0]||(d.Fa[b]&255)>=d.aa[0]){d.yb[b]|=1024;d.U|=49152;break}c=(d.Ta[b]*d.fb[0]+(d.Fa[b]>>8))* +d.aa[0]+(d.Fa[b]&255);e=(d.cb&63)<<16|d.xb;f=65536-d.zb&65535;ac(a,d.ra[b],c,e,f);return;case 57:if(d.Ta[b]>=d.gc[0]||d.Fa[b]>>8>=d.fb[0]||(d.Fa[b]&255)>=d.aa[0])d.yb[b]|=1024,d.U|=49152;else{c=(d.Ta[b]*d.fb[0]+(d.Fa[b]>>8))*d.aa[0]+(d.Fa[b]&255);e=(d.cb&63)<<16|d.xb;f=65536-d.zb&65535;a.cc(d.ra[b],c,e,f);return}}J(a.b,3,5,172,function(){d.U=d.U&65534|128;d.ta[b]|=128;return!!(d.U&64)})} +l.cd=function(a,b,d,c,e){var f=this.O;f.zb=65536-e&65535;f.xb=c&65535;f.U=f.U&-769|c>>8&768;f.cb=c>>16&63;e=~~(d/f.aa[0]);c=~~(e/f.fb[0]);f.Fa[b.Oa]=e%f.fb[0]<<8|d%f.aa[0];f.ec[b.Oa]=f.Ta[b.Oa]=c;f.nb|=1<=b.Wc-1&&(f.ta[b.Oa]|=1024);switch(a){case 1:f.Ea|=512;f.U|=49152;break;case 2:f.Ea|=2048,f.U|=49152}J(this.b,20,5,172,function(){f.ta[b.Oa]|=128;f.U=f.U&65534|128;return!!(f.U&64)})};l.Tc=function(){this.u.K|=128;this.u.K&64&&J(this.b,0,6,64)}; function ec(a,b,d,c,e,f){var g=~~((f+d.Ya-1)/d.Ya),h=new XMLHttpRequest;2048>g&&c+2048M(this.b,a.Vc?fc(this.b,d):d,a.cache[b][e])){a.bc(2,a,b,d,c);return}d+=2;--c}b++}a.bc(0,a,b,d,c)}; -function ac(a,b,d,c,e){for(var f,g;0g){b.bc(2,b,d,c,e);return}b.cache[d][f]=g;c+=2;--e}d++}b.bc(0,b,d,c,e)}l.reset=function(){this.g.sb=this.g.sb&-120|20;this.O.Ma=0;this.O.ua=128;this.B.K=0;this.u.T=128;this.G.K=128;cc(this)}; +function ac(a,b,d,c,e){for(var f,g;0g){b.bc(2,b,d,c,e);return}b.cache[d][f]=g;c+=2;--e}d++}b.bc(0,b,d,c,e)}l.reset=function(){this.w.sb=this.w.sb&-120|20;this.g.Ma=0;this.g.xa=128;this.u.K=0;this.G.T=128;this.J.K=128;cc(this)}; l.Hc=function(a,b,d){var c,e,f=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?c=f.Sa&65280:(a&1&&(b<<=8),f.Sa=b|255,c=0);break;case 4194298:if(0>b)c=f.dc;else{a&1&&(b<<=8);if(c=b&65024){e=c>>9;do c+=34;while(e>>=1)}f.dc=c;f.Ra=2}break;case 4194294:if(70!==f.jb)return L(f,4,222);0>b?c=f.M:c=f.M=0;break;case 4194292:if(70!==f.jb)return L(f,4,224);c=1;break;case 4194290:if(70!==f.jb)return L(f,4,226);c=0;break;case 4194288:if(70!==f.jb)return L(f,4,228);c=61183;break;case 4194296:0<= -b&&!(a&1)&&(b&=255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==f.jb)return L(f,4,232);e=a-4194272>>1;0>b?c=f.jc[e]:(c=K(this,f.jc[e],a,b,d),0<=c&&(f.jc[e]=c));break;case 4194254:return a&1?f.N>>14&1?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.va[3]=b),c=f.va[3]):f.N>>14&0?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.va[1]=b),c=f.va[1]),c;case 4194252:case 4194250:case 4194248:return e=a&7,f.N&2048?(0<=b&&(f.f[e]=b),c=f.f[e]):(0<=b&&(f.bb[e]= -b),c=f.bb[e]),c;case 4194246:return a&1?(0<=b&&(f.f[7]=b),c=f.f[7]):f.N>>14&0?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.va[0]=b),c=f.va[0]),c;case 4194244:case 4194242:case 4194240:return e=a&7,f.N&2048?(0<=b&&(f.bb[e]=b),c=f.bb[e]):(0<=b&&(f.f[e]=b),c=f.f[e]),c;default:return f.M|=16,L(f,4,124)}break;case 4194176:e=a>>1&31;c=K(this,f.ma[3][e],a,b,d);0<=c&&(f.ma[3][e]=c,f.ma[3][e&15]&=65295);break;case 4194112:var g=this.O;e=this.B;switch(a&-2){case 4194174:c=K(this,f.Eb,a,b,d);0<=c&&(f.Eb=c);break;case 4194172:c= -f.Ga;c&65280&&(c=(c<<8|c>>8)&65535);break;case 4194170:f.ea=f.ea&62337|f.Pb<<5|f.ac<<1;0>b?c=f.ea:(c=K(this,f.ea,a,b,d),0<=c&&(f.ea=c&=62337,f.Pb=c>>5&3,f.ac=c>>1&15,c&257?(e=2,f.Ua&16&&(e=1),f.tb=c&1?tb|E:E):(f.tb=0,e=4),this.g.sb=this.g.sb&-8|e));break;case 4194168:0>b?c=this.g.jd&65535:(c=K(this,this.g.data,a,b,d),0<=c&&(this.g.data=c));break;case 4194166:0<=b&&(b&127&&(g.Mc=0),g.ua&=-129,J(f,100,128,52,function(){g.ua|=128;return!!(g.ua&64)}));c=0;break;case 4194164:0>b?c=g.ua:(c=K(this,g.ua, -a,b,d),0<=c&&(128==(g.ua&192)&&c&64&&J(f,8,128,52,function(){g.ua|=128;return!!(g.ua&64)}),g.ua=g.ua&128|c&-129));break;case 4194162:c=0;0>b&&(g.Ma&=-129,0b?c=g.Ma:(c=K(this,g.Ma,a,b,d),0<=c&&(g.Ma=g.Ma&128|c&-129));break;case 4194150:0>b?(c=e.K,e.K&=-129):(c=K(this,e.K,a,b,d),0<=c&&(c&64&&!e.Ob&&(setInterval(this.Tc.bind(this),25),e.Ob=1),e.K=c&-129));break;default:return f.M|= -16,L(f,4,126)}break;case 4194048:e=this.u;switch(a&-2){case 4194048:c=K(this,e.Vb,a,b,d);0<=c&&(e.Vb=c);break;case 4194050:c=K(this,e.oa,a,b,d);0<=c&&(e.oa=c);break;case 4194052:c=K(this,e.T,a,b,d);0<=b&&0<=c&&(e.T=c&-36993|e.T&36992,e.T&1&&$b(this));break;case 4194054:c=K(this,e.Wb,a,b,d);0<=c&&(e.Wb=c);break;case 4194056:c=K(this,e.Ub,a,b,d);0<=c&&(e.Ub=c);break;case 4194058:c=K(this,e.wa,a,b,d);0<=c&&(e.wa=c);break;case 4194060:break;case 4194062:c=K(this,e.Ac,a,b,d);0<=c&&(e.Ac=c);break;default:return f.M|= -16,L(f,4,128)}break;case 4193728:var h=this.J;e=h.Ea&7;switch(a&-2){case 4193728:c=K(this,h.U,a,b,d);0<=b&&0<=c&&(h.cb=h.cb&60|c>>8&3,h.U=c&17279|h.U&34944|2048,c&1&&h.U&128?dc(this,e):192==(c&192)&&J(f,0,160,172));break;case 4193730:c=K(this,h.zb,a,b,d);0<=c&&(h.zb=c);break;case 4193732:c=K(this,h.xb,a,b,d);0<=c&&(h.xb=c&65534);break;case 4193734:c=K(this,h.Fa[e],a,b,d);0<=c&&(h.Fa[e]=c&7967);break;case 4193736:c=K(this,h.Ea,a,b,d);0<=c&&(h.Ea=c&63|h.Ea&65472,c&128&&cc(this));break;case 4193738:c= -h.ta[e];break;case 4193740:c=h.yb[e];break;case 4193742:c=K(this,h.nb,a,b,d);0<=c&&(h.nb=c&255);break;case 4193744:c=h.gd[e];break;case 4193746:c=K(this,h.Bc,a,b,d);0<=c&&(h.Bc=c);break;case 4193748:c=K(this,h.Cc[e],a,b,d);0<=c&&(h.Cc[e]=c&1023);break;case 4193750:c=8210;break;case 4193752:c=h.hd[e];break;case 4193754:c=K(this,h.Dc[e],a,b,d);0<=c&&(h.Dc[e]=c);break;case 4193756:c=K(this,h.Ta[e],a,b,d);0<=c&&(h.Ta[e]=c&511);break;case 4193758:h.ec[e]=h.Ta[e];c=h.ec[e];break;case 4193760:c=h.ed[e]; -break;case 4193762:c=h.fd[e];break;case 4193764:c=h.cd[e];break;case 4193766:c=h.dd[e];break;case 4193768:c=K(this,h.cb,a,b,d);0<=c&&(h.cb=c&63,h.U=h.U&-769|(c&3)<<8);break;case 4193770:c=K(this,h.nc,a,b,d);0<=c&&(h.nc=c);break;default:return f.M|=16,L(f,4,132)}break;case 4192512:e=this.G;switch(a&-2){case 4192512:c=K(this,e.K,a,b,d);0<=b&&0<=c&&(e.Xa=e.Xa&60|c>>4&3,e.K=e.K&-1023|c&1022,e.K&128||bc(this));break;case 4192514:c=K(this,e.Jb,a,b,d);0<=c&&(e.Jb=c&65534);break;case 4192516:c=K(this,e.fa, -a,b,d);0<=c&&(e.fa=c);break;case 4192518:c=K(this,e.ab,a,b,d);0<=c&&(e.ab=c);break;case 4192520:c=K(this,e.Xa,a,b,d);0<=c&&(e.Xa=c&63,e.K=e.K&-49|(e.Xa&3)<<4);break;default:return f.M|=16,L(f,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?c=f.Ua:(c=K(this,f.Ua,a,b,d),0<=c&&(70!==f.jb&&(c&=-49),f.Ua=c,f.lb[0]=c&4?15:7,f.lb[1]=c&2?15:7,f.lb[3]=c&1?15:7,f.tb&&(e=2,f.Ua&16&&(e=1),this.g.sb=this.g.sb&-8|e)));break;default:return f.M|=16,L(f,4,136)}break;case 4191424:e=a>>1&31;c=K(this,f.ma[0][e], -a,b,d);0<=c&&(f.ma[0][e]=c,f.ma[0][e&15]&=65295);break;case 4191360:e=a>>1&31;c=K(this,f.ma[1][e],a,b,d);0<=c&&(f.ma[1][e]=c,f.ma[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.jb)return L(f,4,234);e=a>>2&31;c=f.Xb[e];a&2&&(c>>=16);c&=65535;0<=b&&(c=K(this,c,a,b,d),0<=c&&(f.Xb[e]=a&2?c<<16|f.Xb[e]&65535:f.Xb[e]&4294901760|c&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)c=Wb[a>>1&255];else return f.M|=16,L(f, -4,138);break;default:return f.M|=16,L(f,4,142)}d&&0<=c&&(a&1?c>>=8:c&=255);"undefined"===typeof c&&console.log("panic(76)");return c};var gc={},Xb=(gc[65534]=[null,null,Vb.prototype.Zc,Vb.prototype.ld],gc);Oa(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.G,0,d>>2),nc(this,jc?oc:pc);else{this.b=Array(d>>2);for(a=0;a>1;0>b?c=f.jc[e]:(c=K(this,f.jc[e],a,b,d),0<=c&&(f.jc[e]=c));break;case 4194254:return a&1?f.N>>14&1?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.ua[3]=b),c=f.ua[3]):f.N>>14&0?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.ua[1]=b),c=f.ua[1]),c;case 4194252:case 4194250:case 4194248:return e=a&7,f.N&2048?(0<=b&&(f.f[e]=b),c=f.f[e]):(0<=b&&(f.bb[e]= +b),c=f.bb[e]),c;case 4194246:return a&1?(0<=b&&(f.f[7]=b),c=f.f[7]):f.N>>14&0?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.ua[0]=b),c=f.ua[0]),c;case 4194244:case 4194242:case 4194240:return e=a&7,f.N&2048?(0<=b&&(f.bb[e]=b),c=f.bb[e]):(0<=b&&(f.f[e]=b),c=f.f[e]),c;default:return f.M|=16,L(f,4,124)}break;case 4194176:e=a>>1&31;c=K(this,f.ma[3][e],a,b,d);0<=c&&(f.ma[3][e]=c,f.ma[3][e&15]&=65295);break;case 4194112:var g=this.g;e=this.u;switch(a&-2){case 4194174:c=K(this,f.Eb,a,b,d);0<=c&&(f.Eb=c);break;case 4194172:c= +f.Ga;c&65280&&(c=(c<<8|c>>8)&65535);break;case 4194170:f.ea=f.ea&62337|f.Pb<<5|f.ac<<1;0>b?c=f.ea:(c=K(this,f.ea,a,b,d),0<=c&&(f.ea=c&=62337,f.Pb=c>>5&3,f.ac=c>>1&15,c&257?(e=2,f.Ua&16&&(e=1),f.tb=c&1?tb|E:E):(f.tb=0,e=4),this.w.sb=this.w.sb&-8|e));break;case 4194168:0>b?c=this.w.kd&65535:(c=K(this,this.w.data,a,b,d),0<=c&&(this.w.data=c));break;case 4194166:0<=b&&(b&127&&(g.Mc=0),g.xa&=-129,J(f,100,4,52,function(){g.xa|=128;return!!(g.xa&64)}));c=0;break;case 4194164:break;case 4194162:c=0;0>b&& +(g.Ma&=-129,0b?c=g.Ma:(c=K(this,g.Ma,a,b,d),0<=c&&(g.Ma=g.Ma&128|c&-129));break;case 4194150:0>b?(c=e.K,e.K&=-129):(c=K(this,e.K,a,b,d),0<=c&&(c&64&&!e.Ob&&(setInterval(this.Tc.bind(this),25),e.Ob=1),e.K=c&-129));break;default:return f.M|=16,L(f,4,126)}break;case 4194048:e=this.G;switch(a&-2){case 4194048:c=K(this,e.Vb,a,b,d);0<=c&&(e.Vb=c);break;case 4194050:c=K(this,e.oa, +a,b,d);0<=c&&(e.oa=c);break;case 4194052:c=K(this,e.T,a,b,d);0<=b&&0<=c&&(e.T=c&-36993|e.T&36992,e.T&1&&$b(this));break;case 4194054:c=K(this,e.Wb,a,b,d);0<=c&&(e.Wb=c);break;case 4194056:c=K(this,e.Ub,a,b,d);0<=c&&(e.Ub=c);break;case 4194058:c=K(this,e.va,a,b,d);0<=c&&(e.va=c);break;case 4194060:break;case 4194062:c=K(this,e.Ac,a,b,d);0<=c&&(e.Ac=c);break;default:return f.M|=16,L(f,4,128)}break;case 4193728:var h=this.O;e=h.Ea&7;switch(a&-2){case 4193728:c=K(this,h.U,a,b,d);0<=b&&0<=c&&(h.cb=h.cb& +60|c>>8&3,h.U=c&17279|h.U&34944|2048,c&1&&h.U&128?dc(this,e):192==(c&192)&&J(f,0,5,172));break;case 4193730:c=K(this,h.zb,a,b,d);0<=c&&(h.zb=c);break;case 4193732:c=K(this,h.xb,a,b,d);0<=c&&(h.xb=c&65534);break;case 4193734:c=K(this,h.Fa[e],a,b,d);0<=c&&(h.Fa[e]=c&7967);break;case 4193736:c=K(this,h.Ea,a,b,d);0<=c&&(h.Ea=c&63|h.Ea&65472,c&128&&cc(this));break;case 4193738:c=h.ta[e];break;case 4193740:c=h.yb[e];break;case 4193742:c=K(this,h.nb,a,b,d);0<=c&&(h.nb=c&255);break;case 4193744:c=h.hd[e]; +break;case 4193746:c=K(this,h.Bc,a,b,d);0<=c&&(h.Bc=c);break;case 4193748:c=K(this,h.Cc[e],a,b,d);0<=c&&(h.Cc[e]=c&1023);break;case 4193750:c=8210;break;case 4193752:c=h.jd[e];break;case 4193754:c=K(this,h.Dc[e],a,b,d);0<=c&&(h.Dc[e]=c);break;case 4193756:c=K(this,h.Ta[e],a,b,d);0<=c&&(h.Ta[e]=c&511);break;case 4193758:h.ec[e]=h.Ta[e];c=h.ec[e];break;case 4193760:c=h.fd[e];break;case 4193762:c=h.gd[e];break;case 4193764:c=h.dd[e];break;case 4193766:c=h.ed[e];break;case 4193768:c=K(this,h.cb,a,b,d); +0<=c&&(h.cb=c&63,h.U=h.U&-769|(c&3)<<8);break;case 4193770:c=K(this,h.nc,a,b,d);0<=c&&(h.nc=c);break;default:return f.M|=16,L(f,4,132)}break;case 4192512:e=this.J;switch(a&-2){case 4192512:c=K(this,e.K,a,b,d);0<=b&&0<=c&&(e.Xa=e.Xa&60|c>>4&3,e.K=e.K&-1023|c&1022,e.K&128||bc(this));break;case 4192514:c=K(this,e.Jb,a,b,d);0<=c&&(e.Jb=c&65534);break;case 4192516:c=K(this,e.fa,a,b,d);0<=c&&(e.fa=c);break;case 4192518:c=K(this,e.ab,a,b,d);0<=c&&(e.ab=c);break;case 4192520:c=K(this,e.Xa,a,b,d);0<=c&&(e.Xa= +c&63,e.K=e.K&-49|(e.Xa&3)<<4);break;default:return f.M|=16,L(f,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?c=f.Ua:(c=K(this,f.Ua,a,b,d),0<=c&&(70!==f.jb&&(c&=-49),f.Ua=c,f.lb[0]=c&4?15:7,f.lb[1]=c&2?15:7,f.lb[3]=c&1?15:7,f.tb&&(e=2,f.Ua&16&&(e=1),this.w.sb=this.w.sb&-8|e)));break;default:return f.M|=16,L(f,4,136)}break;case 4191424:e=a>>1&31;c=K(this,f.ma[0][e],a,b,d);0<=c&&(f.ma[0][e]=c,f.ma[0][e&15]&=65295);break;case 4191360:e=a>>1&31;c=K(this,f.ma[1][e],a,b,d);0<=c&&(f.ma[1][e]=c, +f.ma[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.jb)return L(f,4,234);e=a>>2&31;c=f.Xb[e];a&2&&(c>>=16);c&=65535;0<=b&&(c=K(this,c,a,b,d),0<=c&&(f.Xb[e]=a&2?c<<16|f.Xb[e]&65535:f.Xb[e]&4294901760|c&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)c=Wb[a>>1&255];else return f.M|=16,L(f,4,138);break;default:return f.M|=16,L(f,4,142)}d&&0<=c&&(a&1?c>>=8:c&=255);"undefined"===typeof c&&console.log("panic(76)"); +return c};var gc={},Xb=(gc[65534]=[null,null,Vb.prototype.Zc,Vb.prototype.md],gc[65396]=[null,null,Vb.prototype.$c,Vb.prototype.nd],gc);Oa(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.G,0,d>>2),nc(this,jc?oc:pc);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,d)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},qa:function(a){var b=a>>2;a=(a&3)<<3;var d=this.b[b]>>a;return 24>a?d&65535:d&255|(this.b[b+1]&255)<<8},Ca:function(a,b){var d=a>> -2;a=(a&3)<<3;this.b[d]=this.b[d]&~(255<>2;a=(a&3)<<3;24>a?this.b[d]=this.b[d]&~(65535<>8);this.Za=!0},$:function(a,b){if(this.I&&null!=this.w){var d=this.I;uc(d,this.w+a,1,d.Y)&&d.pa(!0)}return this.Tb(a,b)},ha:function(a,b){if(this.I&&null!=this.w){var d=this.I;uc(d,this.w+a,2,d.Y)&&d.pa(!0)}return this.mc(a,b)},za:function(a,b,d){if(this.I&&null!=this.w){var c=this.I;uc(c,this.w+ -a,1,c.J)&&c.pa(!0)}this.H?this.u(a,b,d):this.Cb(a,b,d)},Ia:function(a,b,d){if(this.I&&null!=this.w){var c=this.I;uc(c,this.w+a,2,c.J)&&c.pa(!0)}this.H?this.u(a,b,d):this.qc(a,b,d)},Y:function(a){return this.g[a]},ba:function(a){return this.g[a]},da:function(a){return this.J.getUint16(a,!0)},ia:function(a){return a&1?this.g[a]|this.g[a+1]<<8:this.R[a>>1]},ya:function(a,b){this.g[a]=b;this.Za=!0},Aa:function(a,b){this.g[a]=b;this.Za=!0},Ha:function(a,b){this.J.setUint16(a,b,!0);this.Za=!0},Va:function(a, -b){a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.R[a>>1]=b;this.Za=!0}};function zb(a,b,d){a.I=b;a.P=a.B=0;d&&((a.P=d.P)&&tc(a,sc,!1),(a.B=d.B)&&rc(a,sc,!1))}function vc(a,b){b?--a.B||(a.Bb=a.H?a.u:a.Cb,a.Fc=a.H?a.O:a.qc):--a.P||(a.wb=a.Tb,a.zc=a.mc)}function rc(a,b,d){d&&a.B||(a.Bb=!a.H&&b[1]||a.u,a.Fc=!a.H&&b[3]||a.O);if(d||void 0===d)a.Cb=b[1]||a.u,a.qc=b[3]||a.O}function tc(a,b,d){d&&a.P||(a.wb=b[0]||a.W,a.zc=b[2]||a.X);if(d||void 0===d)a.Tb=b[0]||a.W,a.mc=b[2]||a.X} +I.prototype={constructor:I,parent:null,Ob:function(a){this.A=a},save:function(){var a,b;if(this.controller)a=null;else if(sb)for(a=Array(this.size>>2),b=0;b>8,d)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},qa:function(a){var b=a>>2;a=(a&3)<<3;var d=this.b[b]>>a;return 24>a?d&65535:d&255|(this.b[b+1]&255)<<8},Ca:function(a,b){var d=a>> +2;a=(a&3)<<3;this.b[d]=this.b[d]&~(255<>2;a=(a&3)<<3;24>a?this.b[d]=this.b[d]&~(65535<>8);this.Za=!0},$:function(a,b){if(this.I&&null!=this.A){var d=this.I;uc(d,this.A+a,1,d.Y)&&d.pa(!0)}return this.Tb(a,b)},ha:function(a,b){if(this.I&&null!=this.A){var d=this.I;uc(d,this.A+a,2,d.Y)&&d.pa(!0)}return this.mc(a,b)},za:function(a,b,d){if(this.I&&null!=this.A){var c=this.I;uc(c,this.A+ +a,1,c.J)&&c.pa(!0)}this.H?this.u(a,b,d):this.Cb(a,b,d)},Ia:function(a,b,d){if(this.I&&null!=this.A){var c=this.I;uc(c,this.A+a,2,c.J)&&c.pa(!0)}this.H?this.u(a,b,d):this.qc(a,b,d)},Y:function(a){return this.g[a]},ba:function(a){return this.g[a]},da:function(a){return this.J.getUint16(a,!0)},ia:function(a){return a&1?this.g[a]|this.g[a+1]<<8:this.R[a>>1]},ya:function(a,b){this.g[a]=b;this.Za=!0},Aa:function(a,b){this.g[a]=b;this.Za=!0},Ha:function(a,b){this.J.setUint16(a,b,!0);this.Za=!0},Va:function(a, +b){a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.R[a>>1]=b;this.Za=!0}};function zb(a,b,d){a.I=b;a.P=a.w=0;d&&((a.P=d.P)&&tc(a,sc,!1),(a.w=d.w)&&rc(a,sc,!1))}function vc(a,b){b?--a.w||(a.Bb=a.H?a.u:a.Cb,a.Fc=a.H?a.O:a.qc):--a.P||(a.wb=a.Tb,a.zc=a.mc)}function rc(a,b,d){d&&a.w||(a.Bb=!a.H&&b[1]||a.u,a.Fc=!a.H&&b[3]||a.O);if(d||void 0===d)a.Cb=b[1]||a.u,a.qc=b[3]||a.O}function tc(a,b,d){d&&a.P||(a.wb=b[0]||a.W,a.zc=b[2]||a.X);if(d||void 0===d)a.Tb=b[0]||a.W,a.mc=b[2]||a.X} function nc(a,b){b||(b=wc);tc(a,b,void 0);rc(a,b,void 0)}var wc=[],qc=[I.prototype.ca,I.prototype.Ca,I.prototype.qa,I.prototype.Fb],sc=[I.prototype.$,I.prototype.za,I.prototype.ha,I.prototype.Ia];if(sb)var pc=[I.prototype.Y,I.prototype.ya,I.prototype.da,I.prototype.Ha],oc=[I.prototype.ba,I.prototype.Aa,I.prototype.ia,I.prototype.Va]; function xc(a,b){u.call(this,"CPU",a,xc,1);var d=a.multiplier||1;this.Ha=a.cycles||b;this.mb=d;this.Ca=Math.round(this.Ha/1E4)/100;this.kb=this.Ca*this.mb;this.j.la=!1;this.j.pc=!1;this.j.Hb=a.autoStart;this.j.wc=!1;this.j.rb=!1;this.Qb=this.ba=0;this.Rb=a.csStart;this.ub=a.csInterval;this.vb=a.csStop;this.ya=[];this.Kb=this.ob.bind(this);D(this)}w(xc);var yc=["power","reset"];l=xc.prototype; -l.$a=function(a,b,d,c){this.B=a;this.H=b;this.I=c;for(b=0;b=a.ba&&(a.ba+=a.ub,d=!0);0<=a.vb&&a.vb<=Rc(a)&&(a.ub=a.vb=-1,Pc(a),a.pa(),d=!0);d&&a.i(Rc(a)+" cycles: checksum="+r(a.Qb))}} function Sc(a,b,d,c){if(a.P[b]){void 0===d&&(rb(a,"Value for "+b+" is invalid"),a.pa());var e=a.I&&a.I.za||8;d=!a.j.la||a.j.wc?8==e?ca(d,c):r(d,c):"--------".substr(0,c||4);a.P[b].textContent!=d&&(a.P[b].textContent=d)}} -l.xa=function(a,b,d){var c=this;a=!1;switch(b){case "power":case "reset":this.P[b]=d;a=!0;break;case "run":this.P[b]=d;d.onclick=function(){var a;if(a=c.B)if(a=c.B,a.j.ga)a=!0;else{var b=null,d,h=$a(a.id);for(d=0;da.W/a.kb?b=1:c=!0;a.mb=b;b=a.Ca*a.mb;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var e=a.P.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}d&&a.B&&a.B.Yb()}Uc(a,a.R);a.R=0;a.O=ra();a.X=0;Vc(a);return c}function Wc(a){a.Y-=a.b;a.b=0} -l.ob=function(a){if(db(this,!0)){if(!this.j.la){Tc(this);this.B&&this.B.start(this.O,Rc(this));this.j.la=!0;this.j.pc=!0;this.ha&&this.ha.start();var b=this.P.run;b&&(b.textContent="Halt");this.B&&(this.B.Ba(!0),a&&this.B.Yb(!0))}this.Ia>=this.Ha&&Vc(this,!0);this.ia=0;this.za=ra();this.X&&(a=this.za-this.X,a>this.Db&&(this.O+=a,this.O>this.za&&(this.O=this.za)));try{do{for(var d,c=this.j.rb?1:this.Aa,e=this.ya.length-1;0<=e;e--){var f=this.ya[e];0>f[0]||c>f[0]&&(c=f[0])}d=c;try{this.Ab(d)}catch(m){if("number"!= -typeof m)throw m;}var g=this.Y-this.b;a=g;for(var h=this.ya.length-1;0<=h;h--){var k=this.ya[h];0>k[0]||(k[0]-=a,0>=k[0]&&(k[0]=-1,k[1]()))}this.ia+=g;this.R+=g;Uc(this,0,!0);Qc(this,g);this.ca-=g;if(0>=this.ca){this.ca+=this.Aa;15<=++this.Ib&&(this.B&&this.B.Ba(),this.Ib=0);break}}while(this.j.la)}catch(m){this.pa();N(this);this.B&&this.B.stop(ra(),Rc(this));db(this,!1);rb(this,m.stack||m.message);return}d=setTimeout;c=this.Kb;this.X=ra();e=this.Db;this.ia&&(e=Math.round(e*this.ia/this.Aa));e-=this.X- -this.za;if(f=this.X-this.O)this.W=Math.round(this.R/(10*f))/100,864E5<=f&&(this.$=0,Tc(this));if(0>e||this.We&&(this.O-=e),e=0;this.Ia+=this.ia;this.X+=e;d(c,e)}else N(this),this.B&&this.B.stop(ra(),Rc(this))};l.Ab=function(){return 0};l.pa=function(a){pb(this,!0);Wc(this);Uc(this,this.R);this.R=0;if(this.j.la){this.j.la=!1;this.ha&&this.ha.stop();var b=this.P.run;b&&(b.textContent="Run")}this.j.complete=a};function N(a,b){a.B&&a.B.Ba(b)} -function Xc(a){this.Xc=+a.model||1170;this.kc=a.resetAddr||0;xc.call(this,a,1E6);this.Va=0;this.decode=Yc.bind(this);this.D=65536;this.C=32768;this.F=65535;this.A=32768;this.f=[0,0,0,0,0,0,0,this.kc];this.bb=[0,0,0,0,0,0];this.va=[0,0,0,0];this.Sa=255;this.ac=this.Pb=this.tb=this.G=this.Ua=this.Eb=this.Ga=this.ea=this.M=this.dc=0;this.lb=[7,7,7,7];this.ma=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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, +function Tc(a,b,d){var c=!1;if(void 0!==b){.8>a.W/a.kb?b=1:c=!0;a.mb=b;b=a.Ca*a.mb;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var e=a.P.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}d&&a.w&&a.w.Yb()}Uc(a,a.R);a.R=0;a.O=ra();a.X=0;Vc(a);return c}function Wc(a){a.Y-=a.b;a.b=0} +l.ob=function(a){if(db(this,!0)){if(!this.j.la){Tc(this);this.w&&this.w.start(this.O,Rc(this));this.j.la=!0;this.j.pc=!0;this.ha&&this.ha.start();var b=this.P.run;b&&(b.textContent="Halt");this.w&&(this.w.Ba(!0),a&&this.w.Yb(!0))}this.Ia>=this.Ha&&Vc(this,!0);this.ia=0;this.za=ra();this.X&&(a=this.za-this.X,a>this.Db&&(this.O+=a,this.O>this.za&&(this.O=this.za)));try{do{for(var d,c=this.j.rb?1:this.Aa,e=this.ya.length-1;0<=e;e--){var f=this.ya[e];0>f[0]||c>f[0]&&(c=f[0])}d=c;try{this.Ab(d)}catch(m){if("number"!= +typeof m)throw m;}var g=this.Y-this.b;a=g;for(var h=this.ya.length-1;0<=h;h--){var k=this.ya[h];0>k[0]||(k[0]-=a,0>=k[0]&&(k[0]=-1,k[1]()))}this.ia+=g;this.R+=g;Uc(this,0,!0);Qc(this,g);this.ca-=g;if(0>=this.ca){this.ca+=this.Aa;15<=++this.Ib&&(this.w&&this.w.Ba(),this.Ib=0);break}}while(this.j.la)}catch(m){this.pa();N(this);this.w&&this.w.stop(ra(),Rc(this));db(this,!1);rb(this,m.stack||m.message);return}d=setTimeout;c=this.Kb;this.X=ra();e=this.Db;this.ia&&(e=Math.round(e*this.ia/this.Aa));e-=this.X- +this.za;if(f=this.X-this.O)this.W=Math.round(this.R/(10*f))/100,864E5<=f&&(this.$=0,Tc(this));if(0>e||this.We&&(this.O-=e),e=0;this.Ia+=this.ia;this.X+=e;d(c,e)}else N(this),this.w&&this.w.stop(ra(),Rc(this))};l.Ab=function(){return 0};l.pa=function(a){pb(this,!0);Wc(this);Uc(this,this.R);this.R=0;if(this.j.la){this.j.la=!1;this.ha&&this.ha.stop();var b=this.P.run;b&&(b.textContent="Run")}this.j.complete=a};function N(a,b){a.w&&a.w.Ba(b)} +function Xc(a){this.Xc=+a.model||1170;this.kc=a.resetAddr||0;xc.call(this,a,1E6);this.Va=0;this.decode=Yc.bind(this);this.D=65536;this.C=32768;this.F=65535;this.B=32768;this.f=[0,0,0,0,0,0,0,this.kc];this.bb=[0,0,0,0,0,0];this.ua=[0,0,0,0];this.Sa=255;this.ac=this.Pb=this.tb=this.G=this.Ua=this.Eb=this.Ga=this.ea=this.M=this.dc=0;this.lb=[7,7,7,7];this.ma=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535, 65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Xb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.jc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.g=-1;this.V=0;this.jb=70;this.da=-1;this.u=[];this.qa=0;this.Ra=2;Zc(this);this.j.complete=this.j.Lc=!1}w(Xc,xc);l=Xc.prototype; l.reset=function(){this.j.la&&this.pa();$c(this);Oc(this);this.j.error=!1;this.parent.reset.call(this)};function $c(a){a.Sa=255;a.M=0;a.u=[];a.dc=0;a.ea=a.Ga=a.Eb=a.Ua=a.tb=0;a.lb[0]=a.lb[1]=a.lb[3]=7;a.Pb=0;Zc(a)}function Zc(a){a.tb?(a.J=65536,a.L=a.Rc,a.Lb=a.na):(a.J=0,a.L=a.Qc,a.Lb=a.ka)}l.yc=function(){return 0};l.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.pb,this.$,this.mb]);a.set(2,Jb(this.H));return a.data()}; l.restore=function(a){var b=a[1];this.pb=b[0];this.$=b[1];Tc(this,b[3]);a:{b=this.H;a=a[2];var d;for(d=0;db){a.u[f].Ja-=b;break}b-=a.u[f].Ja}a.u.splice(f+1,0,{delay:b,priority:d&224,vector:c,callback:e})}a.Ra=2}function Yb(a){return a.N=a.N&63728|(a.A&32768?8:0)|(a.F&65535?0:4)|(a.C&32768?2:0)|(a.D&65536?1:0)} -function Zb(a,b){a.A=b<<12;a.F=~b&4;a.C=b<<14;a.D=b<<16;if((b^a.N)&2048)for(var d=a.bb.length;0<=--d;){var c=a.f[d];a.f[d]=a.bb[d];a.bb[d]=c}a.G=b>>14&3;d=a.N>>14&3;a.G!=d&&(a.va[d]=a.f[6],a.f[6]=a.va[a.G]);a.Ra=2;a.N=b}function ad(a,b){a.V&128||(a.A=a.F=a.D=b,a.C=0)}function bd(a,b){a.V&128||(a.A=a.F=b,a.C=0)}function cd(a,b,d,c){a.V&128||(a.A=a.F=a.D=b,a.C=(d^c)&(c^b))} +function J(a,b,d,c,e){for(var f=a.u.length;0b){a.u[f].Ja-=b;break}b-=a.u[f].Ja}a.u.splice(f+1,0,{delay:b,priority:d<<5&224,vector:c,callback:e})}a.Ra=2}function Yb(a){return a.N=a.N&63728|(a.B&32768?8:0)|(a.F&65535?0:4)|(a.C&32768?2:0)|(a.D&65536?1:0)} +function Zb(a,b){a.B=b<<12;a.F=~b&4;a.C=b<<14;a.D=b<<16;if((b^a.N)&2048)for(var d=a.bb.length;0<=--d;){var c=a.f[d];a.f[d]=a.bb[d];a.bb[d]=c}a.G=b>>14&3;d=a.N>>14&3;a.G!=d&&(a.ua[d]=a.f[6],a.f[6]=a.ua[a.G]);a.Ra=2;a.N=b}function ad(a,b){a.V&128||(a.B=a.F=a.D=b,a.C=0)}function bd(a,b){a.V&128||(a.B=a.F=b,a.C=0)}function cd(a,b,d,c){a.V&128||(a.B=a.F=a.D=b,a.C=(d^c)&(c^b))} function L(a,b,d){var c,e,f=0;0>a.da?a.da=Yb(a):a.G||(b=4,f=1);a.ea&57344||(a.Ga=63222,a.Eb=b);a.G=0;0<=(c=a.na(b|65536))&&0<=(e=a.na(b+2&65535|65536))&&(Zb(a,e&53247|a.da>>2&12288),f&&(a.M|=4,a.f[6]=4),0<=dd(a,a.da)&&0<=dd(a,a.f[7])&&(a.f[7]=c));a.V&=-113;a.da=-1;throw b|d<<8;}function fc(a,b){var d=b>>13&31;31>d?a.Ua&32&&(b=a.Xb[d]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} function ed(a,b,d){var c,e,f,g=0;if(d&a.tb){c=b>>13&a.lb[a.G];e=a.ma[a.G][c];f=(a.ma[a.G][c+16]<<6)+(b&8191)&4194303;a.Ua&16?3932160<=f&&4186112>f&&(f=fc(a,f&262143)):(f&=262143,253952<=f&&(f|=4186112));3932160>f&&(3915776<=f&&(a.M|=32,L(a,4,24)),f&1&&!(d&1)&&(a.M|=64,L(a,4,26)));switch(e&7){case 1:g=4096;case 2:e|=128;d&E&&(g=8192);break;case 4:g=4096;case 5:d&E&&(g=4096);case 6:e|=d&E?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2& 8128)&&(g|=16384));a.ma[a.G][c]=e;if(4194170!==f||a.G)a.Pb=a.G,a.ac=c;g&&(g&57344&&(0<=a.da&&(g|=128),a.ea&57344||(a.ea=a.ea|g|a.Pb<<5|a.ac<<1),L(a,168,28)),a.ea&61440||!(4191360>f||4194239>3&7){case 0:L(a,4,34);break;case 1:return 6===f&&!a.G&&d&E&&(a.f[6]<=a.Sa||65534<=a.f[6])&&(a.f[6]<=a.Sa-32||65534<=a.f[6]?(a.M|=4,a.f[6]=4,L(a,4,36)):(a.M|=8,a.V|=64)),7===f?a.f[f]:a.f[f]|a.J;case 2:e=2;c=a.f[f];7!==f&&(c|=a.J,6>f&&d&1&&(e=1));break;case 3:e=2;c=a.f[f];7!==f&&(c|=a.J);if(0>(c=a.na(c)))return c;c|=a.J;break;case 4:e=-2;6>f&&d&1&&(e=-1);c=a.f[f]+e&65535;7!==f&&(c|=a.J);break;case 5:e=-2;c=a.f[f]-2&65535;7!==f&&(c|=a.J);if(0>(c=a.na(c)))return c; c|=a.J;break;case 6:if(0>(c=a.na(a.f[7])))return c;a.f[7]=a.f[7]+2&65535;c=c+a.f[f]&65535;return c|a.J;case 7:if(0>(c=a.na(a.f[7])))return c;a.f[7]=a.f[7]+2&65535;c=c+a.f[f]&65535;return 0>(c=a.na(c|65536))?c:c|a.J}a.f[f]=a.f[f]+e&65535;!a.J||a.ea&57344||(a.Ga=a.Ga<<8|e<<3&248|f);6===f&&!a.G&&d&E&&0>=e&&(a.f[6]<=a.Sa||65534<=a.f[6])&&(a.f[6]<=a.Sa-32?(a.M|=4,a.f[6]=4,L(a,4,38)):(a.M|=8,a.V|=64));return c}l.Qc=function(a,b){return gd(this,a,b)};l.Rc=function(a,b){return ed(this,gd(this,a,b),b)}; function S(a,b){return b&56?a.Lb(gd(a,b,tb)):a.f[b&7]}function hd(a,b){return b&56?P(a,a.L(b,ub)):a.f[b&7]&255}function id(a,b,d,c){b&56?(b=a.L(b,F),M(a,b,c.call(a,d,a.ka(b)))):(b&=7,a.f[b]=c.call(a,d,a.f[b])&65535)}function jd(a,b,d,c){b&56?(b=a.L(b,G),Q(a,b,c.call(a,d,P(a,b)))):(b&=7,a.f[b]=a.f[b]&65280|c.call(a,d,a.f[b])&255)}function kd(a,b,d){b&56?M(a,a.L(b,E),d):a.f[b&7]=d&65535;return d} -function ld(a,b,d,c){b&56?Q(a,a.L(b,vb),d):(b&=7,a.f[b]=c?c&1?a.f[b]&-256:d<<24>>24&65535:a.f[b]&-256|d&255);return d}function T(a,b){return((b&128?b|65280:b&255)<<1)+a&65535} +function ld(a,b,d,c){b&56?Q(a,a.L(b,vb),d):(b&=7,a.f[b]=d?c&1?d<<24>>24&65535:a.f[b]&-256|d&255:a.f[b]&-256);return d}function T(a,b){return((b&128?b|65280:b&255)<<1)+a&65535} l.Ab=function(a){this.j.complete=!0;var b=this.j.Lc=this.I&&md(this.I),d=a?this.j.pc?0:1:-1;this.j.pc=!1;this.Y=this.b=a;this.pb&256?(Wc(this),a=!1):a=!0;if(a){do{if(b){if(nd(this.I,this.f[7],d)){this.pa();break}d=1}var c,e,f,g;this.V&112&&(this.V&32?L(this,168,52):this.V&64?L(this,4,54):this.V&16&&L(this,12,56),this.V&=-113);if(this.Ra)if(1===this.Ra)this.Ra=2;else{this.Ra=0;c=-1;e=this.dc&224;if(0<(a=this.u.length))for(;0e&&(e=this.u[a].Yc,c=a)}e>(this.N&224)&&(0>c?L(this,160,42):(L(this,this.u[c].kd,44),this.u.splice(c,1)))}this.ea&57344||(this.Ga=0,this.Eb=this.f[7]);this.V=this.N&16;this.g=a=this.na(this.f[7]);0<=a&&(this.f[7]=this.f[7]+2&65535);this.decode(a);if(0>this.g)switch(a&61440){case 4096:break;case 8192:break;case 12288:break;case 16384:break;case 20480:break;case 24576:break;case 36864:break;case 40960:break;case 45056:break;case 49152:break;case 53248:break; -case 57344:break;default:switch(a&65024){case 2048:0<=(f=gd(this,a,0))&&(g=a>>6&7,0<=dd(this,this.f[g])&&(this.f[g]=this.f[7],this.f[7]=f&65535));break;case 28672:0<=(c=S(this,a))&&(g=a>>6&7,c&32768&&(c|=-65536),e=this.f[g],e&32768&&(e|=-65536),a=~~(c*e),this.f[g]=a>>16&65535,this.f[g|1]=a&65535,this.A=a>>16,this.F=this.A|a,this.D=this.C=0,-32768>a||32767>6&7,e=this.f[g]<<16|this.f[g|1],this.D=this.C=0,c&32768&&(c|=-65536),a=~~(e/c),-32768<= -a&&32767>=a?(this.f[g]=a&65535,this.f[g|1]=e-a*c&65535,this.F=a>>16|a,this.A=a>>16):(this.C=32768,this.F=a>>15|a,this.A=e>>16,-1===c&&65534===this.f[g]&&(this.f[g]=this.f[g|1]=1))):(this.F=this.A=0,this.C=32768,this.D=65536));break;case 29696:0<=(c=S(this,a))&&(g=a>>6&7,a=this.f[g],a&32768&&(a|=4294901760),this.D=this.C=0,c&=63,c&32?(c=64-c,16>=c):c&&(16>15&65535)&&65535!==e&&(this.C=32768))),this.f[g]=a&65535,this.A=this.F=a);break; -case 30208:if(0<=(c=S(this,a))){g=a>>6&7;e=this.f[g]<<16|this.f[g|1];this.D=this.C=0;c&=63;if(c&32)c=64-c,32>c-1,this.D=a<<16,a>>=1,e&2147483648&&(a|=4294967295<<32-c);else if(c){if(a=e<>15,a<<=1,32>=32-c)e|=4294967295<>16&65535;this.f[g|1]=a&65535;this.A=a>>16;this.F=a>>16|a}break;case 30720:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(e^=this.f[a>>6&7],0<=M(this,c,e)&&(this.A=this.F=e,this.C=0)): -(this.A=this.F=e=this.f[a&7]^=this.f[a>>6&7],this.C=0);break;case 32256:g=a>>6&7;if(this.f[g]=this.f[g]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535;break;default:switch(a&65280){case 256:this.f[7]=T(this.f[7],a);break;case 512:this.F&65535&&(this.f[7]=T(this.f[7],a));break;case 768:this.F&65535||(this.f[7]=T(this.f[7],a));break;case 1024:(this.A&32768)===(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1280:(this.A&32768)!==(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1536:this.F& -65535&&(this.A&32768)===(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1792:this.F&65535&&(this.A&32768)===(this.C&32768)||(this.f[7]=T(this.f[7],a));break;case 32768:this.A&32768||(this.f[7]=T(this.f[7],a));break;case 33280:!(this.D&65536)&&this.F&65535&&(this.f[7]=T(this.f[7],a));break;case 33024:this.A&32768&&(this.f[7]=T(this.f[7],a));break;case 33536:if(this.D&65536||!(this.F&65535))this.f[7]=T(this.f[7],a);break;case 33792:this.C&32768||(this.f[7]=T(this.f[7],a));break;case 34048:this.C& -32768&&(this.f[7]=T(this.f[7],a));break;case 34304:this.D&65536||(this.f[7]=T(this.f[7],a));break;case 34560:this.D&65536&&(this.f[7]=T(this.f[7],a));break;case 34816:L(this,24,2);break;case 35072:L(this,28,4);break;default:switch(a&65472){case 64:0<=(f=gd(this,a,0))&&(this.f[7]=f&65535);break;case 192:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<8|e>>8,0<=M(this,c,a)&&(this.A=this.F=e&65280,this.C=this.D=0)):(g=a&7,e=this.f[g],this.f[g]=(e<<8|e>>8)&65535,this.A=this.F=e&65280,this.C=this.D=0);break; -case 2560:break;case 2624:0<=(e=this.ka(c=this.L(a,F)))&&(a=~e,0<=M(this,c,a)&&(this.A=this.F=a,this.D=65536,this.C=0));break;case 2688:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e+1,0<=M(this,c,a)&&(this.A=this.F=a,this.C=a&(a^e))):(g=a&7,e=this.f[g],a=e+1,this.f[g]=a&65535,this.A=this.F=a,this.C=a&(a^e));break;case 2752:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e-1,0<=M(this,c,a)&&(this.A=this.F=a,this.C=(a^e)&e)):(g=a&7,e=this.f[g],a=e-1,this.f[g]=a&65535,this.A=this.F=a,this.C=(a^e)&e);break;case 2816:0<= -(e=this.ka(c=this.L(a,F)))&&(a=-e,0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=a&e));break;case 2880:0<=(e=this.ka(c=this.L(a,F)))&&(a=e+(this.D>>16&1),0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=a&(a^e)));break;case 2944:0<=(e=this.ka(c=this.L(a,F)))&&(a=e-(this.D>>16&1),0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=(a^e)&e));break;case 3008:0<=(e=S(this,a))&&(this.A=this.F=e,this.D=this.C=0);break;case 3072:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=(this.D&65536|e)>>1,0<=M(this,c,a)&&(this.D= -e<<16,this.A=this.F=a,this.C=a^this.D>>1)):(g=a&7,e=this.f[g],a=(this.D&65536|e)>>1,this.f[g]=a&65535,this.D=e<<16,this.A=this.F=a,this.C=a^this.D>>1);break;case 3136:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<1|this.D>>16&1,0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=a^e)):(g=a&7,e=this.f[g],a=e<<1|this.D>>16&1,this.f[g]=a&65535,this.D=this.A=this.F=a,this.C=a^e);break;case 3200:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e&32768|e>>1,0<=M(this,c,a)&&(this.D=e<<16,this.A=this.F=a,this.C=this.A^this.D>> -1)):(g=a&7,e=this.f[g],a=e&32768|e>>1,this.f[g]=a&65535,this.D=e<<16,this.A=this.F=a,this.C=this.A^this.D>>1);break;case 3264:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<1,0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=a^e)):(g=a&7,e=this.f[g],a=e<<1,this.f[g]=a&65535,this.D=this.A=this.F=a,this.C=a^e);break;case 3328:f=this.f[7]+((a&63)<<1)&65535;0<=(c=this.na(f|65536))&&(this.f[7]=this.f[5],this.f[5]=c,this.f[6]=f+2&65535);break;case 3392:a&56?0<=(f=gd(this,a,0))&&(61440!==(this.N&61440)&&(f&=65535), -this.G=this.N>>12&3,0<=(c=this.na(f))&&(this.G=this.N>>14&3,0<=dd(this,c)&&(this.A=this.F=c,this.C=0))):(g=a&7,c=6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]:this.va[this.N>>12&3],0<=dd(this,c)&&(this.A=this.F=c,this.C=0));break;case 3456:0<=(e=fd(this))&&((this.ea&57344||(this.Ga=22),a&56)?0<=(f=gd(this,a,0))&&(f&=65535,this.G=this.N>>12&3,0<=(c=ed(this,f,E))&&(this.G=this.N>>14&3,0<=M(this,c,e)&&(this.A=this.F=e,this.C=0))):(g=a&7,6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]=e:this.va[this.N>> -12&3]=e,this.A=this.F=e,this.C=0));break;case 3520:0<=(c=this.L(a,E))&&(a=-(this.A>>15&1),0<=M(this,c,a)&&(this.F=a,this.C=0));break;case 35328:break;case 35392:0<=(e=P(this,c=this.L(a,G)))&&(a=~e,0<=Q(this,c,a)&&(this.A=this.F=a<<8,this.D=65536,this.C=0));break;case 35456:0<=(e=P(this,c=this.L(a,G)))&&(a=e+1,0<=Q(this,c,a)&&(this.A=this.F=a<<8,this.C=(a&(a^e))<<8));break;case 35520:0<=(e=P(this,c=this.L(a,G)))&&(a=e-1,0<=Q(this,c,a)&&(this.A=this.F=a<<8,this.C=((a^e)&e)<<8));break;case 35584:0<= -(e=P(this,c=this.L(a,G)))&&(a=-e,0<=Q(this,c,a)&&(this.D=this.A=this.F=a<<8,this.C=(a&e)<<8));break;case 35648:0<=(e=P(this,c=this.L(a,G)))&&(a=e+(this.D>>16&1),0<=Q(this,c,a)&&(this.A=this.F=this.D=a<<8,this.C=(a&(a^e))<<8));break;case 35712:0<=(e=P(this,c=this.L(a,G)))&&(a=e-(this.D>>16&1),0<=Q(this,c,a)&&(this.A=this.F=this.D=a<<8,this.C=((a^e)&e)<<8));break;case 35776:0<=(e=hd(this,a))&&(this.A=this.F=e<<8,this.D=this.C=0);break;case 35840:0<=(e=P(this,c=this.L(a,G)))&&(a=((this.D&65536)>>8|e)>> -1,0<=Q(this,c,a)&&(this.D=e<<16,this.A=this.F=a<<8,this.C=this.A^this.D>>1));break;case 35904:0<=(e=P(this,c=this.L(a,G)))&&(a=e<<1|this.D>>16&1,0<=Q(this,c,a)&&(this.D=this.A=this.F=a<<8,this.C=(a^e)<<8));break;case 35968:0<=(e=P(this,c=this.L(a,G)))&&(a=e&128|e>>1,0<=Q(this,c,a)&&(this.D=e<<16,this.A=this.F=a<<8,this.C=this.A^this.D>>1));break;case 36032:0<=(e=P(this,c=this.L(a,G)))&&(a=e<<1,0<=Q(this,c,a)&&(this.D=this.A=this.F=a<<8,this.C=(a^e)<<8));break;case 36160:a&56?0<=(f=gd(this,a,0))&& -(this.G=this.N>>12&3,0<=(c=this.na(f|65536))&&(this.G=this.N>>14&3,0<=dd(this,c)&&(this.A=this.F=c,this.C=0))):(g=a&7,c=6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]:this.va[this.N>>12&3],0<=dd(this,c)&&(this.A=this.F=c,this.C=0));break;case 36224:0<=(e=fd(this))&&((this.ea&57344||(this.Ga=22),a&56)?0<=(f=gd(this,a,0))&&(this.G=this.N>>12&3,0<=(c=ed(this,f|65536,E))&&(this.G=this.N>>14&3,0<=M(this,c,e)&&(this.A=this.F=e,this.C=0))):(g=a&7,6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]= -e:this.va[this.N>>12&3]=e,this.A=this.F=e,this.C=0));break;default:switch(a&65528){case 128:0<=(c=fd(this))&&(g=a&7,this.f[7]=this.f[g],this.f[g]=c);break;case 152:this.N&49152||(this.N=this.N&63519|(a&7)<<5,this.Ra=1);break;case 160:case 168:break;case 176:case 184:break;default:switch(a){case 0:49152&this.N?(this.M|=128,L(this,4,46)):(this.qa=3,Wc(this),console.log("HALT at "+this.f[7].toString(8)));break;case 1:c=0;if(0<(a=this.u.length))for(;0e&&(e=this.u[a].Yc,c=a)}e>(this.N&224)&&(0>c?L(this,160,42):(L(this,this.u[c].ld,44),this.u.splice(c,1)))}this.ea&57344||(this.Ga=0,this.Eb=this.f[7]);this.V=this.N&16;this.g=a=this.na(this.f[7]);0<=a&&(this.f[7]=this.f[7]+2&65535);this.decode(a);if(0>this.g)switch(a&61440){case 4096:break;case 8192:break;case 12288:break;case 16384:break;case 20480:break;case 24576:break;case 36864:break;case 40960:break;case 45056:break;case 49152:break;case 53248:break; +case 57344:break;default:switch(a&65024){case 2048:0<=(f=gd(this,a,0))&&(g=a>>6&7,0<=dd(this,this.f[g])&&(this.f[g]=this.f[7],this.f[7]=f&65535));break;case 28672:0<=(c=S(this,a))&&(g=a>>6&7,c&32768&&(c|=-65536),e=this.f[g],e&32768&&(e|=-65536),a=~~(c*e),this.f[g]=a>>16&65535,this.f[g|1]=a&65535,this.B=a>>16,this.F=this.B|a,this.D=this.C=0,-32768>a||32767>6&7,e=this.f[g]<<16|this.f[g|1],this.D=this.C=0,c&32768&&(c|=-65536),a=~~(e/c),-32768<= +a&&32767>=a?(this.f[g]=a&65535,this.f[g|1]=e-a*c&65535,this.F=a>>16|a,this.B=a>>16):(this.C=32768,this.F=a>>15|a,this.B=e>>16,-1===c&&65534===this.f[g]&&(this.f[g]=this.f[g|1]=1))):(this.F=this.B=0,this.C=32768,this.D=65536));break;case 29696:0<=(c=S(this,a))&&(g=a>>6&7,a=this.f[g],a&32768&&(a|=4294901760),this.D=this.C=0,c&=63,c&32?(c=64-c,16>=c):c&&(16>15&65535)&&65535!==e&&(this.C=32768))),this.f[g]=a&65535,this.B=this.F=a);break; +case 30208:if(0<=(c=S(this,a))){g=a>>6&7;e=this.f[g]<<16|this.f[g|1];this.D=this.C=0;c&=63;if(c&32)c=64-c,32>c-1,this.D=a<<16,a>>=1,e&2147483648&&(a|=4294967295<<32-c);else if(c){if(a=e<>15,a<<=1,32>=32-c)e|=4294967295<>16&65535;this.f[g|1]=a&65535;this.B=a>>16;this.F=a>>16|a}break;case 30720:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(e^=this.f[a>>6&7],0<=M(this,c,e)&&(this.B=this.F=e,this.C=0)): +(this.B=this.F=e=this.f[a&7]^=this.f[a>>6&7],this.C=0);break;case 32256:g=a>>6&7;if(this.f[g]=this.f[g]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535;break;default:switch(a&65280){case 256:this.f[7]=T(this.f[7],a);break;case 512:this.F&65535&&(this.f[7]=T(this.f[7],a));break;case 768:this.F&65535||(this.f[7]=T(this.f[7],a));break;case 1024:(this.B&32768)===(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1280:(this.B&32768)!==(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1536:this.F& +65535&&(this.B&32768)===(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1792:this.F&65535&&(this.B&32768)===(this.C&32768)||(this.f[7]=T(this.f[7],a));break;case 32768:this.B&32768||(this.f[7]=T(this.f[7],a));break;case 33280:!(this.D&65536)&&this.F&65535&&(this.f[7]=T(this.f[7],a));break;case 33024:this.B&32768&&(this.f[7]=T(this.f[7],a));break;case 33536:if(this.D&65536||!(this.F&65535))this.f[7]=T(this.f[7],a);break;case 33792:this.C&32768||(this.f[7]=T(this.f[7],a));break;case 34048:this.C& +32768&&(this.f[7]=T(this.f[7],a));break;case 34304:this.D&65536||(this.f[7]=T(this.f[7],a));break;case 34560:this.D&65536&&(this.f[7]=T(this.f[7],a));break;case 34816:L(this,24,2);break;case 35072:L(this,28,4);break;default:switch(a&65472){case 64:0<=(f=gd(this,a,0))&&(this.f[7]=f&65535);break;case 192:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<8|e>>8,0<=M(this,c,a)&&(this.B=this.F=e&65280,this.C=this.D=0)):(g=a&7,e=this.f[g],this.f[g]=(e<<8|e>>8)&65535,this.B=this.F=e&65280,this.C=this.D=0);break; +case 2560:break;case 2624:0<=(e=this.ka(c=this.L(a,F)))&&(a=~e,0<=M(this,c,a)&&(this.B=this.F=a,this.D=65536,this.C=0));break;case 2688:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e+1,0<=M(this,c,a)&&(this.B=this.F=a,this.C=a&(a^e))):(g=a&7,e=this.f[g],a=e+1,this.f[g]=a&65535,this.B=this.F=a,this.C=a&(a^e));break;case 2752:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e-1,0<=M(this,c,a)&&(this.B=this.F=a,this.C=(a^e)&e)):(g=a&7,e=this.f[g],a=e-1,this.f[g]=a&65535,this.B=this.F=a,this.C=(a^e)&e);break;case 2816:0<= +(e=this.ka(c=this.L(a,F)))&&(a=-e,0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=a&e));break;case 2880:0<=(e=this.ka(c=this.L(a,F)))&&(a=e+(this.D>>16&1),0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=a&(a^e)));break;case 2944:0<=(e=this.ka(c=this.L(a,F)))&&(a=e-(this.D>>16&1),0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=(a^e)&e));break;case 3008:0<=(e=S(this,a))&&(this.B=this.F=e,this.D=this.C=0);break;case 3072:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=(this.D&65536|e)>>1,0<=M(this,c,a)&&(this.D= +e<<16,this.B=this.F=a,this.C=a^this.D>>1)):(g=a&7,e=this.f[g],a=(this.D&65536|e)>>1,this.f[g]=a&65535,this.D=e<<16,this.B=this.F=a,this.C=a^this.D>>1);break;case 3136:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<1|this.D>>16&1,0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=a^e)):(g=a&7,e=this.f[g],a=e<<1|this.D>>16&1,this.f[g]=a&65535,this.D=this.B=this.F=a,this.C=a^e);break;case 3200:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e&32768|e>>1,0<=M(this,c,a)&&(this.D=e<<16,this.B=this.F=a,this.C=this.B^this.D>> +1)):(g=a&7,e=this.f[g],a=e&32768|e>>1,this.f[g]=a&65535,this.D=e<<16,this.B=this.F=a,this.C=this.B^this.D>>1);break;case 3264:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<1,0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=a^e)):(g=a&7,e=this.f[g],a=e<<1,this.f[g]=a&65535,this.D=this.B=this.F=a,this.C=a^e);break;case 3328:f=this.f[7]+((a&63)<<1)&65535;0<=(c=this.na(f|65536))&&(this.f[7]=this.f[5],this.f[5]=c,this.f[6]=f+2&65535);break;case 3392:a&56?0<=(f=gd(this,a,0))&&(61440!==(this.N&61440)&&(f&=65535), +this.G=this.N>>12&3,0<=(c=this.na(f))&&(this.G=this.N>>14&3,0<=dd(this,c)&&(this.B=this.F=c,this.C=0))):(g=a&7,c=6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]:this.ua[this.N>>12&3],0<=dd(this,c)&&(this.B=this.F=c,this.C=0));break;case 3456:0<=(e=fd(this))&&((this.ea&57344||(this.Ga=22),a&56)?0<=(f=gd(this,a,0))&&(f&=65535,this.G=this.N>>12&3,0<=(c=ed(this,f,E))&&(this.G=this.N>>14&3,0<=M(this,c,e)&&(this.B=this.F=e,this.C=0))):(g=a&7,6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]=e:this.ua[this.N>> +12&3]=e,this.B=this.F=e,this.C=0));break;case 3520:0<=(c=this.L(a,E))&&(a=-(this.B>>15&1),0<=M(this,c,a)&&(this.F=a,this.C=0));break;case 35328:break;case 35392:0<=(e=P(this,c=this.L(a,G)))&&(a=~e,0<=Q(this,c,a)&&(this.B=this.F=a<<8,this.D=65536,this.C=0));break;case 35456:0<=(e=P(this,c=this.L(a,G)))&&(a=e+1,0<=Q(this,c,a)&&(this.B=this.F=a<<8,this.C=(a&(a^e))<<8));break;case 35520:0<=(e=P(this,c=this.L(a,G)))&&(a=e-1,0<=Q(this,c,a)&&(this.B=this.F=a<<8,this.C=((a^e)&e)<<8));break;case 35584:0<= +(e=P(this,c=this.L(a,G)))&&(a=-e,0<=Q(this,c,a)&&(this.D=this.B=this.F=a<<8,this.C=(a&e)<<8));break;case 35648:0<=(e=P(this,c=this.L(a,G)))&&(a=e+(this.D>>16&1),0<=Q(this,c,a)&&(this.B=this.F=this.D=a<<8,this.C=(a&(a^e))<<8));break;case 35712:0<=(e=P(this,c=this.L(a,G)))&&(a=e-(this.D>>16&1),0<=Q(this,c,a)&&(this.B=this.F=this.D=a<<8,this.C=((a^e)&e)<<8));break;case 35776:0<=(e=hd(this,a))&&(this.B=this.F=e<<8,this.D=this.C=0);break;case 35840:0<=(e=P(this,c=this.L(a,G)))&&(a=((this.D&65536)>>8|e)>> +1,0<=Q(this,c,a)&&(this.D=e<<16,this.B=this.F=a<<8,this.C=this.B^this.D>>1));break;case 35904:0<=(e=P(this,c=this.L(a,G)))&&(a=e<<1|this.D>>16&1,0<=Q(this,c,a)&&(this.D=this.B=this.F=a<<8,this.C=(a^e)<<8));break;case 35968:0<=(e=P(this,c=this.L(a,G)))&&(a=e&128|e>>1,0<=Q(this,c,a)&&(this.D=e<<16,this.B=this.F=a<<8,this.C=this.B^this.D>>1));break;case 36032:0<=(e=P(this,c=this.L(a,G)))&&(a=e<<1,0<=Q(this,c,a)&&(this.D=this.B=this.F=a<<8,this.C=(a^e)<<8));break;case 36160:a&56?0<=(f=gd(this,a,0))&& +(this.G=this.N>>12&3,0<=(c=this.na(f|65536))&&(this.G=this.N>>14&3,0<=dd(this,c)&&(this.B=this.F=c,this.C=0))):(g=a&7,c=6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]:this.ua[this.N>>12&3],0<=dd(this,c)&&(this.B=this.F=c,this.C=0));break;case 36224:0<=(e=fd(this))&&((this.ea&57344||(this.Ga=22),a&56)?0<=(f=gd(this,a,0))&&(this.G=this.N>>12&3,0<=(c=ed(this,f|65536,E))&&(this.G=this.N>>14&3,0<=M(this,c,e)&&(this.B=this.F=e,this.C=0))):(g=a&7,6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]= +e:this.ua[this.N>>12&3]=e,this.B=this.F=e,this.C=0));break;default:switch(a&65528){case 128:0<=(c=fd(this))&&(g=a&7,this.f[7]=this.f[g],this.f[g]=c);break;case 152:this.N&49152||(this.N=this.N&63519|(a&7)<<5,this.Ra=1);break;case 160:case 168:break;case 176:case 184:break;default:switch(a){case 0:49152&this.N?(this.M|=128,L(this,4,46)):(this.qa=3,Wc(this),console.log("HALT at "+this.f[7].toString(8)));break;case 1:c=0;if(0<(a=this.u.length))for(;0>12].call(this,a)} -var Cd=[function(a){Dd[a>>8&15].call(this,a)},function(a){bd(this,kd(this,a,S(this,a>>6)));--this.b},function(a){var b=S(this,a>>6);a=S(this,a);cd(this,b-a,a,b);--this.b},function(a){bd(this,S(this,a>>6)&S(this,a));--this.b},function(a){id(this,a,S(this,a>>6),pd);--this.b},function(a){id(this,a,S(this,a>>6),rd);--this.b},function(a){id(this,a,S(this,a>>6),od);--this.b},function(a){Ed[a>>8&15].call(this,a)},function(a){Fd[a>>8&15].call(this,a)},function(a){var b=hd(this,a>>6);bd(this,ld(this,a,b,2)<< +Oa(function(){for(var a=B(document,"pdp11","cpu"),b=0;b>12].call(this,a)} +var Cd=[function(a){Dd[a>>8&15].call(this,a)},function(a){bd(this,kd(this,a,S(this,a>>6)));--this.b},function(a){var b=S(this,a>>6);a=S(this,a);cd(this,b-a,a,b);--this.b},function(a){bd(this,S(this,a>>6)&S(this,a));--this.b},function(a){id(this,a,S(this,a>>6),pd);--this.b},function(a){id(this,a,S(this,a>>6),rd);--this.b},function(a){id(this,a,S(this,a>>6),od);--this.b},function(a){Ed[a>>8&15].call(this,a)},function(a){Fd[a>>8&15].call(this,a)},function(a){var b=hd(this,a>>6);bd(this,ld(this,a,b,1)<< 8);--this.b},function(a){var b=hd(this,a>>6)<<8;a=hd(this,a)<<8;cd(this,b-a,a,b);--this.b},function(a){bd(this,(hd(this,a>>6)&hd(this,a))<<8);--this.b},function(a){jd(this,a,hd(this,a>>6),qd);--this.b},function(a){jd(this,a,hd(this,a>>6),sd);--this.b},function(a){id(this,a,S(this,a>>6),td);--this.b},X],Dd=[function(a){Gd[a>>4&15].call(this,a)},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}, -function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},xd,xd,function(a){Hd[a>>6&3].call(this,a)},function(a){Id[a>>6&3].call(this,a)},function(a){Jd[a>>6&3].call(this,a)},function(a){Kd[a>>6&3].call(this,a)},X,X],Gd=[function(a){Ld[a&15].call(this,a)},X,X,X,X,X,X,X,X,X,function(a){Md[a&15].call(this,a)},function(a){Nd[a&15].call(this,a)},X,X,X,X],Md=[zd,function(){this.D=0;--this.b},function(){this.C=0;--this.b},U,function(){this.F=1;--this.b},U,U,U,function(){this.A=0;--this.b},U,U,U,U,U, -U,U],Nd=[zd,function(){this.D=65536;--this.b},function(){this.C=32768;--this.b},V,function(){this.F=0;--this.b},V,V,V,function(){this.A=32768;--this.b},V,V,V,V,V,V,V],Ld=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.N&49152||($c(this),this.H.reset());--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},X,X,X,X,X,X,X,X],Ed=[yd,yd,wd,wd,ud,ud,vd,vd,Bd,Bd,X, +function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},xd,xd,function(a){Hd[a>>6&3].call(this,a)},function(a){Id[a>>6&3].call(this,a)},function(a){Jd[a>>6&3].call(this,a)},function(a){Kd[a>>6&3].call(this,a)},X,X],Gd=[function(a){Ld[a&15].call(this,a)},X,X,X,X,X,X,X,X,X,function(a){Md[a&15].call(this,a)},function(a){Nd[a&15].call(this,a)},X,X,X,X],Md=[zd,function(){this.D=0;--this.b},function(){this.C=0;--this.b},U,function(){this.F=1;--this.b},U,U,U,function(){this.B=0;--this.b},U,U,U,U,U, +U,U],Nd=[zd,function(){this.D=65536;--this.b},function(){this.C=32768;--this.b},V,function(){this.F=0;--this.b},V,V,V,function(){this.B=32768;--this.b},V,V,V,V,V,V,V],Ld=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.N&49152||($c(this),this.H.reset());--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},X,X,X,X,X,X,X,X],Ed=[yd,yd,wd,wd,ud,ud,vd,vd,Bd,Bd,X, X,X,X,Ad,Ad],Fd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(a){Od[a>>6&3].call(this,a)},function(a){Pd[a>>6&3].call(this,a)},function(a){Qd[a>>6&3].call(this,a)},function(a){Rd[a>>6&3].call(this,a)},X,X],Hd=[function(a){ad(this, kd(this,a,0));--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Id=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Jd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Kd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}], -Od=[function(a){ad(this,ld(this,a,0,1));--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Pd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Qd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Rd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g= --1;--this.b}];function Sd(a){u.call(this,"ROM",a,Sd);this.g=null;this.J=a.addr;this.B=a.size;this.O=a.writable;this.u=a.alias;this.G=a.file;this.R=da(this.G);if(this.G){a=this.G;var b=ia(this.R);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var d=this;wa(a,null,!0,function(a,b,f){re(d,a,b,f)})}}w(Sd);Sd.prototype.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;se(this)}; -Sd.prototype.Qa=function(){if(this.Na){if(this.I){var a=this.I,b=this.id,d=this.J,c=this.B,e=this.Na,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var n=f,k=[k>>>0,g],q=qa(n,k,a.vc);0>q&&n.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.O.push({nd:b,w:d,Uc:c,Na:e,sc:f})}delete this.Na}return!0};Sd.prototype.Pa=function(){return!0}; +Od=[function(a){ad(this,ld(this,a,0));--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Pd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Qd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Rd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g= +-1;--this.b}];function Sd(a){u.call(this,"ROM",a,Sd);this.g=null;this.J=a.addr;this.w=a.size;this.O=a.writable;this.u=a.alias;this.G=a.file;this.R=da(this.G);if(this.G){a=this.G;var b=ia(this.R);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var d=this;wa(a,null,!0,function(a,b,f){re(d,a,b,f)})}}w(Sd);Sd.prototype.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;se(this)}; +Sd.prototype.Qa=function(){if(this.Na){if(this.I){var a=this.I,b=this.id,d=this.J,c=this.w,e=this.Na,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var n=f,k=[k>>>0,g],q=qa(n,k,a.vc);0>q&&n.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.O.push({pd:b,A:d,Uc:c,Na:e,sc:f})}delete this.Na}return!0};Sd.prototype.Pa=function(){return!0}; function re(a,b,d,c){if(c)a.sa("Unable to load system ROM (error "+c+": "+b+")");else{Za(a.tc,b,d);var e;if("["==d.charAt(0)||"{"==d.charAt(0))try{var f,g,h=eval("("+d+")");if(f=h.bytes)a.g=f;else if(f=h.words)for(a.g=Array(2*f.length),g=e=0;e>8&255;else if(f=h.data)for(a.g=Array(4*f.length),g=e=0;e>8&255,a.g[g++]=f[e]>>16&255,a.g[g++]=f[e]>>24&255;else a.g=h;a.Na=h.symbols;if(!a.g.length){t("Empty ROM: "+ b);return}if(1==a.g.length){t(a.g[0]);return}}catch(k){a.sa("ROM data error: "+k.message);return}else for(b=d.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.g=Array(b.length),e=0;e>>c.Z].Cb(e&c.g,a.g[d]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.u?b.push(a.u):null!=a.u&&a.u.length&&(b=a.u);for(d=0;d>>e.Z;0>>=e.Z;0>>c.Z].Cb(e&c.g,a.g[d]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.u?b.push(a.u):null!=a.u&&a.u.length&&(b=a.u);for(d=0;d>>e.Z;0>>=e.Z;0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function xe(a,b,d,c){if(d)if(b){0>a.G&&a.u.length&&(a.G=0);if(0>a.G||b!=a.u[a.G])a.u.splice(0,0,b),a.G=0;a.G--}else a.ca?b="end":b=a.u[a.G+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");d=0;var e=null;c=c||";";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==c&&!e||!g)a.push(pa(b.substring(d,f))),d=f+1}}return a} +function xe(a,b,d,c){if(d)if(b){0>a.G&&a.u.length&&(a.G=0);if(0>a.G||b!=a.u[a.G])a.u.splice(0,0,b),a.G=0;a.G--}else a.ca?b="end":b=a.u[a.G+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");d=0;var e=null;c=c||";";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==c&&!e||!g)a.push(oa(b.substring(d,f))),d=f+1}}return a} function ye(a,b,d){for(d=d||-1;d--&&b.length;){var c=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(c){case "*":c=f*e;break;case "/":if(!e)return!1;c=f/e;break;case "%":if(!e)return!1;c=f%e;break;case "+":c=f+e;break;case "-":c=f-e;break;case "<<":c=f<>":c=f>>e;break;case ">>>":c=f>>>e;break;case "<":c=f":c=f>e?1:0;break;case ">=":c=f>=e?1:0;break;case "==":c=f==e?1:0;break;case "!=":c=f!=e?1:0;break;case "&":c=f&e;break; case "^":c=f^e;break;case "|":c=f|e;break;case "&&":c=f&&e?1:0;break;case "||":c=f||e?1:0;break;default:return!1}a.push(c|0)}return!0} -function ze(a,b,d){var c;if(b){b=Ae(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;c>>=8}c=r(d,0,!0)+" "+d+". "+ca(d,0,!0)+" "+("0b"+g)}a.i((null!=b?b+": ":"")+c);return e} function De(a,b){if(b)return Ce(a,b,a.ha[b]);var d=0;for(b in a.ha)Ce(a,b,a.ha[b]),d++;return 0>>c.H.Z;k=1}c.i("blockid physical blockaddr used size type");c.i("-------- --------- ---------- ------ ------ ----");for(var d=-1,m=0;k--;){var n=b[e];n.type==d?m++||c.i("..."):(d=n.type,m=Hb[d],n&&c.i(r(n.id,8)+" %"+r(e<>>c.H.Z;k=1}c.i("blockid physical blockaddr used size type");c.i("-------- --------- ---------- ------ ------ ----");for(var d=-1,m=0;k--;){var n=b[e];n.type==d?m++||c.i("..."):(d=n.type,m=Hb[d],n&&c.i(r(n.id,8)+" %"+r(e<>>d.Z].Tb(c&d.g,c),b&&Oe(a,b));return d};l.La=function(a,b){var d=65535,c=this.L(a,!1,2);-1!==c&&(d=Ib(this.H,c),b&&Oe(a,b));return d}; -l.fc=function(a,b,d){var c=this.L(a,!0,1);if(-1!==c){var e=this.H;e.S[(c&e.H)>>>e.Z].Cb(c&e.g,b&255,c);d&&Oe(a,d);N(this.b,!0)}};l.oc=function(a,b,d){var c=this.L(a,!0,2);if(-1!==c){var e=this.H,f=c&e.g,g=(c&e.H)>>>e.Z;f!=e.g?e.S[g].qc(f,b&65535,c):(e.S[g++].Cb(f,b&255,c),e.S[g&e.B].Cb(0,b>>8&255,c+1));d&&Oe(a,d);N(this.b,!0)}};function Z(a){return{w:a,Ka:!1}}function Pe(a){return[a.w,a.Ka]}function Qe(a){return{w:a[0],Ka:a[1]}} -function Ne(a,b,d){var c;d=(d?a.X:a.Db).w;if(void 0!==b){c=b=Ae(a,b);var e;if(c.match(/^[a-z_][a-z0-9_]*$/i))for(c=c.toUpperCase(),d=0;d>>d.Z].Tb(c&d.g,c),b&&Oe(a,b));return d};l.La=function(a,b){var d=65535,c=this.L(a,!1,2);-1!==c&&(d=Ib(this.H,c),b&&Oe(a,b));return d}; +l.fc=function(a,b,d){var c=this.L(a,!0,1);if(-1!==c){var e=this.H;e.S[(c&e.H)>>>e.Z].Cb(c&e.g,b&255,c);d&&Oe(a,d);N(this.b,!0)}};l.oc=function(a,b,d){var c=this.L(a,!0,2);if(-1!==c){var e=this.H,f=c&e.g,g=(c&e.H)>>>e.Z;f!=e.g?e.S[g].qc(f,b&65535,c):(e.S[g++].Cb(f,b&255,c),e.S[g&e.w].Cb(0,b>>8&255,c+1));d&&Oe(a,d);N(this.b,!0)}};function Z(a){return{A:a,Ka:!1}}function Pe(a){return[a.A,a.Ka]}function Qe(a){return{A:a[0],Ka:a[1]}} +function Ne(a,b,d){var c;d=(d?a.X:a.Db).A;if(void 0!==b){c=b=Ae(a,b);var e;if(c.match(/^[a-z_][a-z0-9_]*$/i))for(c=c.toUpperCase(),d=0;dc&&(c+=b.length);0>c&&(c=0);for(var e=b.length;c>>c.Z],!1)}a.Y=["br"];if(a.J)for(b=1;b>>c.Z],!0);a.J=["bw"];a.Ib=0} -l.hb=function(a,b,d){var c=!0;d||We(this,a,b,!1,!0);if(a!=this.g){var e=this.L(b);if(-1===e)this.i("invalid address: "+Y(this,b.w)),c=!1;else{var f=this.H;f.S[e>>>f.Z].hb(e&f.g,a==this.J)}}c&&(a.push(b),d?b.Ka=!0:(Xe(this,a,a.length-1,"set"),Ge(this)));return c};function We(a,b,d,c,e){var f=!1;d=a.L(d);for(var g=1;g>>c.Z],b==a.J));h.Ka||Ge(a);break}}return f} -function Ye(a,b){for(var d=1;d>>c.Z],!1)}a.Y=["br"];if(a.J)for(b=1;b>>c.Z],!0);a.J=["bw"];a.Ib=0} +l.hb=function(a,b,d){var c=!0;d||We(this,a,b,!1,!0);if(a!=this.g){var e=this.L(b);if(-1===e)this.i("invalid address: "+Y(this,b.A)),c=!1;else{var f=this.H;f.S[e>>>f.Z].hb(e&f.g,a==this.J)}}c&&(a.push(b),d?b.Ka=!0:(Xe(this,a,a.length-1,"set"),Ge(this)));return c};function We(a,b,d,c,e){var f=!1;d=a.L(d);for(var g=1;g>>c.Z],b==a.J));h.Ka||Ge(a);break}}return f} +function Ye(a,b){for(var d=1;d>23)&65535,x=Y(p,q);else if(8192==A)q=q.w-((f&63)<<1)&65535,x=Y(p,q);else if(12288==A)x=Y(p,f&7,2);else if(24576==A)x=Y(p,f&63);else if(A=f&z,z&4032&&(A>>=6,z>>=6),z&63)switch(z=A&7,A&56){case 0:x=af(z);break;case 8:x="@"+af(z);break;case 16:7>z?x="("+af(z)+ -")+":(A=p.La(q,2),x="#"+Y(p,A));break;case 24:7>z?x="@("+af(z)+")+":(A=p.La(q,2),x="@#"+Y(p,A));break;case 32:x="-("+af(z)+")";break;case 40:x="@-("+af(z)+")";break;case 48:A=p.La(q,2);x=Y(p,A)+"("+af(z)+")";7==z&&(x=[x,Y(p,A+q.w&65535)]);break;case 56:A=p.La(q,2),x="@"+Y(p,A)+"("+af(z)+")",7==z&&(x=[x,Y(p,A+q.w&65535)])}p=x;if(!p||!p.length){h="INVALID";break}"string"!=typeof p&&(d||(d=p[1]),p=p[0]);0a?"R"+a:6==a?"SP":"PC"} -function cf(a,b){var d="",c=a.b;8>b?(d=af(b),d+="="+Y(a,c.f[b])):13>b?d="A"+(b-8)+"="+Y(a,c.bb[b-8]):16<=b&&20>b?d="S"+(b-16)+"="+Y(a,c.va[b-16]):20==b&&(d="PS="+Y(a,Yb(c)));d&&(d+=" ");return d}function df(a){var b,d="";for(b=0;6>b;b++)d+=cf(a,b);d=d+"\n"+(cf(a,6)+cf(a,7)+cf(a,20));return d+=bf(a,"T")+bf(a,"N")+bf(a,"Z")+bf(a,"V")+bf(a,"C")}l.vc=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.Uc;if(e>=g&&e>23)&65535,x=Y(p,q);else if(8192==A)q=q.A-((f&63)<<1)&65535,x=Y(p,q);else if(12288==A)x=Y(p,f&7,2);else if(24576==A)x=Y(p,f&63);else if(A=f&z,z&4032&&(A>>=6,z>>=6),z&63)switch(z=A&7,A&56){case 0:x=af(z);break;case 8:x="@"+af(z);break;case 16:7>z?x="("+af(z)+ +")+":(A=p.La(q,2),x="#"+Y(p,A));break;case 24:7>z?x="@("+af(z)+")+":(A=p.La(q,2),x="@#"+Y(p,A));break;case 32:x="-("+af(z)+")";break;case 40:x="@-("+af(z)+")";break;case 48:A=p.La(q,2);x=Y(p,A)+"("+af(z)+")";7==z&&(x=[x,Y(p,A+q.A&65535)]);break;case 56:A=p.La(q,2),x="@"+Y(p,A)+"("+af(z)+")",7==z&&(x=[x,Y(p,A+q.A&65535)])}p=x;if(!p||!p.length){h="INVALID";break}"string"!=typeof p&&(d||(d=p[1]),p=p[0]);0a?"R"+a:6==a?"SP":"PC"} +function cf(a,b){var d="",c=a.b;8>b?(d=af(b),d+="="+Y(a,c.f[b])):13>b?d="A"+(b-8)+"="+Y(a,c.bb[b-8]):16<=b&&20>b?d="S"+(b-16)+"="+Y(a,c.ua[b-16]):20==b&&(d="PS="+Y(a,Yb(c)));d&&(d+=" ");return d}function df(a){var b,d="";for(b=0;6>b;b++)d+=cf(a,b);d=d+"\n"+(cf(a,6)+cf(a,7)+cf(a,20));return d+=bf(a,"T")+bf(a,"N")+bf(a,"Z")+bf(a,"V")+bf(a,"C")}l.vc=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.Uc;if(e>=g&&eh[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=$e(a,b,g,f);a.i(f);a.X=b;e-=b.w-k;d++}}} -function Ze(a,b,d){var c=!0;try{b.length&&"end"!=b?d||a.i(">> "+b):(a.ca&&(a.i("ended assemble at "+Y(a,a.ba.w)),a.X=a.ba,a.ca=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Ca=null;if(qb(a)&&0m||"z"fa.length&&(a.i("note: only "+fa.length+" available"),W=fa.length);aa-=W;0>aa&&(null==fa[fa.length-1].w?(W=aa+W,aa=0):aa+=fa.length);var Cc=[];"call"==Yd&&(eb=1E5,Cc=["CALL"]);for(void 0!==Xd&&a.i(W+" instructions earlier:");0=fa.length&& -(aa=0);a.Kb=W;$d++;eb--}}$d||(a.i("no "+Zd+"history available"),a.Kb=void 0)}else{var Kb=Ne(a,ea);if(Kb){var Lb=0;ta&&("l"==ta.charAt(0)&&(ta=ta.substr(1)||Df),Lb=Be(a,ta)>>>0,65536>4||1;Ff--&&0Pb?String.fromCharCode(Pb):".";Nb--}gb&& -(gb+="\n");gb+=ea+" "+Ec+(hb?"":" "+ce)}gb&&a.i(gb);a.Db=Kb}}}}break;case "e":if("else"==f[0])break;var Qb=1,de=255,ee=a.Nb,fe=a.fc;"ew"==f[0]&&(Qb=2,de=65535,ee=a.La,fe=a.oc);var ge=Qb<<1,he=f[1];if(null==he)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 Rb=Ne(a,he);if(Rb)for(var Sb=2;SbIc;){for(var ua=null,Jf=256;65536>kb.w>>>0;){je.w=a.La(kb,2);if(null==kb.w||!Jf--)break;for(var Kf=a,Tb=je,ke=null,lb=Tb.w,le=lb,Jc=1;6>=Jc&&lb;Jc++){if(2h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=$e(a,b,g,f);a.i(f);a.X=b;e-=b.A-k;d++}}} +function Ze(a,b,d){var c=!0;try{b.length&&"end"!=b?d||a.i(">> "+b):(a.ca&&(a.i("ended assemble at "+Y(a,a.ba.A)),a.X=a.ba,a.ca=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Ca=null;if(qb(a)&&0m||"z"fa.length&&(a.i("note: only "+fa.length+" available"),W=fa.length);aa-=W;0>aa&&(null==fa[fa.length-1].A?(W=aa+W,aa=0):aa+=fa.length);var Dc=[];"call"==Yd&&(eb=1E5,Dc=["CALL"]);for(void 0!==Xd&&a.i(W+" instructions earlier:");0=fa.length&& +(aa=0);a.Kb=W;$d++;eb--}}$d||(a.i("no "+Zd+"history available"),a.Kb=void 0)}else{var Kb=Ne(a,ea);if(Kb){var Lb=0;ua&&("l"==ua.charAt(0)&&(ua=ua.substr(1)||Df),Lb=Be(a,ua)>>>0,65536>4||1;Ff--&&0Pb?String.fromCharCode(Pb):".";Nb--}gb&& +(gb+="\n");gb+=ea+" "+Fc+(hb?"":" "+ce)}gb&&a.i(gb);a.Db=Kb}}}}break;case "e":if("else"==f[0])break;var Qb=1,de=255,ee=a.Nb,fe=a.fc;"ew"==f[0]&&(Qb=2,de=65535,ee=a.La,fe=a.oc);var ge=Qb<<1,he=f[1];if(null==he)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 Rb=Ne(a,he);if(Rb)for(var Sb=2;SbJc;){for(var va=null,Jf=256;65536>kb.A>>>0;){je.A=a.La(kb,2);if(null==kb.A||!Jf--)break;for(var Kf=a,Tb=je,ke=null,lb=Tb.A,le=lb,Kc=1;6>=Kc&&lb;Kc++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bof){if(qf(c,this.W)){this.J=new O(this,"1.30.0","failsafe");qf(this.J)&&(vf(this,c),a=2,wf(this.J));this.J.set("timestamp",va());xf(this.J);var e=this.g&&!this.O;if(1==a||xa("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(d=uf(c)){var f=c.get("code"),g=c.get("data");f&&("ok"==f?qf(c,g):("error"== -f&&"no machine state"!=g?(this.sa("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.B=null)):this.i(f+": "+g),wf(c),qf(c)?(d=uf(c),e=!0):d=!1))}e&&tf(this,d?c:null)}else 2==a&&c.clear()}else tf(this);delete this.W;delete this.X}e=$a(this.id);for(f=0;fof){if(qf(c,this.W)){this.J=new O(this,"1.30.0","failsafe");qf(this.J)&&(vf(this,c),a=2,wf(this.J));this.J.set("timestamp",sa());xf(this.J);var e=this.g&&!this.O;if(1==a||xa("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(d=uf(c)){var f=c.get("code"),g=c.get("data");f&&("ok"==f?qf(c,g):("error"== +f&&"no machine state"!=g?(this.sa("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.w=null)):this.i(f+": "+g),wf(c),qf(c)?(d=uf(c),e=!0):d=!1))}e&&tf(this,d?c:null)}else 2==a&&c.clear()}else tf(this);delete this.W;delete this.X}e=$a(this.id);for(f=0;fa[1];a=a[2];this.ia=!0;this.j.ga=!0;var c=this.P.power;c&&(c.textContent="Shutdown");this.b&&(yf(this,this.b,b,d,a),this.b.Hb());this.ba&&(vf(this,b),b.clear());!d&&this.J&&(this.J.clear(),delete this.J);this.u=0}; -function vf(a,b){if(xa("There may be a problem with your PDP11js machine.\n\nTo help us diagnose it, click OK to send this PDP11js machine state to http://www.pcjs.org.")){var d=a.B||"";b=b.toString();var c={app:"PDP11js",ver:"1.30.0"};c.url=a.url;c.user=d;c.type="bug";c.data=b;wa("http://www.pcjs.org/api/v1/report",c,!0)}} -function lf(a,b,d){var c,e="none";if(a.u)return null;a.u--;var f=new O(a,"1.30.0"),g=new O(a,"1.30.0","validate"),h=va();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Pa&&(d&&a.b.pa(),c=a.b.Pa(b,d),"object"===typeof c&&f.set(a.b.id,c),d&&(a.b.j.ga=!1,!1===c&&(e=null)));for(var h=$a(a.id),k=0;k>1)+2;10>this.f&&(this.f=10);15>2;this.h=this.g-1;this.l=this.o/this.g|0;this.H=this.l-1;this.ta=[];this.A=null;this.cb=this.O;a=new H;Na(a,this.K);this.c=Array(this.l);for(b=0;b>8:d[2](b)&255}else if(b&1&&(d=c.ta[a&-2],d[2]))return d[2](b&-2)>>8;return c.cb(b,-1,1)} -function Pa(a,b,c){var d=this.controller,f=d.ta[a];if(f){if(f[1]){f[1](b,c);return}if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);return}}else if(c&1&&(f=d.ta[a&-2],f[3])){c&=-2;a=f[2]?f[2](c):0;f[3](a&255|b<<8,c);return}d.cb(c,b,1)}function Qa(a,b){var c=this.controller;if(a=c.ta[a]){if(a[2])return a[2](b);if(a[0])return a[0](b)|a[0](b+1)<<8}return c.cb(b,-1,0)} -function Ra(a,b,c){var d=this.controller;if(a=d.ta[a]){if(a[3]){a[3](b,c);return}if(a[1]){a[1](b&255,c);a[1](b>>8,c+1);return}}d.cb(c,b,0)}Ma.prototype.reset=function(){this.A&&this.A()};Ma.prototype.O=function(){return 0};Ma.prototype.za=function(a,b){b||this.reset();return!0}; -function Sa(a,b,c,d,f){for(var e=b,g=c,h=e>>>a.f;0g&&(q=g);if(k&&k.size){if(k.type==d&&k.controller==f){if(e+g<=k.Sa)return k.wb+=k.Sa-e,k.Sa=e,!0;if(e>=k.Sa+k.wb){q=k.size-(e-m);q>g&&(q=g);k.wb=e-k.Sa+q;e=m+a.g;g-=q;h++;continue}}return Ua(1,e,g)}e=new H(e,q,a.g,d,f);Na(e,a.K,k);a.c[h++]=e;e=m+a.g;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Va[d]+" at "+n(b,8,!0)),!0):Ua(2,b,c)} -function Wa(a){for(var b=0,c=[],d=0;d>1)+2;10>this.f&&(this.f=10);15>2;this.h=this.g-1;this.l=this.o/this.g|0;this.H=this.l-1;this.ta=[];this.A=null;this.cb=this.O;a=new G;Oa(a,this.K);this.c=Array(this.l);for(b=0;b>8:d[2](b)&255}else if(b&1&&(d=c.ta[a&-2],d[2]))return d[2](b&-2)>>8;return c.cb(b,-1,1)} +function Qa(a,b,c){var d=this.controller,f=d.ta[a];if(f){if(f[1]){f[1](b,c);return}if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);return}}else if(c&1&&(f=d.ta[a&-2],f[3])){c&=-2;a=f[2]?f[2](c):0;f[3](a&255|b<<8,c);return}d.cb(c,b,1)}function Ra(a,b){var c=this.controller;if(a=c.ta[a]){if(a[2])return a[2](b);if(a[0])return a[0](b)|a[0](b+1)<<8}return c.cb(b,-1,0)} +function Sa(a,b,c){var d=this.controller;if(a=d.ta[a]){if(a[3]){a[3](b,c);return}if(a[1]){a[1](b&255,c);a[1](b>>8,c+1);return}}d.cb(c,b,0)}Na.prototype.reset=function(){this.A&&this.A()};Na.prototype.O=function(){return 0};Na.prototype.za=function(a,b){b||this.reset();return!0}; +function Ta(a,b,c,d,f){for(var e=b,g=c,h=e>>>a.f;0g&&(q=g);if(k&&k.size){if(k.type==d&&k.controller==f){if(e+g<=k.Sa)return k.wb+=k.Sa-e,k.Sa=e,!0;if(e>=k.Sa+k.wb){q=k.size-(e-m);q>g&&(q=g);k.wb=e-k.Sa+q;e=m+a.g;g-=q;h++;continue}}return Va(1,e,g)}e=new G(e,q,a.g,d,f);Oa(e,a.K,k);a.c[h++]=e;e=m+a.g;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Wa[d]+" at "+n(b,8,!0)),!0):Va(2,b,c)} +function Xa(a){for(var b=0,c=[],d=0;d>13&7;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.qc,drive:e,blocksize:256,mapped:0,maxblock:b.Ja[e]*b.G[e],url:"rk"+e+".dsk"});b.w&=-129;switch(b.w>>1&7){case 0:b.ib=2496;b.S=0;b.w=128;b.X=0;break;case 1:if((b.X>>4&511)>=b.Ja[e]){b.S|=32832;b.w|=49152;break}if((b.X&15)>=b.G[e]){b.S|=32800;b.w|=49152;break}c=(b.X>>4&511)*b.G[e]+(b.X&15);d=(b.w&48)<<12|b.hb;f=65536-b.jb&65535;cb(a,b.T[e],c,d,f);return;case 2:if((b.X>>4&511)>=b.Ja[e])b.S|=32832, -b.w|=49152;else if((b.X&15)>=b.G[e])b.S|=32800,b.w|=49152;else{c=(b.X>>4&511)*b.G[e]+(b.X&15);d=(b.w&48)<<12|b.hb;f=65536-b.jb&65535;a.tb(b.T[e],c,d,f);return}}b.ib=e<<13|b.ib&8176|b.X%9&15;I(a.a,20,160,144,function(){b.w=b.w&65534|128;return!!(b.w&64)})}l.qc=function(a,b,c,d,f){var e=this.g;e.hb=d&65535;e.w=e.w&-49|d>>12&48;e.jb=65536-f&65535;switch(a){case 1:e.S|=33024;e.w|=49152;break;case 2:e.S|=33792,e.w|=49152}I(this.a,20,160,144,function(){e.w=e.w&65534|128;return!!(e.w&64)})}; -function db(a){var b=a.h,c,d,f,e=b.m>>8&3;b.m&=-2;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.rc,drive:e,blocksize:128,mapped:1,maxblock:b.Ja[e]*b.G[e],url:"rl"+e+".dsk"});switch(b.m>>1&7){case 2:b.xa&8&&(b.m&=63);b.xa=b.cc[e]|b.Ba&64;break;case 3:1==(b.J&3)&&(b.Ba=b.J&4?b.Ba+(b.J&65408)&65408|b.J<<2&64:b.Ba-(b.J&65408)&65408|b.J<<2&64,b.J=b.Ba);break;case 4:b.xa=b.Ba;break;case 5:if(b.J>>6>=b.Ja[e]){b.m|=37888;break}if((b.J&63)>=b.G[e]){b.m|=37888;break}c=(b.J>>6)*b.G[e]+(b.J&63); -d=(b.ua&63)<<16|b.ab;f=65536-b.xa&65535;cb(a,b.T[e],c,d,f);return;case 6:if(b.J>>6>=b.Ja[e])b.m|=37888;else if((b.J&63)>=b.G[e])b.m|=37888;else{c=(b.J>>6)*b.G[e]+(b.J&63);d=(b.ua&63)<<16|b.ab;f=65536-b.xa&65535;a.tb(b.T[e],c,d,f);return}}I(a.a,20,160,112,function(){b.m|=129;return!!(b.m&64)})} -l.rc=function(a,b,c,d,f){var e=this.h;e.ab=d&65535;e.m=e.m&-49|d>>12&48;e.ua=d>>16&63;e.J=~~(c/e.G[b.ka])<<6|c%e.G[b.ka];e.Ba=e.J;e.xa=65536-f&65535;switch(a){case 1:e.m|=33792;break;case 2:e.m|=40960}I(this.a,20,160,112,function(){e.m|=129;return!!(e.m&64)})};function eb(a){a=a.i;a.D=2176;a.da=0;a.U=[4544,4544,4544,4544,4544,4544,4544,4544];a.Wa=[0,0,0,0,0,0,0,0];a.Oa=a.Xa=a.Va=a.Aa=a.Hb=0} -function fb(a,b){var c=a.i,d,f,e;c.D&=-16513;c.da&=-2049;c.U[b]&=-1153;I(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.sc,drive:b,blocksize:256,mapped:0,maxblock:c.xb[0]*c.Ia[0]*c.G[0],url:"rp"+b+".dsk"});switch(c.D&63){case 5:c.vb[b]=c.na[b];c.D|=32896;c.U[b]|=32896;c.Oa|=1<=c.xb[0]||c.ea[b]>>8>=c.Ia[0]||(c.ea[b]&255)>=c.G[0]){c.Wa[b]|=1024;c.D|=49152;break}d=(c.na[b]*c.Ia[0]+(c.ea[b]>>8))*c.G[0]+ -(c.ea[b]&255);f=(c.Aa&63)<<16|c.Va;e=65536-c.Xa&65535;cb(a,c.T[b],d,f,e);return;case 57:if(c.na[b]>=c.xb[0]||c.ea[b]>>8>=c.Ia[0]||(c.ea[b]&255)>=c.G[0])c.Wa[b]|=1024,c.D|=49152;else{d=(c.na[b]*c.Ia[0]+(c.ea[b]>>8))*c.G[0]+(c.ea[b]&255);f=(c.Aa&63)<<16|c.Va;e=65536-c.Xa&65535;a.tb(c.T[b],d,f,e);return}}I(a.a,3,160,172,function(){c.D=c.D&65534|128;c.U[b]|=128;return!!(c.D&64)})} -l.sc=function(a,b,c,d,f){var e=this.i;e.Xa=65536-f&65535;e.Va=d&65535;e.D=e.D&-769|d>>8&768;e.Aa=d>>16&63;f=~~(c/e.G[0]);d=~~(f/e.Ia[0]);e.ea[b.ka]=f%e.Ia[0]<<8|c%e.G[0];e.vb[b.ka]=e.na[b.ka]=d;e.Oa|=1<=b.mc-1&&(e.U[b.ka]|=1024);switch(a){case 1:e.da|=512;e.D|=49152;break;case 2:e.da|=2048,e.D|=49152}I(this.a,20,160,172,function(){e.U[b.ka]|=128;e.D=e.D&65534|128;return!!(e.D&64)})};l.kc=function(){this.f.m|=128;this.f.m&64&&I(this.a,0,192,64)}; +0,3024,3103,65514,34562,0,264,8197,33779,5003,2574,32337,260,0,258,5579,12,6080,448,6081,450,6084,452,116,2,6084,65400,17860,65024,21956,62976,38848,65401,3200,161,76,0,16944,10797];l=H.prototype; +l.La=function(a,b,c,d){this.A=b;this.a=c;this.K=d;a=Za;for(var f in a){var e=a[f];c=b;d=+f;for(var g=e[0]?e[0].bind(this):null,h=e[1]?e[1].bind(this):null,k=e[2]?e[2].bind(this):null,e=e[3]?e[3].bind(this):null,m=+f;m<=d;m+=2){var q=m&8191;void 0!==c.ta[q]?r("I/O address already registered: "+n(m,8,!0)):c.ta[q]=[g,h,k,e,!1]}}f=this.bc.bind(this);b.A=this.reset.bind(this);b.cb=f;C(this)};l.oc=function(){return $a(this.a)};l.Cc=function(a){ab(this.a,a&-1809|$a(this.a)&1808);this.a.F|=128};l.qc=function(){return this.c.X}; +l.Ec=function(a){var b=this;128==(this.c.X&192)&&a&64&&I(this.a,8,4,52,function(){b.c.X|=128;return!!(b.c.X&64)});this.c.X=this.c.X&128|a&-129}; +function bb(a){var b=a.h,c,d,f,e=b.W>>13&7;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.rc,drive:e,blocksize:256,mapped:0,maxblock:b.Ja[e]*b.G[e],url:"rk"+e+".dsk"});b.w&=-129;switch(b.w>>1&7){case 0:b.ib=2496;b.S=0;b.w=128;b.W=0;break;case 1:if((b.W>>4&511)>=b.Ja[e]){b.S|=32832;b.w|=49152;break}if((b.W&15)>=b.G[e]){b.S|=32800;b.w|=49152;break}c=(b.W>>4&511)*b.G[e]+(b.W&15);d=(b.w&48)<<12|b.hb;f=65536-b.jb&65535;cb(a,b.T[e],c,d,f);return;case 2:if((b.W>>4&511)>=b.Ja[e])b.S|=32832, +b.w|=49152;else if((b.W&15)>=b.G[e])b.S|=32800,b.w|=49152;else{c=(b.W>>4&511)*b.G[e]+(b.W&15);d=(b.w&48)<<12|b.hb;f=65536-b.jb&65535;a.tb(b.T[e],c,d,f);return}}b.ib=e<<13|b.ib&8176|b.W%9&15;I(a.a,20,5,144,function(){b.w=b.w&65534|128;return!!(b.w&64)})}l.rc=function(a,b,c,d,f){var e=this.h;e.hb=d&65535;e.w=e.w&-49|d>>12&48;e.jb=65536-f&65535;switch(a){case 1:e.S|=33024;e.w|=49152;break;case 2:e.S|=33792,e.w|=49152}I(this.a,20,5,144,function(){e.w=e.w&65534|128;return!!(e.w&64)})}; +function db(a){var b=a.i,c,d,f,e=b.m>>8&3;b.m&=-2;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.sc,drive:e,blocksize:128,mapped:1,maxblock:b.Ja[e]*b.G[e],url:"rl"+e+".dsk"});switch(b.m>>1&7){case 2:b.xa&8&&(b.m&=63);b.xa=b.cc[e]|b.Ba&64;break;case 3:1==(b.J&3)&&(b.Ba=b.J&4?b.Ba+(b.J&65408)&65408|b.J<<2&64:b.Ba-(b.J&65408)&65408|b.J<<2&64,b.J=b.Ba);break;case 4:b.xa=b.Ba;break;case 5:if(b.J>>6>=b.Ja[e]){b.m|=37888;break}if((b.J&63)>=b.G[e]){b.m|=37888;break}c=(b.J>>6)*b.G[e]+(b.J&63); +d=(b.ua&63)<<16|b.ab;f=65536-b.xa&65535;cb(a,b.T[e],c,d,f);return;case 6:if(b.J>>6>=b.Ja[e])b.m|=37888;else if((b.J&63)>=b.G[e])b.m|=37888;else{c=(b.J>>6)*b.G[e]+(b.J&63);d=(b.ua&63)<<16|b.ab;f=65536-b.xa&65535;a.tb(b.T[e],c,d,f);return}}I(a.a,20,5,112,function(){b.m|=129;return!!(b.m&64)})} +l.sc=function(a,b,c,d,f){var e=this.i;e.ab=d&65535;e.m=e.m&-49|d>>12&48;e.ua=d>>16&63;e.J=~~(c/e.G[b.ka])<<6|c%e.G[b.ka];e.Ba=e.J;e.xa=65536-f&65535;switch(a){case 1:e.m|=33792;break;case 2:e.m|=40960}I(this.a,20,5,112,function(){e.m|=129;return!!(e.m&64)})};function eb(a){a=a.l;a.D=2176;a.da=0;a.U=[4544,4544,4544,4544,4544,4544,4544,4544];a.Wa=[0,0,0,0,0,0,0,0];a.Oa=a.Xa=a.Va=a.Aa=a.Hb=0} +function fb(a,b){var c=a.l,d,f,e;c.D&=-16513;c.da&=-2049;c.U[b]&=-1153;I(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.tc,drive:b,blocksize:256,mapped:0,maxblock:c.xb[0]*c.Ia[0]*c.G[0],url:"rp"+b+".dsk"});switch(c.D&63){case 5:c.vb[b]=c.na[b];c.D|=32896;c.U[b]|=32896;c.Oa|=1<=c.xb[0]||c.ea[b]>>8>=c.Ia[0]||(c.ea[b]&255)>=c.G[0]){c.Wa[b]|=1024;c.D|=49152;break}d=(c.na[b]*c.Ia[0]+(c.ea[b]>>8))*c.G[0]+ +(c.ea[b]&255);f=(c.Aa&63)<<16|c.Va;e=65536-c.Xa&65535;cb(a,c.T[b],d,f,e);return;case 57:if(c.na[b]>=c.xb[0]||c.ea[b]>>8>=c.Ia[0]||(c.ea[b]&255)>=c.G[0])c.Wa[b]|=1024,c.D|=49152;else{d=(c.na[b]*c.Ia[0]+(c.ea[b]>>8))*c.G[0]+(c.ea[b]&255);f=(c.Aa&63)<<16|c.Va;e=65536-c.Xa&65535;a.tb(c.T[b],d,f,e);return}}I(a.a,3,5,172,function(){c.D=c.D&65534|128;c.U[b]|=128;return!!(c.D&64)})} +l.tc=function(a,b,c,d,f){var e=this.l;e.Xa=65536-f&65535;e.Va=d&65535;e.D=e.D&-769|d>>8&768;e.Aa=d>>16&63;f=~~(c/e.G[0]);d=~~(f/e.Ia[0]);e.ea[b.ka]=f%e.Ia[0]<<8|c%e.G[0];e.vb[b.ka]=e.na[b.ka]=d;e.Oa|=1<=b.mc-1&&(e.U[b.ka]|=1024);switch(a){case 1:e.da|=512;e.D|=49152;break;case 2:e.da|=2048,e.D|=49152}I(this.a,20,5,172,function(){e.U[b.ka]|=128;e.D=e.D&65534|128;return!!(e.D&64)})};l.kc=function(){this.g.m|=128;this.g.m&64&&I(this.a,0,6,64)}; function gb(a,b,c,d,f,e){var g=~~((e+c.va-1)/c.va),h=new XMLHttpRequest;2048>g&&d+2048M(this.a,a.lc?hb(this.a,c):c,a.cache[b][f])){a.sb(2,a,b,c,d);return}c+=2;--d}b++}a.sb(0,a,b,c,d)}; -function cb(a,b,c,d,f){for(var e,g;0g){b.sb(2,b,c,d,f);return}b.cache[c][e]=g;d+=2;--f}c++}b.sb(0,b,c,d,f)}l.reset=function(){this.c.Ta=this.c.Ta&-120|20;this.l.ia=0;this.l.V=128;this.f.m=0;this.g.w=128;this.h.m=128;eb(this)}; +function cb(a,b,c,d,f){for(var e,g;0g){b.sb(2,b,c,d,f);return}b.cache[c][e]=g;d+=2;--f}c++}b.sb(0,b,c,d,f)}l.reset=function(){this.f.Ta=this.f.Ta&-120|20;this.c.ia=0;this.c.X=128;this.g.m=0;this.h.w=128;this.i.m=128;eb(this)}; l.bc=function(a,b,c){var d,f,e=this.a;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=e.ma&65280:(a&1&&(b<<=8),e.ma=b|255,d=0);break;case 4194298:if(0>b)d=e.ub;else{a&1&&(b<<=8);if(d=b&65024){f=d>>9;do d+=34;while(f>>=1)}e.ub=d;e.la=2}break;case 4194294:if(70!==e.Ka)return K(e,4,222);0>b?d=e.s:d=e.s=0;break;case 4194292:if(70!==e.Ka)return K(e,4,224);d=1;break;case 4194290:if(70!==e.Ka)return K(e,4,226);d=0;break;case 4194288:if(70!==e.Ka)return K(e,4,228);d=61183;break;case 4194296:0<= b&&!(a&1)&&(b&=255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==e.Ka)return K(e,4,232);f=a-4194272>>1;0>b?d=e.Eb[f]:(d=J(this,e.Eb[f],a,b,c),0<=d&&(e.Eb[f]=d));break;case 4194254:return a&1?e.u>>14&1?(0<=b&&(e.b[6]=b),d=e.b[6]):(0<=b&&(e.aa[3]=b),d=e.aa[3]):e.u>>14&0?(0<=b&&(e.b[6]=b),d=e.b[6]):(0<=b&&(e.aa[1]=b),d=e.aa[1]),d;case 4194252:case 4194250:case 4194248:return f=a&7,e.u&2048?(0<=b&&(e.b[f]=b),d=e.b[f]):(0<=b&&(e.Na[f]= -b),d=e.Na[f]),d;case 4194246:return a&1?(0<=b&&(e.b[7]=b),d=e.b[7]):e.u>>14&0?(0<=b&&(e.b[6]=b),d=e.b[6]):(0<=b&&(e.aa[0]=b),d=e.aa[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.u&2048?(0<=b&&(e.Na[f]=b),d=e.Na[f]):(0<=b&&(e.b[f]=b),d=e.b[f]),d;default:return e.s|=16,K(e,4,124)}break;case 4194176:f=a>>1&31;d=J(this,e.P[3][f],a,b,c);0<=d&&(e.P[3][f]=d,e.P[3][f&15]&=65295);break;case 4194112:var g=this.l;f=this.f;switch(a&-2){case 4194174:d=J(this,e.Ya,a,b,c);0<=d&&(e.Ya=d);break;case 4194172:d= -e.ga;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194170:e.I=e.I&62337|e.eb<<5|e.rb<<1;0>b?d=e.I:(d=J(this,e.I,a,b,c),0<=d&&(e.I=d&=62337,e.eb=d>>5&3,e.rb=d>>1&15,d&257?(f=2,e.sa&16&&(f=1),e.Ua=d&1?D|E:E):(e.Ua=0,f=4),this.c.Ta=this.c.Ta&-8|f));break;case 4194168:0>b?d=this.c.zc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;case 4194166:0<=b&&(b&127&&(g.ec=0),g.V&=-129,I(e,100,128,52,function(){g.V|=128;return!!(g.V&64)}));d=0;break;case 4194164:0>b?d=g.V:(d=J(this,g.V,a,b,c),0<=d&& -(128==(g.V&192)&&d&64&&I(e,8,128,52,function(){g.V|=128;return!!(g.V&64)}),g.V=g.V&128|d&-129));break;case 4194162:d=0;0>b&&(g.ia&=-129,0b?d=g.ia:(d=J(this,g.ia,a,b,c),0<=d&&(g.ia=g.ia&128|d&-129));break;case 4194150:0>b?(d=f.m,f.m&=-129):(d=J(this,f.m,a,b,c),0<=d&&(d&64&&!f.Fb&&(setInterval(this.kc.bind(this),25),f.Fb=1),f.m=d&-129));break;default:return e.s|=16,K(e,4, -126)}break;case 4194048:f=this.g;switch(a&-2){case 4194048:d=J(this,f.ib,a,b,c);0<=d&&(f.ib=d);break;case 4194050:d=J(this,f.S,a,b,c);0<=d&&(f.S=d);break;case 4194052:d=J(this,f.w,a,b,c);0<=b&&0<=d&&(f.w=d&-36993|f.w&36992,f.w&1&&bb(this));break;case 4194054:d=J(this,f.jb,a,b,c);0<=d&&(f.jb=d);break;case 4194056:d=J(this,f.hb,a,b,c);0<=d&&(f.hb=d);break;case 4194058:d=J(this,f.X,a,b,c);0<=d&&(f.X=d);break;case 4194060:break;case 4194062:d=J(this,f.Vb,a,b,c);0<=d&&(f.Vb=d);break;default:return e.s|= -16,K(e,4,128)}break;case 4193728:var h=this.i;f=h.da&7;switch(a&-2){case 4193728:d=J(this,h.D,a,b,c);0<=b&&0<=d&&(h.Aa=h.Aa&60|d>>8&3,h.D=d&17279|h.D&34944|2048,d&1&&h.D&128?fb(this,f):192==(d&192)&&I(e,0,160,172));break;case 4193730:d=J(this,h.Xa,a,b,c);0<=d&&(h.Xa=d);break;case 4193732:d=J(this,h.Va,a,b,c);0<=d&&(h.Va=d&65534);break;case 4193734:d=J(this,h.ea[f],a,b,c);0<=d&&(h.ea[f]=d&7967);break;case 4193736:d=J(this,h.da,a,b,c);0<=d&&(h.da=d&63|h.da&65472,d&128&&eb(this));break;case 4193738:d= -h.U[f];break;case 4193740:d=h.Wa[f];break;case 4193742:d=J(this,h.Oa,a,b,c);0<=d&&(h.Oa=d&255);break;case 4193744:d=h.xc[f];break;case 4193746:d=J(this,h.Wb,a,b,c);0<=d&&(h.Wb=d);break;case 4193748:d=J(this,h.Xb[f],a,b,c);0<=d&&(h.Xb[f]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=h.yc[f];break;case 4193754:d=J(this,h.Yb[f],a,b,c);0<=d&&(h.Yb[f]=d);break;case 4193756:d=J(this,h.na[f],a,b,c);0<=d&&(h.na[f]=d&511);break;case 4193758:h.vb[f]=h.na[f];d=h.vb[f];break;case 4193760:d=h.vc[f];break; -case 4193762:d=h.wc[f];break;case 4193764:d=h.tc[f];break;case 4193766:d=h.uc[f];break;case 4193768:d=J(this,h.Aa,a,b,c);0<=d&&(h.Aa=d&63,h.D=h.D&-769|(d&3)<<8);break;case 4193770:d=J(this,h.Hb,a,b,c);0<=d&&(h.Hb=d);break;default:return e.s|=16,K(e,4,132)}break;case 4192512:f=this.h;switch(a&-2){case 4192512:d=J(this,f.m,a,b,c);0<=b&&0<=d&&(f.ua=f.ua&60|d>>4&3,f.m=f.m&-1023|d&1022,f.m&128||db(this));break;case 4192514:d=J(this,f.ab,a,b,c);0<=d&&(f.ab=d&65534);break;case 4192516:d=J(this,f.J,a,b,c); -0<=d&&(f.J=d);break;case 4192518:d=J(this,f.xa,a,b,c);0<=d&&(f.xa=d);break;case 4192520:d=J(this,f.ua,a,b,c);0<=d&&(f.ua=d&63,f.m=f.m&-49|(f.ua&3)<<4);break;default:return e.s|=16,K(e,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.sa:(d=J(this,e.sa,a,b,c),0<=d&&(70!==e.Ka&&(d&=-49),e.sa=d,e.Ma[0]=d&4?15:7,e.Ma[1]=d&2?15:7,e.Ma[3]=d&1?15:7,e.Ua&&(f=2,e.sa&16&&(f=1),this.c.Ta=this.c.Ta&-8|f)));break;default:return e.s|=16,K(e,4,136)}break;case 4191424:f=a>>1&31;d=J(this,e.P[0][f],a,b,c); -0<=d&&(e.P[0][f]=d,e.P[0][f&15]&=65295);break;case 4191360:f=a>>1&31;d=J(this,e.P[1][f],a,b,c);0<=d&&(e.P[1][f]=d,e.P[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!==e.Ka)return K(e,4,234);f=a>>2&31;d=e.kb[f];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(e.kb[f]=a&2?d<<16|e.kb[f]&65535:e.kb[f]&4294901760|d&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)d=Ya[a>>1&255];else return e.s|=16,K(e,4,138);break; -default:return e.s|=16,K(e,4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var ib={},Za=(ib[65534]=[null,null,Xa.prototype.oc,Xa.prototype.Bc],ib);u(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.f,0,c>>2),pb(this,lb?qb:rb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},Z:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},qa:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},Ea:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.wa=!0},O:function(a,b){return this.W(a, +b),d=e.Na[f]),d;case 4194246:return a&1?(0<=b&&(e.b[7]=b),d=e.b[7]):e.u>>14&0?(0<=b&&(e.b[6]=b),d=e.b[6]):(0<=b&&(e.aa[0]=b),d=e.aa[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.u&2048?(0<=b&&(e.Na[f]=b),d=e.Na[f]):(0<=b&&(e.b[f]=b),d=e.b[f]),d;default:return e.s|=16,K(e,4,124)}break;case 4194176:f=a>>1&31;d=J(this,e.P[3][f],a,b,c);0<=d&&(e.P[3][f]=d,e.P[3][f&15]&=65295);break;case 4194112:var g=this.c;f=this.g;switch(a&-2){case 4194174:d=J(this,e.Ya,a,b,c);0<=d&&(e.Ya=d);break;case 4194172:d= +e.ga;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194170:e.I=e.I&62337|e.eb<<5|e.rb<<1;0>b?d=e.I:(d=J(this,e.I,a,b,c),0<=d&&(e.I=d&=62337,e.eb=d>>5&3,e.rb=d>>1&15,d&257?(f=2,e.sa&16&&(f=1),e.Ua=d&1?Ia|D:D):(e.Ua=0,f=4),this.f.Ta=this.f.Ta&-8|f));break;case 4194168:0>b?d=this.f.Ac&65535:(d=J(this,this.f.data,a,b,c),0<=d&&(this.f.data=d));break;case 4194166:0<=b&&(b&127&&(g.ec=0),g.X&=-129,I(e,100,4,52,function(){g.X|=128;return!!(g.X&64)}));d=0;break;case 4194164:break;case 4194162:d=0;0>b&&(g.ia&=-129, +0b?d=g.ia:(d=J(this,g.ia,a,b,c),0<=d&&(g.ia=g.ia&128|d&-129));break;case 4194150:0>b?(d=f.m,f.m&=-129):(d=J(this,f.m,a,b,c),0<=d&&(d&64&&!f.Fb&&(setInterval(this.kc.bind(this),25),f.Fb=1),f.m=d&-129));break;default:return e.s|=16,K(e,4,126)}break;case 4194048:f=this.h;switch(a&-2){case 4194048:d=J(this,f.ib,a,b,c);0<=d&&(f.ib=d);break;case 4194050:d=J(this,f.S,a,b,c);0<=d&& +(f.S=d);break;case 4194052:d=J(this,f.w,a,b,c);0<=b&&0<=d&&(f.w=d&-36993|f.w&36992,f.w&1&&bb(this));break;case 4194054:d=J(this,f.jb,a,b,c);0<=d&&(f.jb=d);break;case 4194056:d=J(this,f.hb,a,b,c);0<=d&&(f.hb=d);break;case 4194058:d=J(this,f.W,a,b,c);0<=d&&(f.W=d);break;case 4194060:break;case 4194062:d=J(this,f.Vb,a,b,c);0<=d&&(f.Vb=d);break;default:return e.s|=16,K(e,4,128)}break;case 4193728:var h=this.l;f=h.da&7;switch(a&-2){case 4193728:d=J(this,h.D,a,b,c);0<=b&&0<=d&&(h.Aa=h.Aa&60|d>>8&3,h.D= +d&17279|h.D&34944|2048,d&1&&h.D&128?fb(this,f):192==(d&192)&&I(e,0,5,172));break;case 4193730:d=J(this,h.Xa,a,b,c);0<=d&&(h.Xa=d);break;case 4193732:d=J(this,h.Va,a,b,c);0<=d&&(h.Va=d&65534);break;case 4193734:d=J(this,h.ea[f],a,b,c);0<=d&&(h.ea[f]=d&7967);break;case 4193736:d=J(this,h.da,a,b,c);0<=d&&(h.da=d&63|h.da&65472,d&128&&eb(this));break;case 4193738:d=h.U[f];break;case 4193740:d=h.Wa[f];break;case 4193742:d=J(this,h.Oa,a,b,c);0<=d&&(h.Oa=d&255);break;case 4193744:d=h.yc[f];break;case 4193746:d= +J(this,h.Wb,a,b,c);0<=d&&(h.Wb=d);break;case 4193748:d=J(this,h.Xb[f],a,b,c);0<=d&&(h.Xb[f]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=h.zc[f];break;case 4193754:d=J(this,h.Yb[f],a,b,c);0<=d&&(h.Yb[f]=d);break;case 4193756:d=J(this,h.na[f],a,b,c);0<=d&&(h.na[f]=d&511);break;case 4193758:h.vb[f]=h.na[f];d=h.vb[f];break;case 4193760:d=h.wc[f];break;case 4193762:d=h.xc[f];break;case 4193764:d=h.uc[f];break;case 4193766:d=h.vc[f];break;case 4193768:d=J(this,h.Aa,a,b,c);0<=d&&(h.Aa=d&63,h.D= +h.D&-769|(d&3)<<8);break;case 4193770:d=J(this,h.Hb,a,b,c);0<=d&&(h.Hb=d);break;default:return e.s|=16,K(e,4,132)}break;case 4192512:f=this.i;switch(a&-2){case 4192512:d=J(this,f.m,a,b,c);0<=b&&0<=d&&(f.ua=f.ua&60|d>>4&3,f.m=f.m&-1023|d&1022,f.m&128||db(this));break;case 4192514:d=J(this,f.ab,a,b,c);0<=d&&(f.ab=d&65534);break;case 4192516:d=J(this,f.J,a,b,c);0<=d&&(f.J=d);break;case 4192518:d=J(this,f.xa,a,b,c);0<=d&&(f.xa=d);break;case 4192520:d=J(this,f.ua,a,b,c);0<=d&&(f.ua=d&63,f.m=f.m&-49|(f.ua& +3)<<4);break;default:return e.s|=16,K(e,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.sa:(d=J(this,e.sa,a,b,c),0<=d&&(70!==e.Ka&&(d&=-49),e.sa=d,e.Ma[0]=d&4?15:7,e.Ma[1]=d&2?15:7,e.Ma[3]=d&1?15:7,e.Ua&&(f=2,e.sa&16&&(f=1),this.f.Ta=this.f.Ta&-8|f)));break;default:return e.s|=16,K(e,4,136)}break;case 4191424:f=a>>1&31;d=J(this,e.P[0][f],a,b,c);0<=d&&(e.P[0][f]=d,e.P[0][f&15]&=65295);break;case 4191360:f=a>>1&31;d=J(this,e.P[1][f],a,b,c);0<=d&&(e.P[1][f]=d,e.P[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!== +e.Ka)return K(e,4,234);f=a>>2&31;d=e.kb[f];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(e.kb[f]=a&2?d<<16|e.kb[f]&65535:e.kb[f]&4294901760|d&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)d=Ya[a>>1&255];else return e.s|=16,K(e,4,138);break;default:return e.s|=16,K(e,4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d}; +var ib={},Za=(ib[65534]=[null,null,H.prototype.oc,H.prototype.Cc],ib[65396]=[null,null,H.prototype.qc,H.prototype.Ec],ib);u(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.f,0,c>>2),pb(this,lb?qb:rb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},Z:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},qa:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},Ea:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.wa=!0},O:function(a,b){return this.V(a, b)},ca:function(a,b){return this.oa(a,b)},Ca:function(a,b,c){this.h||this.ac(a,b,c)},Ga:function(a,b,c){this.h||this.Ha(a,b,c)},H:function(a){return this.c[a]},Y:function(a){return this.c[a]},ba:function(a){return this.g.getUint16(a,!0)},pa:function(a){return a&1?this.c[a]|this.c[a+1]<<8:this.o[a>>1]},ra:function(a,b){this.c[a]=b;this.wa=!0},Da:function(a,b){this.c[a]=b;this.wa=!0},Fa:function(a,b){this.g.setUint16(a,b,!0);this.wa=!0},Qa:function(a,b){a&1?(this.c[a]=b,this.c[a+1]=b>>8):this.o[a>> -1]=b;this.wa=!0}};function Na(a,b,c){a.K=b;a.i=a.l=0;c&&((a.i=c.i)&&tb(a,ub,!1),(a.l=c.l)&&vb(a,ub,!1))}function vb(a,b,c){c&&a.l||(a.lb=!a.h&&b[1]||a.v,a.Cc=!a.h&&b[3]||a.B);if(c||void 0===c)a.ac=b[1]||a.v,a.Ha=b[3]||a.B}function tb(a,b,c){c&&a.i||(a.gb=b[0]||a.C,a.pc=b[2]||a.A);if(c||void 0===c)a.W=b[0]||a.C,a.oa=b[2]||a.A}function pb(a,b){b||(b=wb);tb(a,b,void 0);vb(a,b,void 0)} -var wb=[],sb=[H.prototype.Z,H.prototype.Ea,H.prototype.qa,H.prototype.Ra],ub=[H.prototype.O,H.prototype.Ca,H.prototype.ca,H.prototype.Ga];if(Ha)var rb=[H.prototype.H,H.prototype.ra,H.prototype.ba,H.prototype.Fa],qb=[H.prototype.Y,H.prototype.Da,H.prototype.pa,H.prototype.Qa]; +1]=b;this.wa=!0}};function Oa(a,b,c){a.K=b;a.i=a.l=0;c&&((a.i=c.i)&&tb(a,ub,!1),(a.l=c.l)&&vb(a,ub,!1))}function vb(a,b,c){c&&a.l||(a.lb=!a.h&&b[1]||a.v,a.Dc=!a.h&&b[3]||a.B);if(c||void 0===c)a.ac=b[1]||a.v,a.Ha=b[3]||a.B}function tb(a,b,c){c&&a.i||(a.gb=b[0]||a.C,a.pc=b[2]||a.A);if(c||void 0===c)a.V=b[0]||a.C,a.oa=b[2]||a.A}function pb(a,b){b||(b=wb);tb(a,b,void 0);vb(a,b,void 0)} +var wb=[],sb=[G.prototype.Z,G.prototype.Ea,G.prototype.qa,G.prototype.Ra],ub=[G.prototype.O,G.prototype.Ca,G.prototype.ca,G.prototype.Ga];if(Ha)var rb=[G.prototype.H,G.prototype.ra,G.prototype.ba,G.prototype.Fa],qb=[G.prototype.Y,G.prototype.Da,G.prototype.pa,G.prototype.Qa]; function xb(a,b){v.call(this,"CPU",a,xb);var c=a.multiplier||1;this.Ab=a.cycles||b;this.qa=c;this.zb=Math.round(this.Ab/1E4)/100;this.oa=this.zb*this.qa;this.j.ja=!1;this.j.Zb=!1;this.j.$a=a.autoStart;this.j.Pb=!1;this.j.pb=!1;this.mb=this.pa=0;this.nb=a.csStart;this.Da=a.csInterval;this.Ea=a.csStop;this.Qa=[];this.Sb=this.Ib.bind(this);C(this)}x(xb);var yb=["power","reset"];l=xb.prototype; l.La=function(a,b,c,d){this.B=a;this.A=b;this.K=d;for(b=0;b>=3;d=""+f}else d=n(c,d);else d="--------".substr(0,d||4);a.C[b].textContent!=d&&(a.C[b].textContent=d)}} l.fa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.C[b]=c;a=!0;break;case "run":this.C[b]=c;c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.j.M)a=!0;else{var b=null,c,h=y(a.id);for(c=0;ca.Y/a.oa&&(b=1),a.qa=b,b=a.zb*a.qa,a.oa!=b)){a.oa=b;b=a.oa.toFixed(2)+"Mhz";var c=a.C.setSpeed;c&&(c.textContent=b);a.$("target speed: "+b)}Gb(a,a.W);a.W=0;a.O=ha();a.Z=0;Hb(a)}function Jb(a){a.ba-=a.a;a.a=0} +break;case "speed":this.C[b]=c;a=!0;break;case "setSpeed":this.C[b]=c,c.onclick=function(){Fb(d,d.qa<<1)},c.textContent=this.oa.toFixed(2)+"Mhz",a=!0}return a};function Gb(a,b,c){a.ca+=b;c&&(a.ba=a.a=0)}function Hb(a,b){var c=1;b&&1a.Y/a.oa&&(b=1),a.qa=b,b=a.zb*a.qa,a.oa!=b)){a.oa=b;b=a.oa.toFixed(2)+"Mhz";var c=a.C.setSpeed;c&&(c.textContent=b);a.$("target speed: "+b)}Gb(a,a.V);a.V=0;a.O=ha();a.Z=0;Hb(a)}function Jb(a){a.ba-=a.a;a.a=0} l.Ib=function(){if(Fa(this,!0)){if(!this.j.ja){Fb(this);this.B&&this.B.start(this.O,Ib(this));this.j.ja=!0;this.j.Zb=!0;this.Ca&&this.Ca.start();var a=this.C.run;a&&(a.textContent="Halt");this.B&&this.B.Pa(!0)}this.Bb>=this.Ab&&Hb(this,!0);this.Ga=0;this.Ra=ha();this.Z&&(a=this.Ra-this.Z,a>this.Ob&&(this.O+=a,this.O>this.Ra&&(this.O=this.Ra)));try{do{for(var b,c=this.j.pb?1:this.ob,d=this.Qa.length-1;0<=d;d--){var f=this.Qa[d];0>f[0]||c>f[0]&&(c=f[0])}b=c;try{this.$b(b)}catch(m){if("number"!=typeof m)throw m; -}for(var e=this.ba-this.a,a=e,g=this.Qa.length-1;0<=g;g--){var h=this.Qa[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Ga+=e;this.W+=e;Gb(this,0,!0);a=e;if(this.j.pb){var k=!1;this.mb=this.mb+this.Ub()|0;this.pa-=a;0>=this.pa&&(this.pa+=this.Da,k=!0);0<=this.Ea&&this.Ea<=Ib(this)&&(this.Da=this.Ea=-1,Bb(this),Eb(this),k=!0);k&&this.$(Ib(this)+" cycles: checksum="+n(this.mb))}this.Fa-=e;if(0>=this.Fa){this.Fa+=this.ob;15<=++this.Rb&&(this.B&&this.B.Pa(),this.Rb=0);break}}while(this.j.ja)}catch(m){Eb(this); -Cb(this);this.B&&this.B.stop(ha(),Ib(this));Fa(this,!1);b=m.stack||m.message;this.j.error=!0;this.L(b);return}b=setTimeout;c=this.Sb;this.Z=ha();d=this.Ob;this.Ga&&(d=Math.round(d*this.Ga/this.ob));d-=this.Z-this.Ra;if(f=this.Z-this.O)this.Y=Math.round(this.W/(10*f))/100,864E5<=f&&(this.ca=0,Fb(this));if(0>d||this.Yd&&(this.O-=d),d=0;this.Bb+=this.Ga;this.Z+=d;b(c,d)}else Cb(this),this.B&&this.B.stop(ha(),Ib(this))};l.$b=function(){return 0}; -function Eb(a){a.j.bb&&(a.j.Cb=!0);Jb(a);Gb(a,a.W);a.W=0;if(a.j.ja){a.j.ja=!1;a.Ca&&a.Ca.stop();var b=a.C.run;b&&(b.textContent="Run")}a.j.complete=void 0}function Cb(a){a.B&&a.B.Pa(void 0)} +}for(var e=this.ba-this.a,a=e,g=this.Qa.length-1;0<=g;g--){var h=this.Qa[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Ga+=e;this.V+=e;Gb(this,0,!0);a=e;if(this.j.pb){var k=!1;this.mb=this.mb+this.Ub()|0;this.pa-=a;0>=this.pa&&(this.pa+=this.Da,k=!0);0<=this.Ea&&this.Ea<=Ib(this)&&(this.Da=this.Ea=-1,Bb(this),Eb(this),k=!0);k&&this.$(Ib(this)+" cycles: checksum="+n(this.mb))}this.Fa-=e;if(0>=this.Fa){this.Fa+=this.ob;15<=++this.Rb&&(this.B&&this.B.Pa(),this.Rb=0);break}}while(this.j.ja)}catch(m){Eb(this); +Cb(this);this.B&&this.B.stop(ha(),Ib(this));Fa(this,!1);b=m.stack||m.message;this.j.error=!0;this.L(b);return}b=setTimeout;c=this.Sb;this.Z=ha();d=this.Ob;this.Ga&&(d=Math.round(d*this.Ga/this.ob));d-=this.Z-this.Ra;if(f=this.Z-this.O)this.Y=Math.round(this.V/(10*f))/100,864E5<=f&&(this.ca=0,Fb(this));if(0>d||this.Yd&&(this.O-=d),d=0;this.Bb+=this.Ga;this.Z+=d;b(c,d)}else Cb(this),this.B&&this.B.stop(ha(),Ib(this))};l.$b=function(){return 0}; +function Eb(a){a.j.bb&&(a.j.Cb=!0);Jb(a);Gb(a,a.V);a.V=0;if(a.j.ja){a.j.ja=!1;a.Ca&&a.Ca.stop();var b=a.C.run;b&&(b.textContent="Run")}a.j.complete=void 0}function Cb(a){a.B&&a.B.Pa(void 0)} function Kb(a){this.jc=a.resetAddr||0;xb.call(this,a,1E6);this.Jb=0;this.decode=Lb.bind(this);this.g=65536;this.f=32768;this.h=65535;this.c=32768;this.b=[0,0,0,0,0,0,0,this.jc];this.Na=[0,0,0,0,0,0];this.aa=[0,0,0,0];this.ma=255;this.rb=this.eb=this.Ua=this.v=this.sa=this.Ya=this.ga=this.I=this.s=this.ub=0;this.Ma=[7,7,7,7];this.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535, 65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.kb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Eb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.i=-1;this.F=0;this.Ka=70;this.ra=-1;this.o=[];this.Ha=0;this.la=2;Mb(this);this.j.complete=this.j.dc=!1}x(Kb,xb);l=Kb.prototype; -l.reset=function(){this.j.ja&&Eb(this);Nb(this);Ab(this);this.j.error=!1;this.parent.reset.call(this)};function Nb(a){a.ma=255;a.s=0;a.o=[];a.ub=0;a.I=a.ga=a.Ya=a.sa=a.Ua=0;a.Ma[0]=a.Ma[1]=a.Ma[3]=7;a.eb=0;Mb(a)}function Mb(a){a.Ua?(a.H=65536,a.l=a.hc,a.Tb=a.R):(a.H=0,a.l=a.gc,a.Tb=a.N)}l.Ub=function(){return 0};l.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.Mb,this.ca,this.qa]);a.set(2,Wa(this.A));return a.data()}; +l.reset=function(){this.j.ja&&Eb(this);Nb(this);Ab(this);this.j.error=!1;this.parent.reset.call(this)};function Nb(a){a.ma=255;a.s=0;a.o=[];a.ub=0;a.I=a.ga=a.Ya=a.sa=a.Ua=0;a.Ma[0]=a.Ma[1]=a.Ma[3]=7;a.eb=0;Mb(a)}function Mb(a){a.Ua?(a.H=65536,a.l=a.hc,a.Tb=a.R):(a.H=0,a.l=a.gc,a.Tb=a.N)}l.Ub=function(){return 0};l.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.Mb,this.ca,this.qa]);a.set(2,Xa(this.A));return a.data()}; l.restore=function(a){var b=a[1];this.Mb=b[0];this.ca=b[1];Fb(this,b[3]);a:{b=this.A;a=a[2];var c;for(c=0;cb){a.o[e].ha-=b;break}b-=a.o[e].ha}a.o.splice(e+1,0,{delay:b,priority:c&224,vector:d,callback:f})}a.la=2}function $a(a){return a.u=a.u&63728|(a.c&32768?8:0)|(a.h&65535?0:4)|(a.f&32768?2:0)|(a.g&65536?1:0)} +function I(a,b,c,d,f){for(var e=a.o.length;0b){a.o[e].ha-=b;break}b-=a.o[e].ha}a.o.splice(e+1,0,{delay:b,priority:c<<5&224,vector:d,callback:f})}a.la=2}function $a(a){return a.u=a.u&63728|(a.c&32768?8:0)|(a.h&65535?0:4)|(a.f&32768?2:0)|(a.g&65536?1:0)} function ab(a,b){a.c=b<<12;a.h=~b&4;a.f=b<<14;a.g=b<<16;if((b^a.u)&2048)for(var c=a.Na.length;0<=--c;){var d=a.b[c];a.b[c]=a.Na[c];a.Na[c]=d}a.v=b>>14&3;c=a.u>>14&3;a.v!=c&&(a.aa[c]=a.b[6],a.b[6]=a.aa[a.v]);a.la=2;a.u=b}function Ob(a,b){a.F&128||(a.c=a.h=a.g=b,a.f=0)}function P(a,b){a.F&128||(a.c=a.h=b,a.f=0)}function Pb(a,b,c,d){a.F&128||(a.c=a.h=a.g=b,a.f=(c^d)&(d^b))} function K(a,b,c){var d,f,e=0;0>a.ra?a.ra=$a(a):a.v||(b=4,e=1);a.I&57344||(a.ga=63222,a.Ya=b);a.v=0;0<=(d=a.R(b|65536))&&0<=(f=a.R(b+2&65535|65536))&&(ab(a,f&53247|a.ra>>2&12288),e&&(a.s|=4,a.b[6]=4),0<=Q(a,a.ra)&&0<=Q(a,a.b[7])&&(a.b[7]=d));a.F&=-113;a.ra=-1;throw b|c<<8;}function hb(a,b){var c=b>>13&31;31>c?a.sa&32&&(b=a.kb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} -function Qb(a,b,c){var d,f,e,g=0;if(c&a.Ua){d=b>>13&a.Ma[a.v];f=a.P[a.v][d];e=(a.P[a.v][d+16]<<6)+(b&8191)&4194303;a.sa&16?3932160<=e&&4186112>e&&(e=hb(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.s|=32,K(a,4,24)),e&1&&!(c&1)&&(a.s|=64,K(a,4,26)));switch(f&7){case 1:g=4096;case 2:f|=128;c&E&&(g=8192);break;case 4:g=4096;case 5:c&E&&(g=4096);case 6:f|=c&E?192:128;break;default:g=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(g|=16384):(b&8128)>(f>>2&8128)&& +function Qb(a,b,c){var d,f,e,g=0;if(c&a.Ua){d=b>>13&a.Ma[a.v];f=a.P[a.v][d];e=(a.P[a.v][d+16]<<6)+(b&8191)&4194303;a.sa&16?3932160<=e&&4186112>e&&(e=hb(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.s|=32,K(a,4,24)),e&1&&!(c&1)&&(a.s|=64,K(a,4,26)));switch(f&7){case 1:g=4096;case 2:f|=128;c&D&&(g=8192);break;case 4:g=4096;case 5:c&D&&(g=4096);case 6:f|=c&D?192:128;break;default:g=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(g|=16384):(b&8128)>(f>>2&8128)&& (g|=16384));a.P[a.v][d]=f;if(4194170!==e||a.v)a.eb=a.v,a.rb=d;g&&(g&57344&&(0<=a.ra&&(g|=128),a.I&57344||(a.I=a.I|g|a.eb<<5|a.rb<<1),K(a,168,28)),a.I&61440||!(4191360>e||4194239>>b.f;a=c!=b.h?b.c[d].pc(c,a):b.c[d++].gb(c,a)|b.c[d&b.H].gb(0,a+1)<<8}return a}; -l.R=function(a){return this.N(Qb(this,a,D))};function M(a,b,c){c&=65535;if(4194304<=b)return a.b[b-4194304]=c;if(0<=b){a=a.A;var d=c,f=b&a.h,e=(b&a.i)>>>a.f;f!=a.h?a.c[e].Cc(f,d&65535,b):(a.c[e++].lb(f,d&255,b),a.c[e&a.H].lb(0,d>>8&255,b+1));return c}return b}function R(a,b){4194304<=b?b=a.b[b-4194304]&255:0<=b&&(a=a.A,b=a.c[(b&a.i)>>>a.f].gb(b&a.h,b));return b}function S(a,b,c){c&=255;return 4194304<=b?a.b[b-4194304]=a.b[b-4194304]&65280|c:0<=b?(a=a.A,a.c[(b&a.i)>>>a.f].lb(b&a.h,c&255,b),c):b} -function Rb(a){var b=a.R(a.b[6]|65536);0<=b&&(a.b[6]=a.b[6]+2&65535);return b}function Q(a,b){var c,d;a.b[6]=d=a.b[6]-2&65535;a.I&57344||(a.ga=a.ga<<8|246);!a.v&&d<=a.ma&&4>3&7){case 0:K(a,4,34);break;case 1:return 6===e&&!a.v&&c&E&&(a.b[6]<=a.ma||65534<=a.b[6])&&(a.b[6]<=a.ma-32||65534<=a.b[6]?(a.s|=4,a.b[6]=4,K(a,4,36)):(a.s|=8,a.F|=64)),7===e?a.b[e]:a.b[e]|a.H;case 2:f=2;d=a.b[e];7!==e&&(d|=a.H,6>e&&c&1&&(f=1));break;case 3:f=2;d=a.b[e];7!==e&&(d|=a.H);if(0>(d=a.R(d)))return d;d|=a.H;break;case 4:f=-2;6>e&&c&1&&(f=-1);d=a.b[e]+f&65535;7!==e&&(d|=a.H);break;case 5:f=-2;d=a.b[e]-2&65535;7!==e&&(d|=a.H);if(0>(d=a.R(d)))return d; -d|=a.H;break;case 6:if(0>(d=a.R(a.b[7])))return d;a.b[7]=a.b[7]+2&65535;d=d+a.b[e]&65535;return d|a.H;case 7:if(0>(d=a.R(a.b[7])))return d;a.b[7]=a.b[7]+2&65535;d=d+a.b[e]&65535;return 0>(d=a.R(d|65536))?d:d|a.H}a.b[e]=a.b[e]+f&65535;!a.H||a.I&57344||(a.ga=a.ga<<8|f<<3&248|e);6===e&&!a.v&&c&E&&0>=f&&(a.b[6]<=a.ma||65534<=a.b[6])&&(a.b[6]<=a.ma-32?(a.s|=4,a.b[6]=4,K(a,4,38)):(a.s|=8,a.F|=64));return d}l.gc=function(a,b){return T(this,a,b)};l.hc=function(a,b){return Qb(this,T(this,a,b),b)}; -function U(a,b){return b&56?a.Tb(T(a,b,D)):a.b[b&7]}function V(a,b){return b&56?R(a,a.l(b,Ia)):a.b[b&7]&255}function Sb(a,b,c,d){b&56?(b=a.l(b,F),M(a,b,d.call(a,c,a.N(b)))):(b&=7,a.b[b]=d.call(a,c,a.b[b])&65535)}function Tb(a,b,c,d){b&56?(b=a.l(b,G),S(a,b,d.call(a,c,R(a,b)))):(b&=7,a.b[b]=a.b[b]&65280|d.call(a,c,a.b[b])&255)}function Ub(a,b,c){b&56?M(a,a.l(b,E),c):a.b[b&7]=c&65535;return c} -function Vb(a,b,c,d){b&56?S(a,a.l(b,Ja),c):(b&=7,a.b[b]=d?d&1?a.b[b]&-256:c<<24>>24&65535:a.b[b]&-256|c&255);return c}function W(a,b){return((b&128?b|65280:b&255)<<1)+a&65535} +l.R=function(a){return this.N(Qb(this,a,Ia))};function M(a,b,c){c&=65535;if(4194304<=b)return a.b[b-4194304]=c;if(0<=b){a=a.A;var d=c,f=b&a.h,e=(b&a.i)>>>a.f;f!=a.h?a.c[e].Dc(f,d&65535,b):(a.c[e++].lb(f,d&255,b),a.c[e&a.H].lb(0,d>>8&255,b+1));return c}return b}function R(a,b){4194304<=b?b=a.b[b-4194304]&255:0<=b&&(a=a.A,b=a.c[(b&a.i)>>>a.f].gb(b&a.h,b));return b}function S(a,b,c){c&=255;return 4194304<=b?a.b[b-4194304]=a.b[b-4194304]&65280|c:0<=b?(a=a.A,a.c[(b&a.i)>>>a.f].lb(b&a.h,c&255,b),c):b} +function Rb(a){var b=a.R(a.b[6]|65536);0<=b&&(a.b[6]=a.b[6]+2&65535);return b}function Q(a,b){var c,d;a.b[6]=d=a.b[6]-2&65535;a.I&57344||(a.ga=a.ga<<8|246);!a.v&&d<=a.ma&&4>3&7){case 0:K(a,4,34);break;case 1:return 6===e&&!a.v&&c&D&&(a.b[6]<=a.ma||65534<=a.b[6])&&(a.b[6]<=a.ma-32||65534<=a.b[6]?(a.s|=4,a.b[6]=4,K(a,4,36)):(a.s|=8,a.F|=64)),7===e?a.b[e]:a.b[e]|a.H;case 2:f=2;d=a.b[e];7!==e&&(d|=a.H,6>e&&c&1&&(f=1));break;case 3:f=2;d=a.b[e];7!==e&&(d|=a.H);if(0>(d=a.R(d)))return d;d|=a.H;break;case 4:f=-2;6>e&&c&1&&(f=-1);d=a.b[e]+f&65535;7!==e&&(d|=a.H);break;case 5:f=-2;d=a.b[e]-2&65535;7!==e&&(d|=a.H);if(0>(d=a.R(d)))return d; +d|=a.H;break;case 6:if(0>(d=a.R(a.b[7])))return d;a.b[7]=a.b[7]+2&65535;d=d+a.b[e]&65535;return d|a.H;case 7:if(0>(d=a.R(a.b[7])))return d;a.b[7]=a.b[7]+2&65535;d=d+a.b[e]&65535;return 0>(d=a.R(d|65536))?d:d|a.H}a.b[e]=a.b[e]+f&65535;!a.H||a.I&57344||(a.ga=a.ga<<8|f<<3&248|e);6===e&&!a.v&&c&D&&0>=f&&(a.b[6]<=a.ma||65534<=a.b[6])&&(a.b[6]<=a.ma-32?(a.s|=4,a.b[6]=4,K(a,4,38)):(a.s|=8,a.F|=64));return d}l.gc=function(a,b){return T(this,a,b)};l.hc=function(a,b){return Qb(this,T(this,a,b),b)}; +function U(a,b){return b&56?a.Tb(T(a,b,Ia)):a.b[b&7]}function V(a,b){return b&56?R(a,a.l(b,Ja)):a.b[b&7]&255}function Sb(a,b,c,d){b&56?(b=a.l(b,E),M(a,b,d.call(a,c,a.N(b)))):(b&=7,a.b[b]=d.call(a,c,a.b[b])&65535)}function Tb(a,b,c,d){b&56?(b=a.l(b,F),S(a,b,d.call(a,c,R(a,b)))):(b&=7,a.b[b]=a.b[b]&65280|d.call(a,c,a.b[b])&255)}function Ub(a,b,c){b&56?M(a,a.l(b,D),c):a.b[b&7]=c&65535;return c} +function Vb(a,b,c,d){b&56?S(a,a.l(b,Ka),c):(b&=7,a.b[b]=c?d&1?c<<24>>24&65535:a.b[b]&-256|c&255:a.b[b]&-256);return c}function W(a,b){return((b&128?b|65280:b&255)<<1)+a&65535} l.$b=function(a){this.j.complete=!0;this.j.dc=!1;this.j.Zb=!1;this.ba=this.a=a;this.Mb&256?(Jb(this),a=!1):a=!0;if(a){do{var b,c,d,f;this.F&112&&(this.F&32?K(this,168,52):this.F&64?K(this,4,54):this.F&16&&K(this,12,56),this.F&=-113);if(this.la)if(1===this.la)this.la=2;else{this.la=0;b=-1;c=this.ub&224;if(0<(a=this.o.length))for(;0c&&(c=this.o[a].nc, -b=a)}c>(this.u&224)&&(0>b?K(this,160,42):(K(this,this.o[b].Ac,44),this.o.splice(b,1)))}this.I&57344||(this.ga=0,this.Ya=this.b[7]);this.F=this.u&16;this.i=a=this.R(this.b[7]);0<=a&&(this.b[7]=this.b[7]+2&65535);this.decode(a);if(0>this.i)switch(a&61440){case 4096:break;case 8192:break;case 12288:break;case 16384:break;case 20480:break;case 24576:break;case 36864:break;case 40960:break;case 45056:break;case 49152:break;case 53248:break;case 57344:break;default:switch(a&65024){case 2048:0<=(d=T(this, +b=a)}c>(this.u&224)&&(0>b?K(this,160,42):(K(this,this.o[b].Bc,44),this.o.splice(b,1)))}this.I&57344||(this.ga=0,this.Ya=this.b[7]);this.F=this.u&16;this.i=a=this.R(this.b[7]);0<=a&&(this.b[7]=this.b[7]+2&65535);this.decode(a);if(0>this.i)switch(a&61440){case 4096:break;case 8192:break;case 12288:break;case 16384:break;case 20480:break;case 24576:break;case 36864:break;case 40960:break;case 45056:break;case 49152:break;case 53248:break;case 57344:break;default:switch(a&65024){case 2048:0<=(d=T(this, a,0))&&(f=a>>6&7,0<=Q(this,this.b[f])&&(this.b[f]=this.b[7],this.b[7]=d&65535));break;case 28672:0<=(b=U(this,a))&&(f=a>>6&7,b&32768&&(b|=-65536),c=this.b[f],c&32768&&(c|=-65536),a=~~(b*c),this.b[f]=a>>16&65535,this.b[f|1]=a&65535,this.c=a>>16,this.h=this.c|a,this.g=this.f=0,-32768>a||32767>6&7,c=this.b[f]<<16|this.b[f|1],this.g=this.f=0,b&32768&&(b|=-65536),a=~~(c/b),-32768<=a&&32767>=a?(this.b[f]=a&65535,this.b[f|1]=c-a*b&65535,this.h= a>>16|a,this.c=a>>16):(this.f=32768,this.h=a>>15|a,this.c=c>>16,-1===b&&65534===this.b[f]&&(this.b[f]=this.b[f|1]=1))):(this.h=this.c=0,this.f=32768,this.g=65536));break;case 29696:0<=(b=U(this,a))&&(f=a>>6&7,a=this.b[f],a&32768&&(a|=4294901760),this.g=this.f=0,b&=63,b&32?(b=64-b,16>=b):b&&(16>15&65535)&&65535!==c&&(this.f=32768))),this.b[f]=a&65535,this.c=this.h=a);break;case 30208:if(0<=(b=U(this,a))){f=a>>6&7;c=this.b[f]<<16|this.b[f| -1];this.g=this.f=0;b&=63;if(b&32)b=64-b,32>b-1,this.g=a<<16,a>>=1,c&2147483648&&(a|=4294967295<<32-b);else if(b){if(a=c<>15,a<<=1,32>=32-b)c|=4294967295<>16&65535;this.b[f|1]=a&65535;this.c=a>>16;this.h=a>>16|a}break;case 30720:a&56?0<=(c=this.N(b=this.l(a,F)))&&(c^=this.b[a>>6&7],0<=M(this,b,c)&&(this.c=this.h=c,this.f=0)):(this.c=this.h=c=this.b[a&7]^=this.b[a>>6&7],this.f=0);break;case 32256:f= +1];this.g=this.f=0;b&=63;if(b&32)b=64-b,32>b-1,this.g=a<<16,a>>=1,c&2147483648&&(a|=4294967295<<32-b);else if(b){if(a=c<>15,a<<=1,32>=32-b)c|=4294967295<>16&65535;this.b[f|1]=a&65535;this.c=a>>16;this.h=a>>16|a}break;case 30720:a&56?0<=(c=this.N(b=this.l(a,E)))&&(c^=this.b[a>>6&7],0<=M(this,b,c)&&(this.c=this.h=c,this.f=0)):(this.c=this.h=c=this.b[a&7]^=this.b[a>>6&7],this.f=0);break;case 32256:f= a>>6&7;if(this.b[f]=this.b[f]-1&65535)this.b[7]=this.b[7]-((a&63)<<1)&65535;break;default:switch(a&65280){case 256:this.b[7]=W(this.b[7],a);break;case 512:this.h&65535&&(this.b[7]=W(this.b[7],a));break;case 768:this.h&65535||(this.b[7]=W(this.b[7],a));break;case 1024:(this.c&32768)===(this.f&32768)&&(this.b[7]=W(this.b[7],a));break;case 1280:(this.c&32768)!==(this.f&32768)&&(this.b[7]=W(this.b[7],a));break;case 1536:this.h&65535&&(this.c&32768)===(this.f&32768)&&(this.b[7]=W(this.b[7],a));break;case 1792:this.h& 65535&&(this.c&32768)===(this.f&32768)||(this.b[7]=W(this.b[7],a));break;case 32768:this.c&32768||(this.b[7]=W(this.b[7],a));break;case 33280:!(this.g&65536)&&this.h&65535&&(this.b[7]=W(this.b[7],a));break;case 33024:this.c&32768&&(this.b[7]=W(this.b[7],a));break;case 33536:if(this.g&65536||!(this.h&65535))this.b[7]=W(this.b[7],a);break;case 33792:this.f&32768||(this.b[7]=W(this.b[7],a));break;case 34048:this.f&32768&&(this.b[7]=W(this.b[7],a));break;case 34304:this.g&65536||(this.b[7]=W(this.b[7], -a));break;case 34560:this.g&65536&&(this.b[7]=W(this.b[7],a));break;case 34816:K(this,24,2);break;case 35072:K(this,28,4);break;default:switch(a&65472){case 64:0<=(d=T(this,a,0))&&(this.b[7]=d&65535);break;case 192:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c<<8|c>>8,0<=M(this,b,a)&&(this.c=this.h=c&65280,this.f=this.g=0)):(f=a&7,c=this.b[f],this.b[f]=(c<<8|c>>8)&65535,this.c=this.h=c&65280,this.f=this.g=0);break;case 2560:break;case 2624:0<=(c=this.N(b=this.l(a,F)))&&(a=~c,0<=M(this,b,a)&&(this.c=this.h= -a,this.g=65536,this.f=0));break;case 2688:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c+1,0<=M(this,b,a)&&(this.c=this.h=a,this.f=a&(a^c))):(f=a&7,c=this.b[f],a=c+1,this.b[f]=a&65535,this.c=this.h=a,this.f=a&(a^c));break;case 2752:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c-1,0<=M(this,b,a)&&(this.c=this.h=a,this.f=(a^c)&c)):(f=a&7,c=this.b[f],a=c-1,this.b[f]=a&65535,this.c=this.h=a,this.f=(a^c)&c);break;case 2816:0<=(c=this.N(b=this.l(a,F)))&&(a=-c,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a&c));break; -case 2880:0<=(c=this.N(b=this.l(a,F)))&&(a=c+(this.g>>16&1),0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a&(a^c)));break;case 2944:0<=(c=this.N(b=this.l(a,F)))&&(a=c-(this.g>>16&1),0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=(a^c)&c));break;case 3008:0<=(c=U(this,a))&&(this.c=this.h=c,this.g=this.f=0);break;case 3072:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=(this.g&65536|c)>>1,0<=M(this,b,a)&&(this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1)):(f=a&7,c=this.b[f],a=(this.g&65536|c)>>1,this.b[f]=a& -65535,this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1);break;case 3136:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c<<1|this.g>>16&1,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(f=a&7,c=this.b[f],a=c<<1|this.g>>16&1,this.b[f]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3200:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c&32768|c>>1,0<=M(this,b,a)&&(this.g=c<<16,this.c=this.h=a,this.f=this.c^this.g>>1)):(f=a&7,c=this.b[f],a=c&32768|c>>1,this.b[f]=a&65535,this.g=c<<16,this.c=this.h=a,this.f=this.c^ -this.g>>1);break;case 3264:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c<<1,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(f=a&7,c=this.b[f],a=c<<1,this.b[f]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3328:d=this.b[7]+((a&63)<<1)&65535;0<=(b=this.R(d|65536))&&(this.b[7]=this.b[5],this.b[5]=b,this.b[6]=d+2&65535);break;case 3392:a&56?0<=(d=T(this,a,0))&&(61440!==(this.u&61440)&&(d&=65535),this.v=this.u>>12&3,0<=(b=this.R(d))&&(this.v=this.u>>14&3,0<=Q(this,b)&&(this.c=this.h=b,this.f=0))): -(f=a&7,b=6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]:this.aa[this.u>>12&3],0<=Q(this,b)&&(this.c=this.h=b,this.f=0));break;case 3456:0<=(c=Rb(this))&&((this.I&57344||(this.ga=22),a&56)?0<=(d=T(this,a,0))&&(d&=65535,this.v=this.u>>12&3,0<=(b=Qb(this,d,E))&&(this.v=this.u>>14&3,0<=M(this,b,c)&&(this.c=this.h=c,this.f=0))):(f=a&7,6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]=c:this.aa[this.u>>12&3]=c,this.c=this.h=c,this.f=0));break;case 3520:0<=(b=this.l(a,E))&&(a=-(this.c>>15&1),0<=M(this, -b,a)&&(this.h=a,this.f=0));break;case 35328:break;case 35392:0<=(c=R(this,b=this.l(a,G)))&&(a=~c,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.g=65536,this.f=0));break;case 35456:0<=(c=R(this,b=this.l(a,G)))&&(a=c+1,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.f=(a&(a^c))<<8));break;case 35520:0<=(c=R(this,b=this.l(a,G)))&&(a=c-1,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.f=((a^c)&c)<<8));break;case 35584:0<=(c=R(this,b=this.l(a,G)))&&(a=-c,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a&c)<<8));break; -case 35648:0<=(c=R(this,b=this.l(a,G)))&&(a=c+(this.g>>16&1),0<=S(this,b,a)&&(this.c=this.h=this.g=a<<8,this.f=(a&(a^c))<<8));break;case 35712:0<=(c=R(this,b=this.l(a,G)))&&(a=c-(this.g>>16&1),0<=S(this,b,a)&&(this.c=this.h=this.g=a<<8,this.f=((a^c)&c)<<8));break;case 35776:0<=(c=V(this,a))&&(this.c=this.h=c<<8,this.g=this.f=0);break;case 35840:0<=(c=R(this,b=this.l(a,G)))&&(a=((this.g&65536)>>8|c)>>1,0<=S(this,b,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 35904:0<=(c= -R(this,b=this.l(a,G)))&&(a=c<<1|this.g>>16&1,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 35968:0<=(c=R(this,b=this.l(a,G)))&&(a=c&128|c>>1,0<=S(this,b,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 36032:0<=(c=R(this,b=this.l(a,G)))&&(a=c<<1,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 36160:a&56?0<=(d=T(this,a,0))&&(this.v=this.u>>12&3,0<=(b=this.R(d|65536))&&(this.v=this.u>>14&3,0<=Q(this,b)&&(this.c=this.h=b,this.f= -0))):(f=a&7,b=6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]:this.aa[this.u>>12&3],0<=Q(this,b)&&(this.c=this.h=b,this.f=0));break;case 36224:0<=(c=Rb(this))&&((this.I&57344||(this.ga=22),a&56)?0<=(d=T(this,a,0))&&(this.v=this.u>>12&3,0<=(b=Qb(this,d|65536,E))&&(this.v=this.u>>14&3,0<=M(this,b,c)&&(this.c=this.h=c,this.f=0))):(f=a&7,6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]=c:this.aa[this.u>>12&3]=c,this.c=this.h=c,this.f=0));break;default:switch(a&65528){case 128:0<=(b=Rb(this))&& +a));break;case 34560:this.g&65536&&(this.b[7]=W(this.b[7],a));break;case 34816:K(this,24,2);break;case 35072:K(this,28,4);break;default:switch(a&65472){case 64:0<=(d=T(this,a,0))&&(this.b[7]=d&65535);break;case 192:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c<<8|c>>8,0<=M(this,b,a)&&(this.c=this.h=c&65280,this.f=this.g=0)):(f=a&7,c=this.b[f],this.b[f]=(c<<8|c>>8)&65535,this.c=this.h=c&65280,this.f=this.g=0);break;case 2560:break;case 2624:0<=(c=this.N(b=this.l(a,E)))&&(a=~c,0<=M(this,b,a)&&(this.c=this.h= +a,this.g=65536,this.f=0));break;case 2688:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c+1,0<=M(this,b,a)&&(this.c=this.h=a,this.f=a&(a^c))):(f=a&7,c=this.b[f],a=c+1,this.b[f]=a&65535,this.c=this.h=a,this.f=a&(a^c));break;case 2752:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c-1,0<=M(this,b,a)&&(this.c=this.h=a,this.f=(a^c)&c)):(f=a&7,c=this.b[f],a=c-1,this.b[f]=a&65535,this.c=this.h=a,this.f=(a^c)&c);break;case 2816:0<=(c=this.N(b=this.l(a,E)))&&(a=-c,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a&c));break; +case 2880:0<=(c=this.N(b=this.l(a,E)))&&(a=c+(this.g>>16&1),0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a&(a^c)));break;case 2944:0<=(c=this.N(b=this.l(a,E)))&&(a=c-(this.g>>16&1),0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=(a^c)&c));break;case 3008:0<=(c=U(this,a))&&(this.c=this.h=c,this.g=this.f=0);break;case 3072:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=(this.g&65536|c)>>1,0<=M(this,b,a)&&(this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1)):(f=a&7,c=this.b[f],a=(this.g&65536|c)>>1,this.b[f]=a& +65535,this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1);break;case 3136:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c<<1|this.g>>16&1,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(f=a&7,c=this.b[f],a=c<<1|this.g>>16&1,this.b[f]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3200:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c&32768|c>>1,0<=M(this,b,a)&&(this.g=c<<16,this.c=this.h=a,this.f=this.c^this.g>>1)):(f=a&7,c=this.b[f],a=c&32768|c>>1,this.b[f]=a&65535,this.g=c<<16,this.c=this.h=a,this.f=this.c^ +this.g>>1);break;case 3264:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c<<1,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(f=a&7,c=this.b[f],a=c<<1,this.b[f]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3328:d=this.b[7]+((a&63)<<1)&65535;0<=(b=this.R(d|65536))&&(this.b[7]=this.b[5],this.b[5]=b,this.b[6]=d+2&65535);break;case 3392:a&56?0<=(d=T(this,a,0))&&(61440!==(this.u&61440)&&(d&=65535),this.v=this.u>>12&3,0<=(b=this.R(d))&&(this.v=this.u>>14&3,0<=Q(this,b)&&(this.c=this.h=b,this.f=0))): +(f=a&7,b=6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]:this.aa[this.u>>12&3],0<=Q(this,b)&&(this.c=this.h=b,this.f=0));break;case 3456:0<=(c=Rb(this))&&((this.I&57344||(this.ga=22),a&56)?0<=(d=T(this,a,0))&&(d&=65535,this.v=this.u>>12&3,0<=(b=Qb(this,d,D))&&(this.v=this.u>>14&3,0<=M(this,b,c)&&(this.c=this.h=c,this.f=0))):(f=a&7,6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]=c:this.aa[this.u>>12&3]=c,this.c=this.h=c,this.f=0));break;case 3520:0<=(b=this.l(a,D))&&(a=-(this.c>>15&1),0<=M(this, +b,a)&&(this.h=a,this.f=0));break;case 35328:break;case 35392:0<=(c=R(this,b=this.l(a,F)))&&(a=~c,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.g=65536,this.f=0));break;case 35456:0<=(c=R(this,b=this.l(a,F)))&&(a=c+1,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.f=(a&(a^c))<<8));break;case 35520:0<=(c=R(this,b=this.l(a,F)))&&(a=c-1,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.f=((a^c)&c)<<8));break;case 35584:0<=(c=R(this,b=this.l(a,F)))&&(a=-c,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a&c)<<8));break; +case 35648:0<=(c=R(this,b=this.l(a,F)))&&(a=c+(this.g>>16&1),0<=S(this,b,a)&&(this.c=this.h=this.g=a<<8,this.f=(a&(a^c))<<8));break;case 35712:0<=(c=R(this,b=this.l(a,F)))&&(a=c-(this.g>>16&1),0<=S(this,b,a)&&(this.c=this.h=this.g=a<<8,this.f=((a^c)&c)<<8));break;case 35776:0<=(c=V(this,a))&&(this.c=this.h=c<<8,this.g=this.f=0);break;case 35840:0<=(c=R(this,b=this.l(a,F)))&&(a=((this.g&65536)>>8|c)>>1,0<=S(this,b,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 35904:0<=(c= +R(this,b=this.l(a,F)))&&(a=c<<1|this.g>>16&1,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 35968:0<=(c=R(this,b=this.l(a,F)))&&(a=c&128|c>>1,0<=S(this,b,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 36032:0<=(c=R(this,b=this.l(a,F)))&&(a=c<<1,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 36160:a&56?0<=(d=T(this,a,0))&&(this.v=this.u>>12&3,0<=(b=this.R(d|65536))&&(this.v=this.u>>14&3,0<=Q(this,b)&&(this.c=this.h=b,this.f= +0))):(f=a&7,b=6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]:this.aa[this.u>>12&3],0<=Q(this,b)&&(this.c=this.h=b,this.f=0));break;case 36224:0<=(c=Rb(this))&&((this.I&57344||(this.ga=22),a&56)?0<=(d=T(this,a,0))&&(this.v=this.u>>12&3,0<=(b=Qb(this,d|65536,D))&&(this.v=this.u>>14&3,0<=M(this,b,c)&&(this.c=this.h=c,this.f=0))):(f=a&7,6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]=c:this.aa[this.u>>12&3]=c,this.c=this.h=c,this.f=0));break;default:switch(a&65528){case 128:0<=(b=Rb(this))&& (f=a&7,this.b[7]=this.b[f],this.b[f]=b);break;case 152:this.u&49152||(this.u=this.u&63519|(a&7)<<5,this.la=1);break;case 160:case 168:break;case 176:case 184:break;default:switch(a){case 0:49152&this.u?(this.s|=128,K(this,4,46)):(this.Ha=3,Jb(this),console.log("HALT at "+this.b[7].toString(8)));break;case 1:b=0;if(0<(a=this.o.length))for(;0>12].call(this,a)} -var jc=[function(a){kc[a>>8&15].call(this,a)},function(a){P(this,Ub(this,a,U(this,a>>6)));--this.a},function(a){var b=U(this,a>>6);a=U(this,a);Pb(this,b-a,a,b);--this.a},function(a){P(this,U(this,a>>6)&U(this,a));--this.a},function(a){Sb(this,a,U(this,a>>6),Xb);--this.a},function(a){Sb(this,a,U(this,a>>6),Zb);--this.a},function(a){Sb(this,a,U(this,a>>6),Wb);--this.a},function(a){lc[a>>8&15].call(this,a)},function(a){mc[a>>8&15].call(this,a)},function(a){var b=V(this,a>>6);P(this,Vb(this,a,b,2)<<8); +var jc=[function(a){kc[a>>8&15].call(this,a)},function(a){P(this,Ub(this,a,U(this,a>>6)));--this.a},function(a){var b=U(this,a>>6);a=U(this,a);Pb(this,b-a,a,b);--this.a},function(a){P(this,U(this,a>>6)&U(this,a));--this.a},function(a){Sb(this,a,U(this,a>>6),Xb);--this.a},function(a){Sb(this,a,U(this,a>>6),Zb);--this.a},function(a){Sb(this,a,U(this,a>>6),Wb);--this.a},function(a){lc[a>>8&15].call(this,a)},function(a){mc[a>>8&15].call(this,a)},function(a){var b=V(this,a>>6);P(this,Vb(this,a,b,1)<<8); --this.a},function(a){var b=V(this,a>>6)<<8;a=V(this,a)<<8;Pb(this,b-a,a,b);--this.a},function(a){P(this,(V(this,a>>6)&V(this,a))<<8);--this.a},function(a){Tb(this,a,V(this,a>>6),Yb);--this.a},function(a){Tb(this,a,V(this,a>>6),$b);--this.a},function(a){Sb(this,a,U(this,a>>6),ac);--this.a},Z],kc=[function(a){nc[a>>4&15].call(this,a)},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i= -1;--this.a},function(){this.i=-1;--this.a},ec,ec,function(a){oc[a>>6&3].call(this,a)},function(a){pc[a>>6&3].call(this,a)},function(a){qc[a>>6&3].call(this,a)},function(a){rc[a>>6&3].call(this,a)},Z,Z],nc=[function(a){sc[a&15].call(this,a)},Z,Z,Z,Z,Z,Z,Z,Z,Z,function(a){tc[a&15].call(this,a)},function(a){uc[a&15].call(this,a)},Z,Z,Z,Z],tc=[gc,function(){this.g=0;--this.a},function(){this.f=0;--this.a},X,function(){this.h=1;--this.a},X,X,X,function(){this.c=0;--this.a},X,X,X,X,X,X,X],uc=[gc,function(){this.g= 65536;--this.a},function(){this.f=32768;--this.a},Y,function(){this.h=0;--this.a},Y,Y,Y,function(){this.c=32768;--this.a},Y,Y,Y,Y,Y,Y,Y],sc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.u&49152||(Nb(this),this.A.reset());--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},Z,Z,Z,Z,Z,Z,Z,Z],lc=[fc,fc,dc,dc,bc,bc,cc,cc,ic,ic,Z,Z,Z,Z,hc,hc],mc=[function(){this.i= -1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(a){vc[a>>6&3].call(this,a)},function(a){wc[a>>6&3].call(this,a)},function(a){xc[a>>6&3].call(this,a)},function(a){yc[a>>6&3].call(this,a)},Z,Z],oc=[function(a){Ob(this,Ub(this,a,0));--this.a},function(){this.i= --1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],pc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],qc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],rc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],vc=[function(a){Ob(this,Vb(this,a,0,1)); +-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],pc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],qc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],rc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],vc=[function(a){Ob(this,Vb(this,a,0)); --this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],wc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],xc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],yc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}]; function zc(a){v.call(this,"ROM",a,zc);this.c=null;this.l=a.addr;this.f=a.size;this.o=a.writable;this.g=a.alias;this.h=a.file;this.v=ba(this.h);if(this.h){a=this.h;var b=ca(this.v);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.h+"&format=bytes&decimal=true");var c=this;p(a,null,!0,function(a,b,e){Ac(c,a,b,e)})}}x(zc);zc.prototype.La=function(a,b,c,d){this.A=b;this.a=c;this.K=d;Bc(this)};zc.prototype.za=function(){this.i&&(this.K&&this.K.a(this.id,this.l,this.f,this.i),delete this.i);return!0}; zc.prototype.ya=function(){return!0}; function Ac(a,b,c,d){if(d)a.L("Unable to load system ROM (error "+d+": "+b+")");else{Da(a.Lb,b,c);var f;if("["==c.charAt(0)||"{"==c.charAt(0))try{var e,g,h=eval("("+c+")");if(e=h.bytes)a.c=e;else if(e=h.words)for(a.c=Array(2*e.length),g=f=0;f>8&255;else if(e=h.data)for(a.c=Array(4*e.length),g=f=0;f>8&255,a.c[g++]=e[f]>>16&255,a.c[g++]=e[f]>>24&255;else a.c=h;a.i=h.symbols;if(!a.c.length){r("Empty ROM: "+b); return}if(1==a.c.length){r(a.c[0]);return}}catch(k){a.L("ROM data error: "+k.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.c=Array(b.length),f=0;f>>d.f].ac(f&d.h,a.c[c]&255,f)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c>>f.f;0>>d.f].ac(f&d.h,a.c[c]&255,f)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c>>f.f;0>>=f.f;0\nLicense: GPL version 3 or later ");this.$("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bGc){if(Ic(d,this.v)){this.i=new O(this,"1.30.0","failsafe");Ic(this.i)&&(Nc(this,d),a=2,Oc(this.i));this.i.set("timestamp",ia());Pc(this.i);var f=this.c&&!this.l;if(1==a||ja("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=Mc(d)){var e=d.get("code"),g=d.get("data");e&&("ok"==e?Ic(d,g):("error"== +l.fb=function(a){void 0===a&&(a=this.c||(this.v?1:Gc));if(!this.g){this.g++;var b=!1,c=!1;this.V=!1;var d=this.B||new O(this,"1.30.0");if(-1==a)b=!0;else if(a>Gc){if(Ic(d,this.v)){this.i=new O(this,"1.30.0","failsafe");Ic(this.i)&&(Nc(this,d),a=2,Oc(this.i));this.i.set("timestamp",ia());Pc(this.i);var f=this.c&&!this.l;if(1==a||ja("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=Mc(d)){var e=d.get("code"),g=d.get("data");e&&("ok"==e?Ic(d,g):("error"== e&&"no machine state"!=g?(this.L("Error: "+g),"unable to verify user"==g&&(na("user",""),this.f=null)):this.$(e+": "+g),Oc(d),Ic(d)?(c=Mc(d),f=!0):c=!1))}f&&Lc(this,c?d:null)}else 2==a&&d.clear()}else Lc(this);delete this.v;delete this.B}f=y(this.id);for(e=0;ea[1];a=a[2];this.ca=!0;this.j.M=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.a&&(Qc(this,this.a,b,c,a),this.a.$a());this.W&&(Nc(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.g=0}; +function Qc(a,b,c,d,f){if(!b.j.M){b.j.M=!0;if(b.za){var e=null;f&&((e=c.get(b.id))||(e=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof e&&(e=null);!b.za(e,d)&&e&&(r("Unable to restore state for "+b.type),a.O&&!a.Y?(c.clear(),a.c=Gc,window&&window.location.reload()):a.V=!0,b.za(null),f=!1)}if(!d&&b.Kb)for(a=b.Kb.split("|"),c=0;ca[1];a=a[2];this.ca=!0;this.j.M=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.a&&(Qc(this,this.a,b,c,a),this.a.$a());this.V&&(Nc(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.g=0}; function Nc(a,b){if(ja("There may be a problem with your PDP11js machine.\n\nTo help us diagnose it, click OK to send this PDP11js machine state to http://www.pcjs.org.")){var c=a.f||"";b=b.toString();var d={app:"PDP11js",ver:"1.30.0"};d.url=a.url;d.user=c;d.type="bug";d.data=b;p("http://www.pcjs.org/api/v1/report",d,!0)}} function Rc(a,b,c){var d,f="none";if(a.g)return null;a.g--;var e=new O(a,"1.30.0"),g=new O(a,"1.30.0","validate"),h=ia();g.set("timestamp",h);e.set("timestamp",h);e.set("version","1.30.0");e.set("url",window?window.location.href:null);e.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ya&&(c&&Eb(a.a),d=a.a.ya(b,c),"object"===typeof d&&e.set(a.a.id,d),c&&(a.a.j.M=!1,!1===d&&(f=null)));for(var h=y(a.id),k=0;k