diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 2d05157c7..b34f2d637 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -243,17 +243,18 @@ CPUStatePDP11.prototype.resetCPU = function() */ CPUStatePDP11.prototype.resetMMU = function() { - this.regSL = 0xff; // 177774 - this.regErr = 0; // 177766 - this.regPIR = 0; // 177772 this.regMMR0 = 0; // 177572 this.regMMR1 = 0; // 177574 this.regMMR2 = 0; // 177576 this.regMMR3 = 0; // 172516 + this.regErr = 0; // 177766 + this.regPIR = 0; // 177772 + this.regSL = 0xff; // 177774 this.mmuEnable = 0; // MMU enabled for PDP11.ACCESS.READ or PDP11.ACCESS.WRITE this.mmuLastMode = 0; this.mmuMask = 0x3ffff; + this.lastAddr = 0; // this is queried by the Panel when it's not using its own ADDRESS register this.lastOp = 0; // stores the PC and any auto-incs or auto-decs from the last opcode; used to update MMR1 and MMR2 this.resetTriggers(); @@ -684,6 +685,17 @@ CPUStatePDP11.prototype.getPC = function() return this.regsGen[PDP11.REG.PC]; }; +/** + * getLastAddr() + * + * @this {CPUStatePDP11} + * @return {number} + */ +CPUStatePDP11.prototype.getLastAddr = function() +{ + return this.lastAddr; +}; + /** * getLastPC() * @@ -1605,8 +1617,13 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl newMMR0 |= (this.mmuLastMode << 5) | (this.mmuLastPage << 1); this.assert(!(newMMR0 & ~PDP11.MMR0.UPDATE)); this.setMMR0((this.regMMR0 & ~PDP11.MMR0.UPDATE) | newMMR0); + /* + * I've decided to NOT set fAbort if MMR0 already indicates an ABORT condition, + * because otherwise we run the risk of infinitely looping; eg, we call trap(), which + * calls mapVirtualToPhysical() on the trap vector, which faults again, etc. + */ + fAbort = true; } - fAbort = true; } if (!(this.regMMR0 & (PDP11.MMR0.ABORT | PDP11.MMR0.TRAP_MMU))) { /* @@ -1999,7 +2016,7 @@ CPUStatePDP11.prototype.getVirtualAddrByMode = function(mode, reg, accessFlags) */ CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress) { - return this.bus.getWord(physicalAddress); + return this.bus.getWord(this.lastAddr = physicalAddress); }; /** @@ -2013,7 +2030,7 @@ CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress) */ CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress) { - return this.bus.getWord(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ_WORD)); + return this.bus.getWord(this.lastAddr = this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ_WORD)); }; /** @@ -2027,7 +2044,7 @@ CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress) */ CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data) { - this.bus.setWord(physicalAddress, data & 0xffff); + this.bus.setWord(this.lastAddr = physicalAddress, data & 0xffff); }; /** @@ -2041,7 +2058,7 @@ CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data) */ CPUStatePDP11.prototype.writeWordToVirtual = function(virtualAddress, data) { - this.bus.setWord(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.WRITE_WORD), data); + this.bus.setWord(this.lastAddr = this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.WRITE_WORD), data); }; /** diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index bf18ed94d..5dc89dc67 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -266,7 +266,32 @@ if (DEBUGGER) { * Register numbers 0-7 are reserved for cpu.regsGen, 8-15 are reserved for cpu.regsAlt, and 16-19 for cpu.regsStack. */ DebuggerPDP11.REG_PSW = 20; - DebuggerPDP11.REG_SR = 21; // SWITCH register; see Panel's getSR() and setSR() + DebuggerPDP11.REG_PIR = 21; + DebuggerPDP11.REG_ERR = 22; + DebuggerPDP11.REG_SL = 23; + DebuggerPDP11.REG_MMR0 = 24; + DebuggerPDP11.REG_MMR1 = 25; + DebuggerPDP11.REG_MMR2 = 26; + DebuggerPDP11.REG_MMR3 = 27; + DebuggerPDP11.REG_AR = 28; // ADDRESS register; see Panel's getAR() and setAR() + DebuggerPDP11.REG_DR = 29; // DISPLAY/DATA register; see Panel's getDR() and setDR() + DebuggerPDP11.REG_SR = 30; // SWITCH register; see Panel's getSR() and setSR() + + DebuggerPDP11.REGS = { + "SP": 6, + "PC": 7, + "PS": DebuggerPDP11.REG_PSW, + "IR": DebuggerPDP11.REG_PIR, + "ER": DebuggerPDP11.REG_ERR, + "SL": DebuggerPDP11.REG_SL, + "MMR0": DebuggerPDP11.REG_MMR0, + "MMR1": DebuggerPDP11.REG_MMR1, + "MMR2": DebuggerPDP11.REG_MMR2, + "MMR3": DebuggerPDP11.REG_MMR3, + "AR": DebuggerPDP11.REG_AR, + "DR": DebuggerPDP11.REG_DR, + "SR": DebuggerPDP11.REG_SR + }; /* * Operand type masks; anything that's not covered by OP_SRC or OP_DST must be a OP_OTHER value. @@ -1118,24 +1143,14 @@ if (DEBUGGER) { */ DebuggerPDP11.prototype.getRegIndex = function(sReg, off) { - var iReg = -1; sReg = sReg.toUpperCase(); - switch(sReg) { - case "SP": - iReg = 6; - break; - case "PC": - iReg = 7; - break; - case "SR": - iReg = 21; - break; - default: + var iReg = DebuggerPDP11.REGS[sReg]; + if (iReg == null) { + iReg = -1; if (sReg.charAt(0) == "R") { iReg = +sReg.charAt(1); if (iReg < 0 || iReg > 7) iReg = -1; } - break; } return iReg; }; @@ -1156,7 +1171,7 @@ if (DEBUGGER) { * getRegValue(iReg) * * Register numbers 0-7 are reserved for cpu.regsGen, 8-15 are reserved for cpu.regsAlt, - * 16-19 for cpu.regsAltStack, 20 for regPSW, and 21 for SR (SWITCH register). + * 16-19 for cpu.regsAltStack, 20 for regPSW, etc. * * @this {DebuggerPDP11} * @param {number} iReg @@ -1175,11 +1190,50 @@ if (DEBUGGER) { else if (iReg < 20) { value = this.cpu.regsAltStack[iReg-16]; } - else if (iReg == DebuggerPDP11.REG_PSW) { - value = this.cpu.getPSW(); - } - else if (iReg == DebuggerPDP11.REG_SR && this.panel && this.panel.hasSwitches()) { - value = this.panel.getSR(); + else { + var cpu = this.cpu; + var panel = this.panel; + switch(iReg) { + case DebuggerPDP11.REG_PSW: + value = this.cpu.getPSW(); + break; + case DebuggerPDP11.REG_PIR: + value = cpu.regPIR; + break; + case DebuggerPDP11.REG_ERR: + value = cpu.regErr; + break; + case DebuggerPDP11.REG_SL: + value = cpu.regSL; + break; + case DebuggerPDP11.REG_MMR0: + value = panel.getMMR0(); + break; + case DebuggerPDP11.REG_MMR1: + value = panel.getMMR1(); + break; + case DebuggerPDP11.REG_MMR2: + value = panel.getMMR2(); + break; + case DebuggerPDP11.REG_MMR3: + value = panel.getMMR3(); + break; + case DebuggerPDP11.REG_AR: + if (panel) { + value = panel.getAR(); + } + break; + case DebuggerPDP11.REG_DR: + if (panel) { + value = panel.getDR(); + } + break; + case DebuggerPDP11.REG_SR: + if (panel && panel.hasSwitches()) { + value = panel.getSR(); + } + break; + } } } return value; @@ -1371,6 +1425,7 @@ if (DEBUGGER) { * is calling us in a loop, in which case it will perform its own updateDisplays() when it's done. */ if (fUpdateDisplays !== false) { + if (this.panel && this.panel.stop) this.panel.stop(); this.cmp.updateDisplays(-1); } @@ -2393,28 +2448,86 @@ if (DEBUGGER) { else if (iReg >= 16 && iReg < 20) { sReg = "S" + (iReg - 16) + '=' + this.toStrBase(cpu.regsAltStack[iReg - 16]); } - else if (iReg == DebuggerPDP11.REG_PSW) { - sReg = "PS=" + this.toStrBase(cpu.getPSW()); - } - else if (iReg == DebuggerPDP11.REG_SR && this.panel && this.panel.hasSwitches()) { - sReg = "SR=" + this.toStrBase(this.panel.getSR(), 3); + else { + switch(iReg) { + case DebuggerPDP11.REG_PSW: + sReg = "PS=" + this.toStrBase(cpu.getPSW()); + break; + case DebuggerPDP11.REG_PIR: + sReg = "IR=" + this.toStrBase(cpu.regPIR); + break; + case DebuggerPDP11.REG_ERR: + sReg = "ER=" + this.toStrBase(cpu.regErr); + break; + case DebuggerPDP11.REG_SL: + sReg = "SL=" + this.toStrBase(cpu.regSL); + break; + case DebuggerPDP11.REG_MMR0: + sReg = "MMR0=" + this.toStrBase(cpu.getMMR0()); + break; + case DebuggerPDP11.REG_MMR1: + sReg = "MMR1=" + this.toStrBase(cpu.getMMR1()); + break; + case DebuggerPDP11.REG_MMR2: + sReg = "MMR2=" + this.toStrBase(cpu.getMMR2()); + break; + case DebuggerPDP11.REG_MMR3: + sReg = "MMR3=" + this.toStrBase(cpu.getMMR3()); + break; + case DebuggerPDP11.REG_AR: + if (this.panel) { + sReg = "AR=" + this.toStrBase(this.panel.getAR(), 3); + } + break; + case DebuggerPDP11.REG_DR: + if (this.panel) { + sReg = "DR=" + this.toStrBase(this.panel.getDR()); + } + break; + case DebuggerPDP11.REG_SR: + if (this.panel && this.panel.hasSwitches()) { + sReg = "SR=" + this.toStrBase(this.panel.getSR(), 3); + } + break; + } } if (sReg) sReg += ' '; return sReg; }; /** - * getRegDump() + * getMiscDump() * * Sample register dump: * - * R0=xxxx R1=xxxx R2=xxxx R3=xxxx R4=xxxx R5=xxxx - * SP=xxxx PC=xxxx PS=xxxx T0 N0 Z0 V0 C0 + * MMR0=xxxxxx MMR1=xxxxxx MMR2=xxxxxx MMR3=xxxxxx ER=xxxxxx * * @this {DebuggerPDP11} * @return {string} */ - DebuggerPDP11.prototype.getRegDump = function() + DebuggerPDP11.prototype.getMiscDump = function() + { + var sDump = ""; + sDump += this.getRegOutput(DebuggerPDP11.REG_MMR0) + this.getRegOutput(DebuggerPDP11.REG_MMR1); + sDump += this.getRegOutput(DebuggerPDP11.REG_MMR2) + this.getRegOutput(DebuggerPDP11.REG_MMR3) + this.getRegOutput(DebuggerPDP11.REG_ERR); + sDump += '\n'; + sDump += this.getRegOutput(DebuggerPDP11.REG_SR) + this.getRegOutput(DebuggerPDP11.REG_AR) + this.getRegOutput(DebuggerPDP11.REG_DR); + return sDump; + }; + + /** + * getRegDump(fMisc) + * + * Sample register dump: + * + * R0=xxxxxx R1=xxxxxx R2=xxxxxx R3=xxxxxx R4=xxxxxx R5=xxxxxx + * SP=xxxxxx PC=xxxxxx PS=xxxxxx IR=xxxxxx SL=xxxxxx T0 N0 Z0 V0 C0 + * + * @this {DebuggerPDP11} + * @param {boolean} [fMisc] (true to include misc registers) + * @return {string} + */ + DebuggerPDP11.prototype.getRegDump = function(fMisc) { var i; var sDump = ""; @@ -2423,8 +2536,9 @@ if (DEBUGGER) { } sDump += '\n'; sDump += this.getRegOutput(PDP11.REG.SP) + this.getRegOutput(PDP11.REG.PC); - sDump += this.getRegOutput(DebuggerPDP11.REG_PSW) + this.getRegOutput(DebuggerPDP11.REG_SR); + sDump += this.getRegOutput(DebuggerPDP11.REG_PSW) + this.getRegOutput(DebuggerPDP11.REG_PIR) + this.getRegOutput(DebuggerPDP11.REG_SL); sDump += this.getFlagOutput('T') + this.getFlagOutput('N') + this.getFlagOutput('Z') + this.getFlagOutput('V') + this.getFlagOutput('C'); + if (fMisc) sDump += '\n' + this.getMiscDump(); return sDump; }; @@ -3390,77 +3504,115 @@ if (DEBUGGER) { if (asArgs && asArgs[1] == '?') { this.println("register commands:"); this.println("\tr\tdump registers"); + this.println("\trm\tdump misc registers"); this.println("\trx [#]\tset flag or register x to [#]"); return; } + var fMisc = false; var cpu = this.cpu; if (fInstruction == null) fInstruction = true; if (asArgs != null && asArgs.length > 1) { var sReg = asArgs[1]; - var sValue = null; - var i = sReg.indexOf('='); - if (i > 0) { - sValue = sReg.substr(i + 1); - sReg = sReg.substr(0, i); - } - else if (asArgs.length > 2) { - sValue = asArgs[2]; + + if (sReg == 'm') { + fMisc = true; } else { - this.println("missing value for " + asArgs[1]); - return; - } - - var w = this.parseExpression(sValue); - if (w === undefined) return; - - var sRegMatch = sReg.toUpperCase(); - switch (sRegMatch) { - case "SP": - case "R6": - cpu.setSP(w); - break; - case "PC": - case "R7": - cpu.setPC(w); - this.dbgAddrNextCode = this.newAddr(cpu.getPC()); - break; - case "N": - if (w) cpu.setNF(); else cpu.clearNF(); - break; - case "Z": - if (w) cpu.setZF(); else cpu.clearZF(); - break; - case "V": - if (w) cpu.setVF(); else cpu.clearVF(); - break; - case "C": - if (w) cpu.setCF(); else cpu.clearCF(); - break; - case "SR": - if (this.panel && this.panel.hasSwitches()) { - this.panel.setSR(w); - break; + var sValue = null; + var i = sReg.indexOf('='); + if (i > 0) { + sValue = sReg.substr(i + 1); + sReg = sReg.substr(0, i); } - /* falls through */ - default: - if (sRegMatch.charAt(0) == 'R') { - var iReg = +sRegMatch.charAt(1); - if (iReg >= 0 && iReg < 6) { - cpu.regsGen[iReg] = w & 0xffff; + else if (asArgs.length > 2) { + sValue = asArgs[2]; + } + else { + this.println("missing value for " + asArgs[1]); + return; + } + + var w = this.parseExpression(sValue); + if (w === undefined) return; + + var sRegMatch = sReg.toUpperCase(); + switch (sRegMatch) { + case "SP": + case "R6": + cpu.setSP(w); + break; + case "PC": + case "R7": + cpu.setPC(w); + this.dbgAddrNextCode = this.newAddr(cpu.getPC()); + break; + case "N": + if (w) cpu.setNF(); else cpu.clearNF(); + break; + case "Z": + if (w) cpu.setZF(); else cpu.clearZF(); + break; + case "V": + if (w) cpu.setVF(); else cpu.clearVF(); + break; + case "C": + if (w) cpu.setCF(); else cpu.clearCF(); + break; + case "PS": + cpu.setPSW(w); + break; + case "IR": + cpu.setPIR(w); + break; + case "ER": + cpu.regErr = w; + fMisc = true; + break; + case "SL": + cpu.setSL(w); + break; + case "MMR0": + cpu.setMMR0(w); + fMisc = true; + break; + case "MMR3": + cpu.setMMR3(w); + fMisc = true; + break; + case "AR": + if (this.panel) this.panel.setAR(w); + fMisc = true; + break; + case "DR": + if (this.panel) this.panel.setDR(w); + fMisc = true; + break; + case "SR": + if (this.panel && this.panel.hasSwitches()) { + this.panel.setSR(w); + fMisc = true; break; } + /* falls through */ + default: + if (sRegMatch.charAt(0) == 'R') { + var iReg = +sRegMatch.charAt(1); + if (iReg >= 0 && iReg < 6) { + cpu.regsGen[iReg] = w & 0xffff; + break; + } + } + this.println("unknown register: " + sReg); + return; } - this.println("unknown register: " + sReg); - return; + this.cmp.updateDisplays(); + this.println("updated registers:"); } - this.cmp.updateDisplays(); - this.println("updated registers:"); } - this.println(this.getRegDump()); + this.println(this.getRegDump(fMisc)); if (fInstruction) { this.dbgAddrNextCode = this.newAddr(cpu.getPC()); @@ -3716,7 +3868,7 @@ if (DEBUGGER) { * a final updateDisplays(). */ if (dbg.panel && dbg.panel.stop) dbg.panel.stop(); - dbg.cmp.updateDisplays(); + dbg.cmp.updateDisplays(-1); dbg.setBusy(false); } ); diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 3dcb63b91..f78b33c2a 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -323,7 +323,7 @@ var PDP11 = { ENABLED: 0x0001, // 000001 address relocation enabled PAGE_NUM: 0x000E, // 000016 page number of last fault PAGE_D: 0x0010, // 000020 last fault occurred in D space - PAGE: 0x001E, // 000176 all of the PAGE bits + PAGE: 0x001E, // 000176 (all of the PAGE bits) MODE: 0x0060, // 000140 processor mode as of last fault COMPLETED: 0x0080, // 000200 last instruction completed (R/O) DSTMODE: 0x0100, // 000400 only destination mode references will be relocated (aka MAINT bit) @@ -333,7 +333,7 @@ var PDP11 = { ABORT_RO: 0x2000, // 020000 abort: read-only ABORT_PL: 0x4000, // 040000 abort: page length ABORT_NR: 0x8000, // 100000 abort: non-resident - ABORT: 0xE000, // 160000 + ABORT: 0xE000, // 160000 (all of the ABORT bits) UPDATE: 0xF0FE // Includes all of: ABORT, TRAP, COMPLETED, MODE, and PAGE bits }, MMR1: { // 177574: general purpose auto-inc/auto-dec register diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index 3d4133380..a9d487162 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -176,6 +176,50 @@ PanelPDP11.LED = { B22: 'B22' }; +/** + * getAR() + * + * @this {PanelPDP11} + * @return {number} (current ADDRESS register) + */ +PanelPDP11.prototype.getAR = function() +{ + return this.regAddr; +}; + +/** + * setAR(value) + * + * @this {PanelPDP11} + * @param {number} value (new ADDRESS register) + */ +PanelPDP11.prototype.setAR = function(value) +{ + this.updateAddr(this.regAddr = value); +}; + +/** + * getDR() + * + * @this {PanelPDP11} + * @return {number} (current DISPLAY register) + */ +PanelPDP11.prototype.getDR = function() +{ + return this.regDisplay; +}; + +/** + * setDR(value) + * + * @this {PanelPDP11} + * @param {number} value (new DISPLAY register) + */ +PanelPDP11.prototype.setDR = function(value) +{ + this.updateData(this.regDisplay = value); +}; + /** * getSR() * @@ -1004,7 +1048,7 @@ PanelPDP11.prototype.updateDisplay = function(nUpdate) * TODO: There is currently no mechanism for selecting regData over regDisplay; * we are acting as if the DATASEL switch setting is locked to "DISPLAY REGISTER". */ - this.updateAddr(nUpdate > 0 && fRunning && !fWaiting? this.cpu.getPC() : this.regAddr); + this.updateAddr(nUpdate > 0 && fRunning && !fWaiting? this.cpu.getLastAddr() : this.regAddr); this.updateData(this.regDisplay); var bits = this.cpu.getMMUState(); diff --git a/modules/pdp11/lib/serialport.js b/modules/pdp11/lib/serialport.js index fe3874da6..9d1059cd8 100644 --- a/modules/pdp11/lib/serialport.js +++ b/modules/pdp11/lib/serialport.js @@ -244,6 +244,10 @@ SerialPortPDP11.prototype.setBinding = function(sType, sBinding, control, sValue if (event.preventDefault) event.preventDefault(); var clipboardData = event.clipboardData || window.clipboardData; if (clipboardData) { + /* + * NOTE: Multiple lines of pasted text will (at least on macOS) contain LFs instead of CRs; + * this is dealt with in receiveData() whenever it receives a string of characters. + */ serial.receiveData(clipboardData.getData('Text')); } }; @@ -522,8 +526,20 @@ SerialPortPDP11.prototype.receiveData = function(data) this.abReceive.push(data); } else if (typeof data == "string") { + var b = 0, bPrev; for (var i = 0; i < data.length; i++) { - this.abReceive.push(data.charCodeAt(i)); + bPrev = b; + b = data.charCodeAt(i); + /* + * NOTE: Multiple lines of pasted text will (at least on macOS) contain LFs instead of CRs; + * we convert them to CRs below. Windows may do something different, but in the worst case, + * even if we receive CR/LF pairs, this code should keep the CRs and lose the LFs. + */ + if (b == str.ASCII.LF) { + if (bPrev == str.ASCII.CR) continue; + b = str.ASCII.CR; + } + this.abReceive.push(b); } } else { diff --git a/modules/shared/lib/strlib.js b/modules/shared/lib/strlib.js index f0509b825..3c8ff6cdc 100644 --- a/modules/shared/lib/strlib.js +++ b/modules/shared/lib/strlib.js @@ -551,6 +551,10 @@ str.trim = function(s) /* * Any codes commented out in the following table are deemed "printable" */ +str.ASCII = { + LF: 0x0A, + CR: 0x0D +}; str.aASCIICodes = { 0x00: "NUL", 0x01: "SOH", // (CTRL_A) Start of Heading diff --git a/versions/pdpjs/1.30.3/pdp11-dbg.js b/versions/pdpjs/1.30.3/pdp11-dbg.js index 386f9a1c7..b9e72a96c 100644 --- a/versions/pdpjs/1.30.3/pdp11-dbg.js +++ b/versions/pdpjs/1.30.3/pdp11-dbg.js @@ -31,294 +31,297 @@ 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>=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 ra(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function va(a){return a.replace(/[&<>"']/g,function(a){return ua[a]})} -function wa(a,b){return(a+" ").slice(0,b)}function xa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ya={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 za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== +for(var k,ba="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)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea>=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 sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})} +function xa(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 Ea(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={ea:null,ga:null,Na:null,Ma: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.Na=g.load;d.Ma=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ea=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.Oa=g.load;d.Na=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ga=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Za=this.id:(this.Sa=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.w={ready:!1,bb:!1,ac:!1,ha:!1,error:!1};this.Tb=null;this.w.error=!1;this.G={};this.i=null;this.ka=d||0;u.push(this)}var cb=void 0,db={}; -if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(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=t);a.prototype=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var pb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else pb={},u=[];function qb(a,b,c){pb[a]&&b&&(pb[a][b]=c)}function rb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bb?this.ab=this.id:(this.Ua=this.id.substr(0,b),this.ab=this.id.substr(b+1));this[a]=c;this.A={ready:!1,eb:!1,ec:!1,ha:!1,error:!1};this.Yb=null;this.A.error=!1;this.G={};this.i=null;this.ka=d||0;u.push(this)}var db=void 0,eb={}; +if(window){db||(db=window.location.search.substr(1));for(var fb,gb=/\+/g,hb=/([^&=]+)=?([^&]*)/g;fb=hb.exec(db);)eb[decodeURIComponent(fb[1].replace(gb," "))]=decodeURIComponent(fb[2].replace(gb," "))}function ib(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=t);a.prototype=ib(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var qb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else qb={},u=[];function rb(a,b,c){qb[a]&&b&&(qb[a][b]=c)}function sb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.g["S"+a]=[0,0,!1,!1,this.gd,a]}z(Cb);var Db=7;function Eb(a,b){return a.g[b]&&a.g[b][1]}k=Cb.prototype;k.reset=function(){this.stop()}; -k.sa=function(a,b,c,d){if(this.C&&this.C.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(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.G[b]=c,this.I++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.A[b]=d?1:0,this.I++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Fb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Gb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Fb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Gb(a,b)}}(this,b),!0):this.parent.sa.call(this,a,b,c,d)}};k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Hb(b,this,Ib);Jb(b,this.reset.bind(this));Kb(this);Lb(this)};k.Ia=function(a,b){b||(Mb(),this.reset());return!0};k.Ha=function(){return!0}; -function Nb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Kb(a,b){for(var c in a.A)Nb(a,c,null!=b?b:a.A[c])}function Ob(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Lb(a){for(var b in a.g)Ob(a,b,a.g[b][1])}function Pb(a,b,c,d){a.G[b]&&(void 0===c&&(yb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?qa(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} -function Fb(a,b){var c=a.g[b];Ob(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.L="DEP"==b,a.M="EXAM"==b)}function Gb(a,b){var c=a.g[b];c[2]&&c[3]&&(Ob(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.w.W||(a=this.b,a.v.reset(),bc(a),Eb(this,"ENABLE")&&this.b.ib())};k.fd=function(){};k.ad=function(a){a||this.b.da()}; -k.Zc=function(a){if(!a&&!this.b.w.W)if(Eb(this,"ENABLE"))this.b.ib();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.jb(0,null),ub(a,!1);else try{var b=this.b.jb(1);0a.b.Va?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Pa;Eb(a,"STEP")||(b=-b);hc(a,a.f&~c|a.f+b&c)} -function hc(a,b){a.f=b&a.v.Pa;b=a.f;for(var c=0;22>c;c++)jc(a,"A"+c,b&1<c;c++)jc(a,"D"+c,b&1<c;c++)a.g["S"+c][1]=b&1<>2;this.v=this.za-1;this.D=this.H/this.za|0;this.ab=[];this.la=0;this.f=!1;this.cc=0;this.B=[];this.Nc=[oc,pc,qc,rc];a=new I(this);sc(a,this.i);this.Y=Array(this.D);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.ab[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Fa(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} -function pc(a,b,c){var d=!1,e=this.controller,f=e.ab[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](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.ab[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Fa(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b), -!0,!e.la))}function qc(a,b){var c=-1,d=this.controller;a=d.ab[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.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Fa(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} -function rc(a,b,c){var d=!1,e=this.controller;a=e.ab[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.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Fa(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} -function uc(a,b){if(b!=a.C){var c;a.C&&(c=(1<>>a.ja;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Pb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Pb){n=l.size-(f-m);n>g&&(n=g);l.Pb=f-l.F+n;f=m+a.za;g-=n;h++;continue}}return zc(1,f,g)}f=new I(a,f,n,a.za,d,e);sc(f,a.i,l);a.Y[h++]=f;f=m+a.za;g-=n}return 0>=g?(d==Ac&&(a.cc+=c),a.status((c>>10)+"Kb "+Bc[d]+" at "+qa(b)),!0):zc(2,b,c)} -function wc(a,b,c){var d=[];for(b>>>=a.ja;0>>=a.ja;0>>this.ja].Vb(a&this.v,a)};k.Ub=function(a){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Pa)>>>this.ja].hc(a&this.v,a);this.la--;return a}; -k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Pa)>>>this.ja].ra(a&this.v,a)};k.cb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Pa)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].ic(b,a);this.la--;return a};k.Bb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Pa)>>>this.ja].Zb(a&this.v,b&255,a)};k.qb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Pa)>>>this.ja].$b(a&this.v,b&255,a);this.la--}; -k.hb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Pa)>>>this.ja].Qb(a&this.v,b&65535,a)};k.Cb=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Pa)>>>this.ja;this.f=!1;this.la++;this.Y[d].mc(c,b&65535,a);this.la--}; -function Dc(a){for(var b=0,c=[],d=0;da.b.Va)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r>16&65535);a=a.Hb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.wd=function(){var a=this.b;a.Ba&57344||(a.Jb=a.oa&65535);return a.Jb};k.xd=function(){return this.b.fb};k.pe=function(a){var b=this.b;1170>b.Va&&(a&=-49);b.fb!=a&&(b.fb=a,b.Ca=a&16?4194303:262143,Tc(b))};k.Yd=function(a){a=a>>1&63;var b=this.b.Ob[a>>1];return a&1?b>>16:b&65535}; -k.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Ob[c]=b&1?this.b.Ob[c]&65535|(a&63)<<16:this.b.Ob[c]&-65536|a&65534};k.Rd=function(a){return this.b.V[1][a>>1&7]};k.Je=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Pd=function(a){return this.b.V[1][(a>>1&7)+8]};k.He=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Qd=function(a){return this.b.ya[1][a>>1&7]};k.Ie=function(a,b){b=b>>1&7;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.Od=function(a){return this.b.ya[1][(a>>1&7)+8]}; -k.Ge=function(a,b){b=(b>>1&7)+8;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.rd=function(a){return this.b.V[0][a>>1&7]};k.le=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.pd=function(a){return this.b.V[0][(a>>1&7)+8]};k.je=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.qd=function(a){return this.b.ya[0][a>>1&7]};k.ke=function(a,b){b=b>>1&7;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.od=function(a){return this.b.ya[0][(a>>1&7)+8]};k.ie=function(a,b){b=(b>>1&7)+8;this.b.ya[0][b]=a;this.b.V[0][b]&=65295}; -k.Xd=function(a){return this.b.V[3][a>>1&7]};k.Pe=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Vd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ne=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Wd=function(a){return this.b.ya[3][a>>1&7]};k.Oe=function(a,b){b=b>>1&7;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.Ud=function(a){return this.b.ya[3][(a>>1&7)+8]};k.Me=function(a,b){b=(b>>1&7)+8;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.zb=function(a){a&=7;return this.b.N&2048?this.b.Xa[a]:this.b.u[a]}; -k.Db=function(a,b){b&=7;this.b.N&2048?this.b.Xa[b]=a:this.b.u[b]=a};k.Cd=function(){return this.b.N&49152?this.b.Ka[0]:this.b.u[6]};k.ue=function(a){this.b.N&49152?this.b.Ka[0]=a:this.b.u[6]=a};k.Fd=function(){return this.b.u[7]};k.xe=function(a){this.b.u[7]=a};k.Ab=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Xa[a]};k.Eb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Xa[b]=a};k.Dd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ka[1]}; -k.ve=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ka[1]=a};k.Ed=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ka[3]};k.we=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ka[3]=a};k.md=function(a){return this.b.Gc[a-65504>>1]};k.ge=function(a,b){this.b.Gc[b-65504>>1]=a};k.Dc=function(a){if(65520==a){a=0;switch(Ac){case Ac:a=this.v.cc}a=(a>>6)-1}else a=0;return a};k.Kc=function(){};k.Td=function(){return 1};k.Le=function(){};k.ld=function(){return this.b.Ja}; -k.fe=function(){this.b.Ja=0};k.td=function(){return this.b.Fc};k.ne=function(a,b){b&1||(a&=255);this.b.Fc=a};k.yd=function(a){return a?this.b.jc:0};k.qe=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.jc=a;b.J|=2};k.Sd=function(a){return a?this.b.Xb&65280:0};k.Ke=function(a){this.b.Xb=a|255};k.Bd=function(){return Uc(this.b)};k.te=function(a){Vc(this.b,a&-1793|Uc(this.b)&1792);this.b.J|=128};k.Jc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)}; -var L={},Rc=(L[61568]=[null,null,K.prototype.Yd,K.prototype.Qe,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Rd,K.prototype.Je,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Pd,K.prototype.He,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Qd,K.prototype.Ie,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Od,K.prototype.Ge,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.rd,K.prototype.le,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.pd,K.prototype.je,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.qd, -K.prototype.ke,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.od,K.prototype.ie,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.xd,K.prototype.pe,"MMR3",1,1145],L[65382]=[null,null,K.prototype.sd,K.prototype.me,"LKS"],L[65402]=[null,null,K.prototype.ud,K.prototype.oe,"MMR0",1,1145],L[65404]=[null,null,K.prototype.vd,K.prototype.Jc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.wd,K.prototype.Jc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.Xd,K.prototype.Pe,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Vd, -K.prototype.Ne,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Wd,K.prototype.Oe,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Ud,K.prototype.Me,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.zb,K.prototype.Db,"R0SET0"],L[65473]=[null,null,K.prototype.zb,K.prototype.Db,"R1SET0"],L[65474]=[null,null,K.prototype.zb,K.prototype.Db,"R2SET0"],L[65475]=[null,null,K.prototype.zb,K.prototype.Db,"R3SET0"],L[65476]=[null,null,K.prototype.zb,K.prototype.Db,"R4SET0"],L[65477]=[null,null,K.prototype.zb,K.prototype.Db, -"R5SET0"],L[65478]=[null,null,K.prototype.Cd,K.prototype.ue,"R6KERNEL"],L[65479]=[null,null,K.prototype.Fd,K.prototype.xe,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ab,K.prototype.Eb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ab,K.prototype.Eb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ab,K.prototype.Eb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ab,K.prototype.Eb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ab,K.prototype.Eb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ab, -K.prototype.Eb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Dd,K.prototype.ve,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Ed,K.prototype.we,"R6USER",1,1145],L[65504]=[null,null,K.prototype.md,K.prototype.ge,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Dc,K.prototype.Kc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Dc,K.prototype.Kc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Td,K.prototype.Le,"SYSID",1,1170],L[65526]=[null,null,K.prototype.ld,K.prototype.fe,"CPUERR",1,1170],L[65528]= -[null,null,K.prototype.td,K.prototype.ne,"MB",1,1170],L[65530]=[null,null,K.prototype.yd,K.prototype.qe,"PIR"],L[65532]=[null,null,K.prototype.Sd,K.prototype.Ke,"SL"],L[65534]=[null,null,K.prototype.Bd,K.prototype.te,"PSW"],L);Za(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),cd(this,Zc?dd:ed);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Fa(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},ua: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.Ua=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;jd(c,this.F+a,1,c.M)&&c.da(!0)}return this.hc(a,b)},Sa:function(a,b){if(this.i&&null!=this.F){var c=this.i;jd(c,this.F+a,2,c.M)&&c.da(!0)}return this.ic(a,b)},Za:function(a, -b,c){if(this.i&&null!=this.F){var d=this.i;jd(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.$b(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;jd(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.mc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Fa(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Fa(b,64,2); -a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Ua=!0},ma:function(a,b,c){this.G[a]=b;this.Ua=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&this.v.Fa(c,64,4);this.D.setUint16(a,b,!0);this.Ua=!0},Ca:function(a,b,c){a&1&&this.v.Fa(c,64,4);this.I[a>>1]=b;this.Ua=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, -b)+")",!0)}};function sc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&id(a,hd,!1),(a.C=c.C)&&gd(a,hd,!1))}function kd(a,b){b?--a.C||(a.Zb=a.f?a.A:a.$b,a.Qb=a.f?a.H:a.mc):--a.g||(a.Vb=a.hc,a.ra=a.ic)}function gd(a,b,c){c&&a.C||(a.Zb=!a.f&&b[1]||a.A,a.Qb=!a.f&&b[3]||a.H);if(c||void 0===c)a.$b=b[1]||a.A,a.mc=b[3]||a.H}function id(a,b,c){c&&a.g||(a.Vb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.hc=b[0]||a.K,a.ic=b[2]||a.L}function cd(a,b){b||(b=ld);id(a,b,void 0);gd(a,b,void 0)} -var ld=[],fd=[I.prototype.S,I.prototype.ua,I.prototype.ca,I.prototype.La],hd=[I.prototype.O,I.prototype.Za,I.prototype.Sa,I.prototype.xa];if(zb)var ed=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.wa],dd=[I.prototype.R,I.prototype.ma,I.prototype.ba,I.prototype.Ca]; -function md(a,b){t.call(this,"CPU",a,md,1);b=a.cycles||b;var c=a.multiplier||1;this.tb=0;this.mb=b;this.eb=c;this.Fb=Math.round(this.mb/1E4)/100;this.pb=this.Fb*this.eb;this.w.W=!1;this.w.Yb=!1;this.w.sb=a.autoStart;this.w.ub=!1;this.Lb=this.ua=0;this.Mb=a.csStart;this.wb=a.csInterval;this.xb=a.csStop;this.K=[];this.Cc=this.be.bind(this);H(this)}z(md);var nd=["power","reset"];k=md.prototype; -k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.A=a.A;for(b=0;b=a.ua&&(a.ua+=a.wb,c=!0);0<=a.xb&&a.xb<=td(a)&&(a.wb=a.xb=-1,qd(a),a.da(),c=!0);c&&a.j(td(a)+" cycles: checksum="+p(a.Lb))}} -k.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.w.ha)a=!0;else{var b=null,c,h=rb(a.id);for(c=0;ca.ma/a.pb?b=1:d=!0;a.eb=b;b=a.Fb*a.eb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.rb()}dc(a,a.X);a.X=0;a.S=Aa();a.ba=0;vd(a);return d}function Gc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&ba.K[b][0])&&(c=a.mb*a.eb/1E3*c|0,a.w.W&&(c+=wd(a)),a.K[b][0]=c)} -function xd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function cc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function wd(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c} -k.be=function(){if(this.w.W){this.Gb>=this.mb&&vd(this,!0);this.La=0;this.kb=Aa();if(this.ba){var a=this.kb-this.ba;a>this.zc&&(this.S+=a,this.S>this.kb&&(this.S=this.kb))}try{do{var b=xd(this,this.w.ub?1:this.ob);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=wd(this,!0);this.La+=b;this.X+=b;ec(this,b);cc(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.ob;15<=++this.Ac&&(this.pa(),this.Ac=0);break}}while(this.w.W)}catch(e){this.da();this.C&&this.C.stop(Aa(),td(this));yb(this,e.stack||e.message); -return}if(this.w.W){a=setTimeout;b=this.Cc;this.ba=Aa();var c=this.zc;this.La&&(c=Math.round(c*this.La/this.ob));var c=c-(this.ba-this.kb),d=this.ba-this.S;d&&(this.ma=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ia=0,ud(this)));if(0>c||this.mac&&(this.S-=c),c=0;this.Gb+=this.La;this.ba+=c;a(b,c)}}}; -k.ib=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;ud(this);this.w.W=!0;this.w.Yb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.rb(!0),this.C.start(this.S,td(this)));setTimeout(this.Cc,0);return!0};k.jb=function(){return 0};k.da=function(a){var b=!1;if(this.w.W){wd(this);dc(this,this.X);this.X=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),td(this));b=!0}this.w.complete=a;return b}; -function yd(a){this.Va=+a.model||1170;this.xc=a.addrReset||0;md.call(this,a,6666667);this.decode=1120==this.Va?zd.bind(this):Ad.bind(this);Bd(this);this.M=0;this.O=null;this.w.complete=!1}z(yd,md);k=yd.prototype;k.reset=function(){this.status("model "+this.Va);this.w.W&&this.da();Bd(this);pd(this);this.w.error=!1;this.parent.reset.call(this)}; -function Bd(a){a.T=65536;a.U=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.xc];a.Xa=[0,0,0,0,0,0];a.Ka=[0,0,0,0];a.B=0;a.lb=0;a.Xc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ya=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Ob=[0,0,0,0,0,0,0,0,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.Gc=[0,0,0,0,0,0,0,0];a.Fc=0;a.J=0;a.D=a.H=0;a.g=a.f=a.vb=0;a.xa=-1;bc(a)}function bc(a){a.Xb=255;a.Ja=0;a.jc=0;a.Ba=0;a.Hb=0;a.Jb=0;a.fb=0;a.L=0;a.$a=0;a.Ca=262143;a.oa=0;a.O=null;a.v&&Tc(a)}function Tc(a){a.L?(a.R=65536,a.vc=a.fb&16?4186112:253952,a.aa=a.Vc,a.ra=a.Zd,a.Qb=a.Re,uc(a.v,a.fb&16?22:18)):(a.R=0,a.vc=57344,a.aa=a.Uc,a.ra=a.Ec,a.Qb=a.Lc,uc(a.v,16))} -function Sc(a,b){b&=-3073;if(a.Ba!=b){b&57344&&!(a.Ba&57344)&&(a.Hb=a.oa>>16&65535,a.Jb=a.oa&65535);a.Ba=b;a.$a=b>>5&3;a.lb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.L!=c&&(a.L=c,Tc(a))}}k.sc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ia,this.eb]);a.set(2,Dc(this.v));return a.data()}; -k.restore=function(a){var b=a[1];this.ia=b[1];ud(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.N>>14&3;a.B!=c&&(a.Ka[c]=a.u[6],a.u[6]=a.Ka[a.B]);a.N=b;a.J|=2}function Q(a,b){a.J&128||(a.Z=a.$=b,a.U=0)}function Kd(a,b,c){a.J&128||(a.Z=a.$=a.T=b,a.U=c||0)} -function fe(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^b)&(d^b))}function ge(a,b){a.J&128||(a.Z=a.$=a.T=b,a.U=a.Z^a.T>>1)}function he(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^d)&(d^b))} -k.ta=function(a,b,c){if(!this.M){0>this.xa?this.xa=Uc(this):this.B||(a=4,this.Ja|=4,this.u[6]=4,c=-3);this.oa=a;this.B=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);Vc(this,e&-12289|this.xa>>2&12288);ie(this,this.xa);ie(this,this.u[7]);O(this,d);this.J&=~(b|18);this.J|=9;this.xa=-1;this.jd=a;this.hd=c;if(-3<=c)throw a;}};function je(a){var b=ke(a),c=ke(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Vc(a,c);a.J&=-17} -function Cc(a,b){var c=b>>13&31;31>c&&a.fb&32&&(b=a.Ob[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function le(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.vc),f;d=b>>13;a.fb&a.Xc[a.B]||(d&=7);e=a.V[a.B][d];f=(a.ya[a.B][d]<<6)+(b&8191)&a.Ca;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.B][d]=e;if(f!=(4194170&a.Ca)||a.B)a.$a=a.B,a.lb=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.Ba& -57344||(g|=a.$a<<5|a.lb<<1,Sc(a,a.Ba&-61695|g)),b=!0),a.Ba&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.Ba|=4096,a.Ba&512&&(a.J|=64)),b&&a.ta(168,0,-1));return f}function me(a,b){return a.v.Ib(b)}function ke(a){var b=a.ra(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function ie(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.oa=a.oa&65535|(a.oa&-65536)<<8|16121856;ne(a,0,c);a.Qb(c,b)}function ne(a,b,c){!a.B&&c<=a.Xb&&(b||4c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.ra(e)|g;a.b-=8;break;case 6:return e=a.ra(Hd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Hd(a,2)),e=e+ -a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.oa=a.oa&65535|(a.oa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&ne(a,b,a.u[6]);return e}k.Ub=function(a){if(!this.L)return this.v.Ub(a);this.M++;a=me(this,le(this,a,3));this.M--;return a};k.cb=function(a){if(!this.L)return this.v.cb(a);this.M++;a=this.Ec(le(this,a,2));this.M--;return a};k.qb=function(a,b){this.L?(this.M++,a=le(this,a,5),a&1&&this.b--,this.v.Bb(a,b),this.M--):this.v.qb(a,b)}; -k.Cb=function(a,b){this.L?(this.M++,this.Lc(le(this,a,4),b),this.M--):this.v.Cb(a,b)};k.Uc=function(a,b,c){return oe(this,a,b,c)};k.Vc=function(a,b,c){return le(this,oe(this,a,b,c),c)};k.Ec=function(a){return this.v.na(a)};k.Zd=function(a){return this.v.na(le(this,a,2))};k.Lc=function(a,b){this.v.hb(a,b&65535)};k.Re=function(a,b){this.v.hb(le(this,a,4),b)}; -function pe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=oe(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.ra(d|c&a.R),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ka[a.N>>12&3];return c}function qe(a,b,c,d){a.oa=a.oa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=oe(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=le(a,e|c&65536,4),a.B=a.N>>14&3,a.v.hb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ka[a.N>>12&3]=d} -function re(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?me(a,a.aa(b,c,3)):-c-1}function se(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.aa(b,d,2)):c=-d-1;return c}function te(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return oe(a,b,c,8)}function ue(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?me(a,a.aa(b,c,3)):a.u[c]&255}function ve(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.aa(b,c,2)):a.u[c]} -function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.vb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,me(a,e)),e&1&&a.b--,a.v.Bb(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 S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.hb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} -function we(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.v.Bb(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 xe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.hb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.jb=function(a){this.w.complete=!0;var b=this.i?ye(this.i)?1:this.w.Yb?-1:0:0,c=a?this.w.Yb?0:1:-1;this.w.Yb=!1;this.ca=this.b=a;do{if(b){if(ze(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&7)if(a=!1,this.J&2){this.J&=-3;var d=160,e=(this.jc&224)>>5,f=this.O&&this.O.yb>e?this.O:null;f&&(d=f.de,e=f.yb);e>(this.N&224)>>5?(this.J&4&&(Hd(this,2),this.J&=-5),this.ta(d,0,-9),e=!0):e=!1;e&&(f&&Id(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&ze(this.i,this.u[7],c)){this.da(); -break}if(0>c)break}if(this.J&112&&Jd(this)){if(b&&ze(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Gd(this))}while(0>1|b<<16;ge(this,a);return a&65535}function Fe(a,b){a=b&128|b>>1|b<<8;ge(this,a<<8);return a&255}function Ge(a,b){a=b&~a;Q(this,a);return a}function He(a,b){a=b&~a;Q(this,a<<8);return a}function Ie(a,b){a|=b;Q(this,a);return a}function Je(a,b){a|=b;Q(this,a<<8);return a}function Ke(a,b){a=~b|65536;Kd(this,a);return a&65535} -function Le(a,b){a=~b|256;Kd(this,a<<8);return a&255}function Me(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.U=b&(b^a));return a&65535}function Ne(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.U=b&(b^c));return a&255}function Oe(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.U=a&(b^a));return a&65535}function Pe(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.U=c&(b<<8^c));return a&255}function Qe(a,b){a=-b;Kd(this,a,a&b&32768);return a&65535} -function Re(a,b){a=-b;Kd(this,a<<8,(a&b&128)<<8);return a&255}function Se(a,b){a=b<<1|this.T>>16&1;ge(this,a);return a&65535}function Te(a,b){a=b<<1|this.T>>16&1;ge(this,a<<8);return a&255}function Ue(a,b){a=(this.T&65536|b)>>1|b<<16;ge(this,a);return a&65535}function Ve(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;ge(this,a<<8);return a&255}function We(a,b){var c=b-a;he(this,c,a,b);return c&65535}function Xe(a,b){var c=b-a;he(this,c<<8,a<<8,b<<8);return c&255} -function Ye(a,b){this.J&128||(this.Z=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ze(a,b){a^=b;Q(this,a);return a&65535}function $e(a){S(this,a,se(this,a),Ae);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function af(a){var b=ve(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Z=this.$=c;this.b-=(this.g?6:7)+b} -function bf(a){var b=ve(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32>b-1;this.T=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.Z=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function cf(a){T(this,a,!Cd(this))}function df(a){T(this,a,Cd(this))} -function ef(a){S(this,a,se(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ff(a){R(this,a,re(this,a),He);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function gf(a){S(this,a,se(this,a),Ie);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function hf(a){R(this,a,re(this,a),Je);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function jf(a){var b=se(this,a);a=ve(this,a);Q(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function kf(a){var b=re(this,a);a=ue(this,a);Q(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function lf(a){T(this,a,Ed(this))}function mf(a){T(this,a,!Fd(this)==!Dd(this))}function nf(a){T(this,a,!Ed(this)&&!Fd(this)==!Dd(this))}function of(a){T(this,a,!Cd(this)&&!Ed(this))} -function pf(a){T(this,a,Ed(this)||!Fd(this)!=!Dd(this))}function qf(a){T(this,a,Cd(this)||Ed(this))}function rf(a){T(this,a,!Fd(this)!=!Dd(this))}function sf(a){T(this,a,Fd(this))}function tf(a){T(this,a,!Ed(this))}function uf(a){T(this,a,!Fd(this))}function vf(){this.ta(12,0,-8);this.b-=5}function wf(a){T(this,a,!0)}function xf(a){T(this,a,!Dd(this))}function yf(a){T(this,a,Dd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5} -function zf(a){var b=se(this,a);a=ve(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;he(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Af(a){var b=re(this,a);a=ue(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);he(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} -function Bf(a){var b=ve(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=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.$=d>>16|d,this.Z=d>>16):(this.U=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function Cf(){this.ta(24,0,-8);this.b-=25} -function Df(){this.N&49152?(this.Ja|=128,this.ta(4,0,-7)):(this.A&&1120==this.Va&&this.A.setData(this.u[0],!0),this.i?Ef(this.i):this.da());this.b-=7}function Ff(){this.ta(16,0,-8);this.b-=25}var Gf=[0,7,7,10,7,11,9,13];function Hf(a){this.I=this.b;O(this,te(this,a));this.b=this.I-Gf[this.g]}var If=[0,14,14,17,14,18,16,20];function Jf(a){this.I=this.b;var b=te(this,a);a=a>>6&7;ie(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-If[this.g]} -var Kf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Lf(a){var b=se(this,a);this.I=this.b;Q(this,xe(this,a,b));this.b=this.I-Kf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Mf(a){var b=re(this,a);Q(this,we(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Nf=[7,13,13,17,14,18,17,21]; -function Of(a){var b=ve(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.J&128||(this.Z=b>>16,this.$=this.Z|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Uf(a){S(this,a,se(this,a),We);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Vf(a){S(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)}function Wf(){this.ta(28,0,-8);this.b-=5} -function Xf(){this.A&&(this.A.kc(this.u[7],!0),this.A.setData(this.u[0],!0));this.J|=4;Hd(this,-2);this.b-=3}function Yf(a){S(this,a,this.u[a>>6&7],Ze);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Ef(b)):b=!1;b||this.ta(8,0,-8)}function zd(a){Zf[a>>12].call(this,a)}function $f(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)}function fg(a){gg[a&15].call(this,a)} -function hg(a){ig[a&15].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a>>6&3].call(this,a)}function ng(a){og[a>>6&3].call(this,a)} -var Zf=[function(a){pg[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,$e,V,function(a){qg[a>>8&15].call(this,a)},Mf,Af,kf,ff,hf,Uf,V],pg=[function(a){rg[a>>4&15].call(this,a)},wf,tf,lf,mf,rf,nf,pf,Jf,Jf,$f,bg,dg,V,V,V],ag=[function(a){Kd(this,xe(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Me);this.b-=this.g?9:3+(7==this.f?2:0)}],cg=[function(a){S(this,a,0, -Qe);this.b-=this.g?11:6},function(a){S(this,a,Cd(this)?1:0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Cd(this)?1:0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ve(this,a);Kd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],eg=[function(a){S(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ce);this.b-=this.g?9:3+(7==this.f?2:0)}], -rg=[function(a){sg[a&15].call(this,a)},V,V,V,Hf,Hf,Hf,Hf,Rf,V,fg,hg,Vf,Vf,Vf,Vf],sg=[Df,Xf,Sf,vf,Ff,Qf,V,V,V,V,V,V,V,V,V,V],gg=[Pf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.$=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],ig=[Pf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.$=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],qg=[uf,sf,of,qf,xf,yf,cf,df,Cf,Wf,jg,lg,ng,V,V,V],kg=[function(a){Kd(this, -we(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){R(this,a,0,Re);this.b-=this.g?11:6},function(a){R(this,a,Cd(this)?1:0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Cd(this)?1:0,Xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ue(this,a);Kd(this,a<<8);this.b-=this.g?4:3+ -(7==this.f?2:0)}],og=[function(a){R(this,a,0,Ve);this.b-=this.g?9+(this.vb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Fe);this.b-=this.g?9+(this.vb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,De);this.b-=this.g?9:3+(7==this.f?2:0)}];function Ad(a){tg[a>>12].call(this,a)} -var tg=[function(a){ug[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,$e,function(a){vg[a>>8&15].call(this,a)},function(a){wg[a>>8&15].call(this,a)},Mf,Af,kf,ff,hf,Uf,V],ug=[function(a){xg[a>>4&15].call(this,a)},wf,tf,lf,mf,rf,nf,pf,Jf,Jf,$f,bg,dg,function(a){yg[a>>6&3].call(this,a)},V,V],yg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=pe(this,a,0);ie(this,a);Q(this,a);this.b-=11},function(a){var b=ke(this);this.I= -this.b;qe(this,a,0,b);Q(this,b);this.b=this.I-Nf[this.g]},function(a){Q(this,xe(this,a,Fd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],xg=[function(a){zg[a&15].call(this,a)},V,V,V,Hf,Hf,Hf,Hf,Rf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):V.call(this,a)},fg,hg,Vf,Vf,Vf,Vf],zg=[Df,Xf,function(){je(this);this.J|=this.N&16;this.b-=13},vf,Ff,Qf,Sf,function(){this.ta(8,0,-8)},V,V,V,V,V,V,V,V],vg=[Of,Of,Bf,Bf,af,af,bf,bf,Yf,Yf,V,V,V,V,Tf,Tf],wg=[uf,sf,of,qf, -xf,yf,cf,df,Cf,Wf,jg,lg,ng,function(a){Ag[a>>6&3].call(this,a)},V,V],Ag=[V,function(a){a=pe(this,a,65536);ie(this,a);Q(this,a);this.b-=11},function(a){var b=ke(this);this.I=this.b;qe(this,a,65536,b);Q(this,b);this.b=this.I-Nf[this.g]},V]; -function Bg(a){t.call(this,"ROM",a,Bg,256);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.A=a.alias;this.C=a.file;this.H=ra(this.C);if(this.C){a=this.C;var b=sa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(qb(c.Sa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);Cg(c)})}}z(Bg);k=Bg.prototype; -k.Ga=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Cg(this)};k.Ia=function(){this.ga&&(this.i&&Vg(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ha=function(){return!0}; -function Cg(a){if(!wb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)yb(a,"ROM size ("+p(a.g.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 "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[Bg.prototype.Nd,Bg.prototype.Fe,null,null,null,a.f>>1],c);if(Hb(a.v,a,b)){b=a.D=!0;break a}}else if(xc(a.v,b,a.f,bd)){for(c=0;c>>a.ja;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.qb(n++,b[v++]&255);else n&1?a.b.da():null==d&& -(d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&Hc(e.b,e.ma))});this.M=Qc(52,4);this.ia=Gc(this.b,function(){e.g|=128;e.g&64&&Hc(e.b,e.M)});Hb(b,this,ah);Jb(b,this.reset.bind(this));H(this)}; -k.wc=function(){if(!this.I){var a=od(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Za)return;b=xa(b[1]);if(this.I=sb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Sa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ia=function(a,b){if(!b)if(this.wc(),!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(){bh(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return bh(this)};function bh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.Wb=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=wa("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), -this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Pc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var ch={},ah=(ch[65392]=[null,null,X.prototype.Hd,X.prototype.ze,"RCSR"],ch[65394]=[null,null,X.prototype.Gd,X.prototype.ye,"RBUF"],ch[65396]=[null,null,X.prototype.ae,X.prototype.Te,"XCSR"],ch[65398]=[null,null,X.prototype.$d,X.prototype.Se,"XBUF"],ch);Za(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= -function(){var a=d.G.listTapes;a&&fh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[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;fh(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; -k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=gh(a);var e=this;if((this.g=od(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Qc(56,4);this.ca=Gc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=sa(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.C&&!a.C.w.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(qb(a.Sa,e,f),(e=Ea(e,f))&&ph(a,b,c,d,e.ea,e.Na, -e.Ma));a.w.bb=!1;a.D&&(a.D--,a.D||H(a));mh(a)})}function jh(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.va);for(d=0;dc.indexOf("/api/v1/dump")&&(b=sa(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"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.fc?"":e)+"&format=json"));return!!Da(f, -null,!0,function(b,c,d){wh(a,b,c,d)})} -function wh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.w.ha;if(d)a.controller.P('Unable to load disk "'+a.Ya+'" (error '+d+": "+b+")",f);else{qb(a.controller.Sa,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)q(h[0]);else{a.va=h.length;a.Aa=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Oa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y>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.Da?f=a.Ra+a.Da&&(a.Da+=f-(a.Ra+a.Da)+1):(a.Ra=f,a.Da=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.P("Unable to restore disk '"+this.Ya+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=yh(this,a++);)Ah(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 Ah(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 M(a){t.call(this,"RL11",a,M,4194304);this.A=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Ra("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype; -k.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("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.G[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Bh(d,a)},!0;case "loadDrive":return this.G[b]= -c,c.onclick=function(){var a=d.G.listDisks;a&&Ch(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[la(a.value,10)||0])if(a=a.Ea){var b;b="";for(var c=0,h;h=yh(a,c++);)for(var l=0,m=h.length;la;a++)this.f["S"+a]=[0,0,!1,!1,this.kd,a]}z(Db);var Eb=7;function Fb(a,b){return a.f[b]&&a.f[b][1]}k=Db.prototype;k.reset=function(){this.stop()}; +k.ua=function(a,b,c,d){if(this.C&&this.C.ua(a,b,c,d)||this.b&&this.b.ua(a,b,c,d)||this.i&&this.i.ua(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.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.g[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){Gb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Hb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Gb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Hb(a,b)}}(this,b),!0):this.parent.ua.call(this,a,b,c,d)}};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Ib(b,this,Jb);Kb(b,this.reset.bind(this));Lb(this);Mb(this)};k.Ka=function(a,b){b||(Nb(),this.reset());return!0};k.Ja=function(){return!0}; +function Ob(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Lb(a,b){for(var c in a.g)Ob(a,c,null!=b?b:a.g[c])}function Pb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Mb(a){for(var b in a.f)Pb(a,b,a.f[b][1])}function Qb(a,b,c,d){a.G[b]&&(void 0===c&&(zb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} +function Gb(a,b){var c=a.f[b];Pb(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.K="EXAM"==b)}function Hb(a,b){var c=a.f[b];c[2]&&c[3]&&(Pb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.hd=function(a){a||this.b.A.W||(a=this.b,a.v.reset(),Rb(a),Fb(this,"ENABLE")&&this.b.jb())};k.jd=function(){};k.dd=function(a){a||this.b.da()}; +k.bd=function(a){if(!a&&!this.b.A.W)if(Fb(this,"ENABLE"))this.b.jb();else{if((a=this.i)&&!wb(a,!0))vb(a,!0),a.kb(0,null),vb(a,!1);else try{var b=this.b.kb(1);0a.b.Xa?8:16,c=65472<=a.sa&&a.sa<65472+b,b=c?1:2,c=c?15:a.v.Qa;Fb(a,"STEP")||(b=-b);ic(a,a.sa&~c|a.sa+b&c)} +function ic(a,b){a.sa=b&a.v.Qa;b=a.sa;for(var c=0;22>c;c++)kc(a,"A"+c,b&1<c;c++)kc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.v=this.Ba-1;this.D=this.H/this.Ba|0;this.cb=[];this.la=0;this.f=!1;this.gc=0;this.B=[];this.Qc=[pc,qc,rc,sc];a=new I(this);tc(a,this.i);this.Y=Array(this.D);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.cb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Ha(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} +function qc(a,b,c){var d=!1,e=this.controller,f=e.cb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](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.cb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Ha(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b), +!0,!e.la))}function rc(a,b){var c=-1,d=this.controller;a=d.cb[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.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Ha(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} +function sc(a,b,c){var d=!1,e=this.controller;a=e.cb[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.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Ha(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} +function vc(a,b){if(b!=a.C){var c;a.C&&(c=(1<>>a.ja;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Ub+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ub){n=l.size-(f-m);n>g&&(n=g);l.Ub=f-l.F+n;f=m+a.Ba;g-=n;h++;continue}}return Ac(1,f,g)}f=new I(a,f,n,a.Ba,d,e);tc(f,a.i,l);a.Y[h++]=f;f=m+a.Ba;g-=n}return 0>=g?(d==Bc&&(a.gc+=c),a.status((c>>10)+"Kb "+Cc[d]+" at "+ra(b)),!0):Ac(2,b,c)} +function xc(a,b,c){var d=[];for(b>>>=a.ja;0>>=a.ja;0>>this.ja].$b(a&this.v,a)};k.Zb=function(a){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Qa)>>>this.ja].lc(a&this.v,a);this.la--;return a}; +k.na=function(a){3932160<=a&&(a=Dc(this.b,a));return this.Y[(a&this.Qa)>>>this.ja].ra(a&this.v,a)};k.fb=function(a){3932160<=a&&(a=Dc(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].mc(b,a);this.la--;return a};k.Eb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ja].cc(a&this.v,b&255,a)};k.tb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Qa)>>>this.ja].dc(a&this.v,b&255,a);this.la--}; +k.ib=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ja].Vb(a&this.v,b&65535,a)};k.Fb=function(a,b){3932160<=a&&(a=Dc(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ja;this.f=!1;this.la++;this.Y[d].pc(c,b&65535,a);this.la--}; +function Ec(a){for(var b=0,c=[],d=0;da.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r>1&63;var b=this.b.Tb[a>>1];return a&1?b>>16:b&65535};k.Te=function(a,b){b=b>>1&63;var c=b>>1;this.b.Tb[c]=b&1?this.b.Tb[c]&65535|(a&63)<<16:this.b.Tb[c]&-65536|a&65534};k.Ud=function(a){return this.b.V[1][a>>1&7]};k.Me=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Sd=function(a){return this.b.V[1][(a>>1&7)+8]};k.Ke=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295}; +k.Td=function(a){return this.b.Aa[1][a>>1&7]};k.Le=function(a,b){b=b>>1&7;this.b.Aa[1][b]=a;this.b.V[1][b]&=65295};k.Rd=function(a){return this.b.Aa[1][(a>>1&7)+8]};k.Je=function(a,b){b=(b>>1&7)+8;this.b.Aa[1][b]=a;this.b.V[1][b]&=65295};k.ud=function(a){return this.b.V[0][a>>1&7]};k.oe=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.sd=function(a){return this.b.V[0][(a>>1&7)+8]};k.me=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.td=function(a){return this.b.Aa[0][a>>1&7]}; +k.ne=function(a,b){b=b>>1&7;this.b.Aa[0][b]=a;this.b.V[0][b]&=65295};k.rd=function(a){return this.b.Aa[0][(a>>1&7)+8]};k.le=function(a,b){b=(b>>1&7)+8;this.b.Aa[0][b]=a;this.b.V[0][b]&=65295};k.$d=function(a){return this.b.V[3][a>>1&7]};k.Se=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Yd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Qe=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Zd=function(a){return this.b.Aa[3][a>>1&7]};k.Re=function(a,b){b=b>>1&7;this.b.Aa[3][b]=a;this.b.V[3][b]&=65295}; +k.Xd=function(a){return this.b.Aa[3][(a>>1&7)+8]};k.Pe=function(a,b){b=(b>>1&7)+8;this.b.Aa[3][b]=a;this.b.V[3][b]&=65295};k.Cb=function(a){a&=7;return this.b.N&2048?this.b.Za[a]:this.b.u[a]};k.Gb=function(a,b){b&=7;this.b.N&2048?this.b.Za[b]=a:this.b.u[b]=a};k.Fd=function(){return this.b.N&49152?this.b.La[0]:this.b.u[6]};k.xe=function(a){this.b.N&49152?this.b.La[0]=a:this.b.u[6]=a};k.Id=function(){return this.b.u[7]};k.Ae=function(a){this.b.u[7]=a}; +k.Db=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Za[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Za[b]=a};k.Gd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.ye=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Hd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.ze=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.pd=function(a){return this.b.Jc[a-65504>>1]}; +k.je=function(a,b){this.b.Jc[b-65504>>1]=a};k.Gc=function(a){if(65520==a){a=0;switch(Bc){case Bc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Nc=function(){};k.Wd=function(){return 1};k.Oe=function(){};k.od=function(){return this.b.ta};k.ie=function(){this.b.ta=0};k.wd=function(){return this.b.Ic};k.qe=function(a,b){b&1||(a&=255);this.b.Ic=a};k.Bd=function(a){return a?this.b.Sb:0};k.te=function(a){Yc(this.b,a)};k.Vd=function(a){return a?this.b.sb&65280:0};k.Ne=function(a){this.b.sb=a|255};k.Ed=function(){return Zc(this.b)}; +k.we=function(a){$c(this.b,a&-1793|Zc(this.b)&1792);this.b.J|=128};k.Mc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; +var L={},Sc=(L[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.td, +K.prototype.ne,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145],L[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],L[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145],L[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.$d,K.prototype.Se,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Yd, +K.prototype.Qe,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.Cb,K.prototype.Gb,"R0SET0"],L[65473]=[null,null,K.prototype.Cb,K.prototype.Gb,"R1SET0"],L[65474]=[null,null,K.prototype.Cb,K.prototype.Gb,"R2SET0"],L[65475]=[null,null,K.prototype.Cb,K.prototype.Gb,"R3SET0"],L[65476]=[null,null,K.prototype.Cb,K.prototype.Gb,"R4SET0"],L[65477]=[null,null,K.prototype.Cb,K.prototype.Gb, +"R5SET0"],L[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],L[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],L[65480]=[null,null,K.prototype.Db,K.prototype.Hb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Db,K.prototype.Hb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Db,K.prototype.Hb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Db,K.prototype.Hb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Db,K.prototype.Hb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Db, +K.prototype.Hb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],L[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,"SYSID",1,1170],L[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],L[65528]= +[null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],L[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],L[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],L[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],L);$a(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),hd(this,dd?id:jd);else{a=this.b=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Ha(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},wa: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.Wa=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;od(c,this.F+a,1,c.M)&&c.da(!0)}return this.lc(a,b)},Ua:function(a,b){if(this.i&&null!=this.F){var c=this.i;od(c,this.F+a,2,c.M)&&c.da(!0)}return this.mc(a,b)},ab:function(a, +b,c){if(this.i&&null!=this.F){var d=this.i;od(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.dc(a,b,c)},za:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;od(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.pc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Ha(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Ha(b,64,2); +a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Wa=!0},ma:function(a,b,c){this.G[a]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},ya:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.D.setUint16(a,b,!0);this.Wa=!0},Ea:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.I[a>>1]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, +b)+")",!0)}};function tc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&nd(a,md,!1),(a.C=c.C)&&ld(a,md,!1))}function pd(a,b){b?--a.C||(a.cc=a.f?a.w:a.dc,a.Vb=a.f?a.H:a.pc):--a.g||(a.$b=a.lc,a.ra=a.mc)}function ld(a,b,c){c&&a.C||(a.cc=!a.f&&b[1]||a.w,a.Vb=!a.f&&b[3]||a.H);if(c||void 0===c)a.dc=b[1]||a.w,a.pc=b[3]||a.H}function nd(a,b,c){c&&a.g||(a.$b=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.lc=b[0]||a.K,a.mc=b[2]||a.L}function hd(a,b){b||(b=qd);nd(a,b,void 0);ld(a,b,void 0)} +var qd=[],kd=[I.prototype.S,I.prototype.wa,I.prototype.ca,I.prototype.Ma],md=[I.prototype.O,I.prototype.ab,I.prototype.Ua,I.prototype.za];if(Ab)var jd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.ya],id=[I.prototype.R,I.prototype.ma,I.prototype.ba,I.prototype.Ea]; +function rd(a,b){t.call(this,"CPU",a,rd,1);b=a.cycles||b;var c=a.multiplier||1;this.wb=0;this.nb=b;this.gb=c;this.Ib=Math.round(this.nb/1E4)/100;this.qb=this.Ib*this.gb;this.A.W=!1;this.A.bc=!1;this.A.vb=a.autoStart;this.A.xb=!1;this.Pb=this.wa=0;this.Qb=a.csStart;this.zb=a.csInterval;this.Ab=a.csStop;this.K=[];this.Fc=this.ee.bind(this);H(this)}z(rd);var sd=["power","reset"];k=rd.prototype; +k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.w=a.w;for(b=0;b=a.wa&&(a.wa+=a.zb,c=!0);0<=a.Ab&&a.Ab<=yd(a)&&(a.zb=a.Ab=-1,vd(a),a.da(),c=!0);c&&a.j(yd(a)+" cycles: checksum="+p(a.Pb))}} +k.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.A.ha)a=!0;else{var b=null,c,h=sb(a.id);for(c=0;ca.ma/a.qb?b=1:d=!0;a.gb=b;b=a.Ib*a.gb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ub()}ec(a,a.X);a.X=0;a.S=Ba();a.ba=0;Ad(a);return d}function Hc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Qc(a,b,c,d){0<=b&&ba.K[b][0])&&(c=a.nb*a.gb/1E3*c|0,a.A.W&&(c+=Bd(a)),a.K[b][0]=c)} +function Cd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function dc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Bd(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c} +k.ee=function(){if(this.A.W){this.Jb>=this.nb&&Ad(this,!0);this.Ma=0;this.lb=Ba();if(this.ba){var a=this.lb-this.ba;a>this.Cc&&(this.S+=a,this.S>this.lb&&(this.S=this.lb))}try{do{var b=Cd(this,this.A.xb?1:this.pb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=Bd(this,!0);this.Ma+=b;this.X+=b;fc(this,b);dc(this,b);this.ya-=b;if(0>=this.ya){this.ya+=this.pb;15<=++this.Dc&&(this.pa(),this.Dc=0);break}}while(this.A.W)}catch(e){this.da();this.C&&this.C.stop(Ba(),yd(this));zb(this,e.stack||e.message); +return}if(this.A.W){a=setTimeout;b=this.Fc;this.ba=Ba();var c=this.Cc;this.Ma&&(c=Math.round(c*this.Ma/this.pb));var c=c-(this.ba-this.lb),d=this.ba-this.S;d&&(this.ma=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ia=0,zd(this)));if(0>c||this.mac&&(this.S-=c),c=0;this.Jb+=this.Ma;this.ba+=c;a(b,c)}}}; +k.jb=function(a){if(yb(this))return!1;if(this.A.W)return this.j(this.toString()+" busy"),!1;zd(this);this.A.W=!0;this.A.bc=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ub(!0),this.C.start(this.S,yd(this)));setTimeout(this.Fc,0);return!0};k.kb=function(){return 0};k.da=function(a){var b=!1;if(this.A.W){Bd(this);ec(this,this.X);this.X=0;this.A.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),yd(this));b=!0}this.A.complete=a;return b}; +function Dd(a){this.Xa=+a.model||1170;this.Ac=a.addrReset||0;rd.call(this,a,6666667);this.decode=1120==this.Xa?Ed.bind(this):Fd.bind(this);Gd(this);this.M=0;this.O=null;this.A.complete=!1}z(Dd,rd);k=Dd.prototype;k.reset=function(){this.status("model "+this.Xa);this.A.W&&this.da();Gd(this);ud(this);this.A.error=!1;this.parent.reset.call(this)}; +function Gd(a){a.T=65536;a.U=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Ac];a.Za=[0,0,0,0,0,0];a.La=[0,0,0,0];a.B=0;a.mb=0;a.$c=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Aa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Tb=[0,0,0,0,0,0,0,0,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.J=0;a.D=a.H=0;a.g=a.f=a.yb=0;a.za=-1;Rb(a)}function Rb(a){a.Da=0;a.Kb=0;a.Mb=0;a.Ta=0;a.ta=0;a.Sb=0;a.sb=255;a.L=0;a.bb=0;a.Ea=262143;a.Nb=0;a.oa=0;a.O=null;a.v&&Hd(a)}function Hd(a){a.L?(a.R=65536,a.yc=a.Ta&16?4186112:253952,a.aa=a.Yc,a.ra=a.be,a.Vb=a.Ue,vc(a.v,a.Ta&16?22:18)):(a.R=0,a.yc=57344,a.aa=a.Xc,a.ra=a.Hc,a.Vb=a.Oc,vc(a.v,16))}function Tc(a){return a.Da&-3199|a.bb<<5|a.mb<<1} +function Uc(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.Kb=a.oa>>16&65535,a.Mb=a.oa&65535);a.Da=b;a.bb=b>>5&3;a.mb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.L!=c&&(a.L=c,Hd(a))}}function Vc(a){a.Da&57344||(a.Kb=a.oa>>16&65535);a=a.Kb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function Wc(a){a.Da&57344||(a.Mb=a.oa&65535);return a.Mb}function Xc(a,b){1170>a.Xa&&(b&=-49);a.Ta!=b&&(a.Ta=b,a.Ea=b&16?4194303:262143,Hd(a))}k.vc=function(){return 0}; +k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ia,this.gb]);a.set(2,Ec(this.v));return a.data()};k.restore=function(a){var b=a[1];this.ia=b[1];zd(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.N>>14&3;a.B!=c&&(a.La[c]=a.u[6],a.u[6]=a.La[a.B]);a.N=b;a.J|=2}function Yc(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1)}a.Sb=b;a.J|=2}function Q(a,b){a.J&128||(a.Z=a.$=b,a.U=0)}function ke(a,b,c){a.J&128||(a.Z=a.$=a.T=b,a.U=c||0)}function le(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^b)&(d^b))} +function me(a,b){a.J&128||(a.Z=a.$=a.T=b,a.U=a.Z^a.T>>1)}function ne(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^d)&(d^b))}k.va=function(a,b,c){if(!this.M){0>this.za?this.za=Zc(this):this.B||(a=4,this.ta|=4,this.u[6]=4,c=-3);this.oa=a;this.B=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);$c(this,e&-12289|this.za>>2&12288);oe(this,this.za);oe(this,this.u[7]);O(this,d);this.J&=~(b|18);this.J|=9;this.za=-1;this.md=a;this.ld=c;if(-3<=c)throw a;}}; +function pe(a){var b=qe(a),c=qe(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);$c(a,c);a.J&=-17}function Dc(a,b){var c=b>>13&31;31>c&&a.Ta&32&&(b=a.Tb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function re(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.yc),f;d=b>>13;a.Ta&a.$c[a.B]||(d&=7);e=a.V[a.B][d];f=(a.Aa[a.B][d]<<6)+(b&8191)&a.Ea;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.B][d]=e;if(f!=(4194170&a.Ea)||a.B)a.bb=a.B,a.mb=d;b=!1;g&&(g&57344&&(0<=a.za&&(g|=128),a.Da& +57344||(g|=a.bb<<5|a.mb<<1,Uc(a,a.Da&-61695|g),b=!0)),a.Da&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)),b&&a.va(168,0,-1));return f}function se(a,b){return a.v.Lb(b)}function qe(a){var b=a.ra(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function oe(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.oa=a.oa&65535|(a.oa&-65536)<<8|16121856;te(a,0,c);a.Vb(c,b)}function te(a,b,c){!a.B&&c<=a.sb&&(b||4c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.ra(e)|g;a.b-=8;break;case 6:return e=a.ra(Nd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Nd(a,2)),e=e+ +a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.oa=a.oa&65535|(a.oa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&te(a,b,a.u[6]);return e}k.Zb=function(a){if(!this.L)return this.v.Zb(a);this.M++;a=se(this,re(this,a,3));this.M--;return a};k.fb=function(a){if(!this.L)return this.v.fb(a);this.M++;a=this.Hc(re(this,a,2));this.M--;return a};k.tb=function(a,b){this.L?(this.M++,a=re(this,a,5),a&1&&this.b--,this.v.Eb(a,b),this.M--):this.v.tb(a,b)}; +k.Fb=function(a,b){this.L?(this.M++,this.Oc(re(this,a,4),b),this.M--):this.v.Fb(a,b)};k.Xc=function(a,b,c){return ue(this,a,b,c)};k.Yc=function(a,b,c){return re(this,ue(this,a,b,c),c)};k.Hc=function(a){return this.v.na(this.Nb=a)};k.be=function(a){return this.v.na(this.Nb=re(this,a,2))};k.Oc=function(a,b){this.v.ib(this.Nb=a,b&65535)};k.Ue=function(a,b){this.v.ib(this.Nb=re(this,a,4),b)}; +function ve(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ue(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.ra(d|c&a.R),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.La[a.N>>12&3];return c}function we(a,b,c,d){a.oa=a.oa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ue(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=re(a,e|c&65536,4),a.B=a.N>>14&3,a.v.ib(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.La[a.N>>12&3]=d} +function xe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?se(a,a.aa(b,c,3)):-c-1}function ye(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.aa(b,d,2)):c=-d-1;return c}function ze(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ue(a,b,c,8)}function Ae(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?se(a,a.aa(b,c,3)):a.u[c]&255}function Be(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.aa(b,c,2)):a.u[c]} +function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.yb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,se(a,e)),e&1&&a.b--,a.v.Eb(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 S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.ib(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} +function Ce(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.v.Eb(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 De(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.ib(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.kb=function(a){this.A.complete=!0;var b=this.i?Ee(this.i)?1:this.A.bc?-1:0:0,c=a?this.A.bc?0:1:-1;this.A.bc=!1;this.ca=this.b=a;do{if(b){if(Fe(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&7)if(a=!1,this.J&2){this.J&=-3;var d=160,e=(this.Sb&224)>>5,f=this.O&&this.O.Bb>e?this.O:null;f&&(d=f.ge,e=f.Bb);e>(this.N&224)>>5?(this.J&4&&(Nd(this,2),this.J&=-5),this.va(d,0,-9),e=!0):e=!1;e&&(f&&Od(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&Fe(this.i,this.u[7],c)){this.da(); +break}if(0>c)break}if(this.J&112&&je(this)){if(b&&Fe(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Md(this))}while(0>1|b<<16;me(this,a);return a&65535}function Le(a,b){a=b&128|b>>1|b<<8;me(this,a<<8);return a&255}function Me(a,b){a=b&~a;Q(this,a);return a}function Ne(a,b){a=b&~a;Q(this,a<<8);return a}function Oe(a,b){a|=b;Q(this,a);return a}function Pe(a,b){a|=b;Q(this,a<<8);return a}function Qe(a,b){a=~b|65536;ke(this,a);return a&65535} +function Re(a,b){a=~b|256;ke(this,a<<8);return a&255}function Se(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.U=b&(b^a));return a&65535}function Te(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.U=b&(b^c));return a&255}function Ue(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.U=a&(b^a));return a&65535}function Ve(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.U=c&(b<<8^c));return a&255}function We(a,b){a=-b;ke(this,a,a&b&32768);return a&65535} +function Xe(a,b){a=-b;ke(this,a<<8,(a&b&128)<<8);return a&255}function Ye(a,b){a=b<<1|this.T>>16&1;me(this,a);return a&65535}function Ze(a,b){a=b<<1|this.T>>16&1;me(this,a<<8);return a&255}function $e(a,b){a=(this.T&65536|b)>>1|b<<16;me(this,a);return a&65535}function af(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;me(this,a<<8);return a&255}function bf(a,b){var c=b-a;ne(this,c,a,b);return c&65535}function cf(a,b){var c=b-a;ne(this,c<<8,a<<8,b<<8);return c&255} +function df(a,b){this.J&128||(this.Z=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function ef(a,b){a^=b;Q(this,a);return a&65535}function ff(a){S(this,a,ye(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function gf(a){var b=Be(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Z=this.$=c;this.b-=(this.g?6:7)+b} +function hf(a){var b=Be(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32>b-1;this.T=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.Z=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function jf(a){T(this,a,!Id(this))}function kf(a){T(this,a,Id(this))} +function lf(a){S(this,a,ye(this,a),Me);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function mf(a){R(this,a,xe(this,a),Ne);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function nf(a){S(this,a,ye(this,a),Oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function of(a){R(this,a,xe(this,a),Pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function pf(a){var b=ye(this,a);a=Be(this,a);Q(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function qf(a){var b=xe(this,a);a=Ae(this,a);Q(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function rf(a){T(this,a,Kd(this))}function sf(a){T(this,a,!Ld(this)==!Jd(this))}function tf(a){T(this,a,!Kd(this)&&!Ld(this)==!Jd(this))}function uf(a){T(this,a,!Id(this)&&!Kd(this))} +function vf(a){T(this,a,Kd(this)||!Ld(this)!=!Jd(this))}function wf(a){T(this,a,Id(this)||Kd(this))}function xf(a){T(this,a,!Ld(this)!=!Jd(this))}function yf(a){T(this,a,Ld(this))}function zf(a){T(this,a,!Kd(this))}function Af(a){T(this,a,!Ld(this))}function Bf(){this.va(12,0,-8);this.b-=5}function Cf(a){T(this,a,!0)}function Df(a){T(this,a,!Jd(this))}function Ef(a){T(this,a,Jd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5} +function Ff(a){var b=ye(this,a);a=Be(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ne(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Gf(a){var b=xe(this,a);a=Ae(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ne(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} +function Hf(a){var b=Be(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=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.$=d>>16|d,this.Z=d>>16):(this.U=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function If(){this.va(24,0,-8);this.b-=25} +function Jf(){this.N&49152?(this.ta|=128,this.va(4,0,-7)):(this.w&&1120==this.Xa&&this.w.setData(this.u[0],!0),this.i?Kf(this.i):this.da());this.b-=7}function Lf(){this.va(16,0,-8);this.b-=25}var Mf=[0,7,7,10,7,11,9,13];function Nf(a){this.I=this.b;O(this,ze(this,a));this.b=this.I-Mf[this.g]}var Of=[0,14,14,17,14,18,16,20];function Pf(a){this.I=this.b;var b=ze(this,a);a=a>>6&7;oe(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Of[this.g]} +var Qf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Rf(a){var b=ye(this,a);this.I=this.b;Q(this,De(this,a,b));this.b=this.I-Qf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Sf(a){var b=xe(this,a);Q(this,Ce(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Tf=[7,13,13,17,14,18,17,21]; +function Uf(a){var b=Be(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.J&128||(this.Z=b>>16,this.$=this.Z|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function $f(a){S(this,a,ye(this,a),bf);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ag(a){S(this,a,0,df);this.b-=this.g?9:3+(7==this.f?2:0)}function bg(){this.va(28,0,-8);this.b-=5} +function cg(){this.w&&(this.w.nc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=4;Nd(this,-2);this.b-=3}function dg(a){S(this,a,this.u[a>>6&7],ef);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Kf(b)):b=!1;b||this.va(8,0,-8)}function Ed(a){eg[a>>12].call(this,a)}function fg(a){gg[a>>6&3].call(this,a)}function hg(a){ig[a>>6&3].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a&15].call(this,a)} +function ng(a){og[a&15].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)} +var eg=[function(a){vg[a>>8&15].call(this,a)},Rf,Ff,pf,lf,nf,ff,V,function(a){wg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,$f,V],vg=[function(a){xg[a>>4&15].call(this,a)},Cf,zf,rf,sf,xf,tf,vf,Pf,Pf,fg,hg,jg,V,V,V],gg=[function(a){ke(this,De(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Se);this.b-=this.g?9:3+(7==this.f?2:0)}],ig=[function(a){S(this,a,0, +We);this.b-=this.g?11:6},function(a){S(this,a,Id(this)?1:0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Id(this)?1:0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Be(this,a);ke(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],kg=[function(a){S(this,a,0,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)}], +xg=[function(a){yg[a&15].call(this,a)},V,V,V,Nf,Nf,Nf,Nf,Xf,V,lg,ng,ag,ag,ag,ag],yg=[Jf,cg,Yf,Bf,Lf,Wf,V,V,V,V,V,V,V,V,V,V],mg=[Vf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.$=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],og=[Vf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.$=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],wg=[Af,yf,uf,wf,Df,Ef,jf,kf,If,bg,pg,rg,tg,V,V,V],qg=[function(a){ke(this, +Ce(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Te);this.b-=this.g?9:3+(7==this.f?2:0)}],sg=[function(a){R(this,a,0,Xe);this.b-=this.g?11:6},function(a){R(this,a,Id(this)?1:0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Id(this)?1:0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ae(this,a);ke(this,a<<8);this.b-=this.g?4:3+ +(7==this.f?2:0)}],ug=[function(a){R(this,a,0,af);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Le);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)}];function Fd(a){zg[a>>12].call(this,a)} +var zg=[function(a){Ag[a>>8&15].call(this,a)},Rf,Ff,pf,lf,nf,ff,function(a){Bg[a>>8&15].call(this,a)},function(a){Cg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,$f,V],Ag=[function(a){Dg[a>>4&15].call(this,a)},Cf,zf,rf,sf,xf,tf,vf,Pf,Pf,fg,hg,jg,function(a){Eg[a>>6&3].call(this,a)},V,V],Eg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ve(this,a,0);oe(this,a);Q(this,a);this.b-=11},function(a){var b=qe(this);this.I= +this.b;we(this,a,0,b);Q(this,b);this.b=this.I-Tf[this.g]},function(a){Q(this,De(this,a,Ld(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Dg=[function(a){Fg[a&15].call(this,a)},V,V,V,Nf,Nf,Nf,Nf,Xf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):V.call(this,a)},lg,ng,ag,ag,ag,ag],Fg=[Jf,cg,function(){pe(this);this.J|=this.N&16;this.b-=13},Bf,Lf,Wf,Yf,function(){this.va(8,0,-8)},V,V,V,V,V,V,V,V],Bg=[Uf,Uf,Hf,Hf,gf,gf,hf,hf,dg,dg,V,V,V,V,Zf,Zf],Cg=[Af,yf,uf,wf, +Df,Ef,jf,kf,If,bg,pg,rg,tg,function(a){Gg[a>>6&3].call(this,a)},V,V],Gg=[V,function(a){a=ve(this,a,65536);oe(this,a);Q(this,a);this.b-=11},function(a){var b=qe(this);this.I=this.b;we(this,a,65536,b);Q(this,b);this.b=this.I-Tf[this.g]},V]; +function Hg(a){t.call(this,"ROM",a,Hg,256);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.w=a.alias;this.C=a.file;this.H=sa(this.C);if(this.C){a=this.C;var b=ta(this.H);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(rb(c.Ua,a,b),(a=Fa(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);$g(c)})}}z(Hg);k=Hg.prototype; +k.Ia=function(a,b,c,d){this.v=b;this.b=c;this.i=d;$g(this)};k.Ka=function(){this.ga&&(this.i&&ah(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ja=function(){return!0}; +function $g(a){if(!xb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)zb(a,"ROM size ("+p(a.g.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 "+ra(b));if(57344<=b&&b<57344+oc){var c={};b=(c[b]=[Hg.prototype.Qd,Hg.prototype.Ie,null,null,null,a.f>>1],c);if(Ib(a.v,a,b)){b=a.D=!0;break a}}else if(yc(a.v,b,a.f,gd)){for(c=0;c>>a.ja;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.tb(n++,b[v++]&255);else n&1?a.b.da():null==d&& +(d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&Ic(e.b,e.ma))});this.M=Rc(52,4);this.ia=Hc(this.b,function(){e.g|=128;e.g&64&&Ic(e.b,e.M)});Ib(b,this,gh);Kb(b,this.reset.bind(this));H(this)}; +k.zc=function(){if(!this.I){var a=td(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.ab)return;b=ya(b[1]);if(this.I=tb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.Ja=function(a){return a?this.save():!0};k.reset=function(){hh(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return hh(this)};function hh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.ac=function(a){if("number"==typeof a)this.B.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.S||8,c=a-this.H%a,this.S&&(b=xa("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), +this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Qc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var ih={},gh=(ih[65392]=[null,null,X.prototype.Kd,X.prototype.Ce,"RCSR"],ih[65394]=[null,null,X.prototype.Jd,X.prototype.Be,"RBUF"],ih[65396]=[null,null,X.prototype.de,X.prototype.We,"XCSR"],ih[65398]=[null,null,X.prototype.ce,X.prototype.Ve,"XBUF"],ih);$a(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= +function(){var a=d.G.listTapes;a&&lh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[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;lh(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; +k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=mh(a);var e=this;if((this.g=td(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Rc(56,4);this.ca=Hc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.A.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(rb(a.Ua,e,f),(e=Fa(e,f))&&vh(a,b,c,d,e.ea,e.Oa, +e.Na));a.A.eb=!1;a.D&&(a.D--,a.D||H(a));sh(a)})}function ph(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.xa);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ta(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"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.jc?"":e)+"&format=json"));return!!Ea(f, +null,!0,function(b,c,d){Ch(a,b,c,d)})} +function Ch(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ha;if(d)a.controller.P('Unable to load disk "'+a.$a+'" (error '+d+": "+b+")",f);else{rb(a.controller.Ua,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)q(h[0]);else{a.xa=h.length;a.Ca=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Pa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y>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.Fa?f=a.Sa+a.Fa&&(a.Fa+=f-(a.Sa+a.Fa)+1):(a.Sa=f,a.Fa=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.P("Unable to restore disk '"+this.$a+": "+c);return b}; +k.toJSON=function(){var a;a=0;for(var b;b=Eh(this,a++);)Gh(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 Gh(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 M(a){t.call(this,"RL11",a,M,4194304);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Sa("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype; +k.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("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.G[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Hh(d,a)},!0;case "loadDrive":return this.G[b]= +c,c.onclick=function(){var a=d.G.listDisks;a&&Ih(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[ma(a.value,10)||0])if(a=a.Ga){var b;b="";for(var c=0,h;h=Eh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Bh(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){Dh(this)};k.save=function(){return(new N(this)).data()}; -k.restore=function(a){return Dh(this,a[0])};function Gh(a,b){b||(a.H=0);if(a.A)for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('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=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ih(a,e,b,c,!1,d)}else Hh(a,e)} -function Ih(a,b,c,d,e,f){var g=-1,h=a.f[b];h.gb.toLowerCase()!=d.toLowerCase()&&(g++,Hh(a,b,!0),h.ec?a.P("RL11 busy"):(h.ec=!0,e&&(h.dc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Rb=!!f,vh(new rh(a,h,"preload"),c,d,f,a.Tc)&&g++));return g} -k.Tc=function(a,b,c,d,e){var f;a.ec=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.va||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.gc)),b=null);b?(a.Ea=b,a.Ya=c,a.gb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.gc),a.dc||e),this.C&&this.C.rb()):a.Rb=!1;a.dc&&(a.dc=!1,--this.H||H(this));Bh(this,a.gc)}; -function Fh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; -k.nd=function(a,b,c,d,e,f,g){var h=0,l=a.Ea,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ea.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ea.read(m,n++))||0>(r=a.Ea.read(m,n++))){h=5120;break}this.v.hb(f,v|r<<8);if(Fc(this.v)){h=8192;break}f+=2;if(n>=l.Oa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.he=function(a,b,c,d,e,f,g){var h=0,l=a.Ea,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Fc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ea.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ea.write(m,n++,v&255)||!a.Ea.write(m,n++,v>>8)){h=5120;break}if(n>=l.Oa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Kd=function(){return this.fa&65535}; -k.Ce=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.nd;case 10:b||(b=this.he),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.va||f>=c.qa?this.fa|=37888: -(g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Rc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Hc(this.b,this.O))}};k.Id=function(){return this.I};k.Ae=function(a){this.I=a&65534};k.Ld=function(){return this.g};k.De=function(a){this.g=a};k.Md=function(){return this.D};k.Ee=function(a){this.D=a};k.Jd=function(){return this.K};k.Be=function(a){this.K=a&63}; -var Jh={},Eh=(Jh[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Jh[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Jh[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Jh[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Jh[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Jh);function Kh(a){t.call(this,"Debugger",a,Kh);this.ca=a.base||16;this.Ca=!1;this.K=0;this.R=!1;this.B=-1;this.g=[];this.X={}}z(Kh); -var Lh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Kh.prototype.tc=function(){return-1};Kh.prototype.uc=function(){}; -function Mh(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.R?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(xa(b.substring(c,f))),c=f+1}}return a} -function Nh(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; +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ih(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.w=td(this.C,"autoMount")||this.w)&&"string"==typeof this.w)try{this.w=eval("("+this.w+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.w+")"),this.w=null}Jh(this);this.O=Rc(112,5);Ib(b,this,Kh);Kb(b,this.reset.bind(this));Lh(this,"None","",!0);this.L&&Lh(this,"Local Disk","?");Lh(this,"Remote Disk","??");Mh(this)||H(this)}; +k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.uc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Hh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Jh(this)};k.save=function(){return(new N(this)).data()}; +k.restore=function(a){return Jh(this,a[0])};function Mh(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('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=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Oh(a,e,b,c,!1,d)}else Nh(a,e)} +function Oh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,Nh(a,b,!0),h.ic?a.P("RL11 busy"):(h.ic=!0,e&&(h.hc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Wb=!!f,Bh(new xh(a,h,"preload"),c,d,f,a.Wc)&&g++));return g} +k.Wc=function(a,b,c,d,e){var f;a.ic=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.xa||f[1]>a.Ca)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.kc)),b=null);b?(a.Ga=b,a.$a=c,a.hb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.kc),a.hc||e),this.C&&this.C.ub()):a.Wb=!1;a.hc&&(a.hc=!1,--this.H||H(this));Hh(this,a.kc)}; +function Lh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; +k.qd=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ga.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ga.read(m,n++))||0>(r=a.Ga.read(m,n++))){h=5120;break}this.v.ib(f,v|r<<8);if(Gc(this.v)){h=8192;break}f+=2;if(n>=l.Pa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Ca&&(c=0,++b>=l.xa)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.ke=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Gc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ga.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ga.write(m,n++,v&255)||!a.Ga.write(m,n++,v>>8)){h=5120;break}if(n>=l.Pa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Ca&&(c=0,++b>=l.xa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Nd=function(){return this.fa&65535}; +k.Fe=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.qd;case 10:b||(b=this.ke),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.xa||f>=c.qa?this.fa|=37888: +(g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Uc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Ic(this.b,this.O))}};k.Ld=function(){return this.I};k.De=function(a){this.I=a&65534};k.Od=function(){return this.g};k.Ge=function(a){this.g=a};k.Pd=function(){return this.D};k.He=function(a){this.D=a};k.Md=function(){return this.K};k.Ee=function(a){this.K=a&63}; +var Ph={},Kh=(Ph[63744]=[null,null,M.prototype.Nd,M.prototype.Fe,"RLCS"],Ph[63746]=[null,null,M.prototype.Ld,M.prototype.De,"RLBA"],Ph[63748]=[null,null,M.prototype.Od,M.prototype.Ge,"RLDA"],Ph[63750]=[null,null,M.prototype.Pd,M.prototype.He,"RLMP"],Ph[63752]=[null,null,M.prototype.Md,M.prototype.Ee,"RLBE"],Ph);function Qh(a){t.call(this,"Debugger",a,Qh);this.ca=a.base||16;this.Ea=!1;this.K=0;this.R=!1;this.B=-1;this.g=[];this.X={}}z(Qh); +var Rh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Qh.prototype.wc=function(){return-1};Qh.prototype.xc=function(){}; +function Sh(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.R?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 Th(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 Oh(a,b,c){var d;if(b){b=Ph(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+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Sh(a,b){if(b)return Rh(a,b,a.X[b]);var c=0;for(b in a.X)Rh(a,b,a.X[b]),c++;return 0this.b.Va?ai:[];bi(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ci(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Bc[c],n&&d.j(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.uc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Xa[a-8]:20>a?b=this.b.Ka[a-16]:20==a?b=Uc(this.b):21==a&&this.A&&kc(this.A)&&(b=this.A.Wa));return b}; -k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.oa&65535).F));if(this.ka&1073741824)this.wa.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ka&-2147483648&&this.b&&this.b.w.W||vb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,wd(a),a.wa=0,a.pa())}}; -function Vh(a){var b;if(!ye(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Ab[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?ji(a):ki(a)}}function ii(a,b){var c;(c=!a.b||!wb(a.b))||(c=a.b,c.w.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.w.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!xb(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.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Vh(this);this.xa=0;this.ia=null;this.K=0;this.L=Y(this.b.u[7]);this.w.W=!1;li(this);a||rd(this)};k.save=function(){var a=new N(this);a.set(0,ei(this.L));a.set(1,ei(this.O));a.set(2,[this.g,this.R,this.ka]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=fi(a[b++]),this.O=fi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ka|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.w.W=!0;this.Gb=a;this.Hb=b}; -k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.K=b-this.Hb;if(!this.S){b="stopped";if(this.K){a-=this.Gb;var c=0d&&(d=a.b.cb(b)),65535!=(d&65535)&&(a.kc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Ef(a){var b=a.b;if(b.w.W)throw O(b,a.b.oa&65535),a.da(),-1;return!1} -function Uh(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.ja],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ja],!0);a.D=["bw"];a.mb=0}k.nb=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.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].nb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Qa=!0:(ni(this,a,a.length-1,"set"),Vh(this)));return d}; -function mi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.ja],b==a.D));h.Qa||Vh(a);break}}return f}function oi(a,b){for(var c=1;c>23)&65535,x=J(w,r);else if(8192==C)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==C)x=J(w,f&7,1);else if(24576==C)x=J(w,f&63,1);else if(32768==C)x=J(w,f&255,1);else if(C=f&y,y&4032&&(C>>=6,y>>=6), -y&63)switch(y=C&7,C&56){case 0:x=hi(y);break;case 8:x="@"+hi(y);break;case 16:7>y?x="("+hi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+hi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+hi(y)+")";break;case 40:x="@-("+hi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+hi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+hi(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); -0b?(c=hi(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Xa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ka[b-16]):20==b?c="PS="+J(a,Uc(d)):21==b&&a.A&&kc(a.A)&&(c="SR="+J(a,a.A.Wa,3));c&&(c+=" ");return c}function ti(a){var b,c="";for(b=0;6>b;b++)c+=si(a,b);c=c+"\n"+(si(a,6)+si(a,7));c+=si(a,20)+si(a,21);return c+=ri(a,"T")+ri(a,"N")+ri(a,"Z")+ri(a,"V")+ri(a,"C")}k.pc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],v=za(n,l,a.pc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Ze:b,F:c,Wc:d,ga:e,nc:f})}function ui(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.Wc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.pa();a.j("updated registers:")}a.j(ti(a));c&&(a.L=Y(d.u[7]),ki(a,J(a,a.L.F)))}}function yi(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=qi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} -function pi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(wb(a)&&0n||"z"na.length&&(a.j("note: only "+na.length+" available"),Z=na.length);fa-=Z;0>fa&&(null==na[na.length-1].F?(Z=fa+Z,fa=0):fa+=na.length);var Nd=[];"call"==Ig&&(Qb=1E5,Nd=["CALL"]);for(void 0!==Hg&&a.j(Z+" instructions earlier:");0=na.length&&(fa=0);a.ob=Z;Kg++;Qb--}}Kg||(a.j("no "+Jg+"history available"),a.ob=void 0)}else{var lb=ci(a,ma);if(lb){var Sb=0,Od=!1,Pd="ds"==Ma;Na&&(Od=!0,"l"==Na.charAt(0)&&(Od=!1,Na=Na.substr(1)||Si),Sb=Qh(a,Na)>>>0,65536Sd?String.fromCharCode(Sd):"."),Kc=Kc>>8}Oa&&(Oa+="\n");Oa=Pd?Oa+(Pa+","):Oa+(ma+" "+Pa+(0==Jc?" "+Rd:""))}Oa&&a.j(Oa);a.lb=lb}}}}break;case "e":if("else"==g[0])break;var ob,Td,Ud,Vd,Wd=g[0],Xd=g[1];"eb"==Wd?(ob=1,Td=255,Ud=a.Ib,Vd=a.Bb):"e"==Wd||"ew"==Wd?(ob=2,Td=65535,Ud=a.na,Vd=a.hb):Xd=null;if(null==Xd)a.j("edit memory commands:"), -a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Lc=ci(a,Xd);if(Lc)for(var Mc=2;Mc$d;){for(var Qa=null,Xi=256;65536> -Xb.F>>>0;){ae.F=a.na(Xb,2);if(null==Xb.F||!Xi--)break;if(!(ae.F&1)){for(var Yi=a,Nc=ae,Og=null,Yb=Nc.F,Pg=Yb,be=1;6>=be&&Yb;be++){if(2\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bDi){if(Fi(d,this.I)){this.B=new N(this,"1.30.3","failsafe");Fi(this.B)&&(Ki(this,d),a=2,Li(this.B));this.B.set("timestamp",Ba());Mi(this.B);var e=this.f&&!this.D;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ji(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Fi(d,g):("error"== -f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.j(f+": "+g),Li(d),Fi(d)?(c=Ji(d),e=!0):c=!1))}e&&Ii(this,c?d:null)}else 2==a&&d.clear()}else Ii(this);delete this.I;delete this.K}e=rb(this.id);for(f=0;fa[1];a=a[2];this.ca=!0;this.w.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ni(this,this.b,b,c,a),this.pa(),this.b.sb());this.O&&(Ki(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0}; -function Ki(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.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} -function Ai(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ba();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ha&&(c&&a.b.da(),d=a.b.Ha(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.w.ha=!1,!1===d&&(e=null)));for(var h=rb(a.id),l=0;l=c||30<=(b.tb+=c))&&(d.textContent=b.w.W?b.ma.toFixed(2)+"Mhz":"Stopped",b.tb=0)}if(this.A&&(b=this.A,a=a||0,b.I)){c=b.b.w.W;d=!!(b.b.J&4);if(0>=a||60<=(b.H+=a)){for(var e=0;e=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Yh(a,b){if(b)return Xh(a,b,a.X[b]);var c=0;for(b in a.X)Xh(a,b,a.X[b]),c++;return 0this.b.Xa?hi:[];ii(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ji(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Cc[c],n&&d.j(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.xc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.Za[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=Zc(this.b);break;case 21:b=c.Sb;break;case 22:b=c.ta;break;case 23:b=c.sb;break;case 24:b=Tc(d);break;case 25:b=Vc(d);break;case 26:b=Wc(d);break;case 27:b=d.Ta;break;case 28:d&&(b=d.sa);break;case 29:d&&(b=d.rb);break;case 30:d&&lc(d)&&(b=d.Ya)}}return b}; +k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.oa&65535).F));if(this.ka&1073741824)this.ya.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ka&-2147483648&&this.b&&this.b.A.W||wb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,Bd(a),a.ya=0,a.pa())}}; +function ai(a){var b;if(!Ee(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Bb[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?qi(a):ri(a)}}function pi(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Ja=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ai(this);this.za=0;this.ia=null;this.K=0;this.L=Y(this.b.u[7]);this.A.W=!1;si(this);a||wd(this)};k.save=function(){var a=new N(this);a.set(0,li(this.L));a.set(1,li(this.O));a.set(2,[this.g,this.R,this.ka]);a.set(3,this.I);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=mi(a[b++]),this.O=mi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ka|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.A.W=!0;this.Jb=a;this.Kb=b}; +k.stop=function(a,b){if(this.A.W){this.A.W=!1;this.K=b-this.Kb;if(!this.S){b="stopped";if(this.K){a-=this.Jb;var c=0d&&(d=a.b.fb(b)),65535!=(d&65535)&&(a.nc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Kf(a){var b=a.b;if(b.A.W)throw O(b,a.b.oa&65535),a.da(),-1;return!1} +function $h(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.ja],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ja],!0);a.D=["bw"];a.nb=0}k.ob=function(a,b,c){var d=!0;c||ti(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].ob(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Ra=!0:(ui(this,a,a.length-1,"set"),ai(this)));return d}; +function ti(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.ja],b==a.D));h.Ra||ai(a);break}}return f}function vi(a,b){for(var c=1;c>23)&65535,x=J(w,r);else if(8192==C)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==C)x=J(w,f&7,1);else if(24576==C)x=J(w,f&63,1);else if(32768==C)x=J(w,f&255,1);else if(C=f&y,y&4032&&(C>>=6,y>>=6), +y&63)switch(y=C&7,C&56){case 0:x=oi(y);break;case 8:x="@"+oi(y);break;case 16:7>y?x="("+oi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+oi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+oi(y)+")";break;case 40:x="@-("+oi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+oi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+oi(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); +0b)c=oi(b),c+="="+J(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+J(a,d.Za[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+J(a,d.La[b-16]);else switch(b){case 20:c="PS="+J(a,Zc(d));break;case 21:c="IR="+J(a,d.Sb);break;case 22:c="ER="+J(a,d.ta);break;case 23:c="SL="+J(a,d.sb);break;case 24:c="MMR0="+J(a,Tc(d));break;case 25:c="MMR1="+J(a,Vc(d));break;case 26:c="MMR2="+J(a,Wc(d));break;case 27:c="MMR3="+J(a,d.Ta);break;case 28:a.w&&(c="AR="+J(a,a.w.sa,3));break;case 29:a.w&& +(c="DR="+J(a,a.w.rb));break;case 30:a.w&&lc(a.w)&&(c="SR="+J(a,a.w.Ya,3))}c&&(c+=" ");return c}function zi(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+=yi(a,"T")+yi(a,"N")+yi(a,"Z")+yi(a,"V")+yi(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.sc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],v=Aa(n,l,a.sc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({bf:b,F:c,Zc:d,ga:e,qc:f})}function Ai(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.Zc;if(e>=g&&eb)){e.u[b]= +g&65535;break}a.j("unknown register: "+f);return}a.C.pa();a.j("updated registers:")}}a.j(zi(a,d));c&&(a.L=Y(e.u[7]),ri(a,J(a,a.L.F)))}}function Ei(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=xi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} +function wi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(xb(a)&&0n||"z"oa.length&&(a.j("note: only "+oa.length+" available"),aa=oa.length);ga-=aa;0>ga&&(null==oa[oa.length-1].F?(aa=ga+aa,ga=0):ga+=oa.length);var Rd=[];"call"==Ng&&(Sb=1E5,Rd=["CALL"]);for(void 0!==Mg&&a.j(aa+" instructions earlier:");0=oa.length&&(ga=0);a.pb=aa;Pg++;Sb--}}Pg||(a.j("no "+Og+"history available"),a.pb=void 0)}else{var mb=ji(a,na);if(mb){var Ub=0,Sd=!1,Td="ds"==Na;Oa&&(Sd=!0,"l"==Oa.charAt(0)&&(Sd=!1,Oa=Oa.substr(1)||Yi),Ub=Wh(a,Oa)>>>0,65536Wd?String.fromCharCode(Wd):"."),Lc=Lc>>8}Pa&&(Pa+="\n");Pa=Td?Pa+(Qa+","):Pa+(na+" "+Qa+(0==Kc?" "+Vd:""))}Pa&&a.j(Pa);a.mb=mb}}}}break;case "e":if("else"==g[0])break;var pb,Xd,Yd,Zd,$d=g[0],ae=g[1];"eb"==$d?(pb=1,Xd=255,Yd=a.Lb,Zd=a.Eb):"e"==$d||"ew"==$d?(pb=2,Xd=65535,Yd=a.na,Zd=a.ib):ae=null;if(null==ae)a.j("edit memory commands:"), +a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Mc=ji(a,ae);if(Mc)for(var Nc=2;Ncde;){for(var Ra=null,cj=256;65536> +Zb.F>>>0;){ee.F=a.na(Zb,2);if(null==Zb.F||!cj--)break;if(!(ee.F&1)){for(var dj=a,Oc=ee,Tg=null,$b=Oc.F,Ug=$b,fe=1;6>=fe&&$b;fe++){if(2\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bJi){if(Li(d,this.I)){this.B=new N(this,"1.30.3","failsafe");Li(this.B)&&(Qi(this,d),a=2,Ri(this.B));this.B.set("timestamp",Ca());Si(this.B);var e=this.f&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Pi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Li(d,g):("error"== +f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Ma("user",""),this.g=null)):this.j(f+": "+g),Ri(d),Li(d)?(c=Pi(d),e=!0):c=!1))}e&&Oi(this,c?d:null)}else 2==a&&d.clear()}else Oi(this);delete this.I;delete this.K}e=sb(this.id);for(f=0;fa[1];a=a[2];this.ca=!0;this.A.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ti(this,this.b,b,c,a),this.pa(),this.b.vb());this.O&&(Qi(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0}; +function Qi(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} +function Gi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.da(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ha=!1,!1===d&&(e=null)));for(var h=sb(a.id),l=0;l=c||30<=(b.wb+=c))&&(d.textContent=b.A.W?b.ma.toFixed(2)+"Mhz":"Stopped",b.wb=0)}if(this.w&&(b=this.w,a=a||0,b.D)){c=b.b.A.W;d=!!(b.b.J&4);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);dj(a,b,c)}})}else c(a,null)} -function ej(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=va(a))}function f(a){e("Error: "+a);l&&(--Ri||ab(!0));l=!1}var g,h,l=!0;Ri++;pb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c|| -(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?bj(c,null,null,!1,e,function(d,l){l?(qb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Ri||ab(!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),--Ri||ab(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?bj(b,a,d,!0,e,m):cj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return ej(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map +k.ua=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.A.ha?Gi(d,!1,!0):Ni(d,d.Rb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ha&&!d.C)if(d.f&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Gi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.uc=!0),d.Rb(Ji),d.uc=!1)}else d.reset(),d.b&&d.b.vb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]= +c,c.onclick=function(){var a=Ki(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=Gi(d,b);b?Ui(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1}; +function Ki(a,b){var c=a.g;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=Vi(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c} +function Vi(a,b){a.g=null;b=Ea(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ma("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Mi(a){var b=null;a.g&&(b=Ga()+"/api/v1/user?req=load&user="+a.g+"&state="+Wi(a,"1.30.3"));return b} +function Ui(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Wi(a,"1.30.3");d.data=c;b=Ea(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(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);jj(a,b,c)}})}else c(a,null)} +function kj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Xi||bb(!0));l=!1}var g,h,l=!0;Xi++;qb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c|| +(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?hj(c,null,null,!1,e,function(d,l){l?(rb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Xi||bb(!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),--Xi||bb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?hj(b,a,d,!0,e,m):ij(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){bb(!1);return kj(a,b,c,d)};window.enableEvents=bb;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.3/pdp11.js b/versions/pdpjs/1.30.3/pdp11.js index c864046d6..14779dd03 100644 --- a/versions/pdpjs/1.30.3/pdp11.js +++ b/versions/pdpjs/1.30.3/pdp11.js @@ -45,86 +45,86 @@ d.K[f++]=e[c]>>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.W= function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va} function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var x={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0; function Fa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ga(a){x.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;bb?this.za=this.id:(this.qa=this.id.substr(0,b),this.za=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,sb:!1,N:!1,error:!1};this.jb=null;this.j.error=!1;this.o={};this.F=null;this.pd=d||0;z.push(this)}var Ka=void 0,La={}; +Fa(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ha(x.exit)});function y(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Tb=b.comment;this.td=b;b=this.id.indexOf(".");0>b?this.za=this.id:(this.qa=this.id.substr(0,b),this.za=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,tb:!1,N:!1,error:!1};this.kb=null;this.j.error=!1;this.o={};this.F=null;this.qd=d||0;z.push(this)}var Ka=void 0,La={}; if(window){Ka||(Ka=window.location.search.substr(1));for(var Ma,Na=/\+/g,Oa=/([^&=]+)=?([^&]*)/g;Ma=Oa.exec(Ka);)La[decodeURIComponent(Ma[1].replace(Na," "))]=decodeURIComponent(Ma[2].replace(Na," "))}function Pa(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 A(a,b){b||(b=y);a.prototype=Pa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Qa=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},z=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[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.vc,a]}A(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()}; +function Ya(a){y.call(this,"Panel",a,Ya,1024);this.ea=this.i=this.c=this.m=this.s=this.v=0;this.A=this.B=this.w=!1;this.D=Za;this.g={};this.b={START:[1,1,!0,!1,this.uc],STEP:[1,1,!1,!1,this.vc],ENABLE:[1,1,!1,!1,this.qc],CONT:[1,1,!0,!1,this.oc],DEP:[0,0,!0,!1,this.pc],EXAM:[1,1,!0,!1,this.rc],LOAD:[1,1,!0,!1,this.tc],TEST:[0,0,!0,!1,this.sc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.wc,a]}A(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()}; h.$=function(a,b,c,d){if(this.l&&this.l.$(a,b,c,d)||this.a&&this.a.$(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.o[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ab(a,b)}}(this, b),a.onmouseup=a.onmouseout=function(a,b){return function(){bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){bb(a,b)}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.la=function(a,b){b||(hb(),this.reset());return!0};h.ka=function(){return!0}; function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.g)ib(a,c,null!=b?b:a.g[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.b)jb(a,b,a.b[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.F&&a.F.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))} -function ab(a,b){var c=a.b[b];jb(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 bb(a,b){var c=a.b[b];c[2]&&c[3]&&(jb(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.j.P||(a=this.a,a.h.reset(),lb(a),$a(this,"ENABLE")&&mb(this.a))};h.uc=function(){};h.pc=function(a){a||G(this.a)}; -h.nc=function(a){if(!a&&!this.a.j.P)if($a(this,"ENABLE"))mb(this.a);else{a=this.F;var b;if(b=a)a.j.Da&&(a.j.sb=!0),b=!a.j.Da;if(b)Ua(a,!0),a.pb(0,null),Ua(a,!1);else try{var c=this.a.pb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Ea?8:16,c=65472<=a.ea&&a.ea<65472+b,b=c?1:2,c=c?15:a.h.oa;$a(a,"STEP")||(b=-b);sb(a,a.ea&~c|a.ea+b&c)}function sb(a,b){a.ea=b&a.h.oa;b=a.ea;for(var c=0;22>c;c++)tb(a,"A"+c,b&1<c;c++)tb(a,"D"+c,b&1<>2;this.l=this.b-1;this.A=this.B/this.b|0;this.Aa=[];this.g=0;this.m=!1;this.tb=0;this.w=[];this.fc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.h=Array(this.A);for(b=0;ba;a++)this.b["S"+a][1]=0&1<a.a.Ea?8:16,c=65472<=a.ea&&a.ea<65472+b,b=c?1:2,c=c?15:a.h.oa;$a(a,"STEP")||(b=-b);sb(a,a.ea&~c|a.ea+b&c)}function sb(a,b){a.ea=b&a.h.oa;b=a.ea;for(var c=0;22>c;c++)tb(a,"A"+c,b&1<c;c++)tb(a,"D"+c,b&1<>2;this.l=this.b-1;this.A=this.B/this.b|0;this.Aa=[];this.g=0;this.m=!1;this.ub=0;this.w=[];this.gc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.h=Array(this.A);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.Aa[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 xb(a,b,c){var d=!1,e=this.controller,f=e.Aa[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](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.Aa[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](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 yb(a,b){var c=-1,d=this.controller;a=d.Aa[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 zb(a,b,c){var d=!1,e=this.controller;a=e.Aa[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 Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.qb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.qb){p=l.size-(f-n);p>g&&(p=g);l.qb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.F,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.tb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)} -function Eb(a,b,c){var d=[];for(b>>>=a.c;0>>=a.c;0>>a.c].Eb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.oa)>>>a.c].V(b&a.l,b)}h.lb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.oa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Wb(b,a);this.g--;return a}; -function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].Ib(b&a.l,c&255,b)}h.Za=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.oa)>>>this.c].Jb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].rb(b&a.l,c&65535,b)}h.ob=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.oa)>>>this.c;this.m=!1;this.g++;this.h[d].dc(c,b&65535,a);this.g--}; -function Pb(a){for(var b=0,c=[],d=0;da.a.Ea)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,w=0;w>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){var a=this.a;a.Z&57344||(a.Db=a.A&65535);return a.Db};h.Jc=function(){return this.a.Ba}; -h.Fd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Ra=a&16?4194303:262143,Yb(b))};h.kd=function(a){a=a>>1&63;var b=this.a.$a[a>>1];return a&1?b>>16:b&65535};h.fe=function(a,b){b=b>>1&63;var c=b>>1;this.a.$a[c]=b&1?this.a.$a[c]&65535|(a&63)<<16:this.a.$a[c]&-65536|a&65534};h.cd=function(a){return this.a.H[1][a>>1&7]};h.Zd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.ad=function(a){return this.a.H[1][(a>>1&7)+8]};h.Xd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; -h.bd=function(a){return this.a.X[1][a>>1&7]};h.Yd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.$c=function(a){return this.a.X[1][(a>>1&7)+8]};h.Wd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Dc=function(a){return this.a.H[0][a>>1&7]};h.Bd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Bc=function(a){return this.a.H[0][(a>>1&7)+8]};h.zd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Cc=function(a){return this.a.X[0][a>>1&7]}; -h.Ad=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Ac=function(a){return this.a.X[0][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.jd=function(a){return this.a.H[3][a>>1&7]};h.ee=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.gd=function(a){return this.a.H[3][(a>>1&7)+8]};h.ce=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.hd=function(a){return this.a.X[3][a>>1&7]};h.de=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295}; -h.fd=function(a){return this.a.X[3][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.C&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.C&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Oc=function(){return this.a.C&49152?this.a.pa[0]:this.a.f[6]};h.Kd=function(a){this.a.C&49152?this.a.pa[0]=a:this.a.f[6]=a};h.Rc=function(){return this.a.f[7]};h.Nd=function(a){this.a.f[7]=a}; -h.Na=function(a){a&=7;return this.a.C&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.C&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Pc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[1]};h.Ld=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[1]=a};h.Qc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[3]};h.Md=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[3]=a};h.yc=function(a){return this.a.Zb[a-65504>>1]}; -h.wd=function(a,b){this.a.Zb[b-65504>>1]=a};h.Vb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.tb}a=(a>>6)-1}else a=0;return a};h.cc=function(){};h.ed=function(){return 1};h.ae=function(){};h.xc=function(){return this.a.fa};h.vd=function(){this.a.fa=0};h.Fc=function(){return this.a.Yb};h.Dd=function(a,b){b&1||(a&=255);this.a.Yb=a};h.Kc=function(a){return a?this.a.Fb:0};h.Gd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Fb=a;b.u|=2}; -h.dd=function(a){return a?this.a.nb&65280:0};h.$d=function(a){this.a.nb=a|255};h.Nc=function(){return Zb(this.a)};h.Jd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.bc=function(){}; -var M={},Wb=(M[61568]=[null,null,L.prototype.kd,L.prototype.fe,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.bd,L.prototype.Yd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.$c,L.prototype.Wd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Dc,L.prototype.Bd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Cc, -L.prototype.Ad,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Ac,L.prototype.yd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Jc,L.prototype.Fd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Ec,L.prototype.Cd,"LKS"],M[65402]=[null,null,L.prototype.Gc,L.prototype.Ed,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Hc,L.prototype.bc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Ic,L.prototype.bc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.jd,L.prototype.ee,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.gd, -L.prototype.ce,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.de,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.fd,L.prototype.be,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa, -"R5SET0"],M[65478]=[null,null,L.prototype.Oc,L.prototype.Kd,"R6KERNEL"],M[65479]=[null,null,L.prototype.Rc,L.prototype.Nd,"R7KERNEL"],M[65480]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Na, -L.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Pc,L.prototype.Ld,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Qc,L.prototype.Md,"R6USER",1,1145],M[65504]=[null,null,L.prototype.yc,L.prototype.wd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Vb,L.prototype.cc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Vb,L.prototype.cc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.ed,L.prototype.ae,"SYSID",1,1170],M[65526]=[null,null,L.prototype.xc,L.prototype.vd,"CPUERR",1,1170],M[65528]= -[null,null,L.prototype.Fc,L.prototype.Dd,"MB",1,1170],M[65530]=[null,null,L.prototype.Kc,L.prototype.Gd,"PIR"],M[65532]=[null,null,L.prototype.dd,L.prototype.$d,"SL"],M[65534]=[null,null,L.prototype.Nc,L.prototype.Jd,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.rb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.rb){p=l.size-(f-n);p>g&&(p=g);l.rb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.F,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.ub+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)} +function Eb(a,b,c){var d=[];for(b>>>=a.c;0>>=a.c;0>>a.c].Fb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.oa)>>>a.c].V(b&a.l,b)}h.mb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.oa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a}; +function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].Jb(b&a.l,c&255,b)}h.$a=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.oa)>>>this.c].Kb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].sb(b&a.l,c&65535,b)}h.pb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.oa)>>>this.c;this.m=!1;this.g++;this.h[d].ec(c,b&65535,a);this.g--}; +function Pb(a){for(var b=0,c=[],d=0;da.a.Ea)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,w=0;w>16&65535);a=a.Db;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Jc=function(){var a=this.a;a.Z&57344||(a.Eb=a.A&65535);return a.Eb};h.Kc=function(){return this.a.Ba}; +h.Gd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Ra=a&16?4194303:262143,Yb(b))};h.ld=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};h.ge=function(a,b){b=b>>1&63;var c=b>>1;this.a.ab[c]=b&1?this.a.ab[c]&65535|(a&63)<<16:this.a.ab[c]&-65536|a&65534};h.dd=function(a){return this.a.H[1][a>>1&7]};h.$d=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[1][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; +h.cd=function(a){return this.a.X[1][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.ad=function(a){return this.a.X[1][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Ec=function(a){return this.a.H[0][a>>1&7]};h.Cd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Cc=function(a){return this.a.H[0][(a>>1&7)+8]};h.Ad=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Dc=function(a){return this.a.X[0][a>>1&7]}; +h.Bd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Bc=function(a){return this.a.X[0][(a>>1&7)+8]};h.zd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.kd=function(a){return this.a.H[3][a>>1&7]};h.fe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.hd=function(a){return this.a.H[3][(a>>1&7)+8]};h.de=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.jd=function(a){return this.a.X[3][a>>1&7]};h.ee=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295}; +h.gd=function(a){return this.a.X[3][(a>>1&7)+8]};h.ce=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.C&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.C&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Pc=function(){return this.a.C&49152?this.a.pa[0]:this.a.f[6]};h.Ld=function(a){this.a.C&49152?this.a.pa[0]=a:this.a.f[6]=a};h.Sc=function(){return this.a.f[7]};h.Od=function(a){this.a.f[7]=a}; +h.Na=function(a){a&=7;return this.a.C&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.C&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Qc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[1]};h.Md=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[1]=a};h.Rc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[3]};h.Nd=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[3]=a};h.zc=function(a){return this.a.$b[a-65504>>1]}; +h.xd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.ub}a=(a>>6)-1}else a=0;return a};h.dc=function(){};h.fd=function(){return 1};h.be=function(){};h.yc=function(){return this.a.fa};h.wd=function(){this.a.fa=0};h.Gc=function(){return this.a.Zb};h.Ed=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Lc=function(a){return a?this.a.Gb:0};h.Hd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Gb=a;b.u|=2}; +h.ed=function(a){return a?this.a.ob&65280:0};h.ae=function(a){this.a.ob=a|255};h.Oc=function(){return Zb(this.a)};h.Kd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.cc=function(){}; +var M={},Wb=(M[61568]=[null,null,L.prototype.ld,L.prototype.ge,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.dd,L.prototype.$d,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.bd,L.prototype.Yd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Ec,L.prototype.Cd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Cc,L.prototype.Ad,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Dc, +L.prototype.Bd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Kc,L.prototype.Gd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Fc,L.prototype.Dd,"LKS"],M[65402]=[null,null,L.prototype.Hc,L.prototype.Fd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Ic,L.prototype.cc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Jc,L.prototype.cc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.kd,L.prototype.fe,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.hd, +L.prototype.de,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.jd,L.prototype.ee,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.gd,L.prototype.ce,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa, +"R5SET0"],M[65478]=[null,null,L.prototype.Pc,L.prototype.Ld,"R6KERNEL"],M[65479]=[null,null,L.prototype.Sc,L.prototype.Od,"R7KERNEL"],M[65480]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Na, +L.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Qc,L.prototype.Md,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Rc,L.prototype.Nd,"R6USER",1,1145],M[65504]=[null,null,L.prototype.zc,L.prototype.xd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Wb,L.prototype.dc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Wb,L.prototype.dc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.fd,L.prototype.be,"SYSID",1,1170],M[65526]=[null,null,L.prototype.yc,L.prototype.wd,"CPUERR",1,1170],M[65528]= +[null,null,L.prototype.Gc,L.prototype.Ed,"MB",1,1170],M[65530]=[null,null,L.prototype.Lc,L.prototype.Hd,"PIR"],M[65532]=[null,null,L.prototype.ed,L.prototype.ae,"SL"],M[65534]=[null,null,L.prototype.Oc,L.prototype.Kd,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>> +function I(a,b,c,d,e,f){this.h=a;this.id=ec+=2;this.a=null;this.Ka=b;this.rb=c;this.size=d||0;this.type=e||fc;this.l=e==gc;this.controller=null;Ab(this);this.wa=this.kc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],hc(this,f.gc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ba: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},sa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.wa=!0},D:function(a,b){return this.I(a,b)},R:function(a,b){return this.Wb(a,b)},qa:function(a,b,c){this.l?this.g(a,b,c):this.Jb(a,b,c)},ua:function(a,b,c){this.l?this.g(a,b,c):this.dc(a,b,c)},B:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},ma:function(a,b){this.o[a]=b;this.wa=!0},ra:function(a,b){this.o[a]=b;this.wa=!0},ta:function(a,b,c){a&1&&J(this.h, -c,64);this.c.setUint16(a,b,!0);this.wa=!0},va:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.wa=!0}};function Ab(a,b,c){a.F=b;a.i=a.m=0;c&&((a.i=c.i)&&nc(a,oc,!1),(a.m=c.m)&&pc(a,oc,!1))}function pc(a,b,c){c&&a.m||(a.Ib=!a.l&&b[1]||a.g,a.rb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Jb=b[1]||a.g,a.dc=b[3]||a.A}function nc(a,b,c){c&&a.i||(a.Eb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Wb=b[2]||a.w}function hc(a,b){b||(b=qc);nc(a,b,void 0);pc(a,b,void 0)} +I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Xa)for(a=Array(this.size>>2),b=0;b>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ba: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},sa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.wa=!0},D:function(a,b){return this.I(a,b)},R:function(a,b){return this.Xb(a,b)},qa:function(a,b,c){this.l?this.g(a,b,c):this.Kb(a,b,c)},ua:function(a,b,c){this.l?this.g(a,b,c):this.ec(a,b,c)},B:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},ma:function(a,b){this.o[a]=b;this.wa=!0},ra:function(a,b){this.o[a]=b;this.wa=!0},ta:function(a,b,c){a&1&&J(this.h, +c,64);this.c.setUint16(a,b,!0);this.wa=!0},va:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.wa=!0}};function Ab(a,b,c){a.F=b;a.i=a.m=0;c&&((a.i=c.i)&&nc(a,oc,!1),(a.m=c.m)&&pc(a,oc,!1))}function pc(a,b,c){c&&a.m||(a.Jb=!a.l&&b[1]||a.g,a.sb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Kb=b[1]||a.g,a.ec=b[3]||a.A}function nc(a,b,c){c&&a.i||(a.Fb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Xb=b[2]||a.w}function hc(a,b){b||(b=qc);nc(a,b,void 0);pc(a,b,void 0)} var qc=[],kc=[I.prototype.M,I.prototype.sa,I.prototype.ba,I.prototype.za],oc=[I.prototype.D,I.prototype.qa,I.prototype.R,I.prototype.ua];if(Xa)var jc=[I.prototype.B,I.prototype.ma,I.prototype.O,I.prototype.ta],ic=[I.prototype.J,I.prototype.ra,I.prototype.aa,I.prototype.va]; -function rc(a,b){y.call(this,"CPU",a,rc,1);b=a.cycles||b;var c=a.multiplier||1;this.xb=0;this.ib=b;this.ta=c;this.Ab=Math.round(this.ib/1E4)/100;this.Ha=this.Ab*this.ta;this.j.P=!1;this.j.Gb=!1;this.j.Va=a.autoStart;this.j.eb=!1;this.fb=this.Ia=0;this.gb=a.csStart;this.Sa=a.csInterval;this.Ta=a.csStop;this.J=[];this.ac=this.od.bind(this);F(this)}A(rc);var sc=["power","reset"];h=rc.prototype; +function rc(a,b){y.call(this,"CPU",a,rc,1);b=a.cycles||b;var c=a.multiplier||1;this.yb=0;this.jb=b;this.ta=c;this.Bb=Math.round(this.jb/1E4)/100;this.Ha=this.Bb*this.ta;this.j.P=!1;this.j.Hb=!1;this.j.Va=a.autoStart;this.j.fb=!1;this.gb=this.Ia=0;this.hb=a.csStart;this.Sa=a.csInterval;this.Ta=a.csStop;this.J=[];this.bc=this.pd.bind(this);F(this)}A(rc);var sc=["power","reset"];h=rc.prototype; h.ja=function(a,b,c,d){this.l=a;this.h=b;this.F=d;this.w=a.w;for(b=0;b=a.Ia&&(a.Ia+=a.Sa,c=!0);0<=a.Ta&&a.Ta<=wc(a)&&(a.Sa=a.Ta=-1,vc(a),G(a),c=!0);c&&a.T(wc(a)+" cycles: checksum="+m(a.fb))}} -h.$=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.N)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.Ga/a.Ha&&(b=1);a.ta=b;b=a.Ab*a.ta;if(a.Ha!=b){a.Ha=b;b=a.Ha.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&zc(a.l)}ob(a,a.ma);a.ma=0;a.ba=ra();a.ra=0;yc(a)}function Sb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Ub(a,b,c,d){0<=b&&ba.J[b][0])&&(c=a.ib*a.ta/1E3*c|0,a.j.P&&(c+=Ac(a)),a.J[b][0]=c)} +h.Va=function(){return this.j.Va||void 0===this.o.run?(mb(this),!0):!1};h.Ob=function(){return 0};function vc(a){void 0===a.hb&&(a.hb=0);void 0===a.Sa&&(a.Sa=-1);void 0===a.Ta&&(a.Ta=-1);a.j.fb=0<=a.hb&&0=a.Ia&&(a.Ia+=a.Sa,c=!0);0<=a.Ta&&a.Ta<=wc(a)&&(a.Sa=a.Ta=-1,vc(a),G(a),c=!0);c&&a.T(wc(a)+" cycles: checksum="+m(a.gb))}} +h.$=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.N)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.Ga/a.Ha&&(b=1);a.ta=b;b=a.Bb*a.ta;if(a.Ha!=b){a.Ha=b;b=a.Ha.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&zc(a.l)}ob(a,a.ma);a.ma=0;a.ba=ra();a.ra=0;yc(a)}function Sb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Ub(a,b,c,d){0<=b&&ba.J[b][0])&&(c=a.jb*a.ta/1E3*c|0,a.j.P&&(c+=Ac(a)),a.J[b][0]=c)} function nb(a,b){for(var c=a.J.length-1;0<=c;c--){var d=a.J[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Ac(a,b){var c=a.sa-=a.a;a.a=a.I=0;b&&(a.sa=0);return c} -h.od=function(){if(this.j.P){this.Bb>=this.ib&&yc(this,!0);this.Qa=0;this.cb=ra();if(this.ra){var a=this.cb-this.ra;a>this.Tb&&(this.ba+=a,this.ba>this.cb&&(this.ba=this.cb))}try{do{for(var b,c=this.j.eb?1:this.kb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.pb(b)}catch(f){if("number"!=typeof f)throw f;}b=Ac(this,!0);this.Qa+=b;this.ma+=b;pb(this,b);nb(this,b);this.Ua-=b;if(0>=this.Ua){this.Ua+=this.kb;15<=++this.Ub&&(this.ya(),this.Ub=0);break}}while(this.j.P)}catch(f){G(this); -this.l&&this.l.stop(ra(),wc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.ac;this.ra=ra();c=this.Tb;this.Qa&&(c=Math.round(c*this.Qa/this.kb));c-=this.ra-this.cb;if(d=this.ra-this.ba)this.Ga=Math.round(this.ma/(10*d))/100,864E5<=d&&(this.va=0,xc(this));if(0>c||this.Gac&&(this.ba-=c),c=0;this.Bb+=this.Qa;this.ra+=c;a(b,c)}}}; -function mb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.P)a.T(a.toString()+" busy");else{xc(a);a.j.P=!0;a.j.Gb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.ba,wc(a));setTimeout(a.ac,0)}}h.pb=function(){return 0};function G(a){var b=!1;if(a.j.P){Ac(a);ob(a,a.ma);a.ma=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),wc(a));b=!0}a.j.complete=void 0;return b} -function Bc(a){this.Ea=+a.model||1170;this.Rb=a.addrReset||0;rc.call(this,a,6666667);this.decode=1120==this.Ea?Cc.bind(this):Dc.bind(this);Ec(this);this.ua=0;this.O=null;this.j.complete=!1}A(Bc,rc);h=Bc.prototype;h.reset=function(){this.status("model "+this.Ea);this.j.P&&G(this);Ec(this);uc(this);this.j.error=!1;this.parent.reset.call(this)}; -function Ec(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.C=15;a.f=[0,0,0,0,0,0,0,a.Rb];a.Fa=[0,0,0,0,0,0];a.pa=[0,0,0,0];a.v=0;a.bb=0;a.rd=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.$a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0];a.Zb=[0,0,0,0,0,0,0,0];a.Yb=0;a.u=0;a.B=a.D=0;a.c=a.b=a.zb=0;a.Ja=-1;lb(a)}function lb(a){a.nb=255;a.fa=0;a.Fb=0;a.Z=0;a.Cb=0;a.Db=0;a.Ba=0;a.aa=0;a.ab=0;a.Ra=262143;a.A=0;a.O=null;a.h&&Yb(a)}function Yb(a){a.aa?(a.R=65536,a.Qb=a.Ba&16?4186112:253952,a.M=a.mc,a.V=a.ld,a.rb=a.ge,Cb(a.h,a.Ba&16?22:18)):(a.R=0,a.Qb=57344,a.M=a.lc,a.V=a.Xb,a.rb=a.ec,Cb(a.h,16))} -function Xb(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Cb=a.A>>16&65535,a.Db=a.A&65535);a.Z=b;a.ab=b>>5&3;a.bb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.aa!=c&&(a.aa=c,Yb(a))}}h.Nb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.va,this.ta]);a.set(2,Pb(this.h));return a.data()}; +h.pd=function(){if(this.j.P){this.Cb>=this.jb&&yc(this,!0);this.Qa=0;this.eb=ra();if(this.ra){var a=this.eb-this.ra;a>this.Ub&&(this.ba+=a,this.ba>this.eb&&(this.ba=this.eb))}try{do{for(var b,c=this.j.fb?1:this.lb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.qb(b)}catch(f){if("number"!=typeof f)throw f;}b=Ac(this,!0);this.Qa+=b;this.ma+=b;pb(this,b);nb(this,b);this.Ua-=b;if(0>=this.Ua){this.Ua+=this.lb;15<=++this.Vb&&(this.ya(),this.Vb=0);break}}while(this.j.P)}catch(f){G(this); +this.l&&this.l.stop(ra(),wc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.bc;this.ra=ra();c=this.Ub;this.Qa&&(c=Math.round(c*this.Qa/this.lb));c-=this.ra-this.eb;if(d=this.ra-this.ba)this.Ga=Math.round(this.ma/(10*d))/100,864E5<=d&&(this.va=0,xc(this));if(0>c||this.Gac&&(this.ba-=c),c=0;this.Cb+=this.Qa;this.ra+=c;a(b,c)}}}; +function mb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.P)a.T(a.toString()+" busy");else{xc(a);a.j.P=!0;a.j.Hb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.ba,wc(a));setTimeout(a.bc,0)}}h.qb=function(){return 0};function G(a){var b=!1;if(a.j.P){Ac(a);ob(a,a.ma);a.ma=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),wc(a));b=!0}a.j.complete=void 0;return b} +function Bc(a){this.Ea=+a.model||1170;this.Sb=a.addrReset||0;rc.call(this,a,6666667);this.decode=1120==this.Ea?Cc.bind(this):Dc.bind(this);Ec(this);this.ua=0;this.O=null;this.j.complete=!1}A(Bc,rc);h=Bc.prototype;h.reset=function(){this.status("model "+this.Ea);this.j.P&&G(this);Ec(this);uc(this);this.j.error=!1;this.parent.reset.call(this)}; +function Ec(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.C=15;a.f=[0,0,0,0,0,0,0,a.Sb];a.Fa=[0,0,0,0,0,0];a.pa=[0,0,0,0];a.v=0;a.cb=0;a.sd=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ab=[0,0,0,0,0,0,0,0,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.$b=[0,0,0,0,0,0,0,0];a.Zb=0;a.u=0;a.B=a.D=0;a.c=a.b=a.Ab=0;a.Ja=-1;lb(a)}function lb(a){a.Z=0;a.Db=0;a.Eb=0;a.Ba=0;a.fa=0;a.Gb=0;a.ob=255;a.aa=0;a.bb=0;a.Ra=262143;a.Xa=0;a.A=0;a.O=null;a.h&&Yb(a)}function Yb(a){a.aa?(a.R=65536,a.Rb=a.Ba&16?4186112:253952,a.M=a.nc,a.V=a.md,a.sb=a.he,Cb(a.h,a.Ba&16?22:18)):(a.R=0,a.Rb=57344,a.M=a.mc,a.V=a.Yb,a.sb=a.fc,Cb(a.h,16))} +function Xb(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Db=a.A>>16&65535,a.Eb=a.A&65535);a.Z=b;a.bb=b>>5&3;a.cb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.aa!=c&&(a.aa=c,Yb(a))}}h.Ob=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.va,this.ta]);a.set(2,Pb(this.h));return a.data()}; h.restore=function(a){var b=a[1];this.va=b[1];xc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.C>>14&3;a.v!=c&&(a.pa[c]=a.f[6],a.f[6]=a.pa[a.v]);a.C=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Kc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Lc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))} function Mc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Nc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ua){0>a.Ja?a.Ja=Zb(a):a.v||(b=4,a.fa|=4,a.f[6]=4,d=-3);a.A=b;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ja>>2&12288);Oc(a,a.Ja);Oc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Pc(a){var b=Qc(a),c=Qc(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);Q(a,b);$b(a,c);a.u&=-17} -function Lb(a,b){var c=b>>13&31;31>c&&a.Ba&32&&(b=a.$a[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function Rc(a,b,c){var d,e,f;if(!(c&a.aa))return f=b&65535,57344<=f&&(f|=a.Qb),f;d=b>>13;a.Ba&a.rd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.ab=a.v,a.bb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.Z& -57344||(g|=a.ab<<5|a.bb<<1,Xb(a,a.Z&-61695|g)),b=!0),a.Z&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.rb(c,b)}function Sc(a,b,c){!a.v&&c<=a.nb&&(b||4>13&31;31>c&&a.Ba&32&&(b=a.ab[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function Rc(a,b,c){var d,e,f;if(!(c&a.aa))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Ba&a.sd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.bb=a.v,a.cb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.Z& +57344||(g|=a.bb<<5|a.cb<<1,Xb(a,a.Z&-61695|g),b=!0)),a.Z&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.sb(c,b)}function Sc(a,b,c){!a.v&&c<=a.ob&&(b||4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Hc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Hc(a,2)),e=e+a.f[c]& -65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&Sc(a,b,a.f[6]);return e}h.lb=function(a){if(!this.aa)return this.h.lb(a);this.ua++;a=this.Xb(Rc(this,a,2));this.ua--;return a};h.Za=function(a,b){this.aa?(this.ua++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.Za(a,b)};h.ob=function(a,b){this.aa?(this.ua++,this.ec(Rc(this,a,4),b),this.ua--):this.h.ob(a,b)};h.lc=function(a,b,c){return Tc(this,a,b,c)}; -h.mc=function(a,b,c){return Rc(this,Tc(this,a,b,c),c)};h.Xb=function(a){return Mb(this.h,a)};h.ld=function(a){return Mb(this.h,Rc(this,a,2))};h.ec=function(a,b){Ob(this.h,a,b&65535)};h.ge=function(a,b){Ob(this.h,Rc(this,a,4),b)};function Uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Tc(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.v=a.C>>12&3,c=a.V(d|c&a.R),a.v=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.pa[a.C>>12&3];return c} +65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&Sc(a,b,a.f[6]);return e}h.mb=function(a){if(!this.aa)return this.h.mb(a);this.ua++;a=this.Yb(Rc(this,a,2));this.ua--;return a};h.$a=function(a,b){this.aa?(this.ua++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.$a(a,b)};h.pb=function(a,b){this.aa?(this.ua++,this.fc(Rc(this,a,4),b),this.ua--):this.h.pb(a,b)};h.mc=function(a,b,c){return Tc(this,a,b,c)}; +h.nc=function(a,b,c){return Rc(this,Tc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,this.Xa=a)};h.md=function(a){return Mb(this.h,this.Xa=Rc(this,a,2))};h.fc=function(a,b){Ob(this.h,this.Xa=a,b&65535)};h.he=function(a,b){Ob(this.h,this.Xa=Rc(this,a,4),b)};function Uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Tc(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.v=a.C>>12&3,c=a.V(d|c&a.R),a.v=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.pa[a.C>>12&3];return c} function Vc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Tc(a,b,e,4),c&65536||(e&=65535),a.v=a.C>>12&3,e=Rc(a,e|c&65536,4),a.v=a.C>>14&3,Ob(a.h,e,d)):6!=e||(a.C>>2&12288)===(a.C&12288)?a.f[e]=d:a.pa[a.C>>12&3]=d}function Wc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=-c-1;return a}function Xc(a,b){var c;b>>=6;var d=a.D=b&7;(b=a.B=(b&56)>>3)?c=Mb(a.h,a.M(b,d,2)):c=-d-1;return c}function Yc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Tc(a,b,c,8)} -function Zc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=a.f[c]&255;return a}function $c(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.h,a.M(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.zb=a.M(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Kb(a.h,e)),e&1&&a.a--,Nb(a.h,e,c)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[e]=b&65280|d.call(a,c,b&255))} +function Zc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=a.f[c]&255;return a}function $c(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.h,a.M(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Ab=a.M(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Kb(a.h,e)),e&1&&a.a--,Nb(a.h,e,c)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[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.M(b,e,6),Ob(a.h,e,d.call(a,0>c?a.f[-c-1]:c,Mb(a.h,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])}function ad(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Nb(a.h,d,e)):c?(c=0>c?a.f[-c-1]&255:c,a.f[e]=a.f[e]&~d|c<<24>>24&d):a.f[e]&=~d;return c}function bd(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,d,4),Ob(a.h,d,c=0>c?a.f[-c-1]:c)):a.f[d]=c=0>c?a.f[-c-1]:c;return c} function V(a,b,c){c&&(Q(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} -h.pb=function(a){this.j.complete=!0;var b=a?this.j.Gb?0:1:-1;this.j.Gb=!1;this.sa=this.a=a;do{if(this.u){if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Fb&224)>>5,e=this.O&&this.O.La>d?this.O:null;e&&(c=e.td,d=e.La);d>(this.C&224)>>5?(this.u&4&&(Hc(this,2),this.u&=-5),K(this,c,0,-9),d=!0):d=!1;d&&(e&&Ic(this,e),a=!0)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Jc(this)&&0>b)break}this.u=this.u&7|this.C&16;this.decode(Gc(this))}while(0>5,e=this.O&&this.O.La>d?this.O:null;e&&(c=e.ud,d=e.La);d>(this.C&224)>>5?(this.u&4&&(Hc(this,2),this.u&=-5),K(this,c,0,-9),d=!0):d=!1;d&&(e&&Ic(this,e),a=!0)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Jc(this)&&0>b)break}this.u=this.u&7|this.C&16;this.decode(Gc(this))}while(0>1|b<<16;Mc(this,a);return a&65535}function hd(a,b){a=b&128|b>>1|b<<8;Mc(this,a<<8);return a&255} function id(a,b){a=b&~a;R(this,a);return a}function jd(a,b){a=b&~a;R(this,a<<8);return a}function kd(a,b){a|=b;R(this,a);return a}function ld(a,b){a|=b;R(this,a<<8);return a}function md(a,b){a=~b|65536;Kc(this,a);return a&65535}function nd(a,b){a=~b|256;Kc(this,a<<8);return a&255}function od(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.g=b&(b^a));return a&65535}function pd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.g=b&(b^c));return a&255} function qd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.g=a&(b^a));return a&65535}function rd(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.g=c&(b<<8^c));return a&255}function sd(a,b){a=-b;Kc(this,a,a&b&32768);return a&65535}function td(a,b){a=-b;Kc(this,a<<8,(a&b&128)<<8);return a&255}function ud(a,b){a=b<<1|this.m>>16&1;Mc(this,a);return a&65535}function vd(a,b){a=b<<1|this.m>>16&1;Mc(this,a<<8);return a&255}function wd(a,b){a=(this.m&65536|b)>>1|b<<16;Mc(this,a);return a&65535} @@ -146,27 +146,27 @@ var ze=[function(a){Qe[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,Cd,Y,function(a){Re sd);this.a-=this.c?11:6},function(a){U(this,a,P(this)?1:0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,P(this)?1:0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=$c(this,a);Kc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Fe=[function(a){U(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ed);this.a-=this.c?9:3+(7==this.b?2:0)}], Se=[function(a){Te[a&15].call(this,a)},Y,Y,Y,he,he,he,he,re,Y,Ge,Ie,ve,ve,ve,ve],Te=[ee,xe,se,Xd,fe,qe,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],He=[pe,function(){this.m=0;this.a-=5},function(){this.g=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],Je=[pe,function(){this.m=65536;this.a-=5},function(){this.g=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],Re=[Wd,Ud,Qd,Sd,Zd,$d,Fd,Gd,de,we,Ke,Me,Oe,Y,Y,Y],Le=[function(a){Kc(this, ad(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ne=[function(a){S(this,a,0,td);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Zc(this,a);Kc(this,a<<8);this.a-=this.c?4:3+(7== -this.b?2:0)}],Pe=[function(a){S(this,a,0,xd);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,hd);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Dc(a){Ue[a>>12].call(this,a)} +this.b?2:0)}],Pe=[function(a){S(this,a,0,xd);this.a-=this.c?9+(this.Ab&1):3+(7==this.b?2:0)},function(a){S(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,hd);this.a-=this.c?9+(this.Ab&1):3+(7==this.b?2:0)},function(a){S(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Dc(a){Ue[a>>12].call(this,a)} var Ue=[function(a){Ve[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,Cd,function(a){We[a>>8&15].call(this,a)},function(a){Xe[a>>8&15].call(this,a)},me,be,Md,Id,Kd,ue,Y],Ve=[function(a){Ye[a>>4&15].call(this,a)},Yd,Vd,Nd,Od,Td,Pd,Rd,je,je,Ae,Ce,Ee,function(a){Ze[a>>6&3].call(this,a)},Y,Y],Ze=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Uc(this,a,0);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I= this.a;Vc(this,a,0,b);R(this,b);this.a=this.I-ne[this.c]},function(a){R(this,bd(this,a,Fc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ye=[function(a){$e[a&15].call(this,a)},Y,Y,Y,he,he,he,he,re,function(a){a&8?(this.C&49152||(this.C=this.C&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},Ge,Ie,ve,ve,ve,ve],$e=[ee,xe,function(){Pc(this);this.u|=this.C&16;this.a-=13},Xd,fe,qe,se,function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],We=[oe,oe,ce,ce,Dd,Dd,Ed,Ed,ye,ye,Y,Y,Y,Y,te,te],Xe=[Wd,Ud,Qd,Sd, Zd,$d,Fd,Gd,de,we,Ke,Me,Oe,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[Y,function(a){a=Uc(this,a,65536);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I=this.a;Vc(this,a,65536,b);R(this,b);this.a=this.I-ne[this.c]},Y]; function bf(a){y.call(this,"ROM",a,bf,256);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.qa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);cf(c)})}}A(bf);h=bf.prototype; h.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;cf(this)};h.la=function(){this.W&&(this.F&&this.F.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ka=function(){return!0}; -function cf(a){if(!Va(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[bf.prototype.Zc,bf.prototype.Vd,null,null,null,a.b>>1],c);if(cb(a.h,a,b)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c>1],c);if(cb(a.h,a,b)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c>>a.c;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,w=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Za(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=b)a.preventDefault&&a.preventDefault(),64>>a.c;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,w=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.$a(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=b)a.preventDefault&&a.preventDefault(),64e.w&&(e.w-=32),e.b|=128,e.b&64&&Tb(e.a,e.ba))});this.B=Vb(52,4);this.aa=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.B)});cb(b,this,jf);eb(b,this.reset.bind(this));F(this)}; -h.Ob=function(){if(!this.v){var a=tc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.za)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.la=function(a,b){if(!b)if(this.Ob(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ka=function(a){return a?this.save():!0};h.reset=function(){kf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return kf(this)};function kf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.mb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.I&&!this.s&&c&&(b=String.fromCharCode(this.I)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<= -this.m.length)this.T(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ub(this.a,this.aa,1E3/Math.round(this.R/10))}};var lf={},jf=(lf[65392]=[null,null,Z.prototype.Tc,Z.prototype.Pd,"RCSR"],lf[65394]=[null,null,Z.prototype.Sc,Z.prototype.Od,"RBUF"],lf[65396]=[null,null,Z.prototype.nd,Z.prototype.ie,"XCSR"],lf[65398]=[null,null,Z.prototype.md,Z.prototype.he,"XBUF"],lf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b");if(2==b.length){var c=pa(b[0]);if(c!=this.za)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.la=function(a,b){if(!b)if(this.Pb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ka=function(a){return a?this.save():!0};h.reset=function(){kf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return kf(this)};function kf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.nb=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.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.I&&!this.s&&c&&(b=String.fromCharCode(this.I)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<= +this.m.length)this.T(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ub(this.a,this.aa,1E3/Math.round(this.R/10))}};var lf={},jf=(lf[65392]=[null,null,Z.prototype.Uc,Z.prototype.Qd,"RCSR"],lf[65394]=[null,null,Z.prototype.Tc,Z.prototype.Pd,"RBUF"],lf[65396]=[null,null,Z.prototype.od,Z.prototype.je,"XCSR"],lf[65398]=[null,null,Z.prototype.nd,Z.prototype.ie,"XBUF"],lf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a= d.o.listTapes;a&&of(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.D){c.parentNode.removeChild(c);break}this.o[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;of(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; @@ -176,16 +176,16 @@ function of(a,b,c,d,e){if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to sele function xf(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),yf(a,b,c,d,e),a.s="?");vf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.N;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ra(a.qa,e,f),(e=ta(e,f))&&yf(a,b,c,d,e.K,e.ha,e.ga)); a.j.Da=!1;a.m&&(a.m--,a.m||F(a));vf(a)})}function sf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.U);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=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.wb?"":e)+"&format=json"));return!!r(f, +function Ef(a,b,c,d,e){var f=c;if(a.h)return!0;a.xa=b;a.Ca=c;a.ac=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.Y=e[1];a.S=e[2];a.ia=e[3]||512;c=a.ia>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.U);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=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.xb?"":e)+"&format=json"));return!!r(f, null,!0,function(b,c,d){Ff(a,b,c,d)})} -function Ff(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.N;if(d)a.controller.G('Unable to load disk "'+a.xa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.qa,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +function Ff(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.N;if(d)a.controller.G('Unable to load disk "'+a.xa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.qa,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)t(k[0]);else{a.U=k.length;a.Y=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ia=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 w=l.bytes;if(void 0!==w&&w.length){for(var T=n<<2,xa=w.length;xa>2,e=Array(d),f=0;f>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.ca?f=a.na+a.ca&&(a.ca+=f-(a.na+a.ca)+1):(a.na=f,a.ca=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 ("+ @@ -193,46 +193,46 @@ b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected h.toJSON=function(){var a;a=0;for(var b;b=Hf(this,a++);)Jf(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 Jf(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 N(a){y.call(this,"RL11",a,N,4194304);this.g=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Ba("Mobi")&&window&&"FileReader"in window}A(N);h=N.prototype; h.$=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("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.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Kf(d,a)},!0;case "loadDrive":return this.o[b]= -c,c.onclick=function(){var a=d.o.listDisks;a&&Lf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.da){var b;b="";for(var c=0,k;k=Hf(a,c++);)for(var l=0,n=k.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Kf(this,0)}}return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){return(new O(this)).data()}; +h.la=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Nb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Kf(this,0)}}return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){return(new O(this)).data()}; h.restore=function(a){return Mf(this,a[0])};function Pf(a,b){b||(a.s=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('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=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Rf(a,e,b,c,!1,d)}else Qf(a,e)} -function Rf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Qf(a,b,!0),k.vb?a.G("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.s++),k.hb=!!f,Ef(new Af(a,k,"preload"),c,d,f,a.kc)&&g++));return g} -h.kc=function(a,b,c,d,e){var f;a.vb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.da=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.ub||e),this.l&&zc(this.l)):a.hb=!1;a.ub&&(a.ub=!1,--this.s||F(this));Kf(this,a.yb)}; +function Rf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Qf(a,b,!0),k.wb?a.G("RL11 busy"):(k.wb=!0,e&&(k.vb=!0,a.s++),k.ib=!!f,Ef(new Af(a,k,"preload"),c,d,f,a.lc)&&g++));return g} +h.lc=function(a,b,c,d,e){var f;a.wb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.da=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.zb),a.vb||e),this.l&&zc(this.l)):a.ib=!1;a.vb&&(a.vb=!1,--this.s||F(this));Kf(this,a.zb)}; function Of(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; -h.zc=function(a,b,c,d,e,f,g){var k=0,l=a.da,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.da.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.da.read(n,p++))||0>(w=a.da.read(n,p++))){k=5120;break}Ob(this.h,f,u|w<<8);if(Rb(this.h)){k=8192;break}f+=2;if(p>=l.ia&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)}; -h.xd=function(a,b,c,d,e,f,g){var k=0,l=a.da,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.h,f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.da.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.da.write(n,p++,u&255)||!a.da.write(n,p++,u>>8)){k=5120;break}if(p>=l.ia&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Wc=function(){return this.L&65535}; -h.Sd=function(a){this.L=this.L&-1023|a&1022;this.B=this.B&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.zc;case 10:b||(b=this.xd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w& -63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.ic.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.D))}};h.Uc=function(){return this.v};h.Qd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Td=function(a){this.c=a};h.Yc=function(){return this.m};h.Ud=function(a){this.m=a};h.Vc=function(){return this.w};h.Rd=function(a){this.w=a&63}; -var Sf={},Nf=(Sf[63744]=[null,null,N.prototype.Wc,N.prototype.Sd,"RLCS"],Sf[63746]=[null,null,N.prototype.Uc,N.prototype.Qd,"RLBA"],Sf[63748]=[null,null,N.prototype.Xc,N.prototype.Td,"RLDA"],Sf[63750]=[null,null,N.prototype.Yc,N.prototype.Ud,"RLMP"],Sf[63752]=[null,null,N.prototype.Vc,N.prototype.Rd,"RLBE"],Sf); +function Kf(a,b){if(0<=b&&b>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; +h.Ac=function(a,b,c,d,e,f,g){var k=0,l=a.da,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.da.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.da.read(n,p++))||0>(w=a.da.read(n,p++))){k=5120;break}Ob(this.h,f,u|w<<8);if(Rb(this.h)){k=8192;break}f+=2;if(p>=l.ia&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)}; +h.yd=function(a,b,c,d,e,f,g){var k=0,l=a.da,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.h,f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.da.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.da.write(n,p++,u&255)||!a.da.write(n,p++,u>>8)){k=5120;break}if(p>=l.ia&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Xc=function(){return this.L&65535}; +h.Td=function(a){this.L=this.L&-1023|a&1022;this.B=this.B&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.Ac;case 10:b||(b=this.yd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w& +63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.jc.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.D))}};h.Vc=function(){return this.v};h.Rd=function(a){this.v=a&65534};h.Yc=function(){return this.c};h.Ud=function(a){this.c=a};h.Zc=function(){return this.m};h.Vd=function(a){this.m=a};h.Wc=function(){return this.w};h.Sd=function(a){this.w=a&63}; +var Sf={},Nf=(Sf[63744]=[null,null,N.prototype.Xc,N.prototype.Td,"RLCS"],Sf[63746]=[null,null,N.prototype.Vc,N.prototype.Rd,"RLBA"],Sf[63748]=[null,null,N.prototype.Yc,N.prototype.Ud,"RLDA"],Sf[63750]=[null,null,N.prototype.Zc,N.prototype.Vd,"RLMP"],Sf[63752]=[null,null,N.prototype.Wc,N.prototype.Sd,"RLBE"],Sf); function Tf(a,b,c){y.call(this,"Computer",a,Tf,67108864);this.j.N=!1;Uf(this,b);this.A=tc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Vf;this.s=null;this.i=this.I=!1;this.O=tc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Wf(this);if(this.a=Ta("CPU",this.id)){this.F=Ta("Debugger",this.id);this.h=new vb({id:this.qa+".bus",busWidth:this.M},this.a,this.F);var d,e=B(this.id);if((this.w=Ta("Panel",this.id))&&this.w.Wa)for(b=0;b\nLicense: GPL version 3 or later ");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bVf){if(Xf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Xf(this.g)&&(bg(this,d),a=2,cg(this.g));this.g.set("timestamp",sa());dg(this.g);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=ag(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xf(d,g):("error"== -f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),cg(d),Xf(d)?(c=ag(d),e=!0):c=!1))}e&&$f(this,c?d:null)}else 2==a&&d.clear()}else $f(this);delete this.s;delete this.v}e=B(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.j.N=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(eg(this,this.a,b,c,a),this.ya(),this.a.Va());this.D&&(bg(this,b),b.clear());!c&&this.g&&(this.g.clear(),delete this.g);this.l=0}; +h.Za=function(a){void 0===a&&(a=this.b||(this.s?1:Vf));if(!this.l){this.l++;var b=!1,c=!1;this.D=!1;var d=this.v||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Vf){if(Xf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Xf(this.g)&&(bg(this,d),a=2,cg(this.g));this.g.set("timestamp",sa());dg(this.g);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=ag(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xf(d,g):("error"== +f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),cg(d),Xf(d)?(c=ag(d),e=!0):c=!1))}e&&$f(this,c?d:null)}else 2==a&&d.clear()}else $f(this);delete this.s;delete this.v}e=B(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.j.N=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(eg(this,this.a,b,c,a),this.ya(),this.a.Va());this.D&&(bg(this,b),b.clear());!c&&this.g&&(this.g.clear(),delete this.g);this.l=0}; function bg(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.3"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} function hg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ka&&(c&&G(a.a),d=a.a.ka(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.N=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l=c||30<=(b.xb+=c))&&(d.textContent=b.j.P?b.Ga.toFixed(2)+"Mhz":"Stopped",b.xb=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.j.P;d=!!(b.a.u&4);if(0>=a||60<=(b.s+=a)){for(var e=0;e=c||30<=(b.yb+=c))&&(d.textContent=b.j.P?b.Ga.toFixed(2)+"Mhz":"Stopped",b.yb=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.j.P;d=!!(b.a.u&4);if(0>=a||60<=(b.s+=a)){for(var e=0;e