Cleaned up checkStackLimit() processing, fixing some problems along the way (most notably, mode 6 references were not being checked)
This commit is contained in:
parent
c42ecd63a5
commit
f1c0dce8ab
6 changed files with 538 additions and 517 deletions
|
|
@ -35,8 +35,8 @@ in order to load the desired tape.
|
|||
[](#test-14)
|
||||
[](#test-15)
|
||||
|
||||
Instructions for Running Diagnostics
|
||||
------------------------------------
|
||||
Running Paper Tape Diagnostics
|
||||
------------------------------
|
||||
|
||||
### Tests 1-12
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0" binding="print" upperCase="true"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/debugger/front.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands="bp 021540"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -125,8 +125,10 @@ CPUStatePDP11.prototype.initProcessor = function()
|
|||
{
|
||||
if (this.model == PDP11.MODEL_1120) {
|
||||
this.decode = PDP11.op1120.bind(this);
|
||||
this.checkStackLimit = this.checkStackLimitOld;
|
||||
} else {
|
||||
this.decode = PDP11.op1145.bind(this);
|
||||
this.checkStackLimit = this.checkStackLimitNew;
|
||||
}
|
||||
|
||||
this.initRegs();
|
||||
|
|
@ -247,7 +249,7 @@ CPUStatePDP11.prototype.resetMMU = function()
|
|||
this.regMMR1 = 0; // 177574
|
||||
this.regMMR2 = 0; // 177576
|
||||
this.regMMR3 = 0; // 172516
|
||||
this.regErr = 0; // 177766
|
||||
this.regErr = 0; // 177766 TODO: Do we ever need to clear this, because it appears to accumulate errors...
|
||||
this.regPIR = 0; // 177772
|
||||
this.regSL = 0xff; // 177774
|
||||
this.mmuEnable = 0; // MMU enabled for PDP11.ACCESS.READ or PDP11.ACCESS.WRITE
|
||||
|
|
@ -1488,12 +1490,12 @@ CPUStatePDP11.prototype.mapUnibus = function(addr)
|
|||
};
|
||||
|
||||
/**
|
||||
* mapVirtualToPhysical(virtualAddress, accessFlags)
|
||||
* mapVirtualToPhysical(virtualAddress, access)
|
||||
*
|
||||
* mapVirtualToPhysical() does memory management. It converts a 17-bit I/D virtual address to a
|
||||
* 22-bit physical address. A real PDP 11/70 memory management unit can be enabled separately
|
||||
* for read and write for diagnostic purposes. This is handled here by having an enable mask
|
||||
* (mmuEnable) which is tested against the operation access mask (accessFlags). If there is no
|
||||
* (mmuEnable) which is tested against the operation access mask (access). If there is no
|
||||
* match, then the virtual address is simply mapped as a 16 bit physical address with the upper
|
||||
* page going to the IO address space. Significant access mask values used are PDP11.ACCESS.READ
|
||||
* and PDP11.ACCESS.WRITE.
|
||||
|
|
@ -1539,19 +1541,19 @@ CPUStatePDP11.prototype.mapUnibus = function(addr)
|
|||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} virtualAddress
|
||||
* @param {number} accessFlags
|
||||
* @param {number} access
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFlags)
|
||||
CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, access)
|
||||
{
|
||||
var page, pdr, physicalAddress;
|
||||
|
||||
this.assert(!(virtualAddress & ~0x1ffff) && accessFlags);
|
||||
this.assert(!(virtualAddress & ~0x1ffff) && access);
|
||||
|
||||
/*
|
||||
* This can happen when the DSTMODE (MAINT) bit of MMR0 is set but *not* the ENABLED bit.
|
||||
*/
|
||||
if (!(accessFlags & this.mmuEnable)) {
|
||||
if (!(access & this.mmuEnable)) {
|
||||
physicalAddress = virtualAddress & 0xffff;
|
||||
if (physicalAddress >= BusPDP11.IOPAGE_16BIT) {
|
||||
physicalAddress |= this.addrIOPage;
|
||||
|
|
@ -1578,7 +1580,7 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
|
|||
* As for the ODDADDR error that's supposed to generate a BUS error rather than an MMU error, this happens
|
||||
* in TEST #122 ("KT BEND") in the "EKBEE1" diagnostic (PC 076456).
|
||||
*/
|
||||
if ((physicalAddress & 0x1) && !(accessFlags & PDP11.ACCESS.BYTE)) {
|
||||
if ((physicalAddress & 0x1) && !(access & PDP11.ACCESS.BYTE)) {
|
||||
this.regErr |= PDP11.CPUERR.ODDADDR;
|
||||
this.trap(PDP11.TRAP.BUS, 0, physicalAddress);
|
||||
}
|
||||
|
|
@ -1592,7 +1594,7 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
|
|||
|
||||
case PDP11.PDR.ACF.RO: // 0x2: read-only, abort on write attempt
|
||||
pdr |= PDP11.PDR.ACCESSED;
|
||||
if (accessFlags & PDP11.ACCESS.WRITE) {
|
||||
if (access & PDP11.ACCESS.WRITE) {
|
||||
newMMR0 = PDP11.MMR0.ABORT_RO;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1602,13 +1604,13 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
|
|||
/* falls through */
|
||||
|
||||
case PDP11.PDR.ACF.RW2: // 0x5: read/write, memory management trap upon completion of a write (11/70 only)
|
||||
if (accessFlags & PDP11.ACCESS.WRITE) {
|
||||
if (access & PDP11.ACCESS.WRITE) {
|
||||
newMMR0 = PDP11.MMR0.TRAP_MMU;
|
||||
}
|
||||
/* falls through */
|
||||
|
||||
case PDP11.PDR.ACF.RW: // 0x6: read/write, no system trap/abort action
|
||||
pdr |= ((accessFlags & PDP11.ACCESS.WRITE) ? (PDP11.PDR.ACCESSED | PDP11.PDR.MODIFIED) : PDP11.PDR.ACCESSED);
|
||||
pdr |= ((access & PDP11.ACCESS.WRITE) ? (PDP11.PDR.ACCESSED | PDP11.PDR.MODIFIED) : PDP11.PDR.ACCESSED);
|
||||
break;
|
||||
|
||||
default: // 0x0 (non-resident, abort all accesses) or 0x3 or 0x7 (unused, abort all accesses)
|
||||
|
|
@ -1727,51 +1729,12 @@ CPUStatePDP11.prototype.pushWord = function(data)
|
|||
var virtualAddress = (this.regsGen[6] - 2) & 0xffff;
|
||||
this.regsGen[6] = virtualAddress; // BSD needs SP updated before any fault :-(
|
||||
this.lastOp = (this.lastOp & 0xffff) | ((this.lastOp & ~0xffff) << 8) | (0x00f6 << 16);
|
||||
this.checkStackLimit(0, virtualAddress);
|
||||
this.checkStackLimit(PDP11.ACCESS.PUSH_WORD, -2, virtualAddress);
|
||||
this.writeWord(virtualAddress, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* checkStackLimit(mode, addr)
|
||||
*
|
||||
* The special "mode 0" case used by pushWord() ignores addr <= 4, because pushWord() is used by trap(),
|
||||
* and if the trap() was generated by a RED error (below) or generated a RED error itself, then we need to
|
||||
* avoid triggering another (nested) RED error.
|
||||
*
|
||||
* TODO: pushWord() is not used exclusively by trap(); it's also used by a few instructions, like opJSR(),
|
||||
* so we might need to do some additional factoring of this function's logic.
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} mode (ie, the addressing mode, or 0 if pushWord() is checking)
|
||||
* @param {number} addr
|
||||
*/
|
||||
CPUStatePDP11.prototype.checkStackLimit = function(mode, addr)
|
||||
{
|
||||
if (!this.mmuMode) {
|
||||
/*
|
||||
* NOTE: I've removed the tests below for addr >= 0xFFFE, which were ported from the original code,
|
||||
* because while it's definitely a bad physical stack address, I'm not sure it rises to the level of
|
||||
* a trap, and this code is already expensive enough as it is.
|
||||
*/
|
||||
if (addr <= this.regSL && (mode || addr > 4) /* || mode && addr >= 0xFFFE */) {
|
||||
if (this.model >= PDP11.MODEL_1145 && (addr <= this.regSL - 32 /* || mode == 1 && addr >= 0xFFFE */)) {
|
||||
this.regErr |= PDP11.CPUERR.RED;
|
||||
this.regsGen[6] = 4;
|
||||
this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.RED);
|
||||
} else {
|
||||
/*
|
||||
* On older machines (eg, the PDP-11/20), the instruction is always allowed to complete,
|
||||
* so the trap must always be issued in this fashion.
|
||||
*/
|
||||
this.regErr |= PDP11.CPUERR.YELLOW;
|
||||
this.opFlags |= PDP11.OPFLAG.TRAP_SP;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* getAddrByMode(mode, reg, accessFlags)
|
||||
* getAddrByMode(mode, reg, access)
|
||||
*
|
||||
* getAddrByMode() maps a six bit operand to a 17 bit I/D virtual address space.
|
||||
*
|
||||
|
|
@ -1806,13 +1769,13 @@ CPUStatePDP11.prototype.checkStackLimit = function(mode, addr)
|
|||
* @this {CPUStatePDP11}
|
||||
* @param {number} mode
|
||||
* @param {number} reg
|
||||
* @param {number} accessFlags
|
||||
* @param {number} access
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
|
||||
CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, access)
|
||||
{
|
||||
var virtualAddress, step;
|
||||
var addrDSpace = (accessFlags & PDP11.ACCESS.VIRT)? 0 : this.addrDSpace;
|
||||
var addrDSpace = (access & PDP11.ACCESS.VIRT)? 0 : this.addrDSpace;
|
||||
|
||||
/*
|
||||
* Modes that need to auto-increment or auto-decrement will break, in order to perform
|
||||
|
|
@ -1835,9 +1798,7 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
|
|||
* Mode 1: (R)
|
||||
*/
|
||||
case 1:
|
||||
if (reg == 6 && (accessFlags & PDP11.ACCESS.WRITE)) {
|
||||
this.checkStackLimit(mode, this.regsGen[6]);
|
||||
}
|
||||
if (reg == 6) this.checkStackLimit(access, 0, this.regsGen[6]);
|
||||
this.nStepCycles -= (2 + 1);
|
||||
return (reg == 7? this.regsGen[reg] : (this.regsGen[reg] | addrDSpace));
|
||||
|
||||
|
|
@ -1847,11 +1808,10 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
|
|||
case 2:
|
||||
step = 2;
|
||||
virtualAddress = this.regsGen[reg];
|
||||
if (reg == 6) this.checkStackLimit(access, step, virtualAddress);
|
||||
if (reg != 7) {
|
||||
virtualAddress |= addrDSpace;
|
||||
if (reg < 6 && (accessFlags & PDP11.ACCESS.BYTE)) {
|
||||
step = 1;
|
||||
}
|
||||
if (reg < 6 && (access & PDP11.ACCESS.BYTE)) step = 1;
|
||||
}
|
||||
this.nStepCycles -= (2 + 1);
|
||||
break;
|
||||
|
|
@ -1873,8 +1833,9 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
|
|||
*/
|
||||
case 4:
|
||||
step = -2;
|
||||
if (reg < 6 && (accessFlags & PDP11.ACCESS.BYTE)) step = -1;
|
||||
if (reg < 6 && (access & PDP11.ACCESS.BYTE)) step = -1;
|
||||
virtualAddress = (this.regsGen[reg] + step) & 0xffff;
|
||||
if (reg == 6) this.checkStackLimit(access, step, virtualAddress);
|
||||
if (reg != 7) virtualAddress |= addrDSpace;
|
||||
this.nStepCycles -= (3 + 1);
|
||||
break;
|
||||
|
|
@ -1895,9 +1856,10 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
|
|||
*/
|
||||
case 6:
|
||||
virtualAddress = this.readWord(this.advancePC(2));
|
||||
virtualAddress = ((virtualAddress + this.regsGen[reg]) & 0xffff) | addrDSpace;
|
||||
virtualAddress = (virtualAddress + this.regsGen[reg]) & 0xffff;
|
||||
if (reg == 6) this.checkStackLimit(access, 0, virtualAddress);
|
||||
this.nStepCycles -= (4 + 2);
|
||||
return virtualAddress;
|
||||
return virtualAddress | addrDSpace;
|
||||
|
||||
/*
|
||||
* Mode 7: @d(R)
|
||||
|
|
@ -1905,24 +1867,82 @@ CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
|
|||
case 7:
|
||||
virtualAddress = this.readWord(this.advancePC(2));
|
||||
virtualAddress = (virtualAddress + this.regsGen[reg]) & 0xffff;
|
||||
virtualAddress = this.readWord(virtualAddress | this.addrDSpace) | addrDSpace;
|
||||
virtualAddress = this.readWord(virtualAddress | this.addrDSpace);
|
||||
this.nStepCycles -= (7 + 3);
|
||||
return virtualAddress;
|
||||
return virtualAddress | addrDSpace;
|
||||
}
|
||||
|
||||
this.regsGen[reg] = (this.regsGen[reg] + step) & 0xffff;
|
||||
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
|
||||
* "TRAP TEST" expects "TST -(SP)" to trap when SP is 150.
|
||||
*/
|
||||
if (reg == 6 && step < 0) {
|
||||
this.checkStackLimit(mode, this.regsGen[6]);
|
||||
}
|
||||
return virtualAddress;
|
||||
};
|
||||
|
||||
/**
|
||||
* checkStackLimitOld(access, step, addr)
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} access
|
||||
* @param {number} step
|
||||
* @param {number} addr
|
||||
*/
|
||||
CPUStatePDP11.prototype.checkStackLimitOld = function(access, step, addr)
|
||||
{
|
||||
/*
|
||||
* NOTE: DEC's "TRAP TEST" (MAINDEC-11-D0NA-PB) expects "TST -(SP)" to trap when SP is 150,
|
||||
* so we ignore the access parameter. Also, strangely, it does NOT expect this instruction
|
||||
* to trap:
|
||||
*
|
||||
* R0=006302 R1=000000 R2=000000 R3=000000 R4=000000 R5=000776
|
||||
* SP=000000 PC=006346 PS=000344 IR=000000 SL=000377 T0 N0 Z1 V0 C0
|
||||
* 006346: 112667 171426 MOVB (SP)+,000000
|
||||
*
|
||||
* so if the step parameter is positive, we let it go.
|
||||
*/
|
||||
if (!this.mmuMode && step <= 0 && addr <= this.regSL) {
|
||||
/*
|
||||
* On older machines (eg, the PDP-11/20), there is no "YELLOW" and "RED" distinction, and the
|
||||
* instruction is always allowed to complete, so the trap must always be issued in this fashion.
|
||||
*/
|
||||
this.opFlags |= PDP11.OPFLAG.TRAP_SP;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* checkStackLimitNew(access, step, addr)
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} access
|
||||
* @param {number} step
|
||||
* @param {number} addr
|
||||
*/
|
||||
CPUStatePDP11.prototype.checkStackLimitNew = function(access, step, addr)
|
||||
{
|
||||
if (!this.mmuMode) {
|
||||
/*
|
||||
* NOTE: The 11/70 CPU Instruction Exerciser does NOT expect reads to trigger a stack overflow, so we
|
||||
* check the access parameter.
|
||||
*
|
||||
* The special PUSH_WORD case used by pushWord() ignores addr <= 4, because pushWord() is used by trap(),
|
||||
* and if the trap() was generated by a RED error (below) or generated a RED error itself, then we need to
|
||||
* avoid triggering another (nested) RED error.
|
||||
*/
|
||||
if (!(access & PDP11.ACCESS.WRITE) || access == PDP11.ACCESS.PUSH_WORD && addr <= 4) {
|
||||
return;
|
||||
}
|
||||
if (addr <= this.regSL) {
|
||||
if (addr <= this.regSL - 32) {
|
||||
this.regErr |= PDP11.CPUERR.RED;
|
||||
this.regsGen[6] = 4;
|
||||
this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.RED);
|
||||
} else {
|
||||
this.regErr |= PDP11.CPUERR.YELLOW;
|
||||
this.opFlags |= PDP11.OPFLAG.TRAP_SP;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* getByteDirect(addr)
|
||||
*
|
||||
|
|
@ -2008,35 +2028,35 @@ CPUStatePDP11.prototype.setWordDirect = function(addr, data)
|
|||
};
|
||||
|
||||
/**
|
||||
* getPhysicalAddrByMode(mode, reg, accessFlags)
|
||||
* getPhysicalAddrByMode(mode, reg, access)
|
||||
*
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through getAddr().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} mode
|
||||
* @param {number} reg
|
||||
* @param {number} accessFlags
|
||||
* @param {number} access
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.getPhysicalAddrByMode = function(mode, reg, accessFlags)
|
||||
CPUStatePDP11.prototype.getPhysicalAddrByMode = function(mode, reg, access)
|
||||
{
|
||||
return this.getAddrByMode(mode, reg, accessFlags);
|
||||
return this.getAddrByMode(mode, reg, access);
|
||||
};
|
||||
|
||||
/**
|
||||
* getVirtualAddrByMode(mode, reg, accessFlags)
|
||||
* getVirtualAddrByMode(mode, reg, access)
|
||||
*
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through getAddr().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} mode
|
||||
* @param {number} reg
|
||||
* @param {number} accessFlags
|
||||
* @param {number} access
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.getVirtualAddrByMode = function(mode, reg, accessFlags)
|
||||
CPUStatePDP11.prototype.getVirtualAddrByMode = function(mode, reg, access)
|
||||
{
|
||||
return this.mapVirtualToPhysical(this.getAddrByMode(mode, reg, accessFlags), accessFlags);
|
||||
return this.mapVirtualToPhysical(this.getAddrByMode(mode, reg, access), access);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -2096,14 +2116,14 @@ CPUStatePDP11.prototype.writeWordToVirtual = function(virtualAddress, data)
|
|||
};
|
||||
|
||||
/**
|
||||
* readWordFromPrevSpace(opCode, accessFlags)
|
||||
* readWordFromPrevSpace(opCode, access)
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} opCode
|
||||
* @param {number} accessFlags (really just PDP11.ACCESS.DSPACE or PDP11.ACCESS.ISPACE)
|
||||
* @param {number} access (really just PDP11.ACCESS.DSPACE or PDP11.ACCESS.ISPACE)
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags)
|
||||
CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, access)
|
||||
{
|
||||
var data;
|
||||
var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
|
||||
|
|
@ -2116,25 +2136,25 @@ CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags)
|
|||
}
|
||||
} else {
|
||||
var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD);
|
||||
if (!(accessFlags & PDP11.ACCESS.DSPACE)) {
|
||||
if (!(access & PDP11.ACCESS.DSPACE)) {
|
||||
if ((this.regPSW & 0xf000) !== 0xf000) addr &= 0xffff;
|
||||
}
|
||||
this.mmuMode = (this.regPSW >> 12) & 3;
|
||||
data = this.readWord(addr | (accessFlags & this.addrDSpace));
|
||||
data = this.readWord(addr | (access & this.addrDSpace));
|
||||
this.mmuMode = (this.regPSW >> 14) & 3;
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
/**
|
||||
* writeWordToPrevSpace(opCode, accessFlags, data)
|
||||
* writeWordToPrevSpace(opCode, access, data)
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} opCode
|
||||
* @param {number} accessFlags (really just PDP11.ACCESS.DSPACE or PDP11.ACCESS.ISPACE)
|
||||
* @param {number} access (really just PDP11.ACCESS.DSPACE or PDP11.ACCESS.ISPACE)
|
||||
* @param {number} data
|
||||
*/
|
||||
CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, data)
|
||||
CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, access, data)
|
||||
{
|
||||
this.lastOp = (this.lastOp & 0xffff) | (0x0016 << 16);
|
||||
var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
|
||||
|
|
@ -2147,7 +2167,7 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, dat
|
|||
}
|
||||
} else {
|
||||
var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.WRITE_WORD);
|
||||
if (!(accessFlags & PDP11.ACCESS.DSPACE)) addr &= 0xffff;
|
||||
if (!(access & PDP11.ACCESS.DSPACE)) addr &= 0xffff;
|
||||
/*
|
||||
* TODO: Consider replacing the following code with writeWord(), by adding optional mmuMode
|
||||
* parameters for each of the discrete mapVirtualToPhysical() and bus.setWord() operations, because
|
||||
|
|
@ -2155,7 +2175,7 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, dat
|
|||
* setMemoryAccess() handlers.
|
||||
*/
|
||||
this.mmuMode = (this.regPSW >> 12) & 3;
|
||||
addr = this.mapVirtualToPhysical(addr | (accessFlags & PDP11.ACCESS.DSPACE), PDP11.ACCESS.WRITE);
|
||||
addr = this.mapVirtualToPhysical(addr | (access & PDP11.ACCESS.DSPACE), PDP11.ACCESS.WRITE);
|
||||
this.mmuMode = (this.regPSW >> 14) & 3;
|
||||
this.bus.setWord(addr, data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,6 +307,7 @@ var PDP11 = {
|
|||
WRITE: 0x04,
|
||||
UPDATE: 0x06,
|
||||
VIRT: 0x08, // getVirtualByMode() leaves bit 17 clear if this is set (otherwise the caller would have to clear it again)
|
||||
PUSH: 0x10,
|
||||
ISPACE: 0x00000,
|
||||
DSPACE: 0x10000 // getVirtualByMode() sets bit 17 in any 16-bit virtual address that refers to D space (as opposed to I space)
|
||||
},
|
||||
|
|
@ -747,6 +748,7 @@ PDP11.ACCESS.WRITE_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.WRITE; // forme
|
|||
PDP11.ACCESS.WRITE_BYTE = PDP11.ACCESS.BYTE | PDP11.ACCESS.WRITE; // formerly WRITE_MODE (4) | BYTE_MODE (1)
|
||||
PDP11.ACCESS.UPDATE_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.UPDATE; // formerly MODIFY_WORD (2 | 4)
|
||||
PDP11.ACCESS.UPDATE_BYTE = PDP11.ACCESS.BYTE | PDP11.ACCESS.UPDATE; // formerly MODIFY_BYTE (1 | 2 | 4)
|
||||
PDP11.ACCESS.PUSH_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.WRITE | PDP11.ACCESS.PUSH;
|
||||
|
||||
/*
|
||||
* PSW arithmetic flags are NOT stored directly into the PSW register; they are maintained across separate
|
||||
|
|
|
|||
|
|
@ -31,300 +31,300 @@
|
|||
http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
||||
*/
|
||||
for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ca||(ca[fa]={});ca=ca[fa]}var ga=da[da.length-1],ia=ca[ga],ja=ia?ia:function(a){return Math.log(a)/Math.LN2};
|
||||
ja!=ia&&null!=ja&&aa(ca,ga,{configurable:!0,writable:!0,value:ja});var ka={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]};
|
||||
function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function na(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ta(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ua(a,b){return-1!==a.indexOf(b,a.length-b.length)}var va={"&":"&","<":"<",">":">",'"':""","'":"'"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})}
|
||||
for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ba||(ba[fa]={});ba=ba[fa]}var ga=da[da.length-1],ha=ba[ga],ja=ha?ha:function(a){return Math.log(a)/Math.LN2};
|
||||
ja!=ha&&null!=ja&&aa(ba,ga,{configurable:!0,writable:!0,value:ja});var ka={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]};
|
||||
function la(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function na(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function q(a){return p(a,4,!0)}
|
||||
function oa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ta(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ua(a,b){return-1!==a.indexOf(b,a.length-b.length)}var va={"&":"&","<":"<",">":">",'"':""","'":"'"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})}
|
||||
function xa(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Ba=Date.now||function(){return+new Date};function Ca(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||
function 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}
|
||||
function Ea(a,b){var c,d={ea:null,ga:null,Oa:null,Na:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Oa=g.load;d.Na=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c<e.length;c++)d.ea[f++]=e[c]&255,d.ea[f++]=e[c]>>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c<e.length;c++)d.ea[f++]=
|
||||
e[c]&255,d.ea[f++]=e[c]>>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ga=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ea=e)}return d}
|
||||
function Ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ia=null;function Ja(){if(null==Ia){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ia=a}return Ia}
|
||||
function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function La(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Na(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ta(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
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&&(u(d.ea[0]),d=null):(u("Empty resource: "+a),d=null)}catch(h){u("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)){u("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 u(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ia=null;function Ja(){if(null==Ia){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ia=a}return Ia}
|
||||
function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function La(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ma(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 Oa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function Ua(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Va={init:[],show:[],exit:[]},Wa=!1,Xa=!1,Ya=!0;function Za(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function $a(a){Va.init.push(a)}
|
||||
function ab(a){if(Ya)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function bb(a){!Ya&&a?(Ya=!0,Wa&&cb("init"),Xa&&cb("show")):Ya=a}function cb(a){Va[a]&&ab(Va[a])}Za("onload",function(){Wa=!0;ab(Va.init)});Za("onpageshow",function(){Xa=!0;ab(Va.show)});Za(Na("Opera")||Na("iOS")?"onunload":"onbeforeunload",function(){ab(Va.exit)});
|
||||
function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Bc=b.comment;this.ad=b;b=this.id.indexOf(".");0>b?this.bb=this.id:(this.Ua=this.id.substr(0,b),this.bb=this.id.substr(b+1));this[a]=c;this.A={ready:!1,fb:!1,ec:!1,ia:!1,error:!1};this.Xb=null;this.A.error=!1;this.G={};this.j=null;this.la=d||0;u.push(this)}var db=void 0,eb={};
|
||||
function ab(a){if(Ya)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function bb(a){!Ya&&a?(Ya=!0,Wa&&cb("init"),Xa&&cb("show")):Ya=a}function cb(a){Va[a]&&ab(Va[a])}Za("onload",function(){Wa=!0;ab(Va.init)});Za("onpageshow",function(){Xa=!0;ab(Va.show)});Za(Ma("Opera")||Ma("iOS")?"onunload":"onbeforeunload",function(){ab(Va.exit)});
|
||||
function w(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cc=b.comment;this.nd=b;b=this.id.indexOf(".");0>b?this.bb=this.id:(this.Ua=this.id.substr(0,b),this.bb=this.id.substr(b+1));this[a]=c;this.A={ready:!1,eb:!1,ec:!1,ia:!1,error:!1};this.Xb=null;this.A.error=!1;this.G={};this.j=null;this.la=d||0;y.push(this)}var db=void 0,eb={};
|
||||
if(window){db||(db=window.location.search.substr(1));for(var fb,gb=/\+/g,hb=/([^&=]+)=?([^&]*)/g;fb=hb.exec(db);)eb[decodeURIComponent(fb[1].replace(gb," "))]=decodeURIComponent(fb[2].replace(gb," "))}function ib(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||
function z(a,b){b||(b=t);a.prototype=ib(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var jb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else jb={},u=[];function rb(a,b,c){jb[a]&&b&&(jb[a][b]=c)}function sb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function tb(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}function ub(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
|
||||
function 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.wa(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}
|
||||
t.prototype={constructor:t,parent:null,toString:function(){return this.name?this.name:this.id||this.type},wa:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Va=this.G[b]=c,c.value="",this.i=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.R=function(a){this.i(a,this.bb)}),!0;default:return!1}},log:function(){},i:function(){},status:function(a){this.i(this.bb+": "+a)},R:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ka:function(){return this.A.ia=!0},Ja:function(a,b){b&&(this.A.ia=!1);return!0}};function E(a,b,c,d){a.j&&(!0===c||F(a,c|0))&&a.j.message(b,d)}function F(a,b){if(a.j){a===a.j?b|=0:b=b||a.la;var c=a.j.la&b;return!!b&&c===b||!!(c&a.j.Tc)}return!1}
|
||||
function vb(a,b){if(a.A.ec)return a.A.fb=!1,a.A.ec=!1;if(a.A.error)return a.i(a.toString()+" error"),!1;a.A.fb=b;return a.A.fb}function wb(a,b){a.A.fb&&(b?a.A.ec=!0:void 0===b&&a.i(a.toString()+" busy"));return a.A.fb}function H(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Xb,a.Xb=null,b&&b()))}function xb(a,b){b&&(a.A.ready?b():a.Xb=b);return a.A.ready}function yb(a){return a.A.error?(a.i(a.toString()+" error"),!0):!1}function zb(a,b){a.A.error=!0;a.R(b)}
|
||||
function A(a,b){b||(b=w);a.prototype=ib(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var jb=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else jb={},y=[];function kb(a,b,c){jb[a]&&b&&(jb[a][b]=c)}function sb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function tb(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function ub(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function C(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){u(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 h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=C(f))&&g.binding&&a.wa(g.type,g.binding,f,g.value),l=h.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}
|
||||
w.prototype={constructor:w,parent:null,toString:function(){return this.name?this.name:this.id||this.type},wa: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.Wa=this.G[b]=c,c.value="",this.i=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.R=function(a){this.i(a,this.bb)}),!0;default:return!1}},log:function(){},i:function(){},status:function(a){this.i(this.bb+": "+a)},R:function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)},Ka:function(){return this.A.ia=!0},Ja:function(a,b){b&&(this.A.ia=!1);return!0}};function F(a,b,c,d){a.j&&(!0===c||H(a,c|0))&&a.j.message(b,d)}function H(a,b){if(a.j){a===a.j?b|=0:b=b||a.la;var c=a.j.la&b;return!!b&&c===b||!!(c&a.j.Uc)}return!1}
|
||||
function vb(a,b){if(a.A.ec)return a.A.eb=!1,a.A.ec=!1;if(a.A.error)return a.i(a.toString()+" error"),!1;a.A.eb=b;return a.A.eb}function wb(a,b){a.A.eb&&(b?a.A.ec=!0:void 0===b&&a.i(a.toString()+" busy"));return a.A.eb}function I(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Xb,a.Xb=null,b&&b()))}function xb(a,b){b&&(a.A.ready?b():a.Xb=b);return a.A.ready}function yb(a){return a.A.error?(a.i(a.toString()+" error"),!0):!1}function zb(a,b){a.A.error=!0;a.R(b)}
|
||||
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
|
||||
var Ab="undefined"!==typeof ArrayBuffer,Bb="UNKNOWN ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Cb={cpu:1,trap:16,fault:32,bus:64,memory:128,mmu:256,rom:512,device:1024,panel:2048,keyboard:65536,key:131072,paper:1048576,disk:4194304,rl11:8388608,serial:16777216,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
||||
function Db(a){t.call(this,"Panel",a,Db,2048);this.va=this.w=this.Za=this.qb=this.B=this.D=0;this.I=this.K=this.H=!1;this.L=Eb;this.g={};this.f={START:[1,1,!0,!1,this.hd],STEP:[1,1,!1,!1,this.jd],ENABLE:[1,1,!1,!1,this.dd],CONT:[1,1,!0,!1,this.bd],DEP:[0,0,!0,!1,this.cd],EXAM:[1,1,!0,!1,this.ed],LOAD:[1,1,!0,!1,this.gd],TEST:[0,0,!0,!1,this.fd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.kd,a]}z(Db);var Eb=7;function Fb(a,b){return a.f[b]&&a.f[b][1]}k=Db.prototype;k.reset=function(){this.stop()};
|
||||
function Db(a){w.call(this,"Panel",a,Db,2048);this.va=this.w=this.Za=this.sb=this.B=this.D=0;this.I=this.K=this.H=!1;this.L=Eb;this.g={};this.f={START:[1,1,!0,!1,this.kd],STEP:[1,1,!1,!1,this.ld],ENABLE:[1,1,!1,!1,this.fd],CONT:[1,1,!0,!1,this.dd],DEP:[0,0,!0,!1,this.ed],EXAM:[1,1,!0,!1,this.gd],LOAD:[1,1,!0,!1,this.jd],TEST:[0,0,!0,!1,this.hd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.md,a]}A(Db);var Eb=7;function Fb(a,b){return a.f[b]&&a.f[b][1]}k=Db.prototype;k.reset=function(){this.stop()};
|
||||
k.wa=function(a,b,c,d){if(this.C&&this.C.wa(a,b,c,d)||this.b&&this.b.wa(a,b,c,d)||this.j&&this.j.wa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.g[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
|
||||
b){return function(){Gb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Hb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Gb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Hb(a,b)}}(this,b),!0):this.parent.wa.call(this,a,b,c,d)}};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.j=d;Ib(b,this,Jb);Kb(b,this.reset.bind(this));Lb(this);Mb(this)};k.Ka=function(a,b){b||(Nb(),this.reset());return!0};k.Ja=function(){return!0};
|
||||
function Ob(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Lb(a,b){for(var c in a.g)Ob(a,c,null!=b?b:a.g[c])}function Pb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Mb(a){for(var b in a.f)Pb(a,b,a.f[b][1])}function Qb(a,b,c,d){a.G[b]&&(void 0===c&&(zb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.j&&a.j.ca||8)?na(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}
|
||||
function Gb(a,b){var c=a.f[b];Pb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Hb(a,b){var c=a.f[b];c[2]&&c[3]&&(Pb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.hd=function(a){a||this.b.A.W||(a=this.b,a.v.reset(),Rb(a),Fb(this,"ENABLE")&&this.b.ib())};k.jd=function(){};k.dd=function(a){a||this.b.da()};
|
||||
k.bd=function(a){if(!a&&!this.b.A.W)if(Fb(this,"ENABLE"))this.b.ib();else{if((a=this.j)&&!wb(a,!0))vb(a,!0),a.jb(0,null),vb(a,!1);else try{var b=this.b.jb(1);0<b&&(Sb(this.b,b),Tb(this.b,b,!0),Ub(this.b,b))}catch(c){"number"!=typeof c&&zb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.sa()}};k.cd=function(a){a&&!this.b.A.W&&(this.I&&hc(this),a=ic(this,this.Za),this.L==Eb?this.v.vb(this.va,a):this.b.vb(this.va,a))};
|
||||
k.ed=function(a){a||this.b.A.W||(this.K&&hc(this),a=this.L==Eb?this.v.Xa(this.va):this.b.Xa(this.va),ic(this,a))};k.gd=function(a){a||this.b.A.W||jc(this,this.Za)};k.fd=function(a){a?(this.H=!0,Lb(this,!0)):(this.H=!1,Lb(this),kc(this,0))};k.kd=function(a,b){this.Za=a?this.Za|1<<b:this.Za&~(1<<b)};function hc(a){var b=1145>a.b.Ya?8:16,c=65472<=a.va&&a.va<65472+b,b=c?1:2,c=c?15:a.v.Qa;Fb(a,"STEP")||(b=-b);jc(a,a.va&~c|a.va+b&c)}
|
||||
function jc(a,b){a.va=b&a.v.Qa;b=a.va;for(var c=0;22>c;c++)lc(a,"A"+c,b&1<<c)}function ic(a,b){a.w=b&65535;b=a.w;for(var c=0;16>c;c++)lc(a,"D"+c,b&1<<c);return a.w}function lc(a,b,c){a.g[b]=c;a.H||Ob(a,b,c)}function mc(a){return void 0!==a.G.S0}function kc(a,b){if(mc(a)){a.Za=b;for(var c=0;22>c;c++)a.f["S"+c][1]=b&1<<c?1:0;Mb(a)}}k.stop=function(){jc(this,this.b.u[7])};k.nc=function(a){this.va=a};k.setData=function(a,b){b?this.qb=a:this.w=a};k.nd=function(a,b){return(b?this.qb:this.Za)&65535};
|
||||
k.he=function(a){this.qb=a};var nc={},Jb=(nc[65400]=[null,null,Db.prototype.nd,Db.prototype.he,"CNSW"],nc);function Nb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=tb(e.id);f||(a=!0,f=new Db(e));B(f,d);a&&H(f)}}$a(Nb);
|
||||
function oc(a,b,c){t.call(this,"Bus",a,oc,64);this.b=b;this.j=c;this.K=a.busWidth||16;this.C=0;this.w=[];this.g=null;this.H=1<<this.K;this.Qa=this.H-1;this.Ca=pc;this.ka=Math.log2(this.Ca);this.I=this.Ca>>2;this.v=this.Ca-1;this.D=this.H/this.Ca|0;this.eb=[];this.ma=0;this.f=!1;this.gc=0;this.B=[];this.Qc=[qc,rc,sc,tc];a=new I(this);uc(a,this.j);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(oc);var pc=8192,vc=pc-1;
|
||||
function qc(a,b){var c=-1,d=this.controller,e=d.eb[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.eb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&F(this.j,e[5])&&E(this.j,e[4]+".readByte("+J(this.j,b)+"): "+J(this.j,c),!0,!d.ma),c;d.Ha(b,16,3);c=255;this.j&&F(this.j,64)&&E(this.j,"warning: unconverted read access to byte @"+J(this.j,b)+": "+J(this.j,c),!0,!d.ma);return c}
|
||||
function rc(a,b,c){var d=!1,e=this.controller,f=e.eb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.eb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&F(this.j,f[5])&&E(this.j,f[4]+".writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0,!e.ma):(e.Ha(c,16,5),this.j&&F(this.j,64)&&E(this.j,"warning: unconverted write access to byte @"+J(this.j,c)+": "+J(this.j,
|
||||
b),!0,!e.ma))}function sc(a,b){var c=-1,d=this.controller;a=d.eb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&F(this.j,a[5])&&E(this.j,a[4]+".readWord("+J(this.j,b)+"): "+J(this.j,c),!0,!d.ma),c;d.Ha(b,16,2);c=65535;this.j&&F(this.j,64)&&E(this.j,"warning: unconverted read access to word @"+J(this.j,b)+": "+J(this.j,c),!0,!d.ma);return c}
|
||||
function tc(a,b,c){var d=!1,e=this.controller;a=e.eb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&F(this.j,a[5])&&E(this.j,a[4]+".writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0,!e.ma):(e.Ha(c,16,4),this.j&&F(this.j,64)&&E(this.j,"warning: unconverted write access to word @"+J(this.j,c)+": "+J(this.j,b),!0,!e.ma))}
|
||||
function Gb(a,b){var c=a.f[b];Pb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Hb(a,b){var c=a.f[b];c[2]&&c[3]&&(Pb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.kd=function(a){a||this.b.A.W||(a=this.b,a.v.reset(),Rb(a),Fb(this,"ENABLE")&&this.b.jb())};k.ld=function(){};k.fd=function(a){a||this.b.da()};
|
||||
k.dd=function(a){if(!a&&!this.b.A.W)if(Fb(this,"ENABLE"))this.b.jb();else{if((a=this.j)&&!wb(a,!0))vb(a,!0),a.kb(0,null),vb(a,!1);else try{var b=this.b.kb(1);0<b&&(Sb(this.b,b),Tb(this.b,b,!0),Ub(this.b,b))}catch(c){"number"!=typeof c&&zb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.sa()}};k.ed=function(a){a&&!this.b.A.W&&(this.I&&Vb(this),a=ic(this,this.Za),this.L==Eb?this.v.wb(this.va,a):this.b.wb(this.va,a))};
|
||||
k.gd=function(a){a||this.b.A.W||(this.K&&Vb(this),a=this.L==Eb?this.v.Ya(this.va):this.b.Ya(this.va),ic(this,a))};k.jd=function(a){a||this.b.A.W||jc(this,this.Za)};k.hd=function(a){a?(this.H=!0,Lb(this,!0)):(this.H=!1,Lb(this),kc(this,0))};k.md=function(a,b){this.Za=a?this.Za|1<<b:this.Za&~(1<<b)};function Vb(a){var b=1145>a.b.fb?8:16,c=65472<=a.va&&a.va<65472+b,b=c?1:2,c=c?15:a.v.Qa;Fb(a,"STEP")||(b=-b);jc(a,a.va&~c|a.va+b&c)}
|
||||
function jc(a,b){a.va=b&a.v.Qa;b=a.va;for(var c=0;22>c;c++)lc(a,"A"+c,b&1<<c)}function ic(a,b){a.w=b&65535;b=a.w;for(var c=0;16>c;c++)lc(a,"D"+c,b&1<<c);return a.w}function lc(a,b,c){a.g[b]=c;a.H||Ob(a,b,c)}function mc(a){return void 0!==a.G.S0}function kc(a,b){if(mc(a)){a.Za=b;for(var c=0;22>c;c++)a.f["S"+c][1]=b&1<<c?1:0;Mb(a)}}k.stop=function(){jc(this,this.b.u[7])};k.oc=function(a){this.va=a};k.setData=function(a,b){b?this.sb=a:this.w=a};k.pd=function(a,b){return(b?this.sb:this.Za)&65535};
|
||||
k.ke=function(a){this.sb=a};var nc={},Jb=(nc[65400]=[null,null,Db.prototype.pd,Db.prototype.ke,"CNSW"],nc);function Nb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=C(d),f=tb(e.id);f||(a=!0,f=new Db(e));D(f,d);a&&I(f)}}$a(Nb);
|
||||
function oc(a,b,c){w.call(this,"Bus",a,oc,64);this.b=b;this.j=c;this.K=a.busWidth||16;this.C=0;this.w=[];this.g=null;this.H=1<<this.K;this.Qa=this.H-1;this.Da=pc;this.ka=Math.log2(this.Da);this.I=this.Da>>2;this.v=this.Da-1;this.D=this.H/this.Da|0;this.cb=[];this.ma=0;this.f=!1;this.gc=0;this.B=[];this.Rc=[qc,rc,sc,tc];a=new J(this);uc(a,this.j);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;I(this)}A(oc);var pc=8192,vc=pc-1;
|
||||
function qc(a,b){var c=-1,d=this.controller,e=d.cb[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.cb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&H(this.j,e[5])&&F(this.j,e[4]+".readByte("+K(this.j,b)+"): "+K(this.j,c),!0,!d.ma),c;d.Ha(b,16,3);c=255;this.j&&H(this.j,64)&&F(this.j,"warning: unconverted read access to byte @"+K(this.j,b)+": "+K(this.j,c),!0,!d.ma);return c}
|
||||
function rc(a,b,c){var d=!1,e=this.controller,f=e.cb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.cb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&H(this.j,f[5])&&F(this.j,f[4]+".writeByte("+K(this.j,c)+","+K(this.j,b)+")",!0,!e.ma):(e.Ha(c,16,5),this.j&&H(this.j,64)&&F(this.j,"warning: unconverted write access to byte @"+K(this.j,c)+": "+K(this.j,
|
||||
b),!0,!e.ma))}function sc(a,b){var c=-1,d=this.controller;a=d.cb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&H(this.j,a[5])&&F(this.j,a[4]+".readWord("+K(this.j,b)+"): "+K(this.j,c),!0,!d.ma),c;d.Ha(b,16,2);c=65535;this.j&&H(this.j,64)&&F(this.j,"warning: unconverted read access to word @"+K(this.j,b)+": "+K(this.j,c),!0,!d.ma);return c}
|
||||
function tc(a,b,c){var d=!1,e=this.controller;a=e.cb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&H(this.j,a[5])&&F(this.j,a[4]+".writeWord("+K(this.j,c)+","+K(this.j,b)+")",!0,!e.ma):(e.Ha(c,16,4),this.j&&H(this.j,64)&&F(this.j,"warning: unconverted write access to word @"+K(this.j,c)+": "+K(this.j,b),!0,!e.ma))}
|
||||
function wc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-pc,xc(a,c,pc,a.w),a.C=0);b&&(a.C=b,c=1<<b,a.Qa=c-1,c-=pc,a.w=yc(a,c,pc),a.g?xc(a,c,pc,a.g):(zc(a,c,pc,Ac,a),a.g=yc(a,c,pc)))}}k=oc.prototype;k.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();wc(this,16)};k.Ka=function(a,b){b||this.reset();return!0};
|
||||
function zc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ka;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.Ca,n=a.Ca-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Tb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Tb){n=l.size-(f-m);n>g&&(n=g);l.Tb=f-l.F+n;f=m+a.Ca;g-=n;h++;continue}}return Bc(1,f,g)}f=new I(a,f,n,a.Ca,d,e);uc(f,a.j,l);a.Y[h++]=f;f=m+a.Ca;g-=n}return 0>=g?(d==Cc&&(a.gc+=c),a.status((c>>10)+"Kb "+Dc[d]+" at "+na(b)),!0):Bc(2,b,c)}
|
||||
function yc(a,b,c){var d=[];for(b>>>=a.ka;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.Ca;return d}function xc(a,b,c,d){var e=0;for(b>>>=a.ka;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.Ca}}k.Yb=function(a){3932160<=a&&(a=Ec(this.b,a));return this.Y[(a&this.Qa)>>>this.ka].$b(a&this.v,a)};k.Zb=function(a){3932160<=a&&(a=Ec(this.b,a));this.f=!1;this.ma++;a=this.Y[(a&this.Qa)>>>this.ka].lc(a&this.v,a);this.ma--;return a};
|
||||
k.pa=function(a){3932160<=a&&(a=Ec(this.b,a));return this.Y[(a&this.Qa)>>>this.ka].ua(a&this.v,a)};k.Xa=function(a){3932160<=a&&(a=Ec(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ka;this.f=!1;this.ma++;a=this.Y[c].mc(b,a);this.ma--;return a};k.Fb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.Y[(a&this.Qa)>>>this.ka].cc(a&this.v,b&255,a)};k.sb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.f=!1;this.ma++;this.Y[(a&this.Qa)>>>this.ka].dc(a&this.v,b&255,a);this.ma--};
|
||||
k.ub=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.Y[(a&this.Qa)>>>this.ka].Ub(a&this.v,b&65535,a)};k.vb=function(a,b){3932160<=a&&(a=Ec(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ka;this.f=!1;this.ma++;this.Y[d].pc(c,b&65535,a);this.ma--};
|
||||
function Fc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Wa||e.Vc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Gc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&vc;if(void 0!==a.eb[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.eb[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
|
||||
function Ib(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Ya)){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),!Gc(a,e,e,g,h,l,m,f[7]||b.la||64,n||b.bb))return!1}}return!0}function Kb(a,b){a.B.push(b)}
|
||||
k.Ha=function(a,b,c){this.f=!0;this.ma||(this.j&&F(this.j,32)&&E(this.j,"memory fault ("+c+") on "+J(this.j,a),!0,!0),b&&(this.b.na|=b),this.b.ra(4,0,a))};function Hc(a){var b=a.f;a.f=!1;return b}function Bc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,1024);this.f={fa:0,oc:-1}}z(K);k=K.prototype;
|
||||
k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.j=d;var e=this;this.f.oc=Ic(c,function(){e.f.Nb|=128;e.f.Nb&64&&Jc(e.b,e.f.fe);e.C&&e.C.sa(1);Kc(e.b,e.f.oc,1E3/60)});this.f.fe=Tc(64,6);Ib(b,this,Uc);Kb(b,this.reset.bind(this));d&&Vc(d,256,function(a){var b=e.b;L(e,"KIPDR",b.P[0],0,a[0]);L(e,"KDPDR",b.P[0],8,a[0]);L(e,"KIPAR",b.ha[0],0,a[0]);L(e,"KDPAR",b.ha[0],8,a[0],!0);L(e,"SIPDR",b.P[1],0,a[0]);L(e,"SDPDR",b.P[1],8,a[0]);L(e,"SIPAR",b.ha[1],0,a[0]);L(e,"SDPAR",b.ha[1],8,a[0],!0);L(e,"UIPDR",
|
||||
b.P[3],0,a[0]);L(e,"UDPDR",b.P[3],8,a[0]);L(e,"UIPAR",b.ha[3],0,a[0]);L(e,"UDPAR",b.ha[3],8,a[0],!0)});H(this)};function L(a,b,c,d,e,f){a=a.j;if(!(e&&0>b.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+J(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Nb=128;Kc(this.b,this.f.oc,1E3/60,!0)};k.vd=function(){return this.f.Nb};k.pe=function(a){this.f.Nb=a&192};k.xd=function(){return Wc(this.b)};k.re=function(a){Xc(this.b,a&-129|this.b.za&128)};k.yd=function(){return Yc(this.b)};
|
||||
k.zd=function(){return Zc(this.b)};k.Ad=function(){return this.b.Ta};k.se=function(a){$c(this.b,a)};k.ae=function(a){a=a>>1&63;var b=this.b.Sb[a>>1];return a&1?b>>16:b&65535};k.Te=function(a,b){b=b>>1&63;var c=b>>1;this.b.Sb[c]=b&1?this.b.Sb[c]&65535|(a&63)<<16:this.b.Sb[c]&-65536|a&65534};k.Ud=function(a){return this.b.P[1][a>>1&7]};k.Me=function(a,b){this.b.P[1][b>>1&7]=a&65295};k.Sd=function(a){return this.b.P[1][(a>>1&7)+8]};k.Ke=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};
|
||||
k.Td=function(a){return this.b.ha[1][a>>1&7]};k.Le=function(a,b){b=b>>1&7;this.b.ha[1][b]=a;this.b.P[1][b]&=65295};k.Rd=function(a){return this.b.ha[1][(a>>1&7)+8]};k.Je=function(a,b){b=(b>>1&7)+8;this.b.ha[1][b]=a;this.b.P[1][b]&=65295};k.ud=function(a){return this.b.P[0][a>>1&7]};k.oe=function(a,b){b=b>>1&7;this.b.P[0][b]=a&=65295;F(this,256)&&E(this,"writeKIPDR["+b+"]: "+na(a),!0)};k.sd=function(a){return this.b.P[0][(a>>1&7)+8]};k.me=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};
|
||||
k.td=function(a){return this.b.ha[0][a>>1&7]};k.ne=function(a,b){b=b>>1&7;this.b.ha[0][b]=a;this.b.P[0][b]&=65295};k.rd=function(a){return this.b.ha[0][(a>>1&7)+8]};k.le=function(a,b){b=(b>>1&7)+8;this.b.ha[0][b]=a;this.b.P[0][b]&=65295};k.$d=function(a){return this.b.P[3][a>>1&7]};k.Se=function(a,b){this.b.P[3][b>>1&7]=a&65295};k.Yd=function(a){return this.b.P[3][(a>>1&7)+8]};k.Qe=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};k.Zd=function(a){return this.b.ha[3][a>>1&7]};
|
||||
k.Re=function(a,b){b=b>>1&7;this.b.ha[3][b]=a;this.b.P[3][b]&=65295};k.Xd=function(a){return this.b.ha[3][(a>>1&7)+8]};k.Pe=function(a,b){b=(b>>1&7)+8;this.b.ha[3][b]=a;this.b.P[3][b]&=65295};k.Db=function(a){a&=7;return this.b.N&2048?this.b.$a[a]:this.b.u[a]};k.Gb=function(a,b){b&=7;this.b.N&2048?this.b.$a[b]=a:this.b.u[b]=a};k.Fd=function(){return this.b.N&49152?this.b.La[0]:this.b.u[6]};k.xe=function(a){this.b.N&49152?this.b.La[0]=a:this.b.u[6]=a};k.Id=function(){return this.b.u[7]};
|
||||
k.Ae=function(a){this.b.u[7]=a};k.Eb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.$a[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.$a[b]=a};k.Gd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.ye=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Hd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.ze=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.pd=function(a){return this.b.Jc[a-65504>>1]};
|
||||
k.je=function(a,b){this.b.Jc[b-65504>>1]=a};k.Gc=function(a){if(65520==a){a=0;switch(Cc){case Cc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Nc=function(){};k.Wd=function(){return 1};k.Oe=function(){};k.od=function(){return this.b.na};k.ie=function(){this.b.na=0};k.wd=function(){return this.b.Ic};k.qe=function(a,b){b&1||(a&=255);this.b.Ic=a};k.Bd=function(a,b){return b?0:this.b.Rb};k.te=function(a){ad(this.b,a)};k.Vd=function(a,b){return b?0:this.b.rb&65280};k.Ne=function(a){this.b.rb=a|255};
|
||||
k.Ed=function(){return bd(this.b)};k.we=function(a){cd(this.b,a&-1793|bd(this.b)&1792);this.b.J|=128};k.Mc=function(a,b){F(this)&&E(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)};
|
||||
var M={},Uc=(M[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145,256],M[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145,256],M[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145,256],M[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145,256],M[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145,256],M[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145,256],
|
||||
M[62688]=[null,null,K.prototype.td,K.prototype.ne,"KIPAR",8,1145,256],M[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145,256],M[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145,256],M[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],M[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145,256],M[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145,256],M[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145,256],M[65408]=[null,null,K.prototype.$d,
|
||||
K.prototype.Se,"UIPDR",8,1145,256],M[65424]=[null,null,K.prototype.Yd,K.prototype.Qe,"UDPDR",8,1145,256],M[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145,256],M[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145,256],M[65472]=[null,null,K.prototype.Db,K.prototype.Gb,"R0SET0"],M[65473]=[null,null,K.prototype.Db,K.prototype.Gb,"R1SET0"],M[65474]=[null,null,K.prototype.Db,K.prototype.Gb,"R2SET0"],M[65475]=[null,null,K.prototype.Db,K.prototype.Gb,"R3SET0"],M[65476]=[null,null,
|
||||
K.prototype.Db,K.prototype.Gb,"R4SET0"],M[65477]=[null,null,K.prototype.Db,K.prototype.Gb,"R5SET0"],M[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],M[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],M[65480]=[null,null,K.prototype.Eb,K.prototype.Hb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Eb,K.prototype.Hb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Eb,K.prototype.Hb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Eb,K.prototype.Hb,"R3SET1",1,1145],M[65484]=
|
||||
[null,null,K.prototype.Eb,K.prototype.Hb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Eb,K.prototype.Hb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],M[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],M[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,
|
||||
"SYSID",1,1170],M[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],M[65528]=[null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],M[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],M[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],M[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],M);
|
||||
$a(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new dd(c);B(c,d);break;case "rl11":c=new N(c),B(c,d)}}});var ed;if(Ab){var fd=new ArrayBuffer(2);(new DataView(fd)).setUint16(0,256,!0);ed=256===(new Uint16Array(fd))[0]}else ed=!1;var gd=ed;
|
||||
function I(a,b,c,d,e,f){this.v=a;this.id=hd+=2;this.b=null;this.F=b;this.Tb=c;this.size=d||0;this.type=e||id;this.f=e==jd;this.controller=null;uc(this);this.Wa=this.Vc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],kd(this,f.Qc);else if(Ab)this.B=new ArrayBuffer(this.size),this.D=new DataView(this.B,0,this.size),this.G=new Uint8Array(this.B,0,this.size),this.I=new Uint16Array(this.B,0,this.size>>1),this.b=new Int32Array(this.B,0,this.size>>2),kd(this,gd?ld:md);else{a=this.b=Array(this.size>>
|
||||
function zc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ka;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.Da,n=a.Da-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Tb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Tb){n=l.size-(f-m);n>g&&(n=g);l.Tb=f-l.F+n;f=m+a.Da;g-=n;h++;continue}}return Bc(1,f,g)}f=new J(a,f,n,a.Da,d,e);uc(f,a.j,l);a.Y[h++]=f;f=m+a.Da;g-=n}return 0>=g?(d==Cc&&(a.gc+=c),a.status((c>>10)+"Kb "+Dc[d]+" at "+na(b)),!0):Bc(2,b,c)}
|
||||
function yc(a,b,c){var d=[];for(b>>>=a.ka;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.Da;return d}function xc(a,b,c,d){var e=0;for(b>>>=a.ka;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.Da}}k.Yb=function(a){3932160<=a&&(a=Ec(this.b,a));return this.Y[(a&this.Qa)>>>this.ka].$b(a&this.v,a)};k.Zb=function(a){3932160<=a&&(a=Ec(this.b,a));this.f=!1;this.ma++;a=this.Y[(a&this.Qa)>>>this.ka].mc(a&this.v,a);this.ma--;return a};
|
||||
k.pa=function(a){3932160<=a&&(a=Ec(this.b,a));return this.Y[(a&this.Qa)>>>this.ka].ua(a&this.v,a)};k.Ya=function(a){3932160<=a&&(a=Ec(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ka;this.f=!1;this.ma++;a=this.Y[c].nc(b,a);this.ma--;return a};k.Fb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.Y[(a&this.Qa)>>>this.ka].cc(a&this.v,b&255,a)};k.tb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.f=!1;this.ma++;this.Y[(a&this.Qa)>>>this.ka].dc(a&this.v,b&255,a);this.ma--};
|
||||
k.vb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.Y[(a&this.Qa)>>>this.ka].Ub(a&this.v,b&65535,a)};k.wb=function(a,b){3932160<=a&&(a=Ec(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ka;this.f=!1;this.ma++;this.Y[d].qc(c,b&65535,a);this.ma--};
|
||||
function Fc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Xa||e.Yc){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 Gc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&vc;if(void 0!==a.cb[m])return u("I/O address already registered: "+p(b,8,!0)),!1;a.cb[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
|
||||
function Ib(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.fb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],r=f[5]||1,t=0;t<r;t++,e+=2)if(n&&1<r&&(n=f[4]+t),!Gc(a,e,e,g,h,l,m,f[7]||b.la||64,n||b.bb))return!1}}return!0}function Kb(a,b){a.B.push(b)}
|
||||
k.Ha=function(a,b,c){this.f=!0;this.ma||(this.j&&H(this.j,32)&&F(this.j,"memory fault ("+c+") on "+K(this.j,a),!0,!0),b&&(this.b.na|=b),this.b.ra(4,0,a))};function Hc(a){var b=a.f;a.f=!1;return b}function Bc(a,b,c){u("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function L(a){w.call(this,"Device",a,L,1024);this.f={fa:0,pc:-1}}A(L);k=L.prototype;
|
||||
k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.j=d;var e=this;this.f.pc=Ic(c,function(){e.f.Nb|=128;e.f.Nb&64&&Jc(e.b,e.f.ie);e.C&&e.C.sa(1);Kc(e.b,e.f.pc,1E3/60)});this.f.ie=Lc(64,6);Ib(b,this,Uc);Kb(b,this.reset.bind(this));d&&Vc(d,256,function(a){var b=e.b;M(e,"KIPDR",b.P[0],0,a[0]);M(e,"KDPDR",b.P[0],8,a[0]);M(e,"KIPAR",b.ha[0],0,a[0]);M(e,"KDPAR",b.ha[0],8,a[0],!0);M(e,"SIPDR",b.P[1],0,a[0]);M(e,"SDPDR",b.P[1],8,a[0]);M(e,"SIPAR",b.ha[1],0,a[0]);M(e,"SDPAR",b.ha[1],8,a[0],!0);M(e,"UIPDR",
|
||||
b.P[3],0,a[0]);M(e,"UDPDR",b.P[3],8,a[0]);M(e,"UIPAR",b.ha[3],0,a[0]);M(e,"UDPAR",b.ha[3],8,a[0],!0)});I(this)};function M(a,b,c,d,e,f){a=a.j;if(!(e&&0>b.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+K(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Nb=128;Kc(this.b,this.f.pc,1E3/60,!0)};k.xd=function(){return this.f.Nb};k.se=function(a){this.f.Nb=a&192};k.zd=function(){return Wc(this.b)};k.ue=function(a){Xc(this.b,a&-129|this.b.za&128)};k.Ad=function(){return Yc(this.b)};
|
||||
k.Bd=function(){return Zc(this.b)};k.Cd=function(){return this.b.Ta};k.ve=function(a){$c(this.b,a)};k.ce=function(a){a=a>>1&63;var b=this.b.Sb[a>>1];return a&1?b>>16:b&65535};k.We=function(a,b){b=b>>1&63;var c=b>>1;this.b.Sb[c]=b&1?this.b.Sb[c]&65535|(a&63)<<16:this.b.Sb[c]&-65536|a&65534};k.Wd=function(a){return this.b.P[1][a>>1&7]};k.Pe=function(a,b){this.b.P[1][b>>1&7]=a&65295};k.Ud=function(a){return this.b.P[1][(a>>1&7)+8]};k.Ne=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};
|
||||
k.Vd=function(a){return this.b.ha[1][a>>1&7]};k.Oe=function(a,b){b=b>>1&7;this.b.ha[1][b]=a;this.b.P[1][b]&=65295};k.Td=function(a){return this.b.ha[1][(a>>1&7)+8]};k.Me=function(a,b){b=(b>>1&7)+8;this.b.ha[1][b]=a;this.b.P[1][b]&=65295};k.wd=function(a){return this.b.P[0][a>>1&7]};k.re=function(a,b){b=b>>1&7;this.b.P[0][b]=a&=65295;H(this,256)&&F(this,"writeKIPDR["+b+"]: "+na(a),!0)};k.ud=function(a){return this.b.P[0][(a>>1&7)+8]};k.pe=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};
|
||||
k.vd=function(a){return this.b.ha[0][a>>1&7]};k.qe=function(a,b){b=b>>1&7;this.b.ha[0][b]=a;this.b.P[0][b]&=65295};k.td=function(a){return this.b.ha[0][(a>>1&7)+8]};k.oe=function(a,b){b=(b>>1&7)+8;this.b.ha[0][b]=a;this.b.P[0][b]&=65295};k.be=function(a){return this.b.P[3][a>>1&7]};k.Ve=function(a,b){this.b.P[3][b>>1&7]=a&65295};k.$d=function(a){return this.b.P[3][(a>>1&7)+8]};k.Te=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};k.ae=function(a){return this.b.ha[3][a>>1&7]};
|
||||
k.Ue=function(a,b){b=b>>1&7;this.b.ha[3][b]=a;this.b.P[3][b]&=65295};k.Zd=function(a){return this.b.ha[3][(a>>1&7)+8]};k.Se=function(a,b){b=(b>>1&7)+8;this.b.ha[3][b]=a;this.b.P[3][b]&=65295};k.Db=function(a){a&=7;return this.b.N&2048?this.b.$a[a]:this.b.u[a]};k.Gb=function(a,b){b&=7;this.b.N&2048?this.b.$a[b]=a:this.b.u[b]=a};k.Hd=function(){return this.b.N&49152?this.b.La[0]:this.b.u[6]};k.Ae=function(a){this.b.N&49152?this.b.La[0]=a:this.b.u[6]=a};k.Kd=function(){return this.b.u[7]};
|
||||
k.De=function(a){this.b.u[7]=a};k.Eb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.$a[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.$a[b]=a};k.Id=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.Be=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Jd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.Ce=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.rd=function(a){return this.b.Kc[a-65504>>1]};
|
||||
k.me=function(a,b){this.b.Kc[b-65504>>1]=a};k.Hc=function(a){if(65520==a){a=0;switch(Cc){case Cc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Oc=function(){};k.Yd=function(){return 1};k.Re=function(){};k.qd=function(){return this.b.na};k.le=function(){this.b.na=0};k.yd=function(){return this.b.Jc};k.te=function(a,b){b&1||(a&=255);this.b.Jc=a};k.Dd=function(a,b){return b?0:this.b.Rb};k.we=function(a){ad(this.b,a)};k.Xd=function(a,b){return b?0:this.b.hb&65280};k.Qe=function(a){this.b.hb=a|255};
|
||||
k.Gd=function(){return bd(this.b)};k.ze=function(a){cd(this.b,a&-1793|bd(this.b)&1792);this.b.J|=128};k.Nc=function(a,b){H(this)&&F(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)};
|
||||
var N={},Uc=(N[61568]=[null,null,L.prototype.ce,L.prototype.We,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Wd,L.prototype.Pe,"SIPDR",8,1145,256],N[62608]=[null,null,L.prototype.Ud,L.prototype.Ne,"SDPDR",8,1145,256],N[62624]=[null,null,L.prototype.Vd,L.prototype.Oe,"SIPAR",8,1145,256],N[62640]=[null,null,L.prototype.Td,L.prototype.Me,"SDPAR",8,1145,256],N[62656]=[null,null,L.prototype.wd,L.prototype.re,"KIPDR",8,1145,256],N[62672]=[null,null,L.prototype.ud,L.prototype.pe,"KDPDR",8,1145,256],
|
||||
N[62688]=[null,null,L.prototype.vd,L.prototype.qe,"KIPAR",8,1145,256],N[62704]=[null,null,L.prototype.td,L.prototype.oe,"KDPAR",8,1145,256],N[62798]=[null,null,L.prototype.Cd,L.prototype.ve,"MMR3",1,1145,256],N[65382]=[null,null,L.prototype.xd,L.prototype.se,"LKS"],N[65402]=[null,null,L.prototype.zd,L.prototype.ue,"MMR0",1,1145,256],N[65404]=[null,null,L.prototype.Ad,L.prototype.Nc,"MMR1",1,1145,256],N[65406]=[null,null,L.prototype.Bd,L.prototype.Nc,"MMR2",1,1145,256],N[65408]=[null,null,L.prototype.be,
|
||||
L.prototype.Ve,"UIPDR",8,1145,256],N[65424]=[null,null,L.prototype.$d,L.prototype.Te,"UDPDR",8,1145,256],N[65440]=[null,null,L.prototype.ae,L.prototype.Ue,"UIPAR",8,1145,256],N[65456]=[null,null,L.prototype.Zd,L.prototype.Se,"UDPAR",8,1145,256],N[65472]=[null,null,L.prototype.Db,L.prototype.Gb,"R0SET0"],N[65473]=[null,null,L.prototype.Db,L.prototype.Gb,"R1SET0"],N[65474]=[null,null,L.prototype.Db,L.prototype.Gb,"R2SET0"],N[65475]=[null,null,L.prototype.Db,L.prototype.Gb,"R3SET0"],N[65476]=[null,null,
|
||||
L.prototype.Db,L.prototype.Gb,"R4SET0"],N[65477]=[null,null,L.prototype.Db,L.prototype.Gb,"R5SET0"],N[65478]=[null,null,L.prototype.Hd,L.prototype.Ae,"R6KERNEL"],N[65479]=[null,null,L.prototype.Kd,L.prototype.De,"R7KERNEL"],N[65480]=[null,null,L.prototype.Eb,L.prototype.Hb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Eb,L.prototype.Hb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Eb,L.prototype.Hb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Eb,L.prototype.Hb,"R3SET1",1,1145],N[65484]=
|
||||
[null,null,L.prototype.Eb,L.prototype.Hb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Eb,L.prototype.Hb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.Id,L.prototype.Be,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.Jd,L.prototype.Ce,"R6USER",1,1145],N[65504]=[null,null,L.prototype.rd,L.prototype.me,"CTRL",8,1170],N[65520]=[null,null,L.prototype.Hc,L.prototype.Oc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.Hc,L.prototype.Oc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Yd,L.prototype.Re,
|
||||
"SYSID",1,1170],N[65526]=[null,null,L.prototype.qd,L.prototype.le,"CPUERR",1,1170],N[65528]=[null,null,L.prototype.yd,L.prototype.te,"MB",1,1170],N[65530]=[null,null,L.prototype.Dd,L.prototype.we,"PIR"],N[65532]=[null,null,L.prototype.Xd,L.prototype.Qe,"SL"],N[65534]=[null,null,L.prototype.Gd,L.prototype.ze,"PSW"],N);
|
||||
$a(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 dd(c);D(c,d);break;case "rl11":c=new O(c),D(c,d)}}});var ed;if(Ab){var fd=new ArrayBuffer(2);(new DataView(fd)).setUint16(0,256,!0);ed=256===(new Uint16Array(fd))[0]}else ed=!1;var gd=ed;
|
||||
function J(a,b,c,d,e,f){this.v=a;this.id=hd+=2;this.b=null;this.F=b;this.Tb=c;this.size=d||0;this.type=e||id;this.f=e==jd;this.controller=null;uc(this);this.Xa=this.Yc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],kd(this,f.Rc);else if(Ab)this.B=new ArrayBuffer(this.size),this.D=new DataView(this.B,0,this.size),this.G=new Uint8Array(this.B,0,this.size),this.I=new Uint16Array(this.B,0,this.size>>1),this.b=new Int32Array(this.B,0,this.size>>2),kd(this,gd?ld:md);else{a=this.b=Array(this.size>>
|
||||
2);for(f=0;f<a.length;f++)a[f]=0;kd(this,nd)}else kd(this)}var id=0,Cc=1,jd=2,Ac=4,Dc=["NONE","RAM","ROM","VID","H/W"],hd=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ab)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ab)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Wa=!0}return!1},nb:function(a,b){b?this.C++||od(this,pd,!1):this.g++||qd(this,pd,!1)},K:function(a,b){this.j&&F(this.j,128)&&E(this.j,
|
||||
"attempt to read invalid address "+J(this.j,b),!0);this.v.Ha(b,32,2);return 255},w:function(a,b,c){this.j&&F(this.j,128)&&E(this.j,"attempt to write "+J(this.j,b)+" to invalid addresses "+J(this.j,c),!0);this.v.Ha(c,32,4)},L:function(a,b){return this.$b(a++,b++)|this.$b(a,b)<<8},H:function(a,b,c){this.cc(a++,b&255,c++);this.cc(a,b>>8,c)},T:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Ha(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+
|
||||
1]&255)<<8},xa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Wa=!0},Ma:function(a,b,c){a&1&&this.v.Ha(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Wa=!0},O:function(a,b){if(this.j&&null!=this.F){var c=this.j;rd(c,this.F+a,1,c.M)&&c.da(!0)}return this.lc(a,b)},Ua:function(a,b){if(this.j&&null!=this.F){var c=this.j;rd(c,this.F+a,2,c.M)&&c.da(!0)}return this.mc(a,b)},bb:function(a,
|
||||
b,c){if(this.j&&null!=this.F){var d=this.j;rd(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.dc(a,b,c)},Ba:function(a,b,c){if(this.j&&null!=this.F){var d=this.j;rd(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.pc(a,b,c)},M:function(a){return this.G[a]},S:function(a,b){a=this.G[a];this.j&&F(this.j,128)&&E(this.j,"Memory.readByte("+J(this.j,b)+"): "+J(this.j,a),!0);return a},X:function(a,b){a&1&&this.v.Ha(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Ha(b,64,2);
|
||||
a=this.I[a>>1];this.j&&F(this.j,128)&&E(this.j,"Memory.readWord("+J(this.j,b)+"): "+J(this.j,a),!0);return a},ja:function(a,b){this.G[a]=b;this.Wa=!0},oa:function(a,b,c){this.G[a]=b;this.Wa=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0)},Aa:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.D.setUint16(a,b,!0);this.Wa=!0},Ea:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.I[a>>1]=b;this.Wa=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeWord("+J(this.j,c)+","+J(this.j,
|
||||
b)+")",!0)}};function uc(a,b,c){a.j=b;a.g=a.C=0;c&&((a.g=c.g)&&qd(a,pd,!1),(a.C=c.C)&&od(a,pd,!1))}function sd(a,b){b?--a.C||(a.cc=a.f?a.w:a.dc,a.Ub=a.f?a.H:a.pc):--a.g||(a.$b=a.lc,a.ua=a.mc)}function od(a,b,c){c&&a.C||(a.cc=!a.f&&b[1]||a.w,a.Ub=!a.f&&b[3]||a.H);if(c||void 0===c)a.dc=b[1]||a.w,a.pc=b[3]||a.H}function qd(a,b,c){c&&a.g||(a.$b=b[0]||a.K,a.ua=b[2]||a.L);if(c||void 0===c)a.lc=b[0]||a.K,a.mc=b[2]||a.L}function kd(a,b){b||(b=td);qd(a,b,void 0);od(a,b,void 0)}
|
||||
var td=[],nd=[I.prototype.T,I.prototype.xa,I.prototype.ca,I.prototype.Ma],pd=[I.prototype.O,I.prototype.bb,I.prototype.Ua,I.prototype.Ba];if(Ab)var md=[I.prototype.M,I.prototype.ja,I.prototype.X,I.prototype.Aa],ld=[I.prototype.S,I.prototype.oa,I.prototype.ba,I.prototype.Ea];
|
||||
function ud(a,b){t.call(this,"CPU",a,ud,1);b=a.cycles||b;var c=a.multiplier||1;this.xb=0;this.mb=b;this.gb=c;this.Ib=Math.round(this.mb/1E4)/100;this.pb=this.Ib*this.gb;this.A.W=!1;this.A.bc=!1;this.A.wb=a.autoStart;this.A.yb=!1;this.Ob=this.xa=0;this.Pb=a.csStart;this.Ab=a.csInterval;this.Bb=a.csStop;this.L=[];this.Fc=this.ee.bind(this);H(this)}z(ud);var vd=["power","reset"];k=ud.prototype;
|
||||
k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.j=d;this.w=a.w;for(b=0;b<vd.length;b++)(c=this.G[vd[b]])&&this.C.wa(null,vd[b],c);a=wd(a,"autoStart");null!=a&&(this.A.wb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
||||
k.Ka=function(a,b){if(!b){if(a&&this.restore){xd(this);if(!this.restore(a))return!1;yd(this)}else this.reset();this.j?(a=this.j,b=this.A.wb,a.kb=!0,a.i("Type ? for help with PDPjs Debugger commands"),zd(a),b||a.tb(),a.cb&&(b=a.cb,a.cb=null,Ad(a,b))):this.i("No debugger detected")}return!0};k.Ja=function(a){return a?this.save():!0};k.wb=function(){return this.A.wb||!this.j&&void 0===this.G.run?(this.ib(),!0):!1};k.vc=function(){return 0};
|
||||
function yd(a){void 0===a.Pb&&(a.Pb=0);void 0===a.Ab&&(a.Ab=-1);void 0===a.Bb&&(a.Bb=-1);a.A.yb=0<=a.Pb&&0<a.Ab;a.A.yb&&(a.Ob=0,a.xa=a.Pb-a.ja)}function Ub(a,b){if(a.A.yb){var c=!1;a.Ob=a.Ob+a.vc()|0;a.xa-=b;0>=a.xa&&(a.xa+=a.Ab,c=!0);0<=a.Bb&&a.Bb<=Bd(a)&&(a.Ab=a.Bb=-1,yd(a),a.da(),c=!0);c&&a.i(Bd(a)+" cycles: checksum="+p(a.Ob))}}
|
||||
k.wa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.A.ia)a=!0;else{var b=null,c,h=sb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.A.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.A.ia);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Xb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.W?d.da():d.ib())},
|
||||
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){Cd(d,d.gb<<1,!0)},c.textContent=this.pb.toFixed(2)+"Mhz",!0}return!1};k.sa=function(a){this.C&&this.C.sa(a)};function Tb(a,b,c){a.ja+=b;c&&(a.ca=a.b=a.I=0)}function Dd(a,b){var c=1;b&&1<a.gb&&a.oa&&(c=a.oa/a.Ib);a.Cc=Math.round(1E3/30);a.ob=Math.floor(a.mb/30*c);b||(a.Aa=a.ob);a.Jb=0}function Bd(a){return a.ja+a.X+a.ca-a.b}function xd(a){a.oa=0;a.Dc=0;a.ja=a.X=a.ca=a.b=a.I=0;yd(a);Cd(a,1)}
|
||||
function Cd(a,b,c){var d=!1;if(void 0!==b){.8>a.oa/a.pb?b=1:d=!0;a.gb=b;b=a.Ib*a.gb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.C&&a.C.tb()}Tb(a,a.X);a.X=0;a.T=Ba();a.ba=0;Dd(a);return d}function Ic(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Kc(a,b,c,d){0<=b&&b<a.L.length&&(d||0>a.L[b][0])&&(c=a.mb*a.gb/1E3*c|0,a.A.W&&(c+=Ed(a)),a.L[b][0]=c)}
|
||||
J.prototype={constructor:J,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ab)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ab)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Xa=!0}return!1},ob:function(a,b){b?this.C++||od(this,pd,!1):this.g++||qd(this,pd,!1)},K:function(a,b){this.j&&H(this.j,128)&&F(this.j,
|
||||
"attempt to read invalid address "+K(this.j,b),!0);this.v.Ha(b,32,2);return 255},w:function(a,b,c){this.j&&H(this.j,128)&&F(this.j,"attempt to write "+K(this.j,b)+" to invalid addresses "+K(this.j,c),!0);this.v.Ha(c,32,4)},L:function(a,b){return this.$b(a++,b++)|this.$b(a,b)<<8},H:function(a,b,c){this.cc(a++,b&255,c++);this.cc(a,b>>8,c)},T:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Ha(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+
|
||||
1]&255)<<8},xa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Xa=!0},Ma:function(a,b,c){a&1&&this.v.Ha(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Xa=!0},O:function(a,b){if(this.j&&null!=this.F){var c=this.j;rd(c,this.F+a,1,c.M)&&c.da(!0)}return this.mc(a,b)},Ua:function(a,b){if(this.j&&null!=this.F){var c=this.j;rd(c,this.F+a,2,c.M)&&c.da(!0)}return this.nc(a,b)},oa:function(a,
|
||||
b,c){if(this.j&&null!=this.F){var d=this.j;rd(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.dc(a,b,c)},Ba:function(a,b,c){if(this.j&&null!=this.F){var d=this.j;rd(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.w(a,b,c):this.qc(a,b,c)},M:function(a){return this.G[a]},S:function(a,b){a=this.G[a];this.j&&H(this.j,128)&&F(this.j,"Memory.readByte("+K(this.j,b)+"): "+K(this.j,a),!0);return a},X:function(a,b){a&1&&this.v.Ha(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Ha(b,64,2);
|
||||
a=this.I[a>>1];this.j&&H(this.j,128)&&F(this.j,"Memory.readWord("+K(this.j,b)+"): "+K(this.j,a),!0);return a},ja:function(a,b){this.G[a]=b;this.Xa=!0},bb:function(a,b,c){this.G[a]=b;this.Xa=!0;this.j&&H(this.j,128)&&F(this.j,"Memory.writeByte("+K(this.j,c)+","+K(this.j,b)+")",!0)},Aa:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.D.setUint16(a,b,!0);this.Xa=!0},Ca:function(a,b,c){a&1&&this.v.Ha(c,64,4);this.I[a>>1]=b;this.Xa=!0;this.j&&H(this.j,128)&&F(this.j,"Memory.writeWord("+K(this.j,c)+","+K(this.j,
|
||||
b)+")",!0)}};function uc(a,b,c){a.j=b;a.g=a.C=0;c&&((a.g=c.g)&&qd(a,pd,!1),(a.C=c.C)&&od(a,pd,!1))}function sd(a,b){b?--a.C||(a.cc=a.f?a.w:a.dc,a.Ub=a.f?a.H:a.qc):--a.g||(a.$b=a.mc,a.ua=a.nc)}function od(a,b,c){c&&a.C||(a.cc=!a.f&&b[1]||a.w,a.Ub=!a.f&&b[3]||a.H);if(c||void 0===c)a.dc=b[1]||a.w,a.qc=b[3]||a.H}function qd(a,b,c){c&&a.g||(a.$b=b[0]||a.K,a.ua=b[2]||a.L);if(c||void 0===c)a.mc=b[0]||a.K,a.nc=b[2]||a.L}function kd(a,b){b||(b=td);qd(a,b,void 0);od(a,b,void 0)}
|
||||
var td=[],nd=[J.prototype.T,J.prototype.xa,J.prototype.ca,J.prototype.Ma],pd=[J.prototype.O,J.prototype.oa,J.prototype.Ua,J.prototype.Ba];if(Ab)var md=[J.prototype.M,J.prototype.ja,J.prototype.X,J.prototype.Aa],ld=[J.prototype.S,J.prototype.bb,J.prototype.ba,J.prototype.Ca];
|
||||
function ud(a,b){w.call(this,"CPU",a,ud,1);b=a.cycles||b;var c=a.multiplier||1;this.zb=0;this.pb=b;this.gb=c;this.Jb=Math.round(this.pb/1E4)/100;this.rb=this.Jb*this.gb;this.A.W=!1;this.A.bc=!1;this.A.xb=a.autoStart;this.A.yb=!1;this.Ob=this.Aa=0;this.Pb=a.csStart;this.Ab=a.csInterval;this.Bb=a.csStop;this.L=[];this.Gc=this.ge.bind(this);I(this)}A(ud);var vd=["power","reset"];k=ud.prototype;
|
||||
k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.j=d;this.w=a.w;for(b=0;b<vd.length;b++)(c=this.G[vd[b]])&&this.C.wa(null,vd[b],c);a=wd(a,"autoStart");null!=a&&(this.A.xb="true"==a?!0:"false"==a?!1:!!a);I(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
||||
k.Ka=function(a,b){if(!b){if(a&&this.restore){xd(this);if(!this.restore(a))return!1;yd(this)}else this.reset();this.j?(a=this.j,b=this.A.xb,a.lb=!0,a.i("Type ? for help with PDPjs Debugger commands"),zd(a),b||a.ub(),a.Va&&(b=a.Va,a.Va=null,Ad(a,b))):this.i("No debugger detected")}return!0};k.Ja=function(a){return a?this.save():!0};k.xb=function(){return this.A.xb||!this.j&&void 0===this.G.run?(this.jb(),!0):!1};k.wc=function(){return 0};
|
||||
function yd(a){void 0===a.Pb&&(a.Pb=0);void 0===a.Ab&&(a.Ab=-1);void 0===a.Bb&&(a.Bb=-1);a.A.yb=0<=a.Pb&&0<a.Ab;a.A.yb&&(a.Ob=0,a.Aa=a.Pb-a.ja)}function Ub(a,b){if(a.A.yb){var c=!1;a.Ob=a.Ob+a.wc()|0;a.Aa-=b;0>=a.Aa&&(a.Aa+=a.Ab,c=!0);0<=a.Bb&&a.Bb<=Bd(a)&&(a.Ab=a.Bb=-1,yd(a),a.da(),c=!0);c&&a.i(Bd(a)+" cycles: checksum="+p(a.Ob))}}
|
||||
k.wa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.A.ia)a=!0;else{var b=null,c,h=sb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.A.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.A.ia);c++);c==h.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Xb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.W?d.da():d.jb())},
|
||||
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){Cd(d,d.gb<<1,!0)},c.textContent=this.rb.toFixed(2)+"Mhz",!0}return!1};k.sa=function(a){this.C&&this.C.sa(a)};function Tb(a,b,c){a.ja+=b;c&&(a.ca=a.b=a.I=0)}function Dd(a,b){var c=1;b&&1<a.gb&&a.xa&&(c=a.xa/a.Jb);a.Dc=Math.round(1E3/30);a.qb=Math.floor(a.pb/30*c);b||(a.Ba=a.qb);a.Kb=0}function Bd(a){return a.ja+a.X+a.ca-a.b}function xd(a){a.xa=0;a.Fc=0;a.ja=a.X=a.ca=a.b=a.I=0;yd(a);Cd(a,1)}
|
||||
function Cd(a,b,c){var d=!1;if(void 0!==b){.8>a.xa/a.rb?b=1:d=!0;a.gb=b;b=a.Jb*a.gb;if(a.rb!=b){a.rb=b;b=a.rb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.C&&a.C.ub()}Tb(a,a.X);a.X=0;a.T=Ba();a.ba=0;Dd(a);return d}function Ic(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Kc(a,b,c,d){0<=b&&b<a.L.length&&(d||0>a.L[b][0])&&(c=a.pb*a.gb/1E3*c|0,a.A.W&&(c+=Ed(a)),a.L[b][0]=c)}
|
||||
function Fd(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 Sb(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 Ed(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c}
|
||||
k.ee=function(){if(this.A.W){this.Jb>=this.mb&&Dd(this,!0);this.Ma=0;this.kb=Ba();if(this.ba){var a=this.kb-this.ba;a>this.Cc&&(this.T+=a,this.T>this.kb&&(this.T=this.kb))}try{do{var b=Fd(this,this.A.yb?1:this.ob);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=Ed(this,!0);this.Ma+=b;this.X+=b;Ub(this,b);Sb(this,b);this.Aa-=b;if(0>=this.Aa){this.Aa+=this.ob;15<=++this.Dc&&(this.sa(),this.Dc=0);break}}while(this.A.W)}catch(e){this.da();this.C&&this.C.stop(Ba(),Bd(this));zb(this,e.stack||e.message);
|
||||
return}if(this.A.W){a=setTimeout;b=this.Fc;this.ba=Ba();var c=this.Cc;this.Ma&&(c=Math.round(c*this.Ma/this.ob));var c=c-(this.ba-this.kb),d=this.ba-this.T;d&&(this.oa=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ja=0,Cd(this)));if(0>c||this.oa<this.pb)-1E3>c&&(this.T-=c),c=0;this.Jb+=this.Ma;this.ba+=c;a(b,c)}}};
|
||||
k.ib=function(a){if(yb(this))return!1;if(this.A.W)return this.i(this.toString()+" busy"),!1;Cd(this);this.A.W=!0;this.A.bc=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.tb(!0),this.C.start(this.T,Bd(this)));setTimeout(this.Fc,0);return!0};k.jb=function(){return 0};k.da=function(a){var b=!1;if(this.A.W){Ed(this);Tb(this,this.X);this.X=0;this.A.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),Bd(this));b=!0}this.A.complete=a;return b};
|
||||
function Gd(a){this.Ya=+a.model||1170;this.Ac=a.addrReset||0;ud.call(this,a,6666667);this.decode=1120==this.Ya?Hd.bind(this):Id.bind(this);Jd(this);this.K=0;this.O=null;this.A.complete=!1}z(Gd,ud);k=Gd.prototype;k.reset=function(){this.status("model "+this.Ya);this.A.W&&this.da();Jd(this);xd(this);this.A.error=!1;this.parent.reset.call(this)};
|
||||
function Jd(a){a.U=65536;a.V=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Ac];a.$a=[0,0,0,0,0,0];a.La=[0,0,0,0];a.B=0;a.lb=0;a.$c=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ha=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Sb=
|
||||
[0,0,0,0,0,0,0,0,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.Jc=[0,0,0,0,0,0,0,0];a.Ic=0;a.J=0;a.D=a.H=0;a.g=a.f=a.zb=0;a.Ba=-1;Rb(a)}function Rb(a){a.za=0;a.Kb=0;a.Lb=0;a.Ta=0;a.na=0;a.Rb=0;a.rb=255;a.M=0;a.cb=0;a.Ea=262143;a.Mb=0;a.qa=0;a.O=null;a.v&&Kd(a)}function Kd(a){a.M?(a.S=65536,a.yc=a.Ta&16?4186112:253952,a.aa=a.Yc,a.ua=a.be,a.Ub=a.Ue,wc(a.v,a.Ta&16?22:18)):(a.S=0,a.yc=57344,a.aa=a.Xc,a.ua=a.Hc,a.Ub=a.Oc,wc(a.v,16))}
|
||||
function Wc(a){var b=a.za;b&57344||(b=b&-3199|a.cb<<5|a.lb<<1);return b}function Xc(a,b){b&=-3073;if(a.za!=b){b&57344&&!(a.za&57344)&&(a.Kb=a.qa>>16&65535,a.Lb=a.qa&65535);a.za=b;a.cb=b>>5&3;a.lb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.M!=c&&(a.M=c,Kd(a))}}function Yc(a){a.za&57344||(a.Kb=a.qa>>16&65535);a=a.Kb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function Zc(a){a.za&57344||(a.Lb=a.qa&65535);return a.Lb}function $c(a,b){1170>a.Ya&&(b&=-49);a.Ta!=b&&(a.Ta=b,a.Ea=b&16?4194303:262143,Kd(a))}
|
||||
k.vc=function(){return 0};k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ja,this.gb]);a.set(2,Fc(this.v));return a.data()};k.restore=function(a){var b=a[1];this.ja=b[1];Cd(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 Ld(a){return a.U&65536?1:0}function Md(a){return a.V&32768?2:0}function Nd(a){return a.$&65535?0:4}function Od(a){return a.Z&32768?8:0}function Pd(a){var b=a.u[7];a.qa=b;var c=a.ua(b);a.u[7]=b+2&65535;return c}function Qd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function Q(a,b){a.u[7]=b&65535}function Tc(a,b){return{ge:a,Cb:b,next:null}}function Rd(a,b){var c=a.O;if(c==b)a.O=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}}
|
||||
k.ge=function(){if(this.A.W){this.Kb>=this.pb&&Dd(this,!0);this.Va=0;this.nb=Ba();if(this.ba){var a=this.nb-this.ba;a>this.Dc&&(this.T+=a,this.T>this.nb&&(this.T=this.nb))}try{do{var b=Fd(this,this.A.yb?1:this.qb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=Ed(this,!0);this.Va+=b;this.X+=b;Ub(this,b);Sb(this,b);this.Ba-=b;if(0>=this.Ba){this.Ba+=this.qb;15<=++this.Fc&&(this.sa(),this.Fc=0);break}}while(this.A.W)}catch(e){this.da();this.C&&this.C.stop(Ba(),Bd(this));zb(this,e.stack||e.message);
|
||||
return}if(this.A.W){a=setTimeout;b=this.Gc;this.ba=Ba();var c=this.Dc;this.Va&&(c=Math.round(c*this.Va/this.qb));var c=c-(this.ba-this.nb),d=this.ba-this.T;d&&(this.xa=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ja=0,Cd(this)));if(0>c||this.xa<this.rb)-1E3>c&&(this.T-=c),c=0;this.Kb+=this.Va;this.ba+=c;a(b,c)}}};
|
||||
k.jb=function(a){if(yb(this))return!1;if(this.A.W)return this.i(this.toString()+" busy"),!1;Cd(this);this.A.W=!0;this.A.bc=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ub(!0),this.C.start(this.T,Bd(this)));setTimeout(this.Gc,0);return!0};k.kb=function(){return 0};k.da=function(a){var b=!1;if(this.A.W){Ed(this);Tb(this,this.X);this.X=0;this.A.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),Bd(this));b=!0}this.A.complete=a;return b};
|
||||
function Gd(a){this.fb=+a.model||1170;this.Bc=a.addrReset||0;ud.call(this,a,6666667);1120==this.fb?(this.decode=Hd.bind(this),this.oa=this.Wc):(this.decode=Id.bind(this),this.oa=this.Vc);Jd(this);this.K=0;this.O=null;this.A.complete=!1}A(Gd,ud);k=Gd.prototype;k.reset=function(){this.status("model "+this.fb);this.A.W&&this.da();Jd(this);xd(this);this.A.error=!1;this.parent.reset.call(this)};
|
||||
function Jd(a){a.U=65536;a.V=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Bc];a.$a=[0,0,0,0,0,0];a.La=[0,0,0,0];a.B=0;a.lb=0;a.cd=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ha=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Sb=
|
||||
[0,0,0,0,0,0,0,0,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.Kc=[0,0,0,0,0,0,0,0];a.Jc=0;a.J=0;a.D=a.H=0;a.g=a.f=a.Ib=0;a.Ca=-1;Rb(a)}function Rb(a){a.za=0;a.Lb=0;a.lc=0;a.Ta=0;a.na=0;a.Rb=0;a.hb=255;a.M=0;a.mb=0;a.Ma=262143;a.Mb=0;a.qa=0;a.O=null;a.v&&Kd(a)}function Kd(a){a.M?(a.S=65536,a.Ac=a.Ta&16?4186112:253952,a.aa=a.ad,a.ua=a.de,a.Ub=a.Xe,wc(a.v,a.Ta&16?22:18)):(a.S=0,a.Ac=57344,a.aa=a.$c,a.ua=a.Ic,a.Ub=a.Pc,wc(a.v,16))}
|
||||
function Wc(a){var b=a.za;b&57344||(b=b&-3199|a.mb<<5|a.lb<<1);return b}function Xc(a,b){b&=-3073;if(a.za!=b){b&57344&&!(a.za&57344)&&(a.Lb=a.qa>>16&65535,a.lc=a.qa&65535);a.za=b;a.mb=b>>5&3;a.lb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.M!=c&&(a.M=c,Kd(a))}}function Yc(a){a.za&57344||(a.Lb=a.qa>>16&65535);a=a.Lb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function Zc(a){a.za&57344||(a.lc=a.qa&65535);return a.lc}function $c(a,b){1170>a.fb&&(b&=-49);a.Ta!=b&&(a.Ta=b,a.Ma=b&16?4194303:262143,Kd(a))}
|
||||
k.wc=function(){return 0};k.save=function(){var a=new Q(this);a.set(0,[]);a.set(1,[this.ja,this.gb]);a.set(2,Fc(this.v));return a.data()};k.restore=function(a){var b=a[1];this.ja=b[1];Cd(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)){u("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||
function Ld(a){return a.U&65536?1:0}function Md(a){return a.V&32768?2:0}function Nd(a){return a.$&65535?0:4}function Od(a){return a.Z&32768?8:0}function Pd(a){var b=a.u[7];a.qa=b;var c=a.ua(b);a.u[7]=b+2&65535;return c}function Qd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function R(a,b){a.u[7]=b&65535}function Lc(a,b){return{je:a,Cb:b,next:null}}function Rd(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 Jc(a,b){if(b!=a.O){var c=a.O;if(!c||c.Cb<=b.Cb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.Cb<=b.Cb){b.next=d;c.next=b;break}c=d}while(c)}}a.J|=1}function me(a){return a.J&64?(a.ra(168,64,-5),!0):a.J&32?(a.ra(4,32,-4),!0):a.J&16?(a.ra(12,16,-6),!0):!1}function bd(a){return a.N=a.N&63728|Od(a)|Nd(a)|Md(a)|Ld(a)}
|
||||
function cd(a,b){a.Z=b<<12;a.$=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.N)&2048)for(var c=a.$a.length;0<=--c;){var d=a.u[c];a.u[c]=a.$a[c];a.$a[c]=d}a.B=b>>14&3;c=a.N>>14&3;a.B!=c&&(a.La[c]=a.u[6],a.u[6]=a.La[a.B]);a.N=b;a.J|=2}function ad(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1)}a.Rb=b;a.J|=2}function R(a,b){a.J&128||(a.Z=a.$=b,a.V=0)}function ne(a,b,c){a.J&128||(a.Z=a.$=a.U=b,a.V=c||0)}function oe(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^b)&(d^b))}
|
||||
function pe(a,b){a.J&128||(a.Z=a.$=a.U=b,a.V=a.Z^a.U>>1)}function qe(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^d)&(d^b))}k.ra=function(a,b,c){if(!this.K){0>this.Ba?this.Ba=bd(this):this.B||(a=4,this.na|=4,this.u[6]=4,c=-3);this.qa=a|4143316992;this.B=0;var d=this.ua(a|this.S),e=this.ua(a+2&65535|this.S);cd(this,e&-12289|this.Ba>>2&12288);re(this,this.Ba);re(this,this.u[7]);Q(this,d);this.J&=~(b|18);this.J|=9;this.Ba=-1;this.md=a;this.ld=c;if(-3<=c)throw a;}};
|
||||
function se(a){var b=te(a),c=te(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);Q(a,b);cd(a,c);a.J&=-17}function Ec(a,b){var c=b>>13&31;31>c&&(b=a.Ta&32?a.Sb[c]+(b&8190)&4194302:b&-3932161);return b}
|
||||
function ue(a,b,c){var d,e,f;if(!(c&a.M))return f=b&65535,57344<=f&&(f|=a.yc),f;d=b>>13;a.Ta&a.$c[a.B]||(d&=7);e=a.P[a.B][d];f=(a.ha[a.B][d]<<6)+(b&8191)&a.Ea;if(a.K)return f;f&1&&!(c&1)&&(a.na|=64,a.ra(4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.B][d]=e;if(f!=(4194170&a.Ea)||a.B)a.cb=
|
||||
a.B,a.lb=d;g&&(g&57344&&(0<=a.Ba&&(g|=128),a.za&57344||(g|=a.za&4096|a.cb<<5|a.lb<<1,Xc(a,a.za&-61695|g&61694)),a.ra(168,64,-1)),a.za&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.za|=4096,a.za&512&&(a.J|=64)));return f}function ve(a,b){return a.v.Yb(b)}function te(a){var b=a.ua(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b}function re(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.qa=a.qa&65535|(a.qa&-65536)<<8|16121856;we(a,0,c);a.Ub(c,b)}
|
||||
function we(a,b,c){!a.B&&c<=a.rb&&(b||4<c)&&(1145<=a.Ya&&c<=a.rb-32?(a.na|=4,a.u[6]=4,a.ra(4,0,-3)):(a.na|=8,a.J|=32))}
|
||||
function xe(a,b,c,d){var e,f,g=d&8?0:a.S;switch(b){case 0:return a.ra(4,0,-2),0;case 1:return 6==c&&d&4&&we(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.ua(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.ua(e)|g;a.b-=8;break;case 6:return e=a.ua(Qd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ua(Qd(a,2)),e=e+
|
||||
a.u[c]&65535,e=a.ua(e|a.S)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.qa=a.qa&65535|(a.qa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&we(a,b,a.u[6]);return e}k.Zb=function(a){if(!this.M)return this.v.Zb(a);this.K++;a=ve(this,ue(this,a,3));this.K--;return a};k.Xa=function(a){if(!this.M)return this.v.Xa(a);this.K++;a=this.Hc(ue(this,a,2));this.K--;return a};k.sb=function(a,b){this.M?(this.K++,a=ue(this,a,5),a&1&&this.b--,this.v.Fb(a,b),this.K--):this.v.sb(a,b)};
|
||||
k.vb=function(a,b){this.M?(this.K++,this.Oc(ue(this,a,4),b),this.K--):this.v.vb(a,b)};k.Xc=function(a,b,c){return xe(this,a,b,c)};k.Yc=function(a,b,c){return ue(this,xe(this,a,b,c),c)};k.Hc=function(a){return this.v.pa(this.Mb=a)};k.be=function(a){return this.v.pa(this.Mb=ue(this,a,2))};k.Oc=function(a,b){this.v.ub(this.Mb=a,b&65535)};k.Ue=function(a,b){this.v.ub(this.Mb=ue(this,a,4),b)};
|
||||
function ye(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=xe(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.ua(d|c&a.S),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.La[a.N>>12&3];return c}function ze(a,b,c,d){a.qa=a.qa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=xe(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=ue(a,e|c&65536,4),a.B=a.N>>14&3,a.v.ub(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.La[a.N>>12&3]=d}
|
||||
function Ae(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?ve(a,a.aa(b,c,3)):-c-1}function Be(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.pa(a.aa(b,d,2)):c=-d-1;return c}function Ce(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return xe(a,b,c,8)}function De(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ve(a,a.aa(b,c,3)):a.u[c]&255}function Ee(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.pa(a.aa(b,c,2)):a.u[c]}
|
||||
function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.zb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,ve(a,e)),e&1&&a.b--,a.v.Fb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.ub(e,d.call(a,0>c?a.u[-c-1]:c,a.v.pa(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}
|
||||
function Fe(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Fb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function Ge(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.ub(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function U(a,b,c){c&&(Q(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
||||
k.jb=function(a){this.A.complete=!0;var b=this.j?He(this.j)?1:this.A.bc?-1:0:0,c=a?this.A.bc?0:1:-1;this.A.bc=!1;this.ca=this.b=a;do{if(b){if(Ie(this.j,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.Rb&224)>>5,f=this.O&&this.O.Cb>e?this.O:null;f&&(d=f.ge,e=f.Cb);e>(this.N&224)>>5?(this.J&4&&(Qd(this,2),this.J&=-5),this.ra(d,0,-9),e=!0):e=!1;e&&(f&&Rd(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&Ie(this.j,this.u[7],c)){this.da();
|
||||
break}if(0>c)break}if(this.J&112&&me(this)){if(b&&Ie(this.j,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Pd(this))}while(0<this.b);return this.A.complete?this.ca-this.b:void 0===this.A.complete?0:-1};$a(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Gd(d);B(d,c)}});function Je(a,b){var c=b+a;oe(this,c,a,b);return c&65535}function Ke(a,b){var c=b+a;oe(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function Le(a,b){a=b<<1;pe(this,a);return a&65535}function Me(a,b){a=b<<1;pe(this,a<<8);return a&255}function Ne(a,b){a=b&32768|b>>1|b<<16;pe(this,a);return a&65535}function Oe(a,b){a=b&128|b>>1|b<<8;pe(this,a<<8);return a&255}function Pe(a,b){a=b&~a;R(this,a);return a}function Qe(a,b){a=b&~a;R(this,a<<8);return a}function Re(a,b){a|=b;R(this,a);return a}function Se(a,b){a|=b;R(this,a<<8);return a}function Te(a,b){a=~b|65536;ne(this,a);return a&65535}
|
||||
function Ue(a,b){a=~b|256;ne(this,a<<8);return a&255}function Ve(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.V=b&(b^a));return a&65535}function We(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.V=b&(b^c));return a&255}function Xe(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.V=a&(b^a));return a&65535}function Ye(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.V=c&(b<<8^c));return a&255}function Ze(a,b){a=-b;ne(this,a,a&b&32768);return a&65535}
|
||||
function $e(a,b){a=-b;ne(this,a<<8,(a&b&128)<<8);return a&255}function af(a,b){a=b<<1|this.U>>16&1;pe(this,a);return a&65535}function bf(a,b){a=b<<1|this.U>>16&1;pe(this,a<<8);return a&255}function cf(a,b){a=(this.U&65536|b)>>1|b<<16;pe(this,a);return a&65535}function df(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;pe(this,a<<8);return a&255}function ef(a,b){var c=b-a;qe(this,c,a,b);return c&65535}function ff(a,b){var c=b-a;qe(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function gf(a,b){this.J&128||(this.Z=this.$=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function hf(a,b){a^=b;R(this,a);return a&65535}function jf(a){T(this,a,Be(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 kf(a){var b=Ee(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.U=c<<17-b,c>>=b;else if(b)if(16<b)this.V=c,c=0;else{this.U=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.Z=this.$=c;this.b-=(this.g?6:7)+b}
|
||||
function lf(a){var b=Ee(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.U=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.V=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function mf(a){U(this,a,!Ld(this))}function nf(a){U(this,a,Ld(this))}
|
||||
function of(a){T(this,a,Be(this,a),Pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function pf(a){S(this,a,Ae(this,a),Qe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function qf(a){T(this,a,Be(this,a),Re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function rf(a){S(this,a,Ae(this,a),Se);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function sf(a){var b=Be(this,a);a=Ee(this,a);R(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function tf(a){var b=Ae(this,a);a=De(this,a);R(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function uf(a){U(this,a,Nd(this))}function vf(a){U(this,a,!Od(this)==!Md(this))}function wf(a){U(this,a,!Nd(this)&&!Od(this)==!Md(this))}function xf(a){U(this,a,!Ld(this)&&!Nd(this))}
|
||||
function yf(a){U(this,a,Nd(this)||!Od(this)!=!Md(this))}function zf(a){U(this,a,Ld(this)||Nd(this))}function Af(a){U(this,a,!Od(this)!=!Md(this))}function Bf(a){U(this,a,Od(this))}function Cf(a){U(this,a,!Nd(this))}function Df(a){U(this,a,!Od(this))}function Ef(){this.ra(12,0,-8);this.b-=5}function Ff(a){U(this,a,!0)}function Gf(a){U(this,a,!Md(this))}function Hf(a){U(this,a,Md(this))}function V(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5}
|
||||
function If(a){var b=Be(this,a);a=Ee(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;qe(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Jf(a){var b=Ae(this,a);a=De(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);qe(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 Kf(a){var b=Ee(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.Z=d>>16):(this.V=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.V=32768,this.U=65536,this.b-=7}function Lf(){this.ra(24,0,-8);this.b-=25}
|
||||
function Mf(){this.N&49152?(this.na|=128,this.ra(4,0,-7)):(this.w&&1120==this.Ya&&this.w.setData(this.u[0],!0),this.j?Nf(this.j):this.da());this.b-=7}function Of(){this.ra(16,0,-8);this.b-=25}var Pf=[0,7,7,10,7,11,9,13];function Qf(a){this.I=this.b;Q(this,Ce(this,a));this.b=this.I-Pf[this.g]}var Rf=[0,14,14,17,14,18,16,20];function Sf(a){this.I=this.b;var b=Ce(this,a);a=a>>6&7;re(this,this.u[a]);this.u[a]=this.u[7];Q(this,b);this.b=this.I-Rf[this.g]}
|
||||
var Tf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Uf(a){var b=Be(this,a);this.I=this.b;R(this,Ge(this,a,b));this.b=this.I-Tf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Vf(a){var b=Ae(this,a);R(this,Fe(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 Wf=[7,13,13,17,14,18,17,21];
|
||||
function Xf(a){var b=Ee(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&128||(this.Z=b>>16,this.$=this.Z|b,this.V=0,this.U=-32768>b||32767<b?65536:0);this.b-=23}function Yf(){this.b-=5}function Zf(){this.N&49152||(this.v.reset(),Rb(this),this.w&&this.w.setData(this.u[0],!0));this.b-=667}function $f(a){if(a&8)W.call(this,a);else{var b=te(this);a&=7;7==a?Q(this,b):(Q(this,this.u[a]),this.u[a]=b);this.b-=9}}
|
||||
function ag(){se(this);this.b-=13}function bg(a){a&1&&(this.U=65536);a&2&&(this.V=32768);a&4&&(this.$=0);a&8&&(this.Z=32768);this.b-=5}function cg(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)Q(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function dg(a){T(this,a,Be(this,a),ef);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function eg(a){T(this,a,0,gf);this.b-=this.g?9:3+(7==this.f?2:0)}function fg(){this.ra(28,0,-8);this.b-=5}
|
||||
function gg(){this.w&&(this.w.nc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=4;Qd(this,-2);this.b-=3}function hg(a){T(this,a,this.u[a>>6&7],hf);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.j)b=this.j,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Nf(b)):b=!1;b||this.ra(8,0,-8)}function Hd(a){ig[a>>12].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)}function pg(a){qg[a&15].call(this,a)}
|
||||
function cd(a,b){a.Z=b<<12;a.$=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.N)&2048)for(var c=a.$a.length;0<=--c;){var d=a.u[c];a.u[c]=a.$a[c];a.$a[c]=d}a.B=b>>14&3;c=a.N>>14&3;a.B!=c&&(a.La[c]=a.u[6],a.u[6]=a.La[a.B]);a.N=b;a.J|=2}function ad(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1)}a.Rb=b;a.J|=2}function S(a,b){a.J&128||(a.Z=a.$=b,a.V=0)}function ne(a,b,c){a.J&128||(a.Z=a.$=a.U=b,a.V=c||0)}function oe(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^b)&(d^b))}
|
||||
function pe(a,b){a.J&128||(a.Z=a.$=a.U=b,a.V=a.Z^a.U>>1)}function qe(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^d)&(d^b))}k.ra=function(a,b,c){if(!this.K){0>this.Ca?this.Ca=bd(this):this.B||(a=4,this.na|=4,this.u[6]=4,c=-3);this.qa=a|4143316992;this.B=0;var d=this.ua(a|this.S),e=this.ua(a+2&65535|this.S);cd(this,e&-12289|this.Ca>>2&12288);re(this,this.Ca);re(this,this.u[7]);R(this,d);this.J&=~(b|18);this.J|=9;this.Ca=-1;this.he=a;this.od=c;if(-3<=c)throw a;}};
|
||||
function se(a){var b=te(a),c=te(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);R(a,b);cd(a,c);a.J&=-17}function Ec(a,b){var c=b>>13&31;31>c&&(b=a.Ta&32?a.Sb[c]+(b&8190)&4194302:b&-3932161);return b}
|
||||
function ue(a,b,c){var d,e,f;if(!(c&a.M))return f=b&65535,57344<=f&&(f|=a.Ac),f;d=b>>13;a.Ta&a.cd[a.B]||(d&=7);e=a.P[a.B][d];f=(a.ha[a.B][d]<<6)+(b&8191)&a.Ma;if(a.K)return f;f&1&&!(c&1)&&(a.na|=64,a.ra(4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.B][d]=e;if(f!=(4194170&a.Ma)||a.B)a.mb=
|
||||
a.B,a.lb=d;g&&(g&57344&&(0<=a.Ca&&(g|=128),a.za&57344||(g|=a.za&4096|a.mb<<5|a.lb<<1,Xc(a,a.za&-61695|g&61694)),a.ra(168,64,-1)),a.za&61440||!(f<(4191360&a.Ma)||f>(4194239&a.Ma))||(a.za|=4096,a.za&512&&(a.J|=64)));return f}function ve(a,b){return a.v.Yb(b)}function te(a){var b=a.ua(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b}function re(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.qa=a.qa&65535|(a.qa&-65536)<<8|16121856;a.oa(20,-2,c);a.Ub(c,b)}
|
||||
function we(a,b,c,d){var e,f,g=d&8?0:a.S;switch(b){case 0:return a.ra(4,0,-2),0;case 1:return 6==c&&a.oa(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.oa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.ua(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.oa(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.ua(e)|g;a.b-=8;break;case 6:return e=a.ua(Qd(a,2)),e=e+a.u[c]&65535,6==c&&a.oa(d,
|
||||
0,e),a.b-=6,e|g;case 7:return e=a.ua(Qd(a,2)),e=e+a.u[c]&65535,e=a.ua(e|a.S),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.qa=a.qa&65535|(a.qa&-65536)<<8|(f<<3&248|c)<<16;return e}k.Wc=function(a,b,c){!this.B&&0>=b&&c<=this.hb&&(this.J|=32)};k.Vc=function(a,b,c){!this.B&&a&4&&!(20==a&&4>=c)&&c<=this.hb&&(c<=this.hb-32?(this.na|=4,this.u[6]=4,this.ra(4,0,-3)):(this.na|=8,this.J|=32))};k.Zb=function(a){if(!this.M)return this.v.Zb(a);this.K++;a=ve(this,ue(this,a,3));this.K--;return a};
|
||||
k.Ya=function(a){if(!this.M)return this.v.Ya(a);this.K++;a=this.Ic(ue(this,a,2));this.K--;return a};k.tb=function(a,b){this.M?(this.K++,a=ue(this,a,5),a&1&&this.b--,this.v.Fb(a,b),this.K--):this.v.tb(a,b)};k.wb=function(a,b){this.M?(this.K++,this.Pc(ue(this,a,4),b),this.K--):this.v.wb(a,b)};k.$c=function(a,b,c){return we(this,a,b,c)};k.ad=function(a,b,c){return ue(this,we(this,a,b,c),c)};k.Ic=function(a){return this.v.pa(this.Mb=a)};k.de=function(a){return this.v.pa(this.Mb=ue(this,a,2))};
|
||||
k.Pc=function(a,b){this.v.vb(this.Mb=a,b&65535)};k.Xe=function(a,b){this.v.vb(this.Mb=ue(this,a,4),b)};function xe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=we(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.ua(d|c&a.S),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.La[a.N>>12&3];return c}
|
||||
function ye(a,b,c,d){a.qa=a.qa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=we(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=ue(a,e|c&65536,4),a.B=a.N>>14&3,a.v.vb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.La[a.N>>12&3]=d}function ze(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?ve(a,a.aa(b,c,3)):-c-1}function Ae(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.pa(a.aa(b,d,2)):c=-d-1;return c}function Be(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return we(a,b,c,8)}
|
||||
function Ce(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ve(a,a.aa(b,c,3)):a.u[c]&255}function De(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.pa(a.aa(b,c,2)):a.u[c]}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Ib=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,ve(a,e)),e&1&&a.b--,a.v.Fb(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 U(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.vb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.pa(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}function Ee(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.Fb(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 Fe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.vb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}
|
||||
function V(a,b,c){c&&(R(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
||||
k.kb=function(a){this.A.complete=!0;var b=this.j?Ge(this.j)?1:this.A.bc?-1:0:0,c=a?this.A.bc?0:1:-1;this.A.bc=!1;this.ca=this.b=a;do{if(b){if(He(this.j,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.Rb&224)>>5,f=this.O&&this.O.Cb>e?this.O:null;f&&(d=f.je,e=f.Cb);e>(this.N&224)>>5?(this.J&4&&(Qd(this,2),this.J&=-5),this.ra(d,0,-9),e=!0):e=!1;e&&(f&&Rd(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&He(this.j,this.u[7],c)){this.da();
|
||||
break}if(0>c)break}if(this.J&112&&me(this)){if(b&&He(this.j,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Pd(this))}while(0<this.b);return this.A.complete?this.ca-this.b:void 0===this.A.complete?0:-1};$a(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Gd(d);D(d,c)}});function Ie(a,b){var c=b+a;oe(this,c,a,b);return c&65535}function Je(a,b){var c=b+a;oe(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function Ke(a,b){a=b<<1;pe(this,a);return a&65535}function Le(a,b){a=b<<1;pe(this,a<<8);return a&255}function Me(a,b){a=b&32768|b>>1|b<<16;pe(this,a);return a&65535}function Ne(a,b){a=b&128|b>>1|b<<8;pe(this,a<<8);return a&255}function Oe(a,b){a=b&~a;S(this,a);return a}function Pe(a,b){a=b&~a;S(this,a<<8);return a}function Qe(a,b){a|=b;S(this,a);return a}function Re(a,b){a|=b;S(this,a<<8);return a}function Se(a,b){a=~b|65536;ne(this,a);return a&65535}
|
||||
function Te(a,b){a=~b|256;ne(this,a<<8);return a&255}function Ue(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.V=b&(b^a));return a&65535}function Ve(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.V=b&(b^c));return a&255}function We(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.V=a&(b^a));return a&65535}function Xe(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.V=c&(b<<8^c));return a&255}function Ye(a,b){a=-b;ne(this,a,a&b&32768);return a&65535}
|
||||
function Ze(a,b){a=-b;ne(this,a<<8,(a&b&128)<<8);return a&255}function $e(a,b){a=b<<1|this.U>>16&1;pe(this,a);return a&65535}function af(a,b){a=b<<1|this.U>>16&1;pe(this,a<<8);return a&255}function bf(a,b){a=(this.U&65536|b)>>1|b<<16;pe(this,a);return a&65535}function cf(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;pe(this,a<<8);return a&255}function df(a,b){var c=b-a;qe(this,c,a,b);return c&65535}function ef(a,b){var c=b-a;qe(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function ff(a,b){this.J&128||(this.Z=this.$=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function gf(a,b){a^=b;S(this,a);return a&65535}function hf(a){U(this,a,Ae(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 jf(a){var b=De(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.U=c<<17-b,c>>=b;else if(b)if(16<b)this.V=c,c=0;else{this.U=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.Z=this.$=c;this.b-=(this.g?6:7)+b}
|
||||
function kf(a){var b=De(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.U=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.V=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function lf(a){V(this,a,!Ld(this))}function mf(a){V(this,a,Ld(this))}
|
||||
function nf(a){U(this,a,Ae(this,a),Oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function of(a){T(this,a,ze(this,a),Pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function pf(a){U(this,a,Ae(this,a),Qe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function qf(a){T(this,a,ze(this,a),Re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function rf(a){var b=Ae(this,a);a=De(this,a);S(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 sf(a){var b=ze(this,a);a=Ce(this,a);S(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 tf(a){V(this,a,Nd(this))}function uf(a){V(this,a,!Od(this)==!Md(this))}function vf(a){V(this,a,!Nd(this)&&!Od(this)==!Md(this))}function wf(a){V(this,a,!Ld(this)&&!Nd(this))}
|
||||
function xf(a){V(this,a,Nd(this)||!Od(this)!=!Md(this))}function yf(a){V(this,a,Ld(this)||Nd(this))}function zf(a){V(this,a,!Od(this)!=!Md(this))}function Af(a){V(this,a,Od(this))}function Bf(a){V(this,a,!Nd(this))}function Cf(a){V(this,a,!Od(this))}function Df(){this.ra(12,0,-8);this.b-=5}function Ef(a){V(this,a,!0)}function Ff(a){V(this,a,!Md(this))}function Gf(a){V(this,a,Md(this))}function Hf(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5}
|
||||
function If(a){var b=Ae(this,a);a=De(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;qe(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Jf(a){var b=ze(this,a);a=Ce(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);qe(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 Kf(a){var b=De(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.Z=d>>16):(this.V=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.V=32768,this.U=65536,this.b-=7}function Lf(){this.ra(24,0,-8);this.b-=25}
|
||||
function Mf(){this.N&49152?(this.na|=128,this.ra(4,0,-7)):(this.w&&1120==this.fb&&this.w.setData(this.u[0],!0),this.j?Nf(this.j):this.da());this.b-=7}function Of(){this.ra(16,0,-8);this.b-=25}var Pf=[0,7,7,10,7,11,9,13];function Qf(a){this.I=this.b;R(this,Be(this,a));this.b=this.I-Pf[this.g]}var Rf=[0,14,14,17,14,18,16,20];function Sf(a){this.I=this.b;var b=Be(this,a);a=a>>6&7;re(this,this.u[a]);this.u[a]=this.u[7];R(this,b);this.b=this.I-Rf[this.g]}
|
||||
var Tf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Uf(a){var b=Ae(this,a);this.I=this.b;S(this,Fe(this,a,b));this.b=this.I-Tf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Vf(a){var b=ze(this,a);S(this,Ee(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 Wf=[7,13,13,17,14,18,17,21];
|
||||
function Xf(a){var b=De(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&128||(this.Z=b>>16,this.$=this.Z|b,this.V=0,this.U=-32768>b||32767<b?65536:0);this.b-=23}function Yf(){this.b-=5}function Zf(){this.N&49152||(this.v.reset(),Rb(this),this.w&&this.w.setData(this.u[0],!0));this.b-=667}function $f(a){if(a&8)W.call(this,a);else{var b=te(this);a&=7;7==a?R(this,b):(R(this,this.u[a]),this.u[a]=b);this.b-=9}}
|
||||
function ag(){se(this);this.b-=13}function bg(a){a&1&&(this.U=65536);a&2&&(this.V=32768);a&4&&(this.$=0);a&8&&(this.Z=32768);this.b-=5}function cg(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)R(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function dg(a){U(this,a,Ae(this,a),df);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function eg(a){U(this,a,0,ff);this.b-=this.g?9:3+(7==this.f?2:0)}function fg(){this.ra(28,0,-8);this.b-=5}
|
||||
function gg(){this.w&&(this.w.oc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=4;Qd(this,-2);this.b-=3}function hg(a){U(this,a,this.u[a>>6&7],gf);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.j)b=this.j,H(b,1)?(F(b,"undefined opcode "+K(b,a),!0,!0),b=Nf(b)):b=!1;b||this.ra(8,0,-8)}function Hd(a){ig[a>>12].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)}function pg(a){qg[a&15].call(this,a)}
|
||||
function rg(a){sg[a&15].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)}function vg(a){wg[a>>6&3].call(this,a)}function xg(a){yg[a>>6&3].call(this,a)}
|
||||
var ig=[function(a){zg[a>>8&15].call(this,a)},Uf,If,sf,of,qf,jf,W,function(a){Ag[a>>8&15].call(this,a)},Vf,Jf,tf,pf,rf,dg,W],zg=[function(a){Bg[a>>4&15].call(this,a)},Ff,Cf,uf,vf,Af,wf,yf,Sf,Sf,jg,lg,ng,W,W,W],kg=[function(a){ne(this,Ge(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Ve);this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){T(this,a,0,
|
||||
Ze);this.b-=this.g?11:6},function(a){T(this,a,Ld(this)?1:0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,Ld(this)?1:0,ef);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ee(this,a);ne(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],og=[function(a){T(this,a,0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,af);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
||||
Bg=[function(a){Cg[a&15].call(this,a)},W,W,W,Qf,Qf,Qf,Qf,$f,W,pg,rg,eg,eg,eg,eg],Cg=[Mf,gg,ag,Ef,Of,Zf,W,W,W,W,W,W,W,W,W,W],qg=[Yf,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},V,function(){this.$=1;this.b-=5},V,V,V,function(){this.Z=0;this.b-=5},V,V,V,V,V,V,V],sg=[Yf,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},bg,function(){this.$=0;this.b-=5},bg,bg,bg,function(){this.Z=32768;this.b-=5},bg,bg,bg,bg,bg,bg,bg],Ag=[Df,Bf,xf,zf,Gf,Hf,mf,nf,Lf,fg,tg,vg,xg,W,W,
|
||||
W],ug=[function(a){ne(this,Fe(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,We);this.b-=this.g?9:3+(7==this.f?2:0)}],wg=[function(a){S(this,a,0,$e);this.b-=this.g?11:6},function(a){S(this,a,Ld(this)?1:0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Ld(this)?1:0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=De(this,a);ne(this,
|
||||
a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],yg=[function(a){S(this,a,0,df);this.b-=this.g?9+(this.zb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Oe);this.b-=this.g?9+(this.zb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Me);this.b-=this.g?9:3+(7==this.f?2:0)}];function Id(a){Dg[a>>12].call(this,a)}
|
||||
var Dg=[function(a){Eg[a>>8&15].call(this,a)},Uf,If,sf,of,qf,jf,function(a){Fg[a>>8&15].call(this,a)},function(a){Gg[a>>8&15].call(this,a)},Vf,Jf,tf,pf,rf,dg,W],Eg=[function(a){Hg[a>>4&15].call(this,a)},Ff,Cf,uf,vf,Af,wf,yf,Sf,Sf,jg,lg,ng,function(a){Ig[a>>6&3].call(this,a)},W,W],Ig=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ua(a|this.S);Q(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ye(this,a,0);re(this,a);R(this,a);this.b-=11},function(a){var b=te(this);this.I=
|
||||
this.b;ze(this,a,0,b);R(this,b);this.b=this.I-Wf[this.g]},function(a){R(this,Ge(this,a,Od(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Hg=[function(a){Jg[a&15].call(this,a)},W,W,W,Qf,Qf,Qf,Qf,$f,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):W.call(this,a)},pg,rg,eg,eg,eg,eg],Jg=[Mf,gg,function(){se(this);this.J|=this.N&16;this.b-=13},Ef,Of,Zf,ag,function(){this.ra(8,0,-8)},W,W,W,W,W,W,W,W],Fg=[Xf,Xf,Kf,Kf,kf,kf,lf,lf,hg,hg,W,W,W,W,cg,cg],Gg=[Df,Bf,xf,zf,
|
||||
Gf,Hf,mf,nf,Lf,fg,tg,vg,xg,function(a){Kg[a>>6&3].call(this,a)},W,W],Kg=[W,function(a){a=ye(this,a,65536);re(this,a);R(this,a);this.b-=11},function(a){var b=te(this);this.I=this.b;ze(this,a,65536,b);R(this,b);this.b=this.I-Wf[this.g]},W];
|
||||
function Lg(a){t.call(this,"ROM",a,Lg,512);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.w=a.alias;this.C=a.file;this.H=sa(this.C);if(this.C){a=this.C;var b=ta(this.H);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.R("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(rb(c.Ua,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);eh(c)})}}z(Lg);k=Lg.prototype;
|
||||
var ig=[function(a){zg[a>>8&15].call(this,a)},Uf,If,rf,nf,pf,hf,W,function(a){Ag[a>>8&15].call(this,a)},Vf,Jf,sf,of,qf,dg,W],zg=[function(a){Bg[a>>4&15].call(this,a)},Ef,Bf,tf,uf,zf,vf,xf,Sf,Sf,jg,lg,ng,W,W,W],kg=[function(a){ne(this,Fe(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Ue);this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){U(this,a,0,
|
||||
Ye);this.b-=this.g?11:6},function(a){U(this,a,Ld(this)?1:0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,Ld(this)?1:0,df);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=De(this,a);ne(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],og=[function(a){U(this,a,0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
||||
Bg=[function(a){Cg[a&15].call(this,a)},W,W,W,Qf,Qf,Qf,Qf,$f,W,pg,rg,eg,eg,eg,eg],Cg=[Mf,gg,ag,Df,Of,Zf,W,W,W,W,W,W,W,W,W,W],qg=[Yf,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},Hf,function(){this.$=1;this.b-=5},Hf,Hf,Hf,function(){this.Z=0;this.b-=5},Hf,Hf,Hf,Hf,Hf,Hf,Hf],sg=[Yf,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},bg,function(){this.$=0;this.b-=5},bg,bg,bg,function(){this.Z=32768;this.b-=5},bg,bg,bg,bg,bg,bg,bg],Ag=[Cf,Af,wf,yf,Ff,Gf,lf,mf,Lf,fg,tg,
|
||||
vg,xg,W,W,W],ug=[function(a){ne(this,Ee(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Ve);this.b-=this.g?9:3+(7==this.f?2:0)}],wg=[function(a){T(this,a,0,Ze);this.b-=this.g?11:6},function(a){T(this,a,Ld(this)?1:0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,Ld(this)?1:0,ef);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ce(this,
|
||||
a);ne(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],yg=[function(a){T(this,a,0,cf);this.b-=this.g?9+(this.Ib&1):3+(7==this.f?2:0)},function(a){T(this,a,0,af);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ne);this.b-=this.g?9+(this.Ib&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)}];function Id(a){Dg[a>>12].call(this,a)}
|
||||
var Dg=[function(a){Eg[a>>8&15].call(this,a)},Uf,If,rf,nf,pf,hf,function(a){Fg[a>>8&15].call(this,a)},function(a){Gg[a>>8&15].call(this,a)},Vf,Jf,sf,of,qf,dg,W],Eg=[function(a){Hg[a>>4&15].call(this,a)},Ef,Bf,tf,uf,zf,vf,xf,Sf,Sf,jg,lg,ng,function(a){Ig[a>>6&3].call(this,a)},W,W],Ig=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ua(a|this.S);R(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=xe(this,a,0);re(this,a);S(this,a);this.b-=11},function(a){var b=te(this);this.I=
|
||||
this.b;ye(this,a,0,b);S(this,b);this.b=this.I-Wf[this.g]},function(a){S(this,Fe(this,a,Od(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Hg=[function(a){Jg[a&15].call(this,a)},W,W,W,Qf,Qf,Qf,Qf,$f,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):W.call(this,a)},pg,rg,eg,eg,eg,eg],Jg=[Mf,gg,function(){se(this);this.J|=this.N&16;this.b-=13},Df,Of,Zf,ag,function(){this.ra(8,0,-8)},W,W,W,W,W,W,W,W],Fg=[Xf,Xf,Kf,Kf,jf,jf,kf,kf,hg,hg,W,W,W,W,cg,cg],Gg=[Cf,Af,wf,yf,
|
||||
Ff,Gf,lf,mf,Lf,fg,tg,vg,xg,function(a){Kg[a>>6&3].call(this,a)},W,W],Kg=[W,function(a){a=xe(this,a,65536);re(this,a);S(this,a);this.b-=11},function(a){var b=te(this);this.I=this.b;ye(this,a,65536,b);S(this,b);this.b=this.I-Wf[this.g]},W];
|
||||
function Lg(a){w.call(this,"ROM",a,Lg,512);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.w=a.alias;this.C=a.file;this.H=oa(this.C);if(this.C){a=this.C;var b=ta(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.R("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(kb(c.Ua,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);eh(c)})}}A(Lg);k=Lg.prototype;
|
||||
k.Ia=function(a,b,c,d){this.v=b;this.b=c;this.j=d;eh(this)};k.Ka=function(){this.ga&&(this.j&&fh(this.j,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ja=function(){return!0};
|
||||
function eh(a){if(!xb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)zb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+pc){var c={};b=(c[b]=[Lg.prototype.Qd,Lg.prototype.Ie,null,null,null,a.f>>1],c);if(Ib(a.v,a,b)){b=a.D=!0;break a}}else if(zc(a.v,b,a.f,jd)){for(c=0;c<a.g.length;c++)a.v.sb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.w?b.push(a.w):
|
||||
null!=a.w&&a.w.length&&(b=a.w);for(c=0;c<b.length;c++){var d=a,e=b[c],f=yc(d.v,d.B,d.f);xc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Qd=function(a){return this.g[a-this.B]};k.Ie=function(){};$a(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Lg(d);B(d,c)}});
|
||||
function gh(a){t.call(this,"RAM",a,gh);this.ga=this.g=null;this.C=a.addr;this.B=a.size;this.Oa=a.load;this.Na=a.exec;this.w=!1;this.f=a.file;this.D=sa(this.f);if(this.f){a=this.f;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.R("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(rb(c.Ua,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga,null==c.Oa&&(c.Oa=a.Oa),null==c.Na&&(c.Na=a.Na)):c.f=null);hh(c)})}}
|
||||
z(gh);gh.prototype.Ia=function(a,b,c,d){this.v=b;this.b=c;this.j=d;hh(this)};gh.prototype.Ka=function(){this.ga&&(this.j&&fh(this.j,this.id,this.C,this.B,this.ga),delete this.ga);return!0};gh.prototype.Ja=function(){return!0};function hh(a){if(a.v&&(!a.w&&a.B&&zc(a.v,a.C,a.B,Cc)&&(a.w=!0),!xb(a))){if(!a.w)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;ih(a,a.g,a.Oa,a.Na,a.C)}H(a)}}
|
||||
gh.prototype.reset=function(){if(this.w){for(var a=this.v,b=this.C,c=this.B,d=b&a.v,b=b>>>a.ka;0<c&&b<a.Y.length;){var e=a.Y[b];if(e.controller&&a.g&&a.g.length==a.w.length){var f=a.g.indexOf(e);0<=f&&(e=a.w[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Ab&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.dc(d,g,e.F+d)}c-=a.Ca;b++;d=0}this.g&&ih(this,this.g,this.Oa,this.Na,this.C,!0)}};
|
||||
function ih(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.sb(n++,b[v++]&255);else n&1?a.b.da():null==d&&
|
||||
(d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.b.sb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.Ac=d,a.v.reset(),Rb(a),Q(a,d),cd(a,0),!f&&a.j&&(a.da()||zd(a.j)));return g}$a(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new gh(d);B(d,c)}});function jh(a){t.call(this,"Keyboard",a,jh,65536);H(this)}z(jh);jh.prototype.wa=function(){return!1};
|
||||
jh.prototype.Ia=function(a,b,c,d){this.C=a;this.b=c;this.j=d};$a(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new jh(d);B(d,c)}});
|
||||
function X(a){this.O=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.ba=a.upperCase;this.w=this.D=null;this.T=a.tabSize;this.S=a.charBOL;this.H=0;t.call(this,"SerialPort",a,X,16777216);var b=a.binding;if("console"==b)this.D="";else{var c;a=kh;b&&(void 0===c&&(c="Panel"),(c=ub(c,this.id))&&(b=c.G[b])&&this.wa(null,a,b))}this.I=this.L=null;this.exports={connect:this.zc,receiveData:this.ac}}z(X);var kh="buffer";k=X.prototype;
|
||||
function eh(a){if(!xb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)zb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+pc){var c={};b=(c[b]=[Lg.prototype.Sd,Lg.prototype.Le,null,null,null,a.f>>1],c);if(Ib(a.v,a,b)){b=a.D=!0;break a}}else if(zc(a.v,b,a.f,jd)){for(c=0;c<a.g.length;c++)a.v.tb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.w?b.push(a.w):
|
||||
null!=a.w&&a.w.length&&(b=a.w);for(c=0;c<b.length;c++){var d=a,e=b[c],f=yc(d.v,d.B,d.f);xc(d.v,e,d.f,f)}a.D||delete a.g}}}I(a)}}k.Sd=function(a){return this.g[a-this.B]};k.Le=function(){};$a(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Lg(d);D(d,c)}});
|
||||
function gh(a){w.call(this,"RAM",a,gh);this.ga=this.g=null;this.C=a.addr;this.B=a.size;this.Oa=a.load;this.Na=a.exec;this.w=!1;this.f=a.file;this.D=oa(this.f);if(this.f){a=this.f;var b=ta(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.R("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(kb(c.Ua,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga,null==c.Oa&&(c.Oa=a.Oa),null==c.Na&&(c.Na=a.Na)):c.f=null);hh(c)})}}
|
||||
A(gh);gh.prototype.Ia=function(a,b,c,d){this.v=b;this.b=c;this.j=d;hh(this)};gh.prototype.Ka=function(){this.ga&&(this.j&&fh(this.j,this.id,this.C,this.B,this.ga),delete this.ga);return!0};gh.prototype.Ja=function(){return!0};function hh(a){if(a.v&&(!a.w&&a.B&&zc(a.v,a.C,a.B,Cc)&&(a.w=!0),!xb(a))){if(!a.w)u("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;ih(a,a.g,a.Oa,a.Na,a.C)}I(a)}}
|
||||
gh.prototype.reset=function(){if(this.w){for(var a=this.v,b=this.C,c=this.B,d=b&a.v,b=b>>>a.ka;0<c&&b<a.Y.length;){var e=a.Y[b];if(e.controller&&a.g&&a.g.length==a.w.length){var f=a.g.indexOf(e);0<=f&&(e=a.w[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Ab&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.dc(d,g,e.F+d)}c-=a.Da;b++;d=0}this.g&&ih(this,this.g,this.Oa,this.Na,this.C,!0)}};
|
||||
function ih(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){var m=h;if(1!=l){F(a,"invalid signature ("+q(l)+") at offset "+q(m),1048576);break}if(h+6>=b.length){F(a,"invalid block at offset "+q(m),1048576);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),t=h,v=n-=6;0<n&&h<b.length;)l+=b[h++]&255,n--;if(n||h>=b.length){F(a,"insufficient data for block at offset "+q(m),1048576);
|
||||
break}l+=b[h++]&255;if(l&255){F(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),1048576);break}if(v)for(F(a,"loading "+q(v)+" bytes at "+q(r)+"-"+q(r+v-1),1048576);v--;)a.b.tb(r++,b[t++]&255);else r&1?a.b.da():null==d&&(d=r),null!=d&&F(a,"starting address: "+q(d),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.b.tb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.Bc=d,a.v.reset(),Rb(a),R(a,d),cd(a,0),!f&&a.j&&(a.da()||zd(a.j)));return g}
|
||||
$a(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new gh(d);D(d,c)}});function jh(a){w.call(this,"Keyboard",a,jh,65536);I(this)}A(jh);jh.prototype.wa=function(){return!1};jh.prototype.Ia=function(a,b,c,d){this.C=a;this.b=c;this.j=d};$a(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new jh(d);D(d,c)}});
|
||||
function X(a){this.O=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.ba=a.upperCase;this.w=this.D=null;this.T=a.tabSize;this.S=a.charBOL;this.H=0;w.call(this,"SerialPort",a,X,16777216);var b=a.binding;if("console"==b)this.D="";else{var c;a=kh;b&&(void 0===c&&(c="Panel"),(c=ub(c,this.id))&&(b=c.G[b])&&this.wa(null,a,b))}this.I=this.L=null;this.exports={connect:this.zc,receiveData:this.ac}}A(X);var kh="buffer";k=X.prototype;
|
||||
k.wa=function(a,b,c){var d=this;switch(b){case kh:return this.G[b]=this.w=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.ac(b);return!0},c.onkeypress=function(a){a=a||window.event;d.ac(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ac(a.getData("Text"))},
|
||||
c.removeAttribute("readonly"),!0}return!1};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.j=d;var e=this;this.oa=Tc(48,4);this.X=Ic(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&&Jc(e.b,e.oa))});this.M=Tc(52,4);this.ja=Ic(this.b,function(){e.g|=128;e.g&64&&Jc(e.b,e.M)});Ib(b,this,lh);Kb(b,this.reset.bind(this));H(this)};
|
||||
c.removeAttribute("readonly"),!0}return!1};k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.j=d;var e=this;this.oa=Lc(48,4);this.X=Ic(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&&Jc(e.b,e.oa))});this.M=Lc(52,4);this.ja=Ic(this.b,function(){e.g|=128;e.g&64&&Jc(e.b,e.M)});Ib(b,this,lh);Kb(b,this.reset.bind(this));I(this)};
|
||||
k.zc=function(){if(!this.I){var a=wd(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.bb)return;b=ya(b[1]);if(this.I=tb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
k.Ja=function(a){return a?this.save():!0};k.reset=function(){mh(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return mh(this)};function mh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.ac=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.B.push(b)}else this.B=this.B.concat(a);Kc(this.b,this.X,1E3/Math.round(this.O/10));return!0};
|
||||
k.Kd=function(){return this.f&65534};k.Ce=function(a){this.f=this.f&-112|a&111};k.Jd=function(){this.f&=-129;0<this.B.length&&Kc(this.b,this.X,1E3/Math.round(this.O/10));return this.K};k.Be=function(){};k.de=function(){return this.g};k.We=function(a){this.g&128&&(a&64?Jc(this.b,this.M):Rd(this.b,this.M));this.g=this.g&-70|a&69};k.ce=function(){return 0};
|
||||
k.Ve=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);a&=127;if(this.w)if(13==a)this.H=0;else if(8==a)this.w.value=this.w.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=za[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=xa("",c)));this.S&&!this.H&&c&&(b=String.fromCharCode(this.S)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.i(this.D),
|
||||
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Kc(this.b,this.ja,1E3/Math.round(this.ca/10))}};var nh={},lh=(nh[65392]=[null,null,X.prototype.Kd,X.prototype.Ce,"RCSR"],nh[65394]=[null,null,X.prototype.Jd,X.prototype.Be,"RBUF"],nh[65396]=[null,null,X.prototype.de,X.prototype.We,"XCSR"],nh[65398]=[null,null,X.prototype.ce,X.prototype.Ve,"XBUF"],nh);$a(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new X(d);B(d,c)}});
|
||||
function dd(a){t.call(this,"PC11",a,dd);this.g=a.autoMount||null;this.D=0;this.ba=a.baudReceive||3600;this.K=this.L=this.f=0;this.I=[];this.H=oh;this.w=ph;this.M=this.B="";this.ea=this.Oa=this.Na=null;this.S=-1;this.O=!Na("Mobi")&&window&&"FileReader"in window}z(dd);var oh="",ph=0;k=dd.prototype;
|
||||
k.wa=function(a,b,c){var d=this,e=ph;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&&qh(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;qh(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
|
||||
k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.j=d;this.T=rh(a);var e=this;if((this.g=wd(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=Tc(56,4);this.ca=Ic(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.I.length&&(e.L=e.I[e.K++]&255,sh(e,e.K/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Jc(e.b,e.X))});Ib(b,this,th);Kb(b,this.reset.bind(this));uh(this,"None",oh,!0);this.O&&
|
||||
uh(this,"Local Tape","?");uh(this,"Remote Tape","??");vh(this)||H(this)};k.Ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function vh(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=sa(b,!0)}b&&c?wh(a,c,b,1,!0):xh(a)}return!!a.D}
|
||||
function qh(a,b,c,d,e){if(c)if("?"==c)a.R('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;wh(a,b,c,d,!1,e)}else yh(a,!1)}
|
||||
function wh(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.w!=d)g++,yh(a,!0),a.A.fb?a.R("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),zh(a,b,c,d,f)?g++:a.A.fb=!0);g&&Ah(a,a.M,a.B,a.w,a.ea,a.Oa,a.Na)}
|
||||
function zh(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),Ah(a,b,c,d,e),a.H="?");xh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.A.ia;g?a.R('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(rb(a.Ua,e,f),(e=Ea(e,f))&&Ah(a,b,c,d,e.ea,e.Oa,
|
||||
e.Na));a.A.fb=!1;a.D&&(a.D--,a.D||H(a));xh(a)})}function uh(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 xh(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 sh(a,b){b|=0;if(b!==a.S){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.S=b}}
|
||||
function Ah(a,b,c,d,e,f,g){a.M=b;a.B=c;a.w=d;a.ea=e;a.Oa=f;a.Na=g;2==d?a.T&&ih(a.T,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.B="",a.H=oh,a.w=ph,a.R("No load address available for tape: "+b)):(a.K=0,a.I=e,a.status("tape attached: "+b),sh(a,0))}function yh(a,b){if(a.B||!1===b)a.M="",a.B="",b||(a.w&&a.status(1==a.w?"tape detached":"tape unloaded"),a.H=oh,a.w=ph,xh(a))}k.save=function(){return(new O(this)).data()};k.restore=function(){return!0};k.Dd=function(){return this.f&65534};
|
||||
k.ve=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Jc(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Kc(this.b,this.ca,1E3/Math.round(this.ba/10))));this.f=this.f&-66|a&65};k.Cd=function(){this.f&=-129;this.f|=2048;return this.L};k.ue=function(){};var Bh={},th=(Bh[65384]=[null,null,dd.prototype.Dd,dd.prototype.ve,"PRS"],Bh[65386]=[null,null,dd.prototype.Cd,dd.prototype.ue,"PRB"],Bh);
|
||||
function Ch(a,b,c){t.call(this,"Disk",{id:a.Ua+".disk"+p(++Dh,4)},Ch,4194304);this.controller=a;this.C=a.C;this.j=a.j;this.w=b;this.ab=b.name;this.jc=b.jc;Eh(this,c,b.ya,b.Da,b.ta,b.Pa);H(this)}var Dh=0;z(Ch);k=Ch.prototype;k.Ia=function(a,b,c,d){this.j=d};
|
||||
function Eh(a,b,c,d,e,f){a.mode=b;a.ya=c;a.Da=d;a.ta=e;a.Pa=f;a.b=[];if("preload"!=a.mode){b=Array(a.ya);for(c=0;c<b.length;c++){d=Array(a.Da);for(e=0;e<d.length;e++){f=Array(a.ta);for(var g=1;g<=f.length;g++)f[g-1]=Fh(null,c,e,g,a.Pa,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
|
||||
function Gh(a,b,c,d,e){var f=c;if(a.v)return!0;a.ab=b;a.hb=c;a.Lc=sa(c);a.v=e;a.B=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ka[d];if(e){a.ya=e[0];a.Da=e[1];a.ta=e[2];a.Pa=e[3]||512;c=a.Pa>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ya);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.Da),w=0;w<r.length;w++)for(var y=r[w]=Array(a.ta),x=0;x<y.length;x++){for(var C=Fh(null,d,w,x+1,a.Pa,0),la=C.data,Ma=0;Ma<c;Ma++,f+=4)var P=la[Ma]=b.getInt32(f,
|
||||
!0),e=e+P&-1;C.Fa=c;y[x]=C}a.f=e;c=a}else a.R("Unrecognized disk format ("+d+" bytes)");a.v&&(a.v.call(a.controller,a.w,c,a.ab,a.hb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.jc?"":e)+"&format=json"));return!!Da(f,
|
||||
k.Ja=function(a){return a?this.save():!0};k.reset=function(){mh(this)};k.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};k.restore=function(){return mh(this)};function mh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.ac=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.B.push(b)}else this.B=this.B.concat(a);Kc(this.b,this.X,1E3/Math.round(this.O/10));return!0};
|
||||
k.Md=function(){return this.f&65534};k.Fe=function(a){this.f=this.f&-112|a&111};k.Ld=function(){this.f&=-129;0<this.B.length&&Kc(this.b,this.X,1E3/Math.round(this.O/10));return this.K};k.Ee=function(){};k.fe=function(){return this.g};k.Ze=function(a){this.g&128&&(a&64?Jc(this.b,this.M):Rd(this.b,this.M));this.g=this.g&-70|a&69};k.ee=function(){return 0};
|
||||
k.Ye=function(a){if(a&=255){F(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);a&=127;if(this.w)if(13==a)this.H=0;else if(8==a)this.w.value=this.w.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=za[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=xa("",c)));this.S&&!this.H&&c&&(b=String.fromCharCode(this.S)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.i(this.D),
|
||||
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Kc(this.b,this.ja,1E3/Math.round(this.ca/10))}};var nh={},lh=(nh[65392]=[null,null,X.prototype.Md,X.prototype.Fe,"RCSR"],nh[65394]=[null,null,X.prototype.Ld,X.prototype.Ee,"RBUF"],nh[65396]=[null,null,X.prototype.fe,X.prototype.Ze,"XCSR"],nh[65398]=[null,null,X.prototype.ee,X.prototype.Ye,"XBUF"],nh);$a(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new X(d);D(d,c)}});
|
||||
function dd(a){w.call(this,"PC11",a,dd);this.g=a.autoMount||null;this.D=0;this.ba=a.baudReceive||3600;this.K=this.L=this.f=0;this.I=[];this.H=oh;this.w=ph;this.M=this.B="";this.ea=this.Oa=this.Na=null;this.S=-1;this.O=!Ma("Mobi")&&window&&"FileReader"in window}A(dd);var oh="",ph=0;k=dd.prototype;
|
||||
k.wa=function(a,b,c){var d=this,e=ph;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){u("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&&qh(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;qh(d,oa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
|
||||
k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.j=d;this.T=rh(a);var e=this;if((this.g=wd(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){u("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Lc(56,4);this.ca=Ic(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.I.length&&(e.L=e.I[e.K++]&255,sh(e,e.K/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Jc(e.b,e.X))});Ib(b,this,th);Kb(b,this.reset.bind(this));uh(this,"None",oh,!0);this.O&&
|
||||
uh(this,"Local Tape","?");uh(this,"Remote Tape","??");vh(this)||I(this)};k.Ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function vh(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=oa(b,!0)}b&&c?wh(a,c,b,1,!0):xh(a)}return!!a.D}
|
||||
function qh(a,b,c,d,e){if(c)if("?"==c)a.R('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=oa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;wh(a,b,c,d,!1,e)}else yh(a,!1)}
|
||||
function wh(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.w!=d)g++,yh(a,!0),a.A.eb?a.R("PC11 busy"):(e&&(a.D++,H(a)&&F(a,"auto-loading tape: "+b)),zh(a,b,c,d,f)?g++:a.A.eb=!0);g&&Ah(a,a.M,a.B,a.w,a.ea,a.Oa,a.Na)}
|
||||
function zh(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),Ah(a,b,c,d,e),a.H="?");xh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ta(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.A.ia;g?a.R('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(kb(a.Ua,e,f),(e=Ea(e,f))&&Ah(a,b,c,d,e.ea,e.Oa,
|
||||
e.Na));a.A.eb=!1;a.D&&(a.D--,a.D||I(a));xh(a)})}function uh(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 xh(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 sh(a,b){b|=0;if(b!==a.S){var c=a.G.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.S=b}}
|
||||
function Ah(a,b,c,d,e,f,g){a.M=b;a.B=c;a.w=d;a.ea=e;a.Oa=f;a.Na=g;2==d?a.T&&ih(a.T,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.B="",a.H=oh,a.w=ph,a.R("No load address available for tape: "+b)):(a.K=0,a.I=e,a.status("tape attached: "+b),sh(a,0))}function yh(a,b){if(a.B||!1===b)a.M="",a.B="",b||(a.w&&a.status(1==a.w?"tape detached":"tape unloaded"),a.H=oh,a.w=ph,xh(a))}k.save=function(){return(new Q(this)).data()};k.restore=function(){return!0};k.Fd=function(){return this.f&65534};
|
||||
k.ye=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Jc(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Kc(this.b,this.ca,1E3/Math.round(this.ba/10))));this.f=this.f&-66|a&65};k.Ed=function(){this.f&=-129;this.f|=2048;return this.L};k.xe=function(){};var Bh={},th=(Bh[65384]=[null,null,dd.prototype.Fd,dd.prototype.ye,"PRS"],Bh[65386]=[null,null,dd.prototype.Ed,dd.prototype.xe,"PRB"],Bh);
|
||||
function Ch(a,b,c){w.call(this,"Disk",{id:a.Ua+".disk"+p(++Dh,4)},Ch,4194304);this.controller=a;this.C=a.C;this.j=a.j;this.w=b;this.ab=b.name;this.jc=b.jc;Eh(this,c,b.ya,b.Ea,b.ta,b.Pa);I(this)}var Dh=0;A(Ch);k=Ch.prototype;k.Ia=function(a,b,c,d){this.j=d};
|
||||
function Eh(a,b,c,d,e,f){a.mode=b;a.ya=c;a.Ea=d;a.ta=e;a.Pa=f;a.b=[];if("preload"!=a.mode){b=Array(a.ya);for(c=0;c<b.length;c++){d=Array(a.Ea);for(e=0;e<d.length;e++){f=Array(a.ta);for(var g=1;g<=f.length;g++)f[g-1]=Fh(null,c,e,g,a.Pa,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
|
||||
function Gh(a,b,c,d,e){var f=c;if(a.v)return!0;a.ab=b;a.ib=c;a.Mc=oa(c);a.v=e;a.B=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ka[d];if(e){a.ya=e[0];a.Ea=e[1];a.ta=e[2];a.Pa=e[3]||512;c=a.Pa>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ya);for(d=0;d<a.b.length;d++)for(var t=a.b[d]=Array(a.Ea),v=0;v<t.length;v++)for(var z=t[v]=Array(a.ta),x=0;x<z.length;x++){for(var B=Fh(null,d,v,x+1,a.Pa,0),ma=B.data,Na=0;Na<c;Na++,f+=4)var P=ma[Na]=b.getInt32(f,
|
||||
!0),e=e+P&-1;B.Fa=c;z[x]=B}a.f=e;c=a}else a.R("Unrecognized disk format ("+d+" bytes)");a.v&&(a.v.call(a.controller,a.w,c,a.ab,a.ib),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.jc?"":e)+"&format=json"));return!!Da(f,
|
||||
null,!0,function(b,c,d){Hh(a,b,c,d)})}
|
||||
function Hh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ia;if(d)a.controller.R('Unable to load disk "'+a.ab+'" (error '+d+": "+b+")",f);else{rb(a.controller.Ua,b,c);try{if(0<sa(a.Lc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.ab]: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.ya=h.length;a.Da=h[0].length;a.ta=h[0][0].length;var l=h[0][0][0];a.Pa=l&&l.length||512;for(d=c=0;d<a.ya;d++)for(f=0;f<a.Da;f++)for(g=0;g<a.ta;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;Ih(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}Fh(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.ab)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.B,a.w,e,a.ab,a.hb),a.v=null)}function Fh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ze=b;a.$e=c;a.Sa=a.Fa=0;a.Wa=!1;return a}
|
||||
k.seek=function(a,b,c,d,e){d=null;var f=this.w,g=this.b[a];if(g){var h=g[b];if(!h&&f.Rc&&b<f.Da)for(h=g[b]=Array(f.Sc),g=0;g<h.length;g++)h[g]=Fh(null,a,b,g+1,f.Ec,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Rc&&9==f.rc&&(d=h[g]=Fh(null,a,b,f.rc,f.Ec,0))}}e&&e(d,!1);return d};function Ih(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}
|
||||
function Hh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ia;if(d)a.controller.R('Unable to load disk "'+a.ab+'" (error '+d+": "+b+")",f);else{kb(a.controller.Ua,b,c);try{if(0<oa(a.Mc,!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.ab]: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)u(h[0]);else{a.ya=h.length;a.Ea=h[0].length;a.ta=h[0][0].length;var l=h[0][0][0];a.Pa=l&&l.length||512;for(d=c=0;d<a.ya;d++)for(f=0;f<a.Ea;f++)for(g=0;g<a.ta;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 r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var v=m<<2,z=t.length;z<v;z++)t[z]=n;Ih(l,t)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}Fh(l,d,f);for(v=
|
||||
0;v<r.length;v++)c=c+r[v]&-1}a.b=h;a.f=c;e=a}else u("Empty disk image: "+a.ab)}catch(x){u("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.B,a.w,e,a.ab,a.ib),a.v=null)}function Fh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.bf=b;a.cf=c;a.Sa=a.Fa=0;a.Xa=!1;return a}
|
||||
k.seek=function(a,b,c,d,e){d=null;var f=this.w,g=this.b[a];if(g){var h=g[b];if(!h&&f.Sc&&b<f.Ea)for(h=g[b]=Array(f.Tc),g=0;g<h.length;g++)h[g]=Fh(null,a,b,g+1,f.Ec,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Sc&&9==f.sc&&(d=h[g]=Fh(null,a,b,f.sc,f.Ec,0))}}e&&e(d,!1);return d};function Ih(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Fa?f<a.Sa?(a.Fa+=a.Sa-f,a.Sa=f):f>=a.Sa+a.Fa&&(a.Fa+=f-(a.Sa+a.Fa)+1):(a.Sa=f,a.Fa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function Jh(a,b){var c=a.Da*a.ta,d=b/c|0;return d<a.ya?(b%=c,a.seek(d,b/a.ta|0,b%a.ta+1)):null}function Kh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
|
||||
k.save=function(){var a=0,b=[];b[a++]=[this.hb,this.f,this.ya,this.Da,this.ta,this.Pa];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Fa){for(var h=[],l=0,m=g.Sa,n=g.Sa+g.Fa;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Sa,h]}}return b};
|
||||
function Jh(a,b){var c=a.Ea*a.ta,d=b/c|0;return d<a.ya?(b%=c,a.seek(d,b/a.ta|0,b%a.ta+1)):null}function Kh(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.ib,this.f,this.ya,this.Ea,this.ta,this.Pa];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Fa){for(var h=[],l=0,m=g.Sa,n=g.Sa+g.Fa;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Sa,h]}}return b};
|
||||
k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?Eh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;l<e;)h.data[l++]=h.pattern;l=0;h.Sa=e;for(h.Fa=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.R("Unable to restore disk '"+this.ab+": "+c);return b};
|
||||
k.toJSON=function(){var a;a=0;for(var b;b=Jh(this,a++);)Lh(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 Lh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){t.call(this,"RL11",a,N,8388608);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Na("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype;
|
||||
k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Mh(d,a)},!0;case "loadDrive":return this.G[b]=
|
||||
c,c.onclick=function(){var a=d.G.listDisks;a&&Nh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[ma(a.value,10)||0])if(a=a.Ga){var b;b="";for(var c=0,h;h=Jh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(Kh(a,h,l));b=btoa(b);a=a.Lc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
|
||||
"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.R("No disk loaded in drive.");else d.R("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=
|
||||
!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Nh(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.j=d;if((this.w=wd(this.C,"autoMount")||this.w)&&"string"==typeof this.w)try{this.w=eval("("+this.w+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.w+")"),this.w=null}Oh(this);this.O=Tc(112,5);Ib(b,this,Ph);Kb(b,this.reset.bind(this));Qh(this,"None","",!0);this.L&&Qh(this,"Local Disk","?");Qh(this,"Remote Disk","??");Rh(this)||H(this)};
|
||||
k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.uc){for(a=0;a<this.f.length;a++)Sh(this,a,!0);Rh(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";Mh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Oh(this)};k.save=function(){return(new O(this)).data()};
|
||||
k.restore=function(a){return Oh(this,a[0])};function Rh(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=sa(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!Th(a,g,f,e,!0)&&b&&H(a,!1);continue}a.R("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
|
||||
function Nh(a,b,c,d){var e=a.G.listDrives,e=e&&ma(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.R("Unable to load the selected drive");else if(c)if("?"==c)a.R('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Th(a,e,b,c,!1,d)}else Sh(a,e)}
|
||||
function Th(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,Sh(a,b,!0),h.ic?a.R("RL11 busy"):(h.ic=!0,e&&(h.hc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Vb=!!f,Gh(new Ch(a,h,"preload"),c,d,f,a.Wc)&&g++));return g}
|
||||
k.Wc=function(a,b,c,d,e){var f;a.ic=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ya||f[1]>a.Da)&&(this.R('Disk "'+c+'" too large for drive '+("RL"+a.kc)),b=null);b?(a.Ga=b,a.ab=c,a.hb=d,this.R('Mounted disk "'+c+'" in drive '+("RL"+a.kc),a.hc||e),this.C&&this.C.tb()):a.Vb=!1;a.hc&&(a.hc=!1,--this.H||H(this));Mh(this,a.kc)};
|
||||
function Lh(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 O(a){w.call(this,"RL11",a,O,8388608);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Ma("Mobi")&&window&&"FileReader"in window}A(O);k=O.prototype;
|
||||
k.wa=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){u("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&&Mh(d,a)},!0;case "loadDrive":return this.G[b]=
|
||||
c,c.onclick=function(){var a=d.G.listDisks;a&&Nh(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.Ga){var b;b="";for(var c=0,h;h=Jh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(Kh(a,h,l));b=btoa(b);a=a.Mc.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+")":"")+".");u(a)}else d.R("No disk loaded in drive.");else d.R("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=
|
||||
!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Nh(d,oa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
k.Ia=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.j=d;if((this.w=wd(this.C,"autoMount")||this.w)&&"string"==typeof this.w)try{this.w=eval("("+this.w+")")}catch(e){u("RL11 auto-mount error: "+e.message+" ("+this.w+")"),this.w=null}Oh(this);this.O=Lc(112,5);Ib(b,this,Ph);Kb(b,this.reset.bind(this));Qh(this,"None","",!0);this.L&&Qh(this,"Local Disk","?");Qh(this,"Remote Disk","??");Rh(this)||I(this)};
|
||||
k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.vc){for(a=0;a<this.f.length;a++)Sh(this,a,!0);Rh(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";Mh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Oh(this)};k.save=function(){return(new Q(this)).data()};
|
||||
k.restore=function(a){return Oh(this,a[0])};function Rh(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=oa(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)){!Th(a,g,f,e,!0)&&b&&I(a,!1);continue}a.R("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
|
||||
function Nh(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.R("Unable to load the selected drive");else if(c)if("?"==c)a.R('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=oa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Th(a,e,b,c,!1,d)}else Sh(a,e)}
|
||||
function Th(a,b,c,d,e,f){var g=-1,h=a.f[b];h.ib.toLowerCase()!=d.toLowerCase()&&(g++,Sh(a,b,!0),h.ic?a.R("RL11 busy"):(h.ic=!0,e&&(h.hc=!0,a.H++,H(a)&&F(a,"auto-loading disk: "+c)),h.Vb=!!f,Gh(new Ch(a,h,"preload"),c,d,f,a.Zc)&&g++));return g}
|
||||
k.Zc=function(a,b,c,d,e){var f;a.ic=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ya||f[1]>a.Ea)&&(this.R('Disk "'+c+'" too large for drive '+("RL"+a.kc)),b=null);b?(a.Ga=b,a.ab=c,a.ib=d,this.R('Mounted disk "'+c+'" in drive '+("RL"+a.kc),a.hc||e),this.C&&this.C.ub()):a.Vb=!1;a.hc&&(a.hc=!1,--this.H||I(this));Mh(this,a.kc)};
|
||||
function Qh(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 Mh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=ma(a.value,10),c=c.Vb?"?":c.hb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Sh(a,b,c){var d=a.f[b];if(d.Ga||!1===c)d.ab="",d.hb="",d.Ga=null,d.Vb=!1,c||(a.R("Drive RL"+b+" unloaded",c),Mh(a,b))}
|
||||
function Oh(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.B=b[c++]||0;a.D=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.kc=b;d.ic=d.Vb=!1;d.name=c.bb;d.ya=512;d.Da=2;d.ta=40;d.Pa=256;d.jc=!0;d.Ye=0;d.Xe=0;d.rc=1;d.Sc=d.ta;d.Ec=d.Pa;d.af=0;d.cf=null;d.Ga||(d.hb="");d.status=29|(512==d.ya?128:0)}return!0}
|
||||
k.Uc=function(a,b,c,d,e,f){this.I=f&65535;this.fa=this.fa&-49|f>>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0};
|
||||
k.qd=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ga.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ga.read(m,n++))||0>(r=a.Ga.read(m,n++))){h=5120;break}this.v.vb(f,v|r<<8);if(Hc(this.v)){h=8192;break}f+=2;if(n>=l.Pa&&(m=null,++d>=l.ta&&(d=0,++c>=l.Da&&(c=0,++b>=l.ya)))){h=5120;break}}return g(h,b,c,d,e,f)};
|
||||
k.ke=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.Xa(f);if(Hc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ga.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ga.write(m,n++,v&255)||!a.Ga.write(m,n++,v>>8)){h=5120;break}if(n>=l.Pa&&(m=null,++d>=l.ta&&(d=0,++c>=l.Da&&(c=0,++b>=l.ya)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Nd=function(){return this.fa&65535};
|
||||
k.Fe=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.qd;case 10:b||(b=this.ke),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ya||f>=c.ta?this.fa|=37888:
|
||||
(g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Uc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Jc(this.b,this.O))}};k.Ld=function(){return this.I};k.De=function(a){this.I=a&65534};k.Od=function(){return this.g};k.Ge=function(a){this.g=a};k.Pd=function(){return this.D};k.He=function(a){this.D=a};k.Md=function(){return this.K};k.Ee=function(a){this.K=a&63};
|
||||
var Uh={},Ph=(Uh[63744]=[null,null,N.prototype.Nd,N.prototype.Fe,"RLCS"],Uh[63746]=[null,null,N.prototype.Ld,N.prototype.De,"RLBA"],Uh[63748]=[null,null,N.prototype.Od,N.prototype.Ge,"RLDA"],Uh[63750]=[null,null,N.prototype.Pd,N.prototype.He,"RLMP"],Uh[63752]=[null,null,N.prototype.Md,N.prototype.Ee,"RLBE"],Uh);function Vh(a){t.call(this,"Debugger",a,Vh);this.ca=a.base||16;this.Ea=!1;this.K=0;this.T=!1;this.B=-1;this.g=[];this.X={}}z(Vh);
|
||||
var Wh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Vh.prototype.wc=function(){return-1};Vh.prototype.xc=function(){};
|
||||
function Mh(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.Vb?"?":c.ib,!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 Sh(a,b,c){var d=a.f[b];if(d.Ga||!1===c)d.ab="",d.ib="",d.Ga=null,d.Vb=!1,c||(a.R("Drive RL"+b+" unloaded",c),Mh(a,b))}
|
||||
function Oh(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.B=b[c++]||0;a.D=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.kc=b;d.ic=d.Vb=!1;d.name=c.bb;d.ya=512;d.Ea=2;d.ta=40;d.Pa=256;d.jc=!0;d.af=0;d.$e=0;d.sc=1;d.Tc=d.ta;d.Ec=d.Pa;d.df=0;d.ff=null;d.Ga||(d.ib="");d.status=29|(512==d.ya?128:0)}return!0}
|
||||
k.Xc=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.sd=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ga.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ga.read(m,n++))||0>(t=a.Ga.read(m,n++))){h=5120;break}this.v.wb(f,r|t<<8);if(Hc(this.v)){h=8192;break}f+=2;if(n>=l.Pa&&(m=null,++d>=l.ta&&(d=0,++c>=l.Ea&&(c=0,++b>=l.ya)))){h=5120;break}}return g(h,b,c,d,e,f)};
|
||||
k.ne=function(a,b,c,d,e,f,g){var h=0,l=a.Ga,m=null,n;l||(h=5120,e=0);for(;e--;){var r=this.v.Ya(f);if(Hc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ga.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ga.write(m,n++,r&255)||!a.Ga.write(m,n++,r>>8)){h=5120;break}if(n>=l.Pa&&(m=null,++d>=l.ta&&(d=0,++c>=l.Ea&&(c=0,++b>=l.ya)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Pd=function(){return this.fa&65535};
|
||||
k.Ie=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.sd;case 10:b||(b=this.ne),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ya||f>=c.ta?this.fa|=37888:
|
||||
(g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Xc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Jc(this.b,this.O))}};k.Nd=function(){return this.I};k.Ge=function(a){this.I=a&65534};k.Qd=function(){return this.g};k.Je=function(a){this.g=a};k.Rd=function(){return this.D};k.Ke=function(a){this.D=a};k.Od=function(){return this.K};k.He=function(a){this.K=a&63};
|
||||
var Uh={},Ph=(Uh[63744]=[null,null,O.prototype.Pd,O.prototype.Ie,"RLCS"],Uh[63746]=[null,null,O.prototype.Nd,O.prototype.Ge,"RLBA"],Uh[63748]=[null,null,O.prototype.Qd,O.prototype.Je,"RLDA"],Uh[63750]=[null,null,O.prototype.Rd,O.prototype.Ke,"RLMP"],Uh[63752]=[null,null,O.prototype.Od,O.prototype.He,"RLBE"],Uh);function Vh(a){w.call(this,"Debugger",a,Vh);this.ca=a.base||16;this.Ca=!1;this.K=0;this.T=!1;this.B=-1;this.g=[];this.X={}}A(Vh);
|
||||
var Wh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Vh.prototype.xc=function(){return-1};Vh.prototype.yc=function(){};
|
||||
function Xh(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.T?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a}
|
||||
function Yh(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}
|
||||
function Zh(a,b,c){var d;if(b){b=$h(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=ya(n);if(!n){f=!0;break}n=ai(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&&Wh[n]<Wh[l[l.length-1]]&&Yh(h,l,1);l.push(n);b=b.substr(v+r)}Yh(h,l)&&1==h.length||(f=!0);f?c&&a.i("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&bi(a,null,
|
||||
d))}return d}function $h(a,b){for(var c,d=a.Ea?"(":"{",e=a.Ea?")":"}",f=new RegExp(a.Ea?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Zh(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 ai(a,b,c,d){var e;null!=b?(e=a.wc(b),0<=e?e=a.xc(e):(e=a.X[b],null==e&&(e=ma(b,a.ca))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
|
||||
function Zh(a,b,c){var d;if(b){b=$h(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=ya(n);if(!n){f=!0;break}n=ai(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++],t=n.length;l.length&&Wh[n]<Wh[l[l.length-1]]&&Yh(h,l,1);l.push(n);b=b.substr(r+t)}Yh(h,l)&&1==h.length||(f=!0);f?c&&a.i("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&bi(a,null,
|
||||
d))}return d}function $h(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=Zh(a,c[1]);b=b.replace(d+c[1]+e,null!=g?K(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 ai(a,b,c,d){var e;null!=b?(e=a.xc(b),0<=e?e=a.yc(e):(e=a.X[b],null==e&&(e=la(b,a.ca))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
|
||||
function bi(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function ci(a,b){if(b)return bi(a,b,a.X[b]);var c=0;for(b in a.X)bi(a,b,a.X[b]),c++;return 0<c}
|
||||
function J(a,b,c,d){switch(a.ca){case 8:a=na(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
|
||||
function di(a){Vh.call(this,a);this.kb=!1;this.Ea=!0;this.L=Y(0);this.lb=Y(0);this.S=Y(0);this.I=[];this.f=this.M=this.D=[];ei(this);this.xa=0;fi(this);this.Ma={};gi(this,a.messages);this.cb=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Ad(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Ad(b,a)})}z(di,Vh);
|
||||
function K(a,b,c,d){switch(a.ca){case 8:a=na(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
|
||||
function di(a){Vh.call(this,a);this.lb=!1;this.Ca=!0;this.L=Y(0);this.mb=Y(0);this.S=Y(0);this.I=[];this.f=this.M=this.D=[];ei(this);this.xa=0;fi(this);this.Ma={};gi(this,a.messages);this.Va=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Ad(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Ad(b,a)})}A(di,Vh);
|
||||
var hi={"?":"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"},ii=".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(" "),
|
||||
ji={SP:6,PC:7,PS:20,IR:21,ER:22,SL:23,MMR0:24,MMR1:25,MMR2:26,MMR3:27,AR:28,DR:29,SR:30},ki={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,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]}},li=[0],mi=[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=di.prototype;
|
||||
k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.w=a.w;(a=wd(a,"messages"))&&gi(this,a);this.xb=ki;this.Ib=1145>this.b.Ya?mi:[];Vc(this,64,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ni(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.v.ka;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Dc[c],n&&d.i(p(n.id,8)+" %"+
|
||||
p(e<<d.v.ka,8)+" %%"+p(n.F,8)+" "+p(n.Tb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=id&&(c=-1),m=0);a+=d.v.Ca;e++}}});H(this)};
|
||||
k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.w=a.w;(a=wd(a,"messages"))&&gi(this,a);this.qb=ki;this.Ib=1145>this.b.fb?mi:[];Vc(this,64,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ni(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.v.ka;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Dc[c],n&&d.i(p(n.id,8)+" %"+
|
||||
p(e<<d.v.ka,8)+" %%"+p(n.F,8)+" "+q(n.Tb)+" "+q(n.size)+" "+m),c!=id&&(c=-1),m=0);a+=d.v.Da;e++}}});I(this)};
|
||||
k.wa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.oa=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Ad(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.B<d.g.length-1&&(b=d.g[++d.B])):40==a.keyCode&&(0<d.B?b=d.g[--d.B]:(b="",d.B=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Ua(c,function(){if(d.oa){var a=d.oa.value;
|
||||
d.oa.value="";Ad(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ua(c,function(a){var b=!1;wb(d,!0)||(vb(d,!0),b=d.jb(a?1:0,null),vb(d,!1));return b}),!0}return!1};k.tb=function(a){if(this.oa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.oa.focus();!a&&window&&window.scrollTo(b,c)}};k.aa=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Yb=function(a,b){var c=255,d=this.aa(a,!1,1);-1!==d&&(c=a.Wb?this.v.Zb(d):this.b.Zb(d),b&&oi(a,b));return c};
|
||||
k.pa=function(a,b){var c=65535,d=this.aa(a,!1,2);-1!==d&&(c=a.Wb?this.v.Xa(d):this.b.Xa(d),b&&oi(a,b));return c};k.Fb=function(a,b,c){var d=this.aa(a,!0,1);-1!==d&&(a.Wb?this.v.sb(d,b):this.b.sb(d,b),c&&oi(a,c),this.C.sa(-1))};k.ub=function(a,b,c){var d=this.aa(a,!0,2);-1!==d&&(a.Wb?this.v.vb(d,b):this.b.vb(d,b),c&&oi(a,c),this.C.sa(-1))};function Y(a,b){return{F:a,Wb:b,Ra:!1}}k.nc=function(a,b){a.F=b;a.Ra=!1;return a};function pi(a){return[a.F,a.Ra]}function qi(a){return{F:a[0],Ra:a[1]}}
|
||||
function ni(a,b,c){var d,e=(c?a.L:a.lb).F;c=!1;if(void 0!==b){b=$h(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=Zh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function ri(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Pc=Xh(a,b.Kc=c[2]))}function oi(a,b){null!=a.F&&(a.F+=b||1)}
|
||||
function gi(a,b){a.j=a;a.la=a.Tc=536870912;a.ja=null;a.Aa=[];b=Xh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Cb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.la|=Cb[c],a.i(c+" messages enabled"))}}function Vc(a,b,c){for(var d in Cb)if(b==Cb[d]){a.Ma[d]=c;break}}
|
||||
k.wc=function(a){a=a.toUpperCase();var b=ji[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function si(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||
k.xc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.$a[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=bd(this.b);break;case 21:b=c.Rb;break;case 22:b=c.na;break;case 23:b=c.rb;break;case 24:b=Wc(c);break;case 25:b=Yc(c);break;case 26:b=Zc(c);break;case 27:b=c.Ta;break;case 28:d&&(b=d.va);break;case 29:d&&(b=d.qb);break;case 30:d&&mc(d)&&(b=d.Za)}}return b};
|
||||
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.qa&65535).F));if(this.la&1073741824)this.Aa.push(a);else if(!this.ja||a!=this.ja){this.ja=a;b=!1;if(this.la&-2147483648&&this.b&&(b=this.b.A.W)||wb(this,!0))this.da(),b&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Ed(a),a.Aa=0,a.sa())}};
|
||||
function fi(a){var b;if(!He(a))a.H&&a.H.length&&a.i("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.i("instruction history buffer allocated")}}k.ib=function(a,b){if(!ti(this,b))return!1;this.b.ib(a);return!0};
|
||||
k.jb=function(a,b,c){if(!ti(this))return!1;null===b&&(b=!this.zb||"tr"==this.zb);this.K=0;a||He(this)&&Ie(this,this.b.u[7],0);try{a=Fd(this.b,a);var d=this.b.jb(a);0<d&&(Sb(this.b,d),this.K+=d,Tb(this.b,d,!0),Ub(this.b,d),this.Ba++)}catch(e){"number"!=typeof e&&(this.K=0,zb(this.b,e.stack||e.message))}!1!==c&&(this.w&&this.w.stop&&this.w.stop(),this.C.sa(-1));zd(this,b||!1);return 0<this.K};k.da=function(a){this.b&&this.b.da(a)};
|
||||
function zd(a,b){if(a.kb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.J&8?c.md|c.ld<<8:0){var d=c>>8;a.i("trapped to "+J(a,c&255,1)+" ("+(0>d?Bb[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.O?ui(a):vi(a)}}function ti(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ia?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.i("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||
k.Ja=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){fi(this);this.Ba=0;this.ja=null;this.K=0;this.L=Y(this.b.u[7]);this.A.W=!1;wi(this);a||zd(this)};k.save=function(){var a=new O(this);a.set(0,pi(this.L));a.set(1,pi(this.S));a.set(2,[this.g,this.T,this.la]);a.set(3,this.I);return a.data()};
|
||||
d.oa.value="";Ad(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ua(c,function(a){var b=!1;wb(d,!0)||(vb(d,!0),b=d.kb(a?1:0,null),vb(d,!1));return b}),!0}return!1};k.ub=function(a){if(this.oa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.oa.focus();!a&&window&&window.scrollTo(b,c)}};k.aa=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Yb=function(a,b){var c=255,d=this.aa(a,!1,1);-1!==d&&(c=a.Wb?this.v.Zb(d):this.b.Zb(d),b&&oi(a,b));return c};
|
||||
k.pa=function(a,b){var c=65535,d=this.aa(a,!1,2);-1!==d&&(c=a.Wb?this.v.Ya(d):this.b.Ya(d),b&&oi(a,b));return c};k.Fb=function(a,b,c){var d=this.aa(a,!0,1);-1!==d&&(a.Wb?this.v.tb(d,b):this.b.tb(d,b),c&&oi(a,c),this.C.sa(-1))};k.vb=function(a,b,c){var d=this.aa(a,!0,2);-1!==d&&(a.Wb?this.v.wb(d,b):this.b.wb(d,b),c&&oi(a,c),this.C.sa(-1))};function Y(a,b){return{F:a,Wb:b,Ra:!1}}k.oc=function(a,b){a.F=b;a.Ra=!1;return a};function pi(a){return[a.F,a.Ra]}function qi(a){return{F:a[0],Ra:a[1]}}
|
||||
function ni(a,b,c){var d,e=(c?a.L:a.mb).F;c=!1;if(void 0!==b){b=$h(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=Zh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function ri(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Qc=Xh(a,b.Lc=c[2]))}function oi(a,b){null!=a.F&&(a.F+=b||1)}
|
||||
function gi(a,b){a.j=a;a.la=a.Uc=536870912;a.ja=null;a.Aa=[];b=Xh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Cb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.la|=Cb[c],a.i(c+" messages enabled"))}}function Vc(a,b,c){for(var d in Cb)if(b==Cb[d]){a.Ma[d]=c;break}}
|
||||
k.xc=function(a){a=a.toUpperCase();var b=ji[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function si(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||
k.yc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.$a[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=bd(this.b);break;case 21:b=c.Rb;break;case 22:b=c.na;break;case 23:b=c.hb;break;case 24:b=Wc(c);break;case 25:b=Yc(c);break;case 26:b=Zc(c);break;case 27:b=c.Ta;break;case 28:d&&(b=d.va);break;case 29:d&&(b=d.sb);break;case 30:d&&mc(d)&&(b=d.Za)}}return b};
|
||||
k.message=function(a,b){b&&(a+=" @"+K(this,Y(this.b.qa&65535).F));if(this.la&1073741824)this.Aa.push(a);else if(!this.ja||a!=this.ja){this.ja=a;b=!1;if(this.la&-2147483648&&this.b&&(b=this.b.A.W)||wb(this,!0))this.da(),b&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Ed(a),a.Ba=0,a.sa())}};
|
||||
function fi(a){var b;if(!Ge(a))a.H&&a.H.length&&a.i("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.i("instruction history buffer allocated")}}k.jb=function(a,b){if(!ti(this,b))return!1;this.b.jb(a);return!0};
|
||||
k.kb=function(a,b,c){if(!ti(this))return!1;null===b&&(b=!this.zb||"tr"==this.zb);this.K=0;a||Ge(this)&&He(this,this.b.u[7],0);try{a=Fd(this.b,a);var d=this.b.kb(a);0<d&&(Sb(this.b,d),this.K+=d,Tb(this.b,d,!0),Ub(this.b,d),this.Ba++)}catch(e){"number"!=typeof e&&(this.K=0,zb(this.b,e.stack||e.message))}!1!==c&&(this.w&&this.w.stop&&this.w.stop(),this.C.sa(-1));zd(this,b||!1);return 0<this.K};k.da=function(a){this.b&&this.b.da(a)};
|
||||
function zd(a,b){if(a.lb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.J&8?c.he|c.od<<8:0){var d=c>>8;a.i("trapped to "+K(a,c&255,1)+" ("+(0>d?Bb[-d]:K(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.O?ui(a):vi(a)}}function ti(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ia?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.i("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||
k.Ja=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){fi(this);this.Ba=0;this.ja=null;this.K=0;this.L=Y(this.b.u[7]);this.A.W=!1;wi(this);a||zd(this)};k.save=function(){var a=new Q(this);a.set(0,pi(this.L));a.set(1,pi(this.S));a.set(2,[this.g,this.T,this.la]);a.set(3,this.I);return a.data()};
|
||||
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=qi(a[b++]),this.S=qi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.T=a[b][1],this.la|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.O||this.i("running");this.A.W=!0;this.Jb=a;this.Kb=b};
|
||||
k.stop=function(a,b){if(this.A.W){this.A.W=!1;this.K=b-this.Kb;if(!this.O){b="stopped";if(this.K){a-=this.Jb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";He(this)&&(b+=this.Ba+" instructions, ",this.Ba=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}zd(this,!0);this.tb();wi(this,this.b.u[7]);this.ja=null}};function He(a){return 1<a.f.length||!!a.xa}
|
||||
function Ie(a,b,c){var d=-1;c||(d=a.b.Xa(b),0==d&&(b=Qd(a.b,2)));if(0<c&&(a.xa&&!--a.xa||rd(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.Ba++,0>d&&(d=a.b.Xa(b)),65535!=(d&65535)&&(a.nc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Nf(a){var b=a.b;if(b.A.W)throw Q(b,a.b.qa&65535),a.da(),-1;return!1}
|
||||
function ei(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);sd(d.Y[c>>>d.ka],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.v,c=a.aa(c),sd(d.Y[c>>>d.ka],!0);a.D=["bw"];a.mb=0}k.nb=function(a,b,c){var d=!0;c||xi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.i("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ka].nb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Ra=!0:(yi(this,a,a.length-1,"set"),fi(this)));return d};
|
||||
function xi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.aa(h)&&(!d||h.Ra)){f=!0;h.Ra||e||yi(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,sd(d.Y[c>>>d.ka],b==a.D));h.Ra||fi(a);break}}return f}function zi(a,b){for(var c=1;c<b.length;c++)yi(a,b,c);return b.length-1}function yi(a,b,c,d){c=b[c];a.i(b[0]+" "+J(a,c.F)+(d?" "+d:c.Kc?' "'+c.Kc+'"':""))}
|
||||
k.stop=function(a,b){if(this.A.W){this.A.W=!1;this.K=b-this.Kb;if(!this.O){b="stopped";if(this.K){a-=this.Jb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";Ge(this)&&(b+=this.Ba+" instructions, ",this.Ba=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else H(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}zd(this,!0);this.ub();wi(this,this.b.u[7]);this.ja=null}};function Ge(a){return 1<a.f.length||!!a.xa}
|
||||
function He(a,b,c){var d=-1;c||(d=a.b.Ya(b),0==d&&(b=Qd(a.b,2)));if(0<c&&(a.xa&&!--a.xa||rd(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.Ba++,0>d&&(d=a.b.Ya(b)),65535!=(d&65535)&&(a.oc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Nf(a){var b=a.b;if(b.A.W)throw R(b,a.b.qa&65535),a.da(),-1;return!1}
|
||||
function ei(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);sd(d.Y[c>>>d.ka],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.v,c=a.aa(c),sd(d.Y[c>>>d.ka],!0);a.D=["bw"];a.nb=0}k.ob=function(a,b,c){var d=!0;c||xi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.i("invalid address: "+K(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ka].ob(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Ra=!0:(yi(this,a,a.length-1,"set"),fi(this)));return d};
|
||||
function xi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.aa(h)&&(!d||h.Ra)){f=!0;h.Ra||e||yi(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,sd(d.Y[c>>>d.ka],b==a.D));h.Ra||fi(a);break}}return f}function zi(a,b){for(var c=1;c<b.length;c++)yi(a,b,c);return b.length-1}function yi(a,b,c,d){c=b[c];a.i(b[0]+" "+K(a,c.F)+(d?" "+d:c.Lc?' "'+c.Lc+'"':""))}
|
||||
function wi(a,b){if(void 0!==b)rd(a,b,1,a.f,!0),a.O=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Ra){if(!xi(a,a.f,c,!0))break;b=0}}}
|
||||
function rd(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.Ra)for(var l=a.aa(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Ra&&(xi(a,d,h,!0),e=!0);if(n=h.Pc){for(var f=!1,v=0;v<n.length;v++)if(!Ai(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.A.W||(f=!0)}if(f){e||yi(a,d,g,"hit");break}}}a.mb--;return f}
|
||||
function Bi(a,b,c,d){var e=Y(b.F),f=a.pa(b,2),g,h;for(h in a.xb)if(g=a.xb[h][f&h])break;g||(g=li);var l=g[0];0<=a.Ib.indexOf(l)&&(g=li,l=g[0]);var m=h="",n=ii[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=si(y);break;case 8:x="@"+si(y);break;case 16:7>y?x="("+si(y)+")+":(C=w.pa(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+si(y)+")+":(C=w.pa(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+si(y)+")";break;case 40:x="@-("+si(y)+")";break;case 48:C=w.pa(r,2);x=J(w,C,0,!0)+"("+si(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.pa(r,2),x="@"+J(w,C)+"("+si(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.pa(e,2)),null==e.F)break;while(e.F!=b.F)}g+=xa(f,24);g+=xa(n,5);h&&(g+=" "+h);if(c||m)g=xa(g,60)+";"+(c||""),g=a.b.A.yb?g+("cycles="+Bd(a.b).toString()+" cs="+p(a.b.Ob)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function Ci(a,b){switch(b){case "N":a=Od(a.b);break;case "Z":a=Nd(a.b);break;case "V":a=Md(a.b);break;case "C":a=Ld(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function Z(a,b){var c="",d=a.b;if(8>b)c=si(b),c+="="+J(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+J(a,d.$a[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+J(a,d.La[b-16]);else switch(b){case 20:c="PS="+J(a,bd(d));break;case 21:c="IR="+J(a,d.Rb);break;case 22:c="ER="+J(a,d.na);break;case 23:c="SL="+J(a,d.rb);break;case 24:c="MMR0="+J(a,Wc(d));break;case 25:c="MMR1="+J(a,Yc(d));break;case 26:c="MMR2="+J(a,Zc(d));break;case 27:c="MMR3="+J(a,d.Ta);break;case 28:a.w&&(c="AR="+J(a,a.w.va,3));break;case 29:a.w&&
|
||||
(c="DR="+J(a,a.w.qb));break;case 30:a.w&&mc(a.w)&&(c="SR="+J(a,a.w.Za,3))}c&&(c+=" ");return c}function Di(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ci(a,"T")+Ci(a,"N")+Ci(a,"Z")+Ci(a,"V")+Ci(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.sc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function fh(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],v=Aa(n,l,a.sc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({bf:b,F:c,Zc:d,ga:e,qc:f})}function Ei(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.F>>>0,h=f.Zc;if(e>=g&&e<g+h){e=Aa(f.qc,[e-g],a.sc);0<=e?Fi(a,b,e,d):c&&(e=~e,Fi(a,b,e-1,d),Fi(a,b,e,d));break}}return d}
|
||||
function Fi(a,b,c,d){var e={},f=a.I[b].qc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ga[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function Gi(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return ci(a)||a.i("no variables"),!0;if(!c[2])return ci(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Zh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
||||
function Hi(a,b,c){var d=null;if(b=ni(a,b,!0)){a.aa(b);var e=Ei(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.i(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.i(f),d||(d=f))}else c&&a.i("no symbols")}return d}
|
||||
function ui(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trm\tdump misc registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.b;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.i("missing value for "+b[1]);return}g=Zh(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.u[6]=g&65535;break;case "PC":case "R7":Q(e,
|
||||
g);a.L=Y(e.u[7]);break;case "N":e.Z=g?32768:0;break;case "Z":e.$=g?0:1;break;case "V":e.V=g?32768:0;break;case "C":e.U=g?65536:0;break;case "PS":cd(e,g);break;case "IR":ad(e,g);break;case "ER":e.na=g;d=!0;break;case "SL":e.rb=g|255;break;case "MMR0":Xc(e,g);d=!0;break;case "MMR3":$c(e,g);d=!0;break;case "AR":a.w&&(d=a.w,jc(d,d.va=g));d=!0;break;case "DR":a.w&&(d=a.w,ic(d,d.qb=g));d=!0;break;case "SR":if(a.w&&mc(a.w)){kc(a.w,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.u[b]=
|
||||
g&65535;break}a.i("unknown register: "+f);return}a.C.sa();a.i("updated registers:")}}a.i(Di(a,d));c&&(a.L=Y(e.u[7]),vi(a,J(a,a.L.F)))}}function Ii(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.i(c[2]):bi(a,null,c[2].charCodeAt(0)):Zh(a,b,!0)}
|
||||
function Ji(a,b,c){if("?"==c)a.i("trace commands:"),a.i("\tt [#]\ttrace # instructions"),a.i("\ttr [#]\ttrace # instructions with register updates"),a.i("\ttc [#]\ttrace # cycles"),a.i("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=ai(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);a.zb=b;Ta(c,function(){return vb(a,!0)&&a.jb(e,d,!1)},function(){a.w&&a.w.stop&&a.w.stop();a.C.sa(-1);vb(a,!1)})}}
|
||||
function rd(a,b,c,d,e){var f=!1;if(!a.nb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Ra)for(var l=a.aa(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Ra&&(xi(a,d,h,!0),e=!0);if(n=h.Qc){for(var f=!1,r=0;r<n.length;r++)if(!Ai(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var t=r+1;t<n.length&&n[t].indexOf("else");t++)r++;if(t==n.length){f=!0;break}}a.b.A.W||(f=!0)}if(f){e||yi(a,d,g,"hit");break}}}a.nb--;return f}
|
||||
function Bi(a,b,c,d){var e=Y(b.F),f=a.pa(b,2),g,h;for(h in a.qb)if(g=a.qb[h][f&h])break;g||(g=li);var l=g[0];0<=a.Ib.indexOf(l)&&(g=li,l=g[0]);var m=h="",n=ii[l],r=g.length-1;l||r||(h=K(a,f));for(l=1;l<=r;l++){var t=g[l];if(void 0!==t){var v;v=a;var z=t,t=b,x="",B=z&61440;if(4096==B)t=t.F+((f&255)<<24>>23)&65535,x=K(v,t);else if(8192==B)t=t.F-((f&63)<<1)&65535,x=K(v,t);else if(12288==B)x=K(v,f&7,1);else if(24576==B)x=K(v,f&63,1);else if(32768==B)x=K(v,f&255,1);else if(B=f&z,z&4032&&(B>>=6,z>>=6),
|
||||
z&63)switch(z=B&7,B&56){case 0:x=si(z);break;case 8:x="@"+si(z);break;case 16:7>z?x="("+si(z)+")+":(B=v.pa(t,2),x="#"+K(v,B,0,!0));break;case 24:7>z?x="@("+si(z)+")+":(B=v.pa(t,2),x="@#"+K(v,B,0,!0));break;case 32:x="-("+si(z)+")";break;case 40:x="@-("+si(z)+")";break;case 48:B=v.pa(t,2);x=K(v,B,0,!0)+"("+si(z)+")";7==z&&(x=K(v,B+t.F&65535));break;case 56:B=v.pa(t,2),x="@"+K(v,B)+"("+si(z)+")",7==z&&(x="@"+K(v,B+t.F&65535))}v=x;if(!v||!v.length){h="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]);
|
||||
0<h.length&&(h+=",");h+=v||"???"}}f="";g=K(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+K(a,a.pa(e,2)),null==e.F)break;while(e.F!=b.F)}g+=xa(f,24);g+=xa(n,5);h&&(g+=" "+h);if(c||m)g=xa(g,60)+";"+(c||""),g=a.b.A.yb?g+("cycles="+Bd(a.b).toString()+" cs="+p(a.b.Ob)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function Ci(a,b){switch(b){case "N":a=Od(a.b);break;case "Z":a=Nd(a.b);break;case "V":a=Md(a.b);break;case "C":a=Ld(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function Z(a,b){var c="",d=a.b;if(8>b)c=si(b),c+="="+K(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+K(a,d.$a[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+K(a,d.La[b-16]);else switch(b){case 20:c="PS="+K(a,bd(d));break;case 21:c="IR="+K(a,d.Rb);break;case 22:c="ER="+K(a,d.na);break;case 23:c="SL="+K(a,d.hb);break;case 24:c="MMR0="+K(a,Wc(d));break;case 25:c="MMR1="+K(a,Yc(d));break;case 26:c="MMR2="+K(a,Zc(d));break;case 27:c="MMR3="+K(a,d.Ta);break;case 28:a.w&&(c="AR="+K(a,a.w.va,3));break;case 29:a.w&&
|
||||
(c="DR="+K(a,a.w.sb));break;case 30:a.w&&mc(a.w)&&(c="SR="+K(a,a.w.Za,3))}c&&(c+=" ");return c}function Di(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ci(a,"T")+Ci(a,"N")+Ci(a,"Z")+Ci(a,"V")+Ci(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.tc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function fh(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],r=Aa(n,l,a.tc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({ef:b,F:c,bd:d,ga:e,rc:f})}function Ei(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.bd;if(e>=g&&e<g+h){e=Aa(f.rc,[e-g],a.tc);0<=e?Fi(a,b,e,d):c&&(e=~e,Fi(a,b,e-1,d),Fi(a,b,e,d));break}}return d}
|
||||
function Fi(a,b,c,d){var e={},f=a.I[b].rc,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 Gi(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return ci(a)||a.i("no variables"),!0;if(!c[2])return ci(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Zh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
||||
function Hi(a,b,c){var d=null;if(b=ni(a,b,!0)){a.aa(b);var e=Ei(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+q(f)),f=e[0]+" ("+K(a,e[1])+")"+g,c&&a.i(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+q(f)),f=e[4]+" ("+K(a,e[5])+")"+g,c&&a.i(f),d||(d=f))}else c&&a.i("no symbols")}return d}
|
||||
function ui(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trm\tdump misc registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.b;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.i("missing value for "+b[1]);return}g=Zh(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.u[6]=g&65535;break;case "PC":case "R7":R(e,
|
||||
g);a.L=Y(e.u[7]);break;case "N":e.Z=g?32768:0;break;case "Z":e.$=g?0:1;break;case "V":e.V=g?32768:0;break;case "C":e.U=g?65536:0;break;case "PS":cd(e,g);break;case "IR":ad(e,g);break;case "ER":e.na=g;d=!0;break;case "SL":e.hb=g|255;break;case "MMR0":Xc(e,g);d=!0;break;case "MMR3":$c(e,g);d=!0;break;case "AR":a.w&&(d=a.w,jc(d,d.va=g));d=!0;break;case "DR":a.w&&(d=a.w,ic(d,d.sb=g));d=!0;break;case "SR":if(a.w&&mc(a.w)){kc(a.w,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.u[b]=
|
||||
g&65535;break}a.i("unknown register: "+f);return}a.C.sa();a.i("updated registers:")}}a.i(Di(a,d));c&&(a.L=Y(e.u[7]),vi(a,K(a,a.L.F)))}}function Ii(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.i(c[2]):bi(a,null,c[2].charCodeAt(0)):Zh(a,b,!0)}
|
||||
function Ji(a,b,c){if("?"==c)a.i("trace commands:"),a.i("\tt [#]\ttrace # instructions"),a.i("\ttr [#]\ttrace # instructions with register updates"),a.i("\ttc [#]\ttrace # cycles"),a.i("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=ai(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);a.zb=b;Oa(c,function(){return vb(a,!0)&&a.kb(e,d,!1)},function(){a.w&&a.w.stop&&a.w.stop();a.C.sa(-1);vb(a,!1)})}}
|
||||
function vi(a,b,c,d){if(b=ni(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=ai(a,c.substr(1)),null!=c&&(d=c);else{d=ni(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.i("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=wb(a,!1)||a.O?a.K:null;var g=null!=f?"cycles":null,h=Ei(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.i(m)}h[3]&&(g=h[3],f=null);f=Bi(a,b,g,f);a.i(f);a.L=b;e-=b.F-l;c++}}}
|
||||
function Ai(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+J(a,a.S.F)),a.L=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ja=null;if(xb(a)&&0<b.length){a.T&&(b="a "+J(a,a.S.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=
|
||||
ni(a,g[1],!0);if(v)if(a.S=v,void 0===g[2])a.i("begin assemble at "+J(a,v.F)),a.T=!0,a.C.sa();else{var r;a.i("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.Fb(v,r[w],1);a.i(Bi(a,a.S))}}break;case "b":a:{var y=g[0],x=g[1],C=b;if("?"==x)a.i("breakpoint commands:"),a.i("\tbp [#]\tset exec breakpoint at addr #"),a.i("\tbr [#]\tset read breakpoint at addr #"),a.i("\tbw [#]\tset write breakpoint at addr #"),a.i("\tbc [#]\tclear breakpoint at addr #"),a.i("\tbl\tlist all breakpoints"),
|
||||
a.i("\tbn [#]\tbreak after # instruction(s)");else{var la=y.charAt(1);if("l"==la){var Ma;Ma=0+zi(a,a.f);Ma+=zi(a,a.M);(Ma+=zi(a,a.D))||a.i("no breakpoints")}else if("n"==la)a.xa=ai(a,x),a.i("break after "+a.xa+" instruction(s)");else if(void 0===x)a.i("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=ni(a,x,!0),!P))break a;"c"==la?null==P.F?(ei(a),a.i("all breakpoints cleared")):xi(a,a.f,P)||xi(a,a.M,P)||xi(a,a.D,P)||a.i("breakpoint missing: "+J(a,P.F)):null!=P.F&&(ri(a,P,C),"p"==la?a.nb(a.f,
|
||||
P):"r"==la?a.nb(a.M,P):"w"==la?a.nb(a.D,P):a.i("unknown breakpoint command: "+la))}}}break;case "c":a.Va&&(a.Va.value="");break;case "d":a:{var kb,Oa=g[0],oa=g[1],Pa=g[2],bj=g[3];if("?"==oa){var lb="";for(kb in Cb)a.Ma[kb]&&(lb&&(lb+=","),lb+=kb);lb+=",state,symbols";a.i("dump memory commands:");a.i("\tdb [a] [#] dump # bytes at address a");a.i("\tdw [a] [#] dump # words at address a");a.i("\tdd [a] [#] dump # dwords at address a");a.i("\tdh [#] [#] dump # instructions from history");
|
||||
lb.length&&a.i("dump extension commands:\n\t"+lb)}else if("state"==oa){var Mg=Ki(a.C,!0);"console"==Pa?console.log(Mg):(a.Va&&(a.Va.value=""),a.i(Mg))}else if("symbols"==oa)for(var Sd=0;Sd<a.I.length;Sd++){var Td=a.I[Sd],mb;for(mb in Td.ga)if("."!=mb.charAt(0)){var Ng=Td.ga[mb].o;if(void 0!==Ng){var Og=Td.ga[mb].l;Og&&(mb=Og);a.i(J(a,Ng)+" "+mb)}}}else{if("d"==Oa){for(kb in Cb)if(g[1]==kb){var Pg=a.Ma[kb];Pg?(g.shift(),g.shift(),Pg(g)):a.i("no dump registered for "+oa);break a}oa||(Oa=a.Lb||"dw")}else a.Lb=
|
||||
Oa;if("dh"==Oa){var Qg=oa,Rg=Pa,Sg="",Tg=0,ha=a.ba,pa=a.H;if(pa.length){var ba=+Qg||a.ob,Vb=+Rg||10;isNaN(ba)?ba=Vb:Sg="more ";ba>pa.length&&(a.i("note: only "+pa.length+" available"),ba=pa.length);ha-=ba;0>ha&&(null==pa[pa.length-1].F?(ba=ha+ba,ha=0):ha+=pa.length);var Ud=[];"call"==Rg&&(Vb=1E5,Ud=["CALL"]);for(void 0!==Qg&&a.i(ba+" instructions earlier:");0<Vb&&ha!=a.ba;){var Ug=pa[ha++];if(null==Ug.F)break;var Wb=Y(Ug.F),cj=ba--,Vg=Bi(a,Wb,"history",cj);(!Ud.length||0<=Vg.indexOf(Ud[0]))&&a.i(Vg);
|
||||
Wb.fc&&(ha+=Wb.fc,Vb-=Wb.fc,ba-=Wb.fc);ha>=pa.length&&(ha=0);a.ob=ba;Tg++;Vb--}}Tg||(a.i("no "+Sg+"history available"),a.ob=void 0)}else{var nb=ni(a,oa);if(nb){var Xb=0,Vd=!1,Wd="ds"==Oa;Pa&&(Vd=!0,"l"==Pa.charAt(0)&&(Vd=!1,Pa=Pa.substr(1)||bj),Xb=ai(a,Pa)>>>0,65536<Xb&&(Xb=65536));for(var ob="dd"==Oa?4:"db"==Oa?1:2,Lc=(Vd?Xb-nb.F:ob*Xb)||128,Xd=Wd?16:a.ca,dj=(Lc+Xd-1)/Xd|0||1,Qa="";dj--&&0<Lc;){for(var Ra="",Yd="",oa=J(a,nb.F),Mc=Xd,Yb=0,Zb=0;0<Mc&&0<Lc;){var pb=1,Nc=1==ob?a.Yb(nb,pb):a.pa(nb,pb=
|
||||
2),Yb=Yb|Nc<<(Zb<<3),Zb=Zb+pb;Zb==ob&&(Wd?(Ra&&(Ra+=","),Ra+="0x"+p(Yb,2*ob)):(Ra+=J(a,Yb,ob),Ra+=1==ob?9==Mc?"-":" ":" "),Yb=Zb=0);Mc-=pb;for(Lc-=pb;pb--;)var Zd=Nc&255,Yd=Yd+(32<=Zd&&128>Zd?String.fromCharCode(Zd):"."),Nc=Nc>>8}Qa&&(Qa+="\n");Qa=Wd?Qa+(Ra+","):Qa+(oa+" "+Ra+(0==Mc?" "+Yd:""))}Qa&&a.i(Qa);a.lb=nb}}}}break;case "e":if("else"==g[0])break;var qb,$d,ae,be,ce=g[0],de=g[1];"eb"==ce?(qb=1,$d=255,ae=a.Yb,be=a.Fb):"e"==ce||"ew"==ce?(qb=2,$d=65535,ae=a.pa,be=a.ub):de=null;if(null==de)a.i("edit memory commands:"),
|
||||
a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Oc=ni(a,de);if(Oc)for(var Pc=2;Pc<g.length;Pc++){var $b=Zh(a,g[Pc]);if(void 0===$b){a.i("unrecognized value: "+g[Pc]);break}$b&~$d&&a.i("warning: "+p($b)+" exceeds "+qb+"-byte value");a.i("changing "+J(a,Oc.F)+(F(a,64)?"":" from "+J(a,ae.call(a,Oc),qb))+" to "+J(a,$b,qb));be.call(a,Oc,$b,qb)}}break;case "g":a:{var Wg=g[1],ej=b;if(void 0!==Wg){var ee=ni(a,Wg,!0);if(!ee)break a;ri(a,ee,ej);a.nb(a.f,
|
||||
ee,!0)}a.ib(!0,c)}break;case "h":a.A.W?(c||a.i("halting"),a.da()):wb(a,!0)||c||a.i("already halted");break;case "i":if("if"==g[0]){var fe;var ac=b.substr(2),ac=ya(ac);Zh(a,ac)?(c||a.i("true: "+ac),fe=!0):(c||a.i("false: "+ac),fe=!1);fe||(d=!1);break}f=!0;break;case "k":var fj=g[0];if("?"==g[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var ge=0,he=Y(),bc=Y(a.b.u[6]);for(a.i("stack trace for "+J(a,bc.F));10>ge;){for(var Sa=null,gj=256;65536>
|
||||
bc.F>>>0;){he.F=a.pa(bc,2);if(null==bc.F||!gj--)break;if(!(he.F&1)){for(var hj=a,Qc=he,Xg=null,cc=Qc.F,Yg=cc,ie=1;6>=ie&&cc;ie++){if(2<ie){Qc.F=cc;var Rc=Bi(hj,Qc);if(0<=Rc.indexOf("JSR")){var Zg=Rc.indexOf(" ");if(cc+(Rc.indexOf(" ",Zg+1)-Zg-1)/2==Yg){Xg=Rc;break}}}cc-=2}Qc.F=Yg;if(Sa=Xg)break}}if(!Sa||null==Sa)break;var $g=null;if("ks"==fj){var ah=Sa.match(/[0-9A-F]+$/);ah&&($g=Hi(a,ah[0]))}Sa=xa(Sa,50)+" ;"+($g||"stack="+J(a,bc.F));a.i(Sa);ge++}ge||a.i("no return addresses found")}break;case "l":if("ln"==
|
||||
g[0]){Hi(a,g[1],!0);break}f=!0;break;case "m":a:{var qa,ra=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Fa=0;if("all"==G)Fa=1878917119,G=null;else if("on"==G)ra=!0,G=null;else if("off"==G)ra=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(qa in Cb)if(G==qa){Fa=Cb[qa];ra=!!(a.la&Fa);break}if(!Fa){a.i("unknown message category: "+G);break a}}if(Fa)if("on"==g[2])a.la|=Fa,ra=!0;else if("off"==g[2]&&(a.la&=~Fa,ra=!1,1073741824==Fa)){for(var je=0;je<a.Aa.length;je++)a.i(a.Aa[je]);
|
||||
a.Aa=[]}}var ij=0,dc="";for(qa in Cb)if(!G||G==qa){var jj=!!(a.la&Cb[qa]);if(null===ra||ra==jj)dc&&(dc+=","),++ij%10||(dc+="\n\t"),"key"==qa&&(qa="keys"),dc+=qa}void 0===G&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.i((null!==ra?ra?"messages on: ":"messages off: ":"message categories:\n\t")+(dc||"none"));fi(a)}break;case "p":if("print"==g[0]){Ii(a,b.substr(5));break}var kj=g[0];if("?"==g[1])a.i("step commands:"),a.i("\tp\tstep over instruction"),a.i("\tpr\tstep over instruction with register update");
|
||||
else{var bh="pr"==kj?1:0,ch=1+bh;if(a.O)a.i("step in progress");else{var Sc=Y(a.b.u[7]),ec=a.pa(Sc);3==ec||4==ec||34816==(ec&65280)||35072==(ec&65280)?(a.O=ch,oi(Sc,2)):2048==(ec&65024)&&(Bi(a,Sc),a.O=ch);a.O?(a.nb(a.f,Sc,!0),a.ib()||(a.C&&a.C.tb(),a.O=0)):Ji(a,bh?"tr":"t")}}break;case "r":if("reset"==b){a.C&&a.C.reset();break}ui(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var fc=+g[2];if(8==fc||10==fc||16==fc)a.ca=fc;else{a.i("invalid base: "+fc);break}}a.i("default base: "+a.ca);break;
|
||||
case "cs":var gc;void 0!==g[3]&&(gc=+g[3]);switch(g[2]){case "int":a.b.Ab=gc;break;case "start":a.b.Pb=gc;break;case "stop":a.b.Bb=gc;break;default:a.i("unknown cs option");break a}void 0!==gc&&yd(a.b);a.i("checksums "+(a.b.A.yb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Cd(a.b,+g[2])||a.i("warning: using 1x multiplier, previous target not reached"));a.i("target speed: "+(a.b.pb.toFixed(2)+"Mhz")+" ("+a.b.gb+"x)");break;default:if(g[1]){a.i("unknown option: "+g[1]);break}case "?":a.i("debugger options:"),
|
||||
a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":Ji(a,g[0],g[1]);break;case "u":vi(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Gi(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.i("PDPjs version 1.30.3 ("+a.b.Ya+",RELEASE"+(Ab?",TYPEDARRAYS":",LONGARRAYS")+")");a.i(window?window.navigator.userAgent:
|
||||
"");break}f=!0;break;case "?":if(g[1]){Ii(a,b.substr(1));break}var ke="commands:",le;for(le in hi)ke+="\n"+xa(le,9)+hi[le];He(a)||(ke+="\nnote: history disabled if no exec breakpoints");a.i(ke);break;default:f=!0}f&&(a.i("unknown command: "+b),d=!1)}}catch(dh){a.i("debugger error: "+(dh.stack||dh.message)),d=!1}return d}function Ad(a,b,c){b=Xh(a,b,c);for(var d in b)if(!Ai(a,b[+d]))return!1;return!0}
|
||||
$a(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new di(d);B(d,c)}});
|
||||
function Li(a,b,c){t.call(this,"Computer",a,Li,67108864);this.A.ia=!1;Mi(this,b);this.L=wd(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Ni;this.I=null;this.D=this.S=!1;this.ba=wd(this,"url")||"";(Math.random()+.1).toString(36);this.g=Oi(this);if(this.b=ub("CPU",this.id)){this.j=ub("Debugger",this.id);this.v=new oc({id:this.Ua+".bus",busWidth:this.X},this.b,this.j);var d,e=sb(this.id);if((this.w=ub("Panel",this.id))&&this.w.Va)for(b=0;b<e.length;b++)d=e[b],d.R=this.w.R,d.i=this.w.i,
|
||||
d.Va=this.w.Va;this.i("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.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ia&&d.Ia(this,this.v,this.b,this.j);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=wd(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Ni),this.f&&(this.K=
|
||||
new O(this,"1.30.3"),Pi(this.K)?b=null:delete this.K);!b&&this.f&&(b=Qi(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.R("Unable to load machine state from server (error "+c+(b?": "+ya(b):"")+")")):(g.I=b,g.S=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Ri(this,this.Qb)}else q("Unable to find CPU component")}z(Li);var Ni=0;
|
||||
function Mi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.T=b}function wd(a,b,c){var d=b.toLowerCase(),d=eb[b]||eb[d];void 0===d&&a.T&&(d=a.T[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Ri(a,b,c){for(var d=sb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!xb(f)){xb(f,function(){Ri(a,b,c)});return}}b.call(a,c)}
|
||||
function Si(a,b){var c=new O(a,"1.30.3","validate");if(Pi(c)&&Ti(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.R("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Li.prototype;
|
||||
k.Qb=function(a){void 0===a&&(a=this.f||(this.I?1:Ni));if(!this.C){this.C++;var b=!1,c=!1;this.O=!1;var d=this.K||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Ni){if(Pi(d,this.I)){this.B=new O(this,"1.30.3","failsafe");Pi(this.B)&&(Ui(this,d),a=2,Vi(this.B));this.B.set("timestamp",Ca());Wi(this.B);var e=this.f&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ti(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Pi(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.R("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.i(f+": "+g),Vi(d),Pi(d)?(c=Ti(d),e=!0):c=!1))}e&&Si(this,c?d:null)}else 2==a&&d.clear()}else Si(this);delete this.I;delete this.K}e=sb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Xi(this,g,d,b,c));b=[d,a,c];-1!=a?Ri(this,this.tc,b):this.tc(b)}};
|
||||
function Xi(a,b,c,d,e){if(!b.A.ia){b.A.ia=!0;if(b.Ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ka(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.S?(c.clear(),a.f=Ni,window&&window.location.reload()):a.O=!0,b.Ka(null),e=!1)}if(!d&&b.Bc)for(a=b.Bc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
k.tc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Xi(this,this.b,b,c,a),this.sa(),this.b.wb());this.O&&(Ui(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0};
|
||||
function Ai(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+K(a,a.S.F)),a.L=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ja=null;if(xb(a)&&0<b.length){a.T&&(b="a "+K(a,a.S.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 r=
|
||||
ni(a,g[1],!0);if(r)if(a.S=r,void 0===g[2])a.i("begin assemble at "+K(a,r.F)),a.T=!0,a.C.sa();else{var t;a.i("not supported yet");t=[];if(t.length){for(var v=0;v<t.length;v++)a.Fb(r,t[v],1);a.i(Bi(a,a.S))}}break;case "b":a:{var z=g[0],x=g[1],B=b;if("?"==x)a.i("breakpoint commands:"),a.i("\tbp [#]\tset exec breakpoint at addr #"),a.i("\tbr [#]\tset read breakpoint at addr #"),a.i("\tbw [#]\tset write breakpoint at addr #"),a.i("\tbc [#]\tclear breakpoint at addr #"),a.i("\tbl\tlist all breakpoints"),
|
||||
a.i("\tbn [#]\tbreak after # instruction(s)");else{var ma=z.charAt(1);if("l"==ma){var Na;Na=0+zi(a,a.f);Na+=zi(a,a.M);(Na+=zi(a,a.D))||a.i("no breakpoints")}else if("n"==ma)a.xa=ai(a,x),a.i("break after "+a.xa+" instruction(s)");else if(void 0===x)a.i("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=ni(a,x,!0),!P))break a;"c"==ma?null==P.F?(ei(a),a.i("all breakpoints cleared")):xi(a,a.f,P)||xi(a,a.M,P)||xi(a,a.D,P)||a.i("breakpoint missing: "+K(a,P.F)):null!=P.F&&(ri(a,P,B),"p"==ma?a.ob(a.f,
|
||||
P):"r"==ma?a.ob(a.M,P):"w"==ma?a.ob(a.D,P):a.i("unknown breakpoint command: "+ma))}}}break;case "c":a.Wa&&(a.Wa.value="");break;case "d":a:{var lb,Pa=g[0],pa=g[1],Qa=g[2],bj=g[3];if("?"==pa){var mb="";for(lb in Cb)a.Ma[lb]&&(mb&&(mb+=","),mb+=lb);mb+=",state,symbols";a.i("dump memory commands:");a.i("\tdb [a] [#] dump # bytes at address a");a.i("\tdw [a] [#] dump # words at address a");a.i("\tdd [a] [#] dump # dwords at address a");a.i("\tdh [#] [#] dump # instructions from history");
|
||||
mb.length&&a.i("dump extension commands:\n\t"+mb)}else if("state"==pa){var Mg=Ki(a.C,!0);"console"==Qa?console.log(Mg):(a.Wa&&(a.Wa.value=""),a.i(Mg))}else if("symbols"==pa)for(var Sd=0;Sd<a.I.length;Sd++){var Td=a.I[Sd],nb;for(nb in Td.ga)if("."!=nb.charAt(0)){var Ng=Td.ga[nb].o;if(void 0!==Ng){var Og=Td.ga[nb].l;Og&&(nb=Og);a.i(K(a,Ng)+" "+nb)}}}else{if("d"==Pa){for(lb in Cb)if(g[1]==lb){var Pg=a.Ma[lb];Pg?(g.shift(),g.shift(),Pg(g)):a.i("no dump registered for "+pa);break a}pa||(Pa=a.Lb||"dw")}else a.Lb=
|
||||
Pa;if("dh"==Pa){var Qg=pa,Rg=Qa,Sg="",Tg=0,ia=a.ba,qa=a.H;if(qa.length){var ca=+Qg||a.pb,Wb=+Rg||10;isNaN(ca)?ca=Wb:Sg="more ";ca>qa.length&&(a.i("note: only "+qa.length+" available"),ca=qa.length);ia-=ca;0>ia&&(null==qa[qa.length-1].F?(ca=ia+ca,ia=0):ia+=qa.length);var Ud=[];"call"==Rg&&(Wb=1E5,Ud=["CALL"]);for(void 0!==Qg&&a.i(ca+" instructions earlier:");0<Wb&&ia!=a.ba;){var Ug=qa[ia++];if(null==Ug.F)break;var Xb=Y(Ug.F),cj=ca--,Vg=Bi(a,Xb,"history",cj);(!Ud.length||0<=Vg.indexOf(Ud[0]))&&a.i(Vg);
|
||||
Xb.fc&&(ia+=Xb.fc,Wb-=Xb.fc,ca-=Xb.fc);ia>=qa.length&&(ia=0);a.pb=ca;Tg++;Wb--}}Tg||(a.i("no "+Sg+"history available"),a.pb=void 0)}else{var ob=ni(a,pa);if(ob){var Yb=0,Vd=!1,Wd="ds"==Pa;Qa&&(Vd=!0,"l"==Qa.charAt(0)&&(Vd=!1,Qa=Qa.substr(1)||bj),Yb=ai(a,Qa)>>>0,65536<Yb&&(Yb=65536));for(var pb="dd"==Pa?4:"db"==Pa?1:2,Mc=(Vd?Yb-ob.F:pb*Yb)||128,Xd=Wd?16:a.ca,dj=(Mc+Xd-1)/Xd|0||1,Ra="";dj--&&0<Mc;){for(var Sa="",Yd="",pa=K(a,ob.F),Nc=Xd,Zb=0,$b=0;0<Nc&&0<Mc;){var qb=1,Oc=1==pb?a.Yb(ob,qb):a.pa(ob,qb=
|
||||
2),Zb=Zb|Oc<<($b<<3),$b=$b+qb;$b==pb&&(Wd?(Sa&&(Sa+=","),Sa+="0x"+p(Zb,2*pb)):(Sa+=K(a,Zb,pb),Sa+=1==pb?9==Nc?"-":" ":" "),Zb=$b=0);Nc-=qb;for(Mc-=qb;qb--;)var Zd=Oc&255,Yd=Yd+(32<=Zd&&128>Zd?String.fromCharCode(Zd):"."),Oc=Oc>>8}Ra&&(Ra+="\n");Ra=Wd?Ra+(Sa+","):Ra+(pa+" "+Sa+(0==Nc?" "+Yd:""))}Ra&&a.i(Ra);a.mb=ob}}}}break;case "e":if("else"==g[0])break;var rb,$d,ae,be,ce=g[0],de=g[1];"eb"==ce?(rb=1,$d=255,ae=a.Yb,be=a.Fb):"e"==ce||"ew"==ce?(rb=2,$d=65535,ae=a.pa,be=a.vb):de=null;if(null==de)a.i("edit memory commands:"),
|
||||
a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Pc=ni(a,de);if(Pc)for(var Qc=2;Qc<g.length;Qc++){var ac=Zh(a,g[Qc]);if(void 0===ac){a.i("unrecognized value: "+g[Qc]);break}ac&~$d&&a.i("warning: "+p(ac)+" exceeds "+rb+"-byte value");a.i("changing "+K(a,Pc.F)+(H(a,64)?"":" from "+K(a,ae.call(a,Pc),rb))+" to "+K(a,ac,rb));be.call(a,Pc,ac,rb)}}break;case "g":a:{var Wg=g[1],ej=b;if(void 0!==Wg){var ee=ni(a,Wg,!0);if(!ee)break a;ri(a,ee,ej);a.ob(a.f,
|
||||
ee,!0)}a.jb(!0,c)}break;case "h":a.A.W?(c||a.i("halting"),a.da()):wb(a,!0)||c||a.i("already halted");break;case "i":if("if"==g[0]){var fe;var bc=b.substr(2),bc=ya(bc);Zh(a,bc)?(c||a.i("true: "+bc),fe=!0):(c||a.i("false: "+bc),fe=!1);fe||(d=!1);break}f=!0;break;case "k":var fj=g[0];if("?"==g[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var ge=0,he=Y(),cc=Y(a.b.u[6]);for(a.i("stack trace for "+K(a,cc.F));10>ge;){for(var Ta=null,gj=256;65536>
|
||||
cc.F>>>0;){he.F=a.pa(cc,2);if(null==cc.F||!gj--)break;if(!(he.F&1)){for(var hj=a,Rc=he,Xg=null,dc=Rc.F,Yg=dc,ie=1;6>=ie&&dc;ie++){if(2<ie){Rc.F=dc;var Sc=Bi(hj,Rc);if(0<=Sc.indexOf("JSR")){var Zg=Sc.indexOf(" ");if(dc+(Sc.indexOf(" ",Zg+1)-Zg-1)/2==Yg){Xg=Sc;break}}}dc-=2}Rc.F=Yg;if(Ta=Xg)break}}if(!Ta||null==Ta)break;var $g=null;if("ks"==fj){var ah=Ta.match(/[0-9A-F]+$/);ah&&($g=Hi(a,ah[0]))}Ta=xa(Ta,50)+" ;"+($g||"stack="+K(a,cc.F));a.i(Ta);ge++}ge||a.i("no return addresses found")}break;case "l":if("ln"==
|
||||
g[0]){Hi(a,g[1],!0);break}f=!0;break;case "m":a:{var ra,sa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ga=0;if("all"==G)Ga=1878917119,G=null;else if("on"==G)sa=!0,G=null;else if("off"==G)sa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(ra in Cb)if(G==ra){Ga=Cb[ra];sa=!!(a.la&Ga);break}if(!Ga){a.i("unknown message category: "+G);break a}}if(Ga)if("on"==g[2])a.la|=Ga,sa=!0;else if("off"==g[2]&&(a.la&=~Ga,sa=!1,1073741824==Ga)){for(var je=0;je<a.Aa.length;je++)a.i(a.Aa[je]);
|
||||
a.Aa=[]}}var ij=0,ec="";for(ra in Cb)if(!G||G==ra){var jj=!!(a.la&Cb[ra]);if(null===sa||sa==jj)ec&&(ec+=","),++ij%10||(ec+="\n\t"),"key"==ra&&(ra="keys"),ec+=ra}void 0===G&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.i((null!==sa?sa?"messages on: ":"messages off: ":"message categories:\n\t")+(ec||"none"));fi(a)}break;case "p":if("print"==g[0]){Ii(a,b.substr(5));break}var kj=g[0];if("?"==g[1])a.i("step commands:"),a.i("\tp\tstep over instruction"),a.i("\tpr\tstep over instruction with register update");
|
||||
else{var bh="pr"==kj?1:0,ch=1+bh;if(a.O)a.i("step in progress");else{var Tc=Y(a.b.u[7]),fc=a.pa(Tc);3==fc||4==fc||34816==(fc&65280)||35072==(fc&65280)?(a.O=ch,oi(Tc,2)):2048==(fc&65024)&&(Bi(a,Tc),a.O=ch);a.O?(a.ob(a.f,Tc,!0),a.jb()||(a.C&&a.C.ub(),a.O=0)):Ji(a,bh?"tr":"t")}}break;case "r":if("reset"==b){a.C&&a.C.reset();break}ui(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var gc=+g[2];if(8==gc||10==gc||16==gc)a.ca=gc;else{a.i("invalid base: "+gc);break}}a.i("default base: "+a.ca);break;
|
||||
case "cs":var hc;void 0!==g[3]&&(hc=+g[3]);switch(g[2]){case "int":a.b.Ab=hc;break;case "start":a.b.Pb=hc;break;case "stop":a.b.Bb=hc;break;default:a.i("unknown cs option");break a}void 0!==hc&&yd(a.b);a.i("checksums "+(a.b.A.yb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Cd(a.b,+g[2])||a.i("warning: using 1x multiplier, previous target not reached"));a.i("target speed: "+(a.b.rb.toFixed(2)+"Mhz")+" ("+a.b.gb+"x)");break;default:if(g[1]){a.i("unknown option: "+g[1]);break}case "?":a.i("debugger options:"),
|
||||
a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":Ji(a,g[0],g[1]);break;case "u":vi(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Gi(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.i("PDPjs version 1.30.3 ("+a.b.fb+",RELEASE"+(Ab?",TYPEDARRAYS":",LONGARRAYS")+")");a.i(window?window.navigator.userAgent:
|
||||
"");break}f=!0;break;case "?":if(g[1]){Ii(a,b.substr(1));break}var ke="commands:",le;for(le in hi)ke+="\n"+xa(le,9)+hi[le];Ge(a)||(ke+="\nnote: history disabled if no exec breakpoints");a.i(ke);break;default:f=!0}f&&(a.i("unknown command: "+b),d=!1)}}catch(dh){a.i("debugger error: "+(dh.stack||dh.message)),d=!1}return d}function Ad(a,b,c){b=Xh(a,b,c);for(var d in b)if(!Ai(a,b[+d]))return!1;return!0}
|
||||
$a(function(){for(var a=E(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new di(d);D(d,c)}});
|
||||
function Li(a,b,c){w.call(this,"Computer",a,Li,67108864);this.A.ia=!1;Mi(this,b);this.L=wd(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Ni;this.I=null;this.D=this.S=!1;this.ba=wd(this,"url")||"";(Math.random()+.1).toString(36);this.g=Oi(this);if(this.b=ub("CPU",this.id)){this.j=ub("Debugger",this.id);this.v=new oc({id:this.Ua+".bus",busWidth:this.X},this.b,this.j);var d,e=sb(this.id);if((this.w=ub("Panel",this.id))&&this.w.Wa)for(b=0;b<e.length;b++)d=e[b],d.R=this.w.R,d.i=this.w.i,
|
||||
d.Wa=this.w.Wa;this.i("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.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ia&&d.Ia(this,this.v,this.b,this.j);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=wd(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Ni),this.f&&(this.K=
|
||||
new Q(this,"1.30.3"),Pi(this.K)?b=null:delete this.K);!b&&this.f&&(b=Qi(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.R("Unable to load machine state from server (error "+c+(b?": "+ya(b):"")+")")):(g.I=b,g.S=!0);I(g)})}else I(this);this.G.power||(this.L=!0);!c&&this.L&&Ri(this,this.Qb)}else u("Unable to find CPU component")}A(Li);var Ni=0;
|
||||
function Mi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.T=b}function wd(a,b,c){var d=b.toLowerCase(),d=eb[b]||eb[d];void 0===d&&a.T&&(d=a.T[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Ri(a,b,c){for(var d=sb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!xb(f)){xb(f,function(){Ri(a,b,c)});return}}b.call(a,c)}
|
||||
function Si(a,b){var c=new Q(a,"1.30.3","validate");if(Pi(c)&&Ti(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.R("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Li.prototype;
|
||||
k.Qb=function(a){void 0===a&&(a=this.f||(this.I?1:Ni));if(!this.C){this.C++;var b=!1,c=!1;this.O=!1;var d=this.K||new Q(this,"1.30.3");if(-1==a)b=!0;else if(a>Ni){if(Pi(d,this.I)){this.B=new Q(this,"1.30.3","failsafe");Pi(this.B)&&(Ui(this,d),a=2,Vi(this.B));this.B.set("timestamp",Ca());Wi(this.B);var e=this.f&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ti(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Pi(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.R("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.i(f+": "+g),Vi(d),Pi(d)?(c=Ti(d),e=!0):c=!1))}e&&Si(this,c?d:null)}else 2==a&&d.clear()}else Si(this);delete this.I;delete this.K}e=sb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Xi(this,g,d,b,c));b=[d,a,c];-1!=a?Ri(this,this.uc,b):this.uc(b)}};
|
||||
function Xi(a,b,c,d,e){if(!b.A.ia){b.A.ia=!0;if(b.Ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ka(f,d)&&f&&(u("Unable to restore state for "+b.type),a.M&&!a.S?(c.clear(),a.f=Ni,window&&window.location.reload()):a.O=!0,b.Ka(null),e=!1)}if(!d&&b.Cc)for(a=b.Cc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
k.uc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Xi(this,this.b,b,c,a),this.sa(),this.b.xb());this.O&&(Ui(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0};
|
||||
function Ui(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Ki(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.da(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=sb(a.id),l=0;l<h.length;l++){var m=h[l];m.A.ia&&(m.Ja&&(d=m.Ja(b,c),"object"===typeof d&&f.set(m.id,
|
||||
function Ki(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Q(a,"1.30.3"),g=new Q(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.da(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=sb(a.id),l=0;l<h.length;l++){var m=h[l];m.A.ia&&(m.Ja&&(d=m.Ja(b,c),"object"===typeof d&&f.set(m.id,
|
||||
d)),c&&(m.A.ia=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Yi(a,a.g,f.toString()),Wi(g)&&Wi(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.A.ia=!1,b=a.G.power)&&(b.textContent="Power");a.C=0;return e}
|
||||
k.reset=function(){this.v&&this.v.reset&&(E(this,"Resetting "+this.v.type),this.v.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=sb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.v&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.sa(-1)};k.start=function(a,b){for(var c=sb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.sa(-1)};
|
||||
k.reset=function(){this.v&&this.v.reset&&(F(this,"Resetting "+this.v.type),this.v.reset());this.b&&this.b.reset&&(F(this,"Resetting "+this.b.type),this.b.reset());for(var a=sb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.v&&c!==this.b&&c.reset&&(F(this,"Resetting "+c.type),c.reset())}this.sa(-1)};k.start=function(a,b){for(var c=sb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.sa(-1)};
|
||||
k.stop=function(a,b){for(var c=sb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.sa(-1)};
|
||||
k.sa=function(a){if(this.b){var b=this.b,c=a||0,d=b.G.speed;d&&(0>=c||30<=(b.xb+=c))&&(d.textContent=b.A.W?b.oa.toFixed(2)+"Mhz":"Stopped",b.xb=0)}if(this.w&&(b=this.w,a=a||0,b.D)){c=b.b.A.W;d=!!(b.b.J&4);if(0>=a||60<=(b.B+=a)){for(var e=0;e<b.b.u.length;e++)Qb(b,"R"+e,b.b.u[e]);e=bd(b.b);Qb(b,"PS",e);Qb(b,"NF",e&8?1:0,1);Qb(b,"ZF",e&4?1:0,1);Qb(b,"VF",e&2?1:0,1);Qb(b,"CF",e&1?1:0,1);b.B=0}jc(b,0<a&&c&&!d?b.b.Mb:b.va);ic(b,b.qb);a=b.b;a=a.M?a.Ta&16?1:2:4;lc(b,"B22",a&1);lc(b,"B18",a&2);lc(b,"B16",
|
||||
k.sa=function(a){if(this.b){var b=this.b,c=a||0,d=b.G.speed;d&&(0>=c||30<=(b.zb+=c))&&(d.textContent=b.A.W?b.xa.toFixed(2)+"Mhz":"Stopped",b.zb=0)}if(this.w&&(b=this.w,a=a||0,b.D)){c=b.b.A.W;d=!!(b.b.J&4);if(0>=a||60<=(b.B+=a)){for(var e=0;e<b.b.u.length;e++)Qb(b,"R"+e,b.b.u[e]);e=bd(b.b);Qb(b,"PS",e);Qb(b,"NF",e&8?1:0,1);Qb(b,"ZF",e&4?1:0,1);Qb(b,"VF",e&2?1:0,1);Qb(b,"CF",e&1?1:0,1);b.B=0}jc(b,0<a&&c&&!d?b.b.Mb:b.va);ic(b,b.sb);a=b.b;a=a.M?a.Ta&16?1:2:4;lc(b,"B22",a&1);lc(b,"B18",a&2);lc(b,"B16",
|
||||
a&4)}};
|
||||
k.wa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.A.ia?Ki(d,!1,!0):Ri(d,d.Qb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ia&&!d.C)if(d.f&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ki(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.uc=!0),d.Qb(Ni),d.uc=!1)}else d.reset(),d.b&&d.b.wb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]=
|
||||
k.wa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.A.ia?Ki(d,!1,!0):Ri(d,d.Qb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ia&&!d.C)if(d.f&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ki(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.vc=!0),d.Qb(Ni),d.vc=!1)}else d.reset(),d.b&&d.b.xb()},!0;case "save":if(ua(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]=
|
||||
c,c.onclick=function(){var a=Oi(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=Ki(d,b);b?Yi(d,a,c):d.R("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Oi(a,b){var c=a.g;c||((c=Ka("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Zi(a,c))||a.R("The user ID is invalid.")):b&&a.R("Browser local storage is not available"));return c}
|
||||
function Zi(a,b){a.g=null;b=Da(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Qi(a){var b=null;a.g&&(b=Ga()+"/api/v1/user?req=load&user="+a.g+"&state="+$i(a,"1.30.3"));return b}
|
||||
function Yi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=$i(a,"1.30.3");d.data=c;b=Da(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.R("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.R(c),La("user",""),a.g=null)}}
|
||||
function rh(a){var b;a=sb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.tb=function(a){if(this.Va){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Va.focus();!a&&window&&window.scrollTo(b,c)}};$a(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new Li(g,d,!0);B(g,f);g.L&&Ri(g,g.Qb)}});
|
||||
Va.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=ub("Computer",c.id))&&c.ca&&!c.A.ia&&c.Qb(-1)}});Va.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=ub("Computer",c.id))&&c.A.ia&&Ki(c,!(!c.f||c.H),!0)}});function O(a,b,c){this.id=a.id;this.key=$i(a,b,c);this.j=a.j;Vi(this,a.ad)}function $i(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){Vi(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 Vi(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Wi(a){var b=!0;if(Ja()){var c=JSON.stringify(a[a.id]);La(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ti(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Pi(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ja()&&(b=Ka(a.key))?(a[a.id]=b,a.b=!0):!1}var aj=0;
|
||||
function Zi(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){u(d.message+" ("+c+")")}return a.g}function Qi(a){var b=null;a.g&&(b=Fa()+"/api/v1/user?req=load&user="+a.g+"&state="+$i(a,"1.30.3"));return b}
|
||||
function Yi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=$i(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.R("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.R(c),La("user",""),a.g=null)}}
|
||||
function rh(a){var b;a=sb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.ub=function(a){if(this.Wa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Wa.focus();!a&&window&&window.scrollTo(b,c)}};$a(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 Li(g,d,!0);D(g,f);g.L&&Ri(g,g.Qb)}});
|
||||
Va.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=ub("Computer",c.id))&&c.ca&&!c.A.ia&&c.Qb(-1)}});Va.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=ub("Computer",c.id))&&c.A.ia&&Ki(c,!(!c.f||c.H),!0)}});function Q(a,b,c){this.id=a.id;this.key=$i(a,b,c);this.j=a.j;Vi(this,a.nd)}function $i(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}
|
||||
Q.prototype={constructor:Q,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){Vi(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 Vi(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Wi(a){var b=!0;if(Ja()){var c=JSON.stringify(a[a.id]);La(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ti(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){u(c.message||c),b=!1}return b}function Pi(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ja()&&(b=Ka(a.key))?(a[a.id]=b,a.b=!0):!1}var aj=0;
|
||||
function lj(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)):mj(h,a,b,c,d,e,f)})}
|
||||
function mj(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(rb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
function mj(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(kb(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?nj(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function nj(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);nj(a,b,c)}})}else c(a,null)}
|
||||
function oj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--aj||bb(!0));l=!1}var g,h,l=!0;aj++;jb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c||
|
||||
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?lj(c,null,null,!1,e,function(d,l){l?(rb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--aj||bb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--aj||bb(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?lj(b,a,d,!0,e,m):mj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){bb(!1);return oj(a,b,c,d)};window.enableEvents=bb;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map
|
||||
function oj(a,b,c,d){function e(a){if(void 0===h){var b=g&&E(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--aj||bb(!0));l=!1}var g,h,l=!0;aj++;jb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c||
|
||||
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?lj(c,null,null,!1,e,function(d,l){l?(kb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--aj||bb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--aj||bb(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?lj(b,a,d,!0,e,m):mj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){bb(!1);return oj(a,b,c,d)};window.enableEvents=bb;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map
|
||||
|
|
|
|||
|
|
@ -45,202 +45,201 @@ 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.Y=
|
|||
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 xa=null;function ya(){if(null==xa){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}xa=a}return xa}
|
||||
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)});
|
||||
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.Tb=b.comment;this.td=b;b=this.id.indexOf(".");0>b?this.za=this.id:(this.ra=this.id.substr(0,b),this.za=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,tb:!1,N:!1,error:!1};this.mb=null;this.j.error=!1;this.o={};this.F=null;this.qd=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.Ub=b.comment;this.xd=b;b=this.id.indexOf(".");0>b?this.Fa=this.id:(this.ra=this.id.substr(0,b),this.Fa=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,ub:!1,N:!1,error:!1};this.nb=null;this.j.error=!1;this.o={};this.F=null;this.ud=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}
|
||||
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 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.aa(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}
|
||||
y.prototype={constructor:y,parent:null,toString:function(){return this.name?this.name:this.id||this.type},aa: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.za)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.za+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},la:function(){return this.j.N=!0},ka:function(a,b){b&&(this.j.N=!1);return!0}};function Ua(a,b){a.j.tb?(a.j.Da=!1,a.j.tb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Da=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.mb,a.mb=null,b&&b()))}
|
||||
function Va(a,b){b&&(a.j.ready?b():a.mb=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)});
|
||||
y.prototype={constructor:y,parent:null,toString:function(){return this.name?this.name:this.id||this.type},aa:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Xa=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.G=function(a){this.T(a,this.Fa)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.Fa+": "+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.ub?(a.j.Da=!1,a.j.ub=!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.nb,a.nb=null,b&&b()))}
|
||||
function Va(a,b){b&&(a.j.ready?b():a.nb=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 Ya(a){y.call(this,"Panel",a,Ya,2048);this.fa=this.i=this.c=this.m=this.s=this.v=0;this.A=this.B=this.w=!1;this.D=Za;this.g={};this.b={START:[1,1,!0,!1,this.uc],STEP:[1,1,!1,!1,this.vc],ENABLE:[1,1,!1,!1,this.qc],CONT:[1,1,!0,!1,this.oc],DEP:[0,0,!0,!1,this.pc],EXAM:[1,1,!0,!1,this.rc],LOAD:[1,1,!0,!1,this.tc],TEST:[0,0,!0,!1,this.sc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.wc,a]}A(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()};
|
||||
function Ya(a){y.call(this,"Panel",a,Ya,2048);this.fa=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.xc],STEP:[1,1,!1,!1,this.yc],ENABLE:[1,1,!1,!1,this.tc],CONT:[1,1,!0,!1,this.rc],DEP:[0,0,!0,!1,this.sc],EXAM:[1,1,!0,!1,this.uc],LOAD:[1,1,!0,!1,this.wc],TEST:[0,0,!0,!1,this.vc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.zc,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.aa=function(a,b,c,d){if(this.l&&this.l.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.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.aa.call(this,a,b,c,d)}};h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.la=function(a,b){b||(hb(),this.reset());return!0};h.ka=function(){return!0};
|
||||
function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.g)ib(a,c,null!=b?b:a.g[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.b)jb(a,b,a.b[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.F&&a.F.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))}
|
||||
function 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.uc=function(a){a||this.a.j.P||(a=this.a,a.h.reset(),lb(a),$a(this,"ENABLE")&&mb(this.a))};h.vc=function(){};h.qc=function(a){a||G(this.a)};
|
||||
h.oc=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.tb=!0),b=!a.j.Da;if(b)Ua(a,!0),a.qb(0,null),Ua(a,!1);else try{var c=this.a.qb(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.pc=function(a){a&&!this.a.j.P&&(this.A&&qb(this),a=rb(this,this.c),this.D==Za?this.h.bb(this.fa,a):this.a.bb(this.fa,a))};
|
||||
h.rc=function(a){a||this.a.j.P||(this.B&&qb(this),a=this.D==Za?this.h.Xa(this.fa):this.a.Xa(this.fa),rb(this,a))};h.tc=function(a){a||this.a.j.P||sb(this,this.c)};h.sc=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.wc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)};
|
||||
function qb(a){var b=1145>a.a.Ea?8:16,c=65472<=a.fa&&a.fa<65472+b,b=c?1:2,c=c?15:a.h.pa;$a(a,"STEP")||(b=-b);sb(a,a.fa&~c|a.fa+b&c)}function sb(a,b){a.fa=b&a.h.pa;b=a.fa;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.xc=function(a,b){return(b?this.m:this.c)&65535};h.vd=function(a){this.m=a};
|
||||
var ub={},db=(ub[65400]=[null,null,Ya.prototype.xc,Ya.prototype.vd,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=C(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));D(f,d);a&&F(f)}}Ga(hb);
|
||||
function vb(a,b,c){y.call(this,"Bus",a,vb,64);this.a=b;this.F=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.B=1<<this.I;this.pa=this.B-1;this.b=H;this.c=Math.log2(this.b);this.D=this.b>>2;this.l=this.b-1;this.A=this.B/this.b|0;this.Aa=[];this.g=0;this.m=!1;this.ub=0;this.w=[];this.gc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.h=Array(this.A);for(b=0;b<this.A;b++)this.h[b]=a;F(this)}A(vb);var H=8192,Bb=H-1;
|
||||
function 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.xc=function(a){a||this.a.j.P||(a=this.a,a.h.reset(),lb(a),$a(this,"ENABLE")&&mb(this.a))};h.yc=function(){};h.tc=function(a){a||G(this.a)};
|
||||
h.rc=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.ub=!0),b=!a.j.Da;if(b)Ua(a,!0),a.rb(0,null),Ua(a,!1);else try{var c=this.a.rb(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.sc=function(a){a&&!this.a.j.P&&(this.A&&qb(this),a=rb(this,this.c),this.D==Za?this.h.eb(this.fa,a):this.a.eb(this.fa,a))};
|
||||
h.uc=function(a){a||this.a.j.P||(this.B&&qb(this),a=this.D==Za?this.h.Ya(this.fa):this.a.Ya(this.fa),rb(this,a))};h.wc=function(a){a||this.a.j.P||sb(this,this.c)};h.vc=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.zc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)};
|
||||
function qb(a){var b=1145>a.a.La?8:16,c=65472<=a.fa&&a.fa<65472+b,b=c?1:2,c=c?15:a.h.pa;$a(a,"STEP")||(b=-b);sb(a,a.fa&~c|a.fa+b&c)}function sb(a,b){a.fa=b&a.h.pa;b=a.fa;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.Ac=function(a,b){return(b?this.m:this.c)&65535};h.yd=function(a){this.m=a};
|
||||
var ub={},db=(ub[65400]=[null,null,Ya.prototype.Ac,Ya.prototype.yd,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=C(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));D(f,d);a&&F(f)}}Ga(hb);
|
||||
function vb(a,b,c){y.call(this,"Bus",a,vb,64);this.a=b;this.F=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.B=1<<this.I;this.pa=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.vb=0;this.w=[];this.hc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.F);this.h=Array(this.A);for(b=0;b<this.A;b++)this.h[b]=a;F(this)}A(vb);var H=8192,Bb=H-1;
|
||||
function wb(a,b){var c=-1,d=this.controller,e=d.Aa[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Aa[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255}
|
||||
function xb(a,b,c){var d=!1,e=this.controller,f=e.Aa[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Aa[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.Aa[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}
|
||||
function zb(a,b,c){var d=!1,e=this.controller;a=e.Aa[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,Db(a,c,H,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.pa=c-1,c-=H,a.v=Eb(a,c,H),a.i?Db(a,c,H,a.i):(Fb(a,c,H,Gb,a),a.i=Eb(a,c,H)))}}h=vb.prototype;h.reset=function(){for(var a=0;a<this.w.length;a++)this.w[a]();Cb(this,16)};h.la=function(a,b){b||this.reset();return!0};
|
||||
function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.h.length;){var l=a.h[k],n=k*a.b,p=a.b-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.rb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.rb){p=l.size-(f-n);p>g&&(p=g);l.rb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.F,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.ub+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)}
|
||||
function 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.pa)>>>a.c].Fb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.pa)>>>a.c].V(b&a.l,b)}h.Xa=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.pa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a};
|
||||
function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.pa)>>>a.c].Jb(b&a.l,c&255,b)}h.ab=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.pa)>>>this.c].Kb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.pa)>>>a.c].sb(b&a.l,c&65535,b)}h.bb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.pa)>>>this.c;this.m=!1;this.g++;this.h[d].ec(c,b&65535,a);this.g--};
|
||||
function Pb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.h[d];if(e.wa||e.kc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Qb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Bb;if(void 0!==a.Aa[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.Aa[n]=[d,e,f,g,l||"unknown",k,!1]}return!0}
|
||||
function 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,f[7]||b.qd||64,p||b.za))return!1}}return!0}function eb(a,b){a.w.push(b)}
|
||||
function J(a,b,c){a.m=!0;a.g||(c&&(a.a.W|=c),K(a.a,4,0,b))}function Rb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){y.call(this,"Device",a,L,1024);this.b={L:0,Ib:-1}}A(L);h=L.prototype;h.ja=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.F=d;var e=this;this.b.Ib=Sb(c,function(){e.b.Za|=128;e.b.Za&64&&Tb(e.a,e.b.rd);e.l&&e.l.ya(1);Ub(e.a,e.b.Ib,1E3/60)});this.b.rd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)};
|
||||
h.reset=function(){this.b.Za=128;Ub(this.a,this.b.Ib,1E3/60,!0)};h.Fc=function(){return this.b.Za};h.Dd=function(a){this.b.Za=a&192};h.Hc=function(){var a=this.a,b=a.X;b&57344||(b=b&-3199|a.eb<<5|a.fb<<1);return b};h.Fd=function(a){Xb(this.a,a&-129|this.a.X&128)};h.Ic=function(){var a=this.a;a.X&57344||(a.Db=a.A>>16&65535);a=a.Db;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Jc=function(){var a=this.a;a.X&57344||(a.Eb=a.A&65535);return a.Eb};h.Kc=function(){return this.a.Ba};
|
||||
h.Gd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Ra=a&16?4194303:262143,Yb(b))};h.ld=function(a){a=a>>1&63;var b=this.a.cb[a>>1];return a&1?b>>16:b&65535};h.ge=function(a,b){b=b>>1&63;var c=b>>1;this.a.cb[c]=b&1?this.a.cb[c]&65535|(a&63)<<16:this.a.cb[c]&-65536|a&65534};h.dd=function(a){return this.a.H[1][a>>1&7]};h.$d=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[1][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};
|
||||
h.cd=function(a){return this.a.Z[1][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.ad=function(a){return this.a.Z[1][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.Ec=function(a){return this.a.H[0][a>>1&7]};h.Cd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Cc=function(a){return this.a.H[0][(a>>1&7)+8]};h.Ad=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Dc=function(a){return this.a.Z[0][a>>1&7]};
|
||||
h.Bd=function(a,b){b=b>>1&7;this.a.Z[0][b]=a;this.a.H[0][b]&=65295};h.Bc=function(a){return this.a.Z[0][(a>>1&7)+8]};h.zd=function(a,b){b=(b>>1&7)+8;this.a.Z[0][b]=a;this.a.H[0][b]&=65295};h.kd=function(a){return this.a.H[3][a>>1&7]};h.fe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.hd=function(a){return this.a.H[3][(a>>1&7)+8]};h.de=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.jd=function(a){return this.a.Z[3][a>>1&7]};h.ee=function(a,b){b=b>>1&7;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};
|
||||
h.gd=function(a){return this.a.Z[3][(a>>1&7)+8]};h.ce=function(a,b){b=(b>>1&7)+8;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.C&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.C&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Pc=function(){return this.a.C&49152?this.a.qa[0]:this.a.f[6]};h.Ld=function(a){this.a.C&49152?this.a.qa[0]=a:this.a.f[6]=a};h.Sc=function(){return this.a.f[7]};h.Od=function(a){this.a.f[7]=a};
|
||||
h.Na=function(a){a&=7;return this.a.C&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.C&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Qc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.qa[1]};h.Md=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.qa[1]=a};h.Rc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.qa[3]};h.Nd=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.qa[3]=a};h.zc=function(a){return this.a.$b[a-65504>>1]};
|
||||
h.xd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.ub}a=(a>>6)-1}else a=0;return a};h.dc=function(){};h.fd=function(){return 1};h.be=function(){};h.yc=function(){return this.a.W};h.wd=function(){this.a.W=0};h.Gc=function(){return this.a.Zb};h.Ed=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Lc=function(a,b){return b?0:this.a.Gb};h.Hd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Gb=a;b.u|=2};
|
||||
h.ed=function(a,b){return b?0:this.a.pb&65280};h.ae=function(a){this.a.pb=a|255};h.Oc=function(){return Zb(this.a)};h.Kd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.cc=function(){};
|
||||
var M={},Wb=(M[61568]=[null,null,L.prototype.ld,L.prototype.ge,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.dd,L.prototype.$d,"SIPDR",8,1145,256],M[62608]=[null,null,L.prototype.bd,L.prototype.Yd,"SDPDR",8,1145,256],M[62624]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPAR",8,1145,256],M[62640]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPAR",8,1145,256],M[62656]=[null,null,L.prototype.Ec,L.prototype.Cd,"KIPDR",8,1145,256],M[62672]=[null,null,L.prototype.Cc,L.prototype.Ad,"KDPDR",8,1145,256],
|
||||
M[62688]=[null,null,L.prototype.Dc,L.prototype.Bd,"KIPAR",8,1145,256],M[62704]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPAR",8,1145,256],M[62798]=[null,null,L.prototype.Kc,L.prototype.Gd,"MMR3",1,1145,256],M[65382]=[null,null,L.prototype.Fc,L.prototype.Dd,"LKS"],M[65402]=[null,null,L.prototype.Hc,L.prototype.Fd,"MMR0",1,1145,256],M[65404]=[null,null,L.prototype.Ic,L.prototype.cc,"MMR1",1,1145,256],M[65406]=[null,null,L.prototype.Jc,L.prototype.cc,"MMR2",1,1145,256],M[65408]=[null,null,L.prototype.kd,
|
||||
L.prototype.fe,"UIPDR",8,1145,256],M[65424]=[null,null,L.prototype.hd,L.prototype.de,"UDPDR",8,1145,256],M[65440]=[null,null,L.prototype.jd,L.prototype.ee,"UIPAR",8,1145,256],M[65456]=[null,null,L.prototype.gd,L.prototype.ce,"UDPAR",8,1145,256],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.Pc,L.prototype.Ld,"R6KERNEL"],M[65479]=[null,null,L.prototype.Sc,L.prototype.Od,"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.Qc,L.prototype.Md,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Rc,L.prototype.Nd,"R6USER",1,1145],M[65504]=[null,null,L.prototype.zc,L.prototype.xd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Wb,L.prototype.dc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Wb,L.prototype.dc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.fd,L.prototype.be,
|
||||
"SYSID",1,1170],M[65526]=[null,null,L.prototype.yc,L.prototype.wd,"CPUERR",1,1170],M[65528]=[null,null,L.prototype.Gc,L.prototype.Ed,"MB",1,1170],M[65530]=[null,null,L.prototype.Lc,L.prototype.Hd,"PIR"],M[65532]=[null,null,L.prototype.ed,L.prototype.ae,"SL"],M[65534]=[null,null,L.prototype.Oc,L.prototype.Kd,"PSW"],M);
|
||||
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.sb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.sb){p=l.size-(f-n);p>g&&(p=g);l.sb=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.vb+=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.pa)>>>a.c].Gb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.pa)>>>a.c].V(b&a.l,b)}h.Ya=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.pa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a};
|
||||
function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.pa)>>>a.c].Kb(b&a.l,c&255,b)}h.cb=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.pa)>>>this.c].Lb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.pa)>>>a.c].tb(b&a.l,c&65535,b)}h.eb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.pa)>>>this.c;this.m=!1;this.g++;this.h[d].fc(c,b&65535,a);this.g--};
|
||||
function Pb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.h[d];if(e.wa||e.nc){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.La)){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,f[7]||b.ud||64,p||b.Fa))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.W|=c),K(a.a,4,0,b))}function Rb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){y.call(this,"Device",a,L,1024);this.b={L:0,Jb:-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.Jb=Sb(c,function(){e.b.$a|=128;e.b.$a&64&&Tb(e.a,e.b.td);e.l&&e.l.ya(1);Ub(e.a,e.b.Jb,1E3/60)});this.b.td=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)};
|
||||
h.reset=function(){this.b.$a=128;Ub(this.a,this.b.Jb,1E3/60,!0)};h.Ic=function(){return this.b.$a};h.Gd=function(a){this.b.$a=a&192};h.Kc=function(){var a=this.a,b=a.X;b&57344||(b=b&-3199|a.gb<<5|a.hb<<1);return b};h.Id=function(a){Xb(this.a,a&-129|this.a.X&128)};h.Lc=function(){var a=this.a;a.X&57344||(a.Eb=a.A>>16&65535);a=a.Eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Mc=function(){var a=this.a;a.X&57344||(a.Fb=a.A&65535);return a.Fb};h.Nc=function(){return this.a.Ba};
|
||||
h.Jd=function(a){var b=this.a;1170>b.La&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Sa=a&16?4194303:262143,Yb(b))};h.od=function(a){a=a>>1&63;var b=this.a.fb[a>>1];return a&1?b>>16:b&65535};h.je=function(a,b){b=b>>1&63;var c=b>>1;this.a.fb[c]=b&1?this.a.fb[c]&65535|(a&63)<<16:this.a.fb[c]&-65536|a&65534};h.gd=function(a){return this.a.H[1][a>>1&7]};h.ce=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.ed=function(a){return this.a.H[1][(a>>1&7)+8]};h.ae=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};
|
||||
h.fd=function(a){return this.a.Z[1][a>>1&7]};h.be=function(a,b){b=b>>1&7;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.dd=function(a){return this.a.Z[1][(a>>1&7)+8]};h.$d=function(a,b){b=(b>>1&7)+8;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.Hc=function(a){return this.a.H[0][a>>1&7]};h.Fd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Fc=function(a){return this.a.H[0][(a>>1&7)+8]};h.Dd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Gc=function(a){return this.a.Z[0][a>>1&7]};
|
||||
h.Ed=function(a,b){b=b>>1&7;this.a.Z[0][b]=a;this.a.H[0][b]&=65295};h.Ec=function(a){return this.a.Z[0][(a>>1&7)+8]};h.Cd=function(a,b){b=(b>>1&7)+8;this.a.Z[0][b]=a;this.a.H[0][b]&=65295};h.nd=function(a){return this.a.H[3][a>>1&7]};h.ie=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.ld=function(a){return this.a.H[3][(a>>1&7)+8]};h.ge=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.md=function(a){return this.a.Z[3][a>>1&7]};h.he=function(a,b){b=b>>1&7;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};
|
||||
h.kd=function(a){return this.a.Z[3][(a>>1&7)+8]};h.fe=function(a,b){b=(b>>1&7)+8;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Na=function(a){a&=7;return this.a.C&2048?this.a.Ea[a]:this.a.f[a]};h.Pa=function(a,b){b&=7;this.a.C&2048?this.a.Ea[b]=a:this.a.f[b]=a};h.Sc=function(){return this.a.C&49152?this.a.qa[0]:this.a.f[6]};h.Od=function(a){this.a.C&49152?this.a.qa[0]=a:this.a.f[6]=a};h.Vc=function(){return this.a.f[7]};h.Rd=function(a){this.a.f[7]=a};
|
||||
h.Oa=function(a){a&=7;return this.a.C&2048?this.a.f[a]:this.a.Ea[a]};h.Qa=function(a,b){b&=7;this.a.C&2048?this.a.f[b]=a:this.a.Ea[b]=a};h.Tc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.qa[1]};h.Pd=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.qa[1]=a};h.Uc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.qa[3]};h.Qd=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.qa[3]=a};h.Cc=function(a){return this.a.$b[a-65504>>1]};
|
||||
h.Ad=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.vb}a=(a>>6)-1}else a=0;return a};h.ec=function(){};h.jd=function(){return 1};h.ee=function(){};h.Bc=function(){return this.a.W};h.zd=function(){this.a.W=0};h.Jc=function(){return this.a.Zb};h.Hd=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Oc=function(a,b){return b?0:this.a.Hb};h.Kd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Hb=a;b.u|=2};
|
||||
h.hd=function(a,b){return b?0:this.a.bb&65280};h.de=function(a){this.a.bb=a|255};h.Rc=function(){return Zb(this.a)};h.Nd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.dc=function(){};
|
||||
var M={},Wb=(M[61568]=[null,null,L.prototype.od,L.prototype.je,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.gd,L.prototype.ce,"SIPDR",8,1145,256],M[62608]=[null,null,L.prototype.ed,L.prototype.ae,"SDPDR",8,1145,256],M[62624]=[null,null,L.prototype.fd,L.prototype.be,"SIPAR",8,1145,256],M[62640]=[null,null,L.prototype.dd,L.prototype.$d,"SDPAR",8,1145,256],M[62656]=[null,null,L.prototype.Hc,L.prototype.Fd,"KIPDR",8,1145,256],M[62672]=[null,null,L.prototype.Fc,L.prototype.Dd,"KDPDR",8,1145,256],
|
||||
M[62688]=[null,null,L.prototype.Gc,L.prototype.Ed,"KIPAR",8,1145,256],M[62704]=[null,null,L.prototype.Ec,L.prototype.Cd,"KDPAR",8,1145,256],M[62798]=[null,null,L.prototype.Nc,L.prototype.Jd,"MMR3",1,1145,256],M[65382]=[null,null,L.prototype.Ic,L.prototype.Gd,"LKS"],M[65402]=[null,null,L.prototype.Kc,L.prototype.Id,"MMR0",1,1145,256],M[65404]=[null,null,L.prototype.Lc,L.prototype.dc,"MMR1",1,1145,256],M[65406]=[null,null,L.prototype.Mc,L.prototype.dc,"MMR2",1,1145,256],M[65408]=[null,null,L.prototype.nd,
|
||||
L.prototype.ie,"UIPDR",8,1145,256],M[65424]=[null,null,L.prototype.ld,L.prototype.ge,"UDPDR",8,1145,256],M[65440]=[null,null,L.prototype.md,L.prototype.he,"UIPAR",8,1145,256],M[65456]=[null,null,L.prototype.kd,L.prototype.fe,"UDPAR",8,1145,256],M[65472]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET0"],M[65473]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET0"],M[65474]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET0"],M[65475]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET0"],M[65476]=[null,null,
|
||||
L.prototype.Na,L.prototype.Pa,"R4SET0"],M[65477]=[null,null,L.prototype.Na,L.prototype.Pa,"R5SET0"],M[65478]=[null,null,L.prototype.Sc,L.prototype.Od,"R6KERNEL"],M[65479]=[null,null,L.prototype.Vc,L.prototype.Rd,"R7KERNEL"],M[65480]=[null,null,L.prototype.Oa,L.prototype.Qa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Oa,L.prototype.Qa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Oa,L.prototype.Qa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Oa,L.prototype.Qa,"R3SET1",1,1145],M[65484]=
|
||||
[null,null,L.prototype.Oa,L.prototype.Qa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Oa,L.prototype.Qa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Tc,L.prototype.Pd,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Uc,L.prototype.Qd,"R6USER",1,1145],M[65504]=[null,null,L.prototype.Cc,L.prototype.Ad,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Wb,L.prototype.ec,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Wb,L.prototype.ec,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.jd,L.prototype.ee,
|
||||
"SYSID",1,1170],M[65526]=[null,null,L.prototype.Bc,L.prototype.zd,"CPUERR",1,1170],M[65528]=[null,null,L.prototype.Jc,L.prototype.Hd,"MB",1,1170],M[65530]=[null,null,L.prototype.Oc,L.prototype.Kd,"PIR"],M[65532]=[null,null,L.prototype.hd,L.prototype.de,"SL"],M[65534]=[null,null,L.prototype.Rc,L.prototype.Nd,"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 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=ec+=2;this.a=null;this.Ka=b;this.rb=c;this.size=d||0;this.type=e||fc;this.l=e==gc;this.controller=null;Ab(this);this.wa=this.kc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],hc(this,f.gc);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;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.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.Fb(a++,b++)|
|
||||
this.Fb(a,b)<<8},A:function(a,b,c){this.Jb(a++,b&255,c++);this.Jb(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ca: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.wa=!0},D:function(a,b){return this.I(a,b)},R:function(a,b){return this.Xb(a,b)},na:function(a,b,c){this.l?this.g(a,b,c):this.Kb(a,b,c)},ua:function(a,b,c){this.l?this.g(a,b,c):this.ec(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)},ba: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.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.Jb=!a.l&&b[1]||a.g,a.sb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Kb=b[1]||a.g,a.ec=b[3]||a.A}function nc(a,b,c){c&&a.i||(a.Fb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Xb=b[2]||a.w}function hc(a,b){b||(b=qc);nc(a,b,void 0);pc(a,b,void 0)}
|
||||
var qc=[],kc=[I.prototype.M,I.prototype.sa,I.prototype.ca,I.prototype.za],oc=[I.prototype.D,I.prototype.na,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.ba,I.prototype.va];
|
||||
function rc(a,b){y.call(this,"CPU",a,rc,1);b=a.cycles||b;var c=a.multiplier||1;this.yb=0;this.lb=b;this.ua=c;this.Bb=Math.round(this.lb/1E4)/100;this.Ha=this.Bb*this.ua;this.j.P=!1;this.j.Hb=!1;this.j.Va=a.autoStart;this.j.hb=!1;this.ib=this.Ia=0;this.jb=a.csStart;this.Sa=a.csInterval;this.Ta=a.csStop;this.J=[];this.bc=this.pd.bind(this);F(this)}A(rc);var sc=["power","reset"];h=rc.prototype;
|
||||
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.aa(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.Ob=function(){return 0};function vc(a){void 0===a.jb&&(a.jb=0);void 0===a.Sa&&(a.Sa=-1);void 0===a.Ta&&(a.Ta=-1);a.j.hb=0<=a.jb&&0<a.Sa;a.j.hb&&(a.ib=0,a.Ia=a.jb-a.va)}function pb(a,b){if(a.j.hb){var c=!1;a.ib=a.ib+a.Ob()|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.ib))}}
|
||||
h.aa=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.mb?" (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(){xc(d,d.ua<<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.ta=a.a=a.I=0)}function yc(a,b){var c=1;b&&1<a.ua&&a.Ga&&(c=a.Ga/a.Bb);a.Ub=Math.round(1E3/30);a.nb=Math.floor(a.lb/30*c);b||(a.Ua=a.nb);a.Cb=0}function wc(a){return a.va+a.na+a.ta-a.a}function uc(a){a.Ga=0;a.Vb=0;a.va=a.na=a.ta=a.a=a.I=0;vc(a);xc(a,1)}
|
||||
function xc(a,b,c){if(void 0!==b){.8>a.Ga/a.Ha&&(b=1);a.ua=b;b=a.Bb*a.ua;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.na);a.na=0;a.ca=ra();a.sa=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.lb*a.ua/1E3*c|0,a.j.P&&(c+=Ac(a)),a.J[b][0]=c)}
|
||||
function I(a,b,c,d,e,f){this.h=a;this.id=ec+=2;this.a=null;this.Ka=b;this.sb=c;this.size=d||0;this.type=e||fc;this.l=e==gc;this.controller=null;Ab(this);this.wa=this.nc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],hc(this,f.hc);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;hc(this,mc)}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.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.Gb(a++,b++)|
|
||||
this.Gb(a,b)<<8},A:function(a,b,c){this.Kb(a++,b&255,c++);this.Kb(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ca: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.wa=!0},D:function(a,b){return this.I(a,b)},R:function(a,b){return this.Xb(a,b)},na:function(a,b,c){this.l?this.g(a,b,c):this.Lb(a,b,c)},ua:function(a,b,c){this.l?this.g(a,b,c):this.fc(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)},ba: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.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.Kb=!a.l&&b[1]||a.g,a.tb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Lb=b[1]||a.g,a.fc=b[3]||a.A}function nc(a,b,c){c&&a.i||(a.Gb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Xb=b[2]||a.w}function hc(a,b){b||(b=qc);nc(a,b,void 0);pc(a,b,void 0)}
|
||||
var qc=[],mc=[I.prototype.M,I.prototype.sa,I.prototype.ca,I.prototype.za],oc=[I.prototype.D,I.prototype.na,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.ba,I.prototype.va];
|
||||
function rc(a,b){y.call(this,"CPU",a,rc,1);b=a.cycles||b;var c=a.multiplier||1;this.Ab=0;this.ob=b;this.ua=c;this.Cb=Math.round(this.ob/1E4)/100;this.Ha=this.Cb*this.ua;this.j.P=!1;this.j.Ib=!1;this.j.Wa=a.autoStart;this.j.ib=!1;this.kb=this.Ia=0;this.mb=a.csStart;this.Ta=a.csInterval;this.Ua=a.csStop;this.J=[];this.cc=this.sd.bind(this);F(this)}A(rc);var sc=["power","reset"];h=rc.prototype;
|
||||
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.aa(null,sc[b],c);a=tc(a,"autoStart");null!=a&&(this.j.Wa="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.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.Wa=function(){return this.j.Wa||void 0===this.o.run?(mb(this),!0):!1};h.Pb=function(){return 0};function vc(a){void 0===a.mb&&(a.mb=0);void 0===a.Ta&&(a.Ta=-1);void 0===a.Ua&&(a.Ua=-1);a.j.ib=0<=a.mb&&0<a.Ta;a.j.ib&&(a.kb=0,a.Ia=a.mb-a.va)}function pb(a,b){if(a.j.ib){var c=!1;a.kb=a.kb+a.Pb()|0;a.Ia-=b;0>=a.Ia&&(a.Ia+=a.Ta,c=!0);0<=a.Ua&&a.Ua<=wc(a)&&(a.Ta=a.Ua=-1,vc(a),G(a),c=!0);c&&a.T(wc(a)+" cycles: checksum="+m(a.kb))}}
|
||||
h.aa=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.nb?" (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(){xc(d,d.ua<<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.ta=a.a=a.I=0)}function yc(a,b){var c=1;b&&1<a.ua&&a.Ga&&(c=a.Ga/a.Cb);a.Vb=Math.round(1E3/30);a.pb=Math.floor(a.ob/30*c);b||(a.Ra=a.pb);a.Db=0}function wc(a){return a.va+a.na+a.ta-a.a}function uc(a){a.Ga=0;a.bc=0;a.va=a.na=a.ta=a.a=a.I=0;vc(a);xc(a,1)}
|
||||
function xc(a,b,c){if(void 0!==b){.8>a.Ga/a.Ha&&(b=1);a.ua=b;b=a.Cb*a.ua;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.na);a.na=0;a.ca=ra();a.sa=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.ob*a.ua/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 Ac(a,b){var c=a.ta-=a.a;a.a=a.I=0;b&&(a.ta=0);return c}
|
||||
h.pd=function(){if(this.j.P){this.Cb>=this.lb&&yc(this,!0);this.Qa=0;this.gb=ra();if(this.sa){var a=this.gb-this.sa;a>this.Ub&&(this.ca+=a,this.ca>this.gb&&(this.ca=this.gb))}try{do{for(var b,c=this.j.hb?1:this.nb,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.qb(b)}catch(f){if("number"!=typeof f)throw f;}b=Ac(this,!0);this.Qa+=b;this.na+=b;pb(this,b);nb(this,b);this.Ua-=b;if(0>=this.Ua){this.Ua+=this.nb;15<=++this.Vb&&(this.ya(),this.Vb=0);break}}while(this.j.P)}catch(f){G(this);
|
||||
this.l&&this.l.stop(ra(),wc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.bc;this.sa=ra();c=this.Ub;this.Qa&&(c=Math.round(c*this.Qa/this.nb));c-=this.sa-this.gb;if(d=this.sa-this.ca)this.Ga=Math.round(this.na/(10*d))/100,864E5<=d&&(this.va=0,xc(this));if(0>c||this.Ga<this.Ha)-1E3>c&&(this.ca-=c),c=0;this.Cb+=this.Qa;this.sa+=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{xc(a);a.j.P=!0;a.j.Hb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.ca,wc(a));setTimeout(a.bc,0)}}h.qb=function(){return 0};function G(a){var b=!1;if(a.j.P){Ac(a);ob(a,a.na);a.na=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 Bc(a){this.Ea=+a.model||1170;this.Sb=a.addrReset||0;rc.call(this,a,6666667);this.decode=1120==this.Ea?Cc.bind(this):Dc.bind(this);Ec(this);this.ma=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 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.Sb];a.Fa=[0,0,0,0,0,0];a.qa=[0,0,0,0];a.v=0;a.fb=0;a.sd=[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,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.Z=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.cb=
|
||||
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.$b=[0,0,0,0,0,0,0,0];a.Zb=0;a.u=0;a.B=a.D=0;a.c=a.b=a.Ab=0;a.Ja=-1;lb(a)}function lb(a){a.X=0;a.Db=0;a.Eb=0;a.Ba=0;a.W=0;a.Gb=0;a.pb=255;a.ba=0;a.eb=0;a.Ra=262143;a.Ya=0;a.A=0;a.O=null;a.h&&Yb(a)}function Yb(a){a.ba?(a.R=65536,a.Rb=a.Ba&16?4186112:253952,a.M=a.nc,a.V=a.md,a.sb=a.he,Cb(a.h,a.Ba&16?22:18)):(a.R=0,a.Rb=57344,a.M=a.mc,a.V=a.Yb,a.sb=a.fc,Cb(a.h,16))}
|
||||
function Xb(a,b){b&=-3073;if(a.X!=b){b&57344&&!(a.X&57344)&&(a.Db=a.A>>16&65535,a.Eb=a.A&65535);a.X=b;a.eb=b>>5&3;a.fb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.ba!=c&&(a.ba=c,Yb(a))}}h.Ob=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.va,this.ua]);a.set(2,Pb(this.h));return a.data()};
|
||||
h.sd=function(){if(this.j.P){this.Db>=this.ob&&yc(this,!0);this.Va=0;this.jb=ra();if(this.sa){var a=this.jb-this.sa;a>this.Vb&&(this.ca+=a,this.ca>this.jb&&(this.ca=this.jb))}try{do{for(var b,c=this.j.ib?1:this.pb,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.rb(b)}catch(f){if("number"!=typeof f)throw f;}b=Ac(this,!0);this.Va+=b;this.na+=b;pb(this,b);nb(this,b);this.Ra-=b;if(0>=this.Ra){this.Ra+=this.pb;15<=++this.bc&&(this.ya(),this.bc=0);break}}while(this.j.P)}catch(f){G(this);
|
||||
this.l&&this.l.stop(ra(),wc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.cc;this.sa=ra();c=this.Vb;this.Va&&(c=Math.round(c*this.Va/this.pb));c-=this.sa-this.jb;if(d=this.sa-this.ca)this.Ga=Math.round(this.na/(10*d))/100,864E5<=d&&(this.va=0,xc(this));if(0>c||this.Ga<this.Ha)-1E3>c&&(this.ca-=c),c=0;this.Db+=this.Va;this.sa+=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{xc(a);a.j.P=!0;a.j.Ib=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.ca,wc(a));setTimeout(a.cc,0)}}h.rb=function(){return 0};function G(a){var b=!1;if(a.j.P){Ac(a);ob(a,a.na);a.na=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 Bc(a){this.La=+a.model||1170;this.Tb=a.addrReset||0;rc.call(this,a,6666667);1120==this.La?(this.decode=Cc.bind(this),this.za=this.lc):(this.decode=Dc.bind(this),this.za=this.kc);Ec(this);this.ma=0;this.O=null;this.j.complete=!1}A(Bc,rc);h=Bc.prototype;h.reset=function(){this.status("model "+this.La);this.j.P&&G(this);Ec(this);uc(this);this.j.error=!1;this.parent.reset.call(this)};
|
||||
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.Tb];a.Ea=[0,0,0,0,0,0];a.qa=[0,0,0,0];a.v=0;a.hb=0;a.vd=[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,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.Z=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.fb=
|
||||
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.$b=[0,0,0,0,0,0,0,0];a.Zb=0;a.u=0;a.B=a.D=0;a.c=a.b=a.Bb=0;a.Ja=-1;lb(a)}function lb(a){a.X=0;a.Eb=0;a.Fb=0;a.Ba=0;a.W=0;a.Hb=0;a.bb=255;a.ba=0;a.gb=0;a.Sa=262143;a.Za=0;a.A=0;a.O=null;a.h&&Yb(a)}function Yb(a){a.ba?(a.R=65536,a.Sb=a.Ba&16?4186112:253952,a.M=a.qc,a.V=a.pd,a.tb=a.ke,Cb(a.h,a.Ba&16?22:18)):(a.R=0,a.Sb=57344,a.M=a.pc,a.V=a.Yb,a.tb=a.gc,Cb(a.h,16))}
|
||||
function Xb(a,b){b&=-3073;if(a.X!=b){b&57344&&!(a.X&57344)&&(a.Eb=a.A>>16&65535,a.Fb=a.A&65535);a.X=b;a.gb=b>>5&3;a.hb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.ba!=c&&(a.ba=c,Yb(a))}}h.Pb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.va,this.ua]);a.set(2,Pb(this.h));return a.data()};
|
||||
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 Hc(a,b){var c=a.f[7];a.f[7]=c+b&65535;return c}function Q(a,b){a.f[7]=b&65535}function Vb(a,b){return{ud:a,La:b,next:null}}function Ic(a,b){var c=a.O;if(c==b)a.O=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}}function Tb(a,b){if(b!=a.O){var c=a.O;if(!c||c.La<=b.La)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.La<=b.La){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=1}function Jc(a){return a.u&64?(K(a,168,64,-5),!0):a.u&32?(K(a,4,32,-4),!0):a.u&16?(K(a,12,16,-6),!0):!1}
|
||||
function Zb(a){return a.C=a.C&63728|Fc(a)|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}function $b(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.C)&2048)for(var c=a.Fa.length;0<=--c;){var d=a.f[c];a.f[c]=a.Fa[c];a.Fa[c]=d}a.v=b>>14&3;c=a.C>>14&3;a.v!=c&&(a.qa[c]=a.f[6],a.f[6]=a.qa[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 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{wd:a,Ma: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.Ma<=b.Ma)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.Ma<=b.Ma){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=1}function Jc(a){return a.u&64?(K(a,168,64,-5),!0):a.u&32?(K(a,4,32,-4),!0):a.u&16?(K(a,12,16,-6),!0):!1}
|
||||
function Zb(a){return a.C=a.C&63728|Fc(a)|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}function $b(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.C)&2048)for(var c=a.Ea.length;0<=--c;){var d=a.f[c];a.f[c]=a.Ea[c];a.Ea[c]=d}a.v=b>>14&3;c=a.C>>14&3;a.v!=c&&(a.qa[c]=a.f[6],a.f[6]=a.qa[a.v]);a.C=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Kc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Lc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))}
|
||||
function Mc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Nc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ma){0>a.Ja?a.Ja=Zb(a):a.v||(b=4,a.W|=4,a.f[6]=4,d=-3);a.A=b|4143316992;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ja>>2&12288);Oc(a,a.Ja);Oc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Pc(a){var b=Qc(a),c=Qc(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);Q(a,b);$b(a,c);a.u&=-17}
|
||||
function Lb(a,b){var c=b>>13&31;31>c&&(b=a.Ba&32?a.cb[c]+(b&8190)&4194302:b&-3932161);return b}
|
||||
function Rc(a,b,c){var d,e,f;if(!(c&a.ba))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Ba&a.sd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Z[a.v][d]<<6)+(b&8191)&a.Ra;if(a.ma)return f;f&1&&!(c&1)&&(a.W|=64,K(a,4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.eb=
|
||||
a.v,a.fb=d;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.X&57344||(g|=a.X&4096|a.eb<<5|a.fb<<1,Xb(a,a.X&-61695|g&61694)),K(a,168,64,-1)),a.X&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.X|=4096,a.X&512&&(a.u|=64)));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.sb(c,b)}
|
||||
function Sc(a,b,c){!a.v&&c<=a.pb&&(b||4<c)&&(1145<=a.Ea&&c<=a.pb-32?(a.W|=4,a.f[6]=4,K(a,4,0,-3)):(a.W|=8,a.u|=32))}
|
||||
function Tc(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return K(a,4,0,-2),0;case 1:return 6==c&&d&4&&Sc(a,b,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Hc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Hc(a,2)),e=e+a.f[c]&
|
||||
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.Xa=function(a){if(!this.ba)return this.h.Xa(a);this.ma++;a=this.Yb(Rc(this,a,2));this.ma--;return a};h.ab=function(a,b){this.ba?(this.ma++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ma--):this.h.ab(a,b)};h.bb=function(a,b){this.ba?(this.ma++,this.fc(Rc(this,a,4),b),this.ma--):this.h.bb(a,b)};h.mc=function(a,b,c){return Tc(this,a,b,c)};
|
||||
h.nc=function(a,b,c){return Rc(this,Tc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,this.Ya=a)};h.md=function(a){return Mb(this.h,this.Ya=Rc(this,a,2))};h.fc=function(a,b){Ob(this.h,this.Ya=a,b&65535)};h.he=function(a,b){Ob(this.h,this.Ya=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.qa[a.C>>12&3];return c}
|
||||
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.qa[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 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.Ab=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}
|
||||
h.qb=function(a){this.j.complete=!0;var b=a?this.j.Hb?0:1:-1;this.j.Hb=!1;this.ta=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.Gb&224)>>5,e=this.O&&this.O.La>d?this.O:null;e&&(c=e.ud,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.ta-
|
||||
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 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 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 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 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 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 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 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 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 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 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 ee(){this.C&49152?(this.W|=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 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 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 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 xe(){this.w&&(this.w.fa=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 Me(a){Ne[a>>6&3].call(this,a)}function Oe(a){Pe[a>>6&3].call(this,a)}
|
||||
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,
|
||||
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)}],
|
||||
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,
|
||||
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)}],Pe=[function(a){S(this,a,0,xd);this.a-=this.c?9+(this.Ab&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.Ab&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 Ue=[function(a){Ve[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,Cd,function(a){We[a>>8&15].call(this,a)},function(a){Xe[a>>8&15].call(this,a)},me,be,Md,Id,Kd,ue,Y],Ve=[function(a){Ye[a>>4&15].call(this,a)},Yd,Vd,Nd,Od,Td,Pd,Rd,je,je,Ae,Ce,Ee,function(a){Ze[a>>6&3].call(this,a)},Y,Y],Ze=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Uc(this,a,0);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I=
|
||||
this.a;Vc(this,a,0,b);R(this,b);this.a=this.I-ne[this.c]},function(a){R(this,bd(this,a,Fc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ye=[function(a){$e[a&15].call(this,a)},Y,Y,Y,he,he,he,he,re,function(a){a&8?(this.C&49152||(this.C=this.C&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},Ge,Ie,ve,ve,ve,ve],$e=[ee,xe,function(){Pc(this);this.u|=this.C&16;this.a-=13},Xd,fe,qe,se,function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],We=[oe,oe,ce,ce,Dd,Dd,Ed,Ed,ye,ye,Y,Y,Y,Y,te,te],Xe=[Wd,Ud,Qd,Sd,
|
||||
Zd,$d,Fd,Gd,de,we,Ke,Me,Oe,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[Y,function(a){a=Uc(this,a,65536);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I=this.a;Vc(this,a,65536,b);R(this,b);this.a=this.I-ne[this.c]},Y];
|
||||
function bf(a){y.call(this,"ROM",a,bf,512);this.Y=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.ra,a,b),(a=ta(a,b))?(c.c=a.K,c.Y=a.Y):c.l=null);cf(c)})}}A(bf);h=bf.prototype;
|
||||
h.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;cf(this)};h.la=function(){this.Y&&(this.F&&this.F.a(this.id,this.i,this.b,this.Y),delete this.Y);return!0};h.ka=function(){return!0};
|
||||
function cf(a){if(!Va(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[bf.prototype.$c,bf.prototype.Wd,null,null,null,a.b>>1],c);if(cb(a.h,a,b)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c<a.c.length;c++)a.h.ab(b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.g?b.push(a.g):
|
||||
null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Eb(d.h,d.i,d.b);Db(d.h,e,d.b,f)}a.m||delete a.c}}}F(a)}}h.$c=function(a){return this.c[a-this.i]};h.Wd=function(){};Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new bf(d);D(d,c)}});
|
||||
function df(a){y.call(this,"RAM",a,df);this.Y=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.ra,a,b),(a=ta(a,b))?(c.c=a.K,c.Y=a.Y,null==c.ha&&(c.ha=a.ha),null==c.ga&&(c.ga=a.ga)):c.b=null);ef(c)})}}A(df);
|
||||
df.prototype.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;ef(this)};df.prototype.la=function(){this.Y&&(this.F&&this.F.a(this.id,this.l,this.i,this.Y),delete this.Y);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)}}
|
||||
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.Kb(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 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.ab(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.ab(c+
|
||||
g,b[g]);g=!0}g&&null!=d&&(a=a.a,a.Sb=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.aa=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.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,16777216);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.aa(null,a,b))}this.v=this.A=null;this.exports={connect:this.Pb,receiveData:this.ob}}A(Z);var hf="buffer";h=Z.prototype;
|
||||
h.aa=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.ob(b);return!0},c.onkeypress=function(a){a=a||window.event;d.ob(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.ob(a.getData("Text"))},
|
||||
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.ca=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.ca))});this.B=Vb(52,4);this.ba=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.Pb=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.ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.la=function(a,b){if(!b)if(this.Pb(),!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(){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.ob=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.i.push(b)}else this.i=this.i.concat(a);Ub(this.a,this.M,1E3/Math.round(this.D/10));return!0};
|
||||
h.Uc=function(){return this.b&65534};h.Qd=function(a){this.b=this.b&-112|a&111};h.Tc=function(){this.b&=-129;0<this.i.length&&Ub(this.a,this.M,1E3/Math.round(this.D/10));return this.w};h.Pd=function(){};h.od=function(){return this.c};h.je=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.nd=function(){return 0};
|
||||
h.ie=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.ba,1E3/Math.round(this.R/10))}};var lf={},jf=(lf[65392]=[null,null,Z.prototype.Uc,Z.prototype.Qd,"RCSR"],lf[65394]=[null,null,Z.prototype.Tc,Z.prototype.Pd,"RBUF"],lf[65396]=[null,null,Z.prototype.od,Z.prototype.je,"XCSR"],lf[65398]=[null,null,Z.prototype.nd,Z.prototype.ie,"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 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.aa=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&&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.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&&
|
||||
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 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 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.ra,e,f),(e=ta(e,f))&&yf(a,b,c,d,e.K,e.ha,e.ga));
|
||||
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 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 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.Nc=function(){return this.b&65534};h.Jd=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.Mc=function(){this.b&=-129;this.b|=2048;return this.A};h.Id=function(){};
|
||||
var zf={},rf=(zf[65384]=[null,null,ac.prototype.Nc,ac.prototype.Jd,"PRS"],zf[65386]=[null,null,ac.prototype.Mc,ac.prototype.Id,"PRB"],zf);function Af(a,b,c){y.call(this,"Disk",{id:a.ra+".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.xb=b.xb;Cf(this,c,b.U,b.$,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 Cf(a,b,c,d,e,f){a.mode=b;a.U=c;a.$=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.$);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 Ef(a,b,c,d,e){var f=c;if(a.h)return!0;a.xa=b;a.Ca=c;a.ac=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.$=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.$),T=0;T<w.length;T++)for(var va=w[T]=Array(a.S),wa=0;wa<va.length;wa++){for(var lc=Df(null,d,T,wa+1,a.ia,0),fg=lc.data,mc=0;mc<c;mc++,f+=4)var gg=fg[mc]=b.getInt32(f,
|
||||
!0),e=e+gg&-1;lc.da=c;va[wa]=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.xb?"":e)+"&format=json"));return!!r(f,
|
||||
null,!0,function(b,c,d){Ff(a,b,c,d)})}
|
||||
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.ra,b,c);try{if(0<q(a.ac,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.xa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)t(k[0]);else{a.U=k.length;a.$=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.$;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,va=w.length;va<T;va++)w[va]=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.xa)}catch(wa){t("Disk image error ("+b+"): "+wa.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.me=b;a.ne=c;a.oa=a.da=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.hc&&b<f.$)for(k=g[b]=Array(f.ic),g=0;g<k.length;g++)k[g]=Df(null,a,b,g+1,f.Qb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.hc&&9==f.Lb&&(d=k[g]=Df(null,a,b,f.Lb,f.Qb,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}
|
||||
function Lb(a,b){var c=b>>13&31;31>c&&(b=a.Ba&32?a.fb[c]+(b&8190)&4194302:b&-3932161);return b}
|
||||
function Rc(a,b,c){var d,e,f;if(!(c&a.ba))return f=b&65535,57344<=f&&(f|=a.Sb),f;d=b>>13;a.Ba&a.vd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Z[a.v][d]<<6)+(b&8191)&a.Sa;if(a.ma)return f;f&1&&!(c&1)&&(a.W|=64,K(a,4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Sa)||a.v)a.gb=
|
||||
a.v,a.hb=d;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.X&57344||(g|=a.X&4096|a.gb<<5|a.hb<<1,Xb(a,a.X&-61695|g&61694)),K(a,168,64,-1)),a.X&61440||!(f<(4191360&a.Sa)||f>(4194239&a.Sa))||(a.X|=4096,a.X&512&&(a.u|=64)));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;a.za(20,-2,c);a.tb(c,b)}
|
||||
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&&a.za(d,0,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];6==c&&a.za(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;6==c&&a.za(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Hc(a,2)),e=e+a.f[c]&65535,6==c&&a.za(d,0,
|
||||
e),a.a-=6,e|g;case 7:return e=a.V(Hc(a,2)),e=e+a.f[c]&65535,e=a.V(e|a.R),a.a-=10,e|g}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.lc=function(a,b,c){!this.v&&0>=b&&c<=this.bb&&(this.u|=32)};h.kc=function(a,b,c){!this.v&&a&4&&!(20==a&&4>=c)&&c<=this.bb&&(c<=this.bb-32?(this.W|=4,this.f[6]=4,K(this,4,0,-3)):(this.W|=8,this.u|=32))};h.Ya=function(a){if(!this.ba)return this.h.Ya(a);this.ma++;a=this.Yb(Rc(this,a,2));this.ma--;return a};
|
||||
h.cb=function(a,b){this.ba?(this.ma++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ma--):this.h.cb(a,b)};h.eb=function(a,b){this.ba?(this.ma++,this.gc(Rc(this,a,4),b),this.ma--):this.h.eb(a,b)};h.pc=function(a,b,c){return Sc(this,a,b,c)};h.qc=function(a,b,c){return Rc(this,Sc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,this.Za=a)};h.pd=function(a){return Mb(this.h,this.Za=Rc(this,a,2))};h.gc=function(a,b){Ob(this.h,this.Za=a,b&65535)};h.ke=function(a,b){Ob(this.h,this.Za=Rc(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.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.qa[a.C>>12&3];return c}function Uc(a,b,c,d){a.A=a.A&65535|1441792;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.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.qa[a.C>>12&3]=d}
|
||||
function Vc(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 Wc(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 Xc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Sc(a,b,c,8)}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.Bb=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 $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 V(a,b,c){c&&(Q(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
|
||||
h.rb=function(a){this.j.complete=!0;var b=a?this.j.Ib?0:1:-1;this.j.Ib=!1;this.ta=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.Hb&224)>>5,e=this.O&&this.O.Ma>d?this.O:null;e&&(c=e.wd,d=e.Ma);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.ta-
|
||||
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 bd(a,b){var c=b+a;Lc(this,c,a,b);return c&65535}function cd(a,b){var c=b+a;Lc(this,c<<8,a<<8,b<<8);return c&255}function dd(a,b){a=b<<1;Mc(this,a);return a&65535}function ed(a,b){a=b<<1;Mc(this,a<<8);return a&255}function fd(a,b){a=b&32768|b>>1|b<<16;Mc(this,a);return a&65535}function gd(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;Kc(this,a);return a&65535}function md(a,b){a=~b|256;Kc(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 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;Kc(this,a,a&b&32768);return a&65535}function sd(a,b){a=-b;Kc(this,a<<8,(a&b&128)<<8);return a&255}function td(a,b){a=b<<1|this.m>>16&1;Mc(this,a);return a&65535}function ud(a,b){a=b<<1|this.m>>16&1;Mc(this,a<<8);return a&255}function vd(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;Mc(this,a<<8);return a&255}function xd(a,b){var c=b-a;Nc(this,c,a,b);return c&65535}function yd(a,b){var c=b-a;Nc(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.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=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 Gd(a){U(this,a,Wc(this,a),hd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Hd(a){S(this,a,Vc(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){U(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){S(this,a,Vc(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){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.D&&6<=this.b?1:0):(this.B?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.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Md(a){V(this,a,this.i&65535?0:4)}function Nd(a){V(this,a,!Fc(this)==!(this.g&32768))}function Od(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)||!Fc(this)!=!(this.g&32768))}function Rd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Sd(a){V(this,a,!Fc(this)!=!(this.g&32768))}function Td(a){V(this,a,Fc(this))}function Ud(a){V(this,a,!!(this.i&65535))}function Vd(a){V(this,a,!Fc(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 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;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 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);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 de(){this.C&49152?(this.W|=128,K(this,4,0,-7)):(this.w&&1120==this.La&&this.w.setData(this.f[0],!0),this.F?this.F.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.I=this.a;Q(this,Xc(this,a));this.a=this.I-fe[this.c]}var he=[0,14,14,17,14,18,16,20];function ie(a){this.I=this.a;var b=Xc(this,a);a=a>>6&7;Oc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.I-he[this.c]}var je=[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.I=this.a;R(this,ad(this,a,b));this.a=this.I-je[(this.B?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.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var me=[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.C&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=Qc(this);a&=7;7==a?Q(this,b):(Q(this,this.f[a]),this.f[a]=b);this.a-=9}}
|
||||
function re(){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 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.D&&6<=this.b?1:0):(this.B?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 we(){this.w&&(this.w.fa=this.f[7],this.w.setData(this.f[0],!0));this.u|=4;Hc(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 Cc(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 Le(a){Me[a>>6&3].call(this,a)}function Ne(a){Oe[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){Kc(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,
|
||||
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);Kc(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)}],
|
||||
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){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);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.Bb&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.Bb&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 Dc(a){Te[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);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.I-me[this.c]},function(a){R(this,ad(this,a,Fc(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.C&49152||(this.C=this.C&-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(){Pc(this);this.u|=this.C&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,
|
||||
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);Oc(this,a);R(this,a);this.a-=11},function(a){var b=Qc(this);this.I=this.a;Uc(this,a,65536,b);R(this,b);this.a=this.I-me[this.c]},Y];
|
||||
function af(a){y.call(this,"ROM",a,af,512);this.Y=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.ra,a,b),(a=ta(a,b))?(c.c=a.K,c.Y=a.Y):c.l=null);bf(c)})}}A(af);h=af.prototype;
|
||||
h.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;bf(this)};h.la=function(){this.Y&&(this.F&&this.F.a(this.id,this.i,this.b,this.Y),delete this.Y);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.cd,af.prototype.Zd,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.cb(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.cd=function(a){return this.c[a-this.i]};h.Zd=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)}});
|
||||
function cf(a){y.call(this,"RAM",a,cf);this.Y=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.ra,a,b),(a=ta(a,b))?(c.c=a.K,c.Y=a.Y,null==c.ha&&(c.ha=a.ha),null==c.ga&&(c.ga=a.ga)):c.b=null);df(c)})}}A(cf);
|
||||
cf.prototype.ja=function(a,b,c,d){this.h=b;this.a=c;this.F=d;df(this)};cf.prototype.la=function(){this.Y&&(this.F&&this.F.a(this.id,this.l,this.i,this.Y),delete this.Y);return!0};cf.prototype.ka=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.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.Lb(d,g,e.Ka+d)}c-=a.b;b++;d=0}this.c&&ef(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.cb(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.cb(c+
|
||||
g,b[g]);g=!0}g&&null!=d&&(a=a.a,a.Tb=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 cf(d);D(d,c)}});function ff(a){y.call(this,"Keyboard",a,ff,65536);F(this)}A(ff);ff.prototype.aa=function(){return!1};ff.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 ff(d);D(d,c)}});
|
||||
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,16777216);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.aa(null,a,b))}this.v=this.A=null;this.exports={connect:this.Qb,receiveData:this.qb}}A(Z);var gf="buffer";h=Z.prototype;
|
||||
h.aa=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.qb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.qb(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.qb(a.getData("Text"))},
|
||||
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.ca=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.ca))});this.B=Vb(52,4);this.ba=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.B)});cb(b,this,hf);eb(b,this.reset.bind(this));F(this)};
|
||||
h.Qb=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.Fa)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.ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.la=function(a,b){if(!b)if(this.Qb(),!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(){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.qb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.i.push(b)}else this.i=this.i.concat(a);Ub(this.a,this.M,1E3/Math.round(this.D/10));return!0};
|
||||
h.Xc=function(){return this.b&65534};h.Td=function(a){this.b=this.b&-112|a&111};h.Wc=function(){this.b&=-129;0<this.i.length&&Ub(this.a,this.M,1E3/Math.round(this.D/10));return this.w};h.Sd=function(){};h.rd=function(){return this.c};h.me=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.qd=function(){return 0};
|
||||
h.le=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.ba,1E3/Math.round(this.R/10))}};var kf={},hf=(kf[65392]=[null,null,Z.prototype.Xc,Z.prototype.Td,"RCSR"],kf[65394]=[null,null,Z.prototype.Wc,Z.prototype.Sd,"RBUF"],kf[65396]=[null,null,Z.prototype.rd,Z.prototype.me,"XCSR"],kf[65398]=[null,null,Z.prototype.qd,Z.prototype.le,"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)}});
|
||||
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=lf;this.g=mf;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 lf="",mf=0;h=ac.prototype;
|
||||
h.aa=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=d.o.listTapes;a&&nf(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;nf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1};
|
||||
h.ja=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;this.J=of(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,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.D&&
|
||||
rf(this,"Local Tape","?");rf(this,"Remote Tape","??");sf(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 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}
|
||||
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.Da?a.G("PC11 busy"):(e&&a.m++,wf(a,b,c,d,f)?g++:a.j.Da=!0);g&&xf(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.ra,e,f),(e=ta(e,f))&&xf(a,b,c,d,e.K,e.ha,e.ga));
|
||||
a.j.Da=!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)}}
|
||||
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.B=b;a.i=c;a.g=d;a.K=e;a.ha=f;a.ga=g;2==d?a.J&&ef(a.J,e,f,g)?a.status("tape loaded: "+b):(a.B="",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 vf(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=lf,a.g=mf,uf(a))}h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};h.Qc=function(){return this.b&65534};h.Md=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.Pc=function(){this.b&=-129;this.b|=2048;return this.A};h.Ld=function(){};
|
||||
var yf={},qf=(yf[65384]=[null,null,ac.prototype.Qc,ac.prototype.Md,"PRS"],yf[65386]=[null,null,ac.prototype.Pc,ac.prototype.Ld,"PRB"],yf);function zf(a,b,c){y.call(this,"Disk",{id:a.ra+".disk"+m(++Af,4)},zf,4194304);this.controller=a;this.l=a.l;this.F=a.F;this.g=b;this.xa=b.name;this.yb=b.yb;Bf(this,c,b.U,b.$,b.S,b.ia);F(this)}var Af=0;A(zf);h=zf.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.$=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.$);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.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.xa=b;a.Ca=c;a.ac=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.$=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.$),T=0;T<w.length;T++)for(var va=w[T]=Array(a.S),wa=0;wa<va.length;wa++){for(var kc=Cf(null,d,T,wa+1,a.ia,0),eg=kc.data,lc=0;lc<c;lc++,f+=4)var fg=eg[lc]=b.getInt32(f,
|
||||
!0),e=e+fg&-1;kc.da=c;va[wa]=kc}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.yb?"":e)+"&format=json"));return!!r(f,
|
||||
null,!0,function(b,c,d){Ef(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.xa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.ra,b,c);try{if(0<q(a.ac,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.xa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)t(k[0]);else{a.U=k.length;a.$=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.$;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,va=w.length;va<T;va++)w[va]=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=
|
||||
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(wa){t("Disk image error ("+b+"): "+wa.message)}}a.h&&(a.h.call(a.i,a.g,e,a.xa,a.Ca),a.h=null)}function Cf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.pe=b;a.qe=c;a.oa=a.da=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.ic&&b<f.$)for(k=g[b]=Array(f.jc),g=0;g<k.length;g++)k[g]=Cf(null,a,b,g+1,f.Rb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.ic&&9==f.Mb&&(d=k[g]=Cf(null,a,b,f.Mb,f.Rb,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.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.da?f<a.oa?(a.da+=a.oa-f,a.oa=f):f>=a.oa+a.da&&(a.da+=f-(a.oa+a.da)+1):(a.oa=f,a.da=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function Hf(a,b){var c=a.$*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.$,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.da){for(var k=[],l=0,n=g.oa,p=g.oa+g.da;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.oa,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?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 ("+
|
||||
function Gf(a,b){var c=a.$*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.Ca,this.b,this.U,this.$,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.da){for(var k=[],l=0,n=g.oa,p=g.oa+g.da;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.oa,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 ("+
|
||||
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.oa=e;for(k.da=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=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 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,8388608);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.aa=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&&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.ea){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.ac.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
|
||||
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")};
|
||||
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,8388608);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.aa=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]=
|
||||
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.ea){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.ac.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}),
|
||||
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.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.la=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Nb){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 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 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 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.wb?a.G("RL11 busy"):(k.wb=!0,e&&(k.vb=!0,a.s++),k.kb=!!f,Ef(new Af(a,k,"preload"),c,d,f,a.lc)&&g++));return g}
|
||||
h.lc=function(a,b,c,d,e){var f;a.wb=!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.$)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.ea=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.zb),a.vb||e),this.l&&zc(this.l)):a.kb=!1;a.vb&&(a.vb=!1,--this.s||F(this));Kf(this,a.zb)};
|
||||
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 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.kb?"?":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.ea||!1===c)d.xa="",d.Ca="",d.ea=null,d.kb=!1,c||(a.G("Drive RL"+b+" unloaded",c),Kf(a,b))}
|
||||
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.zb=b;d.wb=d.kb=!1;d.name=c.za;d.U=512;d.$=2;d.S=40;d.ia=256;d.xb=!0;d.le=0;d.ke=0;d.Lb=1;d.ic=d.S;d.Qb=d.ia;d.oe=0;d.pe=null;d.ea||(d.Ca="");d.status=29|(512==d.U?128:0)}return!0}
|
||||
h.jc=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0};
|
||||
h.Ac=function(a,b,c,d,e,f,g){var k=0,l=a.ea,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ea.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ea.read(n,p++))||0>(w=a.ea.read(n,p++))){k=5120;break}this.h.bb(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.$&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};
|
||||
h.yd=function(a,b,c,d,e,f,g){var k=0,l=a.ea,n=null,p;l||(k=5120,e=0);for(;e--;){var u=this.h.Xa(f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.ea.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ea.write(n,p++,u&255)||!a.ea.write(n,p++,u>>8)){k=5120;break}if(p>=l.ia&&(n=null,++d>=l.S&&(d=0,++c>=l.$&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Xc=function(){return this.L&65535};
|
||||
h.Td=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.Ac;case 10:b||(b=this.yd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w&
|
||||
63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.jc.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.D))}};h.Vc=function(){return this.v};h.Rd=function(a){this.v=a&65534};h.Yc=function(){return this.c};h.Ud=function(a){this.c=a};h.Zc=function(){return this.m};h.Vd=function(a){this.m=a};h.Wc=function(){return this.w};h.Sd=function(a){this.w=a&63};
|
||||
var Sf={},Nf=(Sf[63744]=[null,null,N.prototype.Xc,N.prototype.Td,"RLCS"],Sf[63746]=[null,null,N.prototype.Vc,N.prototype.Rd,"RLBA"],Sf[63748]=[null,null,N.prototype.Yc,N.prototype.Ud,"RLDA"],Sf[63750]=[null,null,N.prototype.Zc,N.prototype.Vd,"RLMP"],Sf[63752]=[null,null,N.prototype.Wc,N.prototype.Sd,"RLBE"],Sf);
|
||||
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.ra+".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.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"),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.$a)}else t("Unable to find CPU component")}A(Tf);var Vf=0;
|
||||
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 $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.$a=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),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.Mb,b):this.Mb(b)}};
|
||||
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.Tb)for(a=b.Tb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Mb=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 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 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&&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)};
|
||||
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};
|
||||
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}Lf(this);this.D=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.la=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Ob){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.ka=function(a){return a?this.save():!0};h.reset=function(){Lf(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}
|
||||
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 Qf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Pf(a,b,!0),k.xb?a.G("RL11 busy"):(k.xb=!0,e&&(k.wb=!0,a.s++),k.lb=!!f,Df(new zf(a,k,"preload"),c,d,f,a.oc)&&g++));return g}
|
||||
h.oc=function(a,b,c,d,e){var f;a.xb=!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.$)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.ea=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.zb),a.wb||e),this.l&&zc(this.l)):a.lb=!1;a.wb&&(a.wb=!1,--this.s||F(this));Jf(this,a.zb)};
|
||||
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 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.lb?"?":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 Pf(a,b,c){var d=a.b[b];if(d.ea||!1===c)d.xa="",d.Ca="",d.ea=null,d.lb=!1,c||(a.G("Drive RL"+b+" unloaded",c),Jf(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.zb=b;d.xb=d.lb=!1;d.name=c.Fa;d.U=512;d.$=2;d.S=40;d.ia=256;d.yb=!0;d.oe=0;d.ne=0;d.Mb=1;d.jc=d.S;d.Rb=d.ia;d.re=0;d.se=null;d.ea||(d.Ca="");d.status=29|(512==d.U?128:0)}return!0}
|
||||
h.mc=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.Dc=function(a,b,c,d,e,f,g){var k=0,l=a.ea,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ea.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ea.read(n,p++))||0>(w=a.ea.read(n,p++))){k=5120;break}this.h.eb(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.$&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};
|
||||
h.Bd=function(a,b,c,d,e,f,g){var k=0,l=a.ea,n=null,p;l||(k=5120,e=0);for(;e--;){var u=this.h.Ya(f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.ea.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ea.write(n,p++,u&255)||!a.ea.write(n,p++,u>>8)){k=5120;break}if(p>=l.ia&&(n=null,++d>=l.S&&(d=0,++c>=l.$&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.$c=function(){return this.L&65535};
|
||||
h.Wd=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.Dc;case 10:b||(b=this.Bd),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.mc.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.D))}};h.Yc=function(){return this.v};h.Ud=function(a){this.v=a&65534};h.ad=function(){return this.c};h.Xd=function(a){this.c=a};h.bd=function(){return this.m};h.Yd=function(a){this.m=a};h.Zc=function(){return this.w};h.Vd=function(a){this.w=a&63};
|
||||
var Rf={},Mf=(Rf[63744]=[null,null,N.prototype.$c,N.prototype.Wd,"RLCS"],Rf[63746]=[null,null,N.prototype.Yc,N.prototype.Ud,"RLBA"],Rf[63748]=[null,null,N.prototype.ad,N.prototype.Xd,"RLDA"],Rf[63750]=[null,null,N.prototype.bd,N.prototype.Yd,"RLMP"],Rf[63752]=[null,null,N.prototype.Zc,N.prototype.Vd,"RLBE"],Rf);
|
||||
function Sf(a,b,c){y.call(this,"Computer",a,Sf,67108864);this.j.N=!1;Tf(this,b);this.A=tc(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=tc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Vf(this);if(this.a=Ta("CPU",this.id)){this.F=Ta("Debugger",this.id);this.h=new vb({id:this.ra+".bus",busWidth:this.M},this.a,this.F);var d,e=B(this.id);if((this.w=Ta("Panel",this.id))&&this.w.Xa)for(b=0;b<e.length;b++)d=e[b],d.G=this.w.G,d.T=this.w.T,
|
||||
d.Xa=this.w.Xa;this.T("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.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=Uf),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.ab)}else t("Unable to find CPU component")}A(Sf);var Uf=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 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 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 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;
|
||||
h.ab=function(a){void 0===a&&(a=this.b||(this.s?1:Uf));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>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"==
|
||||
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.Nb,b):this.Nb(b)}};
|
||||
function dg(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=Uf,window&&window.location.reload()):a.D=!0,b.la(null),e=!1)}if(!d&&b.Ub)for(a=b.Ub.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Nb=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.ya(),this.a.Wa());this.D&&(ag(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 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.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.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.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.ya=function(a){if(this.a){var b=this.a,c=a||0,d=b.o.speed;d&&(0>=c||30<=(b.yb+=c))&&(d.textContent=b.j.P?b.Ga.toFixed(2)+"Mhz":"Stopped",b.yb=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.Ya:b.fa);rb(b,b.m);a=b.a;a=a.ba?a.Ba&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.Ab+=c))&&(d.textContent=b.j.P?b.Ga.toFixed(2)+"Mhz":"Stopped",b.Ab=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.Za:b.fa);rb(b,b.m);a=b.a;a=a.ba?a.Ba&16?1:2:4;tb(b,"B22",a&1);tb(b,"B18",a&2);tb(b,"B16",
|
||||
a&4)}};
|
||||
h.aa=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.$a))},!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.Nb=!0),d.$a(Vf),d.Nb=!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=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 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 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 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 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.$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.$a(-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.td)}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){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 cg(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function dg(a){var b=!0;if(ya()){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:ya()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var lg=0;
|
||||
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 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?og(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
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);og(a,b,c)}})}else c(a,null)}
|
||||
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?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)?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
|
||||
h.aa=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.ab))},!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.B?window&&window.location.reload():(a||(d.Ob=!0),d.ab(Uf),d.Ob=!1)}else d.reset(),d.a&&d.a.Wa()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);else return this.o[b]=
|
||||
c,c.onclick=function(){var a=Vf(d,!0);if(a){var b=!!(d.b&&!d.m||d.B),c=gg(d,b);b?hg(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 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 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 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 zc(a){if(a.Xa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Xa.focus();window&&window.scrollTo(b,c)}}Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=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.ab)}});
|
||||
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.ab(-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.F=a.F;bg(this,a.xd)}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}
|
||||
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,
|
||||
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(ya()){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:ya()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var kg=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,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)}
|
||||
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]*/,
|
||||
"");a=a.replace(d[0],g);ng(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||
|
||||
(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: "+
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue