Merge branch 'next-release'

This commit is contained in:
Jeff Parsons 2016-11-13 11:50:31 -08:00
commit 701045d5f5
20 changed files with 922 additions and 700 deletions

View file

@ -17,20 +17,20 @@ into RAM using the machine's "Load" button instead of "Attach", allowing you to
loading the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) in order to load the [Absolute Loader](/apps/pdp11/tapes/absloader/) loading the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) in order to load the [Absolute Loader](/apps/pdp11/tapes/absloader/)
in order to load the desired tape. in order to load the desired tape.
* ![MAINDEC-11-D0AA-PB (MAR/70): TEST 1 - BRANCH](MAINDEC-11-D0AA-PB.jpg) ![MAINDEC-11-D0AA-PB (MAR/70): TEST 1 - BRANCH](MAINDEC-11-D0AA-PB.jpg)
* ![MAINDEC-11-D0BA-PB (MAR/70): TEST 2 - CON BRANCH](MAINDEC-11-D0BA-PB.jpg) ![MAINDEC-11-D0BA-PB (MAR/70): TEST 2 - CON BRANCH](MAINDEC-11-D0BA-PB.jpg)
* ![MAINDEC-11-D0CA-PB (MAR/70): TEST 3 - UNARY](MAINDEC-11-D0CA-PB.jpg) ![MAINDEC-11-D0CA-PB (MAR/70): TEST 3 - UNARY](MAINDEC-11-D0CA-PB.jpg)
* ![MAINDEC-11-D0DA-PB (MAR/70): TEST 4 - UNARY + BINARY](MAINDEC-11-D0DA-PB.jpg) ![MAINDEC-11-D0DA-PB (MAR/70): TEST 4 - UNARY + BINARY](MAINDEC-11-D0DA-PB.jpg)
* ![MAINDEC-11-D0EA-PB (MAR/70): TEST 5 - ROTATE SHIFT](MAINDEC-11-D0EA-PB.jpg) ![MAINDEC-11-D0EA-PB (MAR/70): TEST 5 - ROTATE SHIFT](MAINDEC-11-D0EA-PB.jpg)
* ![MAINDEC-11-D0FA-PB (MAR/70): TEST 6 - COMPARE](MAINDEC-11-D0FA-PB.jpg) ![MAINDEC-11-D0FA-PB (MAR/70): TEST 6 - COMPARE](MAINDEC-11-D0FA-PB.jpg)
* ![MAINDEC-11-D0GA-PB (MAR/70): TEST 7 - COMPARE NOT](MAINDEC-11-D0GA-PB.jpg) ![MAINDEC-11-D0GA-PB (MAR/70): TEST 7 - COMPARE NOT](MAINDEC-11-D0GA-PB.jpg)
* ![MAINDEC-11-D0HA-PB (MAR/70): TEST 8 - MOVE](MAINDEC-11-D0HA-PB.jpg) ![MAINDEC-11-D0HA-PB (MAR/70): TEST 8 - MOVE](MAINDEC-11-D0HA-PB.jpg)
* ![MAINDEC-11-D0IA-PB (MAR/70): TEST 9 - BIS, BIC + BIT](MAINDEC-11-D0IA-PB.jpg) ![MAINDEC-11-D0IA-PB (MAR/70): TEST 9 - BIS, BIC + BIT](MAINDEC-11-D0IA-PB.jpg)
* ![MAINDEC-11-D0JA-PB (MAR/70): TEST 10 - ADD](MAINDEC-11-D0JA-PB.jpg) ![MAINDEC-11-D0JA-PB (MAR/70): TEST 10 - ADD](MAINDEC-11-D0JA-PB.jpg)
* ![MAINDEC-11-D0KA-PB (MAR/70): TEST 11 - SUBTRACT](MAINDEC-11-D0KA-PB.jpg) ![MAINDEC-11-D0KA-PB (MAR/70): TEST 11 - SUBTRACT](MAINDEC-11-D0KA-PB.jpg)
* ![MAINDEC-11-D0LA-PB (MAR/70): TEST 12 - JUMP](MAINDEC-11-D0LA-PB.jpg) ![MAINDEC-11-D0LA-PB (MAR/70): TEST 12 - JUMP](MAINDEC-11-D0LA-PB.jpg)
* ![MAINDEC-11-D0MA-PB (FEB/70): TEST 13 - JSR, RTS, RTI](MAINDEC-11-D0MA-PB.jpg) ![MAINDEC-11-D0MA-PB (FEB/70): TEST 13 - JSR, RTS, RTI](MAINDEC-11-D0MA-PB.jpg)
* ![MAINDEC-11-D0NA-PB (APR/70): TEST 14 - TRAP TEST](MAINDEC-11-D0NA-PB.jpg) ![MAINDEC-11-D0NA-PB (APR/70): TEST 14 - TRAP TEST](MAINDEC-11-D0NA-PB.jpg)
Instructions for Running Diagnostics Instructions for Running Diagnostics
------------------------------------ ------------------------------------

View file

@ -0,0 +1,11 @@
---
layout: page
title: PDP-11/20 with Front Panel and TEST 14
permalink: /devices/pdp11/machine/1120/panel/debugger/test14/
machines:
- id: test1120
type: pdp11
debugger: true
---
{% include machine.html id="test1120" %}

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.3/machine.xsl"?>
<machine id="test1120" class="pdp11" border="1" pos="center" background="#FAEBD7">
<name pos="center">PDP-11/20 with Front Panel and TEST 14</name>
<computer id="computer" busWidth="16"/>
<cpu id="cpu" model="1120" cycles="6666667"/>
<ram id="ram" addr="0x00000" size="0xE000" file="/apps/pdp11/tapes/diags/MAINDEC-11-D0NA-PB.json"/>
<device id="default" type="default"/>
<serial id="dl11" adapter="0" binding="print" upperCase="true"/>
<panel ref="/devices/pdp11/panel/1120/debugger/front.xml"/>
<debugger id="debugger" base="8" messages="" commands=""/>
<device ref="/devices/pdp11/pc11/default.xml"/>
</machine>

View file

@ -1,6 +1,6 @@
--- ---
layout: page layout: page
title: DEC RL02K Disk Images: XXDP+ title: "DEC RL02K Disk Images: XXDP+"
permalink: /disks/dec/rl02k/xxdp/ permalink: /disks/dec/rl02k/xxdp/
--- ---

View file

@ -59,10 +59,10 @@
} }
.pcjs-progress-bar { .pcjs-progress-bar {
height: 20px; height: 20px;
width: 0%; width: 0;
background-color: gold; background-color: gold;
position: absolute; position: absolute;
top: 0px; top: 0;
} }
.pcjs-progress-text { .pcjs-progress-text {
height: 20px; height: 20px;
@ -71,7 +71,7 @@
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
position: absolute; position: absolute;
top: 0px; top: 0;
z-index: 1; z-index: 1;
} }
.pcjs-register { .pcjs-register {
@ -187,7 +187,7 @@
.pcjs-switch { .pcjs-switch {
height: 10px; height: 10px;
width: 28px; width: 28px;
margin-top: 0%; margin-top: 0;
max-width: 90%; max-width: 90%;
background-color: #00ff00; background-color: #00ff00;
} }
@ -229,9 +229,15 @@
} }
.pcjs-registers { .pcjs-registers {
width: 100% !important; width: 100% !important;
max-width: none !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
.pdp11-device { .pdp11-device {
width: 100% !important; width: 98% !important;
max-width: none !important; max-width: none !important;
margin-left: 8px !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
} }

View file

@ -1395,10 +1395,10 @@ BusPDP11.prototype.fault = function(addr, err, access)
this.fFault = true; this.fFault = true;
if (!this.nDisableFaults) { if (!this.nDisableFaults) {
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.FAULT)) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.FAULT)) {
this.dbg.printMessage("memory fault (" + access + ") on address " + this.dbg.toStrBase(addr), true, true); this.dbg.printMessage("memory fault (" + access + ") on " + this.dbg.toStrBase(addr), true, true);
} }
if (err) this.cpu.regErr |= err; if (err) this.cpu.regErr |= err;
this.cpu.trap(PDP11.TRAP.BUS_ERROR, 0, addr); this.cpu.trap(PDP11.TRAP.BUS, 0, addr);
} }
}; };

View file

@ -693,7 +693,9 @@ PDP11.opBISB = function(opCode)
*/ */
PDP11.opBIT = function(opCode) PDP11.opBIT = function(opCode)
{ {
this.updateNZVFlags(this.readSrcWord(opCode) & this.readDstWord(opCode)); var src = this.readSrcWord(opCode);
var dst = this.readDstWord(opCode);
this.updateNZVFlags((src < 0? this.regsGen[-src-1] : src) & dst);
this.nStepCycles -= (this.dstMode? (3 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 1) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); this.nStepCycles -= (this.dstMode? (3 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 1) : (2 + 1)) + (this.dstReg == 7? 2 : 0));
}; };
@ -705,7 +707,9 @@ PDP11.opBIT = function(opCode)
*/ */
PDP11.opBITB = function(opCode) PDP11.opBITB = function(opCode)
{ {
this.updateNZVFlags((this.readSrcByte(opCode) & this.readDstByte(opCode)) << 8); var src = this.readSrcByte(opCode);
var dst = this.readDstByte(opCode);
this.updateNZVFlags(((src < 0? (this.regsGen[-src-1] & 0xff) : src) & dst) << 8);
this.nStepCycles -= (this.dstMode? (3 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 1) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); this.nStepCycles -= (this.dstMode? (3 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 1) : (2 + 1)) + (this.dstReg == 7? 2 : 0));
}; };
@ -827,7 +831,7 @@ PDP11.opBPL = function(opCode)
*/ */
PDP11.opBPT = function(opCode) PDP11.opBPT = function(opCode)
{ {
this.trap(PDP11.TRAP.BPT, 0, PDP11.REASON.BPT); this.trap(PDP11.TRAP.BPT, 0, PDP11.REASON.OPCODE);
this.nStepCycles -= (4 + 1); this.nStepCycles -= (4 + 1);
}; };
@ -964,7 +968,7 @@ PDP11.opCMP = function(opCode)
{ {
var src = this.readSrcWord(opCode); var src = this.readSrcWord(opCode);
var dst = this.readDstWord(opCode); var dst = this.readDstWord(opCode);
var result = src - dst; var result = (src = (src < 0? this.regsGen[-src-1] : src)) - dst;
/* /*
* NOTE: CMP calculates (src - dst) rather than (dst - src), so src and dst updateSubFlags() parms must be reversed. * NOTE: CMP calculates (src - dst) rather than (dst - src), so src and dst updateSubFlags() parms must be reversed.
*/ */
@ -980,9 +984,9 @@ PDP11.opCMP = function(opCode)
*/ */
PDP11.opCMPB = function(opCode) PDP11.opCMPB = function(opCode)
{ {
var src = this.readSrcByte(opCode) << 8; var src = this.readSrcByte(opCode);
var dst = this.readDstByte(opCode) << 8; var dst = this.readDstByte(opCode);
var result = src - dst; var result = (src = (src < 0? (this.regsGen[-src-1] & 0xff): src) << 8) - (dst <<= 8);
/* /*
* NOTE: CMP calculates (src - dst) rather than (dst - src), so src and dst updateSubFlags() parms must be reversed. * NOTE: CMP calculates (src - dst) rather than (dst - src), so src and dst updateSubFlags() parms must be reversed.
*/ */
@ -1101,7 +1105,7 @@ PDP11.opDIV = function(opCode)
*/ */
PDP11.opEMT = function(opCode) PDP11.opEMT = function(opCode)
{ {
this.trap(PDP11.TRAP.EMT, 0, PDP11.REASON.EMT); this.trap(PDP11.TRAP.EMT, 0, PDP11.REASON.OPCODE);
this.nStepCycles -= (22 + 3); this.nStepCycles -= (22 + 3);
}; };
@ -1115,7 +1119,7 @@ PDP11.opHALT = function(opCode)
{ {
if (this.regPSW & PDP11.PSW.CMODE) { if (this.regPSW & PDP11.PSW.CMODE) {
this.regErr |= PDP11.CPUERR.BADHALT; this.regErr |= PDP11.CPUERR.BADHALT;
this.trap(PDP11.TRAP.BUS_ERROR, 0, PDP11.REASON.HALT); this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.HALT);
} else { } else {
if (this.panel) { if (this.panel) {
this.panel.setData(this.regsGen[0], true); this.panel.setData(this.regsGen[0], true);
@ -1174,7 +1178,7 @@ PDP11.opINCB = function(opCode)
*/ */
PDP11.opIOT = function(opCode) PDP11.opIOT = function(opCode)
{ {
this.trap(PDP11.TRAP.IOT, 0, PDP11.REASON.IOT); this.trap(PDP11.TRAP.IOT, 0, PDP11.REASON.OPCODE);
this.nStepCycles -= (22 + 3); this.nStepCycles -= (22 + 3);
}; };
@ -1294,7 +1298,7 @@ PDP11.opMFPT = function(opCode)
/* /*
* TODO: Review * TODO: Review
*/ */
this.trap(PDP11.TRAP.RESERVED, 0, PDP11.REASON.RESERVED); this.trap(PDP11.TRAP.RESERVED, 0, PDP11.REASON.OPCODE);
}; };
PDP11.MOV_CYCLES = [ PDP11.MOV_CYCLES = [
@ -1667,7 +1671,7 @@ PDP11.opSPL = function(opCode)
} }
if (!(this.regPSW & PDP11.PSW.CMODE)) { if (!(this.regPSW & PDP11.PSW.CMODE)) {
this.regPSW = (this.regPSW & ~(PDP11.PSW.UNUSED | PDP11.PSW.PRI)) | ((opCode & 0x7) << PDP11.PSW.SHIFT.PRI); this.regPSW = (this.regPSW & ~(PDP11.PSW.UNUSED | PDP11.PSW.PRI)) | ((opCode & 0x7) << PDP11.PSW.SHIFT.PRI);
this.opFlags |= PDP11.OPFLAG.INTQ_SPL; this.opFlags |= PDP11.OPFLAG.INTQ_DELAY;
} }
this.nStepCycles -= (4 + 1); this.nStepCycles -= (4 + 1);
}; };
@ -1716,7 +1720,7 @@ PDP11.opSXT = function(opCode)
*/ */
PDP11.opTRAP = function(opCode) PDP11.opTRAP = function(opCode)
{ {
this.trap(PDP11.TRAP.TRAP, 0, PDP11.REASON.TRAP); this.trap(PDP11.TRAP.TRAP, 0, PDP11.REASON.OPCODE);
this.nStepCycles -= (4 + 1); this.nStepCycles -= (4 + 1);
}; };
@ -1826,7 +1830,7 @@ PDP11.opUndefined = function(opCode)
if (DEBUGGER && this.dbg) { if (DEBUGGER && this.dbg) {
if (this.dbg.undefinedInstruction(opCode)) return; if (this.dbg.undefinedInstruction(opCode)) return;
} }
this.trap(PDP11.TRAP.RESERVED, 0, PDP11.REASON.RESERVED); this.trap(PDP11.TRAP.RESERVED, 0, PDP11.REASON.OPCODE);
}; };
/** /**

View file

@ -242,6 +242,10 @@ CPUStatePDP11.prototype.resetRegs = function()
this.mmuEnable = 0; // MMU enabled for PDP11.ACCESS.READ or PDP11.ACCESS.WRITE this.mmuEnable = 0; // MMU enabled for PDP11.ACCESS.READ or PDP11.ACCESS.WRITE
this.mmuLastMode = 0; this.mmuLastMode = 0;
this.mmuMask = 0x3ffff; this.mmuMask = 0x3ffff;
this.lastAI = 0; // last auto-incs and/or auto-decs; this gets propagated to MMR1
this.lastPC = 0; // last PC at the time of getOpcode(); this get propagated to MMR2
this.resetTriggers(); this.resetTriggers();
if (this.bus) this.setMemoryAccess(); if (this.bus) this.setMemoryAccess();
@ -324,6 +328,9 @@ CPUStatePDP11.prototype.setMMR0 = function(newMMR0)
*/ */
CPUStatePDP11.prototype.getMMR1 = function() CPUStatePDP11.prototype.getMMR1 = function()
{ {
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
this.regMMR1 = this.lastAI & 0xffff;
}
var result = this.regMMR1; var result = this.regMMR1;
if (result & 0xff00) { if (result & 0xff00) {
result = ((result << 8) | (result >> 8)) & 0xffff; result = ((result << 8) | (result >> 8)) & 0xffff;
@ -331,6 +338,20 @@ CPUStatePDP11.prototype.getMMR1 = function()
return result; return result;
}; };
/**
* getMMR2()
*
* @this {CPUStatePDP11}
* @return {number}
*/
CPUStatePDP11.prototype.getMMR2 = function()
{
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
this.regMMR2 = this.lastPC;
}
return this.regMMR2;
};
/** /**
* getMMR3() * getMMR3()
* *
@ -560,21 +581,22 @@ CPUStatePDP11.prototype.setNF = function()
/** /**
* getOpcode() * getOpcode()
* *
* TODO: Determine whether we can speed this up by *always* snapping PC into a shadow MMR2 register
* and eliminating the ABORT test.
*
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @return {number} * @return {number}
*/ */
CPUStatePDP11.prototype.getOpcode = function() CPUStatePDP11.prototype.getOpcode = function()
{ {
var pc = this.regsGen[PDP11.REG.PC]; var pc = this.regsGen[PDP11.REG.PC];
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) { this.lastAI = 0;
this.regMMR1 = 0; this.lastPC = pc;
this.regMMR2 = pc; /*
} * If PC is unaligned, a BUS trap will be generated, and because it will generate an
* exception, the next line (the equivalent of advancePC(2)) will not be executed, ensuring that
* original unaligned PC will be pushed onto the stack by trap().
*/
var op = this.readWord(pc);
this.regsGen[PDP11.REG.PC] = (pc + 2) & 0xffff; this.regsGen[PDP11.REG.PC] = (pc + 2) & 0xffff;
return this.readWord(pc); return op;
}; };
/** /**
@ -614,10 +636,7 @@ CPUStatePDP11.prototype.getPC = function()
*/ */
CPUStatePDP11.prototype.getLastPC = function() CPUStatePDP11.prototype.getLastPC = function()
{ {
/* return this.lastPC;
* As long as we're always snapping the PC into regMMR2 before every opcode, we might as well use it.
*/
return this.regMMR2;
}; };
/** /**
@ -739,11 +758,12 @@ CPUStatePDP11.prototype.removeTrigger = function(trigger)
CPUStatePDP11.prototype.setTrigger = function(trigger) CPUStatePDP11.prototype.setTrigger = function(trigger)
{ {
/* /*
* For now, we will not dispatch interrupts immediately, but always defer to checkInterrupts() instead. * We COULD dispatch interrupts immediately, but there are compatibility reasons for ONLY doing so
* inside the stepCPU() loop; see that function for details.
* *
if (this.dispatchInterrupt(trigger.vector, trigger.priority)) { * if (this.dispatchInterrupt(trigger.vector, trigger.priority)) {
return true; * return true;
} * }
*/ */
this.insertTrigger(trigger); this.insertTrigger(trigger);
this.opFlags |= PDP11.OPFLAG.INTQ; this.opFlags |= PDP11.OPFLAG.INTQ;
@ -799,10 +819,10 @@ CPUStatePDP11.prototype.checkInterrupts = function()
fInterrupt = true; fInterrupt = true;
} }
} }
else if (this.opFlags & PDP11.OPFLAG.INTQ_SPL) { else if (this.opFlags & PDP11.OPFLAG.INTQ_DELAY) {
/* /*
* We know that INTQ (bit 1) is clear, so since INTQ_SPL (bit 0) is set, incrementing opFlags * We know that INTQ (bit 1) is clear, so since INTQ_DELAY (bit 0) is set, incrementing opFlags
* will transform INTQ_SPL into INTQ, without affecting any other (higher) bits. * will transform INTQ_DELAY into INTQ, without affecting any other (higher) bits.
*/ */
this.opFlags++; this.opFlags++;
} }
@ -812,6 +832,9 @@ CPUStatePDP11.prototype.checkInterrupts = function()
/** /**
* dispatchInterrupt(vector, priority) * dispatchInterrupt(vector, priority)
* *
* TODO: The process of dispatching an interrupt MUST cost some cycles; either trap() needs to assess
* that cost, or we do.
*
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} vector * @param {number} vector
* @param {number} priority * @param {number} priority
@ -831,6 +854,65 @@ CPUStatePDP11.prototype.dispatchInterrupt = function(vector, priority)
return false; return false;
}; };
/**
* checkTraps()
*
* NOTE: The following code processes these "deferred" traps in priority order. Unfortunately, that
* order seems to have changed since the 11/20. For reference, here's the priority list for the 11/20:
*
* 1. Bus Errors
* 2. Instruction Traps
* 3. Trace Trap
* 4. Stack Overflow Trap
* 5. Power Failure Trap
*
* and for the 11/70:
*
* 1. HALT (Instruction, Switch, or Command)
* 2. MMU Faults
* 3. Parity Errors
* 4. Bus Errors (including stack overflow traps?)
* 5. Floating Point Traps
* 6. TRAP Instruction
* 7. TRACE Trap
* 8. OVFL Trap
* 9. Power Fail Trap
* 10. Console Bus Request (Front Panel Operation)
* 11. PIR 7, BR 7, PIR 6, BR 6, PIR 5, BR 5, PIR 4, BR 4, PIR 3, BR 3, PIR 2, PIR 1
* 12. WAIT Loop
*
* TODO: Determine 1) if the 11/20 Handbook was wrong, or 2) if the 11/70 really has different priorities.
*
* Also, as the PDP-11/20 Handbook (1971), p.100, notes:
*
* If a bus error is caused by the trap process handling instruction traps, trace traps, stack overflow
* traps, or a previous bus error, the processor is halted.
*
* If a stack overflow is caused by the trap process in handling bus errors, instruction traps, or trace traps,
* the process is completed and then the stack overflow trap is sprung.
*
* TODO: Based on the above notes, we should probably be halting the CPU when a bus error occurs during a trap.
*
* @this {CPUStatePDP11}
* @return {boolean} (true if dispatched, false if not)
*/
CPUStatePDP11.prototype.checkTraps = function()
{
if (this.opFlags & PDP11.OPFLAG.TRAP_MMU) {
this.trap(PDP11.TRAP.MMU, PDP11.OPFLAG.TRAP_MMU, PDP11.REASON.FAULT);
return true;
}
if (this.opFlags & PDP11.OPFLAG.TRAP_SP) {
this.trap(PDP11.TRAP.BUS, PDP11.OPFLAG.TRAP_SP, PDP11.REASON.YELLOW);
return true;
}
if (this.opFlags & PDP11.OPFLAG.TRAP_TF) {
this.trap(PDP11.TRAP.BPT, PDP11.OPFLAG.TRAP_TF, PDP11.REASON.TRACE);
return true;
}
return false;
};
/** /**
* isWaiting() * isWaiting()
* *
@ -1161,25 +1243,31 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason)
{ {
if (DEBUG && this.dbg) { if (DEBUG && this.dbg) {
if (this.messageEnabled(MessagesPDP11.TRAP)) { if (this.messageEnabled(MessagesPDP11.TRAP)) {
this.printMessage("trap to vector " + this.dbg.toStrBase(vector, 0, true) + (reason? " (" + this.dbg.toStrBase(reason) + ")" : ""), MessagesPDP11.TRAP, true); var sReason = reason < 0? PDP11.REASONS[-reason] : this.dbg.toStrBase(reason);
this.printMessage("trap to vector " + this.dbg.toStrBase(vector, 1) + " (" + sReason + ")", MessagesPDP11.TRAP, true);
} }
} }
if (this.nDisableTraps) return; if (this.nDisableTraps) return;
var doubleTrap = false;
if (this.trapPSW < 0) { if (this.trapPSW < 0) {
this.trapPSW = this.getPSW(); this.trapPSW = this.getPSW();
} else if (!this.mmuMode) { } else if (!this.mmuMode) {
/*
* Double-fault (nested trap) condition detected.
*/
vector = 4; vector = 4;
doubleTrap = true; /*
* The next two lines used to be deferred until after the setPSW() below, but
* I'm not seeing any dependencies on these registers, so I'm consolidating the code.
*/
this.regErr |= PDP11.CPUERR.RED;
this.regsGen[6] = 4;
reason = PDP11.REASON.RED;
} }
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) { this.lastPC = vector;
this.regMMR1 = 0xf6f6; this.lastAI = 0;
this.regMMR2 = vector;
}
/* /*
* Read from kernel D space * Read from kernel D space
@ -1193,33 +1281,52 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason)
*/ */
this.setPSW((newPSW & ~PDP11.PSW.PMODE) | ((this.trapPSW >> 2) & PDP11.PSW.PMODE)); this.setPSW((newPSW & ~PDP11.PSW.PMODE) | ((this.trapPSW >> 2) & PDP11.PSW.PMODE));
if (doubleTrap) {
this.regErr |= PDP11.CPUERR.RED;
this.regsGen[6] = 4;
}
this.pushWord(this.trapPSW); this.pushWord(this.trapPSW);
this.pushWord(this.regsGen[7]); this.pushWord(this.regsGen[7]);
this.setPC(newPC); this.setPC(newPC);
/* /*
* Since DEC's "TRAP TEST" triggers a RESERVED (instruction) trap with the stack deliberately * DEC's "TRAP TEST" triggers a RESERVED trap with an invalid opcode and the stack deliberately
* set too low, and expects the stack overflow trap to be "sprung" immediately afterward, we only * set too low, and expects the stack overflow trap to be "sprung" immediately afterward, so we
* want to "lose interest" in TRAP flags that were set on entry. * only want to "lose interest" in the TRAP flag(s) that were set on entry, not ALL of them.
* *
* this.opFlags &= ~PDP11.OPFLAG.TRAP_MASK; // lose interest in traps after an abort * this.opFlags &= ~PDP11.OPFLAG.TRAP_MASK; // lose interest in traps after an abort
*
* 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
* the next instruction, just in case the PSW priority was lowered. However, there are "TRAP TEST"
* tests like this one:
*
* 005640: 012706 007700 MOV #7700,SP
* 005644: 012767 000340 172124 MOV #340,177776
* 005652: 012767 000100 171704 MOV #100,177564
* 005660: 012767 005712 172146 MOV #5712,000034 ; set TRAP vector (its PSW is already zero)
* 005666: 012767 005714 172170 MOV #5714,000064 ; set hardware interrupt vector (its PSW is already zero)
* 005674: 012767 005716 172116 MOV #5716,000020 ; set IOT vector
* 005702: 012767 000340 172112 MOV #340,000022 ; set IOT PSW
* 005710: 104400 TRAP 000
* 005712: 000004 IOT
* 005714: 000000 HALT
*
* 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.
*/ */
this.opFlags &= ~flag; this.opFlags &= ~(flag | PDP11.OPFLAG.TRAP_TF | PDP11.OPFLAG.INTQ);
this.opFlags |= PDP11.OPFLAG.INTQ_DELAY | PDP11.OPFLAG.TRAP;
this.trapPSW = -1; // reset flag that we have a trap within a trap this.trapPSW = -1; // reset flag that we have a trap within a trap
/* /*
* These next properties are purely an aid for the Debugger; see getTrapStatus() * These next properties (in conjunction with setting PDP11.OPFLAG.TRAP) are purely an aid for the Debugger;
* see getTrapStatus().
*/ */
this.opFlags |= PDP11.OPFLAG.TRAP;
this.trapVector = vector; this.trapVector = vector;
this.trapReason = reason; this.trapReason = reason;
if (reason != PDP11.REASON.INTERRUPT) throw vector; if (reason >= PDP11.REASON.RED) throw vector;
}; };
/** /**
@ -1385,72 +1492,77 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
var errorMask = 0; var errorMask = 0;
switch (pdr & 0x7) { switch (pdr & 0x7) {
case 1: // read-only with trap case 1: // read-only with trap
errorMask = 0x1000; // MMU trap errorMask = PDP11.MMR0.TRAP_MMU;
/* falls through */ /* falls through */
case 2: // read-only case 2: // read-only
pdr |= 0x80; // Set A bit pdr |= 0x80; // Set A bit
if (accessFlags & PDP11.ACCESS.WRITE) { if (accessFlags & PDP11.ACCESS.WRITE) {
errorMask = 0x2000; // read-only abort errorMask = PDP11.MMR0.ABORT_RO;
} }
break; break;
case 4: // read-write with read-write trap case 4: // read-write with read-write trap
errorMask = 0x1000; // MMU trap errorMask = PDP11.MMR0.TRAP_MMU;
/* falls through */ /* falls through */
case 5: // read-write with write trap case 5: // read-write with write trap
if (accessFlags & PDP11.ACCESS.WRITE) { if (accessFlags & PDP11.ACCESS.WRITE) {
errorMask = 0x1000; // MMU trap errorMask = PDP11.MMR0.TRAP_MMU;
} }
/* falls through */ /* falls through */
case 6: // read-write: set A & W bits case 6: // read-write: set A & W bits
pdr |= ((accessFlags & PDP11.ACCESS.WRITE) ? 0xc0 : 0x80); pdr |= ((accessFlags & PDP11.ACCESS.WRITE) ? 0xc0 : 0x80);
break; break;
default: default:
errorMask = 0x8000; // non-resident abort errorMask = PDP11.MMR0.ABORT_NR;
break; break;
} }
if ((pdr & 0x7f08) !== 0x7f00) { // skip checking most common case (hopefully) if ((pdr & 0x7f08) != 0x7f00) { // skip checking most common case (hopefully)
if (pdr & 0x8) { // expand downwards if (pdr & 0x8) { // expand downwards
if (pdr & 0x7f00) { if (pdr & 0x7f00) {
if ((virtualAddress & 0x1fc0) < ((pdr >> 2) & 0x1fc0)) { if ((virtualAddress & 0x1fc0) < ((pdr >> 2) & 0x1fc0)) {
errorMask |= 0x4000; // page length error abort errorMask |= PDP11.MMR0.ABORT_PL;
} }
} }
} else { // expand upwards } else { // expand upwards
if ((virtualAddress & 0x1fc0) > ((pdr >> 2) & 0x1fc0)) { if ((virtualAddress & 0x1fc0) > ((pdr >> 2) & 0x1fc0)) {
errorMask |= 0x4000; // page length error abort errorMask |= PDP11.MMR0.ABORT_PL;
} }
} }
} }
// aborts and traps: log FIRST trap and MOST RECENT abort /*
* Aborts and traps: log FIRST trap and MOST RECENT abort
*/
this.mmuPDR[this.mmuMode][page] = pdr; this.mmuPDR[this.mmuMode][page] = pdr;
if ((physicalAddress !== 0x3fff7a) || this.mmuMode) { // MMR0 is 017777572 if (physicalAddress != ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.MMR0) & this.mmuMask) || this.mmuMode) {
this.mmuLastMode = this.mmuMode; this.mmuLastMode = this.mmuMode;
this.mmuLastPage = page; this.mmuLastPage = page;
} }
var fTrap = false; var fAbort = false;
if (errorMask) { if (errorMask) {
if (errorMask & 0xe000) { if (errorMask & PDP11.MMR0.ABORT) {
if (this.trapPSW >= 0) errorMask |= 0x80; // Instruction complete if (this.trapPSW >= 0) errorMask |= 0x80; // Instruction complete
if (!(this.regMMR0 & 0xe000)) { if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
this.regMMR0 |= errorMask | (this.mmuLastMode << 5) | (this.mmuLastPage << 1); this.regMMR0 |= errorMask | (this.mmuLastMode << 5) | (this.mmuLastPage << 1);
} }
fTrap = true; fAbort = true;
} }
if (!(this.regMMR0 & 0xf000)) { if (!(this.regMMR0 & (PDP11.MMR0.ABORT | PDP11.MMR0.TRAP_MMU))) {
//if (physicalAddress < 017772200 || physicalAddress > 017777677) { /*
if (physicalAddress < 0x3ff480 || physicalAddress > 0x3fffbf) { * TODO: Review the code below, because the address range seems over-inclusive.
this.regMMR0 |= 0x1000; // MMU trap flag */
if (this.regMMR0 & 0x0200) { if (physicalAddress < ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.SIPDR0) & this.mmuMask) ||
physicalAddress > ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.UDPAR7 | 0x1) & this.mmuMask)) {
this.regMMR0 |= PDP11.MMR0.TRAP_MMU;
if (this.regMMR0 & PDP11.MMR0.MMU_TRAPS) {
this.opFlags |= PDP11.OPFLAG.TRAP_MMU; this.opFlags |= PDP11.OPFLAG.TRAP_MMU;
} }
} }
} }
if (fTrap) { // don't trap until the end, because it throws an exception if (fAbort) { // don't abort until the end, because it throws an exception
this.trap(PDP11.TRAP.MMU, 0, PDP11.REASON.MAPERROR); this.trap(PDP11.TRAP.MMU, 0, PDP11.REASON.ABORT);
} }
} }
return physicalAddress; return physicalAddress;
@ -1478,7 +1590,7 @@ CPUStatePDP11.prototype.readByteFromPhysical = function(physicalAddress)
CPUStatePDP11.prototype.writeByteToPhysical = function(physicalAddress, data) CPUStatePDP11.prototype.writeByteToPhysical = function(physicalAddress, data)
{ {
if (physicalAddress & 1) this.nStepCycles--; if (physicalAddress & 1) this.nStepCycles--;
this.bus.setByte(physicalAddress, data & 0xff); this.bus.setByte(physicalAddress, data);
}; };
/** /**
@ -1503,12 +1615,8 @@ CPUStatePDP11.prototype.popWord = function()
CPUStatePDP11.prototype.pushWord = function(data) CPUStatePDP11.prototype.pushWord = function(data)
{ {
var virtualAddress = (this.regsGen[6] - 2) & 0xffff; var virtualAddress = (this.regsGen[6] - 2) & 0xffff;
this.regsGen[6] = virtualAddress; // BSD needs SP updated before any fault :-( this.regsGen[6] = virtualAddress; // BSD needs SP updated before any fault :-(
this.lastAI = (this.lastAI << 8) | 0xf6;
if (!(this.regMMR0 & 0xe000)) {
this.regMMR1 = (this.regMMR1 << 8) | 0xf6;
}
this.checkStackLimit(0, virtualAddress); this.checkStackLimit(0, virtualAddress);
this.writeWord(virtualAddress, data); this.writeWord(virtualAddress, data);
}; };
@ -1516,18 +1624,30 @@ CPUStatePDP11.prototype.pushWord = function(data)
/** /**
* checkStackLimit(mode, addr) * checkStackLimit(mode, addr)
* *
* The special "mode 0" case used by pushWord() ignores addr <= 4, because pushWord() is used by trap(),
* and if the trap() was generated by a RED error (below) or generated a RED error itself, then we need to
* avoid triggering another (nested) RED error.
*
* TODO: pushWord() is not used exclusively by trap(); it's also used by a few instructions, like opJSR(),
* so we might need to do some additional factoring of this function's logic.
*
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} mode (ie, the addressing mode; 0 if push) * @param {number} mode (ie, the addressing mode, or 0 if pushWord() is checking)
* @param {number} addr * @param {number} addr
*/ */
CPUStatePDP11.prototype.checkStackLimit = function(mode, addr) CPUStatePDP11.prototype.checkStackLimit = function(mode, addr)
{ {
if (!this.mmuMode && !(this.opFlags & PDP11.OPFLAG.TRAP_SP)) { if (!this.mmuMode) {
if (addr <= this.regSL && (mode || addr > 4) || mode && addr >= 0xfffe) { /*
if (this.model >= PDP11.MODEL_1145 && (addr <= this.regSL - 32 || mode == 1 && addr >= 0xfffe)) { * NOTE: I've removed the tests below for addr >= 0xFFFE, which were ported from the original code,
* because while it's definitely a bad physical stack address, I'm not sure it rises to the level of
* a trap, and this code is already expensive enough as it is.
*/
if (addr <= this.regSL && (mode || addr > 4) /* || mode && addr >= 0xFFFE */) {
if (this.model >= PDP11.MODEL_1145 && (addr <= this.regSL - 32 /* || mode == 1 && addr >= 0xFFFE */)) {
this.regErr |= PDP11.CPUERR.RED; this.regErr |= PDP11.CPUERR.RED;
this.regsGen[6] = 4; this.regsGen[6] = 4;
this.trap(PDP11.TRAP.BUS_ERROR, 0, PDP11.REASON.STACKMODE1); this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.RED);
} else { } else {
/* /*
* On older machines (eg, the PDP-11/20), the instruction is always allowed to complete, * On older machines (eg, the PDP-11/20), the instruction is always allowed to complete,
@ -1581,7 +1701,7 @@ CPUStatePDP11.prototype.checkStackLimit = function(mode, addr)
*/ */
CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags) CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
{ {
var virtualAddress, stepSize; var virtualAddress, step;
var addrDSpace = (accessFlags & PDP11.ACCESS.VIRT)? 0 : this.addrDSpace; var addrDSpace = (accessFlags & PDP11.ACCESS.VIRT)? 0 : this.addrDSpace;
/* /*
@ -1593,11 +1713,12 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
* Mode 0: Registers don't have a virtual address, so trap. * Mode 0: Registers don't have a virtual address, so trap.
* *
* NOTE: Most instruction code paths never call getAddrByMode() when the mode is zero; * NOTE: Most instruction code paths never call getAddrByMode() when the mode is zero;
* JMP and JSR instructions are exceptions, but that's OK, because those are documented to * JMP and JSR instructions are exceptions, but that's OK, because those are documented as
* "cause an 'illegal' instruction" condition", which presumably means a BUS_ERROR trap. * ILLEGAL instructions which produce a BUS trap (as opposed to UNDEFINED instructions
* that cause a RESERVED trap).
*/ */
case 0: case 0:
this.trap(PDP11.TRAP.BUS_ERROR, 0, PDP11.REASON.NOREGADDR); this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.ILLEGAL);
return 0; return 0;
/* /*
@ -1614,12 +1735,12 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
* Mode 2: (R)+ * Mode 2: (R)+
*/ */
case 2: case 2:
stepSize = 2; step = 2;
virtualAddress = this.regsGen[reg]; virtualAddress = this.regsGen[reg];
if (reg != 7) { if (reg != 7) {
virtualAddress |= addrDSpace; virtualAddress |= addrDSpace;
if (reg < 6 && (accessFlags & PDP11.ACCESS.BYTE)) { if (reg < 6 && (accessFlags & PDP11.ACCESS.BYTE)) {
stepSize = 1; step = 1;
} }
} }
this.nStepCycles -= (2 + 1); this.nStepCycles -= (2 + 1);
@ -1629,7 +1750,7 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
* Mode 3: @(R)+ * Mode 3: @(R)+
*/ */
case 3: case 3:
stepSize = 2; step = 2;
virtualAddress = this.regsGen[reg]; virtualAddress = this.regsGen[reg];
if (reg != 7) virtualAddress |= addrDSpace; if (reg != 7) virtualAddress |= addrDSpace;
virtualAddress = this.readWord(virtualAddress); virtualAddress = this.readWord(virtualAddress);
@ -1641,9 +1762,9 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
* Mode 4: -(R) * Mode 4: -(R)
*/ */
case 4: case 4:
stepSize = -2; step = -2;
if (reg < 6 && (accessFlags & PDP11.ACCESS.BYTE)) stepSize = -1; if (reg < 6 && (accessFlags & PDP11.ACCESS.BYTE)) step = -1;
virtualAddress = (this.regsGen[reg] + stepSize) & 0xffff; virtualAddress = (this.regsGen[reg] + step) & 0xffff;
if (reg != 7) virtualAddress |= addrDSpace; if (reg != 7) virtualAddress |= addrDSpace;
this.nStepCycles -= (3 + 1); this.nStepCycles -= (3 + 1);
break; break;
@ -1652,7 +1773,7 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
* Mode 5: @-(R) * Mode 5: @-(R)
*/ */
case 5: case 5:
stepSize = -2; step = -2;
virtualAddress = (this.regsGen[reg] - 2) & 0xffff; virtualAddress = (this.regsGen[reg] - 2) & 0xffff;
if (reg != 7) virtualAddress |= addrDSpace; if (reg != 7) virtualAddress |= addrDSpace;
virtualAddress = this.readWord(virtualAddress) | addrDSpace; virtualAddress = this.readWord(virtualAddress) | addrDSpace;
@ -1679,17 +1800,14 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
return virtualAddress; return virtualAddress;
} }
this.regsGen[reg] = (this.regsGen[reg] + stepSize) & 0xffff; this.regsGen[reg] = (this.regsGen[reg] + step) & 0xffff;
this.lastAI = (this.lastAI << 8) | ((step << 3) & 0xf8) | reg;
if (addrDSpace && !(this.regMMR0 & 0xe000)) {
this.regMMR1 = (this.regMMR1 << 8) | ((stepSize << 3) & 0xf8) | reg;
}
/* /*
* NOTE: We had to eliminate the test for "(accessFlags & PDP11.ACCESS.WRITE)", because DEC's * NOTE: We had to eliminate the test for "(accessFlags & PDP11.ACCESS.WRITE)", because DEC's
* "TRAP TEST" expects "TST -(SP)" to trap when SP is 150. * "TRAP TEST" expects "TST -(SP)" to trap when SP is 150.
*/ */
if (reg == 6 && stepSize < 0) { if (reg == 6 && step < 0) {
this.checkStackLimit(mode, this.regsGen[6]); this.checkStackLimit(mode, this.regsGen[6]);
} }
return virtualAddress; return virtualAddress;
@ -1877,14 +1995,14 @@ CPUStatePDP11.prototype.writeWordToVirtual = function(virtualAddress, data)
*/ */
CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags) CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags)
{ {
var src; var data;
var reg = this.dstReg = opCode & PDP11.OPREG.MASK; var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
if (!mode) { if (!mode) {
if (reg != 6 || ((this.regPSW >> 2) & PDP11.PSW.PMODE) === (this.regPSW & PDP11.PSW.PMODE)) { if (reg != 6 || ((this.regPSW >> 2) & PDP11.PSW.PMODE) === (this.regPSW & PDP11.PSW.PMODE)) {
src = this.regsGen[reg]; data = this.regsGen[reg];
} else { } else {
src = this.regsAltStack[(this.regPSW >> 12) & 3]; data = this.regsAltStack[(this.regPSW >> 12) & 3];
} }
} else { } else {
var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD); var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD);
@ -1892,10 +2010,10 @@ CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags)
if ((this.regPSW & 0xf000) !== 0xf000) addr &= 0xffff; if ((this.regPSW & 0xf000) !== 0xf000) addr &= 0xffff;
} }
this.mmuMode = (this.regPSW >> 12) & 3; this.mmuMode = (this.regPSW >> 12) & 3;
src = this.readWord(addr | (accessFlags & this.addrDSpace)); data = this.readWord(addr | (accessFlags & this.addrDSpace));
this.mmuMode = (this.regPSW >> 14) & 3; this.mmuMode = (this.regPSW >> 14) & 3;
} }
return src; return data;
}; };
/** /**
@ -1908,9 +2026,7 @@ CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags)
*/ */
CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, data) CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, data)
{ {
if (!(this.regMMR0 & 0xe000)) { this.lastAI = 0x0016;
this.regMMR1 = 0x16;
}
var reg = this.dstReg = opCode & PDP11.OPREG.MASK; var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
if (!mode) { if (!mode) {
@ -1938,6 +2054,11 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, dat
/** /**
* readSrcByte(opCode) * readSrcByte(opCode)
* *
* WARNING: If the SRC operand is a register, we return a negative register number rather than the
* register value, because the final value of the register must be resolved AFTER the DST operand has
* been decoded and any pre-decrement or post-increment operations affecting the SRC register have
* been completed. See readSrcWord() for more details.
*
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} opCode * @param {number} opCode
* @return {number} * @return {number}
@ -1949,7 +2070,7 @@ CPUStatePDP11.prototype.readSrcByte = function(opCode)
var reg = this.srcReg = opCode & PDP11.OPREG.MASK; var reg = this.srcReg = opCode & PDP11.OPREG.MASK;
var mode = this.srcMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; var mode = this.srcMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
if (!mode) { if (!mode) {
result = this.regsGen[reg] & 0xff; result = -reg-1;
} else { } else {
result = this.readByteFromPhysical(this.getAddr(mode, reg, PDP11.ACCESS.READ_BYTE)); result = this.readByteFromPhysical(this.getAddr(mode, reg, PDP11.ACCESS.READ_BYTE));
} }
@ -1959,6 +2080,27 @@ CPUStatePDP11.prototype.readSrcByte = function(opCode)
/** /**
* readSrcWord(opCode) * readSrcWord(opCode)
* *
* WARNING: If the SRC operand is a register, we return a negative register number rather than the
* register value, because the final value of the register must be resolved AFTER the DST operand has
* been decoded and any pre-decrement or post-increment operations affecting the SRC register have
* been completed.
*
* Here's an example from DEC's "TRAP TEST":
*
* 007200: 012700 006340 MOV #6340,R0
* 007204: 010020 MOV R0,(R0)+
* 007206: 026727 177126 006342 CMP 006340,#6342
* 007214: 001401 BEQ 007220
* 007216: 000000 HALT
*
* If this function returned the value of R0 for the SRC operand of "MOV R0,(R0)+", then the operation
* would write 6340 to the destination, rather than 6342.
*
* Most callers don't need to worry about this, because if they pass the result from readSrcWord() directly
* to writeDstWord() or updateDstWord(), those functions will take care of converting any negative register
* number back into the current register value. The exceptions are opcodes that don't modify the DST operand
* (BIT, BITB, CMP, and CMPB); those opcode handlers must deal with negative register numbers themselves.
*
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} opCode * @param {number} opCode
* @return {number} * @return {number}
@ -1970,7 +2112,7 @@ CPUStatePDP11.prototype.readSrcWord = function(opCode)
var reg = this.srcReg = opCode & PDP11.OPREG.MASK; var reg = this.srcReg = opCode & PDP11.OPREG.MASK;
var mode = this.srcMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; var mode = this.srcMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
if (!mode) { if (!mode) {
result = this.regsGen[reg]; result = -reg-1;
} else { } else {
result = this.bus.getWord(this.getAddr(mode, reg, PDP11.ACCESS.READ_WORD)); result = this.bus.getWord(this.getAddr(mode, reg, PDP11.ACCESS.READ_WORD));
} }
@ -2032,53 +2174,63 @@ CPUStatePDP11.prototype.readDstWord = function(opCode)
}; };
/** /**
* updateDstByte(opCode, src, fnOp) * updateDstByte(opCode, data, fnOp)
* *
* Used whenever the dst operand (as described by opCode) needs to be read before writing. * Used whenever the DST operand (as described by opCode) needs to be read before writing.
* *
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} opCode * @param {number} opCode
* @param {number} src * @param {number} data
* @param {function(number,number)} fnOp * @param {function(number,number)} fnOp
*/ */
CPUStatePDP11.prototype.updateDstByte = function(opCode, src, fnOp) CPUStatePDP11.prototype.updateDstByte = function(opCode, data, fnOp)
{ {
var reg = this.dstReg = opCode & PDP11.OPREG.MASK; var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
if (!mode) { if (!mode) {
this.regsGen[reg] = (this.regsGen[reg] & 0xff00) | fnOp.call(this, src, this.regsGen[reg] & 0xff); var dst = this.regsGen[reg];
data = (data < 0? (this.regsGen[-data-1] & 0xff) : data);
this.regsGen[reg] = (dst & 0xff00) | fnOp.call(this, data, dst & 0xff);
} else { } else {
var addr = this.dstAddr = this.getAddr(mode, reg, PDP11.ACCESS.UPDATE_BYTE); var addr = this.dstAddr = this.getAddr(mode, reg, PDP11.ACCESS.UPDATE_BYTE);
this.writeByteToPhysical(addr, fnOp.call(this, src, this.readByteFromPhysical(addr))); data = (data < 0? (this.regsGen[-data-1] & 0xff) : data);
this.writeByteToPhysical(addr, fnOp.call(this, data, this.readByteFromPhysical(addr)));
} }
}; };
/** /**
* updateDstWord(opCode, src, fnOp) * updateDstWord(opCode, data, fnOp)
* *
* Used whenever the dst operand (as described by opCode) needs to be read before writing. * Used whenever the DST operand (as described by opCode) needs to be read before writing.
* *
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} opCode * @param {number} opCode
* @param {number} src * @param {number} data
* @param {function(number,number)} fnOp * @param {function(number,number)} fnOp
*/ */
CPUStatePDP11.prototype.updateDstWord = function(opCode, src, fnOp) CPUStatePDP11.prototype.updateDstWord = function(opCode, data, fnOp)
{ {
var reg = this.dstReg = opCode & PDP11.OPREG.MASK; var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
/*
* TODO: If callers are careful about masking data, then we don't need to mask it here or in bus.setWord().
* We've eliminated the 0xffff data mask here, but bus.setWord() is still masking.
*/
this.assert(data < 0 && data >= -8 || !(data & ~0xffff));
if (!mode) { if (!mode) {
this.regsGen[reg] = fnOp.call(this, src, this.regsGen[reg]); this.regsGen[reg] = fnOp.call(this, data < 0? this.regsGen[-data-1] : data, this.regsGen[reg]);
} else { } else {
var addr = this.getAddr(mode, reg, PDP11.ACCESS.UPDATE_WORD); var addr = this.getAddr(mode, reg, PDP11.ACCESS.UPDATE_WORD);
this.bus.setWord(addr, fnOp.call(this, src, this.bus.getWord(addr))); this.bus.setWord(addr, fnOp.call(this, data < 0? this.regsGen[-data-1] : data, this.bus.getWord(addr)));
} }
}; };
/** /**
* writeDstByte(opCode, data, writeFlags) * writeDstByte(opCode, data, writeFlags)
* *
* Used whenever the dst operand (as described by opCode) does NOT need to be read before writing. * Used whenever the DST operand (as described by opCode) does NOT need to be read before writing.
* *
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} opCode * @param {number} opCode
@ -2102,10 +2254,12 @@ CPUStatePDP11.prototype.writeDstByte = function(opCode, data, writeFlags)
* Potentially worthwhile optimization: skipping the sign-extending data shifts * Potentially worthwhile optimization: skipping the sign-extending data shifts
* if writeFlags is WRITE.BYTE (but that requires an extra test and separate code paths). * if writeFlags is WRITE.BYTE (but that requires an extra test and separate code paths).
*/ */
data = (data < 0? (this.regsGen[-data-1] & 0xff): data);
this.regsGen[reg] = (this.regsGen[reg] & ~writeFlags) | (((data << 24) >> 24) & writeFlags); this.regsGen[reg] = (this.regsGen[reg] & ~writeFlags) | (((data << 24) >> 24) & writeFlags);
} }
} else { } else {
this.writeByteToPhysical(this.getAddr(mode, reg, PDP11.ACCESS.WRITE_BYTE), data); var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_BYTE);
this.writeByteToPhysical(addr, (data = data < 0? (this.regsGen[-data-1] & 0xff): data));
} }
return data; return data;
}; };
@ -2113,7 +2267,7 @@ CPUStatePDP11.prototype.writeDstByte = function(opCode, data, writeFlags)
/** /**
* writeDstWord(opCode, data) * writeDstWord(opCode, data)
* *
* Used whenever the dst operand (as described by opCode) does NOT need to be read before writing. * Used whenever the DST operand (as described by opCode) does NOT need to be read before writing.
* *
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} opCode * @param {number} opCode
@ -2124,10 +2278,18 @@ CPUStatePDP11.prototype.writeDstWord = function(opCode, data)
{ {
var reg = this.dstReg = opCode & PDP11.OPREG.MASK; var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
/*
* TODO: If callers are careful about masking data, then we don't need to mask it here or in bus.setWord().
* We've eliminated the 0xffff data mask here, but bus.setWord() is still masking.
*/
this.assert(data < 0 && data >= -8 || !(data & ~0xffff));
if (!mode) { if (!mode) {
this.regsGen[reg] = data & 0xffff; this.regsGen[reg] = (data = (data < 0? this.regsGen[-data-1] : data));
} else { } else {
this.bus.setWord(this.getAddr(mode, reg, PDP11.ACCESS.WRITE_WORD), data); var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_WORD);
this.bus.setWord(addr, (data = (data < 0? this.regsGen[-data-1] : data)));
} }
return data; return data;
}; };
@ -2219,42 +2381,37 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
if (this.opFlags) { if (this.opFlags) {
/* /*
* Check for any pending traps. * If we're in the INTQ or WAIT state, check for any pending interrupts.
* *
* I've moved this TRAP_MASK check BEFORE we decode the next instruction instead of immediately AFTER, * NOTE: It's no coincidence that we're checking this BEFORE any pending traps, because in rare
* just in case the last instruction threw an exception that kicked us out before we reached the bottom * cases (including some presented by those pesky "TRAP TEST" diagnostics), the process of dispatching
* of the stepCPU() loop. * 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.
* Note: I've swapped the order (priority) of the TF and SP traps, based on the PDP-11/20 Handbook.
* TODO: Determine if 1) the 11/20 Handbook was wrong, or 2) the 11/70 really has different priorities.
*/ */
if (this.opFlags & PDP11.OPFLAG.TRAP_MASK) { if ((this.opFlags & (PDP11.OPFLAG.INTQ_MASK | PDP11.OPFLAG.WAIT)) /* && nDebugState >= 0 */) {
if (this.opFlags & PDP11.OPFLAG.TRAP_MMU) {
this.trap(PDP11.TRAP.MMU, PDP11.OPFLAG.TRAP_MMU, PDP11.REASON.TRAPMMU);
}
else if (this.opFlags & PDP11.OPFLAG.TRAP_TF) {
this.trap(PDP11.TRAP.BPT, PDP11.OPFLAG.TRAP_TF, PDP11.REASON.TRAPTF);
}
else if (this.opFlags & PDP11.OPFLAG.TRAP_SP) {
this.trap(PDP11.TRAP.BUS_ERROR, PDP11.OPFLAG.TRAP_SP, PDP11.REASON.TRAPSP);
}
}
/*
* If we're in the INTQ or WAIT state, see if any interrupts can kick us out of that state.
*
* By also requiring nMinCycles to be non-zero before checking the interrupt queue, we avoid
* interrupting the natural flow of instructions whenever the Debugger is stepping through code.
*/
if ((this.opFlags & (PDP11.OPFLAG.INTQ_SPL | PDP11.OPFLAG.INTQ | PDP11.OPFLAG.WAIT)) /*&& nMinCycles*/) {
if (this.checkInterrupts()) { if (this.checkInterrupts()) {
/* /*
* Since an interrupt was just dispatched, altering the normal flow of time and changing * Since an interrupt was just dispatched, altering the normal flow of time and changing
* the future as we knew it, let's break out immediately if we're single-stepping, so that * the future as we knew it, let's break out immediately if we're single-stepping, so that
* the Debugger gets to see the first instruction of the interrupt handler. * the Debugger gets to see the first instruction of the interrupt handler. NOTE: This
* assumes that we've still commented out the nDebugState check above that used to bypass
* checkInterrupts() when single-stepping.
*/ */
if (nDebugState < 0) break; if (nDebugState < 0) break;
} }
} }
/*
* Next, check for any pending traps (which, as noted above, must be done after checkInterrupts()).
*
* I've moved this TRAP_MASK check BEFORE we decode the next instruction instead of immediately AFTER,
* just in case the last instruction threw an exception that kicked us out before we reached the bottom
* of the stepCPU() loop.
*/
if (this.opFlags & PDP11.OPFLAG.TRAP_MASK) {
if (this.checkTraps()) {
if (nDebugState < 0) break;
}
}
} }
/* /*

View file

@ -431,7 +431,7 @@ if (DEBUGGER) {
DebuggerPDP11.OPNONE = [DebuggerPDP11.OPS.NONE]; DebuggerPDP11.OPNONE = [DebuggerPDP11.OPS.NONE];
/* /*
* Table of opcodes that are specific to the 11/45 and higher * Table of opcodes specific to the 11/45 and newer
*/ */
DebuggerPDP11.OP1145 = [ DebuggerPDP11.OP1145 = [
DebuggerPDP11.OPS.MARK, DebuggerPDP11.OPS.MARK,
@ -1220,7 +1220,7 @@ if (DEBUGGER) {
if (this.sMessagePrev && sMessage == this.sMessagePrev) return; if (this.sMessagePrev && sMessage == this.sMessagePrev) return;
this.sMessagePrev = sMessage; this.sMessagePrev = sMessage;
if ((this.bitsMessage & MessagesPDP11.HALT) && this.cpu && this.cpu.isRunning()) { if ((this.bitsMessage & MessagesPDP11.HALT) && this.cpu && this.cpu.isRunning() || this.isBusy(true)) {
this.stopCPU(); this.stopCPU();
sMessage += " (cpu halted)"; sMessage += " (cpu halted)";
} }
@ -1399,9 +1399,9 @@ if (DEBUGGER) {
var trapStatus = this.cpu.getTrapStatus(); var trapStatus = this.cpu.getTrapStatus();
if (trapStatus) { if (trapStatus) {
var trapReason = trapStatus >> 8; var reason = trapStatus >> 8;
var sReason = trapReason? (" (" + trapReason + ")") : ""; var sReason = reason < 0? PDP11.REASONS[-reason] : this.toStrBase(reason);
this.println("trapped to " + this.toStrBase(trapStatus & 0xff, 1) + sReason); this.println("trapped to " + this.toStrBase(trapStatus & 0xff, 1) + " (" + sReason + ")");
} }
this.dbgAddrNextCode = this.newAddr(this.cpu.getPC()); this.dbgAddrNextCode = this.newAddr(this.cpu.getPC());
@ -2984,10 +2984,10 @@ if (DEBUGGER) {
* *
* Besides, it's nice for "db" and "dw" to generate the same Bus activity that typical byte and word reads do. * Besides, it's nice for "db" and "dw" to generate the same Bus activity that typical byte and word reads do.
*/ */
var i, n; var i = nBytesPerLine;
var data = 0, shift = 0; var data = 0, shift = 0;
for (i = nBytesPerLine; i > 0 && nBytes > 0; i -= n, nBytes -= n) { while (i > 0 && nBytes > 0) {
n = 1; var n = 1;
var v = size == 1? this.getByte(dbgAddr, n) : this.getWord(dbgAddr, (n = 2)); var v = size == 1? this.getByte(dbgAddr, n) : this.getWord(dbgAddr, (n = 2));
data |= (v << (shift << 3)); data |= (v << (shift << 3));
shift += n; shift += n;
@ -3001,7 +3001,12 @@ if (DEBUGGER) {
} }
data = shift = 0; data = shift = 0;
} }
sChars += (v >= 32 && v < 128? String.fromCharCode(v) : '.'); i -= n; nBytes -= n;
while (n--) {
var c = v & 0xff;
sChars += (c >= 32 && c < 128? String.fromCharCode(c) : '.');
v >>= 8;
}
} }
if (sDump) sDump += "\n"; if (sDump) sDump += "\n";
if (fJSON) { if (fJSON) {

View file

@ -82,7 +82,7 @@ var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined');
* MEMFAULT forces the Memory interfaces to signal a CPU fault when a word is accessed using an odd (unaligned) address. * MEMFAULT forces the Memory interfaces to signal a CPU fault when a word is accessed using an odd (unaligned) address.
* *
* Since PDPjs inherited its Bus component from PCx86, it included support for both aligned and unaligned word accesses * Since PDPjs inherited its Bus component from PCx86, it included support for both aligned and unaligned word accesses
* by default. However, the PDP-11 adds a wrinkle: when an odd address is used to access a memory word, a BUS_ERROR trap * by default. However, the PDP-11 adds a wrinkle: when an odd address is used to access a memory word, a BUS trap
* must be generated. Note that odd IOPAGE word accesses are fine; this only affects the Memory component. * must be generated. Note that odd IOPAGE word accesses are fine; this only affects the Memory component.
* *
* When the MMU is enabled, these checks may also be performed at a higher level, eliminating the need for them at the * When the MMU is enabled, these checks may also be performed at a higher level, eliminating the need for them at the
@ -161,19 +161,19 @@ var PDP11 = {
* Processor Status flag definitions (stored in regPSW) * Processor Status flag definitions (stored in regPSW)
*/ */
PSW: { PSW: {
CF: 0x0001, // bit 0: Carry Flag CF: 0x0001, // bit 0 (000001) Carry Flag
VF: 0x0002, // bit 1: Overflow Flag (aka OF on Intel processors) VF: 0x0002, // bit 1 (000002) Overflow Flag (aka OF on Intel processors)
ZF: 0x0004, // bit 2: Zero Flag ZF: 0x0004, // bit 2 (000004) Zero Flag
NF: 0x0008, // bit 3: Negative Flag (aka SF -- Sign Flag -- on Intel processors) NF: 0x0008, // bit 3 (000010) Negative Flag (aka SF -- Sign Flag -- on Intel processors)
TF: 0x0010, // bit 4: Trap Flag TF: 0x0010, // bit 4 (000020) Trap Flag
PRI: 0x00E0, // bits 5-7: Priority PRI: 0x00E0, // bits 5-7 (000340) Priority
UNUSED: 0x0700, // bits 8-10: unused UNUSED: 0x0700, // bits 8-10 (003400) UNUSED
/* /*
* PSW bits above this point are unused on 11/20-class machines * PSW bits above this point are unused on 11/20-class machines
*/ */
REGSET: 0x0800, // bit 11: Register Set ( REGSET: 0x0800, // bit 11 (004000) Register Set
PMODE: 0x3000, // bits 12-13: Prev Mode (see PDP11.MODE) PMODE: 0x3000, // bits 12-13 (030000) Prev Mode (see PDP11.MODE)
CMODE: 0xC000, // bits 14-15: Curr Mode (see PDP11.MODE) CMODE: 0xC000, // bits 14-15 (140000) Curr Mode (see PDP11.MODE)
SHIFT: { SHIFT: {
CF: 0, CF: 0,
VF: 1, VF: 1,
@ -197,13 +197,14 @@ var PDP11 = {
* Internal operation state flags * Internal operation state flags
*/ */
OPFLAG: { OPFLAG: {
INTQ_SPL: 0x01, // INTQ triggered by SPL INTQ_DELAY: 0x01, // set INTQ on next check (set by SPL and traps)
INTQ: 0x02, // call checkInterrupts() INTQ: 0x02, // call checkInterrupts()
INTQ_MASK: 0x03,
WAIT: 0x04, // WAIT operation in progress 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: 0x08, // set if last operation was a trap (see trapLast for the vector, and trapReason for the reason)
TRAP_TF: 0x10, // aka PDP11.PSW.TF TRAP_TF: 0x10, // aka PDP11.PSW.TF
TRAP_MMU: 0x20, TRAP_SP: 0x20, // set for a deferred BUS trap (due to a "yellow" stack overflow condition)
TRAP_SP: 0x40, // set for a deferred BUS_ERROR trap (due to a "yellow" stack overflow condition) TRAP_MMU: 0x40,
TRAP_MASK: 0x70, TRAP_MASK: 0x70,
NO_FLAGS: 0x80, // set whenever the PSW is written directly, requiring all updateXXXFlags() functions to leave flags unchanged NO_FLAGS: 0x80, // set whenever the PSW is written directly, requiring all updateXXXFlags() functions to leave flags unchanged
PRESERVE: 0x07 // OPFLAG bits to preserve prior to the next instruction PRESERVE: 0x07 // OPFLAG bits to preserve prior to the next instruction
@ -250,7 +251,7 @@ var PDP11 = {
*/ */
TRAP: { TRAP: {
UNDEFINED: 0x00, // 000 (reserved) UNDEFINED: 0x00, // 000 (reserved)
BUS_ERROR: 0x04, // 004 illegal instruction, unaligned address, invalid memory, stack limit, microbreak BUS: 0x04, // 004 unaligned address, non-existent memory, illegal instruction, etc
RESERVED: 0x08, // 010 reserved instructions RESERVED: 0x08, // 010 reserved instructions
BPT: 0x0C, // 014 BPT: breakpoint trap (trace) BPT: 0x0C, // 014 BPT: breakpoint trap (trace)
IOT: 0x10, // 020 IOT: input/output trap IOT: 0x10, // 020 IOT: input/output trap
@ -261,28 +262,32 @@ var PDP11 = {
MMU: 0xA8 // 250 MMU: aborts and traps MMU: 0xA8 // 250 MMU: aborts and traps
}, },
/* /*
* PDP-11 trap reasons (for diagnostic purposes only) * PDP-11 trap reasons; the reason may also be a non-negative address indicating a BUS memory error
* (unaligned address or non-existent memory). Any reason >= RED (which includes BUS memory errors) generate
* immediate (thrown) traps; the rest generate synchronous traps.
*/ */
REASON: { REASON: {
BPT: -1, ABORT: -1, // immediate MMU fault
EMT: -2, ILLEGAL: -2, // immediate invalid opcode (BUS)
HALT: -3, RED: -3, // immediate stack overflow fault (BUS)
IOT: -4, YELLOW: -4, // deferred stack overflow fault (BUS)
TRAP: -5, FAULT: -5, // deferred MMU fault
RESERVED: -6, TRACE: -6, // deferred TF fault (BPT)
TRAPMMU: -7, HALT: -7, // illegal HALT (BUS)
TRAPSP: -8, OPCODE: -8, // opcode-generated trap (eg, BPT, EMT, IOT, TRAP, or RESERVED opcode)
TRAPTF: -9, INTERRUPT: -9, // device-generated trap (vector is device-specific)
ODDMEMADDR: -10,
NOMEMORY: -11,
ODDMMUADDR: -12,
MAPERROR: -13,
PUSHERROR: -14,
NOREGADDR: -15,
STACKMODE1: -16,
STACKERROR: -17,
INTERRUPT: -18
}, },
REASONS: [
"ABORT",
"ILLEGAL",
"RED",
"YELLOW",
"FAULT",
"TRACE",
"HALT",
"OPCODE",
"INTERRUPT"
],
/* /*
* Internal memory access flags * Internal memory access flags
*/ */

View file

@ -243,19 +243,7 @@ DevicePDP11.prototype.readMMR1 = function(addr)
*/ */
DevicePDP11.prototype.readMMR2 = function(addr) DevicePDP11.prototype.readMMR2 = function(addr)
{ {
return this.cpu.regMMR2; return this.cpu.getMMR2();
};
/**
* writeMMR2(data, addr)
*
* @this {DevicePDP11}
* @param {number} data
* @param {number} addr (eg, PDP11.UNIBUS.MMR2 or 177576)
*/
DevicePDP11.prototype.writeMMR2 = function(data, addr)
{
this.cpu.regMMR2 = data;
}; };
/** /**

View file

@ -287,6 +287,7 @@ PC11.prototype.initBus = function(cmp, bus, cpu, dbg)
}); });
bus.addIOTable(this, PC11.UNIBUS_IOTABLE); bus.addIOTable(this, PC11.UNIBUS_IOTABLE);
bus.addResetHandler(this.reset.bind(this));
this.addTape("None", PC11.SOURCE.NONE, true); this.addTape("None", PC11.SOURCE.NONE, true);
if (this.fLocalTapes) this.addTape("Local Tape", PC11.SOURCE.LOCAL); if (this.fLocalTapes) this.addTape("Local Tape", PC11.SOURCE.LOCAL);

View file

@ -283,6 +283,7 @@ RL11.prototype.initBus = function(cmp, bus, cpu, dbg)
this.triggerInterrupt = this.cpu.addTrigger(PDP11.RL11.VEC, PDP11.RL11.PRI); this.triggerInterrupt = this.cpu.addTrigger(PDP11.RL11.VEC, PDP11.RL11.PRI);
bus.addIOTable(this, RL11.UNIBUS_IOTABLE, MessagesPDP11.DISK); bus.addIOTable(this, RL11.UNIBUS_IOTABLE, MessagesPDP11.DISK);
bus.addResetHandler(this.reset.bind(this));
this.addDisk("None", RL11.SOURCE.NONE, true); this.addDisk("None", RL11.SOURCE.NONE, true);
if (this.fLocalDisks) this.addDisk("Local Disk", RL11.SOURCE.LOCAL); if (this.fLocalDisks) this.addDisk("Local Disk", RL11.SOURCE.LOCAL);

View file

@ -312,6 +312,8 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg)
}); });
bus.addIOTable(this, SerialPortPDP11.UNIBUS_IOTABLE); bus.addIOTable(this, SerialPortPDP11.UNIBUS_IOTABLE);
bus.addResetHandler(this.reset.bind(this));
this.setReady(); this.setReady();
}; };
@ -655,10 +657,10 @@ SerialPortPDP11.prototype.readXCSR = function(addr)
SerialPortPDP11.prototype.writeXCSR = function(data, addr) SerialPortPDP11.prototype.writeXCSR = function(data, addr)
{ {
/* /*
* If the device is READY, and IE is transitioning on, then request an interrupt. * If the device is READY, and TIE is being set, then request an interrupt.
*/ */
if ((this.xcsr & (PDP11.DL11.XCSR.READY | PDP11.DL11.XCSR.TIE)) == PDP11.DL11.XCSR.READY && (data & PDP11.DL11.XCSR.TIE)) { if ((this.xcsr & PDP11.DL11.XCSR.READY) && (data & PDP11.DL11.XCSR.TIE)) {
this.cpu.setTimer(this.timerTransmitInterrupt, this.getBaudTimeout(this.nBaudTransmit)); this.cpu.setTrigger(this.triggerTransmitInterrupt);
} }
this.xcsr = (this.xcsr & ~PDP11.DL11.XCSR.WMASK) | (data & PDP11.DL11.XCSR.WMASK); this.xcsr = (this.xcsr & ~PDP11.DL11.XCSR.WMASK) | (data & PDP11.DL11.XCSR.WMASK);
}; };
@ -688,6 +690,11 @@ SerialPortPDP11.prototype.writeXBUF = function(data, addr)
if (data) { if (data) {
this.transmitByte(data); this.transmitByte(data);
this.xcsr &= ~PDP11.DL11.XCSR.READY; 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)); this.cpu.setTimer(this.timerTransmitInterrupt, this.getBaudTimeout(this.nBaudTransmit));
} }
}; };

View file

@ -64,10 +64,10 @@
} }
.pcjs-progress-bar { .pcjs-progress-bar {
height: 20px; height: 20px;
width: 0%; /* this will be updated pragmatically */ width: 0; /* this will be updated pragmatically */
background-color: gold; background-color: gold;
position: absolute; position: absolute;
top: 0px; top: 0;
} }
.pcjs-progress-text { .pcjs-progress-text {
height: 20px; height: 20px;
@ -76,7 +76,7 @@
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
position: absolute; position: absolute;
top: 0px; top: 0;
z-index: 1; z-index: 1;
} }
.pcjs-register { .pcjs-register {
@ -192,7 +192,7 @@
.pcjs-switch { .pcjs-switch {
height: 10px; height: 10px;
width: 28px; width: 28px;
margin-top: 0%; margin-top: 0;
max-width: 90%; max-width: 90%;
background-color: #00ff00; background-color: #00ff00;
} }
@ -234,9 +234,15 @@
} }
.pcjs-registers { .pcjs-registers {
width: 100% !important; width: 100% !important;
max-width: none !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
.pdp11-device { .pdp11-device {
width: 100% !important; width: 98% !important;
max-width: none !important; max-width: none !important;
margin-left: 8px !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
} }

View file

@ -59,10 +59,10 @@
} }
.pcjs-progress-bar { .pcjs-progress-bar {
height: 20px; height: 20px;
width: 0%; width: 0;
background-color: gold; background-color: gold;
position: absolute; position: absolute;
top: 0px; top: 0;
} }
.pcjs-progress-text { .pcjs-progress-text {
height: 20px; height: 20px;
@ -71,7 +71,7 @@
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
position: absolute; position: absolute;
top: 0px; top: 0;
z-index: 1; z-index: 1;
} }
.pcjs-register { .pcjs-register {
@ -187,7 +187,7 @@
.pcjs-switch { .pcjs-switch {
height: 10px; height: 10px;
width: 28px; width: 28px;
margin-top: 0%; margin-top: 0;
max-width: 90%; max-width: 90%;
background-color: #00ff00; background-color: #00ff00;
} }
@ -229,9 +229,15 @@
} }
.pcjs-registers { .pcjs-registers {
width: 100% !important; width: 100% !important;
max-width: none !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
.pdp11-device { .pdp11-device {
width: 100% !important; width: 98% !important;
max-width: none !important; max-width: none !important;
margin-left: 8px !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
} }

View file

@ -59,10 +59,10 @@
} }
.pcjs-progress-bar { .pcjs-progress-bar {
height: 20px; height: 20px;
width: 0%; width: 0;
background-color: gold; background-color: gold;
position: absolute; position: absolute;
top: 0px; top: 0;
} }
.pcjs-progress-text { .pcjs-progress-text {
height: 20px; height: 20px;
@ -71,7 +71,7 @@
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
position: absolute; position: absolute;
top: 0px; top: 0;
z-index: 1; z-index: 1;
} }
.pcjs-register { .pcjs-register {
@ -187,7 +187,7 @@
.pcjs-switch { .pcjs-switch {
height: 10px; height: 10px;
width: 28px; width: 28px;
margin-top: 0%; margin-top: 0;
max-width: 90%; max-width: 90%;
background-color: #00ff00; background-color: #00ff00;
} }
@ -229,9 +229,15 @@
} }
.pcjs-registers { .pcjs-registers {
width: 100% !important; width: 100% !important;
max-width: none !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
.pdp11-device { .pdp11-device {
width: 100% !important; width: 98% !important;
max-width: none !important; max-width: none !important;
margin-left: 8px !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
} }

View file

@ -59,10 +59,10 @@
} }
.pcjs-progress-bar { .pcjs-progress-bar {
height: 20px; height: 20px;
width: 0%; width: 0;
background-color: gold; background-color: gold;
position: absolute; position: absolute;
top: 0px; top: 0;
} }
.pcjs-progress-text { .pcjs-progress-text {
height: 20px; height: 20px;
@ -71,7 +71,7 @@
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
position: absolute; position: absolute;
top: 0px; top: 0;
z-index: 1; z-index: 1;
} }
.pcjs-register { .pcjs-register {
@ -187,7 +187,7 @@
.pcjs-switch { .pcjs-switch {
height: 10px; height: 10px;
width: 28px; width: 28px;
margin-top: 0%; margin-top: 0;
max-width: 90%; max-width: 90%;
background-color: #00ff00; background-color: #00ff00;
} }
@ -229,9 +229,15 @@
} }
.pcjs-registers { .pcjs-registers {
width: 100% !important; width: 100% !important;
max-width: none !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
.pdp11-device { .pdp11-device {
width: 100% !important; width: 98% !important;
max-width: none !important; max-width: none !important;
margin-left: 8px !important;
padding-left: 0 !important;
padding-right: 0 !important;
} }
} }

View file

@ -40,282 +40,283 @@ function wa(a,b){return(a+" ").slice(0,b)
function za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Aa=Date.now||function(){return+new Date};function Ba(){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 za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Aa=Date.now||function(){return+new Date};function Ba(){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 Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
function Ea(a,b){var c,d={da:null,ga:null,Ka:null,Ja: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.Ka=g.load;d.Ja=g.exec;if(e=g.bytes)d.da=e;else if(e=g.words)for(d.da=Array(2*e.length),f=c=0;c<e.length;c++)d.da[f++]=e[c]&255,d.da[f++]=e[c]>>8&255;else if(e=g.data)for(d.da=Array(4*e.length),f=c=0;c<e.length;c++)d.da[f++]= function Ea(a,b){var c,d={da:null,ga:null,La:null,Ka: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.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.da=e;else if(e=g.words)for(d.da=Array(2*e.length),f=c=0;c<e.length;c++)d.da[f++]=e[c]&255,d.da[f++]=e[c]>>8&255;else if(e=g.data)for(d.da=Array(4*e.length),f=c=0;c<e.length;c++)d.da[f++]=
e[c]&255,d.da[f++]=e[c]>>8&255,d.da[f++]=e[c]>>16&255,d.da[f++]=e[c]>>24&255;else d.da=g;d.ga=g.symbols;d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.da=e)}return d} e[c]&255,d.da[f++]=e[c]>>8&255,d.da[f++]=e[c]>>16&255,d.da[f++]=e[c]>>24&255;else d.da=g;d.ga=g.symbols;d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.da=e)}return d}
function Fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;function Ia(){if(null==Ha){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ha=a}return Ha} function Fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;function Ia(){if(null==Ha){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ha=a}return Ha}
function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Qa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Sa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()} function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Qa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Sa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Ta(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ua={init:[],show:[],exit:[]},Va=!1,Wa=!1,Xa=!0;function Ya(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Za(a){Ua.init.push(a)} function Ta(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ua={init:[],show:[],exit:[]},Va=!1,Wa=!1,Xa=!0;function Ya(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Za(a){Ua.init.push(a)}
function $a(a){if(Xa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function ab(a){!Xa&&a?(Xa=!0,Va&&bb("init"),Wa&&bb("show")):Xa=a}function bb(a){Ua[a]&&$a(Ua[a])}Ya("onload",function(){Va=!0;$a(Ua.init)});Ya("onpageshow",function(){Wa=!0;$a(Ua.show)});Ya(Ra("Opera")||Ra("iOS")?"onunload":"onbeforeunload",function(){$a(Ua.exit)}); function $a(a){if(Xa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function ab(a){!Xa&&a?(Xa=!0,Va&&bb("init"),Wa&&bb("show")):Xa=a}function bb(a){Ua[a]&&$a(Ua[a])}Ya("onload",function(){Va=!0;$a(Ua.init)});Ya("onpageshow",function(){Wa=!0;$a(Ua.show)});Ya(Ra("Opera")||Ra("iOS")?"onunload":"onbeforeunload",function(){$a(Ua.exit)});
function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.tc=b.comment;this.Vc=b;b=this.id.indexOf(".");0>b?this.Ya=this.id:(this.Qa=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.w={ready:!1,ab:!1,ac:!1,ha:!1,error:!1};this.Rb=null;this.w.error=!1;this.G={};this.i=null;this.ma=d||0;u.push(this)}var cb=void 0,db={}; function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.vc=b.comment;this.Yc=b;b=this.id.indexOf(".");0>b?this.Za=this.id:(this.Qa=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.w={ready:!1,ab:!1,$b:!1,ha:!1,error:!1};this.Sb=null;this.w.error=!1;this.G={};this.i=null;this.ma=d||0;u.push(this)}var cb=void 0,db={};
if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function ob(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function ob(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function z(a,b){b||(b=t);a.prototype=ob(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var pb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else pb={},u=[];function qb(a,b,c){pb[a]&&b&&(pb[a][b]=c)}function rb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c} function z(a,b){b||(b=t);a.prototype=ob(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var pb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else pb={},u=[];function qb(a,b,c){pb[a]&&b&&(pb[a][b]=c)}function rb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function sb(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}function tb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b} function sb(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}function tb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
function B(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=A(f))&&g.binding&&a.ra(g.type,g.binding,f,g.value),l=h.length}}}} function B(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=A(f))&&g.binding&&a.sa(g.type,g.binding,f,g.value),l=h.length}}}}
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c} function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
t.prototype={constructor:t,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ra:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Ra=this.G[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c), t.prototype={constructor:t,parent:null,toString:function(){return this.name?this.name:this.id||this.type},sa:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Sa=this.G[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.P=function(a){this.j(a,this.Ya)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Ya+": "+a)},P:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ga:function(){return this.w.ha=!0},Fa:function(a,b){b&&(this.w.ha=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.ma;var c=a.i.ma&b;return!!b&&c===b||!!(c&a.i.Oc)}return!1} this.P=function(a){this.j(a,this.Za)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Za+": "+a)},P:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ga:function(){return this.w.ha=!0},Fa:function(a,b){b&&(this.w.ha=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.ma;var c=a.i.ma&b;return!!b&&c===b||!!(c&a.i.Qc)}return!1}
function ub(a,b){if(a.w.ac)return a.w.ab=!1,a.w.ac=!1;if(a.w.error)return a.j(a.toString()+" error"),!1;a.w.ab=b;return a.w.ab}function vb(a,b){a.w.ab&&(b?a.w.ac=!0:void 0===b&&a.j(a.toString()+" busy"));return a.w.ab}function H(a,b){a.w.error||(a.w.ready=!1!==b,a.w.ready&&(b=a.Rb,a.Rb=null,b&&b()))}function wb(a,b){b&&(a.w.ready?b():a.Rb=b);return a.w.ready}function xb(a){return a.w.error?(a.j(a.toString()+" error"),!0):!1}function yb(a,b){a.w.error=!0;a.P(b)} function ub(a,b){if(a.w.$b)return a.w.ab=!1,a.w.$b=!1;if(a.w.error)return a.j(a.toString()+" error"),!1;a.w.ab=b;return a.w.ab}function vb(a,b){a.w.ab&&(b?a.w.$b=!0:void 0===b&&a.j(a.toString()+" busy"));return a.w.ab}function H(a,b){a.w.error||(a.w.ready=!1!==b,a.w.ready&&(b=a.Sb,a.Sb=null,b&&b()))}function wb(a,b){b&&(a.w.ready?b():a.Sb=b);return a.w.ready}function xb(a){return a.w.error?(a.j(a.toString()+" error"),!0):!1}function yb(a,b){a.w.error=!0;a.P(b)}
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b}); Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
var zb="undefined"!==typeof ArrayBuffer,Ab={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,keyboard:65536,key:131072,paper:1048576,disk:4194304,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648}; var zb="undefined"!==typeof ArrayBuffer,Ab="ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Bb={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,keyboard:65536,key:131072,paper:1048576,disk:4194304,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
function Bb(a){t.call(this,"Panel",a,Bb);this.f=this.A=this.Va=this.D=this.J=this.H=0;this.L=this.M=this.I=!1;this.O=Cb;this.B={};this.g={START:[1,1,!0,!1,this.ed],STEP:[1,1,!1,!1,this.fd],ENABLE:[1,1,!1,!1,this.ad],CONT:[1,1,!0,!1,this.Zc],DEP:[0,0,!0,!1,this.$c],EXAM:[1,1,!0,!1,this.bd],LOAD:[1,1,!0,!1,this.dd],TEST:[0,0,!0,!1,this.cd]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.gd,a]}z(Bb);var Cb=7;function Db(a,b){return a.g[b]&&a.g[b][1]}k=Bb.prototype;k.reset=function(){this.stop()}; function Cb(a){t.call(this,"Panel",a,Cb);this.f=this.A=this.Wa=this.D=this.J=this.H=0;this.L=this.M=this.I=!1;this.O=Db;this.B={};this.g={START:[1,1,!0,!1,this.fd],STEP:[1,1,!1,!1,this.gd],ENABLE:[1,1,!1,!1,this.bd],CONT:[1,1,!0,!1,this.$c],DEP:[0,0,!0,!1,this.ad],EXAM:[1,1,!0,!1,this.cd],LOAD:[1,1,!0,!1,this.ed],TEST:[0,0,!0,!1,this.dd]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.hd,a]}z(Cb);var Db=7;function Eb(a,b){return a.g[b]&&a.g[b][1]}k=Cb.prototype;k.reset=function(){this.stop()};
k.ra=function(a,b,c,d){if(this.C&&this.C.ra(a,b,c,d)||this.b&&this.b.ra(a,b,c,d)||this.i&&this.i.ra(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.H++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.B[b]=d?1:0,this.H++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, k.sa=function(a,b,c,d){if(this.C&&this.C.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.H++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.B[b]=d?1:0,this.H++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
b){return function(){Eb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Fb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Eb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Fb(a,b)}}(this,b),!0):this.parent.ra.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Gb(b,this,Hb);Ib(b,this.reset.bind(this));Jb(this);Kb(this)};k.Ga=function(a,b){b||(Lb(),this.reset());return!0};k.Fa=function(){return!0}; b){return function(){Fb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Gb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Fb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Gb(a,b)}}(this,b),!0):this.parent.sa.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Hb(b,this,Ib);Jb(b,this.reset.bind(this));Kb(this);Lb(this)};k.Ga=function(a,b){b||(Mb(),this.reset());return!0};k.Fa=function(){return!0};
function Mb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Jb(a,b){for(var c in a.B)Mb(a,c,null!=b?b:a.B[c])}function $b(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Kb(a){for(var b in a.g)$b(a,b,a.g[b][1])}function ac(a,b,c,d){a.G[b]&&(void 0===c&&(yb(a,"Value for "+b+" is invalid"),a.b.fa()),c=8==(a.i&&a.i.ca||8)?qa(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} function Nb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Kb(a,b){for(var c in a.B)Nb(a,c,null!=b?b:a.B[c])}function Ob(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Lb(a){for(var b in a.g)Ob(a,b,a.g[b][1])}function ac(a,b,c,d){a.G[b]&&(void 0===c&&(yb(a,"Value for "+b+" is invalid"),a.b.fa()),c=8==(a.i&&a.i.ca||8)?qa(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}
function Eb(a,b){var c=a.g[b];$b(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.L="DEP"==b,a.M="EXAM"==b)}function Fb(a,b){var c=a.g[b];c[2]&&c[3]&&($b(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.ed=function(a){a||this.b.w.W||(this.v.reset(),bc(this.b),Db(this,"ENABLE")&&this.b.ib())};k.fd=function(){};k.ad=function(a){a||this.b.fa()}; function Fb(a,b){var c=a.g[b];Ob(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.L="DEP"==b,a.M="EXAM"==b)}function Gb(a,b){var c=a.g[b];c[2]&&c[3]&&(Ob(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.fd=function(a){a||this.b.w.W||(this.v.reset(),bc(this.b),Eb(this,"ENABLE")&&this.b.hb())};k.gd=function(){};k.bd=function(a){a||this.b.fa()};
k.Zc=function(a){if(!a&&!this.b.w.W)if(Db(this,"ENABLE"))this.b.ib();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.jb(0),ub(a,!1);else try{var b=this.b.jb(1);0<b&&(cc(this.b,b),dc(this.b,b,!0),ec(this.b,b))}catch(c){"number"!=typeof c&&yb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.oa()}};k.$c=function(a){a&&!this.b.w.W&&(this.L&&fc(this),a=gc(this,this.Va),this.O==Cb?this.v.Bb(this.f,a):this.b.Bb(this.f,a))}; k.$c=function(a){if(!a&&!this.b.w.W)if(Eb(this,"ENABLE"))this.b.hb();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.ib(0),ub(a,!1);else try{var b=this.b.ib(1);0<b&&(cc(this.b,b),dc(this.b,b,!0),ec(this.b,b))}catch(c){"number"!=typeof c&&yb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.oa()}};k.ad=function(a){a&&!this.b.w.W&&(this.L&&fc(this),a=gc(this,this.Wa),this.O==Db?this.v.Bb(this.f,a):this.b.Bb(this.f,a))};
k.bd=function(a){a||this.b.w.W||(this.M&&fc(this),a=this.O==Cb?this.v.bb(this.f):this.b.bb(this.f),gc(this,a))};k.dd=function(a){a||this.b.w.W||hc(this,this.Va)};k.cd=function(a){a?(this.I=!0,Jb(this,!0)):(this.I=!1,Jb(this),ic(this,0))};k.gd=function(a,b){this.Va=a?this.Va|1<<b:this.Va&~(1<<b)};function fc(a){var b=1145>a.b.cb?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Ma;Db(a,"STEP")||(b=-b);hc(a,a.f&~c|a.f+b&c)} k.cd=function(a){a||this.b.w.W||(this.M&&fc(this),a=this.O==Db?this.v.bb(this.f):this.b.bb(this.f),gc(this,a))};k.ed=function(a){a||this.b.w.W||hc(this,this.Wa)};k.dd=function(a){a?(this.I=!0,Kb(this,!0)):(this.I=!1,Kb(this),ic(this,0))};k.hd=function(a,b){this.Wa=a?this.Wa|1<<b:this.Wa&~(1<<b)};function fc(a){var b=1145>a.b.cb?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Na;Eb(a,"STEP")||(b=-b);hc(a,a.f&~c|a.f+b&c)}
function hc(a,b){a.f=b&a.v.Ma;b=a.f;for(var c=0;22>c;c++)jc(a,"A"+c,b&1<<c)}function gc(a,b){a.A=b&65535;b=a.A;for(var c=0;16>c;c++)jc(a,"D"+c,b&1<<c);return a.A}function jc(a,b,c){a.B[b]=c;a.I||Mb(a,b,c)}function kc(a){return void 0!==a.G.S0}function ic(a,b){if(kc(a)){a.Va=b;for(var c=0;22>c;c++)a.g["S"+c][1]=b&1<<c?1:0;Kb(a)}}k.stop=function(){hc(this,this.b.u[7])};k.lc=function(a){this.f=a};k.setData=function(a,b){b?this.D=a:this.A=a};k.hd=function(a){return(a?this.Va:this.D)&65535}; function hc(a,b){a.f=b&a.v.Na;b=a.f;for(var c=0;22>c;c++)jc(a,"A"+c,b&1<<c)}function gc(a,b){a.A=b&65535;b=a.A;for(var c=0;16>c;c++)jc(a,"D"+c,b&1<<c);return a.A}function jc(a,b,c){a.B[b]=c;a.I||Nb(a,b,c)}function kc(a){return void 0!==a.G.S0}function ic(a,b){if(kc(a)){a.Wa=b;for(var c=0;22>c;c++)a.g["S"+c][1]=b&1<<c?1:0;Lb(a)}}k.stop=function(){hc(this,this.b.u[7])};k.kc=function(a){this.f=a};k.setData=function(a,b){b?this.D=a:this.A=a};k.kd=function(a){return(a?this.Wa:this.D)&65535};
k.ce=function(a){this.D=a};var lc={},Hb=(lc[65400]=[null,null,Bb.prototype.hd,Bb.prototype.ce,"CNSW"],lc);function Lb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=sb(e.id);f||(a=!0,f=new Bb(e));B(f,d);a&&H(f)}}Za(Lb); k.ee=function(a){this.D=a};var lc={},Ib=(lc[65400]=[null,null,Cb.prototype.kd,Cb.prototype.ee,"CNSW"],lc);function Mb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=sb(e.id);f||(a=!0,f=new Cb(e));B(f,d);a&&H(f)}}Za(Mb);
function mc(a,b,c){t.call(this,"Bus",a,mc,64);this.b=b;this.i=c;this.J=a.busWidth||16;this.C=0;this.B=[];this.g=null;this.H=1<<this.J;this.Ma=this.H-1;this.ya=nc;this.ja=Math.log2(this.ya);this.I=this.ya>>2;this.v=this.ya-1;this.D=this.H/this.ya|0;this.$a=[];this.la=0;this.f=!1;this.cc=0;this.A=[];this.Lc=[oc,pc,qc,rc];a=new I(this);sc(a,this.i);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(mc);var nc=8192,tc=nc-1; function mc(a,b,c){t.call(this,"Bus",a,mc,64);this.b=b;this.i=c;this.J=a.busWidth||16;this.C=0;this.B=[];this.g=null;this.H=1<<this.J;this.Na=this.H-1;this.za=nc;this.ja=Math.log2(this.za);this.I=this.za>>2;this.v=this.za-1;this.D=this.H/this.za|0;this.$a=[];this.la=0;this.f=!1;this.bc=0;this.A=[];this.Nc=[oc,pc,qc,rc];a=new I(this);sc(a,this.i);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(mc);var nc=8192,tc=nc-1;
function oc(a,b){var c=-1,d=this.controller,e=d.$a[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.$a[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} function oc(a,b){var c=-1,d=this.controller,e=d.$a[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.$a[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
function pc(a,b,c){var d=!1,e=this.controller,f=e.$a[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else if(g&1&&(f=e.$a[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,5),this.i&&F(this.i,f[5])&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i, function pc(a,b,c){var d=!1,e=this.controller,f=e.$a[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else if(g&1&&(f=e.$a[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,5),this.i&&F(this.i,f[5])&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,
b),!0,!e.la))}function qc(a,b){var c=-1,d=this.controller;a=d.$a[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} b),!0,!e.la))}function qc(a,b){var c=-1,d=this.controller;a=d.$a[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
function rc(a,b,c){var d=!1,e=this.controller;a=e.$a[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,4),this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} function rc(a,b,c){var d=!1,e=this.controller;a=e.$a[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,4),this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))}
function uc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-nc,vc(a,c,nc,a.B),a.C=0);b&&(a.C=b,c=1<<b,a.Ma=c-1,c-=nc,a.B=wc(a,c,nc),a.g?vc(a,c,nc,a.g):(xc(a,c,nc,yc,a),a.g=wc(a,c,nc)))}}k=mc.prototype;k.reset=function(){for(var a=0;a<this.A.length;a++)this.A[a]();uc(this,16)};k.Ga=function(a,b){b||this.reset();return!0}; function uc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-nc,vc(a,c,nc,a.B),a.C=0);b&&(a.C=b,c=1<<b,a.Na=c-1,c-=nc,a.B=wc(a,c,nc),a.g?vc(a,c,nc,a.g):(xc(a,c,nc,yc,a),a.g=wc(a,c,nc)))}}k=mc.prototype;k.reset=function(){for(var a=0;a<this.A.length;a++)this.A[a]();uc(this,16)};k.Ga=function(a,b){b||this.reset();return!0};
function xc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ja;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.ya,n=a.ya-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Mb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Mb){n=l.size-(f-m);n>g&&(n=g);l.Mb=f-l.F+n;f=m+a.ya;g-=n;h++;continue}}return zc(1,f,g)}f=new I(a,f,n,a.ya,d,e);sc(f,a.i,l);a.Y[h++]=f;f=m+a.ya;g-=n}return 0>=g?(d==Ac&&(a.cc+=c),a.status((c>>10)+"Kb "+Bc[d]+" at "+qa(b)),!0):zc(2,b,c)} function xc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ja;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.za,n=a.za-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Ob+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.F+n;f=m+a.za;g-=n;h++;continue}}return zc(1,f,g)}f=new I(a,f,n,a.za,d,e);sc(f,a.i,l);a.Y[h++]=f;f=m+a.za;g-=n}return 0>=g?(d==Ac&&(a.bc+=c),a.status((c>>10)+"Kb "+Bc[d]+" at "+qa(b)),!0):zc(2,b,c)}
function wc(a,b,c){var d=[];for(b>>>=a.ja;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.ya;return d}function vc(a,b,c,d){var e=0;for(b>>>=a.ja;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.ya}}k.Fb=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Ma)>>>this.ja].Vb(a&this.v,a)};k.Tb=function(a){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Ma)>>>this.ja].hc(a&this.v,a);this.la--;return a}; function wc(a,b,c){var d=[];for(b>>>=a.ja;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.za;return d}function vc(a,b,c,d){var e=0;for(b>>>=a.ja;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.za}}k.Hb=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].Vb(a&this.v,a)};k.Ub=function(a){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Na)>>>this.ja].gc(a&this.v,a);this.la--;return a};
k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Ma)>>>this.ja].qa(a&this.v,a)};k.bb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Ma)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].ic(b,a);this.la--;return a};k.Xb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Ma)>>>this.ja].Zb(a&this.v,b&255,a)};k.qb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Ma)>>>this.ja].$b(a&this.v,b&255,a);this.la--}; k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].ra(a&this.v,a)};k.bb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Na)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].hc(b,a);this.la--;return a};k.Ab=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Yb(a&this.v,b&255,a)};k.rb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Na)>>>this.ja].Zb(a&this.v,b&255,a);this.la--};
k.hb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Ma)>>>this.ja].Nb(a&this.v,b&65535,a)};k.Bb=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Ma)>>>this.ja;this.f=!1;this.la++;this.Y[d].nc(c,b&65535,a);this.la--}; k.gb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Pb(a&this.v,b&65535,a)};k.Bb=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Na)>>>this.ja;this.f=!1;this.la++;this.Y[d].mc(c,b&65535,a);this.la--};
function Dc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Sa||e.Rc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Kc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&tc;if(void 0!==a.$a[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.$a[m]=[d,e,f,g,l||"unknown",h,!1]}return!0} function Dc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Ta||e.Tc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Lc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&tc;if(void 0!==a.$a[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.$a[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
function Gb(a,b,c,d,e){for(var f in c){var g=+f,h=c[f];if(!(h[6]&&h[6]>a.b.cb)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y<r;y++,g+=2)if(w&&1<r&&(w=h[4]+y),!Kc(a,g,g,l,m,n,v,d||64,w||e))return!1}}return!0}function Ib(a,b){a.A.push(b)} function Hb(a,b,c,d,e){for(var f in c){var g=+f,h=c[f];if(!(h[6]&&h[6]>a.b.cb)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y<r;y++,g+=2)if(w&&1<r&&(w=h[4]+y),!Lc(a,g,g,l,m,n,v,d||64,w||e))return!1}}return!0}function Jb(a,b){a.A.push(b)}
k.Da=function(a,b,c){this.f=!0;this.la||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on address "+J(this.i,a),!0,!0),b&&(this.b.Ha|=b),this.b.sa(4,0,a))};function Lc(a){var b=a.f;a.f=!1;return b}function zc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={ea:0,mc:-1}}z(K);k=K.prototype; k.Da=function(a,b,c){this.f=!0;this.la||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on "+J(this.i,a),!0,!0),b&&(this.b.Ha|=b),this.b.ta(4,0,a))};function Mc(a){var b=a.f;a.f=!1;return b}function zc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={ea:0,lc:-1}}z(K);k=K.prototype;
k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.mc=Mc(c,function(){e.f.Gb|=128;e.f.Gb&64&&Nc(e.b,e.f.ae);e.C&&e.C.oa(1);Oc(e.b,e.f.mc,1E3/60)});this.f.ae=Pc(64,6);Gb(b,this,Qc);Ib(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.Gb=128;Oc(this.b,this.f.mc,1E3/60,!0)};k.qd=function(){return this.f.Gb};k.ke=function(a){this.f.Gb=a&192};k.sd=function(){var a=this.b;return a.D&62337|a.Na<<5|a.Za<<1}; k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.lc=Nc(c,function(){e.f.Jb|=128;e.f.Jb&64&&Oc(e.b,e.f.ce);e.C&&e.C.oa(1);Pc(e.b,e.f.lc,1E3/60)});this.f.ce=Qc(64,6);Hb(b,this,Rc);Jb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.Jb=128;Pc(this.b,this.f.lc,1E3/60,!0)};k.sd=function(){return this.f.Jb};k.me=function(a){this.f.Jb=a&192};k.ud=function(){var a=this.b;return a.J&62337|a.kb<<5|a.jb<<1};
k.me=function(a){var b=this.b;a&=62337;if(b.D!=a){b.D=a;b.Na=a>>5&3;b.Za=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Rc(b))}};k.td=function(){var a=this.b.fb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.ud=function(){return this.b.Kb};k.vd=function(){return this.b.pb};k.ne=function(a){var b=this.b;1170>b.cb&&(a&=-49);b.pb!=a&&(b.pb=a,b.Sb=a&16?4194303:262143,Rc(b))};k.Wd=function(a){a=a>>1&63;var b=this.b.Lb[a>>1];return a&1?b>>16:b&65535}; k.oe=function(a){var b=this.b;a&=62337;if(b.J!=a){b.J=a;b.kb=a>>5&3;b.jb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Va!=c&&(b.Va=c,Sc(b))}};k.vd=function(){var a=this.b;a.J&57344||(a.Ac=a.S&65535);a=a.Ac;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.wd=function(){var a=this.b;a.J&57344||(a.Bc=a.Ib);return a.Bc};k.xd=function(){return this.b.qb};k.pe=function(a){var b=this.b;1170>b.cb&&(a&=-49);b.qb!=a&&(b.qb=a,b.Ja=a&16?4194303:262143,Sc(b))};
k.Oe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Lb[c]=b&1?this.b.Lb[c]&65535|(a&63)<<16:this.b.Lb[c]&-65536|a&65534};k.Pd=function(a){return this.b.V[1][a>>1&7]};k.He=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Nd=function(a){return this.b.V[1][(a>>1&7)+8]};k.Fe=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Od=function(a){return this.b.xa[1][a>>1&7]};k.Ge=function(a,b){b=b>>1&7;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.Md=function(a){return this.b.xa[1][(a>>1&7)+8]}; k.Yd=function(a){a=a>>1&63;var b=this.b.Nb[a>>1];return a&1?b>>16:b&65535};k.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Nb[c]=b&1?this.b.Nb[c]&65535|(a&63)<<16:this.b.Nb[c]&-65536|a&65534};k.Rd=function(a){return this.b.V[1][a>>1&7]};k.Je=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Pd=function(a){return this.b.V[1][(a>>1&7)+8]};k.He=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Qd=function(a){return this.b.ya[1][a>>1&7]};k.Ie=function(a,b){b=b>>1&7;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};
k.Ee=function(a,b){b=(b>>1&7)+8;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.pd=function(a){return this.b.V[0][a>>1&7]};k.je=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.nd=function(a){return this.b.V[0][(a>>1&7)+8]};k.he=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.od=function(a){return this.b.xa[0][a>>1&7]};k.ie=function(a,b){b=b>>1&7;this.b.xa[0][b]=a;this.b.V[0][b]&=65295};k.md=function(a){return this.b.xa[0][(a>>1&7)+8]};k.ge=function(a,b){b=(b>>1&7)+8;this.b.xa[0][b]=a;this.b.V[0][b]&=65295}; k.Od=function(a){return this.b.ya[1][(a>>1&7)+8]};k.Ge=function(a,b){b=(b>>1&7)+8;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.rd=function(a){return this.b.V[0][a>>1&7]};k.le=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.pd=function(a){return this.b.V[0][(a>>1&7)+8]};k.je=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.qd=function(a){return this.b.ya[0][a>>1&7]};k.ke=function(a,b){b=b>>1&7;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.od=function(a){return this.b.ya[0][(a>>1&7)+8]};
k.Vd=function(a){return this.b.V[3][a>>1&7]};k.Ne=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Td=function(a){return this.b.V[3][(a>>1&7)+8]};k.Le=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Ud=function(a){return this.b.xa[3][a>>1&7]};k.Me=function(a,b){b=b>>1&7;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Sd=function(a){return this.b.xa[3][(a>>1&7)+8]};k.Ke=function(a,b){b=(b>>1&7)+8;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.zb=function(a){a&=7;return this.b.N&2048?this.b.Wa[a]:this.b.u[a]}; k.ie=function(a,b){b=(b>>1&7)+8;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.Xd=function(a){return this.b.V[3][a>>1&7]};k.Pe=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Vd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ne=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Wd=function(a){return this.b.ya[3][a>>1&7]};k.Oe=function(a,b){b=b>>1&7;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.Ud=function(a){return this.b.ya[3][(a>>1&7)+8]};k.Me=function(a,b){b=(b>>1&7)+8;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};
k.Cb=function(a,b){b&=7;this.b.N&2048?this.b.Wa[b]=a:this.b.u[b]=a};k.Ad=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.se=function(a){this.b.N&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Dd=function(){return this.b.u[7]};k.ve=function(a){this.b.u[7]=a};k.Ab=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Wa[a]};k.Db=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Wa[b]=a};k.Bd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]}; k.yb=function(a){a&=7;return this.b.N&2048?this.b.Xa[a]:this.b.u[a]};k.Cb=function(a,b){b&=7;this.b.N&2048?this.b.Xa[b]=a:this.b.u[b]=a};k.Cd=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.ue=function(a){this.b.N&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Fd=function(){return this.b.u[7]};k.xe=function(a){this.b.u[7]=a};k.zb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Xa[a]};k.Db=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Xa[b]=a};
k.te=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Cd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.ue=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.kd=function(a){return this.b.Ec[a-65504>>1]};k.ee=function(a,b){this.b.Ec[b-65504>>1]=a};k.Bc=function(a){if(65520==a){a=0;switch(Ac){case Ac:a=this.v.cc}a=(a>>6)-1}else a=0;return a};k.Ic=function(){};k.Rd=function(){return 1};k.Je=function(){};k.jd=function(){return this.b.Ha}; k.Dd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]};k.ve=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Ed=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.we=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.md=function(a){return this.b.Gc[a-65504>>1]};k.ge=function(a,b){this.b.Gc[b-65504>>1]=a};k.Dc=function(a){if(65520==a){a=0;switch(Ac){case Ac:a=this.v.bc}a=(a>>6)-1}else a=0;return a};k.Kc=function(){};k.Td=function(){return 1};
k.de=function(){this.b.Ha=0};k.rd=function(){return this.b.Dc};k.le=function(a,b){b&1||(a&=255);this.b.Dc=a};k.wd=function(a){return a?this.b.kc:0};k.oe=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.kc=a;b.K|=2};k.Qd=function(a){return a?this.b.Wb&65280:0};k.Ie=function(a){this.b.Wb=a|255};k.zd=function(){return Sc(this.b)};k.re=function(a){Tc(this.b,a&-1793|Sc(this.b)&1792);this.b.K|=128};k.Hc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)}; k.Le=function(){};k.ld=function(){return this.b.Ha};k.fe=function(){this.b.Ha=0};k.td=function(){return this.b.Fc};k.ne=function(a,b){b&1||(a&=255);this.b.Fc=a};k.yd=function(a){return a?this.b.jc:0};k.qe=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.jc=a;b.K|=2};k.Sd=function(a){return a?this.b.Wb&65280:0};k.Ke=function(a){this.b.Wb=a|255};k.Bd=function(){return Tc(this.b)};k.te=function(a){Uc(this.b,a&-1793|Tc(this.b)&1792);this.b.K|=128};
var L={},Qc=(L[61568]=[null,null,K.prototype.Wd,K.prototype.Oe,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Pd,K.prototype.He,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Nd,K.prototype.Fe,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Od,K.prototype.Ge,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Md,K.prototype.Ee,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.pd,K.prototype.je,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.nd,K.prototype.he,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.od, k.Jc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)};
K.prototype.ie,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.md,K.prototype.ge,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.vd,K.prototype.ne,"MMR3",1,1145],L[65382]=[null,null,K.prototype.qd,K.prototype.ke,"LKS"],L[65402]=[null,null,K.prototype.sd,K.prototype.me,"MMR0",1,1145],L[65404]=[null,null,K.prototype.td,K.prototype.Hc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.ud,K.prototype.Hc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.Vd,K.prototype.Ne,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Td, var L={},Rc=(L[61568]=[null,null,K.prototype.Yd,K.prototype.Qe,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Rd,K.prototype.Je,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Pd,K.prototype.He,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Qd,K.prototype.Ie,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Od,K.prototype.Ge,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.rd,K.prototype.le,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.pd,K.prototype.je,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.qd,
K.prototype.Le,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Ud,K.prototype.Me,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Sd,K.prototype.Ke,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.zb,K.prototype.Cb,"R0SET0"],L[65473]=[null,null,K.prototype.zb,K.prototype.Cb,"R1SET0"],L[65474]=[null,null,K.prototype.zb,K.prototype.Cb,"R2SET0"],L[65475]=[null,null,K.prototype.zb,K.prototype.Cb,"R3SET0"],L[65476]=[null,null,K.prototype.zb,K.prototype.Cb,"R4SET0"],L[65477]=[null,null,K.prototype.zb,K.prototype.Cb, K.prototype.ke,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.od,K.prototype.ie,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.xd,K.prototype.pe,"MMR3",1,1145],L[65382]=[null,null,K.prototype.sd,K.prototype.me,"LKS"],L[65402]=[null,null,K.prototype.ud,K.prototype.oe,"MMR0",1,1145],L[65404]=[null,null,K.prototype.vd,K.prototype.Jc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.wd,K.prototype.Jc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.Xd,K.prototype.Pe,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Vd,
"R5SET0"],L[65478]=[null,null,K.prototype.Ad,K.prototype.se,"R6KERNEL"],L[65479]=[null,null,K.prototype.Dd,K.prototype.ve,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ab,K.prototype.Db,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ab,K.prototype.Db,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ab,K.prototype.Db,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ab,K.prototype.Db,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ab,K.prototype.Db,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ab, K.prototype.Ne,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Wd,K.prototype.Oe,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Ud,K.prototype.Me,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.yb,K.prototype.Cb,"R0SET0"],L[65473]=[null,null,K.prototype.yb,K.prototype.Cb,"R1SET0"],L[65474]=[null,null,K.prototype.yb,K.prototype.Cb,"R2SET0"],L[65475]=[null,null,K.prototype.yb,K.prototype.Cb,"R3SET0"],L[65476]=[null,null,K.prototype.yb,K.prototype.Cb,"R4SET0"],L[65477]=[null,null,K.prototype.yb,K.prototype.Cb,
K.prototype.Db,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Bd,K.prototype.te,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Cd,K.prototype.ue,"R6USER",1,1145],L[65504]=[null,null,K.prototype.kd,K.prototype.ee,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Bc,K.prototype.Ic,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Bc,K.prototype.Ic,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Rd,K.prototype.Je,"SYSID",1,1170],L[65526]=[null,null,K.prototype.jd,K.prototype.de,"CPUERR",1,1170],L[65528]= "R5SET0"],L[65478]=[null,null,K.prototype.Cd,K.prototype.ue,"R6KERNEL"],L[65479]=[null,null,K.prototype.Fd,K.prototype.xe,"R7KERNEL"],L[65480]=[null,null,K.prototype.zb,K.prototype.Db,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.zb,K.prototype.Db,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.zb,K.prototype.Db,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.zb,K.prototype.Db,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.zb,K.prototype.Db,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.zb,
[null,null,K.prototype.rd,K.prototype.le,"MB",1,1170],L[65530]=[null,null,K.prototype.wd,K.prototype.oe,"PIR"],L[65532]=[null,null,K.prototype.Qd,K.prototype.Ie,"SL"],L[65534]=[null,null,K.prototype.zd,K.prototype.re,"PSW"],L);Za(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new Uc(c);B(c,d);break;case "rl11":c=new M(c),B(c,d)}}});var Vc; K.prototype.Db,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Dd,K.prototype.ve,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Ed,K.prototype.we,"R6USER",1,1145],L[65504]=[null,null,K.prototype.md,K.prototype.ge,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Dc,K.prototype.Kc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Dc,K.prototype.Kc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Td,K.prototype.Le,"SYSID",1,1170],L[65526]=[null,null,K.prototype.ld,K.prototype.fe,"CPUERR",1,1170],L[65528]=
if(zb){var Wc=new ArrayBuffer(2);(new DataView(Wc)).setUint16(0,256,!0);Vc=256===(new Uint16Array(Wc))[0]}else Vc=!1;var Xc=Vc; [null,null,K.prototype.td,K.prototype.ne,"MB",1,1170],L[65530]=[null,null,K.prototype.yd,K.prototype.qe,"PIR"],L[65532]=[null,null,K.prototype.Sd,K.prototype.Ke,"SL"],L[65534]=[null,null,K.prototype.Bd,K.prototype.te,"PSW"],L);Za(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new Vc(c);B(c,d);break;case "rl11":c=new M(c),B(c,d)}}});var Wc;
function I(a,b,c,d,e,f){this.v=a;this.id=Yc+=2;this.b=null;this.F=b;this.Mb=c;this.size=d||0;this.type=e||Zc;this.f=e==$c;this.controller=null;sc(this);this.Sa=this.Rc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],ad(this,f.Lc);else if(zb)this.A=new ArrayBuffer(this.size),this.D=new DataView(this.A,0,this.size),this.G=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),ad(this,Xc?bd:cd);else{a=this.b=Array(this.size>> if(zb){var Xc=new ArrayBuffer(2);(new DataView(Xc)).setUint16(0,256,!0);Wc=256===(new Uint16Array(Xc))[0]}else Wc=!1;var Yc=Wc;
2);for(f=0;f<a.length;f++)a[f]=0;ad(this,dd)}else ad(this)}var Zc=0,Ac=1,$c=2,yc=4,Bc=["NONE","RAM","ROM","VID","H/W"],Yc=0; function I(a,b,c,d,e,f){this.v=a;this.id=Zc+=2;this.b=null;this.F=b;this.Ob=c;this.size=d||0;this.type=e||$c;this.f=e==ad;this.controller=null;sc(this);this.Ta=this.Tc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],bd(this,f.Nc);else if(zb)this.A=new ArrayBuffer(this.size),this.D=new DataView(this.A,0,this.size),this.G=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),bd(this,Yc?cd:dd);else{a=this.b=Array(this.size>>
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(zb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(zb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Sa=!0}return!1},nb:function(a,b){b?this.C++||ed(this,fd,!1):this.g++||gd(this,fd,!1)},J:function(a,b){this.i&&F(this.i,128)&&E(this.i, 2);for(f=0;f<a.length;f++)a[f]=0;bd(this,ed)}else bd(this)}var $c=0,Ac=1,ad=2,yc=4,Bc=["NONE","RAM","ROM","VID","H/W"],Zc=0;
"attempt to read invalid address "+J(this.i,b),!0);this.v.Da(b,32,2);return 255},B:function(a,b,c){this.i&&F(this.i,128)&&E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0);this.v.Da(c,32,4)},L:function(a,b){return this.Vb(a++,b++)|this.Vb(a,b)<<8},H:function(a,b,c){this.Zb(a++,b&255,c++);this.Zb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Da(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(zb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(zb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ta=!0}return!1},mb:function(a,b){b?this.C++||fd(this,gd,!1):this.g++||hd(this,gd,!1)},J:function(a,b){this.i&&F(this.i,128)&&E(this.i,
1]&255)<<8},ta:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Sa=!0},Na:function(a,b,c){a&1&&this.v.Da(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Sa=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;hd(c,this.F+a,1,c.M)&&c.fa(!0)}return this.hc(a,b)},Qa:function(a,b){if(this.i&&null!=this.F){var c=this.i;hd(c,this.F+a,2,c.M)&&c.fa(!0)}return this.ic(a,b)},ka:function(a, "attempt to read invalid address "+J(this.i,b),!0);this.v.Da(b,32,2);return 255},B:function(a,b,c){this.i&&F(this.i,128)&&E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0);this.v.Da(c,32,4)},L:function(a,b){return this.Vb(a++,b++)|this.Vb(a,b)<<8},H:function(a,b,c){this.Yb(a++,b&255,c++);this.Yb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Da(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+
b,c){if(this.i&&null!=this.F){var d=this.i;hd(d,this.F+a,1,d.D)&&d.fa(!0)}this.f?this.B(a,b,c):this.$b(a,b,c)},wa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;hd(d,this.F+a,2,d.D)&&d.fa(!0)}this.f?this.B(a,b,c):this.nc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Da(b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&this.v.Da(b,64,2);a= 1]&255)<<8},Za:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ta=!0},Ja:function(a,b,c){a&1&&this.v.Da(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Ta=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,1,c.M)&&c.fa(!0)}return this.gc(a,b)},$:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,2,c.M)&&c.fa(!0)}return this.hc(a,b)},ka:function(a,
this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Sa=!0},Ya:function(a,b,c){this.G[a]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},va:function(a,b,c){a&1&&this.v.Da(c,64,4);this.D.setUint16(a,b,!0);this.Sa=!0},Aa:function(a,b,c){a&1&&this.v.Da(c,64,4);this.I[a>>1]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, b,c){if(this.i&&null!=this.F){var d=this.i;id(d,this.F+a,1,d.D)&&d.fa(!0)}this.f?this.B(a,b,c):this.Zb(a,b,c)},wa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;id(d,this.F+a,2,d.D)&&d.fa(!0)}this.f?this.B(a,b,c):this.mc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Da(b,64,2);return this.D.getUint16(a,!0)},Qa:function(a,b){a&1&&this.v.Da(b,64,2);
b)+")",!0)}};function sc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&gd(a,fd,!1),(a.C=c.C)&&ed(a,fd,!1))}function id(a,b){b?--a.C||(a.Zb=a.f?a.B:a.$b,a.Nb=a.f?a.H:a.nc):--a.g||(a.Vb=a.hc,a.qa=a.ic)}function ed(a,b,c){c&&a.C||(a.Zb=!a.f&&b[1]||a.B,a.Nb=!a.f&&b[3]||a.H);if(c||void 0===c)a.$b=b[1]||a.B,a.nc=b[3]||a.H}function gd(a,b,c){c&&a.g||(a.Vb=b[0]||a.J,a.qa=b[2]||a.L);if(c||void 0===c)a.hc=b[0]||a.J,a.ic=b[2]||a.L}function ad(a,b){b||(b=jd);gd(a,b,void 0);ed(a,b,void 0)} a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Ta=!0},pa:function(a,b,c){this.G[a]=b;this.Ta=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},va:function(a,b,c){a&1&&this.v.Da(c,64,4);this.D.setUint16(a,b,!0);this.Ta=!0},xa:function(a,b,c){a&1&&this.v.Da(c,64,4);this.I[a>>1]=b;this.Ta=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,
var jd=[],dd=[I.prototype.S,I.prototype.ta,I.prototype.ca,I.prototype.Na],fd=[I.prototype.O,I.prototype.ka,I.prototype.Qa,I.prototype.wa];if(zb)var cd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.va],bd=[I.prototype.R,I.prototype.Ya,I.prototype.$,I.prototype.Aa]; b)+")",!0)}};function sc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&hd(a,gd,!1),(a.C=c.C)&&fd(a,gd,!1))}function jd(a,b){b?--a.C||(a.Yb=a.f?a.B:a.Zb,a.Pb=a.f?a.H:a.mc):--a.g||(a.Vb=a.gc,a.ra=a.hc)}function fd(a,b,c){c&&a.C||(a.Yb=!a.f&&b[1]||a.B,a.Pb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Zb=b[1]||a.B,a.mc=b[3]||a.H}function hd(a,b,c){c&&a.g||(a.Vb=b[0]||a.J,a.ra=b[2]||a.L);if(c||void 0===c)a.gc=b[0]||a.J,a.hc=b[2]||a.L}function bd(a,b){b||(b=kd);hd(a,b,void 0);fd(a,b,void 0)}
function kd(a,b){t.call(this,"CPU",a,kd,1);var c=a.multiplier||1;this.kb=a.cycles||b;this.eb=c;this.ub=Math.round(this.kb/1E4)/100;this.ob=this.ub*this.eb;this.w.W=!1;this.w.Yb=!1;this.w.sb=a.autoStart;this.w.vb=!1;this.Hb=this.ta=0;this.Ib=a.csStart;this.wb=a.csInterval;this.xb=a.csStop;this.L=[];this.zc=this.$d.bind(this);H(this)}z(kd);var ld=["power","reset"];k=kd.prototype; var kd=[],ed=[I.prototype.S,I.prototype.Za,I.prototype.ca,I.prototype.Ja],gd=[I.prototype.O,I.prototype.ka,I.prototype.$,I.prototype.wa];if(zb)var dd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.va],cd=[I.prototype.R,I.prototype.pa,I.prototype.Qa,I.prototype.xa];
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.B=a.B;for(b=0;b<ld.length;b++)(c=this.G[ld[b]])&&this.C.ra(null,ld[b],c);a=md(a,"autoStart");null!=a&&(this.w.sb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1}; function ld(a,b){t.call(this,"CPU",a,ld,1);var c=a.multiplier||1;this.nb=a.cycles||b;this.eb=c;this.Fb=Math.round(this.nb/1E4)/100;this.pb=this.Fb*this.eb;this.w.W=!1;this.w.Xb=!1;this.w.tb=a.autoStart;this.w.ub=!1;this.Kb=this.va=0;this.Lb=a.csStart;this.vb=a.csInterval;this.wb=a.csStop;this.L=[];this.zc=this.be.bind(this);H(this)}z(ld);var md=["power","reset"];k=ld.prototype;
k.Ga=function(a,b){if(!b){if(a&&this.restore){nd(this);if(!this.restore(a))return!1;od(this)}else this.reset();this.i?(a=this.i,b=this.w.sb,a.kb=!0,a.j("Type ? for help with PDPjs Debugger commands"),pd(a),b||a.rb(),a.Za&&(b=a.Za,a.Za=null,qd(a,b))):this.j("No debugger detected")}return!0};k.Fa=function(a){return a?this.save():!0};k.sb=function(){return this.w.sb||!this.i&&void 0===this.G.run?(this.ib(),!0):!1};k.uc=function(){return 0}; k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.B=a.B;for(b=0;b<md.length;b++)(c=this.G[md[b]])&&this.C.sa(null,md[b],c);a=nd(a,"autoStart");null!=a&&(this.w.tb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
function od(a){void 0===a.Ib&&(a.Ib=0);void 0===a.wb&&(a.wb=-1);void 0===a.xb&&(a.xb=-1);a.w.vb=0<=a.Ib&&0<a.wb;a.w.vb&&(a.Hb=0,a.ta=a.Ib-a.ka)}function ec(a,b){if(a.w.vb){var c=!1;a.Hb=a.Hb+a.uc()|0;a.ta-=b;0>=a.ta&&(a.ta+=a.wb,c=!0);0<=a.xb&&a.xb<=rd(a)&&(a.wb=a.xb=-1,od(a),a.fa(),c=!0);c&&a.j(rd(a)+" cycles: checksum="+p(a.Hb))}} k.Ga=function(a,b){if(!b){if(a&&this.restore){od(this);if(!this.restore(a))return!1;pd(this)}else this.reset();this.i?(a=this.i,b=this.w.tb,a.jb=!0,a.j("Type ? for help with PDPjs Debugger commands"),qd(a),b||a.sb(),a.Ra&&(b=a.Ra,a.Ra=null,rd(a,b))):this.j("No debugger detected")}return!0};k.Fa=function(a){return a?this.save():!0};k.tb=function(){return this.w.tb||!this.i&&void 0===this.G.run?(this.hb(),!0):!1};k.sc=function(){return 0};
k.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.w.ha)a=!0;else{var b=null,c,h=rb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.w.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.w.ha);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.w.ready?"powered yet":"ready yet"+(b.Rb?" (waiting for notification)":""))+".");a=!1}a&&(d.w.W?d.fa():d.ib())}, function pd(a){void 0===a.Lb&&(a.Lb=0);void 0===a.vb&&(a.vb=-1);void 0===a.wb&&(a.wb=-1);a.w.ub=0<=a.Lb&&0<a.vb;a.w.ub&&(a.Kb=0,a.va=a.Lb-a.pa)}function ec(a,b){if(a.w.ub){var c=!1;a.Kb=a.Kb+a.sc()|0;a.va-=b;0>=a.va&&(a.va+=a.vb,c=!0);0<=a.wb&&a.wb<=sd(a)&&(a.vb=a.wb=-1,pd(a),a.fa(),c=!0);c&&a.j(sd(a)+" cycles: checksum="+p(a.Kb))}}
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){sd(d,d.eb<<1,!0)},c.textContent=this.ob.toFixed(2)+"Mhz",!0}return!1};k.oa=function(a){this.C&&this.C.oa(a)};function dc(a,b,c){a.ka+=b;c&&(a.ia=a.b=a.J=0)}function td(a,b){var c=1;b&&1<a.eb&&a.$&&(c=a.$/a.ub);a.Ub=Math.round(1E3/30);a.mb=Math.floor(a.kb/30*c);b||(a.va=a.mb);a.Eb=0}function rd(a){return a.ka+a.X+a.ia-a.b}function nd(a){a.$=0;a.xc=0;a.ka=a.X=a.ia=a.b=a.J=0;od(a);sd(a,1)} k.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.w.ha)a=!0;else{var b=null,c,h=rb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.w.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.w.ha);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.w.ready?"powered yet":"ready yet"+(b.Sb?" (waiting for notification)":""))+".");a=!1}a&&(d.w.W?d.fa():d.hb())},
function sd(a,b,c){var d=!1;if(void 0!==b){.8>a.$/a.ob?b=1:d=!0;a.eb=b;b=a.ub*a.eb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.rb()}dc(a,a.X);a.X=0;a.S=Aa();a.ca=0;td(a);return d}function Mc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Oc(a,b,c,d){0<=b&&b<a.L.length&&(d||0>a.L[b][0])&&(c=a.kb*a.eb/1E3*c|0,a.w.W&&(c+=ud(a)),a.L[b][0]=c)} !0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){td(d,d.eb<<1,!0)},c.textContent=this.pb.toFixed(2)+"Mhz",!0}return!1};k.oa=function(a){this.C&&this.C.oa(a)};function dc(a,b,c){a.pa+=b;c&&(a.ka=a.b=a.I=0)}function ud(a,b){var c=1;b&&1<a.eb&&a.ca&&(c=a.ca/a.Fb);a.wc=Math.round(1E3/30);a.ob=Math.floor(a.nb/30*c);b||(a.wa=a.ob);a.Gb=0}function sd(a){return a.pa+a.$+a.ka-a.b}function od(a){a.ca=0;a.yc=0;a.pa=a.$=a.ka=a.b=a.I=0;pd(a);td(a,1)}
function vd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function cc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ud(a,b){var c=a.ia-=a.b;a.b=a.J=0;b&&(a.ia=0);return c} function td(a,b,c){var d=!1;if(void 0!==b){.8>a.ca/a.pb?b=1:d=!0;a.eb=b;b=a.Fb*a.eb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.sb()}dc(a,a.$);a.$=0;a.X=Aa();a.ia=0;ud(a);return d}function Nc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&b<a.L.length&&(d||0>a.L[b][0])&&(c=a.nb*a.eb/1E3*c|0,a.w.W&&(c+=vd(a)),a.L[b][0]=c)}
k.$d=function(){if(this.w.W){this.Eb>=this.kb&&td(this,!0);this.Aa=0;this.lb=Aa();if(this.ca){var a=this.lb-this.ca;a>this.Ub&&(this.S+=a,this.S>this.lb&&(this.S=this.lb))}try{do{var b=vd(this,this.w.vb?1:this.mb);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=ud(this,!0);this.Aa+=b;this.X+=b;ec(this,b);cc(this,b);this.va-=b;if(0>=this.va){this.va+=this.mb;15<=++this.xc&&(this.oa(),this.xc=0);break}}while(this.w.W)}catch(e){this.fa();this.C&&this.C.stop(Aa(),rd(this));yb(this,e.stack||e.message); function wd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function cc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function vd(a,b){var c=a.ka-=a.b;a.b=a.I=0;b&&(a.ka=0);return c}
return}if(this.w.W){a=setTimeout;b=this.zc;this.ca=Aa();var c=this.Ub;this.Aa&&(c=Math.round(c*this.Aa/this.mb));var c=c-(this.ca-this.lb),d=this.ca-this.S;d&&(this.$=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ka=0,sd(this)));if(0>c||this.$<this.ob)-1E3>c&&(this.S-=c),c=0;this.Eb+=this.Aa;this.ca+=c;a(b,c)}}}; k.be=function(){if(this.w.W){this.Gb>=this.nb&&ud(this,!0);this.Ra=0;this.lb=Aa();if(this.ia){var a=this.lb-this.ia;a>this.wc&&(this.X+=a,this.X>this.lb&&(this.X=this.lb))}try{do{var b=wd(this,this.w.ub?1:this.ob);try{this.ib(b)}catch(e){if("number"!=typeof e)throw e;}b=vd(this,!0);this.Ra+=b;this.$+=b;ec(this,b);cc(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.ob;15<=++this.yc&&(this.oa(),this.yc=0);break}}while(this.w.W)}catch(e){this.fa();this.C&&this.C.stop(Aa(),sd(this));yb(this,e.stack||e.message);
k.ib=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;sd(this);this.w.W=!0;this.w.Yb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.rb(!0),this.C.start(this.S,rd(this)));setTimeout(this.zc,0);return!0};k.jb=function(){return 0};k.fa=function(a){var b=!1;if(this.w.W){ud(this);dc(this,this.X);this.X=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),rd(this));b=!0}this.w.complete=a;return b}; return}if(this.w.W){a=setTimeout;b=this.zc;this.ia=Aa();var c=this.wc;this.Ra&&(c=Math.round(c*this.Ra/this.ob));var c=c-(this.ia-this.lb),d=this.ia-this.X;d&&(this.ca=Math.round(this.$/(10*d))/100,864E5<=d&&(this.pa=0,td(this)));if(0>c||this.ca<this.pb)-1E3>c&&(this.X-=c),c=0;this.Gb+=this.Ra;this.ia+=c;a(b,c)}}};
function wd(a){this.cb=+a.model||1170;this.Ob=a.addrReset||0;kd.call(this,a,6666667);this.decode=1120==this.cb?xd.bind(this):yd.bind(this);zd(this);this.M=0;this.O=null;this.w.complete=!1}z(wd,kd);k=wd.prototype;k.reset=function(){this.status("model "+this.cb);this.w.W&&this.fa();zd(this);nd(this);this.w.error=!1;this.parent.reset.call(this)}; k.hb=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;td(this);this.w.W=!0;this.w.Xb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.sb(!0),this.C.start(this.X,sd(this)));setTimeout(this.zc,0);return!0};k.ib=function(){return 0};k.fa=function(a){var b=!1;if(this.w.W){vd(this);dc(this,this.$);this.$=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),sd(this));b=!0}this.w.complete=a;return b};
function zd(a){a.T=65536;a.U=32768;a.aa=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Ob];a.Wa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.A=0;a.Za=0;a.Uc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.xa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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, function xd(a){this.cb=+a.model||1170;this.Tb=a.addrReset||0;ld.call(this,a,6666667);this.decode=1120==this.cb?yd.bind(this):zd.bind(this);Ad(this);this.M=0;this.O=null;this.w.complete=!1}z(xd,ld);k=xd.prototype;k.reset=function(){this.status("model "+this.cb);this.w.W&&this.fa();Ad(this);od(this);this.w.error=!1;this.parent.reset.call(this)};
0,0,0,0,0,0,0,0,0,0];a.Ec=[0,0,0,0,0,0,0,0];a.Dc=0;a.K=0;a.H=a.I=0;a.g=a.f=a.tb=0;a.wa=-1;bc(a)}function bc(a){a.Wb=255;a.Ha=0;a.kc=0;a.D=0;a.fb=0;a.Kb=0;a.pb=0;a.Ua=0;a.Na=0;a.Sb=262143;a.O=null;a.v&&Rc(a)}function Rc(a){a.Ua?(a.R=65536,a.ba=a.Tc,a.qa=a.Xd,a.Nb=a.Pe,uc(a.v,a.pb&16?22:18)):(a.R=0,a.ba=a.Sc,a.qa=a.Cc,a.Nb=a.Jc,uc(a.v,16))}k.uc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ka,this.eb]);a.set(2,Dc(this.v));return a.data()}; function Ad(a){a.T=65536;a.U=32768;a.aa=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Tb];a.Xa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.A=0;a.jb=0;a.Xc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ya=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Nb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
k.restore=function(a){var b=a[1];this.ka=b[1];sd(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.I){for(var f=0,g=Array(b.I),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.Y[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Ad(a){return a.T&65536?1:0}function Bd(a){return a.U&32768?2:0}function Cd(a){return a.aa&65535?0:4}k.Ta=function(){return this.Z&32768?8:0}; 0,0,0,0,0,0,0,0,0,0];a.Gc=[0,0,0,0,0,0,0,0];a.Fc=0;a.K=0;a.D=a.H=0;a.g=a.f=a.Eb=0;a.xa=-1;bc(a)}function bc(a){a.Wb=255;a.Ha=0;a.jc=0;a.J=0;a.Ac=0;a.Bc=0;a.qb=0;a.Va=0;a.kb=0;a.Ja=262143;a.S=0;a.Ib=0;a.O=null;a.v&&Sc(a)}function Sc(a){a.Va?(a.R=65536,a.ba=a.Vc,a.ra=a.Zd,a.Pb=a.Re,uc(a.v,a.qb&16?22:18)):(a.R=0,a.ba=a.Uc,a.ra=a.Ec,a.Pb=a.Lc,uc(a.v,16))}k.sc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.pa,this.eb]);a.set(2,Dc(this.v));return a.data()};
function Dd(a){var b=a.u[7];a.D&57344||(a.fb=0,a.Kb=b);a.u[7]=b+2&65535;return a.qa(b)}function Ed(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Pc(a,b){return{be:a,yb:b,next:null}}function Nc(a,b){if(b!=a.O){var c=a.O;if(!c||c.yb<=b.yb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.yb<=b.yb){b.next=d;c.next=b;break}c=d}while(c)}}a.K|=2}function Sc(a){return a.N=a.N&63728|a.Ta()|Cd(a)|Bd(a)|Ad(a)} k.restore=function(a){var b=a[1];this.pa=b[1];td(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.I){for(var f=0,g=Array(b.I),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.Y[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Bd(a){return a.T&65536?1:0}function Cd(a){return a.U&32768?2:0}function Dd(a){return a.aa&65535?0:4}k.Ua=function(){return this.Z&32768?8:0};
function Tc(a,b){a.Z=b<<12;a.aa=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.N)&2048)for(var c=a.Wa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Wa[c];a.Wa[c]=d}a.A=b>>14&3;c=a.N>>14&3;a.A!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.A]);a.N=b;a.K|=2}function Q(a,b){a.K&128||(a.Z=a.aa=b,a.U=0)}function Fd(a,b,c){a.K&128||(a.Z=a.aa=a.T=b,a.U=c||0)}function Gd(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^b)&(d^b))}function Hd(a,b){a.K&128||(a.Z=a.aa=a.T=b,a.U=a.Z^a.T>>1)} function Ed(a){var b=a.u[7];a.S=0;a.Ib=b;var c=a.ra(b);a.u[7]=b+2&65535;return c}function Fd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Qc(a,b){return{de:a,xb:b,next:null}}function Oc(a,b){if(b!=a.O){var c=a.O;if(!c||c.xb<=b.xb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.xb<=b.xb){b.next=d;c.next=b;break}c=d}while(c)}}a.K|=2}function Gd(a){return a.K&64?(a.ta(168,64,-5),!0):a.K&32?(a.ta(4,32,-4),!0):a.K&16?(a.ta(12,16,-6),!0):!1}
function Id(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.sa=function(a,b,c){if(!this.M){var d=!1;0>this.wa?this.wa=Sc(this):this.A||(a=4,d=!0);this.D&57344||(this.fb=63222,this.Kb=a);this.A=0;var e=this.qa(a|this.R),f=this.qa(a+2&65535|this.R);Tc(this,f&-12289|this.wa>>2&12288);d&&(this.Ha|=4,this.u[6]=4);be(this,this.wa);be(this,this.u[7]);O(this,e);this.K&=~b;this.wa=-1;this.K|=8;this.Yc=a;this.Xc=c;if(-18!=c)throw a;}}; function Tc(a){return a.N=a.N&63728|a.Ua()|Dd(a)|Cd(a)|Bd(a)}function Uc(a,b){a.Z=b<<12;a.aa=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.N)&2048)for(var c=a.Xa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Xa[c];a.Xa[c]=d}a.A=b>>14&3;c=a.N>>14&3;a.A!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.A]);a.N=b;a.K|=2}function Q(a,b){a.K&128||(a.Z=a.aa=b,a.U=0)}function Hd(a,b,c){a.K&128||(a.Z=a.aa=a.T=b,a.U=c||0)}function Id(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^b)&(d^b))}
function ce(a){var b=de(a),c=de(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Tc(a,c);a.K&=-17}function Cc(a,b){var c=b>>13&31;31>c&&a.pb&32&&(b=a.Lb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} function de(a,b){a.K&128||(a.Z=a.aa=a.T=b,a.U=a.Z^a.T>>1)}function ee(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.ta=function(a,b,c){if(!this.M){0>this.xa?this.xa=Tc(this):this.A||(a=4,this.Ha|=4,this.u[6]=4,c=-3);this.Ib=a;this.A=this.S=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);Uc(this,e&-12289|this.xa>>2&12288);fe(this,this.xa);fe(this,this.u[7]);O(this,d);this.K&=~(b|18);this.K|=9;this.xa=-1;this.jd=a;this.Zc=c;if(-3<=c)throw a;}};
function ee(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.pb&a.Uc[a.A]||(d&=7);e=a.V[a.A][d];f=(a.xa[a.A][d]<<6)+(b&8191)&a.Sb;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.A][d]=e;if(4194170!==f||a.A)a.Na=a.A,a.Za=d;b=!1;g&&(g&57344&&(0<=a.wa&&(g|=128),a.D&57344||(a.D=a.D|g|a.Na<<5|a.Za<<1), function ge(a){var b=he(a),c=he(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Uc(a,c);a.K&=-17}function Cc(a,b){var c=b>>13&31;31>c&&a.qb&32&&(b=a.Nb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
b=!0),a.D&61440||!(4191360>f||4194239<f)||(a.D|=4096,a.D&512&&(a.K|=32)),b&&a.sa(168,0,-13));return f}function fe(a,b){return a.v.Fb(b)}function ge(a,b,c){b&1&&a.b--;a.v.Xb(b,c&255)}function de(a){var b=a.qa(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function be(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.D&57344||(a.fb=a.fb<<8|246);he(a,0,c);a.Nb(c,b)} function ie(a,b,c){var d,e,f;if(!(c&a.Va))return b;d=b>>13;a.qb&a.Xc[a.A]||(d&=7);e=a.V[a.A][d];f=(a.ya[a.A][d]<<6)+(b&8191)&a.Ja;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.A][d]=e;if(f!=(4194170&a.Ja)||a.A)a.kb=a.A,a.jb=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.J&57344||(a.J=a.J|g|a.kb<<5|a.jb<<
function he(a,b,c){a.A||a.K&64||!(c<=a.Wb&&(b||4<c)||b&&65534<=c)||(1145<=a.cb&&(c<=a.Wb-32||1==b&&65534<=c)?(a.Ha|=4,a.u[6]=4,a.sa(4,0,-16)):(a.Ha|=8,a.K|=64))} 1),b=!0),a.J&61440||!(f<(4191360&a.Ja)||f>(4194239&a.Ja))||(a.J|=4096,a.J&512&&(a.K|=64)),b&&a.ta(168,0,-1));return f}function je(a,b){return a.v.Hb(b)}function he(a){var b=a.ra(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function fe(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.S=a.S<<8|246;ke(a,0,c);a.Pb(c,b)}function ke(a,b,c){!a.A&&c<=a.Wb&&(b||4<c)&&(1145<=a.cb&&c<=a.Wb-32?(a.Ha|=4,a.u[6]=4,a.ta(4,0,-3)):(a.Ha|=8,a.K|=32))}
function ie(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return a.sa(4,0,-15),0;case 1:return 6==c&&d&4&&he(a,b,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];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.qa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.qa(e)|g;a.b-=8;break;case 6:return e=a.qa(Ed(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.qa(Ed(a,2)),e= function le(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return a.ta(4,0,-2),0;case 1:return 6==c&&d&4&&ke(a,b,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];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.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.ra(e)|g;a.b-=8;break;case 6:return e=a.ra(Fd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Fd(a,2)),e=e+
e+a.u[c]&65535,e=a.qa(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.D&57344||(a.fb=a.fb<<8|f<<3&248|c);6==c&&0>f&&he(a,b,a.u[6]);return e}k.Tb=function(a){if(!this.Ua)return this.v.Tb(a);this.M++;a=fe(this,ee(this,a,3));this.M--;return a};k.bb=function(a){if(!this.Ua)return this.v.bb(a);this.M++;a=this.Cc(ee(this,a,2));this.M--;return a};k.qb=function(a,b){this.Ua?(this.M++,ge(this,ee(this,a,5),b),this.M--):this.v.qb(a,b)}; a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.S=a.S<<8|f<<3&248|c;6==c&&0>f&&ke(a,b,a.u[6]);return e}k.Ub=function(a){if(!this.Va)return this.v.Ub(a);this.M++;a=je(this,ie(this,a,3));this.M--;return a};k.bb=function(a){if(!this.Va)return this.v.bb(a);this.M++;a=this.Ec(ie(this,a,2));this.M--;return a};k.rb=function(a,b){this.Va?(this.M++,a=ie(this,a,5),a&1&&this.b--,this.v.Ab(a,b),this.M--):this.v.rb(a,b)};
k.Bb=function(a,b){this.Ua?(this.M++,this.Jc(ee(this,a,4),b),this.M--):this.v.Bb(a,b)};k.Sc=function(a,b,c){return ie(this,a,b,c)};k.Tc=function(a,b,c){return ee(this,ie(this,a,b,c),c)};k.Cc=function(a){return this.v.na(a)};k.Xd=function(a){return this.v.na(ee(this,a,2))};k.Jc=function(a,b){this.v.hb(a,b&65535)};k.Pe=function(a,b){this.v.hb(ee(this,a,4),b)}; k.Bb=function(a,b){this.Va?(this.M++,this.Lc(ie(this,a,4),b),this.M--):this.v.Bb(a,b)};k.Uc=function(a,b,c){return le(this,a,b,c)};k.Vc=function(a,b,c){return ie(this,le(this,a,b,c),c)};k.Ec=function(a){return this.v.na(a)};k.Zd=function(a){return this.v.na(ie(this,a,2))};k.Lc=function(a,b){this.v.gb(a,b&65535)};k.Re=function(a,b){this.v.gb(ie(this,a,4),b)};
function je(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ie(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.A=a.N>>12&3,c=a.qa(d|c&a.R),a.A=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function ke(a,b,c,d){a.D&57344||(a.fb=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ie(a,b,e,4),c&65536||(e&=65535),a.A=a.N>>12&3,e=ee(a,e|c&65536,4),a.A=a.N>>14&3,a.v.hb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d} function me(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=le(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.A=a.N>>12&3,c=a.ra(d|c&a.R),a.A=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function ne(a,b,c,d){a.S=22;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=le(a,b,e,4),c&65536||(e&=65535),a.A=a.N>>12&3,e=ie(a,e|c&65536,4),a.A=a.N>>14&3,a.v.gb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d}
function le(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?fe(a,a.ba(b,c,3)):a.u[c]&255}function me(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.v.na(a.ba(b,c,2)):a.u[c]}function ne(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ie(a,b,c,8)}function oe(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?fe(a,a.ba(b,c,3)):a.u[c]&255}function pe(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.ba(b,c,2)):a.u[c]} function oe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?je(a,a.ba(b,c,3)):-c-1}function pe(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.ba(b,d,2)):c=-d-1;return c}function qe(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return le(a,b,c,8)}function re(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?je(a,a.ba(b,c,3)):a.u[c]&255}function se(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.ba(b,c,2)):a.u[c]}
function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.tb=a.ba(b,e,7),ge(a,e,d.call(a,c,fe(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e]&255)}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.v.hb(e,d.call(a,c,a.v.na(e)))):a.u[e]=d.call(a,c,a.u[e])}function qe(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?ge(a,a.ba(b,e,5),c):a.u[e]=c?a.u[e]&~d|c<<24>>24&d:a.u[e]&~d;return c}function re(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.v.hb(a.ba(b,d,4),c):a.u[d]=c&65535;return c} function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Eb=a.ba(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,je(a,e)),e&1&&a.b--,a.v.Ab(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.v.gb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}
function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} function te(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Ab(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function ue(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,d,4),a.v.gb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
k.jb=function(a){this.w.complete=!0;var b=this.i&&se(this.i)?1:this.w.Yb?-1:0,c=a?this.w.Yb?0:1:-1;this.w.Yb=!1;this.ia=this.b=a;do{if(b){if(this.i&&te(this.i,this.u[7],c)){this.fa();break}c||c++;b++}if(this.K){this.K&112&&(this.K&32?this.sa(168,32,-7):this.K&16?this.sa(12,16,-9):this.K&64&&this.sa(4,64,-8));if(a=this.K&7){a=!1;if(this.K&2){this.K&=-3;var d=160,e=(this.kc&224)>>5,f=this.O&&this.O.yb>e?this.O:null;f&&(d=f.be,e=f.yb);e>(this.N&224)>>5?(this.K&4&&(Ed(this,2),this.K&=-5),this.sa(d,0, k.ib=function(a){this.w.complete=!0;var b=this.i&&ve(this.i)?1:this.w.Xb?-1:0,c=a?this.w.Xb?0:1:-1;this.w.Xb=!1;this.ka=this.b=a;do{if(b){if(this.i&&we(this.i,this.u[7],c)){this.fa();break}c||c++;b++}if(this.K){if(a=this.K&7){a=!1;if(this.K&2){this.K&=-3;var d=160,e=(this.jc&224)>>5,f=this.O&&this.O.xb>e?this.O:null;f&&(d=f.de,e=f.xb);e>(this.N&224)>>5?(this.K&4&&(Fd(this,2),this.K&=-5),this.ta(d,0,-9),e=!0):e=!1;if(e){if(f)if(a=f,f=this.O,f==a)this.O=a.next;else for(;f;){e=f.next;if(e==a){f.next=
-18),e=!0):e=!1;if(e){if(f)if(a=f,f=this.O,f==a)this.O=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.K&1&&this.K++;a=a&&0>c}if(a)break}this.K=this.K&7|this.N&16;this.decode(Dd(this))}while(0<this.b);return this.w.complete?this.ia-this.b:void 0===this.w.complete?0:-1};Za(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new wd(d);B(d,c)}});function ue(a,b){var c=b+a;Gd(this,c,a,b);return c&65535} e.next;break}f=e}a=!0}}else this.K&1&&this.K++;a=a&&0>c}if(a)break;if(this.K&112&&Gd(this)&&0>c)break}this.K=this.K&7|this.N&16;this.decode(Ed(this))}while(0<this.b);return this.w.complete?this.ka-this.b:void 0===this.w.complete?0:-1};Za(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new xd(d);B(d,c)}});function xe(a,b){var c=b+a;Id(this,c,a,b);return c&65535}function ye(a,b){var c=b+a;Id(this,c<<8,a<<8,b<<8);return c&255}
function ve(a,b){var c=b+a;Gd(this,c<<8,a<<8,b<<8);return c&255}function we(a,b){a=b<<1;Hd(this,a);return a&65535}function xe(a,b){a=b<<1;Hd(this,a<<8);return a&255}function ye(a,b){a=b&32768|b>>1|b<<16;Hd(this,a);return a&65535}function ze(a,b){a=b&128|b>>1|b<<8;Hd(this,a<<8);return a&255}function Ae(a,b){a=b&~a;Q(this,a);return a}function Be(a,b){a=b&~a;Q(this,a<<8);return a}function Ce(a,b){a|=b;Q(this,a);return a}function De(a,b){a|=b;Q(this,a<<8);return a} function ze(a,b){a=b<<1;de(this,a);return a&65535}function Ae(a,b){a=b<<1;de(this,a<<8);return a&255}function Be(a,b){a=b&32768|b>>1|b<<16;de(this,a);return a&65535}function Ce(a,b){a=b&128|b>>1|b<<8;de(this,a<<8);return a&255}function De(a,b){a=b&~a;Q(this,a);return a}function Ee(a,b){a=b&~a;Q(this,a<<8);return a}function Fe(a,b){a|=b;Q(this,a);return a}function Ge(a,b){a|=b;Q(this,a<<8);return a}function He(a,b){a=~b|65536;Hd(this,a);return a&65535}
function Ee(a,b){a=~b|65536;Fd(this,a);return a&65535}function Fe(a,b){a=~b|256;Fd(this,a<<8);return a&255}function Ge(a,b){a=b-a;this.K&128||(this.Z=this.aa=a,this.U=b&(b^a));return a&65535}function He(a,b){a=b-a;var c=a<<8;b<<=8;this.K&128||(this.Z=this.aa=c,this.U=b&(b^c));return a&255}function Ie(a,b){a=b+a;this.K&128||(this.Z=this.aa=a,this.U=a&(b^a));return a&65535}function Je(a,b){a=b+a;var c=a<<8;this.K&128||(this.Z=this.aa=c,this.U=c&(b<<8^c));return a&255} function Ie(a,b){a=~b|256;Hd(this,a<<8);return a&255}function Je(a,b){a=b-a;this.K&128||(this.Z=this.aa=a,this.U=b&(b^a));return a&65535}function Ke(a,b){a=b-a;var c=a<<8;b<<=8;this.K&128||(this.Z=this.aa=c,this.U=b&(b^c));return a&255}function Le(a,b){a=b+a;this.K&128||(this.Z=this.aa=a,this.U=a&(b^a));return a&65535}function Me(a,b){a=b+a;var c=a<<8;this.K&128||(this.Z=this.aa=c,this.U=c&(b<<8^c));return a&255}function Ne(a,b){a=-b;Hd(this,a,a&b&32768);return a&65535}
function Ke(a,b){a=-b;Fd(this,a,a&b&32768);return a&65535}function Le(a,b){a=-b;Fd(this,a<<8,(a&b&128)<<8);return a&255}function Me(a,b){a=b<<1|this.T>>16&1;Hd(this,a);return a&65535}function Ne(a,b){a=b<<1|this.T>>16&1;Hd(this,a<<8);return a&255}function Oe(a,b){a=(this.T&65536|b)>>1|b<<16;Hd(this,a);return a&65535}function Pe(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;Hd(this,a<<8);return a&255}function Qe(a,b){var c=b-a;Id(this,c,a,b);return c&65535} function Oe(a,b){a=-b;Hd(this,a<<8,(a&b&128)<<8);return a&255}function Pe(a,b){a=b<<1|this.T>>16&1;de(this,a);return a&65535}function Qe(a,b){a=b<<1|this.T>>16&1;de(this,a<<8);return a&255}function Re(a,b){a=(this.T&65536|b)>>1|b<<16;de(this,a);return a&65535}function Se(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;de(this,a<<8);return a&255}function Te(a,b){var c=b-a;ee(this,c,a,b);return c&65535}function Ue(a,b){var c=b-a;ee(this,c<<8,a<<8,b<<8);return c&255}
function Re(a,b){var c=b-a;Id(this,c<<8,a<<8,b<<8);return c&255}function Se(a,b){this.K&128||(this.Z=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Te(a,b){a^=b;Q(this,a);return a&65535}function Ue(a){S(this,a,me(this,a),ue);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} function Ve(a,b){this.K&128||(this.Z=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function We(a,b){a^=b;Q(this,a);return a&65535}function Xe(a){S(this,a,pe(this,a),xe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function Ve(a){var b=pe(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Z=this.aa=c;this.b-=(this.g?6:7)+b} function Ye(a){var b=se(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Z=this.aa=c;this.b-=(this.g?6:7)+b}
function We(a){var b=pe(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Xe(a){T(this,a,!Ad(this))}function Ye(a){T(this,a,Ad(this))} function Ze(a){var b=se(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function $e(a){T(this,a,!Bd(this))}function af(a){T(this,a,Bd(this))}
function Ze(a){S(this,a,me(this,a),Ae);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function $e(a){R(this,a,le(this,a),Be);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function af(a){S(this,a,me(this,a),Ce);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function bf(a){R(this,a,le(this,a),De);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} function bf(a){S(this,a,pe(this,a),De);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function cf(a){R(this,a,oe(this,a),Ee);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function df(a){S(this,a,pe(this,a),Fe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ef(a){R(this,a,oe(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function cf(a){Q(this,me(this,a)&pe(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function df(a){Q(this,(le(this,a)&oe(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function ef(a){T(this,a,Cd(this))}function ff(a){T(this,a,!this.Ta()==!Bd(this))}function gf(a){T(this,a,!Cd(this)&&!this.Ta()==!Bd(this))}function hf(a){T(this,a,!Ad(this)&&!Cd(this))}function jf(a){T(this,a,Cd(this)||!this.Ta()!=!Bd(this))} function ff(a){var b=pe(this,a);a=se(this,a);Q(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function gf(a){var b=oe(this,a);a=re(this,a);Q(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function hf(a){T(this,a,Dd(this))}function jf(a){T(this,a,!this.Ua()==!Cd(this))}function kf(a){T(this,a,!Dd(this)&&!this.Ua()==!Cd(this))}function lf(a){T(this,a,!Bd(this)&&!Dd(this))}
function kf(a){T(this,a,Ad(this)||Cd(this))}function lf(a){T(this,a,!this.Ta()!=!Bd(this))}function mf(a){T(this,a,this.Ta())}function nf(a){T(this,a,!Cd(this))}function of(a){T(this,a,!this.Ta())}function pf(){this.sa(12,0,-1);this.b-=5}function qf(a){T(this,a,!0)}function rf(a){T(this,a,!Bd(this))}function sf(a){T(this,a,Bd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.Z=0);this.b-=5} function mf(a){T(this,a,Dd(this)||!this.Ua()!=!Cd(this))}function nf(a){T(this,a,Bd(this)||Dd(this))}function of(a){T(this,a,!this.Ua()!=!Cd(this))}function pf(a){T(this,a,this.Ua())}function qf(a){T(this,a,!Dd(this))}function rf(a){T(this,a,!this.Ua())}function sf(){this.ta(12,0,-8);this.b-=5}function tf(a){T(this,a,!0)}function uf(a){T(this,a,!Cd(this))}function vf(a){T(this,a,Cd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.Z=0);this.b-=5}
function tf(a){var b=me(this,a);a=pe(this,a);Id(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function uf(a){var b=le(this,a)<<8;a=oe(this,a)<<8;Id(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)} function wf(a){var b=pe(this,a);a=se(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ee(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function xf(a){var b=oe(this,a);a=re(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ee(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}
function vf(a){var b=pe(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.aa=d>>16|d,this.Z=d>>16):(this.U=32768,this.aa=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function wf(){this.sa(24,0,-2);this.b-=25} function yf(a){var b=se(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.aa=d>>16|d,this.Z=d>>16):(this.U=32768,this.aa=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function zf(){this.ta(24,0,-8);this.b-=25}
function xf(){this.N&49152?(this.Ha|=128,this.sa(4,0,-3)):(this.B&&this.B.setData(this.u[0],!0),this.i?yf(this.i):this.fa());this.b-=7}function zf(){this.sa(16,0,-4);this.b-=25}var Af=[0,7,7,10,7,11,9,13];function Bf(a){this.J=this.b;O(this,ne(this,a));this.b=this.J-Af[this.g]}var Cf=[0,14,14,17,14,18,16,20];function Df(a){this.J=this.b;var b=ne(this,a);a=a>>6&7;be(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.J-Cf[this.g]}var Ef=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function Af(){this.N&49152?(this.Ha|=128,this.ta(4,0,-7)):(this.B&&this.B.setData(this.u[0],!0),this.i?Bf(this.i):this.fa());this.b-=7}function Cf(){this.ta(16,0,-8);this.b-=25}var Df=[0,7,7,10,7,11,9,13];function Ef(a){this.I=this.b;O(this,qe(this,a));this.b=this.I-Df[this.g]}var Ff=[0,14,14,17,14,18,16,20];function Gf(a){this.I=this.b;var b=qe(this,a);a=a>>6&7;fe(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Ff[this.g]}var Hf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function Ff(a){var b=me(this,a);this.J=this.b;Q(this,re(this,a,b));this.b=this.J-Ef[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Gf(a){var b=le(this,a);Q(this,qe(this,a,b,65535)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var Hf=[7,13,13,17,14,18,17,21]; function If(a){var b=pe(this,a);this.I=this.b;Q(this,ue(this,a,b));this.b=this.I-Hf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Jf(a){var b=oe(this,a);Q(this,te(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Kf=[7,13,13,17,14,18,17,21];
function If(a){var b=pe(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.K&128||(this.Z=b>>16,this.aa=this.Z|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Jf(){this.b-=5}function Kf(){this.N&49152||(this.v.reset(),bc(this));this.b-=667}function Lf(){ce(this);this.K|=this.N&16;this.b-=13} function Lf(a){var b=se(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.K&128||(this.Z=b>>16,this.aa=this.Z|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Mf(){this.b-=5}function Nf(){this.N&49152||(this.v.reset(),bc(this));this.b-=667}function Of(){ge(this);this.K|=this.N&16;this.b-=13}
function Mf(a){if(a&8)V.call(this,a);else{var b=de(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}function W(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.aa=0);a&8&&(this.Z=32768);this.b-=5}function Nf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Of(a){S(this,a,me(this,a),Qe);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} function Pf(a){if(a&8)V.call(this,a);else{var b=he(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}function W(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.aa=0);a&8&&(this.Z=32768);this.b-=5}function Qf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Rf(a){S(this,a,pe(this,a),Te);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function Pf(a){S(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)}function Qf(){this.sa(28,0,-5);this.b-=5}function Rf(){this.B&&(this.B.lc(this.u[7],!0),this.B.setData(this.u[0],!0));this.K|=4;Ed(this,-2);this.b-=3}function Sf(a){S(this,a,me(this,a),Te);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=yf(b)):b=!1;b||this.sa(8,0,-6)}function xd(a){Tf[a>>12].call(this,a)}function Uf(a){Vf[a>>6&3].call(this,a)} function Sf(a){S(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)}function Tf(){this.ta(28,0,-8);this.b-=5}function Uf(){this.B&&(this.B.kc(this.u[7],!0),this.B.setData(this.u[0],!0));this.K|=4;Fd(this,-2);this.b-=3}function Vf(a){S(this,a,pe(this,a),We);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Bf(b)):b=!1;b||this.ta(8,0,-8)}function yd(a){Wf[a>>12].call(this,a)}function Xf(a){Yf[a>>6&3].call(this,a)}
function Wf(a){Xf[a>>6&3].call(this,a)}function Yf(a){Zf[a>>6&3].call(this,a)}function $f(a){ag[a&15].call(this,a)}function bg(a){cg[a&15].call(this,a)}function dg(a){eg[a>>6&3].call(this,a)}function fg(a){gg[a>>6&3].call(this,a)}function hg(a){ig[a>>6&3].call(this,a)} function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a&15].call(this,a)}function eg(a){fg[a&15].call(this,a)}function gg(a){hg[a>>6&3].call(this,a)}function ig(a){jg[a>>6&3].call(this,a)}function kg(a){lg[a>>6&3].call(this,a)}
var Tf=[function(a){jg[a>>8&15].call(this,a)},Ff,tf,cf,Ze,af,Ue,V,function(a){kg[a>>8&15].call(this,a)},Gf,uf,df,$e,bf,Of,V],jg=[function(a){lg[a>>4&15].call(this,a)},qf,nf,ef,ff,lf,gf,jf,Df,Df,Uf,Wf,Yf,V,V,V],Vf=[function(a){Fd(this,re(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ge);this.b-=this.g?9:3+(7==this.f?2:0)}],Xf=[function(a){S(this,a,0, var Wf=[function(a){mg[a>>8&15].call(this,a)},If,wf,ff,bf,df,Xe,V,function(a){ng[a>>8&15].call(this,a)},Jf,xf,gf,cf,ef,Rf,V],mg=[function(a){og[a>>4&15].call(this,a)},tf,qf,hf,jf,of,kf,mf,Gf,Gf,Xf,Zf,ag,V,V,V],Yf=[function(a){Hd(this,ue(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Je);this.b-=this.g?9:3+(7==this.f?2:0)}],$f=[function(a){S(this,a,0,
Ke);this.b-=this.g?11:6},function(a){S(this,a,Ad(this)?1:0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Ad(this)?1:0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=pe(this,a);Fd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Zf=[function(a){S(this,a,0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,we);this.b-=this.g?9:3+(7==this.f?2:0)}], Ne);this.b-=this.g?11:6},function(a){S(this,a,Bd(this)?1:0,xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Bd(this)?1:0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=se(this,a);Hd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],bg=[function(a){S(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ze);this.b-=this.g?9:3+(7==this.f?2:0)}],
lg=[function(a){mg[a&15].call(this,a)},V,V,V,Bf,Bf,Bf,Bf,Mf,V,$f,bg,Pf,Pf,Pf,Pf],mg=[xf,Rf,Lf,pf,zf,Kf,V,V,V,V,V,V,V,V,V,V],ag=[Jf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],cg=[Jf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.aa=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],kg=[of,mf,hf,kf,rf,sf,Xe,Ye,wf,Qf,dg,fg,hg,V,V,V],eg=[function(a){Fd(this, og=[function(a){pg[a&15].call(this,a)},V,V,V,Ef,Ef,Ef,Ef,Pf,V,cg,eg,Sf,Sf,Sf,Sf],pg=[Af,Uf,Of,sf,Cf,Nf,V,V,V,V,V,V,V,V,V,V],dg=[Mf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],fg=[Mf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.aa=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],ng=[rf,pf,lf,nf,uf,vf,$e,af,zf,Tf,gg,ig,kg,V,V,V],hg=[function(a){Hd(this,
qe(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,He);this.b-=this.g?9:3+(7==this.f?2:0)}],gg=[function(a){R(this,a,0,Le);this.b-=this.g?11:6},function(a){R(this,a,Ad(this)?1:0,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Ad(this)?1:0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=oe(this,a);Fd(this,a<<8);this.b-=this.g?4:3+ te(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ke);this.b-=this.g?9:3+(7==this.f?2:0)}],jg=[function(a){R(this,a,0,Oe);this.b-=this.g?11:6},function(a){R(this,a,Bd(this)?1:0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Bd(this)?1:0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=re(this,a);Hd(this,a<<8);this.b-=this.g?4:3+
(7==this.f?2:0)}],ig=[function(a){R(this,a,0,Pe);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ze);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,xe);this.b-=this.g?9:3+(7==this.f?2:0)}];function yd(a){ng[a>>12].call(this,a)} (7==this.f?2:0)}],lg=[function(a){R(this,a,0,Se);this.b-=this.g?9+(this.Eb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ce);this.b-=this.g?9+(this.Eb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)}];function zd(a){qg[a>>12].call(this,a)}
var ng=[function(a){og[a>>8&15].call(this,a)},Ff,tf,cf,Ze,af,Ue,function(a){pg[a>>8&15].call(this,a)},function(a){qg[a>>8&15].call(this,a)},Gf,uf,df,$e,bf,Of,V],og=[function(a){rg[a>>4&15].call(this,a)},qf,nf,ef,ff,lf,gf,jf,Df,Df,Uf,Wf,Yf,function(a){sg[a>>6&3].call(this,a)},V,V],sg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.qa(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=je(this,a,0);be(this,a);Q(this,a);this.b-=11},function(a){var b=de(this);this.J= var qg=[function(a){rg[a>>8&15].call(this,a)},If,wf,ff,bf,df,Xe,function(a){sg[a>>8&15].call(this,a)},function(a){tg[a>>8&15].call(this,a)},Jf,xf,gf,cf,ef,Rf,V],rg=[function(a){ug[a>>4&15].call(this,a)},tf,qf,hf,jf,of,kf,mf,Gf,Gf,Xf,Zf,ag,function(a){vg[a>>6&3].call(this,a)},V,V],vg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=me(this,a,0);fe(this,a);Q(this,a);this.b-=11},function(a){var b=he(this);this.I=
this.b;ke(this,a,0,b);Q(this,b);this.b=this.J-Hf[this.g]},function(a){Q(this,re(this,a,this.Ta?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],rg=[function(a){tg[a&15].call(this,a)},V,V,V,Bf,Bf,Bf,Bf,Mf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.K|=1),this.b-=5):V.call(this,a)},$f,bg,Pf,Pf,Pf,Pf],tg=[xf,Rf,Lf,pf,zf,Kf,function(){ce(this);this.b-=13},function(){this.sa(8,0,-6)},V,V,V,V,V,V,V,V],pg=[If,If,vf,vf,Ve,Ve,We,We,Sf,Sf,V,V,V,V,Nf,Nf],qg=[of,mf,hf,kf,rf,sf,Xe,Ye,wf,Qf, this.b;ne(this,a,0,b);Q(this,b);this.b=this.I-Kf[this.g]},function(a){Q(this,ue(this,a,this.Ua?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],ug=[function(a){wg[a&15].call(this,a)},V,V,V,Ef,Ef,Ef,Ef,Pf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.K|=1),this.b-=5):V.call(this,a)},cg,eg,Sf,Sf,Sf,Sf],wg=[Af,Uf,Of,sf,Cf,Nf,function(){ge(this);this.b-=13},function(){this.ta(8,0,-8)},V,V,V,V,V,V,V,V],sg=[Lf,Lf,yf,yf,Ye,Ye,Ze,Ze,Vf,Vf,V,V,V,V,Qf,Qf],tg=[rf,pf,lf,nf,uf,vf,$e,af,zf,Tf,
dg,fg,hg,function(a){ug[a>>6&3].call(this,a)},V,V],ug=[V,function(a){a=je(this,a,65536);be(this,a);Q(this,a);this.b-=11},function(a){var b=de(this);this.J=this.b;ke(this,a,65536,b);Q(this,b);this.b=this.J-Hf[this.g]},V]; gg,ig,kg,function(a){xg[a>>6&3].call(this,a)},V,V],xg=[V,function(a){a=me(this,a,65536);fe(this,a);Q(this,a);this.b-=11},function(a){var b=he(this);this.I=this.b;ne(this,a,65536,b);Q(this,b);this.b=this.I-Kf[this.g]},V];
function vg(a){t.call(this,"ROM",a,vg);this.ga=this.g=null;this.A=a.addr;this.f=a.size;this.D=!1;this.B=a.alias;this.C=a.file;this.H=ra(this.C);if(this.C){a=this.C;var b=sa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(qb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.da,c.ga=a.ga):c.C=null);wg(c)})}}z(vg);k=vg.prototype; function yg(a){t.call(this,"ROM",a,yg);this.ga=this.g=null;this.A=a.addr;this.f=a.size;this.D=!1;this.B=a.alias;this.C=a.file;this.H=ra(this.C);if(this.C){a=this.C;var b=sa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(qb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.da,c.ga=a.ga):c.C=null);zg(c)})}}z(yg);k=yg.prototype;
k.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;wg(this)};k.Ga=function(){this.ga&&(this.i&&xg(this.i,this.id,this.A,this.f,this.ga),delete this.ga);return!0};k.Fa=function(){return!0}; k.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;zg(this)};k.Ga=function(){this.ga&&(this.i&&Sg(this.i,this.id,this.A,this.f,this.ga),delete this.ga);return!0};k.Fa=function(){return!0};
function wg(a){if(!wb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)yb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.A;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[vg.prototype.Ld,vg.prototype.De,null,null,null,a.f>>1],c);if(Gb(a.v,a,b,256,a.Ya)){b=a.D=!0;break a}}else if(xc(a.v,b,a.f,$c)){for(c=0;c<a.g.length;c++)a.v.qb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.B? function zg(a){if(!wb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)yb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.A;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[yg.prototype.Nd,yg.prototype.Fe,null,null,null,a.f>>1],c);if(Hb(a.v,a,b,256,a.Za)){b=a.D=!0;break a}}else if(xc(a.v,b,a.f,ad)){for(c=0;c<a.g.length;c++)a.v.rb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.B?
b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(c=0;c<b.length;c++){var d=a,e=b[c],f=wc(d.v,d.A,d.f);vc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Ld=function(a){return this.g[a-this.A]};k.De=function(){};Za(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new vg(d);B(d,c)}}); b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(c=0;c<b.length;c++){var d=a,e=b[c],f=wc(d.v,d.A,d.f);vc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Nd=function(a){return this.g[a-this.A]};k.Fe=function(){};Za(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new yg(d);B(d,c)}});
function yg(a){t.call(this,"RAM",a,yg);this.ga=this.g=null;this.C=a.addr;this.A=a.size;this.Ka=a.load;this.Ja=a.exec;this.B=!1;this.f=a.file;this.D=ra(this.f);if(this.f){a=this.f;var b=sa(this.D);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(qb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.da,c.ga=a.ga,null==c.Ka&&(c.Ka=a.Ka),null==c.Ja&&(c.Ja=a.Ja)):c.f=null);Sg(c)})}} function Tg(a){t.call(this,"RAM",a,Tg);this.ga=this.g=null;this.C=a.addr;this.A=a.size;this.La=a.load;this.Ka=a.exec;this.B=!1;this.f=a.file;this.D=ra(this.f);if(this.f){a=this.f;var b=sa(this.D);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(qb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.da,c.ga=a.ga,null==c.La&&(c.La=a.La),null==c.Ka&&(c.Ka=a.Ka)):c.f=null);Ug(c)})}}
z(yg);yg.prototype.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Sg(this)};yg.prototype.Ga=function(){this.ga&&(this.i&&xg(this.i,this.id,this.C,this.A,this.ga),delete this.ga);return!0};yg.prototype.Fa=function(){return!0};function Sg(a){if(a.v&&(!a.B&&a.A&&xc(a.v,a.C,a.A,Ac)&&(a.B=!0),!wb(a))){if(!a.B)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;Tg(a,a.g,a.Ka,a.Ja,a.C)}H(a)}} z(Tg);Tg.prototype.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Ug(this)};Tg.prototype.Ga=function(){this.ga&&(this.i&&Sg(this.i,this.id,this.C,this.A,this.ga),delete this.ga);return!0};Tg.prototype.Fa=function(){return!0};function Ug(a){if(a.v&&(!a.B&&a.A&&xc(a.v,a.C,a.A,Ac)&&(a.B=!0),!wb(a))){if(!a.B)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;Vg(a,a.g,a.La,a.Ka,a.C)}H(a)}}
yg.prototype.reset=function(){if(this.B){for(var a=this.v,b=this.C,c=this.A,d=b&a.v,b=b>>>a.ja;0<c&&b<a.Y.length;){var e=a.Y[b];if(e.controller&&a.g&&a.g.length==a.B.length){var f=a.g.indexOf(e);0<=f&&(e=a.B[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(zb&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.$b(d,g,e.F+d)}c-=a.ya;b++;d=0}this.g&&Tg(this,this.g,this.Ka,this.Ja,this.C,!0)}}; Tg.prototype.reset=function(){if(this.B){for(var a=this.v,b=this.C,c=this.A,d=b&a.v,b=b>>>a.ja;0<c&&b<a.Y.length;){var e=a.Y[b];if(e.controller&&a.g&&a.g.length==a.B.length){var f=a.g.indexOf(e);0<=f&&(e=a.B[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(zb&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.Zb(d,g,e.F+d)}c-=a.za;b++;d=0}this.g&&Vg(this,this.g,this.La,this.Ka,this.C,!0)}};
function Tg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.qb(n++,b[v++]&255);else n&1?a.b.fa():null==d&& function Vg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.rb(n++,b[v++]&255);else n&1?a.b.fa():null==d&&
(d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.b.qb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.Ob=d,O(a,d),!f&&a.i&&(a.fa()||pd(a.i)));return g}Za(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new yg(d);B(d,c)}});function Ug(a){t.call(this,"Keyboard",a,Ug,65536);H(this)}z(Ug);Ug.prototype.ra=function(){return!1}; (d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.b.rb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.Tb=d,O(a,d),!f&&a.i&&(a.fa()||qd(a.i)));return g}Za(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Tg(d);B(d,c)}});function Wg(a){t.call(this,"Keyboard",a,Wg,65536);H(this)}z(Wg);Wg.prototype.sa=function(){return!1};
Ug.prototype.Ea=function(a,b,c,d){this.C=a;this.b=c;this.i=d};Za(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Ug(d);B(d,c)}}); Wg.prototype.Ea=function(a,b,c,d){this.C=a;this.b=c;this.i=d};Za(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Wg(d);B(d,c)}});
function X(a){this.M=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.ca=a.upperCase;this.B=this.D=null;this.S=a.tabSize;this.O=a.charBOL;this.H=0;t.call(this,"SerialPort",a,X,8388608);var b=a.binding;if("console"==b)this.D="";else{var c;a=Vg;b&&(void 0===c&&(c="Panel"),(c=tb(c,this.id))&&(b=c.G[b])&&this.ra(null,a,b))}this.I=this.L=null;this.exports={connect:this.yc,receiveData:this.jc}}z(X);var Vg="buffer";k=X.prototype; function X(a){this.M=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.$=a.upperCase;this.B=this.D=null;this.R=a.tabSize;this.O=a.charBOL;this.H=0;t.call(this,"SerialPort",a,X,8388608);var b=a.binding;if("console"==b)this.D="";else{var c;a=Xg;b&&(void 0===c&&(c="Panel"),(c=tb(c,this.id))&&(b=c.G[b])&&this.sa(null,a,b))}this.I=this.L=null;this.exports={connect:this.xc,receiveData:this.ic}}z(X);var Xg="buffer";k=X.prototype;
k.ra=function(a,b,c){var d=this;switch(b){case Vg:return this.G[b]=this.B=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.jc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.jc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1}; k.sa=function(a,b,c){var d=this;switch(b){case Xg:return this.G[b]=this.B=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.ic(b);return!0},c.onkeypress=function(a){a=a||window.event;d.ic(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;var e=this;this.ia=Pc(48,4);this.X=Mc(this.b,function(){e.f&128||!e.A.length||(e.J=e.A.shift()&255,e.ca&&97<=e.J&&122>e.J&&(e.J-=32),e.f|=128,e.f&64&&Nc(e.b,e.ia))});this.ka=Pc(52,4);this.$=Mc(this.b,function(){e.g|=128;e.g&64&&Nc(e.b,e.ka)});Gb(b,this,Wg);H(this)}; k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;var e=this;this.ka=Qc(48,4);this.S=Nc(this.b,function(){e.f&128||!e.A.length||(e.J=e.A.shift()&255,e.$&&97<=e.J&&122>e.J&&(e.J-=32),e.f|=128,e.f&64&&Oc(e.b,e.ka))});this.X=Qc(52,4);this.ia=Nc(this.b,function(){e.g|=128;e.g&64&&Oc(e.b,e.X)});Hb(b,this,Yg);Jb(b,this.reset.bind(this));H(this)};
k.yc=function(){if(!this.I){var a=md(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Ya)return;b=xa(b[1]);if(this.I=sb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.yc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; k.xc=function(){if(!this.I){var a=nd(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Za)return;b=xa(b[1]);if(this.I=sb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.xc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
k.Fa=function(a){return a?this.save():!0};k.reset=function(){Xg(this)};k.save=function(){var a=new N(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.jc=function(a){if("number"==typeof a)this.A.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.A.push(a.charCodeAt(b));else this.A=this.A.concat(a);Oc(this.b,this.X,1E3/Math.round(this.M/10));return!0};k.Fd=function(){return this.f&65534}; k.Fa=function(a){return a?this.save():!0};k.reset=function(){Zg(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return Zg(this)};function Zg(a){a.J=0;a.f=0;a.g=128;a.A=[];return!0}k.ic=function(a){if("number"==typeof a)this.A.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.A.push(a.charCodeAt(b));else this.A=this.A.concat(a);Pc(this.b,this.S,1E3/Math.round(this.M/10));return!0};k.Hd=function(){return this.f&65534};
k.xe=function(a){this.f=this.f&-112|a&111};k.Ed=function(){this.f&=-129;0<this.A.length&&Oc(this.b,this.X,1E3/Math.round(this.M/10));return this.J};k.we=function(){};k.Zd=function(){return this.g};k.Re=function(a){128==(this.g&192)&&a&64&&Oc(this.b,this.$,1E3/Math.round(this.R/10));this.g=this.g&-70|a&69};k.Yd=function(){return 0}; k.ze=function(a){this.f=this.f&-112|a&111};k.Gd=function(){this.f&=-129;0<this.A.length&&Pc(this.b,this.S,1E3/Math.round(this.M/10));return this.J};k.ye=function(){};k.ae=function(){return this.g};k.Te=function(a){this.g&128&&a&64&&Oc(this.b,this.X);this.g=this.g&-70|a&69};k.$d=function(){return 0};
k.Qe=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);if(this.B)if(13==a)this.H=0;else if(8==a)this.B.value=this.B.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=ya[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=wa("",c)));this.O&&!this.H&&c&&(b=String.fromCharCode(this.O)+b);this.B.value+=b;this.B.scrollTop=this.B.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), k.Se=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);if(this.B)if(13==a)this.H=0;else if(8==a)this.B.value=this.B.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=ya[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.H%a,this.R&&(b=wa("",c)));this.O&&!this.H&&c&&(b=String.fromCharCode(this.O)+b);this.B.value+=b;this.B.scrollTop=this.B.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D),
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Oc(this.b,this.$,1E3/Math.round(this.R/10))}};var Yg={},Wg=(Yg[65392]=[null,null,X.prototype.Fd,X.prototype.xe,"RCSR"],Yg[65394]=[null,null,X.prototype.Ed,X.prototype.we,"RBUF"],Yg[65396]=[null,null,X.prototype.Zd,X.prototype.Re,"XCSR"],Yg[65398]=[null,null,X.prototype.Yd,X.prototype.Qe,"XBUF"],Yg);Za(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new X(d);B(d,c)}}); this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Pc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var $g={},Yg=($g[65392]=[null,null,X.prototype.Hd,X.prototype.ze,"RCSR"],$g[65394]=[null,null,X.prototype.Gd,X.prototype.ye,"RBUF"],$g[65396]=[null,null,X.prototype.ae,X.prototype.Te,"XCSR"],$g[65398]=[null,null,X.prototype.$d,X.prototype.Se,"XBUF"],$g);Za(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new X(d);B(d,c)}});
function Uc(a){t.call(this,"PC11",a,Uc);this.g=a.autoMount||null;this.D=0;this.$=a.baudReceive||3600;this.J=this.L=this.f=0;this.I=[];this.H=Zg;this.B=$g;this.M=this.A="";this.da=this.Ka=this.Ja=null;this.R=-1;this.O=!Ra("Mobi")&&window&&"FileReader"in window}z(Uc);var Zg="",$g=0;k=Uc.prototype; function Vc(a){t.call(this,"PC11",a,Vc);this.g=a.autoMount||null;this.D=0;this.$=a.baudReceive||3600;this.J=this.L=this.f=0;this.I=[];this.H=ah;this.B=bh;this.M=this.A="";this.da=this.La=this.Ka=null;this.R=-1;this.O=!Ra("Mobi")&&window&&"FileReader"in window}z(Vc);var ah="",bh=0;k=Vc.prototype;
k.ra=function(a,b,c){var d=this,e=$g;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= k.sa=function(a,b,c){var d=this,e=bh;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick=
function(){var a=d.G.listTapes;a&&ah(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;ah(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; function(){var a=d.G.listTapes;a&&ch(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;ch(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=bh(a);var e=this;if((this.g=md(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Pc(56,4);this.ca=Mc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.J<e.I.length&&(e.L=e.I[e.J++]&255,ch(e,e.J/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Nc(e.b,e.X))});Gb(b,this,dh);eh(this,"None",Zg,!0);this.O&&eh(this,"Local Tape", k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=dh(a);var e=this;if((this.g=nd(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Qc(56,4);this.ca=Nc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.J<e.I.length&&(e.L=e.I[e.J++]&255,eh(e,e.J/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Oc(e.b,e.X))});Hb(b,this,fh);Jb(b,this.reset.bind(this));gh(this,"None",ah,!0);this.O&&
"?");eh(this,"Remote Tape","??");fh(this)||H(this)};k.Ga=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function fh(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ra(b,!0)}b&&c?gh(a,c,b,1,!0):hh(a)}return!!a.D} gh(this,"Local Tape","?");gh(this,"Remote Tape","??");hh(this)||H(this)};k.Ga=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function hh(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ra(b,!0)}b&&c?ih(a,c,b,1,!0):jh(a)}return!!a.D}
function ah(a,b,c,d,e){if(c)if("?"==c)a.P('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=ra(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;gh(a,b,c,d,!1,e)}else ih(a,!1)} function ch(a,b,c,d,e){if(c)if("?"==c)a.P('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=ra(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;ih(a,b,c,d,!1,e)}else kh(a,!1)}
function gh(a,b,c,d,e,f){var g=-1;if(a.A.toLowerCase()!=c.toLowerCase()||a.B!=d)g++,ih(a,!0),a.w.ab?a.P("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),jh(a,b,c,d,f)?g++:a.w.ab=!0);g&&kh(a,a.M,a.A,a.B,a.da,a.Ka,a.Ja)} function ih(a,b,c,d,e,f){var g=-1;if(a.A.toLowerCase()!=c.toLowerCase()||a.B!=d)g++,kh(a,!0),a.w.ab?a.P("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),lh(a,b,c,d,f)?g++:a.w.ab=!0);g&&mh(a,a.M,a.A,a.B,a.da,a.La,a.Ka)}
function jh(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),kh(a,b,c,d,e),a.H="?");hh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.w.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(qb(a.Qa,e,f),(e=Ea(e,f))&&kh(a,b,c,d,e.da,e.Ka, function lh(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),mh(a,b,c,d,e),a.H="?");jh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.w.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(qb(a.Qa,e,f),(e=Ea(e,f))&&mh(a,b,c,d,e.da,e.La,
e.Ja));a.w.ab=!1;a.D&&(a.D--,a.D||H(a));hh(a)})}function eh(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} e.Ka));a.w.ab=!1;a.D&&(a.D--,a.D||H(a));jh(a)})}function gh(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function hh(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.A;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function ch(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}} function jh(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.A;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function eh(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}}
function kh(a,b,c,d,e,f,g){a.M=b;a.A=c;a.B=d;a.da=e;a.Ka=f;a.Ja=g;2==d?a.S&&Tg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.A="",a.H=Zg,a.B=$g,a.P("No load address available for tape: "+b)):(a.J=0,a.I=e,a.status("tape attached: "+b),ch(a,0))}function ih(a,b){if(a.A||!1===b)a.M="",a.A="",b||(a.B&&a.status(1==a.B?"tape detached":"tape unloaded"),a.H=Zg,a.B=$g,hh(a))}k.save=function(){return(new N(this)).data()};k.restore=function(){return!0};k.yd=function(){return this.f&65534}; function mh(a,b,c,d,e,f,g){a.M=b;a.A=c;a.B=d;a.da=e;a.La=f;a.Ka=g;2==d?a.S&&Vg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.A="",a.H=ah,a.B=bh,a.P("No load address available for tape: "+b)):(a.J=0,a.I=e,a.status("tape attached: "+b),eh(a,0))}function kh(a,b){if(a.A||!1===b)a.M="",a.A="",b||(a.B&&a.status(1==a.B?"tape detached":"tape unloaded"),a.H=ah,a.B=bh,jh(a))}k.save=function(){return(new N(this)).data()};k.restore=function(){return!0};k.Ad=function(){return this.f&65534};
k.qe=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Nc(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Oc(this.b,this.ca,1E3/Math.round(this.$/10))));this.f=this.f&-66|a&65};k.xd=function(){this.f&=-129;this.f|=2048;return this.L};k.pe=function(){};var lh={},dh=(lh[65384]=[null,null,Uc.prototype.yd,Uc.prototype.qe,"PRS"],lh[65386]=[null,null,Uc.prototype.xd,Uc.prototype.pe,"PRB"],lh); k.se=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Oc(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Pc(this.b,this.ca,1E3/Math.round(this.$/10))));this.f=this.f&-66|a&65};k.zd=function(){this.f&=-129;this.f|=2048;return this.L};k.re=function(){};var nh={},fh=(nh[65384]=[null,null,Vc.prototype.Ad,Vc.prototype.se,"PRS"],nh[65386]=[null,null,Vc.prototype.zd,Vc.prototype.re,"PRB"],nh);
function mh(a,b,c){t.call(this,"Disk",{id:a.Qa+".disk"+p(++nh,4)},mh,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.B=b;this.Xa=b.name;this.fc=b.fc;oh(this,c,b.ua,b.za,b.pa,b.La);H(this)}var nh=0;z(mh);k=mh.prototype;k.Ea=function(a,b,c,d){this.i=d}; function oh(a,b,c){t.call(this,"Disk",{id:a.Qa+".disk"+p(++ph,4)},oh,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.B=b;this.Ya=b.name;this.ec=b.ec;qh(this,c,b.ua,b.Aa,b.qa,b.Ma);H(this)}var ph=0;z(oh);k=oh.prototype;k.Ea=function(a,b,c,d){this.i=d};
function oh(a,b,c,d,e,f){a.mode=b;a.ua=c;a.za=d;a.pa=e;a.La=f;a.b=[];if("preload"!=a.mode){b=Array(a.ua);for(c=0;c<b.length;c++){d=Array(a.za);for(e=0;e<d.length;e++){f=Array(a.pa);for(var g=1;g<=f.length;g++)f[g-1]=ph(null,c,e,g,a.La,0);d[e]=f}b[c]=d}a.b=b}a.f=null} function qh(a,b,c,d,e,f){a.mode=b;a.ua=c;a.Aa=d;a.qa=e;a.Ma=f;a.b=[];if("preload"!=a.mode){b=Array(a.ua);for(c=0;c<b.length;c++){d=Array(a.Aa);for(e=0;e<d.length;e++){f=Array(a.qa);for(var g=1;g<=f.length;g++)f[g-1]=rh(null,c,e,g,a.Ma,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
function qh(a,b,c,d,e){var f=c;if(a.v)return!0;a.Xa=b;a.gb=c;a.Gc=ra(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=ka[d];if(e){a.ua=e[0];a.za=e[1];a.pa=e[2];a.La=e[3]||512;c=a.La>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ua);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.za),w=0;w<r.length;w++)for(var y=r[w]=Array(a.pa),x=0;x<y.length;x++){for(var C=ph(null,d,w,x+1,a.La,0),ia=C.data,Ja=0;Ja<c;Ja++,f+=4)var P=ia[Ja]=b.getInt32(f, function sh(a,b,c,d,e){var f=c;if(a.v)return!0;a.Ya=b;a.fb=c;a.Ic=ra(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=ka[d];if(e){a.ua=e[0];a.Aa=e[1];a.qa=e[2];a.Ma=e[3]||512;c=a.Ma>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ua);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.Aa),w=0;w<r.length;w++)for(var y=r[w]=Array(a.qa),x=0;x<y.length;x++){for(var C=rh(null,d,w,x+1,a.Ma,0),ia=C.data,Ja=0;Ja<c;Ja++,f+=4)var P=ia[Ja]=b.getInt32(f,
!0),e=e+P&-1;C.Ba=c;y[x]=C}a.f=e;c=a}else a.P("Unrecognized disk format ("+d+" bytes)");a.v&&(a.v.call(a.controller,a.B,c,a.Xa,a.gb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=sa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.fc?"":e)+"&format=json"));return!!Da(f, !0),e=e+P&-1;C.Ba=c;y[x]=C}a.f=e;c=a}else a.P("Unrecognized disk format ("+d+" bytes)");a.v&&(a.v.call(a.controller,a.B,c,a.Ya,a.fb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=sa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ec?"":e)+"&format=json"));return!!Da(f,
null,!0,function(b,c,d){rh(a,b,c,d)})} null,!0,function(b,c,d){th(a,b,c,d)})}
function rh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.w.ha;if(d)a.controller.P('Unable to load disk "'+a.Xa+'" (error '+d+": "+b+")",f);else{qb(a.controller.Qa,b,c);try{if(0<ra(a.Gc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Xa]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ function th(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.w.ha;if(d)a.controller.P('Unable to load disk "'+a.Ya+'" (error '+d+": "+b+")",f);else{qb(a.controller.Qa,b,c);try{if(0<ra(a.Ic,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Ya]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.za=h[0].length;a.pa=h[0][0].length;var l=h[0][0][0];a.La=l&&l.length||512;for(d=c=0;d<a.ua;d++)for(f=0;f<a.za;f++)for(g=0;g<a.pa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y<w;y++)r[y]=n;sh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}ph(l,d,f);for(w= c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.Aa=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Ma=l&&l.length||512;for(d=c=0;d<a.ua;d++)for(f=0;f<a.Aa;f++)for(g=0;g<a.qa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y<w;y++)r[y]=n;uh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}rh(l,d,f);for(w=
0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Xa)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.A,a.B,e,a.Xa,a.gb),a.v=null)}function ph(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ue=b;a.Ve=c;a.Pa=a.Ba=0;a.Sa=!1;return a} 0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Ya)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.A,a.B,e,a.Ya,a.fb),a.v=null)}function rh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.We=b;a.Xe=c;a.Pa=a.Ba=0;a.Ta=!1;return a}
k.seek=function(a,b,c,d,e){d=null;var f=this.B,g=this.b[a];if(g){var h=g[b];if(!h&&f.Mc&&b<f.za)for(h=g[b]=Array(f.Nc),g=0;g<h.length;g++)h[g]=ph(null,a,b,g+1,f.Ac,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Mc&&9==f.pc&&(d=h[g]=ph(null,a,b,f.pc,f.Ac,0))}}e&&e(d,!1);return d};function sh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e} k.seek=function(a,b,c,d,e){d=null;var f=this.B,g=this.b[a];if(g){var h=g[b];if(!h&&f.Oc&&b<f.Aa)for(h=g[b]=Array(f.Pc),g=0;g<h.length;g++)h[g]=rh(null,a,b,g+1,f.Cc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Oc&&9==f.oc&&(d=h[g]=rh(null,a,b,f.oc,f.Cc,0))}}e&&e(d,!1);return d};function uh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f<a.Pa?(a.Ba+=a.Pa-f,a.Pa=f):f>=a.Pa+a.Ba&&(a.Ba+=f-(a.Pa+a.Ba)+1):(a.Pa=f,a.Ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null}; k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f<a.Pa?(a.Ba+=a.Pa-f,a.Pa=f):f>=a.Pa+a.Ba&&(a.Ba+=f-(a.Pa+a.Ba)+1):(a.Pa=f,a.Ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function th(a,b){var c=a.za*a.pa,d=b/c|0;return d<a.ua?(b%=c,a.seek(d,b/a.pa|0,b%a.pa+1)):null}function uh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e} function vh(a,b){var c=a.Aa*a.qa,d=b/c|0;return d<a.ua?(b%=c,a.seek(d,b/a.qa|0,b%a.qa+1)):null}function wh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
k.save=function(){var a=0,b=[];b[a++]=[this.gb,this.f,this.ua,this.za,this.pa,this.La];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Ba){for(var h=[],l=0,m=g.Pa,n=g.Pa+g.Ba;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Pa,h]}}return b}; k.save=function(){var a=0,b=[];b[a++]=[this.fb,this.f,this.ua,this.Aa,this.qa,this.Ma];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Ba){for(var h=[],l=0,m=g.Pa,n=g.Pa+g.Ba;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Pa,h]}}return b};
k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?oh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?qh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=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;l<e;)h.data[l++]=h.pattern;l=0;h.Pa=e;for(h.Ba=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.P("Unable to restore disk '"+this.Xa+": "+c);return b}; 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;l<e;)h.data[l++]=h.pattern;l=0;h.Pa=e;for(h.Ba=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.P("Unable to restore disk '"+this.Ya+": "+c);return b};
k.toJSON=function(){var a;a=0;for(var b;b=th(this,a++);)vh(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")}; k.toJSON=function(){var a;a=0;for(var b;b=vh(this,a++);)xh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function vh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,4194304);this.B=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Ra("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype; function xh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,4194304);this.B=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Ra("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype;
k.ra=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=pa(c.value,10);null!=a&&wh(d,a)},!0;case "loadDrive":return this.G[b]= k.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=pa(c.value,10);null!=a&&yh(d,a)},!0;case "loadDrive":return this.G[b]=
c,c.onclick=function(){var a=d.G.listDisks;a&&xh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[pa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=th(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(uh(a,h,l));b=btoa(b);a=a.Gc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"), c,c.onclick=function(){var a=d.G.listDisks;a&&zh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[pa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=vh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(wh(a,h,l));b=btoa(b);a=a.Ic.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.P("No disk loaded in drive.");else d.P("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= "string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.P("No disk loaded in drive.");else d.P("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=
!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;xh(d,ra(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;zh(d,ra(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.B=md(this.C,"autoMount")||this.B)&&"string"==typeof this.B)try{this.B=eval("("+this.B+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.B+")"),this.B=null}yh(this);this.O=Pc(112,5);Gb(b,this,zh,4194304);Ah(this,"None","",!0);this.L&&Ah(this,"Local Disk","?");Ah(this,"Remote Disk","??");Bh(this)||H(this)}; k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.B=nd(this.C,"autoMount")||this.B)&&"string"==typeof this.B)try{this.B=eval("("+this.B+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.B+")"),this.B=null}Ah(this);this.O=Qc(112,5);Hb(b,this,Bh,4194304);Jb(b,this.reset.bind(this));Ch(this,"None","",!0);this.L&&Ch(this,"Local Disk","?");Ch(this,"Remote Disk","??");Dh(this)||H(this)};
k.Ga=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.sc){for(a=0;a<this.f.length;a++)Ch(this,a,!0);Bh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";wh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){yh(this)};k.save=function(){return(new N(this)).data()}; k.Ga=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.rc){for(a=0;a<this.f.length;a++)Eh(this,a,!0);Dh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";yh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){Ah(this)};k.save=function(){return(new N(this)).data()};
k.restore=function(a){return yh(this,a[0])};function Bh(a,b){b||(a.H=0);if(a.B)for(var c in a.B){var d=a.B[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=ra(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!Dh(a,g,f,e,!0)&&b&&H(a,!1);continue}a.P("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H} k.restore=function(a){return Ah(this,a[0])};function Dh(a,b){b||(a.H=0);if(a.B)for(var c in a.B){var d=a.B[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=ra(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!Fh(a,g,f,e,!0)&&b&&H(a,!1);continue}a.P("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
function xh(a,b,c,d){var e=a.G.listDrives,e=e&&pa(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Dh(a,e,b,c,!1,d)}else Ch(a,e)} function zh(a,b,c,d){var e=a.G.listDrives,e=e&&pa(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Fh(a,e,b,c,!1,d)}else Eh(a,e)}
function Dh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.gb.toLowerCase()!=d.toLowerCase()&&(g++,Ch(a,b,!0),h.ec?a.P("RL11 busy"):(h.ec=!0,e&&(h.dc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Pb=!!f,qh(new mh(a,h,"preload"),c,d,f,a.Pc)&&g++));return g} function Fh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.fb.toLowerCase()!=d.toLowerCase()&&(g++,Eh(a,b,!0),h.dc?a.P("RL11 busy"):(h.dc=!0,e&&(h.cc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,sh(new oh(a,h,"preload"),c,d,f,a.Rc)&&g++));return g}
k.Pc=function(a,b,c,d,e){var f;a.ec=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ua||f[1]>a.za)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.gc)),b=null);b?(a.Ca=b,a.Xa=c,a.gb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.gc),a.dc||e),this.C&&this.C.rb()):a.Pb=!1;a.dc&&(a.dc=!1,--this.H||H(this));wh(this,a.gc)}; k.Rc=function(a,b,c,d,e){var f;a.dc=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ua||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.fc)),b=null);b?(a.Ca=b,a.Ya=c,a.fb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.fc),a.cc||e),this.C&&this.C.sb()):a.Qb=!1;a.cc&&(a.cc=!1,--this.H||H(this));yh(this,a.fc)};
function Ah(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} function Ch(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function wh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=pa(a.value,10),c=c.Pb?"?":c.gb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Ch(a,b,c){var d=a.f[b];if(d.Ca||!1===c)d.Xa="",d.gb="",d.Ca=null,d.Pb=!1,c||(a.P("Drive RL"+b+" unloaded",c),wh(a,b))} function yh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=pa(a.value,10),c=c.Qb?"?":c.fb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Eh(a,b,c){var d=a.f[b];if(d.Ca||!1===c)d.Ya="",d.fb="",d.Ca=null,d.Qb=!1,c||(a.P("Drive RL"+b+" unloaded",c),yh(a,b))}
function yh(a,b){var c=0;b||(b=[]);a.ea=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.A=b[c++]||0;a.D=b[c++]||0;a.J=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.gc=b;d.ec=d.Pb=!1;d.name=c.Ya;d.ua=512;d.za=2;d.pa=40;d.La=256;d.fc=!0;d.Te=0;d.Se=0;d.pc=1;d.Nc=d.pa;d.Ac=d.La;d.We=0;d.Ye=null;d.Ca||(d.gb="");d.status=29|(512==d.ua?128:0)}return!0} function Ah(a,b){var c=0;b||(b=[]);a.ea=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.A=b[c++]||0;a.D=b[c++]||0;a.J=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.fc=b;d.dc=d.Qb=!1;d.name=c.Za;d.ua=512;d.Aa=2;d.qa=40;d.Ma=256;d.ec=!0;d.Ve=0;d.Ue=0;d.oc=1;d.Pc=d.qa;d.Cc=d.Ma;d.Ye=0;d.$e=null;d.Ca||(d.fb="");d.status=29|(512==d.ua?128:0)}return!0}
k.Qc=function(a,b,c,d,e,f){this.I=f&65535;this.ea=this.ea&-49|f>>12&48;this.J=f>>16&63;this.A=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.ea=this.ea|a|32768);return!0}; k.Sc=function(a,b,c,d,e,f){this.I=f&65535;this.ea=this.ea&-49|f>>12&48;this.J=f>>16&63;this.A=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.ea=this.ea|a|32768);return!0};
k.ld=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.v.hb(f,v|r<<8);if(Lc(this.v)){h=8192;break}f+=2;if(n>=l.La&&(m=null,++d>=l.pa&&(d=0,++c>=l.za&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.nd=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.v.gb(f,v|r<<8);if(Mc(this.v)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};
k.fe=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Lc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.La&&(m=null,++d>=l.pa&&(d=0,++c>=l.za&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Id=function(){return this.ea&65535}; k.he=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Mc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Kd=function(){return this.ea&65535};
k.Ae=function(a){this.ea=this.ea&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.ea&128)){var b;a=!0;var c=this.f[(this.ea&768)>>8],d,e,f,g;this.ea&=-2;switch(this.ea&14){case 4:this.g&8&&(this.ea&=63);this.D=c.status|this.A&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.A=this.g&4?this.A+b:this.A-b,this.g=this.A=this.A&65408|c);break;case 8:this.D=this.A;break;case 12:b=this.ld;case 10:b||(b=this.fe),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ua||f>=c.pa?this.ea|=37888: k.Ce=function(a){this.ea=this.ea&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.ea&128)){var b;a=!0;var c=this.f[(this.ea&768)>>8],d,e,f,g;this.ea&=-2;switch(this.ea&14){case 4:this.g&8&&(this.ea&=63);this.D=c.status|this.A&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.A=this.g&4?this.A+b:this.A-b,this.g=this.A=this.A&65408|c);break;case 8:this.D=this.A;break;case 12:b=this.nd;case 10:b||(b=this.he),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ua||f>=c.qa?this.ea|=37888:
(g=(this.J&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Qc.bind(this)))}a&&(this.ea|=129,this.ea&64&&Nc(this.b,this.O))}};k.Gd=function(){return this.I};k.ye=function(a){this.I=a&65534};k.Jd=function(){return this.g};k.Be=function(a){this.g=a};k.Kd=function(){return this.D};k.Ce=function(a){this.D=a};k.Hd=function(){return this.J};k.ze=function(a){this.J=a&63}; (g=(this.J&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Sc.bind(this)))}a&&(this.ea|=129,this.ea&64&&Oc(this.b,this.O))}};k.Id=function(){return this.I};k.Ae=function(a){this.I=a&65534};k.Ld=function(){return this.g};k.De=function(a){this.g=a};k.Md=function(){return this.D};k.Ee=function(a){this.D=a};k.Jd=function(){return this.J};k.Be=function(a){this.J=a&63};
var Eh={},zh=(Eh[63744]=[null,null,M.prototype.Id,M.prototype.Ae,"RLCS"],Eh[63746]=[null,null,M.prototype.Gd,M.prototype.ye,"RLBA"],Eh[63748]=[null,null,M.prototype.Jd,M.prototype.Be,"RLDA"],Eh[63750]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLMP"],Eh[63752]=[null,null,M.prototype.Hd,M.prototype.ze,"RLBE"],Eh);function Fh(a){t.call(this,"Debugger",a,Fh);this.ca=a.base||16;this.Aa=!1;this.J=0;this.R=!1;this.A=-1;this.g=[];this.X={}}z(Fh); var Gh={},Bh=(Gh[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Gh[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Gh[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Gh[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Gh[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Gh);function Hh(a){t.call(this,"Debugger",a,Hh);this.ca=a.base||16;this.xa=!1;this.J=0;this.R=!1;this.A=-1;this.g=[];this.X={}}z(Hh);
var Gh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Fh.prototype.vc=function(){return-1};Fh.prototype.wc=function(){}; var Ih={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Hh.prototype.tc=function(){return-1};Hh.prototype.uc=function(){};
function Hh(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.R?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a} function Jh(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.R?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a}
function Ih(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<<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;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?1:0;break;case "&":d=f&e;break; function Kh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<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;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?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} 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 Jh(a,b,c){var d;if(b){b=Kh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=xa(n);if(!n){f=!0;break}n=Lh(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],r=n.length;l.length&&Gh[n]<Gh[l[l.length-1]]&&Ih(h,l,1);l.push(n);b=b.substr(v+r)}Ih(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Mh(a,null, function Lh(a,b,c){var d;if(b){b=Mh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=xa(n);if(!n){f=!0;break}n=Nh(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],r=n.length;l.length&&Ih[n]<Ih[l[l.length-1]]&&Kh(h,l,1);l.push(n);b=b.substr(v+r)}Kh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Oh(a,null,
d))}return d}function Kh(a,b){for(var c,d=a.Aa?"(":"{",e=a.Aa?")":"}",f=new RegExp(a.Aa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Jh(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a} d))}return d}function Mh(a,b){for(var c,d=a.xa?"(":"{",e=a.xa?")":"}",f=new RegExp(a.xa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Lh(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
function Lh(a,b,c,d){var e;null!=b?(e=a.vc(b),0<=e?e=a.wc(e):(e=a.X[b],null==e&&(e=pa(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e} function Nh(a,b,c,d){var e;null!=b?(e=a.tc(b),0<=e?e=a.uc(e):(e=a.X[b],null==e&&(e=pa(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
function Mh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Nh(a,b){if(b)return Mh(a,b,a.X[b]);var c=0;for(b in a.X)Mh(a,b,a.X[b]),c++;return 0<c} function Oh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Ph(a,b){if(b)return Oh(a,b,a.X[b]);var c=0;for(b in a.X)Oh(a,b,a.X[b]),c++;return 0<c}
function J(a,b,c,d){switch(a.ca){case 8:a=qa(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d} function J(a,b,c,d){switch(a.ca){case 8:a=qa(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
function Oh(a){Fh.call(this,a);this.kb=!1;this.Aa=!0;this.L=Y(0);this.lb=Y(0);this.O=Y(0);this.I=[];this.f=this.M=this.D=[];Ph(this);this.ta=0;Qh(this);this.Na={};Rh(this,a.messages);this.Za=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return qd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return qd(b,a)})}z(Oh,Fh); function Qh(a){Hh.call(this,a);this.jb=!1;this.xa=!0;this.L=Y(0);this.kb=Y(0);this.O=Y(0);this.I=[];this.f=this.M=this.D=[];Rh(this);this.pa=0;Sh(this);this.Ja={};Th(this,a.messages);this.Ra=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return rd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return rd(b,a)})}z(Qh,Hh);
var Sh={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Th=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "), var Uh={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Vh=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),
Uh={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096], Wh={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],
33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74, 33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,
63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Vh=[0],Wh= 63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Xh=[0],Yh=
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Oh.prototype; [58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Qh.prototype;
k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.B=a.B;(a=md(a,"messages"))&&Rh(this,a);this.ub=Uh;this.Eb=1145>this.b.cb?Wh:[];Xh(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Yh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Bc[c],n&&d.j(p(n.id,8)+" %"+ k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.B=a.B;(a=nd(a,"messages"))&&Th(this,a);this.ob=Wh;this.Eb=1145>this.b.cb?Yh:[];Zh(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.ba($h(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Bc[c],n&&d.j(p(n.id,8)+" %"+
p(e<<d.v.ja,8)+" %%"+p(n.F,8)+" "+p(n.Mb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=Zc&&(c=-1),m=0);a+=d.v.ya;e++}}});H(this)}; p(e<<d.v.ja,8)+" %%"+p(n.F,8)+" "+p(n.Ob,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=$c&&(c=-1),m=0);a+=d.v.za;e++}}});H(this)};
k.ra=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ka=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",qd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.g.length-1&&(b=d.g[++d.A])):40==a.keyCode&&(0<d.A?b=d.g[--d.A]:(b="",d.A=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Ta(c,function(){if(d.ka){var a=d.ka.value; k.sa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ka=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",rd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.g.length-1&&(b=d.g[++d.A])):40==a.keyCode&&(0<d.A?b=d.g[--d.A]:(b="",d.A=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Ta(c,function(){if(d.ka){var a=d.ka.value;
d.ka.value="";qd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ta(c,function(a){var b=!1;vb(d,!0)||(ub(d,!0),b=d.jb(a?1:0),ub(d,!1));return b}),!0}return!1};k.rb=function(a){if(this.ka){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ka.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Fb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Qb?this.v.Tb(d):this.b.Tb(d),b&&Zh(a,b));return c}; d.ka.value="";rd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ta(c,function(a){var b=!1;vb(d,!0)||(ub(d,!0),b=d.ib(a?1:0),ub(d,!1));return b}),!0}return!1};k.sb=function(a){if(this.ka){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ka.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Hb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Rb?this.v.Ub(d):this.b.Ub(d),b&&ai(a,b));return c};
k.na=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Qb?this.v.bb(d):this.b.bb(d),b&&Zh(a,b));return c};k.Xb=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Qb?this.v.qb(d,b):this.b.qb(d,b),c&&Zh(a,c),this.C.oa(-1))};k.hb=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Qb?this.v.Bb(d,b):this.b.Bb(d,b),c&&Zh(a,c),this.C.oa(-1))};function Y(a,b){return{F:a,Qb:b,Oa:!1}}k.lc=function(a,b){a.F=b;a.Oa=!1;return a};function $h(a){return[a.F,a.Oa]}function ai(a){return{F:a[0],Oa:a[1]}} k.na=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Rb?this.v.bb(d):this.b.bb(d),b&&ai(a,b));return c};k.Ab=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Rb?this.v.rb(d,b):this.b.rb(d,b),c&&ai(a,c),this.C.oa(-1))};k.gb=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Rb?this.v.Bb(d,b):this.b.Bb(d,b),c&&ai(a,c),this.C.oa(-1))};function Y(a,b){return{F:a,Rb:b,Oa:!1}}k.kc=function(a,b){a.F=b;a.Oa=!1;return a};function bi(a){return[a.F,a.Oa]}function ci(a){return{F:a[0],Oa:a[1]}}
function Yh(a,b,c){var d,e=(c?a.L:a.lb).F;c=!1;if(void 0!==b){b=Kh(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.I.length;e++){var g=a.I[e].ga[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Y(d));break}}if(d=f)return d;e=Jh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function bi(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Kc=Hh(a,b.Fc=c[2]))}function Zh(a,b){null!=a.F&&(a.F+=b||1)} function $h(a,b,c){var d,e=(c?a.L:a.kb).F;c=!1;if(void 0!==b){b=Mh(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.I.length;e++){var g=a.I[e].ga[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Y(d));break}}if(d=f)return d;e=Lh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function di(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Mc=Jh(a,b.Hc=c[2]))}function ai(a,b){null!=a.F&&(a.F+=b||1)}
function Rh(a,b){a.i=a;a.ma=a.Oc=536870912;a.ia=null;a.va=[];b=Hh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Ab){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ma|=Ab[c],a.j(c+" messages enabled"))}}function Xh(a,b){for(var c in Ab)if(64==Ab[c]){a.Na[c]=b;break}} function Th(a,b){a.i=a;a.ma=a.Qc=536870912;a.ia=null;a.va=[];b=Jh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Bb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ma|=Bb[c],a.j(c+" messages enabled"))}}function Zh(a,b){for(var c in Bb)if(64==Bb[c]){a.Ja[c]=b;break}}
k.vc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SW":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function ci(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.wc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Wa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Sc(this.b):21==a&&this.B&&kc(this.B)&&(b=this.B.Va));return b}; k.tc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SW":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function ei(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.uc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Xa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Tc(this.b):21==a&&this.B&&kc(this.B)&&(b=this.B.Wa));return b};
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Kb).F));this.ma&1073741824?this.va.push(a):this.ia&&a==this.ia||(this.ia=a,this.ma&-2147483648&&this.b&&this.b.w.W&&(this.fa(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,ud(a),a.va=0,a.oa()))};function Qh(a){var b;if(!se(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.$=0;a.j("instruction history buffer allocated")}} k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Ib).F));if(this.ma&1073741824)this.va.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ma&-2147483648&&this.b&&this.b.w.W||vb(this,!0))this.fa(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,vd(a),a.wa=0,a.oa())}};
k.ib=function(a,b){if(!di(this,b))return!1;this.b.ib(a);return!0};k.jb=function(a,b,c){if(!di(this))return!1;this.J=0;a||se(this)&&te(this,this.b.u[7],0);try{a=vd(this.b,a);var d=this.b.jb(a);0<d&&(cc(this.b,d),this.J+=d,dc(this.b,d,!0),ec(this.b,d),this.wa++)}catch(e){"number"!=typeof e&&(this.J=0,yb(this.b,e.stack||e.message))}!1!==c&&this.C.oa(-1);pd(this,b||!1);return 0<this.J};k.fa=function(a){this.b&&this.b.fa(a)}; function Sh(a){var b;if(!ve(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.$=0;a.j("instruction history buffer allocated")}}k.hb=function(a,b){if(!fi(this,b))return!1;this.b.hb(a);return!0};
function pd(a,b){if(a.kb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.K&8?c.Yc|c.Xc<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+(d?" ("+d+")":""))}a.L=Y(a.b.u[7]);b&&1!=a.S?ei(a):fi(a)}}function di(a,b){var c;(c=!a.b||!wb(a.b))||(c=a.b,c.w.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.w.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!xb(a.b)}k.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; k.ib=function(a,b,c){if(!fi(this))return!1;this.J=0;a||ve(this)&&we(this,this.b.u[7],0);try{a=wd(this.b,a);var d=this.b.ib(a);0<d&&(cc(this.b,d),this.J+=d,dc(this.b,d,!0),ec(this.b,d),this.wa++)}catch(e){"number"!=typeof e&&(this.J=0,yb(this.b,e.stack||e.message))}!1!==c&&this.C.oa(-1);qd(this,b||!1);return 0<this.J};k.fa=function(a){this.b&&this.b.fa(a)};
k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Qh(this);this.wa=0;this.ia=null;this.J=0;this.L=Y(this.b.u[7]);this.w.W=!1;gi(this);a||pd(this)};k.save=function(){var a=new N(this);a.set(0,$h(this.L));a.set(1,$h(this.O));a.set(2,[this.g,this.R,this.ma]);a.set(3,this.I);return a.data()}; function qd(a,b){if(a.jb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.K&8?c.jd|c.Zc<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Ab[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?gi(a):hi(a)}}function fi(a,b){var c;(c=!a.b||!wb(a.b))||(c=a.b,c.w.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.w.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!xb(a.b)}k.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=ai(a[b++]),this.O=ai(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ma|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.w.W=!0;this.Ob=a;this.Sb=b}; k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Sh(this);this.wa=0;this.ia=null;this.J=0;this.L=Y(this.b.u[7]);this.w.W=!1;ii(this);a||qd(this)};k.save=function(){var a=new N(this);a.set(0,bi(this.L));a.set(1,bi(this.O));a.set(2,[this.g,this.R,this.ma]);a.set(3,this.I);return a.data()};
k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.J=b-this.Sb;if(!this.S){b="stopped";if(this.J){a-=this.Ob;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";se(this)&&(b+=this.wa+" instructions, ",this.wa=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}pd(this,!0);this.rb();gi(this,this.b.u[7]);this.ia=null}};function se(a){return 1<a.f.length||!!a.ta} k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=ci(a[b++]),this.O=ci(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ma|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.w.W=!0;this.Fb=a;this.Gb=b};
function te(a,b,c){var d=-1;c||(d=a.b.bb(b),0==d&&(b=Ed(a.b,2)));if(0<c&&(a.ta&&!--a.ta||hd(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.wa++,0>d&&(d=a.b.bb(b)),65535!=(d&65535)&&(a.lc(a.H[a.$],b),++a.$==a.H.length&&(a.$=0)));return!1}function yf(a){var b=a.b;if(b.w.W)throw O(b,a.b.Kb),a.fa(),-1;return!1} k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.J=b-this.Gb;if(!this.S){b="stopped";if(this.J){a-=this.Fb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";ve(this)&&(b+=this.wa+" instructions, ",this.wa=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}qd(this,!0);this.sb();ii(this,this.b.u[7]);this.ia=null}};function ve(a){return 1<a.f.length||!!a.pa}
function Ph(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.v;c=a.ba(c);id(d.Y[c>>>d.ja],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.v,c=a.ba(c),id(d.Y[c>>>d.ja],!0);a.D=["bw"];a.mb=0}k.nb=function(a,b,c){var d=!0;c||hi(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].nb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(ii(this,a,a.length-1,"set"),Qh(this)));return d}; function we(a,b,c){var d=-1;c||(d=a.b.bb(b),0==d&&(b=Fd(a.b,2)));if(0<c&&(a.pa&&!--a.pa||id(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.wa++,0>d&&(d=a.b.bb(b)),65535!=(d&65535)&&(a.kc(a.H[a.$],b),++a.$==a.H.length&&(a.$=0)));return!1}function Bf(a){var b=a.b;if(b.w.W)throw O(b,a.b.Ib),a.fa(),-1;return!1}
function hi(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Oa)){f=!0;h.Oa||e||ii(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,id(d.Y[c>>>d.ja],b==a.D));h.Oa||Qh(a);break}}return f}function ji(a,b){for(var c=1;c<b.length;c++)ii(a,b,c);return b.length-1}function ii(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Fc?' "'+c.Fc+'"':""))} function Rh(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.v;c=a.ba(c);jd(d.Y[c>>>d.ja],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.v,c=a.ba(c),jd(d.Y[c>>>d.ja],!0);a.D=["bw"];a.lb=0}k.mb=function(a,b,c){var d=!0;c||ji(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].mb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(ki(this,a,a.length-1,"set"),Sh(this)));return d};
function gi(a,b){if(void 0!==b)hd(a,b,1,a.f,!0),a.S=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Oa){if(!hi(a,a.f,c,!0))break;b=0}}} function ji(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Oa)){f=!0;h.Oa||e||ki(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,jd(d.Y[c>>>d.ja],b==a.D));h.Oa||Sh(a);break}}return f}function li(a,b){for(var c=1;c<b.length;c++)ki(a,b,c);return b.length-1}function ki(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Hc?' "'+c.Hc+'"':""))}
function hd(a,b,c,d,e){var f=!1;if(!a.mb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Oa)for(var l=a.ba(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Oa&&(hi(a,d,h,!0),e=!0);if(n=h.Kc){for(var f=!1,v=0;v<n.length;v++)if(!ki(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.w.W||(f=!0)}if(f){e||ii(a,d,g,"hit");break}}}a.mb--;return f} function ii(a,b){if(void 0!==b)id(a,b,1,a.f,!0),a.S=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Oa){if(!ji(a,a.f,c,!0))break;b=0}}}
function li(a,b,c,d){var e=Y(b.F),f=a.na(b,2),g,h;for(h in a.ub)if(g=a.ub[h][f&h])break;g||(g=Vh);var l=g[0];0<=a.Eb.indexOf(l)&&(g=Vh,l=g[0]);var m=h="",n=Th[l],v=g.length-1;l||v||(h=J(a,f));for(l=1;l<=v;l++){var r=g[l];if(void 0!==r){var w;w=a;var y=r,r=b,x="",C=y&61440;if(4096==C)r=r.F+((f&255)<<24>>23)&65535,x=J(w,r);else if(8192==C)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==C)x=J(w,f&7,1);else if(24576==C)x=J(w,f&63,1);else if(32768==C)x=J(w,f&255,1);else if(C=f&y,y&4032&&(C>>=6,y>>=6), function id(a,b,c,d,e){var f=!1;if(!a.lb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Oa)for(var l=a.ba(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Oa&&(ji(a,d,h,!0),e=!0);if(n=h.Mc){for(var f=!1,v=0;v<n.length;v++)if(!mi(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.w.W||(f=!0)}if(f){e||ki(a,d,g,"hit");break}}}a.lb--;return f}
y&63)switch(y=C&7,C&56){case 0:x=ci(y);break;case 8:x="@"+ci(y);break;case 16:7>y?x="("+ci(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+ci(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+ci(y)+")";break;case 40:x="@-("+ci(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+ci(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+ci(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); function ni(a,b,c,d){var e=Y(b.F),f=a.na(b,2),g,h;for(h in a.ob)if(g=a.ob[h][f&h])break;g||(g=Xh);var l=g[0];0<=a.Eb.indexOf(l)&&(g=Xh,l=g[0]);var m=h="",n=Vh[l],v=g.length-1;l||v||(h=J(a,f));for(l=1;l<=v;l++){var r=g[l];if(void 0!==r){var w;w=a;var y=r,r=b,x="",C=y&61440;if(4096==C)r=r.F+((f&255)<<24>>23)&65535,x=J(w,r);else if(8192==C)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==C)x=J(w,f&7,1);else if(24576==C)x=J(w,f&63,1);else if(32768==C)x=J(w,f&255,1);else if(C=f&y,y&4032&&(C>>=6,y>>=6),
0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.na(e,2)),null==e.F)break;while(e.F!=b.F)}g+=wa(f,24);g+=wa(n,5);h&&(g+=" "+h);if(c||m)g=wa(g,60)+";"+(c||""),g=a.b.w.vb?g+("cycles="+rd(a.b).toString()+" cs="+p(a.b.Hb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function mi(a,b){switch(b){case "N":a=a.b.Ta();break;case "Z":a=Cd(a.b);break;case "V":a=Bd(a.b);break;case "C":a=Ad(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} y&63)switch(y=C&7,C&56){case 0:x=ei(y);break;case 8:x="@"+ei(y);break;case 16:7>y?x="("+ei(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+ei(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+ei(y)+")";break;case 40:x="@-("+ei(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+ei(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+ei(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]);
function ni(a,b){var c="",d=a.b;8>b?(c=ci(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Wa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Sc(d)):21==b&&a.B&&kc(a.B)&&(c="SW="+J(a,a.B.Va,3));c&&(c+=" ");return c}function oi(a){var b,c="";for(b=0;6>b;b++)c+=ni(a,b);c=c+"\n"+(ni(a,6)+ni(a,7));c+=ni(a,20)+ni(a,21);return c+=mi(a,"T")+mi(a,"N")+mi(a,"Z")+mi(a,"V")+mi(a,"C")}k.qc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0}; 0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.na(e,2)),null==e.F)break;while(e.F!=b.F)}g+=wa(f,24);g+=wa(n,5);h&&(g+=" "+h);if(c||m)g=wa(g,60)+";"+(c||""),g=a.b.w.ub?g+("cycles="+sd(a.b).toString()+" cs="+p(a.b.Kb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function oi(a,b){switch(b){case "N":a=a.b.Ua();break;case "Z":a=Dd(a.b);break;case "V":a=Cd(a.b);break;case "C":a=Bd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
function xg(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],v=za(n,l,a.qc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Xe:b,F:c,Wc:d,ga:e,oc:f})}function pi(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.F>>>0,h=f.Wc;if(e>=g&&e<g+h){e=za(f.oc,[e-g],a.qc);0<=e?qi(a,b,e,d):c&&(e=~e,qi(a,b,e-1,d),qi(a,b,e,d));break}}return d} function pi(a,b){var c="",d=a.b;8>b?(c=ei(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Xa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Tc(d)):21==b&&a.B&&kc(a.B)&&(c="SW="+J(a,a.B.Wa,3));c&&(c+=" ");return c}function qi(a){var b,c="";for(b=0;6>b;b++)c+=pi(a,b);c=c+"\n"+(pi(a,6)+pi(a,7));c+=pi(a,20)+pi(a,21);return c+=oi(a,"T")+oi(a,"N")+oi(a,"Z")+oi(a,"V")+oi(a,"C")}k.pc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function qi(a,b,c,d){var e={},f=a.I[b].oc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ga[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function ri(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Nh(a)||a.j("no variables"),!0;if(!c[2])return Nh(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Jh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1} function Sg(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],v=za(n,l,a.pc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Ze:b,F:c,Wc:d,ga:e,nc:f})}function ri(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.F>>>0,h=f.Wc;if(e>=g&&e<g+h){e=za(f.nc,[e-g],a.pc);0<=e?si(a,b,e,d):c&&(e=~e,si(a,b,e-1,d),si(a,b,e,d));break}}return d}
function si(a,b,c){var d=null;if(b=Yh(a,b,!0)){a.ba(b);var e=pi(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d} function si(a,b,c,d){var e={},f=a.I[b].nc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ga[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function ti(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Ph(a)||a.j("no variables"),!0;if(!c[2])return Ph(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Lh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
function ei(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Jh(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.L=Y(d.u[7]);break;case "N":d.Z=f?32768:0;break;case "Z":d.aa= function ui(a,b,c){var d=null;if(b=$h(a,b,!0)){a.ba(b);var e=ri(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SW":if(a.B&&kc(a.B)){ic(a.B,f);break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.oa();a.j("updated registers:")}a.j(oi(a));c&&(a.L=Y(d.u[7]),fi(a,J(a,a.L.F)))}}function ti(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Mh(a,null,c[2].charCodeAt(0)):Jh(a,b,!0)} function gi(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Lh(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.L=Y(d.u[7]);break;case "N":d.Z=f?32768:0;break;case "Z":d.aa=
function ui(a,b,c){var d="t"!=b;c=Lh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Sa(c,function(){return ub(a,!0)&&a.jb(e,d,!1)},function(){a.B&&a.B.stop&&a.B.stop();a.C.oa();ub(a,!1)})} f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SW":if(a.B&&kc(a.B)){ic(a.B,f);break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.oa();a.j("updated registers:")}a.j(qi(a));c&&(a.L=Y(d.u[7]),hi(a,J(a,a.L.F)))}}function vi(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Oh(a,null,c[2].charCodeAt(0)):Lh(a,b,!0)}
function fi(a,b,c,d){if(b=Yh(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Lh(a,c.substr(1)),null!=c&&(d=c);else{d=Yh(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=vb(a,!1)||a.S?a.J:null;var g=null!=f?"cycles":null,h=pi(a,b),l=b.F;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=li(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} function wi(a,b,c){var d="t"!=b;c=Nh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Sa(c,function(){return ub(a,!0)&&a.ib(e,d,!1)},function(){a.B&&a.B.stop&&a.B.stop();a.C.oa();ub(a,!1)})}
function ki(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(wb(a)&&0<b.length){a.R&&(b="a "+J(a,a.O.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var v= function hi(a,b,c,d){if(b=$h(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Nh(a,c.substr(1)),null!=c&&(d=c);else{d=$h(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=vb(a,!1)||a.S?a.J:null;var g=null!=f?"cycles":null,h=ri(a,b),l=b.F;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=ni(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
Yh(a,g[1],!0);if(v)if(a.O=v,void 0===g[2])a.j("begin assemble at "+J(a,v.F)),a.R=!0,a.C.oa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.Xb(v,r[w],1);a.j(li(a,a.O))}}break;case "b":a:{var y=g[0],x=g[1],C=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"), function mi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(wb(a)&&0<b.length){a.R&&(b="a "+J(a,a.O.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var v=
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ia=y.charAt(1);if("l"==ia){var Ja;Ja=0+ji(a,a.f);Ja+=ji(a,a.M);(Ja+=ji(a,a.D))||a.j("no breakpoints")}else if("n"==ia)a.ta=Lh(a,x),a.j("break after "+a.ta+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=Yh(a,x,!0),!P))break a;"c"==ia?null==P.F?(Ph(a),a.j("all breakpoints cleared")):hi(a,a.f,P)||hi(a,a.M,P)||hi(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(bi(a,P,C),"p"==ia?a.nb(a.f, $h(a,g[1],!0);if(v)if(a.O=v,void 0===g[2])a.j("begin assemble at "+J(a,v.F)),a.R=!0,a.C.oa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.Ab(v,r[w],1);a.j(ni(a,a.O))}}break;case "b":a:{var y=g[0],x=g[1],C=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"),
P):"r"==ia?a.nb(a.M,P):"w"==ia?a.nb(a.D,P):a.j("unknown breakpoint command: "+ia))}}}break;case "c":a.Ra&&(a.Ra.value="");break;case "d":a:{var hb,La=g[0],la=g[1],Ma=g[2],Ni=g[3];if("?"==la){var ib="";for(hb in Ab)a.Na[hb]&&(ib&&(ib+=","),ib+=hb);ib+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history"); a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ia=y.charAt(1);if("l"==ia){var Ja;Ja=0+li(a,a.f);Ja+=li(a,a.M);(Ja+=li(a,a.D))||a.j("no breakpoints")}else if("n"==ia)a.pa=Nh(a,x),a.j("break after "+a.pa+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=$h(a,x,!0),!P))break a;"c"==ia?null==P.F?(Rh(a),a.j("all breakpoints cleared")):ji(a,a.f,P)||ji(a,a.M,P)||ji(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(di(a,P,C),"p"==ia?a.mb(a.f,
ib.length&&a.j("dump extension commands:\n\t"+ib)}else if("state"==la){var zg=vi(a.C,!0);"console"==Ma?console.log(zg):(a.Ra&&(a.Ra.value=""),a.j(zg))}else if("symbols"==la)for(var Jd=0;Jd<a.I.length;Jd++){var Kd=a.I[Jd],jb;for(jb in Kd.ga)if("."!=jb.charAt(0)){var Ag=Kd.ga[jb].o;if(void 0!==Ag){var Bg=Kd.ga[jb].l;Bg&&(jb=Bg);a.j(J(a,Ag)+" "+jb)}}}else{if("d"==La){for(hb in Ab)if(g[1]==hb){var Cg=a.Na[hb];Cg?(g.shift(),g.shift(),Cg(g)):a.j("no dump registered for "+la);break a}la||(La=a.Ub||"dw")}else a.Ub= P):"r"==ia?a.mb(a.M,P):"w"==ia?a.mb(a.D,P):a.j("unknown breakpoint command: "+ia))}}}break;case "c":a.Sa&&(a.Sa.value="");break;case "d":a:{var hb,La=g[0],la=g[1],Ma=g[2],Pi=g[3];if("?"==la){var ib="";for(hb in Bb)a.Ja[hb]&&(ib&&(ib+=","),ib+=hb);ib+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
La;if("dh"==La){var Dg=la,Eg=Ma,Fg="",Gg=0,fa=a.$,ma=a.H;if(ma.length){var Z=+Dg||a.tb,Nb=+Eg||10;isNaN(Z)?Z=Nb:Fg="more ";Z>ma.length&&(a.j("note: only "+ma.length+" available"),Z=ma.length);fa-=Z;0>fa&&(null==ma[ma.length-1].F?(Z=fa+Z,fa=0):fa+=ma.length);var Ld=[];"call"==Eg&&(Nb=1E5,Ld=["CALL"]);for(void 0!==Dg&&a.j(Z+" instructions earlier:");0<Nb&&fa!=a.$;){var Hg=ma[fa++];if(null==Hg.F)break;var Ob=Y(Hg.F),Oi=Z--,Ig=li(a,Ob,"history",Oi);(!Ld.length||0<=Ig.indexOf(Ld[0]))&&a.j(Ig);Ob.bc&&(fa+= ib.length&&a.j("dump extension commands:\n\t"+ib)}else if("state"==la){var Ag=xi(a.C,!0);"console"==Ma?console.log(Ag):(a.Sa&&(a.Sa.value=""),a.j(Ag))}else if("symbols"==la)for(var Jd=0;Jd<a.I.length;Jd++){var Kd=a.I[Jd],jb;for(jb in Kd.ga)if("."!=jb.charAt(0)){var Bg=Kd.ga[jb].o;if(void 0!==Bg){var Cg=Kd.ga[jb].l;Cg&&(jb=Cg);a.j(J(a,Bg)+" "+jb)}}}else{if("d"==La){for(hb in Bb)if(g[1]==hb){var Dg=a.Ja[hb];Dg?(g.shift(),g.shift(),Dg(g)):a.j("no dump registered for "+la);break a}la||(La=a.Tb||"dw")}else a.Tb=
Ob.bc,Nb-=Ob.bc,Z-=Ob.bc);fa>=ma.length&&(fa=0);a.tb=Z;Gg++;Nb--}}Gg||(a.j("no "+Fg+"history available"),a.tb=void 0)}else{var kb=Yh(a,la);if(kb){var Pb=0,Md=!1,Nd="ds"==La;Ma&&(Md=!0,"l"==Ma.charAt(0)&&(Md=!1,Ma=Ma.substr(1)||Ni),Pb=Lh(a,Ma)>>>0,65536<Pb&&(Pb=65536));for(var lb="dd"==La?4:"db"==La?1:2,Ec=(Md?Pb-kb.F:lb*Pb)||128,Od=Nd?16:a.ca,Pi=(Ec+Od-1)/Od|0||1,Na="";Pi--&&0<Ec;){var Oa="",Jg="",la=J(a,kb.F),Qb,mb,Rb=0,Sb=0;for(Qb=Od;0<Qb&&0<Ec;Qb-=mb,Ec-=mb){mb=1;var Fc=1==lb?a.Fb(kb,mb):a.na(kb, La;if("dh"==La){var Eg=la,Fg=Ma,Gg="",Hg=0,fa=a.$,ma=a.H;if(ma.length){var Z=+Eg||a.nb,Pb=+Fg||10;isNaN(Z)?Z=Pb:Gg="more ";Z>ma.length&&(a.j("note: only "+ma.length+" available"),Z=ma.length);fa-=Z;0>fa&&(null==ma[ma.length-1].F?(Z=fa+Z,fa=0):fa+=ma.length);var Ld=[];"call"==Fg&&(Pb=1E5,Ld=["CALL"]);for(void 0!==Eg&&a.j(Z+" instructions earlier:");0<Pb&&fa!=a.$;){var Ig=ma[fa++];if(null==Ig.F)break;var Qb=Y(Ig.F),Qi=Z--,Jg=ni(a,Qb,"history",Qi);(!Ld.length||0<=Jg.indexOf(Ld[0]))&&a.j(Jg);Qb.ac&&(fa+=
mb=2),Rb=Rb|Fc<<(Sb<<3),Sb=Sb+mb;Sb==lb&&(Nd?(Oa&&(Oa+=","),Oa+="0x"+p(Rb,2*lb)):(Oa+=J(a,Rb,lb),Oa+=1==lb?9==Qb?"-":" ":" "),Rb=Sb=0);Jg+=32<=Fc&&128>Fc?String.fromCharCode(Fc):"."}Na&&(Na+="\n");Na=Nd?Na+(Oa+","):Na+(la+" "+Oa+(0==Qb?" "+Jg:""))}Na&&a.j(Na);a.lb=kb}}}}break;case "e":if("else"==g[0])break;var nb,Pd,Qd,Rd,Sd=g[0],Td=g[1];"eb"==Sd?(nb=1,Pd=255,Qd=a.Fb,Rd=a.Xb):"e"==Sd||"ew"==Sd?(nb=2,Pd=65535,Qd=a.na,Rd=a.hb):Td=null;if(null==Td)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"), Qb.ac,Pb-=Qb.ac,Z-=Qb.ac);fa>=ma.length&&(fa=0);a.nb=Z;Hg++;Pb--}}Hg||(a.j("no "+Gg+"history available"),a.nb=void 0)}else{var kb=$h(a,la);if(kb){var Rb=0,Md=!1,Nd="ds"==La;Ma&&(Md=!0,"l"==Ma.charAt(0)&&(Md=!1,Ma=Ma.substr(1)||Pi),Rb=Nh(a,Ma)>>>0,65536<Rb&&(Rb=65536));for(var lb="dd"==La?4:"db"==La?1:2,Ec=(Md?Rb-kb.F:lb*Rb)||128,Od=Nd?16:a.ca,Ri=(Ec+Od-1)/Od|0||1,Na="";Ri--&&0<Ec;){for(var Oa="",Pd="",la=J(a,kb.F),Fc=Od,Sb=0,Tb=0;0<Fc&&0<Ec;){var mb=1,Gc=1==lb?a.Hb(kb,mb):a.na(kb,mb=2),Sb=Sb|Gc<<
a.j("\tew [a] [...] edit words at address a");else{var Gc=Yh(a,Td);if(Gc)for(var Hc=2;Hc<g.length;Hc++){var Tb=Jh(a,g[Hc]);if(void 0===Tb){a.j("unrecognized value: "+g[Hc]);break}Tb&~Pd&&a.j("warning: "+p(Tb)+" exceeds "+nb+"-byte value");a.j("changing "+J(a,Gc.F)+(F(a,64)?"":" from "+J(a,Qd.call(a,Gc),nb))+" to "+J(a,Tb,nb));Rd.call(a,Gc,Tb,nb)}}break;case "g":a:{var Kg=g[1],Qi=b;if(void 0!==Kg){var Ud=Yh(a,Kg,!0);if(!Ud)break a;bi(a,Ud,Qi);a.nb(a.f,Ud,!0)}a.ib(!0,c)}break;case "h":a.w.W?(c||a.j("halting"), (Tb<<3),Tb=Tb+mb;Tb==lb&&(Nd?(Oa&&(Oa+=","),Oa+="0x"+p(Sb,2*lb)):(Oa+=J(a,Sb,lb),Oa+=1==lb?9==Fc?"-":" ":" "),Sb=Tb=0);Fc-=mb;for(Ec-=mb;mb--;)var Qd=Gc&255,Pd=Pd+(32<=Qd&&128>Qd?String.fromCharCode(Qd):"."),Gc=Gc>>8}Na&&(Na+="\n");Na=Nd?Na+(Oa+","):Na+(la+" "+Oa+(0==Fc?" "+Pd:""))}Na&&a.j(Na);a.kb=kb}}}}break;case "e":if("else"==g[0])break;var nb,Rd,Sd,Td,Ud=g[0],Vd=g[1];"eb"==Ud?(nb=1,Rd=255,Sd=a.Hb,Td=a.Ab):"e"==Ud||"ew"==Ud?(nb=2,Rd=65535,Sd=a.na,Td=a.gb):Vd=null;if(null==Vd)a.j("edit memory commands:"),
a.fa()):vb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Vd;var Ub=b.substr(2),Ub=xa(Ub);Jh(a,Ub)?(c||a.j("true: "+Ub),Vd=!0):(c||a.j("false: "+Ub),Vd=!1);Vd||(d=!1);break}f=!0;break;case "k":var Ri=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Wd=0,Xd=Y(),Vb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Vb.F));10>Wd;){for(var Pa=null,Si=256;65536>Vb.F>>>0;){Xd.F=a.na(Vb,2);if(null==Vb.F||!Si--)break; a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Hc=$h(a,Vd);if(Hc)for(var Ic=2;Ic<g.length;Ic++){var Ub=Lh(a,g[Ic]);if(void 0===Ub){a.j("unrecognized value: "+g[Ic]);break}Ub&~Rd&&a.j("warning: "+p(Ub)+" exceeds "+nb+"-byte value");a.j("changing "+J(a,Hc.F)+(F(a,64)?"":" from "+J(a,Sd.call(a,Hc),nb))+" to "+J(a,Ub,nb));Td.call(a,Hc,Ub,nb)}}break;case "g":a:{var Kg=g[1],Si=b;if(void 0!==Kg){var Wd=$h(a,Kg,!0);if(!Wd)break a;di(a,Wd,Si);a.mb(a.f,
if(!(Xd.F&1)){for(var Ti=a,Ic=Xd,Lg=null,Wb=Ic.F,Mg=Wb,Yd=1;6>=Yd&&Wb;Yd++){if(2<Yd){Ic.F=Wb;var Jc=li(Ti,Ic);if(0<=Jc.indexOf("JSR")){var Ng=Jc.indexOf(" ");if(Wb+(Jc.indexOf(" ",Ng+1)-Ng-1)/2==Mg){Lg=Jc;break}}}Wb-=2}Ic.F=Mg;if(Pa=Lg)break}}if(!Pa||null==Pa)break;var Og=null;if("ks"==Ri){var Pg=Pa.match(/[0-9A-F]+$/);Pg&&(Og=si(a,Pg[0]))}Pa=wa(Pa,50)+" ;"+(Og||"stack="+J(a,Vb.F));a.j(Pa);Wd++}Wd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){si(a,g[1],!0);break}f=!0;break;case "m":a:{var na, Wd,!0)}a.hb(!0,c)}break;case "h":a.w.W?(c||a.j("halting"),a.fa()):vb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Xd;var Vb=b.substr(2),Vb=xa(Vb);Lh(a,Vb)?(c||a.j("true: "+Vb),Xd=!0):(c||a.j("false: "+Vb),Xd=!1);Xd||(d=!1);break}f=!0;break;case "k":var Ti=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Yd=0,Zd=Y(),Wb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Wb.F));10>Yd;){for(var Pa=null,Ui=256;65536>
oa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"==G)Ca=1878917119,G=null;else if("on"==G)oa=!0,G=null;else if("off"==G)oa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(na in Ab)if(G==na){Ca=Ab[na];oa=!!(a.ma&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.ma|=Ca,oa=!0;else if("off"==g[2]&&(a.ma&=~Ca,oa=!1,1073741824==Ca)){for(var Zd=0;Zd<a.va.length;Zd++)a.j(a.va[Zd]);a.va=[]}}var Ui=0,Xb="";for(na in Ab)if(!G||G==na){var Vi= Wb.F>>>0;){Zd.F=a.na(Wb,2);if(null==Wb.F||!Ui--)break;if(!(Zd.F&1)){for(var Vi=a,Jc=Zd,Lg=null,Xb=Jc.F,Mg=Xb,$d=1;6>=$d&&Xb;$d++){if(2<$d){Jc.F=Xb;var Kc=ni(Vi,Jc);if(0<=Kc.indexOf("JSR")){var Ng=Kc.indexOf(" ");if(Xb+(Kc.indexOf(" ",Ng+1)-Ng-1)/2==Mg){Lg=Kc;break}}}Xb-=2}Jc.F=Mg;if(Pa=Lg)break}}if(!Pa||null==Pa)break;var Og=null;if("ks"==Ti){var Pg=Pa.match(/[0-9A-F]+$/);Pg&&(Og=ui(a,Pg[0]))}Pa=wa(Pa,50)+" ;"+(Og||"stack="+J(a,Wb.F));a.j(Pa);Yd++}Yd||a.j("no return addresses found")}break;case "l":if("ln"==
!!(a.ma&Ab[na]);if(null===oa||oa==Vi)Xb&&(Xb+=","),++Ui%10||(Xb+="\n\t"),"key"==na&&(na="keys"),Xb+=na}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==oa?oa?"messages on: ":"messages off: ":"message categories:\n\t")+(Xb||"none"));Qh(a)}break;case "p":if("print"==g[0]){ti(a,b.substr(5));break}var Wi="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Qg=Y(a.b.u[7]);a.Fb(Qg);a.S?(a.nb(a.f,Qg,!0),a.ib()||(a.C&&a.C.rb(),a.S=0)):ui(a,Wi?"tr":"t")}break; g[0]){ui(a,g[1],!0);break}f=!0;break;case "m":a:{var na,oa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"==G)Ca=1878917119,G=null;else if("on"==G)oa=!0,G=null;else if("off"==G)oa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(na in Bb)if(G==na){Ca=Bb[na];oa=!!(a.ma&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.ma|=Ca,oa=!0;else if("off"==g[2]&&(a.ma&=~Ca,oa=!1,1073741824==Ca)){for(var ae=0;ae<a.va.length;ae++)a.j(a.va[ae]);
case "r":if("reset"==b){a.C&&a.C.reset();break}ei(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Yb=+g[2];if(8==Yb||10==Yb||16==Yb)a.ca=Yb;else{a.j("invalid base: "+Yb);break}}a.j("default base: "+a.ca);break;case "cs":var Zb;void 0!==g[3]&&(Zb=+g[3]);switch(g[2]){case "int":a.b.wb=Zb;break;case "start":a.b.Ib=Zb;break;case "stop":a.b.xb=Zb;break;default:a.j("unknown cs option");break a}void 0!==Zb&&od(a.b);a.j("checksums "+(a.b.w.vb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&& a.va=[]}}var Wi=0,Yb="";for(na in Bb)if(!G||G==na){var Xi=!!(a.ma&Bb[na]);if(null===oa||oa==Xi)Yb&&(Yb+=","),++Wi%10||(Yb+="\n\t"),"key"==na&&(na="keys"),Yb+=na}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==oa?oa?"messages on: ":"messages off: ":"message categories:\n\t")+(Yb||"none"));Sh(a)}break;case "p":if("print"==g[0]){vi(a,b.substr(5));break}var Yi="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Qg=Y(a.b.u[7]);a.Hb(Qg);a.S?(a.mb(a.f,
(sd(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.ob.toFixed(2)+"Mhz")+" ("+a.b.eb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":ui(a, Qg,!0),a.hb()||(a.C&&a.C.sb(),a.S=0)):wi(a,Yi?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}gi(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Zb=+g[2];if(8==Zb||10==Zb||16==Zb)a.ca=Zb;else{a.j("invalid base: "+Zb);break}}a.j("default base: "+a.ca);break;case "cs":var $b;void 0!==g[3]&&($b=+g[3]);switch(g[2]){case "int":a.b.vb=$b;break;case "start":a.b.Lb=$b;break;case "stop":a.b.wb=$b;break;default:a.j("unknown cs option");break a}void 0!==$b&&pd(a.b);a.j("checksums "+
g[0],g[1]);break;case "u":fi(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ri(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.cb+",RELEASE"+(zb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){ti(a,b.substr(1));break}var $d="commands:",ae;for(ae in Sh)$d+="\n"+wa(ae,9)+Sh[ae];se(a)||($d+="\nnote: history disabled if no exec breakpoints");a.j($d);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Rg){a.j("debugger error: "+ (a.b.w.ub?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(td(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.pb.toFixed(2)+"Mhz")+" ("+a.b.eb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),
(Rg.stack||Rg.message)),d=!1}return d}function qd(a,b,c){b=Hh(a,b,c);for(var d in b)if(!ki(a,b[+d]))return!1;return!0}Za(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Oh(d);B(d,c)}}); a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":wi(a,g[0],g[1]);break;case "u":hi(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ti(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.cb+",RELEASE"+(zb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){vi(a,b.substr(1));break}var be="commands:",ce;for(ce in Uh)be+="\n"+wa(ce,9)+Uh[ce];ve(a)||(be+="\nnote: history disabled if no exec breakpoints");a.j(be);
function wi(a,b,c){t.call(this,"Computer",a,wi,67108864);this.w.ha=!1;xi(this,b);this.L=md(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=yi;this.I=null;this.D=this.R=!1;this.$=md(this,"url")||"";(Math.random()+.1).toString(36);this.g=zi(this);if(this.b=tb("CPU",this.id)){this.i=tb("Debugger",this.id);this.v=new mc({id:this.Qa+".bus",busWidth:this.X},this.b,this.i);var d,e=rb(this.id);if((this.B=tb("Panel",this.id))&&this.B.Ra)for(b=0;b<e.length;b++)d=e[b],d.P=this.B.P,d.j=this.B.j, break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Rg){a.j("debugger error: "+(Rg.stack||Rg.message)),d=!1}return d}function rd(a,b,c){b=Jh(a,b,c);for(var d in b)if(!mi(a,b[+d]))return!1;return!0}Za(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Qh(d);B(d,c)}});
d.Ra=this.B.Ra;this.j("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ea&&d.Ea(this,this.v,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=md(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=yi),this.f&&(this.J= function yi(a,b,c){t.call(this,"Computer",a,yi,67108864);this.w.ha=!1;zi(this,b);this.L=nd(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Ai;this.I=null;this.D=this.R=!1;this.$=nd(this,"url")||"";(Math.random()+.1).toString(36);this.g=Bi(this);if(this.b=tb("CPU",this.id)){this.i=tb("Debugger",this.id);this.v=new mc({id:this.Qa+".bus",busWidth:this.X},this.b,this.i);var d,e=rb(this.id);if((this.B=tb("Panel",this.id))&&this.B.Sa)for(b=0;b<e.length;b++)d=e[b],d.P=this.B.P,d.j=this.B.j,
new N(this,"1.30.3"),Ai(this.J)?b=null:delete this.J);!b&&this.f&&(b=Bi(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.P("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.I=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Ci(this,this.Jb)}else q("Unable to find CPU component")}z(wi);var yi=0; d.Sa=this.B.Sa;this.j("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ea&&d.Ea(this,this.v,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=nd(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Ai),this.f&&(this.J=
function xi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function md(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Ci(a,b,c){for(var d=rb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!wb(f)){wb(f,function(){Ci(a,b,c)});return}}b.call(a,c)} new N(this,"1.30.3"),Ci(this.J)?b=null:delete this.J);!b&&this.f&&(b=Di(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.P("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.I=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Ei(this,this.Mb)}else q("Unable to find CPU component")}z(yi);var Ai=0;
function Di(a,b){var c=new N(a,"1.30.3","validate");if(Ai(c)&&Ei(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.P("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=wi.prototype; function zi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function nd(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Ei(a,b,c){for(var d=rb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!wb(f)){wb(f,function(){Ei(a,b,c)});return}}b.call(a,c)}
k.Jb=function(a){void 0===a&&(a=this.f||(this.I?1:yi));if(!this.C){this.C++;var b=!1,c=!1;this.O=!1;var d=this.J||new N(this,"1.30.3");if(-1==a)b=!0;else if(a>yi){if(Ai(d,this.I)){this.A=new N(this,"1.30.3","failsafe");Ai(this.A)&&(Fi(this,d),a=2,Gi(this.A));this.A.set("timestamp",Ba());Hi(this.A);var e=this.f&&!this.D;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ei(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ai(d,g):("error"== function Fi(a,b){var c=new N(a,"1.30.3","validate");if(Ci(c)&&Gi(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.P("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=yi.prototype;
f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Qa("user",""),this.g=null)):this.j(f+": "+g),Gi(d),Ai(d)?(c=Ei(d),e=!0):c=!1))}e&&Di(this,c?d:null)}else 2==a&&d.clear()}else Di(this);delete this.I;delete this.J}e=rb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Ii(this,g,d,b,c));b=[d,a,c];-1!=a?Ci(this,this.rc,b):this.rc(b)}}; k.Mb=function(a){void 0===a&&(a=this.f||(this.I?1:Ai));if(!this.C){this.C++;var b=!1,c=!1;this.O=!1;var d=this.J||new N(this,"1.30.3");if(-1==a)b=!0;else if(a>Ai){if(Ci(d,this.I)){this.A=new N(this,"1.30.3","failsafe");Ci(this.A)&&(Hi(this,d),a=2,Ii(this.A));this.A.set("timestamp",Ba());Ji(this.A);var e=this.f&&!this.D;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Gi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ci(d,g):("error"==
function Ii(a,b,c,d,e){if(!b.w.ha){b.w.ha=!0;if(b.Ga){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ga(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.f=yi,window&&window.location.reload()):a.O=!0,b.Ga(null),e=!1)}if(!d&&b.tc)for(a=b.tc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Qa("user",""),this.g=null)):this.j(f+": "+g),Ii(d),Ci(d)?(c=Gi(d),e=!0):c=!1))}e&&Fi(this,c?d:null)}else 2==a&&d.clear()}else Fi(this);delete this.I;delete this.J}e=rb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Ki(this,g,d,b,c));b=[d,a,c];-1!=a?Ei(this,this.qc,b):this.qc(b)}};
k.rc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.w.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ii(this,this.b,b,c,a),this.oa(),this.b.sb());this.O&&(Fi(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.C=0}; function Ki(a,b,c,d,e){if(!b.w.ha){b.w.ha=!0;if(b.Ga){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ga(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.f=Ai,window&&window.location.reload()):a.O=!0,b.Ga(null),e=!1)}if(!d&&b.vc)for(a=b.vc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
function Fi(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} k.qc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.w.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ki(this,this.b,b,c,a),this.oa(),this.b.tb());this.O&&(Hi(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.C=0};
function vi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ba();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Fa&&(c&&a.b.fa(),d=a.b.Fa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.w.ha=!1,!1===d&&(e=null)));for(var h=rb(a.id),l=0;l<h.length;l++){var m=h[l];m.w.ha&&(m.Fa&&(d=m.Fa(b,c),"object"===typeof d&&f.set(m.id, function Hi(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}}
d)),c&&(m.w.ha=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Ji(a,a.g,f.toString()),Hi(g)&&Hi(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.w.ha=!1,b=a.G.power)&&(b.textContent="Power");a.C=0;return e} function xi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ba();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Fa&&(c&&a.b.fa(),d=a.b.Fa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.w.ha=!1,!1===d&&(e=null)));for(var h=rb(a.id),l=0;l<h.length;l++){var m=h[l];m.w.ha&&(m.Fa&&(d=m.Fa(b,c),"object"===typeof d&&f.set(m.id,
d)),c&&(m.w.ha=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Li(a,a.g,f.toString()),Ji(g)&&Ji(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.w.ha=!1,b=a.G.power)&&(b.textContent="Power");a.C=0;return e}
k.reset=function(){this.v&&this.v.reset&&(E(this,"Resetting "+this.v.type),this.v.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=rb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.v&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.oa(-1)};k.start=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.oa(-1)}; k.reset=function(){this.v&&this.v.reset&&(E(this,"Resetting "+this.v.type),this.v.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=rb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.v&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.oa(-1)};k.start=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.oa(-1)};
k.stop=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.oa(-1)}; k.stop=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.oa(-1)};
k.oa=function(a){if(this.b){var b=this.b,c=b.G.speed;c&&(c.textContent=b.w.W&&b.$?b.$.toFixed(2)+"Mhz":"Stopped")}if(this.B&&(b=this.B,b.H)){var c=b.b.w.W,d=!!(b.b.K&4);if(!(0<a&&60>(b.J+=a))){for(var e=0;e<b.b.u.length;e++)ac(b,"R"+e,b.b.u[e]);e=Sc(b.b);ac(b,"PS",e);ac(b,"NF",e&8?1:0,1);ac(b,"ZF",e&4?1:0,1);ac(b,"VF",e&2?1:0,1);ac(b,"CF",e&1?1:0,1);b.J=0}hc(b,0<a&&c&&!d?b.b.u[7]:b.f);gc(b,b.D);a=b.b.Ua?b.b.pb&16?1:2:4;jc(b,"B22",a&1);jc(b,"B18",a&2);jc(b,"B16",a&4)}}; k.oa=function(a){if(this.b){var b=this.b,c=b.G.speed;c&&(c.textContent=b.w.W&&b.ca?b.ca.toFixed(2)+"Mhz":"Stopped")}if(this.B&&(b=this.B,b.H)){var c=b.b.w.W,d=!!(b.b.K&4);if(!(0<a&&60>(b.J+=a))){for(var e=0;e<b.b.u.length;e++)ac(b,"R"+e,b.b.u[e]);e=Tc(b.b);ac(b,"PS",e);ac(b,"NF",e&8?1:0,1);ac(b,"ZF",e&4?1:0,1);ac(b,"VF",e&2?1:0,1);ac(b,"CF",e&1?1:0,1);b.J=0}hc(b,0<a&&c&&!d?b.b.u[7]:b.f);gc(b,b.D);a=b.b.Va?b.b.qb&16?1:2:4;jc(b,"B22",a&1);jc(b,"B18",a&2);jc(b,"B16",a&4)}};
k.ra=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.w.ha?vi(d,!1,!0):Ci(d,d.Jb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.w.ha&&!d.C)if(d.f&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");vi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.sc=!0),d.Jb(yi),d.sc=!1)}else d.reset(),d.b&&d.b.sb()},!0;case "save":if(ta(Fa(),"pcjs.org"))c.parentNode.removeChild(c); k.sa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.w.ha?xi(d,!1,!0):Ei(d,d.Mb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.w.ha&&!d.C)if(d.f&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");xi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.rc=!0),d.Mb(Ai),d.rc=!1)}else d.reset(),d.b&&d.b.tb()},!0;case "save":if(ta(Fa(),"pcjs.org"))c.parentNode.removeChild(c);
else return this.G[b]=c,c.onclick=function(){var a=zi(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=vi(d,b);b?Ji(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1}; else return this.G[b]=c,c.onclick=function(){var a=Bi(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=xi(d,b);b?Li(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1};
function zi(a,b){var c=a.g;c||((c=Ka("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Ki(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c} function Bi(a,b){var c=a.g;c||((c=Ka("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Mi(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c}
function Ki(a,b){a.g=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Qa("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Bi(a){var b=null;a.g&&(b=Fa()+"/api/v1/user?req=load&user="+a.g+"&state="+Li(a,"1.30.3"));return b} function Mi(a,b){a.g=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Qa("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Di(a){var b=null;a.g&&(b=Fa()+"/api/v1/user?req=load&user="+a.g+"&state="+Ni(a,"1.30.3"));return b}
function Ji(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Li(a,"1.30.3");d.data=c;b=Da(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.P("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.P(c),Qa("user",""),a.g=null)}} function Li(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Ni(a,"1.30.3");d.data=c;b=Da(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.P("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.P(c),Qa("user",""),a.g=null)}}
function bh(a){var b;a=rb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.rb=function(a){if(this.Ra){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Ra.focus();!a&&window&&window.scrollTo(b,c)}};Za(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new wi(g,d,!0);B(g,f);g.L&&Ci(g,g.Jb)}}); function dh(a){var b;a=rb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.sb=function(a){if(this.Sa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Sa.focus();!a&&window&&window.scrollTo(b,c)}};Za(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new yi(g,d,!0);B(g,f);g.L&&Ei(g,g.Mb)}});
Ua.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.ca&&!c.w.ha&&c.Jb(-1)}});Ua.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.w.ha&&vi(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Li(a,b,c);this.i=a.i;Gi(this,a.Vc)}function Li(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a} Ua.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.ca&&!c.w.ha&&c.Mb(-1)}});Ua.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.w.ha&&xi(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Ni(a,b,c);this.i=a.i;Ii(this,a.Yc)}function Ni(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
N.prototype={constructor:N,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Gi(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c, N.prototype={constructor:N,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Ii(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
1);c=0}}};function Gi(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Hi(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);Qa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ei(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Ai(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ka(a.key))?(a[a.id]=b,a.b=!0):!1}var Mi=0; 1);c=0}}};function Ii(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Ji(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);Qa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Gi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Ci(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ka(a.key))?(a[a.id]=b,a.b=!0):!1}var Oi=0;
function Xi(a,b,c,d,e,f){e("Loading "+a+"...");Da(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Yi(h,a,b,c,d,e,f)})} function Zi(a,b,c,d,e,f){e("Loading "+a+"...");Da(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):$i(h,a,b,c,d,e,f)})}
function Yi(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(qb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"), function $i(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(qb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Zi(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)} a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?aj(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
function Zi(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, function aj(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],g);Zi(a,b,c)}})}else c(a,null)} "");a=a.replace(d[0],g);aj(a,b,c)}})}else c(a,null)}
function $i(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=va(a))}function f(a){e("Error: "+a);l&&(--Mi||ab(!0));l=!1}var g,h,l=!0;Mi++;pb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c|| function bj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=va(a))}function f(a){e("Error: "+a);l&&(--Oi||ab(!0));l=!1}var g,h,l=!0;Oi++;pb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c||
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?Xi(c,null,null,!1,e,function(d,l){l?(qb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Mi||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Mi||ab(!0)):f("invalid machine element: "+ (c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?Zi(c,null,null,!1,e,function(d,l){l?(qb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Oi||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Oi||ab(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Xi(b,a,d,!0,e,m):Yi(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return $i(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Zi(b,a,d,!0,e,m):$i(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return bj(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map

View file

@ -45,199 +45,198 @@ d.K[f++]=e[c]>>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.W=
function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va} function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va}
function ya(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function za(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Aa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var Ba={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0; function ya(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function za(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Aa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var Ba={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0;
function Fa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ga(a){Ba.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ea&&a?(Ea=!0,Ca&&Ja("init"),Da&&Ja("show")):Ea=a}function Ja(a){Ba[a]&&Ha(Ba[a])}Fa("onload",function(){Ca=!0;Ha(Ba.init)});Fa("onpageshow",function(){Da=!0;Ha(Ba.show)}); function Fa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ga(a){Ba.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ea&&a?(Ea=!0,Ca&&Ja("init"),Da&&Ja("show")):Ea=a}function Ja(a){Ba[a]&&Ha(Ba[a])}Fa("onload",function(){Ca=!0;Ha(Ba.init)});Fa("onpageshow",function(){Da=!0;Ha(Ba.show)});
Fa(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Ha(Ba.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ob=b.comment;this.mc=b;b=this.id.indexOf(".");0>b?this.ya=this.id:(this.oa=this.id.substr(0,b),this.ya=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Ea:!1,rb:!1,O:!1,error:!1};this.kb=null;this.j.error=!1;this.o={};this.F=null;y.push(this)}var Ka=void 0,La={}; Fa(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Ha(Ba.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Pb=b.comment;this.qd=b;b=this.id.indexOf(".");0>b?this.Ga=this.id:(this.pa=this.id.substr(0,b),this.Ga=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,sb:!1,N:!1,error:!1};this.kb=null;this.j.error=!1;this.o={};this.D=null;y.push(this)}var Ka=void 0,La={};
if(window){Ka||(Ka=window.location.search.substr(1));for(var Ma,Na=/\+/g,Oa=/([^&=]+)=?([^&]*)/g;Ma=Oa.exec(Ka);)La[decodeURIComponent(Ma[1].replace(Na," "))]=decodeURIComponent(Ma[2].replace(Na," "))}function Pa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} if(window){Ka||(Ka=window.location.search.substr(1));for(var Ma,Na=/\+/g,Oa=/([^&=]+)=?([^&]*)/g;Ma=Oa.exec(Ka);)La[decodeURIComponent(Ma[1].replace(Na," "))]=decodeURIComponent(Ma[2].replace(Na," "))}function Pa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function z(a,b){b||(b=x);a.prototype=Pa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Qa=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},y=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[a][b]=c)}function A(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c} function z(a,b){b||(b=x);a.prototype=Pa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Qa=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},y=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[a][b]=c)}function A(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function Sa(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function Ta(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b} function Sa(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function Ta(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
function C(a,b){b=E(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.Z(g.type,g.binding,f,g.value),l=k.length}}}} function C(a,b){b=E(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.Z(g.type,g.binding,f,g.value),l=k.length}}}}
function E(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c} function E(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Z:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Wa=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c), x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Z:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Xa=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.G=function(a){this.T(a,this.ya)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.ya+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},ka:function(){return this.j.O=!0},ja:function(a,b){b&&(this.j.O=!1);return!0}};function Ua(a,b){a.j.rb?(a.j.Ea=!1,a.j.rb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Ea=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.kb,a.kb=null,b&&b()))} this.G=function(a){this.T(a,this.Ga)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.Ga+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},ka:function(){return this.j.N=!0},ja:function(a,b){b&&(this.j.N=!1);return!0}};function Ua(a,b){a.j.sb?(a.j.Da=!1,a.j.sb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Da=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.kb,a.kb=null,b&&b()))}
function Va(a,b){b&&(a.j.ready?b():a.kb=b);return a.j.ready}function Wa(a,b){a.j.error=!0;a.G(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); function Va(a,b){b&&(a.j.ready?b():a.kb=b);return a.j.ready}function Wa(a,b){a.j.error=!0;a.G(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Xa="undefined"!==typeof ArrayBuffer; Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Xa="undefined"!==typeof ArrayBuffer;
function Ya(a){x.call(this,"Panel",a,Ya);this.da=this.i=this.c=this.m=this.w=this.s=0;this.A=this.C=this.v=!1;this.D=Za;this.f={};this.b={START:[1,1,!0,!1,this.tc],STEP:[1,1,!1,!1,this.uc],ENABLE:[1,1,!1,!1,this.pc],CONT:[1,1,!0,!1,this.nc],DEP:[0,0,!0,!1,this.oc],EXAM:[1,1,!0,!1,this.qc],LOAD:[1,1,!0,!1,this.sc],TEST:[0,0,!0,!1,this.rc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.vc,a]}z(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()}; function Ya(a){x.call(this,"Panel",a,Ya);this.da=this.i=this.c=this.m=this.w=this.s=0;this.A=this.C=this.v=!1;this.F=Za;this.g={};this.b={START:[1,1,!0,!1,this.tc],STEP:[1,1,!1,!1,this.uc],ENABLE:[1,1,!1,!1,this.pc],CONT:[1,1,!0,!1,this.nc],DEP:[0,0,!0,!1,this.oc],EXAM:[1,1,!0,!1,this.qc],LOAD:[1,1,!0,!1,this.sc],TEST:[0,0,!0,!1,this.rc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.vc,a]}z(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()};
h.Z=function(a,b,c,d){if(this.l&&this.l.Z(a,b,c,d)||this.a&&this.a.Z(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.s++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.f[b]=d?1:0,this.s++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ab(a,b)}}(this, h.Z=function(a,b,c,d){if(this.l&&this.l.Z(a,b,c,d)||this.a&&this.a.Z(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.s++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.g[b]=d?1:0,this.s++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ab(a,b)}}(this,
b),a.onmouseup=a.onmouseout=function(a,b){return function(){bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){bb(a,b)}}(this,b),!0):this.parent.Z.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.F=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.ka=function(a,b){b||(hb(),this.reset());return!0};h.ja=function(){return!0}; b),a.onmouseup=a.onmouseout=function(a,b){return function(){bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){bb(a,b)}}(this,b),!0):this.parent.Z.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.ka=function(a,b){b||(hb(),this.reset());return!0};h.ja=function(){return!0};
function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.f)ib(a,c,null!=b?b:a.f[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.b)jb(a,b,a.b[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.F&&a.F.g||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))} function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.g)ib(a,c,null!=b?b:a.g[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.b)jb(a,b,a.b[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.D&&a.D.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))}
function ab(a,b){var c=a.b[b];jb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}function bb(a,b){var c=a.b[b];c[2]&&c[3]&&(jb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.tc=function(a){a||this.a.j.P||(this.g.reset(),lb(this.a),$a(this,"ENABLE")&&mb(this.a))};h.uc=function(){};h.pc=function(a){a||G(this.a)}; function ab(a,b){var c=a.b[b];jb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}function bb(a,b){var c=a.b[b];c[2]&&c[3]&&(jb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.tc=function(a){a||this.a.j.P||(this.h.reset(),lb(this.a),$a(this,"ENABLE")&&mb(this.a))};h.uc=function(){};h.pc=function(a){a||G(this.a)};
h.nc=function(a){if(!a&&!this.a.j.P)if($a(this,"ENABLE"))mb(this.a);else{a=this.F;var b;if(b=a)a.j.Ea&&(a.j.rb=!0),b=!a.j.Ea;if(b)Ua(a,!0),a.ob(0),Ua(a,!1);else try{var c=this.a.ob(1);0<c&&(nb(this.a,c),ob(this.a,c,!0),pb(this.a,c))}catch(d){"number"!=typeof d&&Wa(this.a,d.stack||d.message)}this.stop();this.l&&this.l.xa()}};h.oc=function(a){a&&!this.a.j.P&&(this.A&&qb(this),a=rb(this,this.c),this.D==Za?this.g.nb(this.da,a):this.a.nb(this.da,a))}; h.nc=function(a){if(!a&&!this.a.j.P)if($a(this,"ENABLE"))mb(this.a);else{a=this.D;var b;if(b=a)a.j.Da&&(a.j.sb=!0),b=!a.j.Da;if(b)Ua(a,!0),a.pb(0),Ua(a,!1);else try{var c=this.a.pb(1);0<c&&(nb(this.a,c),ob(this.a,c,!0),pb(this.a,c))}catch(d){"number"!=typeof d&&Wa(this.a,d.stack||d.message)}this.stop();this.l&&this.l.ya()}};h.oc=function(a){a&&!this.a.j.P&&(this.A&&qb(this),a=rb(this,this.c),this.F==Za?this.h.ob(this.da,a):this.a.ob(this.da,a))};
h.qc=function(a){a||this.a.j.P||(this.C&&qb(this),a=this.D==Za?this.g.lb(this.da):this.a.lb(this.da),rb(this,a))};h.sc=function(a){a||this.a.j.P||sb(this,this.c)};h.rc=function(a){if(a)this.v=!0,fb(this,!0);else if(this.v=!1,fb(this),void 0!==this.o.S0){for(a=this.c=0;22>a;a++)this.b["S"+a][1]=0&1<<a?1:0;gb(this)}};h.vc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)}; h.qc=function(a){a||this.a.j.P||(this.C&&qb(this),a=this.F==Za?this.h.mb(this.da):this.a.mb(this.da),rb(this,a))};h.sc=function(a){a||this.a.j.P||sb(this,this.c)};h.rc=function(a){if(a)this.v=!0,fb(this,!0);else if(this.v=!1,fb(this),void 0!==this.o.S0){for(a=this.c=0;22>a;a++)this.b["S"+a][1]=0&1<<a?1:0;gb(this)}};h.vc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)};
function qb(a){var b=1145>a.a.La?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.g.ma;$a(a,"STEP")||(b=-b);sb(a,a.da&~c|a.da+b&c)}function sb(a,b){a.da=b&a.g.ma;b=a.da;for(var c=0;22>c;c++)tb(a,"A"+c,b&1<<c)}function rb(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)tb(a,"D"+c,b&1<<c);return a.i}function tb(a,b,c){a.f[b]=c;a.v||ib(a,b,c)}h.stop=function(){sb(this,this.a.h[7])};h.setData=function(a,b){b?this.m=a:this.i=a};h.wc=function(a){return(a?this.c:this.m)&65535};h.rd=function(a){this.m=a}; function qb(a){var b=1145>a.a.La?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.h.na;$a(a,"STEP")||(b=-b);sb(a,a.da&~c|a.da+b&c)}function sb(a,b){a.da=b&a.h.na;b=a.da;for(var c=0;22>c;c++)tb(a,"A"+c,b&1<<c)}function rb(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)tb(a,"D"+c,b&1<<c);return a.i}function tb(a,b,c){a.g[b]=c;a.v||ib(a,b,c)}h.stop=function(){sb(this,this.a.f[7])};h.setData=function(a,b){b?this.m=a:this.i=a};h.wc=function(a){return(a?this.c:this.m)&65535};h.td=function(a){this.m=a};
var ub={},db=(ub[65400]=[null,null,Ya.prototype.wc,Ya.prototype.rd,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));C(f,d);a&&F(f)}}Ga(hb); var ub={},db=(ub[65400]=[null,null,Ya.prototype.wc,Ya.prototype.td,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));C(f,d);a&&F(f)}}Ga(hb);
function vb(a,b,c){x.call(this,"Bus",a,vb);this.a=b;this.F=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.C=1<<this.I;this.ma=this.C-1;this.b=H;this.c=Math.log2(this.b);this.D=this.b>>2;this.l=this.b-1;this.A=this.C/this.b|0;this.za=[];this.f=0;this.m=!1;this.sb=0;this.w=[];this.dc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.g=Array(this.A);for(b=0;b<this.A;b++)this.g[b]=a;F(this)}z(vb);var H=8192,Bb=H-1; function vb(a,b,c){x.call(this,"Bus",a,vb);this.a=b;this.D=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.C=1<<this.I;this.na=this.C-1;this.b=H;this.c=Math.log2(this.b);this.F=this.b>>2;this.l=this.b-1;this.A=this.C/this.b|0;this.za=[];this.g=0;this.m=!1;this.tb=0;this.w=[];this.fc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.D);this.h=Array(this.A);for(b=0;b<this.A;b++)this.h[b]=a;F(this)}z(vb);var H=8192,Bb=H-1;
function wb(a,b){var c=-1,d=this.controller,e=d.za[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.za[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} function wb(a,b){var c=-1,d=this.controller,e=d.za[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.za[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255}
function xb(a,b,c){var d=!1,e=this.controller,f=e.za[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else if(g&1&&(f=e.za[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.za[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} function xb(a,b,c){var d=!1,e=this.controller,f=e.za[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else if(g&1&&(f=e.za[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.za[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}
function zb(a,b,c){var d=!1,e=this.controller;a=e.za[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,Db(a,c,H,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.ma=c-1,c-=H,a.v=Eb(a,c,H),a.i?Db(a,c,H,a.i):(Fb(a,c,H,Gb,a),a.i=Eb(a,c,H)))}}h=vb.prototype;h.reset=function(){for(var a=0;a<this.w.length;a++)this.w[a]();Cb(this,16)};h.ka=function(a,b){b||this.reset();return!0}; function zb(a,b,c){var d=!1,e=this.controller;a=e.za[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,Db(a,c,H,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.na=c-1,c-=H,a.v=Eb(a,c,H),a.i?Db(a,c,H,a.i):(Fb(a,c,H,Gb,a),a.i=Eb(a,c,H)))}}h=vb.prototype;h.reset=function(){for(var a=0;a<this.w.length;a++)this.w[a]();Cb(this,16)};h.ka=function(a,b){b||this.reset();return!0};
function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.g.length;){var l=a.g[k],n=k*a.b,p=a.b-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.pb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.pb){p=l.size-(f-n);p>g&&(p=g);l.pb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.F,l);a.g[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.sb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)} function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.h.length;){var l=a.h[k],n=k*a.b,p=a.b-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.qb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.qb){p=l.size-(f-n);p>g&&(p=g);l.qb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.D,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.tb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)}
function Eb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.g.length;)d.push(a.g[b++]),c-=a.b;return d}function Db(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.g.length;){var f=d[e++];if(!f)break;a.g[b++]=f;c-=a.b}}function Kb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.g[(b&a.ma)>>>a.c].Ab(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.g[(b&a.ma)>>>a.c].V(b&a.l,b)}h.lb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.ma)>>>this.c;this.m=!1;this.f++;a=this.g[c].Vb(b,a);this.f--;return a}; function Eb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.h.length;)d.push(a.h[b++]),c-=a.b;return d}function Db(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.h.length;){var f=d[e++];if(!f)break;a.h[b++]=f;c-=a.b}}function Kb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].Cb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].V(b&a.l,b)}h.mb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.na)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a};
h.Za=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.f++;this.g[(a&this.ma)>>>this.c].Hb(a&this.l,b&255,a);this.f--};function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.g[(b&a.ma)>>>a.c].qb(b&a.l,c&65535,b)}h.nb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.ma)>>>this.c;this.m=!1;this.f++;this.g[d].bc(c,b&65535,a);this.f--}; function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].Hb(b&a.l,c&255,b)}h.$a=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.na)>>>this.c].Ib(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].rb(b&a.l,c&65535,b)}h.ob=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.na)>>>this.c;this.m=!1;this.g++;this.h[d].dc(c,b&65535,a);this.g--};
function Ob(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.g[d];if(e.va||e.ic){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Pb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Bb;if(void 0!==a.za[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.za[n]=[d,e,f,g,l||"unknown",k,!1]}return!0} function Pb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.h[d];if(e.wa||e.kc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Qb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Bb;if(void 0!==a.za[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.za[n]=[d,e,f,g,l||"unknown",k,!1]}return!0}
function cb(a,b,c,d,e){for(var f in c){var g=+f,k=c[f];if(!(k[6]&&k[6]>a.a.La)){var l=k[0]?k[0].bind(b):null,n=k[1]?k[1].bind(b):null,p=k[2]?k[2].bind(b):null,u=k[3]?k[3].bind(b):null,w=k[5]||1;65472<=g&&65487>=g&&(!l&&p&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(p)),!n&&u&&(n=function(a){return function(b,c){return a(b,c)}.bind(b)}(u)));for(var D=k[4],U=0;U<w;U++,g+=2)if(D&&1<w&&(D=k[4]+U),!Pb(a,g,g,l,n,p,u,d||64,D||e))return!1}}return!0}function eb(a,b){a.w.push(b)} function cb(a,b,c,d,e){for(var f in c){var g=+f,k=c[f];if(!(k[6]&&k[6]>a.a.La)){var l=k[0]?k[0].bind(b):null,n=k[1]?k[1].bind(b):null,p=k[2]?k[2].bind(b):null,u=k[3]?k[3].bind(b):null,w=k[5]||1;65472<=g&&65487>=g&&(!l&&p&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(p)),!n&&u&&(n=function(a){return function(b,c){return a(b,c)}.bind(b)}(u)));for(var D=k[4],U=0;U<w;U++,g+=2)if(D&&1<w&&(D=k[4]+U),!Qb(a,g,g,l,n,p,u,d||64,D||e))return!1}}return!0}function eb(a,b){a.w.push(b)}
function J(a,b,c){a.m=!0;a.f||(c&&(a.a.ea|=c),K(a.a,4,0,b))}function Qb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){x.call(this,"Device",a,L);this.b={L:0,Fb:-1}}z(L);h=L.prototype;h.ia=function(a,b,c,d){this.g=b;this.l=a;this.a=c;this.F=d;var e=this;this.b.Fb=Rb(c,function(){e.b.Xa|=128;e.b.Xa&64&&Sb(e.a,e.b.pd);e.l&&e.l.xa(1);Tb(e.a,e.b.Fb,1E3/60)});this.b.pd=Ub(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)}; function J(a,b,c){a.m=!0;a.g||(c&&(a.a.ea|=c),K(a.a,4,0,b))}function Rb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){x.call(this,"Device",a,L);this.b={L:0,Gb:-1}}z(L);h=L.prototype;h.ia=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.D=d;var e=this;this.b.Gb=Sb(c,function(){e.b.Ya|=128;e.b.Ya&64&&Tb(e.a,e.b.rd);e.l&&e.l.ya(1);Ub(e.a,e.b.Gb,1E3/60)});this.b.rd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)};
h.reset=function(){this.b.Xa=128;Tb(this.a,this.b.Fb,1E3/60,!0)};h.Ec=function(){return this.b.Xa};h.zd=function(a){this.b.Xa=a&192};h.Gc=function(){var a=this.a;return a.w&62337|a.bb<<5|a.ab<<1};h.Bd=function(a){var b=this.a;a&=62337;if(b.w!=a){b.w=a;b.bb=a>>5&3;b.ab=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Xb(b))}};h.Hc=function(){var a=this.a.Ca;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){return this.a.Cb};h.Jc=function(){return this.a.Fa}; h.reset=function(){this.b.Ya=128;Ub(this.a,this.b.Gb,1E3/60,!0)};h.Ec=function(){return this.b.Ya};h.Bd=function(a){this.b.Ya=a&192};h.Gc=function(){var a=this.a;return a.I&62337|a.bb<<5|a.cb<<1};h.Dd=function(a){var b=this.a;a&=62337;if(b.I!=a){b.I=a;b.bb=a>>5&3;b.cb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Yb(b))}};h.Hc=function(){var a=this.a;a.I&57344||(a.Ub=a.$&65535);a=a.Ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){var a=this.a;a.I&57344||(a.Vb=a.zb);return a.Vb};
h.Cd=function(a){var b=this.a;1170>b.La&&(a&=-49);b.Fa!=a&&(b.Fa=a,b.Pb=a&16?4194303:262143,Xb(b))};h.kd=function(a){a=a>>1&63;var b=this.a.$a[a>>1];return a&1?b>>16:b&65535};h.ce=function(a,b){b=b>>1&63;var c=b>>1;this.a.$a[c]=b&1?this.a.$a[c]&65535|(a&63)<<16:this.a.$a[c]&-65536|a&65534};h.cd=function(a){return this.a.H[1][a>>1&7]};h.Wd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.ad=function(a){return this.a.H[1][(a>>1&7)+8]};h.Ud=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; h.Jc=function(){return this.a.Ea};h.Ed=function(a){var b=this.a;1170>b.La&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Sa=a&16?4194303:262143,Yb(b))};h.kd=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};h.ee=function(a,b){b=b>>1&63;var c=b>>1;this.a.ab[c]=b&1?this.a.ab[c]&65535|(a&63)<<16:this.a.ab[c]&-65536|a&65534};h.cd=function(a){return this.a.H[1][a>>1&7]};h.Yd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.ad=function(a){return this.a.H[1][(a>>1&7)+8]};
h.bd=function(a){return this.a.X[1][a>>1&7]};h.Vd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.$c=function(a){return this.a.X[1][(a>>1&7)+8]};h.Td=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Dc=function(a){return this.a.H[0][a>>1&7]};h.yd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Bc=function(a){return this.a.H[0][(a>>1&7)+8]};h.wd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Cc=function(a){return this.a.X[0][a>>1&7]}; h.Wd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.bd=function(a){return this.a.X[1][a>>1&7]};h.Xd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.$c=function(a){return this.a.X[1][(a>>1&7)+8]};h.Vd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Dc=function(a){return this.a.H[0][a>>1&7]};h.Ad=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Bc=function(a){return this.a.H[0][(a>>1&7)+8]};h.yd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};
h.xd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Ac=function(a){return this.a.X[0][(a>>1&7)+8]};h.vd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.jd=function(a){return this.a.H[3][a>>1&7]};h.be=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.gd=function(a){return this.a.H[3][(a>>1&7)+8]};h.$d=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.hd=function(a){return this.a.X[3][a>>1&7]};h.ae=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295}; h.Cc=function(a){return this.a.X[0][a>>1&7]};h.zd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Ac=function(a){return this.a.X[0][(a>>1&7)+8]};h.xd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.jd=function(a){return this.a.H[3][a>>1&7]};h.de=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.gd=function(a){return this.a.H[3][(a>>1&7)+8]};h.be=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.hd=function(a){return this.a.X[3][a>>1&7]};
h.fd=function(a){return this.a.X[3][(a>>1&7)+8]};h.Zd=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Na=function(a){a&=7;return this.a.B&2048?this.a.Ga[a]:this.a.h[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.Ga[b]=a:this.a.h[b]=a};h.Oc=function(){return this.a.B&49152?this.a.na[0]:this.a.h[6]};h.Hd=function(a){this.a.B&49152?this.a.na[0]=a:this.a.h[6]=a};h.Rc=function(){return this.a.h[7]};h.Kd=function(a){this.a.h[7]=a}; h.ce=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.fd=function(a){return this.a.X[3][(a>>1&7)+8]};h.ae=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Na=function(a){a&=7;return this.a.B&2048?this.a.Fa[a]:this.a.f[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Oc=function(){return this.a.B&49152?this.a.oa[0]:this.a.f[6]};h.Jd=function(a){this.a.B&49152?this.a.oa[0]=a:this.a.f[6]=a};h.Rc=function(){return this.a.f[7]};
h.Oa=function(a){a&=7;return this.a.B&2048?this.a.h[a]:this.a.Ga[a]};h.Qa=function(a,b){b&=7;this.a.B&2048?this.a.h[b]=a:this.a.Ga[b]=a};h.Pc=function(){return 1==(this.a.B&49152)>>14?this.a.h[6]:this.a.na[1]};h.Id=function(a){1==(this.a.B&49152)>>14?this.a.h[6]=a:this.a.na[1]=a};h.Qc=function(){return 3==(this.a.B&49152)>>14?this.a.h[6]:this.a.na[3]};h.Jd=function(a){3==(this.a.B&49152)>>14?this.a.h[6]=a:this.a.na[3]=a};h.yc=function(a){return this.a.Yb[a-65504>>1]}; h.Md=function(a){this.a.f[7]=a};h.Oa=function(a){a&=7;return this.a.B&2048?this.a.f[a]:this.a.Fa[a]};h.Qa=function(a,b){b&=7;this.a.B&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Pc=function(){return 1==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[1]};h.Kd=function(a){1==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[1]=a};h.Qc=function(){return 3==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[3]};h.Ld=function(a){3==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[3]=a};h.yc=function(a){return this.a.$b[a-65504>>1]};
h.td=function(a,b){this.a.Yb[b-65504>>1]=a};h.Ub=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.g.sb}a=(a>>6)-1}else a=0;return a};h.ac=function(){};h.ed=function(){return 1};h.Yd=function(){};h.xc=function(){return this.a.ea};h.sd=function(){this.a.ea=0};h.Fc=function(){return this.a.Xb};h.Ad=function(a,b){b&1||(a&=255);this.a.Xb=a};h.Kc=function(a){return a?this.a.Db:0};h.Dd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Db=a;b.u|=2}; h.vd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.tb}a=(a>>6)-1}else a=0;return a};h.cc=function(){};h.ed=function(){return 1};h.$d=function(){};h.xc=function(){return this.a.ea};h.ud=function(){this.a.ea=0};h.Fc=function(){return this.a.Zb};h.Cd=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Kc=function(a){return a?this.a.Eb:0};h.Fd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Eb=a;b.u|=2};
h.dd=function(a){return a?this.a.mb&65280:0};h.Xd=function(a){this.a.mb=a|255};h.Nc=function(){return Yb(this.a)};h.Gd=function(a){Zb(this.a,a&-1793|Yb(this.a)&1792);this.a.u|=128};h.$b=function(){}; h.dd=function(a){return a?this.a.nb&65280:0};h.Zd=function(a){this.a.nb=a|255};h.Nc=function(){return Zb(this.a)};h.Id=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.bc=function(){};
var M={},Wb=(M[61568]=[null,null,L.prototype.kd,L.prototype.ce,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.cd,L.prototype.Wd,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.ad,L.prototype.Ud,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.bd,L.prototype.Vd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.$c,L.prototype.Td,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Dc,L.prototype.yd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Bc,L.prototype.wd,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Cc, var M={},Wb=(M[61568]=[null,null,L.prototype.kd,L.prototype.ee,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.cd,L.prototype.Yd,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.ad,L.prototype.Wd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.bd,L.prototype.Xd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.$c,L.prototype.Vd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Dc,L.prototype.Ad,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Bc,L.prototype.yd,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Cc,
L.prototype.xd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Ac,L.prototype.vd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Jc,L.prototype.Cd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Ec,L.prototype.zd,"LKS"],M[65402]=[null,null,L.prototype.Gc,L.prototype.Bd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Hc,L.prototype.$b,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Ic,L.prototype.$b,"MMR2",1,1145],M[65408]=[null,null,L.prototype.jd,L.prototype.be,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.gd, L.prototype.zd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Ac,L.prototype.xd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Jc,L.prototype.Ed,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Ec,L.prototype.Bd,"LKS"],M[65402]=[null,null,L.prototype.Gc,L.prototype.Dd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Hc,L.prototype.bc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Ic,L.prototype.bc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.jd,L.prototype.de,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.gd,
L.prototype.$d,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.ae,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.fd,L.prototype.Zd,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET0"],M[65473]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET0"],M[65474]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET0"],M[65475]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET0"],M[65476]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET0"],M[65477]=[null,null,L.prototype.Na,L.prototype.Pa, L.prototype.be,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.ce,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.fd,L.prototype.ae,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET0"],M[65473]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET0"],M[65474]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET0"],M[65475]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET0"],M[65476]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET0"],M[65477]=[null,null,L.prototype.Na,L.prototype.Pa,
"R5SET0"],M[65478]=[null,null,L.prototype.Oc,L.prototype.Hd,"R6KERNEL"],M[65479]=[null,null,L.prototype.Rc,L.prototype.Kd,"R7KERNEL"],M[65480]=[null,null,L.prototype.Oa,L.prototype.Qa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Oa,L.prototype.Qa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Oa,L.prototype.Qa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Oa,L.prototype.Qa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Oa,L.prototype.Qa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Oa, "R5SET0"],M[65478]=[null,null,L.prototype.Oc,L.prototype.Jd,"R6KERNEL"],M[65479]=[null,null,L.prototype.Rc,L.prototype.Md,"R7KERNEL"],M[65480]=[null,null,L.prototype.Oa,L.prototype.Qa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Oa,L.prototype.Qa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Oa,L.prototype.Qa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Oa,L.prototype.Qa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Oa,L.prototype.Qa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Oa,
L.prototype.Qa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Pc,L.prototype.Id,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Qc,L.prototype.Jd,"R6USER",1,1145],M[65504]=[null,null,L.prototype.yc,L.prototype.td,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Ub,L.prototype.ac,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Ub,L.prototype.ac,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.ed,L.prototype.Yd,"SYSID",1,1170],M[65526]=[null,null,L.prototype.xc,L.prototype.sd,"CPUERR",1,1170],M[65528]= L.prototype.Qa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Pc,L.prototype.Kd,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Qc,L.prototype.Ld,"R6USER",1,1145],M[65504]=[null,null,L.prototype.yc,L.prototype.vd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Wb,L.prototype.cc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Wb,L.prototype.cc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.ed,L.prototype.$d,"SYSID",1,1170],M[65526]=[null,null,L.prototype.xc,L.prototype.ud,"CPUERR",1,1170],M[65528]=
[null,null,L.prototype.Fc,L.prototype.Ad,"MB",1,1170],M[65530]=[null,null,L.prototype.Kc,L.prototype.Dd,"PIR"],M[65532]=[null,null,L.prototype.dd,L.prototype.Xd,"SL"],M[65534]=[null,null,L.prototype.Nc,L.prototype.Gd,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new L(c);C(c,d);break;case "pc11":c=new $b(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var ac; [null,null,L.prototype.Fc,L.prototype.Cd,"MB",1,1170],M[65530]=[null,null,L.prototype.Kc,L.prototype.Fd,"PIR"],M[65532]=[null,null,L.prototype.dd,L.prototype.Zd,"SL"],M[65534]=[null,null,L.prototype.Nc,L.prototype.Id,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new L(c);C(c,d);break;case "pc11":c=new ac(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var bc;
if(Xa){var bc=new ArrayBuffer(2);(new DataView(bc)).setUint16(0,256,!0);ac=256===(new Uint16Array(bc))[0]}else ac=!1;var cc=ac; if(Xa){var cc=new ArrayBuffer(2);(new DataView(cc)).setUint16(0,256,!0);bc=256===(new Uint16Array(cc))[0]}else bc=!1;var dc=bc;
function I(a,b,c,d,e,f){this.g=a;this.id=dc+=2;this.a=null;this.Ka=b;this.pb=c;this.size=d||0;this.type=e||ec;this.l=e==fc;this.controller=null;Ab(this);this.va=this.ic=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],gc(this,f.dc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),gc(this,cc?hc:ic);else{a=this.a=Array(this.size>> function I(a,b,c,d,e,f){this.h=a;this.id=ec+=2;this.a=null;this.Ka=b;this.qb=c;this.size=d||0;this.type=e||fc;this.l=e==gc;this.controller=null;Ab(this);this.wa=this.kc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],hc(this,f.fc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;gc(this,jc)}else gc(this)}var ec=0,Ib=1,fc=2,Gb=4,Jb=["NONE","RAM","ROM","VID","H/W"],dc=0; 2);for(f=0;f<a.length;f++)a[f]=0;hc(this,kc)}else hc(this)}var fc=0,Ib=1,gc=2,Gb=4,Jb=["NONE","RAM","ROM","VID","H/W"],ec=0;
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Xa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Xa)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.va=!0}return!1},v:function(a,b){J(this.g,b,32);return 255},f:function(a,b,c){J(this.g,c,32)},w:function(a,b){return this.Ab(a++,b++)| I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Xa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Xa)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.wa=!0}return!1},v:function(a,b){J(this.h,b,32);return 255},g:function(a,b,c){J(this.h,c,32)},w:function(a,b){return this.Cb(a++,b++)|
this.Ab(a,b)<<8},A:function(a,b,c){this.Gb(a++,b&255,c++);this.Gb(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a,b){a&1&&J(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},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.va=!0},ya:function(a,b,c){a&1&&J(this.g,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256| this.Cb(a,b)<<8},A:function(a,b,c){this.Hb(a++,b&255,c++);this.Hb(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.wa=!0},va:function(a,b,c){a&1&&J(this.h,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
b>>8);this.va=!0},D:function(a,b){return this.I(a,b)},R:function(a,b){return this.Vb(a,b)},pa:function(a,b,c){this.l?this.f(a,b,c):this.Hb(a,b,c)},ta:function(a,b,c){this.l?this.f(a,b,c):this.bc(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},N:function(a,b){a&1&&J(this.g,b,64);return this.c.getUint16(a,!0)},$:function(a,b){a&1&&J(this.g,b,64);return this.s[a>>1]},oa:function(a,b){this.o[a]=b;this.va=!0},qa:function(a,b){this.o[a]=b;this.va=!0},sa:function(a,b,c){a&1&&J(this.g, b>>8);this.wa=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Xb(a,b)},pa:function(a,b,c){this.l?this.g(a,b,c):this.Ib(a,b,c)},ta:function(a,b,c){this.l?this.g(a,b,c):this.dc(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},$:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},la:function(a,b){this.o[a]=b;this.wa=!0},qa:function(a,b){this.o[a]=b;this.wa=!0},sa:function(a,b,c){a&1&&J(this.h,
c,64);this.c.setUint16(a,b,!0);this.va=!0},ua:function(a,b,c){a&1&&J(this.g,c,64);this.s[a>>1]=b;this.va=!0}};function Ab(a,b,c){a.F=b;a.i=a.m=0;c&&((a.i=c.i)&&lc(a,mc,!1),(a.m=c.m)&&nc(a,mc,!1))}function nc(a,b,c){c&&a.m||(a.Gb=!a.l&&b[1]||a.f,a.qb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Hb=b[1]||a.f,a.bc=b[3]||a.A}function lc(a,b,c){c&&a.i||(a.Ab=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Vb=b[2]||a.w}function gc(a,b){b||(b=oc);lc(a,b,void 0);nc(a,b,void 0)} c,64);this.c.setUint16(a,b,!0);this.wa=!0},ua:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.wa=!0}};function Ab(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&mc(a,nc,!1),(a.m=c.m)&&oc(a,nc,!1))}function oc(a,b,c){c&&a.m||(a.Hb=!a.l&&b[1]||a.g,a.rb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Ib=b[1]||a.g,a.dc=b[3]||a.A}function mc(a,b,c){c&&a.i||(a.Cb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Xb=b[2]||a.w}function hc(a,b){b||(b=pc);mc(a,b,void 0);oc(a,b,void 0)}
var oc=[],jc=[I.prototype.M,I.prototype.ra,I.prototype.aa,I.prototype.ya],mc=[I.prototype.D,I.prototype.pa,I.prototype.R,I.prototype.ta];if(Xa)var ic=[I.prototype.C,I.prototype.oa,I.prototype.N,I.prototype.sa],hc=[I.prototype.J,I.prototype.qa,I.prototype.$,I.prototype.ua]; var pc=[],kc=[I.prototype.M,I.prototype.ra,I.prototype.aa,I.prototype.va],nc=[I.prototype.F,I.prototype.pa,I.prototype.R,I.prototype.ta];if(Xa)var jc=[I.prototype.C,I.prototype.la,I.prototype.O,I.prototype.sa],ic=[I.prototype.J,I.prototype.qa,I.prototype.$,I.prototype.ua];
function pc(a,b){x.call(this,"CPU",a,pc);var c=a.multiplier||1;this.hb=a.cycles||b;this.sa=c;this.xb=Math.round(this.hb/1E4)/100;this.Ha=this.xb*this.sa;this.j.P=!1;this.j.Eb=!1;this.j.Va=a.autoStart;this.j.gb=!1;this.eb=this.Ia=0;this.fb=a.csStart;this.Ra=a.csInterval;this.Sa=a.csStop;this.J=[];this.Tb=this.od.bind(this);F(this)}z(pc);var qc=["power","reset"];h=pc.prototype; function qc(a,b){x.call(this,"CPU",a,qc);var c=a.multiplier||1;this.jb=a.cycles||b;this.ta=c;this.Ab=Math.round(this.jb/1E4)/100;this.Ha=this.Ab*this.ta;this.j.P=!1;this.j.Fb=!1;this.j.Wa=a.autoStart;this.j.fb=!1;this.gb=this.Ia=0;this.hb=a.csStart;this.Ta=a.csInterval;this.Ua=a.csStop;this.J=[];this.Tb=this.od.bind(this);F(this)}z(qc);var rc=["power","reset"];h=qc.prototype;
h.ia=function(a,b,c,d){this.l=a;this.g=b;this.F=d;this.A=a.A;for(b=0;b<qc.length;b++)(c=this.o[qc[b]])&&this.l.Z(null,qc[b],c);a=rc(a,"autoStart");null!=a&&(this.j.Va="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ka=function(a,b){if(!b){if(a&&this.restore){sc(this);if(!this.restore(a))return!1;tc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ja=function(a){return a?this.save():!0}; h.ia=function(a,b,c,d){this.l=a;this.h=b;this.D=d;this.w=a.w;for(b=0;b<rc.length;b++)(c=this.o[rc[b]])&&this.l.Z(null,rc[b],c);a=sc(a,"autoStart");null!=a&&(this.j.Wa="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ka=function(a,b){if(!b){if(a&&this.restore){tc(this);if(!this.restore(a))return!1;uc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ja=function(a){return a?this.save():!0};
h.Va=function(){return this.j.Va||void 0===this.o.run?(mb(this),!0):!1};h.Lb=function(){return 0};function tc(a){void 0===a.fb&&(a.fb=0);void 0===a.Ra&&(a.Ra=-1);void 0===a.Sa&&(a.Sa=-1);a.j.gb=0<=a.fb&&0<a.Ra;a.j.gb&&(a.eb=0,a.Ia=a.fb-a.ua)}function pb(a,b){if(a.j.gb){var c=!1;a.eb=a.eb+a.Lb()|0;a.Ia-=b;0>=a.Ia&&(a.Ia+=a.Ra,c=!0);0<=a.Sa&&a.Sa<=uc(a)&&(a.Ra=a.Sa=-1,tc(a),G(a),c=!0);c&&a.T(uc(a)+" cycles: checksum="+m(a.eb))}} h.Wa=function(){return this.j.Wa||void 0===this.o.run?(mb(this),!0):!1};h.Mb=function(){return 0};function uc(a){void 0===a.hb&&(a.hb=0);void 0===a.Ta&&(a.Ta=-1);void 0===a.Ua&&(a.Ua=-1);a.j.fb=0<=a.hb&&0<a.Ta;a.j.fb&&(a.gb=0,a.Ia=a.hb-a.va)}function pb(a,b){if(a.j.fb){var c=!1;a.gb=a.gb+a.Mb()|0;a.Ia-=b;0>=a.Ia&&(a.Ia+=a.Ta,c=!0);0<=a.Ua&&a.Ua<=vc(a)&&(a.Ta=a.Ua=-1,uc(a),G(a),c=!0);c&&a.T(vc(a)+" cycles: checksum="+m(a.gb))}}
h.Z=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.O)a=!0;else{var b=null,c,k=A(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.O);c++);c==k.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.kb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.P?G(d):mb(d))},!0;case "speed":return this.o[b]= h.Z=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.N)a=!0;else{var b=null,c,k=A(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.N);c++);c==k.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.kb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.P?G(d):mb(d))},!0;case "speed":return this.o[b]=
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){vc(d,d.sa<<1,!0)},c.textContent=this.Ha.toFixed(2)+"Mhz",!0}return!1};h.xa=function(a){this.l&&this.l.xa(a)};function ob(a,b,c){a.ua+=b;c&&(a.ra=a.a=a.I=0)}function wc(a,b){var c=1;b&&1<a.sa&&a.pa&&(c=a.pa/a.xb);a.Qb=Math.round(1E3/30);a.ib=Math.floor(a.hb/30*c);b||(a.Ta=a.ib);a.yb=0}function uc(a){return a.ua+a.aa+a.ra-a.a}function sc(a){a.pa=0;a.Rb=0;a.ua=a.aa=a.ra=a.a=a.I=0;tc(a);vc(a,1)} c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){wc(d,d.ta<<1,!0)},c.textContent=this.Ha.toFixed(2)+"Mhz",!0}return!1};h.ya=function(a){this.l&&this.l.ya(a)};function ob(a,b,c){a.va+=b;c&&(a.sa=a.a=a.F=0)}function xc(a,b){var c=1;b&&1<a.ta&&a.qa&&(c=a.qa/a.Ab);a.Rb=Math.round(1E3/30);a.lb=Math.floor(a.jb/30*c);b||(a.Va=a.lb);a.Bb=0}function vc(a){return a.va+a.la+a.sa-a.a}function tc(a){a.qa=0;a.Sb=0;a.va=a.la=a.sa=a.a=a.F=0;uc(a);wc(a,1)}
function vc(a,b,c){if(void 0!==b){.8>a.pa/a.Ha&&(b=1);a.sa=b;b=a.xb*a.sa;if(a.Ha!=b){a.Ha=b;b=a.Ha.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&xc(a.l)}ob(a,a.aa);a.aa=0;a.$=ra();a.qa=0;wc(a)}function Rb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Tb(a,b,c,d){0<=b&&b<a.J.length&&(d||0>a.J[b][0])&&(c=a.hb*a.sa/1E3*c|0,a.j.P&&(c+=yc(a)),a.J[b][0]=c)} function wc(a,b,c){if(void 0!==b){.8>a.qa/a.Ha&&(b=1);a.ta=b;b=a.Ab*a.ta;if(a.Ha!=b){a.Ha=b;b=a.Ha.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&yc(a.l)}ob(a,a.la);a.la=0;a.aa=ra();a.ra=0;xc(a)}function Sb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Ub(a,b,c,d){0<=b&&b<a.J.length&&(d||0>a.J[b][0])&&(c=a.jb*a.ta/1E3*c|0,a.j.P&&(c+=zc(a)),a.J[b][0]=c)}
function nb(a,b){for(var c=a.J.length-1;0<=c;c--){var d=a.J[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function yc(a,b){var c=a.ra-=a.a;a.a=a.I=0;b&&(a.ra=0);return c} function nb(a,b){for(var c=a.J.length-1;0<=c;c--){var d=a.J[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function zc(a,b){var c=a.sa-=a.a;a.a=a.F=0;b&&(a.sa=0);return c}
h.od=function(){if(this.j.P){this.yb>=this.hb&&wc(this,!0);this.Ua=0;this.cb=ra();if(this.qa){var a=this.cb-this.qa;a>this.Qb&&(this.$+=a,this.$>this.cb&&(this.$=this.cb))}try{do{for(var b,c=this.j.gb?1:this.ib,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.ob(b)}catch(f){if("number"!=typeof f)throw f;}b=yc(this,!0);this.Ua+=b;this.aa+=b;pb(this,b);nb(this,b);this.Ta-=b;if(0>=this.Ta){this.Ta+=this.ib;15<=++this.Rb&&(this.xa(),this.Rb=0);break}}while(this.j.P)}catch(f){G(this); h.od=function(){if(this.j.P){this.Bb>=this.jb&&xc(this,!0);this.Ra=0;this.eb=ra();if(this.ra){var a=this.eb-this.ra;a>this.Rb&&(this.aa+=a,this.aa>this.eb&&(this.aa=this.eb))}try{do{for(var b,c=this.j.fb?1:this.lb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.pb(b)}catch(f){if("number"!=typeof f)throw f;}b=zc(this,!0);this.Ra+=b;this.la+=b;pb(this,b);nb(this,b);this.Va-=b;if(0>=this.Va){this.Va+=this.lb;15<=++this.Sb&&(this.ya(),this.Sb=0);break}}while(this.j.P)}catch(f){G(this);
this.l&&this.l.stop(ra(),uc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.Tb;this.qa=ra();c=this.Qb;this.Ua&&(c=Math.round(c*this.Ua/this.ib));c-=this.qa-this.cb;if(d=this.qa-this.$)this.pa=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.ua=0,vc(this));if(0>c||this.pa<this.Ha)-1E3>c&&(this.$-=c),c=0;this.yb+=this.Ua;this.qa+=c;a(b,c)}}}; this.l&&this.l.stop(ra(),vc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.Tb;this.ra=ra();c=this.Rb;this.Ra&&(c=Math.round(c*this.Ra/this.lb));c-=this.ra-this.eb;if(d=this.ra-this.aa)this.qa=Math.round(this.la/(10*d))/100,864E5<=d&&(this.va=0,wc(this));if(0>c||this.qa<this.Ha)-1E3>c&&(this.aa-=c),c=0;this.Bb+=this.Ra;this.ra+=c;a(b,c)}}};
function mb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.P)a.T(a.toString()+" busy");else{vc(a);a.j.P=!0;a.j.Eb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.$,uc(a));setTimeout(a.Tb,0)}}h.ob=function(){return 0};function G(a){var b=!1;if(a.j.P){yc(a);ob(a,a.aa);a.aa=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),uc(a));b=!0}a.j.complete=void 0;return b} function mb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.P)a.T(a.toString()+" busy");else{wc(a);a.j.P=!0;a.j.Fb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.aa,vc(a));setTimeout(a.Tb,0)}}h.pb=function(){return 0};function G(a){var b=!1;if(a.j.P){zc(a);ob(a,a.la);a.la=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),vc(a));b=!0}a.j.complete=void 0;return b}
function zc(a){this.La=+a.model||1170;this.Mb=a.addrReset||0;pc.call(this,a,6666667);this.decode=1120==this.La?Ac.bind(this):Bc.bind(this);Cc(this);this.ta=0;this.N=null;this.j.complete=!1}z(zc,pc);h=zc.prototype;h.reset=function(){this.status("model "+this.La);this.j.P&&G(this);Cc(this);sc(this);this.j.error=!1;this.parent.reset.call(this)}; function Ac(a){this.La=+a.model||1170;this.Ob=a.addrReset||0;qc.call(this,a,6666667);this.decode=1120==this.La?Bc.bind(this):Cc.bind(this);Dc(this);this.ua=0;this.O=null;this.j.complete=!1}z(Ac,qc);h=Ac.prototype;h.reset=function(){this.status("model "+this.La);this.j.P&&G(this);Dc(this);tc(this);this.j.error=!1;this.parent.reset.call(this)};
function Cc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.B=15;a.h=[0,0,0,0,0,0,0,a.Mb];a.Ga=[0,0,0,0,0,0];a.na=[0,0,0,0];a.v=0;a.ab=0;a.lc=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.$a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, function Dc(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.B=15;a.f=[0,0,0,0,0,0,0,a.Ob];a.Fa=[0,0,0,0,0,0];a.oa=[0,0,0,0];a.v=0;a.cb=0;a.pd=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ab=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0];a.Yb=[0,0,0,0,0,0,0,0];a.Xb=0;a.u=0;a.C=a.D=0;a.c=a.b=a.wb=0;a.Ja=-1;lb(a)}function lb(a){a.mb=255;a.ea=0;a.Db=0;a.w=0;a.Ca=0;a.Cb=0;a.Fa=0;a.Ba=0;a.bb=0;a.Pb=262143;a.N=null;a.g&&Xb(a)}function Xb(a){a.Ba?(a.R=65536,a.M=a.kc,a.V=a.ld,a.qb=a.de,Cb(a.g,a.Fa&16?22:18)):(a.R=0,a.M=a.jc,a.V=a.Wb,a.qb=a.cc,Cb(a.g,16))}h.Lb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ua,this.sa]);a.set(2,Ob(this.g));return a.data()}; 0,0,0,0,0,0,0,0,0];a.$b=[0,0,0,0,0,0,0,0];a.Zb=0;a.u=0;a.A=a.C=0;a.c=a.b=a.xb=0;a.Ja=-1;lb(a)}function lb(a){a.nb=255;a.ea=0;a.Eb=0;a.I=0;a.Ub=0;a.Vb=0;a.Ea=0;a.Ba=0;a.bb=0;a.Sa=262143;a.$=0;a.zb=0;a.O=null;a.h&&Yb(a)}function Yb(a){a.Ba?(a.R=65536,a.M=a.mc,a.V=a.ld,a.rb=a.fe,Cb(a.h,a.Ea&16?22:18)):(a.R=0,a.M=a.lc,a.V=a.Yb,a.rb=a.ec,Cb(a.h,16))}h.Mb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.va,this.ta]);a.set(2,Pb(this.h));return a.data()};
h.restore=function(a){var b=a[1];this.ua=b[1];vc(this,b[3]);a:{b=this.g;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.D){for(var f=0,g=Array(b.D),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.g[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function P(a){return a.m&65536?1:0}h.Aa=function(){return this.s&32768?8:0};function Dc(a){var b=a.h[7];a.w&57344||(a.Ca=0,a.Cb=b);a.h[7]=b+2&65535;return a.V(b)} h.restore=function(a){var b=a[1];this.va=b[1];wc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.F){for(var f=0,g=Array(b.F),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.h[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function P(a){return a.m&65536?1:0}h.Aa=function(){return this.s&32768?8:0};function Ec(a){var b=a.f[7];a.$=0;a.zb=b;var c=a.V(b);a.f[7]=b+2&65535;return c}
function Ec(a,b){var c=a.h[7];a.h[7]=c+b&65535;return c}function Q(a,b){a.h[7]=b&65535}function Ub(a,b){return{qd:a,Ma:b,next:null}}function Sb(a,b){if(b!=a.N){var c=a.N;if(!c||c.Ma<=b.Ma)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.Ma<=b.Ma){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=2}function Yb(a){return a.B=a.B&63728|a.Aa()|(a.i&65535?0:4)|(a.f&32768?2:0)|P(a)} function Fc(a,b){var c=a.f[7];a.f[7]=c+b&65535;return c}function Q(a,b){a.f[7]=b&65535}function Vb(a,b){return{sd:a,Ma:b,next:null}}function Tb(a,b){if(b!=a.O){var c=a.O;if(!c||c.Ma<=b.Ma)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.Ma<=b.Ma){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=2}function Gc(a){return a.u&64?(K(a,168,64,-5),!0):a.u&32?(K(a,4,32,-4),!0):a.u&16?(K(a,12,16,-6),!0):!1}function Zb(a){return a.B=a.B&63728|a.Aa()|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}
function Zb(a,b){a.s=b<<12;a.i=~b&4;a.f=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Ga.length;0<=--c;){var d=a.h[c];a.h[c]=a.Ga[c];a.Ga[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.na[c]=a.h[6],a.h[6]=a.na[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function Fc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function Gc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Hc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Ic(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} function $b(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Fa.length;0<=--c;){var d=a.f[c];a.f[c]=a.Fa[c];a.Fa[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.oa[c]=a.f[6],a.f[6]=a.oa[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Hc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Ic(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))}function Jc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Kc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}
function K(a,b,c,d){if(!a.ta){var e=!1;0>a.Ja?a.Ja=Yb(a):a.v||(b=4,e=!0);a.w&57344||(a.Ca=63222,a.Cb=b);a.v=0;var f=a.V(b|a.R),g=a.V(b+2&65535|a.R);Zb(a,g&-12289|a.Ja>>2&12288);e&&(a.ea|=4,a.h[6]=4);Jc(a,a.Ja);Jc(a,a.h[7]);Q(a,f);a.u&=~c;a.Ja=-1;a.u|=8;if(-18!=d)throw b;}}function Kc(a){var b=Lc(a),c=Lc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);Q(a,b);Zb(a,c);a.u&=-17} function K(a,b,c,d){if(!a.ua){0>a.Ja?a.Ja=Zb(a):a.v||(b=4,a.ea|=4,a.f[6]=4,d=-3);a.zb=b;a.$=0;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ja>>2&12288);Lc(a,a.Ja);Lc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Mc(a){var b=Nc(a),c=Nc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);Q(a,b);$b(a,c);a.u&=-17}function Lb(a,b){var c=b>>13&31;31>c&&a.Ea&32&&(b=a.ab[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
function Lb(a,b){var c=b>>13&31;31>c&&a.Fa&32&&(b=a.$a[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} function Oc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Ea&a.pd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Sa;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Sa)||a.v)a.bb=a.v,a.cb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.I&57344||(a.I=a.I|g|a.bb<<5|a.cb<<
function Mc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Fa&a.lc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Pb;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(4194170!==f||a.v)a.bb=a.v,a.ab=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.w&57344||(a.w=a.w|g|a.bb<<5|a.ab<<1), 1),b=!0),a.I&61440||!(f<(4191360&a.Sa)||f>(4194239&a.Sa))||(a.I|=4096,a.I&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Nc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Lc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.$=a.$<<8|246;Pc(a,0,c);a.rb(c,b)}function Pc(a,b,c){!a.v&&c<=a.nb&&(b||4<c)&&(1145<=a.La&&c<=a.nb-32?(a.ea|=4,a.f[6]=4,K(a,4,0,-3)):(a.ea|=8,a.u|=32))}
b=!0),a.w&61440||!(4191360>f||4194239<f)||(a.w|=4096,a.w&512&&(a.u|=32)),b&&K(a,168,0,-13));return f}function Nc(a,b,c){b&1&&a.a--;a=a.g;c&=255;3932160<=b&&(b=Lb(a.a,b));a.g[(b&a.ma)>>>a.c].Gb(b&a.l,c&255,b)}function Lc(a){var b=a.V(a.h[6]|a.R);a.h[6]=a.h[6]+2&65535;return b}function Jc(a,b){var c=a.h[6]-2&65535;a.h[6]=c;a.w&57344||(a.Ca=a.Ca<<8|246);Oc(a,0,c);a.qb(c,b)} function Qc(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return K(a,4,0,-2),0;case 1:return 6==c&&d&4&&Pc(a,b,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];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.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Fc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Fc(a,2)),e=e+a.f[c]&
function Oc(a,b,c){a.v||a.u&64||!(c<=a.mb&&(b||4<c)||b&&65534<=c)||(1145<=a.La&&(c<=a.mb-32||1==b&&65534<=c)?(a.ea|=4,a.h[6]=4,K(a,4,0,-16)):(a.ea|=8,a.u|=64))} 65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.$=a.$<<8|f<<3&248|c;6==c&&0>f&&Pc(a,b,a.f[6]);return e}h.mb=function(a){if(!this.Ba)return this.h.mb(a);this.ua++;a=this.Yb(Oc(this,a,2));this.ua--;return a};h.$a=function(a,b){this.Ba?(this.ua++,a=Oc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.$a(a,b)};h.ob=function(a,b){this.Ba?(this.ua++,this.ec(Oc(this,a,4),b),this.ua--):this.h.ob(a,b)};h.lc=function(a,b,c){return Qc(this,a,b,c)};
function Pc(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return K(a,4,0,-15),0;case 1:return 6==c&&d&4&&Oc(a,b,a.h[6]),a.a-=3,7==c?a.h[c]:a.h[c]|g;case 2:f=2;e=a.h[c];7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.h[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.h[c]+f&65535;7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.h[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Ec(a,2)),e=e+a.h[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Ec(a,2)),e=e+a.h[c]& h.mc=function(a,b,c){return Oc(this,Qc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,a)};h.ld=function(a){return Mb(this.h,Oc(this,a,2))};h.ec=function(a,b){Ob(this.h,a,b&65535)};h.fe=function(a,b){Ob(this.h,Oc(this,a,4),b)};function Rc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Qc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.f[d]:a.oa[a.B>>12&3];return c}
65535,e=a.V(e|a.R)|g,a.a-=10,e}a.h[c]=a.h[c]+f&65535;!g||a.w&57344||(a.Ca=a.Ca<<8|f<<3&248|c);6==c&&0>f&&Oc(a,b,a.h[6]);return e}h.lb=function(a){if(!this.Ba)return this.g.lb(a);this.ta++;a=this.Wb(Mc(this,a,2));this.ta--;return a};h.Za=function(a,b){this.Ba?(this.ta++,Nc(this,Mc(this,a,5),b),this.ta--):this.g.Za(a,b)};h.nb=function(a,b){this.Ba?(this.ta++,this.cc(Mc(this,a,4),b),this.ta--):this.g.nb(a,b)};h.jc=function(a,b,c){return Pc(this,a,b,c)}; function Sc(a,b,c,d){a.$=22;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Qc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Oc(a,e|c&65536,4),a.v=a.B>>14&3,Ob(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.f[e]=d:a.oa[a.B>>12&3]=d}function Tc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=-c-1;return a}function Uc(a,b){var c;b>>=6;var d=a.C=b&7;(b=a.A=(b&56)>>3)?c=Mb(a.h,a.M(b,d,2)):c=-d-1;return c}function Vc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Qc(a,b,c,8)}
h.kc=function(a,b,c){return Mc(this,Pc(this,a,b,c),c)};h.Wb=function(a){return Mb(this.g,a)};h.ld=function(a){return Mb(this.g,Mc(this,a,2))};h.cc=function(a,b){Nb(this.g,a,b&65535)};h.de=function(a,b){Nb(this.g,Mc(this,a,4),b)};function Qc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Pc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.h[d]:a.na[a.B>>12&3];return c} function Wc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=a.f[c]&255;return a}function Xc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.h,a.M(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.xb=a.M(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Kb(a.h,e)),e&1&&a.a--,Nb(a.h,e,c)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[e]=b&65280|d.call(a,c,b&255))}
function Rc(a,b,c,d){a.w&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Pc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Mc(a,e|c&65536,4),a.v=a.B>>14&3,Nb(a.g,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.h[e]=d:a.na[a.B>>12&3]=d}function Sc(a,b){b>>=6;var c=a.D=b&7;(b=a.C=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.g,c)):a=a.h[c]&255;return a}function Tc(a,b){b>>=6;var c=a.D=b&7;return(b=a.C=(b&56)>>3)?Mb(a.g,a.M(b,c,2)):a.h[c]}function Uc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Pc(a,b,c,8)} function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.M(b,e,6),Ob(a.h,e,d.call(a,0>c?a.f[-c-1]:c,Mb(a.h,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])}function Yc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Nb(a.h,d,e)):c?(c=0>c?a.f[-c-1]&255:c,a.f[e]=a.f[e]&~d|c<<24>>24&d):a.f[e]&=~d;return c}function Zc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,d,4),Ob(a.h,d,c=0>c?a.f[-c-1]:c)):a.f[d]=c=0>c?a.f[-c-1]:c;return c}
function Vc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.g,c)):a=a.h[c]&255;return a}function Wc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.g,a.M(b,c,2)):a.h[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.wb=a.M(b,e,7),Nc(a,e,d.call(a,c,Kb(a.g,e)))):a.h[e]=a.h[e]&65280|d.call(a,c,a.h[e]&255)}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.M(b,e,6),Nb(a.g,e,d.call(a,c,Mb(a.g,e)))):a.h[e]=d.call(a,c,a.h[e])} function V(a,b,c){c&&(Q(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
function Xc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Nc(a,a.M(b,e,5),c):a.h[e]=c?a.h[e]&~d|c<<24>>24&d:a.h[e]&~d;return c}function Yc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Nb(a.g,a.M(b,d,4),c):a.h[d]=c&65535;return c}function V(a,b,c){c&&(Q(a,a.h[7]+(b<<24>>23)),a.a-=2);a.a-=3} h.pb=function(a){this.j.complete=!0;var b=a?this.j.Fb?0:1:-1;this.j.Fb=!1;this.sa=this.a=a;do{if(this.u){if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Eb&224)>>5,e=this.O&&this.O.Ma>d?this.O:null;e&&(c=e.sd,d=e.Ma);d>(this.B&224)>>5?(this.u&4&&(Fc(this,2),this.u&=-5),K(this,c,0,-9),d=!0):d=!1;if(d){if(e)if(a=e,e=this.O,e==a)this.O=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Gc(this)&&0>b)break}this.u=
h.ob=function(a){this.j.complete=!0;var b=a?this.j.Eb?0:1:-1;this.j.Eb=!1;this.ra=this.a=a;do{if(this.u){this.u&112&&(this.u&32?K(this,168,32,-7):this.u&16?K(this,12,16,-9):this.u&64&&K(this,4,64,-8));if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Db&224)>>5,e=this.N&&this.N.Ma>d?this.N:null;e&&(c=e.qd,d=e.Ma);d>(this.B&224)>>5?(this.u&4&&(Ec(this,2),this.u&=-5),K(this,c,0,-18),d=!0):d=!1;if(d){if(e)if(a=e,e=this.N,e==a)this.N=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e= this.u&7|this.B&16;this.decode(Ec(this))}while(0<this.a);return this.j.complete?this.sa-this.a:void 0===this.j.complete?0:-1};Ga(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ac(d);C(d,c)}});function $c(a,b){var c=b+a;Ic(this,c,a,b);return c&65535}function ad(a,b){var c=b+a;Ic(this,c<<8,a<<8,b<<8);return c&255}function bd(a,b){a=b<<1;Jc(this,a);return a&65535}function cd(a,b){a=b<<1;Jc(this,a<<8);return a&255}
d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break}this.u=this.u&7|this.B&16;this.decode(Dc(this))}while(0<this.a);return this.j.complete?this.ra-this.a:void 0===this.j.complete?0:-1};Ga(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new zc(d);C(d,c)}});function Zc(a,b){var c=b+a;Gc(this,c,a,b);return c&65535}function $c(a,b){var c=b+a;Gc(this,c<<8,a<<8,b<<8);return c&255}function ad(a,b){a=b<<1;Hc(this,a);return a&65535} function dd(a,b){a=b&32768|b>>1|b<<16;Jc(this,a);return a&65535}function ed(a,b){a=b&128|b>>1|b<<8;Jc(this,a<<8);return a&255}function fd(a,b){a=b&~a;R(this,a);return a}function gd(a,b){a=b&~a;R(this,a<<8);return a}function hd(a,b){a|=b;R(this,a);return a}function id(a,b){a|=b;R(this,a<<8);return a}function jd(a,b){a=~b|65536;Hc(this,a);return a&65535}function kd(a,b){a=~b|256;Hc(this,a<<8);return a&255}function ld(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.g=b&(b^a));return a&65535}
function bd(a,b){a=b<<1;Hc(this,a<<8);return a&255}function cd(a,b){a=b&32768|b>>1|b<<16;Hc(this,a);return a&65535}function dd(a,b){a=b&128|b>>1|b<<8;Hc(this,a<<8);return a&255}function ed(a,b){a=b&~a;R(this,a);return a}function fd(a,b){a=b&~a;R(this,a<<8);return a}function gd(a,b){a|=b;R(this,a);return a}function hd(a,b){a|=b;R(this,a<<8);return a}function id(a,b){a=~b|65536;Fc(this,a);return a&65535}function jd(a,b){a=~b|256;Fc(this,a<<8);return a&255} function md(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.g=b&(b^c));return a&255}function nd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.g=a&(b^a));return a&65535}function od(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.g=c&(b<<8^c));return a&255}function pd(a,b){a=-b;Hc(this,a,a&b&32768);return a&65535}function qd(a,b){a=-b;Hc(this,a<<8,(a&b&128)<<8);return a&255}function rd(a,b){a=b<<1|this.m>>16&1;Jc(this,a);return a&65535}
function kd(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function ld(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.f=b&(b^c));return a&255}function md(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function nd(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function od(a,b){a=-b;Fc(this,a,a&b&32768);return a&65535}function pd(a,b){a=-b;Fc(this,a<<8,(a&b&128)<<8);return a&255} function sd(a,b){a=b<<1|this.m>>16&1;Jc(this,a<<8);return a&255}function td(a,b){a=(this.m&65536|b)>>1|b<<16;Jc(this,a);return a&65535}function ud(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Jc(this,a<<8);return a&255}function vd(a,b){var c=b-a;Kc(this,c,a,b);return c&65535}function wd(a,b){var c=b-a;Kc(this,c<<8,a<<8,b<<8);return c&255}function xd(a,b){this.u&128||(this.s=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function yd(a,b){a^=b;R(this,a);return a&65535}
function qd(a,b){a=b<<1|this.m>>16&1;Hc(this,a);return a&65535}function rd(a,b){a=b<<1|this.m>>16&1;Hc(this,a<<8);return a&255}function sd(a,b){a=(this.m&65536|b)>>1|b<<16;Hc(this,a);return a&65535}function td(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Hc(this,a<<8);return a&255}function ud(a,b){var c=b-a;Ic(this,c,a,b);return c&65535}function vd(a,b){var c=b-a;Ic(this,c<<8,a<<8,b<<8);return c&255}function wd(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535} function zd(a){T(this,a,Uc(this,a),$c);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Ad(a){var b=Xc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
function xd(a,b){a^=b;R(this,a);return a&65535}function yd(a){T(this,a,Tc(this,a),Zc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function zd(a){var b=Wc(this,a);a=a>>6&7;var c=this.h[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.f=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.f=32768)}this.h[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} function Bd(a){var b=Xc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Cd(a){V(this,a,!P(this))}function Dd(a){V(this,a,P(this))}
function Ad(a){var b=Wc(this,a);a=a>>6&7;var c=this.h[a]<<16|this.h[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.f=32768)):d=c;this.h[a]=d>>16&65535;this.h[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Bd(a){V(this,a,!P(this))}function Cd(a){V(this,a,P(this))} function Ed(a){T(this,a,Uc(this,a),fd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Fd(a){S(this,a,Tc(this,a),gd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Gd(a){T(this,a,Uc(this,a),hd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Hd(a){S(this,a,Tc(this,a),id);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
function Dd(a){T(this,a,Tc(this,a),ed);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Ed(a){S(this,a,Sc(this,a),fd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Fd(a){T(this,a,Tc(this,a),gd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Gd(a){S(this,a,Sc(this,a),hd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)} function Id(a){var b=Uc(this,a);a=Xc(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Jd(a){var b=Tc(this,a);a=Wc(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Kd(a){V(this,a,this.i&65535?0:4)}function Ld(a){V(this,a,!this.Aa()==!(this.g&32768))}function Md(a){V(this,a,!!(this.i&65535)&&!this.Aa()==!(this.g&32768))}
function Hd(a){R(this,Tc(this,a)&Wc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Id(a){R(this,(Sc(this,a)&Vc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Jd(a){V(this,a,this.i&65535?0:4)}function Kd(a){V(this,a,!this.Aa()==!(this.f&32768))}function Ld(a){V(this,a,!!(this.i&65535)&&!this.Aa()==!(this.f&32768))}function Md(a){V(this,a,!P(this)&&!!(this.i&65535))} function Nd(a){V(this,a,!P(this)&&!!(this.i&65535))}function Od(a){V(this,a,(this.i&65535?0:4)||!this.Aa()!=!(this.g&32768))}function Pd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Qd(a){V(this,a,!this.Aa()!=!(this.g&32768))}function Rd(a){V(this,a,this.Aa())}function Sd(a){V(this,a,!!(this.i&65535))}function Td(a){V(this,a,!this.Aa())}function Ud(){K(this,12,0,-8);this.a-=5}function Vd(a){V(this,a,!0)}function Wd(a){V(this,a,!(this.g&32768))}function Xd(a){V(this,a,this.g&32768?2:0)}
function Nd(a){V(this,a,(this.i&65535?0:4)||!this.Aa()!=!(this.f&32768))}function Od(a){V(this,a,P(this)||(this.i&65535?0:4))}function Pd(a){V(this,a,!this.Aa()!=!(this.f&32768))}function Qd(a){V(this,a,this.Aa())}function Rd(a){V(this,a,!!(this.i&65535))}function Sd(a){V(this,a,!this.Aa())}function Td(){K(this,12,0,-1);this.a-=5}function Ud(a){V(this,a,!0)}function Vd(a){V(this,a,!(this.f&32768))}function Wd(a){V(this,a,this.f&32768?2:0)} function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function Yd(a){var b=Uc(this,a);a=Xc(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Kc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Zd(a){var b=Tc(this,a);a=Wc(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Kc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}
function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function Xd(a){var b=Tc(this,a);a=Wc(this,a);Ic(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Yd(a){var b=Sc(this,a)<<8;a=Vc(this,a)<<8;Ic(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)} function $d(a){var b=Xc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.g=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.g=32768,this.m=65536,this.a-=7}function ae(){K(this,24,0,-8);this.a-=25}
function Zd(a){var b=Wc(this,a);if(b){a=a>>6&7;var c=this.h[a]<<16|this.h[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.h[a]=d&65535,this.h[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.h[a]&&(this.h[a]=this.h[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function $d(){K(this,24,0,-2);this.a-=25} function be(){this.B&49152?(this.ea|=128,K(this,4,0,-7)):(this.w&&this.w.setData(this.f[0],!0),this.D?this.D.b():G(this));this.a-=7}function ce(){K(this,16,0,-8);this.a-=25}var de=[0,7,7,10,7,11,9,13];function ee(a){this.F=this.a;Q(this,Vc(this,a));this.a=this.F-de[this.c]}var fe=[0,14,14,17,14,18,16,20];function ge(a){this.F=this.a;var b=Vc(this,a);a=a>>6&7;Lc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.F-fe[this.c]}var he=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function ae(){this.B&49152?(this.ea|=128,K(this,4,0,-3)):(this.A&&this.A.setData(this.h[0],!0),this.F?this.F.b():G(this));this.a-=7}function be(){K(this,16,0,-4);this.a-=25}var ce=[0,7,7,10,7,11,9,13];function de(a){this.I=this.a;Q(this,Uc(this,a));this.a=this.I-ce[this.c]}var ee=[0,14,14,17,14,18,16,20];function fe(a){this.I=this.a;var b=Uc(this,a);a=a>>6&7;Jc(this,this.h[a]);this.h[a]=this.h[7];Q(this,b);this.a=this.I-ee[this.c]}var ge=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function ie(a){var b=Uc(this,a);this.F=this.a;R(this,Zc(this,a,b));this.a=this.F-he[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function je(a){var b=Tc(this,a);R(this,Yc(this,a,b,65535)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var ke=[7,13,13,17,14,18,17,21];
function he(a){var b=Tc(this,a);this.I=this.a;R(this,Yc(this,a,b));this.a=this.I-ge[(this.C?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ie(a){var b=Sc(this,a);R(this,Xc(this,a,b,65535)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}var je=[7,13,13,17,14,18,17,21]; function le(a){var b=Xc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function me(){this.a-=5}function ne(){this.B&49152||(this.h.reset(),lb(this));this.a-=667}function oe(){Mc(this);this.u|=this.B&16;this.a-=13}
function ke(a){var b=Wc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.h[a];c&32768&&(c|=-65536);b=~~(b*c);this.h[a]=b>>16&65535;this.h[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function le(){this.a-=5}function me(){this.B&49152||(this.g.reset(),lb(this));this.a-=667}function ne(){Kc(this);this.u|=this.B&16;this.a-=13} function pe(a){if(a&8)K(this,8,0,-8);else{var b=Nc(this);a&=7;7==a?Q(this,b):(Q(this,this.f[a]),this.f[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function qe(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function re(a){T(this,a,Uc(this,a),vd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
function oe(a){if(a&8)K(this,8,0,-6);else{var b=Lc(this);a&=7;7==a?Q(this,b):(Q(this,this.h[a]),this.h[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.f=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function pe(a){var b=(a&448)>>6;if(this.h[b]=this.h[b]-1&65535)Q(this,this.h[7]-((a&63)<<1)),this.a+=1;this.a-=6}function qe(a){T(this,a,Tc(this,a),ud);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)} function se(a){T(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)}function te(){K(this,28,0,-8);this.a-=5}function ue(){this.w&&(this.w.da=this.f[7],this.w.setData(this.f[0],!0));this.u|=4;Fc(this,-2);this.a-=3}function ve(a){T(this,a,Uc(this,a),yd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-8)}function Bc(a){we[a>>12].call(this,a)}function xe(a){ye[a>>6&3].call(this,a)}function ze(a){Ae[a>>6&3].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}
function re(a){T(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)}function se(){K(this,28,0,-5);this.a-=5}function te(){this.A&&(this.A.da=this.h[7],this.A.setData(this.h[0],!0));this.u|=4;Ec(this,-2);this.a-=3}function ue(a){T(this,a,Tc(this,a),xd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-6)}function Ac(a){ve[a>>12].call(this,a)}function we(a){xe[a>>6&3].call(this,a)}function ye(a){ze[a>>6&3].call(this,a)}function Ae(a){Be[a>>6&3].call(this,a)} function De(a){Ee[a&15].call(this,a)}function Fe(a){Ge[a&15].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)}function Je(a){Ke[a>>6&3].call(this,a)}function Le(a){Me[a>>6&3].call(this,a)}
function Ce(a){De[a&15].call(this,a)}function Ee(a){Fe[a&15].call(this,a)}function Ge(a){He[a>>6&3].call(this,a)}function Ie(a){Je[a>>6&3].call(this,a)}function Ke(a){Le[a>>6&3].call(this,a)} var we=[function(a){Ne[a>>8&15].call(this,a)},ie,Yd,Id,Ed,Gd,zd,Y,function(a){Pe[a>>8&15].call(this,a)},je,Zd,Jd,Fd,Hd,re,Y],Ne=[function(a){Qe[a>>4&15].call(this,a)},Vd,Sd,Kd,Ld,Qd,Md,Od,ge,ge,xe,ze,Be,Y,Y,Y],ye=[function(a){Hc(this,Zc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,ld);this.a-=this.c?9:3+(7==this.b?2:0)}],Ae=[function(a){T(this,a,0,
var ve=[function(a){Me[a>>8&15].call(this,a)},he,Xd,Hd,Dd,Fd,yd,Y,function(a){Ne[a>>8&15].call(this,a)},ie,Yd,Id,Ed,Gd,qe,Y],Me=[function(a){Pe[a>>4&15].call(this,a)},Ud,Rd,Jd,Kd,Pd,Ld,Nd,fe,fe,we,ye,Ae,Y,Y,Y],xe=[function(a){Fc(this,Yc(this,a,0));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,1,md);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,kd);this.a-=this.c?9:3+(7==this.b?2:0)}],ze=[function(a){T(this,a,0, pd);this.a-=this.c?11:6},function(a){T(this,a,P(this)?1:0,$c);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,P(this)?1:0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Xc(this,a);Hc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ce=[function(a){T(this,a,0,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,bd);this.a-=this.c?9:3+(7==this.b?2:0)}],
od);this.a-=this.c?11:6},function(a){T(this,a,P(this)?1:0,Zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,P(this)?1:0,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Wc(this,a);Fc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Be=[function(a){T(this,a,0,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ad);this.a-=this.c?9:3+(7==this.b?2:0)}], Qe=[function(a){Re[a&15].call(this,a)},Y,Y,Y,ee,ee,ee,ee,pe,Y,De,Fe,se,se,se,se],Re=[be,ue,oe,Ud,ce,ne,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ee=[me,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ge=[me,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Pe=[Td,Rd,Nd,Pd,Wd,Xd,Cd,Dd,ae,te,He,Je,Le,Y,Y,Y],Ie=[function(a){Hc(this,
Pe=[function(a){Qe[a&15].call(this,a)},Y,Y,Y,de,de,de,de,oe,Y,Ce,Ee,re,re,re,re],Qe=[ae,te,ne,Td,be,me,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],De=[le,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Fe=[le,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Ne=[Sd,Qd,Md,Od,Vd,Wd,Bd,Cd,$d,se,Ge,Ie,Ke,Y,Y,Y],He=[function(a){Fc(this, Yc(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,kd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,md);this.a-=this.c?9:3+(7==this.b?2:0)}],Ke=[function(a){S(this,a,0,qd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Wc(this,a);Hc(this,a<<8);this.a-=this.c?4:3+(7==
Xc(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,ld);this.a-=this.c?9:3+(7==this.b?2:0)}],Je=[function(a){S(this,a,0,pd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,$c);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Vc(this,a);Fc(this,a<<8);this.a-=this.c?4:3+(7== this.b?2:0)}],Me=[function(a){S(this,a,0,ud);this.a-=this.c?9+(this.xb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,ed);this.a-=this.c?9+(this.xb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,cd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Cc(a){Se[a>>12].call(this,a)}
this.b?2:0)}],Le=[function(a){S(this,a,0,td);this.a-=this.c?9+(this.wb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,dd);this.a-=this.c?9+(this.wb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,bd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Bc(a){Re[a>>12].call(this,a)} var Se=[function(a){Te[a>>8&15].call(this,a)},ie,Yd,Id,Ed,Gd,zd,function(a){Ue[a>>8&15].call(this,a)},function(a){Ve[a>>8&15].call(this,a)},je,Zd,Jd,Fd,Hd,re,Y],Te=[function(a){We[a>>4&15].call(this,a)},Vd,Sd,Kd,Ld,Qd,Md,Od,ge,ge,xe,ze,Be,function(a){Xe[a>>6&3].call(this,a)},Y,Y],Xe=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Rc(this,a,0);Lc(this,a);R(this,a);this.a-=11},function(a){var b=Nc(this);this.F=
var Re=[function(a){Se[a>>8&15].call(this,a)},he,Xd,Hd,Dd,Fd,yd,function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},ie,Yd,Id,Ed,Gd,qe,Y],Se=[function(a){Ve[a>>4&15].call(this,a)},Ud,Rd,Jd,Kd,Pd,Ld,Nd,fe,fe,we,ye,Ae,function(a){We[a>>6&3].call(this,a)},Y,Y],We=[function(a){a=this.h[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.h[5]);this.h[6]=a+2&65535;this.h[5]=b;this.a-=8},function(a){a=Qc(this,a,0);Jc(this,a);R(this,a);this.a-=11},function(a){var b=Lc(this);this.I= this.a;Sc(this,a,0,b);R(this,b);this.a=this.F-ke[this.c]},function(a){R(this,Zc(this,a,this.Aa?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],We=[function(a){Ye[a&15].call(this,a)},Y,Y,Y,ee,ee,ee,ee,pe,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},De,Fe,se,se,se,se],Ye=[be,ue,oe,Ud,ce,ne,function(){Mc(this);this.a-=13},function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ue=[le,le,$d,$d,Ad,Ad,Bd,Bd,ve,ve,Y,Y,Y,Y,qe,qe],Ve=[Td,Rd,Nd,Pd,Wd,Xd,Cd,Dd,ae,te,
this.a;Rc(this,a,0,b);R(this,b);this.a=this.I-je[this.c]},function(a){R(this,Yc(this,a,this.Aa?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ve=[function(a){Xe[a&15].call(this,a)},Y,Y,Y,de,de,de,de,oe,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-6)},Ce,Ee,re,re,re,re],Xe=[ae,te,ne,Td,be,me,function(){Kc(this);this.a-=13},function(){K(this,8,0,-6)},Y,Y,Y,Y,Y,Y,Y,Y],Te=[ke,ke,Zd,Zd,zd,zd,Ad,Ad,ue,ue,Y,Y,Y,Y,pe,pe],Ue=[Sd,Qd,Md,Od,Vd,Wd,Bd,Cd,$d,se, He,Je,Le,function(a){Ze[a>>6&3].call(this,a)},Y,Y],Ze=[Y,function(a){a=Rc(this,a,65536);Lc(this,a);R(this,a);this.a-=11},function(a){var b=Nc(this);this.F=this.a;Sc(this,a,65536,b);R(this,b);this.a=this.F-ke[this.c]},Y];
Ge,Ie,Ke,function(a){Ye[a>>6&3].call(this,a)},Y,Y],Ye=[Y,function(a){a=Qc(this,a,65536);Jc(this,a);R(this,a);this.a-=11},function(a){var b=Lc(this);this.I=this.a;Rc(this,a,65536,b);R(this,b);this.a=this.I-je[this.c]},Y]; function $e(a){x.call(this,"ROM",a,$e);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);af(c)})}}z($e);h=$e.prototype;
function Ze(a){x.call(this,"ROM",a,Ze);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.f=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.oa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);$e(c)})}}z(Ze);h=Ze.prototype; h.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;af(this)};h.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ja=function(){return!0};
h.ia=function(a,b,c,d){this.g=b;this.a=c;this.F=d;$e(this)};h.ka=function(){this.W&&(this.F&&this.F.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ja=function(){return!0}; function af(a){if(!Va(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[$e.prototype.Zc,$e.prototype.Ud,null,null,null,a.b>>1],c);if(cb(a.h,a,b,256,a.Ga)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c<a.c.length;c++)a.h.$a(b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.g?
function $e(a){if(!Va(a)){if(a.l){if(!a.c||!a.g)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[Ze.prototype.Zc,Ze.prototype.Sd,null,null,null,a.b>>1],c);if(cb(a.g,a,b,256,a.ya)){b=a.m=!0;break a}}else if(Fb(a.g,b,a.b,fc)){for(c=0;c<a.c.length;c++)a.g.Za(b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.f? b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Eb(d.h,d.i,d.b);Db(d.h,e,d.b,f)}a.m||delete a.c}}}F(a)}}h.Zc=function(a){return this.c[a-this.i]};h.Ud=function(){};Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new $e(d);C(d,c)}});
b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Eb(d.g,d.i,d.b);Db(d.g,e,d.b,f)}a.m||delete a.c}}}F(a)}}h.Zc=function(a){return this.c[a-this.i]};h.Sd=function(){};Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ze(d);C(d,c)}}); function bf(a){x.call(this,"RAM",a,bf);this.W=this.c=null;this.l=a.addr;this.i=a.size;this.ga=a.load;this.fa=a.exec;this.g=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ra(c.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W,null==c.ga&&(c.ga=a.ga),null==c.fa&&(c.fa=a.fa)):c.b=null);cf(c)})}}z(bf);
function af(a){x.call(this,"RAM",a,af);this.W=this.c=null;this.l=a.addr;this.i=a.size;this.ga=a.load;this.fa=a.exec;this.f=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ra(c.oa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W,null==c.ga&&(c.ga=a.ga),null==c.fa&&(c.fa=a.fa)):c.b=null);bf(c)})}}z(af); bf.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;cf(this)};bf.prototype.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.l,this.i,this.W),delete this.W);return!0};bf.prototype.ja=function(){return!0};function cf(a){if(a.h&&(!a.g&&a.i&&Fb(a.h,a.l,a.i,Ib)&&(a.g=!0),!Va(a))){if(!a.g)t("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;df(a,a.c,a.ga,a.fa,a.l)}F(a)}}
af.prototype.ia=function(a,b,c,d){this.g=b;this.a=c;this.F=d;bf(this)};af.prototype.ka=function(){this.W&&(this.F&&this.F.a(this.id,this.l,this.i,this.W),delete this.W);return!0};af.prototype.ja=function(){return!0};function bf(a){if(a.g&&(!a.f&&a.i&&Fb(a.g,a.l,a.i,Ib)&&(a.f=!0),!Va(a))){if(!a.f)t("No RAM allocated");else if(a.b){if(!a.c||!a.g)return;cf(a,a.c,a.ga,a.fa,a.l)}F(a)}} bf.prototype.reset=function(){if(this.g){for(var a=this.h,b=this.l,c=this.i,d=b&a.l,b=b>>>a.c;0<c&&b<a.h.length;){var e=a.h[b];if(e.controller&&a.i&&a.i.length==a.v.length){var f=a.i.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Xa&&e.o)for(k=d;f--&&k<e.o.length;k++)e.o[k]=g;else for(k=d;f--&&k<e.size;k++)e.Ib(d,g,e.Ka+d)}c-=a.b;b++;d=0}this.c&&df(this,this.c,this.ga,this.fa,this.l,!0)}};
af.prototype.reset=function(){if(this.f){for(var a=this.g,b=this.l,c=this.i,d=b&a.l,b=b>>>a.c;0<c&&b<a.g.length;){var e=a.g[b];if(e.controller&&a.i&&a.i.length==a.v.length){var f=a.i.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Xa&&e.o)for(k=d;f--&&k<e.o.length;k++)e.o[k]=g;else for(k=d;f--&&k<e.size;k++)e.Hb(d,g,e.Ka+d)}c-=a.b;b++;d=0}this.c&&cf(this,this.c,this.ga,this.fa,this.l,!0)}}; function df(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,w=n-=6;0<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.$a(p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.a.$a(c+
function cf(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,w=n-=6;0<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Za(p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.a.Za(c+ g,b[g]);g=!0}g&&null!=d&&(a=a.a,a.Ob=d,Q(a,d),!f&&a.D&&(G(a)||a.D.c()));return g}Ga(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new bf(d);C(d,c)}});function ef(a){x.call(this,"Keyboard",a,ef);F(this)}z(ef);ef.prototype.Z=function(){return!1};ef.prototype.ia=function(a,b,c,d){this.l=a;this.a=c;this.D=d};Ga(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new ef(d);C(d,c)}});
g,b[g]);g=!0}g&&null!=d&&(a=a.a,a.Mb=d,Q(a,d),!f&&a.F&&(G(a)||a.F.c()));return g}Ga(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new af(d);C(d,c)}});function df(a){x.call(this,"Keyboard",a,df);F(this)}z(df);df.prototype.Z=function(){return!1};df.prototype.ia=function(a,b,c,d){this.l=a;this.a=c;this.F=d};Ga(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new df(d);C(d,c)}}); function Z(a){this.C=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.O=a.upperCase;this.g=this.m=null;this.I=a.tabSize;this.F=a.charBOL;this.s=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=ff;b&&(void 0===c&&(c="Panel"),(c=Ta(c,this.id))&&(b=c.o[b])&&this.Z(null,a,b))}this.v=this.A=null;this.exports={connect:this.Nb,receiveData:this.Db}}z(Z);var ff="buffer";h=Z.prototype;
function Z(a){this.C=a.baudReceive||9600;this.I=a.baudTransmit||9600;this.R=a.upperCase;this.f=this.m=null;this.J=a.tabSize;this.D=a.charBOL;this.s=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=ef;b&&(void 0===c&&(c="Panel"),(c=Ta(c,this.id))&&(b=c.o[b])&&this.Z(null,a,b))}this.v=this.A=null;this.exports={connect:this.Nb,receiveData:this.Bb}}z(Z);var ef="buffer";h=Z.prototype; h.Z=function(a,b,c){var d=this;switch(b){case ff:return this.o[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Db(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Db(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
h.Z=function(a,b,c){var d=this;switch(b){case ef:return this.o[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Bb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Bb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1}; h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;var e=this;this.aa=Vb(48,4);this.J=Sb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.O&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Tb(e.a,e.aa))});this.M=Vb(52,4);this.$=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.M)});cb(b,this,gf);eb(b,this.reset.bind(this));F(this)};
h.ia=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.F=d;var e=this;this.$=Ub(48,4);this.M=Rb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.R&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Sb(e.a,e.$))});this.aa=Ub(52,4);this.N=Rb(this.a,function(){e.c|=128;e.c&64&&Sb(e.a,e.aa)});cb(b,this,ff);F(this)}; h.Nb=function(){if(!this.v){var a=sc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Ga)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Nb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
h.Nb=function(){if(!this.v){var a=rc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.ya)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.oa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Nb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; h.ja=function(a){return a?this.save():!0};h.reset=function(){hf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return hf(this)};function hf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.Db=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Ub(this.a,this.J,1E3/Math.round(this.C/10));return!0};h.Tc=function(){return this.b&65534};
h.ja=function(a){return a?this.save():!0};h.reset=function(){gf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return gf(this)};function gf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.Bb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Tb(this.a,this.M,1E3/Math.round(this.C/10));return!0};h.Tc=function(){return this.b&65534}; h.Od=function(a){this.b=this.b&-112|a&111};h.Sc=function(){this.b&=-129;0<this.i.length&&Ub(this.a,this.J,1E3/Math.round(this.C/10));return this.w};h.Nd=function(){};h.nd=function(){return this.c};h.he=function(a){this.c&128&&a&64&&Tb(this.a,this.M);this.c=this.c&-70|a&69};h.md=function(){return 0};
h.Md=function(a){this.b=this.b&-112|a&111};h.Sc=function(){this.b&=-129;0<this.i.length&&Tb(this.a,this.M,1E3/Math.round(this.C/10));return this.w};h.Ld=function(){};h.nd=function(){return this.c};h.fe=function(a){128==(this.c&192)&&a&64&&Tb(this.a,this.N,1E3/Math.round(this.I/10));this.c=this.c&-70|a&69};h.md=function(){return 0}; h.ge=function(a){if(a&=255){this.A&&this.A.call(this.v,a);if(this.g)if(13==a)this.s=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.I||8,c=a-this.s%a,this.I&&(b=" ".slice(0,c)));this.F&&!this.s&&c&&(b=String.fromCharCode(this.F)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.T(this.m),
h.ee=function(a){if(a&=255){this.A&&this.A.call(this.v,a);if(this.f)if(13==a)this.s=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.D&&!this.s&&c&&(b=String.fromCharCode(this.D)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.T(this.m), this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ub(this.a,this.$,1E3/Math.round(this.R/10))}};var jf={},gf=(jf[65392]=[null,null,Z.prototype.Tc,Z.prototype.Od,"RCSR"],jf[65394]=[null,null,Z.prototype.Sc,Z.prototype.Nd,"RBUF"],jf[65396]=[null,null,Z.prototype.nd,Z.prototype.he,"XCSR"],jf[65398]=[null,null,Z.prototype.md,Z.prototype.ge,"XBUF"],jf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Z(d);C(d,c)}});
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Tb(this.a,this.N,1E3/Math.round(this.I/10))}};var hf={},ff=(hf[65392]=[null,null,Z.prototype.Tc,Z.prototype.Md,"RCSR"],hf[65394]=[null,null,Z.prototype.Sc,Z.prototype.Ld,"RBUF"],hf[65396]=[null,null,Z.prototype.nd,Z.prototype.fe,"XCSR"],hf[65398]=[null,null,Z.prototype.md,Z.prototype.ee,"XBUF"],hf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Z(d);C(d,c)}}); function ac(a){x.call(this,"PC11",a,ac);this.c=a.autoMount||null;this.m=0;this.O=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=kf;this.g=lf;this.C=this.i="";this.K=this.ga=this.fa=null;this.I=-1;this.F=!Aa("Mobi")&&window&&"FileReader"in window}z(ac);var kf="",lf=0;h=ac.prototype;
function $b(a){x.call(this,"PC11",a,$b);this.c=a.autoMount||null;this.m=0;this.N=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=jf;this.f=kf;this.C=this.i="";this.K=this.ga=this.fa=null;this.I=-1;this.D=!Aa("Mobi")&&window&&"FileReader"in window}z($b);var jf="",kf=0;h=$b.prototype; h.Z=function(a,b,c){var d=this,e=lf;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){t("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a=
h.Z=function(a,b,c){var d=this,e=kf;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){t("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a= d.o.listTapes;a&&mf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;mf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1};
d.o.listTapes;a&&lf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.D){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;lf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;this.J=nf(a);var e=this;if((this.c=sc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.M=Vb(56,4);this.R=Sb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,of(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Tb(e.a,e.M))});cb(b,this,pf);eb(b,this.reset.bind(this));qf(this,"None",kf,!0);this.F&&
h.ia=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.F=d;this.J=mf(a);var e=this;if((this.c=rc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.M=Ub(56,4);this.R=Rb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,nf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Sb(e.a,e.M))});cb(b,this,of);pf(this,"None",jf,!0);this.D&&pf(this,"Local Tape","?"); qf(this,"Local Tape","?");qf(this,"Remote Tape","??");rf(this)||F(this)};h.ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function rf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?sf(a,c,b,1,!0):tf(a)}return!!a.m}
pf(this,"Remote Tape","??");qf(this)||F(this)};h.ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function qf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?rf(a,c,b,1,!0):sf(a)}return!!a.m} function mf(a,b,c,d,e){if(c)if("?"==c)a.G('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=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;sf(a,b,c,d,!1,e)}else uf(a,!1)}function sf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.g!=d)g++,uf(a,!0),a.j.Da?a.G("PC11 busy"):(e&&a.m++,vf(a,b,c,d,f)?g++:a.j.Da=!0);g&&wf(a,a.C,a.i,a.g,a.K,a.ga,a.fa)}
function lf(a,b,c,d,e){if(c)if("?"==c)a.G('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=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;rf(a,b,c,d,!1,e)}else tf(a,!1)}function rf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,tf(a,!0),a.j.Ea?a.G("PC11 busy"):(e&&a.m++,uf(a,b,c,d,f)?g++:a.j.Ea=!0);g&&vf(a,a.C,a.i,a.f,a.K,a.ga,a.fa)} function vf(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),wf(a,b,c,d,e),a.s="?");tf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.N;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ra(a.pa,e,f),(e=ta(e,f))&&wf(a,b,c,d,e.K,e.ga,e.fa));
function uf(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),vf(a,b,c,d,e),a.s="?");sf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.O;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ra(a.oa,e,f),(e=ta(e,f))&&vf(a,b,c,d,e.K,e.ga,e.fa)); a.j.Da=!1;a.m&&(a.m--,a.m||F(a));tf(a)})}function qf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function tf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
a.j.Ea=!1;a.m&&(a.m--,a.m||F(a));sf(a)})}function pf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function sf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}} function of(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function wf(a,b,c,d,e,f,g){a.C=b;a.i=c;a.g=d;a.K=e;a.ga=f;a.fa=g;2==d?a.J&&df(a.J,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=kf,a.g=lf,a.G("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),of(a,0))}
function nf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function vf(a,b,c,d,e,f,g){a.C=b;a.i=c;a.f=d;a.K=e;a.ga=f;a.fa=g;2==d?a.J&&cf(a.J,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=jf,a.f=kf,a.G("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),nf(a,0))} function uf(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.g&&a.status(1==a.g?"tape detached":"tape unloaded"),a.s=kf,a.g=lf,tf(a))}h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};h.Mc=function(){return this.b&65534};h.Hd=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Tb(this.a,this.M)):(this.b&=-129,this.b|=2048,this.A=0,Ub(this.a,this.R,1E3/Math.round(this.O/10))));this.b=this.b&-66|a&65};h.Lc=function(){this.b&=-129;this.b|=2048;return this.A};h.Gd=function(){};
function tf(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.f&&a.status(1==a.f?"tape detached":"tape unloaded"),a.s=jf,a.f=kf,sf(a))}h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};h.Mc=function(){return this.b&65534};h.Fd=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Sb(this.a,this.M)):(this.b&=-129,this.b|=2048,this.A=0,Tb(this.a,this.R,1E3/Math.round(this.N/10))));this.b=this.b&-66|a&65};h.Lc=function(){this.b&=-129;this.b|=2048;return this.A};h.Ed=function(){}; var xf={},pf=(xf[65384]=[null,null,ac.prototype.Mc,ac.prototype.Hd,"PRS"],xf[65386]=[null,null,ac.prototype.Lc,ac.prototype.Gd,"PRB"],xf);function yf(a,b,c){x.call(this,"Disk",{id:a.pa+".disk"+m(++zf,4)},yf);this.controller=a;this.l=a.l;this.D=a.D;this.g=b;this.xa=b.name;this.wb=b.wb;Af(this,c,b.U,b.Y,b.S,b.ha);F(this)}var zf=0;z(yf);h=yf.prototype;h.ia=function(a,b,c,d){this.D=d};
var wf={},of=(wf[65384]=[null,null,$b.prototype.Mc,$b.prototype.Fd,"PRS"],wf[65386]=[null,null,$b.prototype.Lc,$b.prototype.Ed,"PRB"],wf);function xf(a,b,c){x.call(this,"Disk",{id:a.oa+".disk"+m(++yf,4)},xf);this.controller=a;this.l=a.l;this.F=a.F;this.f=b;this.wa=b.name;this.vb=b.vb;zf(this,c,b.U,b.Y,b.S,b.ha);F(this)}var yf=0;z(xf);h=xf.prototype;h.ia=function(a,b,c,d){this.F=d}; function Af(a,b,c,d,e,f){a.mode=b;a.U=c;a.Y=d;a.S=e;a.ha=f;a.a=[];if("preload"!=a.mode){b=Array(a.U);for(c=0;c<b.length;c++){d=Array(a.Y);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=Bf(null,c,e,g,a.ha,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
function zf(a,b,c,d,e,f){a.mode=b;a.U=c;a.Y=d;a.S=e;a.ha=f;a.a=[];if("preload"!=a.mode){b=Array(a.U);for(c=0;c<b.length;c++){d=Array(a.Y);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=Af(null,c,e,g,a.ha,0);d[e]=f}b[c]=d}a.a=b}a.b=null} function Cf(a,b,c,d,e){var f=c;if(a.h)return!0;a.xa=b;a.Ca=c;a.ac=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.Y=e[1];a.S=e[2];a.ha=e[3]||512;c=a.ha>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.U);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Y),D=0;D<w.length;D++)for(var U=w[D]=Array(a.S),xa=0;xa<U.length;xa++){for(var Xb=Bf(null,d,D,xa+1,a.ha,0),Oe=Xb.data,lc=0;lc<c;lc++,f+=4)var dg=Oe[lc]=b.getInt32(f,
function Bf(a,b,c,d,e){var f=c;if(a.g)return!0;a.wa=b;a.Da=c;a.Zb=q(c);a.g=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.Y=e[1];a.S=e[2];a.ha=e[3]||512;c=a.ha>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.U);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Y),D=0;D<w.length;D++)for(var U=w[D]=Array(a.S),xa=0;xa<U.length;xa++){for(var Vb=Af(null,d,D,xa+1,a.ha,0),Oe=Vb.data,kc=0;kc<c;kc++,f+=4)var cg=Oe[kc]=b.getInt32(f, !0),e=e+dg&-1;Xb.ba=c;U[xa]=Xb}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.g,c,a.xa,a.Ca),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.wb?"":e)+"&format=json"));return!!r(f,
!0),e=e+cg&-1;Vb.ba=c;U[xa]=Vb}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.g&&(a.g.call(a.controller,a.f,c,a.wa,a.Da),a.g=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.vb?"":e)+"&format=json"));return!!r(f, null,!0,function(b,c,d){Df(a,b,c,d)})}
null,!0,function(b,c,d){Cf(a,b,c,d)})} function Df(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.N;if(d)a.controller.G('Unable to load disk "'+a.xa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.pa,b,c);try{if(0<q(a.ac,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.xa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
function Cf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.O;if(d)a.controller.G('Unable to load disk "'+a.wa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.oa,b,c);try{if(0<q(a.Zb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.wa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ c+")");if(k.length)if(1==k.length)t(k[0]);else{a.U=k.length;a.Y=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ha=l&&l.length||512;for(d=c=0;d<a.U;d++)for(f=0;f<a.Y;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var w=l.bytes;if(void 0!==w&&w.length){for(var D=n<<2,U=w.length;U<D;U++)w[U]=p;Ef(l,w)}else u=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=u;delete l.bytes}Bf(l,d,f);for(D=0;D<
c+")");if(k.length)if(1==k.length)t(k[0]);else{a.U=k.length;a.Y=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ha=l&&l.length||512;for(d=c=0;d<a.U;d++)for(f=0;f<a.Y;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var w=l.bytes;if(void 0!==w&&w.length){for(var D=n<<2,U=w.length;U<D;U++)w[U]=p;Df(l,w)}else u=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=u;delete l.bytes}Af(l,d,f);for(D=0;D< u.length;D++)c=c+u[D]&-1}a.a=k;a.b=c;e=a}else t("Empty disk image: "+a.xa)}catch(xa){t("Disk image error ("+b+"): "+xa.message)}}a.h&&(a.h.call(a.i,a.g,e,a.xa,a.Ca),a.h=null)}function Bf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.ke=b;a.le=c;a.ma=a.ba=0;a.wa=!1;return a}
u.length;D++)c=c+u[D]&-1}a.a=k;a.b=c;e=a}else t("Empty disk image: "+a.wa)}catch(xa){t("Disk image error ("+b+"): "+xa.message)}}a.g&&(a.g.call(a.i,a.f,e,a.wa,a.Da),a.g=null)}function Af(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.ie=b;a.je=c;a.la=a.ba=0;a.va=!1;return a} h.seek=function(a,b,c,d,e){d=null;var f=this.g,g=this.a[a];if(g){var k=g[b];if(!k&&f.gc&&b<f.Y)for(k=g[b]=Array(f.hc),g=0;g<k.length;g++)k[g]=Bf(null,a,b,g+1,f.Qb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.gc&&9==f.Jb&&(d=k[g]=Bf(null,a,b,f.Jb,f.Qb,0))}}e&&e(d,!1);return d};function Ef(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
h.seek=function(a,b,c,d,e){d=null;var f=this.f,g=this.a[a];if(g){var k=g[b];if(!k&&f.ec&&b<f.Y)for(k=g[b]=Array(f.fc),g=0;g<k.length;g++)k[g]=Af(null,a,b,g+1,f.Sb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.ec&&9==f.Ib&&(d=k[g]=Af(null,a,b,f.Ib,f.Sb,0))}}e&&e(d,!1);return d};function Df(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e} h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f<a.ma?(a.ba+=a.ma-f,a.ma=f):f>=a.ma+a.ba&&(a.ba+=f-(a.ma+a.ba)+1):(a.ma=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f<a.la?(a.ba+=a.la-f,a.la=f):f>=a.la+a.ba&&(a.ba+=f-(a.la+a.ba)+1):(a.la=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null}; function Ff(a,b){var c=a.Y*a.S,d=b/c|0;return d<a.U?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function Gf(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Ca,this.b,this.U,this.Y,this.S,this.ha];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var k=[],l=0,n=g.ma,p=g.ma+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.ma,k]}}return b};
function Ef(a,b){var c=a.Y*a.S,d=b/c|0;return d<a.U?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function Ff(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Da,this.b,this.U,this.Y,this.S,this.ha];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var k=[],l=0,n=g.la,p=g.la+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.la,k]}}return b}; h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?Af(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?zf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=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;l<e;)k.data[l++]=k.pattern;l=0;k.ma=e;for(k.ba=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.G("Unable to restore disk '"+this.xa+": "+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;l<e;)k.data[l++]=k.pattern;l=0;k.la=e;for(k.ba=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.G("Unable to restore disk '"+this.wa+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=Ff(this,a++);)Hf(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")};
h.toJSON=function(){var a;a=0;for(var b;b=Ef(this,a++);)Gf(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 Hf(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,"RL11",a,N);this.g=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Aa("Mobi")&&window&&"FileReader"in window}z(N);h=N.prototype;
function Gf(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,"RL11",a,N);this.f=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Aa("Mobi")&&window&&"FileReader"in window}z(N);h=N.prototype; h.Z=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&If(d,a)},!0;case "loadDrive":return this.o[b]=
h.Z=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Hf(d,a)},!0;case "loadDrive":return this.o[b]= c,c.onclick=function(){var a=d.o.listDisks;a&&Jf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,k;k=Ff(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(Gf(a,k,l));b=btoa(b);a=a.ac.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
c,c.onclick=function(){var a=d.o.listDisks;a&&If(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,k;k=Ef(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(Ff(a,k,l));b=btoa(b);a=a.Zb.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");t(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}), typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");t(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),
c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;If(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Jf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
h.ia=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.F=d;if((this.f=rc(this.l,"autoMount")||this.f)&&"string"==typeof this.f)try{this.f=eval("("+this.f+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.f+")"),this.f=null}Jf(this);this.D=Ub(112,5);cb(b,this,Kf,4194304);Lf(this,"None","",!0);this.A&&Lf(this,"Local Disk","?");Lf(this,"Remote Disk","??");Mf(this)||F(this)}; h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;if((this.g=sc(this.l,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.g+")"),this.g=null}Kf(this);this.F=Vb(112,5);cb(b,this,Lf,4194304);eb(b,this.reset.bind(this));Mf(this,"None","",!0);this.A&&Mf(this,"Local Disk","?");Mf(this,"Remote Disk","??");Nf(this)||F(this)};
h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Kb){for(a=0;a<this.b.length;a++)Nf(this,a,!0);Mf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Hf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Jf(this)};h.save=function(){return(new O(this)).data()}; h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Lb){for(a=0;a<this.b.length;a++)Of(this,a,!0);Nf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";If(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Kf(this)};h.save=function(){return(new O(this)).data()};
h.restore=function(a){return Jf(this,a[0])};function Mf(a,b){b||(a.s=0);if(a.f)for(var c in a.f){var d=a.f[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Of(a,g,f,e,!0)&&b&&F(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s} h.restore=function(a){return Kf(this,a[0])};function Nf(a,b){b||(a.s=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Pf(a,g,f,e,!0)&&b&&F(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s}
function If(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Of(a,e,b,c,!1,d)}else Nf(a,e)} function Jf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Pf(a,e,b,c,!1,d)}else Of(a,e)}
function Of(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Da.toLowerCase()!=d.toLowerCase()&&(g++,Nf(a,b,!0),k.ub?a.G("RL11 busy"):(k.ub=!0,e&&(k.tb=!0,a.s++),k.jb=!!f,Bf(new xf(a,k,"preload"),c,d,f,a.gc)&&g++));return g} function Pf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Of(a,b,!0),k.vb?a.G("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.s++),k.ib=!!f,Cf(new yf(a,k,"preload"),c,d,f,a.ic)&&g++));return g}
h.gc=function(a,b,c,d,e){var f;a.ub=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.ca=b,a.wa=c,a.Da=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.zb),a.tb||e),this.l&&xc(this.l)):a.jb=!1;a.tb&&(a.tb=!1,--this.s||F(this));Hf(this,a.zb)}; h.ic=function(a,b,c,d,e){var f;a.vb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.ca=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.ub||e),this.l&&yc(this.l)):a.ib=!1;a.ub&&(a.ub=!1,--this.s||F(this));If(this,a.yb)};
function Lf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} function Mf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Hf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.jb?"?":c.Da,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Nf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.wa="",d.Da="",d.ca=null,d.jb=!1,c||(a.G("Drive RL"+b+" unloaded",c),Hf(a,b))} function If(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.ib?"?":c.Ca,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Of(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.xa="",d.Ca="",d.ca=null,d.ib=!1,c||(a.G("Drive RL"+b+" unloaded",c),If(a,b))}
function Jf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.zb=b;d.ub=d.jb=!1;d.name=c.ya;d.U=512;d.Y=2;d.S=40;d.ha=256;d.vb=!0;d.he=0;d.ge=0;d.Ib=1;d.fc=d.S;d.Sb=d.ha;d.ke=0;d.le=null;d.ca||(d.Da="");d.status=29|(512==d.U?128:0)}return!0} function Kf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.yb=b;d.vb=d.ib=!1;d.name=c.Ga;d.U=512;d.Y=2;d.S=40;d.ha=256;d.wb=!0;d.je=0;d.ie=0;d.Jb=1;d.hc=d.S;d.Qb=d.ha;d.me=0;d.ne=null;d.ca||(d.Ca="");d.status=29|(512==d.U?128:0)}return!0}
h.hc=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; h.jc=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0};
h.zc=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Nb(this.g,f,u|w<<8);if(Qb(this.g)){k=8192;break}f+=2;if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)}; h.zc=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Ob(this.h,f,u|w<<8);if(Rb(this.h)){k=8192;break}f+=2;if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};
h.ud=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.g,f);if(Qb(this.g)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Wc=function(){return this.L&65535}; h.wd=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.h,f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Wc=function(){return this.L&65535};
h.Pd=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.zc;case 10:b||(b=this.ud),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w& h.Rd=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.zc;case 10:b||(b=this.wd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w&
63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.hc.bind(this)))}a&&(this.L|=129,this.L&64&&Sb(this.a,this.D))}};h.Uc=function(){return this.v};h.Nd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Qd=function(a){this.c=a};h.Yc=function(){return this.m};h.Rd=function(a){this.m=a};h.Vc=function(){return this.w};h.Od=function(a){this.w=a&63}; 63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.jc.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.F))}};h.Uc=function(){return this.v};h.Pd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Sd=function(a){this.c=a};h.Yc=function(){return this.m};h.Td=function(a){this.m=a};h.Vc=function(){return this.w};h.Qd=function(a){this.w=a&63};
var Pf={},Kf=(Pf[63744]=[null,null,N.prototype.Wc,N.prototype.Pd,"RLCS"],Pf[63746]=[null,null,N.prototype.Uc,N.prototype.Nd,"RLBA"],Pf[63748]=[null,null,N.prototype.Xc,N.prototype.Qd,"RLDA"],Pf[63750]=[null,null,N.prototype.Yc,N.prototype.Rd,"RLMP"],Pf[63752]=[null,null,N.prototype.Vc,N.prototype.Od,"RLBE"],Pf); var Qf={},Lf=(Qf[63744]=[null,null,N.prototype.Wc,N.prototype.Rd,"RLCS"],Qf[63746]=[null,null,N.prototype.Uc,N.prototype.Pd,"RLBA"],Qf[63748]=[null,null,N.prototype.Xc,N.prototype.Sd,"RLDA"],Qf[63750]=[null,null,N.prototype.Yc,N.prototype.Td,"RLMP"],Qf[63752]=[null,null,N.prototype.Vc,N.prototype.Qd,"RLBE"],Qf);
function Qf(a,b,c){x.call(this,"Computer",a,Qf);this.j.O=!1;Rf(this,b);this.w=rc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Sf;this.s=null;this.i=this.I=!1;this.N=rc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Tf(this);if(this.a=Ta("CPU",this.id)){this.F=Ta("Debugger",this.id);this.g=new vb({id:this.oa+".bus",busWidth:this.M},this.a,this.F);var d,e=A(this.id);if((this.A=Ta("Panel",this.id))&&this.A.Wa)for(b=0;b<e.length;b++)d=e[b],d.G=this.A.G,d.T=this.A.T,d.Wa=this.A.Wa; function Rf(a,b,c){x.call(this,"Computer",a,Rf);this.j.N=!1;Sf(this,b);this.A=sc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Tf;this.s=null;this.i=this.I=!1;this.O=sc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Uf(this);if(this.a=Ta("CPU",this.id)){this.D=Ta("Debugger",this.id);this.h=new vb({id:this.pa+".bus",busWidth:this.M},this.a,this.D);var d,e=A(this.id);if((this.w=Ta("Panel",this.id))&&this.w.Xa)for(b=0;b<e.length;b++)d=e[b],d.G=this.w.G,d.T=this.w.T,d.Xa=this.w.Xa;
this.T("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ia&&d.ia(this,this.g,this.a,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=rc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.i=!0,this.b=Sf),this.b&&(this.v=new O(this, this.T("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ia&&d.ia(this,this.h,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=sc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.i=!0,this.b=Tf),this.b&&(this.v=new O(this,
"1.30.3"),Uf(this.v)?b=null:delete this.v);!b&&this.b&&(b=Vf(this))&&(this.i=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.m=null,g.i=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.s=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.w=!0);!c&&this.w&&Wf(this,this.Ya)}else t("Unable to find CPU component")}z(Qf);var Sf=0; "1.30.3"),Vf(this.v)?b=null:delete this.v);!b&&this.b&&(b=Wf(this))&&(this.i=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.m=null,g.i=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.s=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Xf(this,this.Za)}else t("Unable to find CPU component")}z(Rf);var Tf=0;
function Rf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.J=b}function rc(a,b,c){var d=b.toLowerCase(),d=La[b]||La[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Wf(a,b,c){for(var d=A(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Va(f)){Va(f,function(){Wf(a,b,c)});return}}b.call(a,c)} function Sf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.J=b}function sc(a,b,c){var d=b.toLowerCase(),d=La[b]||La[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Xf(a,b,c){for(var d=A(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Va(f)){Va(f,function(){Xf(a,b,c)});return}}b.call(a,c)}
function Xf(a,b){var c=new O(a,"1.30.3","validate");if(Uf(c)&&Yf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Qf.prototype; function Yf(a,b){var c=new O(a,"1.30.3","validate");if(Vf(c)&&Zf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Rf.prototype;
h.Ya=function(a){void 0===a&&(a=this.b||(this.s?1:Sf));if(!this.l){this.l++;var b=!1,c=!1;this.D=!1;var d=this.v||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Sf){if(Uf(d,this.s)){this.f=new O(this,"1.30.3","failsafe");Uf(this.f)&&(Zf(this,d),a=2,$f(this.f));this.f.set("timestamp",sa());ag(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Yf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Uf(d,g):("error"== h.Za=function(a){void 0===a&&(a=this.b||(this.s?1:Tf));if(!this.l){this.l++;var b=!1,c=!1;this.F=!1;var d=this.v||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Tf){if(Vf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Vf(this.g)&&($f(this,d),a=2,ag(this.g));this.g.set("timestamp",sa());bg(this.g);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Zf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Vf(d,g):("error"==
f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(za("user",""),this.c=null)):this.T(f+": "+g),$f(d),Uf(d)?(c=Yf(d),e=!0):c=!1))}e&&Xf(this,c?d:null)}else 2==a&&d.clear()}else Xf(this);delete this.s;delete this.v}e=A(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=bg(this,g,d,b,c));b=[d,a,c];-1!=a?Wf(this,this.Jb,b):this.Jb(b)}}; f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(za("user",""),this.c=null)):this.T(f+": "+g),ag(d),Vf(d)?(c=Zf(d),e=!0):c=!1))}e&&Yf(this,c?d:null)}else 2==a&&d.clear()}else Yf(this);delete this.s;delete this.v}e=A(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=cg(this,g,d,b,c));b=[d,a,c];-1!=a?Xf(this,this.Kb,b):this.Kb(b)}};
function bg(a,b,c,d,e){if(!b.j.O){b.j.O=!0;if(b.ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ka(f,d)&&f&&(t("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=Sf,window&&window.location.reload()):a.D=!0,b.ka(null),e=!1)}if(!d&&b.Ob)for(a=b.Ob.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} function cg(a,b,c,d,e){if(!b.j.N){b.j.N=!0;if(b.ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ka(f,d)&&f&&(t("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=Tf,window&&window.location.reload()):a.F=!0,b.ka(null),e=!1)}if(!d&&b.Pb)for(a=b.Pb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
h.Jb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.j.O=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(bg(this,this.a,b,c,a),this.xa(),this.a.Va());this.D&&(Zf(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0}; h.Kb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.j.N=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(cg(this,this.a,b,c,a),this.ya(),this.a.Wa());this.F&&($f(this,b),b.clear());!c&&this.g&&(this.g.clear(),delete this.g);this.l=0};
function Zf(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.N;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} function $f(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}}
function dg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&G(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.O=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l<k.length;l++){var n=k[l];n.j.O&&(n.ja&&(d=n.ja(b,c),"object"===typeof d&&f.set(n.id, function eg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&G(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.N=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l<k.length;l++){var n=k[l];n.j.N&&(n.ja&&(d=n.ja(b,c),"object"===typeof d&&f.set(n.id,
d)),c&&(n.j.O=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&eg(a,a.c,f.toString()),ag(g)&&ag(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.j.O=!1,b=a.o.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.g&&this.g.reset&&this.g.reset();this.a&&this.a.reset&&this.a.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.g&&c!==this.a&&c.reset&&c.reset()}this.xa(-1)}; d)),c&&(n.j.N=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&fg(a,a.c,f.toString()),bg(g)&&bg(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.j.N=!1,b=a.o.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();this.a&&this.a.reset&&this.a.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c!==this.a&&c.reset&&c.reset()}this.ya(-1)};
h.start=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.xa(-1)};h.stop=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.xa(-1)}; h.start=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ya(-1)};h.stop=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ya(-1)};
h.xa=function(a){if(this.a){var b=this.a,c=b.o.speed;c&&(c.textContent=b.j.P&&b.pa?b.pa.toFixed(2)+"Mhz":"Stopped")}if(this.A&&(b=this.A,b.s)){var c=b.a.j.P,d=!!(b.a.u&4);if(!(0<a&&60>(b.w+=a))){for(var e=0;e<b.a.h.length;e++)kb(b,"R"+e,b.a.h[e]);e=Yb(b.a);kb(b,"PS",e);kb(b,"NF",e&8?1:0,1);kb(b,"ZF",e&4?1:0,1);kb(b,"VF",e&2?1:0,1);kb(b,"CF",e&1?1:0,1);b.w=0}sb(b,0<a&&c&&!d?b.a.h[7]:b.da);rb(b,b.m);a=b.a.Ba?b.a.Fa&16?1:2:4;tb(b,"B22",a&1);tb(b,"B18",a&2);tb(b,"B16",a&4)}}; h.ya=function(a){if(this.a){var b=this.a,c=b.o.speed;c&&(c.textContent=b.j.P&&b.qa?b.qa.toFixed(2)+"Mhz":"Stopped")}if(this.w&&(b=this.w,b.s)){var c=b.a.j.P,d=!!(b.a.u&4);if(!(0<a&&60>(b.w+=a))){for(var e=0;e<b.a.f.length;e++)kb(b,"R"+e,b.a.f[e]);e=Zb(b.a);kb(b,"PS",e);kb(b,"NF",e&8?1:0,1);kb(b,"ZF",e&4?1:0,1);kb(b,"VF",e&2?1:0,1);kb(b,"CF",e&1?1:0,1);b.w=0}sb(b,0<a&&c&&!d?b.a.f[7]:b.da);rb(b,b.m);a=b.a.Ba?b.a.Ea&16?1:2:4;tb(b,"B22",a&1);tb(b,"B18",a&2);tb(b,"B16",a&4)}};
h.Z=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.l||(d.j.O?dg(d,!1,!0):Wf(d,d.Ya))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.O&&!d.l)if(d.b&&!d.m){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");dg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Kb=!0),d.Ya(Sf),d.Kb=!1)}else d.reset(),d.a&&d.a.Va()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c); h.Z=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.l||(d.j.N?eg(d,!1,!0):Xf(d,d.Za))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.N&&!d.l)if(d.b&&!d.m){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");eg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Lb=!0),d.Za(Tf),d.Lb=!1)}else d.reset(),d.a&&d.a.Wa()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);
else return this.o[b]=c,c.onclick=function(){var a=Tf(d,!0);if(a){var b=!!(d.b&&!d.m||d.C),c=dg(d,b);b?eg(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1}; else return this.o[b]=c,c.onclick=function(){var a=Uf(d,!0);if(a){var b=!!(d.b&&!d.m||d.C),c=eg(d,b);b?fg(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};
function Tf(a,b){var c=a.c;c||((c=ya("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=fg(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c} function Uf(a,b){var c=a.c;c||((c=ya("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=gg(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
function fg(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){t(d.message+" ("+c+")")}return a.c}function Vf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+gg(a,"1.30.3"));return b} function gg(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){t(d.message+" ("+c+")")}return a.c}function Wf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+hg(a,"1.30.3"));return b}
function eg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=gg(a,"1.30.3");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.G("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.G(c),za("user",""),a.c=null)}} function fg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=hg(a,"1.30.3");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.G("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.G(c),za("user",""),a.c=null)}}
function mf(a){var b;a=A(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function xc(a){if(a.Wa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Wa.focus();window&&window.scrollTo(b,c)}}Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new Qf(g,d,!0);C(g,f);g.w&&Wf(g,g.Ya)}}); function nf(a){var b;a=A(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function yc(a){if(a.Xa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Xa.focus();window&&window.scrollTo(b,c)}}Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new Rf(g,d,!0);C(g,f);g.A&&Xf(g,g.Za)}});
Ba.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.R&&!c.j.O&&c.Ya(-1)}});Ba.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.j.O&&dg(c,!(!c.b||c.m),!0)}});function O(a,b,c){this.id=a.id;this.key=gg(a,b,c);this.F=a.F;$f(this,a.mc)}function gg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a} Ba.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.R&&!c.j.N&&c.Za(-1)}});Ba.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.j.N&&eg(c,!(!c.b||c.m),!0)}});function O(a,b,c){this.id=a.id;this.key=hg(a,b,c);this.D=a.D;ag(this,a.qd)}function hg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){$f(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c, O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){ag(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
1);c=0}}};function $f(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function ag(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Yf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Uf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=ya(a.key))?(a[a.id]=b,a.a=!0):!1}var hg=0; 1);c=0}}};function ag(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function bg(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Zf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Vf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=ya(a.key))?(a[a.id]=b,a.a=!0):!1}var ig=0;
function ig(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):jg(k,a,b,c,d,e,f)})} function jg(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):kg(k,a,b,c,d,e,f)})}
function jg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ra(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"), function kg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ra(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?kg(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)} a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?lg(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
function kg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, function lg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],g);kg(a,b,c)}})}else c(a,null)} "");a=a.replace(d[0],g);lg(a,b,c)}})}else c(a,null)}
function lg(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--hg||Ia(!0));l=!1}var g,k,l=!0;hg++;Qa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| function mg(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--ig||Ia(!0));l=!1}var g,k,l=!0;ig++;Qa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c||
(c="/versions/pdpjs/1.30.3/components.xsl");n=function(d,k){k?ig(c,null,null,!1,e,function(d,l){l?(Ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--hg||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--hg||Ia(!0)):f("invalid machine element: "+ (c="/versions/pdpjs/1.30.3/components.xsl");n=function(d,k){k?jg(c,null,null,!1,e,function(d,l){l?(Ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ig||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ig||Ia(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ig(b,a,d,!0,e,n):jg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return lg(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ja;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11.map a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?jg(b,a,d,!0,e,n):kg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return mg(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ja;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11.map