From a248b177fddbcd9f2f2f6d5760e2d80eada4b771 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 1 Dec 2016 21:12:18 -0800 Subject: [PATCH] Eliminated the NO_FLAGS hack, which was doubly-annoying because its sole purpose was to prevent writes to ONE address -- the PSW -- from modifying any flags; the proper solution is to simply ensure that all flag updates occur before the destination is written --- modules/pdp11/lib/bus.js | 97 ++--- modules/pdp11/lib/cpuops.js | 18 +- modules/pdp11/lib/cpustate.js | 112 ++---- modules/pdp11/lib/defines.js | 1 - modules/pdp11/lib/device.js | 1 - versions/pdpjs/1.30.5/pdp11-dbg.js | 600 ++++++++++++++--------------- versions/pdpjs/1.30.5/pdp11.js | 463 +++++++++++----------- 7 files changed, 630 insertions(+), 662 deletions(-) diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index a521fb7f6..f67465d0f 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -913,6 +913,55 @@ BusPDP11.prototype.getByte = function(addr) return this.aMemBlocks[(addr & this.nMemMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr); }; +/** + * getWord(addr) + * + * @this {BusPDP11} + * @param {number} addr is a physical address + * @return {number} word (16-bit) value at that address + */ +BusPDP11.prototype.getWord = function(addr) +{ + var off = addr & this.nBlockLimit; + var iBlock = (addr & this.nMemMask) >>> this.nBlockShift; + if (!PDP11.WORDBUS && off == this.nBlockLimit) { + return this.aMemBlocks[iBlock++].readByte(off, addr) | (this.aMemBlocks[iBlock & this.nBlockMask].readByte(0, addr + 1) << 8); + } + return this.aMemBlocks[iBlock].readWord(off, addr); +}; + +/** + * setByte(addr, b) + * + * @this {BusPDP11} + * @param {number} addr is a physical address + * @param {number} b is the byte (8-bit) value to write + */ +BusPDP11.prototype.setByte = function(addr, b) +{ + this.assert(!(b & ~0xff)); + this.aMemBlocks[(addr & this.nMemMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b, addr); +}; + +/** + * setWord(addr, w) + * + * @this {BusPDP11} + * @param {number} addr is a physical address + * @param {number} w is the word (16-bit) value to write + */ +BusPDP11.prototype.setWord = function(addr, w) +{ + var off = addr & this.nBlockLimit; + var iBlock = (addr & this.nMemMask) >>> this.nBlockShift; + if (!PDP11.WORDBUS && off == this.nBlockLimit) { + this.aMemBlocks[iBlock++].writeByte(off, w & 0xff, addr); + this.aMemBlocks[iBlock & this.nBlockMask].writeByte(0, (w >> 8) & 0xff, addr + 1); + return; + } + this.aMemBlocks[iBlock].writeWord(off, w, addr); +}; + /** * getBlockDirect(addr) * @@ -943,23 +992,6 @@ BusPDP11.prototype.getByteDirect = function(addr) return b; }; -/** - * getWord(addr) - * - * @this {BusPDP11} - * @param {number} addr is a physical address - * @return {number} word (16-bit) value at that address - */ -BusPDP11.prototype.getWord = function(addr) -{ - var off = addr & this.nBlockLimit; - var iBlock = (addr & this.nMemMask) >>> this.nBlockShift; - if (!PDP11.WORDBUS && off == this.nBlockLimit) { - return this.aMemBlocks[iBlock++].readByte(off, addr) | (this.aMemBlocks[iBlock & this.nBlockMask].readByte(0, addr + 1) << 8); - } - return this.aMemBlocks[iBlock].readWord(off, addr); -}; - /** * getWordDirect(addr) * @@ -985,18 +1017,6 @@ BusPDP11.prototype.getWordDirect = function(addr) return w; }; -/** - * setByte(addr, b) - * - * @this {BusPDP11} - * @param {number} addr is a physical address - * @param {number} b is the byte (8-bit) value to write (we truncate it to 8 bits to be safe) - */ -BusPDP11.prototype.setByte = function(addr, b) -{ - this.aMemBlocks[(addr & this.nMemMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr); -}; - /** * setByteDirect(addr, b) * @@ -1014,25 +1034,6 @@ BusPDP11.prototype.setByteDirect = function(addr, b) this.nDisableFaults--; }; -/** - * setWord(addr, w) - * - * @this {BusPDP11} - * @param {number} addr is a physical address - * @param {number} w is the word (16-bit) value to write (we truncate it to 16 bits to be safe) - */ -BusPDP11.prototype.setWord = function(addr, w) -{ - var off = addr & this.nBlockLimit; - var iBlock = (addr & this.nMemMask) >>> this.nBlockShift; - if (!PDP11.WORDBUS && off == this.nBlockLimit) { - this.aMemBlocks[iBlock++].writeByte(off, w & 0xff, addr); - this.aMemBlocks[iBlock & this.nBlockMask].writeByte(0, (w >> 8) & 0xff, addr + 1); - return; - } - this.aMemBlocks[iBlock].writeWord(off, w & 0xffff, addr); -}; - /** * setWordDirect(addr, w) * diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 558630a47..a749131ea 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -875,7 +875,7 @@ PDP11.opBVS = function(opCode) */ PDP11.opCLR = function(opCode) { - this.updateAllFlags(this.writeDstWord(opCode, 0)); + this.writeDstWord(opCode, 0, this.updateAllFlags); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -887,7 +887,7 @@ PDP11.opCLR = function(opCode) */ PDP11.opCLRB = function(opCode) { - this.updateAllFlags(this.writeDstByte(opCode, 0, PDP11.WRITE.BYTE)); + this.writeDstByte(opCode, 0, PDP11.WRITE.BYTE, this.updateAllFlags); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1283,8 +1283,8 @@ PDP11.opMARK = function(opCode) PDP11.opMFPD = function(opCode) { var data = this.readWordFromPrevSpace(opCode, PDP11.ACCESS.DSPACE); - this.pushWord(data); this.updateNZVFlags(data); + this.pushWord(data); this.nStepCycles -= (10 + 1); }; @@ -1297,8 +1297,8 @@ PDP11.opMFPD = function(opCode) PDP11.opMFPI = function(opCode) { var data = this.readWordFromPrevSpace(opCode, PDP11.ACCESS.ISPACE); - this.pushWord(data); this.updateNZVFlags(data); + this.pushWord(data); this.nStepCycles -= (10 + 1); }; @@ -1346,7 +1346,7 @@ PDP11.opMOV = function(opCode) */ var data = this.readSrcWord(opCode); this.nSnapCycles = this.nStepCycles; - this.updateNZVFlags(this.writeDstWord(opCode, data)); + this.writeDstWord(opCode, data, this.updateNZVFlags); this.nStepCycles = this.nSnapCycles - PDP11.MOV_CYCLES[(this.srcMode? 8 : 0) + this.dstMode] + (this.dstReg == 7 && !this.dstMode? 2 : 0); }; @@ -1359,7 +1359,7 @@ PDP11.opMOV = function(opCode) PDP11.opMOVB = function(opCode) { var data = this.readSrcByte(opCode); - this.updateNZVFlags(this.writeDstByte(opCode, data, PDP11.WRITE.SBYTE) << 8); + this.writeDstByte(opCode, data, PDP11.WRITE.SBYTE, this.updateNZVFlags); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 2) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; @@ -1381,8 +1381,8 @@ PDP11.opMTPD = function(opCode) */ var data = this.popWord(); this.nSnapCycles = this.nStepCycles; - this.writeWordToPrevSpace(opCode, PDP11.ACCESS.DSPACE, data); this.updateNZVFlags(data); + this.writeWordToPrevSpace(opCode, PDP11.ACCESS.DSPACE, data); this.nStepCycles = this.nSnapCycles - PDP11.MTP_CYCLES[this.dstMode]; }; @@ -1400,8 +1400,8 @@ PDP11.opMTPI = function(opCode) */ var data = this.popWord(); this.nSnapCycles = this.nStepCycles; - this.writeWordToPrevSpace(opCode, PDP11.ACCESS.ISPACE, data); this.updateNZVFlags(data); + this.writeWordToPrevSpace(opCode, PDP11.ACCESS.ISPACE, data); this.nStepCycles = this.nSnapCycles - PDP11.MTP_CYCLES[this.dstMode]; }; @@ -1775,7 +1775,7 @@ PDP11.opSWAB = function(opCode) */ PDP11.opSXT = function(opCode) { - this.updateNZVFlags(this.writeDstWord(opCode, this.getNF()? 0xffff : 0)); + this.writeDstWord(opCode, this.getNF()? 0xffff : 0, this.updateNZVFlags); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 4bb835958..88fe8b682 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -1188,10 +1188,8 @@ CPUStatePDP11.prototype.setPIR = function(newPIR) */ CPUStatePDP11.prototype.updateNZVFlags = function(result) { - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = this.flagZ = result; - this.flagV = 0; - } + this.flagN = this.flagZ = result; + this.flagV = 0; }; /** @@ -1204,10 +1202,8 @@ CPUStatePDP11.prototype.updateNZVFlags = function(result) */ CPUStatePDP11.prototype.updateNZVCFlags = function(result) { - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = this.flagZ = result; - this.flagV = this.flagC = 0; - } + this.flagN = this.flagZ = result; + this.flagV = this.flagC = 0; }; /** @@ -1221,10 +1217,8 @@ CPUStatePDP11.prototype.updateNZVCFlags = function(result) */ CPUStatePDP11.prototype.updateAllFlags = function(result, overflow) { - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = this.flagZ = this.flagC = result; - this.flagV = overflow || 0; - } + this.flagN = this.flagZ = this.flagC = result; + this.flagV = overflow || 0; }; /** @@ -1237,10 +1231,8 @@ CPUStatePDP11.prototype.updateAllFlags = function(result, overflow) */ CPUStatePDP11.prototype.updateAddFlags = function(result, src, dst) { - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = this.flagZ = this.flagC = result; - this.flagV = (src ^ result) & (dst ^ result); - } + this.flagN = this.flagZ = this.flagC = result; + this.flagV = (src ^ result) & (dst ^ result); }; /** @@ -1254,11 +1246,11 @@ CPUStatePDP11.prototype.updateAddFlags = function(result, src, dst) */ CPUStatePDP11.prototype.updateDecFlags = function(result, dst) { - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = this.flagZ = result; - // Because src is always 1 (with a zero sign bit), it can be optimized out of this calculation - this.flagV = (/* src ^ */ dst) & (dst ^ result); - } + this.flagN = this.flagZ = result; + /* + * Because src is always 1 (with a zero sign bit), it can be optimized out of this calculation. + */ + this.flagV = (/* src ^ */ dst) & (dst ^ result); }; /** @@ -1272,11 +1264,11 @@ CPUStatePDP11.prototype.updateDecFlags = function(result, dst) */ CPUStatePDP11.prototype.updateIncFlags = function(result, dst) { - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = this.flagZ = result; - // Because src is always 1 (with a zero sign bit), it can be optimized out of this calculation - this.flagV = (/* src ^ */ result) & (dst ^ result); - } + this.flagN = this.flagZ = result; + /* + * Because src is always 1 (with a zero sign bit), it can be optimized out of this calculation. + */ + this.flagV = (/* src ^ */ result) & (dst ^ result); }; /** @@ -1287,23 +1279,10 @@ CPUStatePDP11.prototype.updateIncFlags = function(result, dst) */ CPUStatePDP11.prototype.updateMulFlags = function(result) { - /* - * NOTE: Technically, the MUL instruction doesn't need to worry about NO_FLAGS, because that instruction - * doesn't write to the bus, and therefore can't modify the PSW directly. But it doesn't hurt to be consistent. - * - * TODO: Conduct a review of all opcode handlers, because one possible alternative to all this NO_FLAGS nonsense - * would be to pass the appropriate flag update function to the writeDstByte()/writeDstWord() functions, and - * have them update the flags BEFORE the write occurs, thus allowing any subsequent write to the PSW to be honored. - * - * That already happens automatically with the updateDstByte()/updateDstWord() functions, since generally the - * specified modify function also updates the flags BEFORE the write occurs. - */ - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = result >> 16; - this.flagZ = this.flagN | result; - this.flagV = 0; - this.flagC = (result < -32768 || result > 32767)? 0x10000 : 0; - } + this.flagN = result >> 16; + this.flagZ = this.flagN | result; + this.flagV = 0; + this.flagC = (result < -32768 || result > 32767)? 0x10000 : 0; }; /** @@ -1314,10 +1293,8 @@ CPUStatePDP11.prototype.updateMulFlags = function(result) */ CPUStatePDP11.prototype.updateShiftFlags = function(result) { - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = this.flagZ = this.flagC = result; - this.flagV = this.flagN ^ (this.flagC >> 1); - } + this.flagN = this.flagZ = this.flagC = result; + this.flagV = this.flagN ^ (this.flagC >> 1); }; /** @@ -1333,10 +1310,8 @@ CPUStatePDP11.prototype.updateShiftFlags = function(result) */ CPUStatePDP11.prototype.updateSubFlags = function(result, src, dst) { - if (!(this.opFlags & PDP11.OPFLAG.NO_FLAGS)) { - this.flagN = this.flagZ = this.flagC = result; - this.flagV = (src ^ dst) & (dst ^ result); - } + this.flagN = this.flagZ = this.flagC = result; + this.flagV = (src ^ dst) & (dst ^ result); }; /** @@ -2174,7 +2149,8 @@ CPUStatePDP11.prototype.readWordFromVirtual = function(addrVirtual) CPUStatePDP11.prototype.writeWordToPhysical = function(addr, data) { if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.mapUnibus(addr); - this.bus.setWord(this.addrLast = addr, data & 0xffff); + this.assert(!(data & ~0xffff)); + this.bus.setWord(this.addrLast = addr, data); }; /** @@ -2419,10 +2395,6 @@ CPUStatePDP11.prototype.updateDstWord = function(opCode, data, fnOp) var reg = this.dstReg = opCode & PDP11.OPREG.MASK; var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; - /* - * TODO: If callers are careful about masking data, then we don't need to mask it here or in bus.setWord(). - * We've eliminated the 0xffff data mask here, but bus.setWord() is still masking. - */ this.assert(data < 0 && data >= -8 || !(data & ~0xffff)); if (!mode) { @@ -2434,7 +2406,7 @@ CPUStatePDP11.prototype.updateDstWord = function(opCode, data, fnOp) }; /** - * writeDstByte(opCode, data, writeFlags) + * writeDstByte(opCode, data, writeFlags, fnFlags) * * Used whenever the DST operand (as described by opCode) does NOT need to be read before writing. * @@ -2442,9 +2414,9 @@ CPUStatePDP11.prototype.updateDstWord = function(opCode, data, fnOp) * @param {number} opCode * @param {number} data * @param {number} writeFlags (WRITE.BYTE aka 0xff, or WRITE.SBYTE aka 0xffff) - * @return {number} + * @param {function(number)} fnFlags */ -CPUStatePDP11.prototype.writeDstByte = function(opCode, data, writeFlags) +CPUStatePDP11.prototype.writeDstByte = function(opCode, data, writeFlags, fnFlags) { this.assert(writeFlags); var reg = this.dstReg = opCode & PDP11.OPREG.MASK; @@ -2463,41 +2435,39 @@ CPUStatePDP11.prototype.writeDstByte = function(opCode, data, writeFlags) data = (data < 0? (this.regsGen[-data-1] & 0xff): data); this.regsGen[reg] = (this.regsGen[reg] & ~writeFlags) | (((data << 24) >> 24) & writeFlags); } + fnFlags.call(this, data << 8); } else { var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_BYTE); - this.writeByteToPhysical(addr, (data = data < 0? (this.regsGen[-data-1] & 0xff): data)); + fnFlags.call(this, (data = data < 0? (this.regsGen[-data-1] & 0xff) : data) << 8); + this.writeByteToPhysical(addr, data); } - return data; }; /** - * writeDstWord(opCode, data) + * writeDstWord(opCode, data, fnFlags) * * Used whenever the DST operand (as described by opCode) does NOT need to be read before writing. * * @this {CPUStatePDP11} * @param {number} opCode * @param {number} data - * @return {number} + * @param {function(number)} fnFlags */ -CPUStatePDP11.prototype.writeDstWord = function(opCode, data) +CPUStatePDP11.prototype.writeDstWord = function(opCode, data, fnFlags) { var reg = this.dstReg = opCode & PDP11.OPREG.MASK; var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; - /* - * TODO: If callers are careful about masking data, then we don't need to mask it here or in bus.setWord(). - * We've eliminated the 0xffff data mask here, but bus.setWord() is still masking. - */ this.assert(data < 0 && data >= -8 || !(data & ~0xffff)); if (!mode) { - this.regsGen[reg] = (data = (data < 0? this.regsGen[-data-1] : data)); + this.regsGen[reg] = (data = data < 0? this.regsGen[-data-1] : data); + fnFlags.call(this, data); } else { var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_WORD); - this.bus.setWord(addr, (data = (data < 0? this.regsGen[-data-1] : data))); + fnFlags.call(this, (data = data < 0? this.regsGen[-data-1] : data)); + this.bus.setWord(addr, data); } - return data; }; /** diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 93bd30a65..87797af13 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -274,7 +274,6 @@ var PDP11 = { TRAP_MASK: 0x0070, TRAP_LAST: 0x0080, // set if last operation was a trap (see trapLast for the vector, and trapReason for the reason) TRAP_RED: 0x0100, // set whenever a RED trap occurs, used to catch double RED traps (time to PANIC) - NO_FLAGS: 0x0200 // set whenever the PSW is written directly, requiring all updateXXXFlags() functions to leave flags unchanged }, /* * Opcode reg (opcode bits 2-0) diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 21509130f..8636e9d02 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -1065,7 +1065,6 @@ DevicePDP11.prototype.writePSW = function(data, addr) */ var maskDisallowed = PDP11.PSW.UNUSED; this.cpu.setPSW((data & ~maskDisallowed) | (this.cpu.getPSW() & maskDisallowed)); - this.cpu.opFlags |= PDP11.OPFLAG.NO_FLAGS; }; /** diff --git a/versions/pdpjs/1.30.5/pdp11-dbg.js b/versions/pdpjs/1.30.5/pdp11-dbg.js index 04dda9114..d8d9477ad 100644 --- a/versions/pdpjs/1.30.5/pdp11-dbg.js +++ b/versions/pdpjs/1.30.5/pdp11-dbg.js @@ -32,328 +32,328 @@ http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da":62,"?":63,"@":64,tc:65,Cf:66,Ef:67,ag:68,E:69,bg:70,cg:71,dg:72,eg:73,fg:74,gg:75,hg:76,ig:77,jg:78,kg:79,lg:80,Q:81,mg:82,ng:83,og:84,pg:85,qg:86,rg:87,sg:88,tg:89,dd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ug:97,vg:98,wg:99,d:100,e:101,yg:102,zg:103,Ag:104,Bg:105,Eg:106,k:107,Fg:108,Gg:109,n:110,Hg:111,p:112,q:113,r:114,Ig:115,t:116,Kg:117,Lg:118,Mg:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Vc:127}; +for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],ea=0;ea":62,"?":63,"@":64,vc:65,Ef:66,Gf:67,cg:68,E:69,dg:70,eg:71,fg:72,gg:73,hg:74,ig:75,jg:76,kg:77,lg:78,mg:79,ng:80,Q:81,og:82,pg:83,qg:84,rg:85,sg:86,tg:87,ug:88,vg:89,fd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,wg:97,xg:98,yg:99,d:100,e:101,Ag:102,Bg:103,Cg:104,Dg:105,Gg:106,k:107,Hg:108,Ig:109,n:110,Jg:111,p:112,q:113,r:114,Kg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Xc:127}; function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function q(a){return p(a,4,!0)} -function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ra(a){return a.replace(/[&<>"']/g,function(a){return qa[a]})} -function ta(a,b){return(a+" ").slice(0,b)}function ua(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function sa(a){return a.replace(/[&<>"']/g,function(a){return qa[a]})} +function ta(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ea(a,b){var c,d={ga:null,ia:null,Sa:null,Ra:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Sa=g.load;d.Ra=g.exec;if(e=g.bytes)d.ga=e;else if(e=g.words)for(d.ga=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ga=Array(4*e.length),f=c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ta=g.load;d.Sa=g.exec;if(e=g.bytes)d.ga=e;else if(e=g.words)for(d.ga=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ga=Array(4*e.length),f=c=0;c>8&255,d.ga[f++]=e[c]>>16&255,d.ga[f++]=e[c]>>24&255;else d.ga=g;d.ia=g.symbols;d.ga.length?1==d.ga.length&&(v(d.ga[0]),d=null):(v("Empty resource: "+a),d=null)}catch(h){v("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.fb=this.id:(this.gb=this.id.substr(0,b),this.fb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,ib:!1,lc:!1,la:!1,error:!1};this.ac=null;this.C.error=!1;this.D={};this.j=null;this.oa=d||0;z.push(this)}var fb=void 0,gb={}; +function Na(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}function Pa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.gb=this.id:(this.hb=this.id.substr(0,b),this.gb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,jb:!1,nc:!1,la:!1,error:!1};this.cc=null;this.C.error=!1;this.D={};this.j=null;this.oa=d||0;z.push(this)}var fb=void 0,gb={}; if(window){fb||(fb=window.location.search.substr(1));for(var hb,ib=/\+/g,jb=/([^&=]+)=?([^&]*)/g;hb=jb.exec(fb);)gb[decodeURIComponent(hb[1].replace(ib," "))]=decodeURIComponent(hb[2].replace(ib," "))}function kb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function B(a,b){b||(b=x);a.prototype=kb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var lb=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else lb={},z=[];function mb(a,b,c){lb[a]&&b&&(lb[a][b]=c)}function nb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.f["S"+a]=[0,0,!1,!1,this.Ed,a]}B(Fb);var Gb=7;function Hb(a,b){return a.f[b]&&a.f[b][1]}k=Fb.prototype; +buffer:1073741824,halt:-2147483648};function Fb(a){x.call(this,"Panel",a,Fb,512);this.Ca=this.v=this.eb=this.Ab=this.B=this.F=0;this.I=this.J=this.G=!1;this.K=Gb;this.g={};this.f={START:[1,1,!0,!1,this.Ed],STEP:[1,1,!1,!1,this.Fd],ENABLE:[1,1,!1,!1,this.Ad],CONT:[1,1,!0,!1,this.yd],DEP:[0,0,!0,!1,this.zd],EXAM:[1,1,!0,!1,this.Bd],LOAD:[1,1,!0,!1,this.Dd],TEST:[0,0,!0,!1,this.Cd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.Gd,a]}B(Fb);var Gb=7;function Hb(a,b){return a.f[b]&&a.f[b][1]}k=Fb.prototype; k.reset=function(){this.stop()}; k.wa=function(a,b,c,d){if(this.A&&this.A.wa(a,b,c,d)||this.b&&this.b.wa(a,b,c,d)||this.j&&this.j.wa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Ib(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Jb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Ib(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Jb(a,b)}}(this,b),!0):this.parent.wa.call(this,a,b,c,d)}};k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;Kb(b,this,Lb);Mb(b,this.reset.bind(this));Nb(this);Ob(this)};k.Ia=function(a,b){b||(Pb(),this.reset());return!0};k.Ha=function(){return!0}; +b){return function(){Ib(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Jb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Ib(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Jb(a,b)}}(this,b),!0):this.parent.wa.call(this,a,b,c,d)}};k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;Kb(b,this,Lb);Mb(b,this.reset.bind(this));Nb(this);Ob(this)};k.Ja=function(a,b){b||(Pb(),this.reset());return!0};k.Ia=function(){return!0}; function Qb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Nb(a,b){for(var c in a.g)Qb(a,c,null!=b?b:a.g[c])}function Rb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Ob(a){for(var b in a.f)Rb(a,b,a.f[b][1])}function Sb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.ba()),c=8==(a.j&&a.j.ma||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} -function Ib(a,b){var c=a.f[b];Rb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.J="DEP"==b,a.K="EXAM"==b)}function Jb(a,b){var c=a.f[b];c[2]&&c[3]&&(Rb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Cd=function(a){a||this.b.C.W||(a=this.b,a.w.reset(),Tb(a),Hb(this,"ENABLE")&&this.b.ob())};k.Dd=function(){};k.yd=function(a){a||this.b.ba()}; -k.wd=function(a){if(!a&&!this.b.C.W)if(Hb(this,"ENABLE"))this.b.ob();else{if((a=this.j)&&!xb(a,!0))qb(a,!0),a.pb(0,null),qb(a,!1);else try{var b=this.b.pb(1);0a.b.jb?8:16,c=65472<=a.Ca&&a.Ca<65472+b,b=c?1:2,c=c?15:a.w.Eb;Hb(a,"STEP")||(b=-b);pc(a,a.Ca&~c|a.Ca+b&c)} -function pc(a,b){a.Ca=b&a.w.Eb;b=a.Ca;for(var c=0;22>c;c++)rc(a,"A"+c,b&1<c;c++)rc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.w=this.Ga-1;this.v=this.B/this.Ga|0;this.hb=[];this.qa=0;this.A=!1;this.F=[];this.hd=[wc,xc,yc,zc];a=new K(this);Ac(a,this.j);this.ea=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.pa;this.G=0;this.g=this.Eb;J(this)}B(uc); -var vc=8192,Dc=vc-1;function wc(a,b){var c=-1,d=this.controller,e=d.hb[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.hb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Ma(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} -function xc(a,b,c){var d=!1,e=this.controller,f=e.hb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.hb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Ma(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, -b),!0,!e.qa))}function yc(a,b){var c=-1,d=this.controller;a=d.hb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Ma(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} -function zc(a,b,c){var d=!1,e=this.controller;a=e.hb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Ma(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.qa))} -function Ec(a,b){if(b!=a.G){for(var c=0;c>>a.pa,a.f[a.K]=a.ea[a.J])}}k=uc.prototype;k.reset=function(){for(var a=0;a>>a.pa;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.H)return l.Lb+=l.H-f,l.H=f,!0;if(f>=l.H+l.Lb){n=l.size-(f-m);n>g&&(n=g);l.Lb=f-l.H+n;f=m+a.Ga;g-=n;h++;continue}}return Fc(1,f,g)}f=new K(a,f,n,a.Ga,d,e);Ac(f,a.j,l);a.ea[h++]=f;f=m+a.Ga;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Gc[d]+" at "+na(b)),!0):Fc(2,b,c)}k.bc=function(a){return this.f[(a&this.g)>>>this.pa].cc(a&this.w,a)}; -function Hc(a,b){return a.ea[(b&a.Eb)>>>a.pa]}k.ua=function(a){return this.f[(a&this.g)>>>this.pa].Ba(a&this.w,a)};function nc(a,b){a.A=!1;a.qa++;b=Hc(a,b).K(b&a.w,b);a.qa--;return b}k.Kb=function(a,b){this.f[(a&this.g)>>>this.pa].fc(a&this.w,b&255,a)};function Ic(a,b,c){a.A=!1;a.qa++;Hc(a,b).G(b&a.w,c&255,b);a.qa--}k.zb=function(a,b){this.f[(a&this.g)>>>this.pa].Yb(a&this.w,b&65535,a)};function Zb(a,b,c){a.A=!1;a.qa++;Hc(a,b).M(b&a.w,c&65535,b);a.qa--} -function Jc(a){for(var b=0,c=[],d=0;da.b.jb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],w=g[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Db=128;Qc(this.b,this.f.rc,1E3/60,!0)};k.Md=function(){return this.f.Db};k.Me=function(a){this.f.Db=a&192;this.f.Db&64||bd(this.b,this.f.Cb)};k.Od=function(){return cd(this.b)}; -k.Oe=function(a){dd(this.b,a&-129|this.b.Ea&128)};k.Pd=function(){return ed(this.b)};k.Qd=function(){return fd(this.b)};k.Rd=function(){return this.b.Wa};k.Pe=function(a){gd(this.b,a)};k.ye=function(a){a=a>>1&63;var b=this.b.Wb[a>>1];return a&1?b>>16:b&65535};k.yf=function(a,b){b=b>>1&63;var c=b>>1;this.b.Wb[c]=b&1?this.b.Wb[c]&65535|(a&63)<<16:this.b.Wb[c]&-65536|a&65534};k.re=function(a){return this.b.R[1][a>>1&7]};k.rf=function(a,b){this.b.R[1][b>>1&7]=a&65295}; -k.pe=function(a){return this.b.R[1][(a>>1&7)+8]};k.pf=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295};k.qe=function(a){return this.b.ja[1][a>>1&7]};k.qf=function(a,b){b=b>>1&7;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.oe=function(a){return this.b.ja[1][(a>>1&7)+8]};k.nf=function(a,b){b=(b>>1&7)+8;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.Ld=function(a){return this.b.R[0][a>>1&7]};k.Le=function(a,b){this.b.R[0][b>>1&7]=a&65295};k.Jd=function(a){return this.b.R[0][(a>>1&7)+8]}; -k.Je=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295};k.Kd=function(a){return this.b.ja[0][a>>1&7]};k.Ke=function(a,b){b=b>>1&7;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.Id=function(a){return this.b.ja[0][(a>>1&7)+8]};k.Ie=function(a,b){b=(b>>1&7)+8;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.xe=function(a){return this.b.R[3][a>>1&7]};k.xf=function(a,b){this.b.R[3][b>>1&7]=a&65295};k.ve=function(a){return this.b.R[3][(a>>1&7)+8]};k.vf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295}; -k.we=function(a){return this.b.ja[3][a>>1&7]};k.wf=function(a,b){b=b>>1&7;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.ue=function(a){return this.b.ja[3][(a>>1&7)+8]};k.uf=function(a,b){b=(b>>1&7)+8;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.Hb=function(a){a&=7;return this.b.O&2048?this.b.eb[a]:this.b.u[a]};k.Mb=function(a,b){b&=7;this.b.O&2048?this.b.eb[b]=a:this.b.u[b]=a};k.Wd=function(){return this.b.O&49152?this.b.Oa[0]:this.b.u[6]};k.Ue=function(a){this.b.O&49152?this.b.Oa[0]=a:this.b.u[6]=a}; -k.Zd=function(){return this.b.u[7]};k.Xe=function(a){this.b.u[7]=a};k.Ib=function(a){a&=7;return this.b.O&2048?this.b.u[a]:this.b.eb[a]};k.Nb=function(a,b){b&=7;this.b.O&2048?this.b.u[b]=a:this.b.eb[b]=a};k.Xd=function(){return 1==(this.b.O&49152)>>14?this.b.u[6]:this.b.Oa[1]};k.Ve=function(a){1==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Oa[1]=a};k.Yd=function(){return 3==(this.b.O&49152)>>14?this.b.u[6]:this.b.Oa[3]};k.We=function(a){3==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Oa[3]=a}; -k.Hd=function(a){return this.b.Nc[a-65504>>1]};k.He=function(a,b){this.b.Nc[b-65504>>1]=a};k.Kc=function(a){return 65520==a?(Kc(this.w)>>6)-1:0};k.Qc=function(){};k.te=function(){return 1};k.tf=function(){};k.Gd=function(){return this.b.ra};k.Ge=function(){this.b.ra=0};k.Nd=function(){return this.b.Mc};k.Ne=function(a,b){b&1||(a&=255);this.b.Mc=a};k.Sd=function(a,b){return b?0:this.b.Jb};k.Qe=function(a){hd(this.b,a)};k.se=function(a,b){return b?0:this.b.mb&65280};k.sf=function(a){this.b.mb=a|255}; -k.Vd=function(){return id(this.b)};k.Te=function(a){jd(this.b,a&-1793|id(this.b)&1792);this.b.I|=512};k.Pc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; -var O={},Sc=(O[61568]=[null,null,M.prototype.ye,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.re,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.pe,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.qe,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.oe,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Ld,M.prototype.Le,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Jd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= -[null,null,M.prototype.Kd,M.prototype.Ke,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Id,M.prototype.Ie,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Rd,M.prototype.Pe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Md,M.prototype.Me,"LKS"],O[65402]=[null,null,M.prototype.Od,M.prototype.Oe,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Pd,M.prototype.Pc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Qd,M.prototype.Pc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.xe,M.prototype.xf, -"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.ve,M.prototype.vf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.we,M.prototype.wf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.ue,M.prototype.uf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Hb,M.prototype.Mb,"R0SET0"],O[65473]=[null,null,M.prototype.Hb,M.prototype.Mb,"R1SET0"],O[65474]=[null,null,M.prototype.Hb,M.prototype.Mb,"R2SET0"],O[65475]=[null,null,M.prototype.Hb,M.prototype.Mb,"R3SET0"],O[65476]=[null,null,M.prototype.Hb, -M.prototype.Mb,"R4SET0"],O[65477]=[null,null,M.prototype.Hb,M.prototype.Mb,"R5SET0"],O[65478]=[null,null,M.prototype.Wd,M.prototype.Ue,"R6KERNEL"],O[65479]=[null,null,M.prototype.Zd,M.prototype.Xe,"R7KERNEL"],O[65480]=[null,null,M.prototype.Ib,M.prototype.Nb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Ib,M.prototype.Nb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Ib,M.prototype.Nb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Ib,M.prototype.Nb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Ib, -M.prototype.Nb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Ib,M.prototype.Nb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Xd,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Yd,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Hd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Kc,M.prototype.Qc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Kc,M.prototype.Qc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.te,M.prototype.tf,"SYSID",1,1170],O[65526]= -[null,null,M.prototype.Gd,M.prototype.Ge,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Nd,M.prototype.Ne,"MB",1,1170],O[65530]=[null,null,M.prototype.Sd,M.prototype.Qe,"PIR"],O[65532]=[null,null,M.prototype.se,M.prototype.sf,"SL"],O[65534]=[null,null,M.prototype.Vd,M.prototype.Te,"PSW"],O); -bb(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),rd(this,nd?sd:td);else{a=this.b=Array(this.size>> +function Ib(a,b){var c=a.f[b];Rb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.J="EXAM"==b)}function Jb(a,b){var c=a.f[b];c[2]&&c[3]&&(Rb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ed=function(a){a||this.b.C.X||(a=this.b,a.w.reset(),Tb(a),Hb(this,"ENABLE")&&this.b.pb())};k.Fd=function(){};k.Ad=function(a){a||this.b.ba()}; +k.yd=function(a){if(!a&&!this.b.C.X)if(Hb(this,"ENABLE"))this.b.pb();else{if((a=this.j)&&!xb(a,!0))wb(a,!0),a.qb(0,null),wb(a,!1);else try{var b=this.b.qb(1);0a.b.kb?8:16,c=65472<=a.Ca&&a.Ca<65472+b,b=c?1:2,c=c?15:a.w.Gb;Hb(a,"STEP")||(b=-b);pc(a,a.Ca&~c|a.Ca+b&c)} +function pc(a,b){a.Ca=b&a.w.Gb;b=a.Ca;for(var c=0;22>c;c++)rc(a,"A"+c,b&1<c;c++)rc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.w=this.Ha-1;this.v=this.B/this.Ha|0;this.ib=[];this.qa=0;this.A=!1;this.F=[];this.kd=[wc,xc,yc,zc];a=new K(this);Ac(a,this.j);this.ea=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.pa;this.G=0;this.g=this.Gb;J(this)}B(uc); +var vc=8192,Dc=vc-1;function wc(a,b){var c=-1,d=this.controller,e=d.ib[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.ib[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} +function xc(a,b,c){var d=!1,e=this.controller,f=e.ib[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.ib[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, +b),!0,!e.qa))}function yc(a,b){var c=-1,d=this.controller;a=d.ib[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} +function zc(a,b,c){var d=!1,e=this.controller;a=e.ib[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.qa))} +function Ec(a,b){if(b!=a.G){for(var c=0;c>>a.pa,a.f[a.J]=a.ea[a.I])}}k=uc.prototype;k.reset=function(){for(var a=0;a>>a.pa;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.H)return l.Nb+=l.H-f,l.H=f,!0;if(f>=l.H+l.Nb){n=l.size-(f-m);n>g&&(n=g);l.Nb=f-l.H+n;f=m+a.Ha;g-=n;h++;continue}}return Fc(1,f,g)}f=new K(a,f,n,a.Ha,d,e);Ac(f,a.j,l);a.ea[h++]=f;f=m+a.Ha;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Gc[d]+" at "+na(b)),!0):Fc(2,b,c)}k.dc=function(a){return this.f[(a&this.g)>>>this.pa].ec(a&this.w,a)}; +k.ua=function(a){return this.f[(a&this.g)>>>this.pa].Ba(a&this.w,a)};k.Mb=function(a,b){this.f[(a&this.g)>>>this.pa].hc(a&this.w,b,a)};k.Bb=function(a,b){this.f[(a&this.g)>>>this.pa].$b(a&this.w,b,a)};function Hc(a,b){return a.ea[(b&a.Gb)>>>a.pa]}function nc(a,b){a.A=!1;a.qa++;b=Hc(a,b).J(b&a.w,b);a.qa--;return b}function Ic(a,b,c){a.A=!1;a.qa++;Hc(a,b).G(b&a.w,c&255,b);a.qa--}function lc(a,b,c){a.A=!1;a.qa++;Hc(a,b).M(b&a.w,c&65535,b);a.qa--} +function Jc(a){for(var b=0,c=[],d=0;da.b.kb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],w=g[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Fb=128;Qc(this.b,this.f.tc,1E3/60,!0)};k.Od=function(){return this.f.Fb};k.Oe=function(a){this.f.Fb=a&192;this.f.Fb&64||bd(this.b,this.f.Eb)};k.Qd=function(){return cd(this.b)}; +k.Qe=function(a){dd(this.b,a&-129|this.b.Ea&128)};k.Rd=function(){return ed(this.b)};k.Sd=function(){return fd(this.b)};k.Td=function(){return this.b.Xa};k.Re=function(a){gd(this.b,a)};k.Ae=function(a){a=a>>1&63;var b=this.b.Yb[a>>1];return a&1?b>>16:b&65535};k.Af=function(a,b){b=b>>1&63;var c=b>>1;this.b.Yb[c]=b&1?this.b.Yb[c]&65535|(a&63)<<16:this.b.Yb[c]&-65536|a&65534};k.te=function(a){return this.b.R[1][a>>1&7]};k.tf=function(a,b){this.b.R[1][b>>1&7]=a&65295}; +k.re=function(a){return this.b.R[1][(a>>1&7)+8]};k.rf=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295};k.se=function(a){return this.b.ja[1][a>>1&7]};k.sf=function(a,b){b=b>>1&7;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.qe=function(a){return this.b.ja[1][(a>>1&7)+8]};k.qf=function(a,b){b=(b>>1&7)+8;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.Nd=function(a){return this.b.R[0][a>>1&7]};k.Ne=function(a,b){this.b.R[0][b>>1&7]=a&65295};k.Ld=function(a){return this.b.R[0][(a>>1&7)+8]}; +k.Le=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295};k.Md=function(a){return this.b.ja[0][a>>1&7]};k.Me=function(a,b){b=b>>1&7;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.Kd=function(a){return this.b.ja[0][(a>>1&7)+8]};k.Ke=function(a,b){b=(b>>1&7)+8;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.ze=function(a){return this.b.R[3][a>>1&7]};k.zf=function(a,b){this.b.R[3][b>>1&7]=a&65295};k.xe=function(a){return this.b.R[3][(a>>1&7)+8]};k.xf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295}; +k.ye=function(a){return this.b.ja[3][a>>1&7]};k.yf=function(a,b){b=b>>1&7;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.we=function(a){return this.b.ja[3][(a>>1&7)+8]};k.wf=function(a,b){b=(b>>1&7)+8;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.Jb=function(a){a&=7;return this.b.O&2048?this.b.fb[a]:this.b.u[a]};k.Ob=function(a,b){b&=7;this.b.O&2048?this.b.fb[b]=a:this.b.u[b]=a};k.Yd=function(){return this.b.O&49152?this.b.Pa[0]:this.b.u[6]};k.We=function(a){this.b.O&49152?this.b.Pa[0]=a:this.b.u[6]=a}; +k.ae=function(){return this.b.u[7]};k.Ze=function(a){this.b.u[7]=a};k.Kb=function(a){a&=7;return this.b.O&2048?this.b.u[a]:this.b.fb[a]};k.Pb=function(a,b){b&=7;this.b.O&2048?this.b.u[b]=a:this.b.fb[b]=a};k.Zd=function(){return 1==(this.b.O&49152)>>14?this.b.u[6]:this.b.Pa[1]};k.Xe=function(a){1==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Pa[1]=a};k.$d=function(){return 3==(this.b.O&49152)>>14?this.b.u[6]:this.b.Pa[3]};k.Ye=function(a){3==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Pa[3]=a}; +k.Jd=function(a){return this.b.Pc[a-65504>>1]};k.Je=function(a,b){this.b.Pc[b-65504>>1]=a};k.Mc=function(a){return 65520==a?(Kc(this.w)>>6)-1:0};k.Sc=function(){};k.ve=function(){return 1};k.vf=function(){};k.Id=function(){return this.b.ra};k.Ie=function(){this.b.ra=0};k.Pd=function(){return this.b.Oc};k.Pe=function(a,b){b&1||(a&=255);this.b.Oc=a};k.Ud=function(a,b){return b?0:this.b.Lb};k.Se=function(a){hd(this.b,a)};k.ue=function(a,b){return b?0:this.b.nb&65280};k.uf=function(a){this.b.nb=a|255}; +k.Xd=function(){return id(this.b)};k.Ve=function(a){jd(this.b,a&-1793|id(this.b)&1792)};k.Rc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; +var O={},$c=(O[61568]=[null,null,M.prototype.Ae,M.prototype.Af,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.te,M.prototype.tf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.re,M.prototype.rf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.se,M.prototype.sf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.qe,M.prototype.qf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Nd,M.prototype.Ne,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Ld,M.prototype.Le,"KDPDR",8,1145,64],O[62688]= +[null,null,M.prototype.Md,M.prototype.Me,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Kd,M.prototype.Ke,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Td,M.prototype.Re,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Od,M.prototype.Oe,"LKS"],O[65402]=[null,null,M.prototype.Qd,M.prototype.Qe,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Rd,M.prototype.Rc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Sd,M.prototype.Rc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.ze,M.prototype.zf, +"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.xe,M.prototype.xf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ye,M.prototype.yf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.we,M.prototype.wf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Jb,M.prototype.Ob,"R0SET0"],O[65473]=[null,null,M.prototype.Jb,M.prototype.Ob,"R1SET0"],O[65474]=[null,null,M.prototype.Jb,M.prototype.Ob,"R2SET0"],O[65475]=[null,null,M.prototype.Jb,M.prototype.Ob,"R3SET0"],O[65476]=[null,null,M.prototype.Jb, +M.prototype.Ob,"R4SET0"],O[65477]=[null,null,M.prototype.Jb,M.prototype.Ob,"R5SET0"],O[65478]=[null,null,M.prototype.Yd,M.prototype.We,"R6KERNEL"],O[65479]=[null,null,M.prototype.ae,M.prototype.Ze,"R7KERNEL"],O[65480]=[null,null,M.prototype.Kb,M.prototype.Pb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Kb,M.prototype.Pb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Kb,M.prototype.Pb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Kb,M.prototype.Pb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Kb, +M.prototype.Pb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Kb,M.prototype.Pb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Zd,M.prototype.Xe,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.$d,M.prototype.Ye,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Jd,M.prototype.Je,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Mc,M.prototype.Sc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Mc,M.prototype.Sc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.ve,M.prototype.vf,"SYSID",1,1170],O[65526]= +[null,null,M.prototype.Id,M.prototype.Ie,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Pd,M.prototype.Pe,"MB",1,1170],O[65530]=[null,null,M.prototype.Ud,M.prototype.Se,"PIR"],O[65532]=[null,null,M.prototype.ue,M.prototype.uf,"SL"],O[65534]=[null,null,M.prototype.Xd,M.prototype.Ve,"PSW"],O); +bb(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),rd(this,nd?sd:td);else{a=this.b=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ya:function(a,b){a&1&&this.w.Ma(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ -1]&255)<<8},Pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.ab=!0},gb:function(a,b){if(this.j&&null!=this.H){var c=this.j;yd(c,this.H+a,1,c.M)&&c.ba(!0)}return this.J(a,b)},ma:function(a,b){if(this.j&&null!=this.H){var c=this.j;yd(c,this.H+a,2,c.M)&&c.ba(!0)}return this.K(a,b)},za:function(a, -b,c){if(this.j&&null!=this.H){var d=this.j;yd(d,this.H+a,1,d.F)&&d.ba(!0)}this.f?this.v(a,b,c):this.G(a,b,c)},Xa:function(a,b,c){if(this.j&&null!=this.H){var d=this.j;yd(d,this.H+a,2,d.F)&&d.ba(!0)}this.f?this.v(a,b,c):this.M(a,b,c)},fb:function(a){return this.D[a]},Y:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},da:function(a,b){a&1&&this.w.Ma(b,64,2);return this.F.getUint16(a,!0)},na:function(a,b){a&1&&this.w.Ma(b,64,2);a= -this.P[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ta:function(a,b){this.D[a]=b;this.ab=!0},Ka:function(a,b,c){this.D[a]=b;this.ab=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Qa:function(a,b,c){a&1&&this.w.Ma(c,64,4);this.F.setUint16(a,b,!0);this.ab=!0},Ya:function(a,b,c){a&1&&this.w.Ma(c,64,4);this.P[a>>1]=b;this.ab=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, -b)+")",!0)}};function Ac(a,b,c){a.j=b;a.A=a.g=0;c&&((a.A=c.A)&&xd(a,wd,!1),(a.g=c.g)&&vd(a,wd,!1))}function zd(a,b){b?--a.g||(a.fc=a.f?a.v:a.G,a.Yb=a.f?a.L:a.M):--a.A||(a.cc=a.J,a.Ba=a.K)}function vd(a,b,c){c&&a.g||(a.fc=!a.f&&b[1]||a.v,a.Yb=!a.f&&b[3]||a.L);if(c||void 0===c)a.G=b[1]||a.v,a.M=b[3]||a.L}function xd(a,b,c){c&&a.A||(a.cc=b[0]||a.S,a.Ba=b[2]||a.T);if(c||void 0===c)a.J=b[0]||a.S,a.K=b[2]||a.T}function rd(a,b){b||(b=Ad);xd(a,b,void 0);vd(a,b,void 0)} -var Ad=[],ud=[K.prototype.ca,K.prototype.Pa,K.prototype.ya,K.prototype.Za],wd=[K.prototype.gb,K.prototype.za,K.prototype.ma,K.prototype.Xa];if(Bb)var td=[K.prototype.fb,K.prototype.ta,K.prototype.da,K.prototype.Qa],sd=[K.prototype.Y,K.prototype.Ka,K.prototype.na,K.prototype.Ya]; -function Bd(a,b){x.call(this,"CPU",a,Bd,1);b=a.cycles||b;var c=a.multiplier||1;this.Ob=0;this.qb=b;this.kb=c;this.gc=Math.round(this.qb/1E4)/100;this.xb=this.gc*this.kb;this.C.W=!1;this.C.ec=!1;this.C.Ab=a.autoStart;this.C.Bb=!1;this.Tb=this.ya=0;this.Ub=a.csStart;this.Fb=a.csInterval;this.Gb=a.csStop;this.M=[];this.Bc=this.De.bind(this);J(this)}B(Bd);var Cd=["power","reset"];k=Bd.prototype; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.j=d;this.v=a.v;for(b=0;b=a.ya&&(a.ya+=a.Fb,c=!0);0<=a.Gb&&a.Gb<=Id(a)&&(a.Fb=a.Gb=-1,Fd(a),a.ba(),c=!0);c&&a.i(Id(a)+" cycles: checksum="+p(a.Tb))}} -k.wa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.la)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;ca.na/a.xb?b=1:d=!0;a.kb=b;b=a.gc*a.kb;if(a.xb!=b){a.xb=b;b=a.xb.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.A&&a.A.nb()}Vb(a,a.T);a.T=0;a.S=Ba();a.Y=0;Kd(a);return d}function Oc(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function Qc(a,b,c,d){0<=b&&ba.M[b][0])&&(c=a.qb*a.kb/1E3*c|0,a.C.W&&(c+=Ld(a)),a.M[b][0]=c)} -function Md(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Ub(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Ld(a,b){var c=a.ca-=a.b;a.b=a.L=0;b&&(a.ca=0);return c} -k.De=function(){if(this.C.W){this.hc>=this.qb&&Kd(this,!0);this.Qa=0;this.Za=Ba();if(this.Y){var a=this.Za-this.Y;a>this.zc&&(this.S+=a,this.S>this.Za&&(this.S=this.Za))}try{do{var b=Md(this,this.C.Bb?1:this.rb);try{this.pb(b)}catch(e){if("number"!=typeof e)throw e;}b=Ld(this,!0);this.Qa+=b;this.T+=b;Wb(this,b);Ub(this,b);this.ta-=b;if(0>=this.ta){this.ta+=this.rb;15<=++this.Ac&&(this.xa(),this.Ac=0);break}}while(this.C.W)}catch(e){this.ba();this.A&&this.A.stop(Ba(),Id(this));Ab(this,e.stack||e.message); -return}if(this.C.W){a=setTimeout;b=this.Bc;this.Y=Ba();var c=this.zc;this.Qa&&(c=Math.round(c*this.Qa/this.rb));var c=c-(this.Y-this.Za),d=this.Y-this.S;d&&(this.na=Math.round(this.T/(10*d))/100,864E5<=d&&(this.da=0,Jd(this)));if(0>c||this.nac&&(this.S-=c),c=0;this.hc+=this.Qa;this.Y+=c;a(b,c)}}}; -k.ob=function(a){if(zb(this))return!1;if(this.C.W)return this.i(this.toString()+" busy"),!1;Jd(this);this.C.W=!0;this.C.ec=!0;var b=this.D.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.nb(!0),this.A.start(this.S,Id(this)));setTimeout(this.Bc,0);return!0};k.pb=function(){return 0};k.ba=function(a){var b=!1;if(this.C.W){Ld(this);Vb(this,this.T);this.T=0;this.C.W=!1;if(b=this.D.run)b.textContent="Run";this.A&&this.A.stop(Ba(),Id(this));b=!0}this.C.complete=a;return b}; -function Nd(a){this.jb=+a.model||1170;this.wc=a.addrReset||0;Bd.call(this,a,6666667);this.sb=0;this.yc=255;1120==this.jb?(this.decode=Od.bind(this),this.ma=this.pd,this.sb=8,this.yc=-1):(this.decode=Pd.bind(this),this.ma=this.qd);Qd(this);this.K=0;this.J=null;this.Pb=[];this.C.complete=!1}B(Nd,Bd);k=Nd.prototype;k.uc=function(){for(var a=192,b=0;bc.Xb&&(c.Xb=a,a+=4)}}; -k.reset=function(){this.status("model "+this.jb);this.C.W&&this.ba();Qd(this);Ed(this);this.C.error=!1;this.parent.reset.call(this)}; -function Qd(a){a.U=65536;a.V=32768;a.Z=65535;a.X=32768;a.O=15;a.u=[0,0,0,0,0,0,0,a.wc,-1,-2,-3,-4,-5,-6,-7,-8];a.eb=[0,0,0,0,0,0];a.Oa=[0,0,0,0];a.B=0;a.Ya=0;a.Rc=[4,2,0,1];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ja=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0]];a.Wb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Nc=[0,0,0,0,0,0,0,0];a.Mc=0;a.I=0;a.F=a.G=0;a.g=a.f=a.Rb=0;a.za=-1;Tb(a)}function Tb(a){a.Ea=0;a.ic=0;a.jc=0;a.Wa=0;a.ra=0;a.Jb=0;a.mb=255;a.Ka=0;a.Xa=0;a.Pa=262143;a.Sb=0;a.va=0;a.J=null;a.w&&(Rd(a),a.ed=Kc(a.w))}function Rd(a){a.Ka?(a.P=65536,a.Qb=a.Wa&16?4186112:253952,a.aa=a.td,a.Ba=a.ze,a.Yb=a.zf,Ec(a.w,a.Wa&16?22:18)):(a.P=0,a.Qb=57344,a.aa=a.sd,a.Ba=a.Lc,a.Yb=a.sc,Ec(a.w,16))} -function cd(a){var b=a.Ea;b&57344||(b=b&-3199|a.Xa<<5|a.Ya<<1);return b}function dd(a,b){b&=-3073;if(a.Ea!=b){b&57344&&!(a.Ea&57344)&&(a.ic=a.va>>16&65535,a.jc=a.va&65535);a.Ea=b;a.Xa=b>>5&3;a.Ya=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ka!=c&&(a.Ka=c,Rd(a))}}function ed(a){a.Ea&57344||(a.ic=a.va>>16&65535);a=a.ic;a&65280&&(a=(a<<8|a>>8)&65535);return a}function fd(a){a.Ea&57344||(a.jc=a.va&65535);return a.jc} -function gd(a,b){1170>a.jb&&(b&=-49);a.Wa!=b&&(a.Wa=b,a.Pa=b&16?4194303:262143,Rd(a))}k.Gc=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.da,this.kb]);a.set(2,Jc(this.w));return a.data()}; -k.restore=function(a){var b=a[1];this.da=b[1];Jd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.O>>14&3;a.B!=c&&(a.Oa[c]=a.u[6],a.u[6]=a.Oa[a.B]);a.O=b;a.I&=-3;a.I|=a.J?2:1}function hd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.I|=1}a.Jb=b}function U(a,b){a.I&512||(a.X=a.Z=b,a.V=0)}function $d(a,b,c){a.I&512||(a.X=a.Z=a.U=b,a.V=c||0)} -function ue(a,b,c,d){a.I&512||(a.X=a.Z=a.U=b,a.V=(c^b)&(d^b))}function ve(a,b){a.I&512||(a.X=a.Z=a.U=b,a.V=a.X^a.U>>1)}function we(a,b,c,d){a.I&512||(a.X=a.Z=a.U=b,a.V=(c^d)&(d^b))} -k.sa=function(a,b,c){if(!this.K){0>this.za?this.za=id(this):this.B||(c=-4);-4==c&&(this.I&256&&(c=-1),this.I|=256,this.ra|=4,this.u[6]=a=4);if(-1!=c){this.va=a|4143316992;this.B=0;var d=this.Ba(a|this.P),e=this.Ba(a+2&65535|this.P);jd(this,e&-12289|this.za>>2&12288);xe(this,this.za);xe(this,this.u[7]);T(this,d)}this.b-=5;this.I&=~(b|19);this.I|=129;this.za=-1;this.od=a;this.md=c;-1==c&&this.ba();if(-4<=c)throw a;}}; -function ye(a){var b=ze(a),c=ze(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);T(a,b);jd(a,c);a.I&=-17}k.Na=function(a){var b=a>>13&31;31>b&&(a=this.Wa&32?this.Wb[b]+(a&8190)&4194302:a&-3932161);return a}; -function mc(a,b,c){var d,e,f;if(!(c&a.Ka))return f=b&65535,57344<=f&&(f|=a.Qb),f;d=b>>13;a.Wa&a.Rc[a.B]||(d&=7);e=a.R[a.B][d];f=(a.ja[a.B][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=a.Na(f));if(a.K)return f;f>=a.ed&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& -8128)&&(g|=16384));a.R[a.B][d]=e;if(f!=(4194170&a.Pa)||a.B)a.Xa=a.B,a.Ya=d;g&&(g&57344&&(0<=a.za&&(g|=128),a.Ea&57344||(g|=a.Ea&4096|a.Xa<<5|a.Ya<<1,dd(a,a.Ea&-61695|g&61694)),a.sa(168,64,-2)),a.Ea&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Ea|=4096,a.Ea&512&&(a.I|=64)));return f}function Ae(a,b){return a.w.bc(b)}function ze(a){var b=a.Ba(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b} -function xe(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.va=a.va&65535|(a.va&-65536)<<8|16121856;a.I&256||a.ma(4,-2,c);a.Yb(c,b)} -function Be(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.sa(4,0,-3),0;case 1:return 6==c&&a.ma(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.ma(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Ba(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.ma(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Ba(e)|g;a.b-=8;break;case 6:return e=a.Ba(Xd(a,2)),e=e+a.u[c]&65535,6==c&&a.ma(d, -0,e),a.b-=6,e|g;case 7:return e=a.Ba(Xd(a,2)),e=e+a.u[c]&65535,e=a.Ba(e|a.P),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.va=a.va&65535|(a.va&-65536)<<8|(f<<3&248|c)<<16;return e}k.pd=function(a,b,c){!this.B&&0>=b&&c<=this.mb&&(this.I|=32)};k.qd=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.mb&&(c<=this.mb-32?this.sa(4,0,-4):(this.ra|=8,this.I|=32)))};function oc(a,b){a.K++;b=a.Lc(mc(a,b,2));a.K--;return b}k.sd=function(a,b,c){a=Be(this,a,b,c);3932160<=a&&(a=this.Na(a));return a}; -k.td=function(a,b,c){return mc(this,Be(this,a,b,c),c)};k.Lc=function(a){3932160<=a&&(a=this.Na(a));return this.w.ua(this.Sb=a)};k.ze=function(a){return this.w.ua(this.Sb=mc(this,a,2))};k.sc=function(a,b){3932160<=a&&(a=this.Na(a));this.w.zb(this.Sb=a,b&65535)};k.zf=function(a,b){this.w.zb(this.Sb=mc(this,a,4),b)}; -function Ce(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Be(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.B=a.O>>12&3,c=a.Ba(d|c&a.P),a.B=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.Oa[a.O>>12&3];return c}function De(a,b,c,d){a.va=a.va&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Be(a,b,e,4),c&65536||(e&=65535),a.B=a.O>>12&3,e=mc(a,e|c&65536,4),a.B=a.O>>14&3,a.w.zb(e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.Oa[a.O>>12&3]=d} -function Ee(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?Ae(a,a.aa(b,c,3)):a.u[c+a.sb]&a.yc}function Fe(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?a.w.ua(a.aa(b,c,2)):a.u[c+a.sb]}function Ge(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Be(a,b,c,8)}function He(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Ae(a,a.aa(b,c,3)):a.u[c]&255}function Ie(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ua(a.aa(b,c,2)):a.u[c]} -function Je(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Rb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,Ae(a,e)),e&1&&a.b--,a.w.Kb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.zb(e,d.call(a,0>c?a.u[-c-1]:c,a.w.ua(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} -function Ke(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.w.Kb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function Le(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.w.zb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.pb=function(a){this.C.complete=!0;var b=this.j?Me(this.j)?1:this.C.ec?-1:0:0,c=a?this.C.ec?0:1:-1;this.C.ec=!1;this.ca=this.b=a;do{if(b){if(Ne(this.j,this.u[7],c)){this.ba();break}c||c++;b++}if(this.I){if(a=this.I&11)if(a=!1,this.I&2){var d=160,e=(this.Jb&224)>>5,f=this.J&&this.J.lb>e?this.J:null;f&&(d=f.Xb,e=f.lb);e>(this.O&224)>>5?(this.I&8&&(Xd(this,2),this.I&=-9),this.sa(d,0,-10),e=!0):e=!1;e&&(f&&Yd(this,f),a=!0);this.J||this.Jb||(this.I&=-3)}else this.I&1&&this.I++;if(a){if(b&&Ne(this.j,this.u[7], -c)){this.ba();break}if(0>c)break}if(this.I&112&&Zd(this)){if(b&&Ne(this.j,this.u[7],c)){this.ba();break}if(0>c)break}}this.I=this.I&15|this.O&16;this.decode(Wd(this))}while(0>1|b<<16;ve(this,a);return a&65535}function Te(a,b){a=b&128|b>>1|b<<8;ve(this,a<<8);return a&255}function Ue(a,b){a=b&~a;U(this,a);return a}function Ve(a,b){a=b&~a;U(this,a<<8);return a}function We(a,b){a|=b;U(this,a);return a}function Xe(a,b){a|=b;U(this,a<<8);return a}function Ye(a,b){a=~b|65536;$d(this,a);return a&65535} -function Ze(a,b){a=~b|256;$d(this,a<<8);return a&255}function $e(a,b){a=b-a;this.I&512||(this.X=this.Z=a,this.V=b&(b^a));return a&65535}function af(a,b){a=b-a;var c=a<<8;b<<=8;this.I&512||(this.X=this.Z=c,this.V=b&(b^c));return a&255}function bf(a,b){a=b+a;this.I&512||(this.X=this.Z=a,this.V=a&(b^a));return a&65535}function cf(a,b){a=b+a;var c=a<<8;this.I&512||(this.X=this.Z=c,this.V=c&(b<<8^c));return a&255}function df(a,b){a=-b;$d(this,a,a&b&32768);return a&65535} -function ef(a,b){a=-b;$d(this,a<<8,(a&b&128)<<8);return a&255}function ff(a,b){a=b<<1|this.U>>16&1;ve(this,a);return a&65535}function gf(a,b){a=b<<1|this.U>>16&1;ve(this,a<<8);return a&255}function hf(a,b){a=(this.U&65536|b)>>1|b<<16;ve(this,a);return a&65535}function jf(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;ve(this,a<<8);return a&255}function kf(a,b){var c=b-a;we(this,c,a,b);return c&65535}function lf(a,b){var c=b-a;we(this,c<<8,a<<8,b<<8);return c&255} -function mf(a,b){this.I&512||(this.X=this.Z=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function nf(a,b){a^=b;U(this,a);return a&65535}function of(a){V(this,a,Fe(this,a),Oe);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function pf(a){var b=Ie(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.X=this.Z=c;this.b-=(this.g?6:7)+b} -function qf(a){var b=Ie(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.Z=d>>16|d;this.b-=(this.g?6:7)+b}function rf(a){W(this,a,!Sd(this))}function sf(a){W(this,a,Sd(this))} -function tf(a){V(this,a,Fe(this,a),Ue);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function uf(a){Je(this,a,Ee(this,a),Ve);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function vf(a){V(this,a,Fe(this,a),We);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function wf(a){Je(this,a,Ee(this,a),Xe);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function xf(a){var b=Fe(this,a);a=Ie(this,a);U(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function yf(a){var b=Ee(this,a);a=He(this,a);U(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function zf(a){W(this,a,Ud(this))}function Af(a){W(this,a,!Vd(this)==!Td(this))}function Bf(a){W(this,a,!Ud(this)&&!Vd(this)==!Td(this))}function Cf(a){W(this,a,!Sd(this)&&!Ud(this))} -function Df(a){W(this,a,Ud(this)||!Vd(this)!=!Td(this))}function Ef(a){W(this,a,Sd(this)||Ud(this))}function Ff(a){W(this,a,!Vd(this)!=!Td(this))}function Gf(a){W(this,a,Vd(this))}function Hf(a){W(this,a,!Ud(this))}function If(a){W(this,a,!Vd(this))}function Jf(){this.sa(12,0,-9)}function Kf(a){W(this,a,!0)}function Lf(a){W(this,a,!Td(this))}function Mf(a){W(this,a,Td(this))}function Nf(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.Z=1);a&8&&(this.X=0);this.b-=5} -function Of(a){var b=Fe(this,a);a=Ie(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;we(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Pf(a){var b=Ee(this,a);a=He(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);we(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} -function Qf(a){var b=Ie(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Z=d>>16|d,this.X=d>>16):(this.V=32768,this.Z=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Z=this.X=0,this.V=32768,this.U=65536,this.b-=7}function Rf(){this.sa(24,0,-9);this.b-=20} -function Sf(){this.O&49152?(this.ra|=128,this.sa(4,0,-8)):(this.v&&1120==this.jb&&this.v.setData(this.u[0],!0),this.j?Tf(this.j):this.ba());this.b-=7}function Uf(){this.sa(16,0,-9);this.b-=20}var Vf=[0,7,7,10,7,11,9,13];function Wf(a){this.L=this.b;T(this,Ge(this,a));this.b=this.L-Vf[this.g]}var Xf=[0,14,14,17,14,18,16,20];function Yf(a){this.L=this.b;var b=Ge(this,a);a=a>>6&7;xe(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.L-Xf[this.g]} -var Zf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function $f(a){var b=Fe(this,a);this.L=this.b;U(this,Le(this,a,b));this.b=this.L-Zf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function ag(a){var b=Ee(this,a);U(this,Ke(this,a,b,65535)<<8);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var bg=[7,13,13,17,14,18,17,21]; -function cg(a){var b=Ie(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.I&512||(this.X=b>>16,this.Z=this.X|b,this.V=0,this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function jg(a){V(this,a,Fe(this,a),kf);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function kg(a){V(this,a,0,mf);this.b-=this.g?9:3+(7==this.f?2:0)}function lg(){this.sa(28,0,-9)} -function mg(){this.v&&(this.v.qc(this.u[7],!0),this.v.setData(this.u[0],!0));this.I|=8;Xd(this,-2);this.b-=3}function ng(a){V(this,a,this.u[(a>>6&7)+this.sb],nf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Tf(b)):b=!1;b||this.sa(8,0,-9)}function Od(a){og[a>>12].call(this,a)}function pg(a){qg[a>>6&3].call(this,a)}function rg(a){sg[a>>6&3].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)} -function vg(a){wg[a&15].call(this,a)}function xg(a){yg[a&15].call(this,a)}function zg(a){Ag[a>>6&3].call(this,a)}function Bg(a){Cg[a>>6&3].call(this,a)}function Dg(a){Eg[a>>6&3].call(this,a)} -var og=[function(a){Fg[a>>8&15].call(this,a)},$f,Of,xf,tf,vf,of,X,function(a){Gg[a>>8&15].call(this,a)},ag,Pf,yf,uf,wf,jg,X],Fg=[function(a){Hg[a>>4&15].call(this,a)},Kf,Hf,zf,Af,Ff,Bf,Df,Yf,Yf,pg,rg,tg,X,X,X],qg=[function(a){$d(this,Le(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,$e);this.b-=this.g?9:3+(7==this.f?2:0)}],sg=[function(a){V(this,a,0, -df);this.b-=this.g?11:6},function(a){V(this,a,Sd(this)?1:0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Sd(this)?1:0,kf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ie(this,a);$d(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],ug=[function(a){V(this,a,0,hf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)}], -Hg=[function(a){Ig[a&15].call(this,a)},X,X,X,Wf,Wf,Wf,Wf,fg,X,vg,xg,kg,kg,kg,kg],Ig=[Sf,mg,gg,Jf,Uf,eg,X,X,X,X,X,X,X,X,X,X],wg=[dg,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},Nf,function(){this.Z=1;this.b-=5},Nf,Nf,Nf,function(){this.X=0;this.b-=5},Nf,Nf,Nf,Nf,Nf,Nf,Nf],yg=[dg,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},hg,function(){this.Z=0;this.b-=5},hg,hg,hg,function(){this.X=32768;this.b-=5},hg,hg,hg,hg,hg,hg,hg],Gg=[If,Gf,Cf,Ef,Lf,Mf,rf,sf,Rf,lg,zg, -Bg,Dg,X,X,X],Ag=[function(a){$d(this,Ke(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,0,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,1,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,1,af);this.b-=this.g?9:3+(7==this.f?2:0)}],Cg=[function(a){Je(this,a,0,ef);this.b-=this.g?11:6},function(a){Je(this,a,Sd(this)?1:0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,Sd(this)?1:0,lf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a= -He(this,a);$d(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Eg=[function(a){Je(this,a,0,jf);this.b-=this.g?9+(this.Rb&1):3+(7==this.f?2:0)},function(a){Je(this,a,0,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,0,Te);this.b-=this.g?9+(this.Rb&1):3+(7==this.f?2:0)},function(a){Je(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)}];function Pd(a){Jg[a>>12].call(this,a)} -var Jg=[function(a){Kg[a>>8&15].call(this,a)},$f,Of,xf,tf,vf,of,function(a){Lg[a>>8&15].call(this,a)},function(a){Mg[a>>8&15].call(this,a)},ag,Pf,yf,uf,wf,jg,X],Kg=[function(a){Ng[a>>4&15].call(this,a)},Kf,Hf,zf,Af,Ff,Bf,Df,Yf,Yf,pg,rg,tg,function(a){Og[a>>6&3].call(this,a)},X,X],Og=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Ba(a|this.P);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ce(this,a,0);xe(this,a);U(this,a);this.b-=11},function(a){var b=ze(this);this.L= -this.b;De(this,a,0,b);U(this,b);this.b=this.L-bg[this.g]},function(a){U(this,Le(this,a,Vd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Ng=[function(a){Pg[a&15].call(this,a)},X,X,X,Wf,Wf,Wf,Wf,fg,function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.I|=1,this.I&=-3),this.b-=5):X.call(this,a)},vg,xg,kg,kg,kg,kg],Pg=[Sf,mg,function(){ye(this);this.I|=this.O&16;this.b-=13},Jf,Uf,eg,gg,function(){this.sa(8,0,-9)},X,X,X,X,X,X,X,X],Lg=[cg,cg,Qf,Qf,pf,pf,qf,qf,ng,ng,X,X,X,X,ig,ig],Mg= -[If,Gf,Cf,Ef,Lf,Mf,rf,sf,Rf,lg,zg,Bg,Dg,function(a){Qg[a>>6&3].call(this,a)},X,X],Qg=[X,function(a){a=Ce(this,a,65536);xe(this,a);U(this,a);this.b-=11},function(a){var b=ze(this);this.L=this.b;De(this,a,65536,b);U(this,b);this.b=this.L-bg[this.g]},X]; -function Rg(a){x.call(this,"ROM",a,Rg,128);this.ia=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.v=a.alias;this.g=a.file;this.G=u(this.g);if(this.g){a=this.g;var b=oa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(mb(c.gb,a,b),(a=Ea(a,b))?(c.A=a.ga,c.ia=a.ia):c.g=null);Sg(c)})}}B(Rg);k=Rg.prototype; -k.Fa=function(a,b,c,d){this.w=b;this.b=c;this.j=d;Sg(this)};k.Ia=function(){this.ia&&(this.j&&Tg(this.j,this.id,this.B,this.f,this.ia),delete this.ia);return!0};k.Ha=function(){return!0}; -function Sg(a){if(!yb(a)){if(a.g){if(!a.A||!a.w)return;a.f||(a.f=a.A.length);if(a.A.length!=a.f)Ab(a,"ROM size ("+p(a.A.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+vc){var c={};b=(c[b]=[Rg.prototype.ne,Rg.prototype.mf,null,null,null,a.f>>1],c);if(Kb(a.w,a,b)){b=a.F=!0;break a}}else if(Bc(a.w,b,a.f,qd)){for(c=0;c>>f.pa;0>>=f.pa;0>>a.pa;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),w=h,t=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= -b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(t)for(G(a,"loading "+q(t)+" bytes at "+q(r)+"-"+q(r+t-1),4096);t--;)Ic(a.w,r++,b[w++]&255);else r&1?a.b.ba():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.tc&&c<=la.dd&&(b=c-(la.tc-la.Sc));b&&(a.preventDefault&&a.preventDefault(),d.dc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.Uc&&(b=la.Tc);d.dc(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.dc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;var e=this;this.da=Rc(this.b,this.L?-1:48,4,262144);this.na=Oc(this.b,function(){var a;a=-1;e.J.length&&(a=e.J.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.ya&&97<=a&&122>a&&(a-=32),Qc(e.b,e.na,1E3/Math.round(e.Y/10)));0<=a&&(e.M=a,e.f&128?e.M|=49152:e.f|=128,e.f&64&&Pc(c,e.da))});this.T=Rc(this.b,this.L?-1:52,4,262144);this.za=Oc(this.b,function(){e.g|=128;e.g&64&&Pc(c,e.T)});Kb(b,this,$g,this.L?64832+8*(this.L-1)-65392:0);Mb(b,this.reset.bind(this)); -J(this)};k.Jc=function(a){if(!this.B){var b=Dd(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ua(c[0]);if(d!=this.fb)return;c=ua(c[1]);if(this.B=ob(c)){var e=this.B.exports;if(e){var f=e.connect;f&&f.call(this.B,this.K);if(this.P=e.receiveData){this.K=a;this.S=e.receiveStatus;this.status(this.gb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -k.Ia=function(a,b){if(!b)if(this.Jc(this.K),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){ah(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return ah(this)};function ah(a){a.M=0;a.f=8192;a.g=128;a.J=[];return!0} -k.dc=function(a){if("number"==typeof a)this.J.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.ma||8,c=a-this.G%a,this.ma&&(b=ta("",c)));this.ca&&!this.G&&c&&(b=String.fromCharCode(this.ca)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.G+=c}}else if(null!=this.F){if(10==a||1024<= -this.F.length)this.i(this.F),this.F="";10!=a&&(this.F+=String.fromCharCode(a))}Qc(this.b,this.za,1E3/Math.round(this.ta/10));this.g&=-129};var vh={},$g=(vh[65392]=[null,null,Yg.prototype.ae,Yg.prototype.Ze,"RCSR"],vh[65394]=[null,null,Yg.prototype.$d,Yg.prototype.Ye,"RBUF"],vh[65396]=[null,null,Yg.prototype.Be,Yg.prototype.Bf,"XCSR"],vh[65398]=[null,null,Yg.prototype.Ae,Yg.prototype.Af,"XBUF"],vh); -bb(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= -function(){var a=d.D.listTapes;a&&yh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.D[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;yh(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;this.Y=zh(a);var e=this;if((this.g=Dd(this.A,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){v("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.S=Rc(this.b,56,4,4096);this.da=Oc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.A&&!a.A.C.la;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.gb,e,f),(e=Ea(e,f))&&Ih(a,b,c,d,e.ga,e.Sa, -e.Ra));a.C.ib=!1;a.F&&(a.F--,a.F||J(a));Fh(a)})}function Ch(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.fa);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.$b?"":e)+"&format=json"));return!!Da(f, -null,!0,function(b,c,d){Ph(a,b,c,d)})} -function Ph(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.A&&!a.A.C.la;if(d)a.controller.N('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{mb(a.controller.gb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)v(h[0]);else{a.fa=h.length;a.ka=h[0].length;a.ha=h[0][0].length;var l=h[0][0][0];a.Aa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var w=l.bytes;if(void 0!==w&&w.length){for(var t=m<<2,A=w.length;A>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.La?f=a.Va+a.La&&(a.La+=f-(a.Va+a.La)+1):(a.Va=f,a.La=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Ta+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=Rh(this,a++);)Uh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Uh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function Q(a){x.call(this,"RK11",a,Q,65536);this.K=a.autoMount||{};this.F=0;this.g=Array(8);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(Q);k=Q.prototype; -k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){v("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Vh(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&Wh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Da)?(a=Na(Th(a),a.pc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.L)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Wh(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Dd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.K[e]=a[e]);Xh(this);this.Cb=Rc(this.b,144,5,65536);Kb(b,this,Yh);Mb(b,this.reset.bind(this));Zh(this,"None","",!0);this.L&&Zh(this,"Local Disk","?");Zh(this,"Remote Disk","??");$h(this)||J(this)}; -k.Ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.nc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Vh(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){Xh(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return Xh(this,a[0])};function $h(a,b){b||(a.F=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}bi(a,e,b,c,!1,d)}else ai(a,e)} -function bi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ja.toLowerCase()!=d.toLowerCase()&&(g++,ai(a,b,!0),h.vb?a.N("RK11 busy"):(h.vb=!0,e&&(h.ub=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.bb=!!f,Oh(new Kh(a,h,"preload"),c,d,f,a.Xc)&&g++));return g} -k.Xc=function(a,b,c,d,e){a.vb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.wb)),b=null);b?(a.Da=b,a.Ta=c,a.Ja=d,this.N('Mounted disk "'+c+'" in drive '+("RK"+a.wb),a.ub||e),this.A&&this.A.nb()):a.bb=!1;a.ub&&(a.ub=!1,--this.F||J(this));Vh(this,a.wb)}; -function Zh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.J=65536-e&65535;a&&(this.B=this.B|a|32768,this.f|=49152);return!0};k.Yc=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=4096;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=32;break}Zb(this.w,f,n|r<<8);if(Nc(this.w)){h=1024;break}f+=2;if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)}; -k.Zc=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=128,e=0);for(;e--;){var n=nc(this.w,f);if(Nc(this.w)){h=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=4096;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=32;break}if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)};k.fe=function(){return this.M};k.df=function(){};k.ge=function(){return this.B};k.ef=function(){};k.ce=function(){return this.f&61438}; -k.af=function(a){this.f=this.f&-3968|a&3967;if(this.f&1){var b,c=!0;a=(this.v&57344)>>13;var d=this.g[a],e,f,g,h;this.f&=-129;switch(this.f&14){case 0:this.M=d.status;this.B=0;this.f=128;this.v=0;break;case 4:b=this.Yc;case 2:b||(b=this.Zc),e=(this.v&8160)>>5,f=(this.v&16)>>4,g=this.v&15,e>=d.fa?(this.B|=32832,this.f|=49152):g>=d.ha?(this.B|=32800,this.f|=49152):(h=(this.f&48)<<12|this.G,c=65536-this.J&65535,c=b.call(this,d,e,f,g,c,h,this.Wc.bind(this)))}this.M=d.status|a<<13|this.v%9&15;c&&(this.f&= --2,this.f|=128,this.f&64&&Pc(this.b,this.Cb))}};k.he=function(){return this.J};k.ff=function(a){this.J=a};k.be=function(){return this.G};k.$e=function(a){this.G=a};k.de=function(){return this.v};k.bf=function(a){this.v=a};k.ee=function(){return this.P};k.cf=function(a){this.P=a}; -var ci={},Yh=(ci[65280]=[null,null,Q.prototype.fe,Q.prototype.df,"RKDS"],ci[65282]=[null,null,Q.prototype.ge,Q.prototype.ef,"RKER"],ci[65284]=[null,null,Q.prototype.ce,Q.prototype.af,"RKCS"],ci[65286]=[null,null,Q.prototype.he,Q.prototype.ff,"RKWC"],ci[65288]=[null,null,Q.prototype.be,Q.prototype.$e,"RKBA"],ci[65290]=[null,null,Q.prototype.de,Q.prototype.bf,"RKDA"],ci[65294]=[null,null,Q.prototype.ee,Q.prototype.cf,"RKDB"],ci); -function P(a){x.call(this,"RL11",a,P,131072);this.L=a.autoMount||{};this.J=0;this.g=Array(4);this.M=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; -k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){v("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&di(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&ei(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.M){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Da)?(a=Na(Th(a),a.pc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.M)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;ei(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Dd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);fi(this);this.Cb=Rc(this.b,112,5,131072);Kb(b,this,gi);Mb(b,this.reset.bind(this));hi(this,"None","",!0);this.M&&hi(this,"Local Disk","?");hi(this,"Remote Disk","??");ii(this)||J(this)}; -k.Ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.nc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";di(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){fi(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return fi(this,a[0])};function ii(a,b){b||(a.J=0);for(var c in a.L){var d=a.L[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}ki(a,e,b,c,!1,d)}else ji(a,e)} -function ki(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ja.toLowerCase()!=d.toLowerCase()&&(g++,ji(a,b,!0),h.vb?a.N("RL11 busy"):(h.vb=!0,e&&(h.ub=!0,a.J++,I(a)&&G(a,"auto-loading disk: "+c)),h.bb=!!f,Oh(new Kh(a,h,"preload"),c,d,f,a.ad)&&g++));return g} -k.ad=function(a,b,c,d,e){a.vb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.wb)),b=null);b?(a.Da=b,a.Ta=c,a.Ja=d,this.N('Mounted disk "'+c+'" in drive '+("RL"+a.wb),a.ub||e),this.A&&this.A.nb()):a.bb=!1;a.ub&&(a.ub=!1,--this.J||J(this));di(this,a.wb)}; -function hi(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.F=f>>16&63;this.B=this.v=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.f=this.f|a|32768);return!0}; -k.bd=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=5120;break}Zb(this.w,this.b.Na(f),n|r<<8);if(Nc(this.w)){h=8192;break}f+=2;if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.cd=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=5120,e=0);for(;e--;){var n=nc(this.w,this.b.Na(f));if(Nc(this.w)){h=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=5120;break}if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.ke=function(){return this.f&65535}; -k.jf=function(a){this.f=this.f&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.f&128)){var b;a=!0;var c=this.g[(this.f&768)>>8],d=c.Da,e,f,g;this.f&=-2;switch(this.f&14){case 4:this.G&8&&(this.f&=63);this.G=c.status|this.B&64|(d&&512==d.fa?128:0);break;case 6:1==(this.v&3)&&(b=this.v&65408,c=(this.v&16)<<2,this.B=this.v&4?this.B+b:this.B-b,this.v=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.bd;case 10:b||(b=this.cd),e=this.v>>7,f=this.v&64?1:0,g=this.v&63,!d||e>=d.fa|| -g>=d.ha?this.f|=37888:(d=(this.F&63)<<16|this.K,a=65536-this.G&65535,a=b.call(this,c,e,f,g,a,d,this.$c.bind(this)))}a&&(this.f|=129,this.f&64&&Pc(this.b,this.Cb))}};k.ie=function(){return this.K};k.gf=function(a){this.K=a&65534};k.le=function(){return this.v};k.kf=function(a){this.v=a};k.me=function(){return this.G};k.lf=function(a){this.G=a};k.je=function(){return this.F};k.hf=function(a){this.F=a&63;this.f=this.f&-49|(this.F&3)<<4}; -var li={},gi=(li[63744]=[null,null,P.prototype.ke,P.prototype.jf,"RLCS"],li[63746]=[null,null,P.prototype.ie,P.prototype.gf,"RLBA"],li[63748]=[null,null,P.prototype.le,P.prototype.kf,"RLDA"],li[63750]=[null,null,P.prototype.me,P.prototype.lf,"RLMP"],li[63752]=[null,null,P.prototype.je,P.prototype.hf,"RLBE"],li);function mi(a){x.call(this,"Debugger",a,mi);this.ma=a.base||16;this.Ka=!1;this.K=0;this.T=!1;this.B=-1;this.g=[];this.ca={}}B(mi); -var ni={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};mi.prototype.Hc=function(){return-1};mi.prototype.Ic=function(){}; -function oi(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.T?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ua(b.substring(c,f))),c=f+1}}return a} -function pi(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +K.prototype={constructor:K,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Bb)for(a=Array(this.size>>2),b=0;b>8,c)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ya:function(a,b){a&1&&this.w.Na(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ +1]&255)<<8},Qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.bb=!0},hb:function(a,b){if(this.j&&null!=this.H){var c=this.j;yd(c,this.H+a,1,c.M)&&c.ba(!0)}return this.I(a,b)},ma:function(a,b){if(this.j&&null!=this.H){var c=this.j;yd(c,this.H+a,2,c.M)&&c.ba(!0)}return this.J(a,b)},za:function(a, +b,c){if(this.j&&null!=this.H){var d=this.j;yd(d,this.H+a,1,d.F)&&d.ba(!0)}this.f?this.v(a,b,c):this.G(a,b,c)},Ya:function(a,b,c){if(this.j&&null!=this.H){var d=this.j;yd(d,this.H+a,2,d.F)&&d.ba(!0)}this.f?this.v(a,b,c):this.M(a,b,c)},gb:function(a){return this.D[a]},Z:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},da:function(a,b){a&1&&this.w.Na(b,64,2);return this.F.getUint16(a,!0)},na:function(a,b){a&1&&this.w.Na(b,64,2);a= +this.P[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ta:function(a,b){this.D[a]=b;this.bb=!0},La:function(a,b,c){this.D[a]=b;this.bb=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Ra:function(a,b,c){a&1&&this.w.Na(c,64,4);this.F.setUint16(a,b,!0);this.bb=!0},Za:function(a,b,c){a&1&&this.w.Na(c,64,4);this.P[a>>1]=b;this.bb=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, +b)+")",!0)}};function Ac(a,b,c){a.j=b;a.A=a.g=0;c&&((a.A=c.A)&&xd(a,wd,!1),(a.g=c.g)&&vd(a,wd,!1))}function zd(a,b){b?--a.g||(a.hc=a.f?a.v:a.G,a.$b=a.f?a.K:a.M):--a.A||(a.ec=a.I,a.Ba=a.J)}function vd(a,b,c){c&&a.g||(a.hc=!a.f&&b[1]||a.v,a.$b=!a.f&&b[3]||a.K);if(c||void 0===c)a.G=b[1]||a.v,a.M=b[3]||a.K}function xd(a,b,c){c&&a.A||(a.ec=b[0]||a.S,a.Ba=b[2]||a.T);if(c||void 0===c)a.I=b[0]||a.S,a.J=b[2]||a.T}function rd(a,b){b||(b=Ad);xd(a,b,void 0);vd(a,b,void 0)} +var Ad=[],ud=[K.prototype.ca,K.prototype.Qa,K.prototype.ya,K.prototype.$a],wd=[K.prototype.hb,K.prototype.za,K.prototype.ma,K.prototype.Ya];if(Bb)var td=[K.prototype.gb,K.prototype.ta,K.prototype.da,K.prototype.Ra],sd=[K.prototype.Z,K.prototype.La,K.prototype.na,K.prototype.Za]; +function Bd(a,b){x.call(this,"CPU",a,Bd,1);b=a.cycles||b;var c=a.multiplier||1;this.Qb=0;this.sb=b;this.lb=c;this.ic=Math.round(this.sb/1E4)/100;this.zb=this.ic*this.lb;this.C.X=!1;this.C.gc=!1;this.C.Cb=a.autoStart;this.C.Db=!1;this.Vb=this.ya=0;this.Wb=a.csStart;this.Hb=a.csInterval;this.Ib=a.csStop;this.M=[];this.Dc=this.Fe.bind(this);J(this)}B(Bd);var Cd=["power","reset"];k=Bd.prototype; +k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.j=d;this.v=a.v;for(b=0;b=a.ya&&(a.ya+=a.Hb,c=!0);0<=a.Ib&&a.Ib<=Id(a)&&(a.Hb=a.Ib=-1,Fd(a),a.ba(),c=!0);c&&a.i(Id(a)+" cycles: checksum="+p(a.Vb))}} +k.wa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.la)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;ca.na/a.zb?b=1:d=!0;a.lb=b;b=a.ic*a.lb;if(a.zb!=b){a.zb=b;b=a.zb.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.A&&a.A.ob()}Vb(a,a.T);a.T=0;a.S=Ba();a.Z=0;Kd(a);return d}function Oc(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function Qc(a,b,c,d){0<=b&&ba.M[b][0])&&(c=a.sb*a.lb/1E3*c|0,a.C.X&&(c+=Ld(a)),a.M[b][0]=c)} +function Md(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Ub(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Ld(a,b){var c=a.ca-=a.b;a.b=a.K=0;b&&(a.ca=0);return c} +k.Fe=function(){if(this.C.X){this.jc>=this.sb&&Kd(this,!0);this.Ra=0;this.$a=Ba();if(this.Z){var a=this.$a-this.Z;a>this.Bc&&(this.S+=a,this.S>this.$a&&(this.S=this.$a))}try{do{var b=Md(this,this.C.Db?1:this.tb);try{this.qb(b)}catch(e){if("number"!=typeof e)throw e;}b=Ld(this,!0);this.Ra+=b;this.T+=b;Wb(this,b);Ub(this,b);this.ta-=b;if(0>=this.ta){this.ta+=this.tb;15<=++this.Cc&&(this.xa(),this.Cc=0);break}}while(this.C.X)}catch(e){this.ba();this.A&&this.A.stop(Ba(),Id(this));Ab(this,e.stack||e.message); +return}if(this.C.X){a=setTimeout;b=this.Dc;this.Z=Ba();var c=this.Bc;this.Ra&&(c=Math.round(c*this.Ra/this.tb));var c=c-(this.Z-this.$a),d=this.Z-this.S;d&&(this.na=Math.round(this.T/(10*d))/100,864E5<=d&&(this.da=0,Jd(this)));if(0>c||this.nac&&(this.S-=c),c=0;this.jc+=this.Ra;this.Z+=c;a(b,c)}}}; +k.pb=function(a){if(zb(this))return!1;if(this.C.X)return this.i(this.toString()+" busy"),!1;Jd(this);this.C.X=!0;this.C.gc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.ob(!0),this.A.start(this.S,Id(this)));setTimeout(this.Dc,0);return!0};k.qb=function(){return 0};k.ba=function(a){var b=!1;if(this.C.X){Ld(this);Vb(this,this.T);this.T=0;this.C.X=!1;if(b=this.D.run)b.textContent="Run";this.A&&this.A.stop(Ba(),Id(this));b=!0}this.C.complete=a;return b}; +function Nd(a){this.kb=+a.model||1170;this.yc=a.addrReset||0;Bd.call(this,a,6666667);this.ub=0;this.Ac=255;1120==this.kb?(this.decode=Od.bind(this),this.ma=this.rd,this.ub=8,this.Ac=-1):(this.decode=Pd.bind(this),this.ma=this.sd);Qd(this);this.J=0;this.I=null;this.Rb=[];this.C.complete=!1}B(Nd,Bd);k=Nd.prototype;k.wc=function(){for(var a=192,b=0;bc.Zb&&(c.Zb=a,a+=4)}}; +k.reset=function(){this.status("model "+this.kb);this.C.X&&this.ba();Qd(this);Ed(this);this.C.error=!1;this.parent.reset.call(this)}; +function Qd(a){a.U=65536;a.V=32768;a.Y=65535;a.W=32768;a.O=15;a.u=[0,0,0,0,0,0,0,a.yc,-1,-2,-3,-4,-5,-6,-7,-8];a.fb=[0,0,0,0,0,0];a.Pa=[0,0,0,0];a.B=0;a.Za=0;a.Tc=[4,2,0,1];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ja=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0]];a.Yb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Pc=[0,0,0,0,0,0,0,0];a.Oc=0;a.L=0;a.F=a.G=0;a.g=a.f=a.Tb=0;a.za=-1;Tb(a)}function Tb(a){a.Ea=0;a.kc=0;a.lc=0;a.Xa=0;a.ra=0;a.Lb=0;a.nb=255;a.La=0;a.Ya=0;a.Qa=262143;a.Ub=0;a.va=0;a.I=null;a.w&&(Rd(a),a.gd=Kc(a.w))}function Rd(a){a.La?(a.P=65536,a.Sb=a.Xa&16?4186112:253952,a.aa=a.vd,a.Ba=a.Be,a.$b=a.Bf,Ec(a.w,a.Xa&16?22:18)):(a.P=0,a.Sb=57344,a.aa=a.ud,a.Ba=a.Nc,a.$b=a.uc,Ec(a.w,16))} +function cd(a){var b=a.Ea;b&57344||(b=b&-3199|a.Ya<<5|a.Za<<1);return b}function dd(a,b){b&=-3073;if(a.Ea!=b){b&57344&&!(a.Ea&57344)&&(a.kc=a.va>>16&65535,a.lc=a.va&65535);a.Ea=b;a.Ya=b>>5&3;a.Za=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.La!=c&&(a.La=c,Rd(a))}}function ed(a){a.Ea&57344||(a.kc=a.va>>16&65535);a=a.kc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function fd(a){a.Ea&57344||(a.lc=a.va&65535);return a.lc} +function gd(a,b){1170>a.kb&&(b&=-49);a.Xa!=b&&(a.Xa=b,a.Qa=b&16?4194303:262143,Rd(a))}k.Ic=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.da,this.lb]);a.set(2,Jc(this.w));return a.data()}; +k.restore=function(a){var b=a[1];this.da=b[1];Jd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.O>>14&3;a.B!=c&&(a.Pa[c]=a.u[6],a.u[6]=a.Pa[a.B]);a.O=b;a.L&=-3;a.L|=a.I?2:1}function hd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.L|=1}a.Lb=b}k.Fa=function(a){this.W=this.Y=a;this.V=0};k.rb=function(a,b){this.W=this.Y=this.U=a;this.V=b||0}; +function te(a,b){a.W=a.Y=a.U=b;a.V=a.W^a.U>>1}function ue(a,b,c,d){a.W=a.Y=a.U=b;a.V=(c^d)&(d^b)} +k.sa=function(a,b,c){if(!this.J){0>this.za?this.za=id(this):this.B||(c=-4);-4==c&&(this.L&256&&(c=-1),this.L|=256,this.ra|=4,this.u[6]=a=4);if(-1!=c){this.va=a|4143316992;this.B=0;var d=this.Ba(a|this.P),e=this.Ba(a+2&65535|this.P);jd(this,e&-12289|this.za>>2&12288);ve(this,this.za);ve(this,this.u[7]);T(this,d)}this.b-=5;this.L&=~(b|19);this.L|=129;this.za=-1;this.qd=a;this.od=c;-1==c&&this.ba();if(-4<=c)throw a;}}; +function we(a){var b=xe(a),c=xe(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);T(a,b);jd(a,c);a.L&=-17}k.Oa=function(a){var b=a>>13&31;31>b&&(a=this.Xa&32?this.Yb[b]+(a&8190)&4194302:a&-3932161);return a}; +function mc(a,b,c){var d,e,f;if(!(c&a.La))return f=b&65535,57344<=f&&(f|=a.Sb),f;d=b>>13;a.Xa&a.Tc[a.B]||(d&=7);e=a.R[a.B][d];f=(a.ja[a.B][d]<<6)+(b&8191)&a.Qa;3932160<=f&&(f=a.Oa(f));if(a.J)return f;f>=a.gd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& +8128)&&(g|=16384));a.R[a.B][d]=e;if(f!=(4194170&a.Qa)||a.B)a.Ya=a.B,a.Za=d;g&&(g&57344&&(0<=a.za&&(g|=128),a.Ea&57344||(g|=a.Ea&4096|a.Ya<<5|a.Za<<1,dd(a,a.Ea&-61695|g&61694)),a.sa(168,64,-2)),a.Ea&61440||!(f<(4191360&a.Qa)||f>(4194239&a.Qa))||(a.Ea|=4096,a.Ea&512&&(a.L|=64)));return f}function ye(a,b){return a.w.dc(b)}function xe(a){var b=a.Ba(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b} +function ve(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.va=a.va&65535|(a.va&-65536)<<8|16121856;a.L&256||a.ma(4,-2,c);a.$b(c,b)} +function ze(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.sa(4,0,-3),0;case 1:return 6==c&&a.ma(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.ma(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Ba(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.ma(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Ba(e)|g;a.b-=8;break;case 6:return e=a.Ba(Xd(a,2)),e=e+a.u[c]&65535,6==c&&a.ma(d, +0,e),a.b-=6,e|g;case 7:return e=a.Ba(Xd(a,2)),e=e+a.u[c]&65535,e=a.Ba(e|a.P),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.va=a.va&65535|(a.va&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.B&&0>=b&&c<=this.nb&&(this.L|=32)};k.sd=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.nb&&(c<=this.nb-32?this.sa(4,0,-4):(this.ra|=8,this.L|=32)))};function oc(a,b){a.J++;b=a.Nc(mc(a,b,2));a.J--;return b}k.ud=function(a,b,c){a=ze(this,a,b,c);3932160<=a&&(a=this.Oa(a));return a}; +k.vd=function(a,b,c){return mc(this,ze(this,a,b,c),c)};k.Nc=function(a){3932160<=a&&(a=this.Oa(a));return this.w.ua(this.Ub=a)};k.Be=function(a){return this.w.ua(this.Ub=mc(this,a,2))};k.uc=function(a,b){3932160<=a&&(a=this.Oa(a));this.w.Bb(this.Ub=a,b)};k.Bf=function(a,b){this.w.Bb(this.Ub=mc(this,a,4),b)}; +function Ae(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ze(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.B=a.O>>12&3,c=a.Ba(d|c&a.P),a.B=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.Pa[a.O>>12&3];return c}function Be(a,b,c,d){a.va=a.va&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ze(a,b,e,4),c&65536||(e&=65535),a.B=a.O>>12&3,e=mc(a,e|c&65536,4),a.B=a.O>>14&3,a.w.Bb(e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.Pa[a.O>>12&3]=d} +function Ce(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?ye(a,a.aa(b,c,3)):a.u[c+a.ub]&a.Ac}function De(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?a.w.ua(a.aa(b,c,2)):a.u[c+a.ub]}function Ee(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ze(a,b,c,8)}function Fe(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ye(a,a.aa(b,c,3)):a.u[c]&255}function Ge(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ua(a.aa(b,c,2)):a.u[c]} +function U(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Tb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,ye(a,e)),e&1&&a.b--,a.w.Mb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.Bb(e,d.call(a,0>c?a.u[-c-1]:c,a.w.ua(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} +function He(a,b,c,d,e){var f=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,f,5),e.call(a,(c=0>c?a.u[-c-1]&255:c)<<8),d&1&&a.b--,a.w.Mb(d,c)):(c?(c=0>c?a.u[-c-1]&255:c,a.u[f]=a.u[f]&~d|c<<24>>24&d):a.u[f]&=~d,e.call(a,c<<8))}function Ie(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,4),d.call(a,c=0>c?a.u[-c-1]:c),a.w.Bb(e,c)):(a.u[e]=c=0>c?a.u[-c-1]:c,d.call(a,c))}function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.qb=function(a){this.C.complete=!0;var b=this.j?Je(this.j)?1:this.C.gc?-1:0:0,c=a?this.C.gc?0:1:-1;this.C.gc=!1;this.ca=this.b=a;do{if(b){if(Ke(this.j,this.u[7],c)){this.ba();break}c||c++;b++}if(this.L){if(a=this.L&11)if(a=!1,this.L&2){var d=160,e=(this.Lb&224)>>5,f=this.I&&this.I.mb>e?this.I:null;f&&(d=f.Zb,e=f.mb);e>(this.O&224)>>5?(this.L&8&&(Xd(this,2),this.L&=-9),this.sa(d,0,-10),e=!0):e=!1;e&&(f&&Yd(this,f),a=!0);this.I||this.Lb||(this.L&=-3)}else this.L&1&&this.L++;if(a){if(b&&Ke(this.j,this.u[7], +c)){this.ba();break}if(0>c)break}if(this.L&112&&se(this)){if(b&&Ke(this.j,this.u[7],c)){this.ba();break}if(0>c)break}}this.L=this.L&15|this.O&16;this.decode(Wd(this))}while(0>1|b<<16;te(this,a);return a&65535}function Qe(a,b){a=b&128|b>>1|b<<8;te(this,a<<8);return a&255}function Re(a,b){a=b&~a;this.Fa(a);return a}function Se(a,b){a=b&~a;this.Fa(a<<8);return a}function Te(a,b){a|=b;this.Fa(a);return a}function Ue(a,b){a|=b;this.Fa(a<<8);return a} +function Ve(a,b){a=~b|65536;this.rb(a);return a&65535}function We(a,b){a=~b|256;this.rb(a<<8);return a&255}function Xe(a,b){this.W=this.Y=a=b-a;this.V=b&(b^a);return a&65535}function Ye(a,b){a=b-a;var c=a<<8;b<<=8;this.W=this.Y=c;this.V=b&(b^c);return a&255}function Ze(a,b){this.W=this.Y=a=b+a;this.V=a&(b^a);return a&65535}function $e(a,b){a=b+a;var c=a<<8;this.W=this.Y=c;this.V=c&(b<<8^c);return a&255}function af(a,b){a=-b;this.rb(a,a&b&32768);return a&65535} +function bf(a,b){a=-b;this.rb(a<<8,(a&b&128)<<8);return a&255}function cf(a,b){a=b<<1|this.U>>16&1;te(this,a);return a&65535}function df(a,b){a=b<<1|this.U>>16&1;te(this,a<<8);return a&255}function ef(a,b){a=(this.U&65536|b)>>1|b<<16;te(this,a);return a&65535}function ff(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;te(this,a<<8);return a&255}function gf(a,b){var c=b-a;ue(this,c,a,b);return c&65535}function hf(a,b){var c=b-a;ue(this,c<<8,a<<8,b<<8);return c&255} +function jf(a,b){this.W=this.Y=b&65280;this.V=this.U=0;return(b<<8|b>>8)&65535}function kf(a,b){a^=b;this.Fa(a);return a&65535}function lf(a){V(this,a,De(this,a),Le);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function mf(a){var b=Ge(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.W=this.Y=c;this.b-=(this.g?6:7)+b} +function nf(a){var b=Ge(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.W=d>>16;this.Y=d>>16|d;this.b-=(this.g?6:7)+b}function of(a){W(this,a,!Sd(this))}function pf(a){W(this,a,Sd(this))} +function qf(a){V(this,a,De(this,a),Re);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function rf(a){U(this,a,Ce(this,a),Se);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function sf(a){V(this,a,De(this,a),Te);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function tf(a){U(this,a,Ce(this,a),Ue);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function uf(a){var b=De(this,a);a=Ge(this,a);this.Fa((0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function vf(a){var b=Ce(this,a);a=Fe(this,a);this.Fa(((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function wf(a){W(this,a,Ud(this))}function xf(a){W(this,a,!Vd(this)==!Td(this))}function yf(a){W(this,a,!Ud(this)&&!Vd(this)==!Td(this))}function zf(a){W(this,a,!Sd(this)&&!Ud(this))} +function Af(a){W(this,a,Ud(this)||!Vd(this)!=!Td(this))}function Bf(a){W(this,a,Sd(this)||Ud(this))}function Cf(a){W(this,a,!Vd(this)!=!Td(this))}function Df(a){W(this,a,Vd(this))}function Ef(a){W(this,a,!Ud(this))}function Ff(a){W(this,a,!Vd(this))}function Gf(){this.sa(12,0,-9)}function Hf(a){W(this,a,!0)}function If(a){W(this,a,!Td(this))}function Jf(a){W(this,a,Td(this))}function Kf(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.Y=1);a&8&&(this.W=0);this.b-=5} +function Lf(a){var b=De(this,a);a=Ge(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ue(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Mf(a){var b=Ce(this,a);a=Fe(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ue(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} +function Nf(a){var b=Ge(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Y=d>>16|d,this.W=d>>16):(this.V=32768,this.Y=d>>15|d,this.W=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Y=this.W=0,this.V=32768,this.U=65536,this.b-=7}function Of(){this.sa(24,0,-9);this.b-=20} +function Pf(){this.O&49152?(this.ra|=128,this.sa(4,0,-8)):(this.v&&1120==this.kb&&this.v.setData(this.u[0],!0),this.j?Qf(this.j):this.ba());this.b-=7}function Rf(){this.sa(16,0,-9);this.b-=20}var Sf=[0,7,7,10,7,11,9,13];function Tf(a){this.K=this.b;T(this,Ee(this,a));this.b=this.K-Sf[this.g]}var Uf=[0,14,14,17,14,18,16,20];function Vf(a){this.K=this.b;var b=Ee(this,a);a=a>>6&7;ve(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.K-Uf[this.g]} +var Wf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Xf(a){var b=De(this,a);this.K=this.b;Ie(this,a,b,this.Fa);this.b=this.K-Wf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Yf(a){var b=Ce(this,a);He(this,a,b,65535,this.Fa);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var Zf=[7,13,13,17,14,18,17,21]; +function $f(a){var b=Ge(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.W=b>>16;this.Y=this.W|b;this.V=0;this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function gg(a){V(this,a,De(this,a),gf);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function hg(a){V(this,a,0,jf);this.b-=this.g?9:3+(7==this.f?2:0)}function ig(){this.sa(28,0,-9)} +function jg(){this.v&&(this.v.sc(this.u[7],!0),this.v.setData(this.u[0],!0));this.L|=8;Xd(this,-2);this.b-=3}function kg(a){V(this,a,this.u[(a>>6&7)+this.ub],kf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Qf(b)):b=!1;b||this.sa(8,0,-9)}function Od(a){lg[a>>12].call(this,a)}function mg(a){ng[a>>6&3].call(this,a)}function og(a){pg[a>>6&3].call(this,a)}function qg(a){rg[a>>6&3].call(this,a)} +function sg(a){tg[a&15].call(this,a)}function ug(a){vg[a&15].call(this,a)}function wg(a){xg[a>>6&3].call(this,a)}function yg(a){zg[a>>6&3].call(this,a)}function Ag(a){Bg[a>>6&3].call(this,a)} +var lg=[function(a){Cg[a>>8&15].call(this,a)},Xf,Lf,uf,qf,sf,lf,X,function(a){Dg[a>>8&15].call(this,a)},Yf,Mf,vf,rf,tf,gg,X],Cg=[function(a){Eg[a>>4&15].call(this,a)},Hf,Ef,wf,xf,Cf,yf,Af,Vf,Vf,mg,og,qg,X,X,X],ng=[function(a){Ie(this,a,0,this.rb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Xe);this.b-=this.g?9:3+(7==this.f?2:0)}],pg=[function(a){V(this,a,0,af); +this.b-=this.g?11:6},function(a){V(this,a,Sd(this)?1:0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Sd(this)?1:0,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ge(this,a);this.rb(a);this.b-=this.g?4:3+(7==this.f?2:0)}],rg=[function(a){V(this,a,0,ef);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}],Eg= +[function(a){Fg[a&15].call(this,a)},X,X,X,Tf,Tf,Tf,Tf,cg,X,sg,ug,hg,hg,hg,hg],Fg=[Pf,jg,dg,Gf,Rf,bg,X,X,X,X,X,X,X,X,X,X],tg=[ag,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},Kf,function(){this.Y=1;this.b-=5},Kf,Kf,Kf,function(){this.W=0;this.b-=5},Kf,Kf,Kf,Kf,Kf,Kf,Kf],vg=[ag,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},eg,function(){this.Y=0;this.b-=5},eg,eg,eg,function(){this.W=32768;this.b-=5},eg,eg,eg,eg,eg,eg,eg],Dg=[Ff,Df,zf,Bf,If,Jf,of,pf,Of,ig,wg,yg, +Ag,X,X,X],xg=[function(a){He(this,a,0,255,this.rb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Ye);this.b-=this.g?9:3+(7==this.f?2:0)}],zg=[function(a){U(this,a,0,bf);this.b-=this.g?11:6},function(a){U(this,a,Sd(this)?1:0,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,Sd(this)?1:0,hf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Fe(this,a); +this.rb(a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Bg=[function(a){U(this,a,0,ff);this.b-=this.g?9+(this.Tb&1):3+(7==this.f?2:0)},function(a){U(this,a,0,df);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Qe);this.b-=this.g?9+(this.Tb&1):3+(7==this.f?2:0)},function(a){U(this,a,0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)}];function Pd(a){Gg[a>>12].call(this,a)} +var Gg=[function(a){Hg[a>>8&15].call(this,a)},Xf,Lf,uf,qf,sf,lf,function(a){Ig[a>>8&15].call(this,a)},function(a){Jg[a>>8&15].call(this,a)},Yf,Mf,vf,rf,tf,gg,X],Hg=[function(a){Kg[a>>4&15].call(this,a)},Hf,Ef,wf,xf,Cf,yf,Af,Vf,Vf,mg,og,qg,function(a){Lg[a>>6&3].call(this,a)},X,X],Lg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Ba(a|this.P);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ae(this,a,0);this.Fa(a);ve(this,a);this.b-=11},function(a){var b=xe(this);this.K= +this.b;this.Fa(b);Be(this,a,0,b);this.b=this.K-Zf[this.g]},function(a){Ie(this,a,Vd(this)?65535:0,this.Fa);this.b-=this.g?9:3+(7==this.f?2:0)}],Kg=[function(a){Mg[a&15].call(this,a)},X,X,X,Tf,Tf,Tf,Tf,cg,function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.L|=1,this.L&=-3),this.b-=5):X.call(this,a)},sg,ug,hg,hg,hg,hg],Mg=[Pf,jg,function(){we(this);this.L|=this.O&16;this.b-=13},Gf,Rf,bg,dg,function(){this.sa(8,0,-9)},X,X,X,X,X,X,X,X],Ig=[$f,$f,Nf,Nf,mf,mf,nf,nf,kg,kg,X,X,X,X,fg,fg],Jg= +[Ff,Df,zf,Bf,If,Jf,of,pf,Of,ig,wg,yg,Ag,function(a){Ng[a>>6&3].call(this,a)},X,X],Ng=[X,function(a){a=Ae(this,a,65536);this.Fa(a);ve(this,a);this.b-=11},function(a){var b=xe(this);this.K=this.b;this.Fa(b);Be(this,a,65536,b);this.b=this.K-Zf[this.g]},X]; +function Og(a){x.call(this,"ROM",a,Og,128);this.ia=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.v=a.alias;this.g=a.file;this.G=u(this.g);if(this.g){a=this.g;var b=oa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(mb(c.hb,a,b),(a=Ea(a,b))?(c.A=a.ga,c.ia=a.ia):c.g=null);Pg(c)})}}B(Og);k=Og.prototype; +k.Ga=function(a,b,c,d){this.w=b;this.b=c;this.j=d;Pg(this)};k.Ja=function(){this.ia&&(this.j&&Qg(this.j,this.id,this.B,this.f,this.ia),delete this.ia);return!0};k.Ia=function(){return!0}; +function Pg(a){if(!yb(a)){if(a.g){if(!a.A||!a.w)return;a.f||(a.f=a.A.length);if(a.A.length!=a.f)Ab(a,"ROM size ("+p(a.A.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+vc){var c={};b=(c[b]=[Og.prototype.pe,Og.prototype.pf,null,null,null,a.f>>1],c);if(Kb(a.w,a,b)){b=a.F=!0;break a}}else if(Bc(a.w,b,a.f,qd)){for(c=0;c>>f.pa;0>>=f.pa;0>>a.pa;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),w=h,t=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= +b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(t)for(G(a,"loading "+q(t)+" bytes at "+q(r)+"-"+q(r+t-1),4096);t--;)Ic(a.w,r++,b[w++]&255);else r&1?a.b.ba():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.vc&&c<=la.fd&&(b=c-(la.vc-la.Uc));b&&(a.preventDefault&&a.preventDefault(),d.fc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.Wc&&(b=la.Vc);d.fc(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.fc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;var e=this;this.da=Rc(this.b,this.K?-1:48,4,262144);this.na=Oc(this.b,function(){var a;a=-1;e.I.length&&(a=e.I.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.ya&&97<=a&&122>a&&(a-=32),Qc(e.b,e.na,1E3/Math.round(e.Z/10)));0<=a&&(e.M=a,e.f&128?e.M|=49152:e.f|=128,e.f&64&&Pc(c,e.da))});this.T=Rc(this.b,this.K?-1:52,4,262144);this.za=Oc(this.b,function(){e.g|=128;e.g&64&&Pc(c,e.T)});Kb(b,this,Xg,this.K?64832+8*(this.K-1)-65392:0);Mb(b,this.reset.bind(this)); +J(this)};k.Lc=function(a){if(!this.B){var b=Dd(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ya(c[0]);if(d!=this.gb)return;c=ya(c[1]);if(this.B=ob(c)){var e=this.B.exports;if(e){var f=e.connect;f&&f.call(this.B,this.J);if(this.P=e.receiveData){this.J=a;this.S=e.receiveStatus;this.status(this.hb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +k.Ja=function(a,b){if(!b)if(this.Lc(this.J),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ia=function(a){return a?this.save():!0};k.reset=function(){Yg(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return Yg(this)};function Yg(a){a.M=0;a.f=8192;a.g=128;a.I=[];return!0} +k.fc=function(a){if("number"==typeof a)this.I.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.ma||8,c=a-this.G%a,this.ma&&(b=ta("",c)));this.ca&&!this.G&&c&&(b=String.fromCharCode(this.ca)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.G+=c}}else if(null!=this.F){if(10==a||1024<= +this.F.length)this.i(this.F),this.F="";10!=a&&(this.F+=String.fromCharCode(a))}Qc(this.b,this.za,1E3/Math.round(this.ta/10));this.g&=-129};var sh={},Xg=(sh[65392]=[null,null,Vg.prototype.ce,Vg.prototype.af,"RCSR"],sh[65394]=[null,null,Vg.prototype.be,Vg.prototype.$e,"RBUF"],sh[65396]=[null,null,Vg.prototype.De,Vg.prototype.Df,"XCSR"],sh[65398]=[null,null,Vg.prototype.Ce,Vg.prototype.Cf,"XBUF"],sh); +bb(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= +function(){var a=d.D.listTapes;a&&vh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.D[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;vh(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; +k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;this.Z=wh(a);var e=this;if((this.g=Dd(this.A,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){v("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.S=Rc(this.b,56,4,4096);this.da=Oc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Jc.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.A&&!a.A.C.la;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.hb,e,f),(e=Ea(e,f))&&Fh(a,b,c,d,e.ga,e.Ta, +e.Sa));a.C.jb=!1;a.F&&(a.F--,a.F||J(a));Ch(a)})}function zh(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.fa);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.bc?"":e)+"&format=json"));return!!Da(f, +null,!0,function(b,c,d){Mh(a,b,c,d)})} +function Mh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.A&&!a.A.C.la;if(d)a.controller.N('Unable to load disk "'+a.Ua+'" (error '+d+": "+b+")",f);else{mb(a.controller.hb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(h.length)if(1==h.length)v(h[0]);else{a.fa=h.length;a.ka=h[0].length;a.ha=h[0][0].length;var l=h[0][0][0];a.Aa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var w=l.bytes;if(void 0!==w&&w.length){for(var t=m<<2,A=w.length;A>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ma?f=a.Wa+a.Ma&&(a.Ma+=f-(a.Wa+a.Ma)+1):(a.Wa=f,a.Ma=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Ua+": "+c);return b}; +k.toJSON=function(){var a;a=0;for(var b;b=Oh(this,a++);)Rh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function Rh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function R(a){x.call(this,"RK11",a,R,65536);this.J=a.autoMount||{};this.F=0;this.g=Array(8);this.K=!Ma("Mobi")&&window&&"FileReader"in window}B(R);k=R.prototype; +k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){v("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Sh(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&Th(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.K){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Da)?(a=Na(Qh(a),a.rc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.K)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Th(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Dd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.J[e]=a[e]);Uh(this);this.Eb=Rc(this.b,144,5,65536);Kb(b,this,Vh);Mb(b,this.reset.bind(this));Wh(this,"None","",!0);this.K&&Wh(this,"Local Disk","?");Wh(this,"Remote Disk","??");Xh(this)||J(this)}; +k.Ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Sh(this,0)}}return!0};k.Ia=function(a){return a?this.save():!0};k.reset=function(){Uh(this)};k.save=function(){return(new S(this)).data()}; +k.restore=function(a){return Uh(this,a[0])};function Xh(a,b){b||(a.F=0);for(var c in a.J){var d=a.J[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}Zh(a,e,b,c,!1,d)}else Yh(a,e)} +function Zh(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ka.toLowerCase()!=d.toLowerCase()&&(g++,Yh(a,b,!0),h.xb?a.N("RK11 busy"):(h.xb=!0,e&&(h.wb=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.cb=!!f,Lh(new Hh(a,h,"preload"),c,d,f,a.Zc)&&g++));return g} +k.Zc=function(a,b,c,d,e){a.xb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.yb)),b=null);b?(a.Da=b,a.Ua=c,a.Ka=d,this.N('Mounted disk "'+c+'" in drive '+("RK"+a.yb),a.wb||e),this.A&&this.A.ob()):a.cb=!1;a.wb&&(a.wb=!1,--this.F||J(this));Sh(this,a.yb)}; +function Wh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.I=65536-e&65535;a&&(this.B=this.B|a|32768,this.f|=49152);return!0};k.$c=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=4096;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=32;break}lc(this.w,f,n|r<<8);if(Nc(this.w)){h=1024;break}f+=2;if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)}; +k.ad=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=128,e=0);for(;e--;){var n=nc(this.w,f);if(Nc(this.w)){h=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=4096;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=32;break}if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)};k.he=function(){return this.M};k.ff=function(){};k.ie=function(){return this.B};k.gf=function(){};k.ee=function(){return this.f&61438}; +k.cf=function(a){this.f=this.f&-3968|a&3967;if(this.f&1){var b,c=!0;a=(this.v&57344)>>13;var d=this.g[a],e,f,g,h;this.f&=-129;switch(this.f&14){case 0:this.M=d.status;this.B=0;this.f=128;this.v=0;break;case 4:b=this.$c;case 2:b||(b=this.ad),e=(this.v&8160)>>5,f=(this.v&16)>>4,g=this.v&15,e>=d.fa?(this.B|=32832,this.f|=49152):g>=d.ha?(this.B|=32800,this.f|=49152):(h=(this.f&48)<<12|this.G,c=65536-this.I&65535,c=b.call(this,d,e,f,g,c,h,this.Yc.bind(this)))}this.M=d.status|a<<13|this.v%9&15;c&&(this.f&= +-2,this.f|=128,this.f&64&&Pc(this.b,this.Eb))}};k.je=function(){return this.I};k.hf=function(a){this.I=a};k.de=function(){return this.G};k.bf=function(a){this.G=a};k.fe=function(){return this.v};k.df=function(a){this.v=a};k.ge=function(){return this.P};k.ef=function(a){this.P=a}; +var $h={},Vh=($h[65280]=[null,null,R.prototype.he,R.prototype.ff,"RKDS"],$h[65282]=[null,null,R.prototype.ie,R.prototype.gf,"RKER"],$h[65284]=[null,null,R.prototype.ee,R.prototype.cf,"RKCS"],$h[65286]=[null,null,R.prototype.je,R.prototype.hf,"RKWC"],$h[65288]=[null,null,R.prototype.de,R.prototype.bf,"RKBA"],$h[65290]=[null,null,R.prototype.fe,R.prototype.df,"RKDA"],$h[65294]=[null,null,R.prototype.ge,R.prototype.ef,"RKDB"],$h); +function P(a){x.call(this,"RL11",a,P,131072);this.K=a.autoMount||{};this.I=0;this.g=Array(4);this.M=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; +k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){v("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&ai(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&bi(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.M){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Da)?(a=Na(Qh(a),a.rc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.M)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;bi(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Ga=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Dd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.K[e]=a[e]);ci(this);this.Eb=Rc(this.b,112,5,131072);Kb(b,this,di);Mb(b,this.reset.bind(this));ei(this,"None","",!0);this.M&&ei(this,"Local Disk","?");ei(this,"Remote Disk","??");fi(this)||J(this)}; +k.Ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ai(this,0)}}return!0};k.Ia=function(a){return a?this.save():!0};k.reset=function(){ci(this)};k.save=function(){return(new S(this)).data()}; +k.restore=function(a){return ci(this,a[0])};function fi(a,b){b||(a.I=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}hi(a,e,b,c,!1,d)}else gi(a,e)} +function hi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ka.toLowerCase()!=d.toLowerCase()&&(g++,gi(a,b,!0),h.xb?a.N("RL11 busy"):(h.xb=!0,e&&(h.wb=!0,a.I++,I(a)&&G(a,"auto-loading disk: "+c)),h.cb=!!f,Lh(new Hh(a,h,"preload"),c,d,f,a.cd)&&g++));return g} +k.cd=function(a,b,c,d,e){a.xb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.Da=b,a.Ua=c,a.Ka=d,this.N('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.wb||e),this.A&&this.A.ob()):a.cb=!1;a.wb&&(a.wb=!1,--this.I||J(this));ai(this,a.yb)}; +function ei(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.F=f>>16&63;this.B=this.v=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.f=this.f|a|32768);return!0}; +k.dd=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=5120;break}lc(this.w,this.b.Oa(f),n|r<<8);if(Nc(this.w)){h=8192;break}f+=2;if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.ed=function(a,b,c,d,e,f,g){var h=0;a=a.Da;var l=null,m;a||(h=5120,e=0);for(;e--;){var n=nc(this.w,this.b.Oa(f));if(Nc(this.w)){h=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=5120;break}if(m>=a.Aa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.me=function(){return this.f&65535}; +k.lf=function(a){this.f=this.f&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.f&128)){var b;a=!0;var c=this.g[(this.f&768)>>8],d=c.Da,e,f,g;this.f&=-2;switch(this.f&14){case 4:this.G&8&&(this.f&=63);this.G=c.status|this.B&64|(d&&512==d.fa?128:0);break;case 6:1==(this.v&3)&&(b=this.v&65408,c=(this.v&16)<<2,this.B=this.v&4?this.B+b:this.B-b,this.v=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.dd;case 10:b||(b=this.ed),e=this.v>>7,f=this.v&64?1:0,g=this.v&63,!d||e>=d.fa|| +g>=d.ha?this.f|=37888:(d=(this.F&63)<<16|this.J,a=65536-this.G&65535,a=b.call(this,c,e,f,g,a,d,this.bd.bind(this)))}a&&(this.f|=129,this.f&64&&Pc(this.b,this.Eb))}};k.ke=function(){return this.J};k.jf=function(a){this.J=a&65534};k.ne=function(){return this.v};k.mf=function(a){this.v=a};k.oe=function(){return this.G};k.nf=function(a){this.G=a};k.le=function(){return this.F};k.kf=function(a){this.F=a&63;this.f=this.f&-49|(this.F&3)<<4}; +var ii={},di=(ii[63744]=[null,null,P.prototype.me,P.prototype.lf,"RLCS"],ii[63746]=[null,null,P.prototype.ke,P.prototype.jf,"RLBA"],ii[63748]=[null,null,P.prototype.ne,P.prototype.mf,"RLDA"],ii[63750]=[null,null,P.prototype.oe,P.prototype.nf,"RLMP"],ii[63752]=[null,null,P.prototype.le,P.prototype.kf,"RLBE"],ii);function ji(a){x.call(this,"Debugger",a,ji);this.ma=a.base||16;this.La=!1;this.J=0;this.T=!1;this.B=-1;this.g=[];this.ca={}}B(ji); +var ki={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};ji.prototype.Jc=function(){return-1};ji.prototype.Kc=function(){}; +function li(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.T?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a} +function mi(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function qi(a,b,c){var d;if(b){b=ri(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function ui(a,b){if(b)return ti(a,b,a.ca[b]);var c=0;for(b in a.ca)ti(a,b,a.ca[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function ri(a,b){if(b)return qi(a,b,a.ca[b]);var c=0;for(b in a.ca)qi(a,b,a.ca[b]),c++;return 0this.b.jb?Ei:[];Tc(this,16,function(a){a:{var b=d.w.ea,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(Fi(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.pa;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Gc[c],n&&d.i(p(n.id,8)+" %"+ -p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -k.Ic=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.eb[a-8];else if(20>a)b=this.b.Oa[a-16];else{var c=this.b,d=this.v;switch(a){case 20:b=id(this.b);break;case 21:b=c.Jb;break;case 22:b=c.ra;break;case 23:b=c.mb;break;case 24:b=cd(c);break;case 25:b=ed(c);break;case 26:b=fd(c);break;case 27:b=c.Wa;break;case 28:d&&(b=d.Ca);break;case 29:d&&(b=d.yb);break;case 30:d&&sc(d)&&(b=d.cb)}}return b}; -k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.va&65535).H));if(!this.na||a!=this.na)if(this.na=a,this.oa&1073741824)this.Y.push(a);else{var c;if(this.oa&-2147483648&&this.b&&(c=this.b.C.W)||xb(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Ld(a),a.ta=0,a.xa())}}; -function xi(a){var b;if(!Me(a))a.G&&a.G.length&&a.i("instruction history buffer freed"),a.da=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.P?Mi(a):Ni(a)}}function Li(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.la?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.W?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ia=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Ha=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){xi(this);this.za=0;this.na=null;this.K=0;this.L=Y(this.b.u[7]);this.C.W=!1;Oi(this);a||Gd(this)};k.save=function(){var a=new S(this);a.set(0,Hi(this.L));a.set(1,Hi(this.S));a.set(2,[this.g,this.T,this.oa]);a.set(3,this.J);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Ii(a[b++]),this.S=Ii(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.T=a[b][1],this.oa|=a[b][2]);a[3]&&(this.J=a[3]);return!0};k.start=function(a,b){this.P||this.i("running");this.C.W=!0;this.Pb=a;this.Qb=b}; -k.stop=function(a,b){if(this.C.W){this.C.W=!1;this.K=b-this.Qb;if(!this.P){b="stopped";if(this.K){a-=this.Pb;var c=0d&&(d=oc(a.b,b)),65535!=(d&65535)&&(a.qc(a.G[a.da],b),++a.da==a.G.length&&(a.da=0)));return!1}function Tf(a){var b=a.b;if(b.C.W)throw T(b,a.b.va&65535),a.ba(),-1;return!1} -function wi(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.pa],!1)}a.M=["br"];if(a.F)for(b=1;b>>d.pa],!0);a.F=["bw"];a.Za=0}k.tb=function(a,b,c){var d=!0;c||Pi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.i("invalid address: "+L(this,b.H)),d=!1;else{var f=this.w;f.ea[e>>>f.pa].tb(e&f.w,a==this.F)}}d&&(a.push(b),c?b.Ua=!0:(Qi(this,a,a.length-1,"set"),xi(this)));return d}; -function Pi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.pa],b==a.F));h.Ua||xi(a);break}}return f}function Ri(a,b){for(var c=1;c>23)&65535,y=L(t,w);else if(8192==C)w=w.H-((f&63)<<1)&65535,y=L(t,w);else if(12288==C)y=L(t,f&7,1);else if(24576==C)y=L(t,f&63,1);else if(32768==C)y=L(t,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), -A&63)switch(A=C&7,C&56){case 0:y=Ki(A);break;case 8:y="@"+Ki(A);break;case 16:7>A?y="("+Ki(A)+")+":(C=t.ua(w,2),y="#"+L(t,C,0,!0));break;case 24:7>A?y="@("+Ki(A)+")+":(C=t.ua(w,2),y="@#"+L(t,C,0,!0));break;case 32:y="-("+Ki(A)+")";break;case 40:y="@-("+Ki(A)+")";break;case 48:C=t.ua(w,2);y=L(t,C,0,!0)+"("+Ki(A)+")";7==A&&(y=L(t,C+w.H&65535));break;case 56:C=t.ua(w,2),y="@"+L(t,C)+"("+Ki(A)+")",7==A&&(y="@"+L(t,C+w.H&65535))}t=y;if(!t||!t.length){h="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]); -0b)c=Ki(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.eb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Oa[b-16]);else switch(b){case 20:c="PS="+L(a,id(d));break;case 21:c="IR="+L(a,d.Jb);break;case 22:c="ER="+L(a,d.ra);break;case 23:c="SL="+L(a,d.mb);break;case 24:c="MMR0="+L(a,cd(d));break;case 25:c="MMR1="+L(a,ed(d));break;case 26:c="MMR2="+L(a,fd(d));break;case 27:c="MMR3="+L(a,d.Wa);break;case 28:a.v&&(c="AR="+L(a,a.v.Ca,3));break;case 29:a.v&& -(c="DR="+L(a,a.v.yb));break;case 30:a.v&&sc(a.v)&&(c="SR="+L(a,a.v.cb,3))}c&&(c+=" ");return c}function Vi(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ui(a,"T")+Ui(a,"N")+Ui(a,"Z")+Ui(a,"V")+Ui(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Ec=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Ec);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Jg:b,H:c,vd:d,ia:e,Cc:f})}function Wi(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.vd;if(e>=g&&eb)){e.u[b]= -g&65535;break}a.i("unknown register: "+f);return}a.A.xa();a.i("updated registers:")}}a.i(Vi(a,d));c&&(a.L=Y(e.u[7]),Ni(a,L(a,a.L.H)))}}function $i(a,b){b=ua(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Ti(a,b,g,f);a.i(f);a.L=b;e-=b.H-l;c++}}} -function Si(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+L(a,a.S.H)),a.L=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.na=null;if(yb(a)&&0n||"z"wa.length&&(a.i("note: only "+wa.length+" available"),ea=wa.length);ia-=ea;0>ia&&(null==wa[wa.length-1].H?(ea=ia+ea,ia=0):ia+=wa.length);var ce=[];"call"==gh&&($b=1E5,ce=["CALL"]);for(void 0!==fh&&a.i(ea+" instructions earlier:");0<$b&&ia!=a.da;){var jh=wa[ia++];if(null==jh.H)break;var ac=Y(jh.H),uj= -ea--,kh=Ti(a,ac,"history",uj);(!ce.length||0<=kh.indexOf(ce[0]))&&a.i(kh);ac.mc&&(ia+=ac.mc,$b-=ac.mc,ea-=ac.mc);ia>=wa.length&&(ia=0);a.qb=ea;ih++;$b--}}ih||(a.i("no "+hh+"history available"),a.qb=void 0)}else{var ub=Fi(a,va);if(ub){var bc=0,de=!1,ee="ds"==Sa;Ta&&(de=!0,"l"==Ta.charAt(0)&&(de=!1,Ta=Ta.substr(1)||tj),bc=si(a,Ta)>>>0,65536he?String.fromCharCode(he):"."),Wc=Wc>>8}Va&&(Va+="\n");Va=ee?Va+(Wa+","):Va+(va+": "+Wa+(0==Vc?" "+ge:""))}Va&&a.i(Va);a.Xa=ub}}}}break;case "e":if("else"==g[0])break;var wb,ie,je,ke,le=g[0],me=g[1];"eb"==le?(wb=1,ie=255,je=a.bc,ke= -a.Kb):"e"==le||"ew"==le?(wb=2,ie=65535,je=a.ua,ke=a.zb):me=null;if(null==me)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 Xc=Fi(a,me);if(Xc)for(var Yc=2;Ycpe;){for(var Xa=null,yj=256;65536>gc.H>>>0;){qe.H=a.ua(gc,2);if(null==gc.H||!yj--)break;if(!(qe.H&1)){for(var zj=a,Zc=qe,mh=null,hc=Zc.H,nh=hc,re=1;6>=re&&hc;re++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bej){if(gj(d,this.J)){this.B=new S(this,"1.30.5","failsafe");gj(this.B)&&(lj(this,d),a=2,mj(this.B));this.B.set("timestamp",Ca());nj(this.B);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=kj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?gj(d,g):("error"== -f&&"no machine state"!=g?(this.N("Error: "+g),"unable to verify user"==g&&(La("user",""),this.A=null)):this.i(f+": "+g),mj(d),gj(d)?(c=kj(d),e=!0):c=!1))}e&&jj(this,c?d:null)}else 2==a&&d.clear()}else jj(this);delete this.J;delete this.K}e=nb(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.C.la=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(oj(this,this.b,b,c,a),this.xa(),this.b.Ab());this.P&&(lj(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.g=0}; -function lj(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.A||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} -function bj(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.5"),g=new S(a,"1.30.5","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ha&&(c&&a.b.ba(),d=a.b.Ha(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.la=!1,!1===d&&(e=null)));for(var h=nb(a.id),l=0;lthis.b.kb?Bi:[];ad(this,16,function(a){a:{var b=d.w.ea,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(Ci(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.pa;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Gc[c],n&&d.i(p(n.id,8)+" %"+ +p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +k.Kc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.fb[a-8];else if(20>a)b=this.b.Pa[a-16];else{var c=this.b,d=this.v;switch(a){case 20:b=id(this.b);break;case 21:b=c.Lb;break;case 22:b=c.ra;break;case 23:b=c.nb;break;case 24:b=cd(c);break;case 25:b=ed(c);break;case 26:b=fd(c);break;case 27:b=c.Xa;break;case 28:d&&(b=d.Ca);break;case 29:d&&(b=d.Ab);break;case 30:d&&sc(d)&&(b=d.eb)}}return b}; +k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.va&65535).H));if(!this.na||a!=this.na)if(this.na=a,this.oa&1073741824)this.Z.push(a);else{var c;if(this.oa&-2147483648&&this.b&&(c=this.b.C.X)||xb(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Ld(a),a.ta=0,a.xa())}}; +function ui(a){var b;if(!Je(a))a.G&&a.G.length&&a.i("instruction history buffer freed"),a.da=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.K=Y(a.b.u[7]);b&&1!=a.P?Ji(a):Ki(a)}}function Ii(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.la?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.X?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ja=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Ia=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ui(this);this.za=0;this.na=null;this.J=0;this.K=Y(this.b.u[7]);this.C.X=!1;Li(this);a||Gd(this)};k.save=function(){var a=new S(this);a.set(0,Ei(this.K));a.set(1,Ei(this.S));a.set(2,[this.g,this.T,this.oa]);a.set(3,this.I);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Fi(a[b++]),this.S=Fi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.T=a[b][1],this.oa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.P||this.i("running");this.C.X=!0;this.Rb=a;this.Sb=b}; +k.stop=function(a,b){if(this.C.X){this.C.X=!1;this.J=b-this.Sb;if(!this.P){b="stopped";if(this.J){a-=this.Rb;var c=0d&&(d=oc(a.b,b)),65535!=(d&65535)&&(a.sc(a.G[a.da],b),++a.da==a.G.length&&(a.da=0)));return!1}function Qf(a){var b=a.b;if(b.C.X)throw T(b,a.b.va&65535),a.ba(),-1;return!1} +function ti(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.pa],!1)}a.M=["br"];if(a.F)for(b=1;b>>d.pa],!0);a.F=["bw"];a.$a=0}k.vb=function(a,b,c){var d=!0;c||Mi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.i("invalid address: "+L(this,b.H)),d=!1;else{var f=this.w;f.ea[e>>>f.pa].vb(e&f.w,a==this.F)}}d&&(a.push(b),c?b.Va=!0:(Ni(this,a,a.length-1,"set"),ui(this)));return d}; +function Mi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.pa],b==a.F));h.Va||ui(a);break}}return f}function Oi(a,b){for(var c=1;c>23)&65535,y=L(t,w);else if(8192==C)w=w.H-((f&63)<<1)&65535,y=L(t,w);else if(12288==C)y=L(t,f&7,1);else if(24576==C)y=L(t,f&63,1);else if(32768==C)y=L(t,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), +A&63)switch(A=C&7,C&56){case 0:y=Hi(A);break;case 8:y="@"+Hi(A);break;case 16:7>A?y="("+Hi(A)+")+":(C=t.ua(w,2),y="#"+L(t,C,0,!0));break;case 24:7>A?y="@("+Hi(A)+")+":(C=t.ua(w,2),y="@#"+L(t,C,0,!0));break;case 32:y="-("+Hi(A)+")";break;case 40:y="@-("+Hi(A)+")";break;case 48:C=t.ua(w,2);y=L(t,C,0,!0)+"("+Hi(A)+")";7==A&&(y=L(t,C+w.H&65535));break;case 56:C=t.ua(w,2),y="@"+L(t,C)+"("+Hi(A)+")",7==A&&(y="@"+L(t,C+w.H&65535))}t=y;if(!t||!t.length){h="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]); +0b)c=Hi(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.fb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Pa[b-16]);else switch(b){case 20:c="PS="+L(a,id(d));break;case 21:c="IR="+L(a,d.Lb);break;case 22:c="ER="+L(a,d.ra);break;case 23:c="SL="+L(a,d.nb);break;case 24:c="MMR0="+L(a,cd(d));break;case 25:c="MMR1="+L(a,ed(d));break;case 26:c="MMR2="+L(a,fd(d));break;case 27:c="MMR3="+L(a,d.Xa);break;case 28:a.v&&(c="AR="+L(a,a.v.Ca,3));break;case 29:a.v&& +(c="DR="+L(a,a.v.Ab));break;case 30:a.v&&sc(a.v)&&(c="SR="+L(a,a.v.eb,3))}c&&(c+=" ");return c}function Si(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ri(a,"T")+Ri(a,"N")+Ri(a,"Z")+Ri(a,"V")+Ri(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Gc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Gc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Lg:b,H:c,xd:d,ia:e,Ec:f})}function Ti(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.xd;if(e>=g&&eb)){e.u[b]= +g&65535;break}a.i("unknown register: "+f);return}a.A.xa();a.i("updated registers:")}}a.i(Si(a,d));c&&(a.K=Y(e.u[7]),Ki(a,L(a,a.K.H)))}}function Xi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Qi(a,b,g,f);a.i(f);a.K=b;e-=b.H-l;c++}}} +function Pi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+L(a,a.S.H)),a.K=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.na=null;if(yb(a)&&0n||"z"va.length&&(a.i("note: only "+va.length+" available"),da=va.length);ha-=da;0>ha&&(null==va[va.length-1].H?(da=ha+da,ha=0):ha+=va.length);var ae=[];"call"==dh&&(Yb=1E5,ae=["CALL"]);for(void 0!==ch&&a.i(da+" instructions earlier:");0=va.length&&(ha=0);a.sb=da;fh++;Yb--}}fh||(a.i("no "+eh+"history available"),a.sb=void 0)}else{var sb=Ci(a,ua);if(sb){var $b=0,be=!1,ce="ds"==Qa;Ra&&(be=!0,"l"==Ra.charAt(0)&&(be=!1,Ra=Ra.substr(1)||qj),$b=pi(a,Ra)>>>0,65536<$b&&($b=65536));for(var Sa="dd"==Qa?4:"db"==Qa?1:2,Sc=(be?$b-sb.H:Sa*$b)||128,de=ce?16:a.ma,sj=(Sc+de-1)/de|0||1,Ta="";sj--&&0fe?String.fromCharCode(fe):"."),Uc=Uc>>8}Ta&&(Ta+="\n");Ta=ce?Ta+(Ua+","):Ta+(ua+": "+Ua+(0==Tc?" "+ee:""))}Ta&&a.i(Ta);a.Ya=sb}}}}break;case "e":if("else"==g[0])break;var ub,ge,he,ie,je=g[0],ke=g[1];"eb"==je?(ub=1,ge=255,he=a.dc,ie= +a.Mb):"e"==je||"ew"==je?(ub=2,ge=65535,he=a.ua,ie=a.Bb):ke=null;if(null==ke)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Vc=Ci(a,ke);if(Vc)for(var Wc=2;Wcne;){for(var Va=null,vj=256;65536>ec.H>>>0;){oe.H=a.ua(ec,2);if(null==ec.H||!vj--)break;if(!(oe.H&1)){for(var wj=a,Xc=oe,jh=null,fc=Xc.H,kh=fc,pe=1;6>=pe&&fc;pe++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bbj){if(dj(d,this.I)){this.B=new S(this,"1.30.5","failsafe");dj(this.B)&&(ij(this,d),a=2,jj(this.B));this.B.set("timestamp",Ca());kj(this.B);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=hj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?dj(d,g):("error"== +f&&"no machine state"!=g?(this.N("Error: "+g),"unable to verify user"==g&&(La("user",""),this.A=null)):this.i(f+": "+g),jj(d),dj(d)?(c=hj(d),e=!0):c=!1))}e&&gj(this,c?d:null)}else 2==a&&d.clear()}else gj(this);delete this.I;delete this.J}e=nb(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.C.la=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(lj(this,this.b,b,c,a),this.xa(),this.b.Cb());this.P&&(ij(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.g=0}; +function ij(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.A||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} +function Zi(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.5"),g=new S(a,"1.30.5","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ia&&(c&&a.b.ba(),d=a.b.Ia(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.la=!1,!1===d&&(e=null)));for(var h=nb(a.id),l=0;l=c||30<=(b.Ob+=c))&&(d.textContent=b.C.W?b.na.toFixed(2)+"Mhz":"Stopped",b.Ob=0)}if(this.v&&(b=this.v,a=a||0,b.F)){c=b.b.C.W;d=!!(b.b.I&8);if(0>=a||60<=(b.B+=a)){for(var e=0;e=c||30<=(b.Qb+=c))&&(d.textContent=b.C.X?b.na.toFixed(2)+"Mhz":"Stopped",b.Qb=0)}if(this.v&&(b=this.v,a=a||0,b.F)){c=b.b.C.X;d=!!(b.b.L&8);if(0>=a||60<=(b.B+=a)){for(var e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Fj(a,b,c)}})}else c(a,null)} -function Gj(a,b,c,d){function e(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ra(a))}function f(a){e("Error: "+a);l&&(--sj||db(!0));l=!1}var g,h,l=!0;sj++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Dj(c,null,null,!1,e,function(d,l){l?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--sj||db(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--sj||db(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Dj(b,a,d,!0,e,m):Ej(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){db(!1);return Gj(a,b,c,d)};window.enableEvents=db;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map +k.wa=function(a,b,c){var d=this;switch(b){case "power":return this.D[b]=c,c.onclick=function(){d.g||(d.C.la?Zi(d,!1,!0):fj(d,d.Xb))},!0;case "reset":return this.D[b]=c,c.onclick=function(){if(d.C.la&&!d.g)if(d.f&&!d.G){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Zi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.pc=!0),d.Xb(bj),d.pc=!1)}else d.reset(),d.b&&d.b.Cb()},!0;case "save":if(pa(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.D[b]= +c,c.onclick=function(){var a=cj(d,!0);if(a){var b=!!(d.f&&!d.G||d.M),c=Zi(d,b);b?mj(d,a,c):d.N("Resume disabled, machine state not saved")}},!0}return!1}; +function cj(a,b){var c=a.A;c||((c=Ka("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=nj(a,c))||a.N("The user ID is invalid.")):b&&a.N("Browser local storage is not available"));return c} +function nj(a,b){a.A=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.A=b.data)}catch(d){v(d.message+" ("+c+")")}return a.A}function ej(a){var b=null;a.A&&(b=Fa()+"/api/v1/user?req=load&user="+a.A+"&state="+oj(a,"1.30.5"));return b} +function mj(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=oj(a,"1.30.5");d.data=c;b=Da(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Cj(a,b,c)}})}else c(a,null)} +function Dj(a,b,c,d){function e(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=sa(a))}function f(a){e("Error: "+a);l&&(--pj||db(!0));l=!1}var g,h,l=!0;pj++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Aj(c,null,null,!1,e,function(d,l){l?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--pj||db(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--pj||db(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Aj(b,a,d,!0,e,m):Bj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){db(!1);return Dj(a,b,c,d)};window.enableEvents=db;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.5/pdp11.js b/versions/pdpjs/1.30.5/pdp11.js index 196e45e90..9ccffc6a6 100644 --- a/versions/pdpjs/1.30.5/pdp11.js +++ b/versions/pdpjs/1.30.5/pdp11.js @@ -34,238 +34,237 @@ */ for(var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da":62,"?":63,"@":64,Rb:65,Se:66,Ue:67,sf:68,E:69,tf:70,uf:71,vf:72,wf:73,xf:74,yf:75,zf:76,Af:77,Bf:78,Cf:79,Df:80,Q:81,Ef:82,Ff:83,Gf:84,Hf:85,If:86,Jf:87,Kf:88,Lf:89,yc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Mf:97,Nf:98,Of:99,d:100,e:101,Qf:102,Rf:103,Sf:104,Tf:105,Wf:106,k:107,Xf:108,Yf:109,n:110,Zf:111,p:112,q:113,r:114,$f:115,t:116,ag:117,bg:118,cg:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,pc:127}; +var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},m={Ve:0,oc:1,Xe:2,Ye:3,Ze:4,$e:5,af:6,bf:7,Vb:8,cf:9,pc:10,df:11,ef:12,qc:13,ff:14,gf:15,hf:16,jf:17,kf:18,lf:19,mf:20,nf:21,pf:22,qf:23,rf:24,sf:25,tf:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, +"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Tb:65,Ue:66,We:67,uf:68,E:69,vf:70,wf:71,xf:72,yf:73,zf:74,Af:75,Bf:76,Cf:77,Df:78,Ef:79,Ff:80,Q:81,Gf:82,Hf:83,If:84,Jf:85,Kf:86,Lf:87,Mf:88,Nf:89,Ac:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Of:97,Pf:98,Qf:99,d:100,e:101,Sf:102,Tf:103,Uf:104,Vf:105,Yf:106,k:107,Zf:108,$f:109,n:110,ag:111,p:112,q:113,r:114,bg:115,t:116,cg:117,dg:118,eg:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,rc:127}; function q(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function ka(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function r(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})} -function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ra=Date.now||function(){return+new Date}; -function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function t(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== +e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ja(a,b){var c="";b?11>=3;return""+c}function r(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function t(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function na(a){return a.replace(/[&<>"']/g,function(a){return ma[a]})} +function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},qa=Date.now||function(){return+new Date}; +function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function v(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function ta(a,b){var c,d={M:null,ba:null,oa:null,na:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.oa=g.load;d.na=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ba=g.symbols;d.M.length?1==d.M.length&&(v(d.M[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.xa=this.id:(this.ya=this.id.substr(0,b),this.xa=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Fa:!1,Gb:!1,P:!1,error:!1};this.tb=null;this.o.error=!1;this.j={};this.G=null;this.Kc=d||0;x.push(this)}var Na=void 0,Oa={}; -if(window){Na||(Na=window.location.search.substr(1));for(var Pa,Qa=/\+/g,Ra=/([^&=]+)=?([^&]*)/g;Pa=Ra.exec(Na);)Oa[decodeURIComponent(Pa[1].replace(Qa," "))]=decodeURIComponent(Pa[2].replace(Qa," "))}function Sa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} -function y(a,b){b||(b=w);a.prototype=Sa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ta=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else Ta={},x=[];function Ua(a,b,c){Ta[a]&&b&&(Ta[a][b]=c)}function z(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Vc,a]}y(bb);var cb=7;function db(a,b){return a.b[b]&&a.b[b][1]}h=bb.prototype;h.reset=function(){this.stop()}; -h.aa=function(a,b,c,d){if(this.l&&this.l.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){eb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){fb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){eb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){fb(a,b)}}(this,b),!0):this.parent.aa.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;gb(b,this,hb);ib(b,this.reset.bind(this));jb(this);kb(this)};h.ja=function(a,b){b||(lb(),this.reset());return!0};h.ia=function(){return!0}; -function mb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function jb(a,b){for(var c in a.f)mb(a,c,null!=b?b:a.f[c])}function nb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function kb(a){for(var b in a.b)nb(a,b,a.b[b][1])}function ob(a,b,c,d){a.j[b]&&(void 0===c&&(Za(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.G&&a.G.b||8)?ja(c,d):ka(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} -function eb(a,b){var c=a.b[b];nb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.B="EXAM"==b)}function fb(a,b){var c=a.b[b];c[2]&&c[3]&&(nb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Tc=function(a){a||this.a.o.S||(a=this.a,a.h.reset(),pb(a),db(this,"ENABLE")&&qb(this.a))};h.Uc=function(){};h.Pc=function(a){a||G(this.a)}; -h.Nc=function(a){if(!a&&!this.a.o.S)if(db(this,"ENABLE"))qb(this.a);else{a=this.G;var b;if(b=a)a.o.Fa&&(a.o.Gb=!0),b=!a.o.Fa;if(b)Xa(a,!0),a.wb(0,null),Xa(a,!1);else try{var c=this.a.wb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Qa?8:16,c=65472<=a.ka&&a.ka<65472+b,b=c?1:2,c=c?15:a.h.Ca;db(a,"STEP")||(b=-b);zb(a,a.ka&~c|a.ka+b&c)}function zb(a,b){a.ka=b&a.h.Ca;b=a.ka;for(var c=0;22>c;c++)Ab(a,"A"+c,b&1<c;c++)Ab(a,"D"+c,b&1<>2;this.l=this.c-1;this.v=this.w/this.c|0;this.Ba=[];this.m=0;this.s=!1;this.A=[];this.zc=[Eb,Fb,Gb,Hb];a=new H(this);Ib(a,this.G);this.h=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.b;this.B=0;this.i=this.Ca;E(this)}y(Cb); -var Db=8192,Lb=Db-1;function Eb(a,b){var c=-1,d=this.controller,e=d.Ba[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ba[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255} -function Fb(a,b,c){var d=!1,e=this.controller,f=e.Ba[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ba[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Gb(a,b){var c=-1,d=this.controller;a=d.Ba[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535} -function Hb(a,b,c){var d=!1,e=this.controller;a=e.Ba[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Mb(a,b){if(b!=a.B){for(var c=0;c>>a.b,a.f[a.H]=a.h[a.F])}}Cb.prototype.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ea)return l.ib+=l.Ea-f,l.Ea=f,!0;if(f>=l.Ea+l.ib){p=l.size-(f-n);p>g&&(p=g);l.ib=f-l.Ea+p;f=n+a.c;g-=p;k++;continue}}return Nb(1,f,g)}f=new H(a,f,p,a.c,d,e);Ib(f,a.G,l);a.h[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Ob[d]+" at "+ja(b)),!0):Nb(2,b,c)}function Pb(a,b){return a.f[(b&a.i)>>>a.b].Lb(b&a.l,b)} -function Qb(a,b){return a.f[(b&a.i)>>>a.b].X(b&a.l,b)}function yb(a,b){a.s=!1;a.m++;b=a.h[(b&a.Ca)>>>a.b].ec(b&a.l,b);a.m--;return b}function Rb(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ca)>>>a.b].Qb(b&a.l,c&255,b);a.m--}function Sb(a,b,c){a.f[(b&a.i)>>>a.b].yb(b&a.l,c&65535,b)}function wb(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ca)>>>a.b].kc(b&a.l,c&65535,b);a.m--} -function Tb(a){for(var b=0,c=[],d=0;da.a.Qa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var u=g[4],A=g[5]||1,F=0;F>16&65535);a=a.Hb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.gd=function(){var a=this.a;a.Z&57344||(a.Ib=a.A&65535);return a.Ib};h.hd=function(){return this.a.Da};h.ge=function(a){var b=this.a;1170>b.Qa&&(a&=-49);b.Da!=a&&(b.Da=a,b.Xa=a&16?4194303:262143,ec(b))};h.Qd=function(a){a=a>>1&63;var b=this.a.hb[a>>1];return a&1?b>>16:b&65535}; -h.Oe=function(a,b){b=b>>1&63;var c=b>>1;this.a.hb[c]=b&1?this.a.hb[c]&65535|(a&63)<<16:this.a.hb[c]&-65536|a&65534};h.Jd=function(a){return this.a.J[1][a>>1&7]};h.He=function(a,b){this.a.J[1][b>>1&7]=a&65295};h.Hd=function(a){return this.a.J[1][(a>>1&7)+8]};h.Fe=function(a,b){this.a.J[1][(b>>1&7)+8]=a&65295};h.Id=function(a){return this.a.ca[1][a>>1&7]};h.Ge=function(a,b){b=b>>1&7;this.a.ca[1][b]=a;this.a.J[1][b]&=65295};h.Gd=function(a){return this.a.ca[1][(a>>1&7)+8]}; -h.Ee=function(a,b){b=(b>>1&7)+8;this.a.ca[1][b]=a;this.a.J[1][b]&=65295};h.bd=function(a){return this.a.J[0][a>>1&7]};h.ce=function(a,b){this.a.J[0][b>>1&7]=a&65295};h.$c=function(a){return this.a.J[0][(a>>1&7)+8]};h.ae=function(a,b){this.a.J[0][(b>>1&7)+8]=a&65295};h.ad=function(a){return this.a.ca[0][a>>1&7]};h.be=function(a,b){b=b>>1&7;this.a.ca[0][b]=a;this.a.J[0][b]&=65295};h.Zc=function(a){return this.a.ca[0][(a>>1&7)+8]};h.$d=function(a,b){b=(b>>1&7)+8;this.a.ca[0][b]=a;this.a.J[0][b]&=65295}; -h.Pd=function(a){return this.a.J[3][a>>1&7]};h.Ne=function(a,b){this.a.J[3][b>>1&7]=a&65295};h.Nd=function(a){return this.a.J[3][(a>>1&7)+8]};h.Le=function(a,b){this.a.J[3][(b>>1&7)+8]=a&65295};h.Od=function(a){return this.a.ca[3][a>>1&7]};h.Me=function(a,b){b=b>>1&7;this.a.ca[3][b]=a;this.a.J[3][b]&=65295};h.Md=function(a){return this.a.ca[3][(a>>1&7)+8]};h.Ke=function(a,b){b=(b>>1&7)+8;this.a.ca[3][b]=a;this.a.J[3][b]&=65295};h.Sa=function(a){a&=7;return this.a.D&2048?this.a.Ja[a]:this.a.g[a]}; -h.Ua=function(a,b){b&=7;this.a.D&2048?this.a.Ja[b]=a:this.a.g[b]=a};h.nd=function(){return this.a.D&49152?this.a.sa[0]:this.a.g[6]};h.le=function(a){this.a.D&49152?this.a.sa[0]=a:this.a.g[6]=a};h.qd=function(){return this.a.g[7]};h.oe=function(a){this.a.g[7]=a};h.Ta=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.Ja[a]};h.Va=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.Ja[b]=a};h.od=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.sa[1]}; -h.me=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.sa[1]=a};h.pd=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.sa[3]};h.ne=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.sa[3]=a};h.Yc=function(a){return this.a.hc[a-65504>>1]};h.Zd=function(a,b){this.a.hc[b-65504>>1]=a};h.dc=function(a){return 65520==a?(Ub(this.h)>>6)-1:0};h.jc=function(){};h.Ld=function(){return 1};h.Je=function(){};h.Xc=function(){return this.a.Y};h.Yd=function(){this.a.Y=0};h.dd=function(){return this.a.gc}; -h.ee=function(a,b){b&1||(a&=255);this.a.gc=a};h.jd=function(a,b){return b?0:this.a.vb};h.he=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.u|=1}b.vb=a};h.Kd=function(a,b){return b?0:this.a.gb&65280};h.Ie=function(a){this.a.gb=a|255};h.md=function(){return fc(this.a)};h.ke=function(a){gc(this.a,a&-1793|fc(this.a)&1792);this.a.u|=512};h.ic=function(){}; -var M={},ac=(M[61568]=[null,null,K.prototype.Qd,K.prototype.Oe,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Jd,K.prototype.He,"SIPDR",8,1145,64],M[62608]=[null,null,K.prototype.Hd,K.prototype.Fe,"SDPDR",8,1145,64],M[62624]=[null,null,K.prototype.Id,K.prototype.Ge,"SIPAR",8,1145,64],M[62640]=[null,null,K.prototype.Gd,K.prototype.Ee,"SDPAR",8,1145,64],M[62656]=[null,null,K.prototype.bd,K.prototype.ce,"KIPDR",8,1145,64],M[62672]=[null,null,K.prototype.$c,K.prototype.ae,"KDPDR",8,1145,64],M[62688]= -[null,null,K.prototype.ad,K.prototype.be,"KIPAR",8,1145,64],M[62704]=[null,null,K.prototype.Zc,K.prototype.$d,"KDPAR",8,1145,64],M[62798]=[null,null,K.prototype.hd,K.prototype.ge,"MMR3",1,1145,64],M[65382]=[null,null,K.prototype.cd,K.prototype.de,"LKS"],M[65402]=[null,null,K.prototype.ed,K.prototype.fe,"MMR0",1,1145,64],M[65404]=[null,null,K.prototype.fd,K.prototype.ic,"MMR1",1,1145,64],M[65406]=[null,null,K.prototype.gd,K.prototype.ic,"MMR2",1,1145,64],M[65408]=[null,null,K.prototype.Pd,K.prototype.Ne, -"UIPDR",8,1145,64],M[65424]=[null,null,K.prototype.Nd,K.prototype.Le,"UDPDR",8,1145,64],M[65440]=[null,null,K.prototype.Od,K.prototype.Me,"UIPAR",8,1145,64],M[65456]=[null,null,K.prototype.Md,K.prototype.Ke,"UDPAR",8,1145,64],M[65472]=[null,null,K.prototype.Sa,K.prototype.Ua,"R0SET0"],M[65473]=[null,null,K.prototype.Sa,K.prototype.Ua,"R1SET0"],M[65474]=[null,null,K.prototype.Sa,K.prototype.Ua,"R2SET0"],M[65475]=[null,null,K.prototype.Sa,K.prototype.Ua,"R3SET0"],M[65476]=[null,null,K.prototype.Sa, -K.prototype.Ua,"R4SET0"],M[65477]=[null,null,K.prototype.Sa,K.prototype.Ua,"R5SET0"],M[65478]=[null,null,K.prototype.nd,K.prototype.le,"R6KERNEL"],M[65479]=[null,null,K.prototype.qd,K.prototype.oe,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ta,K.prototype.Va,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Ta,K.prototype.Va,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Ta,K.prototype.Va,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Ta,K.prototype.Va,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Ta, -K.prototype.Va,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Ta,K.prototype.Va,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.od,K.prototype.me,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.pd,K.prototype.ne,"R6USER",1,1145],M[65504]=[null,null,K.prototype.Yc,K.prototype.Zd,"CTRL",8,1170],M[65520]=[null,null,K.prototype.dc,K.prototype.jc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.dc,K.prototype.jc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Ld,K.prototype.Je,"SYSID",1,1170],M[65526]= -[null,null,K.prototype.Xc,K.prototype.Yd,"CPUERR",1,1170],M[65528]=[null,null,K.prototype.dd,K.prototype.ee,"MB",1,1170],M[65530]=[null,null,K.prototype.jd,K.prototype.he,"PIR"],M[65532]=[null,null,K.prototype.Kd,K.prototype.Ie,"SL"],M[65534]=[null,null,K.prototype.md,K.prototype.ke,"PSW"],M); -Ja(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),oc(this,kc?pc:qc);else{a=this.a=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},fa:function(a,b){a&1&&I(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},la:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ua=!0},F:function(a,b){return this.H(a,b)},T:function(a,b){return this.ec(a,b)},ya:function(a,b,c){this.l?this.f(a,b,c):this.Qb(a,b,c)},ta:function(a,b,c){this.l?this.f(a,b,c):this.kc(a,b,c)},B:function(a){return this.j[a]},I:function(a){return this.j[a]},R:function(a,b){a&1&&I(this.h,b,64);return this.c.getUint16(a,!0)},ea:function(a,b){a&1&&I(this.h,b,64);return this.s[a>>1]},xa:function(a,b){this.j[a]=b;this.ua=!0},qa:function(a,b){this.j[a]=b;this.ua=!0},ma:function(a,b,c){a&1&&I(this.h, -c,64);this.c.setUint16(a,b,!0);this.ua=!0},za:function(a,b,c){a&1&&I(this.h,c,64);this.s[a>>1]=b;this.ua=!0}};function Ib(a,b,c){a.G=b;a.i=a.m=0;c&&((a.i=c.i)&&tc(a,uc,!1),(a.m=c.m)&&vc(a,uc,!1))}function vc(a,b,c){c&&a.m||(a.xb=!a.l&&b[1]||a.f,a.yb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Qb=b[1]||a.f,a.kc=b[3]||a.A}function tc(a,b,c){c&&a.i||(a.Lb=b[0]||a.v,a.X=b[2]||a.w);if(c||void 0===c)a.H=b[0]||a.v,a.ec=b[2]||a.w}function oc(a,b){b||(b=wc);tc(a,b,void 0);vc(a,b,void 0)} -var wc=[],sc=[H.prototype.L,H.prototype.la,H.prototype.fa,H.prototype.Aa],uc=[H.prototype.F,H.prototype.ya,H.prototype.T,H.prototype.ta];if($a)var qc=[H.prototype.B,H.prototype.xa,H.prototype.R,H.prototype.ma],pc=[H.prototype.I,H.prototype.qa,H.prototype.ea,H.prototype.za]; -function xc(a,b){w.call(this,"CPU",a,xc,1);b=a.cycles||b;var c=a.multiplier||1;this.Ab=0;this.ob=b;this.ma=c;this.Db=Math.round(this.ob/1E4)/100;this.Ka=this.Db*this.ma;this.o.S=!1;this.o.Nb=!1;this.o.cb=a.autoStart;this.o.rb=!1;this.mb=this.La=0;this.nb=a.csStart;this.Ya=a.csInterval;this.Za=a.csStop;this.L=[];this.cc=this.Vd.bind(this);E(this)}y(xc);var yc=["power","reset"];h=xc.prototype; -h.ha=function(a,b,c,d){this.l=a;this.h=b;this.G=d;this.w=a.w;for(b=0;b=a.La&&(a.La+=a.Ya,c=!0);0<=a.Za&&a.Za<=Cc(a)&&(a.Ya=a.Za=-1,Bc(a),G(a),c=!0);c&&a.V(Cc(a)+" cycles: checksum="+ka(a.mb))}} -h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.o.P)a=!0;else{var b=null,c,k=z(a.id);for(c=0;ca.Aa/a.Ka&&(b=1);a.ma=b;b=a.Db*a.ma;if(a.Ka!=b){a.Ka=b;b=a.Ka.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.V("target speed: "+b)}c&&a.l&&Fc(a.l)}sb(a,a.fa);a.fa=0;a.ea=ra();a.qa=0;Ec(a)}function Yb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Zb(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.ob*a.ma/1E3*c|0,a.o.S&&(c+=Gc(a)),a.L[b][0]=c)} -function rb(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Gc(a,b){var c=a.la-=a.a;a.a=a.I=0;b&&(a.la=0);return c} -h.Vd=function(){if(this.o.S){this.Fb>=this.ob&&Ec(this,!0);this.ab=0;this.lb=ra();if(this.qa){var a=this.lb-this.qa;a>this.$b&&(this.ea+=a,this.ea>this.lb&&(this.ea=this.lb))}try{do{for(var b,c=this.o.rb?1:this.pb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.wb(b)}catch(f){if("number"!=typeof f)throw f;}b=Gc(this,!0);this.ab+=b;this.fa+=b;tb(this,b);rb(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.pb;15<=++this.bc&&(this.wa(),this.bc=0);break}}while(this.o.S)}catch(f){G(this); -this.l&&this.l.stop(ra(),Cc(this));Za(this,f.stack||f.message);return}if(this.o.S){a=setTimeout;b=this.cc;this.qa=ra();c=this.$b;this.ab&&(c=Math.round(c*this.ab/this.pb));c-=this.qa-this.lb;if(d=this.qa-this.ea)this.Aa=Math.round(this.fa/(10*d))/100,864E5<=d&&(this.ta=0,Dc(this));if(0>c||this.Aac&&(this.ea-=c),c=0;this.Fb+=this.ab;this.qa+=c;a(b,c)}}}; -function qb(a){var b;a.o.error?(a.V(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.S)a.V(a.toString()+" busy");else{Dc(a);a.o.S=!0;a.o.Nb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.ea,Cc(a));setTimeout(a.cc,0)}}h.wb=function(){return 0};function G(a){var b=!1;if(a.o.S){Gc(a);sb(a,a.fa);a.fa=0;a.o.S=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(ra(),Cc(a));b=!0}a.o.complete=void 0;return b} -function Hc(a){this.Qa=+a.model||1170;this.Wb=a.addrReset||0;xc.call(this,a,6666667);this.qb=0;this.Zb=255;1120==this.Qa?(this.decode=Ic.bind(this),this.za=this.Dc,this.qb=8,this.Zb=-1):(this.decode=Jc.bind(this),this.za=this.Ec);Kc(this);this.Ma=0;this.H=null;this.Bb=[];this.o.complete=!1}y(Hc,xc);h=Hc.prototype;h.Sb=function(){for(var a=192,b=0;bc.Pb&&(c.Pb=a,a+=4)}}; -h.reset=function(){this.status("model "+this.Qa);this.o.S&&G(this);Kc(this);Ac(this);this.o.error=!1;this.parent.reset.call(this)}; -function Kc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.Wb,-1,-2,-3,-4,-5,-6,-7,-8];a.Ja=[0,0,0,0,0,0];a.sa=[0,0,0,0];a.v=0;a.kb=0;a.Lc=[4,2,0,1];a.J=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ca=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0]];a.hb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.hc=[0,0,0,0,0,0,0,0];a.gc=0;a.u=0;a.B=a.F=0;a.c=a.b=a.zb=0;a.Na=-1;pb(a)}function pb(a){a.Z=0;a.Hb=0;a.Ib=0;a.Da=0;a.Y=0;a.vb=0;a.gb=255;a.Wa=0;a.jb=0;a.Xa=262143;a.bb=0;a.A=0;a.H=null;a.h&&(ec(a),a.Jc=Ub(a.h))}function ec(a){a.Wa?(a.T=65536,a.Cb=a.Da&16?4186112:253952,a.R=a.Hc,a.X=a.Rd,a.yb=a.Pe,Mb(a.h,a.Da&16?22:18)):(a.T=0,a.Cb=57344,a.R=a.Gc,a.X=a.fc,a.yb=a.lc,Mb(a.h,16))} -function dc(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Hb=a.A>>16&65535,a.Ib=a.A&65535);a.Z=b;a.jb=b>>5&3;a.kb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Wa!=c&&(a.Wa=c,ec(a))}}h.Yb=function(){return 0};h.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ta,this.ma]);a.set(2,Tb(this.h));return a.data()}; -h.restore=function(a){var b=a[1];this.ta=b[1];Dc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.D>>14&3;a.v!=c&&(a.sa[c]=a.g[6],a.g[6]=a.sa[a.v]);a.D=b;a.u&=-3;a.u|=a.H?2:1}function S(a,b){a.u&512||(a.s=a.i=b,a.f=0)} -function Pc(a,b,c){a.u&512||(a.s=a.i=a.m=b,a.f=c||0)}function Qc(a,b,c,d){a.u&512||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Rc(a,b){a.u&512||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Sc(a,b,c,d){a.u&512||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} -function J(a,b,c,d){if(!a.Ma){0>a.Na?a.Na=fc(a):a.v||(d=-4);-4==d&&(a.u&256&&(d=-1),a.u|=256,a.Y|=4,a.g[6]=b=4);if(-1!=d){a.A=b|4143316992;a.v=0;var e=a.X(b|a.T),f=a.X(b+2&65535|a.T);gc(a,f&-12289|a.Na>>2&12288);Tc(a,a.Na);Tc(a,a.g[7]);R(a,e)}a.a-=5;a.u&=~(c|19);a.u|=129;a.Na=-1;-1==d&&G(a);if(-4<=d)throw b;}}function Uc(a){var b=Vc(a),c=Vc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);R(a,b);gc(a,c);a.u&=-17} -function Wc(a,b){var c=b>>13&31;31>c&&(b=a.Da&32?a.hb[c]+(b&8190)&4194302:b&-3932161);return b} -function xb(a,b,c){var d,e,f;if(!(c&a.Wa))return f=b&65535,57344<=f&&(f|=a.Cb),f;d=b>>13;a.Da&a.Lc[a.v]||(d&=7);e=a.J[a.v][d];f=(a.ca[a.v][d]<<6)+(b&8191)&a.Xa;3932160<=f&&(f=Wc(a,f));if(a.Ma)return f;f>=a.Jc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.J[a.v][d]=e;if(f!=(4194170&a.Xa)||a.v)a.jb=a.v,a.kb=d;g&&(g&57344&&(0<=a.Na&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.jb<<5|a.kb<<1,dc(a,a.Z&-61695|g&61694)),J(a,168,64,-2)),a.Z&61440||!(f<(4191360&a.Xa)||f>(4194239&a.Xa))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Vc(a){var b=a.X(a.g[6]|a.T);a.g[6]=a.g[6]+2&65535;return b}function Tc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;a.u&256||a.za(4,-2,c);a.yb(c,b)} -function Xc(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return J(a,4,0,-3),0;case 1:return 6==c&&a.za(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.za(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.X(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.za(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.X(e)|g;a.a-=8;break;case 6:return e=a.X(Nc(a,2)),e=e+a.g[c]&65535,6==c&&a.za(d,0, -e),a.a-=6,e|g;case 7:return e=a.X(Nc(a,2)),e=e+a.g[c]&65535,e=a.X(e|a.T),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Dc=function(a,b,c){!this.v&&0>=b&&c<=this.gb&&(this.u|=32)};h.Ec=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.gb&&(c<=this.gb-32?J(this,4,0,-4):(this.Y|=8,this.u|=32)))};h.Gc=function(a,b,c){a=Xc(this,a,b,c);3932160<=a&&(a=Wc(this,a));return a};h.Hc=function(a,b,c){return xb(this,Xc(this,a,b,c),c)}; -h.fc=function(a){3932160<=a&&(a=Wc(this,a));return Qb(this.h,this.bb=a)};h.Rd=function(a){return Qb(this.h,this.bb=xb(this,a,2))};h.lc=function(a,b){3932160<=a&&(a=Wc(this,a));Sb(this.h,this.bb=a,b&65535)};h.Pe=function(a,b){Sb(this.h,this.bb=xb(this,a,4),b)};function Yc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Xc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.v=a.D>>12&3,c=a.X(d|c&a.T),a.v=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.sa[a.D>>12&3];return c} -function Zc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Xc(a,b,e,4),c&65536||(e&=65535),a.v=a.D>>12&3,e=xb(a,e|c&65536,4),a.v=a.D>>14&3,Sb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.sa[a.D>>12&3]=d}function $c(a,b){b>>=6;var c=a.F=b&7;(b=a.B=(b&56)>>3)?(c=a.R(b,c,3),a=Pb(a.h,c)):a=a.g[c+a.qb]&a.Zb;return a}function ad(a,b){b>>=6;var c=a.F=b&7;return(b=a.B=(b&56)>>3)?Qb(a.h,a.R(b,c,2)):a.g[c+a.qb]} -function bd(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Xc(a,b,c,8)}function cd(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.R(b,c,3),a=Pb(a.h,c)):a=a.g[c]&255;return a}function dd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Qb(a.h,a.R(b,c,2)):a.g[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.zb=a.R(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Pb(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].xb(e&a.l,c&255,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,6),Sb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Qb(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function ed(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,e,5),e=c=0>c?a.g[-c-1]&255:c,d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].xb(d&a.l,e&255,d)):c?(c=0>c?a.g[-c-1]&255:c,a.g[e]=a.g[e]&~d|c<<24>>24&d):a.g[e]&=~d;return c} -function fd(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,d,4),Sb(a.h,d,c=0>c?a.g[-c-1]:c)):a.g[d]=c=0>c?a.g[-c-1]:c;return c}function V(a,b,c){c&&(R(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} -h.wb=function(a){this.o.complete=!0;var b=a?this.o.Nb?0:1:-1;this.o.Nb=!1;this.la=this.a=a;do{if(this.u){if(a=this.u&11){a=!1;if(this.u&2){var c=160,d=(this.vb&224)>>5,e=this.H&&this.H.Ra>d?this.H:null;e&&(c=e.Pb,d=e.Ra);d>(this.D&224)>>5?(this.u&8&&(Nc(this,2),this.u&=-9),J(this,c,0,-10),d=!0):d=!1;d&&(e&&bc(this,e),a=!0);this.H||this.vb||(this.u&=-3)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Oc(this)&&0>b)break}this.u=this.u&15|this.D&16;this.decode(Mc(this))}while(0>1|b<<16;Rc(this,a);return a&65535} -function ld(a,b){a=b&128|b>>1|b<<8;Rc(this,a<<8);return a&255}function md(a,b){a=b&~a;S(this,a);return a}function nd(a,b){a=b&~a;S(this,a<<8);return a}function od(a,b){a|=b;S(this,a);return a}function pd(a,b){a|=b;S(this,a<<8);return a}function qd(a,b){a=~b|65536;Pc(this,a);return a&65535}function rd(a,b){a=~b|256;Pc(this,a<<8);return a&255}function sd(a,b){a=b-a;this.u&512||(this.s=this.i=a,this.f=b&(b^a));return a&65535} -function td(a,b){a=b-a;var c=a<<8;b<<=8;this.u&512||(this.s=this.i=c,this.f=b&(b^c));return a&255}function ud(a,b){a=b+a;this.u&512||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function vd(a,b){a=b+a;var c=a<<8;this.u&512||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function wd(a,b){a=-b;Pc(this,a,a&b&32768);return a&65535}function xd(a,b){a=-b;Pc(this,a<<8,(a&b&128)<<8);return a&255}function yd(a,b){a=b<<1|this.m>>16&1;Rc(this,a);return a&65535} -function zd(a,b){a=b<<1|this.m>>16&1;Rc(this,a<<8);return a&255}function Ad(a,b){a=(this.m&65536|b)>>1|b<<16;Rc(this,a);return a&65535}function Bd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Rc(this,a<<8);return a&255}function Cd(a,b){var c=b-a;Sc(this,c,a,b);return c&65535}function Dd(a,b){var c=b-a;Sc(this,c<<8,a<<8,b<<8);return c&255}function Ed(a,b){this.u&512||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535}function Fd(a,b){a^=b;S(this,a);return a&65535} -function Gd(a){U(this,a,ad(this,a),gd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Hd(a){var b=dd(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} -function Id(a){var b=dd(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Jd(a){V(this,a,!Q(this))}function Kd(a){V(this,a,Q(this))} -function Ld(a){U(this,a,ad(this,a),md);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Md(a){T(this,a,$c(this,a),nd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Nd(a){U(this,a,ad(this,a),od);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Od(a){T(this,a,$c(this,a),pd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function Pd(a){var b=ad(this,a);a=dd(this,a);S(this,(0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Qd(a){var b=$c(this,a);a=cd(this,a);S(this,((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Rd(a){V(this,a,this.i&65535?0:4)}function Sd(a){V(this,a,!Lc(this)==!(this.f&32768))}function Td(a){V(this,a,!!(this.i&65535)&&!Lc(this)==!(this.f&32768))} -function Ud(a){V(this,a,!Q(this)&&!!(this.i&65535))}function Vd(a){V(this,a,(this.i&65535?0:4)||!Lc(this)!=!(this.f&32768))}function Wd(a){V(this,a,Q(this)||(this.i&65535?0:4))}function Xd(a){V(this,a,!Lc(this)!=!(this.f&32768))}function Yd(a){V(this,a,Lc(this))}function Zd(a){V(this,a,!!(this.i&65535))}function $d(a){V(this,a,!Lc(this))}function ae(){J(this,12,0,-9)}function be(a){V(this,a,!0)}function ce(a){V(this,a,!(this.f&32768))}function de(a){V(this,a,this.f&32768?2:0)} -function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function ee(a){var b=ad(this,a);a=dd(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Sc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fe(a){var b=$c(this,a);a=cd(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Sc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} -function ge(a){var b=dd(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function he(){J(this,24,0,-9);this.a-=20} -function ie(){this.D&49152?(this.Y|=128,J(this,4,0,-8)):(this.w&&1120==this.Qa&&this.w.setData(this.g[0],!0),this.G?this.G.c():G(this));this.a-=7}function je(){J(this,16,0,-9);this.a-=20}var ke=[0,7,7,10,7,11,9,13];function le(a){this.I=this.a;R(this,bd(this,a));this.a=this.I-ke[this.c]}var me=[0,14,14,17,14,18,16,20];function ne(a){this.I=this.a;var b=bd(this,a);a=a>>6&7;Tc(this,this.g[a]);this.g[a]=this.g[7];R(this,b);this.a=this.I-me[this.c]}var oe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function pe(a){var b=ad(this,a);this.I=this.a;S(this,fd(this,a,b));this.a=this.I-oe[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function qe(a){var b=$c(this,a);S(this,ed(this,a,b,65535)<<8);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var re=[7,13,13,17,14,18,17,21]; -function se(a){var b=dd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.u&512||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)R(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ye(a){U(this,a,ad(this,a),Cd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ze(a){U(this,a,0,Ed);this.a-=this.c?9:3+(7==this.b?2:0)}function Ae(){J(this,28,0,-9)} -function Be(){this.w&&(this.w.ka=this.g[7],this.w.setData(this.g[0],!0));this.u|=8;Nc(this,-2);this.a-=3}function Ce(a){U(this,a,this.g[(a>>6&7)+this.qb],Fd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,0,-9)}function Ic(a){De[a>>12].call(this,a)}function Ee(a){Fe[a>>6&3].call(this,a)}function Ge(a){He[a>>6&3].call(this,a)}function Ie(a){Je[a>>6&3].call(this,a)}function Ke(a){Le[a&15].call(this,a)}function Me(a){Ne[a&15].call(this,a)}function Oe(a){Pe[a>>6&3].call(this,a)} -function Qe(a){Re[a>>6&3].call(this,a)}function Se(a){Te[a>>6&3].call(this,a)} -var De=[function(a){Ue[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,Gd,Y,function(a){Ve[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,ye,Y],Ue=[function(a){We[a>>4&15].call(this,a)},be,Zd,Rd,Sd,Xd,Td,Vd,ne,ne,Ee,Ge,Ie,Y,Y,Y],Fe=[function(a){Pc(this,fd(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)}],He=[function(a){U(this,a,0, -wd);this.a-=this.c?11:6},function(a){U(this,a,Q(this)?1:0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,Q(this)?1:0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=dd(this,a);Pc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Je=[function(a){U(this,a,0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,kd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)}], -We=[function(a){Xe[a&15].call(this,a)},Y,Y,Y,le,le,le,le,ve,Y,Ke,Me,ze,ze,ze,ze],Xe=[ie,Be,we,ae,je,ue,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Le=[te,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ne=[te,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Ve=[$d,Yd,Ud,Wd,ce,de,Jd,Kd,he,Ae,Oe,Qe,Se,Y,Y,Y],Pe=[function(a){Pc(this, -ed(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,td);this.a-=this.c?9:3+(7==this.b?2:0)}],Re=[function(a){T(this,a,0,xd);this.a-=this.c?11:6},function(a){T(this,a,Q(this)?1:0,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,Q(this)?1:0,Dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=cd(this,a);Pc(this,a<<8);this.a-=this.c?4:3+(7== -this.b?2:0)}],Te=[function(a){T(this,a,0,Bd);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ld);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,jd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Jc(a){Ye[a>>12].call(this,a)} -var Ye=[function(a){Ze[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,Gd,function(a){$e[a>>8&15].call(this,a)},function(a){af[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,ye,Y],Ze=[function(a){bf[a>>4&15].call(this,a)},be,Zd,Rd,Sd,Xd,Td,Vd,ne,ne,Ee,Ge,Ie,function(a){cf[a>>6&3].call(this,a)},Y,Y],cf=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.X(a|this.T);R(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Yc(this,a,0);Tc(this,a);S(this,a);this.a-=11},function(a){var b=Vc(this);this.I= -this.a;Zc(this,a,0,b);S(this,b);this.a=this.I-re[this.c]},function(a){S(this,fd(this,a,Lc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],bf=[function(a){df[a&15].call(this,a)},Y,Y,Y,le,le,le,le,ve,function(a){a&8?(this.D&49152||(this.D=this.D&-2017|(a&7)<<5,this.u|=1,this.u&=-3),this.a-=5):J(this,8,0,-9)},Ke,Me,ze,ze,ze,ze],df=[ie,Be,function(){Uc(this);this.u|=this.D&16;this.a-=13},ae,je,ue,we,function(){J(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],$e=[se,se,ge,ge,Hd,Hd,Id,Id,Ce,Ce,Y,Y,Y,Y,xe,xe],af=[$d, -Yd,Ud,Wd,ce,de,Jd,Kd,he,Ae,Oe,Qe,Se,function(a){ef[a>>6&3].call(this,a)},Y,Y],ef=[Y,function(a){a=Yc(this,a,65536);Tc(this,a);S(this,a);this.a-=11},function(a){var b=Vc(this);this.I=this.a;Zc(this,a,65536,b);S(this,b);this.a=this.I-re[this.c]},Y]; -function ff(a){w.call(this,"ROM",a,ff,128);this.ba=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.f=a.alias;this.l=a.file;this.s=r(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;t(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ua(c.ya,a,b),(a=ta(a,b))?(c.c=a.M,c.ba=a.ba):c.l=null);gf(c)})}}y(ff);h=ff.prototype; -h.ha=function(a,b,c,d){this.h=b;this.a=c;this.G=d;gf(this)};h.ja=function(){this.ba&&(this.G&&this.G.a(this.id,this.i,this.b,this.ba),delete this.ba);return!0};h.ia=function(){return!0}; -function gf(a){if(!Ya(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Za(a,"ROM size ("+ka(a.c.length,8,!0)+") does not match specified size ("+ka(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Db){var c={};b=(c[b]=[ff.prototype.Fd,ff.prototype.De,null,null,null,a.b>>1],c);if(gb(a.h,a,b)){b=a.m=!0;break a}}else if(Jb(a.h,b,a.b,nc)){for(c=0;c>>f.b;0>>=f.b;0>>a.b;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,A=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(A)for(;A--;)Rb(a.h,p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=m.Rb&&c<=m.yc&&(b=c-(m.Rb-m.mc));b&&(a.preventDefault&&a.preventDefault(),d.ub(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.oc&&(b=m.nc);d.ub(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&& -a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ub(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ha=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;var e=this;this.T=$b(this.a,this.A?-1:48,4,262144);this.fa=Yb(this.a,function(){var a;a=-1;e.v.length&&(a=e.v.shift()&255,e.qa&&97<=a&&122>a&&(a-=32),Zb(e.a,e.fa,1E3/Math.round(e.L/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&L(c,e.T))});this.I=$b(this.a,this.A?-1:52,4,262144);this.ma=Yb(this.a,function(){e.c|=128;e.c&64&&L(c,e.I)});gb(b,this,nf,this.A?64832+8*(this.A-1)-65392:0);ib(b,this.reset.bind(this));E(this)}; -h.ac=function(a){if(!this.i){var b=zc(this.l,"connection");if(b){var c=b.split("->");if(2==c.length){var d=pa(c[0]);if(d!=this.xa)return;c=pa(c[1]);if(this.i=Va(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.w);if(this.F=e.receiveData){this.w=a;this.H=e.receiveStatus;this.status(this.ya+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.ja=function(a,b){if(!b)if(this.ac(this.w),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){of(this)};h.save=function(){var a=new P(this);a.set(0,[]);return a.data()};h.restore=function(){return of(this)};function of(a){a.B=0;a.b=8192;a.c=128;a.v=[];return!0} -h.ub=function(a){if("number"==typeof a)this.v.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.ea||8,c=a-this.s%a,this.ea&&(b=" ".slice(0,c)));this.R&&!this.s&&c&&(b=String.fromCharCode(this.R)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}}else if(null!=this.m){if(10== -a||1024<=this.m.length)this.V(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}Zb(this.a,this.ma,1E3/Math.round(this.la/10));this.c&=-129};var pf={},nf=(pf[65392]=[null,null,Z.prototype.sd,Z.prototype.qe,"RCSR"],pf[65394]=[null,null,Z.prototype.rd,Z.prototype.pe,"RBUF"],pf[65396]=[null,null,Z.prototype.Td,Z.prototype.Re,"XCSR"],pf[65398]=[null,null,Z.prototype.Sd,Z.prototype.Qe,"XBUF"],pf); -Ja(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.j[b]=c,c.onclick= -function(){var a=d.j.listTapes;a&&sf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;sf(d,r(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.j[b]=c,!0}return!1}; -h.ha=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;this.L=tf(a);var e=this;if((this.c=zc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){v("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.H=$b(this.a,56,4,4096);this.T=Yb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):ua()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!t(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ua(a.ya,e,f),(e=ta(e,f))&&Cf(a,b,c,d,e.M,e.oa,e.na)); -a.o.Fa=!1;a.m&&(a.m--,a.m||E(a));zf(a)})}function wf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.K);for(d=0;dc.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=ua()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.sb?"":e)+"&format=json"));return!!t(f, -null,!0,function(b,c,d){Jf(a,b,c,d)})} -function Jf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.o.P;if(d)a.controller.C('Unable to load disk "'+a.pa+'" (error '+d+": "+b+")",f);else{Ua(a.controller.ya,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.K=k.length;a.O=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var A=l.bytes;if(void 0!==A&&A.length){for(var F=n<<2,za=A.length;za>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ga?f=a.ra+a.ga&&(a.ga+=f-(a.ra+a.ga)+1):(a.ra=f,a.ga=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.pa+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=Lf(this,a++);)Of(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Of(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function O(a){w.call(this,"RK11",a,O,65536);this.w=a.autoMount||{};this.m=0;this.c=Array(8);this.A=!Ca("Mobi")&&window&&"FileReader"in window}y(O);h=O.prototype; -h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Pf(d,a)},!0;case "loadDrive":return this.j[b]= -c,c.onclick=function(){var a=d.j.listDisks;a&&Qf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Da(Nf(a),a.Mb.replace(".json",".img")),v(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.A)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Qf(d,r(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ha=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;if((a=zc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);Rf(this);this.Oa=$b(this.a,144,5,65536);gb(b,this,Sf);ib(b,this.reset.bind(this));Tf(this,"None","",!0);this.A&&Tf(this,"Local Disk","?");Tf(this,"Remote Disk","??");Uf(this)||E(this)}; -h.ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Jb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Pf(this,0)}}return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){Rf(this)};h.save=function(){return(new P(this)).data()}; -h.restore=function(a){return Rf(this,a[0])};function Uf(a,b){b||(a.m=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=r(c);a.status("Attempting to load "+c+' as "'+b+'"')}Wf(a,e,b,c,!1,d)}else Vf(a,e)} -function Wf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,Vf(a,b,!0),k.Ha?a.C("RK11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.m++),k.va=!!f,If(new Ef(a,k,"preload"),c,d,f,a.rc)&&g++));return g}h.rc=function(a,b,c,d,e){a.Ha=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ia)),b=null);b?(a.W=b,a.pa=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ia),a.Ga||e),this.l&&Fc(this.l)):a.va=!1;a.Ga&&(a.Ga=!1,--this.m||E(this));Pf(this,a.Ia)}; -function Tf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.v=65536-e&65535;a&&(this.i=this.i|a|32768,this.b|=49152);return!0}; -h.sc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=4096;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=32;break}wb(this.h,f,p|u<<8);if(Xb(this.h)){k=1024;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)}; -h.tc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){var p=yb(this.h,f);if(Xb(this.h)){k=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=4096;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=32;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)};h.xd=function(){return this.B};h.ve=function(){};h.yd=function(){return this.i};h.we=function(){};h.ud=function(){return this.b&61438}; -h.se=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.c[a],e,f,g,k;this.b&=-129;switch(this.b&14){case 0:this.B=d.status;this.i=0;this.b=128;this.f=0;break;case 4:b=this.sc;case 2:b||(b=this.tc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):(k=(this.b&48)<<12|this.s,c=65536-this.v&65535,c=b.call(this,d,e,f,g,c,k,this.qc.bind(this)))}this.B=d.status|a<<13|this.f%9&15;c&&(this.b&= --2,this.b|=128,this.b&64&&L(this.a,this.Oa))}};h.zd=function(){return this.v};h.xe=function(a){this.v=a};h.td=function(){return this.s};h.re=function(a){this.s=a};h.vd=function(){return this.f};h.te=function(a){this.f=a};h.wd=function(){return this.F};h.ue=function(a){this.F=a}; -var Xf={},Sf=(Xf[65280]=[null,null,O.prototype.xd,O.prototype.ve,"RKDS"],Xf[65282]=[null,null,O.prototype.yd,O.prototype.we,"RKER"],Xf[65284]=[null,null,O.prototype.ud,O.prototype.se,"RKCS"],Xf[65286]=[null,null,O.prototype.zd,O.prototype.xe,"RKWC"],Xf[65288]=[null,null,O.prototype.td,O.prototype.re,"RKBA"],Xf[65290]=[null,null,O.prototype.vd,O.prototype.te,"RKDA"],Xf[65294]=[null,null,O.prototype.wd,O.prototype.ue,"RKDB"],Xf); -function N(a){w.call(this,"RL11",a,N,131072);this.A=a.autoMount||{};this.v=0;this.c=Array(4);this.B=!Ca("Mobi")&&window&&"FileReader"in window}y(N);h=N.prototype; -h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Yf(d,a)},!0;case "loadDrive":return this.j[b]= -c,c.onclick=function(){var a=d.j.listDisks;a&&Zf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Da(Nf(a),a.Mb.replace(".json",".img")),v(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Zf(d,r(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ha=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;if((a=zc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);$f(this);this.Oa=$b(this.a,112,5,131072);gb(b,this,ag);ib(b,this.reset.bind(this));bg(this,"None","",!0);this.B&&bg(this,"Local Disk","?");bg(this,"Remote Disk","??");cg(this)||E(this)}; -h.ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Jb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Yf(this,0)}}return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){$f(this)};h.save=function(){return(new P(this)).data()}; -h.restore=function(a){return $f(this,a[0])};function cg(a,b){b||(a.v=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=r(c);a.status("Attempting to load "+c+' as "'+b+'"')}eg(a,e,b,c,!1,d)}else dg(a,e)} -function eg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,dg(a,b,!0),k.Ha?a.C("RL11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.v++),k.va=!!f,If(new Ef(a,k,"preload"),c,d,f,a.vc)&&g++));return g}h.vc=function(a,b,c,d,e){a.Ha=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.W=b,a.pa=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ia),a.Ga||e),this.l&&Fc(this.l)):a.va=!1;a.Ga&&(a.Ga=!1,--this.v||E(this));Yf(this,a.Ia)}; -function bg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.m=f>>16&63;this.i=this.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0}; -h.wc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=5120;break}wb(this.h,Wc(this.a,f),p|u<<8);if(Xb(this.h)){k=8192;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)}; -h.xc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){var p=yb(this.h,Wc(this.a,f));if(Xb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=5120;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Cd=function(){return this.b&65535}; -h.Ae=function(a){this.b=this.b&-1023|a&1022;this.m=this.m&60|(a&48)>>4;if(!(this.b&128)){var b;a=!0;var c=this.c[(this.b&768)>>8],d=c.W,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.wc;case 10:b||(b=this.xc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>= -d.N?this.b|=37888:(d=(this.m&63)<<16|this.w,a=65536-this.s&65535,a=b.call(this,c,e,f,g,a,d,this.uc.bind(this)))}a&&(this.b|=129,this.b&64&&L(this.a,this.Oa))}};h.Ad=function(){return this.w};h.ye=function(a){this.w=a&65534};h.Dd=function(){return this.f};h.Be=function(a){this.f=a};h.Ed=function(){return this.s};h.Ce=function(a){this.s=a};h.Bd=function(){return this.m};h.ze=function(a){this.m=a&63;this.b=this.b&-49|(this.m&3)<<4}; -var fg={},ag=(fg[63744]=[null,null,N.prototype.Cd,N.prototype.Ae,"RLCS"],fg[63746]=[null,null,N.prototype.Ad,N.prototype.ye,"RLBA"],fg[63748]=[null,null,N.prototype.Dd,N.prototype.Be,"RLDA"],fg[63750]=[null,null,N.prototype.Ed,N.prototype.Ce,"RLMP"],fg[63752]=[null,null,N.prototype.Bd,N.prototype.ze,"RLBE"],fg); -function gg(a,b,c){w.call(this,"Computer",a,gg,33554432);this.o.P=!1;hg(this,b);this.A=zc(this,"autoPower",a);this.l=0;this.L=a.busWidth||a.buswidth;this.b=ig;this.s=null;this.i=this.H=!1;this.R=zc(this,"url")||"";(Math.random()+.1).toString(36);this.c=jg(this);if(this.a=Wa("CPU",this.id)){this.G=Wa("Debugger",this.id);this.h=new Cb({id:this.ya+".bus",busWidth:this.L},this.a,this.G);var d,e=z(this.id);if((this.w=Wa("Panel",this.id))&&this.w.eb)for(b=0;b\nLicense: GPL version 3 or later ");this.V("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;big){if(kg(d,this.s)){this.f=new P(this,"1.30.5","failsafe");kg(this.f)&&(pg(this,d),a=2,qg(this.f));this.f.set("timestamp",sa());rg(this.f);var e=this.b&&!this.i;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=og(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?kg(d,g):("error"== -f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.c=null)):this.V(f+": "+g),qg(d),kg(d)?(c=og(d),e=!0):c=!1))}e&&ng(this,c?d:null)}else 2==a&&d.clear()}else ng(this);delete this.s;delete this.v}e=z(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.o.P=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(ug(this,this.a,b,c,a),this.wa(),this.a.cb());this.F&&(pg(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0}; -function pg(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.R;d.user=c;d.type="bug";d.data=b;t("http://www.pcjs.org/api/v1/report",d,!0)}} -function vg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new P(a,"1.30.5"),g=new P(a,"1.30.5","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&G(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.P=!1,!1===d&&(e=null)));for(var k=z(a.id),l=0;l=c||30<=(b.Ab+=c))&&(d.textContent=b.o.S?b.Aa.toFixed(2)+"Mhz":"Stopped",b.Ab=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.o.S;d=!!(b.a.u&8);if(0>=a||60<=(b.s+=a)){for(var e=0;eb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.pa=g.load;d.oa=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ca=g.symbols;d.M.length?1==d.M.length&&(w(d.M[0]),d=null):(w("Empty resource: "+a),d=null)}catch(k){w("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.ya=this.id:(this.za=this.id.substr(0,b),this.ya=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Ha:!1,Ib:!1,P:!1,error:!1};this.vb=null;this.o.error=!1;this.l={};this.G=null;this.Mc=d||0;y.push(this)}var Ma=void 0,Na={}; +if(window){Ma||(Ma=window.location.search.substr(1));for(var Oa,Pa=/\+/g,Qa=/([^&=]+)=?([^&]*)/g;Oa=Qa.exec(Ma);)Na[decodeURIComponent(Oa[1].replace(Pa," "))]=decodeURIComponent(Oa[2].replace(Pa," "))}function Ra(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} +function z(a,b){b||(b=x);a.prototype=Ra(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Sa=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Sa={},y=[];function Ta(a,b,c){Sa[a]&&b&&(Sa[a][b]=c)}function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Xc,a]}z(ab);var bb=7;function cb(a,b){return a.b[b]&&a.b[b][1]}h=ab.prototype;h.reset=function(){this.stop()}; +h.aa=function(a,b,c,d){if(this.m&&this.m.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.f[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){db(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){eb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){db(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){eb(a,b)}}(this,b),!0):this.parent.aa.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;fb(b,this,gb);hb(b,this.reset.bind(this));ib(this);jb(this)};h.ka=function(a,b){b||(kb(),this.reset());return!0};h.ja=function(){return!0}; +function lb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ib(a,b){for(var c in a.f)lb(a,c,null!=b?b:a.f[c])}function mb(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function jb(a){for(var b in a.b)mb(a,b,a.b[b][1])}function nb(a,b,c,d){a.l[b]&&(void 0===c&&(Ya(a,"Value for "+b+" is invalid"),H(a.a)),c=8==(a.G&&a.G.b||8)?ja(c,d):r(c,d),a.l[b].textContent!=c&&(a.l[b].textContent=c))} +function db(a,b){var c=a.b[b];mb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.B="EXAM"==b)}function eb(a,b){var c=a.b[b];c[2]&&c[3]&&(mb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Vc=function(a){a||this.a.o.S||(a=this.a,a.h.reset(),ob(a),cb(this,"ENABLE")&&pb(this.a))};h.Wc=function(){};h.Rc=function(a){a||H(this.a)}; +h.Pc=function(a){if(!a&&!this.a.o.S)if(cb(this,"ENABLE"))pb(this.a);else{a=this.G;var b;if(b=a)a.o.Ha&&(a.o.Ib=!0),b=!a.o.Ha;if(b)Wa(a,!0),a.yb(0,null),Wa(a,!1);else try{var c=this.a.yb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Sa?8:16,c=65472<=a.la&&a.la<65472+b,b=c?1:2,c=c?15:a.h.Da;cb(a,"STEP")||(b=-b);yb(a,a.la&~c|a.la+b&c)}function yb(a,b){a.la=b&a.h.Da;b=a.la;for(var c=0;22>c;c++)zb(a,"A"+c,b&1<c;c++)zb(a,"D"+c,b&1<>2;this.m=this.c-1;this.u=this.w/this.c|0;this.Ca=[];this.j=0;this.s=!1;this.A=[];this.Bc=[Db,Eb,Fb,Gb];a=new I(this);Hb(a,this.G);this.h=Array(this.u);this.f=Array(this.u);for(b=0;b>>this.b;this.B=0;this.i=this.Da;G(this)}z(Bb); +var Cb=8192,Kb=Cb-1;function Db(a,b){var c=-1,d=this.controller,e=d.Ca[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ca[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} +function Eb(a,b,c){var d=!1,e=this.controller,f=e.Ca[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ca[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Fb(a,b){var c=-1,d=this.controller;a=d.Ca[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} +function Gb(a,b,c){var d=!1,e=this.controller;a=e.Ca[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Lb(a,b){if(b!=a.B){for(var c=0;c>>a.b,a.f[a.H]=a.h[a.F])}}Bb.prototype.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ga)return l.kb+=l.Ga-f,l.Ga=f,!0;if(f>=l.Ga+l.kb){p=l.size-(f-n);p>g&&(p=g);l.kb=f-l.Ga+p;f=n+a.c;g-=p;k++;continue}}return Mb(1,f,g)}f=new I(a,f,p,a.c,d,e);Hb(f,a.G,l);a.h[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Nb[d]+" at "+ja(b)),!0):Mb(2,b,c)}function Ob(a,b){return a.f[(b&a.i)>>>a.b].Nb(b&a.m,b)} +function Pb(a,b){return a.f[(b&a.i)>>>a.b].X(b&a.m,b)}function Qb(a,b,c){a.f[(b&a.i)>>>a.b].Ab(b&a.m,c,b)}function xb(a,b){a.s=!1;a.j++;b=a.h[(b&a.Da)>>>a.b].gc(b&a.m,b);a.j--;return b}function Rb(a,b,c){a.s=!1;a.j++;a.h[(b&a.Da)>>>a.b].Sb(b&a.m,c&255,b);a.j--}function vb(a,b,c){a.s=!1;a.j++;a.h[(b&a.Da)>>>a.b].mc(b&a.m,c&65535,b);a.j--} +function Sb(a){for(var b=0,c=[],d=0;da.a.Sa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var u=g[4],A=g[5]||1,F=0;F>16&65535);a=a.Jb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.jd=function(){var a=this.a;a.Z&57344||(a.Kb=a.A&65535);return a.Kb};h.kd=function(){return this.a.Ea};h.ie=function(a){var b=this.a;1170>b.Sa&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Za=a&16?4194303:262143,dc(b))};h.Sd=function(a){a=a>>1&63;var b=this.a.jb[a>>1];return a&1?b>>16:b&65535}; +h.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.a.jb[c]=b&1?this.a.jb[c]&65535|(a&63)<<16:this.a.jb[c]&-65536|a&65534};h.Ld=function(a){return this.a.J[1][a>>1&7]};h.Je=function(a,b){this.a.J[1][b>>1&7]=a&65295};h.Jd=function(a){return this.a.J[1][(a>>1&7)+8]};h.He=function(a,b){this.a.J[1][(b>>1&7)+8]=a&65295};h.Kd=function(a){return this.a.da[1][a>>1&7]};h.Ie=function(a,b){b=b>>1&7;this.a.da[1][b]=a;this.a.J[1][b]&=65295};h.Id=function(a){return this.a.da[1][(a>>1&7)+8]}; +h.Ge=function(a,b){b=(b>>1&7)+8;this.a.da[1][b]=a;this.a.J[1][b]&=65295};h.dd=function(a){return this.a.J[0][a>>1&7]};h.ee=function(a,b){this.a.J[0][b>>1&7]=a&65295};h.bd=function(a){return this.a.J[0][(a>>1&7)+8]};h.ce=function(a,b){this.a.J[0][(b>>1&7)+8]=a&65295};h.cd=function(a){return this.a.da[0][a>>1&7]};h.de=function(a,b){b=b>>1&7;this.a.da[0][b]=a;this.a.J[0][b]&=65295};h.ad=function(a){return this.a.da[0][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.da[0][b]=a;this.a.J[0][b]&=65295}; +h.Rd=function(a){return this.a.J[3][a>>1&7]};h.Pe=function(a,b){this.a.J[3][b>>1&7]=a&65295};h.Pd=function(a){return this.a.J[3][(a>>1&7)+8]};h.Ne=function(a,b){this.a.J[3][(b>>1&7)+8]=a&65295};h.Qd=function(a){return this.a.da[3][a>>1&7]};h.Oe=function(a,b){b=b>>1&7;this.a.da[3][b]=a;this.a.J[3][b]&=65295};h.Od=function(a){return this.a.da[3][(a>>1&7)+8]};h.Me=function(a,b){b=(b>>1&7)+8;this.a.da[3][b]=a;this.a.J[3][b]&=65295};h.Ua=function(a){a&=7;return this.a.D&2048?this.a.La[a]:this.a.g[a]}; +h.Wa=function(a,b){b&=7;this.a.D&2048?this.a.La[b]=a:this.a.g[b]=a};h.pd=function(){return this.a.D&49152?this.a.ta[0]:this.a.g[6]};h.ne=function(a){this.a.D&49152?this.a.ta[0]=a:this.a.g[6]=a};h.sd=function(){return this.a.g[7]};h.qe=function(a){this.a.g[7]=a};h.Va=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.La[a]};h.Xa=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.La[b]=a};h.qd=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.ta[1]}; +h.oe=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.ta[1]=a};h.rd=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.ta[3]};h.pe=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.ta[3]=a};h.$c=function(a){return this.a.jc[a-65504>>1]};h.ae=function(a,b){this.a.jc[b-65504>>1]=a};h.fc=function(a){return 65520==a?(Tb(this.h)>>6)-1:0};h.lc=function(){};h.Nd=function(){return 1};h.Le=function(){};h.Zc=function(){return this.a.Y};h.$d=function(){this.a.Y=0};h.fd=function(){return this.a.ic}; +h.ge=function(a,b){b&1||(a&=255);this.a.ic=a};h.ld=function(a,b){return b?0:this.a.xb};h.je=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.v|=1}b.xb=a};h.Md=function(a,b){return b?0:this.a.ib&65280};h.Ke=function(a){this.a.ib=a|255};h.od=function(){return ec(this.a)};h.me=function(a){fc(this.a,a&-1793|ec(this.a)&1792)};h.kc=function(){}; +var N={},$b=(N[61568]=[null,null,L.prototype.Sd,L.prototype.Qe,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Ld,L.prototype.Je,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.Jd,L.prototype.He,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.Kd,L.prototype.Ie,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.Id,L.prototype.Ge,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.dd,L.prototype.ee,"KIPDR",8,1145,64],N[62672]=[null,null,L.prototype.bd,L.prototype.ce,"KDPDR",8,1145,64],N[62688]= +[null,null,L.prototype.cd,L.prototype.de,"KIPAR",8,1145,64],N[62704]=[null,null,L.prototype.ad,L.prototype.be,"KDPAR",8,1145,64],N[62798]=[null,null,L.prototype.kd,L.prototype.ie,"MMR3",1,1145,64],N[65382]=[null,null,L.prototype.ed,L.prototype.fe,"LKS"],N[65402]=[null,null,L.prototype.gd,L.prototype.he,"MMR0",1,1145,64],N[65404]=[null,null,L.prototype.hd,L.prototype.kc,"MMR1",1,1145,64],N[65406]=[null,null,L.prototype.jd,L.prototype.kc,"MMR2",1,1145,64],N[65408]=[null,null,L.prototype.Rd,L.prototype.Pe, +"UIPDR",8,1145,64],N[65424]=[null,null,L.prototype.Pd,L.prototype.Ne,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.Qd,L.prototype.Oe,"UIPAR",8,1145,64],N[65456]=[null,null,L.prototype.Od,L.prototype.Me,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.Ua,L.prototype.Wa,"R0SET0"],N[65473]=[null,null,L.prototype.Ua,L.prototype.Wa,"R1SET0"],N[65474]=[null,null,L.prototype.Ua,L.prototype.Wa,"R2SET0"],N[65475]=[null,null,L.prototype.Ua,L.prototype.Wa,"R3SET0"],N[65476]=[null,null,L.prototype.Ua, +L.prototype.Wa,"R4SET0"],N[65477]=[null,null,L.prototype.Ua,L.prototype.Wa,"R5SET0"],N[65478]=[null,null,L.prototype.pd,L.prototype.ne,"R6KERNEL"],N[65479]=[null,null,L.prototype.sd,L.prototype.qe,"R7KERNEL"],N[65480]=[null,null,L.prototype.Va,L.prototype.Xa,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Va,L.prototype.Xa,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Va,L.prototype.Xa,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Va,L.prototype.Xa,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Va, +L.prototype.Xa,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Va,L.prototype.Xa,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.qd,L.prototype.oe,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.rd,L.prototype.pe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.$c,L.prototype.ae,"CTRL",8,1170],N[65520]=[null,null,L.prototype.fc,L.prototype.lc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.fc,L.prototype.lc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Nd,L.prototype.Le,"SYSID",1,1170],N[65526]= +[null,null,L.prototype.Zc,L.prototype.$d,"CPUERR",1,1170],N[65528]=[null,null,L.prototype.fd,L.prototype.ge,"MB",1,1170],N[65530]=[null,null,L.prototype.ld,L.prototype.je,"PIR"],N[65532]=[null,null,L.prototype.Md,L.prototype.Ke,"SL"],N[65534]=[null,null,L.prototype.od,L.prototype.me,"PSW"],N); +Ia(function(){for(var a=E(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),nc(this,jc?oc:qc);else{a=this.a=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ga:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ma:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.va=!0},F:function(a,b){return this.H(a,b)},T:function(a,b){return this.gc(a,b)},za:function(a,b,c){this.m?this.f(a,b,c):this.Sb(a,b,c)},ua:function(a,b,c){this.m?this.f(a,b,c):this.mc(a,b,c)},B:function(a){return this.l[a]},I:function(a){return this.l[a]},R:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},fa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},ya:function(a,b){this.l[a]=b;this.va=!0},ra:function(a,b){this.l[a]=b;this.va=!0},na:function(a,b,c){a&1&&J(this.h, +c,64);this.c.setUint16(a,b,!0);this.va=!0},Aa:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.va=!0}};function Hb(a,b,c){a.G=b;a.i=a.j=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.j=c.j)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.j||(a.zb=!a.m&&b[1]||a.f,a.Ab=!a.m&&b[3]||a.A);if(c||void 0===c)a.Sb=b[1]||a.f,a.mc=b[3]||a.A}function sc(a,b,c){c&&a.i||(a.Nb=b[0]||a.u,a.X=b[2]||a.w);if(c||void 0===c)a.H=b[0]||a.u,a.gc=b[2]||a.w}function nc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)} +var vc=[],rc=[I.prototype.L,I.prototype.ma,I.prototype.ga,I.prototype.Ba],tc=[I.prototype.F,I.prototype.za,I.prototype.T,I.prototype.ua];if(Za)var qc=[I.prototype.B,I.prototype.ya,I.prototype.R,I.prototype.na],oc=[I.prototype.I,I.prototype.ra,I.prototype.fa,I.prototype.Aa]; +function wc(a,b){x.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Cb=0;this.qb=b;this.na=c;this.Fb=Math.round(this.qb/1E4)/100;this.Ma=this.Fb*this.na;this.o.S=!1;this.o.Pb=!1;this.o.fb=a.autoStart;this.o.tb=!1;this.ob=this.Na=0;this.pb=a.csStart;this.$a=a.csInterval;this.ab=a.csStop;this.L=[];this.ec=this.Xd.bind(this);G(this)}z(wc);var xc=["power","reset"];h=wc.prototype; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.G=d;this.w=a.w;for(b=0;b=a.Na&&(a.Na+=a.$a,c=!0);0<=a.ab&&a.ab<=Bc(a)&&(a.$a=a.ab=-1,Ac(a),H(a),c=!0);c&&a.V(Bc(a)+" cycles: checksum="+r(a.ob))}} +h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.m)if(a=d.m,a.o.P)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.Ba/a.Ma&&(b=1);a.na=b;b=a.Fb*a.na;if(a.Ma!=b){a.Ma=b;b=a.Ma.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.V("target speed: "+b)}c&&a.m&&Ec(a.m)}rb(a,a.ga);a.ga=0;a.fa=qa();a.ra=0;Dc(a)}function Xb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.qb*a.na/1E3*c|0,a.o.S&&(c+=Fc(a)),a.L[b][0]=c)} +function qb(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fc(a,b){var c=a.ma-=a.a;a.a=a.I=0;b&&(a.ma=0);return c} +h.Xd=function(){if(this.o.S){this.Hb>=this.qb&&Dc(this,!0);this.cb=0;this.nb=qa();if(this.ra){var a=this.nb-this.ra;a>this.bc&&(this.fa+=a,this.fa>this.nb&&(this.fa=this.nb))}try{do{for(var b,c=this.o.tb?1:this.rb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.yb(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.cb+=b;this.ga+=b;sb(this,b);qb(this,b);this.bb-=b;if(0>=this.bb){this.bb+=this.rb;15<=++this.dc&&(this.xa(),this.dc=0);break}}while(this.o.S)}catch(f){H(this); +this.m&&this.m.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.S){a=setTimeout;b=this.ec;this.ra=qa();c=this.bc;this.cb&&(c=Math.round(c*this.cb/this.rb));c-=this.ra-this.nb;if(d=this.ra-this.fa)this.Ba=Math.round(this.ga/(10*d))/100,864E5<=d&&(this.ua=0,Cc(this));if(0>c||this.Bac&&(this.fa-=c),c=0;this.Hb+=this.cb;this.ra+=c;a(b,c)}}}; +function pb(a){var b;a.o.error?(a.V(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.S)a.V(a.toString()+" busy");else{Cc(a);a.o.S=!0;a.o.Pb=!0;if(b=a.l.run)b.textContent="Halt";a.m&&a.m.start(a.fa,Bc(a));setTimeout(a.ec,0)}}h.yb=function(){return 0};function H(a){var b=!1;if(a.o.S){Fc(a);rb(a,a.ga);a.ga=0;a.o.S=!1;if(b=a.l.run)b.textContent="Run";a.m&&a.m.stop(qa(),Bc(a));b=!0}a.o.complete=void 0;return b} +function Gc(a){this.Sa=+a.model||1170;this.Yb=a.addrReset||0;wc.call(this,a,6666667);this.sb=0;this.ac=255;1120==this.Sa?(this.decode=Hc.bind(this),this.Aa=this.Fc,this.sb=8,this.ac=-1):(this.decode=Ic.bind(this),this.Aa=this.Gc);Jc(this);this.Oa=0;this.H=null;this.Db=[];this.o.complete=!1}z(Gc,wc);h=Gc.prototype;h.Ub=function(){for(var a=192,b=0;bc.Rb&&(c.Rb=a,a+=4)}}; +h.reset=function(){this.status("model "+this.Sa);this.o.S&&H(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)}; +function Jc(a){a.j=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.Yb,-1,-2,-3,-4,-5,-6,-7,-8];a.La=[0,0,0,0,0,0];a.ta=[0,0,0,0];a.u=0;a.mb=0;a.Nc=[4,2,0,1];a.J=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.da=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0]];a.jb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.jc=[0,0,0,0,0,0,0,0];a.ic=0;a.v=0;a.B=a.F=0;a.c=a.b=a.Bb=0;a.Pa=-1;ob(a)}function ob(a){a.Z=0;a.Jb=0;a.Kb=0;a.Ea=0;a.Y=0;a.xb=0;a.ib=255;a.Ya=0;a.lb=0;a.Za=262143;a.eb=0;a.A=0;a.H=null;a.h&&(dc(a),a.Lc=Tb(a.h))}function dc(a){a.Ya?(a.T=65536,a.Eb=a.Ea&16?4186112:253952,a.R=a.Jc,a.X=a.Td,a.Ab=a.Re,Lb(a.h,a.Ea&16?22:18)):(a.T=0,a.Eb=57344,a.R=a.Ic,a.X=a.hc,a.Ab=a.nc,Lb(a.h,16))} +function cc(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Jb=a.A>>16&65535,a.Kb=a.A&65535);a.Z=b;a.lb=b>>5&3;a.mb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ya!=c&&(a.Ya=c,dc(a))}}h.$b=function(){return 0};h.save=function(){var a=new Q(this);a.set(0,[]);a.set(1,[this.ua,this.na]);a.set(2,Sb(this.h));return a.data()}; +h.restore=function(a){var b=a[1];this.ua=b[1];Cc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.D>>14&3;a.u!=c&&(a.ta[c]=a.g[6],a.g[6]=a.ta[a.u]);a.D=b;a.v&=-3;a.v|=a.H?2:1}h.ba=function(a){this.s=this.i=a;this.f=0}; +h.Fa=function(a,b){this.s=this.i=this.j=a;this.f=b||0};function Oc(a,b){a.s=a.i=a.j=b;a.f=a.s^a.j>>1}function Pc(a,b,c,d){a.s=a.i=a.j=b;a.f=(c^d)&(d^b)}function K(a,b,c,d){if(!a.Oa){0>a.Pa?a.Pa=ec(a):a.u||(d=-4);-4==d&&(a.v&256&&(d=-1),a.v|=256,a.Y|=4,a.g[6]=b=4);if(-1!=d){a.A=b|4143316992;a.u=0;var e=a.X(b|a.T),f=a.X(b+2&65535|a.T);fc(a,f&-12289|a.Pa>>2&12288);Qc(a,a.Pa);Qc(a,a.g[7]);S(a,e)}a.a-=5;a.v&=~(c|19);a.v|=129;a.Pa=-1;-1==d&&H(a);if(-4<=d)throw b;}} +function Rc(a){var b=Sc(a),c=Sc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);S(a,b);fc(a,c);a.v&=-17}function Tc(a,b){var c=b>>13&31;31>c&&(b=a.Ea&32?a.jb[c]+(b&8190)&4194302:b&-3932161);return b} +function wb(a,b,c){var d,e,f;if(!(c&a.Ya))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.Ea&a.Nc[a.u]||(d&=7);e=a.J[a.u][d];f=(a.da[a.u][d]<<6)+(b&8191)&a.Za;3932160<=f&&(f=Tc(a,f));if(a.Oa)return f;f>=a.Lc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.J[a.u][d]=e;if(f!=(4194170&a.Za)||a.u)a.lb=a.u,a.mb=d;g&&(g&57344&&(0<=a.Pa&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.lb<<5|a.mb<<1,cc(a,a.Z&-61695|g&61694)),K(a,168,64,-2)),a.Z&61440||!(f<(4191360&a.Za)||f>(4194239&a.Za))||(a.Z|=4096,a.Z&512&&(a.v|=64)));return f}function Sc(a){var b=a.X(a.g[6]|a.T);a.g[6]=a.g[6]+2&65535;return b}function Qc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;a.v&256||a.Aa(4,-2,c);a.Ab(c,b)} +function Uc(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Aa(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Aa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.X(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Aa(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.X(e)|g;a.a-=8;break;case 6:return e=a.X(Mc(a,2)),e=e+a.g[c]&65535,6==c&&a.Aa(d,0, +e),a.a-=6,e|g;case 7:return e=a.X(Mc(a,2)),e=e+a.g[c]&65535,e=a.X(e|a.T),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fc=function(a,b,c){!this.u&&0>=b&&c<=this.ib&&(this.v|=32)};h.Gc=function(a,b,c){this.u||(65534<=c&&(c|=-65536),a&4&&c<=this.ib&&(c<=this.ib-32?K(this,4,0,-4):(this.Y|=8,this.v|=32)))};h.Ic=function(a,b,c){a=Uc(this,a,b,c);3932160<=a&&(a=Tc(this,a));return a};h.Jc=function(a,b,c){return wb(this,Uc(this,a,b,c),c)}; +h.hc=function(a){3932160<=a&&(a=Tc(this,a));return Pb(this.h,this.eb=a)};h.Td=function(a){return Pb(this.h,this.eb=wb(this,a,2))};h.nc=function(a,b){3932160<=a&&(a=Tc(this,a));Qb(this.h,this.eb=a,b)};h.Re=function(a,b){Qb(this.h,this.eb=wb(this,a,4),b)};function Vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Uc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.u=a.D>>12&3,c=a.X(d|c&a.T),a.u=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.ta[a.D>>12&3];return c} +function Wc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Uc(a,b,e,4),c&65536||(e&=65535),a.u=a.D>>12&3,e=wb(a,e|c&65536,4),a.u=a.D>>14&3,Qb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.ta[a.D>>12&3]=d}function Xc(a,b){b>>=6;var c=a.F=b&7;(b=a.B=(b&56)>>3)?(c=a.R(b,c,3),a=Ob(a.h,c)):a=a.g[c+a.sb]&a.ac;return a}function Yc(a,b){b>>=6;var c=a.F=b&7;return(b=a.B=(b&56)>>3)?Pb(a.h,a.R(b,c,2)):a.g[c+a.sb]} +function Zc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Uc(a,b,c,8)}function $c(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.R(b,c,3),a=Ob(a.h,c)):a=a.g[c]&255;return a}function ad(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Pb(a.h,a.R(b,c,2)):a.g[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Bb=a.R(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Ob(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].zb(e&a.m,c,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,6),Qb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Pb(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function bd(a,b,c,d,e){var f=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].zb(d&a.m,c,d)):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} +function cd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),Qb(a.h,e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}function V(a,b,c){c&&(S(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} +h.yb=function(a){this.o.complete=!0;var b=a?this.o.Pb?0:1:-1;this.o.Pb=!1;this.ma=this.a=a;do{if(this.v){if(a=this.v&11){a=!1;if(this.v&2){var c=160,d=(this.xb&224)>>5,e=this.H&&this.H.Ta>d?this.H:null;e&&(c=e.Rb,d=e.Ta);d>(this.D&224)>>5?(this.v&8&&(Mc(this,2),this.v&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&bc(this,e),a=!0);this.H||this.xb||(this.v&=-3)}else this.v&1&&this.v++;a=a&&0>b}if(a)break;if(this.v&112&&Nc(this)&&0>b)break}this.v=this.v&15|this.D&16;this.decode(Lc(this))}while(0>1|b<<16;Oc(this,a);return a&65535} +function id(a,b){a=b&128|b>>1|b<<8;Oc(this,a<<8);return a&255}function jd(a,b){a=b&~a;this.ba(a);return a}function kd(a,b){a=b&~a;this.ba(a<<8);return a}function ld(a,b){a|=b;this.ba(a);return a}function md(a,b){a|=b;this.ba(a<<8);return a}function nd(a,b){a=~b|65536;this.Fa(a);return a&65535}function od(a,b){a=~b|256;this.Fa(a<<8);return a&255}function pd(a,b){this.s=this.i=a=b-a;this.f=b&(b^a);return a&65535}function qd(a,b){a=b-a;var c=a<<8;b<<=8;this.s=this.i=c;this.f=b&(b^c);return a&255} +function rd(a,b){this.s=this.i=a=b+a;this.f=a&(b^a);return a&65535}function sd(a,b){a=b+a;var c=a<<8;this.s=this.i=c;this.f=c&(b<<8^c);return a&255}function td(a,b){a=-b;this.Fa(a,a&b&32768);return a&65535}function ud(a,b){a=-b;this.Fa(a<<8,(a&b&128)<<8);return a&255}function vd(a,b){a=b<<1|this.j>>16&1;Oc(this,a);return a&65535}function wd(a,b){a=b<<1|this.j>>16&1;Oc(this,a<<8);return a&255}function xd(a,b){a=(this.j&65536|b)>>1|b<<16;Oc(this,a);return a&65535} +function yd(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;Oc(this,a<<8);return a&255}function zd(a,b){var c=b-a;Pc(this,c,a,b);return c&65535}function Ad(a,b){var c=b-a;Pc(this,c<<8,a<<8,b<<8);return c&255}function Bd(a,b){this.s=this.i=b&65280;this.f=this.j=0;return(b<<8|b>>8)&65535}function Cd(a,b){a^=b;this.ba(a);return a&65535}function Dd(a){U(this,a,Yc(this,a),dd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +function Ed(a){var b=ad(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.j=this.f=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} +function Fd(a){var b=ad(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.j=this.f=0;b&=63;if(b&32){b=64-b;32>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Gd(a){V(this,a,!R(this))}function Hd(a){V(this,a,R(this))} +function Id(a){U(this,a,Yc(this,a),jd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Jd(a){T(this,a,Xc(this,a),kd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Kd(a){U(this,a,Yc(this,a),ld);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Ld(a){T(this,a,Xc(this,a),md);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +function Md(a){var b=Yc(this,a);a=ad(this,a);this.ba((0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Nd(a){var b=Xc(this,a);a=$c(this,a);this.ba(((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Od(a){V(this,a,this.i&65535?0:4)}function Pd(a){V(this,a,!Kc(this)==!(this.f&32768))}function Qd(a){V(this,a,!!(this.i&65535)&&!Kc(this)==!(this.f&32768))} +function Rd(a){V(this,a,!R(this)&&!!(this.i&65535))}function Sd(a){V(this,a,(this.i&65535?0:4)||!Kc(this)!=!(this.f&32768))}function Td(a){V(this,a,R(this)||(this.i&65535?0:4))}function Ud(a){V(this,a,!Kc(this)!=!(this.f&32768))}function Vd(a){V(this,a,Kc(this))}function Wd(a){V(this,a,!!(this.i&65535))}function Xd(a){V(this,a,!Kc(this))}function Yd(){K(this,12,0,-9)}function Zd(a){V(this,a,!0)}function $d(a){V(this,a,!(this.f&32768))}function ae(a){V(this,a,this.f&32768?2:0)} +function W(a){a&1&&(this.j=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function be(a){var b=Yc(this,a);a=ad(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Pc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ce(a){var b=Xc(this,a);a=$c(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Pc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} +function de(a){var b=ad(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.j=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.j=65536,this.a-=7}function ee(){K(this,24,0,-9);this.a-=20} +function fe(){this.D&49152?(this.Y|=128,K(this,4,0,-8)):(this.w&&1120==this.Sa&&this.w.setData(this.g[0],!0),this.G?this.G.c():H(this));this.a-=7}function ge(){K(this,16,0,-9);this.a-=20}var he=[0,7,7,10,7,11,9,13];function ie(a){this.I=this.a;S(this,Zc(this,a));this.a=this.I-he[this.c]}var je=[0,14,14,17,14,18,16,20];function ke(a){this.I=this.a;var b=Zc(this,a);a=a>>6&7;Qc(this,this.g[a]);this.g[a]=this.g[7];S(this,b);this.a=this.I-je[this.c]}var le=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function me(a){var b=Yc(this,a);this.I=this.a;cd(this,a,b,this.ba);this.a=this.I-le[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ne(a){var b=Xc(this,a);bd(this,a,b,65535,this.ba);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var oe=[7,13,13,17,14,18,17,21]; +function pe(a){var b=ad(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.s=b>>16;this.i=this.s|b;this.f=0;this.j=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)S(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ve(a){U(this,a,Yc(this,a),zd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function we(a){U(this,a,0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)}function xe(){K(this,28,0,-9)} +function ye(){this.w&&(this.w.la=this.g[7],this.w.setData(this.g[0],!0));this.v|=8;Mc(this,-2);this.a-=3}function ze(a){U(this,a,this.g[(a>>6&7)+this.sb],Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-9)}function Hc(a){Ae[a>>12].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a&15].call(this,a)}function Je(a){Ke[a&15].call(this,a)}function Le(a){Me[a>>6&3].call(this,a)} +function Ne(a){Oe[a>>6&3].call(this,a)}function Pe(a){Qe[a>>6&3].call(this,a)} +var Ae=[function(a){Re[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,Y,function(a){Se[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],Re=[function(a){Te[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,Y,Y,Y],Ce=[function(a){cd(this,a,0,this.Fa);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ee=[function(a){U(this,a,0,td); +this.a-=this.c?11:6},function(a){U(this,a,R(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,R(this)?1:0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ad(this,a);this.Fa(a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ge=[function(a){U(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}],Te=[function(a){Ue[a& +15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,Y,He,Je,we,we,we,we],Ue=[fe,ye,te,Yd,ge,re,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ie=[qe,function(){this.j=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ke=[qe,function(){this.j=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Se=[Xd,Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,Y,Y,Y],Me=[function(a){bd(this,a,0, +255,this.Fa);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)}],Oe=[function(a){T(this,a,0,ud);this.a-=this.c?11:6},function(a){T(this,a,R(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,R(this)?1:0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=$c(this,a);this.Fa(a<<8);this.a-=this.c?4:3+(7==this.b? +2:0)}],Qe=[function(a){T(this,a,0,yd);this.a-=this.c?9+(this.Bb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,id);this.a-=this.c?9+(this.Bb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Ic(a){Ve[a>>12].call(this,a)} +var Ve=[function(a){We[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,function(a){Xe[a>>8&15].call(this,a)},function(a){Ye[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],We=[function(a){Ze[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,function(a){$e[a>>6&3].call(this,a)},Y,Y],$e=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.X(a|this.T);S(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Vc(this,a,0);this.ba(a);Qc(this,a);this.a-=11},function(a){var b=Sc(this);this.I= +this.a;this.ba(b);Wc(this,a,0,b);this.a=this.I-oe[this.c]},function(a){cd(this,a,Kc(this)?65535:0,this.ba);this.a-=this.c?9:3+(7==this.b?2:0)}],Ze=[function(a){af[a&15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,function(a){a&8?(this.D&49152||(this.D=this.D&-2017|(a&7)<<5,this.v|=1,this.v&=-3),this.a-=5):K(this,8,0,-9)},He,Je,we,we,we,we],af=[fe,ye,function(){Rc(this);this.v|=this.D&16;this.a-=13},Yd,ge,re,te,function(){K(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],Xe=[pe,pe,de,de,Ed,Ed,Fd,Fd,ze,ze,Y,Y,Y,Y,ue,ue],Ye= +[Xd,Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,function(a){bf[a>>6&3].call(this,a)},Y,Y],bf=[Y,function(a){a=Vc(this,a,65536);this.ba(a);Qc(this,a);this.a-=11},function(a){var b=Sc(this);this.I=this.a;this.ba(b);Wc(this,a,65536,b);this.a=this.I-oe[this.c]},Y]; +function cf(a){x.call(this,"ROM",a,cf,128);this.ca=this.c=null;this.i=a.addr;this.b=a.size;this.j=!1;this.f=a.alias;this.m=a.file;this.s=t(this.m);if(this.m){a=this.m;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.m+"&format=bytes&decimal=true");var c=this;v(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.m=null):(Ta(c.za,a,b),(a=sa(a,b))?(c.c=a.M,c.ca=a.ca):c.m=null);df(c)})}}z(cf);h=cf.prototype; +h.ia=function(a,b,c,d){this.h=b;this.a=c;this.G=d;df(this)};h.ka=function(){this.ca&&(this.G&&this.G.a(this.id,this.i,this.b,this.ca),delete this.ca);return!0};h.ja=function(){return!0}; +function df(a){if(!Xa(a)){if(a.m){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Cb){var c={};b=(c[b]=[cf.prototype.Hd,cf.prototype.Fe,null,null,null,a.b>>1],c);if(fb(a.h,a,b)){b=a.j=!0;break a}}else if(Ib(a.h,b,a.b,mc)){for(c=0;c>>f.b;0>>=f.b;0>>a.b;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,A=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(A)for(;A--;)Rb(a.h,p++,b[u++]&255);else p&1?H(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=m.Tb&&c<=m.Ac&&(b=c-(m.Tb-m.oc));b&&(a.preventDefault&&a.preventDefault(),d.wb(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.qc&&(b=m.pc);d.wb(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&& +a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.wb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;var e=this;this.T=Zb(this.a,this.A?-1:48,4,262144);this.ga=Xb(this.a,function(){var a;a=-1;e.u.length&&(a=e.u.shift()&255,e.ra&&97<=a&&122>a&&(a-=32),Yb(e.a,e.ga,1E3/Math.round(e.L/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&M(c,e.T))});this.I=Zb(this.a,this.A?-1:52,4,262144);this.na=Xb(this.a,function(){e.c|=128;e.c&64&&M(c,e.I)});fb(b,this,kf,this.A?64832+8*(this.A-1)-65392:0);hb(b,this.reset.bind(this));G(this)}; +h.cc=function(a){if(!this.i){var b=yc(this.m,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.ya)return;c=oa(c[1]);if(this.i=Ua(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.w);if(this.F=e.receiveData){this.w=a;this.H=e.receiveStatus;this.status(this.za+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.ka=function(a,b){if(!b)if(this.cc(this.w),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){lf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return lf(this)};function lf(a){a.B=0;a.b=8192;a.c=128;a.u=[];return!0} +h.wb=function(a){if("number"==typeof a)this.u.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.fa||8,c=a-this.s%a,this.fa&&(b=" ".slice(0,c)));this.R&&!this.s&&c&&(b=String.fromCharCode(this.R)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}}else if(null!=this.j){if(10== +a||1024<=this.j.length)this.V(this.j),this.j="";10!=a&&(this.j+=String.fromCharCode(a))}Yb(this.a,this.na,1E3/Math.round(this.ma/10));this.c&=-129};var mf={},kf=(mf[65392]=[null,null,Z.prototype.ud,Z.prototype.se,"RCSR"],mf[65394]=[null,null,Z.prototype.td,Z.prototype.re,"RBUF"],mf[65396]=[null,null,Z.prototype.Vd,Z.prototype.Te,"XCSR"],mf[65398]=[null,null,Z.prototype.Ud,Z.prototype.Se,"XBUF"],mf); +Ia(function(){for(var a=E(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.l[b]=c,c.onclick= +function(){var a=d.l.listTapes;a&&pf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;pf(d,t(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.l[b]=c,!0}return!1}; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;this.L=qf(a);var e=this;if((this.c=yc(this.m,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.H=Zb(this.a,56,4,4096);this.T=Xb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!v(f,null,!0,function(e,f,g){var k=0>g&&a.m&&!a.m.o.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.za,e,f),(e=sa(e,f))&&zf(a,b,c,d,e.M,e.pa,e.oa)); +a.o.Ha=!1;a.j&&(a.j--,a.j||G(a));wf(a)})}function tf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.K);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ub?"":e)+"&format=json"));return!!v(f, +null,!0,function(b,c,d){Gf(a,b,c,d)})} +function Gf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.m&&!a.m.o.P;if(d)a.controller.C('Unable to load disk "'+a.qa+'" (error '+d+": "+b+")",f);else{Ta(a.controller.za,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)w(k[0]);else{a.K=k.length;a.O=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var A=l.bytes;if(void 0!==A&&A.length){for(var F=n<<2,xa=A.length;xa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ha?f=a.sa+a.ha&&(a.ha+=f-(a.sa+a.ha)+1):(a.sa=f,a.ha=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.qa+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=If(this,a++);)Lf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function Lf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function P(a){x.call(this,"RK11",a,P,65536);this.w=a.autoMount||{};this.j=0;this.c=Array(8);this.A=!Ba("Mobi")&&window&&"FileReader"in window}z(P);h=P.prototype; +h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Mf(d,a)},!0;case "loadDrive":return this.l[b]= +c,c.onclick=function(){var a=d.l.listDisks;a&&Nf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Ca(Kf(a),a.Ob.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.A)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Nf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;if((a=yc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);Of(this);this.Qa=Zb(this.a,144,5,65536);fb(b,this,Pf);hb(b,this.reset.bind(this));Qf(this,"None","",!0);this.A&&Qf(this,"Local Disk","?");Qf(this,"Remote Disk","??");Rf(this)||G(this)}; +h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.m.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Mf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Of(this)};h.save=function(){return(new Q(this)).data()}; +h.restore=function(a){return Of(this,a[0])};function Rf(a,b){b||(a.j=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}Tf(a,e,b,c,!1,d)}else Sf(a,e)} +function Tf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,Sf(a,b,!0),k.Ja?a.C("RK11 busy"):(k.Ja=!0,e&&(k.Ia=!0,a.j++),k.wa=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.tc)&&g++));return g}h.tc=function(a,b,c,d,e){a.Ja=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ka)),b=null);b?(a.W=b,a.qa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ka),a.Ia||e),this.m&&Ec(this.m)):a.wa=!1;a.Ia&&(a.Ia=!1,--this.j||G(this));Mf(this,a.Ka)}; +function Qf(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e>12&48;this.u=65536-e&65535;a&&(this.i=this.i|a|32768,this.b|=49152);return!0}; +h.uc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=4096;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=32;break}vb(this.h,f,p|u<<8);if(Wb(this.h)){k=1024;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)}; +h.vc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){var p=xb(this.h,f);if(Wb(this.h)){k=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=4096;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=32;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)};h.zd=function(){return this.B};h.xe=function(){};h.Ad=function(){return this.i};h.ye=function(){};h.wd=function(){return this.b&61438}; +h.ue=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.c[a],e,f,g,k;this.b&=-129;switch(this.b&14){case 0:this.B=d.status;this.i=0;this.b=128;this.f=0;break;case 4:b=this.uc;case 2:b||(b=this.vc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):(k=(this.b&48)<<12|this.s,c=65536-this.u&65535,c=b.call(this,d,e,f,g,c,k,this.sc.bind(this)))}this.B=d.status|a<<13|this.f%9&15;c&&(this.b&= +-2,this.b|=128,this.b&64&&M(this.a,this.Qa))}};h.Bd=function(){return this.u};h.ze=function(a){this.u=a};h.vd=function(){return this.s};h.te=function(a){this.s=a};h.xd=function(){return this.f};h.ve=function(a){this.f=a};h.yd=function(){return this.F};h.we=function(a){this.F=a}; +var Uf={},Pf=(Uf[65280]=[null,null,P.prototype.zd,P.prototype.xe,"RKDS"],Uf[65282]=[null,null,P.prototype.Ad,P.prototype.ye,"RKER"],Uf[65284]=[null,null,P.prototype.wd,P.prototype.ue,"RKCS"],Uf[65286]=[null,null,P.prototype.Bd,P.prototype.ze,"RKWC"],Uf[65288]=[null,null,P.prototype.vd,P.prototype.te,"RKBA"],Uf[65290]=[null,null,P.prototype.xd,P.prototype.ve,"RKDA"],Uf[65294]=[null,null,P.prototype.yd,P.prototype.we,"RKDB"],Uf); +function O(a){x.call(this,"RL11",a,O,131072);this.A=a.autoMount||{};this.u=0;this.c=Array(4);this.B=!Ba("Mobi")&&window&&"FileReader"in window}z(O);h=O.prototype; +h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Vf(d,a)},!0;case "loadDrive":return this.l[b]= +c,c.onclick=function(){var a=d.l.listDisks;a&&Wf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Ca(Kf(a),a.Ob.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Wf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;if((a=yc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);Xf(this);this.Qa=Zb(this.a,112,5,131072);fb(b,this,Yf);hb(b,this.reset.bind(this));Zf(this,"None","",!0);this.B&&Zf(this,"Local Disk","?");Zf(this,"Remote Disk","??");$f(this)||G(this)}; +h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.m.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Vf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Xf(this)};h.save=function(){return(new Q(this)).data()}; +h.restore=function(a){return Xf(this,a[0])};function $f(a,b){b||(a.u=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}bg(a,e,b,c,!1,d)}else ag(a,e)} +function bg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,ag(a,b,!0),k.Ja?a.C("RL11 busy"):(k.Ja=!0,e&&(k.Ia=!0,a.u++),k.wa=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.xc)&&g++));return g}h.xc=function(a,b,c,d,e){a.Ja=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ka)),b=null);b?(a.W=b,a.qa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ka),a.Ia||e),this.m&&Ec(this.m)):a.wa=!1;a.Ia&&(a.Ia=!1,--this.u||G(this));Vf(this,a.Ka)}; +function Zf(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e>12&48;this.j=f>>16&63;this.i=this.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0}; +h.yc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=5120;break}vb(this.h,Tc(this.a,f),p|u<<8);if(Wb(this.h)){k=8192;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)}; +h.zc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){var p=xb(this.h,Tc(this.a,f));if(Wb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=5120;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Ed=function(){return this.b&65535}; +h.Ce=function(a){this.b=this.b&-1023|a&1022;this.j=this.j&60|(a&48)>>4;if(!(this.b&128)){var b;a=!0;var c=this.c[(this.b&768)>>8],d=c.W,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.yc;case 10:b||(b=this.zc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>= +d.N?this.b|=37888:(d=(this.j&63)<<16|this.w,a=65536-this.s&65535,a=b.call(this,c,e,f,g,a,d,this.wc.bind(this)))}a&&(this.b|=129,this.b&64&&M(this.a,this.Qa))}};h.Cd=function(){return this.w};h.Ae=function(a){this.w=a&65534};h.Fd=function(){return this.f};h.De=function(a){this.f=a};h.Gd=function(){return this.s};h.Ee=function(a){this.s=a};h.Dd=function(){return this.j};h.Be=function(a){this.j=a&63;this.b=this.b&-49|(this.j&3)<<4}; +var cg={},Yf=(cg[63744]=[null,null,O.prototype.Ed,O.prototype.Ce,"RLCS"],cg[63746]=[null,null,O.prototype.Cd,O.prototype.Ae,"RLBA"],cg[63748]=[null,null,O.prototype.Fd,O.prototype.De,"RLDA"],cg[63750]=[null,null,O.prototype.Gd,O.prototype.Ee,"RLMP"],cg[63752]=[null,null,O.prototype.Dd,O.prototype.Be,"RLBE"],cg); +function dg(a,b,c){x.call(this,"Computer",a,dg,33554432);this.o.P=!1;eg(this,b);this.A=yc(this,"autoPower",a);this.m=0;this.L=a.busWidth||a.buswidth;this.b=fg;this.s=null;this.i=this.H=!1;this.R=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=gg(this);if(this.a=Va("CPU",this.id)){this.G=Va("Debugger",this.id);this.h=new Bb({id:this.za+".bus",busWidth:this.L},this.a,this.G);var d,e=B(this.id);if((this.w=Va("Panel",this.id))&&this.w.gb)for(b=0;b\nLicense: GPL version 3 or later ");this.V("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bfg){if(hg(d,this.s)){this.f=new Q(this,"1.30.5","failsafe");hg(this.f)&&(mg(this,d),a=2,ng(this.f));this.f.set("timestamp",ra());og(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=lg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?hg(d,g):("error"== +f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.V(f+": "+g),ng(d),hg(d)?(c=lg(d),e=!0):c=!1))}e&&kg(this,c?d:null)}else 2==a&&d.clear()}else kg(this);delete this.s;delete this.u}e=B(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.o.P=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.a&&(rg(this,this.a,b,c,a),this.xa(),this.a.fb());this.F&&(mg(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.m=0}; +function mg(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.R;d.user=c;d.type="bug";d.data=b;v("http://www.pcjs.org/api/v1/report",d,!0)}} +function sg(a,b,c){var d,e="none";if(a.m)return null;a.m--;var f=new Q(a,"1.30.5"),g=new Q(a,"1.30.5","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&H(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.P=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l=c||30<=(b.Cb+=c))&&(d.textContent=b.o.S?b.Ba.toFixed(2)+"Mhz":"Stopped",b.Cb=0)}if(this.w&&(b=this.w,a=a||0,b.u)){c=b.a.o.S;d=!!(b.a.v&8);if(0>=a||60<=(b.s+=a)){for(var e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");t(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Cg(a,b,c)}})}else c(a,null)} -function Dg(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--zg||La(!0));l=!1}var g,k,l=!0;zg++;Ta[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| -(c="/versions/pdpjs/1.30.5/components.xsl");n=function(d,k){k?Ag(c,null,null,!1,e,function(d,l){l?(Ua(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--zg||La(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--zg||La(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ag(b,a,d,!0,e,n):Bg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(A){f(A.message)}return l}window.embedPDP11=function(a,b,c,d){La(!1);return Dg(a,b,c,d)};window.enableEvents=La;window.sendEvent=Ma;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map +h.aa=function(a,b,c){var d=this;switch(b){case "power":return this.l[b]=c,c.onclick=function(){d.m||(d.o.P?sg(d,!1,!0):jg(d,d.hb))},!0;case "reset":return this.l[b]=c,c.onclick=function(){if(d.o.P&&!d.m)if(d.b&&!d.j){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");sg(d,a,!0);!a&&d.B?window&&window.location.reload():(a||(d.Lb=!0),d.hb(fg),d.Lb=!1)}else d.reset(),d.a&&d.a.fb()},!0;case "save":if(la(ta(),"pcjs.org"))c.parentNode.removeChild(c);else return this.l[b]= +c,c.onclick=function(){var a=gg(d,!0);if(a){var b=!!(d.b&&!d.j||d.B),c=sg(d,b);b?tg(d,a,c):d.C("Resume disabled, machine state not saved")}},!0}return!1}; +function gg(a,b){var c=a.c;c||((c=za("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ug(a,c))||a.C("The user ID is invalid.")):b&&a.C("Browser local storage is not available"));return c} +function ug(a,b){a.c=null;b=v(ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){w(d.message+" ("+c+")")}return a.c}function ig(a){var b=null;a.c&&(b=ta()+"/api/v1/user?req=load&user="+a.c+"&state="+vg(a,"1.30.5"));return b} +function tg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=vg(a,"1.30.5");d.data=c;b=v(ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");v(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);zg(a,b,c)}})}else c(a,null)} +function Ag(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--wg||Ka(!0));l=!1}var g,k,l=!0;wg++;Sa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| +(c="/versions/pdpjs/1.30.5/components.xsl");n=function(d,k){k?xg(c,null,null,!1,e,function(d,l){l?(Ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--wg||Ka(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--wg||Ka(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xg(b,a,d,!0,e,n):yg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(A){f(A.message)}return l}window.embedPDP11=function(a,b,c,d){Ka(!1);return Ag(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map