diff --git a/apps/pdp11/boot/monitor/BOOTMON.mac b/apps/pdp11/boot/monitor/BOOTMON.mac index 7b61f6698..983dbad02 100644 --- a/apps/pdp11/boot/monitor/BOOTMON.mac +++ b/apps/pdp11/boot/monitor/BOOTMON.mac @@ -3,13 +3,17 @@ ; REBASE HIGHER LINK/BOT:140000 ; WANT PERFORMANCE COUNTER - CLOCK TICKS TO DO SOMETHING? -PSW = 177776 -DL11XCSR = 177564 -DL11VEC = 64 - KW11LKS = 177546 KW11VEC = 100 +DL11RCSR = 177560 +DL11RBUF = 177562 +DL11XCSR = 177564 +DL11XBUF = 177566 +DL11VEC = 64 + +PSW = 177776 + .ASECT .=140000 START: RESET @@ -46,7 +50,7 @@ CLKAST: ONECHR: TSTB @#DL11XCSR BPL ONECHR - MOVB R0,@#177566 + MOVB R0,@#DL11XBUF RTS PC PRTPTR: .WORD 0 @@ -63,10 +67,10 @@ PRINT: PRTAST: TSTB @PRTPTR BEQ 2$ - MOVB @PRTPTR,@#177566 + MOVB @PRTPTR,@#DL11XBUF INC PRTPTR RTI -2$: CLRB @#177564 +2$: CLRB @#DL11XCSR RTI BUFFER: .WORD 0 ; INPUT BUFFER POINTER @@ -77,12 +81,12 @@ INPUT: CLR LENGTH MOV #INPAST,@#60 MOV #200,@#62 - BISB #100,@#177560 + BISB #100,@#DL11RCSR RTS PC INPAST: MOV R0,-(SP) - MOVB @#177562,R0 + MOVB @#DL11RBUF,R0 CMPB R0,#15 BEQ 7$ ; CARRIAGE RETURN CMPB R0,#127. @@ -132,7 +136,7 @@ CMD: MOV R4,-(SP) MOV #EOL,R0 JSR PC,PRINT -1$: BITB #100,@#177564 +1$: BITB #100,@#DL11XCSR BNE 1$ CLR R4 MOV #CMDLST,R3 ; CMD LIST diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index 99273f47f..5b3a03a34 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -919,10 +919,10 @@ CPUPDP11.prototype.calcRemainingTime = function() * * Why not use JavaScript's setTimeout() instead? Good question. For a good answer, see setTimer() below. * - * TODO: Consider making the addTimer() and setTimer() interfaces more like the addTrigger() and setTrigger() + * TODO: Consider making the addTimer() and setTimer() interfaces more like the addIRQ() and setIRQ() * interfaces (which return the underlying object instead of an array index) and maintaining a separate list - * of active timers, in order of highest to lowest cycle countdown values, as this could speed up getBurstCycles() - * and updateTimers() functions ever so slightly. + * of active timers, in order of highest to lowest cycle countdown values, as this could speed up + * getBurstCycles() and updateTimers() functions ever so slightly. * * @this {CPUPDP11} * @param {function()} callBack diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 2432070b1..7de74abee 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -1738,7 +1738,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_DELAY; + this.opFlags |= PDP11.OPFLAG.IRQ_DELAY; } this.nStepCycles -= (4 + 1); }; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 3e57e8317..6f5f3ef20 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -96,15 +96,15 @@ Component.subclass(CPUStatePDP11, CPUPDP11); * CPU offers timer services that will "fire" a callback after a specified delay, which are much more efficient than * requiring the CPU to dive into an interrupt queue and decrement delay counts on every instruction. * - * Second, devices that generate interrupts will allocate a trigger object during initialization; we will no longer - * be creating and destroying interrupt event objects and inserting/deleting them in a constantly changing queue. Each - * trigger contains properties that never change (eg, the vector and priority), along with a "next" pointer that's - * only used when the trigger is active. + * Second, devices that generate interrupts will allocate an IRQ object during initialization; we will no longer + * be creating and destroying interrupt event objects and inserting/deleting them in a constantly changing queue. + * Each IRQ contains properties that never change (eg, the vector and priority), along with a "next" pointer that's + * only used when the IRQ is active. * - * When a device decides it's time to interrupt (either at the end of some I/O operation or when a timer has "fired"), - * it will simply "pull the trigger", which basically means that its trigger will be linked onto a list of active - * triggers, and in priority order, so that when the CPU is ready to acknowledge interrupts, it need only check the - * top of the active trigger list. + * When a device decides it's time to interrupt (either at the end of some I/O operation or when a timer has fired), + * it will simply set the IRQ, which basically means that the IRQ will be linked onto a list of active IRQs, in + * priority order, so that when the CPU is ready to acknowledge interrupts, it need only check the top of the active + * IRQ list. */ /** @@ -112,10 +112,10 @@ Component.subclass(CPUStatePDP11, CPUPDP11); * vector: number, * priority: number, * message: number, - * next: (Trigger|null) - * }} Trigger + * next: (IRQ|null) + * }} IRQ */ -var Trigger; +var IRQ; /** * initProcessor() @@ -148,12 +148,12 @@ CPUStatePDP11.prototype.initProcessor = function() this.nDisableTraps = 0; - /** @type {Trigger|null} */ - this.triggerNext = null; // the head of the active triggers list, in priority order + /** @type {IRQ|null} */ + this.irqNext = null; // the head of the active IRQ list, in priority order if (DEBUG) { - /** @type {Array.} */ - this.aTriggers = []; // list of all triggers, active or not (just for debugging) + /** @type {Array.} */ + this.aIRQs = []; // list of all IRQs, active or not (just for debugging) } this.flags.complete = false; @@ -274,7 +274,7 @@ CPUStatePDP11.prototype.resetMMU = function() this.lastAddr = 0; // this is queried by the Panel when it's not using its own ADDRESS register this.lastOp = 0; // stores the PC and any auto-incs or auto-decs from the last opcode; used to update MMR1 and MMR2 - this.resetTriggers(); + this.resetIRQs(); if (this.bus) this.setMemoryAccess(); }; @@ -768,130 +768,138 @@ CPUStatePDP11.prototype.setSP = function(addr) }; /** - * addTrigger(vector, priority, message) + * addIRQ(vector, priority, message) * * @this {CPUStatePDP11} * @param {number} vector * @param {number} priority * @param {number} [message] - * @return {Trigger} + * @return {IRQ} */ -CPUStatePDP11.prototype.addTrigger = function(vector, priority, message) +CPUStatePDP11.prototype.addIRQ = function(vector, priority, message) { - var trigger = {vector: vector, priority: priority, message: message || 0, next: null}; - if (DEBUG) this.aTriggers.push(trigger); - return trigger; + var irq = {vector: vector, priority: priority, message: message || 0, next: null}; + if (DEBUG) { + irq.name = PDP11.VECTORS[vector]; + this.aIRQs.push(irq); + } + return irq; }; /** - * insertTrigger(trigger) + * insertIRQ(irq) * * @this {CPUStatePDP11} - * @param {Trigger} trigger + * @param {IRQ} irq */ -CPUStatePDP11.prototype.insertTrigger = function(trigger) +CPUStatePDP11.prototype.insertIRQ = function(irq) { - if (trigger != this.triggerNext) { - var triggerPrev = this.triggerNext; - if (!triggerPrev || triggerPrev.priority <= trigger.priority) { - trigger.next = triggerPrev; - this.triggerNext = trigger; + if (irq != this.irqNext) { + var irqPrev = this.irqNext; + if (!irqPrev || irqPrev.priority <= irq.priority) { + irq.next = irqPrev; + this.irqNext = irq; } else { do { - var triggerNext = triggerPrev.next; - if (!triggerNext || triggerNext.priority <= trigger.priority) { - trigger.next = triggerNext; - triggerPrev.next = trigger; + var irqNext = irqPrev.next; + if (!irqNext || irqNext.priority <= irq.priority) { + irq.next = irqNext; + irqPrev.next = irq; break; } - triggerPrev = triggerNext; - } while (triggerPrev); + irqPrev = irqNext; + } while (irqPrev); } } + /* + * See the writeXCSR() function for an explanation of why signalling an IRQ hardware interrupt + * should be done using IRQ_DELAY rather than setting IRQ directly. + */ + this.opFlags |= PDP11.OPFLAG.IRQ_DELAY; }; /** - * removeTrigger(trigger) + * removeIRQ(irq) * * @this {CPUStatePDP11} - * @param {Trigger} trigger + * @param {IRQ} irq */ -CPUStatePDP11.prototype.removeTrigger = function(trigger) +CPUStatePDP11.prototype.removeIRQ = function(irq) { - var triggerPrev = this.triggerNext; - if (triggerPrev == trigger) { - this.triggerNext = trigger.next; + var irqPrev = this.irqNext; + if (irqPrev == irq) { + this.irqNext = irq.next; } else { - while (triggerPrev) { - var triggerNext = triggerPrev.next; - if (triggerNext == trigger) { - triggerPrev.next = triggerNext.next; + while (irqPrev) { + var irqNext = irqPrev.next; + if (irqNext == irq) { + irqPrev.next = irqNext.next; break; } - triggerPrev = triggerNext; + irqPrev = irqNext; } } - // We could also set trigger.next to null now, but strictly speaking, that shouldn't be necessary. -}; - -/** - * setTrigger(trigger) - * - * @this {CPUStatePDP11} - * @param {Trigger} trigger - * @return {boolean} (true if interrupt dispatched, false if not) - */ -CPUStatePDP11.prototype.setTrigger = function(trigger) -{ - this.insertTrigger(trigger); - /* - * See the writeXCSR() function for an explanation of why signalling an INTQ hardware interrupt condition - * should be done using INTQ_DELAY rather than setting INTQ directly. + * We could also set irq.next to null now, but strictly speaking, that shouldn't be necessary. + * + * Last but not least, if there's still an IRQ on the active IRQ list, we need to make sure IRQ_DELAY + * is still set. */ - this.opFlags |= PDP11.OPFLAG.INTQ_DELAY; - - if (trigger.message && this.messageEnabled(trigger.message | MessagesPDP11.INT)) { - this.printMessage("setInterrupt(vector=" + str.toOct(trigger.vector) + ",priority=" + trigger.priority + ")", true, true); + if (this.irqNext) { + this.opFlags |= PDP11.OPFLAG.IRQ_DELAY; } - return false; }; /** - * clearTrigger(trigger) + * setIRQ(irq) * * @this {CPUStatePDP11} - * @param {Trigger} trigger + * @param {IRQ} irq */ -CPUStatePDP11.prototype.clearTrigger = function(trigger) +CPUStatePDP11.prototype.setIRQ = function(irq) { - this.removeTrigger(trigger); + this.insertIRQ(irq); - if (trigger.message && this.messageEnabled(trigger.message | MessagesPDP11.INT)) { - this.printMessage("clearInterrupt(vector=" + str.toOct(trigger.vector) + ",priority=" + trigger.priority + ")", true, true); + if (irq.message && this.messageEnabled(irq.message | MessagesPDP11.INT)) { + this.printMessage("setIRQ(vector=" + str.toOct(irq.vector) + ",priority=" + irq.priority + ")", true, true); } }; /** - * checkTriggers(priority) + * clearIRQ(irq) + * + * @this {CPUStatePDP11} + * @param {IRQ} irq + */ +CPUStatePDP11.prototype.clearIRQ = function(irq) +{ + this.removeIRQ(irq); + + if (irq.message && this.messageEnabled(irq.message | MessagesPDP11.INT)) { + this.printMessage("clearIRQ(vector=" + str.toOct(irq.vector) + ",priority=" + irq.priority + ")", true, true); + } +}; + +/** + * checkIRQs(priority) * * @this {CPUStatePDP11} * @param {number} priority - * @return {Trigger|null} + * @return {IRQ|null} */ -CPUStatePDP11.prototype.checkTriggers = function(priority) +CPUStatePDP11.prototype.checkIRQs = function(priority) { - return (this.triggerNext && this.triggerNext.priority > priority)? this.triggerNext : null; + return (this.irqNext && this.irqNext.priority > priority)? this.irqNext : null; }; /** - * resetTriggers(priority) + * resetIRQs(priority) * * @this {CPUStatePDP11} */ -CPUStatePDP11.prototype.resetTriggers = function() +CPUStatePDP11.prototype.resetIRQs = function() { - this.triggerNext = null; + this.irqNext = null; }; /** @@ -904,27 +912,30 @@ CPUStatePDP11.prototype.checkInterrupts = function() { var fInterrupt = false; - if (this.opFlags & PDP11.OPFLAG.INTQ) { - this.opFlags &= ~PDP11.OPFLAG.INTQ; + if (this.opFlags & PDP11.OPFLAG.IRQ) { var vector = PDP11.TRAP.PIRQ; var priority = (this.regPIR & PDP11.PSW.PRI) >> PDP11.PSW.SHIFT.PRI; - var trigger = this.checkTriggers(priority); - if (trigger) { - vector = trigger.vector; - priority = trigger.priority; + var irq = this.checkIRQs(priority); + if (irq) { + vector = irq.vector; + priority = irq.priority; } if (this.dispatchInterrupt(vector, priority)) { - if (trigger) this.removeTrigger(trigger); + if (irq) this.removeIRQ(irq); fInterrupt = true; } + + if (!this.irqNext && !this.regPIR) { + this.opFlags &= ~PDP11.OPFLAG.IRQ; + } } - else if (this.opFlags & PDP11.OPFLAG.INTQ_DELAY) { + else if (this.opFlags & PDP11.OPFLAG.IRQ_DELAY) { /* - * 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. + * We know that IRQ (bit 1) is clear, so since IRQ_DELAY (bit 0) is set, incrementing opFlags + * will transform IRQ_DELAY into IRQ, without affecting any other (higher) bits. */ this.opFlags++; } @@ -1087,7 +1098,7 @@ CPUStatePDP11.prototype.setPSW = function(newPSW) this.regPSW = newPSW; /* - * Trigger (no pun intended) a call to checkInterrupts(), just in case. + * Trigger a call to checkInterrupts(), just in case. * * TODO: I think this is overdone; if you set a breakpoint on checkInterrupts(), you'll see that a significant * percentage of calls do nothing. For example, you'll usually see a spurious checkInterrupts() immediately after @@ -1096,11 +1107,11 @@ CPUStatePDP11.prototype.setPSW = function(newPSW) * I mean, sure, it's POSSIBLE that the new PSW loaded by trap() actually set a lower priority, allowing a lower * priority interrupt to immediately be acknowledged. But perhaps we should be a bit more rigorous here. * - * For example, we could avoid setting INTQ unless 1) there's actually an active interrupt trigger (ie, triggerNext + * For example, we could avoid setting IRQ unless 1) there's actually an active IRQ (ie, irqNext * is not null) or 2) an optional fCheckInterrupts flag is passed to us, because the caller has some knowledge * that priority could be changing. Just throwing out some ideas.... */ - this.opFlags |= PDP11.OPFLAG.INTQ; + this.opFlags |= PDP11.OPFLAG.IRQ; }; /** @@ -1144,15 +1155,18 @@ CPUStatePDP11.prototype.getPIR = function() */ CPUStatePDP11.prototype.setPIR = function(newPIR) { - newPIR &= 0xfe00; + newPIR &= PDP11.PIR.BITS; if (newPIR) { - var i = newPIR >> 9; + var bits = newPIR >> PDP11.PIR.SHIFT.BITS; do { - newPIR += 0x22; - } while (i >>= 1); + newPIR += PDP11.PIR.PIA_INC; + } while (bits >>= 1); + /* + * TODO: Which should we set: IRQ or IRQ_DELAY? + */ + this.opFlags |= PDP11.OPFLAG.IRQ; } this.regPIR = newPIR; - this.opFlags |= PDP11.OPFLAG.INTQ; }; /** @@ -1397,7 +1411,7 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason) * * Well, OK, we're also supposed to "lose interest" in the TF flag, too; otherwise, DEC tests fail. * - * Finally, setPSW() likes to always set INTQ, to force a check of hardware interrupts prior to + * Finally, setPSW() likes to always set IRQ, to force a check of hardware interrupts prior to * the next instruction, just in case the PSW priority was lowered. However, there are "TRAP TEST" * tests like this one: * @@ -1414,11 +1428,11 @@ 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_DELAY instead of INTQ, which effectively delays - * INTQ detection for one instruction, which is just long enough to allow the diagnostic to pass. + * trick that the SPL instruction uses: setting IRQ_DELAY instead of IRQ, which effectively delays + * IRQ 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_DELAY | PDP11.OPFLAG.TRAP; + this.opFlags &= ~(flag | PDP11.OPFLAG.TRAP_TF | PDP11.OPFLAG.IRQ); + this.opFlags |= PDP11.OPFLAG.IRQ_DELAY | PDP11.OPFLAG.TRAP; this.trapPSW = -1; // reset flag that we have a trap within a trap @@ -2572,18 +2586,16 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) if (!nDebugState) nDebugState++; nDebugCheck++; } - if (this.opFlags) { - /* - * If we're in the INTQ or WAIT state, check for any pending interrupts. + * If we're in the IRQ or WAIT state, check for any pending interrupts. * * NOTE: It's no coincidence that we're checking this BEFORE any pending traps, because in rare * cases (including some presented by those pesky "TRAP TEST" diagnostics), the process of dispatching * an interrupt can trigger a TRAP_SP stack overflow condition, which must be dealt with BEFORE we * execute the first instruction of the interrupt handler. */ - if ((this.opFlags & (PDP11.OPFLAG.INTQ_MASK | PDP11.OPFLAG.WAIT)) /* && nDebugState >= 0 */) { + if ((this.opFlags & (PDP11.OPFLAG.IRQ_MASK | PDP11.OPFLAG.WAIT)) /* && nDebugState >= 0 */) { if (this.checkInterrupts()) { if (DEBUGGER && nDebugCheck && this.dbg.checkInstruction(this.getPC(), nDebugState)) { this.stopCPU(); @@ -2599,7 +2611,6 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) if (nDebugState < 0) break; } } - /* * Next, check for any pending traps (which, as noted above, must be done after checkInterrupts()). * @@ -2616,8 +2627,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) if (nDebugState < 0) break; } } + } else { + this.assert(!this.irqNext && !this.regPIR); } - /* * Snapshot the TF bit in opFlags, while clearing all other opFlags (except those in PRESERVE); * we'll check the TRAP_TF bit in opFlags when we come back around for another opcode. diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index d2410d81a..ae057e22e 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1262,14 +1262,14 @@ if (DEBUGGER) { sMessage += " @" + this.toStrAddr(this.newAddr(this.cpu.getLastPC())); } + if (this.sMessagePrev && sMessage == this.sMessagePrev) return; + this.sMessagePrev = sMessage; + if (this.bitsMessage & MessagesPDP11.BUFFER) { this.aMessageBuffer.push(sMessage); return; } - if (this.sMessagePrev && sMessage == this.sMessagePrev) return; - this.sMessagePrev = sMessage; - var fRunning; if ((this.bitsMessage & MessagesPDP11.HALT) && this.cpu && (fRunning = this.cpu.isRunning()) || this.isBusy(true)) { this.stopCPU(); @@ -3378,8 +3378,9 @@ if (DEBUGGER) { this.bitsMessage &= ~bitsMessage; fCriteria = false; if (bitsMessage == MessagesPDP11.BUFFER) { - for (var i = 0; i < this.aMessageBuffer.length; i++) { - this.println(this.aMessageBuffer[i]); + var i = this.aMessageBuffer.length >= 1000? this.aMessageBuffer.length - 1000 : 0; + while (i < this.aMessageBuffer.length) { + this.println(this.aMessageBuffer[i++]); } this.aMessageBuffer = []; } diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 72d07dd61..e3db7668e 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -158,7 +158,7 @@ var PDP11 = { MASK: 0x3 }, /* - * Processor Status Word definitions (stored in regPSW) + * Processor Status Word (stored in regPSW) at 177776 */ PSW: { CF: 0x0001, // bit 0 (000001) Carry Flag @@ -185,6 +185,19 @@ var PDP11 = { CMODE: 14 } }, + /* + * Program Interrupt Register (stored in regPIR) at 177772 + * + * The PIA bits at 5-7 are designed to align with PRI bits 5-7 in the PSW. + */ + PIR: { + BITS: 0xFE00, // bits 9-15 correspond to interrupt requests 1-7 + PIA: 0x00EE, // the PIA bits contain two copies of the corresponding interrupt request priority + PIA_INC: 0x0022, // both sets of PIA bits can be incremented with this constant + SHIFT: { + BITS: 9 + } + }, /* * PDP-11 trap vectors */ @@ -248,9 +261,9 @@ var PDP11 = { * Internal operation state flags */ OPFLAG: { - INTQ_DELAY: 0x01, // set INTQ on next check (set by SPL and traps) - INTQ: 0x02, // call checkInterrupts() - INTQ_MASK: 0x03, + IRQ_DELAY: 0x01, // set IRQ on next check (set by SPL and traps) + IRQ: 0x02, // call checkInterrupts() + IRQ_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 (WARNING: do not change this bit, or you will likely break opRTI()) @@ -492,10 +505,10 @@ var PDP11 = { PPS: 0o177554, // PC11 Punch Status Register PPB: 0o177556, // PC11 Punch Buffer Register - RCSR: 0o177560, // DL11 Display Terminal: Receiver Status Register - RBUF: 0o177562, // DL11 Display Terminal: Receiver Data Buffer Register - XCSR: 0o177564, // DL11 Display Terminal: Transmitter Status Register - XBUF: 0o177566, // DL11 Display Terminal: Transmitter Data Buffer Register + RCSR: 0o177560, // DL11 Receiver Status Register + RBUF: 0o177562, // DL11 Receiver Data Buffer Register + XCSR: 0o177564, // DL11 Transmitter Status Register + XBUF: 0o177566, // DL11 Transmitter Data Buffer Register CNSW: 0o177570, // Console (Front Panel) Switch/Display Register @@ -578,9 +591,9 @@ var PDP11 = { }, DL11: { // Serial Line Interface (program compatible with the KL11 for control of console teleprinters) PRI: 4, - RVEC: 0o60, - XVEC: 0o64, - RCSR: { // 177560 + RVEC: 0o060, + XVEC: 0o064, + RCSR: { // 177560: DL11 Receiver Status Register RE: 0x0001, // Reader Enable (W/O) DTR: 0x0002, // Data Terminal Ready (R/W) RTS: 0x0004, // Request To Send (R/W) @@ -598,14 +611,14 @@ var PDP11 = { WMASK: 0x006F, // bits writable BAUD: 9600 }, - RBUF: { // 177562 + RBUF: { // 177562: DL11 Receiver Data Buffer Register DATA: 0x00ff, // Received Data (R/O) PARITY: 0x1000, // Received Data Parity (R/O) FE: 0x2000, // Framing Error (R/O) OE: 0x4000, // Overrun Error (R/O) ERROR: 0x8000 // Error (R/O) }, - XCSR: { // 177564 + XCSR: { // 177564: DL11 Transmitter Status Register BREAK: 0x0001, // BREAK (R/W) MAINT: 0x0004, // Maintenance (R/W) TIE: 0x0040, // Transmitter Interrupt Enable (R/W) @@ -614,7 +627,7 @@ var PDP11 = { WMASK: 0x0045, BAUD: 9600 }, - XBUF: { // 177566 + XBUF: { // 177566: DL11 Transmitter Data Buffer Register DATA: 0x00FF // Transmitted Data (W/O) TODO: Determine why pdp11.js effectively defined this as 0x7F } }, @@ -622,7 +635,7 @@ var PDP11 = { PRI: 6, VEC: 0o100, DELAY: 0, - LKS: { + LKS: { // 177546: KW11-L Clock Status IE: 0x0040, // Interrupt Enable MON: 0x0080, // Monitor MASK: 0x00C0 // these are the only bits that can read or written @@ -630,9 +643,9 @@ var PDP11 = { }, PC11: { // High Speed Reader & Punch (PR11 is a Reader-only unit) PRI: 4, // NOTE: reader has precedence over punch - RVEC: 0o70, // reader vector - PVEC: 0o74, // punch vector - PRS: { + RVEC: 0o070, // reader vector + PVEC: 0o074, // punch vector + PRS: { // 177550: PC11 (and PR11) Reader Status Register RE: 0x0001, // Reader Enable (W/O) RIE: 0x0040, // Reader Interrupt Enable (allows the DONE and ERROR bits to trigger an interrupt) DONE: 0x0080, // Done (R/O) @@ -643,15 +656,20 @@ var PDP11 = { WMASK: 0x0041, // bits writable BAUD: 3600 }, - PRB: { + PRB: { // 177552: PC11 (and PR11) Reader Buffer Register MASK: 0x00FF // Data }, - PPS: { + PPS: { // 177554: PC11 Punch Status Register /* * TODO: Flesh this out if/when we add Paper Tape Punch support */ BAUD: 600 }, + PPB: { // 177556: PC11 Punch Buffer Register + /* + * TODO: Flesh this out if/when we add Paper Tape Punch support + */ + } }, RK11: { // RK11 Disk Controller PRI: 5, @@ -826,6 +844,15 @@ var PDP11 = { RDATA: 0b1100, // Read Data RDNC: 0b1110 // Read Data without Header Check } + }, + VECTORS: { + 0o060: "DL11.RCSR", + 0o064: "DL11.XCSR", + 0o070: "PC11.PRS", + 0o074: "PC11.PPS", + 0o100: "KW11", + 0o160: "RL11", + 0o220: "RK11" } }; diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 6d038e96e..a16d20039 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -90,7 +90,7 @@ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg) device.interruptKW11(); }); - this.kw11.trigger = cpu.addTrigger(PDP11.KW11.VEC, PDP11.KW11.PRI, MessagesPDP11.KW11); + this.kw11.irq = cpu.addIRQ(PDP11.KW11.VEC, PDP11.KW11.PRI, MessagesPDP11.KW11); bus.addIOTable(this, DevicePDP11.UNIBUS_IOTABLE); bus.addResetHandler(this.reset.bind(this)); @@ -176,7 +176,7 @@ DevicePDP11.prototype.interruptKW11 = function() { this.kw11.lks |= PDP11.KW11.LKS.MON; if (this.kw11.lks & PDP11.KW11.LKS.IE) { - this.cpu.setTrigger(this.kw11.trigger); + this.cpu.setIRQ(this.kw11.irq); } if (this.cmp) this.cmp.updateDisplays(1); this.cpu.setTimer(this.kw11.timer, 1000/60); diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js index 2079b0676..94d85b842 100644 --- a/modules/pdp11/lib/pc11.js +++ b/modules/pdp11/lib/pc11.js @@ -280,9 +280,9 @@ PC11.prototype.initBus = function(cmp, bus, cpu, dbg) } } - this.triggerReaderInterrupt = this.cpu.addTrigger(PDP11.PC11.RVEC, PDP11.PC11.PRI, MessagesPDP11.PC11); + this.irqReader = this.cpu.addIRQ(PDP11.PC11.RVEC, PDP11.PC11.PRI, MessagesPDP11.PC11); - this.timerReaderAdvance = this.cpu.addTimer(function readyReader() { + this.timerReader = this.cpu.addTimer(function readyReader() { pc11.advanceReader(); }); @@ -820,7 +820,7 @@ PC11.prototype.advanceReader = function() this.prs |= PDP11.PC11.PRS.DONE; this.prs &= ~PDP11.PC11.PRS.BUSY; if (this.prs & PDP11.PC11.PRS.RIE) { - this.cpu.setTrigger(this.triggerReaderInterrupt); + this.cpu.setIRQ(this.irqReader); } } } @@ -864,7 +864,7 @@ PC11.prototype.writePRS = function(data, addr) if (this.prs & PDP11.PC11.PRS.ERROR) { data &= ~PDP11.PC11.PRS.RE; if (this.prs & PDP11.PC11.PRS.RIE) { - this.cpu.setTrigger(this.triggerReaderInterrupt); + this.cpu.setIRQ(this.irqReader); } } else { this.prs &= ~PDP11.PC11.PRS.DONE; @@ -875,7 +875,7 @@ PC11.prototype.writePRS = function(data, addr) * that's the rate we'll choose as well (ie, 1000ms / 300). As an aside, the original "low speed" * version of the reader ran at 10 CPS. */ - this.cpu.setTimer(this.timerReaderAdvance, this.getBaudTimeout(this.nBaudReceive)); + this.cpu.setTimer(this.timerReader, this.getBaudTimeout(this.nBaudReceive)); } } this.prs = (this.prs & ~PDP11.PC11.PRS.WMASK) | (data & PDP11.PC11.PRS.WMASK); diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index fd2336930..4dc9c0d98 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -290,7 +290,7 @@ RK11.prototype.initBus = function(cmp, bus, cpu, dbg) */ this.initController(); - this.triggerInterrupt = this.cpu.addTrigger(PDP11.RK11.VEC, PDP11.RK11.PRI, MessagesPDP11.RK11); + this.irq = this.cpu.addIRQ(PDP11.RK11.VEC, PDP11.RK11.PRI, MessagesPDP11.RK11); bus.addIOTable(this, RK11.UNIBUS_IOTABLE); bus.addResetHandler(this.reset.bind(this)); @@ -950,9 +950,7 @@ RK11.prototype.processCommand = function() if (fInterrupt) { this.csr &= ~PDP11.RK11.RKCS.GO; this.csr |= PDP11.RK11.RKCS.CRDY; - if (this.csr & PDP11.RK11.RKCS.IE) { - this.cpu.setTrigger(this.triggerInterrupt); - } + if (this.csr & PDP11.RK11.RKCS.IE) this.cpu.setIRQ(this.irq); } }; diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index a78ae03e0..bf10d5aef 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -290,7 +290,7 @@ RL11.prototype.initBus = function(cmp, bus, cpu, dbg) */ this.initController(); - this.triggerInterrupt = this.cpu.addTrigger(PDP11.RL11.VEC, PDP11.RL11.PRI, MessagesPDP11.RL11); + this.irq = this.cpu.addIRQ(PDP11.RL11.VEC, PDP11.RL11.PRI, MessagesPDP11.RL11); bus.addIOTable(this, RL11.UNIBUS_IOTABLE); bus.addResetHandler(this.reset.bind(this)); @@ -965,9 +965,7 @@ RL11.prototype.processCommand = function() if (fInterrupt) { this.csr |= PDP11.RL11.RLCS.DRDY | PDP11.RL11.RLCS.CRDY; - if (this.csr & PDP11.RL11.RLCS.IE) { - this.cpu.setTrigger(this.triggerInterrupt); - } + if (this.csr & PDP11.RL11.RLCS.IE) this.cpu.setIRQ(this.irq); } }; diff --git a/modules/pdp11/lib/serialport.js b/modules/pdp11/lib/serialport.js index 2bcee3518..2ad63efa3 100644 --- a/modules/pdp11/lib/serialport.js +++ b/modules/pdp11/lib/serialport.js @@ -284,42 +284,29 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) var serial = this; - this.triggerReceiveInterrupt = this.cpu.addTrigger(PDP11.DL11.RVEC, PDP11.DL11.PRI, MessagesPDP11.DL11); + this.irqReceiver = this.cpu.addIRQ(PDP11.DL11.RVEC, PDP11.DL11.PRI, MessagesPDP11.DL11); this.timerReceiveInterrupt = this.cpu.addTimer(function readyReceiver() { - if (!(serial.rcsr & PDP11.DL11.RCSR.RD)) { - if (serial.abReceive.length) { - /* - * Here, as elsewhere (eg, the PC11 component), even if I trusted all incoming data - * to be byte values (which I don't), there's also the risk that it could be signed data - * (eg, -128 to 127, instead of 0 to 255). Both risks are good reasons to always mask - * the data assigned to RBUF with 0xff. - */ - serial.rbuf = serial.abReceive.shift() & 0xff; - if (serial.fUpperCase) { - /* - * Automatically transform lower-case ASCII codes to upper-case; fUpperCase should - * only be set when a terminal or some sort of pseudo-display is being used and we don't - * trust it to have its CAPS-LOCK setting correct. - */ - if (serial.rbuf >= 0x61 && serial.rbuf < 0x7A) { - serial.rbuf -= 0x20; - } - } + var b = serial.receiveByte(); + if (b >= 0) { + serial.rbuf = b; + if (!(serial.rcsr & PDP11.DL11.RCSR.RD)) { serial.rcsr |= PDP11.DL11.RCSR.RD; - if (serial.rcsr & PDP11.DL11.RCSR.RIE) { - serial.cpu.setTrigger(serial.triggerReceiveInterrupt); - } + } else { + serial.rbuf |= PDP11.DL11.RBUF.OE | PDP11.DL11.RBUF.ERROR; + } + if (serial.rcsr & PDP11.DL11.RCSR.RIE) { + cpu.setIRQ(serial.irqReceiver); } } }); - this.triggerTransmitInterrupt = this.cpu.addTrigger(PDP11.DL11.XVEC, PDP11.DL11.PRI, MessagesPDP11.DL11); + this.irqTransmitter = this.cpu.addIRQ(PDP11.DL11.XVEC, PDP11.DL11.PRI, MessagesPDP11.DL11); this.timerTransmitInterrupt = this.cpu.addTimer(function readyTransmitter() { serial.xcsr |= PDP11.DL11.XCSR.READY; if (serial.xcsr & PDP11.DL11.XCSR.TIE) { - serial.cpu.setTrigger(serial.triggerTransmitInterrupt); + cpu.setIRQ(serial.irqTransmitter); } }); @@ -544,10 +531,43 @@ SerialPortPDP11.prototype.receiveData = function(data) else { this.abReceive = this.abReceive.concat(data); } + this.cpu.setTimer(this.timerReceiveInterrupt, this.getBaudTimeout(this.nBaudReceive)); + return true; // for now, return true regardless, since we're buffering everything anyway }; +/** + * receiveByte() + * + * @this {SerialPortPDP11} + * @return {number} (0x00-0xff if byte available, -1 if not) + */ +SerialPortPDP11.prototype.receiveByte = function() +{ + var b = -1; + if (this.abReceive.length) { + /* + * Here, as elsewhere (eg, the PC11 component), even if I trusted all incoming data + * to be byte values (which I don't), there's also the risk that it could be signed data + * (eg, -128 to 127, instead of 0 to 255). Both risks are good reasons to always mask + * the data assigned to RBUF with 0xff. + */ + b = this.abReceive.shift() & 0xff; + this.printMessage("receiveByte(" + str.toHexByte(b) + ")"); + if (this.fUpperCase) { + /* + * Automatically transform lower-case ASCII codes to upper-case; fUpperCase should + * only be set when a terminal or some sort of pseudo-display is being used and we don't + * trust it to have its CAPS-LOCK setting correct. + */ + if (b >= 0x61 && b < 0x7A) b -= 0x20; + } + this.cpu.setTimer(this.timerReceiveInterrupt, this.getBaudTimeout(this.nBaudReceive)); + } + return b; +}; + /** * transmitByte(b) * @@ -618,6 +638,13 @@ SerialPortPDP11.prototype.transmitByte = function(b) fTransmitted = true; } + /* + * 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)); + return fTransmitted; }; @@ -655,9 +682,6 @@ SerialPortPDP11.prototype.writeRCSR = function(data, addr) SerialPortPDP11.prototype.readRBUF = function(addr) { this.rcsr &= ~PDP11.DL11.RCSR.RD; - if (this.abReceive.length > 0) { - this.cpu.setTimer(this.timerReceiveInterrupt, this.getBaudTimeout(this.nBaudReceive)); - } return this.rbuf; }; @@ -696,16 +720,17 @@ SerialPortPDP11.prototype.writeXCSR = function(data, addr) /* * If the device is READY, and TIE is being set, then request a hardware interrupt. * - * Conversely, if TIE is being cleared, remove the request; this satisfies a test in MAINDEC TEST 15, - * which appears to clear, set, and clear the Transmitter Interrupt Enable (TIE) bit in rapid succession, - * with the expectation that NO interrupt will be generated. However, this fix also requires a - * complementary change in setTrigger(), to request hardware interrupts with INTQ_DELAY rather than INTQ. + * Conversely, if TIE is being cleared, remove the request; this resolves a problem within + * MAINDEC TEST 15, where the Transmitter Interrupt Enable (TIE) bit is cleared, set, and cleared + * in rapid succession, with the expectation that NO interrupt will be generated. Note that + * this fix also requires a complementary change in setIRQ(), to request hardware interrupts with + * IRQ_DELAY rather than IRQ. */ if (this.xcsr & PDP11.DL11.XCSR.READY) { if (data & PDP11.DL11.XCSR.TIE) { - this.cpu.setTrigger(this.triggerTransmitInterrupt); + this.cpu.setIRQ(this.irqTransmitter); } else { - this.cpu.clearTrigger(this.triggerTransmitInterrupt); + this.cpu.clearIRQ(this.irqTransmitter); } } this.xcsr = (this.xcsr & ~PDP11.DL11.XCSR.WMASK) | (data & PDP11.DL11.XCSR.WMASK); @@ -732,15 +757,8 @@ SerialPortPDP11.prototype.readXBUF = function(addr) */ SerialPortPDP11.prototype.writeXBUF = function(data, addr) { - data &= PDP11.DL11.XBUF.DATA; - this.transmitByte(data); + this.transmitByte(data & PDP11.DL11.XBUF.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.4/pdp11-dbg.js b/versions/pdpjs/1.30.4/pdp11-dbg.js index 5e25f44df..db821a90f 100644 --- a/versions/pdpjs/1.30.4/pdp11-dbg.js +++ b/versions/pdpjs/1.30.4/pdp11-dbg.js @@ -34,8 +34,8 @@ */ for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da":62,"?":63,"@":64, -yc:65,Ef:66,Ff:67,If:68,E:69,Jf:70,Kf:71,Lf:72,Mf:73,Nf:74,Of:75,Pf:76,Qf:77,Rf:78,Sf:79,Tf:80,Q:81,Uf:82,Vf:83,Wf:84,Xf:85,Yf:86,Zf:87,$f:88,ag:89,hd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,bg:97,cg:98,dg:99,d:100,e:101,eg:102,fg:103,gg:104,hg:105,kg:106,k:107,lg:108,mg:109,n:110,ng:111,p:112,q:113,r:114,og:115,t:116,qg:117,rg:118,sg:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Yc:127}; +var ja={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},la={Yc:1,Gf:3,Hf:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64, +zc:65,Ef:66,Ff:67,If:68,E:69,Jf:70,Kf:71,Lf:72,Mf:73,Nf:74,Of:75,Pf:76,Qf:77,Rf:78,Sf:79,Tf:80,Q:81,Uf:82,Vf:83,Wf:84,Xf:85,Yf:86,Zf:87,$f:88,ag:89,jd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,bg:97,cg:98,dg:99,d:100,e:101,eg:102,fg:103,gg:104,hg:105,kg:106,k:107,lg:108,mg:109,n:110,ng:111,p:112,q:113,r:114,og:115,t:116,qg:117,rg:118,sg:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Zc:127}; function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function q(a){return p(a,4,!0)} function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function sa(a){return a.replace(/[&<>"']/g,function(a){return ra[a]})} @@ -50,296 +50,297 @@ function Ja(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}re function Na(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}function Oa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.eb=this.id:(this.fb=this.id.substr(0,b),this.eb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,hb:!1,mc:!1,ma:!1,error:!1};this.bc=null;this.C.error=!1;this.D={};this.j=null;this.pa=d||0;z.push(this)}var eb=void 0,fb={}; +function x(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cc=b.comment;this.kd=b;b=this.id.indexOf(".");0>b?this.eb=this.id:(this.fb=this.id.substr(0,b),this.eb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,hb:!1,nc:!1,ma:!1,error:!1};this.cc=null;this.C.error=!1;this.D={};this.j=null;this.pa=d||0;z.push(this)}var eb=void 0,fb={}; if(window){eb||(eb=window.location.search.substr(1));for(var gb,hb=/\+/g,ib=/([^&=]+)=?([^&]*)/g;gb=ib.exec(eb);)fb[decodeURIComponent(gb[1].replace(hb," "))]=decodeURIComponent(gb[2].replace(hb," "))}function jb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function B(a,b){b||(b=x);a.prototype=jb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var kb=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else kb={},z=[];function lb(a,b,c){kb[a]&&b&&(kb[a][b]=c)}function mb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.f["S"+a]=[0,0,!1,!1,this.Gd,a]}B(Eb);var Fb=7;function Gb(a,b){return a.f[b]&&a.f[b][1]}k=Eb.prototype;k.reset=function(){this.stop()}; -k.ua=function(a,b,c,d){if(this.B&&this.B.ua(a,b,c,d)||this.b&&this.b.ua(a,b,c,d)||this.j&&this.j.ua(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Hb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ib(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Hb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Ib(a,b)}}(this,b),!0):this.parent.ua.call(this,a,b,c,d)}};k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;Jb(b,this,Kb);Lb(b,this.reset.bind(this));Mb(this);Nb(this)};k.Ka=function(a,b){b||(Ob(),this.reset());return!0};k.Ja=function(){return!0}; -function Pb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Mb(a,b){for(var c in a.g)Pb(a,c,null!=b?b:a.g[c])}function Qb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Nb(a){for(var b in a.f)Qb(a,b,a.f[b][1])}function Rb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.ea()),c=8==(a.j&&a.j.ga||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} -function Hb(a,b){var c=a.f[b];Qb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.J="EXAM"==b)}function Ib(a,b){var c=a.f[b];c[2]&&c[3]&&(Qb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ed=function(a){a||this.b.C.X||(a=this.b,a.v.reset(),Sb(a),Gb(this,"ENABLE")&&this.b.ob())};k.Fd=function(){};k.Ad=function(a){a||this.b.ea()}; -k.yd=function(a){if(!a&&!this.b.C.X)if(Gb(this,"ENABLE"))this.b.ob();else{if((a=this.j)&&!xb(a,!0))pb(a,!0),a.pb(0,null),pb(a,!1);else try{var b=this.b.pb(1);0a.b.ib?8:16,c=65472<=a.Aa&&a.Aa<65472+b,b=c?1:2,c=c?15:a.v.Sa;Gb(a,"STEP")||(b=-b);Yb(a,a.Aa&~c|a.Aa+b&c)} -function Yb(a,b){a.Aa=b&a.v.Sa;b=a.Aa;for(var c=0;22>c;c++)$b(a,"A"+c,b&1<c;c++)$b(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.v=this.Ia-1;this.F=this.H/this.Ia|0;this.gb=[];this.qa=0;this.f=!1;this.oc=0;this.A=[];this.md=[rc,sc,tc,uc];a=new K(this);vc(a,this.j);this.Y=Array(this.F);for(b=0;ba;a++)this.f["S"+a]=[0,0,!1,!1,this.Hd,a]}B(Eb);var Fb=7;function Gb(a,b){return a.f[b]&&a.f[b][1]}k=Eb.prototype;k.reset=function(){this.stop()}; +k.va=function(a,b,c,d){if(this.B&&this.B.va(a,b,c,d)||this.b&&this.b.va(a,b,c,d)||this.j&&this.j.va(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){Hb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ib(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Hb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Ib(a,b)}}(this,b),!0):this.parent.va.call(this,a,b,c,d)}};k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;Jb(b,this,Kb);Lb(b,this.reset.bind(this));Mb(this);Nb(this)};k.Ka=function(a,b){b||(Ob(),this.reset());return!0};k.Ja=function(){return!0}; +function Pb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Mb(a,b){for(var c in a.g)Pb(a,c,null!=b?b:a.g[c])}function Qb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Nb(a){for(var b in a.f)Qb(a,b,a.f[b][1])}function Rb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.ea()),c=8==(a.j&&a.j.oa||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} +function Hb(a,b){var c=a.f[b];Qb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Ib(a,b){var c=a.f[b];c[2]&&c[3]&&(Qb(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.C.X||(a=this.b,a.v.reset(),Sb(a),Gb(this,"ENABLE")&&this.b.ob())};k.Gd=function(){};k.Bd=function(a){a||this.b.ea()}; +k.zd=function(a){if(!a&&!this.b.C.X)if(Gb(this,"ENABLE"))this.b.ob();else{if((a=this.j)&&!xb(a,!0))pb(a,!0),a.pb(0,null),pb(a,!1);else try{var b=this.b.pb(1);0a.b.ib?8:16,c=65472<=a.Aa&&a.Aa<65472+b,b=c?1:2,c=c?15:a.v.Sa;Gb(a,"STEP")||(b=-b);Yb(a,a.Aa&~c|a.Aa+b&c)} +function Yb(a,b){a.Aa=b&a.v.Sa;b=a.Aa;for(var c=0;22>c;c++)$b(a,"A"+c,b&1<c;c++)$b(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.v=this.Ia-1;this.F=this.H/this.Ia|0;this.gb=[];this.qa=0;this.f=!1;this.pc=0;this.A=[];this.nd=[rc,sc,tc,uc];a=new K(this);vc(a,this.j);this.Y=Array(this.F);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.gb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} function sc(a,b,c){var d=!1,e=this.controller,f=e.gb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.gb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, b),!0,!e.qa))}function tc(a,b){var c=-1,d=this.controller;a=d.gb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} function uc(a,b,c){var d=!1,e=this.controller;a=e.gb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.qa))} function xc(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.na;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.G)return l.Yb+=l.G-f,l.G=f,!0;if(f>=l.G+l.Yb){n=l.size-(f-m);n>g&&(n=g);l.Yb=f-l.G+n;f=m+a.Ia;g-=n;h++;continue}}return Cc(1,f,g)}f=new K(a,f,n,a.Ia,d,e);vc(f,a.j,l);a.Y[h++]=f;f=m+a.Ia;g-=n}return 0>=g?(d==Dc&&(a.oc+=c),a.status((c>>10)+"Kb "+Ec[d]+" at "+na(b)),!0):Cc(2,b,c)} -function zc(a,b,c){var d=[];for(b>>>=a.na;0>>=a.na;0>>this.na].ec(a&this.v,a)};k.dc=function(a){3932160<=a&&(a=Fc(this.b,a));this.f=!1;this.qa++;a=this.Y[(a&this.Sa)>>>this.na].rc(a&this.v,a);this.qa--;return a}; -k.sa=function(a){3932160<=a&&(a=Fc(this.b,a));return this.Y[(a&this.Sa)>>>this.na].za(a&this.v,a)};k.Va=function(a){3932160<=a&&(a=Fc(this.b,a));var b=a&this.v,c=(a&this.Sa)>>>this.na;this.f=!1;this.qa++;a=this.Y[c].sc(b,a);this.qa--;return a};k.Kb=function(a,b){3932160<=a&&(a=Fc(this.b,a));this.Y[(a&this.Sa)>>>this.na].hc(a&this.v,b&255,a)};k.Cb=function(a,b){3932160<=a&&(a=Fc(this.b,a));this.f=!1;this.qa++;this.Y[(a&this.Sa)>>>this.na].ic(a&this.v,b&255,a);this.qa--}; -k.Db=function(a,b){3932160<=a&&(a=Fc(this.b,a));this.Y[(a&this.Sa)>>>this.na].Zb(a&this.v,b&65535,a)};k.nb=function(a,b){3932160<=a&&(a=Fc(this.b,a));var c=a&this.v,d=(a&this.Sa)>>>this.na;this.f=!1;this.qa++;this.Y[d].xc(c,b&65535,a);this.qa--}; -function Gc(a){for(var b=0,c=[],d=0;d>>a.na;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.G)return l.Zb+=l.G-f,l.G=f,!0;if(f>=l.G+l.Zb){n=l.size-(f-m);n>g&&(n=g);l.Zb=f-l.G+n;f=m+a.Ia;g-=n;h++;continue}}return Cc(1,f,g)}f=new K(a,f,n,a.Ia,d,e);vc(f,a.j,l);a.Y[h++]=f;f=m+a.Ia;g-=n}return 0>=g?(d==Dc&&(a.pc+=c),a.status((c>>10)+"Kb "+Ec[d]+" at "+na(b)),!0):Cc(2,b,c)} +function zc(a,b,c){var d=[];for(b>>>=a.na;0>>=a.na;0>>this.na].fc(a&this.v,a)};k.ec=function(a){3932160<=a&&(a=Fc(this.b,a));this.f=!1;this.qa++;a=this.Y[(a&this.Sa)>>>this.na].sc(a&this.v,a);this.qa--;return a}; +k.ta=function(a){3932160<=a&&(a=Fc(this.b,a));return this.Y[(a&this.Sa)>>>this.na].za(a&this.v,a)};k.Va=function(a){3932160<=a&&(a=Fc(this.b,a));var b=a&this.v,c=(a&this.Sa)>>>this.na;this.f=!1;this.qa++;a=this.Y[c].tc(b,a);this.qa--;return a};k.Lb=function(a,b){3932160<=a&&(a=Fc(this.b,a));this.Y[(a&this.Sa)>>>this.na].ic(a&this.v,b&255,a)};k.Cb=function(a,b){3932160<=a&&(a=Fc(this.b,a));this.f=!1;this.qa++;this.Y[(a&this.Sa)>>>this.na].jc(a&this.v,b&255,a);this.qa--}; +k.Db=function(a,b){3932160<=a&&(a=Fc(this.b,a));this.Y[(a&this.Sa)>>>this.na].$b(a&this.v,b&65535,a)};k.nb=function(a,b){3932160<=a&&(a=Fc(this.b,a));var c=a&this.v,d=(a&this.Sa)>>>this.na;this.f=!1;this.qa++;this.Y[d].yc(c,b&65535,a);this.qa--}; +function Gc(a){for(var b=0,c=[],d=0;da.b.ib)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],r=f[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Sb=128;Lc(this.b,this.f.vc,1E3/60,!0)};k.Od=function(){return this.f.Sb};k.Oe=function(a){this.f.Sb=a&192};k.Qd=function(){return Pc(this.b)};k.Qe=function(a){Qc(this.b,a&-129|this.b.Ca&128)};k.Rd=function(){return Zc(this.b)}; -k.Sd=function(){return $c(this.b)};k.Td=function(){return this.b.Xa};k.Re=function(a){ad(this.b,a)};k.Ae=function(a){a=a>>1&63;var b=this.b.Xb[a>>1];return a&1?b>>16:b&65535};k.Af=function(a,b){b=b>>1&63;var c=b>>1;this.b.Xb[c]=b&1?this.b.Xb[c]&65535|(a&63)<<16:this.b.Xb[c]&-65536|a&65534};k.te=function(a){return this.b.S[1][a>>1&7]};k.tf=function(a,b){this.b.S[1][b>>1&7]=a&65295};k.re=function(a){return this.b.S[1][(a>>1&7)+8]};k.rf=function(a,b){this.b.S[1][(b>>1&7)+8]=a&65295}; -k.se=function(a){return this.b.ka[1][a>>1&7]};k.sf=function(a,b){b=b>>1&7;this.b.ka[1][b]=a;this.b.S[1][b]&=65295};k.qe=function(a){return this.b.ka[1][(a>>1&7)+8]};k.qf=function(a,b){b=(b>>1&7)+8;this.b.ka[1][b]=a;this.b.S[1][b]&=65295};k.Nd=function(a){return this.b.S[0][a>>1&7]};k.Ne=function(a,b){b=b>>1&7;this.b.S[0][b]=a&=65295;I(this,64)&&G(this,"writeKIPDR["+b+"]: "+na(a),!0)};k.Ld=function(a){return this.b.S[0][(a>>1&7)+8]};k.Le=function(a,b){this.b.S[0][(b>>1&7)+8]=a&65295}; -k.Md=function(a){return this.b.ka[0][a>>1&7]};k.Me=function(a,b){b=b>>1&7;this.b.ka[0][b]=a;this.b.S[0][b]&=65295};k.Kd=function(a){return this.b.ka[0][(a>>1&7)+8]};k.Ke=function(a,b){b=(b>>1&7)+8;this.b.ka[0][b]=a;this.b.S[0][b]&=65295};k.ze=function(a){return this.b.S[3][a>>1&7]};k.zf=function(a,b){this.b.S[3][b>>1&7]=a&65295};k.xe=function(a){return this.b.S[3][(a>>1&7)+8]};k.xf=function(a,b){this.b.S[3][(b>>1&7)+8]=a&65295};k.ye=function(a){return this.b.ka[3][a>>1&7]}; -k.yf=function(a,b){b=b>>1&7;this.b.ka[3][b]=a;this.b.S[3][b]&=65295};k.we=function(a){return this.b.ka[3][(a>>1&7)+8]};k.wf=function(a,b){b=(b>>1&7)+8;this.b.ka[3][b]=a;this.b.S[3][b]&=65295};k.Ib=function(a){a&=7;return this.b.P&2048?this.b.cb[a]:this.b.u[a]};k.Lb=function(a,b){b&=7;this.b.P&2048?this.b.cb[b]=a:this.b.u[b]=a};k.Yd=function(){return this.b.P&49152?this.b.Oa[0]:this.b.u[6]};k.We=function(a){this.b.P&49152?this.b.Oa[0]=a:this.b.u[6]=a};k.ae=function(){return this.b.u[7]}; -k.Ze=function(a){this.b.u[7]=a};k.Jb=function(a){a&=7;return this.b.P&2048?this.b.u[a]:this.b.cb[a]};k.Mb=function(a,b){b&=7;this.b.P&2048?this.b.u[b]=a:this.b.cb[b]=a};k.Zd=function(){return 1==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[1]};k.Xe=function(a){1==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[1]=a};k.$d=function(){return 3==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[3]};k.Ye=function(a){3==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[3]=a};k.Jd=function(a){return this.b.Rc[a-65504>>1]}; -k.Je=function(a,b){this.b.Rc[b-65504>>1]=a};k.Oc=function(a){if(65520==a){a=0;switch(Dc){case Dc:a=this.v.oc}a=(a>>6)-1}else a=0;return a};k.Uc=function(){};k.ve=function(){return 1};k.vf=function(){};k.Id=function(){return this.b.Ba};k.Ie=function(){this.b.Ba=0};k.Pd=function(){return this.b.Qc};k.Pe=function(a,b){b&1||(a&=255);this.b.Qc=a};k.Ud=function(a,b){return b?0:this.b.Wb};k.Se=function(a){bd(this.b,a)};k.ue=function(a,b){return b?0:this.b.lb&65280};k.uf=function(a){this.b.lb=a|255}; -k.Xd=function(){return cd(this.b)};k.Ve=function(a){dd(this.b,a&-1793|cd(this.b)&1792);this.b.K|=128};k.Tc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; -var O={},Nc=(O[61568]=[null,null,M.prototype.Ae,M.prototype.Af,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.te,M.prototype.tf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.re,M.prototype.rf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.se,M.prototype.sf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.qe,M.prototype.qf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Nd,M.prototype.Ne,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Ld,M.prototype.Le,"KDPDR",8,1145,64],O[62688]= -[null,null,M.prototype.Md,M.prototype.Me,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Kd,M.prototype.Ke,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Td,M.prototype.Re,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Od,M.prototype.Oe,"LKS"],O[65402]=[null,null,M.prototype.Qd,M.prototype.Qe,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Rd,M.prototype.Tc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Sd,M.prototype.Tc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.ze,M.prototype.zf, -"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.xe,M.prototype.xf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ye,M.prototype.yf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.we,M.prototype.wf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Ib,M.prototype.Lb,"R0SET0"],O[65473]=[null,null,M.prototype.Ib,M.prototype.Lb,"R1SET0"],O[65474]=[null,null,M.prototype.Ib,M.prototype.Lb,"R2SET0"],O[65475]=[null,null,M.prototype.Ib,M.prototype.Lb,"R3SET0"],O[65476]=[null,null,M.prototype.Ib, -M.prototype.Lb,"R4SET0"],O[65477]=[null,null,M.prototype.Ib,M.prototype.Lb,"R5SET0"],O[65478]=[null,null,M.prototype.Yd,M.prototype.We,"R6KERNEL"],O[65479]=[null,null,M.prototype.ae,M.prototype.Ze,"R7KERNEL"],O[65480]=[null,null,M.prototype.Jb,M.prototype.Mb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Jb,M.prototype.Mb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Jb,M.prototype.Mb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Jb,M.prototype.Mb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Jb, -M.prototype.Mb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Jb,M.prototype.Mb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Zd,M.prototype.Xe,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.$d,M.prototype.Ye,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Jd,M.prototype.Je,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Oc,M.prototype.Uc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Oc,M.prototype.Uc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.ve,M.prototype.vf,"SYSID",1,1170],O[65526]= -[null,null,M.prototype.Id,M.prototype.Ie,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Pd,M.prototype.Pe,"MB",1,1170],O[65530]=[null,null,M.prototype.Ud,M.prototype.Se,"PIR"],O[65532]=[null,null,M.prototype.ue,M.prototype.uf,"SL"],O[65534]=[null,null,M.prototype.Xd,M.prototype.Ve,"PSW"],O); +k.Na=function(a,b,c){this.f=!0;this.qa||(this.j&&I(this.j,4)&&G(this.j,"memory fault ("+c+") on "+L(this.j,a),!0,!0),b&&(this.b.Ba|=b),this.b.wa(4,0,a))};function Ic(a){var b=a.f;a.f=!1;return b}function Cc(a,b,c){w("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function M(a){x.call(this,"Device",a,M,256);this.f={M:0,wc:-1}}B(M);k=M.prototype; +k.Ha=function(a,b,c,d){this.v=b;this.B=a;this.b=c;this.j=d;var e=this;this.f.wc=Jc(c,function(){e.f.Ub|=128;e.f.Ub&64&&Kc(e.b,e.f.Sb);e.B&&e.B.xa(1);Lc(e.b,e.f.wc,1E3/60)});this.f.Sb=Mc(64,6,524288);Jb(b,this,Nc);Lb(b,this.reset.bind(this));d&&Oc(d,64,function(a){var b=e.b;N(e,"KIPDR",b.R[0],0,a[0]);N(e,"KDPDR",b.R[0],8,a[0]);N(e,"KIPAR",b.ka[0],0,a[0]);N(e,"KDPAR",b.ka[0],8,a[0],!0);N(e,"SIPDR",b.R[1],0,a[0]);N(e,"SDPDR",b.R[1],8,a[0]);N(e,"SIPAR",b.ka[1],0,a[0]);N(e,"SDPAR",b.ka[1],8,a[0],!0);N(e, +"UIPDR",b.R[3],0,a[0]);N(e,"UDPDR",b.R[3],8,a[0]);N(e,"UIPAR",b.ka[3],0,a[0]);N(e,"UDPAR",b.ka[3],8,a[0],!0)});J(this)};function N(a,b,c,d,e,f){a=a.j;if(!(e&&0>b.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Ub=128;Lc(this.b,this.f.wc,1E3/60,!0)};k.Pd=function(){return this.f.Ub};k.Oe=function(a){this.f.Ub=a&192};k.Rd=function(){return Pc(this.b)};k.Qe=function(a){Qc(this.b,a&-129|this.b.Da&128)};k.Sd=function(){return Zc(this.b)}; +k.Td=function(){return $c(this.b)};k.Ud=function(){return this.b.Xa};k.Re=function(a){ad(this.b,a)};k.Be=function(a){a=a>>1&63;var b=this.b.Yb[a>>1];return a&1?b>>16:b&65535};k.Af=function(a,b){b=b>>1&63;var c=b>>1;this.b.Yb[c]=b&1?this.b.Yb[c]&65535|(a&63)<<16:this.b.Yb[c]&-65536|a&65534};k.ue=function(a){return this.b.R[1][a>>1&7]};k.tf=function(a,b){this.b.R[1][b>>1&7]=a&65295};k.se=function(a){return this.b.R[1][(a>>1&7)+8]};k.rf=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295}; +k.te=function(a){return this.b.ka[1][a>>1&7]};k.sf=function(a,b){b=b>>1&7;this.b.ka[1][b]=a;this.b.R[1][b]&=65295};k.re=function(a){return this.b.ka[1][(a>>1&7)+8]};k.qf=function(a,b){b=(b>>1&7)+8;this.b.ka[1][b]=a;this.b.R[1][b]&=65295};k.Od=function(a){return this.b.R[0][a>>1&7]};k.Ne=function(a,b){b=b>>1&7;this.b.R[0][b]=a&=65295;I(this,64)&&G(this,"writeKIPDR["+b+"]: "+na(a),!0)};k.Md=function(a){return this.b.R[0][(a>>1&7)+8]};k.Le=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295}; +k.Nd=function(a){return this.b.ka[0][a>>1&7]};k.Me=function(a,b){b=b>>1&7;this.b.ka[0][b]=a;this.b.R[0][b]&=65295};k.Ld=function(a){return this.b.ka[0][(a>>1&7)+8]};k.Ke=function(a,b){b=(b>>1&7)+8;this.b.ka[0][b]=a;this.b.R[0][b]&=65295};k.Ae=function(a){return this.b.R[3][a>>1&7]};k.zf=function(a,b){this.b.R[3][b>>1&7]=a&65295};k.ye=function(a){return this.b.R[3][(a>>1&7)+8]};k.xf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295};k.ze=function(a){return this.b.ka[3][a>>1&7]}; +k.yf=function(a,b){b=b>>1&7;this.b.ka[3][b]=a;this.b.R[3][b]&=65295};k.xe=function(a){return this.b.ka[3][(a>>1&7)+8]};k.wf=function(a,b){b=(b>>1&7)+8;this.b.ka[3][b]=a;this.b.R[3][b]&=65295};k.Ib=function(a){a&=7;return this.b.P&2048?this.b.cb[a]:this.b.u[a]};k.Mb=function(a,b){b&=7;this.b.P&2048?this.b.cb[b]=a:this.b.u[b]=a};k.Zd=function(){return this.b.P&49152?this.b.Oa[0]:this.b.u[6]};k.We=function(a){this.b.P&49152?this.b.Oa[0]=a:this.b.u[6]=a};k.be=function(){return this.b.u[7]}; +k.Ze=function(a){this.b.u[7]=a};k.Jb=function(a){a&=7;return this.b.P&2048?this.b.u[a]:this.b.cb[a]};k.Nb=function(a,b){b&=7;this.b.P&2048?this.b.u[b]=a:this.b.cb[b]=a};k.$d=function(){return 1==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[1]};k.Xe=function(a){1==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[1]=a};k.ae=function(){return 3==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[3]};k.Ye=function(a){3==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[3]=a};k.Kd=function(a){return this.b.Sc[a-65504>>1]}; +k.Je=function(a,b){this.b.Sc[b-65504>>1]=a};k.Pc=function(a){if(65520==a){a=0;switch(Dc){case Dc:a=this.v.pc}a=(a>>6)-1}else a=0;return a};k.Vc=function(){};k.we=function(){return 1};k.vf=function(){};k.Jd=function(){return this.b.Ba};k.Ie=function(){this.b.Ba=0};k.Qd=function(){return this.b.Rc};k.Pe=function(a,b){b&1||(a&=255);this.b.Rc=a};k.Vd=function(a,b){return b?0:this.b.Kb};k.Se=function(a){bd(this.b,a)};k.ve=function(a,b){return b?0:this.b.lb&65280};k.uf=function(a){this.b.lb=a|255}; +k.Yd=function(){return cd(this.b)};k.Ve=function(a){dd(this.b,a&-1793|cd(this.b)&1792);this.b.J|=128};k.Uc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; +var O={},Nc=(O[61568]=[null,null,M.prototype.Be,M.prototype.Af,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.ue,M.prototype.tf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.se,M.prototype.rf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.te,M.prototype.sf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.re,M.prototype.qf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Od,M.prototype.Ne,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Md,M.prototype.Le,"KDPDR",8,1145,64],O[62688]= +[null,null,M.prototype.Nd,M.prototype.Me,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Ld,M.prototype.Ke,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Ud,M.prototype.Re,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Pd,M.prototype.Oe,"LKS"],O[65402]=[null,null,M.prototype.Rd,M.prototype.Qe,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Sd,M.prototype.Uc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Td,M.prototype.Uc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.Ae,M.prototype.zf, +"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.ye,M.prototype.xf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ze,M.prototype.yf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.xe,M.prototype.wf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Ib,M.prototype.Mb,"R0SET0"],O[65473]=[null,null,M.prototype.Ib,M.prototype.Mb,"R1SET0"],O[65474]=[null,null,M.prototype.Ib,M.prototype.Mb,"R2SET0"],O[65475]=[null,null,M.prototype.Ib,M.prototype.Mb,"R3SET0"],O[65476]=[null,null,M.prototype.Ib, +M.prototype.Mb,"R4SET0"],O[65477]=[null,null,M.prototype.Ib,M.prototype.Mb,"R5SET0"],O[65478]=[null,null,M.prototype.Zd,M.prototype.We,"R6KERNEL"],O[65479]=[null,null,M.prototype.be,M.prototype.Ze,"R7KERNEL"],O[65480]=[null,null,M.prototype.Jb,M.prototype.Nb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Jb,M.prototype.Nb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Jb,M.prototype.Nb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Jb,M.prototype.Nb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Jb, +M.prototype.Nb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Jb,M.prototype.Nb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.$d,M.prototype.Xe,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.ae,M.prototype.Ye,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Kd,M.prototype.Je,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Pc,M.prototype.Vc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Pc,M.prototype.Vc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.we,M.prototype.vf,"SYSID",1,1170],O[65526]= +[null,null,M.prototype.Jd,M.prototype.Ie,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Qd,M.prototype.Pe,"MB",1,1170],O[65530]=[null,null,M.prototype.Vd,M.prototype.Se,"PIR"],O[65532]=[null,null,M.prototype.ve,M.prototype.uf,"SL"],O[65534]=[null,null,M.prototype.Yd,M.prototype.Ve,"PSW"],O); ab(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.A,0,this.size>>2),ld(this,hd?md:nd);else{a=this.b=Array(this.size>> +function K(a,b,c,d,e,f){this.v=a;this.id=id+=2;this.b=null;this.G=b;this.Zb=c;this.size=d||0;this.type=e||jd;this.f=e==kd;this.controller=null;vc(this);this.$a=this.ud=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],ld(this,f.nd);else if(Bb)this.A=new ArrayBuffer(this.size),this.F=new DataView(this.A,0,this.size),this.D=new Uint8Array(this.A,0,this.size),this.I=new Uint16Array(this.A,0,this.size>>1),this.b=new Int32Array(this.A,0,this.size>>2),ld(this,hd?md:nd);else{a=this.b=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},U:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},fa:function(a,b){a&1&&this.v.Na(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ -1]&255)<<8},Da: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.$a=!0},R:function(a,b){if(this.j&&null!=this.G){var c=this.j;sd(c,this.G+a,1,c.O)&&c.ea(!0)}return this.rc(a,b)},eb:function(a,b){if(this.j&&null!=this.G){var c=this.j;sd(c,this.G+a,2,c.O)&&c.ea(!0)}return this.sc(a,b)},oa:function(a, -b,c){if(this.j&&null!=this.G){var d=this.j;sd(d,this.G+a,1,d.F)&&d.ea(!0)}this.f?this.w(a,b,c):this.ic(a,b,c)},Fa:function(a,b,c){if(this.j&&null!=this.G){var d=this.j;sd(d,this.G+a,2,d.F)&&d.ea(!0)}this.f?this.w(a,b,c):this.xc(a,b,c)},O:function(a){return this.D[a]},T:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ba:function(a,b){a&1&&this.v.Na(b,64,2);return this.F.getUint16(a,!0)},fb:function(a,b){a&1&&this.v.Na(b,64,2); -a=this.I[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ga:function(a,b){this.D[a]=b;this.$a=!0},xa:function(a,b,c){this.D[a]=b;this.$a=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Ea:function(a,b,c){a&1&&this.v.Na(c,64,4);this.F.setUint16(a,b,!0);this.$a=!0},Ga:function(a,b,c){a&1&&this.v.Na(c,64,4);this.I[a>>1]=b;this.$a=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, -b)+")",!0)}};function vc(a,b,c){a.j=b;a.B=a.g=0;c&&((a.B=c.B)&&rd(a,qd,!1),(a.g=c.g)&&pd(a,qd,!1))}function td(a,b){b?--a.g||(a.hc=a.f?a.w:a.ic,a.Zb=a.f?a.H:a.xc):--a.B||(a.ec=a.rc,a.za=a.sc)}function pd(a,b,c){c&&a.g||(a.hc=!a.f&&b[1]||a.w,a.Zb=!a.f&&b[3]||a.H);if(c||void 0===c)a.ic=b[1]||a.w,a.xc=b[3]||a.H}function rd(a,b,c){c&&a.B||(a.ec=b[0]||a.J,a.za=b[2]||a.L);if(c||void 0===c)a.rc=b[0]||a.J,a.sc=b[2]||a.L}function ld(a,b){b||(b=ud);rd(a,b,void 0);pd(a,b,void 0)} -var ud=[],od=[K.prototype.U,K.prototype.Da,K.prototype.fa,K.prototype.Pa],qd=[K.prototype.R,K.prototype.oa,K.prototype.eb,K.prototype.Fa];if(Bb)var nd=[K.prototype.O,K.prototype.ga,K.prototype.ba,K.prototype.Ea],md=[K.prototype.T,K.prototype.xa,K.prototype.fb,K.prototype.Ga]; -function vd(a,b){x.call(this,"CPU",a,vd,1);b=a.cycles||b;var c=a.multiplier||1;this.Nb=0;this.tb=b;this.jb=c;this.Pb=Math.round(this.tb/1E4)/100;this.Ab=this.Pb*this.jb;this.C.X=!1;this.C.gc=!1;this.C.Eb=a.autoStart;this.C.Fb=!1;this.Tb=this.Ea=0;this.Ub=a.csStart;this.Gb=a.csInterval;this.Hb=a.csStop;this.L=[];this.Fc=this.Ee.bind(this);J(this)}B(vd);var wd=["power","reset"];k=vd.prototype; -k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.j=d;this.w=a.w;for(b=0;b=a.Ea&&(a.Ea+=a.Gb,c=!0);0<=a.Hb&&a.Hb<=Cd(a)&&(a.Gb=a.Hb=-1,zd(a),a.ea(),c=!0);c&&a.i(Cd(a)+" cycles: checksum="+p(a.Tb))}} -k.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.C.ma)a=!0;else{var b=null,c,h=mb(a.id);for(c=0;ca.Da/a.Ab?b=1:d=!0;a.jb=b;b=a.Pb*a.jb;if(a.Ab!=b){a.Ab=b;b=a.Ab.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.B&&a.B.mb()}Ub(a,a.ba);a.ba=0;a.U=Ba();a.fa=0;Ed(a);return d}function Jc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Lc(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.tb*a.jb/1E3*c|0,a.C.X&&(c+=Fd(a)),a.L[b][0]=c)} -function Gd(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 Tb(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 Fd(a,b){var c=a.ga-=a.b;a.b=a.I=0;b&&(a.ga=0);return c} -k.Ee=function(){if(this.C.X){this.Qb>=this.tb&&Ed(this,!0);this.Ya=0;this.sb=Ba();if(this.fa){var a=this.sb-this.fa;a>this.Dc&&(this.U+=a,this.U>this.sb&&(this.U=this.sb))}try{do{var b=Gd(this,this.C.Fb?1:this.ub);try{this.pb(b)}catch(e){if("number"!=typeof e)throw e;}b=Fd(this,!0);this.Ya+=b;this.ba+=b;Vb(this,b);Tb(this,b);this.Fa-=b;if(0>=this.Fa){this.Fa+=this.ub;15<=++this.Ec&&(this.wa(),this.Ec=0);break}}while(this.C.X)}catch(e){this.ea();this.B&&this.B.stop(Ba(),Cd(this));Ab(this,e.stack|| -e.message);return}if(this.C.X){a=setTimeout;b=this.Fc;this.fa=Ba();var c=this.Dc;this.Ya&&(c=Math.round(c*this.Ya/this.ub));var c=c-(this.fa-this.sb),d=this.fa-this.U;d&&(this.Da=Math.round(this.ba/(10*d))/100,864E5<=d&&(this.oa=0,Dd(this)));if(0>c||this.Dac&&(this.U-=c),c=0;this.Qb+=this.Ya;this.fa+=c;a(b,c)}}}; -k.ob=function(a){if(zb(this))return!1;if(this.C.X)return this.i(this.toString()+" busy"),!1;Dd(this);this.C.X=!0;this.C.gc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.mb(!0),this.B.start(this.U,Cd(this)));setTimeout(this.Fc,0);return!0};k.pb=function(){return 0};k.ea=function(a){var b=!1;if(this.C.X){Fd(this);Ub(this,this.ba);this.ba=0;this.C.X=!1;if(b=this.D.run)b.textContent="Run";this.B&&this.B.stop(Ba(),Cd(this));b=!0}this.C.complete=a;return b}; -function Hd(a){this.ib=+a.model||1170;this.Ac=a.addrReset||0;vd.call(this,a,6666667);this.vb=0;this.Cc=255;1120==this.ib?(this.decode=Id.bind(this),this.xa=this.rd,this.vb=8,this.Cc=-1):(this.decode=Jd.bind(this),this.xa=this.sd);Kd(this);this.J=0;this.R=null;this.C.complete=!1}B(Hd,vd);k=Hd.prototype;k.reset=function(){this.status("model "+this.ib);this.C.X&&this.ea();Kd(this);yd(this);this.C.error=!1;this.parent.reset.call(this)}; -function Kd(a){a.V=65536;a.W=32768;a.ca=65535;a.aa=32768;a.P=15;a.u=[0,0,0,0,0,0,0,a.Ac,-1,-2,-3,-4,-5,-6,-7,-8];a.cb=[0,0,0,0,0,0];a.Oa=[0,0,0,0];a.A=0;a.rb=0;a.gd=[4,2,0,1];a.S=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ka=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Xb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Rc=[0,0,0,0,0,0,0,0];a.Qc=0;a.K=0;a.F=a.H=0;a.g=a.f=a.Ob=0;a.Ga=-1;Sb(a)}function Sb(a){a.Ca=0;a.jc=0;a.kc=0;a.Xa=0;a.Ba=0;a.Wb=0;a.lb=255;a.O=0;a.qb=0;a.Pa=262143;a.Rb=0;a.ta=0;a.R=null;a.v&&Ld(a)}function Ld(a){a.O?(a.T=65536,a.zc=a.Xa&16?4186112:253952,a.da=a.vd,a.za=a.Be,a.Zb=a.Bf,xc(a.v,a.Xa&16?22:18)):(a.T=0,a.zc=57344,a.da=a.ud,a.za=a.Pc,a.Zb=a.Vc,xc(a.v,16))} -function Pc(a){var b=a.Ca;b&57344||(b=b&-3199|a.qb<<5|a.rb<<1);return b}function Qc(a,b){b&=-3073;if(a.Ca!=b){b&57344&&!(a.Ca&57344)&&(a.jc=a.ta>>16&65535,a.kc=a.ta&65535);a.Ca=b;a.qb=b>>5&3;a.rb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.O!=c&&(a.O=c,Ld(a))}}function Zc(a){a.Ca&57344||(a.jc=a.ta>>16&65535);a=a.jc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function $c(a){a.Ca&57344||(a.kc=a.ta&65535);return a.kc}function ad(a,b){1170>a.ib&&(b&=-49);a.Xa!=b&&(a.Xa=b,a.Pa=b&16?4194303:262143,Ld(a))} -k.Kc=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.oa,this.jb]);a.set(2,Gc(this.v));return a.data()};k.restore=function(a){var b=a[1];this.oa=b[1];Dd(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.P>>14&3;a.A!=c&&(a.Oa[c]=a.u[6],a.u[6]=a.Oa[a.A]);a.P=b;a.K|=2}function bd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1)}a.Wb=b;a.K|=2}function U(a,b){a.K&128||(a.aa=a.ca=b,a.W=0)}function Ud(a,b,c){a.K&128||(a.aa=a.ca=a.V=b,a.W=c||0)}function Vd(a,b,c,d){a.K&128||(a.aa=a.ca=a.V=b,a.W=(c^b)&(d^b))} -function Wd(a,b){a.K&128||(a.aa=a.ca=a.V=b,a.W=a.aa^a.V>>1)}function Xd(a,b,c,d){a.K&128||(a.aa=a.ca=a.V=b,a.W=(c^d)&(d^b))}k.va=function(a,b,c){if(!this.J){0>this.Ga?this.Ga=cd(this):this.A||(c=-3);var d=!1;-3==c&&(a=4,this.Ba|=4,this.u[6]=4,d=!0);this.ta=a|4143316992;this.A=0;var e=this.za(a|this.T),f=this.za(a+2&65535|this.T);dd(this,f&-12289|this.Ga>>2&12288);Yd(this,this.Ga,d);Yd(this,this.u[7],d);T(this,e);this.K&=~(b|18);this.K|=9;this.Ga=-1;this.ld=a;this.Wc=c;if(-3<=c)throw a;}}; -function Zd(a){var b=ue(a),c=ue(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);T(a,b);dd(a,c);a.K&=-17}function Fc(a,b){var c=b>>13&31;31>c&&(b=a.Xa&32?a.Xb[c]+(b&8190)&4194302:b&-3932161);return b} -function ve(a,b,c){var d,e,f;if(!(c&a.O))return f=b&65535,57344<=f&&(f|=a.zc),f;d=b>>13;a.Xa&a.gd[a.A]||(d&=7);e=a.S[a.A][d];f=(a.ka[a.A][d]<<6)+(b&8191)&a.Pa;if(a.J)return f;f&1&&!(c&1)&&(a.Ba|=64,a.va(4,0,f));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.S[a.A][d]=e;if(f!=(4194170&a.Pa)||a.A)a.qb= -a.A,a.rb=d;g&&(g&57344&&(0<=a.Ga&&(g|=128),a.Ca&57344||(g|=a.Ca&4096|a.qb<<5|a.rb<<1,Qc(a,a.Ca&-61695|g&61694)),a.va(168,64,-1)),a.Ca&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Ca|=4096,a.Ca&512&&(a.K|=64)));return f}function we(a,b){return a.v.cc(b)}function ue(a){var b=a.za(a.u[6]|a.T);a.u[6]=a.u[6]+2&65535;return b}function Yd(a,b,c){var d=a.u[6]-2&65535;a.u[6]=d;a.ta=a.ta&65535|(a.ta&-65536)<<8|16121856;c||a.xa(4,-2,d);a.Zb(d,b)} -function xe(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return a.va(4,0,-2),0;case 1:return 6==c&&a.xa(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.xa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.za(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.xa(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.za(e)|g;a.b-=8;break;case 6:return e=a.za(Rd(a,2)),e=e+a.u[c]&65535,6==c&&a.xa(d, -0,e),a.b-=6,e|g;case 7:return e=a.za(Rd(a,2)),e=e+a.u[c]&65535,e=a.za(e|a.T),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.ta=a.ta&65535|(a.ta&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.A&&0>=b&&c<=this.lb&&(this.K|=32)};k.sd=function(a,b,c){this.A||(65534<=c&&(c|=-65536),a&4&&c<=this.lb&&(c<=this.lb-32?this.va(4,0,-3):(this.Ba|=8,this.K|=32)))};k.dc=function(a){if(!this.O)return this.v.dc(a);this.J++;a=we(this,ve(this,a,3));this.J--;return a}; -k.Va=function(a){if(!this.O)return this.v.Va(a);this.J++;a=this.Pc(ve(this,a,2));this.J--;return a};k.Cb=function(a,b){this.O?(this.J++,a=ve(this,a,5),a&1&&this.b--,this.v.Kb(a,b),this.J--):this.v.Cb(a,b)};k.nb=function(a,b){this.O?(this.J++,this.Vc(ve(this,a,4),b),this.J--):this.v.nb(a,b)};k.ud=function(a,b,c){return xe(this,a,b,c)};k.vd=function(a,b,c){return ve(this,xe(this,a,b,c),c)};k.Pc=function(a){return this.v.sa(this.Rb=a)};k.Be=function(a){return this.v.sa(this.Rb=ve(this,a,2))}; -k.Vc=function(a,b){this.v.Db(this.Rb=a,b&65535)};k.Bf=function(a,b){this.v.Db(this.Rb=ve(this,a,4),b)};function ye(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=xe(a,b,d,2),c&65536||61440!==(a.P&61440)&&(d&=65535),a.A=a.P>>12&3,c=a.za(d|c&a.T),a.A=a.P>>14&3):c=6!=d||(a.P>>2&12288)===(a.P&12288)?a.u[d]:a.Oa[a.P>>12&3];return c} -function ze(a,b,c,d){a.ta=a.ta&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=xe(a,b,e,4),c&65536||(e&=65535),a.A=a.P>>12&3,e=ve(a,e|c&65536,4),a.A=a.P>>14&3,a.v.Db(e,d)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.Oa[a.P>>12&3]=d}function Ae(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?we(a,a.da(b,c,3)):a.u[c+a.vb]&a.Cc}function Be(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?a.v.sa(a.da(b,c,2)):a.u[c+a.vb]}function Ce(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return xe(a,b,c,8)} -function De(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?we(a,a.da(b,c,3)):a.u[c]&255}function Ee(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.sa(a.da(b,c,2)):a.u[c]}function Fe(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Ob=a.da(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,we(a,e)),e&1&&a.b--,a.v.Kb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))} -function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.da(b,e,6),a.v.Db(e,d.call(a,0>c?a.u[-c-1]:c,a.v.sa(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}function Ge(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.da(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Kb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function He(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.da(b,d,4),a.v.Db(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c} +K.prototype={constructor:K,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Bb)for(a=Array(this.size>>2),b=0;b>8,c)},U:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},fa:function(a,b){a&1&&this.v.Na(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ +1]&255)<<8},Ea: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.$a=!0},S:function(a,b){if(this.j&&null!=this.G){var c=this.j;sd(c,this.G+a,1,c.O)&&c.ea(!0)}return this.sc(a,b)},eb:function(a,b){if(this.j&&null!=this.G){var c=this.j;sd(c,this.G+a,2,c.O)&&c.ea(!0)}return this.tc(a,b)},oa:function(a, +b,c){if(this.j&&null!=this.G){var d=this.j;sd(d,this.G+a,1,d.F)&&d.ea(!0)}this.f?this.w(a,b,c):this.jc(a,b,c)},Fa:function(a,b,c){if(this.j&&null!=this.G){var d=this.j;sd(d,this.G+a,2,d.F)&&d.ea(!0)}this.f?this.w(a,b,c):this.yc(a,b,c)},O:function(a){return this.D[a]},T:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ba:function(a,b){a&1&&this.v.Na(b,64,2);return this.F.getUint16(a,!0)},fb:function(a,b){a&1&&this.v.Na(b,64,2); +a=this.I[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ga:function(a,b){this.D[a]=b;this.$a=!0},sa:function(a,b,c){this.D[a]=b;this.$a=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Ca:function(a,b,c){a&1&&this.v.Na(c,64,4);this.F.setUint16(a,b,!0);this.$a=!0},Ga:function(a,b,c){a&1&&this.v.Na(c,64,4);this.I[a>>1]=b;this.$a=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, +b)+")",!0)}};function vc(a,b,c){a.j=b;a.B=a.g=0;c&&((a.B=c.B)&&rd(a,qd,!1),(a.g=c.g)&&pd(a,qd,!1))}function td(a,b){b?--a.g||(a.ic=a.f?a.w:a.jc,a.$b=a.f?a.H:a.yc):--a.B||(a.fc=a.sc,a.za=a.tc)}function pd(a,b,c){c&&a.g||(a.ic=!a.f&&b[1]||a.w,a.$b=!a.f&&b[3]||a.H);if(c||void 0===c)a.jc=b[1]||a.w,a.yc=b[3]||a.H}function rd(a,b,c){c&&a.B||(a.fc=b[0]||a.K,a.za=b[2]||a.L);if(c||void 0===c)a.sc=b[0]||a.K,a.tc=b[2]||a.L}function ld(a,b){b||(b=ud);rd(a,b,void 0);pd(a,b,void 0)} +var ud=[],od=[K.prototype.U,K.prototype.Ea,K.prototype.fa,K.prototype.Pa],qd=[K.prototype.S,K.prototype.oa,K.prototype.eb,K.prototype.Fa];if(Bb)var nd=[K.prototype.O,K.prototype.ga,K.prototype.ba,K.prototype.Ca],md=[K.prototype.T,K.prototype.sa,K.prototype.fb,K.prototype.Ga]; +function vd(a,b){x.call(this,"CPU",a,vd,1);b=a.cycles||b;var c=a.multiplier||1;this.Ob=0;this.tb=b;this.jb=c;this.Qb=Math.round(this.tb/1E4)/100;this.Ab=this.Qb*this.jb;this.C.X=!1;this.C.hc=!1;this.C.Eb=a.autoStart;this.C.Fb=!1;this.Vb=this.Ca=0;this.Wb=a.csStart;this.Gb=a.csInterval;this.Hb=a.csStop;this.O=[];this.Gc=this.Fe.bind(this);J(this)}B(vd);var wd=["power","reset"];k=vd.prototype; +k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.j=d;this.w=a.w;for(b=0;b=a.Ca&&(a.Ca+=a.Gb,c=!0);0<=a.Hb&&a.Hb<=Cd(a)&&(a.Gb=a.Hb=-1,zd(a),a.ea(),c=!0);c&&a.i(Cd(a)+" cycles: checksum="+p(a.Vb))}} +k.va=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.C.ma)a=!0;else{var b=null,c,h=mb(a.id);for(c=0;ca.Ea/a.Ab?b=1:d=!0;a.jb=b;b=a.Qb*a.jb;if(a.Ab!=b){a.Ab=b;b=a.Ab.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.B&&a.B.mb()}Ub(a,a.ba);a.ba=0;a.U=Ba();a.fa=0;Ed(a);return d}function Jc(a,b){var c=a.O.length;a.O.push([-1,b]);return c}function Lc(a,b,c,d){0<=b&&ba.O[b][0])&&(c=a.tb*a.jb/1E3*c|0,a.C.X&&(c+=Fd(a)),a.O[b][0]=c)} +function Gd(a,b){for(var c=a.O.length-1;0<=c;c--){var d=a.O[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Tb(a,b){for(var c=a.O.length-1;0<=c;c--){var d=a.O[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fd(a,b){var c=a.ga-=a.b;a.b=a.I=0;b&&(a.ga=0);return c} +k.Fe=function(){if(this.C.X){this.Rb>=this.tb&&Ed(this,!0);this.Ya=0;this.sb=Ba();if(this.fa){var a=this.sb-this.fa;a>this.Ec&&(this.U+=a,this.U>this.sb&&(this.U=this.sb))}try{do{var b=Gd(this,this.C.Fb?1:this.ub);try{this.pb(b)}catch(e){if("number"!=typeof e)throw e;}b=Fd(this,!0);this.Ya+=b;this.ba+=b;Vb(this,b);Tb(this,b);this.Fa-=b;if(0>=this.Fa){this.Fa+=this.ub;15<=++this.Fc&&(this.xa(),this.Fc=0);break}}while(this.C.X)}catch(e){this.ea();this.B&&this.B.stop(Ba(),Cd(this));Ab(this,e.stack|| +e.message);return}if(this.C.X){a=setTimeout;b=this.Gc;this.fa=Ba();var c=this.Ec;this.Ya&&(c=Math.round(c*this.Ya/this.ub));var c=c-(this.fa-this.sb),d=this.fa-this.U;d&&(this.Ea=Math.round(this.ba/(10*d))/100,864E5<=d&&(this.oa=0,Dd(this)));if(0>c||this.Eac&&(this.U-=c),c=0;this.Rb+=this.Ya;this.fa+=c;a(b,c)}}}; +k.ob=function(a){if(zb(this))return!1;if(this.C.X)return this.i(this.toString()+" busy"),!1;Dd(this);this.C.X=!0;this.C.hc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.mb(!0),this.B.start(this.U,Cd(this)));setTimeout(this.Gc,0);return!0};k.pb=function(){return 0};k.ea=function(a){var b=!1;if(this.C.X){Fd(this);Ub(this,this.ba);this.ba=0;this.C.X=!1;if(b=this.D.run)b.textContent="Run";this.B&&this.B.stop(Ba(),Cd(this));b=!0}this.C.complete=a;return b}; +function Hd(a){this.ib=+a.model||1170;this.Bc=a.addrReset||0;vd.call(this,a,6666667);this.vb=0;this.Dc=255;1120==this.ib?(this.decode=Id.bind(this),this.sa=this.sd,this.vb=8,this.Dc=-1):(this.decode=Jd.bind(this),this.sa=this.td);Kd(this);this.L=0;this.K=null;this.C.complete=!1}B(Hd,vd);k=Hd.prototype;k.reset=function(){this.status("model "+this.ib);this.C.X&&this.ea();Kd(this);yd(this);this.C.error=!1;this.parent.reset.call(this)}; +function Kd(a){a.V=65536;a.W=32768;a.ca=65535;a.aa=32768;a.P=15;a.u=[0,0,0,0,0,0,0,a.Bc,-1,-2,-3,-4,-5,-6,-7,-8];a.cb=[0,0,0,0,0,0];a.Oa=[0,0,0,0];a.A=0;a.rb=0;a.hd=[4,2,0,1];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ka=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0]];a.Yb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Sc=[0,0,0,0,0,0,0,0];a.Rc=0;a.J=0;a.F=a.H=0;a.g=a.f=a.Pb=0;a.Ga=-1;Sb(a)}function Sb(a){a.Da=0;a.kc=0;a.lc=0;a.Xa=0;a.Ba=0;a.Kb=0;a.lb=255;a.S=0;a.qb=0;a.Pa=262143;a.Tb=0;a.ua=0;a.K=null;a.v&&Ld(a)}function Ld(a){a.S?(a.T=65536,a.Ac=a.Xa&16?4186112:253952,a.da=a.wd,a.za=a.Ce,a.$b=a.Bf,xc(a.v,a.Xa&16?22:18)):(a.T=0,a.Ac=57344,a.da=a.vd,a.za=a.Qc,a.$b=a.Wc,xc(a.v,16))} +function Pc(a){var b=a.Da;b&57344||(b=b&-3199|a.qb<<5|a.rb<<1);return b}function Qc(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.kc=a.ua>>16&65535,a.lc=a.ua&65535);a.Da=b;a.qb=b>>5&3;a.rb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.S!=c&&(a.S=c,Ld(a))}}function Zc(a){a.Da&57344||(a.kc=a.ua>>16&65535);a=a.kc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function $c(a){a.Da&57344||(a.lc=a.ua&65535);return a.lc}function ad(a,b){1170>a.ib&&(b&=-49);a.Xa!=b&&(a.Xa=b,a.Pa=b&16?4194303:262143,Ld(a))} +k.Lc=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.oa,this.jb]);a.set(2,Gc(this.v));return a.data()};k.restore=function(a){var b=a[1];this.oa=b[1];Dd(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.P>>14&3;a.A!=c&&(a.Oa[c]=a.u[6],a.u[6]=a.Oa[a.A]);a.P=b;a.J|=2}function bd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.J|=2}a.Kb=b}function U(a,b){a.J&128||(a.aa=a.ca=b,a.W=0)}function Ud(a,b,c){a.J&128||(a.aa=a.ca=a.V=b,a.W=c||0)}function Vd(a,b,c,d){a.J&128||(a.aa=a.ca=a.V=b,a.W=(c^b)&(d^b))} +function Wd(a,b){a.J&128||(a.aa=a.ca=a.V=b,a.W=a.aa^a.V>>1)}function Xd(a,b,c,d){a.J&128||(a.aa=a.ca=a.V=b,a.W=(c^d)&(d^b))}k.wa=function(a,b,c){if(!this.L){0>this.Ga?this.Ga=cd(this):this.A||(c=-3);var d=!1;-3==c&&(a=4,this.Ba|=4,this.u[6]=4,d=!0);this.ua=a|4143316992;this.A=0;var e=this.za(a|this.T),f=this.za(a+2&65535|this.T);dd(this,f&-12289|this.Ga>>2&12288);Yd(this,this.Ga,d);Yd(this,this.u[7],d);T(this,e);this.J&=~(b|18);this.J|=9;this.Ga=-1;this.md=a;this.Xc=c;if(-3<=c)throw a;}}; +function Zd(a){var b=te(a),c=te(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);T(a,b);dd(a,c);a.J&=-17}function Fc(a,b){var c=b>>13&31;31>c&&(b=a.Xa&32?a.Yb[c]+(b&8190)&4194302:b&-3932161);return b} +function ue(a,b,c){var d,e,f;if(!(c&a.S))return f=b&65535,57344<=f&&(f|=a.Ac),f;d=b>>13;a.Xa&a.hd[a.A]||(d&=7);e=a.R[a.A][d];f=(a.ka[a.A][d]<<6)+(b&8191)&a.Pa;if(a.L)return f;f&1&&!(c&1)&&(a.Ba|=64,a.wa(4,0,f));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.R[a.A][d]=e;if(f!=(4194170&a.Pa)||a.A)a.qb= +a.A,a.rb=d;g&&(g&57344&&(0<=a.Ga&&(g|=128),a.Da&57344||(g|=a.Da&4096|a.qb<<5|a.rb<<1,Qc(a,a.Da&-61695|g&61694)),a.wa(168,64,-1)),a.Da&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function ve(a,b){return a.v.dc(b)}function te(a){var b=a.za(a.u[6]|a.T);a.u[6]=a.u[6]+2&65535;return b}function Yd(a,b,c){var d=a.u[6]-2&65535;a.u[6]=d;a.ua=a.ua&65535|(a.ua&-65536)<<8|16121856;c||a.sa(4,-2,d);a.$b(d,b)} +function we(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return a.wa(4,0,-2),0;case 1:return 6==c&&a.sa(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.sa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.za(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.sa(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.za(e)|g;a.b-=8;break;case 6:return e=a.za(Rd(a,2)),e=e+a.u[c]&65535,6==c&&a.sa(d, +0,e),a.b-=6,e|g;case 7:return e=a.za(Rd(a,2)),e=e+a.u[c]&65535,e=a.za(e|a.T),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.ua=a.ua&65535|(a.ua&-65536)<<8|(f<<3&248|c)<<16;return e}k.sd=function(a,b,c){!this.A&&0>=b&&c<=this.lb&&(this.J|=32)};k.td=function(a,b,c){this.A||(65534<=c&&(c|=-65536),a&4&&c<=this.lb&&(c<=this.lb-32?this.wa(4,0,-3):(this.Ba|=8,this.J|=32)))};k.ec=function(a){if(!this.S)return this.v.ec(a);this.L++;a=ve(this,ue(this,a,3));this.L--;return a}; +k.Va=function(a){if(!this.S)return this.v.Va(a);this.L++;a=this.Qc(ue(this,a,2));this.L--;return a};k.Cb=function(a,b){this.S?(this.L++,a=ue(this,a,5),a&1&&this.b--,this.v.Lb(a,b),this.L--):this.v.Cb(a,b)};k.nb=function(a,b){this.S?(this.L++,this.Wc(ue(this,a,4),b),this.L--):this.v.nb(a,b)};k.vd=function(a,b,c){return we(this,a,b,c)};k.wd=function(a,b,c){return ue(this,we(this,a,b,c),c)};k.Qc=function(a){return this.v.ta(this.Tb=a)};k.Ce=function(a){return this.v.ta(this.Tb=ue(this,a,2))}; +k.Wc=function(a,b){this.v.Db(this.Tb=a,b&65535)};k.Bf=function(a,b){this.v.Db(this.Tb=ue(this,a,4),b)};function xe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=we(a,b,d,2),c&65536||61440!==(a.P&61440)&&(d&=65535),a.A=a.P>>12&3,c=a.za(d|c&a.T),a.A=a.P>>14&3):c=6!=d||(a.P>>2&12288)===(a.P&12288)?a.u[d]:a.Oa[a.P>>12&3];return c} +function ye(a,b,c,d){a.ua=a.ua&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=we(a,b,e,4),c&65536||(e&=65535),a.A=a.P>>12&3,e=ue(a,e|c&65536,4),a.A=a.P>>14&3,a.v.Db(e,d)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.Oa[a.P>>12&3]=d}function ze(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?ve(a,a.da(b,c,3)):a.u[c+a.vb]&a.Dc}function Ae(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?a.v.ta(a.da(b,c,2)):a.u[c+a.vb]}function Be(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return we(a,b,c,8)} +function Ce(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ve(a,a.da(b,c,3)):a.u[c]&255}function De(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.ta(a.da(b,c,2)):a.u[c]}function Ee(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Pb=a.da(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,ve(a,e)),e&1&&a.b--,a.v.Lb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))} +function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.da(b,e,6),a.v.Db(e,d.call(a,0>c?a.u[-c-1]:c,a.v.ta(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}function Fe(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.da(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Lb(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 Ge(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.da(b,d,4),a.v.Db(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c} function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.pb=function(a){this.C.complete=!0;var b=this.j?Ie(this.j)?1:this.C.gc?-1:0:0,c=a?this.C.gc?0:1:-1;this.C.gc=!1;this.ga=this.b=a;do{if(b){if(Je(this.j,this.u[7],c)){this.ea();break}c||c++;b++}if(this.K){if(a=this.K&7)if(a=!1,this.K&2){this.K&=-3;var d=160,e=(this.Wb&224)>>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.wc,e=f.kb);e>(this.P&224)>>5?(this.K&4&&(Rd(this,2),this.K&=-5),this.va(d,0,-9),e=!0):e=!1;e&&(f&&Sd(this,f),a=!0)}else this.K&1&&this.K++;if(a){if(b&&Je(this.j,this.u[7],c)){this.ea(); -break}if(0>c)break}if(this.K&112&&Td(this)){if(b&&Je(this.j,this.u[7],c)){this.ea();break}if(0>c)break}}this.K=this.K&7|this.P&16;this.decode(Qd(this))}while(0>1|b<<16;Wd(this,a);return a&65535}function Pe(a,b){a=b&128|b>>1|b<<8;Wd(this,a<<8);return a&255}function Qe(a,b){a=b&~a;U(this,a);return a}function Re(a,b){a=b&~a;U(this,a<<8);return a}function Se(a,b){a|=b;U(this,a);return a}function Te(a,b){a|=b;U(this,a<<8);return a}function Ue(a,b){a=~b|65536;Ud(this,a);return a&65535} -function Ve(a,b){a=~b|256;Ud(this,a<<8);return a&255}function We(a,b){a=b-a;this.K&128||(this.aa=this.ca=a,this.W=b&(b^a));return a&65535}function Xe(a,b){a=b-a;var c=a<<8;b<<=8;this.K&128||(this.aa=this.ca=c,this.W=b&(b^c));return a&255}function Ye(a,b){a=b+a;this.K&128||(this.aa=this.ca=a,this.W=a&(b^a));return a&65535}function Ze(a,b){a=b+a;var c=a<<8;this.K&128||(this.aa=this.ca=c,this.W=c&(b<<8^c));return a&255}function $e(a,b){a=-b;Ud(this,a,a&b&32768);return a&65535} -function af(a,b){a=-b;Ud(this,a<<8,(a&b&128)<<8);return a&255}function bf(a,b){a=b<<1|this.V>>16&1;Wd(this,a);return a&65535}function cf(a,b){a=b<<1|this.V>>16&1;Wd(this,a<<8);return a&255}function df(a,b){a=(this.V&65536|b)>>1|b<<16;Wd(this,a);return a&65535}function ef(a,b){a=((this.V&65536)>>8|b)>>1|b<<8;Wd(this,a<<8);return a&255}function ff(a,b){var c=b-a;Xd(this,c,a,b);return c&65535}function gf(a,b){var c=b-a;Xd(this,c<<8,a<<8,b<<8);return c&255} -function hf(a,b){this.K&128||(this.aa=this.ca=b&65280,this.W=this.V=0);return(b<<8|b>>8)&65535}function jf(a,b){a^=b;U(this,a);return a&65535}function kf(a){V(this,a,Be(this,a),Ke);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function lf(a){var b=Ee(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.V=this.W=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.W=32768)}this.u[a]=c&65535;this.aa=this.ca=c;this.b-=(this.g?6:7)+b} -function mf(a){var b=Ee(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=0;b&=63;if(b&32){b=64-b;32>b-1;this.V=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.aa=d>>16;this.ca=d>>16|d;this.b-=(this.g?6:7)+b}function nf(a){W(this,a,!Md(this))}function of(a){W(this,a,Md(this))} -function pf(a){V(this,a,Be(this,a),Qe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function qf(a){Fe(this,a,Ae(this,a),Re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function rf(a){V(this,a,Be(this,a),Se);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function sf(a){Fe(this,a,Ae(this,a),Te);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function tf(a){var b=Be(this,a);a=Ee(this,a);U(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function uf(a){var b=Ae(this,a);a=De(this,a);U(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function vf(a){W(this,a,Od(this))}function wf(a){W(this,a,!Pd(this)==!Nd(this))}function xf(a){W(this,a,!Od(this)&&!Pd(this)==!Nd(this))}function yf(a){W(this,a,!Md(this)&&!Od(this))} -function zf(a){W(this,a,Od(this)||!Pd(this)!=!Nd(this))}function Af(a){W(this,a,Md(this)||Od(this))}function Bf(a){W(this,a,!Pd(this)!=!Nd(this))}function Cf(a){W(this,a,Pd(this))}function Df(a){W(this,a,!Od(this))}function Ef(a){W(this,a,!Pd(this))}function Ff(){this.va(12,0,-8);this.b-=5}function Gf(a){W(this,a,!0)}function Hf(a){W(this,a,!Nd(this))}function If(a){W(this,a,Nd(this))}function Jf(a){a&1&&(this.V=0);a&2&&(this.W=0);a&4&&(this.ca=1);a&8&&(this.aa=0);this.b-=5} -function Kf(a){var b=Be(this,a);a=Ee(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;Xd(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Lf(a){var b=Ae(this,a);a=De(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);Xd(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} -function Mf(a){var b=Ee(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=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.ca=d>>16|d,this.aa=d>>16):(this.W=32768,this.ca=d>>15|d,this.aa=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.ca=this.aa=0,this.W=32768,this.V=65536,this.b-=7}function Nf(){this.va(24,0,-8);this.b-=25} -function Of(){this.P&49152?(this.Ba|=128,this.va(4,0,-7)):(this.w&&1120==this.ib&&this.w.setData(this.u[0],!0),this.j?Pf(this.j):this.ea());this.b-=7}function Qf(){this.va(16,0,-8);this.b-=25}var Rf=[0,7,7,10,7,11,9,13];function Sf(a){this.I=this.b;T(this,Ce(this,a));this.b=this.I-Rf[this.g]}var Tf=[0,14,14,17,14,18,16,20];function Uf(a){this.I=this.b;var b=Ce(this,a);a=a>>6&7;Yd(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.I-Tf[this.g]} -var Vf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Wf(a){var b=Be(this,a);this.I=this.b;U(this,He(this,a,b));this.b=this.I-Vf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Xf(a){var b=Ae(this,a);U(this,Ge(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var Yf=[7,13,13,17,14,18,17,21]; -function Zf(a){var b=Ee(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.aa=b>>16,this.ca=this.aa|b,this.W=0,this.V=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function fg(a){V(this,a,Be(this,a),ff);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function gg(a){V(this,a,0,hf);this.b-=this.g?9:3+(7==this.f?2:0)}function hg(){this.va(28,0,-8);this.b-=5} -function ig(){this.w&&(this.w.uc(this.u[7],!0),this.w.setData(this.u[0],!0));this.K|=4;Rd(this,-2);this.b-=3}function jg(a){V(this,a,this.u[(a>>6&7)+this.vb],jf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Pf(b)):b=!1;b||this.va(8,0,-8)}function Id(a){kg[a>>12].call(this,a)}function lg(a){mg[a>>6&3].call(this,a)}function ng(a){og[a>>6&3].call(this,a)}function pg(a){qg[a>>6&3].call(this,a)} -function rg(a){sg[a&15].call(this,a)}function tg(a){ug[a&15].call(this,a)}function vg(a){wg[a>>6&3].call(this,a)}function xg(a){yg[a>>6&3].call(this,a)}function zg(a){Ag[a>>6&3].call(this,a)} -var kg=[function(a){Bg[a>>8&15].call(this,a)},Wf,Kf,tf,pf,rf,kf,X,function(a){Cg[a>>8&15].call(this,a)},Xf,Lf,uf,qf,sf,fg,X],Bg=[function(a){Dg[a>>4&15].call(this,a)},Gf,Df,vf,wf,Bf,xf,zf,Uf,Uf,lg,ng,pg,X,X,X],mg=[function(a){Ud(this,He(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,We);this.b-=this.g?9:3+(7==this.f?2:0)}],og=[function(a){V(this,a,0, -$e);this.b-=this.g?11:6},function(a){V(this,a,Md(this)?1:0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Md(this)?1:0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ee(this,a);Ud(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],qg=[function(a){V(this,a,0,df);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Me);this.b-=this.g?9:3+(7==this.f?2:0)}], -Dg=[function(a){Eg[a&15].call(this,a)},X,X,X,Sf,Sf,Sf,Sf,bg,X,rg,tg,gg,gg,gg,gg],Eg=[Of,ig,cg,Ff,Qf,ag,X,X,X,X,X,X,X,X,X,X],sg=[$f,function(){this.V=0;this.b-=5},function(){this.W=0;this.b-=5},Jf,function(){this.ca=1;this.b-=5},Jf,Jf,Jf,function(){this.aa=0;this.b-=5},Jf,Jf,Jf,Jf,Jf,Jf,Jf],ug=[$f,function(){this.V=65536;this.b-=5},function(){this.W=32768;this.b-=5},dg,function(){this.ca=0;this.b-=5},dg,dg,dg,function(){this.aa=32768;this.b-=5},dg,dg,dg,dg,dg,dg,dg],Cg=[Ef,Cf,yf,Af,Hf,If,nf,of,Nf, -hg,vg,xg,zg,X,X,X],wg=[function(a){Ud(this,Ge(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,1,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,1,Xe);this.b-=this.g?9:3+(7==this.f?2:0)}],yg=[function(a){Fe(this,a,0,af);this.b-=this.g?11:6},function(a){Fe(this,a,Md(this)?1:0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,Md(this)?1:0,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a= -De(this,a);Ud(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Ag=[function(a){Fe(this,a,0,ef);this.b-=this.g?9+(this.Ob&1):3+(7==this.f?2:0)},function(a){Fe(this,a,0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,0,Pe);this.b-=this.g?9+(this.Ob&1):3+(7==this.f?2:0)},function(a){Fe(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}];function Jd(a){Fg[a>>12].call(this,a)} -var Fg=[function(a){Gg[a>>8&15].call(this,a)},Wf,Kf,tf,pf,rf,kf,function(a){Hg[a>>8&15].call(this,a)},function(a){Ig[a>>8&15].call(this,a)},Xf,Lf,uf,qf,sf,fg,X],Gg=[function(a){Jg[a>>4&15].call(this,a)},Gf,Df,vf,wf,Bf,xf,zf,Uf,Uf,lg,ng,pg,function(a){Kg[a>>6&3].call(this,a)},X,X],Kg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.za(a|this.T);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ye(this,a,0);Yd(this,a);U(this,a);this.b-=11},function(a){var b=ue(this);this.I= -this.b;ze(this,a,0,b);U(this,b);this.b=this.I-Yf[this.g]},function(a){U(this,He(this,a,Pd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Jg=[function(a){Lg[a&15].call(this,a)},X,X,X,Sf,Sf,Sf,Sf,bg,function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.K|=1),this.b-=5):X.call(this,a)},rg,tg,gg,gg,gg,gg],Lg=[Of,ig,function(){Zd(this);this.K|=this.P&16;this.b-=13},Ff,Qf,ag,cg,function(){this.va(8,0,-8)},X,X,X,X,X,X,X,X],Hg=[Zf,Zf,Mf,Mf,lf,lf,mf,mf,jg,jg,X,X,X,X,eg,eg],Ig=[Ef,Cf,yf,Af, -Hf,If,nf,of,Nf,hg,vg,xg,zg,function(a){Mg[a>>6&3].call(this,a)},X,X],Mg=[X,function(a){a=ye(this,a,65536);Yd(this,a);U(this,a);this.b-=11},function(a){var b=ue(this);this.I=this.b;ze(this,a,65536,b);U(this,b);this.b=this.I-Yf[this.g]},X]; -function Ng(a){x.call(this,"ROM",a,Ng,128);this.ja=this.B=null;this.A=a.addr;this.f=a.size;this.F=!1;this.w=a.alias;this.g=a.file;this.H=u(this.g);if(this.g){a=this.g;var b=oa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(lb(c.fb,a,b),(a=Ea(a,b))?(c.B=a.ha,c.ja=a.ja):c.g=null);Og(c)})}}B(Ng);k=Ng.prototype; -k.Ha=function(a,b,c,d){this.v=b;this.b=c;this.j=d;Og(this)};k.Ka=function(){this.ja&&(this.j&&Pg(this.j,this.id,this.A,this.f,this.ja),delete this.ja);return!0};k.Ja=function(){return!0}; -function Og(a){if(!yb(a)){if(a.g){if(!a.B||!a.v)return;a.f||(a.f=a.B.length);if(a.B.length!=a.f)Ab(a,"ROM size ("+p(a.B.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 "+na(b));if(57344<=b&&b<57344+qc){var c={};b=(c[b]=[Ng.prototype.pe,Ng.prototype.pf,null,null,null,a.f>>1],c);if(Jb(a.v,a,b)){b=a.F=!0;break a}}else if(Ac(a.v,b,a.f,kd)){for(c=0;c>>a.na;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),t=h,v=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= -b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(v)for(G(a,"loading "+q(v)+" bytes at "+q(r)+"-"+q(r+v-1),4096);v--;)a.b.Cb(r++,b[t++]&255);else r&1?a.b.ea():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.yc&&c<=la.hd&&(b=!0,c-=la.yc-la.Xc);b&&(a.preventDefault&&a.preventDefault(),d.fc(c));return!0},c.onkeypress=function(a){a=a||window.event;d.fc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData|| -window.clipboardData)&&d.fc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;var e=this;this.xa=Mc(48,4,262144);this.ba=Jc(this.b,function(){e.f&128||!e.A.length||(e.J=e.A.shift()&255,e.fa&&97<=e.J&&122>e.J&&(e.J-=32),e.f|=128,e.f&64&&Kc(e.b,e.xa))});this.O=Mc(52,4,262144);this.oa=Jc(this.b,function(){e.g|=128;e.g&64&&Kc(e.b,e.O)});Jb(b,this,Wg);Lb(b,this.reset.bind(this));J(this)}; -k.Nc=function(){if(!this.I){var a=xd(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.eb)return;b=ya(b[1]);if(this.I=nb(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.fb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.Nc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Ja=function(a){return a?this.save():!0};k.reset=function(){Xg(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return Xg(this)};function Xg(a){a.J=0;a.f=0;a.g=128;a.A=[];return!0}k.fc=function(a){if("number"==typeof a)this.A.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.U||8,c=a-this.H%a,this.U&&(b=xa("",c)));this.T&&!this.H&&c&&(b=String.fromCharCode(this.T)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}}else if(null!=this.F){if(10==a||1024<= -this.F.length)this.i(this.F),this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;Lc(this.b,this.oa,1E3/Math.round(this.ga/10))};var Yg={},Wg=(Yg[65392]=[null,null,Ug.prototype.ce,Ug.prototype.af,"RCSR"],Yg[65394]=[null,null,Ug.prototype.be,Ug.prototype.$e,"RBUF"],Yg[65396]=[null,null,Ug.prototype.De,Ug.prototype.Df,"XCSR"],Yg[65398]=[null,null,Ug.prototype.Ce,Ug.prototype.Cf,"XBUF"],Yg); -ab(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= -function(){var a=d.D.listTapes;a&&th(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.R){c.parentNode.removeChild(c);break}this.D[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;th(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; -k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;this.U=uh(a);var e=this;if((this.g=xd(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.ba=Mc(56,4,4096);this.ga=Jc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.J>5,f=this.K&&this.K.kb>e?this.K:null;f&&(d=f.xc,e=f.kb);e>(this.P&224)>>5?(this.J&4&&(Rd(this,2),this.J&=-5),this.wa(d,0,-9),e=!0):e=!1;e&&(f&&Sd(this,f),a=!0);this.K||this.Kb||(this.J&=-3)}else this.J&1&&this.J++;if(a){if(b&&Ie(this.j,this.u[7], +c)){this.ea();break}if(0>c)break}if(this.J&112&&Td(this)){if(b&&Ie(this.j,this.u[7],c)){this.ea();break}if(0>c)break}}this.J=this.J&7|this.P&16;this.decode(Qd(this))}while(0>1|b<<16;Wd(this,a);return a&65535}function Oe(a,b){a=b&128|b>>1|b<<8;Wd(this,a<<8);return a&255}function Pe(a,b){a=b&~a;U(this,a);return a}function Qe(a,b){a=b&~a;U(this,a<<8);return a}function Re(a,b){a|=b;U(this,a);return a}function Se(a,b){a|=b;U(this,a<<8);return a}function Te(a,b){a=~b|65536;Ud(this,a);return a&65535} +function Ue(a,b){a=~b|256;Ud(this,a<<8);return a&255}function Ve(a,b){a=b-a;this.J&128||(this.aa=this.ca=a,this.W=b&(b^a));return a&65535}function We(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.aa=this.ca=c,this.W=b&(b^c));return a&255}function Xe(a,b){a=b+a;this.J&128||(this.aa=this.ca=a,this.W=a&(b^a));return a&65535}function Ye(a,b){a=b+a;var c=a<<8;this.J&128||(this.aa=this.ca=c,this.W=c&(b<<8^c));return a&255}function Ze(a,b){a=-b;Ud(this,a,a&b&32768);return a&65535} +function $e(a,b){a=-b;Ud(this,a<<8,(a&b&128)<<8);return a&255}function af(a,b){a=b<<1|this.V>>16&1;Wd(this,a);return a&65535}function bf(a,b){a=b<<1|this.V>>16&1;Wd(this,a<<8);return a&255}function cf(a,b){a=(this.V&65536|b)>>1|b<<16;Wd(this,a);return a&65535}function df(a,b){a=((this.V&65536)>>8|b)>>1|b<<8;Wd(this,a<<8);return a&255}function ef(a,b){var c=b-a;Xd(this,c,a,b);return c&65535}function ff(a,b){var c=b-a;Xd(this,c<<8,a<<8,b<<8);return c&255} +function gf(a,b){this.J&128||(this.aa=this.ca=b&65280,this.W=this.V=0);return(b<<8|b>>8)&65535}function hf(a,b){a^=b;U(this,a);return a&65535}function jf(a){V(this,a,Ae(this,a),Je);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function kf(a){var b=De(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.V=this.W=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.W=32768)}this.u[a]=c&65535;this.aa=this.ca=c;this.b-=(this.g?6:7)+b} +function lf(a){var b=De(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=0;b&=63;if(b&32){b=64-b;32>b-1;this.V=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.aa=d>>16;this.ca=d>>16|d;this.b-=(this.g?6:7)+b}function mf(a){W(this,a,!Md(this))}function nf(a){W(this,a,Md(this))} +function of(a){V(this,a,Ae(this,a),Pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function pf(a){Ee(this,a,ze(this,a),Qe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function qf(a){V(this,a,Ae(this,a),Re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function rf(a){Ee(this,a,ze(this,a),Se);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function sf(a){var b=Ae(this,a);a=De(this,a);U(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function tf(a){var b=ze(this,a);a=Ce(this,a);U(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function uf(a){W(this,a,Od(this))}function vf(a){W(this,a,!Pd(this)==!Nd(this))}function wf(a){W(this,a,!Od(this)&&!Pd(this)==!Nd(this))}function xf(a){W(this,a,!Md(this)&&!Od(this))} +function yf(a){W(this,a,Od(this)||!Pd(this)!=!Nd(this))}function zf(a){W(this,a,Md(this)||Od(this))}function Af(a){W(this,a,!Pd(this)!=!Nd(this))}function Bf(a){W(this,a,Pd(this))}function Cf(a){W(this,a,!Od(this))}function Df(a){W(this,a,!Pd(this))}function Ef(){this.wa(12,0,-8);this.b-=5}function Ff(a){W(this,a,!0)}function Gf(a){W(this,a,!Nd(this))}function Hf(a){W(this,a,Nd(this))}function If(a){a&1&&(this.V=0);a&2&&(this.W=0);a&4&&(this.ca=1);a&8&&(this.aa=0);this.b-=5} +function Jf(a){var b=Ae(this,a);a=De(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;Xd(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Kf(a){var b=ze(this,a);a=Ce(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);Xd(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} +function Lf(a){var b=De(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=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.ca=d>>16|d,this.aa=d>>16):(this.W=32768,this.ca=d>>15|d,this.aa=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.ca=this.aa=0,this.W=32768,this.V=65536,this.b-=7}function Mf(){this.wa(24,0,-8);this.b-=25} +function Nf(){this.P&49152?(this.Ba|=128,this.wa(4,0,-7)):(this.w&&1120==this.ib&&this.w.setData(this.u[0],!0),this.j?Of(this.j):this.ea());this.b-=7}function Pf(){this.wa(16,0,-8);this.b-=25}var Qf=[0,7,7,10,7,11,9,13];function Rf(a){this.I=this.b;T(this,Be(this,a));this.b=this.I-Qf[this.g]}var Sf=[0,14,14,17,14,18,16,20];function Tf(a){this.I=this.b;var b=Be(this,a);a=a>>6&7;Yd(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.I-Sf[this.g]} +var Uf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Vf(a){var b=Ae(this,a);this.I=this.b;U(this,Ge(this,a,b));this.b=this.I-Uf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Wf(a){var b=ze(this,a);U(this,Fe(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var Xf=[7,13,13,17,14,18,17,21]; +function Yf(a){var b=De(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&128||(this.aa=b>>16,this.ca=this.aa|b,this.W=0,this.V=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function eg(a){V(this,a,Ae(this,a),ef);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function fg(a){V(this,a,0,gf);this.b-=this.g?9:3+(7==this.f?2:0)}function gg(){this.wa(28,0,-8);this.b-=5} +function hg(){this.w&&(this.w.vc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=4;Rd(this,-2);this.b-=3}function ig(a){V(this,a,this.u[(a>>6&7)+this.vb],hf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Of(b)):b=!1;b||this.wa(8,0,-8)}function Id(a){jg[a>>12].call(this,a)}function kg(a){lg[a>>6&3].call(this,a)}function mg(a){ng[a>>6&3].call(this,a)}function og(a){pg[a>>6&3].call(this,a)} +function qg(a){rg[a&15].call(this,a)}function sg(a){tg[a&15].call(this,a)}function ug(a){vg[a>>6&3].call(this,a)}function wg(a){xg[a>>6&3].call(this,a)}function yg(a){zg[a>>6&3].call(this,a)} +var jg=[function(a){Ag[a>>8&15].call(this,a)},Vf,Jf,sf,of,qf,jf,X,function(a){Bg[a>>8&15].call(this,a)},Wf,Kf,tf,pf,rf,eg,X],Ag=[function(a){Cg[a>>4&15].call(this,a)},Ff,Cf,uf,vf,Af,wf,yf,Tf,Tf,kg,mg,og,X,X,X],lg=[function(a){Ud(this,Ge(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Ve);this.b-=this.g?9:3+(7==this.f?2:0)}],ng=[function(a){V(this,a,0, +Ze);this.b-=this.g?11:6},function(a){V(this,a,Md(this)?1:0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Md(this)?1:0,ef);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=De(this,a);Ud(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],pg=[function(a){V(this,a,0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,af);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)}], +Cg=[function(a){Dg[a&15].call(this,a)},X,X,X,Rf,Rf,Rf,Rf,ag,X,qg,sg,fg,fg,fg,fg],Dg=[Nf,hg,bg,Ef,Pf,$f,X,X,X,X,X,X,X,X,X,X],rg=[Zf,function(){this.V=0;this.b-=5},function(){this.W=0;this.b-=5},If,function(){this.ca=1;this.b-=5},If,If,If,function(){this.aa=0;this.b-=5},If,If,If,If,If,If,If],tg=[Zf,function(){this.V=65536;this.b-=5},function(){this.W=32768;this.b-=5},cg,function(){this.ca=0;this.b-=5},cg,cg,cg,function(){this.aa=32768;this.b-=5},cg,cg,cg,cg,cg,cg,cg],Bg=[Df,Bf,xf,zf,Gf,Hf,mf,nf,Mf, +gg,ug,wg,yg,X,X,X],vg=[function(a){Ud(this,Fe(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ee(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ee(this,a,1,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ee(this,a,1,We);this.b-=this.g?9:3+(7==this.f?2:0)}],xg=[function(a){Ee(this,a,0,$e);this.b-=this.g?11:6},function(a){Ee(this,a,Md(this)?1:0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ee(this,a,Md(this)?1:0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a= +Ce(this,a);Ud(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],zg=[function(a){Ee(this,a,0,df);this.b-=this.g?9+(this.Pb&1):3+(7==this.f?2:0)},function(a){Ee(this,a,0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ee(this,a,0,Oe);this.b-=this.g?9+(this.Pb&1):3+(7==this.f?2:0)},function(a){Ee(this,a,0,Me);this.b-=this.g?9:3+(7==this.f?2:0)}];function Jd(a){Eg[a>>12].call(this,a)} +var Eg=[function(a){Fg[a>>8&15].call(this,a)},Vf,Jf,sf,of,qf,jf,function(a){Gg[a>>8&15].call(this,a)},function(a){Hg[a>>8&15].call(this,a)},Wf,Kf,tf,pf,rf,eg,X],Fg=[function(a){Ig[a>>4&15].call(this,a)},Ff,Cf,uf,vf,Af,wf,yf,Tf,Tf,kg,mg,og,function(a){Jg[a>>6&3].call(this,a)},X,X],Jg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.za(a|this.T);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=xe(this,a,0);Yd(this,a);U(this,a);this.b-=11},function(a){var b=te(this);this.I= +this.b;ye(this,a,0,b);U(this,b);this.b=this.I-Xf[this.g]},function(a){U(this,Ge(this,a,Pd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Ig=[function(a){Kg[a&15].call(this,a)},X,X,X,Rf,Rf,Rf,Rf,ag,function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.J|=1),this.b-=5):X.call(this,a)},qg,sg,fg,fg,fg,fg],Kg=[Nf,hg,function(){Zd(this);this.J|=this.P&16;this.b-=13},Ef,Pf,$f,bg,function(){this.wa(8,0,-8)},X,X,X,X,X,X,X,X],Gg=[Yf,Yf,Lf,Lf,kf,kf,lf,lf,ig,ig,X,X,X,X,dg,dg],Hg=[Df,Bf,xf,zf, +Gf,Hf,mf,nf,Mf,gg,ug,wg,yg,function(a){Lg[a>>6&3].call(this,a)},X,X],Lg=[X,function(a){a=xe(this,a,65536);Yd(this,a);U(this,a);this.b-=11},function(a){var b=te(this);this.I=this.b;ye(this,a,65536,b);U(this,b);this.b=this.I-Xf[this.g]},X]; +function Mg(a){x.call(this,"ROM",a,Mg,128);this.ja=this.B=null;this.A=a.addr;this.f=a.size;this.F=!1;this.w=a.alias;this.g=a.file;this.H=u(this.g);if(this.g){a=this.g;var b=oa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(lb(c.fb,a,b),(a=Ea(a,b))?(c.B=a.ha,c.ja=a.ja):c.g=null);Ng(c)})}}B(Mg);k=Mg.prototype; +k.Ha=function(a,b,c,d){this.v=b;this.b=c;this.j=d;Ng(this)};k.Ka=function(){this.ja&&(this.j&&Og(this.j,this.id,this.A,this.f,this.ja),delete this.ja);return!0};k.Ja=function(){return!0}; +function Ng(a){if(!yb(a)){if(a.g){if(!a.B||!a.v)return;a.f||(a.f=a.B.length);if(a.B.length!=a.f)Ab(a,"ROM size ("+p(a.B.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 "+na(b));if(57344<=b&&b<57344+qc){var c={};b=(c[b]=[Mg.prototype.qe,Mg.prototype.pf,null,null,null,a.f>>1],c);if(Jb(a.v,a,b)){b=a.F=!0;break a}}else if(Ac(a.v,b,a.f,kd)){for(c=0;c>>a.na;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),t=h,v=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= +b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(v)for(G(a,"loading "+q(v)+" bytes at "+q(r)+"-"+q(r+v-1),4096);v--;)a.b.Cb(r++,b[t++]&255);else r&1?a.b.ea():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.zc&&c<=la.jd&&(b=!0,c-=la.zc-la.Yc);b&&(a.preventDefault&&a.preventDefault(),d.gc(c));return!0},c.onkeypress=function(a){a=a||window.event;d.gc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData|| +window.clipboardData)&&d.gc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;var e=this;this.ga=Mc(48,4,262144);this.ba=Jc(this.b,function(){var a;a=-1;e.H.length&&(a=e.H.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.fa&&97<=a&&122>a&&(a-=32),Lc(e.b,e.ba,1E3/Math.round(e.S/10)));0<=a&&(e.K=a,e.f&128?e.K|=49152:e.f|=128,e.f&64&&Kc(c,e.ga))});this.O=Mc(52,4,262144);this.sa=Jc(this.b,function(){e.g|=128;e.g&64&&Kc(c,e.O)});Jb(b,this,Vg);Lb(b,this.reset.bind(this));J(this)}; +k.Oc=function(){if(!this.I){var a=xd(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.eb)return;b=ya(b[1]);if(this.I=nb(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.fb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.Oc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.Ja=function(a){return a?this.save():!0};k.reset=function(){Wg(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return Wg(this)};function Wg(a){a.K=0;a.f=0;a.g=128;a.H=[];return!0}k.gc=function(a){if("number"==typeof a)this.H.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.U||8,c=a-this.F%a,this.U&&(b=xa("",c)));this.T&&!this.F&&c&&(b=String.fromCharCode(this.T)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.F+=c}}else if(null!=this.A){if(10==a||1024<= +this.A.length)this.i(this.A),this.A="";10!=a&&(this.A+=String.fromCharCode(a))}Lc(this.b,this.sa,1E3/Math.round(this.oa/10));this.g&=-129};var Xg={},Vg=(Xg[65392]=[null,null,Tg.prototype.de,Tg.prototype.af,"RCSR"],Xg[65394]=[null,null,Tg.prototype.ce,Tg.prototype.$e,"RBUF"],Xg[65396]=[null,null,Tg.prototype.Ee,Tg.prototype.Df,"XCSR"],Xg[65398]=[null,null,Tg.prototype.De,Tg.prototype.Cf,"XBUF"],Xg); +ab(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= +function(){var a=d.D.listTapes;a&&th(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.S){c.parentNode.removeChild(c);break}this.D[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;th(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; +k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;this.ba=uh(a);var e=this;if((this.g=xd(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.T=Mc(56,4,4096);this.ga=Jc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.C.ma;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(lb(a.fb,e,f),(e=Ea(e,f))&&Dh(a,b,c,d,e.ha,e.Ra, e.Qa));a.C.hb=!1;a.F&&(a.F--,a.F||J(a));Ah(a)})}function xh(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.la);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ac?"":e)+"&format=json"));return!!Da(f, +function Jh(a,b,c,d,e){var f=c;if(a.v)return!0;a.Ta=b;a.La=c;a.uc=u(c);a.v=e;a.A=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ja[d];if(e){a.la=e[0];a.ra=e[1];a.ia=e[2];a.ya=e[3]||512;c=a.ya>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.la);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.bc?"":e)+"&format=json"));return!!Da(f, null,!0,function(b,c,d){Kh(a,b,c,d)})} -function Kh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.C.ma;if(d)a.controller.N('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{lb(a.controller.fb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +function Kh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.C.ma;if(d)a.controller.N('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{lb(a.controller.fb,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)w(h[0]);else{a.la=h.length;a.ra=h[0].length;a.ia=h[0][0].length;var l=h[0][0][0];a.ya=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var v=m<<2,A=t.length;A>2,e=Array(d),f=0;f>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ma?f=a.Wa+a.Ma&&(a.Ma+=f-(a.Wa+a.Ma)+1):(a.Wa=f,a.Ma=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Ta+": "+c);return b}; k.toJSON=function(){var a;a=0;for(var b;b=Nh(this,a++);)Qh(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 Qh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function Q(a){x.call(this,"RK11",a,Q,65536);this.I=a.autoMount||{};this.F=0;this.g=Array(8);this.J=!Ma("Mobi")&&window&&"FileReader"in window}B(Q);k=Q.prototype; -k.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Rh(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&Sh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.J){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Z)?(a=Na(Ph(a),a.tc.replace(".json",".img")),w(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.J)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +function Qh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function Q(a){x.call(this,"RK11",a,Q,65536);this.I=a.autoMount||{};this.F=0;this.g=Array(8);this.K=!Ma("Mobi")&&window&&"FileReader"in window}B(Q);k=Q.prototype; +k.va=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Rh(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&Sh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.K){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Z)?(a=Na(Ph(a),a.uc.replace(".json",".img")),w(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.K)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Sh(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;if((a=xd(this.B,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.I[e]=a[e]);Th(this);this.O=Mc(144,5,65536);Jb(b,this,Uh);Lb(b,this.reset.bind(this));Vh(this,"None","",!0);this.J&&Vh(this,"Local Disk","?");Vh(this,"Remote Disk","??");Wh(this)||J(this)}; -k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Rh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Th(this)};k.save=function(){return(new S(this)).data()}; +k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;if((a=xd(this.B,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.I[e]=a[e]);Th(this);this.Sb=Mc(144,5,65536);Jb(b,this,Uh);Lb(b,this.reset.bind(this));Vh(this,"None","",!0);this.K&&Vh(this,"Local Disk","?");Vh(this,"Remote Disk","??");Wh(this)||J(this)}; +k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.qc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Rh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Th(this)};k.save=function(){return(new S(this)).data()}; k.restore=function(a){return Th(this,a[0])};function Wh(a,b){b||(a.F=0);for(var c in a.I){var d=a.I[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}Yh(a,e,b,c,!1,d)}else Xh(a,e)} -function Yh(a,b,c,d,e,f){var g=-1,h=a.g[b];h.La.toLowerCase()!=d.toLowerCase()&&(g++,Xh(a,b,!0),h.yb?a.N("RK11 busy"):(h.yb=!0,e&&(h.xb=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.ab=!!f,Jh(new Fh(a,h,"preload"),c,d,f,a.$c)&&g++));return g} -k.$c=function(a,b,c,d,e){var f;a.yb=!1;b&&(f=Mh(b),b&&f[0]>a.la||f[1]>a.ra)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.zb)),b=null);b?(a.Z=b,a.Ta=c,a.La=d,this.N('Mounted disk "'+c+'" in drive '+("RK"+a.zb),a.xb||e),this.B&&this.B.mb()):a.ab=!1;a.xb&&(a.xb=!1,--this.F||J(this));Rh(this,a.zb)}; +function Yh(a,b,c,d,e,f){var g=-1,h=a.g[b];h.La.toLowerCase()!=d.toLowerCase()&&(g++,Xh(a,b,!0),h.yb?a.N("RK11 busy"):(h.yb=!0,e&&(h.xb=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.ab=!!f,Jh(new Fh(a,h,"preload"),c,d,f,a.ad)&&g++));return g} +k.ad=function(a,b,c,d,e){var f;a.yb=!1;b&&(f=Mh(b),b&&f[0]>a.la||f[1]>a.ra)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.zb)),b=null);b?(a.Z=b,a.Ta=c,a.La=d,this.N('Mounted disk "'+c+'" in drive '+("RK"+a.zb),a.xb||e),this.B&&this.B.mb()):a.ab=!1;a.xb&&(a.xb=!1,--this.F||J(this));Rh(this,a.zb)}; function Vh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.H=65536-e&65535;a&&(this.A=this.A|a|32768,this.M|=49152);return!0};k.ad=function(a,b,c,d,e,f,g){var h=0,l=a.Z,m=null,n;l||(h=128,e=0);for(;e--;){if(!m){m=a.Z.seek(b,c,d+1);if(!m){h=4096;break}n=0}var r,t;if(0>(r=a.Z.read(m,n++))||0>(t=a.Z.read(m,n++))){h=32;break}this.v.nb(f,r|t<<8);if(Ic(this.v)){h=1024;break}f+=2;if(n>=l.ya&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)}; -k.bd=function(a,b,c,d,e,f,g){var h=0,l=a.Z,m=null,n;l||(h=128,e=0);for(;e--;){var r=this.v.Va(f);if(Ic(this.v)){h=1024;break}f+=2;if(!m){m=a.Z.seek(b,c,d+1,!0);if(!m){h=4096;break}n=0}if(!a.Z.write(m,n++,r&255)||!a.Z.write(m,n++,r>>8)){h=32;break}if(n>=l.ya&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)};k.he=function(){return this.L};k.ff=function(){};k.ie=function(){return this.A};k.gf=function(){};k.ee=function(){return this.M&61438}; -k.cf=function(a){this.M=this.M&-3968|a&3967;if(this.M&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.g[a],e,f,g,h;this.M&=-129;switch(this.M&14){case 0:this.L=d.status;this.A=0;this.M=128;this.f=0;break;case 4:b=this.ad;case 2:b||(b=this.bd),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.la?(this.A|=32832,this.M|=49152):g>=d.ia?(this.A|=32800,this.M|=49152):(h=(this.M&48)<<12|this.w,c=65536-this.H&65535,c=b.call(this,d,e,f,g,c,h,this.Zc.bind(this)))}this.L=d.status|a<<13|this.f%9&15;c&&(this.M&= --2,this.M|=128,this.M&64&&Kc(this.b,this.O))}};k.je=function(){return this.H};k.hf=function(a){this.H=a};k.de=function(){return this.w};k.bf=function(a){this.w=a};k.fe=function(){return this.f};k.df=function(a){this.f=a};k.ge=function(){return this.R};k.ef=function(a){this.R=a}; -var Zh={},Uh=(Zh[65280]=[null,null,Q.prototype.he,Q.prototype.ff,"RKDS"],Zh[65282]=[null,null,Q.prototype.ie,Q.prototype.gf,"RKER"],Zh[65284]=[null,null,Q.prototype.ee,Q.prototype.cf,"RKCS"],Zh[65286]=[null,null,Q.prototype.je,Q.prototype.hf,"RKWC"],Zh[65288]=[null,null,Q.prototype.de,Q.prototype.bf,"RKBA"],Zh[65290]=[null,null,Q.prototype.fe,Q.prototype.df,"RKDA"],Zh[65294]=[null,null,Q.prototype.ge,Q.prototype.ef,"RKDB"],Zh); -function P(a){x.call(this,"RL11",a,P,131072);this.J=a.autoMount||{};this.H=0;this.g=Array(4);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; -k.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&$h(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&ai(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Z)?(a=Na(Ph(a),a.tc.replace(".json",".img")),w(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.L)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +function Th(a,b){var c=0;b||(b=[]);a.L=b[c++]||2496;a.A=b[c++]||0;a.M=b[c++]||128;a.H=b[c++]||0;a.w=b[c++]||0;a.f=b[c++]||0;a.O=b[c]||0;for(b=0;b>12&48;this.H=65536-e&65535;a&&(this.A=this.A|a|32768,this.M|=49152);return!0};k.bd=function(a,b,c,d,e,f,g){var h=0,l=a.Z,m=null,n;l||(h=128,e=0);for(;e--;){if(!m){m=a.Z.seek(b,c,d+1);if(!m){h=4096;break}n=0}var r,t;if(0>(r=a.Z.read(m,n++))||0>(t=a.Z.read(m,n++))){h=32;break}this.v.nb(f,r|t<<8);if(Ic(this.v)){h=1024;break}f+=2;if(n>=l.ya&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)}; +k.cd=function(a,b,c,d,e,f,g){var h=0,l=a.Z,m=null,n;l||(h=128,e=0);for(;e--;){var r=this.v.Va(f);if(Ic(this.v)){h=1024;break}f+=2;if(!m){m=a.Z.seek(b,c,d+1,!0);if(!m){h=4096;break}n=0}if(!a.Z.write(m,n++,r&255)||!a.Z.write(m,n++,r>>8)){h=32;break}if(n>=l.ya&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)};k.ie=function(){return this.L};k.ff=function(){};k.je=function(){return this.A};k.gf=function(){};k.fe=function(){return this.M&61438}; +k.cf=function(a){this.M=this.M&-3968|a&3967;if(this.M&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.g[a],e,f,g,h;this.M&=-129;switch(this.M&14){case 0:this.L=d.status;this.A=0;this.M=128;this.f=0;break;case 4:b=this.bd;case 2:b||(b=this.cd),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.la?(this.A|=32832,this.M|=49152):g>=d.ia?(this.A|=32800,this.M|=49152):(h=(this.M&48)<<12|this.w,c=65536-this.H&65535,c=b.call(this,d,e,f,g,c,h,this.$c.bind(this)))}this.L=d.status|a<<13|this.f%9&15;c&&(this.M&= +-2,this.M|=128,this.M&64&&Kc(this.b,this.Sb))}};k.ke=function(){return this.H};k.hf=function(a){this.H=a};k.ee=function(){return this.w};k.bf=function(a){this.w=a};k.ge=function(){return this.f};k.df=function(a){this.f=a};k.he=function(){return this.O};k.ef=function(a){this.O=a}; +var Zh={},Uh=(Zh[65280]=[null,null,Q.prototype.ie,Q.prototype.ff,"RKDS"],Zh[65282]=[null,null,Q.prototype.je,Q.prototype.gf,"RKER"],Zh[65284]=[null,null,Q.prototype.fe,Q.prototype.cf,"RKCS"],Zh[65286]=[null,null,Q.prototype.ke,Q.prototype.hf,"RKWC"],Zh[65288]=[null,null,Q.prototype.ee,Q.prototype.bf,"RKBA"],Zh[65290]=[null,null,Q.prototype.ge,Q.prototype.df,"RKDA"],Zh[65294]=[null,null,Q.prototype.he,Q.prototype.ef,"RKDB"],Zh); +function P(a){x.call(this,"RL11",a,P,131072);this.K=a.autoMount||{};this.H=0;this.g=Array(4);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; +k.va=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&$h(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&ai(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Z)?(a=Na(Ph(a),a.uc.replace(".json",".img")),w(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.L)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;ai(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;if((a=xd(this.B,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.J[e]=a[e]);bi(this);this.O=Mc(112,5,131072);Jb(b,this,ci);Lb(b,this.reset.bind(this));di(this,"None","",!0);this.L&&di(this,"Local Disk","?");di(this,"Remote Disk","??");ei(this)||J(this)}; -k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";$h(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){bi(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return bi(this,a[0])};function ei(a,b){b||(a.H=0);for(var c in a.J){var d=a.J[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";$h(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){bi(this)};k.save=function(){return(new S(this)).data()}; +k.restore=function(a){return bi(this,a[0])};function ei(a,b){b||(a.H=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}gi(a,e,b,c,!1,d)}else fi(a,e)} -function gi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.La.toLowerCase()!=d.toLowerCase()&&(g++,fi(a,b,!0),h.yb?a.N("RL11 busy"):(h.yb=!0,e&&(h.xb=!0,a.H++,I(a)&&G(a,"auto-loading disk: "+c)),h.ab=!!f,Jh(new Fh(a,h,"preload"),c,d,f,a.dd)&&g++));return g} -k.dd=function(a,b,c,d,e){var f;a.yb=!1;b&&(f=Mh(b),b&&f[0]>a.la||f[1]>a.ra)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.Z=b,a.Ta=c,a.La=d,this.N('Mounted disk "'+c+'" in drive '+("RL"+a.zb),a.xb||e),this.B&&this.B.mb()):a.ab=!1;a.xb&&(a.xb=!1,--this.H||J(this));$h(this,a.zb)}; +function gi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.La.toLowerCase()!=d.toLowerCase()&&(g++,fi(a,b,!0),h.yb?a.N("RL11 busy"):(h.yb=!0,e&&(h.xb=!0,a.H++,I(a)&&G(a,"auto-loading disk: "+c)),h.ab=!!f,Jh(new Fh(a,h,"preload"),c,d,f,a.ed)&&g++));return g} +k.ed=function(a,b,c,d,e){var f;a.yb=!1;b&&(f=Mh(b),b&&f[0]>a.la||f[1]>a.ra)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.Z=b,a.Ta=c,a.La=d,this.N('Mounted disk "'+c+'" in drive '+("RL"+a.zb),a.xb||e),this.B&&this.B.mb()):a.ab=!1;a.xb&&(a.xb=!1,--this.H||J(this));$h(this,a.zb)}; function di(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.I=f>>16&63;this.A=this.f=b<<7|(c?64:0)|d&63;this.F=65536-e&65535;a&&(this.M=this.M|a|32768);return!0}; -k.ed=function(a,b,c,d,e,f,g){var h=0,l=a.Z,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Z.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Z.read(m,n++))||0>(t=a.Z.read(m,n++))){h=5120;break}this.v.nb(f,r|t<<8);if(Ic(this.v)){h=8192;break}f+=2;if(n>=l.ya&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.fd=function(a,b,c,d,e,f,g){var h=0,l=a.Z,m=null,n;l||(h=5120,e=0);for(;e--;){var r=this.v.Va(f);if(Ic(this.v)){h=8192;break}f+=2;if(!m){m=a.Z.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Z.write(m,n++,r&255)||!a.Z.write(m,n++,r>>8)){h=5120;break}if(n>=l.ya&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)};k.me=function(){return this.M&65535}; -k.lf=function(a){this.M=this.M&-1023|a&1022;this.R=this.R&-4|(a&48)>>4;if(!(this.M&128)){var b;a=!0;var c=this.g[(this.M&768)>>8],d,e,f,g;this.M&=-2;switch(this.M&14){case 4:this.f&8&&(this.M&=63);this.F=c.status|this.A&64;break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.A=this.f&4?this.A+b:this.A-b,this.f=this.A=this.A&65408|c);break;case 8:this.F=this.A;break;case 12:b=this.ed;case 10:b||(b=this.fd),d=this.f>>7,e=this.f&64?1:0,f=this.f&63,d>=c.la||f>=c.ia?this.M|=37888:(g=(this.I& -63)<<16|this.w,a=65536-this.F&65535,a=b.call(this,c,d,e,f,a,g,this.cd.bind(this)))}a&&(this.M|=129,this.M&64&&Kc(this.b,this.O))}};k.ke=function(){return this.w};k.jf=function(a){this.w=a&65534};k.ne=function(){return this.f};k.mf=function(a){this.f=a};k.oe=function(){return this.F};k.nf=function(a){this.F=a};k.le=function(){return this.I};k.kf=function(a){this.I=a&63}; -var hi={},ci=(hi[63744]=[null,null,P.prototype.me,P.prototype.lf,"RLCS"],hi[63746]=[null,null,P.prototype.ke,P.prototype.jf,"RLBA"],hi[63748]=[null,null,P.prototype.ne,P.prototype.mf,"RLDA"],hi[63750]=[null,null,P.prototype.oe,P.prototype.nf,"RLMP"],hi[63752]=[null,null,P.prototype.le,P.prototype.kf,"RLBE"],hi);function ii(a){x.call(this,"Debugger",a,ii);this.ga=a.base||16;this.Ga=!1;this.J=0;this.U=!1;this.A=-1;this.g=[];this.ba={}}B(ii); -var ji={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};ii.prototype.Lc=function(){return-1};ii.prototype.Mc=function(){}; +function bi(a,b){var c=0;b||(b=[]);a.M=b[c++]||0;a.w=b[c++]||0;a.f=b[c++]||0;a.A=b[c++]||0;a.F=b[c++]||0;a.I=b[c]||0;for(b=0;b>12&48;this.I=f>>16&63;this.A=this.f=b<<7|(c?64:0)|d&63;this.F=65536-e&65535;a&&(this.M=this.M|a|32768);return!0}; +k.fd=function(a,b,c,d,e,f,g){var h=0,l=a.Z,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Z.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Z.read(m,n++))||0>(t=a.Z.read(m,n++))){h=5120;break}this.v.nb(f,r|t<<8);if(Ic(this.v)){h=8192;break}f+=2;if(n>=l.ya&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.gd=function(a,b,c,d,e,f,g){var h=0,l=a.Z,m=null,n;l||(h=5120,e=0);for(;e--;){var r=this.v.Va(f);if(Ic(this.v)){h=8192;break}f+=2;if(!m){m=a.Z.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Z.write(m,n++,r&255)||!a.Z.write(m,n++,r>>8)){h=5120;break}if(n>=l.ya&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)};k.ne=function(){return this.M&65535}; +k.lf=function(a){this.M=this.M&-1023|a&1022;this.O=this.O&-4|(a&48)>>4;if(!(this.M&128)){var b;a=!0;var c=this.g[(this.M&768)>>8],d,e,f,g;this.M&=-2;switch(this.M&14){case 4:this.f&8&&(this.M&=63);this.F=c.status|this.A&64;break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.A=this.f&4?this.A+b:this.A-b,this.f=this.A=this.A&65408|c);break;case 8:this.F=this.A;break;case 12:b=this.fd;case 10:b||(b=this.gd),d=this.f>>7,e=this.f&64?1:0,f=this.f&63,d>=c.la||f>=c.ia?this.M|=37888:(g=(this.I& +63)<<16|this.w,a=65536-this.F&65535,a=b.call(this,c,d,e,f,a,g,this.dd.bind(this)))}a&&(this.M|=129,this.M&64&&Kc(this.b,this.Sb))}};k.le=function(){return this.w};k.jf=function(a){this.w=a&65534};k.oe=function(){return this.f};k.mf=function(a){this.f=a};k.pe=function(){return this.F};k.nf=function(a){this.F=a};k.me=function(){return this.I};k.kf=function(a){this.I=a&63}; +var hi={},ci=(hi[63744]=[null,null,P.prototype.ne,P.prototype.lf,"RLCS"],hi[63746]=[null,null,P.prototype.le,P.prototype.jf,"RLBA"],hi[63748]=[null,null,P.prototype.oe,P.prototype.mf,"RLDA"],hi[63750]=[null,null,P.prototype.pe,P.prototype.nf,"RLMP"],hi[63752]=[null,null,P.prototype.me,P.prototype.kf,"RLBE"],hi);function ii(a){x.call(this,"Debugger",a,ii);this.oa=a.base||16;this.Ga=!1;this.K=0;this.U=!1;this.A=-1;this.g=[];this.fa={}}B(ii); +var ji={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};ii.prototype.Mc=function(){return-1};ii.prototype.Nc=function(){}; function ki(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.U?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(ya(b.substring(c,f))),c=f+1}}return a} function li(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 mi(a,b,c){var d;if(b){b=ni(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function qi(a,b){if(b)return pi(a,b,a.ba[b]);var c=0;for(b in a.ba)pi(a,b,a.ba[b]),c++;return 0>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function qi(a,b){if(b)return pi(a,b,a.fa[b]);var c=0;for(b in a.fa)pi(a,b,a.fa[b]),c++;return 0this.b.ib?Ai:[];Oc(this,16,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.da(Bi(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.v.na;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Ec[c],n&&d.i(p(n.id,8)+" %"+ -p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -k.Mc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.cb[a-8];else if(20>a)b=this.b.Oa[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=cd(this.b);break;case 21:b=c.Wb;break;case 22:b=c.Ba;break;case 23:b=c.lb;break;case 24:b=Pc(c);break;case 25:b=Zc(c);break;case 26:b=$c(c);break;case 27:b=c.Xa;break;case 28:d&&(b=d.Aa);break;case 29:d&&(b=d.Bb);break;case 30:d&&nc(d)&&(b=d.bb)}}return b}; -k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.ta&65535).G));if(this.pa&1073741824)this.Ea.push(a);else if(!this.oa||a!=this.oa){this.oa=a;var c;if(this.pa&-2147483648&&this.b&&(c=this.b.C.X)||xb(this,!0))this.ea(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Fd(a),a.Fa=0,a.wa())}}; -function ti(a){var b;if(!Ie(a))a.H&&a.H.length&&a.i("instruction history buffer freed"),a.fa=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.R?Ii(a):Ji(a)}}function Hi(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.ma?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.X?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Ja=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ti(this);this.Fa=0;this.oa=null;this.J=0;this.L=Y(this.b.u[7]);this.C.X=!1;Ki(this);a||Ad(this)};k.save=function(){var a=new S(this);a.set(0,Di(this.L));a.set(1,Di(this.T));a.set(2,[this.g,this.U,this.pa]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Ei(a[b++]),this.T=Ei(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.U=a[b][1],this.pa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.R||this.i("running");this.C.X=!0;this.Ob=a;this.Pb=b}; -k.stop=function(a,b){if(this.C.X){this.C.X=!1;this.J=b-this.Pb;if(!this.R){b="stopped";if(this.J){a-=this.Ob;var c=0d&&(d=a.b.Va(b)),65535!=(d&65535)&&(a.uc(a.H[a.fa],b),++a.fa==a.H.length&&(a.fa=0)));return!1}function Pf(a){var b=a.b;if(b.C.X)throw T(b,a.b.ta&65535),a.ea(),-1;return!1} +k.Ha=function(a,b,c,d){this.v=b;this.B=a;this.b=c;this.w=a.w;(a=xd(a,"messages"))&&ui(this,a);this.ub=yi;this.Ob=1145>this.b.ib?Ai:[];Oc(this,16,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.da(Bi(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.v.na;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Ec[c],n&&d.i(p(n.id,8)+" %"+ +p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +k.Nc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.cb[a-8];else if(20>a)b=this.b.Oa[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=cd(this.b);break;case 21:b=c.Kb;break;case 22:b=c.Ba;break;case 23:b=c.lb;break;case 24:b=Pc(c);break;case 25:b=Zc(c);break;case 26:b=$c(c);break;case 27:b=c.Xa;break;case 28:d&&(b=d.Aa);break;case 29:d&&(b=d.Bb);break;case 30:d&&nc(d)&&(b=d.bb)}}return b}; +k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.ua&65535).G));if(!this.sa||a!=this.sa)if(this.sa=a,this.pa&1073741824)this.ba.push(a);else{var c;if(this.pa&-2147483648&&this.b&&(c=this.b.C.X)||xb(this,!0))this.ea(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Fd(a),a.Fa=0,a.xa())}}; +function ti(a){var b;if(!He(a))a.H&&a.H.length&&a.i("instruction history buffer freed"),a.ga=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?Ii(a):Ji(a)}}function Hi(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.ma?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.X?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Ja=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ti(this);this.Fa=0;this.sa=null;this.K=0;this.L=Y(this.b.u[7]);this.C.X=!1;Ki(this);a||Ad(this)};k.save=function(){var a=new S(this);a.set(0,Di(this.L));a.set(1,Di(this.T));a.set(2,[this.g,this.U,this.pa]);a.set(3,this.I);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Ei(a[b++]),this.T=Ei(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.U=a[b][1],this.pa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.i("running");this.C.X=!0;this.Pb=a;this.Qb=b}; +k.stop=function(a,b){if(this.C.X){this.C.X=!1;this.K=b-this.Qb;if(!this.S){b="stopped";if(this.K){a-=this.Pb;var c=0d&&(d=a.b.Va(b)),65535!=(d&65535)&&(a.vc(a.H[a.ga],b),++a.ga==a.H.length&&(a.ga=0)));return!1}function Of(a){var b=a.b;if(b.C.X)throw T(b,a.b.ua&65535),a.ea(),-1;return!1} function si(a){var b,c;a.f=["bp"];if(a.O)for(b=1;b>>d.na],!1)}a.O=["br"];if(a.F)for(b=1;b>>d.na],!0);a.F=["bw"];a.sb=0}k.wb=function(a,b,c){var d=!0;c||Li(this,a,b,!1,!0);if(a!=this.f){var e=this.da(b);if(-1===e)this.i("invalid address: "+L(this,b.G)),d=!1;else{var f=this.v;f.Y[e>>>f.na].wb(e&f.v,a==this.F)}}d&&(a.push(b),c?b.Ua=!0:(Mi(this,a,a.length-1,"set"),ti(this)));return d}; -function Li(a,b,c,d,e){var f=!1;c=a.da(c);for(var g=1;g>>d.na],b==a.F));h.Ua||ti(a);break}}return f}function Ni(a,b){for(var c=1;c>23)&65535,y=L(v,t);else if(8192==C)t=t.G-((f&63)<<1)&65535,y=L(v,t);else if(12288==C)y=L(v,f&7,1);else if(24576==C)y=L(v,f&63,1);else if(32768==C)y=L(v,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), -A&63)switch(A=C&7,C&56){case 0:y=Gi(A);break;case 8:y="@"+Gi(A);break;case 16:7>A?y="("+Gi(A)+")+":(C=v.sa(t,2),y="#"+L(v,C,0,!0));break;case 24:7>A?y="@("+Gi(A)+")+":(C=v.sa(t,2),y="@#"+L(v,C,0,!0));break;case 32:y="-("+Gi(A)+")";break;case 40:y="@-("+Gi(A)+")";break;case 48:C=v.sa(t,2);y=L(v,C,0,!0)+"("+Gi(A)+")";7==A&&(y=L(v,C+t.G&65535));break;case 56:C=v.sa(t,2),y="@"+L(v,C)+"("+Gi(A)+")",7==A&&(y="@"+L(v,C+t.G&65535))}v=y;if(!v||!v.length){h="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]); -0b)c=Gi(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.cb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Oa[b-16]);else switch(b){case 20:c="PS="+L(a,cd(d));break;case 21:c="IR="+L(a,d.Wb);break;case 22:c="ER="+L(a,d.Ba);break;case 23:c="SL="+L(a,d.lb);break;case 24:c="MMR0="+L(a,Pc(d));break;case 25:c="MMR1="+L(a,Zc(d));break;case 26:c="MMR2="+L(a,$c(d));break;case 27:c="MMR3="+L(a,d.Xa);break;case 28:a.w&&(c="AR="+L(a,a.w.Aa,3));break;case 29:a.w&& -(c="DR="+L(a,a.w.Bb));break;case 30:a.w&&nc(a.w)&&(c="SR="+L(a,a.w.bb,3))}c&&(c+=" ");return c}function Ri(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Qi(a,"T")+Qi(a,"N")+Qi(a,"Z")+Qi(a,"V")+Qi(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Ic=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Ic);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({pg:b,G:c,xd:d,ja:e,Gc:f})}function Si(a,b,c){var d=[],e=a.da(b)>>>0;for(b=0;b>>0,h=f.xd;if(e>=g&&e>>d.na],b==a.F));h.Ua||ti(a);break}}return f}function Ni(a,b){for(var c=1;c>23)&65535,y=L(v,t);else if(8192==C)t=t.G-((f&63)<<1)&65535,y=L(v,t);else if(12288==C)y=L(v,f&7,1);else if(24576==C)y=L(v,f&63,1);else if(32768==C)y=L(v,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), +A&63)switch(A=C&7,C&56){case 0:y=Gi(A);break;case 8:y="@"+Gi(A);break;case 16:7>A?y="("+Gi(A)+")+":(C=v.ta(t,2),y="#"+L(v,C,0,!0));break;case 24:7>A?y="@("+Gi(A)+")+":(C=v.ta(t,2),y="@#"+L(v,C,0,!0));break;case 32:y="-("+Gi(A)+")";break;case 40:y="@-("+Gi(A)+")";break;case 48:C=v.ta(t,2);y=L(v,C,0,!0)+"("+Gi(A)+")";7==A&&(y=L(v,C+t.G&65535));break;case 56:C=v.ta(t,2),y="@"+L(v,C)+"("+Gi(A)+")",7==A&&(y="@"+L(v,C+t.G&65535))}v=y;if(!v||!v.length){h="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]); +0b)c=Gi(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.cb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Oa[b-16]);else switch(b){case 20:c="PS="+L(a,cd(d));break;case 21:c="IR="+L(a,d.Kb);break;case 22:c="ER="+L(a,d.Ba);break;case 23:c="SL="+L(a,d.lb);break;case 24:c="MMR0="+L(a,Pc(d));break;case 25:c="MMR1="+L(a,Zc(d));break;case 26:c="MMR2="+L(a,$c(d));break;case 27:c="MMR3="+L(a,d.Xa);break;case 28:a.w&&(c="AR="+L(a,a.w.Aa,3));break;case 29:a.w&& +(c="DR="+L(a,a.w.Bb));break;case 30:a.w&&nc(a.w)&&(c="SR="+L(a,a.w.bb,3))}c&&(c+=" ");return c}function Ri(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Qi(a,"T")+Qi(a,"N")+Qi(a,"Z")+Qi(a,"V")+Qi(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Jc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Jc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({pg:b,G:c,yd:d,ja:e,Hc:f})}function Si(a,b,c){var d=[],e=a.da(b)>>>0;for(b=0;b>>0,h=f.yd;if(e>=g&&eb)){e.u[b]= -g&65535;break}a.i("unknown register: "+f);return}a.B.wa();a.i("updated registers:")}}a.i(Ri(a,d));c&&(a.L=Y(e.u[7]),Ji(a,L(a,a.L.G)))}}function Wi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Pi(a,b,g,f);a.i(f);a.L=b;e-=b.G-l;c++}}} -function Oi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.U&&(a.i("ended assemble at "+L(a,a.T.G)),a.L=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.oa=null;if(yb(a)&&0n||"z"h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Pi(a,b,g,f);a.i(f);a.L=b;e-=b.G-l;c++}}} +function Oi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.U&&(a.i("ended assemble at "+L(a,a.T.G)),a.L=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.sa=null;if(yb(a)&&0n||"z"ua.length&&(a.i("note: only "+ua.length+" available"),ea=ua.length);ka-=ea;0>ka&&(null==ua[ua.length-1].G?(ea=ka+ea,ka=0):ka+=ua.length);var be=[];"call"==eh&&(ac=1E5,be=["CALL"]);for(void 0!==dh&&a.i(ea+" instructions earlier:");0=ua.length&&(ka=0);a.tb=ea;gh++;ac--}}gh||(a.i("no "+fh+"history available"),a.tb=void 0)}else{var tb=Bi(a,ta);if(tb){var cc=0,ce=!1,de="ds"==Ta;Ua&&(ce=!0,"l"==Ua.charAt(0)&&(ce=!1,Ua=Ua.substr(1)||pj),cc=oi(a,Ua)>>>0,65536ge?String.fromCharCode(ge):"."),Tc=Tc>>8}Va&&(Va+="\n");Va=de?Va+(Wa+","):Va+(ta+" "+Wa+(0==Sc?" "+fe:""))}Va&&a.i(Va);a.qb=tb}}}}break;case "e":if("else"==g[0])break;var wb,he,ie,je,ke=g[0],le=g[1];"eb"==ke?(wb=1,he=255,ie=a.cc,je=a.Kb):"e"== -ke||"ew"==ke?(wb=2,he=65535,ie=a.sa,je=a.Db):le=null;if(null==le)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Uc=Bi(a,le);if(Uc)for(var Vc=2;Vcoe;){for(var Xa=null,uj=256;65536>hc.G>>>0;){pe.G=a.sa(hc,2);if(null==hc.G||!uj--)break;if(!(pe.G&1)){for(var vj=a,Wc=pe,kh=null,ic=Wc.G,lh=ic,qe=1;6>=qe&⁣qe++){if(2ua.length&&(a.i("note: only "+ua.length+" available"),ea=ua.length);ka-=ea;0>ka&&(null==ua[ua.length-1].G?(ea=ka+ea,ka=0):ka+=ua.length);var be=[];"call"==dh&&(ac=1E5,be=["CALL"]);for(void 0!==ch&&a.i(ea+" instructions earlier:");0=ua.length&&(ka=0);a.tb=ea;fh++;ac--}}fh||(a.i("no "+eh+"history available"),a.tb=void 0)}else{var tb=Bi(a,ta);if(tb){var cc=0,ce=!1,de="ds"==Ta;Ua&&(ce=!0,"l"==Ua.charAt(0)&&(ce=!1,Ua=Ua.substr(1)||pj),cc=oi(a,Ua)>>>0,65536ge?String.fromCharCode(ge):"."),Tc=Tc>>8}Va&&(Va+="\n");Va=de?Va+(Wa+","):Va+(ta+" "+Wa+(0==Sc?" "+fe:""))}Va&&a.i(Va);a.qb=tb}}}}break;case "e":if("else"==g[0])break;var wb,he,ie,je,ke=g[0],le=g[1];"eb"==ke?(wb=1,he=255,ie=a.dc,je=a.Lb):"e"== +ke||"ew"==ke?(wb=2,he=65535,ie=a.ta,je=a.Db):le=null;if(null==le)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Uc=Bi(a,le);if(Uc)for(var Vc=2;Vcoe;){for(var Xa=null,uj=256;65536>hc.G>>>0;){pe.G=a.ta(hc,2);if(null==hc.G||!uj--)break;if(!(pe.G&1)){for(var vj=a,Wc=pe,jh=null,ic=Wc.G,kh=ic,qe=1;6>=qe&⁣qe++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;baj){if(cj(d,this.I)){this.A=new S(this,"1.30.4","failsafe");cj(this.A)&&(hj(this,d),a=2,ij(this.A));this.A.set("timestamp",Ca());jj(this.A);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=gj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?cj(d,g):("error"== -f&&"no machine state"!=g?(this.N("Error: "+g),"unable to verify user"==g&&(La("user",""),this.B=null)):this.i(f+": "+g),ij(d),cj(d)?(c=gj(d),e=!0):c=!1))}e&&fj(this,c?d:null)}else 2==a&&d.clear()}else fj(this);delete this.I;delete this.J}e=mb(this.id);for(f=0;fa[1];a=a[2];this.ga=!0;this.C.ma=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(kj(this,this.b,b,c,a),this.wa(),this.b.Eb());this.R&&(hj(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.g=0}; +k.Xb=function(a){void 0===a&&(a=this.f||(this.I?1:aj));if(!this.g){this.g++;var b=!1,c=!1;this.S=!1;var d=this.K||new S(this,"1.30.4");if(-1==a)b=!0;else if(a>aj){if(cj(d,this.I)){this.A=new S(this,"1.30.4","failsafe");cj(this.A)&&(hj(this,d),a=2,ij(this.A));this.A.set("timestamp",Ca());jj(this.A);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=gj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?cj(d,g):("error"== +f&&"no machine state"!=g?(this.N("Error: "+g),"unable to verify user"==g&&(La("user",""),this.B=null)):this.i(f+": "+g),ij(d),cj(d)?(c=gj(d),e=!0):c=!1))}e&&fj(this,c?d:null)}else 2==a&&d.clear()}else fj(this);delete this.I;delete this.K}e=mb(this.id);for(f=0;fa[1];a=a[2];this.ga=!0;this.C.ma=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(kj(this,this.b,b,c,a),this.xa(),this.b.Eb());this.S&&(hj(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.g=0}; function hj(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.B||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.4"};d.url=a.fa;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} function Yi(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.4"),g=new S(a,"1.30.4","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.4");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.ea(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.ma=!1,!1===d&&(e=null)));for(var h=mb(a.id),l=0;l=c||30<=(b.Nb+=c))&&(d.textContent=b.C.X?b.Da.toFixed(2)+"Mhz":"Stopped",b.Nb=0)}if(this.w&&(b=this.w,a=a||0,b.F)){c=b.b.C.X;d=!!(b.b.K&4);if(0>=a||60<=(b.A+=a)){for(var e=0;e=c||30<=(b.Ob+=c))&&(d.textContent=b.C.X?b.Ea.toFixed(2)+"Mhz":"Stopped",b.Ob=0)}if(this.w&&(b=this.w,a=a||0,b.F)){c=b.b.C.X;d=!!(b.b.J&4);if(0>=a||60<=(b.A+=a)){for(var e=0;e":62,"?":63,"@":64, -Sb:65,Qe:66,Re:67,Ue:68,E:69,Ve:70,We:71,Xe:72,Ye:73,Ze:74,$e:75,af:76,bf:77,cf:78,df:79,ef:80,Q:81,ff:82,gf:83,hf:84,jf:85,kf:86,lf:87,mf:88,nf:89,wc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,pf:97,qf:98,rf:99,d:100,e:101,sf:102,tf:103,uf:104,vf:105,yf:106,k:107,zf:108,Af:109,n:110,Bf:111,p:112,q:113,r:114,Cf:115,t:116,Df:117,Ef:118,Ff:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,nc:127}; +var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},ja={nc:1,Se:3,Te:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64, +Tb:65,Qe:66,Re:67,Ue:68,E:69,Ve:70,We:71,Xe:72,Ye:73,Ze:74,$e:75,af:76,bf:77,cf:78,df:79,ef:80,Q:81,ff:82,gf:83,hf:84,jf:85,kf:86,lf:87,mf:88,nf:89,xc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,pf:97,qf:98,rf:99,d:100,e:101,sf:102,tf:103,uf:104,vf:105,yf:106,k:107,zf:108,Af:109,n:110,Bf:111,p:112,q:113,r:114,Cf:115,t:116,Df:117,Ef:118,Ff:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,oc:127}; function m(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function q(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function r(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})} @@ -43,219 +43,220 @@ function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function t(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function ta(a,b){var c,d={L:null,ba:null,na:null,ma:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.na=g.load;d.ma=g.exec;if(e=g.bytes)d.L=e;else if(e=g.words)for(d.L=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.L=Array(4*e.length),f=c=0;c>8&255,d.L[f++]=e[c]>>16&255,d.L[f++]=e[c]>>24&255;else d.L=g;d.ba=g.symbols;d.L.length?1==d.L.length&&(w(d.L[0]),d=null):(w("Empty resource: "+a),d=null)}catch(k){w("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.na=g.load;d.ma=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ba=g.symbols;d.M.length?1==d.M.length&&(w(d.M[0]),d=null):(w("Empty resource: "+a),d=null)}catch(k){w("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Ca=this.id:(this.ua=this.id.substr(0,b),this.Ca=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Fa:!1,Hb:!1,R:!1,error:!1};this.vb=null;this.o.error=!1;this.j={};this.H=null;this.Hc=d||0;y.push(this)}var Na=void 0,Oa={}; +Ia(Ca("Opera")||Ca("iOS")?"onunload":"onbeforeunload",function(){Ka(Ea.exit)});function x(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Yb=b.comment;this.Kc=b;b=this.id.indexOf(".");0>b?this.Ca=this.id:(this.ua=this.id.substr(0,b),this.Ca=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Fa:!1,Jb:!1,R:!1,error:!1};this.wb=null;this.o.error=!1;this.j={};this.G=null;this.Ic=d||0;y.push(this)}var Na=void 0,Oa={}; if(window){Na||(Na=window.location.search.substr(1));for(var Pa,Qa=/\+/g,Ra=/([^&=]+)=?([^&]*)/g;Pa=Ra.exec(Na);)Oa[decodeURIComponent(Pa[1].replace(Qa," "))]=decodeURIComponent(Pa[2].replace(Qa," "))}function Sa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function z(a,b){b||(b=x);a.prototype=Sa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ta=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Ta={},y=[];function Ua(a,b,c){Ta[a]&&b&&(Ta[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.Sc,a]}z(ab);var bb=7;function cb(a,b){return a.b[b]&&a.b[b][1]}h=ab.prototype;h.reset=function(){this.stop()}; -h.aa=function(a,b,c,d){if(this.l&&this.l.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.h[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){db(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){eb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){db(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){eb(a,b)}}(this,b),!0):this.parent.aa.call(this,a,b,c,d)}};h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.H=d;fb(b,this,gb);hb(b,this.reset.bind(this));ib(this);jb(this)};h.ha=function(a,b){b||(kb(),this.reset());return!0};h.ga=function(){return!0}; -function lb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ib(a,b){for(var c in a.h)lb(a,c,null!=b?b:a.h[c])}function mb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function jb(a){for(var b in a.b)mb(a,b,a.b[b][1])}function nb(a,b,c,d){a.j[b]&&(void 0===c&&(Za(a,"Value for "+b+" is invalid"),F(a.a)),c=8==(a.H&&a.H.g||8)?ka(c,d):q(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} -function db(a,b){var c=a.b[b];mb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.D="EXAM"==b)}function eb(a,b){var c=a.b[b];c[2]&&c[3]&&(mb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Qc=function(a){a||this.a.o.T||(a=this.a,a.g.reset(),ob(a),cb(this,"ENABLE")&&pb(this.a))};h.Rc=function(){};h.Mc=function(a){a||F(this.a)}; -h.Kc=function(a){if(!a&&!this.a.o.T)if(cb(this,"ENABLE"))pb(this.a);else{a=this.H;var b;if(b=a)a.o.Fa&&(a.o.Hb=!0),b=!a.o.Fa;if(b)Xa(a,!0),a.xb(0,null),Xa(a,!1);else try{var c=this.a.xb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Ra?8:16,c=65472<=a.ia&&a.ia<65472+b,b=c?1:2,c=c?15:a.g.qa;cb(a,"STEP")||(b=-b);vb(a,a.ia&~c|a.ia+b&c)}function vb(a,b){a.ia=b&a.g.qa;b=a.ia;for(var c=0;22>c;c++)wb(a,"A"+c,b&1<c;c++)wb(a,"D"+c,b&1<>2;this.l=this.b-1;this.A=this.D/this.b|0;this.Da=[];this.h=0;this.m=!1;this.Ib=0;this.w=[];this.xc=[zb,Ab,Bb,Cb];a=new H(this);Db(a,this.H);this.g=Array(this.A);for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Tc,a]}z(ab);var bb=7;function cb(a,b){return a.b[b]&&a.b[b][1]}h=ab.prototype;h.reset=function(){this.stop()}; +h.aa=function(a,b,c,d){if(this.l&&this.l.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.h[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){db(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){eb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){db(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){eb(a,b)}}(this,b),!0):this.parent.aa.call(this,a,b,c,d)}};h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;fb(b,this,gb);hb(b,this.reset.bind(this));ib(this);jb(this)};h.ha=function(a,b){b||(kb(),this.reset());return!0};h.ga=function(){return!0}; +function lb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ib(a,b){for(var c in a.h)lb(a,c,null!=b?b:a.h[c])}function mb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function jb(a){for(var b in a.b)mb(a,b,a.b[b][1])}function nb(a,b,c,d){a.j[b]&&(void 0===c&&(Za(a,"Value for "+b+" is invalid"),F(a.a)),c=8==(a.G&&a.G.g||8)?ka(c,d):q(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} +function db(a,b){var c=a.b[b];mb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.w="DEP"==b,a.C="EXAM"==b)}function eb(a,b){var c=a.b[b];c[2]&&c[3]&&(mb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Rc=function(a){a||this.a.o.T||(a=this.a,a.g.reset(),ob(a),cb(this,"ENABLE")&&pb(this.a))};h.Sc=function(){};h.Nc=function(a){a||F(this.a)}; +h.Lc=function(a){if(!a&&!this.a.o.T)if(cb(this,"ENABLE"))pb(this.a);else{a=this.G;var b;if(b=a)a.o.Fa&&(a.o.Jb=!0),b=!a.o.Fa;if(b)Xa(a,!0),a.zb(0,null),Xa(a,!1);else try{var c=this.a.zb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Ra?8:16,c=65472<=a.ia&&a.ia<65472+b,b=c?1:2,c=c?15:a.g.qa;cb(a,"STEP")||(b=-b);vb(a,a.ia&~c|a.ia+b&c)}function vb(a,b){a.ia=b&a.g.qa;b=a.ia;for(var c=0;22>c;c++)wb(a,"A"+c,b&1<c;c++)wb(a,"D"+c,b&1<>2;this.l=this.b-1;this.w=this.C/this.b|0;this.Da=[];this.h=0;this.m=!1;this.Kb=0;this.A=[];this.yc=[zb,Ab,Bb,Cb];a=new H(this);Db(a,this.G);this.g=Array(this.w);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.Da[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255} function Ab(a,b,c){var d=!1,e=this.controller,f=e.Da[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Da[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Bb(a,b){var c=-1,d=this.controller;a=d.Da[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535} -function Cb(a,b,c){var d=!1,e=this.controller;a=e.Da[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Fb(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.Pa)return l.yb+=l.Pa-f,l.Pa=f,!0;if(f>=l.Pa+l.yb){p=l.size-(f-n);p>g&&(p=g);l.yb=f-l.Pa+p;f=n+a.b;g-=p;k++;continue}}return Kb(1,f,g)}f=new H(a,f,p,a.b,d,e);Db(f,a.H,l);a.g[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Lb&&(a.Ib+=c),a.status((c>>10)+"Kb "+Mb[d]+" at "+ka(b)),!0):Kb(2,b,c)} -function Hb(a,b,c){var d=[];for(b>>>=a.c;0>>=a.c;0>>a.c].Lb(b&a.l,b)}function Pb(a,b){3932160<=b&&(b=Ob(a.a,b));return a.g[(b&a.qa)>>>a.c].Y(b&a.l,b)}h.Qa=function(a){3932160<=a&&(a=Ob(this.a,a));var b=a&this.l,c=(a&this.qa)>>>this.c;this.m=!1;this.h++;a=this.g[c].ec(b,a);this.h--;return a}; -function Qb(a,b,c){3932160<=b&&(b=Ob(a.a,b));a.g[(b&a.qa)>>>a.c].Qb(b&a.l,c&255,b)}h.jb=function(a,b){3932160<=a&&(a=Ob(this.a,a));this.m=!1;this.h++;this.g[(a&this.qa)>>>this.c].Rb(a&this.l,b&255,a);this.h--};function Rb(a,b,c){3932160<=b&&(b=Ob(a.a,b));a.g[(b&a.qa)>>>a.c].zb(b&a.l,c&65535,b)}h.Va=function(a,b){3932160<=a&&(a=Ob(this.a,a));var c=a&this.l,d=(a&this.qa)>>>this.c;this.m=!1;this.h++;this.g[d].kc(c,b&65535,a);this.h--}; -function Sb(a){for(var b=0,c=[],d=0;da.a.Ra)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,v=0;v>16&65535);a=a.Eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.dd=function(){var a=this.a;a.Z&57344||(a.Gb=a.A&65535);return a.Gb};h.ed=function(){return this.a.Ea};h.ee=function(a){var b=this.a;1170>b.Ra&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Ya=a&16?4194303:262143,ac(b))};h.Nd=function(a){a=a>>1&63;var b=this.a.kb[a>>1];return a&1?b>>16:b&65535}; -h.Me=function(a,b){b=b>>1&63;var c=b>>1;this.a.kb[c]=b&1?this.a.kb[c]&65535|(a&63)<<16:this.a.kb[c]&-65536|a&65534};h.Gd=function(a){return this.a.I[1][a>>1&7]};h.Fe=function(a,b){this.a.I[1][b>>1&7]=a&65295};h.Ed=function(a){return this.a.I[1][(a>>1&7)+8]};h.De=function(a,b){this.a.I[1][(b>>1&7)+8]=a&65295};h.Fd=function(a){return this.a.ca[1][a>>1&7]};h.Ee=function(a,b){b=b>>1&7;this.a.ca[1][b]=a;this.a.I[1][b]&=65295};h.Dd=function(a){return this.a.ca[1][(a>>1&7)+8]}; -h.Ce=function(a,b){b=(b>>1&7)+8;this.a.ca[1][b]=a;this.a.I[1][b]&=65295};h.Zc=function(a){return this.a.I[0][a>>1&7]};h.ae=function(a,b){this.a.I[0][b>>1&7]=a&65295};h.Xc=function(a){return this.a.I[0][(a>>1&7)+8]};h.Zd=function(a,b){this.a.I[0][(b>>1&7)+8]=a&65295};h.Yc=function(a){return this.a.ca[0][a>>1&7]};h.$d=function(a,b){b=b>>1&7;this.a.ca[0][b]=a;this.a.I[0][b]&=65295};h.Wc=function(a){return this.a.ca[0][(a>>1&7)+8]};h.Yd=function(a,b){b=(b>>1&7)+8;this.a.ca[0][b]=a;this.a.I[0][b]&=65295}; -h.Md=function(a){return this.a.I[3][a>>1&7]};h.Le=function(a,b){this.a.I[3][b>>1&7]=a&65295};h.Kd=function(a){return this.a.I[3][(a>>1&7)+8]};h.Je=function(a,b){this.a.I[3][(b>>1&7)+8]=a&65295};h.Ld=function(a){return this.a.ca[3][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.a.ca[3][b]=a;this.a.I[3][b]&=65295};h.Jd=function(a){return this.a.ca[3][(a>>1&7)+8]};h.Ie=function(a,b){b=(b>>1&7)+8;this.a.ca[3][b]=a;this.a.I[3][b]&=65295};h.Ta=function(a){a&=7;return this.a.F&2048?this.a.Ja[a]:this.a.f[a]}; -h.Wa=function(a,b){b&=7;this.a.F&2048?this.a.Ja[b]=a:this.a.f[b]=a};h.kd=function(){return this.a.F&49152?this.a.ra[0]:this.a.f[6]};h.je=function(a){this.a.F&49152?this.a.ra[0]=a:this.a.f[6]=a};h.nd=function(){return this.a.f[7]};h.me=function(a){this.a.f[7]=a};h.Ua=function(a){a&=7;return this.a.F&2048?this.a.f[a]:this.a.Ja[a]};h.Xa=function(a,b){b&=7;this.a.F&2048?this.a.f[b]=a:this.a.Ja[b]=a};h.ld=function(){return 1==(this.a.F&49152)>>14?this.a.f[6]:this.a.ra[1]}; -h.ke=function(a){1==(this.a.F&49152)>>14?this.a.f[6]=a:this.a.ra[1]=a};h.md=function(){return 3==(this.a.F&49152)>>14?this.a.f[6]:this.a.ra[3]};h.le=function(a){3==(this.a.F&49152)>>14?this.a.f[6]=a:this.a.ra[3]=a};h.Vc=function(a){return this.a.hc[a-65504>>1]};h.Xd=function(a,b){this.a.hc[b-65504>>1]=a};h.dc=function(a){if(65520==a){a=0;switch(Lb){case Lb:a=this.g.Ib}a=(a>>6)-1}else a=0;return a};h.jc=function(){};h.Id=function(){return 1};h.He=function(){};h.Uc=function(){return this.a.ja}; -h.Wd=function(){this.a.ja=0};h.ad=function(){return this.a.gc};h.ce=function(a,b){b&1||(a&=255);this.a.gc=a};h.fd=function(a,b){return b?0:this.a.Mb};h.fe=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Mb=a;b.v|=2};h.Hd=function(a,b){return b?0:this.a.ib&65280};h.Ge=function(a){this.a.ib=a|255};h.jd=function(){return bc(this.a)};h.ie=function(a){cc(this.a,a&-1793|bc(this.a)&1792);this.a.v|=128};h.ic=function(){}; -var L={},Zb=(L[61568]=[null,null,K.prototype.Nd,K.prototype.Me,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Gd,K.prototype.Fe,"SIPDR",8,1145,64],L[62608]=[null,null,K.prototype.Ed,K.prototype.De,"SDPDR",8,1145,64],L[62624]=[null,null,K.prototype.Fd,K.prototype.Ee,"SIPAR",8,1145,64],L[62640]=[null,null,K.prototype.Dd,K.prototype.Ce,"SDPAR",8,1145,64],L[62656]=[null,null,K.prototype.Zc,K.prototype.ae,"KIPDR",8,1145,64],L[62672]=[null,null,K.prototype.Xc,K.prototype.Zd,"KDPDR",8,1145,64],L[62688]= -[null,null,K.prototype.Yc,K.prototype.$d,"KIPAR",8,1145,64],L[62704]=[null,null,K.prototype.Wc,K.prototype.Yd,"KDPAR",8,1145,64],L[62798]=[null,null,K.prototype.ed,K.prototype.ee,"MMR3",1,1145,64],L[65382]=[null,null,K.prototype.$c,K.prototype.be,"LKS"],L[65402]=[null,null,K.prototype.bd,K.prototype.de,"MMR0",1,1145,64],L[65404]=[null,null,K.prototype.cd,K.prototype.ic,"MMR1",1,1145,64],L[65406]=[null,null,K.prototype.dd,K.prototype.ic,"MMR2",1,1145,64],L[65408]=[null,null,K.prototype.Md,K.prototype.Le, -"UIPDR",8,1145,64],L[65424]=[null,null,K.prototype.Kd,K.prototype.Je,"UDPDR",8,1145,64],L[65440]=[null,null,K.prototype.Ld,K.prototype.Ke,"UIPAR",8,1145,64],L[65456]=[null,null,K.prototype.Jd,K.prototype.Ie,"UDPAR",8,1145,64],L[65472]=[null,null,K.prototype.Ta,K.prototype.Wa,"R0SET0"],L[65473]=[null,null,K.prototype.Ta,K.prototype.Wa,"R1SET0"],L[65474]=[null,null,K.prototype.Ta,K.prototype.Wa,"R2SET0"],L[65475]=[null,null,K.prototype.Ta,K.prototype.Wa,"R3SET0"],L[65476]=[null,null,K.prototype.Ta, -K.prototype.Wa,"R4SET0"],L[65477]=[null,null,K.prototype.Ta,K.prototype.Wa,"R5SET0"],L[65478]=[null,null,K.prototype.kd,K.prototype.je,"R6KERNEL"],L[65479]=[null,null,K.prototype.nd,K.prototype.me,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ua,K.prototype.Xa,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ua,K.prototype.Xa,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ua,K.prototype.Xa,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ua,K.prototype.Xa,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ua, -K.prototype.Xa,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ua,K.prototype.Xa,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.ld,K.prototype.ke,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.md,K.prototype.le,"R6USER",1,1145],L[65504]=[null,null,K.prototype.Vc,K.prototype.Xd,"CTRL",8,1170],L[65520]=[null,null,K.prototype.dc,K.prototype.jc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.dc,K.prototype.jc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Id,K.prototype.He,"SYSID",1,1170],L[65526]= -[null,null,K.prototype.Uc,K.prototype.Wd,"CPUERR",1,1170],L[65528]=[null,null,K.prototype.ad,K.prototype.ce,"MB",1,1170],L[65530]=[null,null,K.prototype.fd,K.prototype.fe,"PIR"],L[65532]=[null,null,K.prototype.Hd,K.prototype.Ge,"SL"],L[65534]=[null,null,K.prototype.jd,K.prototype.ie,"PSW"],L); +function Cb(a,b,c){var d=!1,e=this.controller;a=e.Da[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Fb(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.Pa)return l.Ab+=l.Pa-f,l.Pa=f,!0;if(f>=l.Pa+l.Ab){p=l.size-(f-n);p>g&&(p=g);l.Ab=f-l.Pa+p;f=n+a.b;g-=p;k++;continue}}return Kb(1,f,g)}f=new H(a,f,p,a.b,d,e);Db(f,a.G,l);a.g[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Lb&&(a.Kb+=c),a.status((c>>10)+"Kb "+Mb[d]+" at "+ka(b)),!0):Kb(2,b,c)} +function Hb(a,b,c){var d=[];for(b>>>=a.c;0>>=a.c;0>>a.c].Nb(b&a.l,b)}function Pb(a,b){3932160<=b&&(b=Ob(a.a,b));return a.g[(b&a.qa)>>>a.c].Y(b&a.l,b)}h.Qa=function(a){3932160<=a&&(a=Ob(this.a,a));var b=a&this.l,c=(a&this.qa)>>>this.c;this.m=!1;this.h++;a=this.g[c].fc(b,a);this.h--;return a}; +function Qb(a,b,c){3932160<=b&&(b=Ob(a.a,b));a.g[(b&a.qa)>>>a.c].Rb(b&a.l,c&255,b)}h.kb=function(a,b){3932160<=a&&(a=Ob(this.a,a));this.m=!1;this.h++;this.g[(a&this.qa)>>>this.c].Sb(a&this.l,b&255,a);this.h--};function Rb(a,b,c){3932160<=b&&(b=Ob(a.a,b));a.g[(b&a.qa)>>>a.c].Bb(b&a.l,c&65535,b)}h.Va=function(a,b){3932160<=a&&(a=Ob(this.a,a));var c=a&this.l,d=(a&this.qa)>>>this.c;this.m=!1;this.h++;this.g[d].lc(c,b&65535,a);this.h--}; +function Sb(a){for(var b=0,c=[],d=0;da.a.Ra)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,v=0;v>16&65535);a=a.Gb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.ed=function(){var a=this.a;a.Z&57344||(a.Ib=a.w&65535);return a.Ib};h.fd=function(){return this.a.Ea};h.ee=function(a){var b=this.a;1170>b.Ra&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Ya=a&16?4194303:262143,ac(b))};h.Od=function(a){a=a>>1&63;var b=this.a.lb[a>>1];return a&1?b>>16:b&65535}; +h.Me=function(a,b){b=b>>1&63;var c=b>>1;this.a.lb[c]=b&1?this.a.lb[c]&65535|(a&63)<<16:this.a.lb[c]&-65536|a&65534};h.Hd=function(a){return this.a.I[1][a>>1&7]};h.Fe=function(a,b){this.a.I[1][b>>1&7]=a&65295};h.Fd=function(a){return this.a.I[1][(a>>1&7)+8]};h.De=function(a,b){this.a.I[1][(b>>1&7)+8]=a&65295};h.Gd=function(a){return this.a.ca[1][a>>1&7]};h.Ee=function(a,b){b=b>>1&7;this.a.ca[1][b]=a;this.a.I[1][b]&=65295};h.Ed=function(a){return this.a.ca[1][(a>>1&7)+8]}; +h.Ce=function(a,b){b=(b>>1&7)+8;this.a.ca[1][b]=a;this.a.I[1][b]&=65295};h.$c=function(a){return this.a.I[0][a>>1&7]};h.ae=function(a,b){this.a.I[0][b>>1&7]=a&65295};h.Yc=function(a){return this.a.I[0][(a>>1&7)+8]};h.Zd=function(a,b){this.a.I[0][(b>>1&7)+8]=a&65295};h.Zc=function(a){return this.a.ca[0][a>>1&7]};h.$d=function(a,b){b=b>>1&7;this.a.ca[0][b]=a;this.a.I[0][b]&=65295};h.Xc=function(a){return this.a.ca[0][(a>>1&7)+8]};h.Yd=function(a,b){b=(b>>1&7)+8;this.a.ca[0][b]=a;this.a.I[0][b]&=65295}; +h.Nd=function(a){return this.a.I[3][a>>1&7]};h.Le=function(a,b){this.a.I[3][b>>1&7]=a&65295};h.Ld=function(a){return this.a.I[3][(a>>1&7)+8]};h.Je=function(a,b){this.a.I[3][(b>>1&7)+8]=a&65295};h.Md=function(a){return this.a.ca[3][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.a.ca[3][b]=a;this.a.I[3][b]&=65295};h.Kd=function(a){return this.a.ca[3][(a>>1&7)+8]};h.Ie=function(a,b){b=(b>>1&7)+8;this.a.ca[3][b]=a;this.a.I[3][b]&=65295};h.Ta=function(a){a&=7;return this.a.F&2048?this.a.Ja[a]:this.a.f[a]}; +h.Wa=function(a,b){b&=7;this.a.F&2048?this.a.Ja[b]=a:this.a.f[b]=a};h.ld=function(){return this.a.F&49152?this.a.ra[0]:this.a.f[6]};h.je=function(a){this.a.F&49152?this.a.ra[0]=a:this.a.f[6]=a};h.od=function(){return this.a.f[7]};h.me=function(a){this.a.f[7]=a};h.Ua=function(a){a&=7;return this.a.F&2048?this.a.f[a]:this.a.Ja[a]};h.Xa=function(a,b){b&=7;this.a.F&2048?this.a.f[b]=a:this.a.Ja[b]=a};h.md=function(){return 1==(this.a.F&49152)>>14?this.a.f[6]:this.a.ra[1]}; +h.ke=function(a){1==(this.a.F&49152)>>14?this.a.f[6]=a:this.a.ra[1]=a};h.nd=function(){return 3==(this.a.F&49152)>>14?this.a.f[6]:this.a.ra[3]};h.le=function(a){3==(this.a.F&49152)>>14?this.a.f[6]=a:this.a.ra[3]=a};h.Wc=function(a){return this.a.ic[a-65504>>1]};h.Xd=function(a,b){this.a.ic[b-65504>>1]=a};h.ec=function(a){if(65520==a){a=0;switch(Lb){case Lb:a=this.g.Kb}a=(a>>6)-1}else a=0;return a};h.kc=function(){};h.Jd=function(){return 1};h.He=function(){};h.Vc=function(){return this.a.ja}; +h.Wd=function(){this.a.ja=0};h.bd=function(){return this.a.hc};h.ce=function(a,b){b&1||(a&=255);this.a.hc=a};h.gd=function(a,b){return b?0:this.a.yb};h.fe=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.u|=2}b.yb=a};h.Id=function(a,b){return b?0:this.a.jb&65280};h.Ge=function(a){this.a.jb=a|255};h.kd=function(){return bc(this.a)};h.ie=function(a){cc(this.a,a&-1793|bc(this.a)&1792);this.a.u|=128};h.jc=function(){}; +var L={},Zb=(L[61568]=[null,null,K.prototype.Od,K.prototype.Me,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Hd,K.prototype.Fe,"SIPDR",8,1145,64],L[62608]=[null,null,K.prototype.Fd,K.prototype.De,"SDPDR",8,1145,64],L[62624]=[null,null,K.prototype.Gd,K.prototype.Ee,"SIPAR",8,1145,64],L[62640]=[null,null,K.prototype.Ed,K.prototype.Ce,"SDPAR",8,1145,64],L[62656]=[null,null,K.prototype.$c,K.prototype.ae,"KIPDR",8,1145,64],L[62672]=[null,null,K.prototype.Yc,K.prototype.Zd,"KDPDR",8,1145,64],L[62688]= +[null,null,K.prototype.Zc,K.prototype.$d,"KIPAR",8,1145,64],L[62704]=[null,null,K.prototype.Xc,K.prototype.Yd,"KDPAR",8,1145,64],L[62798]=[null,null,K.prototype.fd,K.prototype.ee,"MMR3",1,1145,64],L[65382]=[null,null,K.prototype.ad,K.prototype.be,"LKS"],L[65402]=[null,null,K.prototype.cd,K.prototype.de,"MMR0",1,1145,64],L[65404]=[null,null,K.prototype.dd,K.prototype.jc,"MMR1",1,1145,64],L[65406]=[null,null,K.prototype.ed,K.prototype.jc,"MMR2",1,1145,64],L[65408]=[null,null,K.prototype.Nd,K.prototype.Le, +"UIPDR",8,1145,64],L[65424]=[null,null,K.prototype.Ld,K.prototype.Je,"UDPDR",8,1145,64],L[65440]=[null,null,K.prototype.Md,K.prototype.Ke,"UIPAR",8,1145,64],L[65456]=[null,null,K.prototype.Kd,K.prototype.Ie,"UDPAR",8,1145,64],L[65472]=[null,null,K.prototype.Ta,K.prototype.Wa,"R0SET0"],L[65473]=[null,null,K.prototype.Ta,K.prototype.Wa,"R1SET0"],L[65474]=[null,null,K.prototype.Ta,K.prototype.Wa,"R2SET0"],L[65475]=[null,null,K.prototype.Ta,K.prototype.Wa,"R3SET0"],L[65476]=[null,null,K.prototype.Ta, +K.prototype.Wa,"R4SET0"],L[65477]=[null,null,K.prototype.Ta,K.prototype.Wa,"R5SET0"],L[65478]=[null,null,K.prototype.ld,K.prototype.je,"R6KERNEL"],L[65479]=[null,null,K.prototype.od,K.prototype.me,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ua,K.prototype.Xa,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ua,K.prototype.Xa,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ua,K.prototype.Xa,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ua,K.prototype.Xa,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ua, +K.prototype.Xa,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ua,K.prototype.Xa,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.md,K.prototype.ke,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.nd,K.prototype.le,"R6USER",1,1145],L[65504]=[null,null,K.prototype.Wc,K.prototype.Xd,"CTRL",8,1170],L[65520]=[null,null,K.prototype.ec,K.prototype.kc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.ec,K.prototype.kc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Jd,K.prototype.He,"SYSID",1,1170],L[65526]= +[null,null,K.prototype.Vc,K.prototype.Wd,"CPUERR",1,1170],L[65528]=[null,null,K.prototype.bd,K.prototype.ce,"MB",1,1170],L[65530]=[null,null,K.prototype.gd,K.prototype.fe,"PIR"],L[65532]=[null,null,K.prototype.Id,K.prototype.Ge,"SL"],L[65534]=[null,null,K.prototype.kd,K.prototype.ie,"PSW"],L); Ja(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),kc(this,gc?lc:mc);else{a=this.a=Array(this.size>> +function H(a,b,c,d,e,f){this.g=a;this.id=hc+=2;this.a=null;this.Pa=b;this.Ab=c;this.size=d||0;this.type=e||ic;this.l=e==jc;this.controller=null;Db(this);this.za=this.Ec=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],kc(this,f.yc);else if($a)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.j=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),kc(this,gc?lc:mc);else{a=this.a=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},P:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&I(this.g,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},ua: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.za=!0},G:function(a,b){return this.K(a,b)},V:function(a,b){return this.ec(a,b)},ta:function(a,b,c){this.l?this.h(a,b,c):this.Rb(a,b,c)},wa:function(a,b,c){this.l?this.h(a,b,c):this.kc(a,b,c)},D:function(a){return this.j[a]},N:function(a){return this.j[a]},U:function(a,b){a&1&&I(this.g,b,64);return this.c.getUint16(a,!0)},ka:function(a,b){a&1&&I(this.g,b,64);return this.s[a>>1]},sa:function(a,b){this.j[a]=b;this.za=!0},Ca:function(a,b){this.j[a]=b;this.za=!0},va:function(a,b,c){a&1&&I(this.g, -c,64);this.c.setUint16(a,b,!0);this.za=!0},xa:function(a,b,c){a&1&&I(this.g,c,64);this.s[a>>1]=b;this.za=!0}};function Db(a,b,c){a.H=b;a.i=a.m=0;c&&((a.i=c.i)&&oc(a,pc,!1),(a.m=c.m)&&sc(a,pc,!1))}function sc(a,b,c){c&&a.m||(a.Qb=!a.l&&b[1]||a.h,a.zb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Rb=b[1]||a.h,a.kc=b[3]||a.A}function oc(a,b,c){c&&a.i||(a.Lb=b[0]||a.u,a.Y=b[2]||a.w);if(c||void 0===c)a.K=b[0]||a.u,a.ec=b[2]||a.w}function kc(a,b){b||(b=tc);oc(a,b,void 0);sc(a,b,void 0)} -var tc=[],nc=[H.prototype.P,H.prototype.ua,H.prototype.la,H.prototype.ya],pc=[H.prototype.G,H.prototype.ta,H.prototype.V,H.prototype.wa];if($a)var mc=[H.prototype.D,H.prototype.sa,H.prototype.U,H.prototype.va],lc=[H.prototype.N,H.prototype.Ca,H.prototype.ka,H.prototype.xa]; -function uc(a,b){x.call(this,"CPU",a,uc,1);b=a.cycles||b;var c=a.multiplier||1;this.Bb=0;this.qb=b;this.xa=c;this.Db=Math.round(this.qb/1E4)/100;this.Ma=this.Db*this.xa;this.o.T=!1;this.o.Ob=!1;this.o.cb=a.autoStart;this.o.tb=!1;this.ob=this.Na=0;this.pb=a.csStart;this.Za=a.csInterval;this.$a=a.csStop;this.N=[];this.cc=this.Rd.bind(this);E(this)}z(uc);var vc=["power","reset"];h=uc.prototype; -h.fa=function(a,b,c,d){this.l=a;this.g=b;this.H=d;this.w=a.w;for(b=0;b=a.Na&&(a.Na+=a.Za,c=!0);0<=a.$a&&a.$a<=zc(a)&&(a.Za=a.$a=-1,yc(a),F(a),c=!0);c&&a.X(zc(a)+" cycles: checksum="+q(a.ob))}} -h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.o.R)a=!0;else{var b=null,c,k=A(a.id);for(c=0;ca.La/a.Ma&&(b=1);a.xa=b;b=a.Db*a.xa;if(a.Ma!=b){a.Ma=b;b=a.Ma.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.l&&Cc(a.l)}rb(a,a.ta);a.ta=0;a.la=ra();a.va=0;Bc(a)}function Vb(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Xb(a,b,c,d){0<=b&&ba.N[b][0])&&(c=a.qb*a.xa/1E3*c|0,a.o.T&&(c+=Dc(a)),a.N[b][0]=c)} -function qb(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Dc(a,b){var c=a.wa-=a.a;a.a=a.K=0;b&&(a.wa=0);return c} -h.Rd=function(){if(this.o.T){this.Ab>=this.qb&&Bc(this,!0);this.bb=0;this.nb=ra();if(this.va){var a=this.nb-this.va;a>this.$b&&(this.la+=a,this.la>this.nb&&(this.la=this.nb))}try{do{for(var b,c=this.o.tb?1:this.rb,d=this.N.length-1;0<=d;d--){var e=this.N[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xb(b)}catch(f){if("number"!=typeof f)throw f;}b=Dc(this,!0);this.bb+=b;this.ta+=b;sb(this,b);qb(this,b);this.ab-=b;if(0>=this.ab){this.ab+=this.rb;15<=++this.ac&&(this.Ba(),this.ac=0);break}}while(this.o.T)}catch(f){F(this); -this.l&&this.l.stop(ra(),zc(this));Za(this,f.stack||f.message);return}if(this.o.T){a=setTimeout;b=this.cc;this.va=ra();c=this.$b;this.bb&&(c=Math.round(c*this.bb/this.rb));c-=this.va-this.nb;if(d=this.va-this.la)this.La=Math.round(this.ta/(10*d))/100,864E5<=d&&(this.ya=0,Ac(this));if(0>c||this.Lac&&(this.la-=c),c=0;this.Ab+=this.bb;this.va+=c;a(b,c)}}}; -function pb(a){var b;a.o.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.T)a.X(a.toString()+" busy");else{Ac(a);a.o.T=!0;a.o.Ob=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.la,zc(a));setTimeout(a.cc,0)}}h.xb=function(){return 0};function F(a){var b=!1;if(a.o.T){Dc(a);rb(a,a.ta);a.ta=0;a.o.T=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(ra(),zc(a));b=!0}a.o.complete=void 0;return b} -function Ec(a){this.Ra=+a.model||1170;this.Wb=a.addrReset||0;uc.call(this,a,6666667);this.sb=0;this.Yb=255;1120==this.Ra?(this.decode=Fc.bind(this),this.Ka=this.Bc,this.sb=8,this.Yb=-1):(this.decode=Gc.bind(this),this.Ka=this.Cc);Hc(this);this.sa=0;this.U=null;this.o.complete=!1}z(Ec,uc);h=Ec.prototype;h.reset=function(){this.status("model "+this.Ra);this.o.T&&F(this);Hc(this);xc(this);this.o.error=!1;this.parent.reset.call(this)}; -function Hc(a){a.m=65536;a.h=32768;a.i=65535;a.s=32768;a.F=15;a.f=[0,0,0,0,0,0,0,a.Wb,-1,-2,-3,-4,-5,-6,-7,-8];a.Ja=[0,0,0,0,0,0];a.ra=[0,0,0,0];a.u=0;a.mb=0;a.Ic=[4,2,0,1];a.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ca=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0]];a.kb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.hc=[0,0,0,0,0,0,0,0];a.gc=0;a.v=0;a.D=a.G=0;a.c=a.b=a.Cb=0;a.Oa=-1;ob(a)}function ob(a){a.Z=0;a.Eb=0;a.Gb=0;a.Ea=0;a.ja=0;a.Mb=0;a.ib=255;a.ka=0;a.lb=0;a.Ya=262143;a.fb=0;a.A=0;a.U=null;a.g&&ac(a)}function ac(a){a.ka?(a.V=65536,a.Ub=a.Ea&16?4186112:253952,a.P=a.Fc,a.Y=a.Od,a.zb=a.Ne,Fb(a.g,a.Ea&16?22:18)):(a.V=0,a.Ub=57344,a.P=a.Ec,a.Y=a.fc,a.zb=a.lc,Fb(a.g,16))} -function $b(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Eb=a.A>>16&65535,a.Gb=a.A&65535);a.Z=b;a.lb=b>>5&3;a.mb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.ka!=c&&(a.ka=c,ac(a))}}h.Zb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ya,this.xa]);a.set(2,Sb(this.g));return a.data()}; -h.restore=function(a){var b=a[1];this.ya=b[1];Ac(this,b[3]);a:{b=this.g;a=a[2];var c;for(c=0;c>14&3;c=a.F>>14&3;a.u!=c&&(a.ra[c]=a.f[6],a.f[6]=a.ra[a.u]);a.F=b;a.v|=2}function R(a,b){a.v&128||(a.s=a.i=b,a.h=0)}function Nc(a,b,c){a.v&128||(a.s=a.i=a.m=b,a.h=c||0)} -function Oc(a,b,c,d){a.v&128||(a.s=a.i=a.m=b,a.h=(c^b)&(d^b))}function Pc(a,b){a.v&128||(a.s=a.i=a.m=b,a.h=a.s^a.m>>1)}function Qc(a,b,c,d){a.v&128||(a.s=a.i=a.m=b,a.h=(c^d)&(d^b))}function J(a,b,c,d){if(!a.sa){0>a.Oa?a.Oa=bc(a):a.u||(d=-3);var e=!1;-3==d&&(b=4,a.ja|=4,a.f[6]=4,e=!0);a.A=b|4143316992;a.u=0;var f=a.Y(b|a.V),g=a.Y(b+2&65535|a.V);cc(a,g&-12289|a.Oa>>2&12288);Rc(a,a.Oa,e);Rc(a,a.f[7],e);Q(a,f);a.v&=~(c|18);a.v|=9;a.Oa=-1;if(-3<=d)throw b;}} -function Sc(a){var b=Tc(a),c=Tc(a)&-1793;a.F&49152&&(c=c&-225|a.F&63712);Q(a,b);cc(a,c);a.v&=-17}function Ob(a,b){var c=b>>13&31;31>c&&(b=a.Ea&32?a.kb[c]+(b&8190)&4194302:b&-3932161);return b} -function Uc(a,b,c){var d,e,f;if(!(c&a.ka))return f=b&65535,57344<=f&&(f|=a.Ub),f;d=b>>13;a.Ea&a.Ic[a.u]||(d&=7);e=a.I[a.u][d];f=(a.ca[a.u][d]<<6)+(b&8191)&a.Ya;if(a.sa)return f;f&1&&!(c&1)&&(a.ja|=64,J(a,4,0,f));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.I[a.u][d]=e;if(f!=(4194170&a.Ya)||a.u)a.lb= -a.u,a.mb=d;g&&(g&57344&&(0<=a.Oa&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.lb<<5|a.mb<<1,$b(a,a.Z&-61695|g&61694)),J(a,168,64,-1)),a.Z&61440||!(f<(4191360&a.Ya)||f>(4194239&a.Ya))||(a.Z|=4096,a.Z&512&&(a.v|=64)));return f}function Tc(a){var b=a.Y(a.f[6]|a.V);a.f[6]=a.f[6]+2&65535;return b}function Rc(a,b,c){var d=a.f[6]-2&65535;a.f[6]=d;a.A=a.A&65535|(a.A&-65536)<<8|16121856;c||a.Ka(4,-2,d);a.zb(d,b)} +H.prototype={constructor:H,parent:null,save:function(){var a,b;if(this.controller)a=null;else if($a)for(a=Array(this.size>>2),b=0;b>8,c)},P:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&I(this.g,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},ua: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.za=!0},H:function(a,b){return this.K(a,b)},V:function(a,b){return this.fc(a,b)},ta:function(a,b,c){this.l?this.h(a,b,c):this.Sb(a,b,c)},wa:function(a,b,c){this.l?this.h(a,b,c):this.lc(a,b,c)},C:function(a){return this.j[a]},L:function(a){return this.j[a]},U:function(a,b){a&1&&I(this.g,b,64);return this.c.getUint16(a,!0)},ka:function(a,b){a&1&&I(this.g,b,64);return this.s[a>>1]},sa:function(a,b){this.j[a]=b;this.za=!0},Ca:function(a,b){this.j[a]=b;this.za=!0},va:function(a,b,c){a&1&&I(this.g, +c,64);this.c.setUint16(a,b,!0);this.za=!0},xa:function(a,b,c){a&1&&I(this.g,c,64);this.s[a>>1]=b;this.za=!0}};function Db(a,b,c){a.G=b;a.i=a.m=0;c&&((a.i=c.i)&&oc(a,pc,!1),(a.m=c.m)&&sc(a,pc,!1))}function sc(a,b,c){c&&a.m||(a.Rb=!a.l&&b[1]||a.h,a.Bb=!a.l&&b[3]||a.w);if(c||void 0===c)a.Sb=b[1]||a.h,a.lc=b[3]||a.w}function oc(a,b,c){c&&a.i||(a.Nb=b[0]||a.v,a.Y=b[2]||a.A);if(c||void 0===c)a.K=b[0]||a.v,a.fc=b[2]||a.A}function kc(a,b){b||(b=tc);oc(a,b,void 0);sc(a,b,void 0)} +var tc=[],nc=[H.prototype.P,H.prototype.ua,H.prototype.la,H.prototype.ya],pc=[H.prototype.H,H.prototype.ta,H.prototype.V,H.prototype.wa];if($a)var mc=[H.prototype.C,H.prototype.sa,H.prototype.U,H.prototype.va],lc=[H.prototype.L,H.prototype.Ca,H.prototype.ka,H.prototype.xa]; +function uc(a,b){x.call(this,"CPU",a,uc,1);b=a.cycles||b;var c=a.multiplier||1;this.Db=0;this.rb=b;this.xa=c;this.Fb=Math.round(this.rb/1E4)/100;this.Ma=this.Fb*this.xa;this.o.T=!1;this.o.Pb=!1;this.o.cb=a.autoStart;this.o.ub=!1;this.pb=this.Na=0;this.qb=a.csStart;this.Za=a.csInterval;this.$a=a.csStop;this.P=[];this.dc=this.Sd.bind(this);E(this)}z(uc);var vc=["power","reset"];h=uc.prototype; +h.fa=function(a,b,c,d){this.l=a;this.g=b;this.G=d;this.A=a.A;for(b=0;b=a.Na&&(a.Na+=a.Za,c=!0);0<=a.$a&&a.$a<=zc(a)&&(a.Za=a.$a=-1,yc(a),F(a),c=!0);c&&a.X(zc(a)+" cycles: checksum="+q(a.pb))}} +h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.o.R)a=!0;else{var b=null,c,k=A(a.id);for(c=0;ca.La/a.Ma&&(b=1);a.xa=b;b=a.Fb*a.xa;if(a.Ma!=b){a.Ma=b;b=a.Ma.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.l&&Cc(a.l)}rb(a,a.ta);a.ta=0;a.la=ra();a.va=0;Bc(a)}function Vb(a,b){var c=a.P.length;a.P.push([-1,b]);return c}function Xb(a,b,c,d){0<=b&&ba.P[b][0])&&(c=a.rb*a.xa/1E3*c|0,a.o.T&&(c+=Dc(a)),a.P[b][0]=c)} +function qb(a,b){for(var c=a.P.length-1;0<=c;c--){var d=a.P[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Dc(a,b){var c=a.wa-=a.a;a.a=a.K=0;b&&(a.wa=0);return c} +h.Sd=function(){if(this.o.T){this.Cb>=this.rb&&Bc(this,!0);this.bb=0;this.ob=ra();if(this.va){var a=this.ob-this.va;a>this.ac&&(this.la+=a,this.la>this.ob&&(this.la=this.ob))}try{do{for(var b,c=this.o.ub?1:this.sb,d=this.P.length-1;0<=d;d--){var e=this.P[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.zb(b)}catch(f){if("number"!=typeof f)throw f;}b=Dc(this,!0);this.bb+=b;this.ta+=b;sb(this,b);qb(this,b);this.ab-=b;if(0>=this.ab){this.ab+=this.sb;15<=++this.bc&&(this.Ba(),this.bc=0);break}}while(this.o.T)}catch(f){F(this); +this.l&&this.l.stop(ra(),zc(this));Za(this,f.stack||f.message);return}if(this.o.T){a=setTimeout;b=this.dc;this.va=ra();c=this.ac;this.bb&&(c=Math.round(c*this.bb/this.sb));c-=this.va-this.ob;if(d=this.va-this.la)this.La=Math.round(this.ta/(10*d))/100,864E5<=d&&(this.ya=0,Ac(this));if(0>c||this.Lac&&(this.la-=c),c=0;this.Cb+=this.bb;this.va+=c;a(b,c)}}}; +function pb(a){var b;a.o.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.T)a.X(a.toString()+" busy");else{Ac(a);a.o.T=!0;a.o.Pb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.la,zc(a));setTimeout(a.dc,0)}}h.zb=function(){return 0};function F(a){var b=!1;if(a.o.T){Dc(a);rb(a,a.ta);a.ta=0;a.o.T=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(ra(),zc(a));b=!0}a.o.complete=void 0;return b} +function Ec(a){this.Ra=+a.model||1170;this.Xb=a.addrReset||0;uc.call(this,a,6666667);this.tb=0;this.Zb=255;1120==this.Ra?(this.decode=Fc.bind(this),this.Ka=this.Cc,this.tb=8,this.Zb=-1):(this.decode=Gc.bind(this),this.Ka=this.Dc);Hc(this);this.sa=0;this.L=null;this.o.complete=!1}z(Ec,uc);h=Ec.prototype;h.reset=function(){this.status("model "+this.Ra);this.o.T&&F(this);Hc(this);xc(this);this.o.error=!1;this.parent.reset.call(this)}; +function Hc(a){a.m=65536;a.h=32768;a.i=65535;a.s=32768;a.F=15;a.f=[0,0,0,0,0,0,0,a.Xb,-1,-2,-3,-4,-5,-6,-7,-8];a.Ja=[0,0,0,0,0,0];a.ra=[0,0,0,0];a.v=0;a.nb=0;a.Jc=[4,2,0,1];a.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ca=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0]];a.lb=[0,0,0,0,0,0,0,0,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.ic=[0,0,0,0,0,0,0,0];a.hc=0;a.u=0;a.C=a.H=0;a.c=a.b=a.Eb=0;a.Oa=-1;ob(a)}function ob(a){a.Z=0;a.Gb=0;a.Ib=0;a.Ea=0;a.ja=0;a.yb=0;a.jb=255;a.ka=0;a.mb=0;a.Ya=262143;a.gb=0;a.w=0;a.L=null;a.g&&ac(a)}function ac(a){a.ka?(a.V=65536,a.Vb=a.Ea&16?4186112:253952,a.U=a.Gc,a.Y=a.Pd,a.Bb=a.Ne,Fb(a.g,a.Ea&16?22:18)):(a.V=0,a.Vb=57344,a.U=a.Fc,a.Y=a.gc,a.Bb=a.mc,Fb(a.g,16))} +function $b(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Gb=a.w>>16&65535,a.Ib=a.w&65535);a.Z=b;a.mb=b>>5&3;a.nb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.ka!=c&&(a.ka=c,ac(a))}}h.$b=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ya,this.xa]);a.set(2,Sb(this.g));return a.data()}; +h.restore=function(a){var b=a[1];this.ya=b[1];Ac(this,b[3]);a:{b=this.g;a=a[2];var c;for(c=0;c>14&3;c=a.F>>14&3;a.v!=c&&(a.ra[c]=a.f[6],a.f[6]=a.ra[a.v]);a.F=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.h=0)}function Nc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.h=c||0)} +function Oc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.h=(c^b)&(d^b))}function Pc(a,b){a.u&128||(a.s=a.i=a.m=b,a.h=a.s^a.m>>1)}function Qc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.h=(c^d)&(d^b))}function J(a,b,c,d){if(!a.sa){0>a.Oa?a.Oa=bc(a):a.v||(d=-3);var e=!1;-3==d&&(b=4,a.ja|=4,a.f[6]=4,e=!0);a.w=b|4143316992;a.v=0;var f=a.Y(b|a.V),g=a.Y(b+2&65535|a.V);cc(a,g&-12289|a.Oa>>2&12288);Rc(a,a.Oa,e);Rc(a,a.f[7],e);Q(a,f);a.u&=~(c|18);a.u|=9;a.Oa=-1;if(-3<=d)throw b;}} +function Sc(a){var b=Tc(a),c=Tc(a)&-1793;a.F&49152&&(c=c&-225|a.F&63712);Q(a,b);cc(a,c);a.u&=-17}function Ob(a,b){var c=b>>13&31;31>c&&(b=a.Ea&32?a.lb[c]+(b&8190)&4194302:b&-3932161);return b} +function Uc(a,b,c){var d,e,f;if(!(c&a.ka))return f=b&65535,57344<=f&&(f|=a.Vb),f;d=b>>13;a.Ea&a.Jc[a.v]||(d&=7);e=a.I[a.v][d];f=(a.ca[a.v][d]<<6)+(b&8191)&a.Ya;if(a.sa)return f;f&1&&!(c&1)&&(a.ja|=64,J(a,4,0,f));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.I[a.v][d]=e;if(f!=(4194170&a.Ya)||a.v)a.mb= +a.v,a.nb=d;g&&(g&57344&&(0<=a.Oa&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.mb<<5|a.nb<<1,$b(a,a.Z&-61695|g&61694)),J(a,168,64,-1)),a.Z&61440||!(f<(4191360&a.Ya)||f>(4194239&a.Ya))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Tc(a){var b=a.Y(a.f[6]|a.V);a.f[6]=a.f[6]+2&65535;return b}function Rc(a,b,c){var d=a.f[6]-2&65535;a.f[6]=d;a.w=a.w&65535|(a.w&-65536)<<8|16121856;c||a.Ka(4,-2,d);a.Bb(d,b)} function Vc(a,b,c,d){var e,f,g=d&8?0:a.V;switch(b){case 0:return J(a,4,0,-2),0;case 1:return 6==c&&a.Ka(d,0,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];6==c&&a.Ka(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.Y(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;6==c&&a.Ka(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.Y(e)|g;a.a-=8;break;case 6:return e=a.Y(Kc(a,2)),e=e+a.f[c]&65535,6==c&&a.Ka(d,0, -e),a.a-=6,e|g;case 7:return e=a.Y(Kc(a,2)),e=e+a.f[c]&65535,e=a.Y(e|a.V),a.a-=10,e|g}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Bc=function(a,b,c){!this.u&&0>=b&&c<=this.ib&&(this.v|=32)};h.Cc=function(a,b,c){this.u||(65534<=c&&(c|=-65536),a&4&&c<=this.ib&&(c<=this.ib-32?J(this,4,0,-3):(this.ja|=8,this.v|=32)))};h.Qa=function(a){if(!this.ka)return this.g.Qa(a);this.sa++;a=this.fc(Uc(this,a,2));this.sa--;return a}; -h.jb=function(a,b){this.ka?(this.sa++,a=Uc(this,a,5),a&1&&this.a--,Qb(this.g,a,b),this.sa--):this.g.jb(a,b)};h.Va=function(a,b){this.ka?(this.sa++,this.lc(Uc(this,a,4),b),this.sa--):this.g.Va(a,b)};h.Ec=function(a,b,c){return Vc(this,a,b,c)};h.Fc=function(a,b,c){return Uc(this,Vc(this,a,b,c),c)};h.fc=function(a){return Pb(this.g,this.fb=a)};h.Od=function(a){return Pb(this.g,this.fb=Uc(this,a,2))};h.lc=function(a,b){Rb(this.g,this.fb=a,b&65535)};h.Ne=function(a,b){Rb(this.g,this.fb=Uc(this,a,4),b)}; -function Wc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Vc(a,b,d,2),c&65536||61440!==(a.F&61440)&&(d&=65535),a.u=a.F>>12&3,c=a.Y(d|c&a.V),a.u=a.F>>14&3):c=6!=d||(a.F>>2&12288)===(a.F&12288)?a.f[d]:a.ra[a.F>>12&3];return c}function Xc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Vc(a,b,e,4),c&65536||(e&=65535),a.u=a.F>>12&3,e=Uc(a,e|c&65536,4),a.u=a.F>>14&3,Rb(a.g,e,d)):6!=e||(a.F>>2&12288)===(a.F&12288)?a.f[e]=d:a.ra[a.F>>12&3]=d} -function Yc(a,b){b>>=6;var c=a.G=b&7;(b=a.D=(b&56)>>3)?(c=a.P(b,c,3),a=Nb(a.g,c)):a=a.f[c+a.sb]&a.Yb;return a}function Zc(a,b){b>>=6;var c=a.G=b&7;return(b=a.D=(b&56)>>3)?Pb(a.g,a.P(b,c,2)):a.f[c+a.sb]}function $c(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Vc(a,b,c,8)}function ad(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.P(b,c,3),a=Nb(a.g,c)):a=a.f[c]&255;return a}function bd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Pb(a.g,a.P(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.Cb=a.P(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Nb(a.g,e)),e&1&&a.a--,Qb(a.g,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.P(b,e,6),Rb(a.g,e,d.call(a,0>c?a.f[-c-1]:c,Pb(a.g,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])} -function cd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.P(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Qb(a.g,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 dd(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.P(b,d,4),Rb(a.g,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.xb=function(a){this.o.complete=!0;var b=a?this.o.Ob?0:1:-1;this.o.Ob=!1;this.wa=this.a=a;do{if(this.v){if(a=this.v&7){a=!1;if(this.v&2){this.v&=-3;var c=160,d=(this.Mb&224)>>5,e=this.U&&this.U.Sa>d?this.U:null;e&&(c=e.Ud,d=e.Sa);d>(this.F&224)>>5?(this.v&4&&(Kc(this,2),this.v&=-5),J(this,c,0,-9),d=!0):d=!1;d&&(e&&Lc(this,e),a=!0)}else this.v&1&&this.v++;a=a&&0>b}if(a)break;if(this.v&112&&Mc(this)&&0>b)break}this.v=this.v&7|this.F&16;this.decode(Jc(this))}while(0>1|b<<16;Pc(this,a);return a&65535}function jd(a,b){a=b&128|b>>1|b<<8;Pc(this,a<<8);return a&255} -function kd(a,b){a=b&~a;R(this,a);return a}function ld(a,b){a=b&~a;R(this,a<<8);return a}function md(a,b){a|=b;R(this,a);return a}function nd(a,b){a|=b;R(this,a<<8);return a}function od(a,b){a=~b|65536;Nc(this,a);return a&65535}function pd(a,b){a=~b|256;Nc(this,a<<8);return a&255}function qd(a,b){a=b-a;this.v&128||(this.s=this.i=a,this.h=b&(b^a));return a&65535}function rd(a,b){a=b-a;var c=a<<8;b<<=8;this.v&128||(this.s=this.i=c,this.h=b&(b^c));return a&255} -function sd(a,b){a=b+a;this.v&128||(this.s=this.i=a,this.h=a&(b^a));return a&65535}function td(a,b){a=b+a;var c=a<<8;this.v&128||(this.s=this.i=c,this.h=c&(b<<8^c));return a&255}function ud(a,b){a=-b;Nc(this,a,a&b&32768);return a&65535}function vd(a,b){a=-b;Nc(this,a<<8,(a&b&128)<<8);return a&255}function wd(a,b){a=b<<1|this.m>>16&1;Pc(this,a);return a&65535}function xd(a,b){a=b<<1|this.m>>16&1;Pc(this,a<<8);return a&255}function yd(a,b){a=(this.m&65536|b)>>1|b<<16;Pc(this,a);return a&65535} -function zd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Pc(this,a<<8);return a&255}function Ad(a,b){var c=b-a;Qc(this,c,a,b);return c&65535}function Bd(a,b){var c=b-a;Qc(this,c<<8,a<<8,b<<8);return c&255}function Cd(a,b){this.v&128||(this.s=this.i=b&65280,this.h=this.m=0);return(b<<8|b>>8)&65535}function Dd(a,b){a^=b;R(this,a);return a&65535}function Ed(a){T(this,a,Zc(this,a),ed);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)} -function Fd(a){var b=bd(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.h=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.h=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} +e),a.a-=6,e|g;case 7:return e=a.Y(Kc(a,2)),e=e+a.f[c]&65535,e=a.Y(e|a.V),a.a-=10,e|g}a.f[c]=a.f[c]+f&65535;a.w=a.w&65535|(a.w&-65536)<<8|(f<<3&248|c)<<16;return e}h.Cc=function(a,b,c){!this.v&&0>=b&&c<=this.jb&&(this.u|=32)};h.Dc=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.jb&&(c<=this.jb-32?J(this,4,0,-3):(this.ja|=8,this.u|=32)))};h.Qa=function(a){if(!this.ka)return this.g.Qa(a);this.sa++;a=this.gc(Uc(this,a,2));this.sa--;return a}; +h.kb=function(a,b){this.ka?(this.sa++,a=Uc(this,a,5),a&1&&this.a--,Qb(this.g,a,b),this.sa--):this.g.kb(a,b)};h.Va=function(a,b){this.ka?(this.sa++,this.mc(Uc(this,a,4),b),this.sa--):this.g.Va(a,b)};h.Fc=function(a,b,c){return Vc(this,a,b,c)};h.Gc=function(a,b,c){return Uc(this,Vc(this,a,b,c),c)};h.gc=function(a){return Pb(this.g,this.gb=a)};h.Pd=function(a){return Pb(this.g,this.gb=Uc(this,a,2))};h.mc=function(a,b){Rb(this.g,this.gb=a,b&65535)};h.Ne=function(a,b){Rb(this.g,this.gb=Uc(this,a,4),b)}; +function Wc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Vc(a,b,d,2),c&65536||61440!==(a.F&61440)&&(d&=65535),a.v=a.F>>12&3,c=a.Y(d|c&a.V),a.v=a.F>>14&3):c=6!=d||(a.F>>2&12288)===(a.F&12288)?a.f[d]:a.ra[a.F>>12&3];return c}function Xc(a,b,c,d){a.w=a.w&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Vc(a,b,e,4),c&65536||(e&=65535),a.v=a.F>>12&3,e=Uc(a,e|c&65536,4),a.v=a.F>>14&3,Rb(a.g,e,d)):6!=e||(a.F>>2&12288)===(a.F&12288)?a.f[e]=d:a.ra[a.F>>12&3]=d} +function Yc(a,b){b>>=6;var c=a.H=b&7;(b=a.C=(b&56)>>3)?(c=a.U(b,c,3),a=Nb(a.g,c)):a=a.f[c+a.tb]&a.Zb;return a}function Zc(a,b){b>>=6;var c=a.H=b&7;return(b=a.C=(b&56)>>3)?Pb(a.g,a.U(b,c,2)):a.f[c+a.tb]}function $c(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Vc(a,b,c,8)}function ad(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.U(b,c,3),a=Nb(a.g,c)):a=a.f[c]&255;return a}function bd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Pb(a.g,a.U(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.Eb=a.U(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Nb(a.g,e)),e&1&&a.a--,Qb(a.g,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.U(b,e,6),Rb(a.g,e,d.call(a,0>c?a.f[-c-1]:c,Pb(a.g,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])} +function cd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.U(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Qb(a.g,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 dd(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.U(b,d,4),Rb(a.g,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.zb=function(a){this.o.complete=!0;var b=a?this.o.Pb?0:1:-1;this.o.Pb=!1;this.wa=this.a=a;do{if(this.u){if(a=this.u&7){a=!1;if(this.u&2){var c=160,d=(this.yb&224)>>5,e=this.L&&this.L.Sa>d?this.L:null;e&&(c=e.Ud,d=e.Sa);d>(this.F&224)>>5?(this.u&4&&(Kc(this,2),this.u&=-5),J(this,c,0,-9),d=!0):d=!1;d&&(e&&Lc(this,e),a=!0);this.L||this.yb||(this.u&=-3)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Mc(this)&&0>b)break}this.u=this.u&7|this.F&16;this.decode(Jc(this))}while(0>1|b<<16;Pc(this,a);return a&65535} +function jd(a,b){a=b&128|b>>1|b<<8;Pc(this,a<<8);return a&255}function kd(a,b){a=b&~a;R(this,a);return a}function ld(a,b){a=b&~a;R(this,a<<8);return a}function md(a,b){a|=b;R(this,a);return a}function nd(a,b){a|=b;R(this,a<<8);return a}function od(a,b){a=~b|65536;Nc(this,a);return a&65535}function pd(a,b){a=~b|256;Nc(this,a<<8);return a&255}function qd(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.h=b&(b^a));return a&65535} +function rd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.h=b&(b^c));return a&255}function sd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.h=a&(b^a));return a&65535}function td(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.h=c&(b<<8^c));return a&255}function ud(a,b){a=-b;Nc(this,a,a&b&32768);return a&65535}function vd(a,b){a=-b;Nc(this,a<<8,(a&b&128)<<8);return a&255}function wd(a,b){a=b<<1|this.m>>16&1;Pc(this,a);return a&65535} +function xd(a,b){a=b<<1|this.m>>16&1;Pc(this,a<<8);return a&255}function yd(a,b){a=(this.m&65536|b)>>1|b<<16;Pc(this,a);return a&65535}function zd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Pc(this,a<<8);return a&255}function Ad(a,b){var c=b-a;Qc(this,c,a,b);return c&65535}function Bd(a,b){var c=b-a;Qc(this,c<<8,a<<8,b<<8);return c&255}function Cd(a,b){this.u&128||(this.s=this.i=b&65280,this.h=this.m=0);return(b<<8|b>>8)&65535}function Dd(a,b){a^=b;R(this,a);return a&65535} +function Ed(a){T(this,a,Zc(this,a),ed);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Fd(a){var b=bd(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.h=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.h=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} function Gd(a){var b=bd(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.h=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 Hd(a){V(this,a,!P(this))}function Id(a){V(this,a,P(this))} -function Jd(a){T(this,a,Zc(this,a),kd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Kd(a){S(this,a,Yc(this,a),ld);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Ld(a){T(this,a,Zc(this,a),md);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Md(a){S(this,a,Yc(this,a),nd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)} -function Nd(a){var b=Zc(this,a);a=bd(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function Od(a){var b=Yc(this,a);a=ad(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function Pd(a){V(this,a,this.i&65535?0:4)}function Qd(a){V(this,a,!Ic(this)==!(this.h&32768))}function Rd(a){V(this,a,!!(this.i&65535)&&!Ic(this)==!(this.h&32768))} +function Jd(a){T(this,a,Zc(this,a),kd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Kd(a){S(this,a,Yc(this,a),ld);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Ld(a){T(this,a,Zc(this,a),md);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Md(a){S(this,a,Yc(this,a),nd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)} +function Nd(a){var b=Zc(this,a);a=bd(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Od(a){var b=Yc(this,a);a=ad(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Pd(a){V(this,a,this.i&65535?0:4)}function Qd(a){V(this,a,!Ic(this)==!(this.h&32768))}function Rd(a){V(this,a,!!(this.i&65535)&&!Ic(this)==!(this.h&32768))} function Sd(a){V(this,a,!P(this)&&!!(this.i&65535))}function Td(a){V(this,a,(this.i&65535?0:4)||!Ic(this)!=!(this.h&32768))}function Ud(a){V(this,a,P(this)||(this.i&65535?0:4))}function Vd(a){V(this,a,!Ic(this)!=!(this.h&32768))}function Wd(a){V(this,a,Ic(this))}function Xd(a){V(this,a,!!(this.i&65535))}function Yd(a){V(this,a,!Ic(this))}function Zd(){J(this,12,0,-8);this.a-=5}function $d(a){V(this,a,!0)}function ae(a){V(this,a,!(this.h&32768))}function be(a){V(this,a,this.h&32768?2:0)} -function W(a){a&1&&(this.m=0);a&2&&(this.h=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function ce(a){var b=Zc(this,a);a=bd(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Qc(this,c,a,b);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function de(a){var b=Yc(this,a);a=ad(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Qc(this,c,a,b);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)} +function W(a){a&1&&(this.m=0);a&2&&(this.h=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function ce(a){var b=Zc(this,a);a=bd(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Qc(this,c,a,b);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function de(a){var b=Yc(this,a);a=ad(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Qc(this,c,a,b);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)} function ee(a){var b=bd(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.h=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.h=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.h=32768,this.m=65536,this.a-=7}function fe(){J(this,24,0,-8);this.a-=25} -function ge(){this.F&49152?(this.ja|=128,J(this,4,0,-7)):(this.w&&1120==this.Ra&&this.w.setData(this.f[0],!0),this.H?this.H.b():F(this));this.a-=7}function he(){J(this,16,0,-8);this.a-=25}var ie=[0,7,7,10,7,11,9,13];function je(a){this.K=this.a;Q(this,$c(this,a));this.a=this.K-ie[this.c]}var ke=[0,14,14,17,14,18,16,20];function le(a){this.K=this.a;var b=$c(this,a);a=a>>6&7;Rc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.K-ke[this.c]}var me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function ne(a){var b=Zc(this,a);this.K=this.a;R(this,dd(this,a,b));this.a=this.K-me[(this.D?8:0)+this.c]+(7!=this.b||this.c?0:2)}function oe(a){var b=Yc(this,a);R(this,cd(this,a,b,65535)<<8);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}var pe=[7,13,13,17,14,18,17,21]; -function qe(a){var b=bd(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.v&128||(this.s=b>>16,this.i=this.s|b,this.h=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 we(a){T(this,a,Zc(this,a),Ad);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function xe(a){T(this,a,0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function ye(){J(this,28,0,-8);this.a-=5} -function ze(){this.w&&(this.w.ia=this.f[7],this.w.setData(this.f[0],!0));this.v|=4;Kc(this,-2);this.a-=3}function Ae(a){T(this,a,this.f[(a>>6&7)+this.sb],Dd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,0,-8)}function Fc(a){Be[a>>12].call(this,a)}function Ce(a){De[a>>6&3].call(this,a)}function Ee(a){Fe[a>>6&3].call(this,a)}function Ge(a){He[a>>6&3].call(this,a)}function Ie(a){Je[a&15].call(this,a)}function Ke(a){Le[a&15].call(this,a)}function Me(a){Ne[a>>6&3].call(this,a)} +function ge(){this.F&49152?(this.ja|=128,J(this,4,0,-7)):(this.A&&1120==this.Ra&&this.A.setData(this.f[0],!0),this.G?this.G.b():F(this));this.a-=7}function he(){J(this,16,0,-8);this.a-=25}var ie=[0,7,7,10,7,11,9,13];function je(a){this.K=this.a;Q(this,$c(this,a));this.a=this.K-ie[this.c]}var ke=[0,14,14,17,14,18,16,20];function le(a){this.K=this.a;var b=$c(this,a);a=a>>6&7;Rc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.K-ke[this.c]}var me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function ne(a){var b=Zc(this,a);this.K=this.a;R(this,dd(this,a,b));this.a=this.K-me[(this.C?8:0)+this.c]+(7!=this.b||this.c?0:2)}function oe(a){var b=Yc(this,a);R(this,cd(this,a,b,65535)<<8);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}var pe=[7,13,13,17,14,18,17,21]; +function qe(a){var b=bd(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.h=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 we(a){T(this,a,Zc(this,a),Ad);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function xe(a){T(this,a,0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function ye(){J(this,28,0,-8);this.a-=5} +function ze(){this.A&&(this.A.ia=this.f[7],this.A.setData(this.f[0],!0));this.u|=4;Kc(this,-2);this.a-=3}function Ae(a){T(this,a,this.f[(a>>6&7)+this.tb],Dd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,0,-8)}function Fc(a){Be[a>>12].call(this,a)}function Ce(a){De[a>>6&3].call(this,a)}function Ee(a){Fe[a>>6&3].call(this,a)}function Ge(a){He[a>>6&3].call(this,a)}function Ie(a){Je[a&15].call(this,a)}function Ke(a){Le[a&15].call(this,a)}function Me(a){Ne[a>>6&3].call(this,a)} function Oe(a){Pe[a>>6&3].call(this,a)}function Qe(a){Re[a>>6&3].call(this,a)} var Be=[function(a){Se[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,Ed,Y,function(a){Te[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,we,Y],Se=[function(a){Ue[a>>4&15].call(this,a)},$d,Xd,Pd,Qd,Vd,Rd,Td,le,le,Ce,Ee,Ge,Y,Y,Y],De=[function(a){Nc(this,dd(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)}],Fe=[function(a){T(this,a,0, ud);this.a-=this.c?11:6},function(a){T(this,a,P(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,P(this)?1:0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bd(this,a);Nc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],He=[function(a){T(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)}], Ue=[function(a){Ve[a&15].call(this,a)},Y,Y,Y,je,je,je,je,te,Y,Ie,Ke,xe,xe,xe,xe],Ve=[ge,ze,ue,Zd,he,se,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Je=[re,function(){this.m=0;this.a-=5},function(){this.h=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],Le=[re,function(){this.m=65536;this.a-=5},function(){this.h=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],Te=[Yd,Wd,Sd,Ud,ae,be,Hd,Id,fe,ye,Me,Oe,Qe,Y,Y,Y],Ne=[function(a){Nc(this, cd(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)}],Pe=[function(a){S(this,a,0,vd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ad(this,a);Nc(this,a<<8);this.a-=this.c?4:3+(7== -this.b?2:0)}],Re=[function(a){S(this,a,0,zd);this.a-=this.c?9+(this.Cb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,jd);this.a-=this.c?9+(this.Cb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Gc(a){We[a>>12].call(this,a)} +this.b?2:0)}],Re=[function(a){S(this,a,0,zd);this.a-=this.c?9+(this.Eb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,jd);this.a-=this.c?9+(this.Eb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Gc(a){We[a>>12].call(this,a)} var We=[function(a){Xe[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,Ed,function(a){Ye[a>>8&15].call(this,a)},function(a){Ze[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,we,Y],Xe=[function(a){$e[a>>4&15].call(this,a)},$d,Xd,Pd,Qd,Vd,Rd,Td,le,le,Ce,Ee,Ge,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.Y(a|this.V);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Wc(this,a,0);Rc(this,a);R(this,a);this.a-=11},function(a){var b=Tc(this);this.K= -this.a;Xc(this,a,0,b);R(this,b);this.a=this.K-pe[this.c]},function(a){R(this,dd(this,a,Ic(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],$e=[function(a){bf[a&15].call(this,a)},Y,Y,Y,je,je,je,je,te,function(a){a&8?(this.F&49152||(this.F=this.F&-2017|(a&7)<<5,this.v|=1),this.a-=5):J(this,8,0,-8)},Ie,Ke,xe,xe,xe,xe],bf=[ge,ze,function(){Sc(this);this.v|=this.F&16;this.a-=13},Zd,he,se,ue,function(){J(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ye=[qe,qe,ee,ee,Fd,Fd,Gd,Gd,Ae,Ae,Y,Y,Y,Y,ve,ve],Ze=[Yd,Wd,Sd,Ud, +this.a;Xc(this,a,0,b);R(this,b);this.a=this.K-pe[this.c]},function(a){R(this,dd(this,a,Ic(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],$e=[function(a){bf[a&15].call(this,a)},Y,Y,Y,je,je,je,je,te,function(a){a&8?(this.F&49152||(this.F=this.F&-2017|(a&7)<<5,this.u|=1),this.a-=5):J(this,8,0,-8)},Ie,Ke,xe,xe,xe,xe],bf=[ge,ze,function(){Sc(this);this.u|=this.F&16;this.a-=13},Zd,he,se,ue,function(){J(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ye=[qe,qe,ee,ee,Fd,Fd,Gd,Gd,Ae,Ae,Y,Y,Y,Y,ve,ve],Ze=[Yd,Wd,Sd,Ud, ae,be,Hd,Id,fe,ye,Me,Oe,Qe,function(a){cf[a>>6&3].call(this,a)},Y,Y],cf=[Y,function(a){a=Wc(this,a,65536);Rc(this,a);R(this,a);this.a-=11},function(a){var b=Tc(this);this.K=this.a;Xc(this,a,65536,b);R(this,b);this.a=this.K-pe[this.c]},Y]; -function df(a){x.call(this,"ROM",a,df,128);this.ba=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.h=a.alias;this.l=a.file;this.s=r(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;t(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ua(c.ua,a,b),(a=ta(a,b))?(c.c=a.L,c.ba=a.ba):c.l=null);ef(c)})}}z(df);h=df.prototype; -h.fa=function(a,b,c,d){this.g=b;this.a=c;this.H=d;ef(this)};h.ha=function(){this.ba&&(this.H&&this.H.a(this.id,this.i,this.b,this.ba),delete this.ba);return!0};h.ga=function(){return!0}; -function ef(a){if(!Ya(a)){if(a.l){if(!a.c||!a.g)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Za(a,"ROM size ("+q(a.c.length,8,!0)+") does not match specified size ("+q(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+G){var c={};b=(c[b]=[df.prototype.Cd,df.prototype.Be,null,null,null,a.b>>1],c);if(fb(a.g,a,b)){b=a.m=!0;break a}}else if(Ib(a.g,b,a.b,jc)){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,v=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(v)for(;v--;)a.a.jb(p++,b[u++]&255);else p&1?F(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=ja.Sb&&c<=ja.wc&&(b=!0,c-=ja.Sb-ja.mc);b&&(a.preventDefault&&a.preventDefault(),d.wb(c));return!0},c.onkeypress=function(a){a=a||window.event;d.wb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData|| -window.clipboardData)&&d.wb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.H=d;var e=this;this.la=Yb(48,4,262144);this.P=Vb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.U&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Wb(e.a,e.la))});this.D=Yb(52,4,262144);this.ka=Vb(this.a,function(){e.c|=128;e.c&64&&Wb(e.a,e.D)});fb(b,this,lf);hb(b,this.reset.bind(this));E(this)}; -h.bc=function(){if(!this.u){var a=wc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Ca)return;b=pa(b[1]);if(this.u=Va(b)){var d=this.u.exports;if(d){var e=d.connect;e&&e.call(this.u);if(this.A=d.receiveData){this.status(this.ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ha=function(a,b){if(!b)if(this.bc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ga=function(a){return a?this.save():!0};h.reset=function(){mf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return mf(this)};function mf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.wb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.N||8,c=a-this.s%a,this.N&&(b=" ".slice(0,c)));this.K&&!this.s&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.s+=c}}else if(null!=this.m){if(10==a|| -1024<=this.m.length)this.X(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Xb(this.a,this.ka,1E3/Math.round(this.V/10))};var nf={},lf=(nf[65392]=[null,null,Z.prototype.pd,Z.prototype.oe,"RCSR"],nf[65394]=[null,null,Z.prototype.od,Z.prototype.ne,"RBUF"],nf[65396]=[null,null,Z.prototype.Qd,Z.prototype.Pe,"XCSR"],nf[65398]=[null,null,Z.prototype.Pd,Z.prototype.Oe,"XBUF"],nf); -Ja(function(){for(var a=D(document,"pdp11","serial"),b=0;b>1],c);if(fb(a.g,a,b)){b=a.m=!0;break a}}else if(Ib(a.g,b,a.b,jc)){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,v=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(v)for(;v--;)a.a.kb(p++,b[u++]&255);else p&1?F(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=ja.Tb&&c<=ja.xc&&(b=!0,c-=ja.Tb-ja.nc);b&&(a.preventDefault&&a.preventDefault(),d.xb(c));return!0},c.onkeypress=function(a){a=a||window.event;d.xb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData|| +window.clipboardData)&&d.xb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;var e=this;this.V=Yb(48,4,262144);this.P=Vb(this.a,function(){var a;a=-1;e.s.length&&(a=e.s.shift()&255,e.U&&97<=a&&122>a&&(a-=32),Xb(e.a,e.P,1E3/Math.round(e.H/10)));0<=a&&(e.A=a,e.b&128?e.A|=49152:e.b|=128,e.b&64&&Wb(c,e.V))});this.C=Yb(52,4,262144);this.la=Vb(this.a,function(){e.c|=128;e.c&64&&Wb(c,e.C)});fb(b,this,lf);hb(b,this.reset.bind(this));E(this)}; +h.cc=function(){if(!this.v){var a=wc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Ca)return;b=pa(b[1]);if(this.v=Va(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.w=d.receiveData){this.status(this.ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ha=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ga=function(a){return a?this.save():!0};h.reset=function(){mf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return mf(this)};function mf(a){a.A=0;a.b=0;a.c=128;a.s=[];return!0}h.xb=function(a){if("number"==typeof a)this.s.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.L||8,c=a-this.m%a,this.L&&(b=" ".slice(0,c)));this.K&&!this.m&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!=this.i){if(10==a|| +1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}Xb(this.a,this.la,1E3/Math.round(this.ka/10));this.c&=-129};var nf={},lf=(nf[65392]=[null,null,Z.prototype.qd,Z.prototype.oe,"RCSR"],nf[65394]=[null,null,Z.prototype.pd,Z.prototype.ne,"RBUF"],nf[65396]=[null,null,Z.prototype.Rd,Z.prototype.Pe,"XCSR"],nf[65398]=[null,null,Z.prototype.Qd,Z.prototype.Oe,"XBUF"],nf); +Ja(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.j[b]=c,c.onclick= -function(){var a=d.j.listTapes;a&&qf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.G){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;qf(d,r(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.j[b]=c,!0}return!1}; -h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.H=d;this.N=rf(a);var e=this;if((this.c=wc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.P=Yb(56,4,4096);this.V=Vb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):ua()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!t(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.R;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ua(a.ua,e,f),(e=ta(e,f))&&Af(a,b,c,d,e.L,e.na,e.ma)); +function qf(a,b,c,d,e){if(c)if("?"==c)a.D('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=r(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;wf(a,b,c,d,!1,e)}else yf(a,!1)}function wf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.h!=d)g++,yf(a,!0),a.o.Fa?a.D("PC11 busy"):(e&&a.m++,zf(a,b,c,d,f)?g++:a.o.Fa=!0);g&&Af(a,a.C,a.i,a.h,a.M,a.na,a.ma)} +function zf(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Af(a,b,c,d,e),a.s="?");xf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):ua()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!t(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.R;g?a.D('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ua(a.ua,e,f),(e=ta(e,f))&&Af(a,b,c,d,e.M,e.na,e.ma)); a.o.Fa=!1;a.m&&(a.m--,a.m||E(a));xf(a)})}function uf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.O);for(d=0;dc.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=ua()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ub?"":e)+"&format=json"));return!!t(f, +function sf(a,b){b|=0;if(b!==a.L){var c=a.j.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.L=b}}function Af(a,b,c,d,e,f,g){a.C=b;a.i=c;a.h=d;a.M=e;a.na=f;a.ma=g;2==d?a.P&&hf(a.P,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=of,a.h=pf,a.D("No load address available for tape: "+b)):(a.A=0,a.v=e,a.status("tape attached: "+b),sf(a,0))} +function yf(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.h&&a.status(1==a.h?"tape detached":"tape unloaded"),a.s=of,a.h=pf,xf(a))}h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};h.jd=function(){return this.b&65534};h.he=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Wb(this.a,this.K)):(this.b&=-129,this.b|=2048,this.w=0,Xb(this.a,this.V,1E3/Math.round(this.U/10))));this.b=this.b&-66|a&65};h.hd=function(){this.b&=-129;this.b|=2048;return this.w};h.ge=function(){}; +var Bf={},tf=(Bf[65384]=[null,null,dc.prototype.jd,dc.prototype.he,"PRS"],Bf[65386]=[null,null,dc.prototype.hd,dc.prototype.ge,"PRB"],Bf);function Cf(a,b,c){x.call(this,"Disk",{id:a.ua+".disk"+q(++Df,4)},Cf,8192);this.controller=a;this.l=a.l;this.G=a.G;this.h=b;this.oa=b.name;this.vb=b.vb;Ef(this,c,b.O,b.S,b.N,b.W);E(this)}var Df=0;z(Cf);h=Cf.prototype;h.fa=function(a,b,c,d){this.G=d}; +function Ef(a,b,c,d,e,f){a.mode=b;a.O=c;a.S=d;a.N=e;a.W=f;a.a=[];if("preload"!=a.mode){b=Array(a.O);for(c=0;c>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.O);for(d=0;dc.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=ua()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.vb?"":e)+"&format=json"));return!!t(f, null,!0,function(b,c,d){Hf(a,b,c,d)})} -function Hf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.o.R;if(d)a.controller.C('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{Ua(a.controller.ua,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)w(k[0]);else{a.O=k.length;a.S=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.W=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var v=l.bytes;if(void 0!==v&&v.length){for(var U=n<<2,za=v.length;zad&&a.l&&!a.l.o.R;if(d)a.controller.D('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{Ua(a.controller.ua,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)w(k[0]);else{a.O=k.length;a.S=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.W=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var v=l.bytes;if(void 0!==v&&v.length){for(var U=n<<2,za=v.length;za>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.ea?f=a.pa+a.ea&&(a.ea+=f-(a.pa+a.ea)+1):(a.pa=f,a.ea=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.oa+": "+c);return b}; +b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.D("Unable to restore disk '"+this.oa+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=Kf(this,a++);)Nf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Nf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){x.call(this,"RK11",a,N,65536);this.u=a.autoMount||{};this.m=0;this.c=Array(8);this.w=!Ca("Mobi")&&window&&"FileReader"in window}z(N);h=N.prototype; +function Nf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){x.call(this,"RK11",a,N,65536);this.v=a.autoMount||{};this.m=0;this.c=Array(8);this.A=!Ca("Mobi")&&window&&"FileReader"in window}z(N);h=N.prototype; h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=m(c.value);null!=a&&Of(d,a)},!0;case "loadDrive":return this.j[b]= -c,c.onclick=function(){var a=d.j.listDisks;a&&Pf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.w){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[m(a.value)||0])?(a=a.J)?(a=Da(Mf(a),a.Nb.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.w)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +c,c.onclick=function(){var a=d.j.listDisks;a&&Pf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[m(a.value)||0])?(a=a.J)?(a=Da(Mf(a),a.Ob.replace(".json",".img")),w(a)):d.D("No disk loaded in drive."):d.D("No disk drive selected."))};return!0;case "mountDrive":if(this.A)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Pf(d,r(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.H=d;if((a=wc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.u[e]=a[e]);Qf(this);this.D=Yb(144,5,65536);fb(b,this,Rf);hb(b,this.reset.bind(this));Sf(this,"None","",!0);this.w&&Sf(this,"Local Disk","?");Sf(this,"Remote Disk","??");Tf(this)||E(this)}; -h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Jb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Of(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){Qf(this)};h.save=function(){return(new O(this)).data()}; -h.restore=function(a){return Qf(this,a[0])};function Tf(a,b){b||(a.m=0);for(var c in a.u){var d=a.u[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=r(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vf(a,e,b,c,!1,d)}else Uf(a,e)} -function Vf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,Uf(a,b,!0),k.Ha?a.C("RK11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.m++),k.Aa=!!f,Gf(new Cf(a,k,"preload"),c,d,f,a.pc)&&g++));return g} -h.pc=function(a,b,c,d,e){var f;a.Ha=!1;b&&(f=Jf(b),b&&f[0]>a.O||f[1]>a.S)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ia)),b=null);b?(a.J=b,a.oa=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ia),a.Ga||e),this.l&&Cc(this.l)):a.Aa=!1;a.Ga&&(a.Ga=!1,--this.m||E(this));Of(this,a.Ia)}; +h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;if((a=wc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.v[e]=a[e]);Qf(this);this.fb=Yb(144,5,65536);fb(b,this,Rf);hb(b,this.reset.bind(this));Sf(this,"None","",!0);this.A&&Sf(this,"Local Disk","?");Sf(this,"Remote Disk","??");Tf(this)||E(this)}; +h.ha=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="RK"+b;a.appendChild(c)}a.value="0";Of(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){Qf(this)};h.save=function(){return(new O(this)).data()}; +h.restore=function(a){return Qf(this,a[0])};function Tf(a,b){b||(a.m=0);for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.D("Unable to load the selected drive");else if(c)if("?"==c)a.D('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=r(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vf(a,e,b,c,!1,d)}else Uf(a,e)} +function Vf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,Uf(a,b,!0),k.Ha?a.D("RK11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.m++),k.Aa=!!f,Gf(new Cf(a,k,"preload"),c,d,f,a.qc)&&g++));return g} +h.qc=function(a,b,c,d,e){var f;a.Ha=!1;b&&(f=Jf(b),b&&f[0]>a.O||f[1]>a.S)&&(this.D('Disk "'+c+'" too large for drive '+("RK"+a.Ia)),b=null);b?(a.J=b,a.oa=c,a.da=d,this.D('Mounted disk "'+c+'" in drive '+("RK"+a.Ia),a.Ga||e),this.l&&Cc(this.l)):a.Aa=!1;a.Ga&&(a.Ga=!1,--this.m||E(this));Of(this,a.Ia)}; function Sf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.s=65536-e&65535;a&&(this.i=this.i|a|32768,this.B|=49152);return!0}; -h.qc=function(a,b,c,d,e,f,g){var k=0,l=a.J,n=null,p;l||(k=128,e=0);for(;e--;){if(!n){n=a.J.seek(b,c,d+1);if(!n){k=4096;break}p=0}var u,v;if(0>(u=a.J.read(n,p++))||0>(v=a.J.read(n,p++))){k=32;break}this.g.Va(f,u|v<<8);if(Ub(this.g)){k=1024;break}f+=2;if(p>=l.W&&(n=null,++d>=l.M&&(d=0,++c>=l.S&&(c=0,++b>=l.O)))){k=64;break}}return g(k,b,c,d,e,f)}; -h.rc=function(a,b,c,d,e,f,g){var k=0,l=a.J,n=null,p;l||(k=128,e=0);for(;e--;){var u=this.g.Qa(f);if(Ub(this.g)){k=1024;break}f+=2;if(!n){n=a.J.seek(b,c,d+1,!0);if(!n){k=4096;break}p=0}if(!a.J.write(n,p++,u&255)||!a.J.write(n,p++,u>>8)){k=32;break}if(p>=l.W&&(n=null,++d>=l.M&&(d=0,++c>=l.S&&(c=0,++b>=l.O)))){k=64;break}}return g(k,b,c,d,e,f)};h.ud=function(){return this.A};h.te=function(){};h.vd=function(){return this.i};h.ue=function(){};h.rd=function(){return this.B&61438}; -h.qe=function(a){this.B=this.B&-3968|a&3967;if(this.B&1){var b,c=!0;a=(this.b&57344)>>13;var d=this.c[a],e,f,g,k;this.B&=-129;switch(this.B&14){case 0:this.A=d.status;this.i=0;this.B=128;this.b=0;break;case 4:b=this.qc;case 2:b||(b=this.rc),e=(this.b&8160)>>5,f=(this.b&16)>>4,g=this.b&15,e>=d.O?(this.i|=32832,this.B|=49152):g>=d.M?(this.i|=32800,this.B|=49152):(k=(this.B&48)<<12|this.h,c=65536-this.s&65535,c=b.call(this,d,e,f,g,c,k,this.oc.bind(this)))}this.A=d.status|a<<13|this.b%9&15;c&&(this.B&= --2,this.B|=128,this.B&64&&Wb(this.a,this.D))}};h.wd=function(){return this.s};h.ve=function(a){this.s=a};h.qd=function(){return this.h};h.pe=function(a){this.h=a};h.sd=function(){return this.b};h.re=function(a){this.b=a};h.td=function(){return this.G};h.se=function(a){this.G=a}; -var Wf={},Rf=(Wf[65280]=[null,null,N.prototype.ud,N.prototype.te,"RKDS"],Wf[65282]=[null,null,N.prototype.vd,N.prototype.ue,"RKER"],Wf[65284]=[null,null,N.prototype.rd,N.prototype.qe,"RKCS"],Wf[65286]=[null,null,N.prototype.wd,N.prototype.ve,"RKWC"],Wf[65288]=[null,null,N.prototype.qd,N.prototype.pe,"RKBA"],Wf[65290]=[null,null,N.prototype.sd,N.prototype.re,"RKDA"],Wf[65294]=[null,null,N.prototype.td,N.prototype.se,"RKDB"],Wf); -function M(a){x.call(this,"RL11",a,M,131072);this.w=a.autoMount||{};this.s=0;this.c=Array(4);this.A=!Ca("Mobi")&&window&&"FileReader"in window}z(M);h=M.prototype; +function Of(a,b){if(0<=b&&b>12&48;this.s=65536-e&65535;a&&(this.i=this.i|a|32768,this.B|=49152);return!0}; +h.rc=function(a,b,c,d,e,f,g){var k=0,l=a.J,n=null,p;l||(k=128,e=0);for(;e--;){if(!n){n=a.J.seek(b,c,d+1);if(!n){k=4096;break}p=0}var u,v;if(0>(u=a.J.read(n,p++))||0>(v=a.J.read(n,p++))){k=32;break}this.g.Va(f,u|v<<8);if(Ub(this.g)){k=1024;break}f+=2;if(p>=l.W&&(n=null,++d>=l.N&&(d=0,++c>=l.S&&(c=0,++b>=l.O)))){k=64;break}}return g(k,b,c,d,e,f)}; +h.sc=function(a,b,c,d,e,f,g){var k=0,l=a.J,n=null,p;l||(k=128,e=0);for(;e--;){var u=this.g.Qa(f);if(Ub(this.g)){k=1024;break}f+=2;if(!n){n=a.J.seek(b,c,d+1,!0);if(!n){k=4096;break}p=0}if(!a.J.write(n,p++,u&255)||!a.J.write(n,p++,u>>8)){k=32;break}if(p>=l.W&&(n=null,++d>=l.N&&(d=0,++c>=l.S&&(c=0,++b>=l.O)))){k=64;break}}return g(k,b,c,d,e,f)};h.vd=function(){return this.w};h.te=function(){};h.wd=function(){return this.i};h.ue=function(){};h.sd=function(){return this.B&61438}; +h.qe=function(a){this.B=this.B&-3968|a&3967;if(this.B&1){var b,c=!0;a=(this.b&57344)>>13;var d=this.c[a],e,f,g,k;this.B&=-129;switch(this.B&14){case 0:this.w=d.status;this.i=0;this.B=128;this.b=0;break;case 4:b=this.rc;case 2:b||(b=this.sc),e=(this.b&8160)>>5,f=(this.b&16)>>4,g=this.b&15,e>=d.O?(this.i|=32832,this.B|=49152):g>=d.N?(this.i|=32800,this.B|=49152):(k=(this.B&48)<<12|this.h,c=65536-this.s&65535,c=b.call(this,d,e,f,g,c,k,this.pc.bind(this)))}this.w=d.status|a<<13|this.b%9&15;c&&(this.B&= +-2,this.B|=128,this.B&64&&Wb(this.a,this.fb))}};h.xd=function(){return this.s};h.ve=function(a){this.s=a};h.rd=function(){return this.h};h.pe=function(a){this.h=a};h.td=function(){return this.b};h.re=function(a){this.b=a};h.ud=function(){return this.C};h.se=function(a){this.C=a}; +var Wf={},Rf=(Wf[65280]=[null,null,N.prototype.vd,N.prototype.te,"RKDS"],Wf[65282]=[null,null,N.prototype.wd,N.prototype.ue,"RKER"],Wf[65284]=[null,null,N.prototype.sd,N.prototype.qe,"RKCS"],Wf[65286]=[null,null,N.prototype.xd,N.prototype.ve,"RKWC"],Wf[65288]=[null,null,N.prototype.rd,N.prototype.pe,"RKBA"],Wf[65290]=[null,null,N.prototype.td,N.prototype.re,"RKDA"],Wf[65294]=[null,null,N.prototype.ud,N.prototype.se,"RKDB"],Wf); +function M(a){x.call(this,"RL11",a,M,131072);this.A=a.autoMount||{};this.s=0;this.c=Array(4);this.w=!Ca("Mobi")&&window&&"FileReader"in window}z(M);h=M.prototype; h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=m(c.value);null!=a&&Xf(d,a)},!0;case "loadDrive":return this.j[b]= -c,c.onclick=function(){var a=d.j.listDisks;a&&Yf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[m(a.value)||0])?(a=a.J)?(a=Da(Mf(a),a.Nb.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.A)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +c,c.onclick=function(){var a=d.j.listDisks;a&&Yf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.w){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[m(a.value)||0])?(a=a.J)?(a=Da(Mf(a),a.Ob.replace(".json",".img")),w(a)):d.D("No disk loaded in drive."):d.D("No disk drive selected."))};return!0;case "mountDrive":if(this.w)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Yf(d,r(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.H=d;if((a=wc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);Zf(this);this.D=Yb(112,5,131072);fb(b,this,$f);hb(b,this.reset.bind(this));ag(this,"None","",!0);this.A&&ag(this,"Local Disk","?");ag(this,"Remote Disk","??");bg(this)||E(this)}; -h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Jb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Xf(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){Zf(this)};h.save=function(){return(new O(this)).data()}; -h.restore=function(a){return Zf(this,a[0])};function bg(a,b){b||(a.s=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=r(c);a.status("Attempting to load "+c+' as "'+b+'"')}dg(a,e,b,c,!1,d)}else cg(a,e)} -function dg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,cg(a,b,!0),k.Ha?a.C("RL11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.s++),k.Aa=!!f,Gf(new Cf(a,k,"preload"),c,d,f,a.tc)&&g++));return g} -h.tc=function(a,b,c,d,e){var f;a.Ha=!1;b&&(f=Jf(b),b&&f[0]>a.O||f[1]>a.S)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.J=b,a.oa=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ia),a.Ga||e),this.l&&Cc(this.l)):a.Aa=!1;a.Ga&&(a.Ga=!1,--this.s||E(this));Xf(this,a.Ia)}; +h.fa=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;if((a=wc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);Zf(this);this.fb=Yb(112,5,131072);fb(b,this,$f);hb(b,this.reset.bind(this));ag(this,"None","",!0);this.w&&ag(this,"Local Disk","?");ag(this,"Remote Disk","??");bg(this)||E(this)}; +h.ha=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";Xf(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){Zf(this)};h.save=function(){return(new O(this)).data()}; +h.restore=function(a){return Zf(this,a[0])};function bg(a,b){b||(a.s=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.D("Unable to load the selected drive");else if(c)if("?"==c)a.D('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=r(c);a.status("Attempting to load "+c+' as "'+b+'"')}dg(a,e,b,c,!1,d)}else cg(a,e)} +function dg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,cg(a,b,!0),k.Ha?a.D("RL11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.s++),k.Aa=!!f,Gf(new Cf(a,k,"preload"),c,d,f,a.uc)&&g++));return g} +h.uc=function(a,b,c,d,e){var f;a.Ha=!1;b&&(f=Jf(b),b&&f[0]>a.O||f[1]>a.S)&&(this.D('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.J=b,a.oa=c,a.da=d,this.D('Mounted disk "'+c+'" in drive '+("RL"+a.Ia),a.Ga||e),this.l&&Cc(this.l)):a.Aa=!1;a.Ga&&(a.Ga=!1,--this.s||E(this));Xf(this,a.Ia)}; function ag(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.u=f>>16&63;this.i=this.b=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.B=this.B|a|32768);return!0}; -h.uc=function(a,b,c,d,e,f,g){var k=0,l=a.J,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.J.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,v;if(0>(u=a.J.read(n,p++))||0>(v=a.J.read(n,p++))){k=5120;break}this.g.Va(f,u|v<<8);if(Ub(this.g)){k=8192;break}f+=2;if(p>=l.W&&(n=null,++d>=l.M&&(d=0,++c>=l.S&&(c=0,++b>=l.O)))){k=5120;break}}return g(k,b,c,d,e,f)}; -h.vc=function(a,b,c,d,e,f,g){var k=0,l=a.J,n=null,p;l||(k=5120,e=0);for(;e--;){var u=this.g.Qa(f);if(Ub(this.g)){k=8192;break}f+=2;if(!n){n=a.J.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.J.write(n,p++,u&255)||!a.J.write(n,p++,u>>8)){k=5120;break}if(p>=l.W&&(n=null,++d>=l.M&&(d=0,++c>=l.S&&(c=0,++b>=l.O)))){k=5120;break}}return g(k,b,c,d,e,f)};h.zd=function(){return this.B&65535}; -h.ye=function(a){this.B=this.B&-1023|a&1022;this.G=this.G&-4|(a&48)>>4;if(!(this.B&128)){var b;a=!0;var c=this.c[(this.B&768)>>8],d,e,f,g;this.B&=-2;switch(this.B&14){case 4:this.b&8&&(this.B&=63);this.m=c.status|this.i&64;break;case 6:1==(this.b&3)&&(b=this.b&65408,c=(this.b&16)<<2,this.i=this.b&4?this.i+b:this.i-b,this.b=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.uc;case 10:b||(b=this.vc),d=this.b>>7,e=this.b&64?1:0,f=this.b&63,d>=c.O||f>=c.M?this.B|=37888:(g=(this.u& -63)<<16|this.h,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.sc.bind(this)))}a&&(this.B|=129,this.B&64&&Wb(this.a,this.D))}};h.xd=function(){return this.h};h.we=function(a){this.h=a&65534};h.Ad=function(){return this.b};h.ze=function(a){this.b=a};h.Bd=function(){return this.m};h.Ae=function(a){this.m=a};h.yd=function(){return this.u};h.xe=function(a){this.u=a&63}; -var eg={},$f=(eg[63744]=[null,null,M.prototype.zd,M.prototype.ye,"RLCS"],eg[63746]=[null,null,M.prototype.xd,M.prototype.we,"RLBA"],eg[63748]=[null,null,M.prototype.Ad,M.prototype.ze,"RLDA"],eg[63750]=[null,null,M.prototype.Bd,M.prototype.Ae,"RLMP"],eg[63752]=[null,null,M.prototype.yd,M.prototype.xe,"RLBE"],eg); -function fg(a,b,c){x.call(this,"Computer",a,fg,33554432);this.o.R=!1;gg(this,b);this.A=wc(this,"autoPower",a);this.l=0;this.P=a.busWidth||a.buswidth;this.b=hg;this.s=null;this.i=this.K=!1;this.U=wc(this,"url")||"";(Math.random()+.1).toString(36);this.c=ig(this);if(this.a=Wa("CPU",this.id)){this.H=Wa("Debugger",this.id);this.g=new yb({id:this.ua+".bus",busWidth:this.P},this.a,this.H);var d,e=A(this.id);if((this.w=Wa("Panel",this.id))&&this.w.eb)for(b=0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bhg){if(jg(d,this.s)){this.h=new O(this,"1.30.4","failsafe");jg(this.h)&&(og(this,d),a=2,pg(this.h));this.h.set("timestamp",sa());qg(this.h);var e=this.b&&!this.i;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"== -f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.c=null)):this.X(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.s;delete this.u}e=A(this.id);for(f=0;fa[1];a=a[2];this.V=!0;this.o.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(tg(this,this.a,b,c,a),this.Ba(),this.a.cb());this.G&&(og(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.l=0}; +function Xf(a,b){if(0<=b&&b>12&48;this.v=f>>16&63;this.i=this.b=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.B=this.B|a|32768);return!0}; +h.vc=function(a,b,c,d,e,f,g){var k=0,l=a.J,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.J.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,v;if(0>(u=a.J.read(n,p++))||0>(v=a.J.read(n,p++))){k=5120;break}this.g.Va(f,u|v<<8);if(Ub(this.g)){k=8192;break}f+=2;if(p>=l.W&&(n=null,++d>=l.N&&(d=0,++c>=l.S&&(c=0,++b>=l.O)))){k=5120;break}}return g(k,b,c,d,e,f)}; +h.wc=function(a,b,c,d,e,f,g){var k=0,l=a.J,n=null,p;l||(k=5120,e=0);for(;e--;){var u=this.g.Qa(f);if(Ub(this.g)){k=8192;break}f+=2;if(!n){n=a.J.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.J.write(n,p++,u&255)||!a.J.write(n,p++,u>>8)){k=5120;break}if(p>=l.W&&(n=null,++d>=l.N&&(d=0,++c>=l.S&&(c=0,++b>=l.O)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Ad=function(){return this.B&65535}; +h.ye=function(a){this.B=this.B&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.B&128)){var b;a=!0;var c=this.c[(this.B&768)>>8],d,e,f,g;this.B&=-2;switch(this.B&14){case 4:this.b&8&&(this.B&=63);this.m=c.status|this.i&64;break;case 6:1==(this.b&3)&&(b=this.b&65408,c=(this.b&16)<<2,this.i=this.b&4?this.i+b:this.i-b,this.b=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.vc;case 10:b||(b=this.wc),d=this.b>>7,e=this.b&64?1:0,f=this.b&63,d>=c.O||f>=c.N?this.B|=37888:(g=(this.v& +63)<<16|this.h,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.tc.bind(this)))}a&&(this.B|=129,this.B&64&&Wb(this.a,this.fb))}};h.yd=function(){return this.h};h.we=function(a){this.h=a&65534};h.Bd=function(){return this.b};h.ze=function(a){this.b=a};h.Cd=function(){return this.m};h.Ae=function(a){this.m=a};h.zd=function(){return this.v};h.xe=function(a){this.v=a&63}; +var eg={},$f=(eg[63744]=[null,null,M.prototype.Ad,M.prototype.ye,"RLCS"],eg[63746]=[null,null,M.prototype.yd,M.prototype.we,"RLBA"],eg[63748]=[null,null,M.prototype.Bd,M.prototype.ze,"RLDA"],eg[63750]=[null,null,M.prototype.Cd,M.prototype.Ae,"RLMP"],eg[63752]=[null,null,M.prototype.zd,M.prototype.xe,"RLBE"],eg); +function fg(a,b,c){x.call(this,"Computer",a,fg,33554432);this.o.R=!1;gg(this,b);this.w=wc(this,"autoPower",a);this.l=0;this.P=a.busWidth||a.buswidth;this.b=hg;this.s=null;this.i=this.K=!1;this.U=wc(this,"url")||"";(Math.random()+.1).toString(36);this.c=ig(this);if(this.a=Wa("CPU",this.id)){this.G=Wa("Debugger",this.id);this.g=new yb({id:this.ua+".bus",busWidth:this.P},this.a,this.G);var d,e=A(this.id);if((this.A=Wa("Panel",this.id))&&this.A.eb)for(b=0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bhg){if(jg(d,this.s)){this.h=new O(this,"1.30.4","failsafe");jg(this.h)&&(og(this,d),a=2,pg(this.h));this.h.set("timestamp",sa());qg(this.h);var e=this.b&&!this.i;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"== +f&&"no machine state"!=g?(this.D("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.c=null)):this.X(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.s;delete this.v}e=A(this.id);for(f=0;fa[1];a=a[2];this.V=!0;this.o.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(tg(this,this.a,b,c,a),this.Ba(),this.a.cb());this.H&&(og(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.l=0}; function og(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.4"};d.url=a.U;d.user=c;d.type="bug";d.data=b;t("http://www.pcjs.org/api/v1/report",d,!0)}} function ug(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.4"),g=new O(a,"1.30.4","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.4");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ga&&(c&&F(a.a),d=a.a.ga(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.R=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l=c||30<=(b.Bb+=c))&&(d.textContent=b.o.T?b.La.toFixed(2)+"Mhz":"Stopped",b.Bb=0)}if(this.w&&(b=this.w,a=a||0,b.u)){c=b.a.o.T;d=!!(b.a.v&4);if(0>=a||60<=(b.s+=a)){for(var e=0;e=c||30<=(b.Db+=c))&&(d.textContent=b.o.T?b.La.toFixed(2)+"Mhz":"Stopped",b.Db=0)}if(this.A&&(b=this.A,a=a||0,b.v)){c=b.a.o.T;d=!!(b.a.u&4);if(0>=a||60<=(b.s+=a)){for(var e=0;e