Allow pasted text in the virtual SerialPort window to be processed as received data, and tidy up the MMR0 updates

This commit is contained in:
Jeff 2016-11-16 13:54:10 -08:00 committed by Jeff Parsons
commit 00d6fb6c59
7 changed files with 541 additions and 512 deletions

View file

@ -180,12 +180,12 @@ CPUStatePDP11.prototype.initRegs = function()
this.regsAlt = [ // Alternate R0 - R5 this.regsAlt = [ // Alternate R0 - R5
0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0
]; ];
this.regsAltStack = [ // Alternate R6 stack pointers (KERNEL, SUPER, illegal, USER) this.regsAltStack = [ // Alternate R6 stack pointers (KERNEL, SUPER, UNUSED, USER)
0, 0, 0, 0 0, 0, 0, 0
]; ];
this.mmuMode = 0; // current memory management mode (see PDP11.MODE.KERNEL | SUPER | UNUSED | USER) this.mmuMode = 0; // current memory management mode (see PDP11.MODE.KERNEL | SUPER | UNUSED | USER)
this.mmuLastPage = 0; this.mmuLastPage = 0;
this.mmuLastVirtual = 0; // this.mmuLastVirtual = 0;
this.mapMMR3 = [4,2,0,1]; // map from mode to MMR3 I/D bit this.mapMMR3 = [4,2,0,1]; // map from mode to MMR3 I/D bit
this.mmuPDR = [ // memory management PDR registers by mode this.mmuPDR = [ // memory management PDR registers by mode
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // kernel 0 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // kernel 0
@ -254,8 +254,7 @@ CPUStatePDP11.prototype.resetMMU = function()
this.mmuLastMode = 0; this.mmuLastMode = 0;
this.mmuMask = 0x3ffff; this.mmuMask = 0x3ffff;
this.lastAI = 0; // last auto-incs and/or auto-decs; this is propagated to MMR1 as appropriate this.lastOp = 0; // stores the PC and any auto-incs or auto-decs from the last opcode; used to update MMR1 and MMR2
this.lastPC = 0; // last PC at the time of getOpcode(); this is propagated to MMR2 as appropriate
this.resetTriggers(); this.resetTriggers();
@ -290,12 +289,14 @@ CPUStatePDP11.prototype.setMemoryAccess = function()
{ {
if (this.mmuEnable) { if (this.mmuEnable) {
this.addrDSpace = PDP11.ACCESS.DSPACE; this.addrDSpace = PDP11.ACCESS.DSPACE;
this.addrIOPage = (this.regMMR3 & PDP11.MMR3.MMU_22BIT)? BusPDP11.IOPAGE_22BIT : BusPDP11.IOPAGE_18BIT;
this.getAddr = this.getVirtualAddrByMode; this.getAddr = this.getVirtualAddrByMode;
this.readWord = this.readWordFromVirtual; this.readWord = this.readWordFromVirtual;
this.writeWord = this.writeWordToVirtual; this.writeWord = this.writeWordToVirtual;
this.bus.setIOPageRange((this.regMMR3 & PDP11.MMR3.MMU_22BIT)? 22 : 18); this.bus.setIOPageRange((this.regMMR3 & PDP11.MMR3.MMU_22BIT)? 22 : 18);
} else { } else {
this.addrDSpace = 0; this.addrDSpace = 0;
this.addrIOPage = BusPDP11.IOPAGE_16BIT;
this.getAddr = this.getPhysicalAddrByMode; this.getAddr = this.getPhysicalAddrByMode;
this.readWord = this.readWordFromPhysical; this.readWord = this.readWordFromPhysical;
this.writeWord = this.writeWordToPhysical; this.writeWord = this.writeWordToPhysical;
@ -306,6 +307,8 @@ CPUStatePDP11.prototype.setMemoryAccess = function()
/** /**
* getMMR0() * getMMR0()
* *
* NOTE: It's OK to bypass this function if you're only interested in bits that always stored directly in MMR0.
*
* 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 MMR0 * 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 MMR0
* nonr leng read trap unus unus ena mnt cmp -mode- i/d --page-- enable * nonr leng read trap unus unus ena mnt cmp -mode- i/d --page-- enable
* *
@ -314,7 +317,11 @@ CPUStatePDP11.prototype.setMemoryAccess = function()
*/ */
CPUStatePDP11.prototype.getMMR0 = function() CPUStatePDP11.prototype.getMMR0 = function()
{ {
return (this.regMMR0 & 0xf381) | (this.mmuLastMode << 5) | (this.mmuLastPage << 1); /*
* Technically, we never allow the UNUSED bits to be set, so there's no point going out of our way
* to clear them, but it doesn't hurt to include them in the mask.
*/
return (this.regMMR0 & ~(PDP11.MMR0.UNUSED | PDP11.MMR0.PAGE | PDP11.MMR0.MODE)) | (this.mmuLastMode << 5) | (this.mmuLastPage << 1);
}; };
/** /**
@ -325,17 +332,22 @@ CPUStatePDP11.prototype.getMMR0 = function()
*/ */
CPUStatePDP11.prototype.setMMR0 = function(newMMR0) CPUStatePDP11.prototype.setMMR0 = function(newMMR0)
{ {
newMMR0 &= 0xf381; newMMR0 &= ~PDP11.MMR0.UNUSED;
if (this.regMMR0 != newMMR0) { if (this.regMMR0 != newMMR0) {
/* if (newMMR0 & PDP11.MMR0.ABORT) {
* If updates to MMR1 and MMR2 are being shut off (ie, MMR0.ABORT bits are transitioning from clear to set), /*
* then do one final sync with their real-time counterparts (lastAI and lastPC). * If updates to MMR0[1-7], MMR1, and MMR2 are being shut off (ie, MMR0.ABORT bits are transitioning
*/ * from clear to set), then do one final sync with their real-time counterparts in lastOp.
if (!(this.regMMR0 & PDP11.MMR0.ABORT) && (newMMR0 & PDP11.MMR0.ABORT)) { */
this.assert(!(this.lastAI & ~0xffff)); if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
this.regMMR1 = this.lastAI & 0xffff; this.regMMR1 = (this.lastOp >> 16) & 0xffff;
this.regMMR2 = this.lastPC; this.regMMR2 = this.lastOp & 0xffff;
}
} }
/*
* NOTE: We are not protecting the read-only state of the COMPLETED bit here; that's handled by writeMMR0().
*/
this.regMMR0 = newMMR0; this.regMMR0 = newMMR0;
this.mmuLastMode = (newMMR0 >> 5) & 3; this.mmuLastMode = (newMMR0 >> 5) & 3;
this.mmuLastPage = (newMMR0 >> 1) & 0xf; this.mmuLastPage = (newMMR0 >> 1) & 0xf;
@ -363,11 +375,10 @@ CPUStatePDP11.prototype.getMMR1 = function()
{ {
/* /*
* If updates to MMR1 have not been shut off (ie, MMR0.ABORT bits are clear), * If updates to MMR1 have not been shut off (ie, MMR0.ABORT bits are clear),
* then we are always allowed to sync MMR1 with it real-time counterpart (lastAI). * then we are allowed to sync MMR1 with its real-time counterpart in lastOp.
*/ */
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) { if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
this.assert(!(this.lastAI & ~0xffff)); this.regMMR1 = (this.lastOp >> 16) & 0xffff;
this.regMMR1 = this.lastAI & 0xffff;
} }
var result = this.regMMR1; var result = this.regMMR1;
if (result & 0xff00) { if (result & 0xff00) {
@ -386,10 +397,10 @@ CPUStatePDP11.prototype.getMMR2 = function()
{ {
/* /*
* If updates to MMR2 have not been shut off (ie, MMR0.ABORT bits are clear), * If updates to MMR2 have not been shut off (ie, MMR0.ABORT bits are clear),
* then we are always allowed to sync MMR2 with it real-time counterpart (lastPC). * then we are allowed to sync MMR2 with its real-time counterpart in lastOp.
*/ */
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) { if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
this.regMMR2 = this.lastPC; this.regMMR2 = this.lastOp & 0xffff;
} }
return this.regMMR2; return this.regMMR2;
}; };
@ -633,8 +644,7 @@ CPUStatePDP11.prototype.setNF = function()
CPUStatePDP11.prototype.getOpcode = function() CPUStatePDP11.prototype.getOpcode = function()
{ {
var pc = this.regsGen[PDP11.REG.PC]; var pc = this.regsGen[PDP11.REG.PC];
this.lastAI = 0; this.lastOp = pc;
this.lastPC = pc;
/* /*
* If PC is unaligned, a BUS trap will be generated, and because it will generate an * If PC is unaligned, a BUS trap will be generated, and because it will generate an
* exception, the next line (the equivalent of advancePC(2)) will not be executed, ensuring that * exception, the next line (the equivalent of advancePC(2)) will not be executed, ensuring that
@ -682,7 +692,7 @@ CPUStatePDP11.prototype.getPC = function()
*/ */
CPUStatePDP11.prototype.getLastPC = function() CPUStatePDP11.prototype.getLastPC = function()
{ {
return this.lastPC; return this.lastOp & 0xffff;
}; };
/** /**
@ -1308,8 +1318,7 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason)
reason = PDP11.REASON.RED; reason = PDP11.REASON.RED;
} }
this.lastPC = vector; this.lastOp = vector;
this.lastAI = 0;
/* /*
* Read from kernel D space * Read from kernel D space
@ -1521,40 +1530,44 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
* This can happen when the DSTMODE (MAINT) bit of MMR0 is set but *not* the ENABLED bit. * This can happen when the DSTMODE (MAINT) bit of MMR0 is set but *not* the ENABLED bit.
*/ */
if (!(accessFlags & this.mmuEnable)) { if (!(accessFlags & this.mmuEnable)) {
return virtualAddress; physicalAddress = virtualAddress & 0xffff;
// this.mmuLastVirtual = physicalAddress;
if (physicalAddress >= BusPDP11.IOPAGE_16BIT) {
physicalAddress |= this.addrIOPage;
}
return physicalAddress;
} }
this.mmuLastVirtual = virtualAddress;
page = virtualAddress >> 13; page = virtualAddress >> 13;
if (!(this.regMMR3 & this.mapMMR3[this.mmuMode])) page &= 7; if (!(this.regMMR3 & this.mapMMR3[this.mmuMode])) page &= 7;
pdr = this.mmuPDR[this.mmuMode][page]; pdr = this.mmuPDR[this.mmuMode][page];
physicalAddress = ((this.mmuPAR[this.mmuMode][page] << 6) + (virtualAddress & 0x1fff)) & this.mmuMask; physicalAddress = ((this.mmuPAR[this.mmuMode][page] << 6) + (virtualAddress & 0x1fff)) & this.mmuMask;
// this.mmuLastVirtual = virtualAddress;
var errorMask = 0; var newMMR0 = 0;
switch (pdr & 0x7) { switch (pdr & 0x7) {
case 1: // read-only with trap case 1: // read-only with trap
errorMask = PDP11.MMR0.TRAP_MMU; newMMR0 = PDP11.MMR0.TRAP_MMU;
/* falls through */ /* falls through */
case 2: // read-only case 2: // read-only
pdr |= 0x80; // Set A bit pdr |= 0x80; // Set A bit
if (accessFlags & PDP11.ACCESS.WRITE) { if (accessFlags & PDP11.ACCESS.WRITE) {
errorMask = PDP11.MMR0.ABORT_RO; newMMR0 = PDP11.MMR0.ABORT_RO;
} }
break; break;
case 4: // read-write with read-write trap case 4: // read-write with read-write trap
errorMask = PDP11.MMR0.TRAP_MMU; newMMR0 = PDP11.MMR0.TRAP_MMU;
/* falls through */ /* falls through */
case 5: // read-write with write trap case 5: // read-write with write trap
if (accessFlags & PDP11.ACCESS.WRITE) { if (accessFlags & PDP11.ACCESS.WRITE) {
errorMask = PDP11.MMR0.TRAP_MMU; newMMR0 = PDP11.MMR0.TRAP_MMU;
} }
/* falls through */ /* falls through */
case 6: // read-write: set A & W bits case 6: // read-write: set A & W bits
pdr |= ((accessFlags & PDP11.ACCESS.WRITE) ? 0xc0 : 0x80); pdr |= ((accessFlags & PDP11.ACCESS.WRITE) ? 0xc0 : 0x80);
break; break;
default: default:
errorMask = PDP11.MMR0.ABORT_NR; newMMR0 = PDP11.MMR0.ABORT_NR;
break; break;
} }
@ -1562,12 +1575,12 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
if (pdr & 0x8) { // expand downwards if (pdr & 0x8) { // expand downwards
if (pdr & 0x7f00) { if (pdr & 0x7f00) {
if ((virtualAddress & 0x1fc0) < ((pdr >> 2) & 0x1fc0)) { if ((virtualAddress & 0x1fc0) < ((pdr >> 2) & 0x1fc0)) {
errorMask |= PDP11.MMR0.ABORT_PL; newMMR0 |= PDP11.MMR0.ABORT_PL;
} }
} }
} else { // expand upwards } else { // expand upwards
if ((virtualAddress & 0x1fc0) > ((pdr >> 2) & 0x1fc0)) { if ((virtualAddress & 0x1fc0) > ((pdr >> 2) & 0x1fc0)) {
errorMask |= PDP11.MMR0.ABORT_PL; newMMR0 |= PDP11.MMR0.ABORT_PL;
} }
} }
} }
@ -1583,11 +1596,15 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
} }
var fAbort = false; var fAbort = false;
if (errorMask) { if (newMMR0) {
if (errorMask & PDP11.MMR0.ABORT) { if (newMMR0 & PDP11.MMR0.ABORT) {
if (this.trapPSW >= 0) errorMask |= 0x80; // Instruction complete if (this.trapPSW >= 0) {
newMMR0 |= PDP11.MMR0.COMPLETED;
}
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) { if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
this.regMMR0 |= errorMask | (this.mmuLastMode << 5) | (this.mmuLastPage << 1); newMMR0 |= (this.mmuLastMode << 5) | (this.mmuLastPage << 1);
this.assert(!(newMMR0 & ~PDP11.MMR0.UPDATE));
this.setMMR0((this.regMMR0 & ~PDP11.MMR0.UPDATE) | newMMR0);
} }
fAbort = true; fAbort = true;
} }
@ -1658,7 +1675,7 @@ CPUStatePDP11.prototype.pushWord = function(data)
{ {
var virtualAddress = (this.regsGen[6] - 2) & 0xffff; var virtualAddress = (this.regsGen[6] - 2) & 0xffff;
this.regsGen[6] = virtualAddress; // BSD needs SP updated before any fault :-( this.regsGen[6] = virtualAddress; // BSD needs SP updated before any fault :-(
this.lastAI = (this.lastAI << 8) | 0xf6; this.lastOp = (this.lastOp & 0xffff) | ((this.lastOp & ~0xffff) << 8) | (0x00f6 << 16);
this.checkStackLimit(0, virtualAddress); this.checkStackLimit(0, virtualAddress);
this.writeWord(virtualAddress, data); this.writeWord(virtualAddress, data);
}; };
@ -1843,7 +1860,7 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
} }
this.regsGen[reg] = (this.regsGen[reg] + step) & 0xffff; this.regsGen[reg] = (this.regsGen[reg] + step) & 0xffff;
this.lastAI = (this.lastAI << 8) | ((step << 3) & 0xf8) | reg; this.lastOp = (this.lastOp & 0xffff) | ((this.lastOp & ~0xffff) << 8) | ((((step << 3) & 0xf8) | reg) << 16);
/* /*
* NOTE: We had to eliminate the test for "(accessFlags & PDP11.ACCESS.WRITE)", because DEC's * NOTE: We had to eliminate the test for "(accessFlags & PDP11.ACCESS.WRITE)", because DEC's
@ -2068,7 +2085,7 @@ CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags)
*/ */
CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, data) CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, data)
{ {
this.lastAI = 0x0016; this.lastOp = (this.lastOp & 0xffff) | (0x0016 << 16);
var reg = this.dstReg = opCode & PDP11.OPREG.MASK; var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
if (!mode) { if (!mode) {

View file

@ -583,7 +583,7 @@ if (DEBUGGER) {
{ {
if (this.controlDebug) { if (this.controlDebug) {
/* /*
* This seems to be recommended work-around to prevent the browser from scrolling the focused element * This is the recommended work-around to prevent the browser from scrolling the focused element
* into view. The CPU is not a visual component, so when the CPU wants to set focus, the primary intent * into view. The CPU is not a visual component, so when the CPU wants to set focus, the primary intent
* is to ensure that keyboard input is fielded properly. * is to ensure that keyboard input is fielded properly.
*/ */

View file

@ -311,38 +311,40 @@ var PDP11 = {
BYTE: 0xff, // write byte normally BYTE: 0xff, // write byte normally
SBYTE: 0xffff // sign-extend byte to word SBYTE: 0xffff // sign-extend byte to word
}, },
CPUERR: { CPUERR: { // 177766
RED: 0x0004, // red zone stack limit RED: 0x0004, // 000004 red zone stack limit
YELLOW: 0x0008, // yellow zone stack limit YELLOW: 0x0008, // 000010 yellow zone stack limit
TIMEOUT: 0x0010, // UNIBUS timeout error TIMEOUT: 0x0010, // 000020 UNIBUS timeout error
NOMEMORY: 0x0020, // non-existent memory error NOMEMORY: 0x0020, // 000040 non-existent memory error
ODDADDR: 0x0040, // odd word address error (as in non-even, not strange) ODDADDR: 0x0040, // 000100 odd word address error (as in non-even, not strange)
BADHALT: 0x0080 // HALT attempted in USER or SUPER modes BADHALT: 0x0080 // 000200 HALT attempted in USER or SUPER modes
}, },
MMR0: { MMR0: { // 177572
ENABLED: 0x0001, // address relocation enabled ENABLED: 0x0001, // 000001 address relocation enabled
PAGE_NUM: 0x000E, // page number of last fault PAGE_NUM: 0x000E, // 000016 page number of last fault
PAGE_D: 0x0010, // last fault occurred in D space PAGE_D: 0x0010, // 000020 last fault occurred in D space
PAGE_MODE: 0x0060, // processor mode as of last fault PAGE: 0x001E, // 000176 all of the PAGE bits
COMPLETED: 0x0080, // last instruction completed MODE: 0x0060, // 000140 processor mode as of last fault
DSTMODE: 0x0100, // only destination mode references will be relocated (aka MAINT bit) COMPLETED: 0x0080, // 000200 last instruction completed (R/O)
MMU_TRAPS: 0x0200, // enable MMU traps DSTMODE: 0x0100, // 000400 only destination mode references will be relocated (aka MAINT bit)
UNUSED: 0x0C00, MMU_TRAPS: 0x0200, // 001000 enable MMU traps
TRAP_MMU: 0x1000, // trap: MMU UNUSED: 0x0C00, // 006000
ABORT_RO: 0x2000, // abort: read-only TRAP_MMU: 0x1000, // 010000 trap: MMU
ABORT_PL: 0x4000, // abort: page length ABORT_RO: 0x2000, // 020000 abort: read-only
ABORT_NR: 0x8000, // abort: non-resident ABORT_PL: 0x4000, // 040000 abort: page length
ABORT: 0xE000 ABORT_NR: 0x8000, // 100000 abort: non-resident
ABORT: 0xE000, // 160000
UPDATE: 0xF0FE // Includes all of: ABORT, TRAP, COMPLETED, MODE, and PAGE bits
}, },
MMR1: { // general purpose auto-inc/auto-dec register MMR1: { // 177574: general purpose auto-inc/auto-dec register
REG1_NUM: 0x0007, REG1_NUM: 0x0007, //
REG1_DELTA: 0x00F8, REG1_DELTA: 0x00F8, //
REG2_NUM: 0x0700, REG2_NUM: 0x0700, //
REG2_DELTA: 0xF800 REG2_DELTA: 0xF800 //
}, },
MMR2: { // virtual program counter register MMR2: { // 177576: virtual program counter register
}, },
MMR3: { // mapping register MMR3: { // 172516: mapping register
USER_D: 0x0001, USER_D: 0x0001,
SUPER_D: 0x0002, SUPER_D: 0x0002,
KERNEL_D: 0x0004, KERNEL_D: 0x0004,

View file

@ -219,7 +219,7 @@ DevicePDP11.prototype.readMMR0 = function(addr)
*/ */
DevicePDP11.prototype.writeMMR0 = function(data, addr) DevicePDP11.prototype.writeMMR0 = function(data, addr)
{ {
this.cpu.setMMR0(data); this.cpu.setMMR0((data & ~PDP11.MMR0.COMPLETED) | (this.cpu.regMMR0 & PDP11.MMR0.COMPLETED));
}; };
/** /**

View file

@ -239,6 +239,15 @@ SerialPortPDP11.prototype.setBinding = function(sType, sBinding, control, sValue
return true; return true;
}; };
control.onpaste = function onKeyPress(event) {
if (event.stopPropagation) event.stopPropagation();
if (event.preventDefault) event.preventDefault();
var clipboardData = event.clipboardData || window.clipboardData;
if (clipboardData) {
serial.receiveData(clipboardData.getData('Text'));
}
};
/* /*
* Now that we've added an onkeypress handler that calls preventDefault() for ALL keys, the control * Now that we've added an onkeypress handler that calls preventDefault() for ALL keys, the control
* itself no longer needs the "readonly" attribute; we primarily need to remove it for iOS browsers, * itself no longer needs the "readonly" attribute; we primarily need to remove it for iOS browsers,

View file

@ -40,285 +40,285 @@ function wa(a,b){return(a+" ").slice(0,b)
function za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Aa=Date.now||function(){return+new Date};function Ba(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Aa=Date.now||function(){return+new Date};function Ba(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
function Ea(a,b){var c,d={ea:null,ga:null,La:null,Ka:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.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,Na:null,Ma:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Na=g.load;d.Ma=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c<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 Fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;function Ia(){if(null==Ha){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ha=a}return Ha} function Fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;function Ia(){if(null==Ha){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ha=a}return Ha}
function Ja(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 Ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Sa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()} function Ja(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 Ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Sa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Ta(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ua={init:[],show:[],exit:[]},Va=!1,Wa=!1,Xa=!0;function Ya(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Za(a){Ua.init.push(a)} function Ta(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ua={init:[],show:[],exit:[]},Va=!1,Wa=!1,Xa=!0;function Ya(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Za(a){Ua.init.push(a)}
function $a(a){if(Xa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function ab(a){!Xa&&a?(Xa=!0,Va&&bb("init"),Wa&&bb("show")):Xa=a}function bb(a){Ua[a]&&$a(Ua[a])}Ya("onload",function(){Va=!0;$a(Ua.init)});Ya("onpageshow",function(){Wa=!0;$a(Ua.show)});Ya(Ra("Opera")||Ra("iOS")?"onunload":"onbeforeunload",function(){$a(Ua.exit)}); function $a(a){if(Xa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function ab(a){!Xa&&a?(Xa=!0,Va&&bb("init"),Wa&&bb("show")):Xa=a}function bb(a){Ua[a]&&$a(Ua[a])}Ya("onload",function(){Va=!0;$a(Ua.init)});Ya("onpageshow",function(){Wa=!0;$a(Ua.show)});Ya(Ra("Opera")||Ra("iOS")?"onunload":"onbeforeunload",function(){$a(Ua.exit)});
function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.vc=b.comment;this.Yc=b;b=this.id.indexOf(".");0>b?this.Za=this.id:(this.Qa=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.w={ready:!1,ab:!1,Zb:!1,ha:!1,error:!1};this.Sb=null;this.w.error=!1;this.G={};this.i=null;this.la=d||0;u.push(this)}var cb=void 0,db={}; function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.yc=b.comment;this.Yc=b;b=this.id.indexOf(".");0>b?this.Za=this.id:(this.Sa=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.w={ready:!1,bb:!1,ac:!1,ha:!1,error:!1};this.Tb=null;this.w.error=!1;this.G={};this.i=null;this.ka=d||0;u.push(this)}var cb=void 0,db={};
if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function z(a,b){b||(b=t);a.prototype=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var pb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else pb={},u=[];function qb(a,b,c){pb[a]&&b&&(pb[a][b]=c)}function rb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;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=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var pb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else pb={},u=[];function qb(a,b,c){pb[a]&&b&&(pb[a][b]=c)}function rb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function sb(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}function tb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b} function sb(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}function tb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
function B(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=A(f))&&g.binding&&a.ra(g.type,g.binding,f,g.value),l=h.length}}}} function B(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=A(f))&&g.binding&&a.sa(g.type,g.binding,f,g.value),l=h.length}}}}
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c} function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
t.prototype={constructor:t,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ra:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Sa=this.G[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c), t.prototype={constructor:t,parent:null,toString:function(){return this.name?this.name:this.id||this.type},sa:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Ta=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.Za)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Za+": "+a)},P:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ga:function(){return this.w.ha=!0},Fa:function(a,b){b&&(this.w.ha=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.la;var c=a.i.la&b;return!!b&&c===b||!!(c&a.i.Qc)}return!1} this.P=function(a){this.j(a,this.Za)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Za+": "+a)},P:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ia:function(){return this.w.ha=!0},Ha:function(a,b){b&&(this.w.ha=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.ka;var c=a.i.ka&b;return!!b&&c===b||!!(c&a.i.Qc)}return!1}
function ub(a,b){if(a.w.Zb)return a.w.ab=!1,a.w.Zb=!1;if(a.w.error)return a.j(a.toString()+" error"),!1;a.w.ab=b;return a.w.ab}function vb(a,b){a.w.ab&&(b?a.w.Zb=!0:void 0===b&&a.j(a.toString()+" busy"));return a.w.ab}function H(a,b){a.w.error||(a.w.ready=!1!==b,a.w.ready&&(b=a.Sb,a.Sb=null,b&&b()))}function wb(a,b){b&&(a.w.ready?b():a.Sb=b);return a.w.ready}function xb(a){return a.w.error?(a.j(a.toString()+" error"),!0):!1}function yb(a,b){a.w.error=!0;a.P(b)} function ub(a,b){if(a.w.ac)return a.w.bb=!1,a.w.ac=!1;if(a.w.error)return a.j(a.toString()+" error"),!1;a.w.bb=b;return a.w.bb}function vb(a,b){a.w.bb&&(b?a.w.ac=!0:void 0===b&&a.j(a.toString()+" busy"));return a.w.bb}function H(a,b){a.w.error||(a.w.ready=!1!==b,a.w.ready&&(b=a.Tb,a.Tb=null,b&&b()))}function wb(a,b){b&&(a.w.ready?b():a.Tb=b);return a.w.ready}function xb(a){return a.w.error?(a.j(a.toString()+" error"),!0):!1}function yb(a,b){a.w.error=!0;a.P(b)}
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b}); Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
var zb="undefined"!==typeof ArrayBuffer,Ab="UNKNOWN ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Bb={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,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 zb="undefined"!==typeof ArrayBuffer,Ab="UNKNOWN ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Bb={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,panel:1024,keyboard:65536,key:131072,paper:1048576,disk:4194304,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
function Cb(a){t.call(this,"Panel",a,Cb,1024);this.f=this.B=this.Wa=this.D=this.H=this.I=0;this.L=this.M=this.J=!1;this.O=Db;this.A={};this.g={START:[1,1,!0,!1,this.ed],STEP:[1,1,!1,!1,this.fd],ENABLE:[1,1,!1,!1,this.ad],CONT:[1,1,!0,!1,this.Zc],DEP:[0,0,!0,!1,this.$c],EXAM:[1,1,!0,!1,this.bd],LOAD:[1,1,!0,!1,this.dd],TEST:[0,0,!0,!1,this.cd]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.gd,a]}z(Cb);var Db=7;function Eb(a,b){return a.g[b]&&a.g[b][1]}k=Cb.prototype;k.reset=function(){this.stop()}; function Cb(a){t.call(this,"Panel",a,Cb,1024);this.f=this.B=this.Wa=this.D=this.H=this.I=0;this.L=this.M=this.K=!1;this.O=Db;this.A={};this.g={START:[1,1,!0,!1,this.ed],STEP:[1,1,!1,!1,this.fd],ENABLE:[1,1,!1,!1,this.ad],CONT:[1,1,!0,!1,this.Zc],DEP:[0,0,!0,!1,this.$c],EXAM:[1,1,!0,!1,this.bd],LOAD:[1,1,!0,!1,this.dd],TEST:[0,0,!0,!1,this.cd]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.gd,a]}z(Cb);var Db=7;function Eb(a,b){return a.g[b]&&a.g[b][1]}k=Cb.prototype;k.reset=function(){this.stop()};
k.ra=function(a,b,c,d){if(this.C&&this.C.ra(a,b,c,d)||this.b&&this.b.ra(a,b,c,d)||this.i&&this.i.ra(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.I++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.A[b]=d?1:0,this.I++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, k.sa=function(a,b,c,d){if(this.C&&this.C.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.I++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.A[b]=d?1:0,this.I++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
b){return function(){Fb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Gb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Fb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Gb(a,b)}}(this,b),!0):this.parent.ra.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Hb(b,this,Ib);Jb(b,this.reset.bind(this));Kb(this);Lb(this)};k.Ga=function(a,b){b||(Mb(),this.reset());return!0};k.Fa=function(){return!0}; b){return function(){Fb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Gb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Fb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Gb(a,b)}}(this,b),!0):this.parent.sa.call(this,a,b,c,d)}};k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Hb(b,this,Ib);Jb(b,this.reset.bind(this));Kb(this);Lb(this)};k.Ia=function(a,b){b||(Mb(),this.reset());return!0};k.Ha=function(){return!0};
function Nb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Kb(a,b){for(var c in a.A)Nb(a,c,null!=b?b:a.A[c])}function Ob(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Lb(a){for(var b in a.g)Ob(a,b,a.g[b][1])}function Pb(a,b,c,d){a.G[b]&&(void 0===c&&(yb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?qa(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} function Nb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Kb(a,b){for(var c in a.A)Nb(a,c,null!=b?b:a.A[c])}function Ob(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Lb(a){for(var b in a.g)Ob(a,b,a.g[b][1])}function Pb(a,b,c,d){a.G[b]&&(void 0===c&&(yb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?qa(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}
function Fb(a,b){var c=a.g[b];Ob(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.L="DEP"==b,a.M="EXAM"==b)}function Gb(a,b){var c=a.g[b];c[2]&&c[3]&&(Ob(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.ed=function(a){a||this.b.w.W||(a=this.b,a.v.reset(),bc(a),Eb(this,"ENABLE")&&this.b.gb())};k.fd=function(){};k.ad=function(a){a||this.b.da()}; function Fb(a,b){var c=a.g[b];Ob(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.L="DEP"==b,a.M="EXAM"==b)}function Gb(a,b){var c=a.g[b];c[2]&&c[3]&&(Ob(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.ed=function(a){a||this.b.w.W||(a=this.b,a.v.reset(),bc(a),Eb(this,"ENABLE")&&this.b.ib())};k.fd=function(){};k.ad=function(a){a||this.b.da()};
k.Zc=function(a){if(!a&&!this.b.w.W)if(Eb(this,"ENABLE"))this.b.gb();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.hb(0),ub(a,!1);else try{var b=this.b.hb(1);0<b&&(cc(this.b,b),dc(this.b,b,!0),ec(this.b,b))}catch(c){"number"!=typeof c&&yb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.oa()}};k.$c=function(a){a&&!this.b.w.W&&(this.L&&fc(this),a=gc(this,this.Wa),this.O==Db?this.v.Ab(this.f,a):this.b.Ab(this.f,a))}; k.Zc=function(a){if(!a&&!this.b.w.W)if(Eb(this,"ENABLE"))this.b.ib();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.jb(0,null),ub(a,!1);else try{var b=this.b.jb(1);0<b&&(cc(this.b,b),dc(this.b,b,!0),ec(this.b,b))}catch(c){"number"!=typeof c&&yb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.pa()}};k.$c=function(a){a&&!this.b.w.W&&(this.L&&fc(this),a=gc(this,this.Wa),this.O==Db?this.v.Cb(this.f,a):this.b.Cb(this.f,a))};
k.bd=function(a){a||this.b.w.W||(this.M&&fc(this),a=this.O==Db?this.v.bb(this.f):this.b.bb(this.f),gc(this,a))};k.dd=function(a){a||this.b.w.W||hc(this,this.Wa)};k.cd=function(a){a?(this.J=!0,Kb(this,!0)):(this.J=!1,Kb(this),ic(this,0))};k.gd=function(a,b){this.Wa=a?this.Wa|1<<b:this.Wa&~(1<<b)};function fc(a){var b=1145>a.b.Va?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Na;Eb(a,"STEP")||(b=-b);hc(a,a.f&~c|a.f+b&c)} k.bd=function(a){a||this.b.w.W||(this.M&&fc(this),a=this.O==Db?this.v.cb(this.f):this.b.cb(this.f),gc(this,a))};k.dd=function(a){a||this.b.w.W||hc(this,this.Wa)};k.cd=function(a){a?(this.K=!0,Kb(this,!0)):(this.K=!1,Kb(this),ic(this,0))};k.gd=function(a,b){this.Wa=a?this.Wa|1<<b:this.Wa&~(1<<b)};function fc(a){var b=1145>a.b.Va?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Pa;Eb(a,"STEP")||(b=-b);hc(a,a.f&~c|a.f+b&c)}
function hc(a,b){a.f=b&a.v.Na;b=a.f;for(var c=0;22>c;c++)jc(a,"A"+c,b&1<<c)}function gc(a,b){a.B=b&65535;b=a.B;for(var c=0;16>c;c++)jc(a,"D"+c,b&1<<c);return a.B}function jc(a,b,c){a.A[b]=c;a.J||Nb(a,b,c)}function kc(a){return void 0!==a.G.S0}function ic(a,b){if(kc(a)){a.Wa=b;for(var c=0;22>c;c++)a.g["S"+c][1]=b&1<<c?1:0;Lb(a)}}k.stop=function(){hc(this,this.b.u[7])};k.jc=function(a){this.f=a};k.setData=function(a,b){b?this.D=a:this.B=a};k.kd=function(a){return(a?this.Wa:this.D)&65535}; function hc(a,b){a.f=b&a.v.Pa;b=a.f;for(var c=0;22>c;c++)jc(a,"A"+c,b&1<<c)}function gc(a,b){a.B=b&65535;b=a.B;for(var c=0;16>c;c++)jc(a,"D"+c,b&1<<c);return a.B}function jc(a,b,c){a.A[b]=c;a.K||Nb(a,b,c)}function kc(a){return void 0!==a.G.S0}function ic(a,b){if(kc(a)){a.Wa=b;for(var c=0;22>c;c++)a.g["S"+c][1]=b&1<<c?1:0;Lb(a)}}k.stop=function(){hc(this,this.b.u[7])};k.kc=function(a){this.f=a};k.setData=function(a,b){b?this.D=a:this.B=a};k.kd=function(a){return(a?this.Wa:this.D)&65535};
k.ee=function(a){this.D=a};var lc={},Ib=(lc[65400]=[null,null,Cb.prototype.kd,Cb.prototype.ee,"CNSW"],lc);function Mb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=sb(e.id);f||(a=!0,f=new Cb(e));B(f,d);a&&H(f)}}Za(Mb); k.ee=function(a){this.D=a};var lc={},Ib=(lc[65400]=[null,null,Cb.prototype.kd,Cb.prototype.ee,"CNSW"],lc);function Mb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=sb(e.id);f||(a=!0,f=new Cb(e));B(f,d);a&&H(f)}}Za(Mb);
function mc(a,b,c){t.call(this,"Bus",a,mc,64);this.b=b;this.i=c;this.J=a.busWidth||16;this.C=0;this.A=[];this.g=null;this.H=1<<this.J;this.Na=this.H-1;this.za=nc;this.ja=Math.log2(this.za);this.I=this.za>>2;this.v=this.za-1;this.D=this.H/this.za|0;this.$a=[];this.ma=0;this.f=!1;this.ac=0;this.B=[];this.Nc=[oc,pc,qc,rc];a=new I(this);sc(a,this.i);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(mc);var nc=8192,tc=nc-1; function mc(a,b,c){t.call(this,"Bus",a,mc,64);this.b=b;this.i=c;this.K=a.busWidth||16;this.C=0;this.A=[];this.g=null;this.H=1<<this.K;this.Pa=this.H-1;this.za=nc;this.ja=Math.log2(this.za);this.I=this.za>>2;this.v=this.za-1;this.D=this.H/this.za|0;this.ab=[];this.la=0;this.f=!1;this.cc=0;this.B=[];this.Nc=[oc,pc,qc,rc];a=new I(this);sc(a,this.i);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(mc);var nc=8192,tc=nc-1;
function oc(a,b){var c=-1,d=this.controller,e=d.$a[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.$a[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Da(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 oc(a,b){var c=-1,d=this.controller,e=d.ab[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.ab[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Fa(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
function pc(a,b,c){var d=!1,e=this.controller,f=e.$a[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.$a[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.ma):(e.Da(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 pc(a,b,c){var d=!1,e=this.controller,f=e.ab[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.ab[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Fa(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),
!0,!e.ma))}function qc(a,b){var c=-1,d=this.controller;a=d.$a[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Da(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} !0,!e.la))}function qc(a,b){var c=-1,d=this.controller;a=d.ab[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Fa(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
function rc(a,b,c){var d=!1,e=this.controller;a=e.$a[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Da(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 rc(a,b,c){var d=!1,e=this.controller;a=e.ab[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Fa(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))}
function uc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-nc,vc(a,c,nc,a.A),a.C=0);b&&(a.C=b,c=1<<b,a.Na=c-1,c-=nc,a.A=wc(a,c,nc),a.g?vc(a,c,nc,a.g):(xc(a,c,nc,yc,a),a.g=wc(a,c,nc)))}}k=mc.prototype;k.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();uc(this,16)};k.Ga=function(a,b){b||this.reset();return!0}; function uc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-nc,vc(a,c,nc,a.A),a.C=0);b&&(a.C=b,c=1<<b,a.Pa=c-1,c-=nc,a.A=wc(a,c,nc),a.g?vc(a,c,nc,a.g):(xc(a,c,nc,yc,a),a.g=wc(a,c,nc)))}}k=mc.prototype;k.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();uc(this,16)};k.Ia=function(a,b){b||this.reset();return!0};
function xc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ja;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.za,n=a.za-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Ob+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.F+n;f=m+a.za;g-=n;h++;continue}}return zc(1,f,g)}f=new I(a,f,n,a.za,d,e);sc(f,a.i,l);a.Y[h++]=f;f=m+a.za;g-=n}return 0>=g?(d==Ac&&(a.ac+=c),a.status((c>>10)+"Kb "+Bc[d]+" at "+qa(b)),!0):zc(2,b,c)} function xc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ja;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.za,n=a.za-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Pb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Pb){n=l.size-(f-m);n>g&&(n=g);l.Pb=f-l.F+n;f=m+a.za;g-=n;h++;continue}}return zc(1,f,g)}f=new I(a,f,n,a.za,d,e);sc(f,a.i,l);a.Y[h++]=f;f=m+a.za;g-=n}return 0>=g?(d==Ac&&(a.cc+=c),a.status((c>>10)+"Kb "+Bc[d]+" at "+qa(b)),!0):zc(2,b,c)}
function wc(a,b,c){var d=[];for(b>>>=a.ja;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.za;return d}function vc(a,b,c,d){var e=0;for(b>>>=a.ja;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.za}}k.Hb=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].Ub(a&this.v,a)};k.Tb=function(a){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.ma++;a=this.Y[(a&this.Na)>>>this.ja].fc(a&this.v,a);this.ma--;return a}; function wc(a,b,c){var d=[];for(b>>>=a.ja;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.za;return d}function vc(a,b,c,d){var e=0;for(b>>>=a.ja;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.za}}k.Ib=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Pa)>>>this.ja].Vb(a&this.v,a)};k.Ub=function(a){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Pa)>>>this.ja].hc(a&this.v,a);this.la--;return a};
k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].qa(a&this.v,a)};k.bb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Na)>>>this.ja;this.f=!1;this.ma++;a=this.Y[c].gc(b,a);this.ma--;return a};k.zb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Xb(a&this.v,b&255,a)};k.qb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.ma++;this.Y[(a&this.Na)>>>this.ja].Yb(a&this.v,b&255,a);this.ma--}; k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Pa)>>>this.ja].ra(a&this.v,a)};k.cb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Pa)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].ic(b,a);this.la--;return a};k.Bb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Pa)>>>this.ja].Zb(a&this.v,b&255,a)};k.qb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Pa)>>>this.ja].$b(a&this.v,b&255,a);this.la--};
k.fb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Pb(a&this.v,b&65535,a)};k.Ab=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Na)>>>this.ja;this.f=!1;this.ma++;this.Y[d].lc(c,b&65535,a);this.ma--}; k.hb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Pa)>>>this.ja].Qb(a&this.v,b&65535,a)};k.Cb=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Pa)>>>this.ja;this.f=!1;this.la++;this.Y[d].mc(c,b&65535,a);this.la--};
function Dc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Ta||e.Sc){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 Ec(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&tc;if(void 0!==a.$a[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.$a[m]=[d,e,f,g,l||"unknown",h,!1]}return!0} function Dc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Ua||e.Sc){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 Ec(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&tc;if(void 0!==a.ab[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.ab[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
function Hb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Va)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r<v;r++,e+=2)if(n&&1<v&&(n=f[4]+r),!Ec(a,e,e,g,h,l,m,b.la||64,n||b.Za))return!1}}return!0}function Jb(a,b){a.B.push(b)} function Hb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Va)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r<v;r++,e+=2)if(n&&1<v&&(n=f[4]+r),!Ec(a,e,e,g,h,l,m,b.ka||64,n||b.Za))return!1}}return!0}function Jb(a,b){a.B.push(b)}
k.Da=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.Ha|=b),this.b.sa(4,0,a))};function Fc(a){var b=a.f;a.f=!1;return b}function zc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={fa:0,kc:-1}}z(K);k=K.prototype; k.Fa=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.Ja|=b),this.b.ta(4,0,a))};function Fc(a){var b=a.f;a.f=!1;return b}function zc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={fa:0,lc:-1}}z(K);k=K.prototype;
k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.kc=Gc(c,function(){e.f.Jb|=128;e.f.Jb&64&&Hc(e.b,e.f.ce);e.C&&e.C.oa(1);Pc(e.b,e.f.kc,1E3/60)});this.f.ce=Qc(64,6);Hb(b,this,Rc);Jb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.Jb=128;Pc(this.b,this.f.kc,1E3/60,!0)};k.sd=function(){return this.f.Jb};k.me=function(a){this.f.Jb=a&192};k.ud=function(){var a=this.b;return a.J&62337|a.jb<<5|a.ib<<1}; k.Ga=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.lc=Gc(c,function(){e.f.Kb|=128;e.f.Kb&64&&Hc(e.b,e.f.ce);e.C&&e.C.pa(1);Pc(e.b,e.f.lc,1E3/60)});this.f.ce=Qc(64,6);Hb(b,this,Rc);Jb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.Kb=128;Pc(this.b,this.f.lc,1E3/60,!0)};k.sd=function(){return this.f.Kb};k.me=function(a){this.f.Kb=a&192};k.ud=function(){var a=this.b;return a.Ba&-3199|a.$a<<5|a.lb<<1};k.oe=function(a){Sc(this.b,a&-129|this.b.Ba&128)};
k.oe=function(a){var b=this.b;a&=62337;if(b.J!=a){b.J=a;b.jb=a>>5&3;b.ib=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Sc(b))}};k.vd=function(){var a=this.b;a.J&57344||(a.Ac=a.S&65535);a=a.Ac;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.wd=function(){var a=this.b;a.J&57344||(a.Cc=a.Ib);return a.Cc};k.xd=function(){return this.b.pb};k.pe=function(a){var b=this.b;1170>b.Va&&(a&=-49);b.pb!=a&&(b.pb=a,b.Ja=a&16?4194303:262143,Sc(b))}; k.vd=function(){var a=this.b;a.Ba&57344||(a.Hb=a.oa>>16&65535);a=a.Hb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.wd=function(){var a=this.b;a.Ba&57344||(a.Jb=a.oa&65535);return a.Jb};k.xd=function(){return this.b.fb};k.pe=function(a){var b=this.b;1170>b.Va&&(a&=-49);b.fb!=a&&(b.fb=a,b.Ca=a&16?4194303:262143,Tc(b))};k.Yd=function(a){a=a>>1&63;var b=this.b.Ob[a>>1];return a&1?b>>16:b&65535};
k.Yd=function(a){a=a>>1&63;var b=this.b.Nb[a>>1];return a&1?b>>16:b&65535};k.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Nb[c]=b&1?this.b.Nb[c]&65535|(a&63)<<16:this.b.Nb[c]&-65536|a&65534};k.Rd=function(a){return this.b.V[1][a>>1&7]};k.Je=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Pd=function(a){return this.b.V[1][(a>>1&7)+8]};k.He=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Qd=function(a){return this.b.ya[1][a>>1&7]};k.Ie=function(a,b){b=b>>1&7;this.b.ya[1][b]=a;this.b.V[1][b]&=65295}; k.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Ob[c]=b&1?this.b.Ob[c]&65535|(a&63)<<16:this.b.Ob[c]&-65536|a&65534};k.Rd=function(a){return this.b.V[1][a>>1&7]};k.Je=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Pd=function(a){return this.b.V[1][(a>>1&7)+8]};k.He=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Qd=function(a){return this.b.ya[1][a>>1&7]};k.Ie=function(a,b){b=b>>1&7;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.Od=function(a){return this.b.ya[1][(a>>1&7)+8]};
k.Od=function(a){return this.b.ya[1][(a>>1&7)+8]};k.Ge=function(a,b){b=(b>>1&7)+8;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.rd=function(a){return this.b.V[0][a>>1&7]};k.le=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.pd=function(a){return this.b.V[0][(a>>1&7)+8]};k.je=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.qd=function(a){return this.b.ya[0][a>>1&7]};k.ke=function(a,b){b=b>>1&7;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.od=function(a){return this.b.ya[0][(a>>1&7)+8]}; k.Ge=function(a,b){b=(b>>1&7)+8;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.rd=function(a){return this.b.V[0][a>>1&7]};k.le=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.pd=function(a){return this.b.V[0][(a>>1&7)+8]};k.je=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.qd=function(a){return this.b.ya[0][a>>1&7]};k.ke=function(a,b){b=b>>1&7;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.od=function(a){return this.b.ya[0][(a>>1&7)+8]};k.ie=function(a,b){b=(b>>1&7)+8;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};
k.ie=function(a,b){b=(b>>1&7)+8;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.Xd=function(a){return this.b.V[3][a>>1&7]};k.Pe=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Vd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ne=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Wd=function(a){return this.b.ya[3][a>>1&7]};k.Oe=function(a,b){b=b>>1&7;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.Ud=function(a){return this.b.ya[3][(a>>1&7)+8]};k.Me=function(a,b){b=(b>>1&7)+8;this.b.ya[3][b]=a;this.b.V[3][b]&=65295}; k.Xd=function(a){return this.b.V[3][a>>1&7]};k.Pe=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Vd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ne=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Wd=function(a){return this.b.ya[3][a>>1&7]};k.Oe=function(a,b){b=b>>1&7;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.Ud=function(a){return this.b.ya[3][(a>>1&7)+8]};k.Me=function(a,b){b=(b>>1&7)+8;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.zb=function(a){a&=7;return this.b.N&2048?this.b.Xa[a]:this.b.u[a]};
k.xb=function(a){a&=7;return this.b.N&2048?this.b.Xa[a]:this.b.u[a]};k.Bb=function(a,b){b&=7;this.b.N&2048?this.b.Xa[b]=a:this.b.u[b]=a};k.Cd=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.ue=function(a){this.b.N&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Fd=function(){return this.b.u[7]};k.xe=function(a){this.b.u[7]=a};k.yb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Xa[a]};k.Cb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Xa[b]=a}; k.Db=function(a,b){b&=7;this.b.N&2048?this.b.Xa[b]=a:this.b.u[b]=a};k.Cd=function(){return this.b.N&49152?this.b.Ka[0]:this.b.u[6]};k.ue=function(a){this.b.N&49152?this.b.Ka[0]=a:this.b.u[6]=a};k.Fd=function(){return this.b.u[7]};k.xe=function(a){this.b.u[7]=a};k.Ab=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Xa[a]};k.Eb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Xa[b]=a};k.Dd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ka[1]};
k.Dd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]};k.ve=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Ed=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.we=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.md=function(a){return this.b.Gc[a-65504>>1]};k.ge=function(a,b){this.b.Gc[b-65504>>1]=a};k.Dc=function(a){if(65520==a){a=0;switch(Ac){case Ac:a=this.v.ac}a=(a>>6)-1}else a=0;return a};k.Kc=function(){};k.Td=function(){return 1}; k.ve=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ka[1]=a};k.Ed=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ka[3]};k.we=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ka[3]=a};k.md=function(a){return this.b.Gc[a-65504>>1]};k.ge=function(a,b){this.b.Gc[b-65504>>1]=a};k.Dc=function(a){if(65520==a){a=0;switch(Ac){case Ac:a=this.v.cc}a=(a>>6)-1}else a=0;return a};k.Kc=function(){};k.Td=function(){return 1};k.Le=function(){};k.ld=function(){return this.b.Ja};
k.Le=function(){};k.ld=function(){return this.b.Ha};k.fe=function(){this.b.Ha=0};k.td=function(){return this.b.Fc};k.ne=function(a,b){b&1||(a&=255);this.b.Fc=a};k.yd=function(a){return a?this.b.ic:0};k.qe=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ic=a;b.K|=2};k.Sd=function(a){return a?this.b.Vb&65280:0};k.Ke=function(a){this.b.Vb=a|255};k.Bd=function(){return Tc(this.b)};k.te=function(a){Uc(this.b,a&-1793|Tc(this.b)&1792);this.b.K|=128}; k.fe=function(){this.b.Ja=0};k.td=function(){return this.b.Fc};k.ne=function(a,b){b&1||(a&=255);this.b.Fc=a};k.yd=function(a){return a?this.b.jc:0};k.qe=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.jc=a;b.J|=2};k.Sd=function(a){return a?this.b.Xb&65280:0};k.Ke=function(a){this.b.Xb=a|255};k.Bd=function(){return Uc(this.b)};k.te=function(a){Vc(this.b,a&-1793|Uc(this.b)&1792);this.b.J|=128};k.Jc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)};
k.Jc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)};
var L={},Rc=(L[61568]=[null,null,K.prototype.Yd,K.prototype.Qe,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Rd,K.prototype.Je,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Pd,K.prototype.He,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Qd,K.prototype.Ie,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Od,K.prototype.Ge,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.rd,K.prototype.le,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.pd,K.prototype.je,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.qd, var L={},Rc=(L[61568]=[null,null,K.prototype.Yd,K.prototype.Qe,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Rd,K.prototype.Je,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Pd,K.prototype.He,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Qd,K.prototype.Ie,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Od,K.prototype.Ge,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.rd,K.prototype.le,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.pd,K.prototype.je,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.qd,
K.prototype.ke,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.od,K.prototype.ie,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.xd,K.prototype.pe,"MMR3",1,1145],L[65382]=[null,null,K.prototype.sd,K.prototype.me,"LKS"],L[65402]=[null,null,K.prototype.ud,K.prototype.oe,"MMR0",1,1145],L[65404]=[null,null,K.prototype.vd,K.prototype.Jc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.wd,K.prototype.Jc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.Xd,K.prototype.Pe,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Vd, K.prototype.ke,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.od,K.prototype.ie,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.xd,K.prototype.pe,"MMR3",1,1145],L[65382]=[null,null,K.prototype.sd,K.prototype.me,"LKS"],L[65402]=[null,null,K.prototype.ud,K.prototype.oe,"MMR0",1,1145],L[65404]=[null,null,K.prototype.vd,K.prototype.Jc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.wd,K.prototype.Jc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.Xd,K.prototype.Pe,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Vd,
K.prototype.Ne,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Wd,K.prototype.Oe,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Ud,K.prototype.Me,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.xb,K.prototype.Bb,"R0SET0"],L[65473]=[null,null,K.prototype.xb,K.prototype.Bb,"R1SET0"],L[65474]=[null,null,K.prototype.xb,K.prototype.Bb,"R2SET0"],L[65475]=[null,null,K.prototype.xb,K.prototype.Bb,"R3SET0"],L[65476]=[null,null,K.prototype.xb,K.prototype.Bb,"R4SET0"],L[65477]=[null,null,K.prototype.xb,K.prototype.Bb, K.prototype.Ne,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Wd,K.prototype.Oe,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Ud,K.prototype.Me,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.zb,K.prototype.Db,"R0SET0"],L[65473]=[null,null,K.prototype.zb,K.prototype.Db,"R1SET0"],L[65474]=[null,null,K.prototype.zb,K.prototype.Db,"R2SET0"],L[65475]=[null,null,K.prototype.zb,K.prototype.Db,"R3SET0"],L[65476]=[null,null,K.prototype.zb,K.prototype.Db,"R4SET0"],L[65477]=[null,null,K.prototype.zb,K.prototype.Db,
"R5SET0"],L[65478]=[null,null,K.prototype.Cd,K.prototype.ue,"R6KERNEL"],L[65479]=[null,null,K.prototype.Fd,K.prototype.xe,"R7KERNEL"],L[65480]=[null,null,K.prototype.yb,K.prototype.Cb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.yb,K.prototype.Cb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.yb,K.prototype.Cb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.yb,K.prototype.Cb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.yb,K.prototype.Cb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.yb, "R5SET0"],L[65478]=[null,null,K.prototype.Cd,K.prototype.ue,"R6KERNEL"],L[65479]=[null,null,K.prototype.Fd,K.prototype.xe,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ab,K.prototype.Eb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ab,K.prototype.Eb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ab,K.prototype.Eb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ab,K.prototype.Eb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ab,K.prototype.Eb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ab,
K.prototype.Cb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Dd,K.prototype.ve,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Ed,K.prototype.we,"R6USER",1,1145],L[65504]=[null,null,K.prototype.md,K.prototype.ge,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Dc,K.prototype.Kc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Dc,K.prototype.Kc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Td,K.prototype.Le,"SYSID",1,1170],L[65526]=[null,null,K.prototype.ld,K.prototype.fe,"CPUERR",1,1170],L[65528]= K.prototype.Eb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Dd,K.prototype.ve,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Ed,K.prototype.we,"R6USER",1,1145],L[65504]=[null,null,K.prototype.md,K.prototype.ge,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Dc,K.prototype.Kc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Dc,K.prototype.Kc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Td,K.prototype.Le,"SYSID",1,1170],L[65526]=[null,null,K.prototype.ld,K.prototype.fe,"CPUERR",1,1170],L[65528]=
[null,null,K.prototype.td,K.prototype.ne,"MB",1,1170],L[65530]=[null,null,K.prototype.yd,K.prototype.qe,"PIR"],L[65532]=[null,null,K.prototype.Sd,K.prototype.Ke,"SL"],L[65534]=[null,null,K.prototype.Bd,K.prototype.te,"PSW"],L);Za(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new Vc(c);B(c,d);break;case "rl11":c=new M(c),B(c,d)}}});var Wc; [null,null,K.prototype.td,K.prototype.ne,"MB",1,1170],L[65530]=[null,null,K.prototype.yd,K.prototype.qe,"PIR"],L[65532]=[null,null,K.prototype.Sd,K.prototype.Ke,"SL"],L[65534]=[null,null,K.prototype.Bd,K.prototype.te,"PSW"],L);Za(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new Wc(c);B(c,d);break;case "rl11":c=new M(c),B(c,d)}}});var Xc;
if(zb){var Xc=new ArrayBuffer(2);(new DataView(Xc)).setUint16(0,256,!0);Wc=256===(new Uint16Array(Xc))[0]}else Wc=!1;var Yc=Wc; if(zb){var Yc=new ArrayBuffer(2);(new DataView(Yc)).setUint16(0,256,!0);Xc=256===(new Uint16Array(Yc))[0]}else Xc=!1;var Zc=Xc;
function I(a,b,c,d,e,f){this.v=a;this.id=Zc+=2;this.b=null;this.F=b;this.Ob=c;this.size=d||0;this.type=e||$c;this.f=e==ad;this.controller=null;sc(this);this.Ta=this.Sc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],bd(this,f.Nc);else if(zb)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),bd(this,Yc?cd:dd);else{a=this.b=Array(this.size>> function I(a,b,c,d,e,f){this.v=a;this.id=$c+=2;this.b=null;this.F=b;this.Pb=c;this.size=d||0;this.type=e||ad;this.f=e==bd;this.controller=null;sc(this);this.Ua=this.Sc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],cd(this,f.Nc);else if(zb)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),cd(this,Zc?dd:ed);else{a=this.b=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;bd(this,ed)}else bd(this)}var $c=0,Ac=1,ad=2,yc=4,Bc=["NONE","RAM","ROM","VID","H/W"],Zc=0; 2);for(f=0;f<a.length;f++)a[f]=0;cd(this,fd)}else cd(this)}var ad=0,Ac=1,bd=2,yc=4,Bc=["NONE","RAM","ROM","VID","H/W"],$c=0;
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(zb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(zb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ta=!0}return!1},lb:function(a,b){b?this.C++||fd(this,gd,!1):this.g++||hd(this,gd,!1)},J:function(a,b){this.i&&F(this.i,128)&&E(this.i, I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(zb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(zb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ua=!0}return!1},nb:function(a,b){b?this.C++||gd(this,hd,!1):this.g++||id(this,hd,!1)},K:function(a,b){this.i&&F(this.i,128)&&E(this.i,
"attempt to read invalid address "+J(this.i,b),!0);this.v.Da(b,32,2);return 255},A:function(a,b,c){this.i&&F(this.i,128)&&E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0);this.v.Da(c,32,4)},L:function(a,b){return this.Ub(a++,b++)|this.Ub(a,b)<<8},H:function(a,b,c){this.Xb(a++,b&255,c++);this.Xb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Da(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ "attempt to read invalid address "+J(this.i,b),!0);this.v.Fa(b,32,2);return 255},A: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.Fa(c,32,4)},L:function(a,b){return this.Vb(a++,b++)|this.Vb(a,b)<<8},H:function(a,b,c){this.Zb(a++,b&255,c++);this.Zb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Fa(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+
1]&255)<<8},ta:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ta=!0},Ja:function(a,b,c){a&1&&this.v.Da(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Ta=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,1,c.M)&&c.da(!0)}return this.fc(a,b)},$:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,2,c.M)&&c.da(!0)}return this.gc(a,b)},ka:function(a, 1]&255)<<8},ua:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ua=!0},La:function(a,b,c){a&1&&this.v.Fa(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.Ua=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;jd(c,this.F+a,1,c.M)&&c.da(!0)}return this.hc(a,b)},Sa:function(a,b){if(this.i&&null!=this.F){var c=this.i;jd(c,this.F+a,2,c.M)&&c.da(!0)}return this.ic(a,b)},Za:function(a,
b,c){if(this.i&&null!=this.F){var d=this.i;id(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.Yb(a,b,c)},wa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;id(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.lc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Da(b,64,2);return this.D.getUint16(a,!0)},Qa:function(a,b){a&1&&this.v.Da(b,64,2); b,c){if(this.i&&null!=this.F){var d=this.i;jd(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.$b(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;jd(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.mc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Fa(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Fa(b,64,2);
a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Ta=!0},Za:function(a,b,c){this.G[a]=b;this.Ta=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},va:function(a,b,c){a&1&&this.v.Da(c,64,4);this.D.setUint16(a,b,!0);this.Ta=!0},xa:function(a,b,c){a&1&&this.v.Da(c,64,4);this.I[a>>1]=b;this.Ta=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Ua=!0},ma:function(a,b,c){this.G[a]=b;this.Ua=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&this.v.Fa(c,64,4);this.D.setUint16(a,b,!0);this.Ua=!0},Ca:function(a,b,c){a&1&&this.v.Fa(c,64,4);this.I[a>>1]=b;this.Ua=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,
b)+")",!0)}};function sc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&hd(a,gd,!1),(a.C=c.C)&&fd(a,gd,!1))}function jd(a,b){b?--a.C||(a.Xb=a.f?a.A:a.Yb,a.Pb=a.f?a.H:a.lc):--a.g||(a.Ub=a.fc,a.qa=a.gc)}function fd(a,b,c){c&&a.C||(a.Xb=!a.f&&b[1]||a.A,a.Pb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Yb=b[1]||a.A,a.lc=b[3]||a.H}function hd(a,b,c){c&&a.g||(a.Ub=b[0]||a.J,a.qa=b[2]||a.L);if(c||void 0===c)a.fc=b[0]||a.J,a.gc=b[2]||a.L}function bd(a,b){b||(b=kd);hd(a,b,void 0);fd(a,b,void 0)} b)+")",!0)}};function sc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&id(a,hd,!1),(a.C=c.C)&&gd(a,hd,!1))}function kd(a,b){b?--a.C||(a.Zb=a.f?a.A:a.$b,a.Qb=a.f?a.H:a.mc):--a.g||(a.Vb=a.hc,a.ra=a.ic)}function gd(a,b,c){c&&a.C||(a.Zb=!a.f&&b[1]||a.A,a.Qb=!a.f&&b[3]||a.H);if(c||void 0===c)a.$b=b[1]||a.A,a.mc=b[3]||a.H}function id(a,b,c){c&&a.g||(a.Vb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.hc=b[0]||a.K,a.ic=b[2]||a.L}function cd(a,b){b||(b=ld);id(a,b,void 0);gd(a,b,void 0)}
var kd=[],ed=[I.prototype.S,I.prototype.ta,I.prototype.ca,I.prototype.Ja],gd=[I.prototype.O,I.prototype.ka,I.prototype.$,I.prototype.wa];if(zb)var dd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.va],cd=[I.prototype.R,I.prototype.Za,I.prototype.Qa,I.prototype.xa]; var ld=[],fd=[I.prototype.S,I.prototype.ua,I.prototype.ca,I.prototype.La],hd=[I.prototype.O,I.prototype.Za,I.prototype.Sa,I.prototype.xa];if(zb)var ed=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.wa],dd=[I.prototype.R,I.prototype.ma,I.prototype.ba,I.prototype.Ca];
function ld(a,b){t.call(this,"CPU",a,ld,1);b=a.cycles||b;var c=a.multiplier||1;this.Db=0;this.mb=b;this.cb=c;this.Fb=Math.round(this.mb/1E4)/100;this.ob=this.Fb*this.cb;this.w.W=!1;this.w.Wb=!1;this.w.sb=a.autoStart;this.w.tb=!1;this.Kb=this.va=0;this.Lb=a.csStart;this.ub=a.csInterval;this.vb=a.csStop;this.L=[];this.zc=this.be.bind(this);H(this)}z(ld);var md=["power","reset"];k=ld.prototype; function md(a,b){t.call(this,"CPU",a,md,1);b=a.cycles||b;var c=a.multiplier||1;this.tb=0;this.mb=b;this.eb=c;this.Fb=Math.round(this.mb/1E4)/100;this.pb=this.Fb*this.eb;this.w.W=!1;this.w.Yb=!1;this.w.sb=a.autoStart;this.w.ub=!1;this.Lb=this.ua=0;this.Mb=a.csStart;this.wb=a.csInterval;this.xb=a.csStop;this.K=[];this.Cc=this.be.bind(this);H(this)}z(md);var nd=["power","reset"];k=md.prototype;
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.A=a.A;for(b=0;b<md.length;b++)(c=this.G[md[b]])&&this.C.ra(null,md[b],c);a=nd(a,"autoStart");null!=a&&(this.w.sb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1}; k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.A=a.A;for(b=0;b<nd.length;b++)(c=this.G[nd[b]])&&this.C.sa(null,nd[b],c);a=od(a,"autoStart");null!=a&&(this.w.sb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
k.Ga=function(a,b){if(!b){if(a&&this.restore){od(this);if(!this.restore(a))return!1;pd(this)}else this.reset();this.i?(a=this.i,b=this.w.sb,a.ib=!0,a.j("Type ? for help with PDPjs Debugger commands"),qd(a),b||a.rb(),a.Ra&&(b=a.Ra,a.Ra=null,rd(a,b))):this.j("No debugger detected")}return!0};k.Fa=function(a){return a?this.save():!0};k.sb=function(){return this.w.sb||!this.i&&void 0===this.G.run?(this.gb(),!0):!1};k.rc=function(){return 0}; k.Ia=function(a,b){if(!b){if(a&&this.restore){pd(this);if(!this.restore(a))return!1;qd(this)}else this.reset();this.i?(a=this.i,b=this.w.sb,a.kb=!0,a.j("Type ? for help with PDPjs Debugger commands"),rd(a),b||a.rb(),a.$a&&(b=a.$a,a.$a=null,sd(a,b))):this.j("No debugger detected")}return!0};k.Ha=function(a){return a?this.save():!0};k.sb=function(){return this.w.sb||!this.i&&void 0===this.G.run?(this.ib(),!0):!1};k.sc=function(){return 0};
function pd(a){void 0===a.Lb&&(a.Lb=0);void 0===a.ub&&(a.ub=-1);void 0===a.vb&&(a.vb=-1);a.w.tb=0<=a.Lb&&0<a.ub;a.w.tb&&(a.Kb=0,a.va=a.Lb-a.ka)}function ec(a,b){if(a.w.tb){var c=!1;a.Kb=a.Kb+a.rc()|0;a.va-=b;0>=a.va&&(a.va+=a.ub,c=!0);0<=a.vb&&a.vb<=sd(a)&&(a.ub=a.vb=-1,pd(a),a.da(),c=!0);c&&a.j(sd(a)+" cycles: checksum="+p(a.Kb))}} function qd(a){void 0===a.Mb&&(a.Mb=0);void 0===a.wb&&(a.wb=-1);void 0===a.xb&&(a.xb=-1);a.w.ub=0<=a.Mb&&0<a.wb;a.w.ub&&(a.Lb=0,a.ua=a.Mb-a.ia)}function ec(a,b){if(a.w.ub){var c=!1;a.Lb=a.Lb+a.sc()|0;a.ua-=b;0>=a.ua&&(a.ua+=a.wb,c=!0);0<=a.xb&&a.xb<=td(a)&&(a.wb=a.xb=-1,qd(a),a.da(),c=!0);c&&a.j(td(a)+" cycles: checksum="+p(a.Lb))}}
k.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.w.ha)a=!0;else{var b=null,c,h=rb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.w.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.w.ha);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.w.ready?"powered yet":"ready yet"+(b.Sb?" (waiting for notification)":""))+".");a=!1}a&&(d.w.W?d.da():d.gb())}, k.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.w.ha)a=!0;else{var b=null,c,h=rb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.w.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.w.ha);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.w.ready?"powered yet":"ready yet"+(b.Tb?" (waiting for notification)":""))+".");a=!1}a&&(d.w.W?d.da():d.ib())},
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){td(d,d.cb<<1,!0)},c.textContent=this.ob.toFixed(2)+"Mhz",!0}return!1};k.oa=function(a){this.C&&this.C.oa(a)};function dc(a,b,c){a.ka+=b;c&&(a.ia=a.b=a.I=0)}function ud(a,b){var c=1;b&&1<a.cb&&a.ta&&(c=a.ta/a.Fb);a.xc=Math.round(1E3/30);a.nb=Math.floor(a.mb/30*c);b||(a.wa=a.nb);a.Gb=0}function sd(a){return a.ka+a.$+a.ia-a.b}function od(a){a.ta=0;a.yc=0;a.ka=a.$=a.ia=a.b=a.I=0;pd(a);td(a,1)} !0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){ud(d,d.eb<<1,!0)},c.textContent=this.pb.toFixed(2)+"Mhz",!0}return!1};k.pa=function(a){this.C&&this.C.pa(a)};function dc(a,b,c){a.ia+=b;c&&(a.ca=a.b=a.I=0)}function vd(a,b){var c=1;b&&1<a.eb&&a.ma&&(c=a.ma/a.Fb);a.zc=Math.round(1E3/30);a.ob=Math.floor(a.mb/30*c);b||(a.wa=a.ob);a.Gb=0}function td(a){return a.ia+a.X+a.ca-a.b}function pd(a){a.ma=0;a.Ac=0;a.ia=a.X=a.ca=a.b=a.I=0;qd(a);ud(a,1)}
function td(a,b,c){var d=!1;if(void 0!==b){.8>a.ta/a.ob?b=1:d=!0;a.cb=b;b=a.Fb*a.cb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.rb()}dc(a,a.$);a.$=0;a.X=Aa();a.ca=0;ud(a);return d}function Gc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&b<a.L.length&&(d||0>a.L[b][0])&&(c=a.mb*a.cb/1E3*c|0,a.w.W&&(c+=vd(a)),a.L[b][0]=c)} function ud(a,b,c){var d=!1;if(void 0!==b){.8>a.ma/a.pb?b=1:d=!0;a.eb=b;b=a.Fb*a.eb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.rb()}dc(a,a.X);a.X=0;a.S=Aa();a.ba=0;vd(a);return d}function Gc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&b<a.K.length&&(d||0>a.K[b][0])&&(c=a.mb*a.eb/1E3*c|0,a.w.W&&(c+=wd(a)),a.K[b][0]=c)}
function wd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function cc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function vd(a,b){var c=a.ia-=a.b;a.b=a.I=0;b&&(a.ia=0);return c} function xd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function cc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function wd(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c}
k.be=function(){if(this.w.W){this.Gb>=this.mb&&ud(this,!0);this.Ra=0;this.kb=Aa();if(this.ca){var a=this.kb-this.ca;a>this.xc&&(this.X+=a,this.X>this.kb&&(this.X=this.kb))}try{do{var b=wd(this,this.w.tb?1:this.nb);try{this.hb(b)}catch(e){if("number"!=typeof e)throw e;}b=vd(this,!0);this.Ra+=b;this.$+=b;ec(this,b);cc(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.nb;15<=++this.yc&&(this.oa(),this.yc=0);break}}while(this.w.W)}catch(e){this.da();this.C&&this.C.stop(Aa(),sd(this));yb(this,e.stack||e.message); k.be=function(){if(this.w.W){this.Gb>=this.mb&&vd(this,!0);this.La=0;this.kb=Aa();if(this.ba){var a=this.kb-this.ba;a>this.zc&&(this.S+=a,this.S>this.kb&&(this.S=this.kb))}try{do{var b=xd(this,this.w.ub?1:this.ob);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=wd(this,!0);this.La+=b;this.X+=b;ec(this,b);cc(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.ob;15<=++this.Ac&&(this.pa(),this.Ac=0);break}}while(this.w.W)}catch(e){this.da();this.C&&this.C.stop(Aa(),td(this));yb(this,e.stack||e.message);
return}if(this.w.W){a=setTimeout;b=this.zc;this.ca=Aa();var c=this.xc;this.Ra&&(c=Math.round(c*this.Ra/this.nb));var c=c-(this.ca-this.kb),d=this.ca-this.X;d&&(this.ta=Math.round(this.$/(10*d))/100,864E5<=d&&(this.ka=0,td(this)));if(0>c||this.ta<this.ob)-1E3>c&&(this.X-=c),c=0;this.Gb+=this.Ra;this.ca+=c;a(b,c)}}}; return}if(this.w.W){a=setTimeout;b=this.Cc;this.ba=Aa();var c=this.zc;this.La&&(c=Math.round(c*this.La/this.ob));var c=c-(this.ba-this.kb),d=this.ba-this.S;d&&(this.ma=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ia=0,ud(this)));if(0>c||this.ma<this.pb)-1E3>c&&(this.S-=c),c=0;this.Gb+=this.La;this.ba+=c;a(b,c)}}};
k.gb=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;td(this);this.w.W=!0;this.w.Wb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.rb(!0),this.C.start(this.X,sd(this)));setTimeout(this.zc,0);return!0};k.hb=function(){return 0};k.da=function(a){var b=!1;if(this.w.W){vd(this);dc(this,this.$);this.$=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),sd(this));b=!0}this.w.complete=a;return b}; k.ib=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;ud(this);this.w.W=!0;this.w.Yb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.rb(!0),this.C.start(this.S,td(this)));setTimeout(this.Cc,0);return!0};k.jb=function(){return 0};k.da=function(a){var b=!1;if(this.w.W){wd(this);dc(this,this.X);this.X=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),td(this));b=!0}this.w.complete=a;return b};
function xd(a){this.Va=+a.model||1170;this.uc=a.addrReset||0;ld.call(this,a,6666667);this.decode=1120==this.Va?yd.bind(this):zd.bind(this);Ad(this);this.M=0;this.O=null;this.w.complete=!1}z(xd,ld);k=xd.prototype;k.reset=function(){this.status("model "+this.Va);this.w.W&&this.da();Ad(this);od(this);this.w.error=!1;this.parent.reset.call(this)}; function yd(a){this.Va=+a.model||1170;this.xc=a.addrReset||0;md.call(this,a,6666667);this.decode=1120==this.Va?zd.bind(this):Ad.bind(this);Bd(this);this.M=0;this.O=null;this.w.complete=!1}z(yd,md);k=yd.prototype;k.reset=function(){this.status("model "+this.Va);this.w.W&&this.da();Bd(this);pd(this);this.w.error=!1;this.parent.reset.call(this)};
function Ad(a){a.T=65536;a.U=32768;a.aa=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.uc];a.Xa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.B=0;a.ib=0;a.Xc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ya=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Nb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, function Bd(a){a.T=65536;a.U=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.xc];a.Xa=[0,0,0,0,0,0];a.Ka=[0,0,0,0];a.B=0;a.lb=0;a.Xc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ya=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Ob=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0];a.Gc=[0,0,0,0,0,0,0,0];a.Fc=0;a.K=0;a.D=a.H=0;a.g=a.f=a.Eb=0;a.xa=-1;bc(a)}function bc(a){a.Vb=255;a.Ha=0;a.ic=0;a.J=0;a.Ac=0;a.Cc=0;a.pb=0;a.Ua=0;a.jb=0;a.Ja=262143;a.S=0;a.Ib=0;a.O=null;a.v&&Sc(a)}function Sc(a){a.Ua?(a.R=65536,a.ba=a.Vc,a.qa=a.Zd,a.Pb=a.Re,uc(a.v,a.pb&16?22:18)):(a.R=0,a.ba=a.Uc,a.qa=a.Ec,a.Pb=a.Lc,uc(a.v,16))}k.rc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ka,this.cb]);a.set(2,Dc(this.v));return a.data()}; 0,0,0,0,0,0,0,0,0];a.Gc=[0,0,0,0,0,0,0,0];a.Fc=0;a.J=0;a.D=a.H=0;a.g=a.f=a.vb=0;a.xa=-1;bc(a)}function bc(a){a.Xb=255;a.Ja=0;a.jc=0;a.Ba=0;a.Hb=0;a.Jb=0;a.fb=0;a.L=0;a.$a=0;a.Ca=262143;a.oa=0;a.O=null;a.v&&Tc(a)}function Tc(a){a.L?(a.R=65536,a.vc=a.fb&16?4186112:253952,a.aa=a.Vc,a.ra=a.Zd,a.Qb=a.Re,uc(a.v,a.fb&16?22:18)):(a.R=0,a.vc=57344,a.aa=a.Uc,a.ra=a.Ec,a.Qb=a.Lc,uc(a.v,16))}
k.restore=function(a){var b=a[1];this.ka=b[1];td(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.I){for(var f=0,g=Array(b.I),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.Y[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Bd(a){return a.T&65536?1:0}function Cd(a){return a.U&32768?2:0}function Dd(a){return a.aa&65535?0:4}function Ed(a){return a.Z&32768?8:0} function Sc(a,b){b&=-3073;if(a.Ba!=b){b&57344&&!(a.Ba&57344)&&(a.Hb=a.oa>>16&65535,a.Jb=a.oa&65535);a.Ba=b;a.$a=b>>5&3;a.lb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.L!=c&&(a.L=c,Tc(a))}}k.sc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ia,this.eb]);a.set(2,Dc(this.v));return a.data()};
function Fd(a){var b=a.u[7];a.S=0;a.Ib=b;var c=a.qa(b);a.u[7]=b+2&65535;return c}function Gd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Qc(a,b){return{de:a,wb:b,next:null}}function Hd(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 Hc(a,b){if(b!=a.O){var c=a.O;if(!c||c.wb<=b.wb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.wb<=b.wb){b.next=d;c.next=b;break}c=d}while(c)}}a.K|=1} k.restore=function(a){var b=a[1];this.ia=b[1];ud(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c<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 Cd(a){return a.T&65536?1:0}function Dd(a){return a.U&32768?2:0}function Ed(a){return a.$&65535?0:4}function Fd(a){return a.Z&32768?8:0}
function Id(a){return a.K&64?(a.sa(168,64,-5),!0):a.K&32?(a.sa(4,32,-4),!0):a.K&16?(a.sa(12,16,-6),!0):!1}function Tc(a){return a.N=a.N&63728|Ed(a)|Dd(a)|Cd(a)|Bd(a)}function Uc(a,b){a.Z=b<<12;a.aa=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.N)&2048)for(var c=a.Xa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Xa[c];a.Xa[c]=d}a.B=b>>14&3;c=a.N>>14&3;a.B!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.B]);a.N=b;a.K|=2}function Q(a,b){a.K&128||(a.Z=a.aa=b,a.U=0)}function Jd(a,b,c){a.K&128||(a.Z=a.aa=a.T=b,a.U=c||0)} function Gd(a){var b=a.u[7];a.oa=b;var c=a.ra(b);a.u[7]=b+2&65535;return c}function Hd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Qc(a,b){return{de:a,yb:b,next:null}}function Id(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 Hc(a,b){if(b!=a.O){var c=a.O;if(!c||c.yb<=b.yb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.yb<=b.yb){b.next=d;c.next=b;break}c=d}while(c)}}a.J|=1}
function Kd(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^b)&(d^b))}function fe(a,b){a.K&128||(a.Z=a.aa=a.T=b,a.U=a.Z^a.T>>1)}function ge(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^d)&(d^b))} function Jd(a){return a.J&64?(a.ta(168,64,-5),!0):a.J&32?(a.ta(4,32,-4),!0):a.J&16?(a.ta(12,16,-6),!0):!1}function Uc(a){return a.N=a.N&63728|Fd(a)|Ed(a)|Dd(a)|Cd(a)}function Vc(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.Xa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Xa[c];a.Xa[c]=d}a.B=b>>14&3;c=a.N>>14&3;a.B!=c&&(a.Ka[c]=a.u[6],a.u[6]=a.Ka[a.B]);a.N=b;a.J|=2}function Q(a,b){a.J&128||(a.Z=a.$=b,a.U=0)}function Kd(a,b,c){a.J&128||(a.Z=a.$=a.T=b,a.U=c||0)}
k.sa=function(a,b,c){if(!this.M){0>this.xa?this.xa=Tc(this):this.B||(a=4,this.Ha|=4,this.u[6]=4,c=-3);this.Ib=a;this.B=this.S=0;var d=this.qa(a|this.R),e=this.qa(a+2&65535|this.R);Uc(this,e&-12289|this.xa>>2&12288);he(this,this.xa);he(this,this.u[7]);O(this,d);this.K&=~(b|18);this.K|=9;this.xa=-1;this.jd=a;this.hd=c;if(-3<=c)throw a;}};function ie(a){var b=je(a),c=je(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Uc(a,c);a.K&=-17} function fe(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^b)&(d^b))}function ge(a,b){a.J&128||(a.Z=a.$=a.T=b,a.U=a.Z^a.T>>1)}function he(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^d)&(d^b))}
function Cc(a,b){var c=b>>13&31;31>c&&a.pb&32&&(b=a.Nb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} k.ta=function(a,b,c){if(!this.M){0>this.xa?this.xa=Uc(this):this.B||(a=4,this.Ja|=4,this.u[6]=4,c=-3);this.oa=a;this.B=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);Vc(this,e&-12289|this.xa>>2&12288);ie(this,this.xa);ie(this,this.u[7]);O(this,d);this.J&=~(b|18);this.J|=9;this.xa=-1;this.jd=a;this.hd=c;if(-3<=c)throw a;}};function je(a){var b=ke(a),c=ke(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Vc(a,c);a.J&=-17}
function ke(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.pb&a.Xc[a.B]||(d&=7);e=a.V[a.B][d];f=(a.ya[a.B][d]<<6)+(b&8191)&a.Ja;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.B][d]=e;if(f!=(4194170&a.Ja)||a.B)a.jb=a.B,a.ib=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.J&57344||(a.J=a.J|g|a.jb<<5|a.ib<< function Cc(a,b){var c=b>>13&31;31>c&&a.fb&32&&(b=a.Ob[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
1),b=!0),a.J&61440||!(f<(4191360&a.Ja)||f>(4194239&a.Ja))||(a.J|=4096,a.J&512&&(a.K|=64)),b&&a.sa(168,0,-1));return f}function le(a,b){return a.v.Hb(b)}function je(a){var b=a.qa(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function he(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.S=a.S<<8|246;me(a,0,c);a.Pb(c,b)}function me(a,b,c){!a.B&&c<=a.Vb&&(b||4<c)&&(1145<=a.Va&&c<=a.Vb-32?(a.Ha|=4,a.u[6]=4,a.sa(4,0,-3)):(a.Ha|=8,a.K|=32))} function le(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.vc),f;d=b>>13;a.fb&a.Xc[a.B]||(d&=7);e=a.V[a.B][d];f=(a.ya[a.B][d]<<6)+(b&8191)&a.Ca;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.B][d]=e;if(f!=(4194170&a.Ca)||a.B)a.$a=a.B,a.lb=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.Ba&
function ne(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return a.sa(4,0,-2),0;case 1:return 6==c&&d&4&&me(a,b,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.qa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.qa(e)|g;a.b-=8;break;case 6:return e=a.qa(Gd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.qa(Gd(a,2)),e=e+ 57344||(g|=a.$a<<5|a.lb<<1,Sc(a,a.Ba&-61695|g)),b=!0),a.Ba&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.Ba|=4096,a.Ba&512&&(a.J|=64)),b&&a.ta(168,0,-1));return f}function me(a,b){return a.v.Ib(b)}function ke(a){var b=a.ra(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function ie(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.oa=a.oa&65535|(a.oa&-65536)<<8|16121856;ne(a,0,c);a.Qb(c,b)}function ne(a,b,c){!a.B&&c<=a.Xb&&(b||4<c)&&(1145<=a.Va&&c<=a.Xb-32?(a.Ja|=4,a.u[6]=4,a.ta(4,0,-3)):(a.Ja|=8,a.J|=32))}
a.u[c]&65535,e=a.qa(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.S=a.S<<8|f<<3&248|c;6==c&&0>f&&me(a,b,a.u[6]);return e}k.Tb=function(a){if(!this.Ua)return this.v.Tb(a);this.M++;a=le(this,ke(this,a,3));this.M--;return a};k.bb=function(a){if(!this.Ua)return this.v.bb(a);this.M++;a=this.Ec(ke(this,a,2));this.M--;return a};k.qb=function(a,b){this.Ua?(this.M++,a=ke(this,a,5),a&1&&this.b--,this.v.zb(a,b),this.M--):this.v.qb(a,b)}; function oe(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return a.ta(4,0,-2),0;case 1:return 6==c&&d&4&&ne(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(Hd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Hd(a,2)),e=e+
k.Ab=function(a,b){this.Ua?(this.M++,this.Lc(ke(this,a,4),b),this.M--):this.v.Ab(a,b)};k.Uc=function(a,b,c){return ne(this,a,b,c)};k.Vc=function(a,b,c){return ke(this,ne(this,a,b,c),c)};k.Ec=function(a){return this.v.na(a)};k.Zd=function(a){return this.v.na(ke(this,a,2))};k.Lc=function(a,b){this.v.fb(a,b&65535)};k.Re=function(a,b){this.v.fb(ke(this,a,4),b)}; a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.oa=a.oa&65535|(a.oa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&ne(a,b,a.u[6]);return e}k.Ub=function(a){if(!this.L)return this.v.Ub(a);this.M++;a=me(this,le(this,a,3));this.M--;return a};k.cb=function(a){if(!this.L)return this.v.cb(a);this.M++;a=this.Ec(le(this,a,2));this.M--;return a};k.qb=function(a,b){this.L?(this.M++,a=le(this,a,5),a&1&&this.b--,this.v.Bb(a,b),this.M--):this.v.qb(a,b)};
function oe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ne(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.qa(d|c&a.R),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function pe(a,b,c,d){a.S=22;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ne(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=ke(a,e|c&65536,4),a.B=a.N>>14&3,a.v.fb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d} k.Cb=function(a,b){this.L?(this.M++,this.Lc(le(this,a,4),b),this.M--):this.v.Cb(a,b)};k.Uc=function(a,b,c){return oe(this,a,b,c)};k.Vc=function(a,b,c){return le(this,oe(this,a,b,c),c)};k.Ec=function(a){return this.v.na(a)};k.Zd=function(a){return this.v.na(le(this,a,2))};k.Lc=function(a,b){this.v.hb(a,b&65535)};k.Re=function(a,b){this.v.hb(le(this,a,4),b)};
function qe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?le(a,a.ba(b,c,3)):-c-1}function re(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.ba(b,d,2)):c=-d-1;return c}function se(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ne(a,b,c,8)}function te(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?le(a,a.ba(b,c,3)):a.u[c]&255}function ue(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.ba(b,c,2)):a.u[c]} function pe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=oe(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.ra(d|c&a.R),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ka[a.N>>12&3];return c}function qe(a,b,c,d){a.oa=a.oa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=oe(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=le(a,e|c&65536,4),a.B=a.N>>14&3,a.v.hb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ka[a.N>>12&3]=d}
function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Eb=a.ba(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,le(a,e)),e&1&&a.b--,a.v.zb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.v.fb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} function re(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?me(a,a.aa(b,c,3)):-c-1}function se(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.aa(b,d,2)):c=-d-1;return c}function te(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return oe(a,b,c,8)}function ue(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?me(a,a.aa(b,c,3)):a.u[c]&255}function ve(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.aa(b,c,2)):a.u[c]}
function ve(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.zb(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 we(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,d,4),a.v.fb(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 R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.vb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,me(a,e)),e&1&&a.b--,a.v.Bb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.hb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}
k.hb=function(a){this.w.complete=!0;var b=this.i?xe(this.i)?1:this.w.Wb?-1:0:0,c=a?this.w.Wb?0:1:-1;this.w.Wb=!1;this.ia=this.b=a;do{if(b){if(ye(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.K){if(a=this.K&7)if(a=!1,this.K&2){this.K&=-3;var d=160,e=(this.ic&224)>>5,f=this.O&&this.O.wb>e?this.O:null;f&&(d=f.de,e=f.wb);e>(this.N&224)>>5?(this.K&4&&(Gd(this,2),this.K&=-5),this.sa(d,0,-9),e=!0):e=!1;e&&(f&&Hd(this,f),a=!0)}else this.K&1&&this.K++;if(a){if(b&&ye(this.i,this.u[7],c)){this.da(); function we(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Bb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function xe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.hb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
break}if(0>c)break}if(this.K&112&&Id(this)){if(b&&ye(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.K=this.K&7|this.N&16;this.decode(Fd(this))}while(0<this.b);return this.w.complete?this.ia-this.b:void 0===this.w.complete?0:-1};Za(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new xd(d);B(d,c)}});function ze(a,b){var c=b+a;Kd(this,c,a,b);return c&65535}function Ae(a,b){var c=b+a;Kd(this,c<<8,a<<8,b<<8);return c&255} k.jb=function(a){this.w.complete=!0;var b=this.i?ye(this.i)?1:this.w.Yb?-1:0:0,c=a?this.w.Yb?0:1:-1;this.w.Yb=!1;this.ca=this.b=a;do{if(b){if(ze(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&7)if(a=!1,this.J&2){this.J&=-3;var d=160,e=(this.jc&224)>>5,f=this.O&&this.O.yb>e?this.O:null;f&&(d=f.de,e=f.yb);e>(this.N&224)>>5?(this.J&4&&(Hd(this,2),this.J&=-5),this.ta(d,0,-9),e=!0):e=!1;e&&(f&&Id(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&ze(this.i,this.u[7],c)){this.da();
function Be(a,b){a=b<<1;fe(this,a);return a&65535}function Ce(a,b){a=b<<1;fe(this,a<<8);return a&255}function De(a,b){a=b&32768|b>>1|b<<16;fe(this,a);return a&65535}function Ee(a,b){a=b&128|b>>1|b<<8;fe(this,a<<8);return a&255}function Fe(a,b){a=b&~a;Q(this,a);return a}function Ge(a,b){a=b&~a;Q(this,a<<8);return a}function He(a,b){a|=b;Q(this,a);return a}function Ie(a,b){a|=b;Q(this,a<<8);return a}function Je(a,b){a=~b|65536;Jd(this,a);return a&65535} break}if(0>c)break}if(this.J&112&&Jd(this)){if(b&&ze(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Gd(this))}while(0<this.b);return this.w.complete?this.ca-this.b:void 0===this.w.complete?0:-1};Za(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new yd(d);B(d,c)}});function Ae(a,b){var c=b+a;fe(this,c,a,b);return c&65535}function Be(a,b){var c=b+a;fe(this,c<<8,a<<8,b<<8);return c&255}
function Ke(a,b){a=~b|256;Jd(this,a<<8);return a&255}function Le(a,b){a=b-a;this.K&128||(this.Z=this.aa=a,this.U=b&(b^a));return a&65535}function Me(a,b){a=b-a;var c=a<<8;b<<=8;this.K&128||(this.Z=this.aa=c,this.U=b&(b^c));return a&255}function Ne(a,b){a=b+a;this.K&128||(this.Z=this.aa=a,this.U=a&(b^a));return a&65535}function Oe(a,b){a=b+a;var c=a<<8;this.K&128||(this.Z=this.aa=c,this.U=c&(b<<8^c));return a&255}function Pe(a,b){a=-b;Jd(this,a,a&b&32768);return a&65535} function Ce(a,b){a=b<<1;ge(this,a);return a&65535}function De(a,b){a=b<<1;ge(this,a<<8);return a&255}function Ee(a,b){a=b&32768|b>>1|b<<16;ge(this,a);return a&65535}function Fe(a,b){a=b&128|b>>1|b<<8;ge(this,a<<8);return a&255}function Ge(a,b){a=b&~a;Q(this,a);return a}function He(a,b){a=b&~a;Q(this,a<<8);return a}function Ie(a,b){a|=b;Q(this,a);return a}function Je(a,b){a|=b;Q(this,a<<8);return a}function Ke(a,b){a=~b|65536;Kd(this,a);return a&65535}
function Qe(a,b){a=-b;Jd(this,a<<8,(a&b&128)<<8);return a&255}function Re(a,b){a=b<<1|this.T>>16&1;fe(this,a);return a&65535}function Se(a,b){a=b<<1|this.T>>16&1;fe(this,a<<8);return a&255}function Te(a,b){a=(this.T&65536|b)>>1|b<<16;fe(this,a);return a&65535}function Ue(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;fe(this,a<<8);return a&255}function Ve(a,b){var c=b-a;ge(this,c,a,b);return c&65535}function We(a,b){var c=b-a;ge(this,c<<8,a<<8,b<<8);return c&255} function Le(a,b){a=~b|256;Kd(this,a<<8);return a&255}function Me(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.U=b&(b^a));return a&65535}function Ne(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.U=b&(b^c));return a&255}function Oe(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.U=a&(b^a));return a&65535}function Pe(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.U=c&(b<<8^c));return a&255}function Qe(a,b){a=-b;Kd(this,a,a&b&32768);return a&65535}
function Xe(a,b){this.K&128||(this.Z=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ye(a,b){a^=b;Q(this,a);return a&65535}function Ze(a){S(this,a,re(this,a),ze);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Re(a,b){a=-b;Kd(this,a<<8,(a&b&128)<<8);return a&255}function Se(a,b){a=b<<1|this.T>>16&1;ge(this,a);return a&65535}function Te(a,b){a=b<<1|this.T>>16&1;ge(this,a<<8);return a&255}function Ue(a,b){a=(this.T&65536|b)>>1|b<<16;ge(this,a);return a&65535}function Ve(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;ge(this,a<<8);return a&255}function We(a,b){var c=b-a;he(this,c,a,b);return c&65535}function Xe(a,b){var c=b-a;he(this,c<<8,a<<8,b<<8);return c&255}
function $e(a){var b=ue(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Z=this.aa=c;this.b-=(this.g?6:7)+b} function Ye(a,b){this.J&128||(this.Z=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ze(a,b){a^=b;Q(this,a);return a&65535}function $e(a){S(this,a,se(this,a),Ae);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function af(a){var b=ue(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function bf(a){T(this,a,!Bd(this))}function cf(a){T(this,a,Bd(this))} function af(a){var b=ve(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(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 df(a){S(this,a,re(this,a),Fe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ef(a){R(this,a,qe(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ff(a){S(this,a,re(this,a),He);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function gf(a){R(this,a,qe(this,a),Ie);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function bf(a){var b=ve(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(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 cf(a){T(this,a,!Cd(this))}function df(a){T(this,a,Cd(this))}
function hf(a){var b=re(this,a);a=ue(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 jf(a){var b=qe(this,a);a=te(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 kf(a){T(this,a,Dd(this))}function lf(a){T(this,a,!Ed(this)==!Cd(this))}function mf(a){T(this,a,!Dd(this)&&!Ed(this)==!Cd(this))}function nf(a){T(this,a,!Bd(this)&&!Dd(this))} function ef(a){S(this,a,se(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ff(a){R(this,a,re(this,a),He);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function gf(a){S(this,a,se(this,a),Ie);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function hf(a){R(this,a,re(this,a),Je);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
function of(a){T(this,a,Dd(this)||!Ed(this)!=!Cd(this))}function pf(a){T(this,a,Bd(this)||Dd(this))}function qf(a){T(this,a,!Ed(this)!=!Cd(this))}function rf(a){T(this,a,Ed(this))}function sf(a){T(this,a,!Dd(this))}function tf(a){T(this,a,!Ed(this))}function uf(){this.sa(12,0,-8);this.b-=5}function vf(a){T(this,a,!0)}function wf(a){T(this,a,!Cd(this))}function xf(a){T(this,a,Cd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.Z=0);this.b-=5} function jf(a){var b=se(this,a);a=ve(this,a);Q(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function kf(a){var b=re(this,a);a=ue(this,a);Q(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function lf(a){T(this,a,Ed(this))}function mf(a){T(this,a,!Fd(this)==!Dd(this))}function nf(a){T(this,a,!Ed(this)&&!Fd(this)==!Dd(this))}function of(a){T(this,a,!Cd(this)&&!Ed(this))}
function yf(a){var b=re(this,a);a=ue(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ge(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 zf(a){var b=qe(this,a);a=te(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ge(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 pf(a){T(this,a,Ed(this)||!Fd(this)!=!Dd(this))}function qf(a){T(this,a,Cd(this)||Ed(this))}function rf(a){T(this,a,!Fd(this)!=!Dd(this))}function sf(a){T(this,a,Fd(this))}function tf(a){T(this,a,!Ed(this))}function uf(a){T(this,a,!Fd(this))}function vf(){this.ta(12,0,-8);this.b-=5}function wf(a){T(this,a,!0)}function xf(a){T(this,a,!Dd(this))}function yf(a){T(this,a,Dd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5}
function Af(a){var b=ue(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.aa=d>>16|d,this.Z=d>>16):(this.U=32768,this.aa=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function Bf(){this.sa(24,0,-8);this.b-=25} function zf(a){var b=se(this,a);a=ve(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;he(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Af(a){var b=re(this,a);a=ue(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);he(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}
function Cf(){this.N&49152?(this.Ha|=128,this.sa(4,0,-7)):(this.A&&1120==this.Va&&this.A.setData(this.u[0],!0),this.i?Df(this.i):this.da());this.b-=7}function Ef(){this.sa(16,0,-8);this.b-=25}var Ff=[0,7,7,10,7,11,9,13];function Gf(a){this.I=this.b;O(this,se(this,a));this.b=this.I-Ff[this.g]}var Hf=[0,14,14,17,14,18,16,20];function If(a){this.I=this.b;var b=se(this,a);a=a>>6&7;he(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Hf[this.g]} function Bf(a){var b=ve(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.Z=d>>16):(this.U=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function Cf(){this.ta(24,0,-8);this.b-=25}
var Jf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Kf(a){var b=re(this,a);this.I=this.b;Q(this,we(this,a,b));this.b=this.I-Jf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Lf(a){var b=qe(this,a);Q(this,ve(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 Mf=[7,13,13,17,14,18,17,21]; function Df(){this.N&49152?(this.Ja|=128,this.ta(4,0,-7)):(this.A&&1120==this.Va&&this.A.setData(this.u[0],!0),this.i?Ef(this.i):this.da());this.b-=7}function Ff(){this.ta(16,0,-8);this.b-=25}var Gf=[0,7,7,10,7,11,9,13];function Hf(a){this.I=this.b;O(this,te(this,a));this.b=this.I-Gf[this.g]}var If=[0,14,14,17,14,18,16,20];function Jf(a){this.I=this.b;var b=te(this,a);a=a>>6&7;ie(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-If[this.g]}
function Nf(a){var b=ue(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.K&128||(this.Z=b>>16,this.aa=this.Z|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Of(){this.b-=5}function Pf(){this.N&49152||(this.v.reset(),bc(this),this.A&&this.A.setData(this.u[0],!0));this.b-=667}function Qf(a){if(a&8)V.call(this,a);else{var b=je(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}} var Kf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Lf(a){var b=se(this,a);this.I=this.b;Q(this,xe(this,a,b));this.b=this.I-Kf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Mf(a){var b=re(this,a);Q(this,we(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Nf=[7,13,13,17,14,18,17,21];
function Rf(){ie(this);this.b-=13}function W(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.aa=0);a&8&&(this.Z=32768);this.b-=5}function Sf(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 Tf(a){S(this,a,re(this,a),Ve);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Uf(a){S(this,a,0,Xe);this.b-=this.g?9:3+(7==this.f?2:0)}function Vf(){this.sa(28,0,-8);this.b-=5} function Of(a){var b=ve(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&128||(this.Z=b>>16,this.$=this.Z|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Pf(){this.b-=5}function Qf(){this.N&49152||(this.v.reset(),bc(this),this.A&&this.A.setData(this.u[0],!0));this.b-=667}function Rf(a){if(a&8)V.call(this,a);else{var b=ke(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}
function Wf(){this.A&&(this.A.jc(this.u[7],!0),this.A.setData(this.u[0],!0));this.K|=4;Gd(this,-2);this.b-=3}function Xf(a){S(this,a,this.u[a>>6&7],Ye);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=Df(b)):b=!1;b||this.sa(8,0,-8)}function yd(a){Yf[a>>12].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)}function eg(a){fg[a&15].call(this,a)} function Sf(){je(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 Tf(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 Uf(a){S(this,a,se(this,a),We);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Vf(a){S(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)}function Wf(){this.ta(28,0,-8);this.b-=5}
function gg(a){hg[a&15].call(this,a)}function ig(a){jg[a>>6&3].call(this,a)}function kg(a){lg[a>>6&3].call(this,a)}function mg(a){ng[a>>6&3].call(this,a)} function Xf(){this.A&&(this.A.kc(this.u[7],!0),this.A.setData(this.u[0],!0));this.J|=4;Hd(this,-2);this.b-=3}function Yf(a){S(this,a,this.u[a>>6&7],Ze);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Ef(b)):b=!1;b||this.ta(8,0,-8)}function zd(a){Zf[a>>12].call(this,a)}function $f(a){ag[a>>6&3].call(this,a)}function bg(a){cg[a>>6&3].call(this,a)}function dg(a){eg[a>>6&3].call(this,a)}function fg(a){gg[a&15].call(this,a)}
var Yf=[function(a){og[a>>8&15].call(this,a)},Kf,yf,hf,df,ff,Ze,V,function(a){pg[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,Tf,V],og=[function(a){qg[a>>4&15].call(this,a)},vf,sf,kf,lf,qf,mf,of,If,If,Zf,ag,cg,V,V,V],$f=[function(a){Jd(this,we(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Le);this.b-=this.g?9:3+(7==this.f?2:0)}],bg=[function(a){S(this,a,0, function hg(a){ig[a&15].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a>>6&3].call(this,a)}function ng(a){og[a>>6&3].call(this,a)}
Pe);this.b-=this.g?11:6},function(a){S(this,a,Bd(this)?1:0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Bd(this)?1:0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ue(this,a);Jd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],dg=[function(a){S(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,De);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)}], var Zf=[function(a){pg[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,$e,V,function(a){qg[a>>8&15].call(this,a)},Mf,Af,kf,ff,hf,Uf,V],pg=[function(a){rg[a>>4&15].call(this,a)},wf,tf,lf,mf,rf,nf,pf,Jf,Jf,$f,bg,dg,V,V,V],ag=[function(a){Kd(this,xe(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Me);this.b-=this.g?9:3+(7==this.f?2:0)}],cg=[function(a){S(this,a,0,
qg=[function(a){rg[a&15].call(this,a)},V,V,V,Gf,Gf,Gf,Gf,Qf,V,eg,gg,Uf,Uf,Uf,Uf],rg=[Cf,Wf,Rf,uf,Ef,Pf,V,V,V,V,V,V,V,V,V,V],fg=[Of,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],hg=[Of,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.aa=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],pg=[tf,rf,nf,pf,wf,xf,bf,cf,Bf,Vf,ig,kg,mg,V,V,V],jg=[function(a){Jd(this, Qe);this.b-=this.g?11:6},function(a){S(this,a,Cd(this)?1:0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Cd(this)?1:0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ve(this,a);Kd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],eg=[function(a){S(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ce);this.b-=this.g?9:3+(7==this.f?2:0)}],
ve(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Me);this.b-=this.g?9:3+(7==this.f?2:0)}],lg=[function(a){R(this,a,0,Qe);this.b-=this.g?11:6},function(a){R(this,a,Bd(this)?1:0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Bd(this)?1:0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=te(this,a);Jd(this,a<<8);this.b-=this.g?4:3+ rg=[function(a){sg[a&15].call(this,a)},V,V,V,Hf,Hf,Hf,Hf,Rf,V,fg,hg,Vf,Vf,Vf,Vf],sg=[Df,Xf,Sf,vf,Ff,Qf,V,V,V,V,V,V,V,V,V,V],gg=[Pf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.$=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],ig=[Pf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.$=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],qg=[uf,sf,of,qf,xf,yf,cf,df,Cf,Wf,jg,lg,ng,V,V,V],kg=[function(a){Kd(this,
(7==this.f?2:0)}],ng=[function(a){R(this,a,0,Ue);this.b-=this.g?9+(this.Eb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ee);this.b-=this.g?9+(this.Eb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ce);this.b-=this.g?9:3+(7==this.f?2:0)}];function zd(a){sg[a>>12].call(this,a)} we(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){R(this,a,0,Re);this.b-=this.g?11:6},function(a){R(this,a,Cd(this)?1:0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Cd(this)?1:0,Xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ue(this,a);Kd(this,a<<8);this.b-=this.g?4:3+
var sg=[function(a){tg[a>>8&15].call(this,a)},Kf,yf,hf,df,ff,Ze,function(a){ug[a>>8&15].call(this,a)},function(a){vg[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,Tf,V],tg=[function(a){wg[a>>4&15].call(this,a)},vf,sf,kf,lf,qf,mf,of,If,If,Zf,ag,cg,function(a){xg[a>>6&3].call(this,a)},V,V],xg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.qa(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=oe(this,a,0);he(this,a);Q(this,a);this.b-=11},function(a){var b=je(this);this.I= (7==this.f?2:0)}],og=[function(a){R(this,a,0,Ve);this.b-=this.g?9+(this.vb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Fe);this.b-=this.g?9+(this.vb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,De);this.b-=this.g?9:3+(7==this.f?2:0)}];function Ad(a){tg[a>>12].call(this,a)}
this.b;pe(this,a,0,b);Q(this,b);this.b=this.I-Mf[this.g]},function(a){Q(this,we(this,a,Ed(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],wg=[function(a){yg[a&15].call(this,a)},V,V,V,Gf,Gf,Gf,Gf,Qf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.K|=1),this.b-=5):V.call(this,a)},eg,gg,Uf,Uf,Uf,Uf],yg=[Cf,Wf,function(){ie(this);this.K|=this.N&16;this.b-=13},uf,Ef,Pf,Rf,function(){this.sa(8,0,-8)},V,V,V,V,V,V,V,V],ug=[Nf,Nf,Af,Af,$e,$e,af,af,Xf,Xf,V,V,V,V,Sf,Sf],vg=[tf,rf,nf,pf, var tg=[function(a){ug[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,$e,function(a){vg[a>>8&15].call(this,a)},function(a){wg[a>>8&15].call(this,a)},Mf,Af,kf,ff,hf,Uf,V],ug=[function(a){xg[a>>4&15].call(this,a)},wf,tf,lf,mf,rf,nf,pf,Jf,Jf,$f,bg,dg,function(a){yg[a>>6&3].call(this,a)},V,V],yg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=pe(this,a,0);ie(this,a);Q(this,a);this.b-=11},function(a){var b=ke(this);this.I=
wf,xf,bf,cf,Bf,Vf,ig,kg,mg,function(a){zg[a>>6&3].call(this,a)},V,V],zg=[V,function(a){a=oe(this,a,65536);he(this,a);Q(this,a);this.b-=11},function(a){var b=je(this);this.I=this.b;pe(this,a,65536,b);Q(this,b);this.b=this.I-Mf[this.g]},V]; this.b;qe(this,a,0,b);Q(this,b);this.b=this.I-Nf[this.g]},function(a){Q(this,xe(this,a,Fd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],xg=[function(a){zg[a&15].call(this,a)},V,V,V,Hf,Hf,Hf,Hf,Rf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):V.call(this,a)},fg,hg,Vf,Vf,Vf,Vf],zg=[Df,Xf,function(){je(this);this.J|=this.N&16;this.b-=13},vf,Ff,Qf,Sf,function(){this.ta(8,0,-8)},V,V,V,V,V,V,V,V],vg=[Of,Of,Bf,Bf,af,af,bf,bf,Yf,Yf,V,V,V,V,Tf,Tf],wg=[uf,sf,of,qf,
function Ag(a){t.call(this,"ROM",a,Ag,256);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.A=a.alias;this.C=a.file;this.H=ra(this.C);if(this.C){a=this.C;var b=sa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(qb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);Bg(c)})}}z(Ag);k=Ag.prototype; xf,yf,cf,df,Cf,Wf,jg,lg,ng,function(a){Ag[a>>6&3].call(this,a)},V,V],Ag=[V,function(a){a=pe(this,a,65536);ie(this,a);Q(this,a);this.b-=11},function(a){var b=ke(this);this.I=this.b;qe(this,a,65536,b);Q(this,b);this.b=this.I-Nf[this.g]},V];
k.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Bg(this)};k.Ga=function(){this.ga&&(this.i&&Ug(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Fa=function(){return!0}; function Bg(a){t.call(this,"ROM",a,Bg,256);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.A=a.alias;this.C=a.file;this.H=ra(this.C);if(this.C){a=this.C;var b=sa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(qb(c.Sa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);Cg(c)})}}z(Bg);k=Bg.prototype;
function Bg(a){if(!wb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)yb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[Ag.prototype.Nd,Ag.prototype.Fe,null,null,null,a.f>>1],c);if(Hb(a.v,a,b)){b=a.D=!0;break a}}else if(xc(a.v,b,a.f,ad)){for(c=0;c<a.g.length;c++)a.v.qb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.A?b.push(a.A): k.Ga=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Cg(this)};k.Ia=function(){this.ga&&(this.i&&Vg(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ha=function(){return!0};
null!=a.A&&a.A.length&&(b=a.A);for(c=0;c<b.length;c++){var d=a,e=b[c],f=wc(d.v,d.B,d.f);vc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Nd=function(a){return this.g[a-this.B]};k.Fe=function(){};Za(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Ag(d);B(d,c)}}); function Cg(a){if(!wb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)yb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[Bg.prototype.Nd,Bg.prototype.Fe,null,null,null,a.f>>1],c);if(Hb(a.v,a,b)){b=a.D=!0;break a}}else if(xc(a.v,b,a.f,bd)){for(c=0;c<a.g.length;c++)a.v.qb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.A?b.push(a.A):
function Vg(a){t.call(this,"RAM",a,Vg);this.ga=this.g=null;this.C=a.addr;this.B=a.size;this.La=a.load;this.Ka=a.exec;this.A=!1;this.f=a.file;this.D=ra(this.f);if(this.f){a=this.f;var b=sa(this.D);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(qb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga,null==c.La&&(c.La=a.La),null==c.Ka&&(c.Ka=a.Ka)):c.f=null);Wg(c)})}} null!=a.A&&a.A.length&&(b=a.A);for(c=0;c<b.length;c++){var d=a,e=b[c],f=wc(d.v,d.B,d.f);vc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Nd=function(a){return this.g[a-this.B]};k.Fe=function(){};Za(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Bg(d);B(d,c)}});
z(Vg);Vg.prototype.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Wg(this)};Vg.prototype.Ga=function(){this.ga&&(this.i&&Ug(this.i,this.id,this.C,this.B,this.ga),delete this.ga);return!0};Vg.prototype.Fa=function(){return!0};function Wg(a){if(a.v&&(!a.A&&a.B&&xc(a.v,a.C,a.B,Ac)&&(a.A=!0),!wb(a))){if(!a.A)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;Xg(a,a.g,a.La,a.Ka,a.C)}H(a)}} function Wg(a){t.call(this,"RAM",a,Wg);this.ga=this.g=null;this.C=a.addr;this.B=a.size;this.Na=a.load;this.Ma=a.exec;this.A=!1;this.f=a.file;this.D=ra(this.f);if(this.f){a=this.f;var b=sa(this.D);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(qb(c.Sa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga,null==c.Na&&(c.Na=a.Na),null==c.Ma&&(c.Ma=a.Ma)):c.f=null);Xg(c)})}}
Vg.prototype.reset=function(){if(this.A){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.A.length){var f=a.g.indexOf(e);0<=f&&(e=a.A[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(zb&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.Yb(d,g,e.F+d)}c-=a.za;b++;d=0}this.g&&Xg(this,this.g,this.La,this.Ka,this.C,!0)}}; z(Wg);Wg.prototype.Ga=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Xg(this)};Wg.prototype.Ia=function(){this.ga&&(this.i&&Vg(this.i,this.id,this.C,this.B,this.ga),delete this.ga);return!0};Wg.prototype.Ha=function(){return!0};function Xg(a){if(a.v&&(!a.A&&a.B&&xc(a.v,a.C,a.B,Ac)&&(a.A=!0),!wb(a))){if(!a.A)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;Yg(a,a.g,a.Na,a.Ma,a.C)}H(a)}}
function Xg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.qb(n++,b[v++]&255);else n&1?a.b.da():null==d&& Wg.prototype.reset=function(){if(this.A){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.A.length){var f=a.g.indexOf(e);0<=f&&(e=a.A[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(zb&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.$b(d,g,e.F+d)}c-=a.za;b++;d=0}this.g&&Yg(this,this.g,this.Na,this.Ma,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.qb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.uc=d,a.v.reset(),bc(a),O(a,d),Uc(a,0),!f&&a.i&&(a.da()||qd(a.i)));return g}Za(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Vg(d);B(d,c)}});function Yg(a){t.call(this,"Keyboard",a,Yg,65536);H(this)}z(Yg);Yg.prototype.ra=function(){return!1}; function Yg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.qb(n++,b[v++]&255);else n&1?a.b.da():null==d&&
Yg.prototype.Ea=function(a,b,c,d){this.C=a;this.b=c;this.i=d};Za(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Yg(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.qb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.xc=d,a.v.reset(),bc(a),O(a,d),Vc(a,0),!f&&a.i&&(a.da()||rd(a.i)));return g}Za(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Wg(d);B(d,c)}});function Zg(a){t.call(this,"Keyboard",a,Zg,65536);H(this)}z(Zg);Zg.prototype.sa=function(){return!1};
function X(a){this.O=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.$=a.upperCase;this.A=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=Zg;b&&(void 0===c&&(c="Panel"),(c=tb(c,this.id))&&(b=c.G[b])&&this.ra(null,a,b))}this.I=this.L=null;this.exports={connect:this.wc,receiveData:this.hc}}z(X);var Zg="buffer";k=X.prototype; Zg.prototype.Ga=function(a,b,c,d){this.C=a;this.b=c;this.i=d};Za(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Zg(d);B(d,c)}});
k.ra=function(a,b,c){var d=this;switch(b){case Zg:return this.G[b]=this.A=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.hc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.hc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1}; function X(a){this.O=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.ba=a.upperCase;this.A=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=$g;b&&(void 0===c&&(c="Panel"),(c=tb(c,this.id))&&(b=c.G[b])&&this.sa(null,a,b))}this.I=this.L=null;this.exports={connect:this.wc,receiveData:this.Wb}}z(X);var $g="buffer";k=X.prototype;
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;var e=this;this.ka=Qc(48,4);this.X=Gc(this.b,function(){e.f&128||!e.B.length||(e.J=e.B.shift()&255,e.$&&97<=e.J&&122>e.J&&(e.J-=32),e.f|=128,e.f&64&&Hc(e.b,e.ka))});this.M=Qc(52,4);this.ia=Gc(this.b,function(){e.g|=128;e.g&64&&Hc(e.b,e.M)});Hb(b,this,$g);Jb(b,this.reset.bind(this));H(this)}; k.sa=function(a,b,c){var d=this;switch(b){case $g:return this.G[b]=this.A=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.Wb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Wb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Wb(a.getData("Text"))},
k.wc=function(){if(!this.I){var a=nd(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Za)return;b=xa(b[1]);if(this.I=sb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.wc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; c.removeAttribute("readonly"),!0}return!1};k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;var e=this;this.ma=Qc(48,4);this.X=Gc(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&&Hc(e.b,e.ma))});this.M=Qc(52,4);this.ia=Gc(this.b,function(){e.g|=128;e.g&64&&Hc(e.b,e.M)});Hb(b,this,ah);Jb(b,this.reset.bind(this));H(this)};
k.Fa=function(a){return a?this.save():!0};k.reset=function(){ah(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return ah(this)};function ah(a){a.J=0;a.f=0;a.g=128;a.B=[];return!0}k.hc=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.B.push(a.charCodeAt(b));else this.B=this.B.concat(a);Pc(this.b,this.X,1E3/Math.round(this.O/10));return!0};k.Hd=function(){return this.f&65534}; k.wc=function(){if(!this.I){var a=od(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Za)return;b=xa(b[1]);if(this.I=sb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Sa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ia=function(a,b){if(!b)if(this.wc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
k.ze=function(a){this.f=this.f&-112|a&111};k.Gd=function(){this.f&=-129;0<this.B.length&&Pc(this.b,this.X,1E3/Math.round(this.O/10));return this.J};k.ye=function(){};k.ae=function(){return this.g};k.Te=function(a){this.g&128&&(a&64?Hc(this.b,this.M):Hd(this.b,this.M));this.g=this.g&-70|a&69};k.$d=function(){return 0}; k.Ha=function(a){return a?this.save():!0};k.reset=function(){bh(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return bh(this)};function bh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.Wb=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.B.push(a.charCodeAt(b));else this.B=this.B.concat(a);Pc(this.b,this.X,1E3/Math.round(this.O/10));return!0};k.Hd=function(){return this.f&65534};
k.ze=function(a){this.f=this.f&-112|a&111};k.Gd=function(){this.f&=-129;0<this.B.length&&Pc(this.b,this.X,1E3/Math.round(this.O/10));return this.K};k.ye=function(){};k.ae=function(){return this.g};k.Te=function(a){this.g&128&&(a&64?Hc(this.b,this.M):Id(this.b,this.M));this.g=this.g&-70|a&69};k.$d=function(){return 0};
k.Se=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);a&=127;if(this.A)if(13==a)this.H=0;else if(8==a)this.A.value=this.A.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=ya[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=wa("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), k.Se=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);a&=127;if(this.A)if(13==a)this.H=0;else if(8==a)this.A.value=this.A.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=ya[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=wa("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D),
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Pc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var bh={},$g=(bh[65392]=[null,null,X.prototype.Hd,X.prototype.ze,"RCSR"],bh[65394]=[null,null,X.prototype.Gd,X.prototype.ye,"RBUF"],bh[65396]=[null,null,X.prototype.ae,X.prototype.Te,"XCSR"],bh[65398]=[null,null,X.prototype.$d,X.prototype.Se,"XBUF"],bh);Za(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new X(d);B(d,c)}}); this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Pc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var ch={},ah=(ch[65392]=[null,null,X.prototype.Hd,X.prototype.ze,"RCSR"],ch[65394]=[null,null,X.prototype.Gd,X.prototype.ye,"RBUF"],ch[65396]=[null,null,X.prototype.ae,X.prototype.Te,"XCSR"],ch[65398]=[null,null,X.prototype.$d,X.prototype.Se,"XBUF"],ch);Za(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new X(d);B(d,c)}});
function Vc(a){t.call(this,"PC11",a,Vc);this.g=a.autoMount||null;this.D=0;this.$=a.baudReceive||3600;this.J=this.L=this.f=0;this.I=[];this.H=ch;this.A=dh;this.M=this.B="";this.ea=this.La=this.Ka=null;this.R=-1;this.O=!Ra("Mobi")&&window&&"FileReader"in window}z(Vc);var ch="",dh=0;k=Vc.prototype; function Wc(a){t.call(this,"PC11",a,Wc);this.g=a.autoMount||null;this.D=0;this.ba=a.baudReceive||3600;this.K=this.L=this.f=0;this.I=[];this.H=dh;this.A=eh;this.M=this.B="";this.ea=this.Na=this.Ma=null;this.R=-1;this.O=!Ra("Mobi")&&window&&"FileReader"in window}z(Wc);var dh="",eh=0;k=Wc.prototype;
k.ra=function(a,b,c){var d=this,e=dh;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= k.sa=function(a,b,c){var d=this,e=eh;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick=
function(){var a=d.G.listTapes;a&&eh(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;eh(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; function(){var a=d.G.listTapes;a&&fh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;fh(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=fh(a);var e=this;if((this.g=nd(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Qc(56,4);this.ca=Gc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.J<e.I.length&&(e.L=e.I[e.J++]&255,gh(e,e.J/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Hc(e.b,e.X))});Hb(b,this,hh);Jb(b,this.reset.bind(this));ih(this,"None",ch,!0);this.O&& k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=gh(a);var e=this;if((this.g=od(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Qc(56,4);this.ca=Gc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.I.length&&(e.L=e.I[e.K++]&255,hh(e,e.K/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Hc(e.b,e.X))});Hb(b,this,ih);Jb(b,this.reset.bind(this));jh(this,"None",dh,!0);this.O&&
ih(this,"Local Tape","?");ih(this,"Remote Tape","??");jh(this)||H(this)};k.Ga=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function jh(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ra(b,!0)}b&&c?kh(a,c,b,1,!0):lh(a)}return!!a.D} jh(this,"Local Tape","?");jh(this,"Remote Tape","??");kh(this)||H(this)};k.Ia=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function kh(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ra(b,!0)}b&&c?lh(a,c,b,1,!0):mh(a)}return!!a.D}
function eh(a,b,c,d,e){if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;kh(a,b,c,d,!1,e)}else mh(a,!1)} function fh(a,b,c,d,e){if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;lh(a,b,c,d,!1,e)}else nh(a,!1)}
function kh(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.A!=d)g++,mh(a,!0),a.w.ab?a.P("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),nh(a,b,c,d,f)?g++:a.w.ab=!0);g&&oh(a,a.M,a.B,a.A,a.ea,a.La,a.Ka)} function lh(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.A!=d)g++,nh(a,!0),a.w.bb?a.P("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),oh(a,b,c,d,f)?g++:a.w.bb=!0);g&&ph(a,a.M,a.B,a.A,a.ea,a.Na,a.Ma)}
function nh(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),oh(a,b,c,d,e),a.H="?");lh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.w.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(qb(a.Qa,e,f),(e=Ea(e,f))&&oh(a,b,c,d,e.ea,e.La, function oh(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),ph(a,b,c,d,e),a.H="?");mh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.w.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(qb(a.Sa,e,f),(e=Ea(e,f))&&ph(a,b,c,d,e.ea,e.Na,
e.Ka));a.w.ab=!1;a.D&&(a.D--,a.D||H(a));lh(a)})}function ih(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} e.Ma));a.w.bb=!1;a.D&&(a.D--,a.D||H(a));mh(a)})}function jh(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<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 lh(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 gh(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}} function mh(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 hh(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}}
function oh(a,b,c,d,e,f,g){a.M=b;a.B=c;a.A=d;a.ea=e;a.La=f;a.Ka=g;2==d?a.S&&Xg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.B="",a.H=ch,a.A=dh,a.P("No load address available for tape: "+b)):(a.J=0,a.I=e,a.status("tape attached: "+b),gh(a,0))}function mh(a,b){if(a.B||!1===b)a.M="",a.B="",b||(a.A&&a.status(1==a.A?"tape detached":"tape unloaded"),a.H=ch,a.A=dh,lh(a))}k.save=function(){return(new N(this)).data()};k.restore=function(){return!0};k.Ad=function(){return this.f&65534}; function ph(a,b,c,d,e,f,g){a.M=b;a.B=c;a.A=d;a.ea=e;a.Na=f;a.Ma=g;2==d?a.S&&Yg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.B="",a.H=dh,a.A=eh,a.P("No load address available for tape: "+b)):(a.K=0,a.I=e,a.status("tape attached: "+b),hh(a,0))}function nh(a,b){if(a.B||!1===b)a.M="",a.B="",b||(a.A&&a.status(1==a.A?"tape detached":"tape unloaded"),a.H=dh,a.A=eh,mh(a))}k.save=function(){return(new N(this)).data()};k.restore=function(){return!0};k.Ad=function(){return this.f&65534};
k.se=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Hc(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Pc(this.b,this.ca,1E3/Math.round(this.$/10))));this.f=this.f&-66|a&65};k.zd=function(){this.f&=-129;this.f|=2048;return this.L};k.re=function(){};var ph={},hh=(ph[65384]=[null,null,Vc.prototype.Ad,Vc.prototype.se,"PRS"],ph[65386]=[null,null,Vc.prototype.zd,Vc.prototype.re,"PRB"],ph); k.se=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Hc(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Pc(this.b,this.ca,1E3/Math.round(this.ba/10))));this.f=this.f&-66|a&65};k.zd=function(){this.f&=-129;this.f|=2048;return this.L};k.re=function(){};var qh={},ih=(qh[65384]=[null,null,Wc.prototype.Ad,Wc.prototype.se,"PRS"],qh[65386]=[null,null,Wc.prototype.zd,Wc.prototype.re,"PRB"],qh);
function qh(a,b,c){t.call(this,"Disk",{id:a.Qa+".disk"+p(++rh,4)},qh,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.A=b;this.Ya=b.name;this.dc=b.dc;sh(this,c,b.ua,b.Aa,b.pa,b.Ma);H(this)}var rh=0;z(qh);k=qh.prototype;k.Ea=function(a,b,c,d){this.i=d}; function rh(a,b,c){t.call(this,"Disk",{id:a.Sa+".disk"+p(++sh,4)},rh,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.A=b;this.Ya=b.name;this.fc=b.fc;th(this,c,b.va,b.Aa,b.qa,b.Oa);H(this)}var sh=0;z(rh);k=rh.prototype;k.Ga=function(a,b,c,d){this.i=d};
function sh(a,b,c,d,e,f){a.mode=b;a.ua=c;a.Aa=d;a.pa=e;a.Ma=f;a.b=[];if("preload"!=a.mode){b=Array(a.ua);for(c=0;c<b.length;c++){d=Array(a.Aa);for(e=0;e<d.length;e++){f=Array(a.pa);for(var g=1;g<=f.length;g++)f[g-1]=th(null,c,e,g,a.Ma,0);d[e]=f}b[c]=d}a.b=b}a.f=null} function th(a,b,c,d,e,f){a.mode=b;a.va=c;a.Aa=d;a.qa=e;a.Oa=f;a.b=[];if("preload"!=a.mode){b=Array(a.va);for(c=0;c<b.length;c++){d=Array(a.Aa);for(e=0;e<d.length;e++){f=Array(a.qa);for(var g=1;g<=f.length;g++)f[g-1]=uh(null,c,e,g,a.Oa,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
function uh(a,b,c,d,e){var f=c;if(a.v)return!0;a.Ya=b;a.eb=c;a.Ic=ra(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.ua=e[0];a.Aa=e[1];a.pa=e[2];a.Ma=e[3]||512;c=a.Ma>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ua);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.Aa),w=0;w<r.length;w++)for(var y=r[w]=Array(a.pa),x=0;x<y.length;x++){for(var C=th(null,d,w,x+1,a.Ma,0),ja=C.data,Ka=0;Ka<c;Ka++,f+=4)var P=ja[Ka]=b.getInt32(f, function vh(a,b,c,d,e){var f=c;if(a.v)return!0;a.Ya=b;a.gb=c;a.Ic=ra(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.va=e[0];a.Aa=e[1];a.qa=e[2];a.Oa=e[3]||512;c=a.Oa>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.va);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.Aa),w=0;w<r.length;w++)for(var y=r[w]=Array(a.qa),x=0;x<y.length;x++){for(var C=uh(null,d,w,x+1,a.Oa,0),ja=C.data,Ka=0;Ka<c;Ka++,f+=4)var P=ja[Ka]=b.getInt32(f,
!0),e=e+P&-1;C.Ba=c;y[x]=C}a.f=e;c=a}else a.P("Unrecognized disk format ("+d+" bytes)");a.v&&(a.v.call(a.controller,a.A,c,a.Ya,a.eb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=sa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dc?"":e)+"&format=json"));return!!Da(f, !0),e=e+P&-1;C.Da=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.A,c,a.Ya,a.gb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=sa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.fc?"":e)+"&format=json"));return!!Da(f,
null,!0,function(b,c,d){vh(a,b,c,d)})} null,!0,function(b,c,d){wh(a,b,c,d)})}
function vh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.w.ha;if(d)a.controller.P('Unable to load disk "'+a.Ya+'" (error '+d+": "+b+")",f);else{qb(a.controller.Qa,b,c);try{if(0<ra(a.Ic,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Ya]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ function wh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.w.ha;if(d)a.controller.P('Unable to load disk "'+a.Ya+'" (error '+d+": "+b+")",f);else{qb(a.controller.Sa,b,c);try{if(0<ra(a.Ic,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Ya]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.Aa=h[0].length;a.pa=h[0][0].length;var l=h[0][0][0];a.Ma=l&&l.length||512;for(d=c=0;d<a.ua;d++)for(f=0;f<a.Aa;f++)for(g=0;g<a.pa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y<w;y++)r[y]=n;wh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}th(l,d,f);for(w= c+")");if(h.length)if(1==h.length)q(h[0]);else{a.va=h.length;a.Aa=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Oa=l&&l.length||512;for(d=c=0;d<a.va;d++)for(f=0;f<a.Aa;f++)for(g=0;g<a.qa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y<w;y++)r[y]=n;xh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}uh(l,d,f);for(w=
0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Ya)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.B,a.A,e,a.Ya,a.eb),a.v=null)}function th(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.We=b;a.Xe=c;a.Pa=a.Ba=0;a.Ta=!1;return a} 0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Ya)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.B,a.A,e,a.Ya,a.gb),a.v=null)}function uh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.We=b;a.Xe=c;a.Ra=a.Da=0;a.Ua=!1;return a}
k.seek=function(a,b,c,d,e){d=null;var f=this.A,g=this.b[a];if(g){var h=g[b];if(!h&&f.Oc&&b<f.Aa)for(h=g[b]=Array(f.Pc),g=0;g<h.length;g++)h[g]=th(null,a,b,g+1,f.Bc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Oc&&9==f.nc&&(d=h[g]=th(null,a,b,f.nc,f.Bc,0))}}e&&e(d,!1);return d};function wh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e} k.seek=function(a,b,c,d,e){d=null;var f=this.A,g=this.b[a];if(g){var h=g[b];if(!h&&f.Oc&&b<f.Aa)for(h=g[b]=Array(f.Pc),g=0;g<h.length;g++)h[g]=uh(null,a,b,g+1,f.Bc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Oc&&9==f.oc&&(d=h[g]=uh(null,a,b,f.oc,f.Bc,0))}}e&&e(d,!1);return d};function xh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f<a.Pa?(a.Ba+=a.Pa-f,a.Pa=f):f>=a.Pa+a.Ba&&(a.Ba+=f-(a.Pa+a.Ba)+1):(a.Pa=f,a.Ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null}; k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Da?f<a.Ra?(a.Da+=a.Ra-f,a.Ra=f):f>=a.Ra+a.Da&&(a.Da+=f-(a.Ra+a.Da)+1):(a.Ra=f,a.Da=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function xh(a,b){var c=a.Aa*a.pa,d=b/c|0;return d<a.ua?(b%=c,a.seek(d,b/a.pa|0,b%a.pa+1)):null}function yh(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 yh(a,b){var c=a.Aa*a.qa,d=b/c|0;return d<a.va?(b%=c,a.seek(d,b/a.qa|0,b%a.qa+1)):null}function zh(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.eb,this.f,this.ua,this.Aa,this.pa,this.Ma];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Ba){for(var h=[],l=0,m=g.Pa,n=g.Pa+g.Ba;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Pa,h]}}return b}; k.save=function(){var a=0,b=[];b[a++]=[this.gb,this.f,this.va,this.Aa,this.qa,this.Oa];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.Da){for(var h=[],l=0,m=g.Ra,n=g.Ra+g.Da;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Ra,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?sh(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?th(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;l<e;)h.data[l++]=h.pattern;l=0;h.Pa=e;for(h.Ba=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.P("Unable to restore disk '"+this.Ya+": "+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.Ra=e;for(h.Da=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.P("Unable to restore disk '"+this.Ya+": "+c);return b};
k.toJSON=function(){var a;a=0;for(var b;b=xh(this,a++);)zh(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=yh(this,a++);)Ah(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function zh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,4194304);this.A=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Ra("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype; function Ah(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,4194304);this.A=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Ra("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype;
k.ra=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Ah(d,a)},!0;case "loadDrive":return this.G[b]= k.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Bh(d,a)},!0;case "loadDrive":return this.G[b]=
c,c.onclick=function(){var a=d.G.listDisks;a&&Bh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[la(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=xh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(yh(a,h,l));b=btoa(b);a=a.Ic.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"), c,c.onclick=function(){var a=d.G.listDisks;a&&Ch(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[la(a.value,10)||0])if(a=a.Ea){var b;b="";for(var c=0,h;h=yh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(zh(a,h,l));b=btoa(b);a=a.Ic.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.P("No disk loaded in drive.");else d.P("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= "string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.P("No disk loaded in drive.");else d.P("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=
!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Bh(d,ra(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ch(d,ra(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.A=nd(this.C,"autoMount")||this.A)&&"string"==typeof this.A)try{this.A=eval("("+this.A+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.A+")"),this.A=null}Ch(this);this.O=Qc(112,5);Hb(b,this,Dh);Jb(b,this.reset.bind(this));Eh(this,"None","",!0);this.L&&Eh(this,"Local Disk","?");Eh(this,"Remote Disk","??");Fh(this)||H(this)}; k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.A=od(this.C,"autoMount")||this.A)&&"string"==typeof this.A)try{this.A=eval("("+this.A+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.A+")"),this.A=null}Dh(this);this.O=Qc(112,5);Hb(b,this,Eh);Jb(b,this.reset.bind(this));Fh(this,"None","",!0);this.L&&Fh(this,"Local Disk","?");Fh(this,"Remote Disk","??");Gh(this)||H(this)};
k.Ga=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.qc){for(a=0;a<this.f.length;a++)Gh(this,a,!0);Fh(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";Ah(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){Ch(this)};k.save=function(){return(new N(this)).data()}; k.Ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.rc){for(a=0;a<this.f.length;a++)Hh(this,a,!0);Gh(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";Bh(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){Dh(this)};k.save=function(){return(new N(this)).data()};
k.restore=function(a){return Ch(this,a[0])};function Fh(a,b){b||(a.H=0);if(a.A)for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=ra(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!Hh(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 Dh(this,a[0])};function Gh(a,b){b||(a.H=0);if(a.A)for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=ra(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!Ih(a,g,f,e,!0)&&b&&H(a,!1);continue}a.P("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
function Bh(a,b,c,d){var e=a.G.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Hh(a,e,b,c,!1,d)}else Gh(a,e)} function Ch(a,b,c,d){var e=a.G.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ih(a,e,b,c,!1,d)}else Hh(a,e)}
function Hh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.eb.toLowerCase()!=d.toLowerCase()&&(g++,Gh(a,b,!0),h.cc?a.P("RL11 busy"):(h.cc=!0,e&&(h.bc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,uh(new qh(a,h,"preload"),c,d,f,a.Tc)&&g++));return g} function Ih(a,b,c,d,e,f){var g=-1,h=a.f[b];h.gb.toLowerCase()!=d.toLowerCase()&&(g++,Hh(a,b,!0),h.ec?a.P("RL11 busy"):(h.ec=!0,e&&(h.dc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Rb=!!f,vh(new rh(a,h,"preload"),c,d,f,a.Tc)&&g++));return g}
k.Tc=function(a,b,c,d,e){var f;a.cc=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ua||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.ec)),b=null);b?(a.Ca=b,a.Ya=c,a.eb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.ec),a.bc||e),this.C&&this.C.rb()):a.Qb=!1;a.bc&&(a.bc=!1,--this.H||H(this));Ah(this,a.ec)}; k.Tc=function(a,b,c,d,e){var f;a.ec=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.va||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.gc)),b=null);b?(a.Ea=b,a.Ya=c,a.gb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.gc),a.dc||e),this.C&&this.C.rb()):a.Rb=!1;a.dc&&(a.dc=!1,--this.H||H(this));Bh(this,a.gc)};
function Eh(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 Fh(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 Ah(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=la(a.value,10),c=c.Qb?"?":c.eb,!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 Gh(a,b,c){var d=a.f[b];if(d.Ca||!1===c)d.Ya="",d.eb="",d.Ca=null,d.Qb=!1,c||(a.P("Drive RL"+b+" unloaded",c),Ah(a,b))} function Bh(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=la(a.value,10),c=c.Rb?"?":c.gb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Hh(a,b,c){var d=a.f[b];if(d.Ea||!1===c)d.Ya="",d.gb="",d.Ea=null,d.Rb=!1,c||(a.P("Drive RL"+b+" unloaded",c),Bh(a,b))}
function Ch(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.J=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.ec=b;d.cc=d.Qb=!1;d.name=c.Za;d.ua=512;d.Aa=2;d.pa=40;d.Ma=256;d.dc=!0;d.Ve=0;d.Ue=0;d.nc=1;d.Pc=d.pa;d.Bc=d.Ma;d.Ye=0;d.$e=null;d.Ca||(d.eb="");d.status=29|(512==d.ua?128:0)}return!0} function Dh(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.gc=b;d.ec=d.Rb=!1;d.name=c.Za;d.va=512;d.Aa=2;d.qa=40;d.Oa=256;d.fc=!0;d.Ve=0;d.Ue=0;d.oc=1;d.Pc=d.qa;d.Bc=d.Oa;d.Ye=0;d.$e=null;d.Ea||(d.gb="");d.status=29|(512==d.va?128:0)}return!0}
k.Rc=function(a,b,c,d,e,f){this.I=f&65535;this.fa=this.fa&-49|f>>12&48;this.J=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.Rc=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.nd=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.v.fb(f,v|r<<8);if(Fc(this.v)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.pa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.nd=function(a,b,c,d,e,f,g){var h=0,l=a.Ea,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ea.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ea.read(m,n++))||0>(r=a.Ea.read(m,n++))){h=5120;break}this.v.hb(f,v|r<<8);if(Fc(this.v)){h=8192;break}f+=2;if(n>=l.Oa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};
k.he=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Fc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.pa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Kd=function(){return this.fa&65535}; k.he=function(a,b,c,d,e,f,g){var h=0,l=a.Ea,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Fc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ea.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ea.write(m,n++,v&255)||!a.Ea.write(m,n++,v>>8)){h=5120;break}if(n>=l.Oa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Kd=function(){return this.fa&65535};
k.Ce=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.nd;case 10:b||(b=this.he),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ua||f>=c.pa?this.fa|=37888: k.Ce=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.nd;case 10:b||(b=this.he),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.va||f>=c.qa?this.fa|=37888:
(g=(this.J&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Rc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Hc(this.b,this.O))}};k.Id=function(){return this.I};k.Ae=function(a){this.I=a&65534};k.Ld=function(){return this.g};k.De=function(a){this.g=a};k.Md=function(){return this.D};k.Ee=function(a){this.D=a};k.Jd=function(){return this.J};k.Be=function(a){this.J=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.Rc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Hc(this.b,this.O))}};k.Id=function(){return this.I};k.Ae=function(a){this.I=a&65534};k.Ld=function(){return this.g};k.De=function(a){this.g=a};k.Md=function(){return this.D};k.Ee=function(a){this.D=a};k.Jd=function(){return this.K};k.Be=function(a){this.K=a&63};
var Ih={},Dh=(Ih[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Ih[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Ih[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Ih[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Ih[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Ih);function Jh(a){t.call(this,"Debugger",a,Jh);this.ca=a.base||16;this.xa=!1;this.J=0;this.R=!1;this.B=-1;this.g=[];this.X={}}z(Jh); var Jh={},Eh=(Jh[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Jh[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Jh[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Jh[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Jh[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Jh);function Kh(a){t.call(this,"Debugger",a,Kh);this.ca=a.base||16;this.Ca=!1;this.K=0;this.R=!1;this.B=-1;this.g=[];this.X={}}z(Kh);
var Kh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Jh.prototype.sc=function(){return-1};Jh.prototype.tc=function(){}; var Lh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Kh.prototype.tc=function(){return-1};Kh.prototype.uc=function(){};
function Lh(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.R?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a} function Mh(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.R?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a}
function Mh(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 Nh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<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 Nh(a,b,c){var d;if(b){b=Oh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=xa(n);if(!n){f=!0;break}n=Ph(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&&Kh[n]<Kh[l[l.length-1]]&&Mh(h,l,1);l.push(n);b=b.substr(v+r)}Mh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Qh(a,null, function Oh(a,b,c){var d;if(b){b=Ph(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=xa(n);if(!n){f=!0;break}n=Qh(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&&Lh[n]<Lh[l[l.length-1]]&&Nh(h,l,1);l.push(n);b=b.substr(v+r)}Nh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Rh(a,null,
d))}return d}function Oh(a,b){for(var c,d=a.xa?"(":"{",e=a.xa?")":"}",f=new RegExp(a.xa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Nh(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 Ph(a,b){for(var c,d=a.Ca?"(":"{",e=a.Ca?")":"}",f=new RegExp(a.Ca?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Oh(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 Ph(a,b,c,d){var e;null!=b?(e=a.sc(b),0<=e?e=a.tc(e):(e=a.X[b],null==e&&(e=la(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e} function Qh(a,b,c,d){var e;null!=b?(e=a.tc(b),0<=e?e=a.uc(e):(e=a.X[b],null==e&&(e=la(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
function Qh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Rh(a,b){if(b)return Qh(a,b,a.X[b]);var c=0;for(b in a.X)Qh(a,b,a.X[b]),c++;return 0<c} function Rh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Sh(a,b){if(b)return Rh(a,b,a.X[b]);var c=0;for(b in a.X)Rh(a,b,a.X[b]),c++;return 0<c}
function J(a,b,c,d){switch(a.ca){case 8:a=qa(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d} function J(a,b,c,d){switch(a.ca){case 8:a=qa(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
function Sh(a){Jh.call(this,a);this.ib=!1;this.xa=!0;this.L=Y(0);this.jb=Y(0);this.O=Y(0);this.I=[];this.f=this.M=this.D=[];Th(this);this.ta=0;Uh(this);this.Ja={};Vh(this,a.messages);this.Ra=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return rd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return rd(b,a)})}z(Sh,Jh); function Th(a){Kh.call(this,a);this.kb=!1;this.Ca=!0;this.L=Y(0);this.lb=Y(0);this.O=Y(0);this.I=[];this.f=this.M=this.D=[];Uh(this);this.ua=0;Vh(this);this.La={};Wh(this,a.messages);this.$a=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return sd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return sd(b,a)})}z(Th,Kh);
var Wh={"?":"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"},Xh=".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 Xh={"?":"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"},Yh=".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(" "),
Yh={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], Zh={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],
33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74, 33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,
63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Zh=[0],$h= 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]}},$h=[0],ai=
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Sh.prototype; [58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Th.prototype;
k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.A=a.A;(a=nd(a,"messages"))&&Vh(this,a);this.nb=Yh;this.Db=1145>this.b.Va?$h:[];ai(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(bi(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Bc[c],n&&d.j(p(n.id,8)+" %"+ k.Ga=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.A=a.A;(a=od(a,"messages"))&&Wh(this,a);this.tb=Zh;this.Fb=1145>this.b.Va?ai:[];bi(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ci(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Bc[c],n&&d.j(p(n.id,8)+" %"+
p(e<<d.v.ja,8)+" %%"+p(n.F,8)+" "+p(n.Ob,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=$c&&(c=-1),m=0);a+=d.v.za;e++}}});H(this)}; p(e<<d.v.ja,8)+" %%"+p(n.F,8)+" "+p(n.Pb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=ad&&(c=-1),m=0);a+=d.v.za;e++}}});H(this)};
k.ra=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ka=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",rd(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,Ta(c,function(){if(d.ka){var a=d.ka.value; k.sa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ma=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",sd(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,Ta(c,function(){if(d.ma){var a=d.ma.value;
d.ka.value="";rd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ta(c,function(a){var b=!1;vb(d,!0)||(ub(d,!0),b=d.hb(a?1:0),ub(d,!1));return b}),!0}return!1};k.rb=function(a){if(this.ka){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ka.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Hb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Rb?this.v.Tb(d):this.b.Tb(d),b&&ci(a,b));return c}; d.ma.value="";sd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ta(c,function(a){var b=!1;vb(d,!0)||(ub(d,!0),b=d.jb(a?1:0,null),ub(d,!1));return b}),!0}return!1};k.rb=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.Ib=function(a,b){var c=255,d=this.aa(a,!1,1);-1!==d&&(c=a.Sb?this.v.Ub(d):this.b.Ub(d),b&&di(a,b));return c};
k.na=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Rb?this.v.bb(d):this.b.bb(d),b&&ci(a,b));return c};k.zb=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Rb?this.v.qb(d,b):this.b.qb(d,b),c&&ci(a,c),this.C.oa(-1))};k.fb=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Rb?this.v.Ab(d,b):this.b.Ab(d,b),c&&ci(a,c),this.C.oa(-1))};function Y(a,b){return{F:a,Rb:b,Oa:!1}}k.jc=function(a,b){a.F=b;a.Oa=!1;return a};function di(a){return[a.F,a.Oa]}function ei(a){return{F:a[0],Oa:a[1]}} k.na=function(a,b){var c=65535,d=this.aa(a,!1,2);-1!==d&&(c=a.Sb?this.v.cb(d):this.b.cb(d),b&&di(a,b));return c};k.Bb=function(a,b,c){var d=this.aa(a,!0,1);-1!==d&&(a.Sb?this.v.qb(d,b):this.b.qb(d,b),c&&di(a,c),this.C.pa(-1))};k.hb=function(a,b,c){var d=this.aa(a,!0,2);-1!==d&&(a.Sb?this.v.Cb(d,b):this.b.Cb(d,b),c&&di(a,c),this.C.pa(-1))};function Y(a,b){return{F:a,Sb:b,Qa:!1}}k.kc=function(a,b){a.F=b;a.Qa=!1;return a};function ei(a){return[a.F,a.Qa]}function fi(a){return{F:a[0],Qa:a[1]}}
function bi(a,b,c){var d,e=(c?a.L:a.jb).F;c=!1;if(void 0!==b){b=Oh(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=Nh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function fi(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Mc=Lh(a,b.Hc=c[2]))}function ci(a,b){null!=a.F&&(a.F+=b||1)} function ci(a,b,c){var d,e=(c?a.L:a.lb).F;c=!1;if(void 0!==b){b=Ph(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=Oh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function gi(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Mc=Mh(a,b.Hc=c[2]))}function di(a,b){null!=a.F&&(a.F+=b||1)}
function Vh(a,b){a.i=a;a.la=a.Qc=536870912;a.ia=null;a.va=[];b=Lh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Bb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.la|=Bb[c],a.j(c+" messages enabled"))}}function ai(a,b){for(var c in Bb)if(64==Bb[c]){a.Ja[c]=b;break}} function Wh(a,b){a.i=a;a.ka=a.Qc=536870912;a.ia=null;a.wa=[];b=Mh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Bb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ka|=Bb[c],a.j(c+" messages enabled"))}}function bi(a,b){for(var c in Bb)if(64==Bb[c]){a.La[c]=b;break}}
k.sc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SR":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function gi(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.tc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Xa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Tc(this.b):21==a&&this.A&&kc(this.A)&&(b=this.A.Wa));return b}; k.tc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SR":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function hi(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.uc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Xa[a-8]:20>a?b=this.b.Ka[a-16]:20==a?b=Uc(this.b):21==a&&this.A&&kc(this.A)&&(b=this.A.Wa));return b};
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Ib).F));if(this.la&1073741824)this.va.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.la&-2147483648&&this.b&&this.b.w.W||vb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,vd(a),a.wa=0,a.oa())}}; k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.oa&65535).F));if(this.ka&1073741824)this.wa.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ka&-2147483648&&this.b&&this.b.w.W||vb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,wd(a),a.wa=0,a.pa())}};
function Uh(a){var b;if(!xe(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.$=0;a.j("instruction history buffer allocated")}}k.gb=function(a,b){if(!hi(this,b))return!1;this.b.gb(a);return!0}; function Vh(a){var b;if(!ye(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.ba=0;a.j("instruction history buffer allocated")}}k.ib=function(a,b){if(!ii(this,b))return!1;this.b.ib(a);return!0};
k.hb=function(a,b,c){if(!hi(this))return!1;this.J=0;a||xe(this)&&ye(this,this.b.u[7],0);try{a=wd(this.b,a);var d=this.b.hb(a);0<d&&(cc(this.b,d),this.J+=d,dc(this.b,d,!0),ec(this.b,d),this.wa++)}catch(e){"number"!=typeof e&&(this.J=0,yb(this.b,e.stack||e.message))}!1!==c&&this.C.oa(-1);qd(this,b||!1);return 0<this.J};k.da=function(a){this.b&&this.b.da(a)}; k.jb=function(a,b,c){if(!ii(this))return!1;null===b&&(b=!this.vb||"tr"==this.vb);this.K=0;a||ye(this)&&ze(this,this.b.u[7],0);try{a=xd(this.b,a);var d=this.b.jb(a);0<d&&(cc(this.b,d),this.K+=d,dc(this.b,d,!0),ec(this.b,d),this.xa++)}catch(e){"number"!=typeof e&&(this.K=0,yb(this.b,e.stack||e.message))}!1!==c&&this.C.pa(-1);rd(this,b||!1);return 0<this.K};k.da=function(a){this.b&&this.b.da(a)};
function qd(a,b){if(a.ib){void 0===b&&(b=!0);var c;c=a.b;if(c=c.K&8?c.jd|c.hd<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Ab[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?ii(a):ji(a)}}function hi(a,b){var c;(c=!a.b||!wb(a.b))||(c=a.b,c.w.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.w.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!xb(a.b)}k.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; function rd(a,b){if(a.kb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.J&8?c.jd|c.hd<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Ab[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?ji(a):ki(a)}}function ii(a,b){var c;(c=!a.b||!wb(a.b))||(c=a.b,c.w.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.w.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!xb(a.b)}k.Ia=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Uh(this);this.wa=0;this.ia=null;this.J=0;this.L=Y(this.b.u[7]);this.w.W=!1;ki(this);a||qd(this)};k.save=function(){var a=new N(this);a.set(0,di(this.L));a.set(1,di(this.O));a.set(2,[this.g,this.R,this.la]);a.set(3,this.I);return a.data()}; k.Ha=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Vh(this);this.xa=0;this.ia=null;this.K=0;this.L=Y(this.b.u[7]);this.w.W=!1;li(this);a||rd(this)};k.save=function(){var a=new N(this);a.set(0,ei(this.L));a.set(1,ei(this.O));a.set(2,[this.g,this.R,this.ka]);a.set(3,this.I);return a.data()};
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=ei(a[b++]),this.O=ei(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.la|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.w.W=!0;this.Eb=a;this.Fb=b}; k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=fi(a[b++]),this.O=fi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ka|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.w.W=!0;this.Gb=a;this.Hb=b};
k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.J=b-this.Fb;if(!this.S){b="stopped";if(this.J){a-=this.Eb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";xe(this)&&(b+=this.wa+" instructions, ",this.wa=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}qd(this,!0);this.rb();ki(this,this.b.u[7]);this.ia=null}};function xe(a){return 1<a.f.length||!!a.ta} k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.K=b-this.Hb;if(!this.S){b="stopped";if(this.K){a-=this.Gb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";ye(this)&&(b+=this.xa+" instructions, ",this.xa=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)}rd(this,!0);this.rb();li(this,this.b.u[7]);this.ia=null}};function ye(a){return 1<a.f.length||!!a.ua}
function ye(a,b,c){var d=-1;c||(d=a.b.bb(b),0==d&&(b=Gd(a.b,2)));if(0<c&&(a.ta&&!--a.ta||id(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.wa++,0>d&&(d=a.b.bb(b)),65535!=(d&65535)&&(a.jc(a.H[a.$],b),++a.$==a.H.length&&(a.$=0)));return!1}function Df(a){var b=a.b;if(b.w.W)throw O(b,a.b.Ib),a.da(),-1;return!1} function ze(a,b,c){var d=-1;c||(d=a.b.cb(b),0==d&&(b=Hd(a.b,2)));if(0<c&&(a.ua&&!--a.ua||jd(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.xa++,0>d&&(d=a.b.cb(b)),65535!=(d&65535)&&(a.kc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Ef(a){var b=a.b;if(b.w.W)throw O(b,a.b.oa&65535),a.da(),-1;return!1}
function Th(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.v;c=a.ba(c);jd(d.Y[c>>>d.ja],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.v,c=a.ba(c),jd(d.Y[c>>>d.ja],!0);a.D=["bw"];a.kb=0}k.lb=function(a,b,c){var d=!0;c||li(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].lb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(mi(this,a,a.length-1,"set"),Uh(this)));return d}; function Uh(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);kd(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),kd(d.Y[c>>>d.ja],!0);a.D=["bw"];a.mb=0}k.nb=function(a,b,c){var d=!0;c||mi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].nb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Qa=!0:(ni(this,a,a.length-1,"set"),Vh(this)));return d};
function li(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Oa)){f=!0;h.Oa||e||mi(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,jd(d.Y[c>>>d.ja],b==a.D));h.Oa||Uh(a);break}}return f}function ni(a,b){for(var c=1;c<b.length;c++)mi(a,b,c);return b.length-1}function mi(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Hc?' "'+c.Hc+'"':""))} function mi(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.Qa)){f=!0;h.Qa||e||ni(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,kd(d.Y[c>>>d.ja],b==a.D));h.Qa||Vh(a);break}}return f}function oi(a,b){for(var c=1;c<b.length;c++)ni(a,b,c);return b.length-1}function ni(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Hc?' "'+c.Hc+'"':""))}
function ki(a,b){if(void 0!==b)id(a,b,1,a.f,!0),a.S=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Oa){if(!li(a,a.f,c,!0))break;b=0}}} function li(a,b){if(void 0!==b)jd(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.Qa){if(!mi(a,a.f,c,!0))break;b=0}}}
function id(a,b,c,d,e){var f=!1;if(!a.kb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Oa)for(var l=a.ba(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Oa&&(li(a,d,h,!0),e=!0);if(n=h.Mc){for(var f=!1,v=0;v<n.length;v++)if(!oi(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.w.W||(f=!0)}if(f){e||mi(a,d,g,"hit");break}}}a.kb--;return f} function jd(a,b,c,d,e){var f=!1;if(!a.mb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Qa)for(var l=a.aa(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Qa&&(mi(a,d,h,!0),e=!0);if(n=h.Mc){for(var f=!1,v=0;v<n.length;v++)if(!pi(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.w.W||(f=!0)}if(f){e||ni(a,d,g,"hit");break}}}a.mb--;return f}
function pi(a,b,c,d){var e=Y(b.F),f=a.na(b,2),g,h;for(h in a.nb)if(g=a.nb[h][f&h])break;g||(g=Zh);var l=g[0];0<=a.Db.indexOf(l)&&(g=Zh,l=g[0]);var m=h="",n=Xh[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 qi(a,b,c,d){var e=Y(b.F),f=a.na(b,2),g,h;for(h in a.tb)if(g=a.tb[h][f&h])break;g||(g=$h);var l=g[0];0<=a.Fb.indexOf(l)&&(g=$h,l=g[0]);var m=h="",n=Yh[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=gi(y);break;case 8:x="@"+gi(y);break;case 16:7>y?x="("+gi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+gi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+gi(y)+")";break;case 40:x="@-("+gi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+gi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+gi(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=hi(y);break;case 8:x="@"+hi(y);break;case 16:7>y?x="("+hi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+hi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+hi(y)+")";break;case 40:x="@-("+hi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+hi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+hi(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]);
0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.na(e,2)),null==e.F)break;while(e.F!=b.F)}g+=wa(f,24);g+=wa(n,5);h&&(g+=" "+h);if(c||m)g=wa(g,60)+";"+(c||""),g=a.b.w.tb?g+("cycles="+sd(a.b).toString()+" cs="+p(a.b.Kb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function qi(a,b){switch(b){case "N":a=Ed(a.b);break;case "Z":a=Dd(a.b);break;case "V":a=Cd(a.b);break;case "C":a=Bd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} 0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.na(e,2)),null==e.F)break;while(e.F!=b.F)}g+=wa(f,24);g+=wa(n,5);h&&(g+=" "+h);if(c||m)g=wa(g,60)+";"+(c||""),g=a.b.w.ub?g+("cycles="+td(a.b).toString()+" cs="+p(a.b.Lb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function ri(a,b){switch(b){case "N":a=Fd(a.b);break;case "Z":a=Ed(a.b);break;case "V":a=Dd(a.b);break;case "C":a=Cd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
function ri(a,b){var c="",d=a.b;8>b?(c=gi(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Xa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Tc(d)):21==b&&a.A&&kc(a.A)&&(c="SR="+J(a,a.A.Wa,3));c&&(c+=" ");return c}function si(a){var b,c="";for(b=0;6>b;b++)c+=ri(a,b);c=c+"\n"+(ri(a,6)+ri(a,7));c+=ri(a,20)+ri(a,21);return c+=qi(a,"T")+qi(a,"N")+qi(a,"Z")+qi(a,"V")+qi(a,"C")}k.oc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0}; function si(a,b){var c="",d=a.b;8>b?(c=hi(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Xa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ka[b-16]):20==b?c="PS="+J(a,Uc(d)):21==b&&a.A&&kc(a.A)&&(c="SR="+J(a,a.A.Wa,3));c&&(c+=" ");return c}function ti(a){var b,c="";for(b=0;6>b;b++)c+=si(a,b);c=c+"\n"+(si(a,6)+si(a,7));c+=si(a,20)+si(a,21);return c+=ri(a,"T")+ri(a,"N")+ri(a,"Z")+ri(a,"V")+ri(a,"C")}k.pc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function Ug(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],v=za(n,l,a.oc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Ze:b,F:c,Wc:d,ga:e,mc:f})}function ti(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.F>>>0,h=f.Wc;if(e>=g&&e<g+h){e=za(f.mc,[e-g],a.oc);0<=e?ui(a,b,e,d):c&&(e=~e,ui(a,b,e-1,d),ui(a,b,e,d));break}}return d} function Vg(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],v=za(n,l,a.pc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Ze:b,F:c,Wc:d,ga:e,nc:f})}function ui(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.Wc;if(e>=g&&e<g+h){e=za(f.nc,[e-g],a.pc);0<=e?vi(a,b,e,d):c&&(e=~e,vi(a,b,e-1,d),vi(a,b,e,d));break}}return d}
function ui(a,b,c,d){var e={},f=a.I[b].mc,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 vi(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Rh(a)||a.j("no variables"),!0;if(!c[2])return Rh(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Nh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1} function vi(a,b,c,d){var e={},f=a.I[b].nc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ga[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function wi(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Sh(a)||a.j("no variables"),!0;if(!c[2])return Sh(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Oh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
function wi(a,b,c){var d=null;if(b=bi(a,b,!0)){a.ba(b);var e=ti(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 xi(a,b,c){var d=null;if(b=ci(a,b,!0)){a.aa(b);var e=ui(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 ii(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Nh(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.L=Y(d.u[7]);break;case "N":d.Z=f?32768:0;break;case "Z":d.aa= function ji(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Oh(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.L=Y(d.u[7]);break;case "N":d.Z=f?32768:0;break;case "Z":d.$=
f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SR":if(a.A&&kc(a.A)){ic(a.A,f);break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.oa();a.j("updated registers:")}a.j(si(a));c&&(a.L=Y(d.u[7]),ji(a,J(a,a.L.F)))}}function xi(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Qh(a,null,c[2].charCodeAt(0)):Nh(a,b,!0)} f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SR":if(a.A&&kc(a.A)){ic(a.A,f);break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.pa();a.j("updated registers:")}a.j(ti(a));c&&(a.L=Y(d.u[7]),ki(a,J(a,a.L.F)))}}function yi(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Rh(a,null,c[2].charCodeAt(0)):Oh(a,b,!0)}
function yi(a,b,c){var d="t"!=b;c=Ph(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Sa(c,function(){return ub(a,!0)&&a.hb(e,d,!1)},function(){a.A&&a.A.stop&&a.A.stop();a.C.oa();ub(a,!1)})} function zi(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=Qh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);a.vb=b;Sa(c,function(){return ub(a,!0)&&a.jb(e,d,!1)},function(){a.A&&a.A.stop&&a.A.stop();a.C.pa();ub(a,!1)})}}
function ji(a,b,c,d){if(b=bi(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Ph(a,c.substr(1)),null!=c&&(d=c);else{d=bi(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=vb(a,!1)||a.S?a.J:null;var g=null!=f?"cycles":null,h=ti(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=pi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} function ki(a,b,c,d){if(b=ci(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Qh(a,c.substr(1)),null!=c&&(d=c);else{d=ci(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=vb(a,!1)||a.S?a.K:null;var g=null!=f?"cycles":null,h=ui(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=qi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
function oi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(wb(a)&&0<b.length){a.R&&(b="a "+J(a,a.O.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var v= function pi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(wb(a)&&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=
bi(a,g[1],!0);if(v)if(a.O=v,void 0===g[2])a.j("begin assemble at "+J(a,v.F)),a.R=!0,a.C.oa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.zb(v,r[w],1);a.j(pi(a,a.O))}}break;case "b":a:{var y=g[0],x=g[1],C=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"), ci(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.Bb(v,r[w],1);a.j(qi(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"),
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ja=y.charAt(1);if("l"==ja){var Ka;Ka=0+ni(a,a.f);Ka+=ni(a,a.M);(Ka+=ni(a,a.D))||a.j("no breakpoints")}else if("n"==ja)a.ta=Ph(a,x),a.j("break after "+a.ta+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=bi(a,x,!0),!P))break a;"c"==ja?null==P.F?(Th(a),a.j("all breakpoints cleared")):li(a,a.f,P)||li(a,a.M,P)||li(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(fi(a,P,C),"p"==ja?a.lb(a.f, a.j("\tbn [#]\tbreak after # instruction(s)");else{var ja=y.charAt(1);if("l"==ja){var Ka;Ka=0+oi(a,a.f);Ka+=oi(a,a.M);(Ka+=oi(a,a.D))||a.j("no breakpoints")}else if("n"==ja)a.ua=Qh(a,x),a.j("break after "+a.ua+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=ci(a,x,!0),!P))break a;"c"==ja?null==P.F?(Uh(a),a.j("all breakpoints cleared")):mi(a,a.f,P)||mi(a,a.M,P)||mi(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(gi(a,P,C),"p"==ja?a.nb(a.f,
P):"r"==ja?a.lb(a.M,P):"w"==ja?a.lb(a.D,P):a.j("unknown breakpoint command: "+ja))}}}break;case "c":a.Sa&&(a.Sa.value="");break;case "d":a:{var ib,Ma=g[0],ma=g[1],Na=g[2],Ri=g[3];if("?"==ma){var jb="";for(ib in Bb)a.Ja[ib]&&(jb&&(jb+=","),jb+=ib);jb+=",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"==ja?a.nb(a.M,P):"w"==ja?a.nb(a.D,P):a.j("unknown breakpoint command: "+ja))}}}break;case "c":a.Ta&&(a.Ta.value="");break;case "d":a:{var ib,Ma=g[0],ma=g[1],Na=g[2],Si=g[3];if("?"==ma){var jb="";for(ib in Bb)a.La[ib]&&(jb&&(jb+=","),jb+=ib);jb+=",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");
jb.length&&a.j("dump extension commands:\n\t"+jb)}else if("state"==ma){var Cg=zi(a.C,!0);"console"==Na?console.log(Cg):(a.Sa&&(a.Sa.value=""),a.j(Cg))}else if("symbols"==ma)for(var Ld=0;Ld<a.I.length;Ld++){var Md=a.I[Ld],kb;for(kb in Md.ga)if("."!=kb.charAt(0)){var Dg=Md.ga[kb].o;if(void 0!==Dg){var Eg=Md.ga[kb].l;Eg&&(kb=Eg);a.j(J(a,Dg)+" "+kb)}}}else{if("d"==Ma){for(ib in Bb)if(g[1]==ib){var Fg=a.Ja[ib];Fg?(g.shift(),g.shift(),Fg(g)):a.j("no dump registered for "+ma);break a}ma||(Ma=a.Gb||"dw")}else a.Gb= jb.length&&a.j("dump extension commands:\n\t"+jb)}else if("state"==ma){var Dg=Ai(a.C,!0);"console"==Na?console.log(Dg):(a.Ta&&(a.Ta.value=""),a.j(Dg))}else if("symbols"==ma)for(var Ld=0;Ld<a.I.length;Ld++){var Md=a.I[Ld],kb;for(kb in Md.ga)if("."!=kb.charAt(0)){var Eg=Md.ga[kb].o;if(void 0!==Eg){var Fg=Md.ga[kb].l;Fg&&(kb=Fg);a.j(J(a,Eg)+" "+kb)}}}else{if("d"==Ma){for(ib in Bb)if(g[1]==ib){var Gg=a.La[ib];Gg?(g.shift(),g.shift(),Gg(g)):a.j("no dump registered for "+ma);break a}ma||(Ma=a.Jb||"dw")}else a.Jb=
Ma;if("dh"==Ma){var Gg=ma,Hg=Na,Ig="",Jg=0,fa=a.$,na=a.H;if(na.length){var Z=+Gg||a.mb,Qb=+Hg||10;isNaN(Z)?Z=Qb:Ig="more ";Z>na.length&&(a.j("note: only "+na.length+" available"),Z=na.length);fa-=Z;0>fa&&(null==na[na.length-1].F?(Z=fa+Z,fa=0):fa+=na.length);var Nd=[];"call"==Hg&&(Qb=1E5,Nd=["CALL"]);for(void 0!==Gg&&a.j(Z+" instructions earlier:");0<Qb&&fa!=a.$;){var Kg=na[fa++];if(null==Kg.F)break;var Rb=Y(Kg.F),Si=Z--,Lg=pi(a,Rb,"history",Si);(!Nd.length||0<=Lg.indexOf(Nd[0]))&&a.j(Lg);Rb.$b&&(fa+= Ma;if("dh"==Ma){var Hg=ma,Ig=Na,Jg="",Kg=0,fa=a.ba,na=a.H;if(na.length){var Z=+Hg||a.ob,Qb=+Ig||10;isNaN(Z)?Z=Qb:Jg="more ";Z>na.length&&(a.j("note: only "+na.length+" available"),Z=na.length);fa-=Z;0>fa&&(null==na[na.length-1].F?(Z=fa+Z,fa=0):fa+=na.length);var Nd=[];"call"==Ig&&(Qb=1E5,Nd=["CALL"]);for(void 0!==Hg&&a.j(Z+" instructions earlier:");0<Qb&&fa!=a.ba;){var Lg=na[fa++];if(null==Lg.F)break;var Rb=Y(Lg.F),Ti=Z--,Mg=qi(a,Rb,"history",Ti);(!Nd.length||0<=Mg.indexOf(Nd[0]))&&a.j(Mg);Rb.bc&&
Rb.$b,Qb-=Rb.$b,Z-=Rb.$b);fa>=na.length&&(fa=0);a.mb=Z;Jg++;Qb--}}Jg||(a.j("no "+Ig+"history available"),a.mb=void 0)}else{var lb=bi(a,ma);if(lb){var Sb=0,Od=!1,Pd="ds"==Ma;Na&&(Od=!0,"l"==Na.charAt(0)&&(Od=!1,Na=Na.substr(1)||Ri),Sb=Ph(a,Na)>>>0,65536<Sb&&(Sb=65536));for(var mb="dd"==Ma?4:"db"==Ma?1:2,Ic=(Od?Sb-lb.F:mb*Sb)||128,Qd=Pd?16:a.ca,Ti=(Ic+Qd-1)/Qd|0||1,Oa="";Ti--&&0<Ic;){for(var Pa="",Rd="",ma=J(a,lb.F),Jc=Qd,Tb=0,Ub=0;0<Jc&&0<Ic;){var nb=1,Kc=1==mb?a.Hb(lb,nb):a.na(lb,nb=2),Tb=Tb|Kc<< (fa+=Rb.bc,Qb-=Rb.bc,Z-=Rb.bc);fa>=na.length&&(fa=0);a.ob=Z;Kg++;Qb--}}Kg||(a.j("no "+Jg+"history available"),a.ob=void 0)}else{var lb=ci(a,ma);if(lb){var Sb=0,Od=!1,Pd="ds"==Ma;Na&&(Od=!0,"l"==Na.charAt(0)&&(Od=!1,Na=Na.substr(1)||Si),Sb=Qh(a,Na)>>>0,65536<Sb&&(Sb=65536));for(var mb="dd"==Ma?4:"db"==Ma?1:2,Ic=(Od?Sb-lb.F:mb*Sb)||128,Qd=Pd?16:a.ca,Ui=(Ic+Qd-1)/Qd|0||1,Oa="";Ui--&&0<Ic;){for(var Pa="",Rd="",ma=J(a,lb.F),Jc=Qd,Tb=0,Ub=0;0<Jc&&0<Ic;){var nb=1,Kc=1==mb?a.Ib(lb,nb):a.na(lb,nb=2),Tb=Tb|
(Ub<<3),Ub=Ub+nb;Ub==mb&&(Pd?(Pa&&(Pa+=","),Pa+="0x"+p(Tb,2*mb)):(Pa+=J(a,Tb,mb),Pa+=1==mb?9==Jc?"-":" ":" "),Tb=Ub=0);Jc-=nb;for(Ic-=nb;nb--;)var Sd=Kc&255,Rd=Rd+(32<=Sd&&128>Sd?String.fromCharCode(Sd):"."),Kc=Kc>>8}Oa&&(Oa+="\n");Oa=Pd?Oa+(Pa+","):Oa+(ma+" "+Pa+(0==Jc?" "+Rd:""))}Oa&&a.j(Oa);a.jb=lb}}}}break;case "e":if("else"==g[0])break;var ob,Td,Ud,Vd,Wd=g[0],Xd=g[1];"eb"==Wd?(ob=1,Td=255,Ud=a.Hb,Vd=a.zb):"e"==Wd||"ew"==Wd?(ob=2,Td=65535,Ud=a.na,Vd=a.fb):Xd=null;if(null==Xd)a.j("edit memory commands:"), Kc<<(Ub<<3),Ub=Ub+nb;Ub==mb&&(Pd?(Pa&&(Pa+=","),Pa+="0x"+p(Tb,2*mb)):(Pa+=J(a,Tb,mb),Pa+=1==mb?9==Jc?"-":" ":" "),Tb=Ub=0);Jc-=nb;for(Ic-=nb;nb--;)var Sd=Kc&255,Rd=Rd+(32<=Sd&&128>Sd?String.fromCharCode(Sd):"."),Kc=Kc>>8}Oa&&(Oa+="\n");Oa=Pd?Oa+(Pa+","):Oa+(ma+" "+Pa+(0==Jc?" "+Rd:""))}Oa&&a.j(Oa);a.lb=lb}}}}break;case "e":if("else"==g[0])break;var ob,Td,Ud,Vd,Wd=g[0],Xd=g[1];"eb"==Wd?(ob=1,Td=255,Ud=a.Ib,Vd=a.Bb):"e"==Wd||"ew"==Wd?(ob=2,Td=65535,Ud=a.na,Vd=a.hb):Xd=null;if(null==Xd)a.j("edit memory commands:"),
a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Lc=bi(a,Xd);if(Lc)for(var Mc=2;Mc<g.length;Mc++){var Vb=Nh(a,g[Mc]);if(void 0===Vb){a.j("unrecognized value: "+g[Mc]);break}Vb&~Td&&a.j("warning: "+p(Vb)+" exceeds "+ob+"-byte value");a.j("changing "+J(a,Lc.F)+(F(a,64)?"":" from "+J(a,Ud.call(a,Lc),ob))+" to "+J(a,Vb,ob));Vd.call(a,Lc,Vb,ob)}}break;case "g":a:{var Mg=g[1],Ui=b;if(void 0!==Mg){var Yd=bi(a,Mg,!0);if(!Yd)break a;fi(a,Yd,Ui);a.lb(a.f, a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Lc=ci(a,Xd);if(Lc)for(var Mc=2;Mc<g.length;Mc++){var Vb=Oh(a,g[Mc]);if(void 0===Vb){a.j("unrecognized value: "+g[Mc]);break}Vb&~Td&&a.j("warning: "+p(Vb)+" exceeds "+ob+"-byte value");a.j("changing "+J(a,Lc.F)+(F(a,64)?"":" from "+J(a,Ud.call(a,Lc),ob))+" to "+J(a,Vb,ob));Vd.call(a,Lc,Vb,ob)}}break;case "g":a:{var Ng=g[1],Vi=b;if(void 0!==Ng){var Yd=ci(a,Ng,!0);if(!Yd)break a;gi(a,Yd,Vi);a.nb(a.f,
Yd,!0)}a.gb(!0,c)}break;case "h":a.w.W?(c||a.j("halting"),a.da()):vb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Zd;var Wb=b.substr(2),Wb=xa(Wb);Nh(a,Wb)?(c||a.j("true: "+Wb),Zd=!0):(c||a.j("false: "+Wb),Zd=!1);Zd||(d=!1);break}f=!0;break;case "k":var Vi=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var $d=0,ae=Y(),Xb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Xb.F));10>$d;){for(var Qa=null,Wi=256;65536> Yd,!0)}a.ib(!0,c)}break;case "h":a.w.W?(c||a.j("halting"),a.da()):vb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Zd;var Wb=b.substr(2),Wb=xa(Wb);Oh(a,Wb)?(c||a.j("true: "+Wb),Zd=!0):(c||a.j("false: "+Wb),Zd=!1);Zd||(d=!1);break}f=!0;break;case "k":var Wi=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var $d=0,ae=Y(),Xb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Xb.F));10>$d;){for(var Qa=null,Xi=256;65536>
Xb.F>>>0;){ae.F=a.na(Xb,2);if(null==Xb.F||!Wi--)break;if(!(ae.F&1)){for(var Xi=a,Nc=ae,Ng=null,Yb=Nc.F,Og=Yb,be=1;6>=be&&Yb;be++){if(2<be){Nc.F=Yb;var Oc=pi(Xi,Nc);if(0<=Oc.indexOf("JSR")){var Pg=Oc.indexOf(" ");if(Yb+(Oc.indexOf(" ",Pg+1)-Pg-1)/2==Og){Ng=Oc;break}}}Yb-=2}Nc.F=Og;if(Qa=Ng)break}}if(!Qa||null==Qa)break;var Qg=null;if("ks"==Vi){var Rg=Qa.match(/[0-9A-F]+$/);Rg&&(Qg=wi(a,Rg[0]))}Qa=wa(Qa,50)+" ;"+(Qg||"stack="+J(a,Xb.F));a.j(Qa);$d++}$d||a.j("no return addresses found")}break;case "l":if("ln"== Xb.F>>>0;){ae.F=a.na(Xb,2);if(null==Xb.F||!Xi--)break;if(!(ae.F&1)){for(var Yi=a,Nc=ae,Og=null,Yb=Nc.F,Pg=Yb,be=1;6>=be&&Yb;be++){if(2<be){Nc.F=Yb;var Oc=qi(Yi,Nc);if(0<=Oc.indexOf("JSR")){var Qg=Oc.indexOf(" ");if(Yb+(Oc.indexOf(" ",Qg+1)-Qg-1)/2==Pg){Og=Oc;break}}}Yb-=2}Nc.F=Pg;if(Qa=Og)break}}if(!Qa||null==Qa)break;var Rg=null;if("ks"==Wi){var Sg=Qa.match(/[0-9A-F]+$/);Sg&&(Rg=xi(a,Sg[0]))}Qa=wa(Qa,50)+" ;"+(Rg||"stack="+J(a,Xb.F));a.j(Qa);$d++}$d||a.j("no return addresses found")}break;case "l":if("ln"==
g[0]){wi(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"==G)Ca=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in Bb)if(G==oa){Ca=Bb[oa];pa=!!(a.la&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.la|=Ca,pa=!0;else if("off"==g[2]&&(a.la&=~Ca,pa=!1,1073741824==Ca)){for(var ce=0;ce<a.va.length;ce++)a.j(a.va[ce]); g[0]){xi(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"==G)Ca=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in Bb)if(G==oa){Ca=Bb[oa];pa=!!(a.ka&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.ka|=Ca,pa=!0;else if("off"==g[2]&&(a.ka&=~Ca,pa=!1,1073741824==Ca)){for(var ce=0;ce<a.wa.length;ce++)a.j(a.wa[ce]);
a.va=[]}}var Yi=0,Zb="";for(oa in Bb)if(!G||G==oa){var Zi=!!(a.la&Bb[oa]);if(null===pa||pa==Zi)Zb&&(Zb+=","),++Yi%10||(Zb+="\n\t"),"key"==oa&&(oa="keys"),Zb+=oa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==pa?pa?"messages on: ":"messages off: ":"message categories:\n\t")+(Zb||"none"));Uh(a)}break;case "p":if("print"==g[0]){xi(a,b.substr(5));break}var $i="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Sg=Y(a.b.u[7]);a.Hb(Sg);a.S?(a.lb(a.f, a.wa=[]}}var Zi=0,Zb="";for(oa in Bb)if(!G||G==oa){var $i=!!(a.ka&Bb[oa]);if(null===pa||pa==$i)Zb&&(Zb+=","),++Zi%10||(Zb+="\n\t"),"key"==oa&&(oa="keys"),Zb+=oa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==pa?pa?"messages on: ":"messages off: ":"message categories:\n\t")+(Zb||"none"));Vh(a)}break;case "p":if("print"==g[0]){yi(a,b.substr(5));break}var aj="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Tg=Y(a.b.u[7]);a.Ib(Tg);a.S?(a.nb(a.f,
Sg,!0),a.gb()||(a.C&&a.C.rb(),a.S=0)):yi(a,$i?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}ii(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var $b=+g[2];if(8==$b||10==$b||16==$b)a.ca=$b;else{a.j("invalid base: "+$b);break}}a.j("default base: "+a.ca);break;case "cs":var ac;void 0!==g[3]&&(ac=+g[3]);switch(g[2]){case "int":a.b.ub=ac;break;case "start":a.b.Lb=ac;break;case "stop":a.b.vb=ac;break;default:a.j("unknown cs option");break a}void 0!==ac&&pd(a.b);a.j("checksums "+ Tg,!0),a.ib()||(a.C&&a.C.rb(),a.S=0)):zi(a,aj?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}ji(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var $b=+g[2];if(8==$b||10==$b||16==$b)a.ca=$b;else{a.j("invalid base: "+$b);break}}a.j("default base: "+a.ca);break;case "cs":var ac;void 0!==g[3]&&(ac=+g[3]);switch(g[2]){case "int":a.b.wb=ac;break;case "start":a.b.Mb=ac;break;case "stop":a.b.xb=ac;break;default:a.j("unknown cs option");break a}void 0!==ac&&qd(a.b);a.j("checksums "+
(a.b.w.tb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(td(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.ob.toFixed(2)+"Mhz")+" ("+a.b.cb+"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.w.ub?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(ud(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.pb.toFixed(2)+"Mhz")+" ("+a.b.eb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),
a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":yi(a,g[0],g[1]);break;case "u":ji(a,g[1],g[2],8);break;case "v":if("var"==g[0]){vi(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.Va+",RELEASE"+(zb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){xi(a,b.substr(1));break}var de="commands:",ee;for(ee in Wh)de+="\n"+wa(ee,9)+Wh[ee];xe(a)||(de+="\nnote: history disabled if no exec breakpoints");a.j(de); a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":zi(a,g[0],g[1]);break;case "u":ki(a,g[1],g[2],8);break;case "v":if("var"==g[0]){wi(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.Va+",RELEASE"+(zb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){yi(a,b.substr(1));break}var de="commands:",ee;for(ee in Xh)de+="\n"+wa(ee,9)+Xh[ee];ye(a)||(de+="\nnote: history disabled if no exec breakpoints");a.j(de);
break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Tg){a.j("debugger error: "+(Tg.stack||Tg.message)),d=!1}return d}function rd(a,b,c){b=Lh(a,b,c);for(var d in b)if(!oi(a,b[+d]))return!1;return!0}Za(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Sh(d);B(d,c)}}); break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Ug){a.j("debugger error: "+(Ug.stack||Ug.message)),d=!1}return d}function sd(a,b,c){b=Mh(a,b,c);for(var d in b)if(!pi(a,b[+d]))return!1;return!0}Za(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Th(d);B(d,c)}});
function Ai(a,b,c){t.call(this,"Computer",a,Ai,67108864);this.w.ha=!1;Bi(this,b);this.L=nd(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Ci;this.I=null;this.D=this.R=!1;this.$=nd(this,"url")||"";(Math.random()+.1).toString(36);this.g=Di(this);if(this.b=tb("CPU",this.id)){this.i=tb("Debugger",this.id);this.v=new mc({id:this.Qa+".bus",busWidth:this.X},this.b,this.i);var d,e=rb(this.id);if((this.A=tb("Panel",this.id))&&this.A.Sa)for(b=0;b<e.length;b++)d=e[b],d.P=this.A.P,d.j=this.A.j, function Bi(a,b,c){t.call(this,"Computer",a,Bi,67108864);this.w.ha=!1;Ci(this,b);this.L=od(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Di;this.I=null;this.D=this.R=!1;this.ba=od(this,"url")||"";(Math.random()+.1).toString(36);this.g=Ei(this);if(this.b=tb("CPU",this.id)){this.i=tb("Debugger",this.id);this.v=new mc({id:this.Sa+".bus",busWidth:this.X},this.b,this.i);var d,e=rb(this.id);if((this.A=tb("Panel",this.id))&&this.A.Ta)for(b=0;b<e.length;b++)d=e[b],d.P=this.A.P,d.j=this.A.j,
d.Sa=this.A.Sa;this.j("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ea&&d.Ea(this,this.v,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=nd(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Ci),this.f&&(this.J= d.Ta=this.A.Ta;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.Ga&&d.Ga(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=od(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Di),this.f&&(this.K=
new N(this,"1.30.3"),Ei(this.J)?b=null:delete this.J);!b&&this.f&&(b=Fi(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.P("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.I=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Gi(this,this.Mb)}else q("Unable to find CPU component")}z(Ai);var Ci=0; new N(this,"1.30.3"),Fi(this.K)?b=null:delete this.K);!b&&this.f&&(b=Gi(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.P("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.I=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Hi(this,this.Nb)}else q("Unable to find CPU component")}z(Bi);var Di=0;
function Bi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function nd(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Gi(a,b,c){for(var d=rb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!wb(f)){wb(f,function(){Gi(a,b,c)});return}}b.call(a,c)} function Ci(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 od(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Hi(a,b,c){for(var d=rb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!wb(f)){wb(f,function(){Hi(a,b,c)});return}}b.call(a,c)}
function Hi(a,b){var c=new N(a,"1.30.3","validate");if(Ei(c)&&Ii(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=Ai.prototype; function Ii(a,b){var c=new N(a,"1.30.3","validate");if(Fi(c)&&Ji(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=Bi.prototype;
k.Mb=function(a){void 0===a&&(a=this.f||(this.I?1:Ci));if(!this.C){this.C++;var b=!1,c=!1;this.O=!1;var d=this.J||new N(this,"1.30.3");if(-1==a)b=!0;else if(a>Ci){if(Ei(d,this.I)){this.B=new N(this,"1.30.3","failsafe");Ei(this.B)&&(Ji(this,d),a=2,Ki(this.B));this.B.set("timestamp",Ba());Li(this.B);var e=this.f&&!this.D;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ii(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ei(d,g):("error"== k.Nb=function(a){void 0===a&&(a=this.f||(this.I?1:Di));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>Di){if(Fi(d,this.I)){this.B=new N(this,"1.30.3","failsafe");Fi(this.B)&&(Ki(this,d),a=2,Li(this.B));this.B.set("timestamp",Ba());Mi(this.B);var e=this.f&&!this.D;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ji(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Fi(d,g):("error"==
f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.j(f+": "+g),Ki(d),Ei(d)?(c=Ii(d),e=!0):c=!1))}e&&Hi(this,c?d:null)}else 2==a&&d.clear()}else Hi(this);delete this.I;delete this.J}e=rb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Mi(this,g,d,b,c));b=[d,a,c];-1!=a?Gi(this,this.pc,b):this.pc(b)}}; f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.j(f+": "+g),Li(d),Fi(d)?(c=Ji(d),e=!0):c=!1))}e&&Ii(this,c?d:null)}else 2==a&&d.clear()}else Ii(this);delete this.I;delete this.K}e=rb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Ni(this,g,d,b,c));b=[d,a,c];-1!=a?Hi(this,this.qc,b):this.qc(b)}};
function Mi(a,b,c,d,e){if(!b.w.ha){b.w.ha=!0;if(b.Ga){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ga(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.f=Ci,window&&window.location.reload()):a.O=!0,b.Ga(null),e=!1)}if(!d&&b.vc)for(a=b.vc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} function Ni(a,b,c,d,e){if(!b.w.ha){b.w.ha=!0;if(b.Ia){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.Ia(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.f=Di,window&&window.location.reload()):a.O=!0,b.Ia(null),e=!1)}if(!d&&b.yc)for(a=b.yc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
k.pc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.w.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Mi(this,this.b,b,c,a),this.oa(),this.b.sb());this.O&&(Ji(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0}; k.qc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.w.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ni(this,this.b,b,c,a),this.pa(),this.b.sb());this.O&&(Ki(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0};
function Ji(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} function Ki(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}}
function zi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ba();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Fa&&(c&&a.b.da(),d=a.b.Fa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.w.ha=!1,!1===d&&(e=null)));for(var h=rb(a.id),l=0;l<h.length;l++){var m=h[l];m.w.ha&&(m.Fa&&(d=m.Fa(b,c),"object"===typeof d&&f.set(m.id, function Ai(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ba();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ha&&(c&&a.b.da(),d=a.b.Ha(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.w.ha=!1,!1===d&&(e=null)));for(var h=rb(a.id),l=0;l<h.length;l++){var m=h[l];m.w.ha&&(m.Ha&&(d=m.Ha(b,c),"object"===typeof d&&f.set(m.id,
d)),c&&(m.w.ha=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Ni(a,a.g,f.toString()),Li(g)&&Li(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.w.ha=!1,b=a.G.power)&&(b.textContent="Power");a.C=0;return e} d)),c&&(m.w.ha=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Oi(a,a.g,f.toString()),Mi(g)&&Mi(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.w.ha=!1,b=a.G.power)&&(b.textContent="Power");a.C=0;return e}
k.reset=function(){this.v&&this.v.reset&&(E(this,"Resetting "+this.v.type),this.v.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=rb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.v&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.oa(-1)};k.start=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.oa(-1)}; k.reset=function(){this.v&&this.v.reset&&(E(this,"Resetting "+this.v.type),this.v.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=rb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.v&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.pa(-1)};k.start=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.pa(-1)};
k.stop=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.oa(-1)}; k.stop=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.pa(-1)};
k.oa=function(a){if(this.b){var b=this.b,c=a||0,d=b.G.speed;d&&(0>=c||30<=(b.Db+=c))&&(d.textContent=b.w.W?b.ta.toFixed(2)+"Mhz":"Stopped",b.Db=0)}if(this.A&&(b=this.A,a=a||0,b.I)){c=b.b.w.W;d=!!(b.b.K&4);if(0>=a||60<=(b.H+=a)){for(var e=0;e<b.b.u.length;e++)Pb(b,"R"+e,b.b.u[e]);e=Tc(b.b);Pb(b,"PS",e);Pb(b,"NF",e&8?1:0,1);Pb(b,"ZF",e&4?1:0,1);Pb(b,"VF",e&2?1:0,1);Pb(b,"CF",e&1?1:0,1);b.H=0}hc(b,0<a&&c&&!d?b.b.u[7]:b.f);gc(b,b.D);a=b.b.Ua?b.b.pb&16?1:2:4;jc(b,"B22",a&1);jc(b,"B18",a&2);jc(b,"B16", k.pa=function(a){if(this.b){var b=this.b,c=a||0,d=b.G.speed;d&&(0>=c||30<=(b.tb+=c))&&(d.textContent=b.w.W?b.ma.toFixed(2)+"Mhz":"Stopped",b.tb=0)}if(this.A&&(b=this.A,a=a||0,b.I)){c=b.b.w.W;d=!!(b.b.J&4);if(0>=a||60<=(b.H+=a)){for(var e=0;e<b.b.u.length;e++)Pb(b,"R"+e,b.b.u[e]);e=Uc(b.b);Pb(b,"PS",e);Pb(b,"NF",e&8?1:0,1);Pb(b,"ZF",e&4?1:0,1);Pb(b,"VF",e&2?1:0,1);Pb(b,"CF",e&1?1:0,1);b.H=0}hc(b,0<a&&c&&!d?b.b.u[7]:b.f);gc(b,b.D);a=b.b;a=a.L?a.fb&16?1:2:4;jc(b,"B22",a&1);jc(b,"B18",a&2);jc(b,"B16",
a&4)}}; a&4)}};
k.ra=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.w.ha?zi(d,!1,!0):Gi(d,d.Mb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.w.ha&&!d.C)if(d.f&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");zi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.qc=!0),d.Mb(Ci),d.qc=!1)}else d.reset(),d.b&&d.b.sb()},!0;case "save":if(ta(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]= k.sa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.w.ha?Ai(d,!1,!0):Hi(d,d.Nb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.w.ha&&!d.C)if(d.f&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ai(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.rc=!0),d.Nb(Di),d.rc=!1)}else d.reset(),d.b&&d.b.sb()},!0;case "save":if(ta(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]=
c,c.onclick=function(){var a=Di(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=zi(d,b);b?Ni(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1}; c,c.onclick=function(){var a=Ei(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=Ai(d,b);b?Oi(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1};
function Di(a,b){var c=a.g;c||((c=Ja("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=Oi(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c} function Ei(a,b){var c=a.g;c||((c=Ja("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=Pi(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c}
function Oi(a,b){a.g=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Fi(a){var b=null;a.g&&(b=Fa()+"/api/v1/user?req=load&user="+a.g+"&state="+Pi(a,"1.30.3"));return b} function Pi(a,b){a.g=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Gi(a){var b=null;a.g&&(b=Fa()+"/api/v1/user?req=load&user="+a.g+"&state="+Qi(a,"1.30.3"));return b}
function Ni(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Pi(a,"1.30.3");d.data=c;b=Da(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.P("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.P(c),La("user",""),a.g=null)}} function Oi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Qi(a,"1.30.3");d.data=c;b=Da(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.P("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.P(c),La("user",""),a.g=null)}}
function fh(a){var b;a=rb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.rb=function(a){if(this.Sa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Sa.focus();!a&&window&&window.scrollTo(b,c)}};Za(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new Ai(g,d,!0);B(g,f);g.L&&Gi(g,g.Mb)}}); function gh(a){var b;a=rb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.rb=function(a){if(this.Ta){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Ta.focus();!a&&window&&window.scrollTo(b,c)}};Za(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new Bi(g,d,!0);B(g,f);g.L&&Hi(g,g.Nb)}});
Ua.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.ca&&!c.w.ha&&c.Mb(-1)}});Ua.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.w.ha&&zi(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Pi(a,b,c);this.i=a.i;Ki(this,a.Yc)}function Pi(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a} Ua.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.ca&&!c.w.ha&&c.Nb(-1)}});Ua.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.w.ha&&Ai(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Qi(a,b,c);this.i=a.i;Li(this,a.Yc)}function Qi(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){Ki(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c, N.prototype={constructor:N,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Li(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 Ki(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Li(a){var b=!0;if(Ia()){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 Ii(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Ei(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ja(a.key))?(a[a.id]=b,a.b=!0):!1}var Qi=0; 1);c=0}}};function Li(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Mi(a){var b=!0;if(Ia()){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 Ji(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Fi(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ja(a.key))?(a[a.id]=b,a.b=!0):!1}var Ri=0;
function aj(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)):bj(h,a,b,c,d,e,f)})} function bj(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)):cj(h,a,b,c,d,e,f)})}
function bj(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(qb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"), function cj(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(qb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?cj(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?dj(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
function cj(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, function dj(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);cj(a,b,c)}})}else c(a,null)} "");a=a.replace(d[0],g);dj(a,b,c)}})}else c(a,null)}
function dj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=va(a))}function f(a){e("Error: "+a);l&&(--Qi||ab(!0));l=!1}var g,h,l=!0;Qi++;pb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c|| function ej(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=va(a))}function f(a){e("Error: "+a);l&&(--Ri||ab(!0));l=!1}var g,h,l=!0;Ri++;pb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c||
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?aj(c,null,null,!1,e,function(d,l){l?(qb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Qi||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Qi||ab(!0)):f("invalid machine element: "+ (c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?bj(c,null,null,!1,e,function(d,l){l?(qb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Ri||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Ri||ab(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?aj(b,a,d,!0,e,m):bj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return dj(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?bj(b,a,d,!0,e,m):cj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return ej(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map

View file

@ -40,205 +40,206 @@ function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function r(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== function r(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
function ta(a,b){var c,d={K:null,W:null,ga:null,fa: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.ga=g.load;d.fa=g.exec;if(e=g.bytes)d.K=e;else if(e=g.words)for(d.K=Array(2*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255, function ta(a,b){var c,d={K:null,W:null,ha:null,ga: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.ha=g.load;d.ga=g.exec;if(e=g.bytes)d.K=e;else if(e=g.words)for(d.K=Array(2*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,
d.K[f++]=e[c]>>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.W=g.symbols;d.K.length?1==d.K.length&&(t(d.K[0]),d=null):(t("Empty resource: "+a),d=null)}catch(k){t("Resource data error ("+a+"): "+k.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)){t("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.K=e)}return d} d.K[f++]=e[c]>>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.W=g.symbols;d.K.length?1==d.K.length&&(t(d.K[0]),d=null):(t("Empty resource: "+a),d=null)}catch(k){t("Resource data error ("+a+"): "+k.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)){t("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.K=e)}return d}
function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va} function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va}
function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var x={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0; function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var x={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0;
function Fa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ga(a){x.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ea&&a?(Ea=!0,Ca&&Ja("init"),Da&&Ja("show")):Ea=a}function Ja(a){x[a]&&Ha(x[a])}Fa("onload",function(){Ca=!0;Ha(x.init)});Fa("onpageshow",function(){Da=!0;Ha(x.show)}); function Fa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ga(a){x.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ea&&a?(Ea=!0,Ca&&Ja("init"),Da&&Ja("show")):Ea=a}function Ja(a){x[a]&&Ha(x[a])}Fa("onload",function(){Ca=!0;Ha(x.init)});Fa("onpageshow",function(){Da=!0;Ha(x.show)});
Fa(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ha(x.exit)});function y(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Qb=b.comment;this.sd=b;b=this.id.indexOf(".");0>b?this.ya=this.id:(this.pa=this.id.substr(0,b),this.ya=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Ca:!1,rb:!1,N:!1,error:!1};this.jb=null;this.j.error=!1;this.o={};this.D=null;this.pd=d||0;z.push(this)}var Ka=void 0,La={}; Fa(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ha(x.exit)});function y(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sb=b.comment;this.sd=b;b=this.id.indexOf(".");0>b?this.za=this.id:(this.qa=this.id.substr(0,b),this.za=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,sb:!1,N:!1,error:!1};this.jb=null;this.j.error=!1;this.o={};this.F=null;this.pd=d||0;z.push(this)}var Ka=void 0,La={};
if(window){Ka||(Ka=window.location.search.substr(1));for(var Ma,Na=/\+/g,Oa=/([^&=]+)=?([^&]*)/g;Ma=Oa.exec(Ka);)La[decodeURIComponent(Ma[1].replace(Na," "))]=decodeURIComponent(Ma[2].replace(Na," "))}function Pa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} if(window){Ka||(Ka=window.location.search.substr(1));for(var Ma,Na=/\+/g,Oa=/([^&=]+)=?([^&]*)/g;Ma=Oa.exec(Ka);)La[decodeURIComponent(Ma[1].replace(Na," "))]=decodeURIComponent(Ma[2].replace(Na," "))}function Pa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function A(a,b){b||(b=y);a.prototype=Pa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Qa=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},z=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[a][b]=c)}function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<z.length;b++){var d=z[b];a&&d.id.indexOf(a)||c.push(d)}return c} function A(a,b){b||(b=y);a.prototype=Pa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Qa=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},z=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[a][b]=c)}function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<z.length;b++){var d=z[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function Sa(a){if(void 0!==a){var b;for(b=0;b<z.length;b++)if(z[b].id===a)return z[b]}return null}function Ta(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<z.length;d++)if(c)c==z[d]&&(c=null);else if(!(a!=z[d].type||b&&z[d].id.indexOf(b)))return z[d]}return null}function C(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b} function Sa(a){if(void 0!==a){var b;for(b=0;b<z.length;b++)if(z[b].id===a)return z[b]}return null}function Ta(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<z.length;d++)if(c)c==z[d]&&(c=null);else if(!(a!=z[d].type||b&&z[d].id.indexOf(b)))return z[d]}return null}function C(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
function D(a,b){b=E(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=C(f))&&g.binding&&a.Z(g.type,g.binding,f,g.value),l=k.length}}}} function D(a,b){b=E(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=C(f))&&g.binding&&a.$(g.type,g.binding,f,g.value),l=k.length}}}}
function E(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c} function E(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
y.prototype={constructor:y,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Z:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Wa=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c), y.prototype={constructor:y,parent:null,toString:function(){return this.name?this.name:this.id||this.type},$:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Wa=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.G=function(a){this.T(a,this.ya)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.ya+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},ka:function(){return this.j.N=!0},ja:function(a,b){b&&(this.j.N=!1);return!0}};function Ua(a,b){a.j.rb?(a.j.Ca=!1,a.j.rb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Ca=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.jb,a.jb=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.sb?(a.j.Da=!1,a.j.sb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Da=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.jb,a.jb=null,b&&b()))}
function Va(a,b){b&&(a.j.ready?b():a.jb=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.jb=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.da=this.i=this.c=this.m=this.s=this.v=0;this.A=this.C=this.w=!1;this.F=Za;this.g={};this.b={START:[1,1,!0,!1,this.tc],STEP:[1,1,!1,!1,this.uc],ENABLE:[1,1,!1,!1,this.pc],CONT:[1,1,!0,!1,this.nc],DEP:[0,0,!0,!1,this.oc],EXAM:[1,1,!0,!1,this.qc],LOAD:[1,1,!0,!1,this.sc],TEST:[0,0,!0,!1,this.rc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.vc,a]}A(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()}; function Ya(a){y.call(this,"Panel",a,Ya,1024);this.ea=this.i=this.c=this.m=this.s=this.v=0;this.A=this.B=this.w=!1;this.D=Za;this.g={};this.b={START:[1,1,!0,!1,this.tc],STEP:[1,1,!1,!1,this.uc],ENABLE:[1,1,!1,!1,this.pc],CONT:[1,1,!0,!1,this.nc],DEP:[0,0,!0,!1,this.oc],EXAM:[1,1,!0,!1,this.qc],LOAD:[1,1,!0,!1,this.sc],TEST:[0,0,!0,!1,this.rc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.vc,a]}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.Z=function(a,b,c,d){if(this.l&&this.l.Z(a,b,c,d)||this.a&&this.a.Z(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.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.Z.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.ka=function(a,b){b||(hb(),this.reset());return!0};h.ja=function(){return!0}; 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.D&&a.D.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))}
function ab(a,b){var c=a.b[b];jb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}function bb(a,b){var c=a.b[b];c[2]&&c[3]&&(jb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.tc=function(a){a||this.a.j.P||(a=this.a,a.h.reset(),lb(a),$a(this,"ENABLE")&&mb(this.a))};h.uc=function(){};h.pc=function(a){a||G(this.a)}; function ab(a,b){var c=a.b[b];jb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.B="EXAM"==b)}function bb(a,b){var c=a.b[b];c[2]&&c[3]&&(jb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.tc=function(a){a||this.a.j.P||(a=this.a,a.h.reset(),lb(a),$a(this,"ENABLE")&&mb(this.a))};h.uc=function(){};h.pc=function(a){a||G(this.a)};
h.nc=function(a){if(!a&&!this.a.j.P)if($a(this,"ENABLE"))mb(this.a);else{a=this.D;var b;if(b=a)a.j.Ca&&(a.j.rb=!0),b=!a.j.Ca;if(b)Ua(a,!0),a.ob(0),Ua(a,!1);else try{var c=this.a.ob(1);0<c&&(nb(this.a,c),ob(this.a,c,!0),pb(this.a,c))}catch(d){"number"!=typeof d&&Wa(this.a,d.stack||d.message)}this.stop();this.l&&this.l.xa()}};h.oc=function(a){a&&!this.a.j.P&&(this.A&&qb(this),a=rb(this,this.c),this.F==Za?this.h.nb(this.da,a):this.a.nb(this.da,a))}; h.nc=function(a){if(!a&&!this.a.j.P)if($a(this,"ENABLE"))mb(this.a);else{a=this.F;var b;if(b=a)a.j.Da&&(a.j.sb=!0),b=!a.j.Da;if(b)Ua(a,!0),a.pb(0,null),Ua(a,!1);else try{var c=this.a.pb(1);0<c&&(nb(this.a,c),ob(this.a,c,!0),pb(this.a,c))}catch(d){"number"!=typeof d&&Wa(this.a,d.stack||d.message)}this.stop();this.l&&this.l.ya()}};h.oc=function(a){a&&!this.a.j.P&&(this.A&&qb(this),a=rb(this,this.c),this.D==Za?this.h.ob(this.ea,a):this.a.ob(this.ea,a))};
h.qc=function(a){a||this.a.j.P||(this.C&&qb(this),a=this.F==Za?this.h.lb(this.da):this.a.lb(this.da),rb(this,a))};h.sc=function(a){a||this.a.j.P||sb(this,this.c)};h.rc=function(a){if(a)this.w=!0,fb(this,!0);else if(this.w=!1,fb(this),void 0!==this.o.S0){for(a=this.c=0;22>a;a++)this.b["S"+a][1]=0&1<<a?1:0;gb(this)}};h.vc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)}; h.qc=function(a){a||this.a.j.P||(this.B&&qb(this),a=this.D==Za?this.h.lb(this.ea):this.a.lb(this.ea),rb(this,a))};h.sc=function(a){a||this.a.j.P||sb(this,this.c)};h.rc=function(a){if(a)this.w=!0,fb(this,!0);else if(this.w=!1,fb(this),void 0!==this.o.S0){for(a=this.c=0;22>a;a++)this.b["S"+a][1]=0&1<<a?1:0;gb(this)}};h.vc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)};
function qb(a){var b=1145>a.a.Da?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.h.na;$a(a,"STEP")||(b=-b);sb(a,a.da&~c|a.da+b&c)}function sb(a,b){a.da=b&a.h.na;b=a.da;for(var c=0;22>c;c++)tb(a,"A"+c,b&1<<c)}function rb(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)tb(a,"D"+c,b&1<<c);return a.i}function tb(a,b,c){a.g[b]=c;a.w||ib(a,b,c)}h.stop=function(){sb(this,this.a.f[7])};h.setData=function(a,b){b?this.m=a:this.i=a};h.wc=function(a){return(a?this.c:this.m)&65535};h.ud=function(a){this.m=a}; 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:a.h.oa;$a(a,"STEP")||(b=-b);sb(a,a.ea&~c|a.ea+b&c)}function sb(a,b){a.ea=b&a.h.oa;b=a.ea;for(var c=0;22>c;c++)tb(a,"A"+c,b&1<<c)}function rb(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)tb(a,"D"+c,b&1<<c);return a.i}function tb(a,b,c){a.g[b]=c;a.w||ib(a,b,c)}h.stop=function(){sb(this,this.a.f[7])};h.setData=function(a,b){b?this.m=a:this.i=a};h.wc=function(a){return(a?this.c:this.m)&65535};h.ud=function(a){this.m=a};
var ub={},db=(ub[65400]=[null,null,Ya.prototype.wc,Ya.prototype.ud,"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.wc,Ya.prototype.ud,"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.D=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.C=1<<this.I;this.na=this.C-1;this.b=H;this.c=Math.log2(this.b);this.F=this.b>>2;this.l=this.b-1;this.A=this.C/this.b|0;this.za=[];this.g=0;this.m=!1;this.sb=0;this.w=[];this.fc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.D);this.h=Array(this.A);for(b=0;b<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.tb=0;this.w=[];this.fc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.h=Array(this.A);for(b=0;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.za[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.za[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} function wb(a,b){var c=-1,d=this.controller,e=d.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.za[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.za[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.za[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} function xb(a,b,c){var d=!1,e=this.controller,f=e.Aa[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Aa[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.Aa[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}
function zb(a,b,c){var d=!1,e=this.controller;a=e.za[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,Db(a,c,H,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.na=c-1,c-=H,a.v=Eb(a,c,H),a.i?Db(a,c,H,a.i):(Fb(a,c,H,Gb,a),a.i=Eb(a,c,H)))}}h=vb.prototype;h.reset=function(){for(var a=0;a<this.w.length;a++)this.w[a]();Cb(this,16)};h.ka=function(a,b){b||this.reset();return!0}; function 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.pb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.pb){p=l.size-(f-n);p>g&&(p=g);l.pb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.D,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.sb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)} function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.h.length;){var l=a.h[k],n=k*a.b,p=a.b-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.qb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.qb){p=l.size-(f-n);p>g&&(p=g);l.qb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.F,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.tb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)}
function Eb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.h.length;)d.push(a.h[b++]),c-=a.b;return d}function Db(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.h.length;){var f=d[e++];if(!f)break;a.h[b++]=f;c-=a.b}}function Kb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].Cb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].V(b&a.l,b)}h.lb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.na)>>>this.c;this.m=!1;this.g++;a=this.h[c].Wb(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].Eb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.oa)>>>a.c].V(b&a.l,b)}h.lb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.oa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Wb(b,a);this.g--;return a};
function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].Hb(b&a.l,c&255,b)}h.Za=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.na)>>>this.c].Ib(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].qb(b&a.l,c&65535,b)}h.nb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.na)>>>this.c;this.m=!1;this.g++;this.h[d].dc(c,b&65535,a);this.g--}; function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].Ib(b&a.l,c&255,b)}h.Za=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.oa)>>>this.c].Jb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].rb(b&a.l,c&65535,b)}h.ob=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.oa)>>>this.c;this.m=!1;this.g++;this.h[d].dc(c,b&65535,a);this.g--};
function Pb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.h[d];if(e.va||e.jc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Qb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Bb;if(void 0!==a.za[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.za[n]=[d,e,f,g,l||"unknown",k,!1]}return!0} function Pb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.h[d];if(e.wa||e.jc){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.Da)){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.pd||64,p||b.ya))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.pd||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.ea|=c),K(a.a,4,0,b))}function Rb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){y.call(this,"Device",a,L,512);this.b={L:0,Gb:-1}}A(L);h=L.prototype;h.ia=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.D=d;var e=this;this.b.Gb=Sb(c,function(){e.b.Xa|=128;e.b.Xa&64&&Tb(e.a,e.b.qd);e.l&&e.l.xa(1);Ub(e.a,e.b.Gb,1E3/60)});this.b.qd=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,512);this.b={L:0,Hb:-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.Hb=Sb(c,function(){e.b.Xa|=128;e.b.Xa&64&&Tb(e.a,e.b.qd);e.l&&e.l.ya(1);Ub(e.a,e.b.Hb,1E3/60)});this.b.qd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)};
h.reset=function(){this.b.Xa=128;Ub(this.a,this.b.Gb,1E3/60,!0)};h.Ec=function(){return this.b.Xa};h.Cd=function(a){this.b.Xa=a&192};h.Gc=function(){var a=this.a;return a.I&62337|a.ab<<5|a.bb<<1};h.Ed=function(a){var b=this.a;a&=62337;if(b.I!=a){b.I=a;b.ab=a>>5&3;b.bb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Aa!=c&&(b.Aa=c,Xb(b))}};h.Hc=function(){var a=this.a;a.I&57344||(a.Ub=a.$&65535);a=a.Ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){var a=this.a;a.I&57344||(a.ac=a.zb);return a.ac}; h.reset=function(){this.b.Xa=128;Ub(this.a,this.b.Hb,1E3/60,!0)};h.Ec=function(){return this.b.Xa};h.Cd=function(a){this.b.Xa=a&192};h.Gc=function(){var a=this.a;return a.Z&-3199|a.ab<<5|a.bb<<1};h.Ed=function(a){Xb(this.a,a&-129|this.a.Z&128)};h.Hc=function(){var a=this.a;a.Z&57344||(a.Cb=a.A>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){var a=this.a;a.Z&57344||(a.Db=a.A&65535);return a.Db};h.Jc=function(){return this.a.Ba};
h.Jc=function(){return this.a.Ea};h.Fd=function(a){var b=this.a;1170>b.Da&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Ra=a&16?4194303:262143,Xb(b))};h.kd=function(a){a=a>>1&63;var b=this.a.$a[a>>1];return a&1?b>>16:b&65535};h.fe=function(a,b){b=b>>1&63;var c=b>>1;this.a.$a[c]=b&1?this.a.$a[c]&65535|(a&63)<<16:this.a.$a[c]&-65536|a&65534};h.cd=function(a){return this.a.H[1][a>>1&7]};h.Zd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.ad=function(a){return this.a.H[1][(a>>1&7)+8]}; h.Fd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Ra=a&16?4194303:262143,Yb(b))};h.kd=function(a){a=a>>1&63;var b=this.a.$a[a>>1];return a&1?b>>16:b&65535};h.fe=function(a,b){b=b>>1&63;var c=b>>1;this.a.$a[c]=b&1?this.a.$a[c]&65535|(a&63)<<16:this.a.$a[c]&-65536|a&65534};h.cd=function(a){return this.a.H[1][a>>1&7]};h.Zd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.ad=function(a){return this.a.H[1][(a>>1&7)+8]};h.Xd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};
h.Xd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.bd=function(a){return this.a.X[1][a>>1&7]};h.Yd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.$c=function(a){return this.a.X[1][(a>>1&7)+8]};h.Wd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Dc=function(a){return this.a.H[0][a>>1&7]};h.Bd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Bc=function(a){return this.a.H[0][(a>>1&7)+8]};h.zd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295}; h.bd=function(a){return this.a.X[1][a>>1&7]};h.Yd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.$c=function(a){return this.a.X[1][(a>>1&7)+8]};h.Wd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Dc=function(a){return this.a.H[0][a>>1&7]};h.Bd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Bc=function(a){return this.a.H[0][(a>>1&7)+8]};h.zd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Cc=function(a){return this.a.X[0][a>>1&7]};
h.Cc=function(a){return this.a.X[0][a>>1&7]};h.Ad=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Ac=function(a){return this.a.X[0][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.jd=function(a){return this.a.H[3][a>>1&7]};h.ee=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.gd=function(a){return this.a.H[3][(a>>1&7)+8]};h.ce=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.hd=function(a){return this.a.X[3][a>>1&7]}; h.Ad=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Ac=function(a){return this.a.X[0][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.jd=function(a){return this.a.H[3][a>>1&7]};h.ee=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.gd=function(a){return this.a.H[3][(a>>1&7)+8]};h.ce=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.hd=function(a){return this.a.X[3][a>>1&7]};h.de=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};
h.de=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.fd=function(a){return this.a.X[3][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.B&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.B&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Oc=function(){return this.a.B&49152?this.a.oa[0]:this.a.f[6]};h.Kd=function(a){this.a.B&49152?this.a.oa[0]=a:this.a.f[6]=a};h.Rc=function(){return this.a.f[7]}; h.fd=function(a){return this.a.X[3][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.C&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.C&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Oc=function(){return this.a.C&49152?this.a.pa[0]:this.a.f[6]};h.Kd=function(a){this.a.C&49152?this.a.pa[0]=a:this.a.f[6]=a};h.Rc=function(){return this.a.f[7]};h.Nd=function(a){this.a.f[7]=a};
h.Nd=function(a){this.a.f[7]=a};h.Na=function(a){a&=7;return this.a.B&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Pc=function(){return 1==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[1]};h.Ld=function(a){1==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[1]=a};h.Qc=function(){return 3==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[3]};h.Md=function(a){3==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[3]=a};h.yc=function(a){return this.a.Zb[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.Pc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[1]};h.Ld=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[1]=a};h.Qc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[3]};h.Md=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[3]=a};h.yc=function(a){return this.a.Zb[a-65504>>1]};
h.wd=function(a,b){this.a.Zb[b-65504>>1]=a};h.Vb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.sb}a=(a>>6)-1}else a=0;return a};h.cc=function(){};h.ed=function(){return 1};h.ae=function(){};h.xc=function(){return this.a.ea};h.vd=function(){this.a.ea=0};h.Fc=function(){return this.a.Yb};h.Dd=function(a,b){b&1||(a&=255);this.a.Yb=a};h.Kc=function(a){return a?this.a.Eb:0};h.Gd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Eb=a;b.u|=2}; h.wd=function(a,b){this.a.Zb[b-65504>>1]=a};h.Vb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.tb}a=(a>>6)-1}else a=0;return a};h.cc=function(){};h.ed=function(){return 1};h.ae=function(){};h.xc=function(){return this.a.fa};h.vd=function(){this.a.fa=0};h.Fc=function(){return this.a.Yb};h.Dd=function(a,b){b&1||(a&=255);this.a.Yb=a};h.Kc=function(a){return a?this.a.Fb:0};h.Gd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Fb=a;b.u|=2};
h.dd=function(a){return a?this.a.mb&65280:0};h.$d=function(a){this.a.mb=a|255};h.Nc=function(){return Yb(this.a)};h.Jd=function(a){Zb(this.a,a&-1793|Yb(this.a)&1792);this.a.u|=128};h.bc=function(){}; h.dd=function(a){return a?this.a.nb&65280:0};h.$d=function(a){this.a.nb=a|255};h.Nc=function(){return Zb(this.a)};h.Jd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.bc=function(){};
var M={},Wb=(M[61568]=[null,null,L.prototype.kd,L.prototype.fe,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.bd,L.prototype.Yd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.$c,L.prototype.Wd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Dc,L.prototype.Bd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Cc, var M={},Wb=(M[61568]=[null,null,L.prototype.kd,L.prototype.fe,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.bd,L.prototype.Yd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.$c,L.prototype.Wd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Dc,L.prototype.Bd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Cc,
L.prototype.Ad,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Ac,L.prototype.yd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Jc,L.prototype.Fd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Ec,L.prototype.Cd,"LKS"],M[65402]=[null,null,L.prototype.Gc,L.prototype.Ed,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Hc,L.prototype.bc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Ic,L.prototype.bc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.jd,L.prototype.ee,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.gd, L.prototype.Ad,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Ac,L.prototype.yd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Jc,L.prototype.Fd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Ec,L.prototype.Cd,"LKS"],M[65402]=[null,null,L.prototype.Gc,L.prototype.Ed,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Hc,L.prototype.bc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Ic,L.prototype.bc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.jd,L.prototype.ee,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.gd,
L.prototype.ce,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.de,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.fd,L.prototype.be,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa, L.prototype.ce,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.de,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.fd,L.prototype.be,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa,
"R5SET0"],M[65478]=[null,null,L.prototype.Oc,L.prototype.Kd,"R6KERNEL"],M[65479]=[null,null,L.prototype.Rc,L.prototype.Nd,"R7KERNEL"],M[65480]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Na, "R5SET0"],M[65478]=[null,null,L.prototype.Oc,L.prototype.Kd,"R6KERNEL"],M[65479]=[null,null,L.prototype.Rc,L.prototype.Nd,"R7KERNEL"],M[65480]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Na,
L.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Pc,L.prototype.Ld,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Qc,L.prototype.Md,"R6USER",1,1145],M[65504]=[null,null,L.prototype.yc,L.prototype.wd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Vb,L.prototype.cc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Vb,L.prototype.cc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.ed,L.prototype.ae,"SYSID",1,1170],M[65526]=[null,null,L.prototype.xc,L.prototype.vd,"CPUERR",1,1170],M[65528]= L.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Pc,L.prototype.Ld,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Qc,L.prototype.Md,"R6USER",1,1145],M[65504]=[null,null,L.prototype.yc,L.prototype.wd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Vb,L.prototype.cc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Vb,L.prototype.cc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.ed,L.prototype.ae,"SYSID",1,1170],M[65526]=[null,null,L.prototype.xc,L.prototype.vd,"CPUERR",1,1170],M[65528]=
[null,null,L.prototype.Fc,L.prototype.Dd,"MB",1,1170],M[65530]=[null,null,L.prototype.Kc,L.prototype.Gd,"PIR"],M[65532]=[null,null,L.prototype.dd,L.prototype.$d,"SL"],M[65534]=[null,null,L.prototype.Nc,L.prototype.Jd,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=C(d);switch(c.type){case "default":c=new L(c);D(c,d);break;case "pc11":c=new $b(c);D(c,d);break;case "rl11":c=new N(c),D(c,d)}}});var ac; [null,null,L.prototype.Fc,L.prototype.Dd,"MB",1,1170],M[65530]=[null,null,L.prototype.Kc,L.prototype.Gd,"PIR"],M[65532]=[null,null,L.prototype.dd,L.prototype.$d,"SL"],M[65534]=[null,null,L.prototype.Nc,L.prototype.Jd,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=C(d);switch(c.type){case "default":c=new L(c);D(c,d);break;case "pc11":c=new ac(c);D(c,d);break;case "rl11":c=new N(c),D(c,d)}}});var bc;
if(Xa){var bc=new ArrayBuffer(2);(new DataView(bc)).setUint16(0,256,!0);ac=256===(new Uint16Array(bc))[0]}else ac=!1;var cc=ac; if(Xa){var cc=new ArrayBuffer(2);(new DataView(cc)).setUint16(0,256,!0);bc=256===(new Uint16Array(cc))[0]}else bc=!1;var dc=bc;
function I(a,b,c,d,e,f){this.h=a;this.id=dc+=2;this.a=null;this.Ka=b;this.pb=c;this.size=d||0;this.type=e||ec;this.l=e==fc;this.controller=null;Ab(this);this.va=this.jc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],gc(this,f.fc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),gc(this,cc?hc:ic);else{a=this.a=Array(this.size>> function I(a,b,c,d,e,f){this.h=a;this.id=ec+=2;this.a=null;this.Ka=b;this.qb=c;this.size=d||0;this.type=e||fc;this.l=e==gc;this.controller=null;Ab(this);this.wa=this.jc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],hc(this,f.fc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;gc(this,jc)}else gc(this)}var ec=0,Ib=1,fc=2,Gb=4,Jb=["NONE","RAM","ROM","VID","H/W"],dc=0; 2);for(f=0;f<a.length;f++)a[f]=0;hc(this,kc)}else hc(this)}var fc=0,Ib=1,gc=2,Gb=4,Jb=["NONE","RAM","ROM","VID","H/W"],ec=0;
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Xa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Xa)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.va=!0}return!1},v:function(a,b){J(this.h,b,32);return 255},g:function(a,b,c){J(this.h,c,32)},w:function(a,b){return this.Cb(a++,b++)| I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Xa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Xa)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.wa=!0}return!1},v:function(a,b){J(this.h,b,32);return 255},g:function(a,b,c){J(this.h,c,32)},w:function(a,b){return this.Eb(a++,b++)|
this.Cb(a,b)<<8},A:function(a,b,c){this.Hb(a++,b&255,c++);this.Hb(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.va=!0},ya:function(a,b,c){a&1&&J(this.h,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256| this.Eb(a,b)<<8},A:function(a,b,c){this.Ib(a++,b&255,c++);this.Ib(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ba:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},sa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.wa=!0},za:function(a,b,c){a&1&&J(this.h,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
b>>8);this.va=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Wb(a,b)},pa:function(a,b,c){this.l?this.g(a,b,c):this.Ib(a,b,c)},ta:function(a,b,c){this.l?this.g(a,b,c):this.dc(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},$:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},la:function(a,b){this.o[a]=b;this.va=!0},qa:function(a,b){this.o[a]=b;this.va=!0},sa:function(a,b,c){a&1&&J(this.h, b>>8);this.wa=!0},D:function(a,b){return this.I(a,b)},R:function(a,b){return this.Wb(a,b)},qa:function(a,b,c){this.l?this.g(a,b,c):this.Jb(a,b,c)},ua:function(a,b,c){this.l?this.g(a,b,c):this.dc(a,b,c)},B:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},ma:function(a,b){this.o[a]=b;this.wa=!0},ra:function(a,b){this.o[a]=b;this.wa=!0},ta:function(a,b,c){a&1&&J(this.h,
c,64);this.c.setUint16(a,b,!0);this.va=!0},ua:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.va=!0}};function Ab(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&kc(a,nc,!1),(a.m=c.m)&&oc(a,nc,!1))}function oc(a,b,c){c&&a.m||(a.Hb=!a.l&&b[1]||a.g,a.qb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Ib=b[1]||a.g,a.dc=b[3]||a.A}function kc(a,b,c){c&&a.i||(a.Cb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Wb=b[2]||a.w}function gc(a,b){b||(b=pc);kc(a,b,void 0);oc(a,b,void 0)} c,64);this.c.setUint16(a,b,!0);this.wa=!0},va:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.wa=!0}};function Ab(a,b,c){a.F=b;a.i=a.m=0;c&&((a.i=c.i)&&nc(a,oc,!1),(a.m=c.m)&&pc(a,oc,!1))}function pc(a,b,c){c&&a.m||(a.Ib=!a.l&&b[1]||a.g,a.rb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Jb=b[1]||a.g,a.dc=b[3]||a.A}function nc(a,b,c){c&&a.i||(a.Eb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Wb=b[2]||a.w}function hc(a,b){b||(b=qc);nc(a,b,void 0);pc(a,b,void 0)}
var pc=[],jc=[I.prototype.M,I.prototype.ra,I.prototype.aa,I.prototype.ya],nc=[I.prototype.F,I.prototype.pa,I.prototype.R,I.prototype.ta];if(Xa)var ic=[I.prototype.C,I.prototype.la,I.prototype.O,I.prototype.sa],hc=[I.prototype.J,I.prototype.qa,I.prototype.$,I.prototype.ua]; var qc=[],kc=[I.prototype.M,I.prototype.sa,I.prototype.ba,I.prototype.za],oc=[I.prototype.D,I.prototype.qa,I.prototype.R,I.prototype.ua];if(Xa)var jc=[I.prototype.B,I.prototype.ma,I.prototype.O,I.prototype.ta],ic=[I.prototype.J,I.prototype.ra,I.prototype.aa,I.prototype.va];
function qc(a,b){y.call(this,"CPU",a,qc,1);b=a.cycles||b;var c=a.multiplier||1;this.wb=0;this.ib=b;this.sa=c;this.Ab=Math.round(this.ib/1E4)/100;this.Ha=this.Ab*this.sa;this.j.P=!1;this.j.Fb=!1;this.j.Va=a.autoStart;this.j.eb=!1;this.fb=this.Ia=0;this.gb=a.csStart;this.Sa=a.csInterval;this.Ta=a.csStop;this.J=[];this.Tb=this.od.bind(this);F(this)}A(qc);var rc=["power","reset"];h=qc.prototype; function rc(a,b){y.call(this,"CPU",a,rc,1);b=a.cycles||b;var c=a.multiplier||1;this.xb=0;this.ib=b;this.ta=c;this.Ab=Math.round(this.ib/1E4)/100;this.Ha=this.Ab*this.ta;this.j.P=!1;this.j.Gb=!1;this.j.Va=a.autoStart;this.j.eb=!1;this.fb=this.Ia=0;this.gb=a.csStart;this.Sa=a.csInterval;this.Ta=a.csStop;this.J=[];this.ac=this.od.bind(this);F(this)}A(rc);var sc=["power","reset"];h=rc.prototype;
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.D=d;this.w=a.w;for(b=0;b<rc.length;b++)(c=this.o[rc[b]])&&this.l.Z(null,rc[b],c);a=sc(a,"autoStart");null!=a&&(this.j.Va="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ka=function(a,b){if(!b){if(a&&this.restore){tc(this);if(!this.restore(a))return!1;uc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ja=function(a){return a?this.save():!0}; h.ja=function(a,b,c,d){this.l=a;this.h=b;this.F=d;this.w=a.w;for(b=0;b<sc.length;b++)(c=this.o[sc[b]])&&this.l.$(null,sc[b],c);a=tc(a,"autoStart");null!=a&&(this.j.Va="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.la=function(a,b){if(!b){if(a&&this.restore){uc(this);if(!this.restore(a))return!1;vc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ka=function(a){return a?this.save():!0};
h.Va=function(){return this.j.Va||void 0===this.o.run?(mb(this),!0):!1};h.Mb=function(){return 0};function uc(a){void 0===a.gb&&(a.gb=0);void 0===a.Sa&&(a.Sa=-1);void 0===a.Ta&&(a.Ta=-1);a.j.eb=0<=a.gb&&0<a.Sa;a.j.eb&&(a.fb=0,a.Ia=a.gb-a.ua)}function pb(a,b){if(a.j.eb){var c=!1;a.fb=a.fb+a.Mb()|0;a.Ia-=b;0>=a.Ia&&(a.Ia+=a.Sa,c=!0);0<=a.Ta&&a.Ta<=vc(a)&&(a.Sa=a.Ta=-1,uc(a),G(a),c=!0);c&&a.T(vc(a)+" cycles: checksum="+m(a.fb))}} h.Va=function(){return this.j.Va||void 0===this.o.run?(mb(this),!0):!1};h.Nb=function(){return 0};function vc(a){void 0===a.gb&&(a.gb=0);void 0===a.Sa&&(a.Sa=-1);void 0===a.Ta&&(a.Ta=-1);a.j.eb=0<=a.gb&&0<a.Sa;a.j.eb&&(a.fb=0,a.Ia=a.gb-a.va)}function pb(a,b){if(a.j.eb){var c=!1;a.fb=a.fb+a.Nb()|0;a.Ia-=b;0>=a.Ia&&(a.Ia+=a.Sa,c=!0);0<=a.Ta&&a.Ta<=wc(a)&&(a.Sa=a.Ta=-1,vc(a),G(a),c=!0);c&&a.T(wc(a)+" cycles: checksum="+m(a.fb))}}
h.Z=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.N)a=!0;else{var b=null,c,k=B(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.N);c++);c==k.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.jb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.P?G(d):mb(d))},!0;case "speed":return this.o[b]= h.$=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.N)a=!0;else{var b=null,c,k=B(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.N);c++);c==k.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.jb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.P?G(d):mb(d))},!0;case "speed":return this.o[b]=
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){wc(d,d.sa<<1,!0)},c.textContent=this.Ha.toFixed(2)+"Mhz",!0}return!1};h.xa=function(a){this.l&&this.l.xa(a)};function ob(a,b,c){a.ua+=b;c&&(a.ra=a.a=a.F=0)}function xc(a,b){var c=1;b&&1<a.sa&&a.Ga&&(c=a.Ga/a.Ab);a.Rb=Math.round(1E3/30);a.kb=Math.floor(a.ib/30*c);b||(a.Ua=a.kb);a.Bb=0}function vc(a){return a.ua+a.la+a.ra-a.a}function tc(a){a.Ga=0;a.Sb=0;a.ua=a.la=a.ra=a.a=a.F=0;uc(a);wc(a,1)} c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){xc(d,d.ta<<1,!0)},c.textContent=this.Ha.toFixed(2)+"Mhz",!0}return!1};h.ya=function(a){this.l&&this.l.ya(a)};function ob(a,b,c){a.va+=b;c&&(a.sa=a.a=a.I=0)}function yc(a,b){var c=1;b&&1<a.ta&&a.Ga&&(c=a.Ga/a.Ab);a.Tb=Math.round(1E3/30);a.kb=Math.floor(a.ib/30*c);b||(a.Ua=a.kb);a.Bb=0}function wc(a){return a.va+a.ma+a.sa-a.a}function uc(a){a.Ga=0;a.Ub=0;a.va=a.ma=a.sa=a.a=a.I=0;vc(a);xc(a,1)}
function wc(a,b,c){if(void 0!==b){.8>a.Ga/a.Ha&&(b=1);a.sa=b;b=a.Ab*a.sa;if(a.Ha!=b){a.Ha=b;b=a.Ha.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&yc(a.l)}ob(a,a.la);a.la=0;a.aa=ra();a.qa=0;xc(a)}function Sb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Ub(a,b,c,d){0<=b&&b<a.J.length&&(d||0>a.J[b][0])&&(c=a.ib*a.sa/1E3*c|0,a.j.P&&(c+=zc(a)),a.J[b][0]=c)} function xc(a,b,c){if(void 0!==b){.8>a.Ga/a.Ha&&(b=1);a.ta=b;b=a.Ab*a.ta;if(a.Ha!=b){a.Ha=b;b=a.Ha.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&zc(a.l)}ob(a,a.ma);a.ma=0;a.ba=ra();a.ra=0;yc(a)}function Sb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Ub(a,b,c,d){0<=b&&b<a.J.length&&(d||0>a.J[b][0])&&(c=a.ib*a.ta/1E3*c|0,a.j.P&&(c+=Ac(a)),a.J[b][0]=c)}
function nb(a,b){for(var c=a.J.length-1;0<=c;c--){var d=a.J[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function zc(a,b){var c=a.ra-=a.a;a.a=a.F=0;b&&(a.ra=0);return c} function nb(a,b){for(var c=a.J.length-1;0<=c;c--){var d=a.J[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Ac(a,b){var c=a.sa-=a.a;a.a=a.I=0;b&&(a.sa=0);return c}
h.od=function(){if(this.j.P){this.Bb>=this.ib&&xc(this,!0);this.Qa=0;this.cb=ra();if(this.qa){var a=this.cb-this.qa;a>this.Rb&&(this.aa+=a,this.aa>this.cb&&(this.aa=this.cb))}try{do{for(var b,c=this.j.eb?1:this.kb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.ob(b)}catch(f){if("number"!=typeof f)throw f;}b=zc(this,!0);this.Qa+=b;this.la+=b;pb(this,b);nb(this,b);this.Ua-=b;if(0>=this.Ua){this.Ua+=this.kb;15<=++this.Sb&&(this.xa(),this.Sb=0);break}}while(this.j.P)}catch(f){G(this); h.od=function(){if(this.j.P){this.Bb>=this.ib&&yc(this,!0);this.Qa=0;this.cb=ra();if(this.ra){var a=this.cb-this.ra;a>this.Tb&&(this.ba+=a,this.ba>this.cb&&(this.ba=this.cb))}try{do{for(var b,c=this.j.eb?1:this.kb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.pb(b)}catch(f){if("number"!=typeof f)throw f;}b=Ac(this,!0);this.Qa+=b;this.ma+=b;pb(this,b);nb(this,b);this.Ua-=b;if(0>=this.Ua){this.Ua+=this.kb;15<=++this.Ub&&(this.ya(),this.Ub=0);break}}while(this.j.P)}catch(f){G(this);
this.l&&this.l.stop(ra(),vc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.Tb;this.qa=ra();c=this.Rb;this.Qa&&(c=Math.round(c*this.Qa/this.kb));c-=this.qa-this.cb;if(d=this.qa-this.aa)this.Ga=Math.round(this.la/(10*d))/100,864E5<=d&&(this.ua=0,wc(this));if(0>c||this.Ga<this.Ha)-1E3>c&&(this.aa-=c),c=0;this.Bb+=this.Qa;this.qa+=c;a(b,c)}}}; this.l&&this.l.stop(ra(),wc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.ac;this.ra=ra();c=this.Tb;this.Qa&&(c=Math.round(c*this.Qa/this.kb));c-=this.ra-this.cb;if(d=this.ra-this.ba)this.Ga=Math.round(this.ma/(10*d))/100,864E5<=d&&(this.va=0,xc(this));if(0>c||this.Ga<this.Ha)-1E3>c&&(this.ba-=c),c=0;this.Bb+=this.Qa;this.ra+=c;a(b,c)}}};
function mb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.P)a.T(a.toString()+" busy");else{wc(a);a.j.P=!0;a.j.Fb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.aa,vc(a));setTimeout(a.Tb,0)}}h.ob=function(){return 0};function G(a){var b=!1;if(a.j.P){zc(a);ob(a,a.la);a.la=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),vc(a));b=!0}a.j.complete=void 0;return b} function mb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.P)a.T(a.toString()+" busy");else{xc(a);a.j.P=!0;a.j.Gb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.ba,wc(a));setTimeout(a.ac,0)}}h.pb=function(){return 0};function G(a){var b=!1;if(a.j.P){Ac(a);ob(a,a.ma);a.ma=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),wc(a));b=!0}a.j.complete=void 0;return b}
function Ac(a){this.Da=+a.model||1170;this.Ob=a.addrReset||0;qc.call(this,a,6666667);this.decode=1120==this.Da?Bc.bind(this):Cc.bind(this);Dc(this);this.ta=0;this.O=null;this.j.complete=!1}A(Ac,qc);h=Ac.prototype;h.reset=function(){this.status("model "+this.Da);this.j.P&&G(this);Dc(this);tc(this);this.j.error=!1;this.parent.reset.call(this)}; function Bc(a){this.Ea=+a.model||1170;this.Rb=a.addrReset||0;rc.call(this,a,6666667);this.decode=1120==this.Ea?Cc.bind(this):Dc.bind(this);Ec(this);this.ua=0;this.O=null;this.j.complete=!1}A(Bc,rc);h=Bc.prototype;h.reset=function(){this.status("model "+this.Ea);this.j.P&&G(this);Ec(this);uc(this);this.j.error=!1;this.parent.reset.call(this)};
function Dc(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.B=15;a.f=[0,0,0,0,0,0,0,a.Ob];a.Fa=[0,0,0,0,0,0];a.oa=[0,0,0,0];a.v=0;a.bb=0;a.rd=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.$a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, function Ec(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.C=15;a.f=[0,0,0,0,0,0,0,a.Rb];a.Fa=[0,0,0,0,0,0];a.pa=[0,0,0,0];a.v=0;a.bb=0;a.rd=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.$a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0];a.Zb=[0,0,0,0,0,0,0,0];a.Yb=0;a.u=0;a.A=a.C=0;a.c=a.b=a.yb=0;a.Ja=-1;lb(a)}function lb(a){a.mb=255;a.ea=0;a.Eb=0;a.I=0;a.Ub=0;a.ac=0;a.Ea=0;a.Aa=0;a.ab=0;a.Ra=262143;a.$=0;a.zb=0;a.O=null;a.h&&Xb(a)}function Xb(a){a.Aa?(a.R=65536,a.M=a.mc,a.V=a.ld,a.qb=a.ge,Cb(a.h,a.Ea&16?22:18)):(a.R=0,a.M=a.lc,a.V=a.Xb,a.qb=a.ec,Cb(a.h,16))}h.Mb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ua,this.sa]);a.set(2,Pb(this.h));return a.data()}; 0,0,0,0,0,0,0,0,0];a.Zb=[0,0,0,0,0,0,0,0];a.Yb=0;a.u=0;a.B=a.D=0;a.c=a.b=a.zb=0;a.Ja=-1;lb(a)}function lb(a){a.nb=255;a.fa=0;a.Fb=0;a.Z=0;a.Cb=0;a.Db=0;a.Ba=0;a.aa=0;a.ab=0;a.Ra=262143;a.A=0;a.O=null;a.h&&Yb(a)}function Yb(a){a.aa?(a.R=65536,a.Qb=a.Ba&16?4186112:253952,a.M=a.mc,a.V=a.ld,a.rb=a.ge,Cb(a.h,a.Ba&16?22:18)):(a.R=0,a.Qb=57344,a.M=a.lc,a.V=a.Xb,a.rb=a.ec,Cb(a.h,16))}
h.restore=function(a){var b=a[1];this.ua=b[1];wc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.F){for(var f=0,g=Array(b.F),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.h[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function P(a){return a.m&65536?1:0}function Ec(a){return a.s&32768?8:0}function Fc(a){var b=a.f[7];a.$=0;a.zb=b;var c=a.V(b);a.f[7]=b+2&65535;return c} function Xb(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Cb=a.A>>16&65535,a.Db=a.A&65535);a.Z=b;a.ab=b>>5&3;a.bb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.aa!=c&&(a.aa=c,Yb(a))}}h.Nb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.va,this.ta]);a.set(2,Pb(this.h));return a.data()};
function Gc(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{td:a,La:b,next:null}}function Hc(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 Ic(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} h.restore=function(a){var b=a[1];this.va=b[1];xc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.D){for(var f=0,g=Array(b.D),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.h[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function P(a){return a.m&65536?1:0}function Fc(a){return a.s&32768?8:0}function Gc(a){var b=a.f[7];a.A=b;var c=a.V(b);a.f[7]=b+2&65535;return c}
function Yb(a){return a.B=a.B&63728|Ec(a)|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}function Zb(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Fa.length;0<=--c;){var d=a.f[c];a.f[c]=a.Fa[c];a.Fa[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.oa[c]=a.f[6],a.f[6]=a.oa[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Jc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Kc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))} 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{td: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 Lc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Mc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ta){0>a.Ja?a.Ja=Yb(a):a.v||(b=4,a.ea|=4,a.f[6]=4,d=-3);a.zb=b;a.$=0;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);Zb(a,f&-12289|a.Ja>>2&12288);Nc(a,a.Ja);Nc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Oc(a){var b=Pc(a),c=Pc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);Q(a,b);Zb(a,c);a.u&=-17} 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 Lb(a,b){var c=b>>13&31;31>c&&a.Ea&32&&(b=a.$a[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} function 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 Qc(a,b,c){var d,e,f;if(!(c&a.Aa))return b;d=b>>13;a.Ea&a.rd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.ab=a.v,a.bb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.I&57344||(a.I=a.I|g|a.ab<<5|a.bb<< function Lb(a,b){var c=b>>13&31;31>c&&a.Ba&32&&(b=a.$a[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
1),b=!0),a.I&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.I|=4096,a.I&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Pc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Nc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.$=a.$<<8|246;Rc(a,0,c);a.qb(c,b)}function Rc(a,b,c){!a.v&&c<=a.mb&&(b||4<c)&&(1145<=a.Da&&c<=a.mb-32?(a.ea|=4,a.f[6]=4,K(a,4,0,-3)):(a.ea|=8,a.u|=32))} function Rc(a,b,c){var d,e,f;if(!(c&a.aa))return f=b&65535,57344<=f&&(f|=a.Qb),f;d=b>>13;a.Ba&a.rd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.ab=a.v,a.bb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.Z&
function Sc(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&&Rc(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(Gc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Gc(a,2)),e=e+a.f[c]& 57344||(g|=a.ab<<5|a.bb<<1,Xb(a,a.Z&-61695|g)),b=!0),a.Z&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.rb(c,b)}function Sc(a,b,c){!a.v&&c<=a.nb&&(b||4<c)&&(1145<=a.Ea&&c<=a.nb-32?(a.fa|=4,a.f[6]=4,K(a,4,0,-3)):(a.fa|=8,a.u|=32))}
65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.$=a.$<<8|f<<3&248|c;6==c&&0>f&&Rc(a,b,a.f[6]);return e}h.lb=function(a){if(!this.Aa)return this.h.lb(a);this.ta++;a=this.Xb(Qc(this,a,2));this.ta--;return a};h.Za=function(a,b){this.Aa?(this.ta++,a=Qc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ta--):this.h.Za(a,b)};h.nb=function(a,b){this.Aa?(this.ta++,this.ec(Qc(this,a,4),b),this.ta--):this.h.nb(a,b)};h.lc=function(a,b,c){return Sc(this,a,b,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]&
h.mc=function(a,b,c){return Qc(this,Sc(this,a,b,c),c)};h.Xb=function(a){return Mb(this.h,a)};h.ld=function(a){return Mb(this.h,Qc(this,a,2))};h.ec=function(a,b){Ob(this.h,a,b&65535)};h.ge=function(a,b){Ob(this.h,Qc(this,a,4),b)};function Tc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Sc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.f[d]:a.oa[a.B>>12&3];return c} 65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&Sc(a,b,a.f[6]);return e}h.lb=function(a){if(!this.aa)return this.h.lb(a);this.ua++;a=this.Xb(Rc(this,a,2));this.ua--;return a};h.Za=function(a,b){this.aa?(this.ua++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.Za(a,b)};h.ob=function(a,b){this.aa?(this.ua++,this.ec(Rc(this,a,4),b),this.ua--):this.h.ob(a,b)};h.lc=function(a,b,c){return Tc(this,a,b,c)};
function Uc(a,b,c,d){a.$=22;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Sc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Qc(a,e|c&65536,4),a.v=a.B>>14&3,Ob(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.f[e]=d:a.oa[a.B>>12&3]=d}function Vc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=-c-1;return a}function Wc(a,b){var c;b>>=6;var d=a.C=b&7;(b=a.A=(b&56)>>3)?c=Mb(a.h,a.M(b,d,2)):c=-d-1;return c}function Xc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Sc(a,b,c,8)} h.mc=function(a,b,c){return Rc(this,Tc(this,a,b,c),c)};h.Xb=function(a){return Mb(this.h,a)};h.ld=function(a){return Mb(this.h,Rc(this,a,2))};h.ec=function(a,b){Ob(this.h,a,b&65535)};h.ge=function(a,b){Ob(this.h,Rc(this,a,4),b)};function Uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Tc(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.v=a.C>>12&3,c=a.V(d|c&a.R),a.v=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.pa[a.C>>12&3];return c}
function Yc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=a.f[c]&255;return a}function Zc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.h,a.M(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.yb=a.M(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Kb(a.h,e)),e&1&&a.a--,Nb(a.h,e,c)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[e]=b&65280|d.call(a,c,b&255))} function Vc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Tc(a,b,e,4),c&65536||(e&=65535),a.v=a.C>>12&3,e=Rc(a,e|c&65536,4),a.v=a.C>>14&3,Ob(a.h,e,d)):6!=e||(a.C>>2&12288)===(a.C&12288)?a.f[e]=d:a.pa[a.C>>12&3]=d}function Wc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=-c-1;return a}function Xc(a,b){var c;b>>=6;var d=a.D=b&7;(b=a.B=(b&56)>>3)?c=Mb(a.h,a.M(b,d,2)):c=-d-1;return c}function Yc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Tc(a,b,c,8)}
function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.M(b,e,6),Ob(a.h,e,d.call(a,0>c?a.f[-c-1]:c,Mb(a.h,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])}function $c(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Nb(a.h,d,e)):c?(c=0>c?a.f[-c-1]&255:c,a.f[e]=a.f[e]&~d|c<<24>>24&d):a.f[e]&=~d;return c}function ad(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,d,4),Ob(a.h,d,c=0>c?a.f[-c-1]:c)):a.f[d]=c=0>c?a.f[-c-1]:c;return c} function Zc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=a.f[c]&255;return a}function $c(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.h,a.M(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.zb=a.M(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Kb(a.h,e)),e&1&&a.a--,Nb(a.h,e,c)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[e]=b&65280|d.call(a,c,b&255))}
function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.M(b,e,6),Ob(a.h,e,d.call(a,0>c?a.f[-c-1]:c,Mb(a.h,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])}function ad(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Nb(a.h,d,e)):c?(c=0>c?a.f[-c-1]&255:c,a.f[e]=a.f[e]&~d|c<<24>>24&d):a.f[e]&=~d;return c}function bd(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,d,4),Ob(a.h,d,c=0>c?a.f[-c-1]:c)):a.f[d]=c=0>c?a.f[-c-1]:c;return c}
function V(a,b,c){c&&(Q(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} function V(a,b,c){c&&(Q(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
h.ob=function(a){this.j.complete=!0;var b=a?this.j.Fb?0:1:-1;this.j.Fb=!1;this.ra=this.a=a;do{if(this.u){if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Eb&224)>>5,e=this.O&&this.O.La>d?this.O:null;e&&(c=e.td,d=e.La);d>(this.B&224)>>5?(this.u&4&&(Gc(this,2),this.u&=-5),K(this,c,0,-9),d=!0):d=!1;d&&(e&&Hc(this,e),a=!0)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Ic(this)&&0>b)break}this.u=this.u&7|this.B&16;this.decode(Fc(this))}while(0<this.a);return this.j.complete?this.ra- h.pb=function(a){this.j.complete=!0;var b=a?this.j.Gb?0:1:-1;this.j.Gb=!1;this.sa=this.a=a;do{if(this.u){if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Fb&224)>>5,e=this.O&&this.O.La>d?this.O:null;e&&(c=e.td,d=e.La);d>(this.C&224)>>5?(this.u&4&&(Hc(this,2),this.u&=-5),K(this,c,0,-9),d=!0):d=!1;d&&(e&&Ic(this,e),a=!0)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Jc(this)&&0>b)break}this.u=this.u&7|this.C&16;this.decode(Gc(this))}while(0<this.a);return this.j.complete?this.sa-
this.a:void 0===this.j.complete?0:-1};Ga(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Ac(d);D(d,c)}});function bd(a,b){var c=b+a;Kc(this,c,a,b);return c&65535}function cd(a,b){var c=b+a;Kc(this,c<<8,a<<8,b<<8);return c&255}function dd(a,b){a=b<<1;Lc(this,a);return a&65535}function ed(a,b){a=b<<1;Lc(this,a<<8);return a&255}function fd(a,b){a=b&32768|b>>1|b<<16;Lc(this,a);return a&65535}function gd(a,b){a=b&128|b>>1|b<<8;Lc(this,a<<8);return a&255} this.a:void 0===this.j.complete?0:-1};Ga(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Bc(d);D(d,c)}});function cd(a,b){var c=b+a;Lc(this,c,a,b);return c&65535}function dd(a,b){var c=b+a;Lc(this,c<<8,a<<8,b<<8);return c&255}function ed(a,b){a=b<<1;Mc(this,a);return a&65535}function fd(a,b){a=b<<1;Mc(this,a<<8);return a&255}function gd(a,b){a=b&32768|b>>1|b<<16;Mc(this,a);return a&65535}function hd(a,b){a=b&128|b>>1|b<<8;Mc(this,a<<8);return a&255}
function hd(a,b){a=b&~a;R(this,a);return a}function id(a,b){a=b&~a;R(this,a<<8);return a}function jd(a,b){a|=b;R(this,a);return a}function kd(a,b){a|=b;R(this,a<<8);return a}function ld(a,b){a=~b|65536;Jc(this,a);return a&65535}function md(a,b){a=~b|256;Jc(this,a<<8);return a&255}function nd(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.g=b&(b^a));return a&65535}function od(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.g=b&(b^c));return a&255} function id(a,b){a=b&~a;R(this,a);return a}function jd(a,b){a=b&~a;R(this,a<<8);return a}function kd(a,b){a|=b;R(this,a);return a}function ld(a,b){a|=b;R(this,a<<8);return a}function md(a,b){a=~b|65536;Kc(this,a);return a&65535}function nd(a,b){a=~b|256;Kc(this,a<<8);return a&255}function od(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.g=b&(b^a));return a&65535}function pd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.g=b&(b^c));return a&255}
function pd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.g=a&(b^a));return a&65535}function qd(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.g=c&(b<<8^c));return a&255}function rd(a,b){a=-b;Jc(this,a,a&b&32768);return a&65535}function sd(a,b){a=-b;Jc(this,a<<8,(a&b&128)<<8);return a&255}function td(a,b){a=b<<1|this.m>>16&1;Lc(this,a);return a&65535}function ud(a,b){a=b<<1|this.m>>16&1;Lc(this,a<<8);return a&255}function vd(a,b){a=(this.m&65536|b)>>1|b<<16;Lc(this,a);return a&65535} function qd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.g=a&(b^a));return a&65535}function rd(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.g=c&(b<<8^c));return a&255}function sd(a,b){a=-b;Kc(this,a,a&b&32768);return a&65535}function td(a,b){a=-b;Kc(this,a<<8,(a&b&128)<<8);return a&255}function ud(a,b){a=b<<1|this.m>>16&1;Mc(this,a);return a&65535}function vd(a,b){a=b<<1|this.m>>16&1;Mc(this,a<<8);return a&255}function wd(a,b){a=(this.m&65536|b)>>1|b<<16;Mc(this,a);return a&65535}
function wd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Lc(this,a<<8);return a&255}function xd(a,b){var c=b-a;Mc(this,c,a,b);return c&65535}function yd(a,b){var c=b-a;Mc(this,c<<8,a<<8,b<<8);return c&255}function zd(a,b){this.u&128||(this.s=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function Ad(a,b){a^=b;R(this,a);return a&65535}function Bd(a){U(this,a,Wc(this,a),bd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} function xd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Mc(this,a<<8);return a&255}function yd(a,b){var c=b-a;Nc(this,c,a,b);return c&65535}function zd(a,b){var c=b-a;Nc(this,c<<8,a<<8,b<<8);return c&255}function Ad(a,b){this.u&128||(this.s=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function Bd(a,b){a^=b;R(this,a);return a&65535}function Cd(a){U(this,a,Xc(this,a),cd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
function Cd(a){var b=Zc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} function Dd(a){var b=$c(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
function Dd(a){var b=Zc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Ed(a){V(this,a,!P(this))}function Fd(a){V(this,a,P(this))} function Ed(a){var b=$c(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Fd(a){V(this,a,!P(this))}function Gd(a){V(this,a,P(this))}
function Gd(a){U(this,a,Wc(this,a),hd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Hd(a){S(this,a,Vc(this,a),id);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Id(a){U(this,a,Wc(this,a),jd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Jd(a){S(this,a,Vc(this,a),kd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} function Hd(a){U(this,a,Xc(this,a),id);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Id(a){S(this,a,Wc(this,a),jd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Jd(a){U(this,a,Xc(this,a),kd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Kd(a){S(this,a,Wc(this,a),ld);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
function Kd(a){var b=Wc(this,a);a=Zc(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Ld(a){var b=Vc(this,a);a=Yc(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Md(a){V(this,a,this.i&65535?0:4)}function Nd(a){V(this,a,!Ec(this)==!(this.g&32768))}function Od(a){V(this,a,!!(this.i&65535)&&!Ec(this)==!(this.g&32768))} function Ld(a){var b=Xc(this,a);a=$c(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Md(a){var b=Wc(this,a);a=Zc(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Nd(a){V(this,a,this.i&65535?0:4)}function Od(a){V(this,a,!Fc(this)==!(this.g&32768))}function Pd(a){V(this,a,!!(this.i&65535)&&!Fc(this)==!(this.g&32768))}
function Pd(a){V(this,a,!P(this)&&!!(this.i&65535))}function Qd(a){V(this,a,(this.i&65535?0:4)||!Ec(this)!=!(this.g&32768))}function Rd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Sd(a){V(this,a,!Ec(this)!=!(this.g&32768))}function Td(a){V(this,a,Ec(this))}function Ud(a){V(this,a,!!(this.i&65535))}function Vd(a){V(this,a,!Ec(this))}function Wd(){K(this,12,0,-8);this.a-=5}function Xd(a){V(this,a,!0)}function Yd(a){V(this,a,!(this.g&32768))}function Zd(a){V(this,a,this.g&32768?2:0)} function Qd(a){V(this,a,!P(this)&&!!(this.i&65535))}function Rd(a){V(this,a,(this.i&65535?0:4)||!Fc(this)!=!(this.g&32768))}function Sd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Td(a){V(this,a,!Fc(this)!=!(this.g&32768))}function Ud(a){V(this,a,Fc(this))}function Vd(a){V(this,a,!!(this.i&65535))}function Wd(a){V(this,a,!Fc(this))}function Xd(){K(this,12,0,-8);this.a-=5}function Yd(a){V(this,a,!0)}function Zd(a){V(this,a,!(this.g&32768))}function $d(a){V(this,a,this.g&32768?2:0)}
function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function $d(a){var b=Wc(this,a);a=Zc(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Mc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function ae(a){var b=Vc(this,a);a=Yc(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Mc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)} function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function ae(a){var b=Xc(this,a);a=$c(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Nc(this,c,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function be(a){var b=Wc(this,a);a=Zc(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Nc(this,c,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}
function be(a){var b=Zc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.g=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.g=32768,this.m=65536,this.a-=7}function ce(){K(this,24,0,-8);this.a-=25} function ce(a){var b=$c(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.g=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.g=32768,this.m=65536,this.a-=7}function de(){K(this,24,0,-8);this.a-=25}
function de(){this.B&49152?(this.ea|=128,K(this,4,0,-7)):(this.w&&1120==this.Da&&this.w.setData(this.f[0],!0),this.D?this.D.b():G(this));this.a-=7}function ee(){K(this,16,0,-8);this.a-=25}var fe=[0,7,7,10,7,11,9,13];function ge(a){this.F=this.a;Q(this,Xc(this,a));this.a=this.F-fe[this.c]}var he=[0,14,14,17,14,18,16,20];function ie(a){this.F=this.a;var b=Xc(this,a);a=a>>6&7;Nc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.F-he[this.c]}var je=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function ee(){this.C&49152?(this.fa|=128,K(this,4,0,-7)):(this.w&&1120==this.Ea&&this.w.setData(this.f[0],!0),this.F?this.F.b():G(this));this.a-=7}function fe(){K(this,16,0,-8);this.a-=25}var ge=[0,7,7,10,7,11,9,13];function he(a){this.I=this.a;Q(this,Yc(this,a));this.a=this.I-ge[this.c]}var ie=[0,14,14,17,14,18,16,20];function je(a){this.I=this.a;var b=Yc(this,a);a=a>>6&7;Oc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.I-ie[this.c]}var ke=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function ke(a){var b=Wc(this,a);this.F=this.a;R(this,ad(this,a,b));this.a=this.F-je[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function le(a){var b=Vc(this,a);R(this,$c(this,a,b,65535)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var me=[7,13,13,17,14,18,17,21]; function le(a){var b=Xc(this,a);this.I=this.a;R(this,bd(this,a,b));this.a=this.I-ke[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function me(a){var b=Wc(this,a);R(this,ad(this,a,b,65535)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var ne=[7,13,13,17,14,18,17,21];
function ne(a){var b=Zc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function oe(){this.a-=5}function pe(){this.B&49152||(this.h.reset(),lb(this),this.w&&this.w.setData(this.f[0],!0));this.a-=667}function qe(a){if(a&8)K(this,8,0,-8);else{var b=Pc(this);a&=7;7==a?Q(this,b):(Q(this,this.f[a]),this.f[a]=b);this.a-=9}} function oe(a){var b=$c(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function pe(){this.a-=5}function qe(){this.C&49152||(this.h.reset(),lb(this),this.w&&this.w.setData(this.f[0],!0));this.a-=667}function re(a){if(a&8)K(this,8,0,-8);else{var b=Qc(this);a&=7;7==a?Q(this,b):(Q(this,this.f[a]),this.f[a]=b);this.a-=9}}
function re(){Oc(this);this.a-=13}function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function se(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function te(a){U(this,a,Wc(this,a),xd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function ue(a){U(this,a,0,zd);this.a-=this.c?9:3+(7==this.b?2:0)}function ve(){K(this,28,0,-8);this.a-=5} function se(){Pc(this);this.a-=13}function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function te(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ue(a){U(this,a,Xc(this,a),yd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ve(a){U(this,a,0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)}function we(){K(this,28,0,-8);this.a-=5}
function we(){this.w&&(this.w.da=this.f[7],this.w.setData(this.f[0],!0));this.u|=4;Gc(this,-2);this.a-=3}function xe(a){U(this,a,this.f[a>>6&7],Ad);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-8)}function Bc(a){ye[a>>12].call(this,a)}function ze(a){Ae[a>>6&3].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a&15].call(this,a)}function He(a){Ie[a&15].call(this,a)}function Je(a){Ke[a>>6&3].call(this,a)} function xe(){this.w&&(this.w.ea=this.f[7],this.w.setData(this.f[0],!0));this.u|=4;Hc(this,-2);this.a-=3}function ye(a){U(this,a,this.f[a>>6&7],Bd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-8)}function Cc(a){ze[a>>12].call(this,a)}function Ae(a){Be[a>>6&3].call(this,a)}function Ce(a){De[a>>6&3].call(this,a)}function Ee(a){Fe[a>>6&3].call(this,a)}function Ge(a){He[a&15].call(this,a)}function Ie(a){Je[a&15].call(this,a)}function Ke(a){Le[a>>6&3].call(this,a)}
function Le(a){Me[a>>6&3].call(this,a)}function Ne(a){Oe[a>>6&3].call(this,a)} function Me(a){Ne[a>>6&3].call(this,a)}function Oe(a){Pe[a>>6&3].call(this,a)}
var ye=[function(a){Pe[a>>8&15].call(this,a)},ke,$d,Kd,Gd,Id,Bd,Y,function(a){Qe[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,te,Y],Pe=[function(a){Re[a>>4&15].call(this,a)},Xd,Ud,Md,Nd,Sd,Od,Qd,ie,ie,ze,Be,De,Y,Y,Y],Ae=[function(a){Jc(this,ad(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ld);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,nd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ce=[function(a){U(this,a,0, var ze=[function(a){Qe[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,Cd,Y,function(a){Re[a>>8&15].call(this,a)},me,be,Md,Id,Kd,ue,Y],Qe=[function(a){Se[a>>4&15].call(this,a)},Yd,Vd,Nd,Od,Td,Pd,Rd,je,je,Ae,Ce,Ee,Y,Y,Y],Be=[function(a){Kc(this,bd(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,md);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,od);this.a-=this.c?9:3+(7==this.b?2:0)}],De=[function(a){U(this,a,0,
rd);this.a-=this.c?11:6},function(a){U(this,a,P(this)?1:0,bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,P(this)?1:0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Zc(this,a);Jc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ee=[function(a){U(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,dd);this.a-=this.c?9:3+(7==this.b?2:0)}], sd);this.a-=this.c?11:6},function(a){U(this,a,P(this)?1:0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,P(this)?1:0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=$c(this,a);Kc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Fe=[function(a){U(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ed);this.a-=this.c?9:3+(7==this.b?2:0)}],
Re=[function(a){Se[a&15].call(this,a)},Y,Y,Y,ge,ge,ge,ge,qe,Y,Fe,He,ue,ue,ue,ue],Se=[de,we,re,Wd,ee,pe,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ge=[oe,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ie=[oe,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Qe=[Vd,Td,Pd,Rd,Yd,Zd,Ed,Fd,ce,ve,Je,Le,Ne,Y,Y,Y],Ke=[function(a){Jc(this, Se=[function(a){Te[a&15].call(this,a)},Y,Y,Y,he,he,he,he,re,Y,Ge,Ie,ve,ve,ve,ve],Te=[ee,xe,se,Xd,fe,qe,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],He=[pe,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Je=[pe,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Re=[Wd,Ud,Qd,Sd,Zd,$d,Fd,Gd,de,we,Ke,Me,Oe,Y,Y,Y],Le=[function(a){Kc(this,
$c(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,md);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,od);this.a-=this.c?9:3+(7==this.b?2:0)}],Me=[function(a){S(this,a,0,sd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Yc(this,a);Jc(this,a<<8);this.a-=this.c?4:3+(7== ad(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ne=[function(a){S(this,a,0,td);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Zc(this,a);Kc(this,a<<8);this.a-=this.c?4:3+(7==
this.b?2:0)}],Oe=[function(a){S(this,a,0,wd);this.a-=this.c?9+(this.yb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,gd);this.a-=this.c?9+(this.yb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,ed);this.a-=this.c?9:3+(7==this.b?2:0)}];function Cc(a){Te[a>>12].call(this,a)} this.b?2:0)}],Pe=[function(a){S(this,a,0,xd);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,hd);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Dc(a){Ue[a>>12].call(this,a)}
var Te=[function(a){Ue[a>>8&15].call(this,a)},ke,$d,Kd,Gd,Id,Bd,function(a){Ve[a>>8&15].call(this,a)},function(a){We[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,te,Y],Ue=[function(a){Xe[a>>4&15].call(this,a)},Xd,Ud,Md,Nd,Sd,Od,Qd,ie,ie,ze,Be,De,function(a){Ye[a>>6&3].call(this,a)},Y,Y],Ye=[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=Tc(this,a,0);Nc(this,a);R(this,a);this.a-=11},function(a){var b=Pc(this);this.F= 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;Uc(this,a,0,b);R(this,b);this.a=this.F-me[this.c]},function(a){R(this,ad(this,a,Ec(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Xe=[function(a){Ze[a&15].call(this,a)},Y,Y,Y,ge,ge,ge,ge,qe,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},Fe,He,ue,ue,ue,ue],Ze=[de,we,function(){Oc(this);this.u|=this.B&16;this.a-=13},Wd,ee,pe,re,function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ve=[ne,ne,be,be,Cd,Cd,Dd,Dd,xe,xe,Y,Y,Y,Y,se,se],We=[Vd,Td,Pd,Rd, 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,
Yd,Zd,Ed,Fd,ce,ve,Je,Le,Ne,function(a){$e[a>>6&3].call(this,a)},Y,Y],$e=[Y,function(a){a=Tc(this,a,65536);Nc(this,a);R(this,a);this.a-=11},function(a){var b=Pc(this);this.F=this.a;Uc(this,a,65536,b);R(this,b);this.a=this.F-me[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 af(a){y.call(this,"ROM",a,af,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.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);bf(c)})}}A(af);h=af.prototype; function bf(a){y.call(this,"ROM",a,bf,256);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.qa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);cf(c)})}}A(bf);h=bf.prototype;
h.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;bf(this)};h.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ja=function(){return!0}; h.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 bf(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]=[af.prototype.Zc,af.prototype.Vd,null,null,null,a.b>>1],c);if(cb(a.h,a,b)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,fc)){for(c=0;c<a.c.length;c++)a.h.Za(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.Zc,bf.prototype.Vd,null,null,null,a.b>>1],c);if(cb(a.h,a,b)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c<a.c.length;c++)a.h.Za(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.Zc=function(a){return this.c[a-this.i]};h.Vd=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 af(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.Zc=function(a){return this.c[a-this.i]};h.Vd=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)}});
function cf(a){y.call(this,"RAM",a,cf);this.W=this.c=null;this.l=a.addr;this.i=a.size;this.ga=a.load;this.fa=a.exec;this.g=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ra(c.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W,null==c.ga&&(c.ga=a.ga),null==c.fa&&(c.fa=a.fa)):c.b=null);df(c)})}}A(cf); function df(a){y.call(this,"RAM",a,df);this.W=this.c=null;this.l=a.addr;this.i=a.size;this.ha=a.load;this.ga=a.exec;this.g=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ra(c.qa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W,null==c.ha&&(c.ha=a.ha),null==c.ga&&(c.ga=a.ga)):c.b=null);ef(c)})}}A(df);
cf.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;df(this)};cf.prototype.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.l,this.i,this.W),delete this.W);return!0};cf.prototype.ja=function(){return!0};function df(a){if(a.h&&(!a.g&&a.i&&Fb(a.h,a.l,a.i,Ib)&&(a.g=!0),!Va(a))){if(!a.g)t("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;ef(a,a.c,a.ga,a.fa,a.l)}F(a)}} df.prototype.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;ef(this)};df.prototype.la=function(){this.W&&(this.F&&this.F.a(this.id,this.l,this.i,this.W),delete this.W);return!0};df.prototype.ka=function(){return!0};function ef(a){if(a.h&&(!a.g&&a.i&&Fb(a.h,a.l,a.i,Ib)&&(a.g=!0),!Va(a))){if(!a.g)t("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;ff(a,a.c,a.ha,a.ga,a.l)}F(a)}}
cf.prototype.reset=function(){if(this.g){for(var a=this.h,b=this.l,c=this.i,d=b&a.l,b=b>>>a.c;0<c&&b<a.h.length;){var e=a.h[b];if(e.controller&&a.i&&a.i.length==a.v.length){var f=a.i.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Xa&&e.o)for(k=d;f--&&k<e.o.length;k++)e.o[k]=g;else for(k=d;f--&&k<e.size;k++)e.Ib(d,g,e.Ka+d)}c-=a.b;b++;d=0}this.c&&ef(this,this.c,this.ga,this.fa,this.l,!0)}}; df.prototype.reset=function(){if(this.g){for(var a=this.h,b=this.l,c=this.i,d=b&a.l,b=b>>>a.c;0<c&&b<a.h.length;){var e=a.h[b];if(e.controller&&a.i&&a.i.length==a.v.length){var f=a.i.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Xa&&e.o)for(k=d;f--&&k<e.o.length;k++)e.o[k]=g;else for(k=d;f--&&k<e.size;k++)e.Jb(d,g,e.Ka+d)}c-=a.b;b++;d=0}this.c&&ff(this,this.c,this.ha,this.ga,this.l,!0)}};
function ef(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,w=n-=6;0<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Za(p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.a.Za(c+ function ff(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,w=n-=6;0<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Za(p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.a.Za(c+
g,b[g]);g=!0}g&&null!=d&&(a=a.a,a.Ob=d,a.h.reset(),lb(a),Q(a,d),Zb(a,0),!f&&a.D&&(G(a)||a.D.c()));return g}Ga(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new cf(d);D(d,c)}});function ff(a){y.call(this,"Keyboard",a,ff,65536);F(this)}A(ff);ff.prototype.Z=function(){return!1};ff.prototype.ia=function(a,b,c,d){this.l=a;this.a=c;this.D=d};Ga(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new ff(d);D(d,c)}}); g,b[g]);g=!0}g&&null!=d&&(a=a.a,a.Rb=d,a.h.reset(),lb(a),Q(a,d),$b(a,0),!f&&a.F&&(G(a)||a.F.c()));return g}Ga(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new df(d);D(d,c)}});function gf(a){y.call(this,"Keyboard",a,gf,65536);F(this)}A(gf);gf.prototype.$=function(){return!1};gf.prototype.ja=function(a,b,c,d){this.l=a;this.a=c;this.F=d};Ga(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new gf(d);D(d,c)}});
function Z(a){this.F=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.O=a.upperCase;this.g=this.m=null;this.J=a.tabSize;this.I=a.charBOL;this.s=0;y.call(this,"SerialPort",a,Z,8388608);var b=a.binding;if("console"==b)this.m="";else{var c;a=gf;b&&(void 0===c&&(c="Panel"),(c=Ta(c,this.id))&&(b=c.o[b])&&this.Z(null,a,b))}this.v=this.A=null;this.exports={connect:this.Nb,receiveData:this.Db}}A(Z);var gf="buffer";h=Z.prototype; function Z(a){this.D=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.O=a.upperCase;this.g=this.m=null;this.J=a.tabSize;this.I=a.charBOL;this.s=0;y.call(this,"SerialPort",a,Z,8388608);var b=a.binding;if("console"==b)this.m="";else{var c;a=hf;b&&(void 0===c&&(c="Panel"),(c=Ta(c,this.id))&&(b=c.o[b])&&this.$(null,a,b))}this.v=this.A=null;this.exports={connect:this.Ob,receiveData:this.mb}}A(Z);var hf="buffer";h=Z.prototype;
h.Z=function(a,b,c){var d=this;switch(b){case gf:return this.o[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Db(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Db(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1}; h.$=function(a,b,c){var d=this;switch(b){case hf:return this.o[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.mb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.mb(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.mb(a.getData("Text"))},
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;var e=this;this.aa=Vb(48,4);this.M=Sb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.O&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Tb(e.a,e.aa))});this.C=Vb(52,4);this.$=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.C)});cb(b,this,hf);eb(b,this.reset.bind(this));F(this)}; c.removeAttribute("readonly"),!0}return!1};h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;var e=this;this.ba=Vb(48,4);this.M=Sb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.O&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Tb(e.a,e.ba))});this.B=Vb(52,4);this.aa=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.B)});cb(b,this,jf);eb(b,this.reset.bind(this));F(this)};
h.Nb=function(){if(!this.v){var a=sc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.ya)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Nb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; h.Ob=function(){if(!this.v){var a=tc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.za)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.la=function(a,b){if(!b)if(this.Ob(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
h.ja=function(a){return a?this.save():!0};h.reset=function(){jf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return jf(this)};function jf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.Db=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Ub(this.a,this.M,1E3/Math.round(this.F/10));return!0};h.Tc=function(){return this.b&65534}; h.ka=function(a){return a?this.save():!0};h.reset=function(){kf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return kf(this)};function kf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.mb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Ub(this.a,this.M,1E3/Math.round(this.D/10));return!0};h.Tc=function(){return this.b&65534};
h.Pd=function(a){this.b=this.b&-112|a&111};h.Sc=function(){this.b&=-129;0<this.i.length&&Ub(this.a,this.M,1E3/Math.round(this.F/10));return this.w};h.Od=function(){};h.nd=function(){return this.c};h.ie=function(a){this.c&128&&(a&64?Tb(this.a,this.C):Hc(this.a,this.C));this.c=this.c&-70|a&69};h.md=function(){return 0}; h.Pd=function(a){this.b=this.b&-112|a&111};h.Sc=function(){this.b&=-129;0<this.i.length&&Ub(this.a,this.M,1E3/Math.round(this.D/10));return this.w};h.Od=function(){};h.nd=function(){return this.c};h.ie=function(a){this.c&128&&(a&64?Tb(this.a,this.B):Ic(this.a,this.B));this.c=this.c&-70|a&69};h.md=function(){return 0};
h.he=function(a){if(a&=255){this.A&&this.A.call(this.v,a);a&=127;if(this.g)if(13==a)this.s=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.I&&!this.s&&c&&(b=String.fromCharCode(this.I)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<= h.he=function(a){if(a&=255){this.A&&this.A.call(this.v,a);a&=127;if(this.g)if(13==a)this.s=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.I&&!this.s&&c&&(b=String.fromCharCode(this.I)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=
this.m.length)this.T(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ub(this.a,this.$,1E3/Math.round(this.R/10))}};var kf={},hf=(kf[65392]=[null,null,Z.prototype.Tc,Z.prototype.Pd,"RCSR"],kf[65394]=[null,null,Z.prototype.Sc,Z.prototype.Od,"RBUF"],kf[65396]=[null,null,Z.prototype.nd,Z.prototype.ie,"XCSR"],kf[65398]=[null,null,Z.prototype.md,Z.prototype.he,"XBUF"],kf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Z(d);D(d,c)}}); this.m.length)this.T(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ub(this.a,this.aa,1E3/Math.round(this.R/10))}};var lf={},jf=(lf[65392]=[null,null,Z.prototype.Tc,Z.prototype.Pd,"RCSR"],lf[65394]=[null,null,Z.prototype.Sc,Z.prototype.Od,"RBUF"],lf[65396]=[null,null,Z.prototype.nd,Z.prototype.ie,"XCSR"],lf[65398]=[null,null,Z.prototype.md,Z.prototype.he,"XBUF"],lf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Z(d);D(d,c)}});
function $b(a){y.call(this,"PC11",a,$b);this.c=a.autoMount||null;this.m=0;this.O=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=lf;this.g=mf;this.C=this.i="";this.K=this.ga=this.fa=null;this.I=-1;this.F=!Ba("Mobi")&&window&&"FileReader"in window}A($b);var lf="",mf=0;h=$b.prototype; function ac(a){y.call(this,"PC11",a,ac);this.c=a.autoMount||null;this.m=0;this.O=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=mf;this.g=nf;this.B=this.i="";this.K=this.ha=this.ga=null;this.I=-1;this.D=!Ba("Mobi")&&window&&"FileReader"in window}A(ac);var mf="",nf=0;h=ac.prototype;
h.Z=function(a,b,c){var d=this,e=mf;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){t("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a= h.$=function(a,b,c){var d=this,e=nf;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){t("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a=
d.o.listTapes;a&&nf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;nf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; d.o.listTapes;a&&of(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.D){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;of(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;this.J=of(a);var e=this;if((this.c=sc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.M=Vb(56,4);this.R=Sb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,pf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Tb(e.a,e.M))});cb(b,this,qf);eb(b,this.reset.bind(this));rf(this,"None",lf,!0);this.F&& h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;this.J=pf(a);var e=this;if((this.c=tc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.M=Vb(56,4);this.R=Sb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,qf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Tb(e.a,e.M))});cb(b,this,rf);eb(b,this.reset.bind(this));sf(this,"None",mf,!0);this.D&&
rf(this,"Local Tape","?");rf(this,"Remote Tape","??");sf(this)||F(this)};h.ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function sf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?tf(a,c,b,1,!0):uf(a)}return!!a.m} sf(this,"Local Tape","?");sf(this,"Remote Tape","??");tf(this)||F(this)};h.la=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function tf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?uf(a,c,b,1,!0):vf(a)}return!!a.m}
function nf(a,b,c,d,e){if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;tf(a,b,c,d,!1,e)}else vf(a,!1)}function tf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.g!=d)g++,vf(a,!0),a.j.Ca?a.G("PC11 busy"):(e&&a.m++,wf(a,b,c,d,f)?g++:a.j.Ca=!0);g&&xf(a,a.C,a.i,a.g,a.K,a.ga,a.fa)} function of(a,b,c,d,e){if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;uf(a,b,c,d,!1,e)}else wf(a,!1)}function uf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.g!=d)g++,wf(a,!0),a.j.Da?a.G("PC11 busy"):(e&&a.m++,xf(a,b,c,d,f)?g++:a.j.Da=!0);g&&yf(a,a.B,a.i,a.g,a.K,a.ha,a.ga)}
function wf(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),xf(a,b,c,d,e),a.s="?");uf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.N;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ra(a.pa,e,f),(e=ta(e,f))&&xf(a,b,c,d,e.K,e.ga,e.fa)); function xf(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),yf(a,b,c,d,e),a.s="?");vf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.N;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ra(a.qa,e,f),(e=ta(e,f))&&yf(a,b,c,d,e.K,e.ha,e.ga));
a.j.Ca=!1;a.m&&(a.m--,a.m||F(a));uf(a)})}function rf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function uf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}} a.j.Da=!1;a.m&&(a.m--,a.m||F(a));vf(a)})}function sf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<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 vf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
function pf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function xf(a,b,c,d,e,f,g){a.C=b;a.i=c;a.g=d;a.K=e;a.ga=f;a.fa=g;2==d?a.J&&ef(a.J,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=lf,a.g=mf,a.G("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),pf(a,0))} function qf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function yf(a,b,c,d,e,f,g){a.B=b;a.i=c;a.g=d;a.K=e;a.ha=f;a.ga=g;2==d?a.J&&ff(a.J,e,f,g)?a.status("tape loaded: "+b):(a.B="",a.i="",a.s=mf,a.g=nf,a.G("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),qf(a,0))}
function vf(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.g&&a.status(1==a.g?"tape detached":"tape unloaded"),a.s=lf,a.g=mf,uf(a))}h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};h.Mc=function(){return this.b&65534};h.Id=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Tb(this.a,this.M)):(this.b&=-129,this.b|=2048,this.A=0,Ub(this.a,this.R,1E3/Math.round(this.O/10))));this.b=this.b&-66|a&65};h.Lc=function(){this.b&=-129;this.b|=2048;return this.A};h.Hd=function(){}; function wf(a,b){if(a.i||!1===b)a.B="",a.i="",b||(a.g&&a.status(1==a.g?"tape detached":"tape unloaded"),a.s=mf,a.g=nf,vf(a))}h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};h.Mc=function(){return this.b&65534};h.Id=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Tb(this.a,this.M)):(this.b&=-129,this.b|=2048,this.A=0,Ub(this.a,this.R,1E3/Math.round(this.O/10))));this.b=this.b&-66|a&65};h.Lc=function(){this.b&=-129;this.b|=2048;return this.A};h.Hd=function(){};
var yf={},qf=(yf[65384]=[null,null,$b.prototype.Mc,$b.prototype.Id,"PRS"],yf[65386]=[null,null,$b.prototype.Lc,$b.prototype.Hd,"PRB"],yf);function zf(a,b,c){y.call(this,"Disk",{id:a.pa+".disk"+m(++Af,4)},zf,4194304);this.controller=a;this.l=a.l;this.D=a.D;this.g=b;this.wa=b.name;this.vb=b.vb;Bf(this,c,b.U,b.Y,b.S,b.ha);F(this)}var Af=0;A(zf);h=zf.prototype;h.ia=function(a,b,c,d){this.D=d}; var zf={},rf=(zf[65384]=[null,null,ac.prototype.Mc,ac.prototype.Id,"PRS"],zf[65386]=[null,null,ac.prototype.Lc,ac.prototype.Hd,"PRB"],zf);function Af(a,b,c){y.call(this,"Disk",{id:a.qa+".disk"+m(++Bf,4)},Af,4194304);this.controller=a;this.l=a.l;this.F=a.F;this.g=b;this.xa=b.name;this.wb=b.wb;Cf(this,c,b.U,b.Y,b.S,b.ia);F(this)}var Bf=0;A(Af);h=Af.prototype;h.ja=function(a,b,c,d){this.F=d};
function Bf(a,b,c,d,e,f){a.mode=b;a.U=c;a.Y=d;a.S=e;a.ha=f;a.a=[];if("preload"!=a.mode){b=Array(a.U);for(c=0;c<b.length;c++){d=Array(a.Y);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=Cf(null,c,e,g,a.ha,0);d[e]=f}b[c]=d}a.a=b}a.b=null} function Cf(a,b,c,d,e,f){a.mode=b;a.U=c;a.Y=d;a.S=e;a.ia=f;a.a=[];if("preload"!=a.mode){b=Array(a.U);for(c=0;c<b.length;c++){d=Array(a.Y);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=Df(null,c,e,g,a.ia,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
function Df(a,b,c,d,e){var f=c;if(a.h)return!0;a.wa=b;a.Ba=c;a.$b=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.Y=e[1];a.S=e[2];a.ha=e[3]||512;c=a.ha>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.U);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Y),T=0;T<w.length;T++)for(var xa=w[T]=Array(a.S),ya=0;ya<xa.length;ya++){for(var lc=Cf(null,d,T,ya+1,a.ha,0),eg=lc.data,mc=0;mc<c;mc++,f+=4)var fg=eg[mc]=b.getInt32(f, function Ef(a,b,c,d,e){var f=c;if(a.h)return!0;a.xa=b;a.Ca=c;a.$b=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.Y=e[1];a.S=e[2];a.ia=e[3]||512;c=a.ia>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.U);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Y),T=0;T<w.length;T++)for(var xa=w[T]=Array(a.S),ya=0;ya<xa.length;ya++){for(var lc=Df(null,d,T,ya+1,a.ia,0),fg=lc.data,mc=0;mc<c;mc++,f+=4)var gg=fg[mc]=b.getInt32(f,
!0),e=e+fg&-1;lc.ba=c;xa[ya]=lc}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.g,c,a.wa,a.Ba),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.vb?"":e)+"&format=json"));return!!r(f, !0),e=e+gg&-1;lc.ca=c;xa[ya]=lc}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.g,c,a.xa,a.Ca),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.wb?"":e)+"&format=json"));return!!r(f,
null,!0,function(b,c,d){Ef(a,b,c,d)})} null,!0,function(b,c,d){Ff(a,b,c,d)})}
function Ef(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.N;if(d)a.controller.G('Unable to load disk "'+a.wa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.pa,b,c);try{if(0<q(a.$b,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.wa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ function Ff(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.N;if(d)a.controller.G('Unable to load disk "'+a.xa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.qa,b,c);try{if(0<q(a.$b,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.xa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
c+")");if(k.length)if(1==k.length)t(k[0]);else{a.U=k.length;a.Y=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ha=l&&l.length||512;for(d=c=0;d<a.U;d++)for(f=0;f<a.Y;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var w=l.bytes;if(void 0!==w&&w.length){for(var T=n<<2,xa=w.length;xa<T;xa++)w[xa]=p;Ff(l,w)}else u=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=u;delete l.bytes}Cf(l,d,f);for(T= c+")");if(k.length)if(1==k.length)t(k[0]);else{a.U=k.length;a.Y=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ia=l&&l.length||512;for(d=c=0;d<a.U;d++)for(f=0;f<a.Y;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var w=l.bytes;if(void 0!==w&&w.length){for(var T=n<<2,xa=w.length;xa<T;xa++)w[xa]=p;Gf(l,w)}else u=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=u;delete l.bytes}Df(l,d,f);for(T=
0;T<u.length;T++)c=c+u[T]&-1}a.a=k;a.b=c;e=a}else t("Empty disk image: "+a.wa)}catch(ya){t("Disk image error ("+b+"): "+ya.message)}}a.h&&(a.h.call(a.i,a.g,e,a.wa,a.Ba),a.h=null)}function Cf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.le=b;a.me=c;a.ma=a.ba=0;a.va=!1;return a} 0;T<u.length;T++)c=c+u[T]&-1}a.a=k;a.b=c;e=a}else t("Empty disk image: "+a.xa)}catch(ya){t("Disk image error ("+b+"): "+ya.message)}}a.h&&(a.h.call(a.i,a.g,e,a.xa,a.Ca),a.h=null)}function Df(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.le=b;a.me=c;a.na=a.ca=0;a.wa=!1;return a}
h.seek=function(a,b,c,d,e){d=null;var f=this.g,g=this.a[a];if(g){var k=g[b];if(!k&&f.gc&&b<f.Y)for(k=g[b]=Array(f.hc),g=0;g<k.length;g++)k[g]=Cf(null,a,b,g+1,f.Pb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.gc&&9==f.Jb&&(d=k[g]=Cf(null,a,b,f.Jb,f.Pb,0))}}e&&e(d,!1);return d};function Ff(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e} h.seek=function(a,b,c,d,e){d=null;var f=this.g,g=this.a[a];if(g){var k=g[b];if(!k&&f.gc&&b<f.Y)for(k=g[b]=Array(f.hc),g=0;g<k.length;g++)k[g]=Df(null,a,b,g+1,f.Pb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.gc&&9==f.Kb&&(d=k[g]=Df(null,a,b,f.Kb,f.Pb,0))}}e&&e(d,!1);return d};function Gf(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f<a.ma?(a.ba+=a.ma-f,a.ma=f):f>=a.ma+a.ba&&(a.ba+=f-(a.ma+a.ba)+1):(a.ma=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null}; h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ca?f<a.na?(a.ca+=a.na-f,a.na=f):f>=a.na+a.ca&&(a.ca+=f-(a.na+a.ca)+1):(a.na=f,a.ca=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function Gf(a,b){var c=a.Y*a.S,d=b/c|0;return d<a.U?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function Hf(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Ba,this.b,this.U,this.Y,this.S,this.ha];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var k=[],l=0,n=g.ma,p=g.ma+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.ma,k]}}return b}; function Hf(a,b){var c=a.Y*a.S,d=b/c|0;return d<a.U?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function If(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Ca,this.b,this.U,this.Y,this.S,this.ia];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ca){for(var k=[],l=0,n=g.na,p=g.na+g.ca;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.na,k]}}return b};
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?Bf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?Cf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+
b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.ma=e;for(k.ba=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.G("Unable to restore disk '"+this.wa+": "+c);return b}; b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.na=e;for(k.ca=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.G("Unable to restore disk '"+this.xa+": "+c);return b};
h.toJSON=function(){var a;a=0;for(var b;b=Gf(this,a++);)If(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; h.toJSON=function(){var a;a=0;for(var b;b=Hf(this,a++);)Jf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function If(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){y.call(this,"RL11",a,N,4194304);this.g=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Ba("Mobi")&&window&&"FileReader"in window}A(N);h=N.prototype; function Jf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){y.call(this,"RL11",a,N,4194304);this.g=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Ba("Mobi")&&window&&"FileReader"in window}A(N);h=N.prototype;
h.Z=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Jf(d,a)},!0;case "loadDrive":return this.o[b]= h.$=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Kf(d,a)},!0;case "loadDrive":return this.o[b]=
c,c.onclick=function(){var a=d.o.listDisks;a&&Kf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,k;k=Gf(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(Hf(a,k,l));b=btoa(b);a=a.$b.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!= c,c.onclick=function(){var a=d.o.listDisks;a&&Lf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.da){var b;b="";for(var c=0,k;k=Hf(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(If(a,k,l));b=btoa(b);a=a.$b.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");t(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}), typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");t(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),
c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Kf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Lf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;if((this.g=sc(this.l,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.g+")"),this.g=null}Lf(this);this.F=Vb(112,5);cb(b,this,Mf);eb(b,this.reset.bind(this));Nf(this,"None","",!0);this.A&&Nf(this,"Local Disk","?");Nf(this,"Remote Disk","??");Of(this)||F(this)}; h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;if((this.g=tc(this.l,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.g+")"),this.g=null}Mf(this);this.D=Vb(112,5);cb(b,this,Nf);eb(b,this.reset.bind(this));Of(this,"None","",!0);this.A&&Of(this,"Local Disk","?");Of(this,"Remote Disk","??");Pf(this)||F(this)};
h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Lb){for(a=0;a<this.b.length;a++)Pf(this,a,!0);Of(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Jf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Lf(this)};h.save=function(){return(new O(this)).data()}; h.la=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Mb){for(a=0;a<this.b.length;a++)Qf(this,a,!0);Pf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Kf(this,0)}}return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){return(new O(this)).data()};
h.restore=function(a){return Lf(this,a[0])};function Of(a,b){b||(a.s=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Qf(a,g,f,e,!0)&&b&&F(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s} h.restore=function(a){return Mf(this,a[0])};function Pf(a,b){b||(a.s=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Rf(a,g,f,e,!0)&&b&&F(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s}
function Kf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Qf(a,e,b,c,!1,d)}else Pf(a,e)} function Lf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Rf(a,e,b,c,!1,d)}else Qf(a,e)}
function Qf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ba.toLowerCase()!=d.toLowerCase()&&(g++,Pf(a,b,!0),k.ub?a.G("RL11 busy"):(k.ub=!0,e&&(k.tb=!0,a.s++),k.hb=!!f,Df(new zf(a,k,"preload"),c,d,f,a.kc)&&g++));return g} function Rf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Qf(a,b,!0),k.vb?a.G("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.s++),k.hb=!!f,Ef(new Af(a,k,"preload"),c,d,f,a.kc)&&g++));return g}
h.kc=function(a,b,c,d,e){var f;a.ub=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.xb)),b=null);b?(a.ca=b,a.wa=c,a.Ba=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.xb),a.tb||e),this.l&&yc(this.l)):a.hb=!1;a.tb&&(a.tb=!1,--this.s||F(this));Jf(this,a.xb)}; h.kc=function(a,b,c,d,e){var f;a.vb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.da=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.ub||e),this.l&&zc(this.l)):a.hb=!1;a.ub&&(a.ub=!1,--this.s||F(this));Kf(this,a.yb)};
function Nf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} function Of(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Jf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.hb?"?":c.Ba,!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 Pf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.wa="",d.Ba="",d.ca=null,d.hb=!1,c||(a.G("Drive RL"+b+" unloaded",c),Jf(a,b))} function Kf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.hb?"?":c.Ca,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Qf(a,b,c){var d=a.b[b];if(d.da||!1===c)d.xa="",d.Ca="",d.da=null,d.hb=!1,c||(a.G("Drive RL"+b+" unloaded",c),Kf(a,b))}
function Lf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.xb=b;d.ub=d.hb=!1;d.name=c.ya;d.U=512;d.Y=2;d.S=40;d.ha=256;d.vb=!0;d.ke=0;d.je=0;d.Jb=1;d.hc=d.S;d.Pb=d.ha;d.ne=0;d.oe=null;d.ca||(d.Ba="");d.status=29|(512==d.U?128:0)}return!0} function Mf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.yb=b;d.vb=d.hb=!1;d.name=c.za;d.U=512;d.Y=2;d.S=40;d.ia=256;d.wb=!0;d.ke=0;d.je=0;d.Kb=1;d.hc=d.S;d.Pb=d.ia;d.ne=0;d.oe=null;d.da||(d.Ca="");d.status=29|(512==d.U?128:0)}return!0}
h.ic=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; h.ic=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0};
h.zc=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Ob(this.h,f,u|w<<8);if(Rb(this.h)){k=8192;break}f+=2;if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)}; h.zc=function(a,b,c,d,e,f,g){var k=0,l=a.da,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.da.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.da.read(n,p++))||0>(w=a.da.read(n,p++))){k=5120;break}Ob(this.h,f,u|w<<8);if(Rb(this.h)){k=8192;break}f+=2;if(p>=l.ia&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};
h.xd=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.h,f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Wc=function(){return this.L&65535}; h.xd=function(a,b,c,d,e,f,g){var k=0,l=a.da,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.h,f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.da.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.da.write(n,p++,u&255)||!a.da.write(n,p++,u>>8)){k=5120;break}if(p>=l.ia&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Wc=function(){return this.L&65535};
h.Sd=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.zc;case 10:b||(b=this.xd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w& h.Sd=function(a){this.L=this.L&-1023|a&1022;this.B=this.B&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.zc;case 10:b||(b=this.xd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w&
63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.ic.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.F))}};h.Uc=function(){return this.v};h.Qd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Td=function(a){this.c=a};h.Yc=function(){return this.m};h.Ud=function(a){this.m=a};h.Vc=function(){return this.w};h.Rd=function(a){this.w=a&63}; 63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.ic.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.D))}};h.Uc=function(){return this.v};h.Qd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Td=function(a){this.c=a};h.Yc=function(){return this.m};h.Ud=function(a){this.m=a};h.Vc=function(){return this.w};h.Rd=function(a){this.w=a&63};
var Rf={},Mf=(Rf[63744]=[null,null,N.prototype.Wc,N.prototype.Sd,"RLCS"],Rf[63746]=[null,null,N.prototype.Uc,N.prototype.Qd,"RLBA"],Rf[63748]=[null,null,N.prototype.Xc,N.prototype.Td,"RLDA"],Rf[63750]=[null,null,N.prototype.Yc,N.prototype.Ud,"RLMP"],Rf[63752]=[null,null,N.prototype.Vc,N.prototype.Rd,"RLBE"],Rf); var Sf={},Nf=(Sf[63744]=[null,null,N.prototype.Wc,N.prototype.Sd,"RLCS"],Sf[63746]=[null,null,N.prototype.Uc,N.prototype.Qd,"RLBA"],Sf[63748]=[null,null,N.prototype.Xc,N.prototype.Td,"RLDA"],Sf[63750]=[null,null,N.prototype.Yc,N.prototype.Ud,"RLMP"],Sf[63752]=[null,null,N.prototype.Vc,N.prototype.Rd,"RLBE"],Sf);
function Sf(a,b,c){y.call(this,"Computer",a,Sf,67108864);this.j.N=!1;Tf(this,b);this.A=sc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Uf;this.s=null;this.i=this.I=!1;this.O=sc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Vf(this);if(this.a=Ta("CPU",this.id)){this.D=Ta("Debugger",this.id);this.h=new vb({id:this.pa+".bus",busWidth:this.M},this.a,this.D);var d,e=B(this.id);if((this.w=Ta("Panel",this.id))&&this.w.Wa)for(b=0;b<e.length;b++)d=e[b],d.G=this.w.G,d.T=this.w.T, function Tf(a,b,c){y.call(this,"Computer",a,Tf,67108864);this.j.N=!1;Uf(this,b);this.A=tc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Vf;this.s=null;this.i=this.I=!1;this.O=tc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Wf(this);if(this.a=Ta("CPU",this.id)){this.F=Ta("Debugger",this.id);this.h=new vb({id:this.qa+".bus",busWidth:this.M},this.a,this.F);var d,e=B(this.id);if((this.w=Ta("Panel",this.id))&&this.w.Wa)for(b=0;b<e.length;b++)d=e[b],d.G=this.w.G,d.T=this.w.T,
d.Wa=this.w.Wa;this.T("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ia&&d.ia(this,this.h,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=sc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.i=!0,this.b=Uf),this.b&&(this.v= d.Wa=this.w.Wa;this.T("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ja&&d.ja(this,this.h,this.a,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=tc(this,"state")||(f=!0,a.state))b=this.B=a,f||(this.i=!0,this.b=Vf),this.b&&(this.v=
new O(this,"1.30.3"),Wf(this.v)?b=null:delete this.v);!b&&this.b&&(b=Xf(this))&&(this.i=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.m=null,g.i=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.s=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Yf(this,this.Ya)}else t("Unable to find CPU component")}A(Sf);var Uf=0; new O(this,"1.30.3"),Xf(this.v)?b=null:delete this.v);!b&&this.b&&(b=Yf(this))&&(this.i=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.m=null,g.i=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.s=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Zf(this,this.Ya)}else t("Unable to find CPU component")}A(Tf);var Vf=0;
function Tf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.J=b}function sc(a,b,c){var d=b.toLowerCase(),d=La[b]||La[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Yf(a,b,c){for(var d=B(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Va(f)){Va(f,function(){Yf(a,b,c)});return}}b.call(a,c)} function Uf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.J=b}function tc(a,b,c){var d=b.toLowerCase(),d=La[b]||La[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Zf(a,b,c){for(var d=B(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Va(f)){Va(f,function(){Zf(a,b,c)});return}}b.call(a,c)}
function Zf(a,b){var c=new O(a,"1.30.3","validate");if(Wf(c)&&$f(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Sf.prototype; function $f(a,b){var c=new O(a,"1.30.3","validate");if(Xf(c)&&ag(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Tf.prototype;
h.Ya=function(a){void 0===a&&(a=this.b||(this.s?1:Uf));if(!this.l){this.l++;var b=!1,c=!1;this.F=!1;var d=this.v||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Uf){if(Wf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Wf(this.g)&&(ag(this,d),a=2,bg(this.g));this.g.set("timestamp",sa());cg(this.g);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=$f(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Wf(d,g):("error"== h.Ya=function(a){void 0===a&&(a=this.b||(this.s?1:Vf));if(!this.l){this.l++;var b=!1,c=!1;this.D=!1;var d=this.v||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Vf){if(Xf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Xf(this.g)&&(bg(this,d),a=2,cg(this.g));this.g.set("timestamp",sa());dg(this.g);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ag(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xf(d,g):("error"==
f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),bg(d),Wf(d)?(c=$f(d),e=!0):c=!1))}e&&Zf(this,c?d:null)}else 2==a&&d.clear()}else Zf(this);delete this.s;delete this.v}e=B(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=dg(this,g,d,b,c));b=[d,a,c];-1!=a?Yf(this,this.Kb,b):this.Kb(b)}}; f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),cg(d),Xf(d)?(c=ag(d),e=!0):c=!1))}e&&$f(this,c?d:null)}else 2==a&&d.clear()}else $f(this);delete this.s;delete this.v}e=B(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=eg(this,g,d,b,c));b=[d,a,c];-1!=a?Zf(this,this.Lb,b):this.Lb(b)}};
function dg(a,b,c,d,e){if(!b.j.N){b.j.N=!0;if(b.ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ka(f,d)&&f&&(t("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=Uf,window&&window.location.reload()):a.F=!0,b.ka(null),e=!1)}if(!d&&b.Qb)for(a=b.Qb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} function eg(a,b,c,d,e){if(!b.j.N){b.j.N=!0;if(b.la){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.la(f,d)&&f&&(t("Unable to restore state for "+b.type),a.B&&!a.I?(c.clear(),a.b=Vf,window&&window.location.reload()):a.D=!0,b.la(null),e=!1)}if(!d&&b.Sb)for(a=b.Sb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
h.Kb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.j.N=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(dg(this,this.a,b,c,a),this.xa(),this.a.Va());this.F&&(ag(this,b),b.clear());!c&&this.g&&(this.g.clear(),delete this.g);this.l=0}; h.Lb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.j.N=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(eg(this,this.a,b,c,a),this.ya(),this.a.Va());this.D&&(bg(this,b),b.clear());!c&&this.g&&(this.g.clear(),delete this.g);this.l=0};
function ag(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} function bg(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}}
function gg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&G(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.N=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l<k.length;l++){var n=k[l];n.j.N&&(n.ja&&(d=n.ja(b,c),"object"===typeof d&&f.set(n.id, function hg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ka&&(c&&G(a.a),d=a.a.ka(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.N=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l<k.length;l++){var n=k[l];n.j.N&&(n.ka&&(d=n.ka(b,c),"object"===typeof d&&f.set(n.id,
d)),c&&(n.j.N=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&hg(a,a.c,f.toString()),cg(g)&&cg(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.j.N=!1,b=a.o.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();this.a&&this.a.reset&&this.a.reset();for(var a=B(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c!==this.a&&c.reset&&c.reset()}this.xa(-1)}; d)),c&&(n.j.N=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&ig(a,a.c,f.toString()),dg(g)&&dg(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.j.N=!1,b=a.o.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();this.a&&this.a.reset&&this.a.reset();for(var a=B(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c!==this.a&&c.reset&&c.reset()}this.ya(-1)};
h.start=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.xa(-1)};h.stop=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.xa(-1)}; h.start=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ya(-1)};h.stop=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ya(-1)};
h.xa=function(a){if(this.a){var b=this.a,c=a||0,d=b.o.speed;d&&(0>=c||30<=(b.wb+=c))&&(d.textContent=b.j.P?b.Ga.toFixed(2)+"Mhz":"Stopped",b.wb=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.j.P;d=!!(b.a.u&4);if(0>=a||60<=(b.s+=a)){for(var e=0;e<b.a.f.length;e++)kb(b,"R"+e,b.a.f[e]);e=Yb(b.a);kb(b,"PS",e);kb(b,"NF",e&8?1:0,1);kb(b,"ZF",e&4?1:0,1);kb(b,"VF",e&2?1:0,1);kb(b,"CF",e&1?1:0,1);b.s=0}sb(b,0<a&&c&&!d?b.a.f[7]:b.da);rb(b,b.m);a=b.a.Aa?b.a.Ea&16?1:2:4;tb(b,"B22",a&1);tb(b,"B18",a&2);tb(b,"B16", h.ya=function(a){if(this.a){var b=this.a,c=a||0,d=b.o.speed;d&&(0>=c||30<=(b.xb+=c))&&(d.textContent=b.j.P?b.Ga.toFixed(2)+"Mhz":"Stopped",b.xb=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.j.P;d=!!(b.a.u&4);if(0>=a||60<=(b.s+=a)){for(var e=0;e<b.a.f.length;e++)kb(b,"R"+e,b.a.f[e]);e=Zb(b.a);kb(b,"PS",e);kb(b,"NF",e&8?1:0,1);kb(b,"ZF",e&4?1:0,1);kb(b,"VF",e&2?1:0,1);kb(b,"CF",e&1?1:0,1);b.s=0}sb(b,0<a&&c&&!d?b.a.f[7]:b.ea);rb(b,b.m);a=b.a;a=a.aa?a.Ba&16?1:2:4;tb(b,"B22",a&1);tb(b,"B18",a&2);tb(b,"B16",
a&4)}}; a&4)}};
h.Z=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.l||(d.j.N?gg(d,!1,!0):Yf(d,d.Ya))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.N&&!d.l)if(d.b&&!d.m){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");gg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Lb=!0),d.Ya(Uf),d.Lb=!1)}else d.reset(),d.a&&d.a.Va()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);else return this.o[b]= h.$=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.l||(d.j.N?hg(d,!1,!0):Zf(d,d.Ya))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.N&&!d.l)if(d.b&&!d.m){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");hg(d,a,!0);!a&&d.B?window&&window.location.reload():(a||(d.Mb=!0),d.Ya(Vf),d.Mb=!1)}else d.reset(),d.a&&d.a.Va()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);else return this.o[b]=
c,c.onclick=function(){var a=Vf(d,!0);if(a){var b=!!(d.b&&!d.m||d.C),c=gg(d,b);b?hg(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1}; c,c.onclick=function(){var a=Wf(d,!0);if(a){var b=!!(d.b&&!d.m||d.B),c=hg(d,b);b?ig(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};
function Vf(a,b){var c=a.c;c||((c=za("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=ig(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c} function Wf(a,b){var c=a.c;c||((c=za("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=jg(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
function ig(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){t(d.message+" ("+c+")")}return a.c}function Xf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+jg(a,"1.30.3"));return b} function jg(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){t(d.message+" ("+c+")")}return a.c}function Yf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+kg(a,"1.30.3"));return b}
function hg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=jg(a,"1.30.3");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.G("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.G(c),Aa("user",""),a.c=null)}} function ig(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=kg(a,"1.30.3");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.G("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.G(c),Aa("user",""),a.c=null)}}
function of(a){var b;a=B(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function yc(a){if(a.Wa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Wa.focus();window&&window.scrollTo(b,c)}}Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=C(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=C(f),g=new Sf(g,d,!0);D(g,f);g.A&&Yf(g,g.Ya)}}); function pf(a){var b;a=B(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function zc(a){if(a.Wa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Wa.focus();window&&window.scrollTo(b,c)}}Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=C(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=C(f),g=new Tf(g,d,!0);D(g,f);g.A&&Zf(g,g.Ya)}});
x.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Ta("Computer",c.id))&&c.R&&!c.j.N&&c.Ya(-1)}});x.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Ta("Computer",c.id))&&c.j.N&&gg(c,!(!c.b||c.m),!0)}});function O(a,b,c){this.id=a.id;this.key=jg(a,b,c);this.D=a.D;bg(this,a.sd)}function jg(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} x.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Ta("Computer",c.id))&&c.R&&!c.j.N&&c.Ya(-1)}});x.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Ta("Computer",c.id))&&c.j.N&&hg(c,!(!c.b||c.m),!0)}});function O(a,b,c){this.id=a.id;this.key=kg(a,b,c);this.F=a.F;cg(this,a.sd)}function kg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){bg(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){cg(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 bg(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function cg(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);Aa(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function $f(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Wf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var kg=0; 1);c=0}}};function cg(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function dg(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);Aa(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function ag(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Xf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var lg=0;
function lg(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):mg(k,a,b,c,d,e,f)})} function mg(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):ng(k,a,b,c,d,e,f)})}
function mg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ra(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"), function ng(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ra(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?ng(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)} a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?og(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
function ng(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, function og(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],g);ng(a,b,c)}})}else c(a,null)} "");a=a.replace(d[0],g);og(a,b,c)}})}else c(a,null)}
function og(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--kg||Ia(!0));l=!1}var g,k,l=!0;kg++;Qa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| function pg(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--lg||Ia(!0));l=!1}var g,k,l=!0;lg++;Qa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c||
(c="/versions/pdpjs/1.30.3/components.xsl");n=function(d,k){k?lg(c,null,null,!1,e,function(d,l){l?(Ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--kg||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--kg||Ia(!0)):f("invalid machine element: "+ (c="/versions/pdpjs/1.30.3/components.xsl");n=function(d,k){k?mg(c,null,null,!1,e,function(d,l){l?(Ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--lg||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--lg||Ia(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?lg(b,a,d,!0,e,n):mg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return og(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ja;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11.map a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?mg(b,a,d,!0,e,n):ng(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return pg(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ja;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11.map