diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 912dc6b3b..c6935394e 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -1398,7 +1398,7 @@ BusPDP11.prototype.fault = function(addr, err, access) this.dbg.printMessage("memory fault (" + access + ") on " + this.dbg.toStrBase(addr), true, true); } if (err) this.cpu.regErr |= err; - this.cpu.trap(PDP11.TRAP.BUS_ERROR, 0, addr); + this.cpu.trap(PDP11.TRAP.BUS, 0, addr); } }; diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 42cc2a1e0..03affedf4 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -831,7 +831,7 @@ PDP11.opBPL = function(opCode) */ PDP11.opBPT = function(opCode) { - this.trap(PDP11.TRAP.BPT, 0, PDP11.REASON.TRAP); + this.trap(PDP11.TRAP.BPT, 0, PDP11.REASON.OPCODE); this.nStepCycles -= (4 + 1); }; @@ -1105,7 +1105,7 @@ PDP11.opDIV = function(opCode) */ PDP11.opEMT = function(opCode) { - this.trap(PDP11.TRAP.EMT, 0, PDP11.REASON.TRAP); + this.trap(PDP11.TRAP.EMT, 0, PDP11.REASON.OPCODE); this.nStepCycles -= (22 + 3); }; @@ -1119,7 +1119,7 @@ PDP11.opHALT = function(opCode) { if (this.regPSW & PDP11.PSW.CMODE) { this.regErr |= PDP11.CPUERR.BADHALT; - this.trap(PDP11.TRAP.BUS_ERROR, 0, PDP11.REASON.HALT); + this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.HALT); } else { if (this.panel) { this.panel.setData(this.regsGen[0], true); @@ -1178,7 +1178,7 @@ PDP11.opINCB = function(opCode) */ PDP11.opIOT = function(opCode) { - this.trap(PDP11.TRAP.IOT, 0, PDP11.REASON.TRAP); + this.trap(PDP11.TRAP.IOT, 0, PDP11.REASON.OPCODE); this.nStepCycles -= (22 + 3); }; @@ -1298,7 +1298,7 @@ PDP11.opMFPT = function(opCode) /* * TODO: Review */ - this.trap(PDP11.TRAP.RESERVED, 0, PDP11.REASON.TRAP); + this.trap(PDP11.TRAP.RESERVED, 0, PDP11.REASON.OPCODE); }; PDP11.MOV_CYCLES = [ @@ -1671,7 +1671,7 @@ PDP11.opSPL = function(opCode) } if (!(this.regPSW & PDP11.PSW.CMODE)) { this.regPSW = (this.regPSW & ~(PDP11.PSW.UNUSED | PDP11.PSW.PRI)) | ((opCode & 0x7) << PDP11.PSW.SHIFT.PRI); - this.opFlags |= PDP11.OPFLAG.INTQ_CHK; + this.opFlags |= PDP11.OPFLAG.INTQ_DELAY; } this.nStepCycles -= (4 + 1); }; @@ -1720,7 +1720,7 @@ PDP11.opSXT = function(opCode) */ PDP11.opTRAP = function(opCode) { - this.trap(PDP11.TRAP.TRAP, 0, PDP11.REASON.TRAP); + this.trap(PDP11.TRAP.TRAP, 0, PDP11.REASON.OPCODE); this.nStepCycles -= (4 + 1); }; @@ -1830,7 +1830,7 @@ PDP11.opUndefined = function(opCode) if (DEBUGGER && this.dbg) { if (this.dbg.undefinedInstruction(opCode)) return; } - this.trap(PDP11.TRAP.RESERVED, 0, PDP11.REASON.TRAP); + this.trap(PDP11.TRAP.RESERVED, 0, PDP11.REASON.OPCODE); }; /** diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 4eab82c92..07eda6c9b 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -590,9 +590,9 @@ CPUStatePDP11.prototype.getOpcode = function() this.lastAI = 0; this.lastPC = pc; /* - * If PC is misaligned, a BUS_ERROR trap will be generated, and because it will generate an + * If PC is unaligned, a BUS trap will be generated, and because it will generate an * exception, the next line (the equivalent of advancePC(2)) will not be executed, ensuring that - * original misaligned PC will be pushed onto the stack by trap(). + * original unaligned PC will be pushed onto the stack by trap(). */ var op = this.readWord(pc); this.regsGen[PDP11.REG.PC] = (pc + 2) & 0xffff; @@ -819,10 +819,10 @@ CPUStatePDP11.prototype.checkInterrupts = function() fInterrupt = true; } } - else if (this.opFlags & PDP11.OPFLAG.INTQ_CHK) { + else if (this.opFlags & PDP11.OPFLAG.INTQ_DELAY) { /* - * We know that INTQ (bit 1) is clear, so since INTQ_CHK (bit 0) is set, incrementing opFlags - * will transform INTQ_CHK into INTQ, without affecting any other (higher) bits. + * We know that INTQ (bit 1) is clear, so since INTQ_DELAY (bit 0) is set, incrementing opFlags + * will transform INTQ_DELAY into INTQ, without affecting any other (higher) bits. */ this.opFlags++; } @@ -899,11 +899,11 @@ CPUStatePDP11.prototype.dispatchInterrupt = function(vector, priority) CPUStatePDP11.prototype.checkTraps = function() { if (this.opFlags & PDP11.OPFLAG.TRAP_MMU) { - this.trap(PDP11.TRAP.MMU, PDP11.OPFLAG.TRAP_MMU, PDP11.REASON.TRAP); + this.trap(PDP11.TRAP.MMU, PDP11.OPFLAG.TRAP_MMU, PDP11.REASON.FAULT); return true; } if (this.opFlags & PDP11.OPFLAG.TRAP_SP) { - this.trap(PDP11.TRAP.BUS_ERROR, PDP11.OPFLAG.TRAP_SP, PDP11.REASON.STACK); + this.trap(PDP11.TRAP.BUS, PDP11.OPFLAG.TRAP_SP, PDP11.REASON.YELLOW); return true; } if (this.opFlags & PDP11.OPFLAG.TRAP_TF) { @@ -1263,6 +1263,7 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason) */ this.regErr |= PDP11.CPUERR.RED; this.regsGen[6] = 4; + reason = PDP11.REASON.RED; } this.lastPC = vector; @@ -1310,22 +1311,22 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason) * * where, after "TRAP 000" has executed, a hardware interrupt will be acknowledged, and instead of * executing the IOT, we'll execute the HALT and fail the test. We avoid that by relying on the same - * trick that the SPL instruction uses: setting INTQ_CHK instead of INTQ, which effectively delays + * trick that the SPL instruction uses: setting INTQ_DELAY instead of INTQ, which effectively delays * INTQ detection for one instruction, which is just long enough to allow the diagnostic to pass. */ this.opFlags &= ~(flag | PDP11.OPFLAG.TRAP_TF | PDP11.OPFLAG.INTQ); - this.opFlags |= PDP11.OPFLAG.INTQ_CHK; + this.opFlags |= PDP11.OPFLAG.INTQ_DELAY | PDP11.OPFLAG.TRAP; this.trapPSW = -1; // reset flag that we have a trap within a trap /* - * These next properties are purely an aid for the Debugger; see getTrapStatus() + * These next properties (in conjunction with setting PDP11.OPFLAG.TRAP) are purely an aid for the Debugger; + * see getTrapStatus(). */ - this.opFlags |= PDP11.OPFLAG.TRAP; this.trapVector = vector; this.trapReason = reason; - if (reason != PDP11.REASON.INTERRUPT) throw vector; + if (reason >= PDP11.REASON.RED) throw vector; }; /** @@ -1491,72 +1492,77 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl var errorMask = 0; switch (pdr & 0x7) { case 1: // read-only with trap - errorMask = 0x1000; // MMU trap + errorMask = PDP11.MMR0.TRAP_MMU; /* falls through */ case 2: // read-only pdr |= 0x80; // Set A bit if (accessFlags & PDP11.ACCESS.WRITE) { - errorMask = 0x2000; // read-only abort + errorMask = PDP11.MMR0.ABORT_RO; } break; case 4: // read-write with read-write trap - errorMask = 0x1000; // MMU trap + errorMask = PDP11.MMR0.TRAP_MMU; /* falls through */ case 5: // read-write with write trap if (accessFlags & PDP11.ACCESS.WRITE) { - errorMask = 0x1000; // MMU trap + errorMask = PDP11.MMR0.TRAP_MMU; } /* falls through */ case 6: // read-write: set A & W bits pdr |= ((accessFlags & PDP11.ACCESS.WRITE) ? 0xc0 : 0x80); break; default: - errorMask = 0x8000; // non-resident abort + errorMask = PDP11.MMR0.ABORT_NR; break; } - if ((pdr & 0x7f08) !== 0x7f00) { // skip checking most common case (hopefully) + if ((pdr & 0x7f08) != 0x7f00) { // skip checking most common case (hopefully) if (pdr & 0x8) { // expand downwards if (pdr & 0x7f00) { if ((virtualAddress & 0x1fc0) < ((pdr >> 2) & 0x1fc0)) { - errorMask |= 0x4000; // page length error abort + errorMask |= PDP11.MMR0.ABORT_PL; } } } else { // expand upwards if ((virtualAddress & 0x1fc0) > ((pdr >> 2) & 0x1fc0)) { - errorMask |= 0x4000; // page length error abort + errorMask |= PDP11.MMR0.ABORT_PL; } } } - // aborts and traps: log FIRST trap and MOST RECENT abort + /* + * Aborts and traps: log FIRST trap and MOST RECENT abort + */ this.mmuPDR[this.mmuMode][page] = pdr; - if ((physicalAddress !== 0x3fff7a) || this.mmuMode) {// MMR0 is 017777572 + if (physicalAddress != ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.MMR0) & this.mmuMask) || this.mmuMode) { this.mmuLastMode = this.mmuMode; this.mmuLastPage = page; } - var fTrap = false; + var fAbort = false; if (errorMask) { - if (errorMask & 0xe000) { + if (errorMask & PDP11.MMR0.ABORT) { if (this.trapPSW >= 0) errorMask |= 0x80; // Instruction complete - if (!(this.regMMR0 & 0xe000)) { + if (!(this.regMMR0 & PDP11.MMR0.ABORT)) { this.regMMR0 |= errorMask | (this.mmuLastMode << 5) | (this.mmuLastPage << 1); } - fTrap = true; + fAbort = true; } - if (!(this.regMMR0 & 0xf000)) { - //if (physicalAddress < 017772200 || physicalAddress > 017777677) { - if (physicalAddress < 0x3ff480 || physicalAddress > 0x3fffbf) { - this.regMMR0 |= 0x1000; // MMU trap flag - if (this.regMMR0 & 0x0200) { + if (!(this.regMMR0 & (PDP11.MMR0.ABORT | PDP11.MMR0.TRAP_MMU))) { + /* + * TODO: Review the code below, because the address range seems over-inclusive. + */ + if (physicalAddress < ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.SIPDR0) & this.mmuMask) || + physicalAddress > ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.UDPAR7 | 0x1) & this.mmuMask)) { + this.regMMR0 |= PDP11.MMR0.TRAP_MMU; + if (this.regMMR0 & PDP11.MMR0.MMU_TRAPS) { this.opFlags |= PDP11.OPFLAG.TRAP_MMU; } } } - if (fTrap) { // don't trap until the end, because it throws an exception - this.trap(PDP11.TRAP.MMU, 0, PDP11.REASON.ERROR); + if (fAbort) { // don't abort until the end, because it throws an exception + this.trap(PDP11.TRAP.MMU, 0, PDP11.REASON.ABORT); } } return physicalAddress; @@ -1641,7 +1647,7 @@ CPUStatePDP11.prototype.checkStackLimit = function(mode, addr) if (this.model >= PDP11.MODEL_1145 && (addr <= this.regSL - 32 /* || mode == 1 && addr >= 0xFFFE */)) { this.regErr |= PDP11.CPUERR.RED; this.regsGen[6] = 4; - this.trap(PDP11.TRAP.BUS_ERROR, 0, PDP11.REASON.STACK); + this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.RED); } else { /* * On older machines (eg, the PDP-11/20), the instruction is always allowed to complete, @@ -1708,11 +1714,11 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags) * * NOTE: Most instruction code paths never call getAddrByMode() when the mode is zero; * JMP and JSR instructions are exceptions, but that's OK, because those are documented as - * ILLEGAL instructions which produce a BUS_ERROR trap (as opposed to UNDEFINED instructions + * ILLEGAL instructions which produce a BUS trap (as opposed to UNDEFINED instructions * that cause a RESERVED trap). */ case 0: - this.trap(PDP11.TRAP.BUS_ERROR, 0, PDP11.REASON.ILLEGAL); + this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.ILLEGAL); return 0; /* @@ -2208,6 +2214,7 @@ CPUStatePDP11.prototype.updateDstWord = function(opCode, data, fnOp) /* * TODO: If callers are careful about masking data, then we don't need to mask it here or in bus.setWord(). + * We've eliminated the 0xffff data mask here, but bus.setWord() is still masking. */ this.assert(data < 0 && data >= -8 || !(data & ~0xffff)); @@ -2273,14 +2280,15 @@ CPUStatePDP11.prototype.writeDstWord = function(opCode, data) /* * TODO: If callers are careful about masking data, then we don't need to mask it here or in bus.setWord(). + * We've eliminated the 0xffff data mask here, but bus.setWord() is still masking. */ this.assert(data < 0 && data >= -8 || !(data & ~0xffff)); if (!mode) { - this.regsGen[reg] = data < 0? this.regsGen[-data-1] : (data & 0xffff); + this.regsGen[reg] = (data = (data < 0? this.regsGen[-data-1] : data)); } else { var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_WORD); - this.bus.setWord(addr, data < 0? this.regsGen[-data-1] : data); + this.bus.setWord(addr, (data = (data < 0? this.regsGen[-data-1] : data))); } return data; }; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index b962071a7..b1343f5ea 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1220,7 +1220,7 @@ if (DEBUGGER) { if (this.sMessagePrev && sMessage == this.sMessagePrev) return; this.sMessagePrev = sMessage; - if ((this.bitsMessage & MessagesPDP11.HALT) && this.cpu && this.cpu.isRunning()) { + if ((this.bitsMessage & MessagesPDP11.HALT) && this.cpu && this.cpu.isRunning() || this.isBusy(true)) { this.stopCPU(); sMessage += " (cpu halted)"; } @@ -2984,10 +2984,10 @@ if (DEBUGGER) { * * Besides, it's nice for "db" and "dw" to generate the same Bus activity that typical byte and word reads do. */ - var i, n; + var i = nBytesPerLine; var data = 0, shift = 0; - for (i = nBytesPerLine; i > 0 && nBytes > 0; i -= n, nBytes -= n) { - n = 1; + while (i > 0 && nBytes > 0) { + var n = 1; var v = size == 1? this.getByte(dbgAddr, n) : this.getWord(dbgAddr, (n = 2)); data |= (v << (shift << 3)); shift += n; @@ -3001,7 +3001,12 @@ if (DEBUGGER) { } data = shift = 0; } - sChars += (v >= 32 && v < 128? String.fromCharCode(v) : '.'); + i -= n; nBytes -= n; + while (n--) { + var c = v & 0xff; + sChars += (c >= 32 && c < 128? String.fromCharCode(c) : '.'); + v >>= 8; + } } if (sDump) sDump += "\n"; if (fJSON) { diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 049498ea0..53fdac475 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -82,7 +82,7 @@ var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined'); * MEMFAULT forces the Memory interfaces to signal a CPU fault when a word is accessed using an odd (unaligned) address. * * Since PDPjs inherited its Bus component from PCx86, it included support for both aligned and unaligned word accesses - * by default. However, the PDP-11 adds a wrinkle: when an odd address is used to access a memory word, a BUS_ERROR trap + * by default. However, the PDP-11 adds a wrinkle: when an odd address is used to access a memory word, a BUS trap * must be generated. Note that odd IOPAGE word accesses are fine; this only affects the Memory component. * * When the MMU is enabled, these checks may also be performed at a higher level, eliminating the need for them at the @@ -197,13 +197,13 @@ var PDP11 = { * Internal operation state flags */ OPFLAG: { - INTQ_CHK: 0x01, // set INTQ on next check (set by SPL and assorted traps) + INTQ_DELAY: 0x01, // set INTQ on next check (set by SPL and traps) INTQ: 0x02, // call checkInterrupts() INTQ_MASK: 0x03, WAIT: 0x04, // WAIT operation in progress TRAP: 0x08, // set if last operation was a trap (see trapLast for the vector, and trapReason for the reason) TRAP_TF: 0x10, // aka PDP11.PSW.TF - TRAP_SP: 0x20, // set for a deferred BUS_ERROR trap (due to a "yellow" stack overflow condition) + TRAP_SP: 0x20, // set for a deferred BUS trap (due to a "yellow" stack overflow condition) TRAP_MMU: 0x40, TRAP_MASK: 0x70, NO_FLAGS: 0x80, // set whenever the PSW is written directly, requiring all updateXXXFlags() functions to leave flags unchanged @@ -251,7 +251,7 @@ var PDP11 = { */ TRAP: { UNDEFINED: 0x00, // 000 (reserved) - BUS_ERROR: 0x04, // 004 illegal instruction, unaligned address, invalid memory, stack limit, microbreak + BUS: 0x04, // 004 unaligned address, non-existent memory, illegal instruction, etc RESERVED: 0x08, // 010 reserved instructions BPT: 0x0C, // 014 BPT: breakpoint trap (trace) IOT: 0x10, // 020 IOT: input/output trap @@ -262,27 +262,31 @@ var PDP11 = { MMU: 0xA8 // 250 MMU: aborts and traps }, /* - * PDP-11 trap reasons (largely for diagnostic purposes only) + * PDP-11 trap reasons; the reason may also be a non-negative address indicating a BUS memory error + * (unaligned address or non-existent memory). Any reason >= RED (which includes BUS memory errors) generate + * immediate (thrown) traps; the rest generate synchronous traps. */ REASON: { - UNKNOWN: 0, - TRAP: -1, - HALT: -2, - INTERRUPT: -3, - TRACE: -4, - STACK: -5, - ILLEGAL: -6, - ERROR: -7, + ABORT: -1, // immediate MMU fault + ILLEGAL: -2, // immediate invalid opcode (BUS) + RED: -3, // immediate stack overflow fault (BUS) + YELLOW: -4, // deferred stack overflow fault (BUS) + FAULT: -5, // deferred MMU fault + TRACE: -6, // deferred TF fault (BPT) + HALT: -7, // illegal HALT (BUS) + OPCODE: -8, // opcode-generated trap (eg, BPT, EMT, IOT, TRAP, or RESERVED opcode) + INTERRUPT: -9, // device-generated trap (vector is device-specific) }, REASONS: [ - "UNKNOWN", - "TRAP", - "HALT", - "INTERRUPT", - "TRACE", - "STACK", + "ABORT", "ILLEGAL", - "ERROR" + "RED", + "YELLOW", + "FAULT", + "TRACE", + "HALT", + "OPCODE", + "INTERRUPT" ], /* * Internal memory access flags diff --git a/modules/pdp11/lib/serialport.js b/modules/pdp11/lib/serialport.js index 5918e0c61..7ca259d5f 100644 --- a/modules/pdp11/lib/serialport.js +++ b/modules/pdp11/lib/serialport.js @@ -690,6 +690,11 @@ SerialPortPDP11.prototype.writeXBUF = function(data, addr) if (data) { this.transmitByte(data); this.xcsr &= ~PDP11.DL11.XCSR.READY; + /* + * NOTE: When debugging issues involving the SerialPort, such as debugging code between a pair of + * transmitted bytes, you can pass 0 instead of getBaudTimeout() to setTimer() to minimize the amount + * of time spent waiting for XCSR.READY to be set again. + */ this.cpu.setTimer(this.timerTransmitInterrupt, this.getBaudTimeout(this.nBaudTransmit)); } }; diff --git a/versions/pdpjs/1.30.3/pdp11-dbg.js b/versions/pdpjs/1.30.3/pdp11-dbg.js index 488f0bc1c..41d16168b 100644 --- a/versions/pdpjs/1.30.3/pdp11-dbg.js +++ b/versions/pdpjs/1.30.3/pdp11-dbg.js @@ -46,47 +46,47 @@ function Fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}funct function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Qa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Sa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.Ya=this.id:(this.Qa=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.w={ready:!1,ab:!1,$b:!1,ha:!1,error:!1};this.Sb=null;this.w.error=!1;this.G={};this.i=null;this.ma=d||0;u.push(this)}var cb=void 0,db={}; +function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.vc=b.comment;this.Yc=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.w={ready:!1,ab:!1,$b:!1,ha:!1,error:!1};this.Sb=null;this.w.error=!1;this.G={};this.i=null;this.ma=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 ob(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=ob(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;ba;a++)this.g["S"+a]=[0,0,!1,!1,this.hd,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()}; +var zb="undefined"!==typeof ArrayBuffer,Ab="ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Bb={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,keyboard:65536,key:131072,paper:1048576,disk:4194304,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648}; +function Cb(a){t.call(this,"Panel",a,Cb);this.f=this.A=this.Wa=this.D=this.J=this.H=0;this.L=this.M=this.I=!1;this.O=Db;this.B={};this.g={START:[1,1,!0,!1,this.fd],STEP:[1,1,!1,!1,this.gd],ENABLE:[1,1,!1,!1,this.bd],CONT:[1,1,!0,!1,this.$c],DEP:[0,0,!0,!1,this.ad],EXAM:[1,1,!0,!1,this.cd],LOAD:[1,1,!0,!1,this.ed],TEST:[0,0,!0,!1,this.dd]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.hd,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.H++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.B[b]=d?1:0,this.H++,!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.Ea=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.Ga=function(a,b){b||(Mb(),this.reset());return!0};k.Fa=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.B)Nb(a,c,null!=b?b:a.B[c])}function ac(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)ac(a,b,a.g[b][1])}function bc(a,b,c,d){a.G[b]&&(void 0===c&&(yb(a,"Value for "+b+" is invalid"),a.b.fa()),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];ac(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]&&(ac(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.fd=function(a){a||this.b.w.W||(this.v.reset(),cc(this.b),Eb(this,"ENABLE")&&this.b.hb())};k.gd=function(){};k.bd=function(a){a||this.b.fa()}; -k.$c=function(a){if(!a&&!this.b.w.W)if(Eb(this,"ENABLE"))this.b.hb();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.ib(0),ub(a,!1);else try{var b=this.b.ib(1);0a.b.cb?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Na;Eb(a,"STEP")||(b=-b);ic(a,a.f&~c|a.f+b&c)} -function ic(a,b){a.f=b&a.v.Na;b=a.f;for(var c=0;22>c;c++)kc(a,"A"+c,b&1<c;c++)kc(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.$a=[];this.la=0;this.f=!1;this.bc=0;this.A=[];this.Nc=[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.$a[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.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&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.$a[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 if(g&1&&(f=e.$a[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);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.Da(c,16,5),this.i&&F(this.i,f[5])&&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.$a[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.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&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.$a[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.Da(c,16,4),this.i&&F(this.i,a[5])&&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.Nb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Nb){n=l.size-(f-m);n>g&&(n=g);l.Nb=f-l.F+n;f=m+a.za;g-=n;h++;continue}}return Ac(1,f,g)}f=new I(a,f,n,a.za,d,e);tc(f,a.i,l);a.Y[h++]=f;f=m+a.za;g-=n}return 0>=g?(d==Bc&&(a.bc+=c),a.status((c>>10)+"Kb "+Cc[d]+" at "+qa(b)),!0):Ac(2,b,c)} -function xc(a,b,c){var d=[];for(b>>>=a.ja;0>>=a.ja;0>>this.ja].Vb(a&this.v,a)};k.Tb=function(a){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Na)>>>this.ja].gc(a&this.v,a);this.la--;return a}; -k.na=function(a){3932160<=a&&(a=Dc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].ra(a&this.v,a)};k.bb=function(a){3932160<=a&&(a=Dc(this.b,a));var b=a&this.v,c=(a&this.Na)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].hc(b,a);this.la--;return a};k.Ab=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Yb(a&this.v,b&255,a)};k.qb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Na)>>>this.ja].Zb(a&this.v,b&255,a);this.la--}; -k.gb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Ob(a&this.v,b&65535,a)};k.Bb=function(a,b){3932160<=a&&(a=Dc(this.b,a));var c=a&this.v,d=(a&this.Na)>>>this.ja;this.f=!1;this.la++;this.Y[d].mc(c,b&65535,a);this.la--}; -function Ec(a){for(var b=0,c=[],d=0;da.b.cb?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Na;Eb(a,"STEP")||(b=-b);hc(a,a.f&~c|a.f+b&c)} +function hc(a,b){a.f=b&a.v.Na;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.$a=[];this.la=0;this.f=!1;this.bc=0;this.A=[];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.$a[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.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&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.$a[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 if(g&1&&(f=e.$a[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);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.Da(c,16,5),this.i&&F(this.i,f[5])&&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.$a[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.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&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.$a[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.Da(c,16,4),this.i&&F(this.i,a[5])&&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.Ob+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=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.bc+=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.Na)>>>this.ja].gc(a&this.v,a);this.la--;return a}; +k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].ra(a&this.v,a)};k.bb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Na)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].hc(b,a);this.la--;return a};k.Ab=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Yb(a&this.v,b&255,a)};k.rb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Na)>>>this.ja].Zb(a&this.v,b&255,a);this.la--}; +k.gb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Pb(a&this.v,b&65535,a)};k.Bb=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Na)>>>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.cb)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y>5&3;b.kb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Sc(b))}};k.vd=function(){var a=this.b;a.J&57344||(a.Ac=a.S&65535);a=a.Ac;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.wd=function(){var a=this.b;a.J&57344||(a.Bc=a.Hb);return a.Bc};k.xd=function(){return this.b.pb};k.pe=function(a){var b=this.b;1170>b.cb&&(a&=-49);b.pb!=a&&(b.pb=a,b.Ub=a&16?4194303:262143,Sc(b))}; -k.Yd=function(a){a=a>>1&63;var b=this.b.Mb[a>>1];return a&1?b>>16:b&65535};k.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Mb[c]=b&1?this.b.Mb[c]&65535|(a&63)<<16:this.b.Mb[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.Da=function(a,b,c){this.f=!0;this.la||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on "+J(this.i,a),!0,!0),b&&(this.b.Ha|=b),this.b.ta(4,0,a))};function Mc(a){var b=a.f;a.f=!1;return b}function zc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={ea:0,lc:-1}}z(K);k=K.prototype; +k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.lc=Nc(c,function(){e.f.Jb|=128;e.f.Jb&64&&Oc(e.b,e.f.ce);e.C&&e.C.oa(1);Pc(e.b,e.f.lc,1E3/60)});this.f.ce=Qc(64,6);Hb(b,this,Rc);Jb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.Jb=128;Pc(this.b,this.f.lc,1E3/60,!0)};k.sd=function(){return this.f.Jb};k.me=function(a){this.f.Jb=a&192};k.ud=function(){var a=this.b;return a.J&62337|a.kb<<5|a.jb<<1}; +k.oe=function(a){var b=this.b;a&=62337;if(b.J!=a){b.J=a;b.kb=a>>5&3;b.jb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Va!=c&&(b.Va=c,Sc(b))}};k.vd=function(){var a=this.b;a.J&57344||(a.Ac=a.S&65535);a=a.Ac;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.wd=function(){var a=this.b;a.J&57344||(a.Bc=a.Ib);return a.Bc};k.xd=function(){return this.b.qb};k.pe=function(a){var b=this.b;1170>b.cb&&(a&=-49);b.qb!=a&&(b.qb=a,b.Ja=a&16?4194303:262143,Sc(b))}; +k.Yd=function(a){a=a>>1&63;var b=this.b.Nb[a>>1];return a&1?b>>16:b&65535};k.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Nb[c]=b&1?this.b.Nb[c]&65535|(a&63)<<16:this.b.Nb[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.yb=function(a){a&=7;return this.b.N&2048?this.b.Wa[a]:this.b.u[a]};k.Cb=function(a,b){b&=7;this.b.N&2048?this.b.Wa[b]=a:this.b.u[b]=a};k.Cd=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.ue=function(a){this.b.N&49152?this.b.Ia[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.zb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Wa[a]};k.Db=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Wa[b]=a}; -k.Dd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]};k.ve=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Ed=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.we=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[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(Bc){case Bc:a=this.v.bc}a=(a>>6)-1}else a=0;return a};k.Kc=function(){};k.Td=function(){return 1}; +k.yb=function(a){a&=7;return this.b.N&2048?this.b.Xa[a]:this.b.u[a]};k.Cb=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.Ia[0]:this.b.u[6]};k.ue=function(a){this.b.N&49152?this.b.Ia[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.zb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Xa[a]};k.Db=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.Ia[1]};k.ve=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Ed=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.we=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[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.bc}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.Ha};k.fe=function(){this.b.Ha=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.K|=2};k.Sd=function(a){return a?this.b.Wb&65280:0};k.Ke=function(a){this.b.Wb=a|255};k.Bd=function(){return Tc(this.b)};k.te=function(a){Uc(this.b,a&-1793|Tc(this.b)&1792);this.b.K|=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, @@ -96,226 +96,227 @@ K.prototype.Ne,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Wd,K.prototype.Oe K.prototype.Db,"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.A,0,this.size>>2),bd(this,Yc?cd:dd);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>1),this.b=new Int32Array(this.A,0,this.size>>2),bd(this,Yc?cd:dd);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.Da(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},Ya: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.Sa=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,1,c.M)&&c.fa(!0)}return this.gc(a,b)},$:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,2,c.M)&&c.fa(!0)}return this.hc(a,b)},ka:function(a, +1]&255)<<8},Za: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.Ta=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,1,c.M)&&c.fa(!0)}return this.gc(a,b)},$:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,2,c.M)&&c.fa(!0)}return this.hc(a,b)},ka:function(a, b,c){if(this.i&&null!=this.F){var d=this.i;id(d,this.F+a,1,d.D)&&d.fa(!0)}this.f?this.B(a,b,c):this.Zb(a,b,c)},wa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;id(d,this.F+a,2,d.D)&&d.fa(!0)}this.f?this.B(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.Da(b,64,2);return this.D.getUint16(a,!0)},Qa:function(a,b){a&1&&this.v.Da(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.Sa=!0},pa:function(a,b,c){this.G[a]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},va:function(a,b,c){a&1&&this.v.Da(c,64,4);this.D.setUint16(a,b,!0);this.Sa=!0},xa:function(a,b,c){a&1&&this.v.Da(c,64,4);this.I[a>>1]=b;this.Sa=!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)&&hd(a,gd,!1),(a.C=c.C)&&fd(a,gd,!1))}function jd(a,b){b?--a.C||(a.Yb=a.f?a.B:a.Zb,a.Ob=a.f?a.H:a.mc):--a.g||(a.Vb=a.gc,a.ra=a.hc)}function fd(a,b,c){c&&a.C||(a.Yb=!a.f&&b[1]||a.B,a.Ob=!a.f&&b[3]||a.H);if(c||void 0===c)a.Zb=b[1]||a.B,a.mc=b[3]||a.H}function hd(a,b,c){c&&a.g||(a.Vb=b[0]||a.J,a.ra=b[2]||a.L);if(c||void 0===c)a.gc=b[0]||a.J,a.hc=b[2]||a.L}function bd(a,b){b||(b=kd);hd(a,b,void 0);fd(a,b,void 0)} -var kd=[],ed=[I.prototype.S,I.prototype.Ya,I.prototype.ca,I.prototype.Ja],gd=[I.prototype.O,I.prototype.ka,I.prototype.$,I.prototype.wa];if(zb)var dd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.va],cd=[I.prototype.R,I.prototype.pa,I.prototype.Qa,I.prototype.xa]; -function ld(a,b){t.call(this,"CPU",a,ld,1);var c=a.multiplier||1;this.lb=a.cycles||b;this.eb=c;this.Eb=Math.round(this.lb/1E4)/100;this.ob=this.Eb*this.eb;this.w.W=!1;this.w.Xb=!1;this.w.sb=a.autoStart;this.w.ub=!1;this.Jb=this.va=0;this.Kb=a.csStart;this.vb=a.csInterval;this.wb=a.csStop;this.L=[];this.zc=this.be.bind(this);H(this)}z(ld);var md=["power","reset"];k=ld.prototype; -k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.B=a.B;for(b=0;b=a.va&&(a.va+=a.vb,c=!0);0<=a.wb&&a.wb<=sd(a)&&(a.vb=a.wb=-1,pd(a),a.fa(),c=!0);c&&a.j(sd(a)+" cycles: checksum="+p(a.Jb))}} +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.Ta=!0},pa:function(a,b,c){this.G[a]=b;this.Ta=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},va:function(a,b,c){a&1&&this.v.Da(c,64,4);this.D.setUint16(a,b,!0);this.Ta=!0},xa:function(a,b,c){a&1&&this.v.Da(c,64,4);this.I[a>>1]=b;this.Ta=!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)&&hd(a,gd,!1),(a.C=c.C)&&fd(a,gd,!1))}function jd(a,b){b?--a.C||(a.Yb=a.f?a.B:a.Zb,a.Pb=a.f?a.H:a.mc):--a.g||(a.Vb=a.gc,a.ra=a.hc)}function fd(a,b,c){c&&a.C||(a.Yb=!a.f&&b[1]||a.B,a.Pb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Zb=b[1]||a.B,a.mc=b[3]||a.H}function hd(a,b,c){c&&a.g||(a.Vb=b[0]||a.J,a.ra=b[2]||a.L);if(c||void 0===c)a.gc=b[0]||a.J,a.hc=b[2]||a.L}function bd(a,b){b||(b=kd);hd(a,b,void 0);fd(a,b,void 0)} +var kd=[],ed=[I.prototype.S,I.prototype.Za,I.prototype.ca,I.prototype.Ja],gd=[I.prototype.O,I.prototype.ka,I.prototype.$,I.prototype.wa];if(zb)var dd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.va],cd=[I.prototype.R,I.prototype.pa,I.prototype.Qa,I.prototype.xa]; +function ld(a,b){t.call(this,"CPU",a,ld,1);var c=a.multiplier||1;this.nb=a.cycles||b;this.eb=c;this.Fb=Math.round(this.nb/1E4)/100;this.pb=this.Fb*this.eb;this.w.W=!1;this.w.Xb=!1;this.w.tb=a.autoStart;this.w.ub=!1;this.Kb=this.va=0;this.Lb=a.csStart;this.vb=a.csInterval;this.wb=a.csStop;this.L=[];this.zc=this.be.bind(this);H(this)}z(ld);var md=["power","reset"];k=ld.prototype; +k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.B=a.B;for(b=0;b=a.va&&(a.va+=a.vb,c=!0);0<=a.wb&&a.wb<=sd(a)&&(a.vb=a.wb=-1,pd(a),a.fa(),c=!0);c&&a.j(sd(a)+" cycles: checksum="+p(a.Kb))}} 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.ca/a.ob?b=1:d=!0;a.eb=b;b=a.Eb*a.eb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.rb()}ec(a,a.$);a.$=0;a.X=Aa();a.ia=0;ud(a);return d}function Nc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.lb*a.eb/1E3*c|0,a.w.W&&(c+=vd(a)),a.L[b][0]=c)} -function wd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function dc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function vd(a,b){var c=a.ka-=a.b;a.b=a.I=0;b&&(a.ka=0);return c} -k.be=function(){if(this.w.W){this.Fb>=this.lb&&ud(this,!0);this.Ja=0;this.jb=Aa();if(this.ia){var a=this.jb-this.ia;a>this.wc&&(this.X+=a,this.X>this.jb&&(this.X=this.jb))}try{do{var b=wd(this,this.w.ub?1:this.nb);try{this.ib(b)}catch(e){if("number"!=typeof e)throw e;}b=vd(this,!0);this.Ja+=b;this.$+=b;fc(this,b);dc(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.nb;15<=++this.yc&&(this.oa(),this.yc=0);break}}while(this.w.W)}catch(e){this.fa();this.C&&this.C.stop(Aa(),sd(this));yb(this,e.stack||e.message); -return}if(this.w.W){a=setTimeout;b=this.zc;this.ia=Aa();var c=this.wc;this.Ja&&(c=Math.round(c*this.Ja/this.nb));var c=c-(this.ia-this.jb),d=this.ia-this.X;d&&(this.ca=Math.round(this.$/(10*d))/100,864E5<=d&&(this.pa=0,td(this)));if(0>c||this.cac&&(this.X-=c),c=0;this.Fb+=this.Ja;this.ia+=c;a(b,c)}}}; -k.hb=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;td(this);this.w.W=!0;this.w.Xb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.rb(!0),this.C.start(this.X,sd(this)));setTimeout(this.zc,0);return!0};k.ib=function(){return 0};k.fa=function(a){var b=!1;if(this.w.W){vd(this);ec(this,this.$);this.$=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),sd(this));b=!0}this.w.complete=a;return b}; -function xd(a){this.cb=+a.model||1170;this.Rb=a.addrReset||0;ld.call(this,a,6666667);this.decode=1120==this.cb?yd.bind(this):zd.bind(this);Ad(this);this.M=0;this.O=null;this.w.complete=!1}z(xd,ld);k=xd.prototype;k.reset=function(){this.status("model "+this.cb);this.w.W&&this.fa();Ad(this);od(this);this.w.error=!1;this.parent.reset.call(this)}; -function Ad(a){a.T=65536;a.U=32768;a.aa=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Rb];a.Wa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.A=0;a.kb=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.Mb=[0,0,0,0,0,0,0,0,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.K=0;a.D=a.H=0;a.g=a.f=a.tb=0;a.xa=-1;cc(a)}function cc(a){a.Wb=255;a.Ha=0;a.jc=0;a.J=0;a.Ac=0;a.Bc=0;a.pb=0;a.Ua=0;a.Za=0;a.Ub=262143;a.S=0;a.Hb=0;a.O=null;a.v&&Sc(a)}function Sc(a){a.Ua?(a.R=65536,a.ba=a.Vc,a.ra=a.Zd,a.Ob=a.Re,vc(a.v,a.pb&16?22:18)):(a.R=0,a.ba=a.Uc,a.ra=a.Ec,a.Ob=a.Lc,vc(a.v,16))}k.tc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.pa,this.eb]);a.set(2,Ec(this.v));return a.data()}; -k.restore=function(a){var b=a[1];this.pa=b[1];td(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.N>>14&3;a.A!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.A]);a.N=b;a.K|=2}function Q(a,b){a.K&128||(a.Z=a.aa=b,a.U=0)}function Hd(a,b,c){a.K&128||(a.Z=a.aa=a.T=b,a.U=c||0)}function Id(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^b)&(d^b))} -function be(a,b){a.K&128||(a.Z=a.aa=a.T=b,a.U=a.Z^a.T>>1)}function ce(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.ta=function(a,b,c){if(!this.M){0>this.xa?this.xa=Tc(this):this.A||(a=4,this.Ha|=4,this.u[6]=4);this.Hb=a;this.A=this.S=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);Uc(this,e&-12289|this.xa>>2&12288);de(this,this.xa);de(this,this.u[7]);O(this,d);this.K&=~(b|18);this.K|=1;this.xa=-1;this.K|=8;this.jd=a;this.Zc=c;if(-3!=c)throw a;}}; -function ee(a){var b=fe(a),c=fe(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Uc(a,c);a.K&=-17}function Dc(a,b){var c=b>>13&31;31>c&&a.pb&32&&(b=a.Mb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function ge(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.pb&a.Xc[a.A]||(d&=7);e=a.V[a.A][d];f=(a.ya[a.A][d]<<6)+(b&8191)&a.Ub;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.A][d]=e;if(4194170!==f||a.A)a.Za=a.A,a.kb=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.J&57344||(a.J=a.J|g|a.Za<<5|a.kb<<1), -b=!0),a.J&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.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(Fd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Fd(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.S=a.S<<8|f<<3&248|c;6==c&&0>f&&ie(a,b,a.u[6]);return e}k.Tb=function(a){if(!this.Ua)return this.v.Tb(a);this.M++;a=he(this,ge(this,a,3));this.M--;return a};k.bb=function(a){if(!this.Ua)return this.v.bb(a);this.M++;a=this.Ec(ge(this,a,2));this.M--;return a};k.qb=function(a,b){this.Ua?(this.M++,a=ge(this,a,5),a&1&&this.b--,this.v.Ab(a,b),this.M--):this.v.qb(a,b)}; -k.Bb=function(a,b){this.Ua?(this.M++,this.Lc(ge(this,a,4),b),this.M--):this.v.Bb(a,b)};k.Uc=function(a,b,c){return je(this,a,b,c)};k.Vc=function(a,b,c){return ge(this,je(this,a,b,c),c)};k.Ec=function(a){return this.v.na(a)};k.Zd=function(a){return this.v.na(ge(this,a,2))};k.Lc=function(a,b){this.v.gb(a,b&65535)};k.Re=function(a,b){this.v.gb(ge(this,a,4),b)}; -function ke(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=je(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.A=a.N>>12&3,c=a.ra(d|c&a.R),a.A=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function le(a,b,c,d){a.S=22;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=je(a,b,e,4),c&65536||(e&=65535),a.A=a.N>>12&3,e=ge(a,e|c&65536,4),a.A=a.N>>14&3,a.v.gb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d} -function me(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?he(a,a.ba(b,c,3)):-c-1}function ne(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.ba(b,d,2)):c=-d-1;return c}function oe(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return je(a,b,c,8)}function pe(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?he(a,a.ba(b,c,3)):a.u[c]&255}function qe(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.ba(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.tb=a.ba(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,he(a,e)),e&1&&a.b--,a.v.Ab(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.ba(b,e,6),a.v.gb(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 re(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Ab(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 se(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,d,4),a.v.gb(d,0>c?a.u[-c-1]:c)):a.u[d]=0>c?a.u[-c-1]:c&65535;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.ib=function(a){this.w.complete=!0;var b=this.i&&te(this.i)?1:this.w.Xb?-1:0,c=a?this.w.Xb?0:1:-1;this.w.Xb=!1;this.ka=this.b=a;do{if(b){if(this.i&&ue(this.i,this.u[7],c)){this.fa();break}c||c++;b++}if(this.K){if(a=this.K&7){a=!1;if(this.K&2){this.K&=-3;var d=160,e=(this.jc&224)>>5,f=this.O&&this.O.xb>e?this.O:null;f&&(d=f.de,e=f.xb);e>(this.N&224)>>5?(this.K&4&&(Fd(this,2),this.K&=-5),this.ta(d,0,-3),e=!0):e=!1;if(e){if(f)if(a=f,f=this.O,f==a)this.O=a.next;else for(;f;){e=f.next;if(e==a){f.next= -e.next;break}f=e}a=!0}}else this.K&1&&this.K++;a=a&&0>c}if(a)break;if(this.K&112&&Gd(this)&&0>c)break}this.K=this.K&7|this.N&16;this.decode(Ed(this))}while(0>1|b<<16;be(this,a);return a&65535}function Ae(a,b){a=b&128|b>>1|b<<8;be(this,a<<8);return a&255}function Be(a,b){a=b&~a;Q(this,a);return a}function Ce(a,b){a=b&~a;Q(this,a<<8);return a}function De(a,b){a|=b;Q(this,a);return a}function Ee(a,b){a|=b;Q(this,a<<8);return a}function Fe(a,b){a=~b|65536;Hd(this,a);return a&65535} -function Ge(a,b){a=~b|256;Hd(this,a<<8);return a&255}function He(a,b){a=b-a;this.K&128||(this.Z=this.aa=a,this.U=b&(b^a));return a&65535}function Ie(a,b){a=b-a;var c=a<<8;b<<=8;this.K&128||(this.Z=this.aa=c,this.U=b&(b^c));return a&255}function Je(a,b){a=b+a;this.K&128||(this.Z=this.aa=a,this.U=a&(b^a));return a&65535}function Ke(a,b){a=b+a;var c=a<<8;this.K&128||(this.Z=this.aa=c,this.U=c&(b<<8^c));return a&255}function Le(a,b){a=-b;Hd(this,a,a&b&32768);return a&65535} -function Me(a,b){a=-b;Hd(this,a<<8,(a&b&128)<<8);return a&255}function Ne(a,b){a=b<<1|this.T>>16&1;be(this,a);return a&65535}function Oe(a,b){a=b<<1|this.T>>16&1;be(this,a<<8);return a&255}function Pe(a,b){a=(this.T&65536|b)>>1|b<<16;be(this,a);return a&65535}function Qe(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;be(this,a<<8);return a&255}function Re(a,b){var c=b-a;ce(this,c,a,b);return c&65535}function Se(a,b){var c=b-a;ce(this,c<<8,a<<8,b<<8);return c&255} -function Te(a,b){this.K&128||(this.Z=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ue(a,b){a^=b;Q(this,a);return a&65535}function Ve(a){S(this,a,ne(this,a),ve);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function We(a){var b=qe(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.aa=c;this.b-=(this.g?6:7)+b} -function Xe(a){var b=qe(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.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Ye(a){T(this,a,!Bd(this))}function Ze(a){T(this,a,Bd(this))} -function $e(a){S(this,a,ne(this,a),Be);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function af(a){R(this,a,me(this,a),Ce);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function bf(a){S(this,a,ne(this,a),De);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function cf(a){R(this,a,me(this,a),Ee);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function df(a){var b=ne(this,a);a=qe(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 ef(a){var b=me(this,a);a=pe(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 ff(a){T(this,a,Dd(this))}function gf(a){T(this,a,!this.Ta()==!Cd(this))}function hf(a){T(this,a,!Dd(this)&&!this.Ta()==!Cd(this))}function jf(a){T(this,a,!Bd(this)&&!Dd(this))} -function kf(a){T(this,a,Dd(this)||!this.Ta()!=!Cd(this))}function lf(a){T(this,a,Bd(this)||Dd(this))}function mf(a){T(this,a,!this.Ta()!=!Cd(this))}function nf(a){T(this,a,this.Ta())}function of(a){T(this,a,!Dd(this))}function pf(a){T(this,a,!this.Ta())}function qf(){this.ta(12,0,-1);this.b-=5}function rf(a){T(this,a,!0)}function sf(a){T(this,a,!Cd(this))}function tf(a){T(this,a,Cd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.Z=0);this.b-=5} -function uf(a){var b=ne(this,a);a=qe(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ce(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 vf(a){var b=me(this,a);a=pe(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ce(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 wf(a){var b=qe(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.aa=d>>16|d,this.Z=d>>16):(this.U=32768,this.aa=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.aa=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function xf(){this.ta(24,0,-1);this.b-=25} -function yf(){this.N&49152?(this.Ha|=128,this.ta(4,0,-2)):(this.B&&this.B.setData(this.u[0],!0),this.i?zf(this.i):this.fa());this.b-=7}function Af(){this.ta(16,0,-1);this.b-=25}var Bf=[0,7,7,10,7,11,9,13];function Cf(a){this.I=this.b;O(this,oe(this,a));this.b=this.I-Bf[this.g]}var Df=[0,14,14,17,14,18,16,20];function Ef(a){this.I=this.b;var b=oe(this,a);a=a>>6&7;de(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Df[this.g]}var Ff=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function Gf(a){var b=ne(this,a);this.I=this.b;Q(this,se(this,a,b));this.b=this.I-Ff[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Hf(a){var b=me(this,a);Q(this,re(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 If=[7,13,13,17,14,18,17,21]; -function Jf(a){var b=qe(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.K&128||(this.Z=b>>16,this.aa=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 Pf(a){S(this,a,ne(this,a),Re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function Qf(a){S(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)}function Rf(){this.ta(28,0,-1);this.b-=5}function Sf(){this.B&&(this.B.kc(this.u[7],!0),this.B.setData(this.u[0],!0));this.K|=4;Fd(this,-2);this.b-=3}function Tf(a){S(this,a,ne(this,a),Ue);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=zf(b)):b=!1;b||this.ta(8,0,-1)}function yd(a){Uf[a>>12].call(this,a)}function Vf(a){Wf[a>>6&3].call(this,a)} -function Xf(a){Yf[a>>6&3].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a&15].call(this,a)}function cg(a){dg[a&15].call(this,a)}function eg(a){fg[a>>6&3].call(this,a)}function gg(a){hg[a>>6&3].call(this,a)}function ig(a){jg[a>>6&3].call(this,a)} -var Uf=[function(a){kg[a>>8&15].call(this,a)},Gf,uf,df,$e,bf,Ve,V,function(a){lg[a>>8&15].call(this,a)},Hf,vf,ef,af,cf,Pf,V],kg=[function(a){mg[a>>4&15].call(this,a)},rf,of,ff,gf,mf,hf,kf,Ef,Ef,Vf,Xf,Zf,V,V,V],Wf=[function(a){Hd(this,se(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,He);this.b-=this.g?9:3+(7==this.f?2:0)}],Yf=[function(a){S(this,a,0, -Le);this.b-=this.g?11:6},function(a){S(this,a,Bd(this)?1:0,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Bd(this)?1:0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=qe(this,a);Hd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],$f=[function(a){S(this,a,0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,xe);this.b-=this.g?9:3+(7==this.f?2:0)}], -mg=[function(a){ng[a&15].call(this,a)},V,V,V,Cf,Cf,Cf,Cf,Nf,V,ag,cg,Qf,Qf,Qf,Qf],ng=[yf,Sf,Mf,qf,Af,Lf,V,V,V,V,V,V,V,V,V,V],bg=[Kf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],dg=[Kf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.aa=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],lg=[pf,nf,jf,lf,sf,tf,Ye,Ze,xf,Rf,eg,gg,ig,V,V,V],fg=[function(a){Hd(this, -re(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ie);this.b-=this.g?9:3+(7==this.f?2:0)}],hg=[function(a){R(this,a,0,Me);this.b-=this.g?11:6},function(a){R(this,a,Bd(this)?1:0,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Bd(this)?1:0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=pe(this,a);Hd(this,a<<8);this.b-=this.g?4:3+ -(7==this.f?2:0)}],jg=[function(a){R(this,a,0,Qe);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ae);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,ye);this.b-=this.g?9:3+(7==this.f?2:0)}];function zd(a){og[a>>12].call(this,a)} -var og=[function(a){pg[a>>8&15].call(this,a)},Gf,uf,df,$e,bf,Ve,function(a){qg[a>>8&15].call(this,a)},function(a){rg[a>>8&15].call(this,a)},Hf,vf,ef,af,cf,Pf,V],pg=[function(a){sg[a>>4&15].call(this,a)},rf,of,ff,gf,mf,hf,kf,Ef,Ef,Vf,Xf,Zf,function(a){tg[a>>6&3].call(this,a)},V,V],tg=[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=ke(this,a,0);de(this,a);Q(this,a);this.b-=11},function(a){var b=fe(this);this.I= -this.b;le(this,a,0,b);Q(this,b);this.b=this.I-If[this.g]},function(a){Q(this,se(this,a,this.Ta?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],sg=[function(a){ug[a&15].call(this,a)},V,V,V,Cf,Cf,Cf,Cf,Nf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.K|=1),this.b-=5):V.call(this,a)},ag,cg,Qf,Qf,Qf,Qf],ug=[yf,Sf,Mf,qf,Af,Lf,function(){ee(this);this.b-=13},function(){this.ta(8,0,-1)},V,V,V,V,V,V,V,V],qg=[Jf,Jf,wf,wf,We,We,Xe,Xe,Tf,Tf,V,V,V,V,Of,Of],rg=[pf,nf,jf,lf,sf,tf,Ye,Ze,xf,Rf, -eg,gg,ig,function(a){vg[a>>6&3].call(this,a)},V,V],vg=[V,function(a){a=ke(this,a,65536);de(this,a);Q(this,a);this.b-=11},function(a){var b=fe(this);this.I=this.b;le(this,a,65536,b);Q(this,b);this.b=this.I-If[this.g]},V]; -function wg(a){t.call(this,"ROM",a,wg);this.ga=this.g=null;this.A=a.addr;this.f=a.size;this.D=!1;this.B=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.Qa,a,b),(a=Ea(a,b))?(c.g=a.da,c.ga=a.ga):c.C=null);xg(c)})}}z(wg);k=wg.prototype; -k.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;xg(this)};k.Ga=function(){this.ga&&(this.i&&Rg(this.i,this.id,this.A,this.f,this.ga),delete this.ga);return!0};k.Fa=function(){return!0}; -function xg(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.A;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+oc){var c={};b=(c[b]=[wg.prototype.Nd,wg.prototype.Fe,null,null,null,a.f>>1],c);if(Hb(a.v,a,b,256,a.Ya)){b=a.D=!0;break a}}else if(yc(a.v,b,a.f,ad)){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.fa():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.J&&(e.J-=32),e.f|=128,e.f&64&&Oc(e.b,e.ka))});this.X=Qc(52,4);this.ia=Nc(this.b,function(){e.g|=128;e.g&64&&Oc(e.b,e.X)});Hb(b,this,Xg);Jb(b,this.reset.bind(this));H(this)}; -k.xc=function(){if(!this.I){var a=nd(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Ya)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.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.xc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Fa=function(a){return a?this.save():!0};k.reset=function(){Yg(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return Yg(this)};function Yg(a){a.J=0;a.f=0;a.g=128;return!0}k.ic=function(a){if("number"==typeof a)this.H.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.D%a,this.R&&(b=wa("",c)));this.O&&!this.D&&c&&(b=String.fromCharCode(this.O)+b);this.B.value+=b;this.B.scrollTop=this.B.scrollHeight;this.D+=c}else if(null!=this.A){if(10==a||1024<=this.A.length)this.j(this.A), -this.A="";10!=a&&(this.A+=String.fromCharCode(a))}this.g&=-129;Pc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var Zg={},Xg=(Zg[65392]=[null,null,X.prototype.Hd,X.prototype.ze,"RCSR"],Zg[65394]=[null,null,X.prototype.Gd,X.prototype.ye,"RBUF"],Zg[65396]=[null,null,X.prototype.ae,X.prototype.Te,"XCSR"],Zg[65398]=[null,null,X.prototype.$d,X.prototype.Se,"XBUF"],Zg);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&&bh(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;bh(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; -k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=ch(a);var e=this;if((this.g=nd(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=Nc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Jc.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.Qa,e,f),(e=Ea(e,f))&&lh(a,b,c,d,e.da,e.La, -e.Ka));a.w.ab=!1;a.D&&(a.D--,a.D||H(a));ih(a)})}function fh(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.ua);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.ec?"":e)+"&format=json"));return!!Da(f, -null,!0,function(b,c,d){sh(a,b,c,d)})} -function sh(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.Xa+'" (error '+d+": "+b+")",f);else{qb(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(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.Aa=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Ma=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;fa.ca/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.sb()}dc(a,a.$);a.$=0;a.X=Aa();a.ia=0;ud(a);return d}function Nc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.nb*a.eb/1E3*c|0,a.w.W&&(c+=vd(a)),a.L[b][0]=c)} +function wd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function cc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function vd(a,b){var c=a.ka-=a.b;a.b=a.I=0;b&&(a.ka=0);return c} +k.be=function(){if(this.w.W){this.Gb>=this.nb&&ud(this,!0);this.Ra=0;this.lb=Aa();if(this.ia){var a=this.lb-this.ia;a>this.wc&&(this.X+=a,this.X>this.lb&&(this.X=this.lb))}try{do{var b=wd(this,this.w.ub?1:this.ob);try{this.ib(b)}catch(e){if("number"!=typeof e)throw e;}b=vd(this,!0);this.Ra+=b;this.$+=b;ec(this,b);cc(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.ob;15<=++this.yc&&(this.oa(),this.yc=0);break}}while(this.w.W)}catch(e){this.fa();this.C&&this.C.stop(Aa(),sd(this));yb(this,e.stack||e.message); +return}if(this.w.W){a=setTimeout;b=this.zc;this.ia=Aa();var c=this.wc;this.Ra&&(c=Math.round(c*this.Ra/this.ob));var c=c-(this.ia-this.lb),d=this.ia-this.X;d&&(this.ca=Math.round(this.$/(10*d))/100,864E5<=d&&(this.pa=0,td(this)));if(0>c||this.cac&&(this.X-=c),c=0;this.Gb+=this.Ra;this.ia+=c;a(b,c)}}}; +k.hb=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;td(this);this.w.W=!0;this.w.Xb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.sb(!0),this.C.start(this.X,sd(this)));setTimeout(this.zc,0);return!0};k.ib=function(){return 0};k.fa=function(a){var b=!1;if(this.w.W){vd(this);dc(this,this.$);this.$=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),sd(this));b=!0}this.w.complete=a;return b}; +function xd(a){this.cb=+a.model||1170;this.Tb=a.addrReset||0;ld.call(this,a,6666667);this.decode=1120==this.cb?yd.bind(this):zd.bind(this);Ad(this);this.M=0;this.O=null;this.w.complete=!1}z(xd,ld);k=xd.prototype;k.reset=function(){this.status("model "+this.cb);this.w.W&&this.fa();Ad(this);od(this);this.w.error=!1;this.parent.reset.call(this)}; +function Ad(a){a.T=65536;a.U=32768;a.aa=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Tb];a.Xa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.A=0;a.jb=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.Nb=[0,0,0,0,0,0,0,0,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.K=0;a.D=a.H=0;a.g=a.f=a.Eb=0;a.xa=-1;bc(a)}function bc(a){a.Wb=255;a.Ha=0;a.jc=0;a.J=0;a.Ac=0;a.Bc=0;a.qb=0;a.Va=0;a.kb=0;a.Ja=262143;a.S=0;a.Ib=0;a.O=null;a.v&&Sc(a)}function Sc(a){a.Va?(a.R=65536,a.ba=a.Vc,a.ra=a.Zd,a.Pb=a.Re,uc(a.v,a.qb&16?22:18)):(a.R=0,a.ba=a.Uc,a.ra=a.Ec,a.Pb=a.Lc,uc(a.v,16))}k.sc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.pa,this.eb]);a.set(2,Dc(this.v));return a.data()}; +k.restore=function(a){var b=a[1];this.pa=b[1];td(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.N>>14&3;a.A!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.A]);a.N=b;a.K|=2}function Q(a,b){a.K&128||(a.Z=a.aa=b,a.U=0)}function Hd(a,b,c){a.K&128||(a.Z=a.aa=a.T=b,a.U=c||0)}function Id(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^b)&(d^b))} +function de(a,b){a.K&128||(a.Z=a.aa=a.T=b,a.U=a.Z^a.T>>1)}function ee(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.ta=function(a,b,c){if(!this.M){0>this.xa?this.xa=Tc(this):this.A||(a=4,this.Ha|=4,this.u[6]=4,c=-3);this.Ib=a;this.A=this.S=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);Uc(this,e&-12289|this.xa>>2&12288);fe(this,this.xa);fe(this,this.u[7]);O(this,d);this.K&=~(b|18);this.K|=9;this.xa=-1;this.jd=a;this.Zc=c;if(-3<=c)throw a;}}; +function ge(a){var b=he(a),c=he(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Uc(a,c);a.K&=-17}function Cc(a,b){var c=b>>13&31;31>c&&a.qb&32&&(b=a.Nb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function ie(a,b,c){var d,e,f;if(!(c&a.Va))return b;d=b>>13;a.qb&a.Xc[a.A]||(d&=7);e=a.V[a.A][d];f=(a.ya[a.A][d]<<6)+(b&8191)&a.Ja;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.A][d]=e;if(f!=(4194170&a.Ja)||a.A)a.kb=a.A,a.jb=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.J&57344||(a.J=a.J|g|a.kb<<5|a.jb<< +1),b=!0),a.J&61440||!(f<(4191360&a.Ja)||f>(4194239&a.Ja))||(a.J|=4096,a.J&512&&(a.K|=64)),b&&a.ta(168,0,-1));return f}function je(a,b){return a.v.Hb(b)}function he(a){var b=a.ra(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function fe(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.S=a.S<<8|246;ke(a,0,c);a.Pb(c,b)}function ke(a,b,c){!a.A&&c<=a.Wb&&(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(Fd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Fd(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.S=a.S<<8|f<<3&248|c;6==c&&0>f&&ke(a,b,a.u[6]);return e}k.Ub=function(a){if(!this.Va)return this.v.Ub(a);this.M++;a=je(this,ie(this,a,3));this.M--;return a};k.bb=function(a){if(!this.Va)return this.v.bb(a);this.M++;a=this.Ec(ie(this,a,2));this.M--;return a};k.rb=function(a,b){this.Va?(this.M++,a=ie(this,a,5),a&1&&this.b--,this.v.Ab(a,b),this.M--):this.v.rb(a,b)}; +k.Bb=function(a,b){this.Va?(this.M++,this.Lc(ie(this,a,4),b),this.M--):this.v.Bb(a,b)};k.Uc=function(a,b,c){return le(this,a,b,c)};k.Vc=function(a,b,c){return ie(this,le(this,a,b,c),c)};k.Ec=function(a){return this.v.na(a)};k.Zd=function(a){return this.v.na(ie(this,a,2))};k.Lc=function(a,b){this.v.gb(a,b&65535)};k.Re=function(a,b){this.v.gb(ie(this,a,4),b)}; +function me(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=le(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.A=a.N>>12&3,c=a.ra(d|c&a.R),a.A=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function ne(a,b,c,d){a.S=22;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=le(a,b,e,4),c&65536||(e&=65535),a.A=a.N>>12&3,e=ie(a,e|c&65536,4),a.A=a.N>>14&3,a.v.gb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d} +function oe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?je(a,a.ba(b,c,3)):-c-1}function pe(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.ba(b,d,2)):c=-d-1;return c}function qe(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return le(a,b,c,8)}function re(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?je(a,a.ba(b,c,3)):a.u[c]&255}function se(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.ba(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.Eb=a.ba(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,je(a,e)),e&1&&a.b--,a.v.Ab(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.ba(b,e,6),a.v.gb(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 te(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Ab(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 ue(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,d,4),a.v.gb(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.ib=function(a){this.w.complete=!0;var b=this.i&&ve(this.i)?1:this.w.Xb?-1:0,c=a?this.w.Xb?0:1:-1;this.w.Xb=!1;this.ka=this.b=a;do{if(b){if(this.i&&we(this.i,this.u[7],c)){this.fa();break}c||c++;b++}if(this.K){if(a=this.K&7){a=!1;if(this.K&2){this.K&=-3;var d=160,e=(this.jc&224)>>5,f=this.O&&this.O.xb>e?this.O:null;f&&(d=f.de,e=f.xb);e>(this.N&224)>>5?(this.K&4&&(Fd(this,2),this.K&=-5),this.ta(d,0,-9),e=!0):e=!1;if(e){if(f)if(a=f,f=this.O,f==a)this.O=a.next;else for(;f;){e=f.next;if(e==a){f.next= +e.next;break}f=e}a=!0}}else this.K&1&&this.K++;a=a&&0>c}if(a)break;if(this.K&112&&Gd(this)&&0>c)break}this.K=this.K&7|this.N&16;this.decode(Ed(this))}while(0>1|b<<16;de(this,a);return a&65535}function Ce(a,b){a=b&128|b>>1|b<<8;de(this,a<<8);return a&255}function De(a,b){a=b&~a;Q(this,a);return a}function Ee(a,b){a=b&~a;Q(this,a<<8);return a}function Fe(a,b){a|=b;Q(this,a);return a}function Ge(a,b){a|=b;Q(this,a<<8);return a}function He(a,b){a=~b|65536;Hd(this,a);return a&65535} +function Ie(a,b){a=~b|256;Hd(this,a<<8);return a&255}function Je(a,b){a=b-a;this.K&128||(this.Z=this.aa=a,this.U=b&(b^a));return a&65535}function Ke(a,b){a=b-a;var c=a<<8;b<<=8;this.K&128||(this.Z=this.aa=c,this.U=b&(b^c));return a&255}function Le(a,b){a=b+a;this.K&128||(this.Z=this.aa=a,this.U=a&(b^a));return a&65535}function Me(a,b){a=b+a;var c=a<<8;this.K&128||(this.Z=this.aa=c,this.U=c&(b<<8^c));return a&255}function Ne(a,b){a=-b;Hd(this,a,a&b&32768);return a&65535} +function Oe(a,b){a=-b;Hd(this,a<<8,(a&b&128)<<8);return a&255}function Pe(a,b){a=b<<1|this.T>>16&1;de(this,a);return a&65535}function Qe(a,b){a=b<<1|this.T>>16&1;de(this,a<<8);return a&255}function Re(a,b){a=(this.T&65536|b)>>1|b<<16;de(this,a);return a&65535}function Se(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;de(this,a<<8);return a&255}function Te(a,b){var c=b-a;ee(this,c,a,b);return c&65535}function Ue(a,b){var c=b-a;ee(this,c<<8,a<<8,b<<8);return c&255} +function Ve(a,b){this.K&128||(this.Z=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function We(a,b){a^=b;Q(this,a);return a&65535}function Xe(a){S(this,a,pe(this,a),xe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Ye(a){var b=se(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.aa=c;this.b-=(this.g?6:7)+b} +function Ze(a){var b=se(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.aa=d>>16|d;this.b-=(this.g?6:7)+b}function $e(a){T(this,a,!Bd(this))}function af(a){T(this,a,Bd(this))} +function bf(a){S(this,a,pe(this,a),De);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function cf(a){R(this,a,oe(this,a),Ee);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function df(a){S(this,a,pe(this,a),Fe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ef(a){R(this,a,oe(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){var b=pe(this,a);a=se(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 gf(a){var b=oe(this,a);a=re(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 hf(a){T(this,a,Dd(this))}function jf(a){T(this,a,!this.Ua()==!Cd(this))}function kf(a){T(this,a,!Dd(this)&&!this.Ua()==!Cd(this))}function lf(a){T(this,a,!Bd(this)&&!Dd(this))} +function mf(a){T(this,a,Dd(this)||!this.Ua()!=!Cd(this))}function nf(a){T(this,a,Bd(this)||Dd(this))}function of(a){T(this,a,!this.Ua()!=!Cd(this))}function pf(a){T(this,a,this.Ua())}function qf(a){T(this,a,!Dd(this))}function rf(a){T(this,a,!this.Ua())}function sf(){this.ta(12,0,-8);this.b-=5}function tf(a){T(this,a,!0)}function uf(a){T(this,a,!Cd(this))}function vf(a){T(this,a,Cd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.Z=0);this.b-=5} +function wf(a){var b=pe(this,a);a=se(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ee(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 xf(a){var b=oe(this,a);a=re(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ee(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 yf(a){var b=se(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.aa=d>>16|d,this.Z=d>>16):(this.U=32768,this.aa=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.aa=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function zf(){this.ta(24,0,-8);this.b-=25} +function Af(){this.N&49152?(this.Ha|=128,this.ta(4,0,-7)):(this.B&&this.B.setData(this.u[0],!0),this.i?Bf(this.i):this.fa());this.b-=7}function Cf(){this.ta(16,0,-8);this.b-=25}var Df=[0,7,7,10,7,11,9,13];function Ef(a){this.I=this.b;O(this,qe(this,a));this.b=this.I-Df[this.g]}var Ff=[0,14,14,17,14,18,16,20];function Gf(a){this.I=this.b;var b=qe(this,a);a=a>>6&7;fe(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Ff[this.g]}var Hf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function If(a){var b=pe(this,a);this.I=this.b;Q(this,ue(this,a,b));this.b=this.I-Hf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Jf(a){var b=oe(this,a);Q(this,te(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 Kf=[7,13,13,17,14,18,17,21]; +function Lf(a){var b=se(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.K&128||(this.Z=b>>16,this.aa=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 Rf(a){S(this,a,pe(this,a),Te);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Sf(a){S(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)}function Tf(){this.ta(28,0,-8);this.b-=5}function Uf(){this.B&&(this.B.kc(this.u[7],!0),this.B.setData(this.u[0],!0));this.K|=4;Fd(this,-2);this.b-=3}function Vf(a){S(this,a,pe(this,a),We);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=Bf(b)):b=!1;b||this.ta(8,0,-8)}function yd(a){Wf[a>>12].call(this,a)}function Xf(a){Yf[a>>6&3].call(this,a)} +function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a&15].call(this,a)}function eg(a){fg[a&15].call(this,a)}function gg(a){hg[a>>6&3].call(this,a)}function ig(a){jg[a>>6&3].call(this,a)}function kg(a){lg[a>>6&3].call(this,a)} +var Wf=[function(a){mg[a>>8&15].call(this,a)},If,wf,ff,bf,df,Xe,V,function(a){ng[a>>8&15].call(this,a)},Jf,xf,gf,cf,ef,Rf,V],mg=[function(a){og[a>>4&15].call(this,a)},tf,qf,hf,jf,of,kf,mf,Gf,Gf,Xf,Zf,ag,V,V,V],Yf=[function(a){Hd(this,ue(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Je);this.b-=this.g?9:3+(7==this.f?2:0)}],$f=[function(a){S(this,a,0, +Ne);this.b-=this.g?11:6},function(a){S(this,a,Bd(this)?1:0,xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Bd(this)?1:0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=se(this,a);Hd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],bg=[function(a){S(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ze);this.b-=this.g?9:3+(7==this.f?2:0)}], +og=[function(a){pg[a&15].call(this,a)},V,V,V,Ef,Ef,Ef,Ef,Pf,V,cg,eg,Sf,Sf,Sf,Sf],pg=[Af,Uf,Of,sf,Cf,Nf,V,V,V,V,V,V,V,V,V,V],dg=[Mf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],fg=[Mf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.aa=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],ng=[rf,pf,lf,nf,uf,vf,$e,af,zf,Tf,gg,ig,kg,V,V,V],hg=[function(a){Hd(this, +te(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ke);this.b-=this.g?9:3+(7==this.f?2:0)}],jg=[function(a){R(this,a,0,Oe);this.b-=this.g?11:6},function(a){R(this,a,Bd(this)?1:0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Bd(this)?1:0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=re(this,a);Hd(this,a<<8);this.b-=this.g?4:3+ +(7==this.f?2:0)}],lg=[function(a){R(this,a,0,Se);this.b-=this.g?9+(this.Eb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ce);this.b-=this.g?9+(this.Eb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)}];function zd(a){qg[a>>12].call(this,a)} +var qg=[function(a){rg[a>>8&15].call(this,a)},If,wf,ff,bf,df,Xe,function(a){sg[a>>8&15].call(this,a)},function(a){tg[a>>8&15].call(this,a)},Jf,xf,gf,cf,ef,Rf,V],rg=[function(a){ug[a>>4&15].call(this,a)},tf,qf,hf,jf,of,kf,mf,Gf,Gf,Xf,Zf,ag,function(a){vg[a>>6&3].call(this,a)},V,V],vg=[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=me(this,a,0);fe(this,a);Q(this,a);this.b-=11},function(a){var b=he(this);this.I= +this.b;ne(this,a,0,b);Q(this,b);this.b=this.I-Kf[this.g]},function(a){Q(this,ue(this,a,this.Ua?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],ug=[function(a){wg[a&15].call(this,a)},V,V,V,Ef,Ef,Ef,Ef,Pf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.K|=1),this.b-=5):V.call(this,a)},cg,eg,Sf,Sf,Sf,Sf],wg=[Af,Uf,Of,sf,Cf,Nf,function(){ge(this);this.b-=13},function(){this.ta(8,0,-8)},V,V,V,V,V,V,V,V],sg=[Lf,Lf,yf,yf,Ye,Ye,Ze,Ze,Vf,Vf,V,V,V,V,Qf,Qf],tg=[rf,pf,lf,nf,uf,vf,$e,af,zf,Tf, +gg,ig,kg,function(a){xg[a>>6&3].call(this,a)},V,V],xg=[V,function(a){a=me(this,a,65536);fe(this,a);Q(this,a);this.b-=11},function(a){var b=he(this);this.I=this.b;ne(this,a,65536,b);Q(this,b);this.b=this.I-Kf[this.g]},V]; +function yg(a){t.call(this,"ROM",a,yg);this.ga=this.g=null;this.A=a.addr;this.f=a.size;this.D=!1;this.B=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.Qa,a,b),(a=Ea(a,b))?(c.g=a.da,c.ga=a.ga):c.C=null);zg(c)})}}z(yg);k=yg.prototype; +k.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;zg(this)};k.Ga=function(){this.ga&&(this.i&&Sg(this.i,this.id,this.A,this.f,this.ga),delete this.ga);return!0};k.Fa=function(){return!0}; +function zg(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.A;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[yg.prototype.Nd,yg.prototype.Fe,null,null,null,a.f>>1],c);if(Hb(a.v,a,b,256,a.Za)){b=a.D=!0;break a}}else if(xc(a.v,b,a.f,ad)){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.rb(n++,b[v++]&255);else n&1?a.b.fa():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.J&&(e.J-=32),e.f|=128,e.f&64&&Oc(e.b,e.ka))});this.X=Qc(52,4);this.ia=Nc(this.b,function(){e.g|=128;e.g&64&&Oc(e.b,e.X)});Hb(b,this,Yg);Jb(b,this.reset.bind(this));H(this)}; +k.xc=function(){if(!this.I){var a=nd(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.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.xc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.Fa=function(a){return a?this.save():!0};k.reset=function(){Zg(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return Zg(this)};function Zg(a){a.J=0;a.f=0;a.g=128;a.A=[];return!0}k.ic=function(a){if("number"==typeof a)this.A.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.R||8,c=a-this.H%a,this.R&&(b=wa("",c)));this.O&&!this.H&&c&&(b=String.fromCharCode(this.O)+b);this.B.value+=b;this.B.scrollTop=this.B.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 $g={},Yg=($g[65392]=[null,null,X.prototype.Hd,X.prototype.ze,"RCSR"],$g[65394]=[null,null,X.prototype.Gd,X.prototype.ye,"RBUF"],$g[65396]=[null,null,X.prototype.ae,X.prototype.Te,"XCSR"],$g[65398]=[null,null,X.prototype.$d,X.prototype.Se,"XBUF"],$g);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&&ch(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;ch(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; +k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=dh(a);var e=this;if((this.g=nd(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=Nc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Jc.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.Qa,e,f),(e=Ea(e,f))&&mh(a,b,c,d,e.da,e.La, +e.Ka));a.w.ab=!1;a.D&&(a.D--,a.D||H(a));jh(a)})}function gh(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.ua);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.ec?"":e)+"&format=json"));return!!Da(f, +null,!0,function(b,c,d){th(a,b,c,d)})} +function th(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.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(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.Aa=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Ma=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.Ba?f=a.Pa+a.Ba&&(a.Ba+=f-(a.Pa+a.Ba)+1):(a.Pa=f,a.Ba=1);d[f]=d[f]&~(255<g)break;e|=g<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.Xa+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=uh(this,a++);)wh(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 wh(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.B=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=pa(c.value,10);null!=a&&xh(d,a)},!0;case "loadDrive":return this.G[b]= -c,c.onclick=function(){var a=d.G.listDisks;a&&yh(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[pa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=uh(a,c++);)for(var l=0,m=h.length;l=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=vh(this,a++);)xh(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 xh(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.B=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=pa(c.value,10);null!=a&&yh(d,a)},!0;case "loadDrive":return this.G[b]= +c,c.onclick=function(){var a=d.G.listDisks;a&&zh(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[pa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=vh(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";xh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){zh(this)};k.save=function(){return(new N(this)).data()}; -k.restore=function(a){return zh(this,a[0])};function Ch(a,b){b||(a.H=0);if(a.B)for(var c in a.B){var d=a.B[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+'"')}Eh(a,e,b,c,!1,d)}else Dh(a,e)} -function Eh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.fb.toLowerCase()!=d.toLowerCase()&&(g++,Dh(a,b,!0),h.dc?a.P("RL11 busy"):(h.dc=!0,e&&(h.cc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Pb=!!f,rh(new nh(a,h,"preload"),c,d,f,a.Rc)&&g++));return g} -k.Rc=function(a,b,c,d,e){var f;a.dc=!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.ua||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.fc)),b=null);b?(a.Ca=b,a.Xa=c,a.fb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.fc),a.cc||e),this.C&&this.C.rb()):a.Pb=!1;a.cc&&(a.cc=!1,--this.H||H(this));xh(this,a.fc)}; -function Bh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;eb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";yh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){Ah(this)};k.save=function(){return(new N(this)).data()}; +k.restore=function(a){return Ah(this,a[0])};function Dh(a,b){b||(a.H=0);if(a.B)for(var c in a.B){var d=a.B[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+'"')}Fh(a,e,b,c,!1,d)}else Eh(a,e)} +function Fh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.fb.toLowerCase()!=d.toLowerCase()&&(g++,Eh(a,b,!0),h.dc?a.P("RL11 busy"):(h.dc=!0,e&&(h.cc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,sh(new oh(a,h,"preload"),c,d,f,a.Rc)&&g++));return g} +k.Rc=function(a,b,c,d,e){var f;a.dc=!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.ua||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.fc)),b=null);b?(a.Ca=b,a.Ya=c,a.fb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.fc),a.cc||e),this.C&&this.C.sb()):a.Qb=!1;a.cc&&(a.cc=!1,--this.H||H(this));yh(this,a.fc)}; +function Ch(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.J=f>>16&63;this.A=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.ea=this.ea|a|32768);return!0}; k.nd=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.v.gb(f,v|r<<8);if(Mc(this.v)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){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.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Mc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Kd=function(){return this.ea&65535}; k.Ce=function(a){this.ea=this.ea&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.ea&128)){var b;a=!0;var c=this.f[(this.ea&768)>>8],d,e,f,g;this.ea&=-2;switch(this.ea&14){case 4:this.g&8&&(this.ea&=63);this.D=c.status|this.A&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.A=this.g&4?this.A+b:this.A-b,this.g=this.A=this.A&65408|c);break;case 8:this.D=this.A;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.ua||f>=c.qa?this.ea|=37888: (g=(this.J&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Sc.bind(this)))}a&&(this.ea|=129,this.ea&64&&Oc(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.J};k.Be=function(a){this.J=a&63}; -var Fh={},Ah=(Fh[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Fh[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Fh[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Fh[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Fh[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Fh);function Gh(a){t.call(this,"Debugger",a,Gh);this.ca=a.base||16;this.xa=!1;this.J=0;this.R=!1;this.A=-1;this.g=[];this.X={}}z(Gh); -var Hh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Gh.prototype.uc=function(){return-1};Gh.prototype.vc=function(){}; -function Ih(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.R?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a} -function Jh(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; +var Gh={},Bh=(Gh[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Gh[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Gh[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Gh[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Gh[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Gh);function Hh(a){t.call(this,"Debugger",a,Hh);this.ca=a.base||16;this.xa=!1;this.J=0;this.R=!1;this.A=-1;this.g=[];this.X={}}z(Hh); +var Ih={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Hh.prototype.tc=function(){return-1};Hh.prototype.uc=function(){}; +function Jh(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.R?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a} +function Kh(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 Kh(a,b,c){var d;if(b){b=Lh(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 Oh(a,b){if(b)return Nh(a,b,a.X[b]);var c=0;for(b in a.X)Nh(a,b,a.X[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);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 Ph(a,b){if(b)return Oh(a,b,a.X[b]);var c=0;for(b in a.X)Oh(a,b,a.X[b]),c++;return 0this.b.cb?Xh:[];Yh(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Zh(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<this.b.cb?Yh:[];Zh(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.ba($h(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.vc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Wa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Tc(this.b):21==a&&this.B&&lc(this.B)&&(b=this.B.Va));return b}; -k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Hb).F));this.ma&1073741824?this.va.push(a):this.ia&&a==this.ia||(this.ia=a,this.ma&-2147483648&&this.b&&this.b.w.W&&(this.fa(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,vd(a),a.wa=0,a.oa()))};function Rh(a){var b;if(!te(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=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?fi(a):gi(a)}}function ei(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.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Rh(this);this.wa=0;this.ia=null;this.J=0;this.L=Y(this.b.u[7]);this.w.W=!1;hi(this);a||qd(this)};k.save=function(){var a=new N(this);a.set(0,ai(this.L));a.set(1,ai(this.O));a.set(2,[this.g,this.R,this.ma]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=bi(a[b++]),this.O=bi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ma|=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.Fb=a;this.Rb=b}; -k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.J=b-this.Rb;if(!this.S){b="stopped";if(this.J){a-=this.Fb;var c=0d&&(d=a.b.bb(b)),65535!=(d&65535)&&(a.kc(a.H[a.$],b),++a.$==a.H.length&&(a.$=0)));return!1}function zf(a){var b=a.b;if(b.w.W)throw O(b,a.b.Hb),a.fa(),-1;return!1} -function Qh(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.lb=0}k.mb=function(a,b,c){var d=!0;c||ii(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].mb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(ji(this,a,a.length-1,"set"),Rh(this)));return d}; -function ii(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ja],b==a.D));h.Oa||Rh(a);break}}return f}function ki(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=di(y);break;case 8:x="@"+di(y);break;case 16:7>y?x="("+di(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+di(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+di(y)+")";break;case 40:x="@-("+di(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+di(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+di(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=di(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Wa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Tc(d)):21==b&&a.B&&lc(a.B)&&(c="SW="+J(a,a.B.Va,3));c&&(c+=" ");return c}function pi(a){var b,c="";for(b=0;6>b;b++)c+=oi(a,b);c=c+"\n"+(oi(a,6)+oi(a,7));c+=oi(a,20)+oi(a,21);return c+=ni(a,"T")+ni(a,"N")+ni(a,"Z")+ni(a,"V")+ni(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 qi(a,b,c){var d=[],e=a.ba(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.oa();a.j("updated registers:")}a.j(pi(a));c&&(a.L=Y(d.u[7]),gi(a,J(a,a.L.F)))}}function ui(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=mi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} -function li(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"ma.length&&(a.j("note: only "+ma.length+" available"),Z=ma.length);fa-=Z;0>fa&&(null==ma[ma.length-1].F?(Z=fa+Z,fa=0):fa+=ma.length);var Ld=[];"call"==Dg&&(Ob=1E5,Ld=["CALL"]);for(void 0!==Cg&&a.j(Z+" instructions earlier:");0=ma.length&&(fa=0);a.nb=Z;Fg++;Ob--}}Fg||(a.j("no "+Eg+"history available"),a.nb=void 0)}else{var kb=Zh(a,la);if(kb){var Qb=0,Md=!1,Nd="ds"==La;Ma&&(Md=!0,"l"==Ma.charAt(0)&&(Md=!1,Ma=Ma.substr(1)||Oi),Qb=Mh(a,Ma)>>>0,65536Gc?String.fromCharCode(Gc):"."}Na&&(Na+="\n");Na=Nd?Na+(Oa+","):Na+(la+" "+Oa+(0==Rb?" "+Ig:""))}Na&&a.j(Na);a.kb=kb}}}}break;case "e":if("else"==g[0])break;var nb,Pd,Qd,Rd,Sd=g[0],Td=g[1];"eb"==Sd?(nb=1,Pd=255,Qd=a.Gb,Rd=a.Ab):"e"==Sd||"ew"==Sd?(nb=2,Pd=65535,Qd=a.na,Rd=a.gb):Td=null;if(null==Td)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 Hc=Zh(a,Td);if(Hc)for(var Ic=2;IcWd;){for(var Pa=null,Ti=256;65536>Wb.F>>>0;){Xd.F=a.na(Wb,2);if(null==Wb.F||!Ti--)break; -if(!(Xd.F&1)){for(var Ui=a,Jc=Xd,Kg=null,Xb=Jc.F,Lg=Xb,Yd=1;6>=Yd&&Xb;Yd++){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;bzi){if(Bi(d,this.I)){this.A=new N(this,"1.30.3","failsafe");Bi(this.A)&&(Gi(this,d),a=2,Hi(this.A));this.A.set("timestamp",Ba());Ii(this.A);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=Fi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Bi(d,g):("error"== -f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Qa("user",""),this.g=null)):this.j(f+": "+g),Hi(d),Bi(d)?(c=Fi(d),e=!0):c=!1))}e&&Ei(this,c?d:null)}else 2==a&&d.clear()}else Ei(this);delete this.I;delete this.J}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&&(Ji(this,this.b,b,c,a),this.oa(),this.b.sb());this.O&&(Gi(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.C=0}; -function Gi(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.$;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} -function wi(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.Fa&&(c&&a.b.fa(),d=a.b.Fa(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;ld&&(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.Ia[a-16]:20==a?b=Tc(this.b):21==a&&this.B&&kc(this.B)&&(b=this.B.Wa));return b}; +k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Ib).F));if(this.ma&1073741824)this.va.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ma&-2147483648&&this.b&&this.b.w.W||vb(this,!0))this.fa(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,vd(a),a.wa=0,a.oa())}}; +function Sh(a){var b;if(!ve(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=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?gi(a):hi(a)}}function fi(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.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Sh(this);this.wa=0;this.ia=null;this.J=0;this.L=Y(this.b.u[7]);this.w.W=!1;ii(this);a||qd(this)};k.save=function(){var a=new N(this);a.set(0,bi(this.L));a.set(1,bi(this.O));a.set(2,[this.g,this.R,this.ma]);a.set(3,this.I);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=ci(a[b++]),this.O=ci(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ma|=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.Fb=a;this.Gb=b}; +k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.J=b-this.Gb;if(!this.S){b="stopped";if(this.J){a-=this.Fb;var c=0d&&(d=a.b.bb(b)),65535!=(d&65535)&&(a.kc(a.H[a.$],b),++a.$==a.H.length&&(a.$=0)));return!1}function Bf(a){var b=a.b;if(b.w.W)throw O(b,a.b.Ib),a.fa(),-1;return!1} +function Rh(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.lb=0}k.mb=function(a,b,c){var d=!0;c||ji(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].mb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(ki(this,a,a.length-1,"set"),Sh(this)));return d}; +function ji(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ja],b==a.D));h.Oa||Sh(a);break}}return f}function li(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=ei(y);break;case 8:x="@"+ei(y);break;case 16:7>y?x="("+ei(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+ei(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+ei(y)+")";break;case 40:x="@-("+ei(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+ei(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+ei(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=ei(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.Ia[b-16]):20==b?c="PS="+J(a,Tc(d)):21==b&&a.B&&kc(a.B)&&(c="SW="+J(a,a.B.Wa,3));c&&(c+=" ");return c}function qi(a){var b,c="";for(b=0;6>b;b++)c+=pi(a,b);c=c+"\n"+(pi(a,6)+pi(a,7));c+=pi(a,20)+pi(a,21);return c+=oi(a,"T")+oi(a,"N")+oi(a,"Z")+oi(a,"V")+oi(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 ri(a,b,c){var d=[],e=a.ba(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.oa();a.j("updated registers:")}a.j(qi(a));c&&(a.L=Y(d.u[7]),hi(a,J(a,a.L.F)))}}function vi(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=ni(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} +function mi(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"ma.length&&(a.j("note: only "+ma.length+" available"),Z=ma.length);fa-=Z;0>fa&&(null==ma[ma.length-1].F?(Z=fa+Z,fa=0):fa+=ma.length);var Ld=[];"call"==Fg&&(Pb=1E5,Ld=["CALL"]);for(void 0!==Eg&&a.j(Z+" instructions earlier:");0=ma.length&&(fa=0);a.nb=Z;Hg++;Pb--}}Hg||(a.j("no "+Gg+"history available"),a.nb=void 0)}else{var kb=$h(a,la);if(kb){var Rb=0,Md=!1,Nd="ds"==La;Ma&&(Md=!0,"l"==Ma.charAt(0)&&(Md=!1,Ma=Ma.substr(1)||Pi),Rb=Nh(a,Ma)>>>0,65536Qd?String.fromCharCode(Qd):"."),Gc=Gc>>8}Na&&(Na+="\n");Na=Nd?Na+(Oa+","):Na+(la+" "+Oa+(0==Fc?" "+Pd:""))}Na&&a.j(Na);a.kb=kb}}}}break;case "e":if("else"==g[0])break;var nb,Rd,Sd,Td,Ud=g[0],Vd=g[1];"eb"==Ud?(nb=1,Rd=255,Sd=a.Hb,Td=a.Ab):"e"==Ud||"ew"==Ud?(nb=2,Rd=65535,Sd=a.na,Td=a.gb):Vd=null;if(null==Vd)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 Hc=$h(a,Vd);if(Hc)for(var Ic=2;IcYd;){for(var Pa=null,Ui=256;65536> +Wb.F>>>0;){Zd.F=a.na(Wb,2);if(null==Wb.F||!Ui--)break;if(!(Zd.F&1)){for(var Vi=a,Jc=Zd,Lg=null,Xb=Jc.F,Mg=Xb,$d=1;6>=$d&&Xb;$d++){if(2<$d){Jc.F=Xb;var Kc=ni(Vi,Jc);if(0<=Kc.indexOf("JSR")){var Ng=Kc.indexOf(" ");if(Xb+(Kc.indexOf(" ",Ng+1)-Ng-1)/2==Mg){Lg=Kc;break}}}Xb-=2}Jc.F=Mg;if(Pa=Lg)break}}if(!Pa||null==Pa)break;var Og=null;if("ks"==Ti){var Pg=Pa.match(/[0-9A-F]+$/);Pg&&(Og=ui(a,Pg[0]))}Pa=wa(Pa,50)+" ;"+(Og||"stack="+J(a,Wb.F));a.j(Pa);Yd++}Yd||a.j("no return addresses found")}break;case "l":if("ln"== +g[0]){ui(a,g[1],!0);break}f=!0;break;case "m":a:{var na,oa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"==G)Ca=1878917119,G=null;else if("on"==G)oa=!0,G=null;else if("off"==G)oa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(na in Bb)if(G==na){Ca=Bb[na];oa=!!(a.ma&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.ma|=Ca,oa=!0;else if("off"==g[2]&&(a.ma&=~Ca,oa=!1,1073741824==Ca)){for(var ae=0;ae\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bAi){if(Ci(d,this.I)){this.A=new N(this,"1.30.3","failsafe");Ci(this.A)&&(Hi(this,d),a=2,Ii(this.A));this.A.set("timestamp",Ba());Ji(this.A);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=Gi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ci(d,g):("error"== +f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Qa("user",""),this.g=null)):this.j(f+": "+g),Ii(d),Ci(d)?(c=Gi(d),e=!0):c=!1))}e&&Fi(this,c?d:null)}else 2==a&&d.clear()}else Fi(this);delete this.I;delete this.J}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&&(Ki(this,this.b,b,c,a),this.oa(),this.b.tb());this.O&&(Hi(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.C=0}; +function Hi(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.$;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} +function xi(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.Fa&&(c&&a.b.fa(),d=a.b.Fa(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(b.J+=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);$i(a,b,c)}})}else c(a,null)} -function aj(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&&(--Ni||ab(!0));l=!1}var g,h,l=!0;Ni++;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?Yi(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,--Ni||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),--Ni||ab(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Yi(b,a,d,!0,e,m):Zi(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 aj(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map +k.oa=function(a){if(this.b){var b=this.b,c=b.G.speed;c&&(c.textContent=b.w.W&&b.ca?b.ca.toFixed(2)+"Mhz":"Stopped")}if(this.B&&(b=this.B,b.H)){var c=b.b.w.W,d=!!(b.b.K&4);if(!(0(b.J+=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);aj(a,b,c)}})}else c(a,null)} +function bj(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&&(--Oi||ab(!0));l=!1}var g,h,l=!0;Oi++;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?Zi(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,--Oi||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),--Oi||ab(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Zi(b,a,d,!0,e,m):$i(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 bj(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# 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 9e2043c94..9fcef4695 100644 --- a/versions/pdpjs/1.30.3/pdp11.js +++ b/versions/pdpjs/1.30.3/pdp11.js @@ -45,14 +45,14 @@ 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 ya(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function za(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Aa(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 Ba={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){Ba.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;bb?this.Ga=this.id:(this.pa=this.id.substr(0,b),this.Ga=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,rb:!1,N:!1,error:!1};this.kb=null;this.j.error=!1;this.o={};this.D=null;y.push(this)}var Ka=void 0,La={}; +Fa(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Ha(Ba.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Pb=b.comment;this.qd=b;b=this.id.indexOf(".");0>b?this.Ga=this.id:(this.pa=this.id.substr(0,b),this.Ga=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,sb:!1,N:!1,error:!1};this.kb=null;this.j.error=!1;this.o={};this.D=null;y.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 z(a,b){b||(b=x);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={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},y=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[a][b]=c)}function A(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]}z(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()}; @@ -60,28 +60,28 @@ h.Z=function(a,b,c,d){if(this.l&&this.l.Z(a,b,c,d)||this.a&&this.a.Z(a,b,c,d))re 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.Z.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.ka=function(a,b){b||(hb(),this.reset());return!0};h.ja=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.D&&a.D.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.C="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||(this.h.reset(),lb(this.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.D;var b;if(b=a)a.j.Da&&(a.j.rb=!0),b=!a.j.Da;if(b)Ua(a,!0),a.ob(0),Ua(a,!1);else try{var c=this.a.ob(1);0a;a++)this.b["S"+a][1]=0&1<a;a++)this.b["S"+a][1]=0&1<a.a.La?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.h.na;$a(a,"STEP")||(b=-b);sb(a,a.da&~c|a.da+b&c)}function sb(a,b){a.da=b&a.h.na;b=a.da;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.C/this.b|0;this.za=[];this.g=0;this.m=!1;this.sb=0;this.w=[];this.fc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.D);this.h=Array(this.A);for(b=0;b>2;this.l=this.b-1;this.A=this.C/this.b|0;this.za=[];this.g=0;this.m=!1;this.tb=0;this.w=[];this.fc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.D);this.h=Array(this.A);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.za[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.za[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 if(g&1&&(f=e.za[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.za[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.za[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.pb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.pb){p=l.size-(f-n);p>g&&(p=g);l.pb=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.D,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.sb+=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].Bb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>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.na)>>>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.na)>>>a.c].Gb(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.na)>>>this.c].Hb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].qb(b&a.l,c&65535,b)}h.nb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.na)>>>this.c;this.m=!1;this.g++;this.h[d].dc(c,b&65535,a);this.g--}; +function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>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.D,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].Cb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>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.na)>>>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.na)>>>a.c].Hb(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.na)>>>this.c].Ib(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>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.na)>>>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.La)){var l=k[0]?k[0].bind(b):null,n=k[1]?k[1].bind(b):null,p=k[2]?k[2].bind(b):null,u=k[3]?k[3].bind(b):null,w=k[5]||1;65472<=g&&65487>=g&&(!l&&p&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(p)),!n&&u&&(n=function(a){return function(b,c){return a(b,c)}.bind(b)}(u)));for(var D=k[4],U=0;U>5&3;b.bb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Yb(b))}};h.Hc=function(){var a=this.a;a.I&57344||(a.Ub=a.$&65535);a=a.Ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){var a=this.a;a.I&57344||(a.Vb=a.xb);return a.Vb}; -h.Jc=function(){return this.a.Ea};h.Ed=function(a){var b=this.a;1170>b.La&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Pb=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.ee=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.Yd=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]}; +function J(a,b,c){a.m=!0;a.g||(c&&(a.a.ea|=c),K(a.a,4,0,b))}function Rb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){x.call(this,"Device",a,L);this.b={L:0,Gb:-1}}z(L);h=L.prototype;h.ia=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.D=d;var e=this;this.b.Gb=Sb(c,function(){e.b.Ya|=128;e.b.Ya&64&&Tb(e.a,e.b.rd);e.l&&e.l.ya(1);Ub(e.a,e.b.Gb,1E3/60)});this.b.rd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)}; +h.reset=function(){this.b.Ya=128;Ub(this.a,this.b.Gb,1E3/60,!0)};h.Ec=function(){return this.b.Ya};h.Bd=function(a){this.b.Ya=a&192};h.Gc=function(){var a=this.a;return a.I&62337|a.bb<<5|a.cb<<1};h.Dd=function(a){var b=this.a;a&=62337;if(b.I!=a){b.I=a;b.bb=a>>5&3;b.cb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Yb(b))}};h.Hc=function(){var a=this.a;a.I&57344||(a.Ub=a.$&65535);a=a.Ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){var a=this.a;a.I&57344||(a.Vb=a.zb);return a.Vb}; +h.Jc=function(){return this.a.Ea};h.Ed=function(a){var b=this.a;1170>b.La&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Sa=a&16?4194303:262143,Yb(b))};h.kd=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};h.ee=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.cd=function(a){return this.a.H[1][a>>1&7]};h.Yd=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.Wd=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.Xd=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.Vd=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.Ad=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.yd=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.zd=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.xd=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.de=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.be=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.ce=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.ae=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Na=function(a){a&=7;return this.a.B&2048?this.a.Fa[a]:this.a.f[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Oc=function(){return this.a.B&49152?this.a.oa[0]:this.a.f[6]};h.Jd=function(a){this.a.B&49152?this.a.oa[0]=a:this.a.f[6]=a};h.Rc=function(){return this.a.f[7]}; h.Md=function(a){this.a.f[7]=a};h.Oa=function(a){a&=7;return this.a.B&2048?this.a.f[a]:this.a.Fa[a]};h.Qa=function(a,b){b&=7;this.a.B&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Pc=function(){return 1==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[1]};h.Kd=function(a){1==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[1]=a};h.Qc=function(){return 3==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[3]};h.Ld=function(a){3==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[3]=a};h.yc=function(a){return this.a.$b[a-65504>>1]}; -h.vd=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.sb}a=(a>>6)-1}else a=0;return a};h.cc=function(){};h.ed=function(){return 1};h.$d=function(){};h.xc=function(){return this.a.ea};h.ud=function(){this.a.ea=0};h.Fc=function(){return this.a.Zb};h.Cd=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Kc=function(a){return a?this.a.Db:0};h.Fd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Db=a;b.u|=2}; -h.dd=function(a){return a?this.a.mb&65280:0};h.Zd=function(a){this.a.mb=a|255};h.Nc=function(){return Zb(this.a)};h.Id=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.bc=function(){}; +h.vd=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.tb}a=(a>>6)-1}else a=0;return a};h.cc=function(){};h.ed=function(){return 1};h.$d=function(){};h.xc=function(){return this.a.ea};h.ud=function(){this.a.ea=0};h.Fc=function(){return this.a.Zb};h.Cd=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Kc=function(a){return a?this.a.Eb:0};h.Fd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Eb=a;b.u|=2}; +h.dd=function(a){return a?this.a.nb&65280:0};h.Zd=function(a){this.a.nb=a|255};h.Nc=function(){return Zb(this.a)};h.Id=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.ee,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.cd,L.prototype.Yd,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.ad,L.prototype.Wd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.bd,L.prototype.Xd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.$c,L.prototype.Vd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Dc,L.prototype.Ad,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Bc,L.prototype.yd,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Cc, L.prototype.zd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Ac,L.prototype.xd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Jc,L.prototype.Ed,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Ec,L.prototype.Bd,"LKS"],M[65402]=[null,null,L.prototype.Gc,L.prototype.Dd,"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.de,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.gd, L.prototype.be,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.ce,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.fd,L.prototype.ae,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET0"],M[65473]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET0"],M[65474]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET0"],M[65475]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET0"],M[65476]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET0"],M[65477]=[null,null,L.prototype.Na,L.prototype.Pa, @@ -89,40 +89,40 @@ L.prototype.be,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.ce L.prototype.Qa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Pc,L.prototype.Kd,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Qc,L.prototype.Ld,"R6USER",1,1145],M[65504]=[null,null,L.prototype.yc,L.prototype.vd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Wb,L.prototype.cc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Wb,L.prototype.cc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.ed,L.prototype.$d,"SYSID",1,1170],M[65526]=[null,null,L.prototype.xc,L.prototype.ud,"CPUERR",1,1170],M[65528]= [null,null,L.prototype.Fc,L.prototype.Cd,"MB",1,1170],M[65530]=[null,null,L.prototype.Kc,L.prototype.Fd,"PIR"],M[65532]=[null,null,L.prototype.dd,L.prototype.Zd,"SL"],M[65534]=[null,null,L.prototype.Nc,L.prototype.Id,"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.qb=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.fc);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},aa: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},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.wa=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Xb(a,b)},pa:function(a,b,c){this.l?this.g(a,b,c):this.Hb(a,b,c)},ta:function(a,b,c){this.l?this.g(a,b,c):this.dc(a,b,c)},C: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)},$:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},la:function(a,b){this.o[a]=b;this.wa=!0},qa:function(a,b){this.o[a]=b;this.wa=!0},sa:function(a,b,c){a&1&&J(this.h, -c,64);this.c.setUint16(a,b,!0);this.wa=!0},ua: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.D=b;a.i=a.m=0;c&&((a.i=c.i)&&mc(a,nc,!1),(a.m=c.m)&&oc(a,nc,!1))}function oc(a,b,c){c&&a.m||(a.Gb=!a.l&&b[1]||a.g,a.qb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Hb=b[1]||a.g,a.dc=b[3]||a.A}function mc(a,b,c){c&&a.i||(a.Bb=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=pc);mc(a,b,void 0);oc(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},aa: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},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.wa=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Xb(a,b)},pa:function(a,b,c){this.l?this.g(a,b,c):this.Ib(a,b,c)},ta:function(a,b,c){this.l?this.g(a,b,c):this.dc(a,b,c)},C: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)},$:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},la:function(a,b){this.o[a]=b;this.wa=!0},qa:function(a,b){this.o[a]=b;this.wa=!0},sa:function(a,b,c){a&1&&J(this.h, +c,64);this.c.setUint16(a,b,!0);this.wa=!0},ua: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.D=b;a.i=a.m=0;c&&((a.i=c.i)&&mc(a,nc,!1),(a.m=c.m)&&oc(a,nc,!1))}function oc(a,b,c){c&&a.m||(a.Hb=!a.l&&b[1]||a.g,a.rb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Ib=b[1]||a.g,a.dc=b[3]||a.A}function mc(a,b,c){c&&a.i||(a.Cb=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=pc);mc(a,b,void 0);oc(a,b,void 0)} var pc=[],kc=[I.prototype.M,I.prototype.ra,I.prototype.aa,I.prototype.va],nc=[I.prototype.F,I.prototype.pa,I.prototype.R,I.prototype.ta];if(Xa)var jc=[I.prototype.C,I.prototype.la,I.prototype.O,I.prototype.sa],ic=[I.prototype.J,I.prototype.qa,I.prototype.$,I.prototype.ua]; -function qc(a,b){x.call(this,"CPU",a,qc);var c=a.multiplier||1;this.hb=a.cycles||b;this.ta=c;this.zb=Math.round(this.hb/1E4)/100;this.Ha=this.zb*this.ta;this.j.P=!1;this.j.Eb=!1;this.j.Va=a.autoStart;this.j.fb=!1;this.eb=this.Ia=0;this.gb=a.csStart;this.Ra=a.csInterval;this.Sa=a.csStop;this.J=[];this.Tb=this.od.bind(this);F(this)}z(qc);var rc=["power","reset"];h=qc.prototype; -h.ia=function(a,b,c,d){this.l=a;this.h=b;this.D=d;this.w=a.w;for(b=0;b=a.Ia&&(a.Ia+=a.Ra,c=!0);0<=a.Sa&&a.Sa<=vc(a)&&(a.Ra=a.Sa=-1,uc(a),G(a),c=!0);c&&a.T(vc(a)+" cycles: checksum="+m(a.eb))}} +function qc(a,b){x.call(this,"CPU",a,qc);var c=a.multiplier||1;this.jb=a.cycles||b;this.ta=c;this.Ab=Math.round(this.jb/1E4)/100;this.Ha=this.Ab*this.ta;this.j.P=!1;this.j.Fb=!1;this.j.Wa=a.autoStart;this.j.fb=!1;this.gb=this.Ia=0;this.hb=a.csStart;this.Ta=a.csInterval;this.Ua=a.csStop;this.J=[];this.Tb=this.od.bind(this);F(this)}z(qc);var rc=["power","reset"];h=qc.prototype; +h.ia=function(a,b,c,d){this.l=a;this.h=b;this.D=d;this.w=a.w;for(b=0;b=a.Ia&&(a.Ia+=a.Ta,c=!0);0<=a.Ua&&a.Ua<=vc(a)&&(a.Ta=a.Ua=-1,uc(a),G(a),c=!0);c&&a.T(vc(a)+" cycles: checksum="+m(a.gb))}} h.Z=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=A(a.id);for(c=0;ca.qa/a.Ha&&(b=1);a.ta=b;b=a.zb*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&&yc(a.l)}ob(a,a.la);a.la=0;a.aa=ra();a.ra=0;xc(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.hb*a.ta/1E3*c|0,a.j.P&&(c+=zc(a)),a.J[b][0]=c)} +c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){wc(d,d.ta<<1,!0)},c.textContent=this.Ha.toFixed(2)+"Mhz",!0}return!1};h.ya=function(a){this.l&&this.l.ya(a)};function ob(a,b,c){a.va+=b;c&&(a.sa=a.a=a.F=0)}function xc(a,b){var c=1;b&&1a.qa/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&&yc(a.l)}ob(a,a.la);a.la=0;a.aa=ra();a.ra=0;xc(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+=zc(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 zc(a,b){var c=a.sa-=a.a;a.a=a.F=0;b&&(a.sa=0);return c} -h.od=function(){if(this.j.P){this.Ab>=this.hb&&xc(this,!0);this.Ua=0;this.cb=ra();if(this.ra){var a=this.cb-this.ra;a>this.Rb&&(this.aa+=a,this.aa>this.cb&&(this.aa=this.cb))}try{do{for(var b,c=this.j.fb?1:this.jb,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.ob(b)}catch(f){if("number"!=typeof f)throw f;}b=zc(this,!0);this.Ua+=b;this.la+=b;pb(this,b);nb(this,b);this.Ta-=b;if(0>=this.Ta){this.Ta+=this.jb;15<=++this.Sb&&(this.ya(),this.Sb=0);break}}while(this.j.P)}catch(f){G(this); -this.l&&this.l.stop(ra(),vc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.Tb;this.ra=ra();c=this.Rb;this.Ua&&(c=Math.round(c*this.Ua/this.jb));c-=this.ra-this.cb;if(d=this.ra-this.aa)this.qa=Math.round(this.la/(10*d))/100,864E5<=d&&(this.va=0,wc(this));if(0>c||this.qac&&(this.aa-=c),c=0;this.Ab+=this.Ua;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{wc(a);a.j.P=!0;a.j.Eb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.aa,vc(a));setTimeout(a.Tb,0)}}h.ob=function(){return 0};function G(a){var b=!1;if(a.j.P){zc(a);ob(a,a.la);a.la=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),vc(a));b=!0}a.j.complete=void 0;return b} -function Ac(a){this.La=+a.model||1170;this.Nb=a.addrReset||0;qc.call(this,a,6666667);this.decode=1120==this.La?Bc.bind(this):Cc.bind(this);Dc(this);this.ua=0;this.O=null;this.j.complete=!1}z(Ac,qc);h=Ac.prototype;h.reset=function(){this.status("model "+this.La);this.j.P&&G(this);Dc(this);tc(this);this.j.error=!1;this.parent.reset.call(this)}; -function Dc(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.B=15;a.f=[0,0,0,0,0,0,0,a.Nb];a.Fa=[0,0,0,0,0,0];a.oa=[0,0,0,0];a.v=0;a.bb=0;a.pd=[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.$b=[0,0,0,0,0,0,0,0];a.Zb=0;a.u=0;a.A=a.C=0;a.c=a.b=a.wb=0;a.Ja=-1;lb(a)}function lb(a){a.mb=255;a.ea=0;a.Db=0;a.I=0;a.Ub=0;a.Vb=0;a.Ea=0;a.Ba=0;a.ab=0;a.Pb=262143;a.$=0;a.xb=0;a.O=null;a.h&&Yb(a)}function Yb(a){a.Ba?(a.R=65536,a.M=a.mc,a.V=a.ld,a.qb=a.fe,Cb(a.h,a.Ea&16?22:18)):(a.R=0,a.M=a.lc,a.V=a.Yb,a.qb=a.ec,Cb(a.h,16))}h.Lb=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];wc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c=this.jb&&xc(this,!0);this.Ra=0;this.eb=ra();if(this.ra){var a=this.eb-this.ra;a>this.Rb&&(this.aa+=a,this.aa>this.eb&&(this.aa=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.pb(b)}catch(f){if("number"!=typeof f)throw f;}b=zc(this,!0);this.Ra+=b;this.la+=b;pb(this,b);nb(this,b);this.Va-=b;if(0>=this.Va){this.Va+=this.lb;15<=++this.Sb&&(this.ya(),this.Sb=0);break}}while(this.j.P)}catch(f){G(this); +this.l&&this.l.stop(ra(),vc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.Tb;this.ra=ra();c=this.Rb;this.Ra&&(c=Math.round(c*this.Ra/this.lb));c-=this.ra-this.eb;if(d=this.ra-this.aa)this.qa=Math.round(this.la/(10*d))/100,864E5<=d&&(this.va=0,wc(this));if(0>c||this.qac&&(this.aa-=c),c=0;this.Bb+=this.Ra;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{wc(a);a.j.P=!0;a.j.Fb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.aa,vc(a));setTimeout(a.Tb,0)}}h.pb=function(){return 0};function G(a){var b=!1;if(a.j.P){zc(a);ob(a,a.la);a.la=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),vc(a));b=!0}a.j.complete=void 0;return b} +function Ac(a){this.La=+a.model||1170;this.Ob=a.addrReset||0;qc.call(this,a,6666667);this.decode=1120==this.La?Bc.bind(this):Cc.bind(this);Dc(this);this.ua=0;this.O=null;this.j.complete=!1}z(Ac,qc);h=Ac.prototype;h.reset=function(){this.status("model "+this.La);this.j.P&&G(this);Dc(this);tc(this);this.j.error=!1;this.parent.reset.call(this)}; +function Dc(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.B=15;a.f=[0,0,0,0,0,0,0,a.Ob];a.Fa=[0,0,0,0,0,0];a.oa=[0,0,0,0];a.v=0;a.cb=0;a.pd=[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.A=a.C=0;a.c=a.b=a.xb=0;a.Ja=-1;lb(a)}function lb(a){a.nb=255;a.ea=0;a.Eb=0;a.I=0;a.Ub=0;a.Vb=0;a.Ea=0;a.Ba=0;a.bb=0;a.Sa=262143;a.$=0;a.zb=0;a.O=null;a.h&&Yb(a)}function Yb(a){a.Ba?(a.R=65536,a.M=a.mc,a.V=a.ld,a.rb=a.fe,Cb(a.h,a.Ea&16?22:18)):(a.R=0,a.M=a.lc,a.V=a.Yb,a.rb=a.ec,Cb(a.h,16))}h.Mb=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];wc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.B>>14&3;a.v!=c&&(a.oa[c]=a.f[6],a.f[6]=a.oa[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Hc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Ic(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))}function Jc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Kc(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.ea|=4,a.f[6]=4);a.xb=b;a.$=0;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);Lc(a,a.Ja);Lc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=1;a.Ja=-1;a.u|=8;if(-3!=d)throw b;}}function Mc(a){var b=Nc(a),c=Nc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);Q(a,b);$b(a,c);a.u&=-17}function Lb(a,b){var c=b>>13&31;31>c&&a.Ea&32&&(b=a.$a[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function Oc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Ea&a.pd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Pb;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(4194170!==f||a.v)a.ab=a.v,a.bb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.I&57344||(a.I=a.I|g|a.ab<<5|a.bb<<1), -b=!0),a.I&61440||!(4191360>f||4194239c&&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(Fc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Fc(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.$<<8|f<<3&248|c;6==c&&0>f&&Pc(a,b,a.f[6]);return e}h.lb=function(a){if(!this.Ba)return this.h.lb(a);this.ua++;a=this.Yb(Oc(this,a,2));this.ua--;return a};h.Za=function(a,b){this.Ba?(this.ua++,a=Oc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.Za(a,b)};h.nb=function(a,b){this.Ba?(this.ua++,this.ec(Oc(this,a,4),b),this.ua--):this.h.nb(a,b)};h.lc=function(a,b,c){return Qc(this,a,b,c)}; +function K(a,b,c,d){if(!a.ua){0>a.Ja?a.Ja=Zb(a):a.v||(b=4,a.ea|=4,a.f[6]=4,d=-3);a.zb=b;a.$=0;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);Lc(a,a.Ja);Lc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Mc(a){var b=Nc(a),c=Nc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);Q(a,b);$b(a,c);a.u&=-17}function Lb(a,b){var c=b>>13&31;31>c&&a.Ea&32&&(b=a.ab[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function Oc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Ea&a.pd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Sa;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.Sa)||a.v)a.bb=a.v,a.cb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.I&57344||(a.I=a.I|g|a.bb<<5|a.cb<< +1),b=!0),a.I&61440||!(f<(4191360&a.Sa)||f>(4194239&a.Sa))||(a.I|=4096,a.I&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Nc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Lc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.$=a.$<<8|246;Pc(a,0,c);a.rb(c,b)}function Pc(a,b,c){!a.v&&c<=a.nb&&(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(Fc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Fc(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.$<<8|f<<3&248|c;6==c&&0>f&&Pc(a,b,a.f[6]);return e}h.mb=function(a){if(!this.Ba)return this.h.mb(a);this.ua++;a=this.Yb(Oc(this,a,2));this.ua--;return a};h.$a=function(a,b){this.Ba?(this.ua++,a=Oc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.$a(a,b)};h.ob=function(a,b){this.Ba?(this.ua++,this.ec(Oc(this,a,4),b),this.ua--):this.h.ob(a,b)};h.lc=function(a,b,c){return Qc(this,a,b,c)}; h.mc=function(a,b,c){return Oc(this,Qc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,a)};h.ld=function(a){return Mb(this.h,Oc(this,a,2))};h.ec=function(a,b){Ob(this.h,a,b&65535)};h.fe=function(a,b){Ob(this.h,Oc(this,a,4),b)};function Rc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Qc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.f[d]:a.oa[a.B>>12&3];return c} function Sc(a,b,c,d){a.$=22;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Qc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Oc(a,e|c&65536,4),a.v=a.B>>14&3,Ob(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.f[e]=d:a.oa[a.B>>12&3]=d}function Tc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=-c-1;return a}function Uc(a,b){var c;b>>=6;var d=a.C=b&7;(b=a.A=(b&56)>>3)?c=Mb(a.h,a.M(b,d,2)):c=-d-1;return c}function Vc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Qc(a,b,c,8)} -function Wc(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 Xc(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.wb=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 T(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 Yc(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 Zc(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,0>c?a.f[-c-1]:c)):a.f[d]=0>c?a.f[-c-1]:c&65535;return c} +function Wc(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 Xc(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.xb=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 T(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 Yc(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 Zc(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.ob=function(a){this.j.complete=!0;var b=a?this.j.Eb?0:1:-1;this.j.Eb=!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.Db&224)>>5,e=this.O&&this.O.Ma>d?this.O:null;e&&(c=e.sd,d=e.Ma);d>(this.B&224)>>5?(this.u&4&&(Fc(this,2),this.u&=-5),K(this,c,0,-3),d=!0):d=!1;if(d){if(e)if(a=e,e=this.O,e==a)this.O=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Gc(this)&&0>b)break}this.u= +h.pb=function(a){this.j.complete=!0;var b=a?this.j.Fb?0:1:-1;this.j.Fb=!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.Eb&224)>>5,e=this.O&&this.O.Ma>d?this.O:null;e&&(c=e.sd,d=e.Ma);d>(this.B&224)>>5?(this.u&4&&(Fc(this,2),this.u&=-5),K(this,c,0,-9),d=!0):d=!1;if(d){if(e)if(a=e,e=this.O,e==a)this.O=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Gc(this)&&0>b)break}this.u= this.u&7|this.B&16;this.decode(Ec(this))}while(0>1|b<<16;Jc(this,a);return a&65535}function ed(a,b){a=b&128|b>>1|b<<8;Jc(this,a<<8);return a&255}function fd(a,b){a=b&~a;R(this,a);return a}function gd(a,b){a=b&~a;R(this,a<<8);return a}function hd(a,b){a|=b;R(this,a);return a}function id(a,b){a|=b;R(this,a<<8);return a}function jd(a,b){a=~b|65536;Hc(this,a);return a&65535}function kd(a,b){a=~b|256;Hc(this,a<<8);return a&255}function ld(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.g=b&(b^a));return a&65535} function md(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 nd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.g=a&(b^a));return a&65535}function od(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 pd(a,b){a=-b;Hc(this,a,a&b&32768);return a&65535}function qd(a,b){a=-b;Hc(this,a<<8,(a&b&128)<<8);return a&255}function rd(a,b){a=b<<1|this.m>>16&1;Jc(this,a);return a&65535} @@ -131,40 +131,40 @@ function zd(a){T(this,a,Uc(this,a),$c);this.a-=this.c?9+(this.C&&6<=this.b?1:0): function Bd(a){var b=Xc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Cd(a){V(this,a,!P(this))}function Dd(a){V(this,a,P(this))} function Ed(a){T(this,a,Uc(this,a),fd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Fd(a){S(this,a,Tc(this,a),gd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Gd(a){T(this,a,Uc(this,a),hd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Hd(a){S(this,a,Tc(this,a),id);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} function Id(a){var b=Uc(this,a);a=Xc(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Jd(a){var b=Tc(this,a);a=Wc(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Kd(a){V(this,a,this.i&65535?0:4)}function Ld(a){V(this,a,!this.Aa()==!(this.g&32768))}function Md(a){V(this,a,!!(this.i&65535)&&!this.Aa()==!(this.g&32768))} -function Nd(a){V(this,a,!P(this)&&!!(this.i&65535))}function Od(a){V(this,a,(this.i&65535?0:4)||!this.Aa()!=!(this.g&32768))}function Pd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Qd(a){V(this,a,!this.Aa()!=!(this.g&32768))}function Rd(a){V(this,a,this.Aa())}function Sd(a){V(this,a,!!(this.i&65535))}function Td(a){V(this,a,!this.Aa())}function Ud(){K(this,12,0,-1);this.a-=5}function Vd(a){V(this,a,!0)}function Wd(a){V(this,a,!(this.g&32768))}function Xd(a){V(this,a,this.g&32768?2:0)} +function Nd(a){V(this,a,!P(this)&&!!(this.i&65535))}function Od(a){V(this,a,(this.i&65535?0:4)||!this.Aa()!=!(this.g&32768))}function Pd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Qd(a){V(this,a,!this.Aa()!=!(this.g&32768))}function Rd(a){V(this,a,this.Aa())}function Sd(a){V(this,a,!!(this.i&65535))}function Td(a){V(this,a,!this.Aa())}function Ud(){K(this,12,0,-8);this.a-=5}function Vd(a){V(this,a,!0)}function Wd(a){V(this,a,!(this.g&32768))}function Xd(a){V(this,a,this.g&32768?2:0)} function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function Yd(a){var b=Uc(this,a);a=Xc(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Kc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Zd(a){var b=Tc(this,a);a=Wc(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Kc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)} -function $d(a){var b=Xc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.g=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.g=32768,this.m=65536,this.a-=7}function ae(){K(this,24,0,-1);this.a-=25} -function be(){this.B&49152?(this.ea|=128,K(this,4,0,-2)):(this.w&&this.w.setData(this.f[0],!0),this.D?this.D.b():G(this));this.a-=7}function ce(){K(this,16,0,-1);this.a-=25}var de=[0,7,7,10,7,11,9,13];function ee(a){this.F=this.a;Q(this,Vc(this,a));this.a=this.F-de[this.c]}var fe=[0,14,14,17,14,18,16,20];function ge(a){this.F=this.a;var b=Vc(this,a);a=a>>6&7;Lc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.F-fe[this.c]}var he=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function $d(a){var b=Xc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.g=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.g=32768,this.m=65536,this.a-=7}function ae(){K(this,24,0,-8);this.a-=25} +function be(){this.B&49152?(this.ea|=128,K(this,4,0,-7)):(this.w&&this.w.setData(this.f[0],!0),this.D?this.D.b():G(this));this.a-=7}function ce(){K(this,16,0,-8);this.a-=25}var de=[0,7,7,10,7,11,9,13];function ee(a){this.F=this.a;Q(this,Vc(this,a));this.a=this.F-de[this.c]}var fe=[0,14,14,17,14,18,16,20];function ge(a){this.F=this.a;var b=Vc(this,a);a=a>>6&7;Lc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.F-fe[this.c]}var he=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function ie(a){var b=Uc(this,a);this.F=this.a;R(this,Zc(this,a,b));this.a=this.F-he[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function je(a){var b=Tc(this,a);R(this,Yc(this,a,b,65535)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var ke=[7,13,13,17,14,18,17,21]; function le(a){var b=Xc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.g=0,this.m=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function re(a){T(this,a,Uc(this,a),vd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} -function se(a){T(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)}function te(){K(this,28,0,-1);this.a-=5}function ue(){this.w&&(this.w.da=this.f[7],this.w.setData(this.f[0],!0));this.u|=4;Fc(this,-2);this.a-=3}function ve(a){T(this,a,Uc(this,a),yd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-1)}function Bc(a){we[a>>12].call(this,a)}function xe(a){ye[a>>6&3].call(this,a)}function ze(a){Ae[a>>6&3].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)} +function pe(a){if(a&8)K(this,8,0,-8);else{var b=Nc(this);a&=7;7==a?Q(this,b):(Q(this,this.f[a]),this.f[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function qe(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function re(a){T(this,a,Uc(this,a),vd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} +function se(a){T(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)}function te(){K(this,28,0,-8);this.a-=5}function ue(){this.w&&(this.w.da=this.f[7],this.w.setData(this.f[0],!0));this.u|=4;Fc(this,-2);this.a-=3}function ve(a){T(this,a,Uc(this,a),yd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-8)}function Bc(a){we[a>>12].call(this,a)}function xe(a){ye[a>>6&3].call(this,a)}function ze(a){Ae[a>>6&3].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)} function De(a){Ee[a&15].call(this,a)}function Fe(a){Ge[a&15].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)}function Je(a){Ke[a>>6&3].call(this,a)}function Le(a){Me[a>>6&3].call(this,a)} var we=[function(a){Ne[a>>8&15].call(this,a)},ie,Yd,Id,Ed,Gd,zd,Y,function(a){Pe[a>>8&15].call(this,a)},je,Zd,Jd,Fd,Hd,re,Y],Ne=[function(a){Qe[a>>4&15].call(this,a)},Vd,Sd,Kd,Ld,Qd,Md,Od,ge,ge,xe,ze,Be,Y,Y,Y],ye=[function(a){Hc(this,Zc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,ld);this.a-=this.c?9:3+(7==this.b?2:0)}],Ae=[function(a){T(this,a,0, pd);this.a-=this.c?11:6},function(a){T(this,a,P(this)?1:0,$c);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,P(this)?1:0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Xc(this,a);Hc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ce=[function(a){T(this,a,0,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,bd);this.a-=this.c?9:3+(7==this.b?2:0)}], Qe=[function(a){Re[a&15].call(this,a)},Y,Y,Y,ee,ee,ee,ee,pe,Y,De,Fe,se,se,se,se],Re=[be,ue,oe,Ud,ce,ne,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ee=[me,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],Ge=[me,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],Pe=[Td,Rd,Nd,Pd,Wd,Xd,Cd,Dd,ae,te,He,Je,Le,Y,Y,Y],Ie=[function(a){Hc(this, Yc(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,kd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,md);this.a-=this.c?9:3+(7==this.b?2:0)}],Ke=[function(a){S(this,a,0,qd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Wc(this,a);Hc(this,a<<8);this.a-=this.c?4:3+(7== -this.b?2:0)}],Me=[function(a){S(this,a,0,ud);this.a-=this.c?9+(this.wb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,ed);this.a-=this.c?9+(this.wb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,cd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Cc(a){Se[a>>12].call(this,a)} +this.b?2:0)}],Me=[function(a){S(this,a,0,ud);this.a-=this.c?9+(this.xb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,ed);this.a-=this.c?9+(this.xb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,cd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Cc(a){Se[a>>12].call(this,a)} var Se=[function(a){Te[a>>8&15].call(this,a)},ie,Yd,Id,Ed,Gd,zd,function(a){Ue[a>>8&15].call(this,a)},function(a){Ve[a>>8&15].call(this,a)},je,Zd,Jd,Fd,Hd,re,Y],Te=[function(a){We[a>>4&15].call(this,a)},Vd,Sd,Kd,Ld,Qd,Md,Od,ge,ge,xe,ze,Be,function(a){Xe[a>>6&3].call(this,a)},Y,Y],Xe=[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=Rc(this,a,0);Lc(this,a);R(this,a);this.a-=11},function(a){var b=Nc(this);this.F= -this.a;Sc(this,a,0,b);R(this,b);this.a=this.F-ke[this.c]},function(a){R(this,Zc(this,a,this.Aa?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],We=[function(a){Ye[a&15].call(this,a)},Y,Y,Y,ee,ee,ee,ee,pe,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-1)},De,Fe,se,se,se,se],Ye=[be,ue,oe,Ud,ce,ne,function(){Mc(this);this.a-=13},function(){K(this,8,0,-1)},Y,Y,Y,Y,Y,Y,Y,Y],Ue=[le,le,$d,$d,Ad,Ad,Bd,Bd,ve,ve,Y,Y,Y,Y,qe,qe],Ve=[Td,Rd,Nd,Pd,Wd,Xd,Cd,Dd,ae,te, +this.a;Sc(this,a,0,b);R(this,b);this.a=this.F-ke[this.c]},function(a){R(this,Zc(this,a,this.Aa?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],We=[function(a){Ye[a&15].call(this,a)},Y,Y,Y,ee,ee,ee,ee,pe,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},De,Fe,se,se,se,se],Ye=[be,ue,oe,Ud,ce,ne,function(){Mc(this);this.a-=13},function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ue=[le,le,$d,$d,Ad,Ad,Bd,Bd,ve,ve,Y,Y,Y,Y,qe,qe],Ve=[Td,Rd,Nd,Pd,Wd,Xd,Cd,Dd,ae,te, He,Je,Le,function(a){Ze[a>>6&3].call(this,a)},Y,Y],Ze=[Y,function(a){a=Rc(this,a,65536);Lc(this,a);R(this,a);this.a-=11},function(a){var b=Nc(this);this.F=this.a;Sc(this,a,65536,b);R(this,b);this.a=this.F-ke[this.c]},Y]; function $e(a){x.call(this,"ROM",a,$e);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.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);af(c)})}}z($e);h=$e.prototype; h.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;af(this)};h.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ja=function(){return!0}; -function af(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]=[$e.prototype.Zc,$e.prototype.Ud,null,null,null,a.b>>1],c);if(cb(a.h,a,b,256,a.Ga)){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,256,a.Ga)){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(),64e.w&&(e.w-=32),e.b|=128,e.b&64&&Tb(e.a,e.aa))});this.M=Vb(52,4);this.$=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.M)});cb(b,this,gf);eb(b,this.reset.bind(this));F(this)}; -h.Mb=function(){if(!this.v){var a=sc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Ga)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.pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Mb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ja=function(a){return a?this.save():!0};h.reset=function(){hf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return hf(this)};function hf(a){a.w=0;a.b=0;a.c=128;return!0}h.Cb=function(a){if("number"==typeof a)this.s.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.I||8,c=a-this.m%a,this.I&&(b=" ".slice(0,c)));this.F&&!this.m&&c&&(b=String.fromCharCode(this.F)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}else if(null!=this.i){if(10==a||1024<=this.i.length)this.T(this.i), -this.i="";10!=a&&(this.i+=String.fromCharCode(a))}this.c&=-129;Ub(this.a,this.$,1E3/Math.round(this.R/10))}};var jf={},gf=(jf[65392]=[null,null,Z.prototype.Tc,Z.prototype.Od,"RCSR"],jf[65394]=[null,null,Z.prototype.Sc,Z.prototype.Nd,"RBUF"],jf[65396]=[null,null,Z.prototype.nd,Z.prototype.he,"XCSR"],jf[65398]=[null,null,Z.prototype.md,Z.prototype.ge,"XBUF"],jf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b>>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.aa))});this.M=Vb(52,4);this.$=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.M)});cb(b,this,gf);eb(b,this.reset.bind(this));F(this)}; +h.Nb=function(){if(!this.v){var a=sc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Ga)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.pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Nb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ja=function(a){return a?this.save():!0};h.reset=function(){hf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return hf(this)};function hf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.Db=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.I||8,c=a-this.s%a,this.I&&(b=" ".slice(0,c)));this.F&&!this.s&&c&&(b=String.fromCharCode(this.F)+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.$,1E3/Math.round(this.R/10))}};var jf={},gf=(jf[65392]=[null,null,Z.prototype.Tc,Z.prototype.Od,"RCSR"],jf[65394]=[null,null,Z.prototype.Sc,Z.prototype.Nd,"RBUF"],jf[65396]=[null,null,Z.prototype.nd,Z.prototype.he,"XCSR"],jf[65398]=[null,null,Z.prototype.md,Z.prototype.ge,"XBUF"],jf);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&&mf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){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;mf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; @@ -175,15 +175,15 @@ function vf(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){va a.j.Da=!1;a.m&&(a.m--,a.m||F(a));tf(a)})}function qf(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.vb?"":e)+"&format=json"));return!!r(f, +!0),e=e+dg&-1;Xb.ba=c;U[xa]=Xb}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.g,c,a.xa,a.Ca),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.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, null,!0,function(b,c,d){Df(a,b,c,d)})} function Df(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.pa,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.ha=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 D=n<<2,U=w.length;U>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.ba?f=a.ma+a.ba&&(a.ba+=f-(a.ma+a.ba)+1):(a.ma=f,a.ba=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 ("+ @@ -195,41 +195,41 @@ c,c.onclick=function(){var a=d.o.listDisks;a&&Jf(d,a.options[a.selectedIndex].te typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");t(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return 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;Jf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;if((this.g=sc(this.l,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.g+")"),this.g=null}Kf(this);this.F=Vb(112,5);cb(b,this,Lf,4194304);eb(b,this.reset.bind(this));Mf(this,"None","",!0);this.A&&Mf(this,"Local Disk","?");Mf(this,"Remote Disk","??");Nf(this)||F(this)}; -h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Kb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";If(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Kf(this)};h.save=function(){return(new O(this)).data()}; +h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";If(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Kf(this)};h.save=function(){return(new O(this)).data()}; h.restore=function(a){return Kf(this,a[0])};function Nf(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+'"')}Pf(a,e,b,c,!1,d)}else Of(a,e)} -function Pf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Of(a,b,!0),k.ub?a.G("RL11 busy"):(k.ub=!0,e&&(k.tb=!0,a.s++),k.ib=!!f,Cf(new yf(a,k,"preload"),c,d,f,a.ic)&&g++));return g} -h.ic=function(a,b,c,d,e){var f;a.ub=!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.ca=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.tb||e),this.l&&yc(this.l)):a.ib=!1;a.tb&&(a.tb=!1,--this.s||F(this));If(this,a.yb)}; +function Pf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Of(a,b,!0),k.vb?a.G("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.s++),k.ib=!!f,Cf(new yf(a,k,"preload"),c,d,f,a.ic)&&g++));return g} +h.ic=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.ca=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.ub||e),this.l&&yc(this.l)):a.ib=!1;a.ub&&(a.ub=!1,--this.s||F(this));If(this,a.yb)}; function Mf(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.ca,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.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.ha&&(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.wd=function(a,b,c,d,e,f,g){var k=0,l=a.ca,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.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ha&&(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.Rd=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-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.wd),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.F))}};h.Uc=function(){return this.v};h.Pd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Sd=function(a){this.c=a};h.Yc=function(){return this.m};h.Td=function(a){this.m=a};h.Vc=function(){return this.w};h.Qd=function(a){this.w=a&63}; var Qf={},Lf=(Qf[63744]=[null,null,N.prototype.Wc,N.prototype.Rd,"RLCS"],Qf[63746]=[null,null,N.prototype.Uc,N.prototype.Pd,"RLBA"],Qf[63748]=[null,null,N.prototype.Xc,N.prototype.Sd,"RLDA"],Qf[63750]=[null,null,N.prototype.Yc,N.prototype.Td,"RLMP"],Qf[63752]=[null,null,N.prototype.Vc,N.prototype.Qd,"RLBE"],Qf); -function Rf(a,b,c){x.call(this,"Computer",a,Rf);this.j.N=!1;Sf(this,b);this.A=sc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Tf;this.s=null;this.i=this.I=!1;this.O=sc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Uf(this);if(this.a=Ta("CPU",this.id)){this.D=Ta("Debugger",this.id);this.h=new vb({id:this.pa+".bus",busWidth:this.M},this.a,this.D);var d,e=A(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;bTf){if(Vf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Vf(this.g)&&($f(this,d),a=2,ag(this.g));this.g.set("timestamp",sa());bg(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=Zf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Vf(d,g):("error"== -f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(za("user",""),this.c=null)):this.T(f+": "+g),ag(d),Vf(d)?(c=Zf(d),e=!0):c=!1))}e&&Yf(this,c?d:null)}else 2==a&&d.clear()}else Yf(this);delete this.s;delete this.v}e=A(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&&(cg(this,this.a,b,c,a),this.ya(),this.a.Va());this.F&&($f(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:Tf));if(!this.l){this.l++;var b=!1,c=!1;this.F=!1;var d=this.v||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Tf){if(Vf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Vf(this.g)&&($f(this,d),a=2,ag(this.g));this.g.set("timestamp",sa());bg(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=Zf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Vf(d,g):("error"== +f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(za("user",""),this.c=null)):this.T(f+": "+g),ag(d),Vf(d)?(c=Zf(d),e=!0):c=!1))}e&&Yf(this,c?d:null)}else 2==a&&d.clear()}else Yf(this);delete this.s;delete this.v}e=A(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&&(cg(this,this.a,b,c,a),this.ya(),this.a.Wa());this.F&&($f(this,b),b.clear());!c&&this.g&&(this.g.clear(),delete this.g);this.l=0}; function $f(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 eg(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.ja&&(c&&G(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.N=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l(b.w+=a))){for(var e=0;e