Added MMU dump command ("d mmu [filter]"), fixed byte updates of PDRs, masked 18-bit UNIBUS addresses when UNIBUS relocation map not enabled, and fixed reads of MMR0 when ABORT bits are set

This commit is contained in:
Jeff 2016-11-17 13:22:25 -08:00 committed by Jeff Parsons
commit 9148cec085
8 changed files with 424 additions and 360 deletions

View file

@ -166,11 +166,12 @@ Component.subclass(BusPDP11);
BusPDP11.IOPAGE_16BIT = 0xE000; /*000160000*/ // eg, PDP-11/20 BusPDP11.IOPAGE_16BIT = 0xE000; /*000160000*/ // eg, PDP-11/20
BusPDP11.IOPAGE_18BIT = 0x3E000; /*000760000*/ // eg, PDP-11/45 BusPDP11.IOPAGE_18BIT = 0x3E000; /*000760000*/ // eg, PDP-11/45
BusPDP11.IOPAGE_UNIBUS = 0x3C0000; /*017000000*/
BusPDP11.IOPAGE_22BIT = 0x3FE000; /*017760000*/ // eg, PDP-11/70 BusPDP11.IOPAGE_22BIT = 0x3FE000; /*017760000*/ // eg, PDP-11/70
BusPDP11.IOPAGE_LENGTH = 0x2000; // ie, 8Kb BusPDP11.IOPAGE_LENGTH = 0x2000; // ie, 8Kb
BusPDP11.IOPAGE_MASK = BusPDP11.IOPAGE_LENGTH - 1; BusPDP11.IOPAGE_MASK = BusPDP11.IOPAGE_LENGTH - 1;
BusPDP11.MAX_MEMORY = BusPDP11.IOPAGE_UNIBUS - 16384; // Maximum memory address (need less memory for BSD 2.9 boot)
BusPDP11.UNIBUS_22BIT = 0x3C0000; /*017000000*/
BusPDP11.MAX_MEMORY = BusPDP11.UNIBUS_22BIT - 16384; // Maximum memory address (need less memory for BSD 2.9 boot)
BusPDP11.ERROR = { BusPDP11.ERROR = {
RANGE_INUSE: 1, RANGE_INUSE: 1,
@ -319,15 +320,11 @@ BusPDP11.IOController = {
fWrite = true; fWrite = true;
} }
/* /*
* If a writeWord() handler exists, call the readWord() handler first to get the original data, * If a writeWord() handler exists, call the readWord() handler first to get the original data
* then call writeWord() with the new data pre-inserted in the original data. * (with fPreWrite set to true) and call writeWord() with the new data inserted into the original data.
*
* WARNING: Whenever we call readWord() under these circumstances, we zero the address parameter,
* so that the handler can distinguish this case. Thus, if we're dealing with a special register
* where a byte write operation modifies the entire register, the handler can simply return zero.
*/ */
else if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) { else if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) {
w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](0) : 0; w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](addrMasked, true) : 0;
if (!(addrMasked & 0x1)) { if (!(addrMasked & 0x1)) {
afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & ~0xff) | b, addrMasked); afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & ~0xff) | b, addrMasked);
fWrite = true; fWrite = true;
@ -339,18 +336,14 @@ BusPDP11.IOController = {
} else if (addrMasked & 0x1) { } else if (addrMasked & 0x1) {
/* /*
* If no handler existed, and this address was odd, then perhaps a handler exists for the even address; * If no handler existed, and this address was odd, then perhaps a handler exists for the even address;
* if so, call the readWord() handler first to get the original data, then call writeWord() with the new * if so, call the readWord() handler first to get the original data (with fPreWrite set to true) and call
* data pre-inserted in (the high byte of) the original data. * writeWord() with the new data inserted into (the high byte of) the original data.
*
* WARNING: Whenever we call readWord() under these circumstances, we zero the address parameter,
* so that the handler can distinguish this case. Thus, if we're dealing with a special register
* where a byte write operation modifies the entire register, the handler can simply return zero.
*/ */
afn = bus.aIOHandlers[off & ~0x1]; afn = bus.aIOHandlers[off & ~0x1];
if (afn) { if (afn) {
if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) { if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) {
addrMasked &= ~0x1; addrMasked &= ~0x1;
w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](0) : 0; w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](addrMasked, true) : 0;
afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & 0xff) | (b << 8), addrMasked); afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & 0xff) | (b << 8), addrMasked);
fWrite = true; fWrite = true;
} else if (afn[BusPDP11.IOHANDLER.WRITE_BYTE]) { } else if (afn[BusPDP11.IOHANDLER.WRITE_BYTE]) {
@ -930,11 +923,11 @@ BusPDP11.prototype.setMemoryBlocks = function(addr, size, aBlocks, type)
BusPDP11.prototype.getByte = function(addr) BusPDP11.prototype.getByte = function(addr)
{ {
/* /*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map. * UNIBUS relocation map.
*/ */
if (addr >= BusPDP11.IOPAGE_UNIBUS) { if (addr >= BusPDP11.UNIBUS_22BIT) {
addr = this.cpu.mapUnibus(addr); addr = this.cpu.mapUnibus(addr);
} }
return this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr); return this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr);
@ -952,11 +945,11 @@ BusPDP11.prototype.getByte = function(addr)
BusPDP11.prototype.getByteDirect = function(addr) BusPDP11.prototype.getByteDirect = function(addr)
{ {
/* /*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map. * UNIBUS relocation map.
*/ */
if (addr >= BusPDP11.IOPAGE_UNIBUS) { if (addr >= BusPDP11.UNIBUS_22BIT) {
addr = this.cpu.mapUnibus(addr); addr = this.cpu.mapUnibus(addr);
} }
this.fFault = false; this.fFault = false;
@ -976,11 +969,11 @@ BusPDP11.prototype.getByteDirect = function(addr)
BusPDP11.prototype.getWord = function(addr) BusPDP11.prototype.getWord = function(addr)
{ {
/* /*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map. * UNIBUS relocation map.
*/ */
if (addr >= BusPDP11.IOPAGE_UNIBUS) { if (addr >= BusPDP11.UNIBUS_22BIT) {
addr = this.cpu.mapUnibus(addr); addr = this.cpu.mapUnibus(addr);
} }
var off = addr & this.nBlockLimit; var off = addr & this.nBlockLimit;
@ -1003,11 +996,11 @@ BusPDP11.prototype.getWord = function(addr)
BusPDP11.prototype.getWordDirect = function(addr) BusPDP11.prototype.getWordDirect = function(addr)
{ {
/* /*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map. * UNIBUS relocation map.
*/ */
if (addr >= BusPDP11.IOPAGE_UNIBUS) { if (addr >= BusPDP11.UNIBUS_22BIT) {
addr = this.cpu.mapUnibus(addr); addr = this.cpu.mapUnibus(addr);
} }
var w; var w;
@ -1034,11 +1027,11 @@ BusPDP11.prototype.getWordDirect = function(addr)
BusPDP11.prototype.setByte = function(addr, b) BusPDP11.prototype.setByte = function(addr, b)
{ {
/* /*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map. * UNIBUS relocation map.
*/ */
if (addr >= BusPDP11.IOPAGE_UNIBUS) { if (addr >= BusPDP11.UNIBUS_22BIT) {
addr = this.cpu.mapUnibus(addr); addr = this.cpu.mapUnibus(addr);
} }
this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr); this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr);
@ -1057,11 +1050,11 @@ BusPDP11.prototype.setByte = function(addr, b)
BusPDP11.prototype.setByteDirect = function(addr, b) BusPDP11.prototype.setByteDirect = function(addr, b)
{ {
/* /*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map. * UNIBUS relocation map.
*/ */
if (addr >= BusPDP11.IOPAGE_UNIBUS) { if (addr >= BusPDP11.UNIBUS_22BIT) {
addr = this.cpu.mapUnibus(addr); addr = this.cpu.mapUnibus(addr);
} }
this.fFault = false; this.fFault = false;
@ -1080,11 +1073,11 @@ BusPDP11.prototype.setByteDirect = function(addr, b)
BusPDP11.prototype.setWord = function(addr, w) BusPDP11.prototype.setWord = function(addr, w)
{ {
/* /*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map. * UNIBUS relocation map.
*/ */
if (addr >= BusPDP11.IOPAGE_UNIBUS) { if (addr >= BusPDP11.UNIBUS_22BIT) {
addr = this.cpu.mapUnibus(addr); addr = this.cpu.mapUnibus(addr);
} }
var off = addr & this.nBlockLimit; var off = addr & this.nBlockLimit;
@ -1110,11 +1103,11 @@ BusPDP11.prototype.setWord = function(addr, w)
BusPDP11.prototype.setWordDirect = function(addr, w) BusPDP11.prototype.setWordDirect = function(addr, w)
{ {
/* /*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the * then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map. * UNIBUS relocation map.
*/ */
if (addr >= BusPDP11.IOPAGE_UNIBUS) { if (addr >= BusPDP11.UNIBUS_22BIT) {
addr = this.cpu.mapUnibus(addr); addr = this.cpu.mapUnibus(addr);
} }
var off = addr & this.nBlockLimit; var off = addr & this.nBlockLimit;

View file

@ -318,11 +318,11 @@ CPUStatePDP11.prototype.setMemoryAccess = function()
*/ */
CPUStatePDP11.prototype.getMMR0 = function() CPUStatePDP11.prototype.getMMR0 = function()
{ {
/* var data = this.regMMR0;
* Technically, we never allow the UNUSED bits to be set, so there's no point going out of our way if (!(data & PDP11.MMR0.ABORT)) {
* to clear them, but it doesn't hurt to include them in the mask. data = (data & ~(PDP11.MMR0.UNUSED | PDP11.MMR0.PAGE | PDP11.MMR0.MODE)) | (this.mmuLastMode << 5) | (this.mmuLastPage << 1);
*/ }
return (this.regMMR0 & ~(PDP11.MMR0.UNUSED | PDP11.MMR0.PAGE | PDP11.MMR0.MODE)) | (this.mmuLastMode << 5) | (this.mmuLastPage << 1); return data;
}; };
/** /**
@ -1278,19 +1278,6 @@ CPUStatePDP11.prototype.updateSubFlags = function(result, src, dst)
} }
}; };
/**
* panic(reason)
*
* TODO: Something.
*
* @this {CPUStatePDP11}
* @param {number} reason
*/
CPUStatePDP11.prototype.panic = function(reason)
{
console.log("panic(" + reason + ")");
};
/** /**
* trap(vector, flag, reason) * trap(vector, flag, reason)
* *
@ -1433,7 +1420,7 @@ CPUStatePDP11.prototype.getTrapStatus = function()
/** /**
* mapUnibus(addr) * mapUnibus(addr)
* *
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000), * If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.UNIBUS_22BIT aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so if the UNIBUS relocation map is enabled, * then we have a 22-bit address pointing to the top 256Kb range, so if the UNIBUS relocation map is enabled,
* we must pass the lower 18 bits of that address through the map. * we must pass the lower 18 bits of that address through the map.
* *
@ -1470,8 +1457,19 @@ CPUStatePDP11.prototype.mapUnibus = function(addr)
var idx = (addr >> 13) & 0x1f; var idx = (addr >> 13) & 0x1f;
if (idx < 31) { if (idx < 31) {
if (this.regMMR3 & PDP11.MMR3.UNIBUS_MAP) { if (this.regMMR3 & PDP11.MMR3.UNIBUS_MAP) {
/*
* The UNIBUS map relocation is enabled
*/
addr = (this.unibusMap[idx] + (addr & 0x1ffe)) & 0x3ffffe; addr = (this.unibusMap[idx] + (addr & 0x1ffe)) & 0x3ffffe;
if (addr >= BusPDP11.IOPAGE_UNIBUS && addr < BusPDP11.IOPAGE_22BIT) this.panic(898); this.assert(addr < BusPDP11.UNIBUS_22BIT || addr >= BusPDP11.IOPAGE_22BIT);
} else {
/*
* Since UNIBUS map relocation is NOT enabled, then as explained above:
*
* If the UNIBUS map relocation is not enabled, an incoming 18-bit UNIBUS address has 4 leading zeroes added for
* referencing a 22-bit physical address. The lower 18 bits are the same. No relocation is performed.
*/
addr &= ~BusPDP11.UNIBUS_22BIT;
} }
} }
return addr; return addr;
@ -1607,7 +1605,6 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
this.mmuLastPage = page; this.mmuLastPage = page;
} }
var fAbort = false;
if (newMMR0) { if (newMMR0) {
if (newMMR0 & PDP11.MMR0.ABORT) { if (newMMR0 & PDP11.MMR0.ABORT) {
if (this.trapPSW >= 0) { if (this.trapPSW >= 0) {
@ -1618,11 +1615,11 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
this.assert(!(newMMR0 & ~PDP11.MMR0.UPDATE)); this.assert(!(newMMR0 & ~PDP11.MMR0.UPDATE));
this.setMMR0((this.regMMR0 & ~PDP11.MMR0.UPDATE) | newMMR0); this.setMMR0((this.regMMR0 & ~PDP11.MMR0.UPDATE) | newMMR0);
/* /*
* I've decided to NOT set fAbort if MMR0 already indicates an ABORT condition, * I've decided to NOT abort if MMR0 already indicates an ABORT condition,
* because otherwise we run the risk of infinitely looping; eg, we call trap(), which * because otherwise we run the risk of infinitely looping; eg, we call trap(), which
* calls mapVirtualToPhysical() on the trap vector, which faults again, etc. * calls mapVirtualToPhysical() on the trap vector, which faults again, etc.
*/ */
fAbort = true; this.trap(PDP11.TRAP.MMU, 0, PDP11.REASON.ABORT);
} }
} }
if (!(this.regMMR0 & (PDP11.MMR0.ABORT | PDP11.MMR0.TRAP_MMU))) { if (!(this.regMMR0 & (PDP11.MMR0.ABORT | PDP11.MMR0.TRAP_MMU))) {
@ -1637,9 +1634,6 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
} }
} }
} }
if (fAbort) { // don't abort until the end, because it throws an exception
this.trap(PDP11.TRAP.MMU, 0, PDP11.REASON.ABORT);
}
} }
return physicalAddress; return physicalAddress;
}; };

View file

@ -1207,26 +1207,22 @@ if (DEBUGGER) {
value = cpu.regSL; value = cpu.regSL;
break; break;
case DebuggerPDP11.REG_MMR0: case DebuggerPDP11.REG_MMR0:
value = panel.getMMR0(); value = cpu.getMMR0();
break; break;
case DebuggerPDP11.REG_MMR1: case DebuggerPDP11.REG_MMR1:
value = panel.getMMR1(); value = cpu.getMMR1();
break; break;
case DebuggerPDP11.REG_MMR2: case DebuggerPDP11.REG_MMR2:
value = panel.getMMR2(); value = cpu.getMMR2();
break; break;
case DebuggerPDP11.REG_MMR3: case DebuggerPDP11.REG_MMR3:
value = panel.getMMR3(); value = cpu.getMMR3();
break; break;
case DebuggerPDP11.REG_AR: case DebuggerPDP11.REG_AR:
if (panel) { if (panel) value = panel.getAR();
value = panel.getAR();
}
break; break;
case DebuggerPDP11.REG_DR: case DebuggerPDP11.REG_DR:
if (panel) { if (panel) value = panel.getDR();
value = panel.getDR();
}
break; break;
case DebuggerPDP11.REG_SR: case DebuggerPDP11.REG_SR:
if (panel && panel.hasSwitches()) { if (panel && panel.hasSwitches()) {

View file

@ -351,6 +351,24 @@ var PDP11 = {
MMU_22BIT: 0x0010, MMU_22BIT: 0x0010,
UNIBUS_MAP: 0x0020 // UNIBUS map relocation enabled UNIBUS_MAP: 0x0020 // UNIBUS map relocation enabled
}, },
PDR: {
ACF: {
NR: 0x0, // non-resident, abort all accesses
RO1: 0x1, // read-only, abort on write attempt, memory management trap on read (11/70 only)
RO: 0x2, // read-only, abort on write attempt
U1: 0x3, // unused, abort all accesses--reserved for future use
RW1: 0x4, // read/write, memory management trap upon completion of a read or write
RW2: 0x5, // read/write, memory management trap upon completion of a write (11/70 only)
RW: 0x6, // read/write, no system trap/abort action
U2: 0x7 // unused, abort all accesses--reserved for future use
},
ED: 0x0080, // expansion direction (if set, the page expands downward from block number 127)
UNUSED: 0x0030,
MODIFIED: 0x0040, // page has been written (bit cleared when either PDR or PAR is written)
ACCESSED: 0x0080, // page has been accessed (bit cleared when either PDR or PAR is written) (11/70 only)
PLF: 0x7F00, // page length field
BC: 0x8000 // bypass cache (11/44 only)
},
/* /*
* Assorted special (UNIBUS) addresses * Assorted special (UNIBUS) addresses
* *

View file

@ -130,9 +130,62 @@ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg)
bus.addIOTable(this, DevicePDP11.UNIBUS_IOTABLE); bus.addIOTable(this, DevicePDP11.UNIBUS_IOTABLE);
bus.addResetHandler(this.reset.bind(this)); bus.addResetHandler(this.reset.bind(this));
if (DEBUGGER && dbg) {
dbg.messageDump(MessagesPDP11.MMU, function onDumpMMU(asArgs) {
device.dumpMMU(asArgs);
});
}
this.setReady(); this.setReady();
}; };
/**
* dumpMMU(asArgs)
*
* @this {DevicePDP11}
* @param {Array.<string>} asArgs
*/
DevicePDP11.prototype.dumpMMU = function(asArgs)
{
if (DEBUGGER) {
var cpu = this.cpu;
this.dumpRegs("KIPDR", cpu.mmuPDR[0], 0, asArgs[0]);
this.dumpRegs("KDPDR", cpu.mmuPDR[0], 8, asArgs[0]);
this.dumpRegs("KIPAR", cpu.mmuPAR[0], 0, asArgs[0]);
this.dumpRegs("KDPAR", cpu.mmuPAR[0], 8, asArgs[0], true);
this.dumpRegs("SIPDR", cpu.mmuPDR[1], 0, asArgs[0]);
this.dumpRegs("SDPDR", cpu.mmuPDR[1], 8, asArgs[0]);
this.dumpRegs("SIPAR", cpu.mmuPAR[1], 0, asArgs[0]);
this.dumpRegs("SDPAR", cpu.mmuPAR[1], 8, asArgs[0], true);
this.dumpRegs("UIPDR", cpu.mmuPDR[3], 0, asArgs[0]);
this.dumpRegs("UDPDR", cpu.mmuPDR[3], 8, asArgs[0]);
this.dumpRegs("UIPAR", cpu.mmuPAR[3], 0, asArgs[0]);
this.dumpRegs("UDPAR", cpu.mmuPAR[3], 8, asArgs[0], true);
}
};
/**
* dumpRegs(sName, aRegs, offset, sFilter, fBreak)
*
* @this {DevicePDP11}
* @param {string} sName
* @param {Array.<number>} aRegs
* @param {number} offset
* @param {string} sFilter
* @param {boolean} [fBreak]
*/
DevicePDP11.prototype.dumpRegs = function(sName, aRegs, offset, sFilter, fBreak)
{
if (DEBUGGER) {
var dbg = this.dbg;
if (sFilter && sName.indexOf(sFilter.toUpperCase()) < 0) return;
var sDump = sName + ":";
for (var i = 0; i < 8; i++) {
sDump += ' ' + dbg.toStrBase(aRegs[offset + i]);
}
dbg.println(sDump + (fBreak? '\n' : ''));
}
};
/** /**
* reset() * reset()
* *
@ -435,7 +488,10 @@ DevicePDP11.prototype.readKIPDR = function(addr)
DevicePDP11.prototype.writeKIPDR = function(data, addr) DevicePDP11.prototype.writeKIPDR = function(data, addr)
{ {
var reg = (addr >> 1) & 7; var reg = (addr >> 1) & 7;
this.cpu.mmuPDR[0][reg] = data & 0xff0f; this.cpu.mmuPDR[0][reg] = data &= 0xff0f;
if (this.messageEnabled(MessagesPDP11.MMU)) {
this.printMessage("writeKIPDR[" + reg + "]: " + str.toOct(data), true);
}
}; };
/** /**
@ -962,20 +1018,23 @@ DevicePDP11.prototype.readMB = function(addr)
*/ */
DevicePDP11.prototype.writeMB = function(data, addr) DevicePDP11.prototype.writeMB = function(data, addr)
{ {
if (!(addr & 0x1)) data &= 0xff; // Required for KB11-CM without MFPT instruction if (!(addr & 0x1)) {
data &= 0xff; // required for KB11-CM without MFPT instruction
}
this.cpu.regMB = data; this.cpu.regMB = data;
}; };
/** /**
* readPIR(addr) * readPIR(addr, fPreWrite)
* *
* @this {DevicePDP11} * @this {DevicePDP11}
* @param {number} addr (eg, PDP11.UNIBUS.PIR or 177772) * @param {number} addr (eg, PDP11.UNIBUS.PIR or 177772)
* @param {boolean} [fPreWrite]
* @return {number} * @return {number}
*/ */
DevicePDP11.prototype.readPIR = function(addr) DevicePDP11.prototype.readPIR = function(addr, fPreWrite)
{ {
if (!addr) return 0; // the caller is preparing to write the low or high byte; these are the bits to return for the other byte if (fPreWrite) return 0;
return this.cpu.getPIR(); return this.cpu.getPIR();
}; };
@ -992,15 +1051,16 @@ DevicePDP11.prototype.writePIR = function(data, addr)
}; };
/** /**
* readSL(addr) * readSL(addr, fPreWrite)
* *
* @this {DevicePDP11} * @this {DevicePDP11}
* @param {number} addr (eg, PDP11.UNIBUS.SL or 177774) * @param {number} addr (eg, PDP11.UNIBUS.SL or 177774)
* @param {boolean} [fPreWrite]
* @return {number} * @return {number}
*/ */
DevicePDP11.prototype.readSL = function(addr) DevicePDP11.prototype.readSL = function(addr, fPreWrite)
{ {
if (!addr) return 0; // the caller is preparing to write the low or high byte; these are the bits to return for the other byte if (fPreWrite) return 0;
return this.cpu.getSL(); return this.cpu.getSL();
}; };

View file

@ -38,9 +38,10 @@ var MessagesPDP11 = {
FAULT: 0x00000020, FAULT: 0x00000020,
BUS: 0x00000040, BUS: 0x00000040,
MEMORY: 0x00000080, MEMORY: 0x00000080,
ROM: 0x00000100, MMU: 0x00000100,
DEVICE: 0x00000200, ROM: 0x00000200,
PANEL: 0x00000400, DEVICE: 0x00000400,
PANEL: 0x00000800,
KEYBOARD: 0x00010000, KEYBOARD: 0x00010000,
KEYS: 0x00020000, KEYS: 0x00020000,
PAPER: 0x00100000, PAPER: 0x00100000,
@ -74,6 +75,7 @@ MessagesPDP11.CATEGORIES = {
"fault": MessagesPDP11.FAULT, "fault": MessagesPDP11.FAULT,
"bus": MessagesPDP11.BUS, "bus": MessagesPDP11.BUS,
"memory": MessagesPDP11.MEMORY, "memory": MessagesPDP11.MEMORY,
"mmu": MessagesPDP11.MMU,
"rom": MessagesPDP11.ROM, "rom": MessagesPDP11.ROM,
"device": MessagesPDP11.DEVICE, "device": MessagesPDP11.DEVICE,
"panel": MessagesPDP11.PANEL, "panel": MessagesPDP11.PANEL,

View file

@ -31,297 +31,298 @@
http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
*/ */
for(var k,ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ca||(ca[fa]={});ca=ca[fa]}var ha=da[da.length-1],ia=ca[ha],ja=ia?ia:function(a){return Math.log(a)/Math.LN2}; for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ca||(ca[fa]={});ca=ca[fa]}var ga=da[da.length-1],ia=ca[ga],ja=ia?ia:function(a){return Math.log(a)/Math.LN2};
ja!=ia&&null!=ja&&ba(ca,ha,{configurable:!0,writable:!0,value:ja});var la={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]}; ja!=ia&&null!=ja&&aa(ca,ga,{configurable:!0,writable:!0,value:ja});var ka={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]};
function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&& function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ra(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function na(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
function sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ta(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ua(a,b){return-1!==a.indexOf(b,a.length-b.length)}var va={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})} function sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ta(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ua(a,b){return-1!==a.indexOf(b,a.length-b.length)}var va={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})}
function xa(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function xa(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<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 Ba=Date.now||function(){return+new Date};function Ca(){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 Aa(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 Ba=Date.now||function(){return+new Date};function Ca(){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 Ea(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== 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 Fa(a,b){var c,d={ea:null,ga:null,Oa:null,Na:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Oa=g.load;d.Na=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c<e.length;c++)d.ea[f++]=e[c]&255,d.ea[f++]=e[c]>>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c<e.length;c++)d.ea[f++]= function Ea(a,b){var c,d={ea:null,ga:null,Oa:null,Na:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Oa=g.load;d.Na=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c<e.length;c++)d.ea[f++]=e[c]&255,d.ea[f++]=e[c]>>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c<e.length;c++)d.ea[f++]=
e[c]&255,d.ea[f++]=e[c]>>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ga=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;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.ea=e)}return d} e[c]&255,d.ea[f++]=e[c]>>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ga=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;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.ea=e)}return d}
function Ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ia=null;function Ja(){if(null==Ia){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}Ia=a}return Ia} function Ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ia=null;function Ja(){if(null==Ia){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}Ia=a}return Ia}
function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Ma(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Sa(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 Ta(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 La(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Na(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 Ta(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Ua(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 Va={init:[],show:[],exit:[]},Wa=!1,Xa=!1,Ya=!0;function Za(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function $a(a){Va.init.push(a)} function Ua(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 Va={init:[],show:[],exit:[]},Wa=!1,Xa=!1,Ya=!0;function Za(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function $a(a){Va.init.push(a)}
function ab(a){if(Ya)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 bb(a){!Ya&&a?(Ya=!0,Wa&&cb("init"),Xa&&cb("show")):Ya=a}function cb(a){Va[a]&&ab(Va[a])}Za("onload",function(){Wa=!0;ab(Va.init)});Za("onpageshow",function(){Xa=!0;ab(Va.show)});Za(Sa("Opera")||Sa("iOS")?"onunload":"onbeforeunload",function(){ab(Va.exit)}); function ab(a){if(Ya)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 bb(a){!Ya&&a?(Ya=!0,Wa&&cb("init"),Xa&&cb("show")):Ya=a}function cb(a){Va[a]&&ab(Va[a])}Za("onload",function(){Wa=!0;ab(Va.init)});Za("onpageshow",function(){Xa=!0;ab(Va.show)});Za(Na("Opera")||Na("iOS")?"onunload":"onbeforeunload",function(){ab(Va.exit)});
function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Bc=b.comment;this.ad=b;b=this.id.indexOf(".");0>b?this.ab=this.id:(this.Ua=this.id.substr(0,b),this.ab=this.id.substr(b+1));this[a]=c;this.A={ready:!1,eb:!1,ec:!1,ha:!1,error:!1};this.Yb=null;this.A.error=!1;this.G={};this.i=null;this.ka=d||0;u.push(this)}var db=void 0,eb={}; function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Bc=b.comment;this.ad=b;b=this.id.indexOf(".");0>b?this.ab=this.id:(this.Ua=this.id.substr(0,b),this.ab=this.id.substr(b+1));this[a]=c;this.A={ready:!1,eb:!1,ec:!1,ia:!1,error:!1};this.Yb=null;this.A.error=!1;this.G={};this.i=null;this.la=d||0;u.push(this)}var db=void 0,eb={};
if(window){db||(db=window.location.search.substr(1));for(var fb,gb=/\+/g,hb=/([^&=]+)=?([^&]*)/g;fb=hb.exec(db);)eb[decodeURIComponent(fb[1].replace(gb," "))]=decodeURIComponent(fb[2].replace(gb," "))}function ib(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} if(window){db||(db=window.location.search.substr(1));for(var fb,gb=/\+/g,hb=/([^&=]+)=?([^&]*)/g;fb=hb.exec(db);)eb[decodeURIComponent(fb[1].replace(gb," "))]=decodeURIComponent(fb[2].replace(gb," "))}function ib(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function z(a,b){b||(b=t);a.prototype=ib(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var qb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else qb={},u=[];function rb(a,b,c){qb[a]&&b&&(qb[a][b]=c)}function sb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;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=ib(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var jb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else jb={},u=[];function rb(a,b,c){jb[a]&&b&&(jb[a][b]=c)}function sb(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 tb(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 ub(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 tb(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 ub(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.ua(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.va(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},ua: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.Va=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},va: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.Va=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.ab)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.ab+": "+a)},P:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ka:function(){return this.A.ha=!0},Ja:function(a,b){b&&(this.A.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.ka;var c=a.i.ka&b;return!!b&&c===b||!!(c&a.i.Tc)}return!1} this.R=function(a){this.j(a,this.ab)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.ab+": "+a)},R:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ka:function(){return this.A.ia=!0},Ja:function(a,b){b&&(this.A.ia=!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.la;var c=a.i.la&b;return!!b&&c===b||!!(c&a.i.Tc)}return!1}
function vb(a,b){if(a.A.ec)return a.A.eb=!1,a.A.ec=!1;if(a.A.error)return a.j(a.toString()+" error"),!1;a.A.eb=b;return a.A.eb}function wb(a,b){a.A.eb&&(b?a.A.ec=!0:void 0===b&&a.j(a.toString()+" busy"));return a.A.eb}function H(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Yb,a.Yb=null,b&&b()))}function xb(a,b){b&&(a.A.ready?b():a.Yb=b);return a.A.ready}function yb(a){return a.A.error?(a.j(a.toString()+" error"),!0):!1}function zb(a,b){a.A.error=!0;a.P(b)} function vb(a,b){if(a.A.ec)return a.A.eb=!1,a.A.ec=!1;if(a.A.error)return a.j(a.toString()+" error"),!1;a.A.eb=b;return a.A.eb}function wb(a,b){a.A.eb&&(b?a.A.ec=!0:void 0===b&&a.j(a.toString()+" busy"));return a.A.eb}function H(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Yb,a.Yb=null,b&&b()))}function xb(a,b){b&&(a.A.ready?b():a.Yb=b);return a.A.ready}function yb(a){return a.A.error?(a.j(a.toString()+" error"),!0):!1}function zb(a,b){a.A.error=!0;a.R(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 Ab="undefined"!==typeof ArrayBuffer,Bb="UNKNOWN ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Cb={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,panel:1024,keyboard:65536,key:131072,paper:1048576,disk:4194304,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648}; var Ab="undefined"!==typeof ArrayBuffer,Bb="UNKNOWN ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Cb={cpu:1,trap:16,fault:32,bus:64,memory:128,mmu:256,rom:512,device:1024,panel:2048,keyboard:65536,key:131072,paper:1048576,disk:4194304,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
function Db(a){t.call(this,"Panel",a,Db,1024);this.sa=this.w=this.Ya=this.rb=this.B=this.D=0;this.I=this.K=this.H=!1;this.L=Eb;this.g={};this.f={START:[1,1,!0,!1,this.hd],STEP:[1,1,!1,!1,this.jd],ENABLE:[1,1,!1,!1,this.dd],CONT:[1,1,!0,!1,this.bd],DEP:[0,0,!0,!1,this.cd],EXAM:[1,1,!0,!1,this.ed],LOAD:[1,1,!0,!1,this.gd],TEST:[0,0,!0,!1,this.fd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.kd,a]}z(Db);var Eb=7;function Fb(a,b){return a.f[b]&&a.f[b][1]}k=Db.prototype;k.reset=function(){this.stop()}; function Db(a){t.call(this,"Panel",a,Db,2048);this.ta=this.w=this.Ya=this.rb=this.B=this.D=0;this.I=this.K=this.H=!1;this.L=Eb;this.g={};this.f={START:[1,1,!0,!1,this.hd],STEP:[1,1,!1,!1,this.jd],ENABLE:[1,1,!1,!1,this.dd],CONT:[1,1,!0,!1,this.bd],DEP:[0,0,!0,!1,this.cd],EXAM:[1,1,!0,!1,this.ed],LOAD:[1,1,!0,!1,this.gd],TEST:[0,0,!0,!1,this.fd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.kd,a]}z(Db);var Eb=7;function Fb(a,b){return a.f[b]&&a.f[b][1]}k=Db.prototype;k.reset=function(){this.stop()};
k.ua=function(a,b,c,d){if(this.C&&this.C.ua(a,b,c,d)||this.b&&this.b.ua(a,b,c,d)||this.i&&this.i.ua(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.g[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, k.va=function(a,b,c,d){if(this.C&&this.C.va(a,b,c,d)||this.b&&this.b.va(a,b,c,d)||this.i&&this.i.va(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.g[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
b){return function(){Gb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Hb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Gb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Hb(a,b)}}(this,b),!0):this.parent.ua.call(this,a,b,c,d)}};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Ib(b,this,Jb);Kb(b,this.reset.bind(this));Lb(this);Mb(this)};k.Ka=function(a,b){b||(Nb(),this.reset());return!0};k.Ja=function(){return!0}; b){return function(){Gb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Hb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Gb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Hb(a,b)}}(this,b),!0):this.parent.va.call(this,a,b,c,d)}};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Ib(b,this,Jb);Kb(b,this.reset.bind(this));Lb(this);Mb(this)};k.Ka=function(a,b){b||(Nb(),this.reset());return!0};k.Ja=function(){return!0};
function Ob(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Lb(a,b){for(var c in a.g)Ob(a,c,null!=b?b:a.g[c])}function Pb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Mb(a){for(var b in a.f)Pb(a,b,a.f[b][1])}function Qb(a,b,c,d){a.G[b]&&(void 0===c&&(zb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} function Ob(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Lb(a,b){for(var c in a.g)Ob(a,c,null!=b?b:a.g[c])}function Pb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Mb(a){for(var b in a.f)Pb(a,b,a.f[b][1])}function Qb(a,b,c,d){a.G[b]&&(void 0===c&&(zb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?na(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}
function Gb(a,b){var c=a.f[b];Pb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Hb(a,b){var c=a.f[b];c[2]&&c[3]&&(Pb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.hd=function(a){a||this.b.A.W||(a=this.b,a.v.reset(),Rb(a),Fb(this,"ENABLE")&&this.b.jb())};k.jd=function(){};k.dd=function(a){a||this.b.da()}; function Gb(a,b){var c=a.f[b];Pb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Hb(a,b){var c=a.f[b];c[2]&&c[3]&&(Pb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.hd=function(a){a||this.b.A.W||(a=this.b,a.v.reset(),Rb(a),Fb(this,"ENABLE")&&this.b.jb())};k.jd=function(){};k.dd=function(a){a||this.b.da()};
k.bd=function(a){if(!a&&!this.b.A.W)if(Fb(this,"ENABLE"))this.b.jb();else{if((a=this.i)&&!wb(a,!0))vb(a,!0),a.kb(0,null),vb(a,!1);else try{var b=this.b.kb(1);0<b&&(dc(this.b,b),ec(this.b,b,!0),fc(this.b,b))}catch(c){"number"!=typeof c&&zb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.pa()}};k.cd=function(a){a&&!this.b.A.W&&(this.I&&gc(this),a=hc(this,this.Ya),this.L==Eb?this.v.Fb(this.sa,a):this.b.Fb(this.sa,a))}; k.bd=function(a){if(!a&&!this.b.A.W)if(Fb(this,"ENABLE"))this.b.jb();else{if((a=this.i)&&!wb(a,!0))vb(a,!0),a.kb(0,null),vb(a,!1);else try{var b=this.b.kb(1);0<b&&(Sb(this.b,b),ec(this.b,b,!0),fc(this.b,b))}catch(c){"number"!=typeof c&&zb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.qa()}};k.cd=function(a){a&&!this.b.A.W&&(this.I&&gc(this),a=hc(this,this.Ya),this.L==Eb?this.v.Fb(this.ta,a):this.b.Fb(this.ta,a))};
k.ed=function(a){a||this.b.A.W||(this.K&&gc(this),a=this.L==Eb?this.v.fb(this.sa):this.b.fb(this.sa),hc(this,a))};k.gd=function(a){a||this.b.A.W||ic(this,this.Ya)};k.fd=function(a){a?(this.H=!0,Lb(this,!0)):(this.H=!1,Lb(this),jc(this,0))};k.kd=function(a,b){this.Ya=a?this.Ya|1<<b:this.Ya&~(1<<b)};function gc(a){var b=1145>a.b.Xa?8:16,c=65472<=a.sa&&a.sa<65472+b,b=c?1:2,c=c?15:a.v.Qa;Fb(a,"STEP")||(b=-b);ic(a,a.sa&~c|a.sa+b&c)} k.ed=function(a){a||this.b.A.W||(this.K&&gc(this),a=this.L==Eb?this.v.fb(this.ta):this.b.fb(this.ta),hc(this,a))};k.gd=function(a){a||this.b.A.W||ic(this,this.Ya)};k.fd=function(a){a?(this.H=!0,Lb(this,!0)):(this.H=!1,Lb(this),jc(this,0))};k.kd=function(a,b){this.Ya=a?this.Ya|1<<b:this.Ya&~(1<<b)};function gc(a){var b=1145>a.b.Xa?8:16,c=65472<=a.ta&&a.ta<65472+b,b=c?1:2,c=c?15:a.v.Qa;Fb(a,"STEP")||(b=-b);ic(a,a.ta&~c|a.ta+b&c)}
function ic(a,b){a.sa=b&a.v.Qa;b=a.sa;for(var c=0;22>c;c++)kc(a,"A"+c,b&1<<c)}function hc(a,b){a.w=b&65535;b=a.w;for(var c=0;16>c;c++)kc(a,"D"+c,b&1<<c);return a.w}function kc(a,b,c){a.g[b]=c;a.H||Ob(a,b,c)}function lc(a){return void 0!==a.G.S0}function jc(a,b){if(lc(a)){a.Ya=b;for(var c=0;22>c;c++)a.f["S"+c][1]=b&1<<c?1:0;Mb(a)}}k.stop=function(){ic(this,this.b.u[7])};k.nc=function(a){this.sa=a};k.setData=function(a,b){b?this.rb=a:this.w=a};k.nd=function(a){return(a?this.Ya:this.rb)&65535}; function ic(a,b){a.ta=b&a.v.Qa;b=a.ta;for(var c=0;22>c;c++)kc(a,"A"+c,b&1<<c)}function hc(a,b){a.w=b&65535;b=a.w;for(var c=0;16>c;c++)kc(a,"D"+c,b&1<<c);return a.w}function kc(a,b,c){a.g[b]=c;a.H||Ob(a,b,c)}function lc(a){return void 0!==a.G.S0}function jc(a,b){if(lc(a)){a.Ya=b;for(var c=0;22>c;c++)a.f["S"+c][1]=b&1<<c?1:0;Mb(a)}}k.stop=function(){ic(this,this.b.u[7])};k.nc=function(a){this.ta=a};k.setData=function(a,b){b?this.rb=a:this.w=a};k.nd=function(a){return(a?this.Ya:this.rb)&65535};
k.he=function(a){this.rb=a};var mc={},Jb=(mc[65400]=[null,null,Db.prototype.nd,Db.prototype.he,"CNSW"],mc);function Nb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=tb(e.id);f||(a=!0,f=new Db(e));B(f,d);a&&H(f)}}$a(Nb); k.he=function(a){this.rb=a};var mc={},Jb=(mc[65400]=[null,null,Db.prototype.nd,Db.prototype.he,"CNSW"],mc);function Nb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=tb(e.id);f||(a=!0,f=new Db(e));B(f,d);a&&H(f)}}$a(Nb);
function nc(a,b,c){t.call(this,"Bus",a,nc,64);this.b=b;this.i=c;this.K=a.busWidth||16;this.C=0;this.w=[];this.g=null;this.H=1<<this.K;this.Qa=this.H-1;this.Ba=oc;this.ja=Math.log2(this.Ba);this.I=this.Ba>>2;this.v=this.Ba-1;this.D=this.H/this.Ba|0;this.cb=[];this.la=0;this.f=!1;this.gc=0;this.B=[];this.Qc=[pc,qc,rc,sc];a=new I(this);tc(a,this.i);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(nc);var oc=8192,uc=oc-1; function nc(a,b,c){t.call(this,"Bus",a,nc,64);this.b=b;this.i=c;this.K=a.busWidth||16;this.C=0;this.w=[];this.g=null;this.H=1<<this.K;this.Qa=this.H-1;this.Ba=oc;this.ka=Math.log2(this.Ba);this.I=this.Ba>>2;this.v=this.Ba-1;this.D=this.H/this.Ba|0;this.cb=[];this.ma=0;this.f=!1;this.gc=0;this.B=[];this.Qc=[pc,qc,rc,sc];a=new I(this);tc(a,this.i);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(nc);var oc=8192,uc=oc-1;
function pc(a,b){var c=-1,d=this.controller,e=d.cb[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.cb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Ha(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} function pc(a,b){var c=-1,d=this.controller,e=d.cb[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.cb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Ha(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.ma);return c}
function qc(a,b,c){var d=!1,e=this.controller,f=e.cb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.cb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Ha(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b), function qc(a,b,c){var d=!1,e=this.controller,f=e.cb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.cb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Ha(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,
!0,!e.la))}function rc(a,b){var c=-1,d=this.controller;a=d.cb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Ha(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} b),!0,!e.ma))}function rc(a,b){var c=-1,d=this.controller;a=d.cb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Ha(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.ma);return c}
function sc(a,b,c){var d=!1,e=this.controller;a=e.cb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Ha(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} function sc(a,b,c){var d=!1,e=this.controller;a=e.cb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Ha(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.ma))}
function vc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-oc,wc(a,c,oc,a.w),a.C=0);b&&(a.C=b,c=1<<b,a.Qa=c-1,c-=oc,a.w=xc(a,c,oc),a.g?wc(a,c,oc,a.g):(yc(a,c,oc,zc,a),a.g=xc(a,c,oc)))}}k=nc.prototype;k.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();vc(this,16)};k.Ka=function(a,b){b||this.reset();return!0}; function vc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-oc,wc(a,c,oc,a.w),a.C=0);b&&(a.C=b,c=1<<b,a.Qa=c-1,c-=oc,a.w=xc(a,c,oc),a.g?wc(a,c,oc,a.g):(yc(a,c,oc,zc,a),a.g=xc(a,c,oc)))}}k=nc.prototype;k.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();vc(this,16)};k.Ka=function(a,b){b||this.reset();return!0};
function yc(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.Ba,n=a.Ba-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Ub+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ub){n=l.size-(f-m);n>g&&(n=g);l.Ub=f-l.F+n;f=m+a.Ba;g-=n;h++;continue}}return Ac(1,f,g)}f=new I(a,f,n,a.Ba,d,e);tc(f,a.i,l);a.Y[h++]=f;f=m+a.Ba;g-=n}return 0>=g?(d==Bc&&(a.gc+=c),a.status((c>>10)+"Kb "+Cc[d]+" at "+ra(b)),!0):Ac(2,b,c)} function yc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ka;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.Ba,n=a.Ba-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Ub+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ub){n=l.size-(f-m);n>g&&(n=g);l.Ub=f-l.F+n;f=m+a.Ba;g-=n;h++;continue}}return Ac(1,f,g)}f=new I(a,f,n,a.Ba,d,e);tc(f,a.i,l);a.Y[h++]=f;f=m+a.Ba;g-=n}return 0>=g?(d==Bc&&(a.gc+=c),a.status((c>>10)+"Kb "+Cc[d]+" at "+na(b)),!0):Ac(2,b,c)}
function xc(a,b,c){var d=[];for(b>>>=a.ja;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.Ba;return d}function wc(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.Ba}}k.Lb=function(a){3932160<=a&&(a=Dc(this.b,a));return this.Y[(a&this.Qa)>>>this.ja].$b(a&this.v,a)};k.Zb=function(a){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Qa)>>>this.ja].lc(a&this.v,a);this.la--;return a}; function xc(a,b,c){var d=[];for(b>>>=a.ka;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.Ba;return d}function wc(a,b,c,d){var e=0;for(b>>>=a.ka;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.Ba}}k.Lb=function(a){3932160<=a&&(a=Dc(this.b,a));return this.Y[(a&this.Qa)>>>this.ka].$b(a&this.v,a)};k.Zb=function(a){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.ma++;a=this.Y[(a&this.Qa)>>>this.ka].lc(a&this.v,a);this.ma--;return a};
k.na=function(a){3932160<=a&&(a=Dc(this.b,a));return this.Y[(a&this.Qa)>>>this.ja].ra(a&this.v,a)};k.fb=function(a){3932160<=a&&(a=Dc(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].mc(b,a);this.la--;return a};k.Eb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ja].cc(a&this.v,b&255,a)};k.tb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Qa)>>>this.ja].dc(a&this.v,b&255,a);this.la--}; k.oa=function(a){3932160<=a&&(a=Dc(this.b,a));return this.Y[(a&this.Qa)>>>this.ka].sa(a&this.v,a)};k.fb=function(a){3932160<=a&&(a=Dc(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ka;this.f=!1;this.ma++;a=this.Y[c].mc(b,a);this.ma--;return a};k.Eb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ka].cc(a&this.v,b&255,a)};k.tb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.f=!1;this.ma++;this.Y[(a&this.Qa)>>>this.ka].dc(a&this.v,b&255,a);this.ma--};
k.ib=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ja].Vb(a&this.v,b&65535,a)};k.Fb=function(a,b){3932160<=a&&(a=Dc(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ja;this.f=!1;this.la++;this.Y[d].pc(c,b&65535,a);this.la--}; k.ib=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.Y[(a&this.Qa)>>>this.ka].Vb(a&this.v,b&65535,a)};k.Fb=function(a,b){3932160<=a&&(a=Dc(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ka;this.f=!1;this.ma++;this.Y[d].pc(c,b&65535,a);this.ma--};
function Ec(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Wa||e.Vc){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 Fc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&uc;if(void 0!==a.cb[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.cb[m]=[d,e,f,g,l||"unknown",h,!1]}return!0} function Ec(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Wa||e.Vc){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 Fc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&uc;if(void 0!==a.cb[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.cb[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
function Ib(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r<v;r++,e+=2)if(n&&1<v&&(n=f[4]+r),!Fc(a,e,e,g,h,l,m,b.ka||64,n||b.ab))return!1}}return!0}function Kb(a,b){a.B.push(b)} function Ib(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r<v;r++,e+=2)if(n&&1<v&&(n=f[4]+r),!Fc(a,e,e,g,h,l,m,b.la||64,n||b.ab))return!1}}return!0}function Kb(a,b){a.B.push(b)}
k.Ha=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.ta|=b),this.b.va(4,0,a))};function Gc(a){var b=a.f;a.f=!1;return b}function Ac(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={fa:0,oc:-1}}z(K);k=K.prototype; k.Ha=function(a,b,c){this.f=!0;this.ma||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on "+J(this.i,a),!0,!0),b&&(this.b.ua|=b),this.b.wa(4,0,a))};function Gc(a){var b=a.f;a.f=!1;return b}function Ac(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,1024);this.f={fa:0,oc:-1}}z(K);k=K.prototype;
k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.oc=Hc(c,function(){e.f.Ob|=128;e.f.Ob&64&&Ic(e.b,e.f.fe);e.C&&e.C.pa(1);Qc(e.b,e.f.oc,1E3/60)});this.f.fe=Rc(64,6);Ib(b,this,Sc);Kb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.Ob=128;Qc(this.b,this.f.oc,1E3/60,!0)};k.vd=function(){return this.f.Ob};k.pe=function(a){this.f.Ob=a&192};k.xd=function(){return Tc(this.b)};k.re=function(a){Uc(this.b,a&-129|this.b.Da&128)};k.yd=function(){return Vc(this.b)}; k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.oc=Hc(c,function(){e.f.Ob|=128;e.f.Ob&64&&Ic(e.b,e.f.fe);e.C&&e.C.qa(1);Jc(e.b,e.f.oc,1E3/60)});this.f.fe=Rc(64,6);Ib(b,this,Sc);Kb(b,this.reset.bind(this));d&&Tc(d,256,function(a){var b=e.b;L(e,"KIPDR",b.O[0],0,a[0]);L(e,"KDPDR",b.O[0],8,a[0]);L(e,"KIPAR",b.ha[0],0,a[0]);L(e,"KDPAR",b.ha[0],8,a[0],!0);L(e,"SIPDR",b.O[1],0,a[0]);L(e,"SDPDR",b.O[1],8,a[0]);L(e,"SIPAR",b.ha[1],0,a[0]);L(e,"SDPAR",b.ha[1],8,a[0],!0);L(e,"UIPDR",
k.zd=function(){return Wc(this.b)};k.Ad=function(){return this.b.Ta};k.se=function(a){Xc(this.b,a)};k.ae=function(a){a=a>>1&63;var b=this.b.Tb[a>>1];return a&1?b>>16:b&65535};k.Te=function(a,b){b=b>>1&63;var c=b>>1;this.b.Tb[c]=b&1?this.b.Tb[c]&65535|(a&63)<<16:this.b.Tb[c]&-65536|a&65534};k.Ud=function(a){return this.b.V[1][a>>1&7]};k.Me=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Sd=function(a){return this.b.V[1][(a>>1&7)+8]};k.Ke=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295}; b.O[3],0,a[0]);L(e,"UDPDR",b.O[3],8,a[0]);L(e,"UIPAR",b.ha[3],0,a[0]);L(e,"UDPAR",b.ha[3],8,a[0],!0)});H(this)};function L(a,b,c,d,e,f){a=a.i;if(!(e&&0>b.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+J(a,c[d+e]);a.j(b+(f?"\n":""))}}k.reset=function(){this.f.Ob=128;Jc(this.b,this.f.oc,1E3/60,!0)};k.vd=function(){return this.f.Ob};k.pe=function(a){this.f.Ob=a&192};k.xd=function(){return Uc(this.b)};k.re=function(a){Vc(this.b,a&-129|this.b.Da&128)};k.yd=function(){return Wc(this.b)};
k.Td=function(a){return this.b.Aa[1][a>>1&7]};k.Le=function(a,b){b=b>>1&7;this.b.Aa[1][b]=a;this.b.V[1][b]&=65295};k.Rd=function(a){return this.b.Aa[1][(a>>1&7)+8]};k.Je=function(a,b){b=(b>>1&7)+8;this.b.Aa[1][b]=a;this.b.V[1][b]&=65295};k.ud=function(a){return this.b.V[0][a>>1&7]};k.oe=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.sd=function(a){return this.b.V[0][(a>>1&7)+8]};k.me=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.td=function(a){return this.b.Aa[0][a>>1&7]}; k.zd=function(){return Xc(this.b)};k.Ad=function(){return this.b.Ta};k.se=function(a){Yc(this.b,a)};k.ae=function(a){a=a>>1&63;var b=this.b.Tb[a>>1];return a&1?b>>16:b&65535};k.Te=function(a,b){b=b>>1&63;var c=b>>1;this.b.Tb[c]=b&1?this.b.Tb[c]&65535|(a&63)<<16:this.b.Tb[c]&-65536|a&65534};k.Ud=function(a){return this.b.O[1][a>>1&7]};k.Me=function(a,b){this.b.O[1][b>>1&7]=a&65295};k.Sd=function(a){return this.b.O[1][(a>>1&7)+8]};k.Ke=function(a,b){this.b.O[1][(b>>1&7)+8]=a&65295};
k.ne=function(a,b){b=b>>1&7;this.b.Aa[0][b]=a;this.b.V[0][b]&=65295};k.rd=function(a){return this.b.Aa[0][(a>>1&7)+8]};k.le=function(a,b){b=(b>>1&7)+8;this.b.Aa[0][b]=a;this.b.V[0][b]&=65295};k.$d=function(a){return this.b.V[3][a>>1&7]};k.Se=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Yd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Qe=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Zd=function(a){return this.b.Aa[3][a>>1&7]};k.Re=function(a,b){b=b>>1&7;this.b.Aa[3][b]=a;this.b.V[3][b]&=65295}; k.Td=function(a){return this.b.ha[1][a>>1&7]};k.Le=function(a,b){b=b>>1&7;this.b.ha[1][b]=a;this.b.O[1][b]&=65295};k.Rd=function(a){return this.b.ha[1][(a>>1&7)+8]};k.Je=function(a,b){b=(b>>1&7)+8;this.b.ha[1][b]=a;this.b.O[1][b]&=65295};k.ud=function(a){return this.b.O[0][a>>1&7]};k.oe=function(a,b){b=b>>1&7;this.b.O[0][b]=a&=65295;F(this,256)&&E(this,"writeKIPDR["+b+"]: "+na(a),!0)};k.sd=function(a){return this.b.O[0][(a>>1&7)+8]};k.me=function(a,b){this.b.O[0][(b>>1&7)+8]=a&65295};
k.Xd=function(a){return this.b.Aa[3][(a>>1&7)+8]};k.Pe=function(a,b){b=(b>>1&7)+8;this.b.Aa[3][b]=a;this.b.V[3][b]&=65295};k.Cb=function(a){a&=7;return this.b.N&2048?this.b.Za[a]:this.b.u[a]};k.Gb=function(a,b){b&=7;this.b.N&2048?this.b.Za[b]=a:this.b.u[b]=a};k.Fd=function(){return this.b.N&49152?this.b.La[0]:this.b.u[6]};k.xe=function(a){this.b.N&49152?this.b.La[0]=a:this.b.u[6]=a};k.Id=function(){return this.b.u[7]};k.Ae=function(a){this.b.u[7]=a}; k.td=function(a){return this.b.ha[0][a>>1&7]};k.ne=function(a,b){b=b>>1&7;this.b.ha[0][b]=a;this.b.O[0][b]&=65295};k.rd=function(a){return this.b.ha[0][(a>>1&7)+8]};k.le=function(a,b){b=(b>>1&7)+8;this.b.ha[0][b]=a;this.b.O[0][b]&=65295};k.$d=function(a){return this.b.O[3][a>>1&7]};k.Se=function(a,b){this.b.O[3][b>>1&7]=a&65295};k.Yd=function(a){return this.b.O[3][(a>>1&7)+8]};k.Qe=function(a,b){this.b.O[3][(b>>1&7)+8]=a&65295};k.Zd=function(a){return this.b.ha[3][a>>1&7]};
k.Db=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Za[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Za[b]=a};k.Gd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.ye=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Hd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.ze=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.pd=function(a){return this.b.Jc[a-65504>>1]}; k.Re=function(a,b){b=b>>1&7;this.b.ha[3][b]=a;this.b.O[3][b]&=65295};k.Xd=function(a){return this.b.ha[3][(a>>1&7)+8]};k.Pe=function(a,b){b=(b>>1&7)+8;this.b.ha[3][b]=a;this.b.O[3][b]&=65295};k.Cb=function(a){a&=7;return this.b.N&2048?this.b.Za[a]:this.b.u[a]};k.Gb=function(a,b){b&=7;this.b.N&2048?this.b.Za[b]=a:this.b.u[b]=a};k.Fd=function(){return this.b.N&49152?this.b.La[0]:this.b.u[6]};k.xe=function(a){this.b.N&49152?this.b.La[0]=a:this.b.u[6]=a};k.Id=function(){return this.b.u[7]};
k.je=function(a,b){this.b.Jc[b-65504>>1]=a};k.Gc=function(a){if(65520==a){a=0;switch(Bc){case Bc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Nc=function(){};k.Wd=function(){return 1};k.Oe=function(){};k.od=function(){return this.b.ta};k.ie=function(){this.b.ta=0};k.wd=function(){return this.b.Ic};k.qe=function(a,b){b&1||(a&=255);this.b.Ic=a};k.Bd=function(a){return a?this.b.Sb:0};k.te=function(a){Yc(this.b,a)};k.Vd=function(a){return a?this.b.sb&65280:0};k.Ne=function(a){this.b.sb=a|255};k.Ed=function(){return Zc(this.b)}; k.Ae=function(a){this.b.u[7]=a};k.Db=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Za[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Za[b]=a};k.Gd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.ye=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Hd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.ze=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.pd=function(a){return this.b.Jc[a-65504>>1]};
k.we=function(a){$c(this.b,a&-1793|Zc(this.b)&1792);this.b.J|=128};k.Mc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; k.je=function(a,b){this.b.Jc[b-65504>>1]=a};k.Gc=function(a){if(65520==a){a=0;switch(Bc){case Bc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Nc=function(){};k.Wd=function(){return 1};k.Oe=function(){};k.od=function(){return this.b.ua};k.ie=function(){this.b.ua=0};k.wd=function(){return this.b.Ic};k.qe=function(a,b){b&1||(a&=255);this.b.Ic=a};k.Bd=function(a,b){return b?0:this.b.Sb};k.te=function(a){Zc(this.b,a)};k.Vd=function(a,b){return b?0:this.b.sb&65280};k.Ne=function(a){this.b.sb=a|255};
var L={},Sc=(L[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.td, k.Ed=function(){return $c(this.b)};k.we=function(a){ad(this.b,a&-1793|$c(this.b)&1792);this.b.J|=128};k.Mc=function(a,b){F(this)&&E(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)};
K.prototype.ne,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145],L[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],L[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145],L[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.$d,K.prototype.Se,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Yd, var M={},Sc=(M[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145],M[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145],M[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145],M[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145],M[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145],M[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145],M[62688]=[null,null,K.prototype.td,
K.prototype.Qe,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.Cb,K.prototype.Gb,"R0SET0"],L[65473]=[null,null,K.prototype.Cb,K.prototype.Gb,"R1SET0"],L[65474]=[null,null,K.prototype.Cb,K.prototype.Gb,"R2SET0"],L[65475]=[null,null,K.prototype.Cb,K.prototype.Gb,"R3SET0"],L[65476]=[null,null,K.prototype.Cb,K.prototype.Gb,"R4SET0"],L[65477]=[null,null,K.prototype.Cb,K.prototype.Gb, K.prototype.ne,"KIPAR",8,1145],M[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145],M[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145],M[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],M[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145],M[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.$d,K.prototype.Se,"UIPDR",8,1145],M[65424]=[null,null,K.prototype.Yd,
"R5SET0"],L[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],L[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],L[65480]=[null,null,K.prototype.Db,K.prototype.Hb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Db,K.prototype.Hb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Db,K.prototype.Hb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Db,K.prototype.Hb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Db,K.prototype.Hb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Db, K.prototype.Qe,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145],M[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145],M[65472]=[null,null,K.prototype.Cb,K.prototype.Gb,"R0SET0"],M[65473]=[null,null,K.prototype.Cb,K.prototype.Gb,"R1SET0"],M[65474]=[null,null,K.prototype.Cb,K.prototype.Gb,"R2SET0"],M[65475]=[null,null,K.prototype.Cb,K.prototype.Gb,"R3SET0"],M[65476]=[null,null,K.prototype.Cb,K.prototype.Gb,"R4SET0"],M[65477]=[null,null,K.prototype.Cb,K.prototype.Gb,
K.prototype.Hb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],L[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,"SYSID",1,1170],L[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],L[65528]= "R5SET0"],M[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],M[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],M[65480]=[null,null,K.prototype.Db,K.prototype.Hb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Db,K.prototype.Hb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Db,K.prototype.Hb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Db,K.prototype.Hb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Db,K.prototype.Hb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Db,
[null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],L[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],L[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],L[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],L);$a(function(){for(var a=D(document,"pdp11","device"),b=0;b<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 ad(c);B(c,d);break;case "rl11":c=new M(c),B(c,d)}}});var bd; K.prototype.Hb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],M[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],M[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,"SYSID",1,1170],M[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],M[65528]=
if(Ab){var cd=new ArrayBuffer(2);(new DataView(cd)).setUint16(0,256,!0);bd=256===(new Uint16Array(cd))[0]}else bd=!1;var dd=bd; [null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],M[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],M[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],M[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],M);$a(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 bd(c);B(c,d);break;case "rl11":c=new N(c),B(c,d)}}});var cd;
function I(a,b,c,d,e,f){this.v=a;this.id=ed+=2;this.b=null;this.F=b;this.Ub=c;this.size=d||0;this.type=e||fd;this.f=e==gd;this.controller=null;tc(this);this.Wa=this.Vc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],hd(this,f.Qc);else if(Ab)this.B=new ArrayBuffer(this.size),this.D=new DataView(this.B,0,this.size),this.G=new Uint8Array(this.B,0,this.size),this.I=new Uint16Array(this.B,0,this.size>>1),this.b=new Int32Array(this.B,0,this.size>>2),hd(this,dd?id:jd);else{a=this.b=Array(this.size>> if(Ab){var dd=new ArrayBuffer(2);(new DataView(dd)).setUint16(0,256,!0);cd=256===(new Uint16Array(dd))[0]}else cd=!1;var ed=cd;
2);for(f=0;f<a.length;f++)a[f]=0;hd(this,kd)}else hd(this)}var fd=0,Bc=1,gd=2,zc=4,Cc=["NONE","RAM","ROM","VID","H/W"],ed=0; function I(a,b,c,d,e,f){this.v=a;this.id=fd+=2;this.b=null;this.F=b;this.Ub=c;this.size=d||0;this.type=e||gd;this.f=e==hd;this.controller=null;tc(this);this.Wa=this.Vc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],id(this,f.Qc);else if(Ab)this.B=new ArrayBuffer(this.size),this.D=new DataView(this.B,0,this.size),this.G=new Uint8Array(this.B,0,this.size),this.I=new Uint16Array(this.B,0,this.size>>1),this.b=new Int32Array(this.B,0,this.size>>2),id(this,ed?jd:kd);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(Ab)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(Ab)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Wa=!0}return!1},ob:function(a,b){b?this.C++||ld(this,md,!1):this.g++||nd(this,md,!1)},K:function(a,b){this.i&&F(this.i,128)&&E(this.i, 2);for(f=0;f<a.length;f++)a[f]=0;id(this,ld)}else id(this)}var gd=0,Bc=1,hd=2,zc=4,Cc=["NONE","RAM","ROM","VID","H/W"],fd=0;
"attempt to read invalid address "+J(this.i,b),!0);this.v.Ha(b,32,2);return 255},w: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.Ha(c,32,4)},L:function(a,b){return this.$b(a++,b++)|this.$b(a,b)<<8},H:function(a,b,c){this.cc(a++,b&255,c++);this.cc(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Ha(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ab)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(Ab)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Wa=!0}return!1},ob:function(a,b){b?this.C++||md(this,nd,!1):this.g++||od(this,nd,!1)},K:function(a,b){this.i&&F(this.i,128)&&E(this.i,
1]&255)<<8},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Wa=!0},Ma:function(a,b,c){a&1&&this.v.Ha(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.Wa=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;od(c,this.F+a,1,c.M)&&c.da(!0)}return this.lc(a,b)},Ua:function(a,b){if(this.i&&null!=this.F){var c=this.i;od(c,this.F+a,2,c.M)&&c.da(!0)}return this.mc(a,b)},ab:function(a, "attempt to read invalid address "+J(this.i,b),!0);this.v.Ha(b,32,2);return 255},w: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.Ha(c,32,4)},L:function(a,b){return this.$b(a++,b++)|this.$b(a,b)<<8},H:function(a,b,c){this.cc(a++,b&255,c++);this.cc(a,b>>8,c)},T:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Ha(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+
b,c){if(this.i&&null!=this.F){var d=this.i;od(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.dc(a,b,c)},za:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;od(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.pc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Ha(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Ha(b,64,2); 1]&255)<<8},xa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Wa=!0},Ma:function(a,b,c){a&1&&this.v.Ha(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.Wa=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;pd(c,this.F+a,1,c.M)&&c.da(!0)}return this.lc(a,b)},Ua:function(a,b){if(this.i&&null!=this.F){var c=this.i;pd(c,this.F+a,2,c.M)&&c.da(!0)}return this.mc(a,b)},ab:function(a,
a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Wa=!0},ma:function(a,b,c){this.G[a]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},ya:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.D.setUint16(a,b,!0);this.Wa=!0},Ea:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.I[a>>1]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, b,c){if(this.i&&null!=this.F){var d=this.i;pd(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.dc(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;pd(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.pc(a,b,c)},M:function(a){return this.G[a]},S:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Ha(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Ha(b,64,2);
b)+")",!0)}};function tc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&nd(a,md,!1),(a.C=c.C)&&ld(a,md,!1))}function pd(a,b){b?--a.C||(a.cc=a.f?a.w:a.dc,a.Vb=a.f?a.H:a.pc):--a.g||(a.$b=a.lc,a.ra=a.mc)}function ld(a,b,c){c&&a.C||(a.cc=!a.f&&b[1]||a.w,a.Vb=!a.f&&b[3]||a.H);if(c||void 0===c)a.dc=b[1]||a.w,a.pc=b[3]||a.H}function nd(a,b,c){c&&a.g||(a.$b=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.lc=b[0]||a.K,a.mc=b[2]||a.L}function hd(a,b){b||(b=qd);nd(a,b,void 0);ld(a,b,void 0)} 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},ja:function(a,b){this.G[a]=b;this.Wa=!0},na:function(a,b,c){this.G[a]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},za:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.D.setUint16(a,b,!0);this.Wa=!0},Ea:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.I[a>>1]=b;this.Wa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,
var qd=[],kd=[I.prototype.S,I.prototype.wa,I.prototype.ca,I.prototype.Ma],md=[I.prototype.O,I.prototype.ab,I.prototype.Ua,I.prototype.za];if(Ab)var jd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.ya],id=[I.prototype.R,I.prototype.ma,I.prototype.ba,I.prototype.Ea]; b)+")",!0)}};function tc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&od(a,nd,!1),(a.C=c.C)&&md(a,nd,!1))}function qd(a,b){b?--a.C||(a.cc=a.f?a.w:a.dc,a.Vb=a.f?a.H:a.pc):--a.g||(a.$b=a.lc,a.sa=a.mc)}function md(a,b,c){c&&a.C||(a.cc=!a.f&&b[1]||a.w,a.Vb=!a.f&&b[3]||a.H);if(c||void 0===c)a.dc=b[1]||a.w,a.pc=b[3]||a.H}function od(a,b,c){c&&a.g||(a.$b=b[0]||a.K,a.sa=b[2]||a.L);if(c||void 0===c)a.lc=b[0]||a.K,a.mc=b[2]||a.L}function id(a,b){b||(b=rd);od(a,b,void 0);md(a,b,void 0)}
function rd(a,b){t.call(this,"CPU",a,rd,1);b=a.cycles||b;var c=a.multiplier||1;this.wb=0;this.nb=b;this.gb=c;this.Ib=Math.round(this.nb/1E4)/100;this.qb=this.Ib*this.gb;this.A.W=!1;this.A.bc=!1;this.A.vb=a.autoStart;this.A.xb=!1;this.Pb=this.wa=0;this.Qb=a.csStart;this.zb=a.csInterval;this.Ab=a.csStop;this.K=[];this.Fc=this.ee.bind(this);H(this)}z(rd);var sd=["power","reset"];k=rd.prototype; var rd=[],ld=[I.prototype.T,I.prototype.xa,I.prototype.ca,I.prototype.Ma],nd=[I.prototype.P,I.prototype.ab,I.prototype.Ua,I.prototype.Aa];if(Ab)var kd=[I.prototype.M,I.prototype.ja,I.prototype.X,I.prototype.za],jd=[I.prototype.S,I.prototype.na,I.prototype.ba,I.prototype.Ea];
k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.w=a.w;for(b=0;b<sd.length;b++)(c=this.G[sd[b]])&&this.C.ua(null,sd[b],c);a=td(a,"autoStart");null!=a&&(this.A.vb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1}; function sd(a,b){t.call(this,"CPU",a,sd,1);b=a.cycles||b;var c=a.multiplier||1;this.wb=0;this.nb=b;this.gb=c;this.Ib=Math.round(this.nb/1E4)/100;this.qb=this.Ib*this.gb;this.A.W=!1;this.A.bc=!1;this.A.vb=a.autoStart;this.A.xb=!1;this.Pb=this.xa=0;this.Qb=a.csStart;this.zb=a.csInterval;this.Ab=a.csStop;this.K=[];this.Fc=this.ee.bind(this);H(this)}z(sd);var td=["power","reset"];k=sd.prototype;
k.Ka=function(a,b){if(!b){if(a&&this.restore){ud(this);if(!this.restore(a))return!1;vd(this)}else this.reset();this.i?(a=this.i,b=this.A.vb,a.lb=!0,a.j("Type ? for help with PDPjs Debugger commands"),wd(a),b||a.ub(),a.bb&&(b=a.bb,a.bb=null,xd(a,b))):this.j("No debugger detected")}return!0};k.Ja=function(a){return a?this.save():!0};k.vb=function(){return this.A.vb||!this.i&&void 0===this.G.run?(this.jb(),!0):!1};k.vc=function(){return 0}; k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.w=a.w;for(b=0;b<td.length;b++)(c=this.G[td[b]])&&this.C.va(null,td[b],c);a=ud(a,"autoStart");null!=a&&(this.A.vb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
function vd(a){void 0===a.Qb&&(a.Qb=0);void 0===a.zb&&(a.zb=-1);void 0===a.Ab&&(a.Ab=-1);a.A.xb=0<=a.Qb&&0<a.zb;a.A.xb&&(a.Pb=0,a.wa=a.Qb-a.ia)}function fc(a,b){if(a.A.xb){var c=!1;a.Pb=a.Pb+a.vc()|0;a.wa-=b;0>=a.wa&&(a.wa+=a.zb,c=!0);0<=a.Ab&&a.Ab<=yd(a)&&(a.zb=a.Ab=-1,vd(a),a.da(),c=!0);c&&a.j(yd(a)+" cycles: checksum="+p(a.Pb))}} k.Ka=function(a,b){if(!b){if(a&&this.restore){vd(this);if(!this.restore(a))return!1;wd(this)}else this.reset();this.i?(a=this.i,b=this.A.vb,a.lb=!0,a.j("Type ? for help with PDPjs Debugger commands"),xd(a),b||a.ub(),a.bb&&(b=a.bb,a.bb=null,yd(a,b))):this.j("No debugger detected")}return!0};k.Ja=function(a){return a?this.save():!0};k.vb=function(){return this.A.vb||!this.i&&void 0===this.G.run?(this.jb(),!0):!1};k.vc=function(){return 0};
k.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.A.ha)a=!0;else{var b=null,c,h=sb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.A.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.A.ha);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Yb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.W?d.da():d.jb())}, function wd(a){void 0===a.Qb&&(a.Qb=0);void 0===a.zb&&(a.zb=-1);void 0===a.Ab&&(a.Ab=-1);a.A.xb=0<=a.Qb&&0<a.zb;a.A.xb&&(a.Pb=0,a.xa=a.Qb-a.ja)}function fc(a,b){if(a.A.xb){var c=!1;a.Pb=a.Pb+a.vc()|0;a.xa-=b;0>=a.xa&&(a.xa+=a.zb,c=!0);0<=a.Ab&&a.Ab<=zd(a)&&(a.zb=a.Ab=-1,wd(a),a.da(),c=!0);c&&a.j(zd(a)+" cycles: checksum="+p(a.Pb))}}
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){zd(d,d.gb<<1,!0)},c.textContent=this.qb.toFixed(2)+"Mhz",!0}return!1};k.pa=function(a){this.C&&this.C.pa(a)};function ec(a,b,c){a.ia+=b;c&&(a.ca=a.b=a.I=0)}function Ad(a,b){var c=1;b&&1<a.gb&&a.ma&&(c=a.ma/a.Ib);a.Cc=Math.round(1E3/30);a.pb=Math.floor(a.nb/30*c);b||(a.ya=a.pb);a.Jb=0}function yd(a){return a.ia+a.X+a.ca-a.b}function ud(a){a.ma=0;a.Dc=0;a.ia=a.X=a.ca=a.b=a.I=0;vd(a);zd(a,1)} k.va=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.A.ia)a=!0;else{var b=null,c,h=sb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.A.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.A.ia);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Yb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.W?d.da():d.jb())},
function zd(a,b,c){var d=!1;if(void 0!==b){.8>a.ma/a.qb?b=1:d=!0;a.gb=b;b=a.Ib*a.gb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ub()}ec(a,a.X);a.X=0;a.S=Ba();a.ba=0;Ad(a);return d}function Hc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Qc(a,b,c,d){0<=b&&b<a.K.length&&(d||0>a.K[b][0])&&(c=a.nb*a.gb/1E3*c|0,a.A.W&&(c+=Bd(a)),a.K[b][0]=c)} !0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){Ad(d,d.gb<<1,!0)},c.textContent=this.qb.toFixed(2)+"Mhz",!0}return!1};k.qa=function(a){this.C&&this.C.qa(a)};function ec(a,b,c){a.ja+=b;c&&(a.ca=a.b=a.I=0)}function Bd(a,b){var c=1;b&&1<a.gb&&a.na&&(c=a.na/a.Ib);a.Cc=Math.round(1E3/30);a.pb=Math.floor(a.nb/30*c);b||(a.za=a.pb);a.Jb=0}function zd(a){return a.ja+a.X+a.ca-a.b}function vd(a){a.na=0;a.Dc=0;a.ja=a.X=a.ca=a.b=a.I=0;wd(a);Ad(a,1)}
function Cd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function dc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Bd(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c} function Ad(a,b,c){var d=!1;if(void 0!==b){.8>a.na/a.qb?b=1:d=!0;a.gb=b;b=a.Ib*a.gb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ub()}ec(a,a.X);a.X=0;a.T=Ba();a.ba=0;Bd(a);return d}function Hc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Jc(a,b,c,d){0<=b&&b<a.K.length&&(d||0>a.K[b][0])&&(c=a.nb*a.gb/1E3*c|0,a.A.W&&(c+=Cd(a)),a.K[b][0]=c)}
k.ee=function(){if(this.A.W){this.Jb>=this.nb&&Ad(this,!0);this.Ma=0;this.lb=Ba();if(this.ba){var a=this.lb-this.ba;a>this.Cc&&(this.S+=a,this.S>this.lb&&(this.S=this.lb))}try{do{var b=Cd(this,this.A.xb?1:this.pb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=Bd(this,!0);this.Ma+=b;this.X+=b;fc(this,b);dc(this,b);this.ya-=b;if(0>=this.ya){this.ya+=this.pb;15<=++this.Dc&&(this.pa(),this.Dc=0);break}}while(this.A.W)}catch(e){this.da();this.C&&this.C.stop(Ba(),yd(this));zb(this,e.stack||e.message); function Dd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Sb(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Cd(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c}
return}if(this.A.W){a=setTimeout;b=this.Fc;this.ba=Ba();var c=this.Cc;this.Ma&&(c=Math.round(c*this.Ma/this.pb));var c=c-(this.ba-this.lb),d=this.ba-this.S;d&&(this.ma=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ia=0,zd(this)));if(0>c||this.ma<this.qb)-1E3>c&&(this.S-=c),c=0;this.Jb+=this.Ma;this.ba+=c;a(b,c)}}}; k.ee=function(){if(this.A.W){this.Jb>=this.nb&&Bd(this,!0);this.Ma=0;this.lb=Ba();if(this.ba){var a=this.lb-this.ba;a>this.Cc&&(this.T+=a,this.T>this.lb&&(this.T=this.lb))}try{do{var b=Dd(this,this.A.xb?1:this.pb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=Cd(this,!0);this.Ma+=b;this.X+=b;fc(this,b);Sb(this,b);this.za-=b;if(0>=this.za){this.za+=this.pb;15<=++this.Dc&&(this.qa(),this.Dc=0);break}}while(this.A.W)}catch(e){this.da();this.C&&this.C.stop(Ba(),zd(this));zb(this,e.stack||e.message);
k.jb=function(a){if(yb(this))return!1;if(this.A.W)return this.j(this.toString()+" busy"),!1;zd(this);this.A.W=!0;this.A.bc=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ub(!0),this.C.start(this.S,yd(this)));setTimeout(this.Fc,0);return!0};k.kb=function(){return 0};k.da=function(a){var b=!1;if(this.A.W){Bd(this);ec(this,this.X);this.X=0;this.A.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),yd(this));b=!0}this.A.complete=a;return b}; return}if(this.A.W){a=setTimeout;b=this.Fc;this.ba=Ba();var c=this.Cc;this.Ma&&(c=Math.round(c*this.Ma/this.pb));var c=c-(this.ba-this.lb),d=this.ba-this.T;d&&(this.na=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ja=0,Ad(this)));if(0>c||this.na<this.qb)-1E3>c&&(this.T-=c),c=0;this.Jb+=this.Ma;this.ba+=c;a(b,c)}}};
function Dd(a){this.Xa=+a.model||1170;this.Ac=a.addrReset||0;rd.call(this,a,6666667);this.decode=1120==this.Xa?Ed.bind(this):Fd.bind(this);Gd(this);this.M=0;this.O=null;this.A.complete=!1}z(Dd,rd);k=Dd.prototype;k.reset=function(){this.status("model "+this.Xa);this.A.W&&this.da();Gd(this);ud(this);this.A.error=!1;this.parent.reset.call(this)}; k.jb=function(a){if(yb(this))return!1;if(this.A.W)return this.j(this.toString()+" busy"),!1;Ad(this);this.A.W=!0;this.A.bc=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ub(!0),this.C.start(this.T,zd(this)));setTimeout(this.Fc,0);return!0};k.kb=function(){return 0};k.da=function(a){var b=!1;if(this.A.W){Cd(this);ec(this,this.X);this.X=0;this.A.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),zd(this));b=!0}this.A.complete=a;return b};
function Gd(a){a.T=65536;a.U=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Ac];a.Za=[0,0,0,0,0,0];a.La=[0,0,0,0];a.B=0;a.mb=0;a.$c=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Aa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Tb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, function Ed(a){this.Xa=+a.model||1170;this.Ac=a.addrReset||0;sd.call(this,a,6666667);this.decode=1120==this.Xa?Fd.bind(this):Gd.bind(this);Hd(this);this.M=0;this.P=null;this.A.complete=!1}z(Ed,sd);k=Ed.prototype;k.reset=function(){this.status("model "+this.Xa);this.A.W&&this.da();Hd(this);vd(this);this.A.error=!1;this.parent.reset.call(this)};
0,0,0,0,0,0,0,0,0];a.Jc=[0,0,0,0,0,0,0,0];a.Ic=0;a.J=0;a.D=a.H=0;a.g=a.f=a.yb=0;a.za=-1;Rb(a)}function Rb(a){a.Da=0;a.Kb=0;a.Mb=0;a.Ta=0;a.ta=0;a.Sb=0;a.sb=255;a.L=0;a.bb=0;a.Ea=262143;a.Nb=0;a.oa=0;a.O=null;a.v&&Hd(a)}function Hd(a){a.L?(a.R=65536,a.yc=a.Ta&16?4186112:253952,a.aa=a.Yc,a.ra=a.be,a.Vb=a.Ue,vc(a.v,a.Ta&16?22:18)):(a.R=0,a.yc=57344,a.aa=a.Xc,a.ra=a.Hc,a.Vb=a.Oc,vc(a.v,16))}function Tc(a){return a.Da&-3199|a.bb<<5|a.mb<<1} function Hd(a){a.U=65536;a.V=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Ac];a.Za=[0,0,0,0,0,0];a.La=[0,0,0,0];a.B=0;a.mb=0;a.$c=[4,2,0,1];a.O=[[0,0,0,0,0,0,0,0,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.ha=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Tb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
function Uc(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.Kb=a.oa>>16&65535,a.Mb=a.oa&65535);a.Da=b;a.bb=b>>5&3;a.mb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.L!=c&&(a.L=c,Hd(a))}}function Vc(a){a.Da&57344||(a.Kb=a.oa>>16&65535);a=a.Kb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function Wc(a){a.Da&57344||(a.Mb=a.oa&65535);return a.Mb}function Xc(a,b){1170>a.Xa&&(b&=-49);a.Ta!=b&&(a.Ta=b,a.Ea=b&16?4194303:262143,Hd(a))}k.vc=function(){return 0}; 0,0,0,0,0,0,0,0,0];a.Jc=[0,0,0,0,0,0,0,0];a.Ic=0;a.J=0;a.D=a.H=0;a.g=a.f=a.yb=0;a.Aa=-1;Rb(a)}function Rb(a){a.Da=0;a.Kb=0;a.Mb=0;a.Ta=0;a.ua=0;a.Sb=0;a.sb=255;a.L=0;a.bb=0;a.Ea=262143;a.Nb=0;a.pa=0;a.P=null;a.v&&Id(a)}function Id(a){a.L?(a.S=65536,a.yc=a.Ta&16?4186112:253952,a.aa=a.Yc,a.sa=a.be,a.Vb=a.Ue,vc(a.v,a.Ta&16?22:18)):(a.S=0,a.yc=57344,a.aa=a.Xc,a.sa=a.Hc,a.Vb=a.Oc,vc(a.v,16))}function Uc(a){var b=a.Da;b&57344||(b=b&-3199|a.bb<<5|a.mb<<1);return b}
k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ia,this.gb]);a.set(2,Ec(this.v));return a.data()};k.restore=function(a){var b=a[1];this.ia=b[1];zd(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c<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 Id(a){return a.T&65536?1:0} function Vc(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.Kb=a.pa>>16&65535,a.Mb=a.pa&65535);a.Da=b;a.bb=b>>5&3;a.mb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.L!=c&&(a.L=c,Id(a))}}function Wc(a){a.Da&57344||(a.Kb=a.pa>>16&65535);a=a.Kb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function Xc(a){a.Da&57344||(a.Mb=a.pa&65535);return a.Mb}function Yc(a,b){1170>a.Xa&&(b&=-49);a.Ta!=b&&(a.Ta=b,a.Ea=b&16?4194303:262143,Id(a))}k.vc=function(){return 0};
function Jd(a){return a.U&32768?2:0}function Kd(a){return a.$&65535?0:4}function Ld(a){return a.Z&32768?8:0}function Md(a){var b=a.u[7];a.oa=b;var c=a.ra(b);a.u[7]=b+2&65535;return c}function Nd(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 Rc(a,b){return{ge:a,Bb:b,next:null}}function Od(a,b){var c=a.O;if(c==b)a.O=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}} k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ja,this.gb]);a.set(2,Ec(this.v));return a.data()};k.restore=function(a){var b=a[1];this.ja=b[1];Ad(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 Jd(a){return a.U&65536?1:0}
function Ic(a,b){if(b!=a.O){var c=a.O;if(!c||c.Bb<=b.Bb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.Bb<=b.Bb){b.next=d;c.next=b;break}c=d}while(c)}}a.J|=1}function je(a){return a.J&64?(a.va(168,64,-5),!0):a.J&32?(a.va(4,32,-4),!0):a.J&16?(a.va(12,16,-6),!0):!1}function Zc(a){return a.N=a.N&63728|Ld(a)|Kd(a)|Jd(a)|Id(a)} function Kd(a){return a.V&32768?2:0}function Ld(a){return a.$&65535?0:4}function Md(a){return a.Z&32768?8:0}function Nd(a){var b=a.u[7];a.pa=b;var c=a.sa(b);a.u[7]=b+2&65535;return c}function Od(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function Q(a,b){a.u[7]=b&65535}function Rc(a,b){return{ge:a,Bb:b,next:null}}function Pd(a,b){var c=a.P;if(c==b)a.P=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}}
function $c(a,b){a.Z=b<<12;a.$=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.N)&2048)for(var c=a.Za.length;0<=--c;){var d=a.u[c];a.u[c]=a.Za[c];a.Za[c]=d}a.B=b>>14&3;c=a.N>>14&3;a.B!=c&&(a.La[c]=a.u[6],a.u[6]=a.La[a.B]);a.N=b;a.J|=2}function Yc(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1)}a.Sb=b;a.J|=2}function Q(a,b){a.J&128||(a.Z=a.$=b,a.U=0)}function ke(a,b,c){a.J&128||(a.Z=a.$=a.T=b,a.U=c||0)}function le(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^b)&(d^b))} function Ic(a,b){if(b!=a.P){var c=a.P;if(!c||c.Bb<=b.Bb)b.next=c,a.P=b;else{do{var d=c.next;if(!d||d.Bb<=b.Bb){b.next=d;c.next=b;break}c=d}while(c)}}a.J|=1}function ke(a){return a.J&64?(a.wa(168,64,-5),!0):a.J&32?(a.wa(4,32,-4),!0):a.J&16?(a.wa(12,16,-6),!0):!1}function $c(a){return a.N=a.N&63728|Md(a)|Ld(a)|Kd(a)|Jd(a)}
function me(a,b){a.J&128||(a.Z=a.$=a.T=b,a.U=a.Z^a.T>>1)}function ne(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^d)&(d^b))}k.va=function(a,b,c){if(!this.M){0>this.za?this.za=Zc(this):this.B||(a=4,this.ta|=4,this.u[6]=4,c=-3);this.oa=a;this.B=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);$c(this,e&-12289|this.za>>2&12288);oe(this,this.za);oe(this,this.u[7]);O(this,d);this.J&=~(b|18);this.J|=9;this.za=-1;this.md=a;this.ld=c;if(-3<=c)throw a;}}; function ad(a,b){a.Z=b<<12;a.$=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.N)&2048)for(var c=a.Za.length;0<=--c;){var d=a.u[c];a.u[c]=a.Za[c];a.Za[c]=d}a.B=b>>14&3;c=a.N>>14&3;a.B!=c&&(a.La[c]=a.u[6],a.u[6]=a.La[a.B]);a.N=b;a.J|=2}function Zc(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1)}a.Sb=b;a.J|=2}function R(a,b){a.J&128||(a.Z=a.$=b,a.V=0)}function le(a,b,c){a.J&128||(a.Z=a.$=a.U=b,a.V=c||0)}function me(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^b)&(d^b))}
function pe(a){var b=qe(a),c=qe(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);$c(a,c);a.J&=-17}function Dc(a,b){var c=b>>13&31;31>c&&a.Ta&32&&(b=a.Tb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} function ne(a,b){a.J&128||(a.Z=a.$=a.U=b,a.V=a.Z^a.U>>1)}function oe(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^d)&(d^b))}k.wa=function(a,b,c){if(!this.M){0>this.Aa?this.Aa=$c(this):this.B||(a=4,this.ua|=4,this.u[6]=4,c=-3);this.pa=a;this.B=0;var d=this.sa(a|this.S),e=this.sa(a+2&65535|this.S);ad(this,e&-12289|this.Aa>>2&12288);pe(this,this.Aa);pe(this,this.u[7]);Q(this,d);this.J&=~(b|18);this.J|=9;this.Aa=-1;this.md=a;this.ld=c;if(-3<=c)throw a;}};
function re(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.yc),f;d=b>>13;a.Ta&a.$c[a.B]||(d&=7);e=a.V[a.B][d];f=(a.Aa[a.B][d]<<6)+(b&8191)&a.Ea;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.B][d]=e;if(f!=(4194170&a.Ea)||a.B)a.bb=a.B,a.mb=d;b=!1;g&&(g&57344&&(0<=a.za&&(g|=128),a.Da& function qe(a){var b=re(a),c=re(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);Q(a,b);ad(a,c);a.J&=-17}function Dc(a,b){var c=b>>13&31;31>c&&(b=a.Ta&32?a.Tb[c]+(b&8190)&4194302:b&-3932161);return b}
57344||(g|=a.bb<<5|a.mb<<1,Uc(a,a.Da&-61695|g),b=!0)),a.Da&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)),b&&a.va(168,0,-1));return f}function se(a,b){return a.v.Lb(b)}function qe(a){var b=a.ra(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function oe(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.oa=a.oa&65535|(a.oa&-65536)<<8|16121856;te(a,0,c);a.Vb(c,b)}function te(a,b,c){!a.B&&c<=a.sb&&(b||4<c)&&(1145<=a.Xa&&c<=a.sb-32?(a.ta|=4,a.u[6]=4,a.va(4,0,-3)):(a.ta|=8,a.J|=32))} function se(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.yc),f;d=b>>13;a.Ta&a.$c[a.B]||(d&=7);e=a.O[a.B][d];f=(a.ha[a.B][d]<<6)+(b&8191)&a.Ea;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.O[a.B][d]=e;if(f!=(4194170&a.Ea)||a.B)a.bb=a.B,a.mb=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.Da&57344||
function ue(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return a.va(4,0,-2),0;case 1:return 6==c&&d&4&&te(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(Nd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Nd(a,2)),e=e+ (g|=a.bb<<5|a.mb<<1,Vc(a,a.Da&-61695|g),a.wa(168,0,-1))),a.Da&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function te(a,b){return a.v.Lb(b)}function re(a){var b=a.sa(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b}function pe(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.pa=a.pa&65535|(a.pa&-65536)<<8|16121856;ue(a,0,c);a.Vb(c,b)}function ue(a,b,c){!a.B&&c<=a.sb&&(b||4<c)&&(1145<=a.Xa&&c<=a.sb-32?(a.ua|=4,a.u[6]=4,a.wa(4,0,-3)):(a.ua|=8,a.J|=32))}
a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.oa=a.oa&65535|(a.oa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&te(a,b,a.u[6]);return e}k.Zb=function(a){if(!this.L)return this.v.Zb(a);this.M++;a=se(this,re(this,a,3));this.M--;return a};k.fb=function(a){if(!this.L)return this.v.fb(a);this.M++;a=this.Hc(re(this,a,2));this.M--;return a};k.tb=function(a,b){this.L?(this.M++,a=re(this,a,5),a&1&&this.b--,this.v.Eb(a,b),this.M--):this.v.tb(a,b)}; function ve(a,b,c,d){var e,f,g=d&8?0:a.S;switch(b){case 0:return a.wa(4,0,-2),0;case 1:return 6==c&&d&4&&ue(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.sa(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.sa(e)|g;a.b-=8;break;case 6:return e=a.sa(Od(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Od(a,2)),e=e+
k.Fb=function(a,b){this.L?(this.M++,this.Oc(re(this,a,4),b),this.M--):this.v.Fb(a,b)};k.Xc=function(a,b,c){return ue(this,a,b,c)};k.Yc=function(a,b,c){return re(this,ue(this,a,b,c),c)};k.Hc=function(a){return this.v.na(this.Nb=a)};k.be=function(a){return this.v.na(this.Nb=re(this,a,2))};k.Oc=function(a,b){this.v.ib(this.Nb=a,b&65535)};k.Ue=function(a,b){this.v.ib(this.Nb=re(this,a,4),b)}; a.u[c]&65535,e=a.sa(e|a.S)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.pa=a.pa&65535|(a.pa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&ue(a,b,a.u[6]);return e}k.Zb=function(a){if(!this.L)return this.v.Zb(a);this.M++;a=te(this,se(this,a,3));this.M--;return a};k.fb=function(a){if(!this.L)return this.v.fb(a);this.M++;a=this.Hc(se(this,a,2));this.M--;return a};k.tb=function(a,b){this.L?(this.M++,a=se(this,a,5),a&1&&this.b--,this.v.Eb(a,b),this.M--):this.v.tb(a,b)};
function ve(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ue(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.ra(d|c&a.R),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.La[a.N>>12&3];return c}function we(a,b,c,d){a.oa=a.oa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ue(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=re(a,e|c&65536,4),a.B=a.N>>14&3,a.v.ib(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.La[a.N>>12&3]=d} k.Fb=function(a,b){this.L?(this.M++,this.Oc(se(this,a,4),b),this.M--):this.v.Fb(a,b)};k.Xc=function(a,b,c){return ve(this,a,b,c)};k.Yc=function(a,b,c){return se(this,ve(this,a,b,c),c)};k.Hc=function(a){return this.v.oa(this.Nb=a)};k.be=function(a){return this.v.oa(this.Nb=se(this,a,2))};k.Oc=function(a,b){this.v.ib(this.Nb=a,b&65535)};k.Ue=function(a,b){this.v.ib(this.Nb=se(this,a,4),b)};
function xe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?se(a,a.aa(b,c,3)):-c-1}function ye(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.aa(b,d,2)):c=-d-1;return c}function ze(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ue(a,b,c,8)}function Ae(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?se(a,a.aa(b,c,3)):a.u[c]&255}function Be(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.aa(b,c,2)):a.u[c]} function we(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ve(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.sa(d|c&a.S),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.La[a.N>>12&3];return c}function xe(a,b,c,d){a.pa=a.pa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ve(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=se(a,e|c&65536,4),a.B=a.N>>14&3,a.v.ib(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.La[a.N>>12&3]=d}
function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.yb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,se(a,e)),e&1&&a.b--,a.v.Eb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.ib(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} function ye(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?te(a,a.aa(b,c,3)):-c-1}function ze(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.oa(a.aa(b,d,2)):c=-d-1;return c}function Ae(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ve(a,b,c,8)}function Be(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?te(a,a.aa(b,c,3)):a.u[c]&255}function Ce(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.oa(a.aa(b,c,2)):a.u[c]}
function Ce(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Eb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function De(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.ib(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.yb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,te(a,e)),e&1&&a.b--,a.v.Eb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.ib(e,d.call(a,0>c?a.u[-c-1]:c,a.v.oa(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}
k.kb=function(a){this.A.complete=!0;var b=this.i?Ee(this.i)?1:this.A.bc?-1:0:0,c=a?this.A.bc?0:1:-1;this.A.bc=!1;this.ca=this.b=a;do{if(b){if(Fe(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&7)if(a=!1,this.J&2){this.J&=-3;var d=160,e=(this.Sb&224)>>5,f=this.O&&this.O.Bb>e?this.O:null;f&&(d=f.ge,e=f.Bb);e>(this.N&224)>>5?(this.J&4&&(Nd(this,2),this.J&=-5),this.va(d,0,-9),e=!0):e=!1;e&&(f&&Od(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&Fe(this.i,this.u[7],c)){this.da(); function De(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Eb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function Ee(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.ib(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function U(a,b,c){c&&(Q(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
break}if(0>c)break}if(this.J&112&&je(this)){if(b&&Fe(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Md(this))}while(0<this.b);return this.A.complete?this.ca-this.b:void 0===this.A.complete?0:-1};$a(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Dd(d);B(d,c)}});function Ge(a,b){var c=b+a;le(this,c,a,b);return c&65535}function He(a,b){var c=b+a;le(this,c<<8,a<<8,b<<8);return c&255} k.kb=function(a){this.A.complete=!0;var b=this.i?Fe(this.i)?1:this.A.bc?-1:0:0,c=a?this.A.bc?0:1:-1;this.A.bc=!1;this.ca=this.b=a;do{if(b){if(Ge(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&7)if(a=!1,this.J&2){this.J&=-3;var d=160,e=(this.Sb&224)>>5,f=this.P&&this.P.Bb>e?this.P:null;f&&(d=f.ge,e=f.Bb);e>(this.N&224)>>5?(this.J&4&&(Od(this,2),this.J&=-5),this.wa(d,0,-9),e=!0):e=!1;e&&(f&&Pd(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&Ge(this.i,this.u[7],c)){this.da();
function Ie(a,b){a=b<<1;me(this,a);return a&65535}function Je(a,b){a=b<<1;me(this,a<<8);return a&255}function Ke(a,b){a=b&32768|b>>1|b<<16;me(this,a);return a&65535}function Le(a,b){a=b&128|b>>1|b<<8;me(this,a<<8);return a&255}function Me(a,b){a=b&~a;Q(this,a);return a}function Ne(a,b){a=b&~a;Q(this,a<<8);return a}function Oe(a,b){a|=b;Q(this,a);return a}function Pe(a,b){a|=b;Q(this,a<<8);return a}function Qe(a,b){a=~b|65536;ke(this,a);return a&65535} break}if(0>c)break}if(this.J&112&&ke(this)){if(b&&Ge(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Nd(this))}while(0<this.b);return this.A.complete?this.ca-this.b:void 0===this.A.complete?0:-1};$a(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Ed(d);B(d,c)}});function He(a,b){var c=b+a;me(this,c,a,b);return c&65535}function Ie(a,b){var c=b+a;me(this,c<<8,a<<8,b<<8);return c&255}
function Re(a,b){a=~b|256;ke(this,a<<8);return a&255}function Se(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.U=b&(b^a));return a&65535}function Te(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.U=b&(b^c));return a&255}function Ue(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.U=a&(b^a));return a&65535}function Ve(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.U=c&(b<<8^c));return a&255}function We(a,b){a=-b;ke(this,a,a&b&32768);return a&65535} function Je(a,b){a=b<<1;ne(this,a);return a&65535}function Ke(a,b){a=b<<1;ne(this,a<<8);return a&255}function Le(a,b){a=b&32768|b>>1|b<<16;ne(this,a);return a&65535}function Me(a,b){a=b&128|b>>1|b<<8;ne(this,a<<8);return a&255}function Ne(a,b){a=b&~a;R(this,a);return a}function Oe(a,b){a=b&~a;R(this,a<<8);return a}function Pe(a,b){a|=b;R(this,a);return a}function Qe(a,b){a|=b;R(this,a<<8);return a}function Re(a,b){a=~b|65536;le(this,a);return a&65535}
function Xe(a,b){a=-b;ke(this,a<<8,(a&b&128)<<8);return a&255}function Ye(a,b){a=b<<1|this.T>>16&1;me(this,a);return a&65535}function Ze(a,b){a=b<<1|this.T>>16&1;me(this,a<<8);return a&255}function $e(a,b){a=(this.T&65536|b)>>1|b<<16;me(this,a);return a&65535}function af(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;me(this,a<<8);return a&255}function bf(a,b){var c=b-a;ne(this,c,a,b);return c&65535}function cf(a,b){var c=b-a;ne(this,c<<8,a<<8,b<<8);return c&255} function Se(a,b){a=~b|256;le(this,a<<8);return a&255}function Te(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.V=b&(b^a));return a&65535}function Ue(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.V=b&(b^c));return a&255}function Ve(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.V=a&(b^a));return a&65535}function We(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.V=c&(b<<8^c));return a&255}function Xe(a,b){a=-b;le(this,a,a&b&32768);return a&65535}
function df(a,b){this.J&128||(this.Z=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function ef(a,b){a^=b;Q(this,a);return a&65535}function ff(a){S(this,a,ye(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Ye(a,b){a=-b;le(this,a<<8,(a&b&128)<<8);return a&255}function Ze(a,b){a=b<<1|this.U>>16&1;ne(this,a);return a&65535}function $e(a,b){a=b<<1|this.U>>16&1;ne(this,a<<8);return a&255}function af(a,b){a=(this.U&65536|b)>>1|b<<16;ne(this,a);return a&65535}function bf(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;ne(this,a<<8);return a&255}function cf(a,b){var c=b-a;oe(this,c,a,b);return c&65535}function df(a,b){var c=b-a;oe(this,c<<8,a<<8,b<<8);return c&255}
function gf(a){var b=Be(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(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.$=c;this.b-=(this.g?6:7)+b} function ef(a,b){this.J&128||(this.Z=this.$=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function ff(a,b){a^=b;R(this,a);return a&65535}function gf(a){T(this,a,ze(this,a),He);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function hf(a){var b=Be(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(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.$=d>>16|d;this.b-=(this.g?6:7)+b}function jf(a){T(this,a,!Id(this))}function kf(a){T(this,a,Id(this))} function hf(a){var b=Ce(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.U=c<<17-b,c>>=b;else if(b)if(16<b)this.V=c,c=0;else{this.U=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.Z=this.$=c;this.b-=(this.g?6:7)+b}
function lf(a){S(this,a,ye(this,a),Me);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function mf(a){R(this,a,xe(this,a),Ne);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function nf(a){S(this,a,ye(this,a),Oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function of(a){R(this,a,xe(this,a),Pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function jf(a){var b=Ce(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.U=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.V=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function kf(a){U(this,a,!Jd(this))}function lf(a){U(this,a,Jd(this))}
function pf(a){var b=ye(this,a);a=Be(this,a);Q(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function qf(a){var b=xe(this,a);a=Ae(this,a);Q(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function rf(a){T(this,a,Kd(this))}function sf(a){T(this,a,!Ld(this)==!Jd(this))}function tf(a){T(this,a,!Kd(this)&&!Ld(this)==!Jd(this))}function uf(a){T(this,a,!Id(this)&&!Kd(this))} function mf(a){T(this,a,ze(this,a),Ne);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function nf(a){S(this,a,ye(this,a),Oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function of(a){T(this,a,ze(this,a),Pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function pf(a){S(this,a,ye(this,a),Qe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function vf(a){T(this,a,Kd(this)||!Ld(this)!=!Jd(this))}function wf(a){T(this,a,Id(this)||Kd(this))}function xf(a){T(this,a,!Ld(this)!=!Jd(this))}function yf(a){T(this,a,Ld(this))}function zf(a){T(this,a,!Kd(this))}function Af(a){T(this,a,!Ld(this))}function Bf(){this.va(12,0,-8);this.b-=5}function Cf(a){T(this,a,!0)}function Df(a){T(this,a,!Jd(this))}function Ef(a){T(this,a,Jd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5} function qf(a){var b=ze(this,a);a=Ce(this,a);R(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 rf(a){var b=ye(this,a);a=Be(this,a);R(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 sf(a){U(this,a,Ld(this))}function tf(a){U(this,a,!Md(this)==!Kd(this))}function uf(a){U(this,a,!Ld(this)&&!Md(this)==!Kd(this))}function vf(a){U(this,a,!Jd(this)&&!Ld(this))}
function Ff(a){var b=ye(this,a);a=Be(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ne(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Gf(a){var b=xe(this,a);a=Ae(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ne(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} function wf(a){U(this,a,Ld(this)||!Md(this)!=!Kd(this))}function xf(a){U(this,a,Jd(this)||Ld(this))}function yf(a){U(this,a,!Md(this)!=!Kd(this))}function zf(a){U(this,a,Md(this))}function Af(a){U(this,a,!Ld(this))}function Bf(a){U(this,a,!Md(this))}function Cf(){this.wa(12,0,-8);this.b-=5}function Df(a){U(this,a,!0)}function Ef(a){U(this,a,!Kd(this))}function Ff(a){U(this,a,Kd(this))}function V(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5}
function Hf(a){var b=Be(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.Z=d>>16):(this.U=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function If(){this.va(24,0,-8);this.b-=25} function Gf(a){var b=ze(this,a);a=Ce(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;oe(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Hf(a){var b=ye(this,a);a=Be(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);oe(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 Jf(){this.N&49152?(this.ta|=128,this.va(4,0,-7)):(this.w&&1120==this.Xa&&this.w.setData(this.u[0],!0),this.i?Kf(this.i):this.da());this.b-=7}function Lf(){this.va(16,0,-8);this.b-=25}var Mf=[0,7,7,10,7,11,9,13];function Nf(a){this.I=this.b;O(this,ze(this,a));this.b=this.I-Mf[this.g]}var Of=[0,14,14,17,14,18,16,20];function Pf(a){this.I=this.b;var b=ze(this,a);a=a>>6&7;oe(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Of[this.g]} function If(a){var b=Ce(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.Z=d>>16):(this.V=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.V=32768,this.U=65536,this.b-=7}function Jf(){this.wa(24,0,-8);this.b-=25}
var Qf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Rf(a){var b=ye(this,a);this.I=this.b;Q(this,De(this,a,b));this.b=this.I-Qf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Sf(a){var b=xe(this,a);Q(this,Ce(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Tf=[7,13,13,17,14,18,17,21]; function Kf(){this.N&49152?(this.ua|=128,this.wa(4,0,-7)):(this.w&&1120==this.Xa&&this.w.setData(this.u[0],!0),this.i?Lf(this.i):this.da());this.b-=7}function Mf(){this.wa(16,0,-8);this.b-=25}var Nf=[0,7,7,10,7,11,9,13];function Of(a){this.I=this.b;Q(this,Ae(this,a));this.b=this.I-Nf[this.g]}var Pf=[0,14,14,17,14,18,16,20];function Qf(a){this.I=this.b;var b=Ae(this,a);a=a>>6&7;pe(this,this.u[a]);this.u[a]=this.u[7];Q(this,b);this.b=this.I-Pf[this.g]}
function Uf(a){var b=Be(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&128||(this.Z=b>>16,this.$=this.Z|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Vf(){this.b-=5}function Wf(){this.N&49152||(this.v.reset(),Rb(this),this.w&&this.w.setData(this.u[0],!0));this.b-=667}function Xf(a){if(a&8)V.call(this,a);else{var b=qe(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}} var Rf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Sf(a){var b=ze(this,a);this.I=this.b;R(this,Ee(this,a,b));this.b=this.I-Rf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Tf(a){var b=ye(this,a);R(this,De(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 Uf=[7,13,13,17,14,18,17,21];
function Yf(){pe(this);this.b-=13}function W(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.$=0);a&8&&(this.Z=32768);this.b-=5}function Zf(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 $f(a){S(this,a,ye(this,a),bf);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ag(a){S(this,a,0,df);this.b-=this.g?9:3+(7==this.f?2:0)}function bg(){this.va(28,0,-8);this.b-=5} function Vf(a){var b=Ce(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&128||(this.Z=b>>16,this.$=this.Z|b,this.V=0,this.U=-32768>b||32767<b?65536:0);this.b-=23}function Wf(){this.b-=5}function Xf(){this.N&49152||(this.v.reset(),Rb(this),this.w&&this.w.setData(this.u[0],!0));this.b-=667}function Yf(a){if(a&8)W.call(this,a);else{var b=re(this);a&=7;7==a?Q(this,b):(Q(this,this.u[a]),this.u[a]=b);this.b-=9}}
function cg(){this.w&&(this.w.nc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=4;Nd(this,-2);this.b-=3}function dg(a){S(this,a,this.u[a>>6&7],ef);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Kf(b)):b=!1;b||this.va(8,0,-8)}function Ed(a){eg[a>>12].call(this,a)}function fg(a){gg[a>>6&3].call(this,a)}function hg(a){ig[a>>6&3].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a&15].call(this,a)} function Zf(){qe(this);this.b-=13}function $f(a){a&1&&(this.U=65536);a&2&&(this.V=32768);a&4&&(this.$=0);a&8&&(this.Z=32768);this.b-=5}function ag(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)Q(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function bg(a){T(this,a,ze(this,a),cf);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function cg(a){T(this,a,0,ef);this.b-=this.g?9:3+(7==this.f?2:0)}function dg(){this.wa(28,0,-8);this.b-=5}
function ng(a){og[a&15].call(this,a)}function pg(a){qg[a>>6&3].call(this,a)}function rg(a){sg[a>>6&3].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)} function eg(){this.w&&(this.w.nc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=4;Od(this,-2);this.b-=3}function fg(a){T(this,a,this.u[a>>6&7],ff);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Lf(b)):b=!1;b||this.wa(8,0,-8)}function Fd(a){gg[a>>12].call(this,a)}function hg(a){ig[a>>6&3].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a>>6&3].call(this,a)}function ng(a){og[a&15].call(this,a)}
var eg=[function(a){vg[a>>8&15].call(this,a)},Rf,Ff,pf,lf,nf,ff,V,function(a){wg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,$f,V],vg=[function(a){xg[a>>4&15].call(this,a)},Cf,zf,rf,sf,xf,tf,vf,Pf,Pf,fg,hg,jg,V,V,V],gg=[function(a){ke(this,De(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Se);this.b-=this.g?9:3+(7==this.f?2:0)}],ig=[function(a){S(this,a,0, function pg(a){qg[a&15].call(this,a)}function rg(a){sg[a>>6&3].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)}function vg(a){wg[a>>6&3].call(this,a)}
We);this.b-=this.g?11:6},function(a){S(this,a,Id(this)?1:0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Id(this)?1:0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Be(this,a);ke(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],kg=[function(a){S(this,a,0,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)}], var gg=[function(a){xg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,gf,W,function(a){yg[a>>8&15].call(this,a)},Tf,Hf,rf,nf,pf,bg,W],xg=[function(a){zg[a>>4&15].call(this,a)},Df,Af,sf,tf,yf,uf,wf,Qf,Qf,hg,jg,lg,W,W,W],ig=[function(a){le(this,Ee(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Te);this.b-=this.g?9:3+(7==this.f?2:0)}],kg=[function(a){T(this,a,0,
xg=[function(a){yg[a&15].call(this,a)},V,V,V,Nf,Nf,Nf,Nf,Xf,V,lg,ng,ag,ag,ag,ag],yg=[Jf,cg,Yf,Bf,Lf,Wf,V,V,V,V,V,V,V,V,V,V],mg=[Vf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.$=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],og=[Vf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.$=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],wg=[Af,yf,uf,wf,Df,Ef,jf,kf,If,bg,pg,rg,tg,V,V,V],qg=[function(a){ke(this, Xe);this.b-=this.g?11:6},function(a){T(this,a,Jd(this)?1:0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,Jd(this)?1:0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ce(this,a);le(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],mg=[function(a){T(this,a,0,af);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)}],
Ce(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Te);this.b-=this.g?9:3+(7==this.f?2:0)}],sg=[function(a){R(this,a,0,Xe);this.b-=this.g?11:6},function(a){R(this,a,Id(this)?1:0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Id(this)?1:0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ae(this,a);ke(this,a<<8);this.b-=this.g?4:3+ zg=[function(a){Ag[a&15].call(this,a)},W,W,W,Of,Of,Of,Of,Yf,W,ng,pg,cg,cg,cg,cg],Ag=[Kf,eg,Zf,Cf,Mf,Xf,W,W,W,W,W,W,W,W,W,W],og=[Wf,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},V,function(){this.$=1;this.b-=5},V,V,V,function(){this.Z=0;this.b-=5},V,V,V,V,V,V,V],qg=[Wf,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},$f,function(){this.$=0;this.b-=5},$f,$f,$f,function(){this.Z=32768;this.b-=5},$f,$f,$f,$f,$f,$f,$f],yg=[Bf,zf,vf,xf,Ef,Ff,kf,lf,Jf,dg,rg,tg,vg,W,W,
(7==this.f?2:0)}],ug=[function(a){R(this,a,0,af);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Le);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)}];function Fd(a){zg[a>>12].call(this,a)} W],sg=[function(a){le(this,De(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ue);this.b-=this.g?9:3+(7==this.f?2:0)}],ug=[function(a){S(this,a,0,Ye);this.b-=this.g?11:6},function(a){S(this,a,Jd(this)?1:0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Jd(this)?1:0,df);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Be(this,a);le(this,
var zg=[function(a){Ag[a>>8&15].call(this,a)},Rf,Ff,pf,lf,nf,ff,function(a){Bg[a>>8&15].call(this,a)},function(a){Cg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,$f,V],Ag=[function(a){Dg[a>>4&15].call(this,a)},Cf,zf,rf,sf,xf,tf,vf,Pf,Pf,fg,hg,jg,function(a){Eg[a>>6&3].call(this,a)},V,V],Eg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ve(this,a,0);oe(this,a);Q(this,a);this.b-=11},function(a){var b=qe(this);this.I= a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],wg=[function(a){S(this,a,0,bf);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Me);this.b-=this.g?9+(this.yb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)}];function Gd(a){Bg[a>>12].call(this,a)}
this.b;we(this,a,0,b);Q(this,b);this.b=this.I-Tf[this.g]},function(a){Q(this,De(this,a,Ld(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Dg=[function(a){Fg[a&15].call(this,a)},V,V,V,Nf,Nf,Nf,Nf,Xf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):V.call(this,a)},lg,ng,ag,ag,ag,ag],Fg=[Jf,cg,function(){pe(this);this.J|=this.N&16;this.b-=13},Bf,Lf,Wf,Yf,function(){this.va(8,0,-8)},V,V,V,V,V,V,V,V],Bg=[Uf,Uf,Hf,Hf,gf,gf,hf,hf,dg,dg,V,V,V,V,Zf,Zf],Cg=[Af,yf,uf,wf, var Bg=[function(a){Cg[a>>8&15].call(this,a)},Sf,Gf,qf,mf,of,gf,function(a){Dg[a>>8&15].call(this,a)},function(a){Eg[a>>8&15].call(this,a)},Tf,Hf,rf,nf,pf,bg,W],Cg=[function(a){Fg[a>>4&15].call(this,a)},Df,Af,sf,tf,yf,uf,wf,Qf,Qf,hg,jg,lg,function(a){Gg[a>>6&3].call(this,a)},W,W],Gg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.sa(a|this.S);Q(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=we(this,a,0);pe(this,a);R(this,a);this.b-=11},function(a){var b=re(this);this.I=
Df,Ef,jf,kf,If,bg,pg,rg,tg,function(a){Gg[a>>6&3].call(this,a)},V,V],Gg=[V,function(a){a=ve(this,a,65536);oe(this,a);Q(this,a);this.b-=11},function(a){var b=qe(this);this.I=this.b;we(this,a,65536,b);Q(this,b);this.b=this.I-Tf[this.g]},V]; this.b;xe(this,a,0,b);R(this,b);this.b=this.I-Uf[this.g]},function(a){R(this,Ee(this,a,Md(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Fg=[function(a){Hg[a&15].call(this,a)},W,W,W,Of,Of,Of,Of,Yf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):W.call(this,a)},ng,pg,cg,cg,cg,cg],Hg=[Kf,eg,function(){qe(this);this.J|=this.N&16;this.b-=13},Cf,Mf,Xf,Zf,function(){this.wa(8,0,-8)},W,W,W,W,W,W,W,W],Dg=[Vf,Vf,If,If,hf,hf,jf,jf,fg,fg,W,W,W,W,ag,ag],Eg=[Bf,zf,vf,xf,
function Hg(a){t.call(this,"ROM",a,Hg,256);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.w=a.alias;this.C=a.file;this.H=sa(this.C);if(this.C){a=this.C;var b=ta(this.H);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(rb(c.Ua,a,b),(a=Fa(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);$g(c)})}}z(Hg);k=Hg.prototype; Ef,Ff,kf,lf,Jf,dg,rg,tg,vg,function(a){Ig[a>>6&3].call(this,a)},W,W],Ig=[W,function(a){a=we(this,a,65536);pe(this,a);R(this,a);this.b-=11},function(a){var b=re(this);this.I=this.b;xe(this,a,65536,b);R(this,b);this.b=this.I-Uf[this.g]},W];
k.Ia=function(a,b,c,d){this.v=b;this.b=c;this.i=d;$g(this)};k.Ka=function(){this.ga&&(this.i&&ah(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ja=function(){return!0}; function Jg(a){t.call(this,"ROM",a,Jg,512);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.w=a.alias;this.C=a.file;this.H=sa(this.C);if(this.C){a=this.C;var b=ta(this.H);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.R("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(rb(c.Ua,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);bh(c)})}}z(Jg);k=Jg.prototype;
function $g(a){if(!xb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)zb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+ra(b));if(57344<=b&&b<57344+oc){var c={};b=(c[b]=[Hg.prototype.Qd,Hg.prototype.Ie,null,null,null,a.f>>1],c);if(Ib(a.v,a,b)){b=a.D=!0;break a}}else if(yc(a.v,b,a.f,gd)){for(c=0;c<a.g.length;c++)a.v.tb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.w?b.push(a.w): k.Ia=function(a,b,c,d){this.v=b;this.b=c;this.i=d;bh(this)};k.Ka=function(){this.ga&&(this.i&&ch(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ja=function(){return!0};
null!=a.w&&a.w.length&&(b=a.w);for(c=0;c<b.length;c++){var d=a,e=b[c],f=xc(d.v,d.B,d.f);wc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Qd=function(a){return this.g[a-this.B]};k.Ie=function(){};$a(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Hg(d);B(d,c)}}); function bh(a){if(!xb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)zb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+oc){var c={};b=(c[b]=[Jg.prototype.Qd,Jg.prototype.Ie,null,null,null,a.f>>1],c);if(Ib(a.v,a,b)){b=a.D=!0;break a}}else if(yc(a.v,b,a.f,hd)){for(c=0;c<a.g.length;c++)a.v.tb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.w?b.push(a.w):
function bh(a){t.call(this,"RAM",a,bh);this.ga=this.g=null;this.C=a.addr;this.B=a.size;this.Oa=a.load;this.Na=a.exec;this.w=!1;this.f=a.file;this.D=sa(this.f);if(this.f){a=this.f;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.P("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(rb(c.Ua,a,b),(a=Fa(a,b))?(c.g=a.ea,c.ga=a.ga,null==c.Oa&&(c.Oa=a.Oa),null==c.Na&&(c.Na=a.Na)):c.f=null);ch(c)})}} null!=a.w&&a.w.length&&(b=a.w);for(c=0;c<b.length;c++){var d=a,e=b[c],f=xc(d.v,d.B,d.f);wc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Qd=function(a){return this.g[a-this.B]};k.Ie=function(){};$a(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Jg(d);B(d,c)}});
z(bh);bh.prototype.Ia=function(a,b,c,d){this.v=b;this.b=c;this.i=d;ch(this)};bh.prototype.Ka=function(){this.ga&&(this.i&&ah(this.i,this.id,this.C,this.B,this.ga),delete this.ga);return!0};bh.prototype.Ja=function(){return!0};function ch(a){if(a.v&&(!a.w&&a.B&&yc(a.v,a.C,a.B,Bc)&&(a.w=!0),!xb(a))){if(!a.w)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;dh(a,a.g,a.Oa,a.Na,a.C)}H(a)}} function dh(a){t.call(this,"RAM",a,dh);this.ga=this.g=null;this.C=a.addr;this.B=a.size;this.Oa=a.load;this.Na=a.exec;this.w=!1;this.f=a.file;this.D=sa(this.f);if(this.f){a=this.f;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.R("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(rb(c.Ua,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga,null==c.Oa&&(c.Oa=a.Oa),null==c.Na&&(c.Na=a.Na)):c.f=null);eh(c)})}}
bh.prototype.reset=function(){if(this.w){for(var a=this.v,b=this.C,c=this.B,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.w.length){var f=a.g.indexOf(e);0<=f&&(e=a.w[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Ab&&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.dc(d,g,e.F+d)}c-=a.Ba;b++;d=0}this.g&&dh(this,this.g,this.Oa,this.Na,this.C,!0)}}; z(dh);dh.prototype.Ia=function(a,b,c,d){this.v=b;this.b=c;this.i=d;eh(this)};dh.prototype.Ka=function(){this.ga&&(this.i&&ch(this.i,this.id,this.C,this.B,this.ga),delete this.ga);return!0};dh.prototype.Ja=function(){return!0};function eh(a){if(a.v&&(!a.w&&a.B&&yc(a.v,a.C,a.B,Bc)&&(a.w=!0),!xb(a))){if(!a.w)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;fh(a,a.g,a.Oa,a.Na,a.C)}H(a)}}
function dh(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.tb(n++,b[v++]&255);else n&1?a.b.da():null==d&& dh.prototype.reset=function(){if(this.w){for(var a=this.v,b=this.C,c=this.B,d=b&a.v,b=b>>>a.ka;0<c&&b<a.Y.length;){var e=a.Y[b];if(e.controller&&a.g&&a.g.length==a.w.length){var f=a.g.indexOf(e);0<=f&&(e=a.w[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Ab&&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.dc(d,g,e.F+d)}c-=a.Ba;b++;d=0}this.g&&fh(this,this.g,this.Oa,this.Na,this.C,!0)}};
(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.tb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.Ac=d,a.v.reset(),Rb(a),O(a,d),$c(a,0),!f&&a.i&&(a.da()||wd(a.i)));return g}$a(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new bh(d);B(d,c)}});function eh(a){t.call(this,"Keyboard",a,eh,65536);H(this)}z(eh);eh.prototype.ua=function(){return!1}; function fh(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.tb(n++,b[v++]&255);else n&1?a.b.da():null==d&&
eh.prototype.Ia=function(a,b,c,d){this.C=a;this.b=c;this.i=d};$a(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new eh(d);B(d,c)}}); (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.tb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.Ac=d,a.v.reset(),Rb(a),Q(a,d),ad(a,0),!f&&a.i&&(a.da()||xd(a.i)));return g}$a(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new dh(d);B(d,c)}});function gh(a){t.call(this,"Keyboard",a,gh,65536);H(this)}z(gh);gh.prototype.va=function(){return!1};
function X(a){this.O=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.ba=a.upperCase;this.w=this.D=null;this.S=a.tabSize;this.R=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=fh;b&&(void 0===c&&(c="Panel"),(c=ub(c,this.id))&&(b=c.G[b])&&this.ua(null,a,b))}this.I=this.L=null;this.exports={connect:this.zc,receiveData:this.ac}}z(X);var fh="buffer";k=X.prototype; gh.prototype.Ia=function(a,b,c,d){this.C=a;this.b=c;this.i=d};$a(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new gh(d);B(d,c)}});
k.ua=function(a,b,c){var d=this;switch(b){case fh:return this.G[b]=this.w=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.ac(b);return!0},c.onkeypress=function(a){a=a||window.event;d.ac(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ac(a.getData("Text"))}, function X(a){this.P=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.ba=a.upperCase;this.w=this.D=null;this.T=a.tabSize;this.S=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=hh;b&&(void 0===c&&(c="Panel"),(c=ub(c,this.id))&&(b=c.G[b])&&this.va(null,a,b))}this.I=this.L=null;this.exports={connect:this.zc,receiveData:this.ac}}z(X);var hh="buffer";k=X.prototype;
c.removeAttribute("readonly"),!0}return!1};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;var e=this;this.ma=Rc(48,4);this.X=Hc(this.b,function(){e.f&128||!e.B.length||(e.K=e.B.shift()&255,e.ba&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&Ic(e.b,e.ma))});this.M=Rc(52,4);this.ia=Hc(this.b,function(){e.g|=128;e.g&64&&Ic(e.b,e.M)});Ib(b,this,gh);Kb(b,this.reset.bind(this));H(this)}; k.va=function(a,b,c){var d=this;switch(b){case hh:return this.G[b]=this.w=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.ac(b);return!0},c.onkeypress=function(a){a=a||window.event;d.ac(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ac(a.getData("Text"))},
k.zc=function(){if(!this.I){var a=td(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.ab)return;b=ya(b[1]);if(this.I=tb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; c.removeAttribute("readonly"),!0}return!1};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;var e=this;this.na=Rc(48,4);this.X=Hc(this.b,function(){e.f&128||!e.B.length||(e.K=e.B.shift()&255,e.ba&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&Ic(e.b,e.na))});this.M=Rc(52,4);this.ja=Hc(this.b,function(){e.g|=128;e.g&64&&Ic(e.b,e.M)});Ib(b,this,ih);Kb(b,this.reset.bind(this));H(this)};
k.Ja=function(a){return a?this.save():!0};k.reset=function(){hh(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return hh(this)};function hh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.ac=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.B.push(b)}else this.B=this.B.concat(a);Qc(this.b,this.X,1E3/Math.round(this.O/10));return!0}; k.zc=function(){if(!this.I){var a=ud(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.ab)return;b=ya(b[1]);if(this.I=tb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
k.Kd=function(){return this.f&65534};k.Ce=function(a){this.f=this.f&-112|a&111};k.Jd=function(){this.f&=-129;0<this.B.length&&Qc(this.b,this.X,1E3/Math.round(this.O/10));return this.K};k.Be=function(){};k.de=function(){return this.g};k.We=function(a){this.g&128&&(a&64?Ic(this.b,this.M):Od(this.b,this.M));this.g=this.g&-70|a&69};k.ce=function(){return 0}; k.Ja=function(a){return a?this.save():!0};k.reset=function(){jh(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return jh(this)};function jh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.ac=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.B.push(b)}else this.B=this.B.concat(a);Jc(this.b,this.X,1E3/Math.round(this.P/10));return!0};
k.Ve=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);a&=127;if(this.w)if(13==a)this.H=0;else if(8==a)this.w.value=this.w.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=za[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=xa("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), k.Kd=function(){return this.f&65534};k.Ce=function(a){this.f=this.f&-112|a&111};k.Jd=function(){this.f&=-129;0<this.B.length&&Jc(this.b,this.X,1E3/Math.round(this.P/10));return this.K};k.Be=function(){};k.de=function(){return this.g};k.We=function(a){this.g&128&&(a&64?Ic(this.b,this.M):Pd(this.b,this.M));this.g=this.g&-70|a&69};k.ce=function(){return 0};
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Qc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var ih={},gh=(ih[65392]=[null,null,X.prototype.Kd,X.prototype.Ce,"RCSR"],ih[65394]=[null,null,X.prototype.Jd,X.prototype.Be,"RBUF"],ih[65396]=[null,null,X.prototype.de,X.prototype.We,"XCSR"],ih[65398]=[null,null,X.prototype.ce,X.prototype.Ve,"XBUF"],ih);$a(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new X(d);B(d,c)}}); k.Ve=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);a&=127;if(this.w)if(13==a)this.H=0;else if(8==a)this.w.value=this.w.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=za[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=xa("",c)));this.S&&!this.H&&c&&(b=String.fromCharCode(this.S)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D),
function ad(a){t.call(this,"PC11",a,ad);this.g=a.autoMount||null;this.D=0;this.ba=a.baudReceive||3600;this.K=this.L=this.f=0;this.I=[];this.H=jh;this.w=kh;this.M=this.B="";this.ea=this.Oa=this.Na=null;this.R=-1;this.O=!Sa("Mobi")&&window&&"FileReader"in window}z(ad);var jh="",kh=0;k=ad.prototype; this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Jc(this.b,this.ja,1E3/Math.round(this.ca/10))}};var kh={},ih=(kh[65392]=[null,null,X.prototype.Kd,X.prototype.Ce,"RCSR"],kh[65394]=[null,null,X.prototype.Jd,X.prototype.Be,"RBUF"],kh[65396]=[null,null,X.prototype.de,X.prototype.We,"XCSR"],kh[65398]=[null,null,X.prototype.ce,X.prototype.Ve,"XBUF"],kh);$a(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)}});
k.ua=function(a,b,c){var d=this,e=kh;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 bd(a){t.call(this,"PC11",a,bd);this.g=a.autoMount||null;this.D=0;this.ba=a.baudReceive||3600;this.K=this.L=this.f=0;this.I=[];this.H=lh;this.w=mh;this.M=this.B="";this.ea=this.Oa=this.Na=null;this.S=-1;this.P=!Na("Mobi")&&window&&"FileReader"in window}z(bd);var lh="",mh=0;k=bd.prototype;
function(){var a=d.G.listTapes;a&&lh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;lh(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; k.va=function(a,b,c){var d=this,e=mh;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.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=mh(a);var e=this;if((this.g=td(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Rc(56,4);this.ca=Hc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.I.length&&(e.L=e.I[e.K++]&255,nh(e,e.K/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Ic(e.b,e.X))});Ib(b,this,oh);Kb(b,this.reset.bind(this));ph(this,"None",jh,!0);this.O&& function(){var a=d.G.listTapes;a&&nh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){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;nh(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
ph(this,"Local Tape","?");ph(this,"Remote Tape","??");qh(this)||H(this)};k.Ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function qh(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=sa(b,!0)}b&&c?rh(a,c,b,1,!0):sh(a)}return!!a.D} k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.T=oh(a);var e=this;if((this.g=ud(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Rc(56,4);this.ca=Hc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.I.length&&(e.L=e.I[e.K++]&255,ph(e,e.K/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Ic(e.b,e.X))});Ib(b,this,qh);Kb(b,this.reset.bind(this));rh(this,"None",lh,!0);this.P&&
function lh(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=sa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;rh(a,b,c,d,!1,e)}else th(a,!1)} rh(this,"Local Tape","?");rh(this,"Remote Tape","??");sh(this)||H(this)};k.Ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function sh(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=sa(b,!0)}b&&c?th(a,c,b,1,!0):uh(a)}return!!a.D}
function rh(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.w!=d)g++,th(a,!0),a.A.eb?a.P("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),uh(a,b,c,d,f)?g++:a.A.eb=!0);g&&vh(a,a.M,a.B,a.w,a.ea,a.Oa,a.Na)} function nh(a,b,c,d,e){if(c)if("?"==c)a.R('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=sa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;th(a,b,c,d,!1,e)}else vh(a,!1)}
function uh(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),vh(a,b,c,d,e),a.H="?");sh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.A.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(rb(a.Ua,e,f),(e=Fa(e,f))&&vh(a,b,c,d,e.ea,e.Oa, function th(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.w!=d)g++,vh(a,!0),a.A.eb?a.R("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),wh(a,b,c,d,f)?g++:a.A.eb=!0);g&&xh(a,a.M,a.B,a.w,a.ea,a.Oa,a.Na)}
e.Na));a.A.eb=!1;a.D&&(a.D--,a.D||H(a));sh(a)})}function ph(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<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,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),xh(a,b,c,d,e),a.H="?");uh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/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.A.ia;g?a.R('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(rb(a.Ua,e,f),(e=Ea(e,f))&&xh(a,b,c,d,e.ea,e.Oa,
function sh(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.B;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 nh(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}} e.Na));a.A.eb=!1;a.D&&(a.D--,a.D||H(a));uh(a)})}function rh(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 vh(a,b,c,d,e,f,g){a.M=b;a.B=c;a.w=d;a.ea=e;a.Oa=f;a.Na=g;2==d?a.S&&dh(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.B="",a.H=jh,a.w=kh,a.P("No load address available for tape: "+b)):(a.K=0,a.I=e,a.status("tape attached: "+b),nh(a,0))}function th(a,b){if(a.B||!1===b)a.M="",a.B="",b||(a.w&&a.status(1==a.w?"tape detached":"tape unloaded"),a.H=jh,a.w=kh,sh(a))}k.save=function(){return(new N(this)).data()};k.restore=function(){return!0};k.Dd=function(){return this.f&65534}; function uh(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.B;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 ph(a,b){b|=0;if(b!==a.S){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.S=b}}
k.ve=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Ic(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Qc(this.b,this.ca,1E3/Math.round(this.ba/10))));this.f=this.f&-66|a&65};k.Cd=function(){this.f&=-129;this.f|=2048;return this.L};k.ue=function(){};var wh={},oh=(wh[65384]=[null,null,ad.prototype.Dd,ad.prototype.ve,"PRS"],wh[65386]=[null,null,ad.prototype.Cd,ad.prototype.ue,"PRB"],wh); function xh(a,b,c,d,e,f,g){a.M=b;a.B=c;a.w=d;a.ea=e;a.Oa=f;a.Na=g;2==d?a.T&&fh(a.T,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.B="",a.H=lh,a.w=mh,a.R("No load address available for tape: "+b)):(a.K=0,a.I=e,a.status("tape attached: "+b),ph(a,0))}function vh(a,b){if(a.B||!1===b)a.M="",a.B="",b||(a.w&&a.status(1==a.w?"tape detached":"tape unloaded"),a.H=lh,a.w=mh,uh(a))}k.save=function(){return(new O(this)).data()};k.restore=function(){return!0};k.Dd=function(){return this.f&65534};
function xh(a,b,c){t.call(this,"Disk",{id:a.Ua+".disk"+p(++yh,4)},xh,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.w=b;this.$a=b.name;this.jc=b.jc;zh(this,c,b.xa,b.Ca,b.qa,b.Pa);H(this)}var yh=0;z(xh);k=xh.prototype;k.Ia=function(a,b,c,d){this.i=d}; k.ve=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Ic(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Jc(this.b,this.ca,1E3/Math.round(this.ba/10))));this.f=this.f&-66|a&65};k.Cd=function(){this.f&=-129;this.f|=2048;return this.L};k.ue=function(){};var yh={},qh=(yh[65384]=[null,null,bd.prototype.Dd,bd.prototype.ve,"PRS"],yh[65386]=[null,null,bd.prototype.Cd,bd.prototype.ue,"PRB"],yh);
function zh(a,b,c,d,e,f){a.mode=b;a.xa=c;a.Ca=d;a.qa=e;a.Pa=f;a.b=[];if("preload"!=a.mode){b=Array(a.xa);for(c=0;c<b.length;c++){d=Array(a.Ca);for(e=0;e<d.length;e++){f=Array(a.qa);for(var g=1;g<=f.length;g++)f[g-1]=Ah(null,c,e,g,a.Pa,0);d[e]=f}b[c]=d}a.b=b}a.f=null} function zh(a,b,c){t.call(this,"Disk",{id:a.Ua+".disk"+p(++Ah,4)},zh,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.w=b;this.$a=b.name;this.jc=b.jc;Bh(this,c,b.ya,b.Ca,b.ra,b.Pa);H(this)}var Ah=0;z(zh);k=zh.prototype;k.Ia=function(a,b,c,d){this.i=d};
function Bh(a,b,c,d,e){var f=c;if(a.v)return!0;a.$a=b;a.hb=c;a.Lc=sa(c);a.v=e;a.B=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=la[d];if(e){a.xa=e[0];a.Ca=e[1];a.qa=e[2];a.Pa=e[3]||512;c=a.Pa>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.xa);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.Ca),w=0;w<r.length;w++)for(var y=r[w]=Array(a.qa),x=0;x<y.length;x++){for(var C=Ah(null,d,w,x+1,a.Pa,0),ka=C.data,La=0;La<c;La++,f+=4)var P=ka[La]=b.getInt32(f, function Bh(a,b,c,d,e,f){a.mode=b;a.ya=c;a.Ca=d;a.ra=e;a.Pa=f;a.b=[];if("preload"!=a.mode){b=Array(a.ya);for(c=0;c<b.length;c++){d=Array(a.Ca);for(e=0;e<d.length;e++){f=Array(a.ra);for(var g=1;g<=f.length;g++)f[g-1]=Ch(null,c,e,g,a.Pa,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
!0),e=e+P&-1;C.Fa=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.w,c,a.$a,a.hb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.jc?"":e)+"&format=json"));return!!Ea(f, function Dh(a,b,c,d,e){var f=c;if(a.v)return!0;a.$a=b;a.hb=c;a.Lc=sa(c);a.v=e;a.B=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.ya=e[0];a.Ca=e[1];a.ra=e[2];a.Pa=e[3]||512;c=a.Pa>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ya);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.Ca),w=0;w<r.length;w++)for(var y=r[w]=Array(a.ra),x=0;x<y.length;x++){for(var C=Ch(null,d,w,x+1,a.Pa,0),la=C.data,Ma=0;Ma<c;Ma++,f+=4)var P=la[Ma]=b.getInt32(f,
null,!0,function(b,c,d){Ch(a,b,c,d)})} !0),e=e+P&-1;C.Fa=c;y[x]=C}a.f=e;c=a}else a.R("Unrecognized disk format ("+d+" bytes)");a.v&&(a.v.call(a.controller,a.w,c,a.$a,a.hb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.jc?"":e)+"&format=json"));return!!Da(f,
function Ch(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ha;if(d)a.controller.P('Unable to load disk "'+a.$a+'" (error '+d+": "+b+")",f);else{rb(a.controller.Ua,b,c);try{if(0<sa(a.Lc,!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.$a]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ null,!0,function(b,c,d){Eh(a,b,c,d)})}
c+")");if(h.length)if(1==h.length)q(h[0]);else{a.xa=h.length;a.Ca=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Pa=l&&l.length||512;for(d=c=0;d<a.xa;d++)for(f=0;f<a.Ca;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;Dh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}Ah(l,d,f);for(w= function Eh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ia;if(d)a.controller.R('Unable to load disk "'+a.$a+'" (error '+d+": "+b+")",f);else{rb(a.controller.Ua,b,c);try{if(0<sa(a.Lc,!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.$a]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.$a)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.B,a.w,e,a.$a,a.hb),a.v=null)}function Ah(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ze=b;a.$e=c;a.Sa=a.Fa=0;a.Wa=!1;return a} c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ya=h.length;a.Ca=h[0].length;a.ra=h[0][0].length;var l=h[0][0][0];a.Pa=l&&l.length||512;for(d=c=0;d<a.ya;d++)for(f=0;f<a.Ca;f++)for(g=0;g<a.ra;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;Fh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}Ch(l,d,f);for(w=
k.seek=function(a,b,c,d,e){d=null;var f=this.w,g=this.b[a];if(g){var h=g[b];if(!h&&f.Rc&&b<f.Ca)for(h=g[b]=Array(f.Sc),g=0;g<h.length;g++)h[g]=Ah(null,a,b,g+1,f.Ec,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Rc&&9==f.rc&&(d=h[g]=Ah(null,a,b,f.rc,f.Ec,0))}}e&&e(d,!1);return d};function Dh(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} 0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.$a)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.B,a.w,e,a.$a,a.hb),a.v=null)}function Ch(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ze=b;a.$e=c;a.Sa=a.Fa=0;a.Wa=!1;return a}
k.seek=function(a,b,c,d,e){d=null;var f=this.w,g=this.b[a];if(g){var h=g[b];if(!h&&f.Rc&&b<f.Ca)for(h=g[b]=Array(f.Sc),g=0;g<h.length;g++)h[g]=Ch(null,a,b,g+1,f.Ec,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Rc&&9==f.rc&&(d=h[g]=Ch(null,a,b,f.rc,f.Ec,0))}}e&&e(d,!1);return d};function Fh(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.Fa?f<a.Sa?(a.Fa+=a.Sa-f,a.Sa=f):f>=a.Sa+a.Fa&&(a.Fa+=f-(a.Sa+a.Fa)+1):(a.Sa=f,a.Fa=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.Fa?f<a.Sa?(a.Fa+=a.Sa-f,a.Sa=f):f>=a.Sa+a.Fa&&(a.Fa+=f-(a.Sa+a.Fa)+1):(a.Sa=f,a.Fa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function Eh(a,b){var c=a.Ca*a.qa,d=b/c|0;return d<a.xa?(b%=c,a.seek(d,b/a.qa|0,b%a.qa+1)):null}function Fh(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 Gh(a,b){var c=a.Ca*a.ra,d=b/c|0;return d<a.ya?(b%=c,a.seek(d,b/a.ra|0,b%a.ra+1)):null}function Hh(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.hb,this.f,this.xa,this.Ca,this.qa,this.Pa];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.Fa){for(var h=[],l=0,m=g.Sa,n=g.Sa+g.Fa;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Sa,h]}}return b}; k.save=function(){var a=0,b=[];b[a++]=[this.hb,this.f,this.ya,this.Ca,this.ra,this.Pa];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.Fa){for(var h=[],l=0,m=g.Sa,n=g.Sa+g.Fa;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Sa,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?zh(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?Bh(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.Sa=e;for(h.Fa=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.P("Unable to restore disk '"+this.$a+": "+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.Sa=e;for(h.Fa=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.R("Unable to restore disk '"+this.$a+": "+c);return b};
k.toJSON=function(){var a;a=0;for(var b;b=Eh(this,a++);)Gh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; k.toJSON=function(){var a;a=0;for(var b;b=Gh(this,a++);)Ih(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function Gh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,4194304);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Sa("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype; function Ih(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){t.call(this,"RL11",a,N,4194304);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Na("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype;
k.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<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=ma(c.value,10);null!=a&&Hh(d,a)},!0;case "loadDrive":return this.G[b]= k.va=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=ma(c.value,10);null!=a&&Jh(d,a)},!0;case "loadDrive":return this.G[b]=
c,c.onclick=function(){var a=d.G.listDisks;a&&Ih(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[ma(a.value,10)||0])if(a=a.Ga){var b;b="";for(var c=0,h;h=Eh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(Fh(a,h,l));b=btoa(b);a=a.Lc.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&&Kh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[ma(a.value,10)||0])if(a=a.Ga){var b;b="";for(var c=0,h;h=Gh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(Hh(a,h,l));b=btoa(b);a=a.Lc.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.R("No disk loaded in drive.");else d.R("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;Ih(d,sa(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;Kh(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.w=td(this.C,"autoMount")||this.w)&&"string"==typeof this.w)try{this.w=eval("("+this.w+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.w+")"),this.w=null}Jh(this);this.O=Rc(112,5);Ib(b,this,Kh);Kb(b,this.reset.bind(this));Lh(this,"None","",!0);this.L&&Lh(this,"Local Disk","?");Lh(this,"Remote Disk","??");Mh(this)||H(this)}; k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.w=ud(this.C,"autoMount")||this.w)&&"string"==typeof this.w)try{this.w=eval("("+this.w+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.w+")"),this.w=null}Lh(this);this.P=Rc(112,5);Ib(b,this,Mh);Kb(b,this.reset.bind(this));Nh(this,"None","",!0);this.L&&Nh(this,"Local Disk","?");Nh(this,"Remote Disk","??");Oh(this)||H(this)};
k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.uc){for(a=0;a<this.f.length;a++)Nh(this,a,!0);Mh(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";Hh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Jh(this)};k.save=function(){return(new N(this)).data()}; k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.uc){for(a=0;a<this.f.length;a++)Ph(this,a,!0);Oh(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";Jh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Lh(this)};k.save=function(){return(new O(this)).data()};
k.restore=function(a){return Jh(this,a[0])};function Mh(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=sa(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)){!Oh(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 Lh(this,a[0])};function Oh(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=sa(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)){!Qh(a,g,f,e,!0)&&b&&H(a,!1);continue}a.R("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
function Ih(a,b,c,d){var e=a.G.listDrives,e=e&&ma(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=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Oh(a,e,b,c,!1,d)}else Nh(a,e)} function Kh(a,b,c,d){var e=a.G.listDrives,e=e&&ma(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.R("Unable to load the selected drive");else if(c)if("?"==c)a.R('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Qh(a,e,b,c,!1,d)}else Ph(a,e)}
function Oh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,Nh(a,b,!0),h.ic?a.P("RL11 busy"):(h.ic=!0,e&&(h.hc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Wb=!!f,Bh(new xh(a,h,"preload"),c,d,f,a.Wc)&&g++));return g} function Qh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,Ph(a,b,!0),h.ic?a.R("RL11 busy"):(h.ic=!0,e&&(h.hc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Wb=!!f,Dh(new zh(a,h,"preload"),c,d,f,a.Wc)&&g++));return g}
k.Wc=function(a,b,c,d,e){var f;a.ic=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.xa||f[1]>a.Ca)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.kc)),b=null);b?(a.Ga=b,a.$a=c,a.hb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.kc),a.hc||e),this.C&&this.C.ub()):a.Wb=!1;a.hc&&(a.hc=!1,--this.H||H(this));Hh(this,a.kc)}; k.Wc=function(a,b,c,d,e){var f;a.ic=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ya||f[1]>a.Ca)&&(this.R('Disk "'+c+'" too large for drive '+("RL"+a.kc)),b=null);b?(a.Ga=b,a.$a=c,a.hb=d,this.R('Mounted disk "'+c+'" in drive '+("RL"+a.kc),a.hc||e),this.C&&this.C.ub()):a.Wb=!1;a.hc&&(a.hc=!1,--this.H||H(this));Jh(this,a.kc)};
function Lh(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 Nh(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 Hh(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=ma(a.value,10),c=c.Wb?"?":c.hb,!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 Nh(a,b,c){var d=a.f[b];if(d.Ga||!1===c)d.$a="",d.hb="",d.Ga=null,d.Wb=!1,c||(a.P("Drive RL"+b+" unloaded",c),Hh(a,b))} function Jh(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=ma(a.value,10),c=c.Wb?"?":c.hb,!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 Ph(a,b,c){var d=a.f[b];if(d.Ga||!1===c)d.$a="",d.hb="",d.Ga=null,d.Wb=!1,c||(a.R("Drive RL"+b+" unloaded",c),Jh(a,b))}
function Jh(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.B=b[c++]||0;a.D=b[c++]||0;a.K=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.kc=b;d.ic=d.Wb=!1;d.name=c.ab;d.xa=512;d.Ca=2;d.qa=40;d.Pa=256;d.jc=!0;d.Ye=0;d.Xe=0;d.rc=1;d.Sc=d.qa;d.Ec=d.Pa;d.af=0;d.cf=null;d.Ga||(d.hb="");d.status=29|(512==d.xa?128:0)}return!0} function Lh(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.B=b[c++]||0;a.D=b[c++]||0;a.K=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.kc=b;d.ic=d.Wb=!1;d.name=c.ab;d.ya=512;d.Ca=2;d.ra=40;d.Pa=256;d.jc=!0;d.Ye=0;d.Xe=0;d.rc=1;d.Sc=d.ra;d.Ec=d.Pa;d.af=0;d.cf=null;d.Ga||(d.hb="");d.status=29|(512==d.ya?128:0)}return!0}
k.Uc=function(a,b,c,d,e,f){this.I=f&65535;this.fa=this.fa&-49|f>>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; k.Uc=function(a,b,c,d,e,f){this.I=f&65535;this.fa=this.fa&-49|f>>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0};
k.qd=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ga.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ga.read(m,n++))||0>(r=a.Ga.read(m,n++))){h=5120;break}this.v.ib(f,v|r<<8);if(Gc(this.v)){h=8192;break}f+=2;if(n>=l.Pa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Ca&&(c=0,++b>=l.xa)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.qd=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ga.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ga.read(m,n++))||0>(r=a.Ga.read(m,n++))){h=5120;break}this.v.ib(f,v|r<<8);if(Gc(this.v)){h=8192;break}f+=2;if(n>=l.Pa&&(m=null,++d>=l.ra&&(d=0,++c>=l.Ca&&(c=0,++b>=l.ya)))){h=5120;break}}return g(h,b,c,d,e,f)};
k.ke=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Gc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ga.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ga.write(m,n++,v&255)||!a.Ga.write(m,n++,v>>8)){h=5120;break}if(n>=l.Pa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Ca&&(c=0,++b>=l.xa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Nd=function(){return this.fa&65535}; k.ke=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.oa(f);if(Gc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ga.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ga.write(m,n++,v&255)||!a.Ga.write(m,n++,v>>8)){h=5120;break}if(n>=l.Pa&&(m=null,++d>=l.ra&&(d=0,++c>=l.Ca&&(c=0,++b>=l.ya)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Nd=function(){return this.fa&65535};
k.Fe=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.qd;case 10:b||(b=this.ke),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.xa||f>=c.qa?this.fa|=37888: k.Fe=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.qd;case 10:b||(b=this.ke),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ya||f>=c.ra?this.fa|=37888:
(g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Uc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Ic(this.b,this.O))}};k.Ld=function(){return this.I};k.De=function(a){this.I=a&65534};k.Od=function(){return this.g};k.Ge=function(a){this.g=a};k.Pd=function(){return this.D};k.He=function(a){this.D=a};k.Md=function(){return this.K};k.Ee=function(a){this.K=a&63}; (g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Uc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Ic(this.b,this.P))}};k.Ld=function(){return this.I};k.De=function(a){this.I=a&65534};k.Od=function(){return this.g};k.Ge=function(a){this.g=a};k.Pd=function(){return this.D};k.He=function(a){this.D=a};k.Md=function(){return this.K};k.Ee=function(a){this.K=a&63};
var Ph={},Kh=(Ph[63744]=[null,null,M.prototype.Nd,M.prototype.Fe,"RLCS"],Ph[63746]=[null,null,M.prototype.Ld,M.prototype.De,"RLBA"],Ph[63748]=[null,null,M.prototype.Od,M.prototype.Ge,"RLDA"],Ph[63750]=[null,null,M.prototype.Pd,M.prototype.He,"RLMP"],Ph[63752]=[null,null,M.prototype.Md,M.prototype.Ee,"RLBE"],Ph);function Qh(a){t.call(this,"Debugger",a,Qh);this.ca=a.base||16;this.Ea=!1;this.K=0;this.R=!1;this.B=-1;this.g=[];this.X={}}z(Qh); var Rh={},Mh=(Rh[63744]=[null,null,N.prototype.Nd,N.prototype.Fe,"RLCS"],Rh[63746]=[null,null,N.prototype.Ld,N.prototype.De,"RLBA"],Rh[63748]=[null,null,N.prototype.Od,N.prototype.Ge,"RLDA"],Rh[63750]=[null,null,N.prototype.Pd,N.prototype.He,"RLMP"],Rh[63752]=[null,null,N.prototype.Md,N.prototype.Ee,"RLBE"],Rh);function Sh(a){t.call(this,"Debugger",a,Sh);this.ca=a.base||16;this.Ea=!1;this.K=0;this.S=!1;this.B=-1;this.g=[];this.X={}}z(Sh);
var Rh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Qh.prototype.wc=function(){return-1};Qh.prototype.xc=function(){}; var Th={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Sh.prototype.wc=function(){return-1};Sh.prototype.xc=function(){};
function Sh(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.R?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a} function Uh(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.S?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a}
function Th(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<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 Vh(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 Uh(a,b,c){var d;if(b){b=Vh(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=ya(n);if(!n){f=!0;break}n=Wh(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&&Rh[n]<Rh[l[l.length-1]]&&Th(h,l,1);l.push(n);b=b.substr(v+r)}Th(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Xh(a,null, function Wh(a,b,c){var d;if(b){b=Xh(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=ya(n);if(!n){f=!0;break}n=Yh(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&&Th[n]<Th[l[l.length-1]]&&Vh(h,l,1);l.push(n);b=b.substr(v+r)}Vh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Zh(a,null,
d))}return d}function Vh(a,b){for(var c,d=a.Ea?"(":"{",e=a.Ea?")":"}",f=new RegExp(a.Ea?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Uh(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 Xh(a,b){for(var c,d=a.Ea?"(":"{",e=a.Ea?")":"}",f=new RegExp(a.Ea?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Wh(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 Wh(a,b,c,d){var e;null!=b?(e=a.wc(b),0<=e?e=a.xc(e):(e=a.X[b],null==e&&(e=ma(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e} function Yh(a,b,c,d){var e;null!=b?(e=a.wc(b),0<=e?e=a.xc(e):(e=a.X[b],null==e&&(e=ma(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
function Xh(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+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Yh(a,b){if(b)return Xh(a,b,a.X[b]);var c=0;for(b in a.X)Xh(a,b,a.X[b]),c++;return 0<c} function Zh(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+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function $h(a,b){if(b)return Zh(a,b,a.X[b]);var c=0;for(b in a.X)Zh(a,b,a.X[b]),c++;return 0<c}
function J(a,b,c,d){switch(a.ca){case 8:a=ra(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=na(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 Zh(a){Qh.call(this,a);this.lb=!1;this.Ea=!0;this.L=Y(0);this.mb=Y(0);this.O=Y(0);this.I=[];this.f=this.M=this.D=[];$h(this);this.wa=0;ai(this);this.Ma={};bi(this,a.messages);this.bb=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return xd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return xd(b,a)})}z(Zh,Qh); function ai(a){Sh.call(this,a);this.lb=!1;this.Ea=!0;this.L=Y(0);this.mb=Y(0);this.P=Y(0);this.I=[];this.f=this.M=this.D=[];bi(this);this.xa=0;ci(this);this.Ma={};di(this,a.messages);this.bb=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return yd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return yd(b,a)})}z(ai,Sh);
var ci={"?":"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"},di=".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 ei={"?":"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"},fi=".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(" "),
ei={SP:6,PC:7,PS:20,IR:21,ER:22,SL:23,MMR0:24,MMR1:25,MMR2:26,MMR3:27,AR:28,DR:29,SR:30},fi={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], gi={SP:6,PC:7,PS:20,IR:21,ER:22,SL:23,MMR0:24,MMR1:25,MMR2:26,MMR3:27,AR:28,DR:29,SR:30},hi={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], 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,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], 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]}},gi=[0],hi=[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Zh.prototype; 183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},ii=[0],ji=[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=ai.prototype;
k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.w=a.w;(a=td(a,"messages"))&&bi(this,a);this.wb=fi;this.Ib=1145>this.b.Xa?hi:[];ii(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ji(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Cc[c],n&&d.j(p(n.id,8)+" %"+ k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.w=a.w;(a=ud(a,"messages"))&&di(this,a);this.wb=hi;this.Ib=1145>this.b.Xa?ji:[];Tc(this,64,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ki(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Cc[c],n&&d.j(p(n.id,8)+" %"+
p(e<<d.v.ja,8)+" %%"+p(n.F,8)+" "+p(n.Ub,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=fd&&(c=-1),m=0);a+=d.v.Ba;e++}}});H(this)}; p(e<<d.v.ka,8)+" %%"+p(n.F,8)+" "+p(n.Ub,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=gd&&(c=-1),m=0);a+=d.v.Ba;e++}}});H(this)};
k.ua=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ma=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",xd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.B<d.g.length-1&&(b=d.g[++d.B])):40==a.keyCode&&(0<d.B?b=d.g[--d.B]:(b="",d.B=-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,Ua(c,function(){if(d.ma){var a=d.ma.value; k.va=function(a,b,c){var d=this;switch(b){case "debugInput":return this.na=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",yd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.B<d.g.length-1&&(b=d.g[++d.B])):40==a.keyCode&&(0<d.B?b=d.g[--d.B]:(b="",d.B=-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,Ua(c,function(){if(d.na){var a=d.na.value;
d.ma.value="";xd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ua(c,function(a){var b=!1;wb(d,!0)||(vb(d,!0),b=d.kb(a?1:0,null),vb(d,!1));return b}),!0}return!1};k.ub=function(a){if(this.ma){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ma.focus();!a&&window&&window.scrollTo(b,c)}};k.aa=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Lb=function(a,b){var c=255,d=this.aa(a,!1,1);-1!==d&&(c=a.Xb?this.v.Zb(d):this.b.Zb(d),b&&ki(a,b));return c}; d.na.value="";yd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ua(c,function(a){var b=!1;wb(d,!0)||(vb(d,!0),b=d.kb(a?1:0,null),vb(d,!1));return b}),!0}return!1};k.ub=function(a){if(this.na){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.na.focus();!a&&window&&window.scrollTo(b,c)}};k.aa=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Lb=function(a,b){var c=255,d=this.aa(a,!1,1);-1!==d&&(c=a.Xb?this.v.Zb(d):this.b.Zb(d),b&&li(a,b));return c};
k.na=function(a,b){var c=65535,d=this.aa(a,!1,2);-1!==d&&(c=a.Xb?this.v.fb(d):this.b.fb(d),b&&ki(a,b));return c};k.Eb=function(a,b,c){var d=this.aa(a,!0,1);-1!==d&&(a.Xb?this.v.tb(d,b):this.b.tb(d,b),c&&ki(a,c),this.C.pa(-1))};k.ib=function(a,b,c){var d=this.aa(a,!0,2);-1!==d&&(a.Xb?this.v.Fb(d,b):this.b.Fb(d,b),c&&ki(a,c),this.C.pa(-1))};function Y(a,b){return{F:a,Xb:b,Ra:!1}}k.nc=function(a,b){a.F=b;a.Ra=!1;return a};function li(a){return[a.F,a.Ra]}function mi(a){return{F:a[0],Ra:a[1]}} k.oa=function(a,b){var c=65535,d=this.aa(a,!1,2);-1!==d&&(c=a.Xb?this.v.fb(d):this.b.fb(d),b&&li(a,b));return c};k.Eb=function(a,b,c){var d=this.aa(a,!0,1);-1!==d&&(a.Xb?this.v.tb(d,b):this.b.tb(d,b),c&&li(a,c),this.C.qa(-1))};k.ib=function(a,b,c){var d=this.aa(a,!0,2);-1!==d&&(a.Xb?this.v.Fb(d,b):this.b.Fb(d,b),c&&li(a,c),this.C.qa(-1))};function Y(a,b){return{F:a,Xb:b,Ra:!1}}k.nc=function(a,b){a.F=b;a.Ra=!1;return a};function mi(a){return[a.F,a.Ra]}function ni(a){return{F:a[0],Ra:a[1]}}
function ji(a,b,c){var d,e=(c?a.L:a.mb).F;c=!1;if(void 0!==b){b=Vh(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=Uh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function ni(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Pc=Sh(a,b.Kc=c[2]))}function ki(a,b){null!=a.F&&(a.F+=b||1)} function ki(a,b,c){var d,e=(c?a.L:a.mb).F;c=!1;if(void 0!==b){b=Xh(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=Wh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function oi(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Pc=Uh(a,b.Kc=c[2]))}function li(a,b){null!=a.F&&(a.F+=b||1)}
function bi(a,b){a.i=a;a.ka=a.Tc=536870912;a.ia=null;a.ya=[];b=Sh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Cb){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.ka|=Cb[c],a.j(c+" messages enabled"))}}function ii(a,b){for(var c in Cb)if(64==Cb[c]){a.Ma[c]=b;break}} function di(a,b){a.i=a;a.la=a.Tc=536870912;a.ja=null;a.za=[];b=Uh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Cb){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.la|=Cb[c],a.j(c+" messages enabled"))}}function Tc(a,b,c){for(var d in Cb)if(b==Cb[d]){a.Ma[d]=c;break}}
k.wc=function(a){a=a.toUpperCase();var b=ei[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function oi(a){return 6>a?"R"+a:6==a?"SP":"PC"} k.wc=function(a){a=a.toUpperCase();var b=gi[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function pi(a){return 6>a?"R"+a:6==a?"SP":"PC"}
k.xc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.Za[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=Zc(this.b);break;case 21:b=c.Sb;break;case 22:b=c.ta;break;case 23:b=c.sb;break;case 24:b=Tc(d);break;case 25:b=Vc(d);break;case 26:b=Wc(d);break;case 27:b=d.Ta;break;case 28:d&&(b=d.sa);break;case 29:d&&(b=d.rb);break;case 30:d&&lc(d)&&(b=d.Ya)}}return b}; k.xc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.Za[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=$c(this.b);break;case 21:b=c.Sb;break;case 22:b=c.ua;break;case 23:b=c.sb;break;case 24:b=Uc(c);break;case 25:b=Wc(c);break;case 26:b=Xc(c);break;case 27:b=c.Ta;break;case 28:d&&(b=d.ta);break;case 29:d&&(b=d.rb);break;case 30:d&&lc(d)&&(b=d.Ya)}}return b};
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.oa&65535).F));if(this.ka&1073741824)this.ya.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ka&-2147483648&&this.b&&this.b.A.W||wb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,Bd(a),a.ya=0,a.pa())}}; k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.pa&65535).F));if(this.la&1073741824)this.za.push(a);else if(!this.ja||a!=this.ja){this.ja=a;if(this.la&-2147483648&&this.b&&this.b.A.W||wb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,Cd(a),a.za=0,a.qa())}};
function ai(a){var b;if(!Ee(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.ba=0;a.j("instruction history buffer allocated")}}k.jb=function(a,b){if(!pi(this,b))return!1;this.b.jb(a);return!0}; function ci(a){var b;if(!Fe(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.ba=0;a.j("instruction history buffer allocated")}}k.jb=function(a,b){if(!qi(this,b))return!1;this.b.jb(a);return!0};
k.kb=function(a,b,c){if(!pi(this))return!1;null===b&&(b=!this.yb||"tr"==this.yb);this.K=0;a||Ee(this)&&Fe(this,this.b.u[7],0);try{a=Cd(this.b,a);var d=this.b.kb(a);0<d&&(dc(this.b,d),this.K+=d,ec(this.b,d,!0),fc(this.b,d),this.za++)}catch(e){"number"!=typeof e&&(this.K=0,zb(this.b,e.stack||e.message))}!1!==c&&(this.w&&this.w.stop&&this.w.stop(),this.C.pa(-1));wd(this,b||!1);return 0<this.K};k.da=function(a){this.b&&this.b.da(a)}; k.kb=function(a,b,c){if(!qi(this))return!1;null===b&&(b=!this.yb||"tr"==this.yb);this.K=0;a||Fe(this)&&Ge(this,this.b.u[7],0);try{a=Dd(this.b,a);var d=this.b.kb(a);0<d&&(Sb(this.b,d),this.K+=d,ec(this.b,d,!0),fc(this.b,d),this.Aa++)}catch(e){"number"!=typeof e&&(this.K=0,zb(this.b,e.stack||e.message))}!1!==c&&(this.w&&this.w.stop&&this.w.stop(),this.C.qa(-1));xd(this,b||!1);return 0<this.K};k.da=function(a){this.b&&this.b.da(a)};
function wd(a,b){if(a.lb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.J&8?c.md|c.ld<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Bb[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?qi(a):ri(a)}}function pi(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; function xd(a,b){if(a.lb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.J&8?c.md|c.ld<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Bb[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.T?ri(a):si(a)}}function qi(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
k.Ja=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ai(this);this.za=0;this.ia=null;this.K=0;this.L=Y(this.b.u[7]);this.A.W=!1;si(this);a||wd(this)};k.save=function(){var a=new N(this);a.set(0,li(this.L));a.set(1,li(this.O));a.set(2,[this.g,this.R,this.ka]);a.set(3,this.I);return a.data()}; k.Ja=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ci(this);this.Aa=0;this.ja=null;this.K=0;this.L=Y(this.b.u[7]);this.A.W=!1;ti(this);a||xd(this)};k.save=function(){var a=new O(this);a.set(0,mi(this.L));a.set(1,mi(this.P));a.set(2,[this.g,this.S,this.la]);a.set(3,this.I);return a.data()};
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=mi(a[b++]),this.O=mi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ka|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.A.W=!0;this.Jb=a;this.Kb=b}; k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=ni(a[b++]),this.P=ni(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.S=a[b][1],this.la|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.T||this.j("running");this.A.W=!0;this.Jb=a;this.Kb=b};
k.stop=function(a,b){if(this.A.W){this.A.W=!1;this.K=b-this.Kb;if(!this.S){b="stopped";if(this.K){a-=this.Jb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";Ee(this)&&(b+=this.za+" instructions, ",this.za=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}wd(this,!0);this.ub();si(this,this.b.u[7]);this.ia=null}};function Ee(a){return 1<a.f.length||!!a.wa} k.stop=function(a,b){if(this.A.W){this.A.W=!1;this.K=b-this.Kb;if(!this.T){b="stopped";if(this.K){a-=this.Jb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";Fe(this)&&(b+=this.Aa+" instructions, ",this.Aa=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}xd(this,!0);this.ub();ti(this,this.b.u[7]);this.ja=null}};function Fe(a){return 1<a.f.length||!!a.xa}
function Fe(a,b,c){var d=-1;c||(d=a.b.fb(b),0==d&&(b=Nd(a.b,2)));if(0<c&&(a.wa&&!--a.wa||od(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.za++,0>d&&(d=a.b.fb(b)),65535!=(d&65535)&&(a.nc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Kf(a){var b=a.b;if(b.A.W)throw O(b,a.b.oa&65535),a.da(),-1;return!1} function Ge(a,b,c){var d=-1;c||(d=a.b.fb(b),0==d&&(b=Od(a.b,2)));if(0<c&&(a.xa&&!--a.xa||pd(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.Aa++,0>d&&(d=a.b.fb(b)),65535!=(d&65535)&&(a.nc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Lf(a){var b=a.b;if(b.A.W)throw Q(b,a.b.pa&65535),a.da(),-1;return!1}
function $h(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.aa(c);pd(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.aa(c),pd(d.Y[c>>>d.ja],!0);a.D=["bw"];a.nb=0}k.ob=function(a,b,c){var d=!0;c||ti(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].ob(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Ra=!0:(ui(this,a,a.length-1,"set"),ai(this)));return d}; function bi(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.aa(c);qd(d.Y[c>>>d.ka],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.v,c=a.aa(c),qd(d.Y[c>>>d.ka],!0);a.D=["bw"];a.nb=0}k.ob=function(a,b,c){var d=!0;c||ui(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ka].ob(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Ra=!0:(vi(this,a,a.length-1,"set"),ci(this)));return d};
function ti(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.aa(h)&&(!d||h.Ra)){f=!0;h.Ra||e||ui(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,pd(d.Y[c>>>d.ja],b==a.D));h.Ra||ai(a);break}}return f}function vi(a,b){for(var c=1;c<b.length;c++)ui(a,b,c);return b.length-1}function ui(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Kc?' "'+c.Kc+'"':""))} function ui(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.aa(h)&&(!d||h.Ra)){f=!0;h.Ra||e||vi(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,qd(d.Y[c>>>d.ka],b==a.D));h.Ra||ci(a);break}}return f}function wi(a,b){for(var c=1;c<b.length;c++)vi(a,b,c);return b.length-1}function vi(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Kc?' "'+c.Kc+'"':""))}
function si(a,b){if(void 0!==b)od(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.Ra){if(!ti(a,a.f,c,!0))break;b=0}}} function ti(a,b){if(void 0!==b)pd(a,b,1,a.f,!0),a.T=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Ra){if(!ui(a,a.f,c,!0))break;b=0}}}
function od(a,b,c,d,e){var f=!1;if(!a.nb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Ra)for(var l=a.aa(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Ra&&(ti(a,d,h,!0),e=!0);if(n=h.Pc){for(var f=!1,v=0;v<n.length;v++)if(!wi(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.A.W||(f=!0)}if(f){e||ui(a,d,g,"hit");break}}}a.nb--;return f} function pd(a,b,c,d,e){var f=!1;if(!a.nb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Ra)for(var l=a.aa(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Ra&&(ui(a,d,h,!0),e=!0);if(n=h.Pc){for(var f=!1,v=0;v<n.length;v++)if(!xi(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.A.W||(f=!0)}if(f){e||vi(a,d,g,"hit");break}}}a.nb--;return f}
function xi(a,b,c,d){var e=Y(b.F),f=a.na(b,2),g,h;for(h in a.wb)if(g=a.wb[h][f&h])break;g||(g=gi);var l=g[0];0<=a.Ib.indexOf(l)&&(g=gi,l=g[0]);var m=h="",n=di[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 yi(a,b,c,d){var e=Y(b.F),f=a.oa(b,2),g,h;for(h in a.wb)if(g=a.wb[h][f&h])break;g||(g=ii);var l=g[0];0<=a.Ib.indexOf(l)&&(g=ii,l=g[0]);var m=h="",n=fi[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),
y&63)switch(y=C&7,C&56){case 0:x=oi(y);break;case 8:x="@"+oi(y);break;case 16:7>y?x="("+oi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+oi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+oi(y)+")";break;case 40:x="@-("+oi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+oi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+oi(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); y&63)switch(y=C&7,C&56){case 0:x=pi(y);break;case 8:x="@"+pi(y);break;case 16:7>y?x="("+pi(y)+")+":(C=w.oa(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+pi(y)+")+":(C=w.oa(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+pi(y)+")";break;case 40:x="@-("+pi(y)+")";break;case 48:C=w.oa(r,2);x=J(w,C,0,!0)+"("+pi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.oa(r,2),x="@"+J(w,C)+"("+pi(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]);
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+=xa(f,24);g+=xa(n,5);h&&(g+=" "+h);if(c||m)g=xa(g,60)+";"+(c||""),g=a.b.A.xb?g+("cycles="+yd(a.b).toString()+" cs="+p(a.b.Pb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function yi(a,b){switch(b){case "N":a=Ld(a.b);break;case "Z":a=Kd(a.b);break;case "V":a=Jd(a.b);break;case "C":a=Id(a.b);break;default:a=0}return b.charAt(0)+(a?"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.oa(e,2)),null==e.F)break;while(e.F!=b.F)}g+=xa(f,24);g+=xa(n,5);h&&(g+=" "+h);if(c||m)g=xa(g,60)+";"+(c||""),g=a.b.A.xb?g+("cycles="+zd(a.b).toString()+" cs="+p(a.b.Pb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function zi(a,b){switch(b){case "N":a=Md(a.b);break;case "Z":a=Ld(a.b);break;case "V":a=Kd(a.b);break;case "C":a=Jd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
function Z(a,b){var c="",d=a.b;if(8>b)c=oi(b),c+="="+J(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+J(a,d.Za[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+J(a,d.La[b-16]);else switch(b){case 20:c="PS="+J(a,Zc(d));break;case 21:c="IR="+J(a,d.Sb);break;case 22:c="ER="+J(a,d.ta);break;case 23:c="SL="+J(a,d.sb);break;case 24:c="MMR0="+J(a,Tc(d));break;case 25:c="MMR1="+J(a,Vc(d));break;case 26:c="MMR2="+J(a,Wc(d));break;case 27:c="MMR3="+J(a,d.Ta);break;case 28:a.w&&(c="AR="+J(a,a.w.sa,3));break;case 29:a.w&& function Z(a,b){var c="",d=a.b;if(8>b)c=pi(b),c+="="+J(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+J(a,d.Za[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+J(a,d.La[b-16]);else switch(b){case 20:c="PS="+J(a,$c(d));break;case 21:c="IR="+J(a,d.Sb);break;case 22:c="ER="+J(a,d.ua);break;case 23:c="SL="+J(a,d.sb);break;case 24:c="MMR0="+J(a,Uc(d));break;case 25:c="MMR1="+J(a,Wc(d));break;case 26:c="MMR2="+J(a,Xc(d));break;case 27:c="MMR3="+J(a,d.Ta);break;case 28:a.w&&(c="AR="+J(a,a.w.ta,3));break;case 29:a.w&&
(c="DR="+J(a,a.w.rb));break;case 30:a.w&&lc(a.w)&&(c="SR="+J(a,a.w.Ya,3))}c&&(c+=" ");return c}function zi(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=yi(a,"T")+yi(a,"N")+yi(a,"Z")+yi(a,"V")+yi(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.sc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0}; (c="DR="+J(a,a.w.rb));break;case 30:a.w&&lc(a.w)&&(c="SR="+J(a,a.w.Ya,3))}c&&(c+=" ");return c}function Ai(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=zi(a,"T")+zi(a,"N")+zi(a,"Z")+zi(a,"V")+zi(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.sc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function ah(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=Aa(n,l,a.sc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({bf:b,F:c,Zc:d,ga:e,qc:f})}function Ai(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.F>>>0,h=f.Zc;if(e>=g&&e<g+h){e=Aa(f.qc,[e-g],a.sc);0<=e?Bi(a,b,e,d):c&&(e=~e,Bi(a,b,e-1,d),Bi(a,b,e,d));break}}return d} function ch(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=Aa(n,l,a.sc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({bf:b,F:c,Zc:d,ga:e,qc:f})}function Bi(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.F>>>0,h=f.Zc;if(e>=g&&e<g+h){e=Aa(f.qc,[e-g],a.sc);0<=e?Ci(a,b,e,d):c&&(e=~e,Ci(a,b,e-1,d),Ci(a,b,e,d));break}}return d}
function Bi(a,b,c,d){var e={},f=a.I[b].qc,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 Ci(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Yh(a)||a.j("no variables"),!0;if(!c[2])return Yh(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Uh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1} function Ci(a,b,c,d){var e={},f=a.I[b].qc,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 Di(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return $h(a)||a.j("no variables"),!0;if(!c[2])return $h(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Wh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
function Di(a,b,c){var d=null;if(b=ji(a,b,!0)){a.aa(b);var e=Ai(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 Ei(a,b,c){var d=null;if(b=ki(a,b,!0)){a.aa(b);var e=Bi(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 qi(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trm\tdump misc registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.b;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}g=Uh(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.u[6]=g&65535;break;case "PC":case "R7":O(e, function ri(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trm\tdump misc registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.b;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}g=Wh(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.u[6]=g&65535;break;case "PC":case "R7":Q(e,
g);a.L=Y(e.u[7]);break;case "N":e.Z=g?32768:0;break;case "Z":e.$=g?0:1;break;case "V":e.U=g?32768:0;break;case "C":e.T=g?65536:0;break;case "PS":$c(e,g);break;case "IR":Yc(e,g);break;case "ER":e.ta=g;d=!0;break;case "SL":e.sb=g|255;break;case "MMR0":Uc(e,g);d=!0;break;case "MMR3":Xc(e,g);d=!0;break;case "AR":a.w&&(d=a.w,ic(d,d.sa=g));d=!0;break;case "DR":a.w&&(d=a.w,hc(d,d.rb=g));d=!0;break;case "SR":if(a.w&&lc(a.w)){jc(a.w,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.u[b]= g);a.L=Y(e.u[7]);break;case "N":e.Z=g?32768:0;break;case "Z":e.$=g?0:1;break;case "V":e.V=g?32768:0;break;case "C":e.U=g?65536:0;break;case "PS":ad(e,g);break;case "IR":Zc(e,g);break;case "ER":e.ua=g;d=!0;break;case "SL":e.sb=g|255;break;case "MMR0":Vc(e,g);d=!0;break;case "MMR3":Yc(e,g);d=!0;break;case "AR":a.w&&(d=a.w,ic(d,d.ta=g));d=!0;break;case "DR":a.w&&(d=a.w,hc(d,d.rb=g));d=!0;break;case "SR":if(a.w&&lc(a.w)){jc(a.w,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.u[b]=
g&65535;break}a.j("unknown register: "+f);return}a.C.pa();a.j("updated registers:")}}a.j(zi(a,d));c&&(a.L=Y(e.u[7]),ri(a,J(a,a.L.F)))}}function Ei(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Xh(a,null,c[2].charCodeAt(0)):Uh(a,b,!0)} g&65535;break}a.j("unknown register: "+f);return}a.C.qa();a.j("updated registers:")}}a.j(Ai(a,d));c&&(a.L=Y(e.u[7]),si(a,J(a,a.L.F)))}}function Fi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Zh(a,null,c[2].charCodeAt(0)):Wh(a,b,!0)}
function Fi(a,b,c){if("?"==c)a.j("trace commands:"),a.j("\tt [#]\ttrace # instructions"),a.j("\ttr [#]\ttrace # instructions with register updates"),a.j("\ttc [#]\ttrace # cycles"),a.j("note: bn [#] to break after # instructions is much faster");else{var d="t"!=b;c=Wh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);a.yb=b;Ta(c,function(){return vb(a,!0)&&a.kb(e,d,!1)},function(){a.w&&a.w.stop&&a.w.stop();a.C.pa(-1);vb(a,!1)})}} function Gi(a,b,c){if("?"==c)a.j("trace commands:"),a.j("\tt [#]\ttrace # instructions"),a.j("\ttr [#]\ttrace # instructions with register updates"),a.j("\ttc [#]\ttrace # cycles"),a.j("note: bn [#] to break after # instructions is much faster");else{var d="t"!=b;c=Yh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);a.yb=b;Ta(c,function(){return vb(a,!0)&&a.kb(e,d,!1)},function(){a.w&&a.w.stop&&a.w.stop();a.C.qa(-1);vb(a,!1)})}}
function ri(a,b,c,d){if(b=ji(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Wh(a,c.substr(1)),null!=c&&(d=c);else{d=ji(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=wb(a,!1)||a.S?a.K:null;var g=null!=f?"cycles":null,h=Ai(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=xi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} function si(a,b,c,d){if(b=ki(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Yh(a,c.substr(1)),null!=c&&(d=c);else{d=ki(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=wb(a,!1)||a.T?a.K:null;var g=null!=f?"cycles":null,h=Bi(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=yi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
function wi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(xb(a)&&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 xi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.S&&(a.j("ended assemble at "+J(a,a.P.F)),a.L=a.P,a.S=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ja=null;if(xb(a)&&0<b.length){a.S&&(b="a "+J(a,a.P.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=
ji(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.pa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.Eb(v,r[w],1);a.j(xi(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 [#]\tset exec breakpoint at addr #"),a.j("\tbr [#]\tset read breakpoint at addr #"),a.j("\tbw [#]\tset write breakpoint at addr #"),a.j("\tbc [#]\tclear breakpoint at addr #"),a.j("\tbl\tlist all breakpoints"), ki(a,g[1],!0);if(v)if(a.P=v,void 0===g[2])a.j("begin assemble at "+J(a,v.F)),a.S=!0,a.C.qa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.Eb(v,r[w],1);a.j(yi(a,a.P))}}break;case "b":a:{var y=g[0],x=g[1],C=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [#]\tset exec breakpoint at addr #"),a.j("\tbr [#]\tset read breakpoint at addr #"),a.j("\tbw [#]\tset write breakpoint at addr #"),a.j("\tbc [#]\tclear breakpoint at addr #"),a.j("\tbl\tlist all breakpoints"),
a.j("\tbn [#]\tbreak after # instruction(s)");else{var ka=y.charAt(1);if("l"==ka){var La;La=0+vi(a,a.f);La+=vi(a,a.M);(La+=vi(a,a.D))||a.j("no breakpoints")}else if("n"==ka)a.wa=Wh(a,x),a.j("break after "+a.wa+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=ji(a,x,!0),!P))break a;"c"==ka?null==P.F?($h(a),a.j("all breakpoints cleared")):ti(a,a.f,P)||ti(a,a.M,P)||ti(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(ni(a,P,C),"p"==ka?a.ob(a.f, a.j("\tbn [#]\tbreak after # instruction(s)");else{var la=y.charAt(1);if("l"==la){var Ma;Ma=0+wi(a,a.f);Ma+=wi(a,a.M);(Ma+=wi(a,a.D))||a.j("no breakpoints")}else if("n"==la)a.xa=Yh(a,x),a.j("break after "+a.xa+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=ki(a,x,!0),!P))break a;"c"==la?null==P.F?(bi(a),a.j("all breakpoints cleared")):ui(a,a.f,P)||ui(a,a.M,P)||ui(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(oi(a,P,C),"p"==la?a.ob(a.f,
P):"r"==ka?a.ob(a.M,P):"w"==ka?a.ob(a.D,P):a.j("unknown breakpoint command: "+ka))}}}break;case "c":a.Va&&(a.Va.value="");break;case "d":a:{var jb,Na=g[0],na=g[1],Oa=g[2],Yi=g[3];if("?"==na){var kb="";for(jb in Cb)a.Ma[jb]&&(kb&&(kb+=","),kb+=jb);kb+=",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"); P):"r"==la?a.ob(a.M,P):"w"==la?a.ob(a.D,P):a.j("unknown breakpoint command: "+la))}}}break;case "c":a.Va&&(a.Va.value="");break;case "d":a:{var kb,Oa=g[0],oa=g[1],Pa=g[2],Zi=g[3];if("?"==oa){var lb="";for(kb in Cb)a.Ma[kb]&&(lb&&(lb+=","),lb+=kb);lb+=",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");
kb.length&&a.j("dump extension commands:\n\t"+kb)}else if("state"==na){var Ig=Gi(a.C,!0);"console"==Oa?console.log(Ig):(a.Va&&(a.Va.value=""),a.j(Ig))}else if("symbols"==na)for(var Pd=0;Pd<a.I.length;Pd++){var Qd=a.I[Pd],lb;for(lb in Qd.ga)if("."!=lb.charAt(0)){var Jg=Qd.ga[lb].o;if(void 0!==Jg){var Kg=Qd.ga[lb].l;Kg&&(lb=Kg);a.j(J(a,Jg)+" "+lb)}}}else{if("d"==Na){for(jb in Cb)if(g[1]==jb){var Lg=a.Ma[jb];Lg?(g.shift(),g.shift(),Lg(g)):a.j("no dump registered for "+na);break a}na||(Na=a.Mb||"dw")}else a.Mb= lb.length&&a.j("dump extension commands:\n\t"+lb)}else if("state"==oa){var Kg=Hi(a.C,!0);"console"==Pa?console.log(Kg):(a.Va&&(a.Va.value=""),a.j(Kg))}else if("symbols"==oa)for(var Qd=0;Qd<a.I.length;Qd++){var Rd=a.I[Qd],mb;for(mb in Rd.ga)if("."!=mb.charAt(0)){var Lg=Rd.ga[mb].o;if(void 0!==Lg){var Mg=Rd.ga[mb].l;Mg&&(mb=Mg);a.j(J(a,Lg)+" "+mb)}}}else{if("d"==Oa){for(kb in Cb)if(g[1]==kb){var Ng=a.Ma[kb];Ng?(g.shift(),g.shift(),Ng(g)):a.j("no dump registered for "+oa);break a}oa||(Oa=a.Mb||"dw")}else a.Mb=
Na;if("dh"==Na){var Mg=na,Ng=Oa,Og="",Pg=0,ga=a.ba,oa=a.H;if(oa.length){var aa=+Mg||a.pb,Sb=+Ng||10;isNaN(aa)?aa=Sb:Og="more ";aa>oa.length&&(a.j("note: only "+oa.length+" available"),aa=oa.length);ga-=aa;0>ga&&(null==oa[oa.length-1].F?(aa=ga+aa,ga=0):ga+=oa.length);var Rd=[];"call"==Ng&&(Sb=1E5,Rd=["CALL"]);for(void 0!==Mg&&a.j(aa+" instructions earlier:");0<Sb&&ga!=a.ba;){var Qg=oa[ga++];if(null==Qg.F)break;var Tb=Y(Qg.F),Zi=aa--,Rg=xi(a,Tb,"history",Zi);(!Rd.length||0<=Rg.indexOf(Rd[0]))&&a.j(Rg); Oa;if("dh"==Oa){var Og=oa,Pg=Pa,Qg="",Rg=0,ha=a.ba,pa=a.H;if(pa.length){var ba=+Og||a.pb,Tb=+Pg||10;isNaN(ba)?ba=Tb:Qg="more ";ba>pa.length&&(a.j("note: only "+pa.length+" available"),ba=pa.length);ha-=ba;0>ha&&(null==pa[pa.length-1].F?(ba=ha+ba,ha=0):ha+=pa.length);var Sd=[];"call"==Pg&&(Tb=1E5,Sd=["CALL"]);for(void 0!==Og&&a.j(ba+" instructions earlier:");0<Tb&&ha!=a.ba;){var Sg=pa[ha++];if(null==Sg.F)break;var Ub=Y(Sg.F),$i=ba--,Tg=yi(a,Ub,"history",$i);(!Sd.length||0<=Tg.indexOf(Sd[0]))&&a.j(Tg);
Tb.fc&&(ga+=Tb.fc,Sb-=Tb.fc,aa-=Tb.fc);ga>=oa.length&&(ga=0);a.pb=aa;Pg++;Sb--}}Pg||(a.j("no "+Og+"history available"),a.pb=void 0)}else{var mb=ji(a,na);if(mb){var Ub=0,Sd=!1,Td="ds"==Na;Oa&&(Sd=!0,"l"==Oa.charAt(0)&&(Sd=!1,Oa=Oa.substr(1)||Yi),Ub=Wh(a,Oa)>>>0,65536<Ub&&(Ub=65536));for(var nb="dd"==Na?4:"db"==Na?1:2,Jc=(Sd?Ub-mb.F:nb*Ub)||128,Ud=Td?16:a.ca,$i=(Jc+Ud-1)/Ud|0||1,Pa="";$i--&&0<Jc;){for(var Qa="",Vd="",na=J(a,mb.F),Kc=Ud,Vb=0,Wb=0;0<Kc&&0<Jc;){var ob=1,Lc=1==nb?a.Lb(mb,ob):a.na(mb,ob= Ub.fc&&(ha+=Ub.fc,Tb-=Ub.fc,ba-=Ub.fc);ha>=pa.length&&(ha=0);a.pb=ba;Rg++;Tb--}}Rg||(a.j("no "+Qg+"history available"),a.pb=void 0)}else{var nb=ki(a,oa);if(nb){var Vb=0,Td=!1,Ud="ds"==Oa;Pa&&(Td=!0,"l"==Pa.charAt(0)&&(Td=!1,Pa=Pa.substr(1)||Zi),Vb=Yh(a,Pa)>>>0,65536<Vb&&(Vb=65536));for(var ob="dd"==Oa?4:"db"==Oa?1:2,Kc=(Td?Vb-nb.F:ob*Vb)||128,Vd=Ud?16:a.ca,aj=(Kc+Vd-1)/Vd|0||1,Qa="";aj--&&0<Kc;){for(var Ra="",Wd="",oa=J(a,nb.F),Lc=Vd,Wb=0,Xb=0;0<Lc&&0<Kc;){var pb=1,Mc=1==ob?a.Lb(nb,pb):a.oa(nb,pb=
2),Vb=Vb|Lc<<(Wb<<3),Wb=Wb+ob;Wb==nb&&(Td?(Qa&&(Qa+=","),Qa+="0x"+p(Vb,2*nb)):(Qa+=J(a,Vb,nb),Qa+=1==nb?9==Kc?"-":" ":" "),Vb=Wb=0);Kc-=ob;for(Jc-=ob;ob--;)var Wd=Lc&255,Vd=Vd+(32<=Wd&&128>Wd?String.fromCharCode(Wd):"."),Lc=Lc>>8}Pa&&(Pa+="\n");Pa=Td?Pa+(Qa+","):Pa+(na+" "+Qa+(0==Kc?" "+Vd:""))}Pa&&a.j(Pa);a.mb=mb}}}}break;case "e":if("else"==g[0])break;var pb,Xd,Yd,Zd,$d=g[0],ae=g[1];"eb"==$d?(pb=1,Xd=255,Yd=a.Lb,Zd=a.Eb):"e"==$d||"ew"==$d?(pb=2,Xd=65535,Yd=a.na,Zd=a.ib):ae=null;if(null==ae)a.j("edit memory commands:"), 2),Wb=Wb|Mc<<(Xb<<3),Xb=Xb+pb;Xb==ob&&(Ud?(Ra&&(Ra+=","),Ra+="0x"+p(Wb,2*ob)):(Ra+=J(a,Wb,ob),Ra+=1==ob?9==Lc?"-":" ":" "),Wb=Xb=0);Lc-=pb;for(Kc-=pb;pb--;)var Xd=Mc&255,Wd=Wd+(32<=Xd&&128>Xd?String.fromCharCode(Xd):"."),Mc=Mc>>8}Qa&&(Qa+="\n");Qa=Ud?Qa+(Ra+","):Qa+(oa+" "+Ra+(0==Lc?" "+Wd:""))}Qa&&a.j(Qa);a.mb=nb}}}}break;case "e":if("else"==g[0])break;var qb,Yd,Zd,$d,ae=g[0],be=g[1];"eb"==ae?(qb=1,Yd=255,Zd=a.Lb,$d=a.Eb):"e"==ae||"ew"==ae?(qb=2,Yd=65535,Zd=a.oa,$d=a.ib):be=null;if(null==be)a.j("edit memory commands:"),
a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Mc=ji(a,ae);if(Mc)for(var Nc=2;Nc<g.length;Nc++){var Xb=Uh(a,g[Nc]);if(void 0===Xb){a.j("unrecognized value: "+g[Nc]);break}Xb&~Xd&&a.j("warning: "+p(Xb)+" exceeds "+pb+"-byte value");a.j("changing "+J(a,Mc.F)+(F(a,64)?"":" from "+J(a,Yd.call(a,Mc),pb))+" to "+J(a,Xb,pb));Zd.call(a,Mc,Xb,pb)}}break;case "g":a:{var Sg=g[1],aj=b;if(void 0!==Sg){var be=ji(a,Sg,!0);if(!be)break a;ni(a,be,aj);a.ob(a.f, a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Nc=ki(a,be);if(Nc)for(var Oc=2;Oc<g.length;Oc++){var Yb=Wh(a,g[Oc]);if(void 0===Yb){a.j("unrecognized value: "+g[Oc]);break}Yb&~Yd&&a.j("warning: "+p(Yb)+" exceeds "+qb+"-byte value");a.j("changing "+J(a,Nc.F)+(F(a,64)?"":" from "+J(a,Zd.call(a,Nc),qb))+" to "+J(a,Yb,qb));$d.call(a,Nc,Yb,qb)}}break;case "g":a:{var Ug=g[1],bj=b;if(void 0!==Ug){var ce=ki(a,Ug,!0);if(!ce)break a;oi(a,ce,bj);a.ob(a.f,
be,!0)}a.jb(!0,c)}break;case "h":a.A.W?(c||a.j("halting"),a.da()):wb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var ce;var Yb=b.substr(2),Yb=ya(Yb);Uh(a,Yb)?(c||a.j("true: "+Yb),ce=!0):(c||a.j("false: "+Yb),ce=!1);ce||(d=!1);break}f=!0;break;case "k":var bj=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var de=0,ee=Y(),Zb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Zb.F));10>de;){for(var Ra=null,cj=256;65536> ce,!0)}a.jb(!0,c)}break;case "h":a.A.W?(c||a.j("halting"),a.da()):wb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var de;var Zb=b.substr(2),Zb=ya(Zb);Wh(a,Zb)?(c||a.j("true: "+Zb),de=!0):(c||a.j("false: "+Zb),de=!1);de||(d=!1);break}f=!0;break;case "k":var cj=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var ee=0,fe=Y(),$b=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,$b.F));10>ee;){for(var Sa=null,dj=256;65536>
Zb.F>>>0;){ee.F=a.na(Zb,2);if(null==Zb.F||!cj--)break;if(!(ee.F&1)){for(var dj=a,Oc=ee,Tg=null,$b=Oc.F,Ug=$b,fe=1;6>=fe&&$b;fe++){if(2<fe){Oc.F=$b;var Pc=xi(dj,Oc);if(0<=Pc.indexOf("JSR")){var Vg=Pc.indexOf(" ");if($b+(Pc.indexOf(" ",Vg+1)-Vg-1)/2==Ug){Tg=Pc;break}}}$b-=2}Oc.F=Ug;if(Ra=Tg)break}}if(!Ra||null==Ra)break;var Wg=null;if("ks"==bj){var Xg=Ra.match(/[0-9A-F]+$/);Xg&&(Wg=Di(a,Xg[0]))}Ra=xa(Ra,50)+" ;"+(Wg||"stack="+J(a,Zb.F));a.j(Ra);de++}de||a.j("no return addresses found")}break;case "l":if("ln"== $b.F>>>0;){fe.F=a.oa($b,2);if(null==$b.F||!dj--)break;if(!(fe.F&1)){for(var ej=a,Pc=fe,Vg=null,ac=Pc.F,Wg=ac,ge=1;6>=ge&&ac;ge++){if(2<ge){Pc.F=ac;var Qc=yi(ej,Pc);if(0<=Qc.indexOf("JSR")){var Xg=Qc.indexOf(" ");if(ac+(Qc.indexOf(" ",Xg+1)-Xg-1)/2==Wg){Vg=Qc;break}}}ac-=2}Pc.F=Wg;if(Sa=Vg)break}}if(!Sa||null==Sa)break;var Yg=null;if("ks"==cj){var Zg=Sa.match(/[0-9A-F]+$/);Zg&&(Yg=Ei(a,Zg[0]))}Sa=xa(Sa,50)+" ;"+(Yg||"stack="+J(a,$b.F));a.j(Sa);ee++}ee||a.j("no return addresses found")}break;case "l":if("ln"==
g[0]){Di(a,g[1],!0);break}f=!0;break;case "m":a:{var pa,qa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Da=0;if("all"==G)Da=1878917119,G=null;else if("on"==G)qa=!0,G=null;else if("off"==G)qa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(pa in Cb)if(G==pa){Da=Cb[pa];qa=!!(a.ka&Da);break}if(!Da){a.j("unknown message category: "+G);break a}}if(Da)if("on"==g[2])a.ka|=Da,qa=!0;else if("off"==g[2]&&(a.ka&=~Da,qa=!1,1073741824==Da)){for(var ge=0;ge<a.ya.length;ge++)a.j(a.ya[ge]); g[0]){Ei(a,g[1],!0);break}f=!0;break;case "m":a:{var qa,ra=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Fa=0;if("all"==G)Fa=1878917119,G=null;else if("on"==G)ra=!0,G=null;else if("off"==G)ra=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(qa in Cb)if(G==qa){Fa=Cb[qa];ra=!!(a.la&Fa);break}if(!Fa){a.j("unknown message category: "+G);break a}}if(Fa)if("on"==g[2])a.la|=Fa,ra=!0;else if("off"==g[2]&&(a.la&=~Fa,ra=!1,1073741824==Fa)){for(var he=0;he<a.za.length;he++)a.j(a.za[he]);
a.ya=[]}}var ej=0,ac="";for(pa in Cb)if(!G||G==pa){var fj=!!(a.ka&Cb[pa]);if(null===qa||qa==fj)ac&&(ac+=","),++ej%10||(ac+="\n\t"),"key"==pa&&(pa="keys"),ac+=pa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==qa?qa?"messages on: ":"messages off: ":"message categories:\n\t")+(ac||"none"));ai(a)}break;case "p":if("print"==g[0]){Ei(a,b.substr(5));break}var gj="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Yg=Y(a.b.u[7]);a.Lb(Yg);a.S?(a.ob(a.f, a.za=[]}}var fj=0,bc="";for(qa in Cb)if(!G||G==qa){var gj=!!(a.la&Cb[qa]);if(null===ra||ra==gj)bc&&(bc+=","),++fj%10||(bc+="\n\t"),"key"==qa&&(qa="keys"),bc+=qa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==ra?ra?"messages on: ":"messages off: ":"message categories:\n\t")+(bc||"none"));ci(a)}break;case "p":if("print"==g[0]){Fi(a,b.substr(5));break}var hj="pr"==g[0]?1:0;if(a.T)a.j("step in progress");else{var $g=Y(a.b.u[7]);a.Lb($g);a.T?(a.ob(a.f,
Yg,!0),a.jb()||(a.C&&a.C.ub(),a.S=0)):Fi(a,gj?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}qi(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var bc=+g[2];if(8==bc||10==bc||16==bc)a.ca=bc;else{a.j("invalid base: "+bc);break}}a.j("default base: "+a.ca);break;case "cs":var cc;void 0!==g[3]&&(cc=+g[3]);switch(g[2]){case "int":a.b.zb=cc;break;case "start":a.b.Qb=cc;break;case "stop":a.b.Ab=cc;break;default:a.j("unknown cs option");break a}void 0!==cc&&vd(a.b);a.j("checksums "+ $g,!0),a.jb()||(a.C&&a.C.ub(),a.T=0)):Gi(a,hj?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}ri(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var cc=+g[2];if(8==cc||10==cc||16==cc)a.ca=cc;else{a.j("invalid base: "+cc);break}}a.j("default base: "+a.ca);break;case "cs":var dc;void 0!==g[3]&&(dc=+g[3]);switch(g[2]){case "int":a.b.zb=dc;break;case "start":a.b.Qb=dc;break;case "stop":a.b.Ab=dc;break;default:a.j("unknown cs option");break a}void 0!==dc&&wd(a.b);a.j("checksums "+
(a.b.A.xb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(zd(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.qb.toFixed(2)+"Mhz")+" ("+a.b.gb+"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.b.A.xb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Ad(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.qb.toFixed(2)+"Mhz")+" ("+a.b.gb+"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":Fi(a,g[0],g[1]);break;case "u":ri(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Ci(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.Xa+",RELEASE"+(Ab?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){Ei(a,b.substr(1));break}var he="commands:",ie;for(ie in ci)he+="\n"+xa(ie,9)+ci[ie];Ee(a)||(he+="\nnote: history disabled if no exec breakpoints");a.j(he); a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":Gi(a,g[0],g[1]);break;case "u":si(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Di(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.Xa+",RELEASE"+(Ab?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){Fi(a,b.substr(1));break}var ie="commands:",je;for(je in ei)ie+="\n"+xa(je,9)+ei[je];Fe(a)||(ie+="\nnote: history disabled if no exec breakpoints");a.j(ie);
break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Zg){a.j("debugger error: "+(Zg.stack||Zg.message)),d=!1}return d}function xd(a,b,c){b=Sh(a,b,c);for(var d in b)if(!wi(a,b[+d]))return!1;return!0}$a(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Zh(d);B(d,c)}}); break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(ah){a.j("debugger error: "+(ah.stack||ah.message)),d=!1}return d}function yd(a,b,c){b=Uh(a,b,c);for(var d in b)if(!xi(a,b[+d]))return!1;return!0}$a(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new ai(d);B(d,c)}});
function Hi(a,b,c){t.call(this,"Computer",a,Hi,67108864);this.A.ha=!1;Ii(this,b);this.L=td(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Ji;this.I=null;this.D=this.R=!1;this.ba=td(this,"url")||"";(Math.random()+.1).toString(36);this.g=Ki(this);if(this.b=ub("CPU",this.id)){this.i=ub("Debugger",this.id);this.v=new nc({id:this.Ua+".bus",busWidth:this.X},this.b,this.i);var d,e=sb(this.id);if((this.w=ub("Panel",this.id))&&this.w.Va)for(b=0;b<e.length;b++)d=e[b],d.P=this.w.P,d.j=this.w.j, function Ii(a,b,c){t.call(this,"Computer",a,Ii,67108864);this.A.ia=!1;Ji(this,b);this.L=ud(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Ki;this.I=null;this.D=this.S=!1;this.ba=ud(this,"url")||"";(Math.random()+.1).toString(36);this.g=Li(this);if(this.b=ub("CPU",this.id)){this.i=ub("Debugger",this.id);this.v=new nc({id:this.Ua+".bus",busWidth:this.X},this.b,this.i);var d,e=sb(this.id);if((this.w=ub("Panel",this.id))&&this.w.Va)for(b=0;b<e.length;b++)d=e[b],d.R=this.w.R,d.j=this.w.j,
d.Va=this.w.Va;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.Ia&&d.Ia(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=td(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Ji),this.f&&(this.K= d.Va=this.w.Va;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.Ia&&d.Ia(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=ud(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Ki),this.f&&(this.K=
new N(this,"1.30.3"),Li(this.K)?b=null:delete this.K);!b&&this.f&&(b=Mi(this))&&(this.D=!0);if(b){var g=this;Ea(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?": "+ya(b):"")+")")):(g.I=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Ni(this,this.Rb)}else q("Unable to find CPU component")}z(Hi);var Ji=0; new O(this,"1.30.3"),Mi(this.K)?b=null:delete this.K);!b&&this.f&&(b=Ni(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.R("Unable to load machine state from server (error "+c+(b?": "+ya(b):"")+")")):(g.I=b,g.S=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Oi(this,this.Rb)}else q("Unable to find CPU component")}z(Ii);var Ki=0;
function Ii(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 td(a,b,c){var d=b.toLowerCase(),d=eb[b]||eb[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 Ni(a,b,c){for(var d=sb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!xb(f)){xb(f,function(){Ni(a,b,c)});return}}b.call(a,c)} function Ji(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.T=b}function ud(a,b,c){var d=b.toLowerCase(),d=eb[b]||eb[d];void 0===d&&a.T&&(d=a.T[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Oi(a,b,c){for(var d=sb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!xb(f)){xb(f,function(){Oi(a,b,c)});return}}b.call(a,c)}
function Oi(a,b){var c=new N(a,"1.30.3","validate");if(Li(c)&&Pi(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=Hi.prototype; function Pi(a,b){var c=new O(a,"1.30.3","validate");if(Mi(c)&&Qi(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.R("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Ii.prototype;
k.Rb=function(a){void 0===a&&(a=this.f||(this.I?1:Ji));if(!this.C){this.C++;var b=!1,c=!1;this.O=!1;var d=this.K||new N(this,"1.30.3");if(-1==a)b=!0;else if(a>Ji){if(Li(d,this.I)){this.B=new N(this,"1.30.3","failsafe");Li(this.B)&&(Qi(this,d),a=2,Ri(this.B));this.B.set("timestamp",Ca());Si(this.B);var e=this.f&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Pi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Li(d,g):("error"== k.Rb=function(a){void 0===a&&(a=this.f||(this.I?1:Ki));if(!this.C){this.C++;var b=!1,c=!1;this.P=!1;var d=this.K||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Ki){if(Mi(d,this.I)){this.B=new O(this,"1.30.3","failsafe");Mi(this.B)&&(Ri(this,d),a=2,Si(this.B));this.B.set("timestamp",Ca());Ti(this.B);var e=this.f&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Qi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Mi(d,g):("error"==
f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Ma("user",""),this.g=null)):this.j(f+": "+g),Ri(d),Li(d)?(c=Pi(d),e=!0):c=!1))}e&&Oi(this,c?d:null)}else 2==a&&d.clear()}else Oi(this);delete this.I;delete this.K}e=sb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Ti(this,g,d,b,c));b=[d,a,c];-1!=a?Ni(this,this.tc,b):this.tc(b)}}; f&&"no machine state"!=g?(this.R("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.j(f+": "+g),Si(d),Mi(d)?(c=Qi(d),e=!0):c=!1))}e&&Pi(this,c?d:null)}else 2==a&&d.clear()}else Pi(this);delete this.I;delete this.K}e=sb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Ui(this,g,d,b,c));b=[d,a,c];-1!=a?Oi(this,this.tc,b):this.tc(b)}};
function Ti(a,b,c,d,e){if(!b.A.ha){b.A.ha=!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&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.f=Ji,window&&window.location.reload()):a.O=!0,b.Ka(null),e=!1)}if(!d&&b.Bc)for(a=b.Bc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} function Ui(a,b,c,d,e){if(!b.A.ia){b.A.ia=!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&&(q("Unable to restore state for "+b.type),a.M&&!a.S?(c.clear(),a.f=Ki,window&&window.location.reload()):a.P=!0,b.Ka(null),e=!1)}if(!d&&b.Bc)for(a=b.Bc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
k.tc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.A.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ti(this,this.b,b,c,a),this.pa(),this.b.vb());this.O&&(Qi(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0}; k.tc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ui(this,this.b,b,c,a),this.qa(),this.b.vb());this.P&&(Ri(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0};
function Qi(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} function Ri(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}}
function Gi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.da(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ha=!1,!1===d&&(e=null)));for(var h=sb(a.id),l=0;l<h.length;l++){var m=h[l];m.A.ha&&(m.Ja&&(d=m.Ja(b,c),"object"===typeof d&&f.set(m.id, function Hi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.da(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=sb(a.id),l=0;l<h.length;l++){var m=h[l];m.A.ia&&(m.Ja&&(d=m.Ja(b,c),"object"===typeof d&&f.set(m.id,
d)),c&&(m.A.ha=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Ui(a,a.g,f.toString()),Si(g)&&Si(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.A.ha=!1,b=a.G.power)&&(b.textContent="Power");a.C=0;return e} d)),c&&(m.A.ia=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Vi(a,a.g,f.toString()),Ti(g)&&Ti(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.A.ia=!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=sb(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.pa(-1)};k.start=function(a,b){for(var c=sb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.pa(-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=sb(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.qa(-1)};k.start=function(a,b){for(var c=sb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.qa(-1)};
k.stop=function(a,b){for(var c=sb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.pa(-1)}; k.stop=function(a,b){for(var c=sb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.qa(-1)};
k.pa=function(a){if(this.b){var b=this.b,c=a||0,d=b.G.speed;d&&(0>=c||30<=(b.wb+=c))&&(d.textContent=b.A.W?b.ma.toFixed(2)+"Mhz":"Stopped",b.wb=0)}if(this.w&&(b=this.w,a=a||0,b.D)){c=b.b.A.W;d=!!(b.b.J&4);if(0>=a||60<=(b.B+=a)){for(var e=0;e<b.b.u.length;e++)Qb(b,"R"+e,b.b.u[e]);e=Zc(b.b);Qb(b,"PS",e);Qb(b,"NF",e&8?1:0,1);Qb(b,"ZF",e&4?1:0,1);Qb(b,"VF",e&2?1:0,1);Qb(b,"CF",e&1?1:0,1);b.B=0}ic(b,0<a&&c&&!d?b.b.Nb:b.sa);hc(b,b.rb);a=b.b;a=a.L?a.Ta&16?1:2:4;kc(b,"B22",a&1);kc(b,"B18",a&2);kc(b,"B16", k.qa=function(a){if(this.b){var b=this.b,c=a||0,d=b.G.speed;d&&(0>=c||30<=(b.wb+=c))&&(d.textContent=b.A.W?b.na.toFixed(2)+"Mhz":"Stopped",b.wb=0)}if(this.w&&(b=this.w,a=a||0,b.D)){c=b.b.A.W;d=!!(b.b.J&4);if(0>=a||60<=(b.B+=a)){for(var e=0;e<b.b.u.length;e++)Qb(b,"R"+e,b.b.u[e]);e=$c(b.b);Qb(b,"PS",e);Qb(b,"NF",e&8?1:0,1);Qb(b,"ZF",e&4?1:0,1);Qb(b,"VF",e&2?1:0,1);Qb(b,"CF",e&1?1:0,1);b.B=0}ic(b,0<a&&c&&!d?b.b.Nb:b.ta);hc(b,b.rb);a=b.b;a=a.L?a.Ta&16?1:2:4;kc(b,"B22",a&1);kc(b,"B18",a&2);kc(b,"B16",
a&4)}}; a&4)}};
k.ua=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.A.ha?Gi(d,!1,!0):Ni(d,d.Rb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ha&&!d.C)if(d.f&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Gi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.uc=!0),d.Rb(Ji),d.uc=!1)}else d.reset(),d.b&&d.b.vb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]= k.va=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.A.ia?Hi(d,!1,!0):Oi(d,d.Rb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ia&&!d.C)if(d.f&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Hi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.uc=!0),d.Rb(Ki),d.uc=!1)}else d.reset(),d.b&&d.b.vb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]=
c,c.onclick=function(){var a=Ki(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=Gi(d,b);b?Ui(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1}; c,c.onclick=function(){var a=Li(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=Hi(d,b);b?Vi(d,a,c):d.R("Resume disabled, machine state not saved")}},!0}return!1};
function Ki(a,b){var c=a.g;c||((c=Ka("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Vi(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c} function Li(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=Wi(a,c))||a.R("The user ID is invalid.")):b&&a.R("Browser local storage is not available"));return c}
function Vi(a,b){a.g=null;b=Ea(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ma("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Mi(a){var b=null;a.g&&(b=Ga()+"/api/v1/user?req=load&user="+a.g+"&state="+Wi(a,"1.30.3"));return b} function Wi(a,b){a.g=null;b=Da(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Ni(a){var b=null;a.g&&(b=Ga()+"/api/v1/user?req=load&user="+a.g+"&state="+Xi(a,"1.30.3"));return b}
function Ui(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Wi(a,"1.30.3");d.data=c;b=Ea(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");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),Ma("user",""),a.g=null)}} function Vi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Xi(a,"1.30.3");d.data=c;b=Da(Ga()+"/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.R("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.R(c),La("user",""),a.g=null)}}
function mh(a){var b;a=sb(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.ub=function(a){if(this.Va){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Va.focus();!a&&window&&window.scrollTo(b,c)}};$a(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 Hi(g,d,!0);B(g,f);g.L&&Ni(g,g.Rb)}}); function oh(a){var b;a=sb(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.ub=function(a){if(this.Va){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Va.focus();!a&&window&&window.scrollTo(b,c)}};$a(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 Ii(g,d,!0);B(g,f);g.L&&Oi(g,g.Rb)}});
Va.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=ub("Computer",c.id))&&c.ca&&!c.A.ha&&c.Rb(-1)}});Va.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=ub("Computer",c.id))&&c.A.ha&&Gi(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Wi(a,b,c);this.i=a.i;Ri(this,a.ad)}function Wi(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} Va.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=ub("Computer",c.id))&&c.ca&&!c.A.ia&&c.Rb(-1)}});Va.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=ub("Computer",c.id))&&c.A.ia&&Hi(c,!(!c.f||c.H),!0)}});function O(a,b,c){this.id=a.id;this.key=Xi(a,b,c);this.i=a.i;Si(this,a.ad)}function Xi(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){Ri(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){Si(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 Ri(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Si(a){var b=!0;if(Ja()){var c=JSON.stringify(a[a.id]);Ma(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Pi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Li(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ja()&&(b=Ka(a.key))?(a[a.id]=b,a.b=!0):!1}var Xi=0; 1);c=0}}};function Si(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Ti(a){var b=!0;if(Ja()){var c=JSON.stringify(a[a.id]);La(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Qi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Mi(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ja()&&(b=Ka(a.key))?(a[a.id]=b,a.b=!0):!1}var Yi=0;
function hj(a,b,c,d,e,f){e("Loading "+a+"...");Ea(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):ij(h,a,b,c,d,e,f)})} function ij(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)):jj(h,a,b,c,d,e,f)})}
function ij(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(rb(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 jj(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(rb(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?jj(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?kj(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
function jj(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, function kj(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);jj(a,b,c)}})}else c(a,null)} "");a=a.replace(d[0],g);kj(a,b,c)}})}else c(a,null)}
function kj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Xi||bb(!0));l=!1}var g,h,l=!0;Xi++;qb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c|| function lj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Yi||bb(!0));l=!1}var g,h,l=!0;Yi++;jb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c||
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?hj(c,null,null,!1,e,function(d,l){l?(rb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Xi||bb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Xi||bb(!0)):f("invalid machine element: "+ (c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?ij(c,null,null,!1,e,function(d,l){l?(rb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Yi||bb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Yi||bb(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?hj(b,a,d,!0,e,m):ij(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){bb(!1);return kj(a,b,c,d)};window.enableEvents=bb;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ij(b,a,d,!0,e,m):jj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){bb(!1);return lj(a,b,c,d)};window.enableEvents=bb;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map

View file

@ -55,7 +55,7 @@ y.prototype={constructor:y,parent:null,toString:function(){return this.name?this
this.G=function(a){this.T(a,this.za)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.za+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},la:function(){return this.j.N=!0},ka:function(a,b){b&&(this.j.N=!1);return!0}};function Ua(a,b){a.j.tb?(a.j.Da=!1,a.j.tb=!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()))} this.G=function(a){this.T(a,this.za)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.za+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},la:function(){return this.j.N=!0},ka:function(a,b){b&&(this.j.N=!1);return!0}};function Ua(a,b){a.j.tb?(a.j.Da=!1,a.j.tb=!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){y.call(this,"Panel",a,Ya,1024);this.ea=this.i=this.c=this.m=this.s=this.v=0;this.A=this.B=this.w=!1;this.D=Za;this.g={};this.b={START:[1,1,!0,!1,this.uc],STEP:[1,1,!1,!1,this.vc],ENABLE:[1,1,!1,!1,this.qc],CONT:[1,1,!0,!1,this.oc],DEP:[0,0,!0,!1,this.pc],EXAM:[1,1,!0,!1,this.rc],LOAD:[1,1,!0,!1,this.tc],TEST:[0,0,!0,!1,this.sc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.wc,a]}A(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()}; function Ya(a){y.call(this,"Panel",a,Ya,2048);this.ea=this.i=this.c=this.m=this.s=this.v=0;this.A=this.B=this.w=!1;this.D=Za;this.g={};this.b={START:[1,1,!0,!1,this.uc],STEP:[1,1,!1,!1,this.vc],ENABLE:[1,1,!1,!1,this.qc],CONT:[1,1,!0,!1,this.oc],DEP:[0,0,!0,!1,this.pc],EXAM:[1,1,!0,!1,this.rc],LOAD:[1,1,!0,!1,this.tc],TEST:[0,0,!0,!1,this.sc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.wc,a]}A(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()};
h.$=function(a,b,c,d){if(this.l&&this.l.$(a,b,c,d)||this.a&&this.a.$(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ab(a,b)}}(this, h.$=function(a,b,c,d){if(this.l&&this.l.$(a,b,c,d)||this.a&&this.a.$(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ab(a,b)}}(this,
b),a.onmouseup=a.onmouseout=function(a,b){return function(){bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){bb(a,b)}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.la=function(a,b){b||(hb(),this.reset());return!0};h.ka=function(){return!0}; b),a.onmouseup=a.onmouseout=function(a,b){return function(){bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){bb(a,b)}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.la=function(a,b){b||(hb(),this.reset());return!0};h.ka=function(){return!0};
function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.g)ib(a,c,null!=b?b:a.g[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.b)jb(a,b,a.b[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.F&&a.F.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))} function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.g)ib(a,c,null!=b?b:a.g[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.b)jb(a,b,a.b[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.F&&a.F.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))}
@ -66,22 +66,22 @@ function qb(a){var b=1145>a.a.Ea?8:16,c=65472<=a.ea&&a.ea<65472+b,b=c?1:2,c=c?15
var ub={},db=(ub[65400]=[null,null,Ya.prototype.xc,Ya.prototype.vd,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=C(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));D(f,d);a&&F(f)}}Ga(hb); var ub={},db=(ub[65400]=[null,null,Ya.prototype.xc,Ya.prototype.vd,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=C(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));D(f,d);a&&F(f)}}Ga(hb);
function vb(a,b,c){y.call(this,"Bus",a,vb,64);this.a=b;this.F=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.B=1<<this.I;this.oa=this.B-1;this.b=H;this.c=Math.log2(this.b);this.D=this.b>>2;this.l=this.b-1;this.A=this.B/this.b|0;this.Aa=[];this.g=0;this.m=!1;this.ub=0;this.w=[];this.gc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.h=Array(this.A);for(b=0;b<this.A;b++)this.h[b]=a;F(this)}A(vb);var H=8192,Bb=H-1; function vb(a,b,c){y.call(this,"Bus",a,vb,64);this.a=b;this.F=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.B=1<<this.I;this.oa=this.B-1;this.b=H;this.c=Math.log2(this.b);this.D=this.b>>2;this.l=this.b-1;this.A=this.B/this.b|0;this.Aa=[];this.g=0;this.m=!1;this.ub=0;this.w=[];this.gc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.h=Array(this.A);for(b=0;b<this.A;b++)this.h[b]=a;F(this)}A(vb);var H=8192,Bb=H-1;
function wb(a,b){var c=-1,d=this.controller,e=d.Aa[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.Aa[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} function wb(a,b){var c=-1,d=this.controller,e=d.Aa[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.Aa[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255}
function xb(a,b,c){var d=!1,e=this.controller,f=e.Aa[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Aa[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.Aa[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} function xb(a,b,c){var d=!1,e=this.controller,f=e.Aa[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Aa[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.Aa[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}
function zb(a,b,c){var d=!1,e=this.controller;a=e.Aa[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,Db(a,c,H,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.oa=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.la=function(a,b){b||this.reset();return!0}; function zb(a,b,c){var d=!1,e=this.controller;a=e.Aa[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,Db(a,c,H,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.oa=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.la=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.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.rb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.rb){p=l.size-(f-n);p>g&&(p=g);l.rb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.F,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.ub+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)} function 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.rb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.rb){p=l.size-(f-n);p>g&&(p=g);l.rb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.F,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.ub+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)}
function Eb(a,b,c){var d=[];for(b>>>=a.c;0<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.oa)>>>a.c].Fb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.oa)>>>a.c].V(b&a.l,b)}h.mb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.oa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a}; function 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.oa)>>>a.c].Fb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.oa)>>>a.c].V(b&a.l,b)}h.mb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.oa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a};
function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].Jb(b&a.l,c&255,b)}h.$a=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.oa)>>>this.c].Kb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].sb(b&a.l,c&65535,b)}h.pb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.oa)>>>this.c;this.m=!1;this.g++;this.h[d].ec(c,b&65535,a);this.g--}; function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].Jb(b&a.l,c&255,b)}h.$a=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.oa)>>>this.c].Kb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].sb(b&a.l,c&65535,b)}h.pb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.oa)>>>this.c;this.m=!1;this.g++;this.h[d].ec(c,b&65535,a);this.g--};
function Pb(a){for(var b=0,c=[],d=0;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.Aa[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.Aa[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.Aa[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.Aa[n]=[d,e,f,g,l||"unknown",k,!1]}return!0}
function cb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.a.Ea)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,w=0;w<u;w++,e+=2)if(p&&1<u&&(p=f[4]+w),!Qb(a,e,e,g,k,l,n,b.qd||64,p||b.za))return!1}}return!0}function eb(a,b){a.w.push(b)} function cb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.a.Ea)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,w=0;w<u;w++,e+=2)if(p&&1<u&&(p=f[4]+w),!Qb(a,e,e,g,k,l,n,b.qd||64,p||b.za))return!1}}return!0}function eb(a,b){a.w.push(b)}
function J(a,b,c){a.m=!0;a.g||(c&&(a.a.fa|=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){y.call(this,"Device",a,L,512);this.b={L:0,Ib:-1}}A(L);h=L.prototype;h.ja=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.F=d;var e=this;this.b.Ib=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.Ib,1E3/60)});this.b.rd=Vb(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.fa|=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){y.call(this,"Device",a,L,1024);this.b={L:0,Ib:-1}}A(L);h=L.prototype;h.ja=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.F=d;var e=this;this.b.Ib=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.Ib,1E3/60)});this.b.rd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)};
h.reset=function(){this.b.Ya=128;Ub(this.a,this.b.Ib,1E3/60,!0)};h.Fc=function(){return this.b.Ya};h.Dd=function(a){this.b.Ya=a&192};h.Hc=function(){var a=this.a;return a.Z&-3199|a.bb<<5|a.cb<<1};h.Fd=function(a){Xb(this.a,a&-129|this.a.Z&128)};h.Ic=function(){var a=this.a;a.Z&57344||(a.Db=a.A>>16&65535);a=a.Db;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Jc=function(){var a=this.a;a.Z&57344||(a.Eb=a.A&65535);return a.Eb};h.Kc=function(){return this.a.Ba}; h.reset=function(){this.b.Ya=128;Ub(this.a,this.b.Ib,1E3/60,!0)};h.Fc=function(){return this.b.Ya};h.Dd=function(a){this.b.Ya=a&192};h.Hc=function(){var a=this.a,b=a.Z;b&57344||(b=b&-3199|a.bb<<5|a.cb<<1);return b};h.Fd=function(a){Xb(this.a,a&-129|this.a.Z&128)};h.Ic=function(){var a=this.a;a.Z&57344||(a.Db=a.A>>16&65535);a=a.Db;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Jc=function(){var a=this.a;a.Z&57344||(a.Eb=a.A&65535);return a.Eb};h.Kc=function(){return this.a.Ba};
h.Gd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Ra=a&16?4194303:262143,Yb(b))};h.ld=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};h.ge=function(a,b){b=b>>1&63;var c=b>>1;this.a.ab[c]=b&1?this.a.ab[c]&65535|(a&63)<<16:this.a.ab[c]&-65536|a&65534};h.dd=function(a){return this.a.H[1][a>>1&7]};h.$d=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[1][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; h.Gd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Ra=a&16?4194303:262143,Yb(b))};h.ld=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};h.ge=function(a,b){b=b>>1&63;var c=b>>1;this.a.ab[c]=b&1?this.a.ab[c]&65535|(a&63)<<16:this.a.ab[c]&-65536|a&65534};h.dd=function(a){return this.a.H[1][a>>1&7]};h.$d=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[1][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};
h.cd=function(a){return this.a.X[1][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.ad=function(a){return this.a.X[1][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Ec=function(a){return this.a.H[0][a>>1&7]};h.Cd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Cc=function(a){return this.a.H[0][(a>>1&7)+8]};h.Ad=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Dc=function(a){return this.a.X[0][a>>1&7]}; h.cd=function(a){return this.a.X[1][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.ad=function(a){return this.a.X[1][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Ec=function(a){return this.a.H[0][a>>1&7]};h.Cd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Cc=function(a){return this.a.H[0][(a>>1&7)+8]};h.Ad=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Dc=function(a){return this.a.X[0][a>>1&7]};
h.Bd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Bc=function(a){return this.a.X[0][(a>>1&7)+8]};h.zd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.kd=function(a){return this.a.H[3][a>>1&7]};h.fe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.hd=function(a){return this.a.H[3][(a>>1&7)+8]};h.de=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.jd=function(a){return this.a.X[3][a>>1&7]};h.ee=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295}; h.Bd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Bc=function(a){return this.a.X[0][(a>>1&7)+8]};h.zd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.kd=function(a){return this.a.H[3][a>>1&7]};h.fe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.hd=function(a){return this.a.H[3][(a>>1&7)+8]};h.de=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.jd=function(a){return this.a.X[3][a>>1&7]};h.ee=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};
h.gd=function(a){return this.a.X[3][(a>>1&7)+8]};h.ce=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.C&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.C&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Pc=function(){return this.a.C&49152?this.a.pa[0]:this.a.f[6]};h.Ld=function(a){this.a.C&49152?this.a.pa[0]=a:this.a.f[6]=a};h.Sc=function(){return this.a.f[7]};h.Od=function(a){this.a.f[7]=a}; h.gd=function(a){return this.a.X[3][(a>>1&7)+8]};h.ce=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.C&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.C&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Pc=function(){return this.a.C&49152?this.a.pa[0]:this.a.f[6]};h.Ld=function(a){this.a.C&49152?this.a.pa[0]=a:this.a.f[6]=a};h.Sc=function(){return this.a.f[7]};h.Od=function(a){this.a.f[7]=a};
h.Na=function(a){a&=7;return this.a.C&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.C&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Qc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[1]};h.Md=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[1]=a};h.Rc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[3]};h.Nd=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[3]=a};h.zc=function(a){return this.a.$b[a-65504>>1]}; h.Na=function(a){a&=7;return this.a.C&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.C&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Qc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[1]};h.Md=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[1]=a};h.Rc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[3]};h.Nd=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[3]=a};h.zc=function(a){return this.a.$b[a-65504>>1]};
h.xd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.ub}a=(a>>6)-1}else a=0;return a};h.dc=function(){};h.fd=function(){return 1};h.be=function(){};h.yc=function(){return this.a.fa};h.wd=function(){this.a.fa=0};h.Gc=function(){return this.a.Zb};h.Ed=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Lc=function(a){return a?this.a.Gb:0};h.Hd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Gb=a;b.u|=2}; h.xd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.ub}a=(a>>6)-1}else a=0;return a};h.dc=function(){};h.fd=function(){return 1};h.be=function(){};h.yc=function(){return this.a.fa};h.wd=function(){this.a.fa=0};h.Gc=function(){return this.a.Zb};h.Ed=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Lc=function(a,b){return b?0:this.a.Gb};h.Hd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Gb=a;b.u|=2};
h.ed=function(a){return a?this.a.ob&65280:0};h.ae=function(a){this.a.ob=a|255};h.Oc=function(){return Zb(this.a)};h.Kd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.cc=function(){}; h.ed=function(a,b){return b?0:this.a.ob&65280};h.ae=function(a){this.a.ob=a|255};h.Oc=function(){return Zb(this.a)};h.Kd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.cc=function(){};
var M={},Wb=(M[61568]=[null,null,L.prototype.ld,L.prototype.ge,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.dd,L.prototype.$d,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.bd,L.prototype.Yd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Ec,L.prototype.Cd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Cc,L.prototype.Ad,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Dc, var M={},Wb=(M[61568]=[null,null,L.prototype.ld,L.prototype.ge,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.dd,L.prototype.$d,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.bd,L.prototype.Yd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Ec,L.prototype.Cd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Cc,L.prototype.Ad,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Dc,
L.prototype.Bd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Kc,L.prototype.Gd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Fc,L.prototype.Dd,"LKS"],M[65402]=[null,null,L.prototype.Hc,L.prototype.Fd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Ic,L.prototype.cc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Jc,L.prototype.cc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.kd,L.prototype.fe,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.hd, L.prototype.Bd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Kc,L.prototype.Gd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Fc,L.prototype.Dd,"LKS"],M[65402]=[null,null,L.prototype.Hc,L.prototype.Fd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Ic,L.prototype.cc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Jc,L.prototype.cc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.kd,L.prototype.fe,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.hd,
L.prototype.de,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.jd,L.prototype.ee,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.gd,L.prototype.ce,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa, L.prototype.de,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.jd,L.prototype.ee,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.gd,L.prototype.ce,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa,
@ -114,9 +114,9 @@ h.restore=function(a){var b=a[1];this.va=b[1];xc(this,b[3]);a:{b=this.h;a=a[2];v
function Hc(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{ud:a,La:b,next:null}}function Ic(a,b){var c=a.O;if(c==b)a.O=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}}function Tb(a,b){if(b!=a.O){var c=a.O;if(!c||c.La<=b.La)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.La<=b.La){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=1}function Jc(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 Hc(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{ud:a,La:b,next:null}}function Ic(a,b){var c=a.O;if(c==b)a.O=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}}function Tb(a,b){if(b!=a.O){var c=a.O;if(!c||c.La<=b.La)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.La<=b.La){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=1}function Jc(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.C=a.C&63728|Fc(a)|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}function $b(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.C)&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.C>>14&3;a.v!=c&&(a.pa[c]=a.f[6],a.f[6]=a.pa[a.v]);a.C=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Kc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Lc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))} function Zb(a){return a.C=a.C&63728|Fc(a)|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}function $b(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.C)&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.C>>14&3;a.v!=c&&(a.pa[c]=a.f[6],a.f[6]=a.pa[a.v]);a.C=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Kc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Lc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))}
function Mc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Nc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ua){0>a.Ja?a.Ja=Zb(a):a.v||(b=4,a.fa|=4,a.f[6]=4,d=-3);a.A=b;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ja>>2&12288);Oc(a,a.Ja);Oc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Pc(a){var b=Qc(a),c=Qc(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);Q(a,b);$b(a,c);a.u&=-17} function Mc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Nc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ua){0>a.Ja?a.Ja=Zb(a):a.v||(b=4,a.fa|=4,a.f[6]=4,d=-3);a.A=b;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ja>>2&12288);Oc(a,a.Ja);Oc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Pc(a){var b=Qc(a),c=Qc(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);Q(a,b);$b(a,c);a.u&=-17}
function Lb(a,b){var c=b>>13&31;31>c&&a.Ba&32&&(b=a.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&&(b=a.Ba&32?a.ab[c]+(b&8190)&4194302:b&-3932161);return b}
function Rc(a,b,c){var d,e,f;if(!(c&a.aa))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Ba&a.sd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.bb=a.v,a.cb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.Z& function Rc(a,b,c){var d,e,f;if(!(c&a.aa))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Ba&a.sd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.bb=a.v,a.cb=d;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.Z&57344||
57344||(g|=a.bb<<5|a.cb<<1,Xb(a,a.Z&-61695|g),b=!0)),a.Z&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.sb(c,b)}function Sc(a,b,c){!a.v&&c<=a.ob&&(b||4<c)&&(1145<=a.Ea&&c<=a.ob-32?(a.fa|=4,a.f[6]=4,K(a,4,0,-3)):(a.fa|=8,a.u|=32))} (g|=a.bb<<5|a.cb<<1,Xb(a,a.Z&-61695|g),K(a,168,0,-1))),a.Z&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.sb(c,b)}function Sc(a,b,c){!a.v&&c<=a.ob&&(b||4<c)&&(1145<=a.Ea&&c<=a.ob-32?(a.fa|=4,a.f[6]=4,K(a,4,0,-3)):(a.fa|=8,a.u|=32))}
function Tc(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&&Sc(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(Hc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Hc(a,2)),e=e+a.f[c]& function Tc(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&&Sc(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(Hc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Hc(a,2)),e=e+a.f[c]&
65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&Sc(a,b,a.f[6]);return e}h.mb=function(a){if(!this.aa)return this.h.mb(a);this.ua++;a=this.Yb(Rc(this,a,2));this.ua--;return a};h.$a=function(a,b){this.aa?(this.ua++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.$a(a,b)};h.pb=function(a,b){this.aa?(this.ua++,this.fc(Rc(this,a,4),b),this.ua--):this.h.pb(a,b)};h.mc=function(a,b,c){return Tc(this,a,b,c)}; 65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&Sc(a,b,a.f[6]);return e}h.mb=function(a){if(!this.aa)return this.h.mb(a);this.ua++;a=this.Yb(Rc(this,a,2));this.ua--;return a};h.$a=function(a,b){this.aa?(this.ua++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.$a(a,b)};h.pb=function(a,b){this.aa?(this.ua++,this.fc(Rc(this,a,4),b),this.ua--):this.h.pb(a,b)};h.mc=function(a,b,c){return Tc(this,a,b,c)};
h.nc=function(a,b,c){return Rc(this,Tc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,this.Xa=a)};h.md=function(a){return Mb(this.h,this.Xa=Rc(this,a,2))};h.fc=function(a,b){Ob(this.h,this.Xa=a,b&65535)};h.he=function(a,b){Ob(this.h,this.Xa=Rc(this,a,4),b)};function Uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Tc(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.v=a.C>>12&3,c=a.V(d|c&a.R),a.v=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.pa[a.C>>12&3];return c} h.nc=function(a,b,c){return Rc(this,Tc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,this.Xa=a)};h.md=function(a){return Mb(this.h,this.Xa=Rc(this,a,2))};h.fc=function(a,b){Ob(this.h,this.Xa=a,b&65535)};h.he=function(a,b){Ob(this.h,this.Xa=Rc(this,a,4),b)};function Uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Tc(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.v=a.C>>12&3,c=a.V(d|c&a.R),a.v=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.pa[a.C>>12&3];return c}
@ -150,7 +150,7 @@ this.b?2:0)}],Pe=[function(a){S(this,a,0,xd);this.a-=this.c?9+(this.Ab&1):3+(7==
var Ue=[function(a){Ve[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,Cd,function(a){We[a>>8&15].call(this,a)},function(a){Xe[a>>8&15].call(this,a)},me,be,Md,Id,Kd,ue,Y],Ve=[function(a){Ye[a>>4&15].call(this,a)},Yd,Vd,Nd,Od,Td,Pd,Rd,je,je,Ae,Ce,Ee,function(a){Ze[a>>6&3].call(this,a)},Y,Y],Ze=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Uc(this,a,0);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I= var Ue=[function(a){Ve[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,Cd,function(a){We[a>>8&15].call(this,a)},function(a){Xe[a>>8&15].call(this,a)},me,be,Md,Id,Kd,ue,Y],Ve=[function(a){Ye[a>>4&15].call(this,a)},Yd,Vd,Nd,Od,Td,Pd,Rd,je,je,Ae,Ce,Ee,function(a){Ze[a>>6&3].call(this,a)},Y,Y],Ze=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Uc(this,a,0);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I=
this.a;Vc(this,a,0,b);R(this,b);this.a=this.I-ne[this.c]},function(a){R(this,bd(this,a,Fc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ye=[function(a){$e[a&15].call(this,a)},Y,Y,Y,he,he,he,he,re,function(a){a&8?(this.C&49152||(this.C=this.C&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},Ge,Ie,ve,ve,ve,ve],$e=[ee,xe,function(){Pc(this);this.u|=this.C&16;this.a-=13},Xd,fe,qe,se,function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],We=[oe,oe,ce,ce,Dd,Dd,Ed,Ed,ye,ye,Y,Y,Y,Y,te,te],Xe=[Wd,Ud,Qd,Sd, this.a;Vc(this,a,0,b);R(this,b);this.a=this.I-ne[this.c]},function(a){R(this,bd(this,a,Fc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ye=[function(a){$e[a&15].call(this,a)},Y,Y,Y,he,he,he,he,re,function(a){a&8?(this.C&49152||(this.C=this.C&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},Ge,Ie,ve,ve,ve,ve],$e=[ee,xe,function(){Pc(this);this.u|=this.C&16;this.a-=13},Xd,fe,qe,se,function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],We=[oe,oe,ce,ce,Dd,Dd,Ed,Ed,ye,ye,Y,Y,Y,Y,te,te],Xe=[Wd,Ud,Qd,Sd,
Zd,$d,Fd,Gd,de,we,Ke,Me,Oe,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[Y,function(a){a=Uc(this,a,65536);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I=this.a;Vc(this,a,65536,b);R(this,b);this.a=this.I-ne[this.c]},Y]; Zd,$d,Fd,Gd,de,we,Ke,Me,Oe,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[Y,function(a){a=Uc(this,a,65536);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I=this.a;Vc(this,a,65536,b);R(this,b);this.a=this.I-ne[this.c]},Y];
function bf(a){y.call(this,"ROM",a,bf,256);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.qa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);cf(c)})}}A(bf);h=bf.prototype; function bf(a){y.call(this,"ROM",a,bf,512);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.qa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);cf(c)})}}A(bf);h=bf.prototype;
h.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;cf(this)};h.la=function(){this.W&&(this.F&&this.F.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ka=function(){return!0}; h.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;cf(this)};h.la=function(){this.W&&(this.F&&this.F.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ka=function(){return!0};
function cf(a){if(!Va(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[bf.prototype.$c,bf.prototype.Wd,null,null,null,a.b>>1],c);if(cb(a.h,a,b)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c<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?b.push(a.g): function cf(a){if(!Va(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[bf.prototype.$c,bf.prototype.Wd,null,null,null,a.b>>1],c);if(cb(a.h,a,b)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c<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?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.$c=function(a){return this.c[a-this.i]};h.Wd=function(){};Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new bf(d);D(d,c)}}); 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.$c=function(a){return this.c[a-this.i]};h.Wd=function(){};Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new bf(d);D(d,c)}});